[
  {
    "path": ".all-contributorsrc",
    "content": "{\n  \"projectName\": \"qwik\",\n  \"projectOwner\": \"QwikDev\",\n  \"repoType\": \"github\",\n  \"repoHost\": \"https://github.com\",\n  \"files\": [\"README.md\"],\n  \"imageSize\": 100,\n  \"commit\": true,\n  \"commitConvention\": \"angular\",\n  \"contributors\": [],\n  \"contributorsPerLine\": 7\n}\n"
  },
  {
    "path": ".changeset/breezy-items-relax.md",
    "content": "---\n'@builder.io/qwik-city': patch\n---\n\nFIX: When a form POST is done, keys like \"name.1\" mean it's an array. However, later keys could be strings like \"name.value\". Now, we check if all the keys are numbers, otherwise we make an object instead of an array. This allows for more correct form data handling.\n"
  },
  {
    "path": ".changeset/changelog-github-custom.cjs",
    "content": "'use strict';\nvar __assign =\n  (this && this.__assign) ||\n  function () {\n    __assign =\n      Object.assign ||\n      function (t) {\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\n          s = arguments[i];\n          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n        }\n        return t;\n      };\n    return __assign.apply(this, arguments);\n  };\nvar __awaiter =\n  (this && this.__awaiter) ||\n  function (thisArg, _arguments, P, generator) {\n    function adopt(value) {\n      return value instanceof P\n        ? value\n        : new P(function (resolve) {\n            resolve(value);\n          });\n    }\n    return new (P || (P = Promise))(function (resolve, reject) {\n      function fulfilled(value) {\n        try {\n          step(generator.next(value));\n        } catch (e) {\n          reject(e);\n        }\n      }\n      function rejected(value) {\n        try {\n          step(generator['throw'](value));\n        } catch (e) {\n          reject(e);\n        }\n      }\n      function step(result) {\n        result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n      }\n      step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n  };\nvar __generator =\n  (this && this.__generator) ||\n  function (thisArg, body) {\n    var _ = {\n        label: 0,\n        sent: function () {\n          if (t[0] & 1) throw t[1];\n          return t[1];\n        },\n        trys: [],\n        ops: [],\n      },\n      f,\n      y,\n      t,\n      g;\n    return (\n      (g = { next: verb(0), throw: verb(1), return: verb(2) }),\n      typeof Symbol === 'function' &&\n        (g[Symbol.iterator] = function () {\n          return this;\n        }),\n      g\n    );\n    function verb(n) {\n      return function (v) {\n        return step([n, v]);\n      };\n    }\n    function step(op) {\n      if (f) throw new TypeError('Generator is already executing.');\n      while ((g && ((g = 0), op[0] && (_ = 0)), _))\n        try {\n          if (\n            ((f = 1),\n            y &&\n              (t =\n                op[0] & 2\n                  ? y['return']\n                  : op[0]\n                    ? y['throw'] || ((t = y['return']) && t.call(y), 0)\n                    : y.next) &&\n              !(t = t.call(y, op[1])).done)\n          )\n            return t;\n          if (((y = 0), t)) op = [op[0] & 2, t.value];\n          switch (op[0]) {\n            case 0:\n            case 1:\n              t = op;\n              break;\n            case 4:\n              _.label++;\n              return { value: op[1], done: false };\n            case 5:\n              _.label++;\n              y = op[1];\n              op = [0];\n              continue;\n            case 7:\n              op = _.ops.pop();\n              _.trys.pop();\n              continue;\n            default:\n              if (\n                !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&\n                (op[0] === 6 || op[0] === 2)\n              ) {\n                _ = 0;\n                continue;\n              }\n              if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n                _.label = op[1];\n                break;\n              }\n              if (op[0] === 6 && _.label < t[1]) {\n                _.label = t[1];\n                t = op;\n                break;\n              }\n              if (t && _.label < t[2]) {\n                _.label = t[2];\n                _.ops.push(op);\n                break;\n              }\n              if (t[2]) _.ops.pop();\n              _.trys.pop();\n              continue;\n          }\n          op = body.call(thisArg, _);\n        } catch (e) {\n          op = [6, e];\n          y = 0;\n        } finally {\n          f = t = 0;\n        }\n      if (op[0] & 5) throw op[1];\n      return { value: op[0] ? op[1] : void 0, done: true };\n    }\n  };\nvar __spreadArray =\n  (this && this.__spreadArray) ||\n  function (to, from, pack) {\n    if (pack || arguments.length === 2)\n      for (var i = 0, l = from.length, ar; i < l; i++) {\n        if (ar || !(i in from)) {\n          if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n          ar[i] = from[i];\n        }\n      }\n    return to.concat(ar || Array.prototype.slice.call(from));\n  };\nObject.defineProperty(exports, '__esModule', { value: true });\n// @ts-ignore\nvar get_github_info_1 = require('@changesets/get-github-info');\nvar dotenv_1 = require('dotenv');\n(0, dotenv_1.config)();\nvar changelogFunctions = {\n  getDependencyReleaseLine: function (changesets, dependenciesUpdated, options) {\n    return __awaiter(void 0, void 0, void 0, function () {\n      var changesetLink, _a, updatedDepenenciesList;\n      return __generator(this, function (_b) {\n        switch (_b.label) {\n          case 0:\n            if (!options.repo) {\n              throw new Error(\n                'Please provide a repo to this changelog generator like this:\\n\"changelog\": [\"@changesets/changelog-github\", { \"repo\": \"org/repo\" }]'\n              );\n            }\n            if (dependenciesUpdated.length === 0) return [2 /*return*/, ''];\n            _a = '- Updated dependencies ['.concat;\n            return [\n              4 /*yield*/,\n              Promise.all(\n                changesets.map(function (cs) {\n                  return __awaiter(void 0, void 0, void 0, function () {\n                    var links;\n                    return __generator(this, function (_a) {\n                      switch (_a.label) {\n                        case 0:\n                          if (!cs.commit) return [3 /*break*/, 2];\n                          return [\n                            4 /*yield*/,\n                            (0, get_github_info_1.getInfo)({\n                              repo: options.repo,\n                              commit: cs.commit,\n                            }),\n                          ];\n                        case 1:\n                          links = _a.sent().links;\n                          return [2 /*return*/, links.commit];\n                        case 2:\n                          return [2 /*return*/];\n                      }\n                    });\n                  });\n                })\n              ),\n            ];\n          case 1:\n            changesetLink = _a.apply('- Updated dependencies [', [\n              _b\n                .sent()\n                .filter(function (_) {\n                  return _;\n                })\n                .join(', '),\n              ']:',\n            ]);\n            updatedDepenenciesList = dependenciesUpdated.map(function (dependency) {\n              return '  - '.concat(dependency.name, '@').concat(dependency.newVersion);\n            });\n            return [\n              2 /*return*/,\n              __spreadArray([changesetLink], updatedDepenenciesList, true).join('\\n'),\n            ];\n        }\n      });\n    });\n  },\n  getReleaseLine: function (changeset, type, options) {\n    return __awaiter(void 0, void 0, void 0, function () {\n      var prFromSummary,\n        commitFromSummary,\n        usersFromSummary,\n        replacedChangelog,\n        linkifyIssueHints,\n        _a,\n        firstLine,\n        futureLines,\n        links,\n        users,\n        suffix,\n        emojiFirstline;\n      return __generator(this, function (_b) {\n        switch (_b.label) {\n          case 0:\n            if (!options || !options.repo) {\n              throw new Error(\n                'Please provide a repo to this changelog generator like this:\\n\"changelog\": [\"@changesets/changelog-github\", { \"repo\": \"org/repo\" }]'\n              );\n            }\n            usersFromSummary = [];\n            replacedChangelog = changeset.summary\n              .replace(/^\\s*(?:pr|pull|pull\\s+request):\\s*#?(\\d+)/im, function (_, pr) {\n                var num = Number(pr);\n                if (!isNaN(num)) prFromSummary = num;\n                return '';\n              })\n              .replace(/^\\s*commit:\\s*([^\\s]+)/im, function (_, commit) {\n                commitFromSummary = commit;\n                return '';\n              })\n              .replace(/^\\s*(?:author|user):\\s*@?([^\\s]+)/gim, function (_, user) {\n                usersFromSummary.push(user);\n                return '';\n              })\n              .trim();\n            linkifyIssueHints = function (line) {\n              return line.replace(\n                /(?<=\\( ?(?:fix|fixes|see) )(#\\d+)(?= ?\\))/g,\n                function (issueHash) {\n                  return '['\n                    .concat(issueHash, '](https://github.com/')\n                    .concat(options.repo, '/issues/')\n                    .concat(issueHash.substring(1), ')');\n                }\n              );\n            };\n            (_a = replacedChangelog.split('\\n').map(function (l) {\n              return linkifyIssueHints(l.trimEnd());\n            })),\n              (firstLine = _a[0]),\n              (futureLines = _a.slice(1));\n            return [\n              4 /*yield*/,\n              (function () {\n                return __awaiter(void 0, void 0, void 0, function () {\n                  var links_1, shortCommitId, commitToFetchFrom, links_2;\n                  return __generator(this, function (_a) {\n                    switch (_a.label) {\n                      case 0:\n                        if (!(prFromSummary !== undefined)) return [3 /*break*/, 2];\n                        return [\n                          4 /*yield*/,\n                          (0, get_github_info_1.getInfoFromPullRequest)({\n                            repo: options.repo,\n                            pull: prFromSummary,\n                          }),\n                        ];\n                      case 1:\n                        links_1 = _a.sent().links;\n                        if (commitFromSummary) {\n                          shortCommitId = commitFromSummary.slice(0, 7);\n                          links_1 = __assign(__assign({}, links_1), {\n                            commit: '[`'\n                              .concat(shortCommitId, '`](https://github.com/')\n                              .concat(options.repo, '/commit/')\n                              .concat(commitFromSummary, ')'),\n                          });\n                        }\n                        return [2 /*return*/, links_1];\n                      case 2:\n                        commitToFetchFrom = commitFromSummary || changeset.commit;\n                        if (!commitToFetchFrom) return [3 /*break*/, 4];\n                        return [\n                          4 /*yield*/,\n                          (0, get_github_info_1.getInfo)({\n                            repo: options.repo,\n                            commit: commitToFetchFrom,\n                          }),\n                        ];\n                      case 3:\n                        links_2 = _a.sent().links;\n                        return [2 /*return*/, links_2];\n                      case 4:\n                        return [\n                          2 /*return*/,\n                          {\n                            commit: null,\n                            pull: null,\n                            user: null,\n                          },\n                        ];\n                    }\n                  });\n                });\n              })(),\n            ];\n          case 1:\n            links = _b.sent();\n            users = usersFromSummary.length\n              ? usersFromSummary\n                  .map(function (userFromSummary) {\n                    return '[@'\n                      .concat(userFromSummary, '](https://github.com/')\n                      .concat(userFromSummary, ')');\n                  })\n                  .join(', ')\n              : links.user;\n            suffix = '';\n            if (links.pull || links.commit || users) {\n              suffix = '('\n                .concat(users ? 'by '.concat(users, ' ') : '', 'in ')\n                .concat(links.pull || links.commit, ')');\n            }\n            emojiFirstline = firstLine\n              .replace(/feat:/i, '✨')\n              .replace(/chore:/i, '🛠')\n              .replace(/infra:/i, '🛠')\n              .replace(/fix:/i, '🐞🩹')\n              .replace(/docs:/i, '📃');\n            return [\n              2 /*return*/,\n              '\\n\\n- '\n                .concat(emojiFirstline, ' ')\n                .concat(suffix, '\\n')\n                .concat(\n                  futureLines\n                    .map(function (l) {\n                      return '  '.concat(l);\n                    })\n                    .join('\\n')\n                ),\n            ];\n        }\n      });\n    });\n  },\n};\nexports.default = changelogFunctions;\n"
  },
  {
    "path": ".changeset/changelog-github-custom.ts",
    "content": "import { ChangelogFunctions } from '@changesets/types';\n// @ts-ignore\nimport { getInfo, getInfoFromPullRequest } from '@changesets/get-github-info';\nimport { config } from 'dotenv';\n\nconfig();\n\nconst changelogFunctions: ChangelogFunctions = {\n  getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {\n    if (!options.repo) {\n      throw new Error(\n        'Please provide a repo to this changelog generator like this:\\n\"changelog\": [\"@changesets/changelog-github\", { \"repo\": \"org/repo\" }]'\n      );\n    }\n    if (dependenciesUpdated.length === 0) {\n      return '';\n    }\n\n    const changesetLink = `- Updated dependencies [${(\n      await Promise.all(\n        changesets.map(async (cs) => {\n          if (cs.commit) {\n            const { links } = await getInfo({\n              repo: options.repo,\n              commit: cs.commit,\n            });\n            return links.commit;\n          }\n        })\n      )\n    )\n      .filter((_) => _)\n      .join(', ')}]:`;\n\n    const updatedDepenenciesList = dependenciesUpdated.map(\n      (dependency) => `  - ${dependency.name}@${dependency.newVersion}`\n    );\n\n    return [changesetLink, ...updatedDepenenciesList].join('\\n');\n  },\n  getReleaseLine: async (changeset, type, options) => {\n    if (!options || !options.repo) {\n      throw new Error(\n        'Please provide a repo to this changelog generator like this:\\n\"changelog\": [\"@changesets/changelog-github\", { \"repo\": \"org/repo\" }]'\n      );\n    }\n\n    let prFromSummary: number | undefined;\n    let commitFromSummary: string | undefined;\n    const usersFromSummary: string[] = [];\n\n    const replacedChangelog = changeset.summary\n      .replace(/^\\s*(?:pr|pull|pull\\s+request):\\s*#?(\\d+)/im, (_, pr) => {\n        const num = Number(pr);\n        if (!isNaN(num)) {\n          prFromSummary = num;\n        }\n        return '';\n      })\n      .replace(/^\\s*commit:\\s*([^\\s]+)/im, (_, commit) => {\n        commitFromSummary = commit;\n        return '';\n      })\n      .replace(/^\\s*(?:author|user):\\s*@?([^\\s]+)/gim, (_, user) => {\n        usersFromSummary.push(user);\n        return '';\n      })\n      .trim();\n\n    const linkifyIssueHints = (line: string) =>\n      line.replace(/(?<=\\( ?(?:fix|fixes|see) )(#\\d+)(?= ?\\))/g, (issueHash) => {\n        return `[${issueHash}](https://github.com/${\n          options.repo\n        }/issues/${issueHash.substring(1)})`;\n      });\n\n    const [firstLine, ...futureLines] = replacedChangelog\n      .split('\\n')\n      .map((l) => linkifyIssueHints(l.trimEnd()));\n\n    const links = await (async () => {\n      if (prFromSummary !== undefined) {\n        let { links } = await getInfoFromPullRequest({\n          repo: options.repo,\n          pull: prFromSummary,\n        });\n        if (commitFromSummary) {\n          const shortCommitId = commitFromSummary.slice(0, 7);\n          links = {\n            ...links,\n            commit: `[\\`${shortCommitId}\\`](https://github.com/${options.repo}/commit/${commitFromSummary})`,\n          };\n        }\n        return links;\n      }\n      const commitToFetchFrom = commitFromSummary || changeset.commit;\n      if (commitToFetchFrom) {\n        const { links } = await getInfo({\n          repo: options.repo,\n          commit: commitToFetchFrom,\n        });\n        return links;\n      }\n      return {\n        commit: null,\n        pull: null,\n        user: null,\n      };\n    })();\n\n    const users = usersFromSummary.length\n      ? usersFromSummary\n          .map((userFromSummary) => `[@${userFromSummary}](https://github.com/${userFromSummary})`)\n          .join(', ')\n      : links.user;\n\n    let suffix = '';\n    if (links.pull || links.commit || users) {\n      suffix = `(${users ? `by ${users} ` : ''}in ${links.pull || links.commit})`;\n    }\n\n    const emojiFirstline = firstLine\n      .replace(/feat:/i, '✨')\n      .replace(/chore:/i, '🛠')\n      .replace(/infra:/i, '🛠')\n      .replace(/fix:/i, '🐞🩹')\n      .replace(/docs:/i, '📃');\n\n    return `\\n\\n- ${emojiFirstline} ${suffix}\\n${futureLines.map((l) => `  ${l}`).join('\\n')}`;\n  },\n};\n\nexport default changelogFunctions;\n"
  },
  {
    "path": ".changeset/config.json",
    "content": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@3.0.1/schema.json\",\n  \"changelog\": [\"./changelog-github-custom.cjs\", { \"repo\": \"QwikDev/qwik\" }],\n  \"commit\": false,\n  \"fixed\": [[\"@builder.io/qwik\", \"@builder.io/qwik-city\", \"eslint-plugin-qwik\", \"create-qwik\"]],\n  \"linked\": [],\n  \"access\": \"public\",\n  \"baseBranch\": \"origin/upcoming\",\n  \"updateInternalDependencies\": \"minor\",\n  \"ignore\": [\n    \"qwik-docs\",\n    \"@builder.io/qwik-labs\",\n    \"insights\",\n    \"@builder.io/qwik-worker\",\n    \"qwik-cli-e2e\",\n    \"qwik-react-test-app\",\n    \"docs-e2e\"\n  ],\n  \"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH\": {\n    \"onlyUpdatePeerDependentsWhenOutOfRange\": true\n  }\n}\n"
  },
  {
    "path": ".changeset/deno-production-builds.md",
    "content": "---\n'@builder.io/qwik': patch\n'@builder.io/qwik-city': patch\n---\n\nFIX: support Deno as package manager for production builds. The Vite plugin now recognizes Deno as a Node-compatible runtime for manifest passing, and SSG delegates to the Node implementation instead of stubbing out.\n"
  },
  {
    "path": ".changeset/eager-sides-sit.md",
    "content": "---\n'@builder.io/qwik': patch\n---\n\nFIX: the optimizer was not using the binary builds\n"
  },
  {
    "path": ".changeset/fix-virtual-css-dev-ssr.md",
    "content": "---\n'@builder.io/qwik': patch\n---\n\nfix: resolve 404 error for virtual CSS modules during dev SSR\n"
  },
  {
    "path": ".changeset/late-parrots-open.md",
    "content": "---\n'eslint-plugin-qwik': patch\n---\n\nSupport ESLint v10\n"
  },
  {
    "path": ".changeset/shaky-ends-help.md",
    "content": "---\n'@builder.io/qwik-city': patch\n---\n\nfix: Link hash change now properly updates location.url.hash\n"
  },
  {
    "path": ".changeset/small-candies-train.md",
    "content": "---\n'@builder.io/qwik-city': patch\n---\n\nfix: handle special characters in dynamic route\n"
  },
  {
    "path": ".changeset/smooth-ends-count.md",
    "content": "---\n'@builder.io/qwik': patch\n---\n\nfix: type casts to bridge Rollup vs Rolldown type differences without changing runtime behavior\n"
  },
  {
    "path": ".devcontainer/Dockerfile",
    "content": "FROM cimg/rust:1.88.0-node\n\nRUN rustup --version; \\\n    cargo --version; \\\n    rustc --version; \n\nRUN rustup update; \\\n    rustup target add wasm32-unknown-unknown; \\\n    cargo install cargo-insta --locked; \\\n    cargo install wasm-pack --locked; \\\n    rustup component add clippy; \\\n    corepack enable --install-directory ~/bin\n\nRUN mkdir /home/circleci/store; \\\n    pnpm config set store-dir /home/circleci/store\n"
  },
  {
    "path": ".devcontainer/devcontainer.json",
    "content": "// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:\n// https://github.com/microsoft/vscode-dev-containers/tree/v0.217.2/containers/docker-existing-dockerfile\n{\n  \"name\": \"Qwik devcontainer\",\n  \"hostRequirements\": {\n    \"cpus\": 4\n  },\n  // Add the IDs of extensions you want installed when the container is created.\n  \"extensions\": [\n    \"esbenp.prettier-vscode\",\n    \"rust-lang.rust-analyzer\",\n    \"hdevalke.rust-test-lens\",\n    \"ms-playwright.playwright\",\n    \"manucorporat.vermoji\",\n    \"ms-azuretools.vscode-docker\",\n    \"mitsuhiko.insta\",\n    \"silvenon.mdx\",\n    \"csstools.postcss\"\n  ],\n  \"build\": {\n    \"dockerfile\": \"Dockerfile\"\n  },\n  \"waitFor\": \"updateContentCommand\",\n  \"updateContentCommand\": \"corepack install && pnpm install\",\n  \"forwardPorts\": [3300, 9229],\n  \"customizations\": {\n    \"codespaces\": {\n      \"openFiles\": [\"CONTRIBUTING.md\"]\n    }\n  },\n  \"portsAttributes\": {\n    \"3300\": {\n      \"label\": \"Serve\",\n      \"onAutoForward\": \"openPreview\"\n    }\n  }\n}\n"
  },
  {
    "path": ".dockerignore",
    "content": ".history\n.vscode\ndist\ndist-dev\nnode_modules\ntsc-out\nexternal\n*.\n**/*.log\netc\ntemp\ntsdoc-metadata.json\n**/.DS_Store\nintegration/out/\nintegration/todo/output\nintegration/*.js\nintegration/*.cjs\nintegration/*.map\npackages/qwik/src/napi/package-*\ntarget\n*.node\ntodo-express/\nqwik-app/"
  },
  {
    "path": ".envrc",
    "content": "# shellcheck shell=bash\nuse flake\nwatch_file rust-toolchain\n"
  },
  {
    "path": ".gitattributes",
    "content": "*.json  linguist-language=JSON-with-Comments\n.yarn/releases/** binary\n.yarn/plugins/** binary\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "# For all PRs\n* @QwikDev/core-veterans\n\n# For docs PRs\npackages/docs @QwikDev/docs-team @QwikDev/qwik-team\ncontributing @QwikDev/docs-team @QwikDev/qwik-team\nREADME.md @QwikDev/docs-team @QwikDev/qwik-team\nCONTRIBUTING.md @QwikDev/docs-team @QwikDev/qwik-team\nCODE_OF_CONDUCT.md @QwikDev/docs-team @QwikDev/qwik-team\n\n# For API changes\napi.json @QwikDev/api-guards\n\n# For releases\nCHANGELOG.md @QwikDev/api-guards\n\n# Protect the code owners file\n.github/CODEOWNERS @mhevery @shairez\n\n\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug.yaml",
    "content": "name: 🐞 Bug Report\ndescription: Something does not work or is flaky! let us know!\nlabels: ['TYPE: bug', 'STATUS-1: needs triage']\ntitle: '[🐞]'\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for taking the time to fill out this bug report!\n\n  - type: dropdown\n    id: component\n    attributes:\n      label: Which component is affected?\n      options:\n        - Qwik Runtime\n        - Qwik Rollup / Vite plugin\n        - Qwik Optimizer (rust)\n        - Qwik React\n        - Qwik City (routing)\n        - Starters / CLI\n        - Qwik Playground\n    validations:\n      required: true\n\n  - type: textarea\n    id: description\n    attributes:\n      description: 'A clear and concise description of what you expected to happen instead. If you intend to submit a PR for this issue, tell us in the description. Thanks!'\n      label: Describe the bug\n      placeholder: I am doing ... What I expect is ... What actually happening is ...\n\n    validations:\n      required: true\n\n  - type: input\n    id: reproduction\n    attributes:\n      label: Reproduction\n      description: Please provide a link via [qwik.new](https://qwik.new/) or a link to a repo that can reproduce the problem you ran into. `npm create qwik@latest` can be used as a starter template. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required ([Why?](https://antfu.me/posts/why-reproductions-are-required)). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a \"need reproduction\" label. If no reproduction is provided after 3 days, it will be auto-closed.\n      placeholder: Reproduction URL\n    validations:\n      required: true\n\n  - type: textarea\n    id: reproduction-steps\n    attributes:\n      label: Steps to reproduce\n      description: Please provide any reproduction steps that may need to be described. E.g. if it happens only when running the dev or build script make sure it's clear which one to use.\n      placeholder: Run `npm install` followed by `npm run dev`\n\n  - type: textarea\n    id: system-info\n    attributes:\n      label: System Info\n      description: Output of `npx envinfo --system --npmPackages '{vite,undici,typescript,@builder.io/*}' --binaries --browsers`\n      render: shell\n      placeholder: System, Binaries, Browsers\n    validations:\n      required: true\n\n  - type: textarea\n    id: additional_information\n    attributes:\n      label: Additional Information\n    validations:\n      required: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "contact_links:\n  - name: ✨ Feature requests Ideas\n    url: https://github.com/QwikDev/qwik-evolution/discussions\n    about: Propose new features and improvements and help shape Qwik\n  - name: 🤔 Support Question\n    url: https://qwik.dev/chat\n    about: This issue tracker is not for support questions. Please post your question on the Discord chat.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/docs_suggestion.yml",
    "content": "name: 📖 Documentation Suggestion\ndescription: Suggestions on how we can improve the documentation.\ntitle: '[📖]'\nlabels: ['COMP: docs', 'STATUS-1: needs triage']\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for taking the time to fill out docs suggestion! However, if you think it's something you can fix yourself, please submit a PR instead.\n        In every doc page, you will be able to find the \"Edit this page\" in the right menu!\n        ![Screenshot](https://user-images.githubusercontent.com/127379/203278116-7986d8b2-6aad-45fd-9890-7f171ca26bf0.png)\n\n  - type: textarea\n    id: description\n    attributes:\n      description: 'A clear and concise description of your suggestion to improve the docs.'\n      label: Suggestion\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "<!--\nThe Qwik Team and Community appreciate all PRs. Thank you for your effort! Not all PRs can be merged, but those that meet the following criteria will be prioritized:\n\na) Core fixes, and\n\nb) Framework functionality achievable only by the core.\n\nIf this PR can be done as a 3rd-Party Community Add-On, we encourage that for quicker adoption.\n\nIf you believe your functionality is valuable to the entire Qwik Community, discuss it in the Qwik Discord channels for potential inclusion in the core.\n\nFirst of all, make sure your PR title is descriptive and matches our commit title guidelines.\n\nAlso make sure your PR follows all the guidelines in the [CONTRIBUTING.md](./CONTRIBUTING.md) document.\n\n-->\n\n# What is it?\n\n<!-- pick one and remove the others -->\n\n- Feature / enhancement\n- Bug\n- Docs / tests / types / typos\n- Infra\n\n# Description\n\n<!--\n* Include a summary of the motivation and context for this PR\n* Is it related to any opened issues? (please add them here)\n-->\n\n# Checklist\n\n<!--\n* delete the items that are not relevant, so it's easy to tell if the PR is ready to be merged\n* add items that are relevant and need to be done before merging\n-->\n\n- [ ] My code follows the [developer guidelines of this project](https://github.com/QwikDev/qwik/blob/main/CONTRIBUTING.md)\n- [ ] I performed a self-review of my own code\n- [ ] I added a changeset with `pnpm change`\n- [ ] I made corresponding changes to the Qwik docs\n- [ ] I added new tests to cover the fix / functionality\n"
  },
  {
    "path": ".github/workflows/ai-issue-triage.yml",
    "content": "name: AI Issue Triage\n\non:\n  issues:\n    types: [opened]\n\npermissions:\n  issues: write\n\njobs:\n  triage:\n    if: github.repository == 'QwikDev/qwik'\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Check account age (skip accounts < 30 days)\n        id: check\n        uses: actions/github-script@v7\n        with:\n          script: |\n            const user = await github.rest.users.getByUsername({\n              username: context.payload.issue.user.login\n            });\n            const created = new Date(user.data.created_at);\n            const days = (Date.now() - created) / (1000 * 60 * 60 * 24);\n            return days >= 30;\n\n      - name: AI triage and apply labels\n        if: steps.check.outputs.result == 'true'\n        uses: actions/github-script@v7\n        env:\n          OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}\n        with:\n          script: |\n            const issue = context.payload.issue;\n            const issueText = `Title: ${issue.title}\\n\\nBody: ${issue.body || '(empty)'}`;\n\n            // Call OpenCode Zen API (OpenAI-compatible)\n            const response = await fetch('https://opencode.ai/zen/v1/chat/completions', {\n              method: 'POST',\n              headers: {\n                'Content-Type': 'application/json',\n                'Authorization': `Bearer ${process.env.OPENCODE_API_KEY}`\n              },\n              body: JSON.stringify({\n                model: 'kimi-k2.5',\n                messages: [\n                  {\n                    role: 'system',\n                    content: `You are a Qwik framework issue triager. Given an issue, respond with ONLY a JSON array of label strings to apply. No explanation, no markdown, just the JSON array.\n\n            Available labels:\n\n            Type (pick exactly one):\n            - \"bug\" — Something isn't working\n            - \"enhancement\" — New feature or request\n\n            Component (pick if clearly relevant):\n            - \"runtime\", \"Optimizer\", \"Router\", \"SSR\", \"Preloader\", \"starters\", \"styling\", \"types\", \"reactivity\", \"Insights\", \"docs\", \"DX\"\n\n            Status (apply if applicable):\n            - \"needs reproduction\" — Bug report lacks a reproduction link\n\n            Rules:\n            1. Always include exactly ONE type label.\n            2. For bugs without a reproduction link, include \"needs reproduction\".\n            3. Do NOT include \"good first issue\" unless the fix is obviously trivial.\n            4. Respond with ONLY a JSON array like: [\"bug\", \"runtime\", \"needs reproduction\"]`\n                  },\n                  {\n                    role: 'user',\n                    content: issueText\n                  }\n                ],\n                temperature: 0\n              })\n            });\n\n            if (!response.ok) {\n              const text = await response.text();\n              core.setFailed(`Zen API error ${response.status}: ${text}`);\n              return;\n            }\n\n            const data = await response.json();\n            const content = data.choices[0].message.content.trim();\n\n            // Parse labels from response\n            let labels;\n            try {\n              labels = JSON.parse(content);\n            } catch {\n              // Try extracting JSON array from response\n              const match = content.match(/\\[[\\s\\S]*\\]/);\n              if (match) {\n                labels = JSON.parse(match[0]);\n              } else {\n                core.setFailed(`Could not parse labels from: ${content}`);\n                return;\n              }\n            }\n\n            if (!Array.isArray(labels) || labels.length === 0) {\n              core.setFailed(`Invalid labels response: ${content}`);\n              return;\n            }\n\n            // Fetch actual repo labels to validate against\n            const repoLabels = await github.paginate(github.rest.issues.listLabelsForRepo, {\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              per_page: 100\n            });\n            const allowed = new Set(repoLabels.map(l => l.name));\n            const valid = labels.filter(l => allowed.has(l));\n\n            if (valid.length === 0) {\n              core.setFailed(`No valid labels found in: ${JSON.stringify(labels)}`);\n              return;\n            }\n\n            // Apply labels\n            await github.rest.issues.addLabels({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: issue.number,\n              labels: valid\n            });\n\n            core.info(`Applied labels: ${valid.join(', ')}`);\n\n            // Post follow-up comment for needs reproduction\n            // (labeling-issues.yml won't fire because GITHUB_TOKEN labels don't trigger labeled events)\n            if (valid.includes('needs reproduction')) {\n              const author = issue.user.login;\n              await github.rest.issues.createComment({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                issue_number: issue.number,\n                body: `Hello @${author}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://qwik.new).\\n[Here](https://antfu.me/posts/why-reproductions-are-required#why-reproduction) is why reproductions help us fix issues faster.\\nThanks 🙏`\n              });\n            }\n"
  },
  {
    "path": ".github/workflows/auto-assign-core-team.yml",
    "content": "name: Auto-assign PRs to core team authors\n\non:\n  pull_request_target:\n    types: [opened, reopened, ready_for_review, converted_to_draft]\n\npermissions:\n  pull-requests: write\n  contents: read\n\njobs:\n  auto_assign:\n    name: Assign PR author when core team member\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check team membership via REST\n        id: team\n        env:\n          GH_TOKEN: ${{ secrets.QWIK_AUTO_ASSIGN_PR_PAT }}\n          ORG: QwikDev\n          TEAM_SLUG: qwik-team\n          AUTHOR: ${{ github.event.pull_request.user.login }}\n        run: |\n          RESPONSE=$(curl -s \\\n            -H \"Authorization: token ${GH_TOKEN}\" \\\n            -H \"Accept: application/vnd.github+json\" \\\n            \"https://api.github.com/orgs/${ORG}/teams/${TEAM_SLUG}/memberships/${AUTHOR}\")\n\n          STATE=$(echo \"$RESPONSE\" | jq -r '.state // empty')\n          if [ \"$STATE\" = \"active\" ]; then\n            echo \"isCore=true\" >> $GITHUB_OUTPUT\n          else\n            echo \"isCore=false\" >> $GITHUB_OUTPUT\n          fi\n\n      - name: Assign PR to author\n        if: steps.team.outputs.isCore == 'true'\n        env:\n          GH_TOKEN: ${{ secrets.QWIK_AUTO_ASSIGN_PR_PAT }}\n        run: |\n          PR_NUMBER=${{ github.event.pull_request.number }}\n          AUTHOR=${{ github.event.pull_request.user.login }}\n          curl -s -H \"Authorization: token ${GH_TOKEN}\" \\\n            -H \"Accept: application/vnd.github+json\" \\\n            -X POST \\\n            -d \"{\\\"assignees\\\":[\\\"${AUTHOR}\\\"]}\" \\\n            https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/assignees\n\n      - name: Add PR to Qwik Development project\n        id: add-project\n        if: steps.team.outputs.isCore == 'true'\n        uses: actions/add-to-project@v1.0.2\n        with:\n          project-url: https://github.com/orgs/QwikDev/projects/1\n          github-token: ${{ secrets.QWIK_AUTO_ASSIGN_PR_PAT }}\n\n      - name: Set status to \"In progress\" (draft)\n        if: steps.team.outputs.isCore == 'true' && github.event.pull_request.draft == true\n        uses: titoportas/update-project-fields@v0.1.0\n        with:\n          project-url: https://github.com/orgs/QwikDev/projects/1\n          github-token: ${{ secrets.QWIK_AUTO_ASSIGN_PR_PAT }}\n          item-id: ${{ steps.add-project.outputs.itemId }}\n          field-keys: Status\n          field-values: In progress\n\n      - name: Set status to \"Waiting For Review\" (ready)\n        if: steps.team.outputs.isCore == 'true' && github.event.pull_request.draft == false\n        uses: titoportas/update-project-fields@v0.1.0\n        with:\n          project-url: https://github.com/orgs/QwikDev/projects/1\n          github-token: ${{ secrets.QWIK_AUTO_ASSIGN_PR_PAT }}\n          item-id: ${{ steps.add-project.outputs.itemId }}\n          field-keys: Status\n          field-values: Waiting For Review\n"
  },
  {
    "path": ".github/workflows/bench.yml.disabled",
    "content": "# disabled for now, not working as expected and not checking qwik runtime performance\nname: Benchmark\n\non:\n  - push\n  - pull_request\n\njobs:\n  changes:\n    runs-on: ubuntu-latest\n    outputs:\n      optimizer: ${{ steps.filter.outputs.optimizer }}\n\n    steps:\n      - uses: actions/checkout@v5\n      - uses: dorny/paths-filter@v2\n        id: filter\n        with:\n          filters: |\n            optimizer:\n              - 'src/optimizer/core/**'\n\n  benchmark:\n    name: Performance regression check\n    needs: changes\n    if: ${{ needs.changes.outputs.optimizer == 'true' }}\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v5\n\n      - name: Cache\n        uses: actions/cache@v4\n        with:\n          path: |\n            ~/.cargo/bin/\n            ~/.cargo/registry/index/\n            ~/.cargo/registry/cache/\n            ~/.cargo/git/db/\n            target/\n          key: cargo-bench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}\n          restore-keys: |\n            cargo-bench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}\n\n      - name: Install Rust\n        uses: actions-rs/toolchain@v1\n        with:\n          profile: minimal\n          toolchain: nightly-2021-09-30\n          override: true\n\n      - name: Run benchmark\n        run: cargo +nightly-2021-09-30 bench --workspace | tee output.txt\n\n      - name: Download previous benchmark results\n        run: mkdir raw-data && curl -o raw-data/benchmark-data.json https://raw.githubusercontent.com/QwikDev/qwik-raw-data/gh-pages/benchmark-data.json\n\n      - name: Analyze benchmark result\n        uses: benchmark-action/github-action-benchmark@v1\n        with:\n          # What benchmark tool the output.txt came from\n          tool: 'cargo'\n          # Where the output from the benchmark tool is stored\n          output-file-path: output.txt\n          external-data-json-path: ./raw-data/${{ github.sha }}/benchmark-data.json\n          # Workflow will fail when an alert happens\n          fail-on-alert: false\n          # GitHub API token to make a commit comment\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          # Enable alert commit comment\n          comment-on-alert: true\n          comment-always: true\n          alert-comment-cc-users: '@manucorporat'\n          skip-fetch-gh-pages: true\n\n      - name: Analyze benchmark result (root)\n        if: ${{ github.event_name == 'push' }}\n        uses: benchmark-action/github-action-benchmark@v1\n        with:\n          # What benchmark tool the output.txt came from\n          tool: 'cargo'\n          # Where the output from the benchmark tool is stored\n          output-file-path: output.txt\n          external-data-json-path: ./raw-data/benchmark-data.json\n          # Workflow will fail when an alert happens\n          # fail-on-alert: true\n          # GitHub API token to make a commit comment\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          # Enable alert commit comment\n          comment-on-alert: true\n          comment-always: true\n          alert-comment-cc-users: '@manucorporat'\n          max-items-in-chart: 250\n          skip-fetch-gh-pages: true\n          auto-push: false\n\n      - name: Deploy to qwik-raw-data\n        if: ${{ github.ref == 'refs/heads/main' }}\n        uses: JamesIves/github-pages-deploy-action@4.1.0\n        with:\n          token: ${{ secrets.PAT_GITHUB_TOKEN }}\n          branch: gh-pages\n          folder: raw-data\n          clean: false\n          single-commit: false\n          git-config-email: github-bot@builder.io\n          repository-name: QwikDev/qwik-raw-data\n          commit-message: 'Update'\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "# Build and test everything\n#\n# First it builds the packages and stores them in artifacts/cache.\n# Meanwhile it lints the code.\n# Then it runs the unit tests with the artifacts, as well as builds the docs and insights\n# Once it all works, it does a release\n#\n# NOTE: only use pnpm run scripts for build commands\n# This way we're sure that dev and CI environments are consistent\n\nname: Qwik CI\n\n# TODO fix e2e tests hanging and not cancelling\n# # We only need one instance of the workflow running at a time, per branch\n# concurrency:\n#   group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}\n#   cancel-in-progress: true\n\non:\n  pull_request:\n  push:\n    branches:\n      - main\n      - upcoming\n      - next\n      - qwik-labs\n      - vercelserverless\n      - 'build/**'\n  workflow_dispatch:\n    inputs:\n      disttag:\n        description: 'Publish \"@builder.io/qwik\" to NPM using this dist-tag, push the git-tag to the repo and create a GitHub release. The \"latest\" and \"next\" dist-tags will use the version number already committed in package.json.'\n        required: true\n        type: choice\n        default: 'dev'\n        options:\n          - dev\n          - next\n          - latest\n\nenv:\n  # Disable incremental build, speeds up CI\n  CARGO_INCREMENTAL: 0\n\npermissions:\n  id-token: write\n  contents: write\n  pull-requests: write\n\njobs:\n  changes:\n    name: Setup\n    runs-on: ubuntu-latest\n    outputs:\n      hash-qwik: ${{ steps.cache-qwik.outputs.cache-primary-key }}\n      hash-rust: ${{ steps.cache-rust.outputs.cache-primary-key }}\n      hash-others: ${{ steps.cache-others.outputs.cache-primary-key }}\n      hash-docs: ${{ steps.cache-docs.outputs.cache-primary-key }}\n      hash-insights: ${{ steps.cache-insights.outputs.cache-primary-key }}\n      hash-unit: ${{ steps.cache-unit.outputs.cache-primary-key }}\n      hash-e2e: ${{ steps.cache-e2e.outputs.cache-primary-key }}\n      hash-cli-e2e: ${{ steps.cache-cli-e2e.outputs.cache-primary-key }}\n      build-qwik: ${{ steps.cache-qwik.outputs.cache-hit != 'true' }}\n      build-rust: ${{ steps.cache-rust.outputs.cache-hit != 'true' }}\n      build-others: ${{ steps.cache-others.outputs.cache-hit != 'true' }}\n      build-docs: ${{ steps.cache-docs.outputs.cache-hit != 'true' }}\n      build-insights: ${{ steps.cache-insights.outputs.cache-hit != 'true' }}\n      build-unit: ${{ steps.cache-unit.outputs.cache-hit != 'true' }}\n      build-e2e: ${{ steps.cache-e2e.outputs.cache-hit != 'true' }}\n      build-cli-e2e: ${{ steps.cache-cli-e2e.outputs.cache-hit != 'true' }}\n      disttag: ${{ steps.set_dist_tag.outputs.disttag }}\n\n    steps:\n      - name: Branch\n        run: echo \"${{ github.ref }}\"\n      - name: NPM Dist Tag from input\n        run: echo \"${{ github.event.inputs.disttag }}\"\n      - name: Github event\n        run: echo event_name=${{ github.event_name }}\n\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - name: Set Dist Tag\n        id: set_dist_tag\n        if: |\n          github.ref == 'refs/heads/upcoming' && (\n            github.event_name == 'push' ||\n            github.event_name == 'workflow_dispatch'\n          )\n        run: |\n          if [ ${{ github.event_name }} == 'workflow_dispatch' ]; then\n            disttag=\"${{ github.event.inputs.disttag }}\"\n            echo \"Overriding disttag with input: $disttag\"\n            echo \"disttag=${disttag}\" >> $GITHUB_OUTPUT\n            exit 0\n          fi\n\n          is_release=false\n          commit_id=${{ github.sha }}\n          owner=${{ github.repository_owner }}\n          repo=${{ github.event.repository.name }}\n\n          removed_files=$(curl -s -H \"Authorization: token ${{ secrets.GITHUB_TOKEN }}\" \\\n            \"https://api.github.com/repos/$owner/$repo/commits/$commit_id\" | jq -r '.files[] | select(.status == \"removed\") | .filename')\n\n          echo \"Removed files: $removed_files\"\n\n          md_file_removed=false\n          for file in $removed_files; do\n            if [[ $file == .changeset/*.md ]]; then\n              md_file_removed=true\n              break\n            fi\n          done\n\n          if [ $md_file_removed = true ]; then\n            if ! ls .changeset/*.md > /dev/null 2>&1; then\n              is_release=true\n            fi\n          fi\n\n          echo \"is_release: $is_release\"\n\n          if [ \"$is_release\" = true ]; then\n            disttag='latest'\n          else \n            disttag=\"${{github.event.inputs.disttag}}\"\n          fi\n\n          echo \"disttag: $disttag\"\n\n          echo \"disttag=${disttag}\" >> $GITHUB_OUTPUT\n\n      - run: jq .scripts package.json > scripts.json\n\n      - name: 'check cache: qwik'\n        id: cache-qwik\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: packages/qwik/dist\n          # Note that this includes the package.json of qwik\n          key: ${{ hashfiles('.github/workflows/ci.yml', 'pnpm-lock.yaml', 'scripts.json', 'scripts/**/*', 'packages/qwik/**/*', 'starters/features/**/*', 'starters/adapters/**/*', 'starters/templates/**/*', '!**/*.unit.*', '!**/*.rs', '!starters/apps/e2e') }}\n      - run: 'echo ${{ steps.cache-qwik.outputs.cache-primary-key }} > qwik-key.txt'\n      - name: 'check cache: rust'\n        id: cache-rust\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: packages/qwik/bindings\n          key: ${{ hashfiles('Makefile', 'rust-toolchain', '**/Cargo.toml', '**/Cargo.lock', '**/*.rs') }}\n      - run: 'echo ${{ steps.cache-rust.outputs.cache-primary-key }} > rust-key.txt'\n      - name: 'check cache: others'\n        id: cache-others\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: |\n            packages/qwik-city/lib\n            packages/qwik-labs/lib\n            packages/qwik-labs/vite\n            packages/qwik-react/lib\n            packages/eslint-plugin-qwik/dist\n            packages/create-qwik/dist\n          # note that all inputs need to be listed here, including qwik, for correct cache invalidation\n          key: ${{ hashfiles('qwik-key.txt', 'rust-key.txt', 'packages/qwik-city/**/*', 'packages/qwik-labs/**/*', 'packages/qwik-react/**/*', 'packages/eslint-plugin-qwik/**/*', 'packages/create-qwik/**/*', 'starters/apps/**/*', '!**/*.unit.*') }}\n      - run: 'echo ${{ steps.cache-others.outputs.cache-primary-key }} > others-key.txt'\n      - name: 'check cache: docs'\n        id: cache-docs\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: docs-build-completed.txt\n          key: ${{ hashfiles('others-key.txt', 'packages/docs/**/*') }}\n      - name: 'check cache: insights'\n        id: cache-insights\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: |\n            packages/insights/dist\n            packages/insights/.netlify\n          key: ${{ hashfiles('others-key.txt', 'packages/insights/**/*') }}\n      - name: 'check cache: unit tests'\n        id: cache-unit\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: unit-tests-completed.txt\n          key: ${{ hashfiles('others-key.txt', 'packages/**/*.unit.*') }}\n      - name: 'check cache: e2e tests'\n        id: cache-e2e\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: e2e-tests-completed.txt\n          key: ${{ hashfiles('others-key.txt', 'starters/**/*') }}\n      - name: 'check cache: cli e2e tests'\n        id: cache-cli-e2e\n        uses: actions/cache/restore@v4\n        with:\n          lookup-only: true\n          path: cli-e2e-tests-completed.txt\n          key: ${{ hashfiles('others-key.txt', 'e2e/**/*') }}\n\n  ############ BUILD Qwik ############\n  build-qwik:\n    if: needs.changes.outputs.build-qwik == 'true'\n    name: Build Qwik\n    needs: changes\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - name: Install NPM Dependencies\n        run: |\n          # Ensure that the qwik binary gets made\n          mkdir -p packages/qwik/bindings/\n          pnpm install --frozen-lockfile\n\n      - name: 'build: qwik'\n        run: pnpm build --qwik --set-dist-tag=\"${{ needs.changes.outputs.disttag }}\"\n\n      - name: Print Qwik Dist Build\n        continue-on-error: true\n        run: tree -a packages/qwik/dist/\n\n      - name: Save qwik cache\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-qwik }}\n          path: packages/qwik/dist\n\n      - name: Save artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-qwik-no-optimizer\n          include-hidden-files: true\n          path: packages/qwik/dist/\n          if-no-files-found: error\n\n  ############ BUILD PLATFORM BINDINGS ############\n  build-bindings:\n    if: needs.changes.outputs.build-rust == 'true'\n    strategy:\n      matrix:\n        settings:\n          - host: ubuntu-latest\n            target: x86_64-unknown-linux-gnu\n            wasm: true\n\n          # the last x86 macos available as a standard runner\n          - host: macos-13\n            target: x86_64-apple-darwin\n\n          - host: macos-latest\n            target: aarch64-apple-darwin\n\n          - host: windows-latest\n            target: x86_64-pc-windows-msvc\n\n    name: Build optimizer ${{ matrix.settings.target }}\n    runs-on: ${{ matrix.settings.host }}\n\n    needs: changes\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - name: Install Rust toolchain\n        uses: actions-rust-lang/setup-rust-toolchain@v1\n        with:\n          components: clippy,rustfmt\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - run: pnpm install\n      - if: matrix.settings.wasm\n        run: pnpm install -w wasm-pack\n\n      - name: Lint check\n        if: matrix.settings.wasm\n        run: pnpm lint.rust\n\n      - name: Unit tests\n        if: matrix.settings.wasm\n        run: pnpm test.rust\n\n      - name: Build Platform Binding\n        run: pnpm build --platform-binding\n\n      - name: Build Wasm Binding\n        if: matrix.settings.wasm\n        run: pnpm build --wasm\n\n      - name: Print Packages Dist Build\n        continue-on-error: true\n        run: ls -lR packages/qwik/bindings/\n\n      - name: Upload Platform Binding Artifact\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-bindings-${{ matrix.settings.target }}\n          include-hidden-files: true\n          path: packages/qwik/bindings/\n          if-no-files-found: error\n\n  ############ BUILD PACKAGE ############\n  combined-qwik:\n    name: Bundle Qwik\n    if: always()\n    runs-on: ubuntu-latest\n    needs:\n      - build-qwik\n      - build-bindings\n      - changes\n\n    steps:\n      - name: Verify builds\n        if: |\n          !(\n            (needs.build-qwik.result == 'success' || needs.build-qwik.result == 'skipped') &&\n            (needs.build-bindings.result == 'success' || needs.build-bindings.result == 'skipped')\n          )\n        run: exit 1\n\n      - name: Restore artifacts\n        if: needs.changes.outputs.build-rust == 'true'\n        uses: actions/download-artifact@v4\n\n      - name: Restore Qwik from cache\n        uses: actions/cache/restore@v4\n        with:\n          path: packages/qwik/dist\n          key: ${{ needs.changes.outputs.hash-qwik }}\n\n      - name: Restore Rust from cache\n        if: needs.changes.outputs.build-rust != 'true'\n        uses: actions/cache/restore@v4\n        with:\n          path: packages/qwik/bindings\n          key: ${{ needs.changes.outputs.hash-rust }}\n\n      - name: Move Rust Artifacts\n        if: needs.changes.outputs.build-rust == 'true'\n        run: |\n          mkdir -p packages/qwik/bindings\n          mv artifact-bindings-*/* packages/qwik/bindings\n\n      - name: Save rust cache\n        if: needs.changes.outputs.build-rust == 'true'\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-rust }}\n          path: packages/qwik/bindings\n\n      - name: Upload Qwik artifact\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-qwik\n          include-hidden-files: true\n          path: |\n            packages/qwik/bindings\n            packages/qwik/dist\n          if-no-files-found: error\n\n  build-other-packages:\n    name: Build Other Packages\n    needs:\n      - changes\n      - combined-qwik\n    if: always()\n    runs-on: ubuntu-latest\n    steps:\n      - name: Verify combined-qwik\n        if: needs.combined-qwik.result != 'success'\n        run: exit 1\n\n      - name: Checkout\n        if: needs.changes.outputs.build-others == 'true'\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n        if: needs.changes.outputs.build-others == 'true'\n      - name: Setup Node\n        if: needs.changes.outputs.build-others == 'true'\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - name: Restore Qwik artifact\n        uses: actions/download-artifact@v4\n        with:\n          name: artifact-qwik\n          path: packages/qwik/\n\n      - name: Install NPM Dependencies\n        if: needs.changes.outputs.build-others == 'true'\n        run: pnpm install\n\n      - name: 'build: qwik-city & others'\n        if: needs.changes.outputs.build-others == 'true'\n        run: pnpm build --tsc --api --qwikcity --cli --qwiklabs --qwikreact --eslint --set-dist-tag=\"${{ needs.changes.outputs.disttag }}\"\n      - name: Save others cache\n        if: needs.changes.outputs.build-others == 'true'\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-others }}\n          path: |\n            packages/qwik-city/lib\n            packages/qwik-labs/lib\n            packages/qwik-labs/vite\n            packages/qwik-react/lib\n            packages/eslint-plugin-qwik/dist\n            packages/create-qwik/dist\n\n      - name: 'restore: qwik-city & others'\n        if: needs.changes.outputs.build-others != 'true'\n        uses: actions/cache/restore@v4\n        with:\n          path: |\n            packages/qwik-city/lib\n            packages/qwik-labs/lib\n            packages/qwik-labs/vite\n            packages/qwik-react/lib\n            packages/eslint-plugin-qwik/dist\n            packages/create-qwik/dist\n          key: ${{ needs.changes.outputs.hash-others }}\n\n      - name: Print QwikCity Lib Build\n        run: tree -a packages/qwik-city/lib/\n\n      - name: Upload QwikCity Build Artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-qwikcity\n          include-hidden-files: true\n          path: packages/qwik-city/lib/\n          if-no-files-found: error\n\n      - name: Print QwikLabs Lib Build\n        run: tree -a packages/qwik-labs/lib/ packages/qwik-labs/vite/\n\n      - name: Upload QwikLabs+React Build Artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-qwiklabs\n          include-hidden-files: true\n          path: |\n            packages/qwik-labs/lib/\n            packages/qwik-labs/vite/\n            packages/qwik-labs/package.json\n          if-no-files-found: error\n\n      - name: Print qwik-react Lib Build\n        run: tree -a packages/qwik-react/lib/\n\n      - name: Upload qwik-react Build Artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-qwikreact\n          include-hidden-files: true\n          path: |\n            packages/qwik-react/lib/\n            packages/qwik-react/package.json\n          if-no-files-found: error\n\n      - name: Print Create Qwik CLI Dist Build\n        run: tree -a packages/create-qwik/dist/\n\n      - name: Upload Create Qwik CLI Build Artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-create-qwik\n          include-hidden-files: true\n          path: packages/create-qwik/dist/\n          if-no-files-found: error\n\n      - name: Print Eslint rules Dist Build\n        run: tree -a packages/eslint-plugin-qwik/dist/\n\n      - name: Upload Eslint rules Build Artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-eslint-plugin-qwik\n          include-hidden-files: true\n          path: packages/eslint-plugin-qwik/dist/\n          if-no-files-found: error\n\n  ############ BUILD INSIGHTS ############\n  build-insights:\n    if: always() && needs.changes.outputs.build-insights == 'true'\n    name: Build Insights\n    needs:\n      - changes\n      - build-other-packages\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Verify build-other-packages\n        if: needs.build-other-packages.result != 'success'\n        run: exit 1\n\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - name: Download Build Artifacts\n        uses: actions/download-artifact@v4\n\n      - name: Move Distribution Artifacts\n        run: |\n          mv artifact-qwik/* packages/qwik/\n          mkdir -p packages/qwik-city/lib/\n          mv artifact-qwikcity/* packages/qwik-city/lib/\n          mkdir -p packages/create-qwik/dist/\n          mv artifact-create-qwik/* packages/create-qwik/dist/\n          mkdir -p packages/eslint-plugin-qwik/dist/\n          mv artifact-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/\n          mv artifact-qwiklabs/lib packages/qwik-labs/lib\n          mv artifact-qwiklabs/vite packages/qwik-labs/vite\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - run: pnpm install --frozen-lockfile\n      - name: Build Qwik Insights\n        run: pnpm run build.packages.insights\n\n      - name: Save Insights Cache\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-insights }}\n          path: |\n            packages/insights/dist\n            packages/insights/.netlify\n\n  ############ BUILD DOCS ############\n  build-docs:\n    if: always() && needs.changes.outputs.build-docs == 'true'\n    name: Build Docs\n    needs:\n      - changes\n      - build-other-packages\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Verify build-other-packages\n        if: needs.build-other-packages.result != 'success'\n        run: exit 1\n\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - name: Download Build Artifacts\n        uses: actions/download-artifact@v4\n\n      - name: Move Distribution Artifacts\n        run: |\n          mv artifact-qwik/* packages/qwik/\n          mkdir -p packages/qwik-city/lib/\n          mv artifact-qwikcity/* packages/qwik-city/lib/\n          mkdir -p packages/create-qwik/dist/\n          mv artifact-create-qwik/* packages/create-qwik/dist/\n          mkdir -p packages/eslint-plugin-qwik/dist/\n          mv artifact-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/\n          mv artifact-qwiklabs/lib packages/qwik-labs/lib\n          mv artifact-qwiklabs/vite packages/qwik-labs/vite\n          mv artifact-qwikreact/lib packages/qwik-react/lib\n\n      - run: pnpm install --frozen-lockfile\n      - name: Build Qwik Docs\n        run: pnpm run build.packages.docs && echo ok > docs-build-completed.txt\n\n      - name: Save Docs Artifacts\n        uses: actions/upload-artifact@v4\n        with:\n          name: artifact-docs\n          include-hidden-files: true\n          path: |\n            packages/docs/dist\n            packages/docs/server\n\n      - name: Save Docs Cache\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-docs }}\n          path: docs-build-completed.txt\n\n  ############ UNIT TEST ############\n  test-unit:\n    name: Unit Tests\n    if: always() && needs.changes.outputs.build-unit == 'true'\n    runs-on: ubuntu-latest\n    needs:\n      - changes\n      - build-other-packages\n\n    steps:\n      - name: Verify build-other-packages\n        if: needs.build-other-packages.result != 'success'\n        run: exit 1\n\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - name: Download Build Artifacts\n        uses: actions/download-artifact@v4\n\n      - name: Move Distribution Artifacts\n        run: |\n          mv artifact-qwik/* packages/qwik/\n          mkdir -p packages/qwik-city/lib/\n          mv artifact-qwikcity/* packages/qwik-city/lib/\n          mkdir -p packages/create-qwik/dist/\n          mv artifact-create-qwik/* packages/create-qwik/dist/\n          mkdir -p packages/eslint-plugin-qwik/dist/\n          mv artifact-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/\n\n      - run: pnpm install --frozen-lockfile\n\n      - name: Unit Tests\n        run: pnpm run test.unit && echo ok > unit-tests-completed.txt\n\n      - name: Save unit tests cache\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-unit }}\n          path: unit-tests-completed.txt\n\n  ############ E2E TEST ############\n  test-e2e:\n    # Sometimes the tests just hang\n    timeout-minutes: 20\n    name: E2E Tests\n    if: always() && needs.changes.outputs.build-e2e == 'true'\n\n    needs:\n      - build-other-packages\n      - changes\n      - test-unit\n\n    strategy:\n      matrix:\n        settings:\n          - host: ubuntu-latest\n            browser: chromium\n          # too slow and flaky. Perhaps better in v2?\n          # - host: ubuntu-latest\n          #   browser: firefox\n          - host: macos-latest\n            browser: webkit\n          - host: windows-latest\n            browser: chromium\n\n    runs-on: ${{ matrix.settings.host }}\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - name: Download Build Artifacts\n        uses: actions/download-artifact@v4\n\n      - name: Move Distribution Artifacts\n        run: |\n          mv artifact-qwik/* packages/qwik/\n          mkdir -p packages/qwik-city/lib/\n          mv artifact-qwikcity/* packages/qwik-city/lib/\n          mkdir -p packages/create-qwik/dist/\n          mv artifact-create-qwik/* packages/create-qwik/dist/\n          mkdir -p packages/eslint-plugin-qwik/dist/\n          mv artifact-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/\n          mkdir -p packages/qwik-react/lib/\n          mv artifact-qwikreact/lib/* packages/qwik-react/lib/\n\n      - run: pnpm install --frozen-lockfile\n\n      - name: Install Playwright\n        run: npx playwright install ${{ matrix.settings.browser }} --with-deps\n\n      - name: Playwright E2E Tests\n        run: pnpm run test.e2e.${{ matrix.settings.browser }} --timeout 60000 --retries 7 --workers 1\n\n      - name: Playwright E2E Integration Tests\n        run: pnpm run test.e2e.integrations.${{ matrix.settings.browser }} --timeout 60000 --retries 7 --workers 1\n\n      - name: Playwright E2E Qwik React Tests\n        run: pnpm run test.e2e.qwik-react.${{ matrix.settings.browser }} --timeout 60000 --retries 7 --workers 1\n\n      - name: Validate Create Qwik Cli\n        if: matrix.settings.host != 'windows-latest'\n        run: pnpm cli.validate\n\n  ############ E2E CLI TEST ############\n  test-cli-e2e:\n    name: E2E CLI Tests\n    if: always() && needs.changes.outputs.build-cli-e2e == 'true'\n\n    needs:\n      - build-other-packages\n      - changes\n      - test-unit\n\n    strategy:\n      matrix:\n        settings:\n          - host: ubuntu-latest\n          - host: macos-latest\n          - host: windows-latest\n\n    runs-on: ${{ matrix.settings.host }}\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - name: Download Build Artifacts\n        uses: actions/download-artifact@v4\n\n      - name: Move Distribution Artifacts\n        run: |\n          mv artifact-qwik/* packages/qwik/\n          mkdir -p packages/qwik-city/lib/\n          mv artifact-qwikcity/* packages/qwik-city/lib/\n          mkdir -p packages/create-qwik/dist/\n          mv artifact-create-qwik/* packages/create-qwik/dist/\n          mkdir -p packages/eslint-plugin-qwik/dist/\n          mv artifact-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/\n\n      - run: pnpm install --frozen-lockfile\n\n      - name: CLI E2E Tests\n        run: pnpm run test.e2e.cli\n\n  ########### LINT PACKAGES ############\n  lint-package:\n    name: Lint Package\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - run: pnpm install --frozen-lockfile\n\n      - name: SyncPack Check\n        if: always()\n        run: pnpm run lint.syncpack\n\n      - name: Prettier Check\n        if: always()\n        run: pnpm run lint.prettier\n\n      - name: Build ESLint\n        if: always()\n        run: pnpm build --eslint\n\n      - name: ESLint Check\n        if: always()\n        run: pnpm run lint.eslint\n\n  ############ RELEASE ############\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n\n    needs:\n      - changes\n      - test-unit\n      - test-e2e\n      - test-cli-e2e\n    # test-unit runs when any packages changes, so we have to release\n    # on \"upcoming\", we always check if we have something to release\n    # don't run on forks\n    if: |\n      always() && \n      github.repository == 'QwikDev/qwik' && (\n        github.ref == 'refs/heads/upcoming' ||\n        needs.test-unit.result == 'success' || \n        needs.test-unit.result == 'skipped'\n      )\n\n    steps:\n      - name: Verify test-e2e\n        if: needs.test-e2e.result != 'skipped'\n        run: |\n          if [ \"${{ needs.test-e2e.result }}\" != success ] ; then\n            exit 1\n          else\n            echo ok > e2e-tests-completed.txt\n          fi\n      - name: Save e2e tests cache\n        if: needs.test-e2e.result != 'skipped'\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-e2e }}\n          path: e2e-tests-completed.txt\n\n      - name: Verify test-cli-e2e\n        if: needs.test-cli-e2e.result != 'skipped'\n        run: |\n          if [ \"${{ needs.test-cli-e2e.result }}\" != success ] ; then\n            exit 1\n          else\n            echo ok > cli-e2e-tests-completed.txt\n          fi\n      - name: Save cli-e2e tests cache\n        if: needs.test-cli-e2e.result != 'skipped'\n        uses: actions/cache/save@v4\n        with:\n          key: ${{ needs.changes.outputs.hash-cli-e2e }}\n          path: cli-e2e-tests-completed.txt\n\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - uses: pnpm/action-setup@v4\n      - name: Setup Node\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.x\n          cache: 'pnpm'\n          registry-url: https://registry.npmjs.org/\n\n      - name: Download Build Artifacts\n        uses: actions/download-artifact@v4\n\n      - name: Move Distribution Artifacts\n        run: |\n          mv artifact-qwik/* packages/qwik/\n          mkdir -p packages/qwik-city/lib/\n          mv artifact-qwikcity/* packages/qwik-city/lib/\n          mkdir -p packages/create-qwik/dist/\n          mv artifact-create-qwik/* packages/create-qwik/dist/\n          mkdir -p packages/eslint-plugin-qwik/dist/\n          mv artifact-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/\n          mv artifact-qwiklabs/lib packages/qwik-labs/lib\n          mv artifact-qwiklabs/vite packages/qwik-labs/vite\n          mv artifact-qwikreact/lib packages/qwik-react/lib\n          rm -rf artifact-*\n\n      - run: pnpm install --frozen-lockfile\n\n      # Do this before other release steps to avoid\n      # publishing temporary files\n      - name: Create Release Pull Request or Publish to npm\n        if: github.ref == 'refs/heads/upcoming'\n        id: changesets\n        uses: changesets/action@v1\n        with:\n          publish: pnpm release\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Fixup package.json files\n        run: pnpm run release.fixup-package-json\n\n      - name: Commit Build Artifacts\n        if: github.event_name == 'push'\n        env:\n          QWIK_API_TOKEN_GITHUB: ${{ secrets.QWIK_API_TOKEN_GITHUB }}\n        run: pnpm run qwik-push-build-repos\n\n      - name: Publish packages for testing\n        if: github.event_name != 'workflow_dispatch'\n        run: pnpm release.pkg-pr-new\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n  ############ TRIGGER QWIKCITY E2E TEST ############\n  trigger-qwikcity-e2e:\n    name: Trigger Qwik City E2E\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs/heads/upcoming'\n\n    needs:\n      - changes\n      - release\n\n    steps:\n      - name: Repository Dispatch\n        uses: peter-evans/repository-dispatch@v2\n        with:\n          token: ${{ secrets.QWIK_API_TOKEN_GITHUB }}\n          repository: builderIO/qwik-city-e2e\n          event-type: main-updated\n\n  ############ Everything is fine ############\n  requirements-passed:\n    name: All requirements are met\n    runs-on: ubuntu-latest\n    needs:\n      - test-unit\n      - test-e2e\n      - test-cli-e2e\n      - lint-package\n      - build-docs\n      - build-insights\n    if: always()\n    steps:\n      - name: check status\n        if: |\n          !(\n            (needs.test-unit.result == 'success' || needs.test-unit.result == 'skipped') &&\n            (needs.test-e2e.result == 'success' || needs.test-e2e.result == 'skipped') &&\n            (needs.test-cli-e2e.result == 'success' || needs.test-cli-e2e.result == 'skipped') &&\n            (needs.lint-package.result == 'success' || needs.lint-package.result == 'skipped') &&\n            (needs.build-docs.result == 'success' || needs.build-docs.result == 'skipped') &&\n            (needs.build-insights.result == 'success' || needs.build-insights.result == 'skipped')\n          )\n        run: exit 1\n"
  },
  {
    "path": ".github/workflows/closing-issues.yml",
    "content": "name: Closing Issues For Inactivity\n\non:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  close-issues:\n    if: github.repository == 'QwikDev/qwik'\n    runs-on: ubuntu-latest\n    steps:\n      - name: needs reproduction\n        uses: actions-cool/issues-helper@v3\n        with:\n          actions: 'close-issues'\n          token: ${{ secrets.GITHUB_TOKEN }}\n          labels: 'STATUS-2: needs reproduction'\n          inactive-day: 14\n\n      - name: missing info\n        uses: actions-cool/issues-helper@v3\n        with:\n          actions: 'close-issues'\n          token: ${{ secrets.GITHUB_TOKEN }}\n          labels: 'STATUS-2: missing info'\n          inactive-day: 14\n"
  },
  {
    "path": ".github/workflows/deploy-docs.yml",
    "content": "# a workflow that runs after the \"Qwik CI\" workflow is successful\n# and deploys the documentation to CloudFlare Pages.\n\nname: Deploy Docs\n\non:\n  workflow_run:\n    workflows: ['Qwik CI']\n    types:\n      - completed\n\npermissions:\n  actions: read\n  deployments: write\n  contents: read\n  pull-requests: write\n\njobs:\n  deploy:\n    name: Cloudflare Pages Deployment\n    if: >\n      github.repository == 'QwikDev/qwik'\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check for docs artifact\n        id: check-artifact\n        uses: actions/github-script@v7\n        with:\n          retries: 3\n          script: |\n            try {\n              const artifacts = await github.rest.actions.listWorkflowRunArtifacts({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                run_id: context.payload.workflow_run.id\n              });\n              const hasDocsArtifact = artifacts.data.artifacts.some(a => a.name === 'artifact-docs');\n              core.setOutput('has-docs', hasDocsArtifact);\n            } catch (error) {\n              console.error('Error checking for artifacts:', error);\n              core.setOutput('has-docs', false);\n            }\n\n      - name: Checkout code\n        if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}\n        uses: actions/checkout@v5\n\n      - name: Download docs artifact\n        if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}\n        uses: actions/download-artifact@v4\n        with:\n          name: artifact-docs\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          run-id: ${{ github.event.workflow_run.id }}\n          path: packages/docs\n\n      - name: Verify dist directory exists\n        if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}\n        run: |\n          ls -la packages/docs\n          if [ ! -d \"packages/docs/dist\" ]; then\n            echo \"Creating dist directory\"\n            mkdir -p packages/docs/dist\n            cp -r packages/docs/* packages/docs/dist/ || true\n          fi\n\n      # not the official version, so be careful when updating\n      - name: Deploy to Cloudflare Pages\n        if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}\n        uses: AdrianGonz97/refined-cf-pages-action@6c0d47ff7c97c48fa702b6d9f71f7e3a7c30c7d8\n        with:\n          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}\n          projectName: 'qwik-docs'\n          directory: packages/docs/dist\n          githubToken: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Skip message when no docs artifact\n        if: ${{ steps.check-artifact.outputs.has-docs != 'true' }}\n        run: echo \"No docs artifact found, skipping deployment\"\n"
  },
  {
    "path": ".github/workflows/labeling-issues.yml",
    "content": "name: Labling Issues\n\non:\n  issues:\n    types: [labeled]\n\njobs:\n  handle-labeled:\n    if: github.repository == 'QwikDev/qwik'\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: ensure STATUS-1 label is present\n        id: status-1-label-presence\n        # GH's built-in functions do not allow to search for array values that start with something, so we're using node for this\n        run: |\n          echo present=$( \n            node -e '\n              const labels = JSON.parse(`${{ toJSON(github.event.issue.labels.*.name) }}`);\n              console.log(labels.some(l => l.startsWith(\"STATUS-1:\")));\n            ' \n          ) >> $GITHUB_OUTPUT\n      - name: remove needs triage\n        if: steps.status-1-label-presence.outputs.present == 'true' && (contains(github.event.label.name, 'STATUS-2:') || contains(github.event.label.name, 'STATUS-3:'))\n        uses: actions-cool/issues-helper@v3\n        with:\n          actions: 'remove-labels'\n          token: ${{ secrets.GITHUB_TOKEN }}\n          issue-number: ${{ github.event.issue.number }}\n          labels: 'STATUS-1: needs triage'\n\n      - name: needs reproduction time limit\n        if: contains(github.event.label.name, 'needs reproduction')\n        uses: actions-cool/issues-helper@v3\n        with:\n          actions: 'create-comment'\n          token: ${{ secrets.GITHUB_TOKEN }}\n          issue-number: ${{ github.event.issue.number }}\n          body: |\n            Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://qwik.new). \n            [Here](https://antfu.me/posts/why-reproductions-are-required#why-reproduction) is why we really need a minimal reproduction. \n            Issues marked with `needs reproduction` will be automatically closed if they have no activity within 14 days.\n            Thanks 🙏\n\n      - name: missing info time limit\n        if: contains(github.event.label.name, 'missing info')\n        uses: actions-cool/issues-helper@v3\n        with:\n          actions: 'create-comment'\n          token: ${{ secrets.GITHUB_TOKEN }}\n          issue-number: ${{ github.event.issue.number }}\n          body: |\n            Hello @${{ github.event.issue.user.login }}. Please provide the missing information requested above. \n            Issues marked with `missing info` will be automatically closed if they have no activity within 14 days.\n            Thanks 🙏\n"
  },
  {
    "path": ".gitignore",
    "content": "# Keep \"OS\" and \"IDE and local environment\" ignores on your local machine in user home\n# git config --global core.excludesFile ~/.gitignore\n# https://git-scm.com/docs/gitignore\n\n# OS\n**/.DS_Store\netc\ntemp\n.history\n.lh\n*.\n**/*.log\n*.node\n\n# Application\nqwik-app/\n/server/\n/starters/**/server/\n/packages/*/server/\n!/packages/qwik/server/\n/packages/*/src/styled-system/\ntodo-express/\ntarget\n!/packages/docs/src/routes/demo/events/target\nsrc/napi/package-*\n\n# Node\nnode_modules\n\n# Artifacts\ntsc-out\ndist\ndist-dev\nexternal\nlib\ntsdoc-metadata.json\npackages/qwik/bindings\n\n# IDE and local environment\n.idea\n.eslintcache\ntest-results\n.direnv\n\n# Package Managers\n.yarn/*\n!.yarn/releases\n.pnpm-store/*\n\n# Local Netlify folder\n.netlify\nsandbox\n\n# AI tools\n.planning\n\n# We need to ignore this because \"changesets\" will try to replace it\n/CHANGELOG.md"
  },
  {
    "path": ".node-version",
    "content": "24\n"
  },
  {
    "path": ".nvmrc",
    "content": "24\n"
  },
  {
    "path": ".prettierignore",
    "content": "**/**.api.md\n**/*.log\n**/.DS_Store\n*.\npnpm-lock.yaml\n.*\n!.eslintrc.cjs\n!.prettierignore\n!.prettierrc.json\n\n# Build output\ndist\ndist-dev\nlib\ntarget\nstarters/apps/**/dist\nnode_modules\n\ntsconfig.tsbuildinfo\n\n# REPL files\npackages/docs/public/repl/repl-sw.js*\n\n# build output\npackages/*/lib\npackages/*/dist\npackages/*/server\n\n# API output files\npackages/docs/src/routes/api\n\n# Prettier doesn't handle mdx files well\npackages/docs/**/*.mdx\n\npackages/insights/drizzle\npackages/insights/.netlify\npackages/insights/scripts\npackages/insights/**/*.gen.d.ts\npackages/qwik-labs/lib-types\npackages/qwik-labs/vite\n\n# insights cache files\n**/q-insights.json\n\n# Exclude builder js files from formatting - delete after migration\npackages/docs/public/builder\n"
  },
  {
    "path": ".prettierrc.json",
    "content": "{\n  \"plugins\": [\"./node_modules/prettier-plugin-jsdoc/dist/index.js\"],\n  \"jsdocPreferCodeFences\": true,\n  \"tsdoc\": true,\n  \"trailingComma\": \"es5\",\n  \"tabWidth\": 2,\n  \"semi\": true,\n  \"singleQuote\": true,\n  \"printWidth\": 100,\n  \"useTabs\": false\n}\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\n    \"dbaeumer.vscode-eslint\",\n    \"unifiedjs.vscode-mdx\",\n    \"esbenp.prettier-vscode\",\n    \"ms-playwright.playwright\",\n    \"rust-lang.rust-analyzer\",\n    \"ms-azuretools.vscode-docker\",\n    \"manucorporat.vermoji\",\n    \"vadimcn.vscode-lldb\",\n    \"streetsidesoftware.code-spell-checker\",\n    \"vitest.explorer\"\n  ],\n  \"unwantedRecommendations\": []\n}\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n  // Use IntelliSense to learn about possible attributes.\n  // Hover to view descriptions of existing attributes.\n  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"name\": \"docs dev.debug\",\n      \"request\": \"launch\",\n      \"skipFiles\": [\"<node_internals>/**\"],\n      \"cwd\": \"${workspaceFolder}/packages/docs\",\n      \"program\": \"${workspaceFolder}/packages/docs/node_modules/vite/bin/vite.js\",\n      \"args\": [\"--mode\", \"ssr\", \"--force\"]\n    },\n    {\n      \"type\": \"node\",\n      \"name\": \"insights dev.debug\",\n      \"request\": \"launch\",\n      \"skipFiles\": [\"<node_internals>/**\"],\n      \"cwd\": \"${workspaceFolder}/packages/insights\",\n      \"program\": \"${workspaceFolder}/packages/insights/node_modules/vite/bin/vite.js\",\n      \"args\": [\"--mode\", \"ssr\", \"--force\"]\n    },\n    {\n      \"type\": \"node\",\n      \"name\": \"docs build.client\",\n      \"request\": \"launch\",\n      \"skipFiles\": [\"<node_internals>/**\"],\n      \"cwd\": \"${workspaceFolder}/packages/docs\",\n      \"program\": \"${workspaceFolder}/packages/docs/node_modules/vite/bin/vite.js\",\n      \"args\": [\"build\"]\n    },\n    {\n      \"type\": \"node\",\n      \"name\": \"docs build.server\",\n      \"request\": \"launch\",\n      \"skipFiles\": [\"<node_internals>/**\"],\n      \"cwd\": \"${workspaceFolder}/packages/docs\",\n      \"program\": \"${workspaceFolder}/packages/docs/node_modules/vite/bin/vite.js\",\n      \"args\": [\"build\", \"-c\", \"adapters/cloudflare-pages/vite.config.mts\"]\n    },\n    {\n      \"type\": \"node\",\n      \"name\": \"preloader-test build.client\",\n      \"request\": \"launch\",\n      \"runtimeExecutable\": \"pnpm\",\n      \"runtimeArgs\": [\n        \"run\",\n        \"build.client\"\n      ],\n      \"skipFiles\": [\"<node_internals>/**\"],\n      \"cwd\": \"${workspaceFolder}/starters/apps/preloader-test\"\n    },\n    {\n      \"type\": \"node\",\n      \"name\": \"e2e.test\",\n      \"request\": \"launch\",\n      \"console\": \"integratedTerminal\",\n      \"internalConsoleOptions\": \"neverOpen\",\n      \"program\": \"${workspaceFolder}/./node_modules/tsm/bin.js\",\n      \"cwd\": \"${workspaceFolder}\",\n      \"args\": [\"./starters/dev-server.ts\", \"3301\"]\n    },\n    {\n      \"type\": \"node\",\n      \"name\": \"vitest\",\n      \"request\": \"launch\",\n      \"console\": \"integratedTerminal\",\n      \"internalConsoleOptions\": \"neverOpen\",\n      \"program\": \"${workspaceFolder}/./node_modules/vitest/vitest.mjs\",\n      \"cwd\": \"${workspaceFolder}\",\n      \"args\": [\"${file}\"]\n    }\n  ]\n}\n"
  },
  {
    "path": ".vscode/qwik.code-snippets",
    "content": "{\n  \"Qwik component\": {\n    \"scope\": \"typescriptreact\",\n    \"prefix\": \"q:component w/props\",\n    \"description\": \"Qwik component w/ props\",\n    \"body\": [\n      \"export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}}Props {\",\n      \"  $2\",\n      \"}\",\n      \"\",\n      \"export const $1 = component$((props: $1Props) => {\",\n      \"  const state = useStore({\",\n      \"    $3\",\n      \"  });\",\n      \"  \",\n      \"  return <${4:button} on${5:Click}$={(${6:e}) => {$7}}>$8</${4}>\",\n      \"});\",\n    ],\n  },\n  \"Qwik component (simple)\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:component simple\",\n    \"description\": \"Simple Qwik component\",\n    \"body\": [\n      \"export const ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}} = component$(() => {\",\n      \"  return <${2:button}>$4</$2>\",\n      \"});\",\n    ],\n  },\n  \"Qwik state\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useStore$\",\n    \"description\": \"useStore() declaration\",\n    \"body\": [\"const ${1:state} = useStore({\", \"  $2\", \"});\", \"$0\"],\n  },\n  \"Qwik signal\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useSignal\",\n    \"description\": \"useSignal() declaration\",\n    \"body\": [\"const ${1:signal} = useSignal($2);\", \"$0\"],\n  },\n  \"$ hook\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:$\",\n    \"description\": \"$() function hook\",\n    \"body\": [\"$(() => {\", \"  $0\", \"});\", \"\"],\n  },\n  \"useVisibleTask\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useVisibleTask\",\n    \"description\": \"useVisibleTask$() function hook\",\n    \"body\": [\"useVisibleTask$(({ track }) => {\", \"  $0\", \"});\", \"\"],\n  },\n  \"useTask\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useTask\",\n    \"description\": \"useTask$() function hook\",\n    \"body\": [\"useTask$(({ track }) => {\", \"  track(() => $1);\", \"  $0\", \"});\", \"\"],\n  },\n  \"useResource\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useResource$\",\n    \"description\": \"useResource$() declaration\",\n    \"body\": [\"const $1 = useResource$(({ track, previous, cleanup }) => {\", \"  $0\", \"});\", \"\"],\n  },\n  \"useOn\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useOn\",\n    \"description\": \"useOn declaration\",\n    \"body\": [\"useOn(\", \"'$1',\", \"$((event) => {\", \"  const { $3 } = event as $2;\", \"  })\", \");\"],\n  },\n  \"useOnDocument\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useOnDocument\",\n    \"description\": \"useOnDocument declaration\",\n    \"body\": [\n      \"useOnDocument(\",\n      \"'$1',\",\n      \"$((event) => {\",\n      \"  const { $3 } = event as $2;\",\n      \"  })\",\n      \");\",\n    ],\n  },\n  \"useOnWindow\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q:useOnWindow\",\n    \"description\": \"useOnWindow declaration\",\n    \"body\": [\n      \"useOnWindow(\",\n      \"'$1',\",\n      \"$((event) => {\",\n      \"  const { $3 } = event as $2;\",\n      \"  })\",\n      \");\",\n    ],\n  },\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"vitest.include\": [\"**/*.unit.{js,mjs,cjs,ts,mts,cts,jsx,tsx}\"],\n  \"vitest.exclude\": [\n    \"**/node_modules/**\",\n    \"**/dist/**\",\n    \"**/dist-dev/**\",\n    \"**/cypress/**\",\n    \"**/.{idea,git,cache,output,temp}/**\"\n  ],\n  \"javascript.preferences.autoImportFileExcludePatterns\": [\"node:test\"],\n  \"typescript.preferences.preferTypeOnlyAutoImports\": true,\n  \"typescript.tsdk\": \"./node_modules/typescript/lib\",\n  \"typescript.enablePromptUseWorkspaceTsdk\": true\n}\n"
  },
  {
    "path": "@types/bun.d.ts",
    "content": "declare const Bun: {\n  fileURLToPath: (url: string) => string;\n  env: any;\n  file: (path: string) => {\n    text: () => Promise<string>;\n    stream: () => Promise<ReadableStream<Uint8Array>>;\n  };\n};\n"
  },
  {
    "path": "@types/deno.d.ts",
    "content": "declare module 'https://deno.land/std/path/mod.ts' {\n  export function extname(paths: string): string;\n  export function fromFileUrl(url: string): string;\n  export function join(...paths: string[]): string;\n}\n\ninterface FsFile {\n  readable: ReadableStream<Uint8Array>;\n}\ndeclare const Deno: {\n  env: any;\n  open(path: string, mode: { read: boolean }): Promise<FsFile>;\n  readTextFile(path: string): Promise<string>;\n  readFile(path: string): Promise<Uint8Array>;\n  version: {\n    deno: string;\n  };\n};\n"
  },
  {
    "path": "AGENTS.md",
    "content": "# Qwik — AI Agent Instructions\n\n> Canonical instruction file for AI coding agents working on the Qwik monorepo.\n> For detailed contributor setup, see [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Overview\n\nQwik is a **resumable** web framework — it serializes application state and framework state into HTML during SSR, then resumes on the client without re-executing component code. This enables it to stream javascript (a.k.a javascript streaming). There’s no waiting for the entire code to be downloaded (a.k.a hydration). The developer can write code very similar to other reactive frameworks; the app is automatically instant, regardless the amount of javascript.\n\n**Key concepts:** Resumability, QRLs (lazy-loading primitives), the `$` suffix transform, fine-grained signals, and the Rust-based optimizer.\n\n## Monorepo Layout\n\n| Package                   | Path                          | Description                                    |\n| ------------------------- | ----------------------------- | ---------------------------------------------- |\n| `@builder.io/qwik`        | `packages/qwik`               | Core framework (runtime + optimizer)           |\n| `@builder.io/qwik-city`   | `packages/qwik-city`          | Meta-framework (routing, middleware, adapters) |\n| `@builder.io/qwik-react`  | `packages/qwik-react`         | React integration layer                        |\n| `@builder.io/qwik-auth`   | `packages/qwik-auth`          | Auth.js integration                            |\n| `@builder.io/qwik-dom`    | `packages/qwik-dom`           | Server-side DOM implementation                 |\n| `@builder.io/qwik-worker` | `packages/qwik-worker`        | Web Worker support (experimental)              |\n| `@builder.io/qwik-labs`   | `packages/qwik-labs`          | Experimental features (private)                |\n| `eslint-plugin-qwik`      | `packages/eslint-plugin-qwik` | ESLint rules for Qwik                          |\n| `create-qwik`             | `packages/create-qwik`        | Project scaffolding CLI                        |\n| `qwik-docs`               | `packages/docs`               | Documentation site (private)                   |\n| `insights`                | `packages/insights`           | Analytics dashboard (private)                  |\n\n## Setup\n\n**Requirements:** Node ≥22.18.0, pnpm ≥10.14.0\n\n```bash\npnpm install\npnpm build.local    # builds everything without Rust (copies optimizer from npm)\n```\n\nUse `pnpm build.full` only if you modified Rust/optimizer code.\n\nPrefer `pnpm build --qwik --qwikcity --dev` to build qwik and qwik-city faster.\n\n## Key Commands\n\n| Task                     | Command                  | Notes                                       |\n| ------------------------ | ------------------------ | ------------------------------------------- |\n| **Install**              | `pnpm install`           |                                             |\n| **Install**              | `pnpm install`           |                                             |\n| **Build (no Rust)**      | `pnpm build.local`       | For a fresh start                           |\n| **Build (with Rust)**    | `pnpm build.full`        | Only for optimizer changes                  |\n| **Build core only**      | `pnpm build.core`        | Fast — just Qwik + Qwik City + types        |\n| **Watch mode**           | `pnpm build.watch`       | Rebuilds on change                          |\n| **Unit tests**           | `pnpm test.unit`         | Vitest — runs `packages/**/*.unit.{ts,tsx}` |\n| **E2E tests (Chromium)** | `pnpm test.e2e.chromium` | Playwright                                  |\n| **E2E tests (City)**     | `pnpm test.e2e.city`     | Qwik City–specific E2E                      |\n| **Lint**                 | `pnpm lint`              | ESLint + Prettier + Rust lint               |\n| **Lint fix**             | `pnpm lint.fix`          | Auto-fix ESLint issues                      |\n| **Format**               | `pnpm fmt`               | Prettier + syncpack                         |\n| **Type check**           | `pnpm tsc.check`         | Full TypeScript check                       |\n| **Update API docs**      | `pnpm api.update`        | Regenerates public API `.md` files          |\n| **Create changeset**     | `pnpm change`            | Interactive — creates `.changeset/*.md`     |\n| **Dev server**           | `pnpm serve`             | Port 3300                                   |\n| **Docs dev**             | `pnpm docs.dev`          | Documentation site                          |\n\n### Running a Single Test File\n\n```bash\n# Unit test — single file\npnpm vitest run packages/qwik/src/core/qrl/qrl.unit.ts\n\n# E2E test — single file\npnpm playwright test starters/e2e/e2e.events.spec.ts --project chromium\n```\n\n## Architecture Essentials\n\n### Resumability\n\nQwik serializes the full application state into HTML at SSR time. On the client, it **resumes** from that serialized state instead of re-executing components (no hydration). The serialization/deserialization logic lives in `packages/qwik/src/core/container/`.\n\n### QRL & the `$` Transform\n\nA **QRL** (Qwik Resource Locator) is a lazy reference to a closure. Any function ending with `$` (e.g., `component$`, `useTask$`, `$()`) creates a QRL boundary — the optimizer extracts these into separate chunks for lazy loading.\n\n- QRL implementation: `packages/qwik/src/core/qrl/`\n- The Rust optimizer rewrites `$`-suffixed calls at build time\n\n### Signals\n\nFine-grained reactivity system. Signals track subscriptions and update only the DOM nodes or tasks that read them — no virtual DOM diffing.\n\n- Implementation: `packages/qwik/src/core/state/signal.ts`\n- Stores (proxy-based deep reactivity): `packages/qwik/src/core/state/store.ts`\n\n### Optimizer (Rust)\n\nThe optimizer is a Rust-based compiler plugin (SWC transform) that:\n\n1. Extracts `$`-suffixed closures into separate entry points\n2. Captures lexical scope for serialization\n3. Generates manifest metadata for prefetching\n\n- Rust source: `packages/qwik/src/optimizer/core/`\n- WASM build: `packages/qwik/src/wasm/`\n- Native bindings: `packages/qwik/src/napi/`\n\n### Qwik City (Meta-framework)\n\nQwik City provides file-based routing, data loaders (`routeLoader$`), actions (`routeAction$`), middleware, and server adapters.\n\n- Runtime: `packages/qwik-city/src/runtime/`\n- Build tooling: `packages/qwik-city/src/buildtime/`\n- Adapters: `packages/qwik-city/src/adapters/`\n\n## Code Style\n\n**Config:** Prettier (`.prettierrc.json`) + ESLint 9 flat config (`eslint.config.js`)\n\n| Rule           | Setting                    |\n| -------------- | -------------------------- |\n| Semi           | `true`                     |\n| Quotes         | Single                     |\n| Print width    | 100                        |\n| Tabs           | Spaces (2)                 |\n| Trailing comma | ES5                        |\n| `no-console`   | Error (warn/error allowed) |\n| `curly`        | Always required            |\n\n### Naming Conventions\n\n| Pattern        | Usage                                             | Example                             |\n| -------------- | ------------------------------------------------- | ----------------------------------- |\n| `use*`         | Hooks (must be called in component or task scope) | `useSignal`, `useStore`, `useTask$` |\n| `*$`           | QRL boundary — optimizer extracts the closure     | `component$`, `routeLoader$`        |\n| `create*`      | Factory functions                                 | `createDOM`, `createContextId`      |\n| `*.unit.ts(x)` | Unit test files                                   | `qrl.unit.ts`                       |\n| `*.spec.ts`    | E2E test files                                    | `e2e.events.spec.ts`                |\n\n## Testing\n\n### Unit Tests (Vitest)\n\n- File pattern: `*.unit.ts` / `*.unit.tsx`\n- Config: `vitest.config.ts` (root)\n- Run all: `pnpm test.unit`\n- Run one: `pnpm vitest run <path>`\n- Server-side DOM helper: `createDOM()` from `@builder.io/qwik/testing`\n\n### E2E Tests (Playwright)\n\n- File pattern: `*.spec.ts` in `starters/e2e/`\n- Config: `starters/playwright.config.ts`\n- Run: `pnpm test.e2e.chromium`\n- Run one: `pnpm playwright test <path> --project chromium`\n- Additional E2E suites: `e2e/adapters-e2e/`, `e2e/docs-e2e/`, `e2e/qwik-react-e2e/`\n\n### Rust Tests\n\n- Run: `pnpm test.rust` (or `make test`)\n- Update snapshots: `pnpm test.rust.update` (or `make test-update`)\n\n## Git Workflow\n\n### Commit Convention\n\n```\ntype(scope): description\n```\n\nTypes: `feat`, `fix`, `docs`, `lint`, `refactor`, `perf`, `test`, `chore`\n\n- Use imperative mood (\"add feature\" not \"added feature\")\n- No trailing period\n- Scope is optional but encouraged (e.g., `fix(qwik-city): ...`)\n\n### Changesets\n\nIf your change affects published packages, create a changeset:\n\n```bash\npnpm change\n```\n\nThis creates a `.changeset/*.md` file describing the change. The core packages (`@builder.io/qwik`, `@builder.io/qwik-city`, `eslint-plugin-qwik`, `create-qwik`) are **fixed-versioned** — they always release together.\n\n### Branch Strategy\n\n- **Base branch:** `main` (trunk-based development)\n- PRs target `main`\n- CI runs on all PRs\n\n### Before Pushing a PR\n\n1. `pnpm build.core`\n2. `pnpm test.unit` (run relevant tests)\n3. `pnpm lint`\n4. `pnpm api.update` (if you changed public API)\n5. `pnpm change` (to document patches or new features)\n\n## Boundaries — What NOT to Do\n\n1. **Don't run the full test suite** — Use `pnpm test.unit` or target specific files. The full `pnpm test` runs build + all tests and takes a very long time.\n2. **Don't forget `pnpm api.update`** — If you change any public API, CI will fail without regenerated API docs.\n3. **Don't modify Rust code without rebuilding** — After touching `packages/qwik/src/optimizer/core/`, run `pnpm build.full` (requires Rust toolchain + wasm-pack).\n4. **Don't skip changesets for user-facing changes** — CI checks for changesets on PRs that touch published packages.\n5. **Don't commit `.only` tests** — ESLint rule `no-only-tests` blocks this.\n6. **Don't edit generated files** — Files in `dist/`, `lib/`, and API docs under `packages/docs/` are generated. Edit the source instead.\n"
  },
  {
    "path": "CLAUDE.md",
    "content": "@AGENTS.md\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participation in our\ncommunity a harassment-free experience for everyone, regardless of age, body\nsize, visible or invisible disability, ethnicity, sex characteristics, gender\nidentity and expression, level of experience, education, socio-economic status,\nnationality, personal appearance, race, religion, or sexual identity\nand orientation.\n\nWe pledge to act and interact in ways that contribute to an open, welcoming,\ndiverse, inclusive, and healthy community.\n\n## Our Standards\n\nExamples of behavior that contributes to a positive environment for our\ncommunity include:\n\n- Demonstrating empathy and kindness toward other people\n- Being respectful of differing opinions, viewpoints, and experiences\n- Giving and gracefully accepting constructive feedback\n- Accepting responsibility and apologizing to those affected by our mistakes,\n  and learning from the experience\n- Focusing on what is best not just for us as individuals, but for the\n  overall community\n\nExamples of unacceptable behavior include:\n\n- The use of sexualized language or imagery, and sexual attention or\n  advances of any kind\n- Trolling, insulting or derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or email\n  address, without their explicit permission\n- Other conduct which could reasonably be considered inappropriate in a\n  professional setting\n\n## Enforcement Responsibilities\n\nCommunity leaders are responsible for clarifying and enforcing our standards of\nacceptable behavior and will take appropriate and fair corrective action in\nresponse to any behavior that they deem inappropriate, threatening, offensive,\nor harmful.\n\nCommunity leaders have the right and responsibility to remove, edit, or reject\ncomments, commits, code, wiki edits, issues, and other contributions that are\nnot aligned to this Code of Conduct, and will communicate reasons for moderation\ndecisions when appropriate.\n\n## Scope\n\nThis Code of Conduct applies within all community spaces, and also applies when\nan individual is officially representing the community in public spaces.\nExamples of representing our community include using an official e-mail address,\nposting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported to the community leaders responsible for enforcement at\ninfo@builder.io.\nAll complaints will be reviewed and investigated promptly and fairly.\n\nAll community leaders are obligated to respect the privacy and security of the\nreporter of any incident.\n\n## Enforcement Guidelines\n\nCommunity leaders will follow these Community Impact Guidelines in determining\nthe consequences for any action they deem in violation of this Code of Conduct:\n\n### 1. Correction\n\n**Community Impact**: Use of inappropriate language or other behavior deemed\nunprofessional or unwelcome in the community.\n\n**Consequence**: A private, written warning from community leaders, providing\nclarity around the nature of the violation and an explanation of why the\nbehavior was inappropriate. A public apology may be requested.\n\n### 2. Warning\n\n**Community Impact**: A violation through a single incident or series\nof actions.\n\n**Consequence**: A warning with consequences for continued behavior. No\ninteraction with the people involved, including unsolicited interaction with\nthose enforcing the Code of Conduct, for a specified period of time. This\nincludes avoiding interactions in community spaces as well as external channels\nlike social media. Violating these terms may lead to a temporary or\npermanent ban.\n\n### 3. Temporary Ban\n\n**Community Impact**: A serious violation of community standards, including\nsustained inappropriate behavior.\n\n**Consequence**: A temporary ban from any sort of interaction or public\ncommunication with the community for a specified period of time. No public or\nprivate interaction with the people involved, including unsolicited interaction\nwith those enforcing the Code of Conduct, is allowed during this period.\nViolating these terms may lead to a permanent ban.\n\n### 4. Permanent Ban\n\n**Community Impact**: Demonstrating a pattern of violation of community\nstandards, including sustained inappropriate behavior, harassment of an\nindividual, or aggression toward or disparagement of classes of individuals.\n\n**Consequence**: A permanent ban from any sort of public interaction within\nthe community.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage],\nversion 2.0, available at\nhttps://www.contributor-covenant.org/version/2/0/code_of_conduct.html.\n\nCommunity Impact Guidelines were inspired by [Mozilla's code of conduct\nenforcement ladder](https://github.com/mozilla/diversity).\n\n[homepage]: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see the FAQ at\nhttps://www.contributor-covenant.org/faq. Translations are available at\nhttps://www.contributor-covenant.org/translations.\n"
  },
  {
    "path": "CONTINUOUS_BUILD.md",
    "content": "# Continuous Build Artifacts\n\nThis repo contains build artifacts that are generated as part of the continues build pipeline.\n\nCurrently supported artifacts:\n\n- [`@builder.io/qwik`](https://github.com/QwikDev/qwik-build)\n- [`@builder.io/qwik-city`](https://github.com/QwikDev/qwik-city-build)\n- [`@builder.io/qwik-labs`](https://github.com/QwikDev/qwik-labs-build)\n\nThe build artifact is created if:\n\n- Code is merged to `main` branch\n- Code is merged to `build/*` branch\n\n## How to use\n\nThe build artifacts are useful if you want to:\n\n- Install an un-released change.\n- Bisect which specific commit caused a regression.\n\n## Install specific build artifact\n\nTo install a specific build artifact change you `package.json` like so (not all lines may be needed):\n\n```json\n{\n  \"dependencies\": {\n    \"@builder.io/qwik\": \"github:QwikDev/qwik-build#SHA\",\n    \"@builder.io/qwik-city\": \"github:QwikDev/qwik-city-build#SHA\",\n    \"@builder.io/qwik-labs\": \"github:QwikDev/qwik-labs-build#SHA\"\n  }\n}\n```\n\nWhere `#SHA` is one of the following:\n\n- `#SHA` - Install a specific build SHA. You can get the SHA from:\n  - [`@builder.io/qwik`](https://github.com/QwikDev/qwik-build/commits/) commits\n  - [`@builder.io/qwik-city`](https://github.com/QwikDev/qwik-city-build/commits/) commits\n  - [`@builder.io/qwik-labs`](https://github.com/QwikDev/qwik-labs-build/commits/) commits\n- `#build/name` (or `#main`) - Install a specific `build/*` (or `#main`) branch:\n  - [`@builder.io/qwik`](https://github.com/QwikDev/qwik-build/branches/) branches\n  - [`@builder.io/qwik-city`](https://github.com/QwikDev/qwik-city-build/branches/) branches\n  - [`@builder.io/qwik-labs`](https://github.com/QwikDev/qwik-labs-build/branches/) branches\n    > NOTE: Package managers will treat any SHA in the lock file which is on the branch as valid, and so they will not auto upgrade to the latest. For this reason this is not recommended.\n\n## Bisect for regression\n\nYou can bisect different commits to `main` to determine which specific change has cause the regression.\n\n1. Install latest to get an upper mound\n2. Install oldest known good to get a lower bound\n3. Keep bisecting until you find a specific SHA where the code breaks.\n\nWhen creating the issue please include which SHA has caused the regression.\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to Qwik\n\nThank you for taking an interest in contributing to Qwik! We appreciate you! 🫶🏽\n\nBelow are the guidelines on how to help in the best possible way.\n\n## Submitting an Issue\n\nBefore creating a new issue, please search through open issues using the [GitHub issue search bar](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests). You might find the solution to your problem, or can verify that it is an already known issue.\n\nWe want a bug-free and best-performing project. That's why we take all reported issues to heart. But please be aware that if we can't reproduce the problem, we won't have a way of locating and adequately fixing it.\n\nTherefore, to solve the problem in the best possible way, please create a minimal repository that reproduces the problem with the least possible code explaining and demonstrating the error.\n\nWithout enough information to reproduce the issue, we will close it because we can't recreate and solve it.\n\n## Triaging Issues\n\nIf you're interested in helping out with triaging issues, please follow the [Triaging Guide](./contributing/TRIAGE.md).\n\n## Submitting a Pull Request (PR)\n\n### Branch Organization\n\nWe adopt [trunk-based development](https://trunkbaseddevelopment.com/) therefore all Pull Requests are made against the main branch.\nBefore releasing, we merge `main` into a release branch, for testing purposes.\n\n### Good first issue\n\nThe issues marked with [_Good first issue_](https://github.com/QwikDev/qwik/issues?q=is%3Aissue+is%3Aopen+label%3A%22COMMUNITY%3A++good+first+issue%22) are a good starting point to familiarize yourself with the project.\n\nBefore solving the problem, please check with the maintainers that the issue is still relevant. Feel free to leave a comment on the issue to show your intention to work on it and prevent other people from unintentionally duplicating your effort.\n\n### Sending a Pull Request\n\nBefore submitting a pull request, consider the following guidelines:\n\n- Fork the repository into your own account.\n- In your forked repository, create a new branch: `git checkout -b my-branch main`\n- Make your changes/fixes.\n- Run `pnpm fmt` to lint the code.\n- Add a changeset with `pnpm change` if needed ([follow this tutorial](https://go.screenpal.com/watch/cZivIcVPJQV))\n- Push your branch to GitHub: `git push origin my-branch`\n- In GitHub, send a pull request to `QwikDev:main`.\n\n> If you aren't sure your PR is ready, open it as a [draft](https://github.blog/2019-02-14-introducing-draft-pull-requests/) to make it clear to the maintainer.\n\n### ⚠ Troubleshooting PR build issues on CI\n\nEvery PR is being automatically merged with `main` before the CI Github actions run.\nThat's why if the CI checks aren't passing your PR branch is probably not up to date.\n\n**For non documentation PRs please do the following:**\n\n1. Merge `main` into your PR branch\n2. Run `pnpm api.update`\n3. Run `pnpm build.local` or `pnpm build.full` if you made a change to the Rust code\n4. Commit and push any changes as a result of the above steps\n\n## Local development\n\nThis is the best approach because all required dependencies will be installed in the docker container for you and won't affect your personal configuration in any way.\n\n### Prerequisites\n\nYou need to have these tools up and running in your local machine:\n\n- an editor. We recommend [VSCode](https://code.visualstudio.com/).\n- one of the following:\n  - [Nix](https://nixos.org)\n  - [Docker](https://www.docker.com/)\n  - Locally installed NodeJS v22+ and optionally Rust\n\n#### Nix\n\n[Nix](https://nixos.org/download.html) can be used on macOS and Linux. It keeps installation files in `/nix` and doesn't write anywhere else. It has a declarative configuration in the `flake.nix` file, which describes all the tools needed to build the project.\n\n- Install it on your machine and enable flakes. The [DetSys installer](https://github.com/DeterminateSystems/nix-installer) makes that easy.\n- run `nix develop` in the project root to open a shell with all the tools, or use `direnv` to have them automatically added into your current shell.\n\n##### Nix + Direnv (optional)\n\nYou can additionally use [direnv](https://direnv.net/) to automatically load the dev environment when you enter the project directory.\nThere is also a VSCode plugin for direnv that reloads the extensions so they get environment changes.\nWhen you install direnv, you'll need to allow it once with `direnv allow` in the project root. From then on, when you `cd` into the project, it will automatically have the correct tools installed.\n\n#### Docker\n\n- Install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension in your VSCode.\n- Once installed you will be prompted to 'Reopen the folder to develop in a container [learn more](https://code.visualstudio.com/docs/devcontainers/containers) or Clone repository in Docker volume for [better I/O performance](https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume)'. If you're not prompted, you can run the `Dev Containers: Open Folder in Container` command from the [VSCode Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).\n\nAlternatively you can use [devcontainers/cli](https://github.com/devcontainers/cli):\n\n- Install devcontainers following their documentation.\n- In your terminal navigate to the Qwik's project root directory.\n- Then run `devcontainer up --workspace-folder .`. This command will start a Docker container with all required environment dependencies.\n\n> [!TIP]\n> If you are using Podman, be sure to update the [VSCode dev container settings](https://code.visualstudio.com/remote/advancedcontainers/docker-options#_podman). Don't forget to allocate enough resources to the Podman machine to avoid slow builds.\n\n> [!NOTE]\n> You may run into an `EEXISTS` error when the Dev Container runs the \"updateContentCommand\" script. This may happen if pnpm gets installed automatically during the setup process. You can ignore the error because the container will be setup correctly, then run `pnpm install` in the project root once the container is connected and the terminal is available.\n\n> [!CAUTION]\n> The Dev Container may not work on Windows properly due to a difference with Windows container host volume permissions and ownership. It's recommended to use Mac or Linux instead, or configure your environment to build the project without Dev Containers.\n\n##### Using development container without Dev Containers and VSCode\n\nIf you would like to make use of the development container solution, but don't use VSCode or Dev Containers, you still can do so, by following steps:\n\n- Build development container locally: `cd .devcontainer; docker build -t qwik-container .`\n- Run development container from Qwik project root, binding the directory to container: `cd ..; docker run --rm -d --name qwik-container -p 3300:3300 -p 9229:9299 -v $PWD:/home/circleci/project -t qwik-container`\n\nDocker command does:\n\n- Create a new container that is removed once stopped,\n- In daemon mode,\n- With name `qwik-container`,\n- That exposes the ports `3300` and `9229`, and\n- Binds `qwik` project directory to container working directory.\n\n##### Podman extras\n\n> This section is highly influenced by SO answer: https://serverfault.com/a/1075838/352338\n> If you use [Podman](https://podman.io/) instead of Docker as your containers engine, then you need to know the following:\n\n- Container runs as user `circleci` with UID `1001` and GID `1002`.\n- As you are accustomed to using Podman, you will need to append `:Z` to `volumes | -v` parameter so the command becomes:\n\n```bash\n$ subuid_size=65536\n$ subgid_size=65536\n$ container_uid=1001\n$ container_gid=1002\n$ podman run --rm \\\n    --user $container_uid:$container_gid \\\n    --uidmap=0:1:$container_uid \\\n    --uidmap=$((container_uid + 1)):$((container_uid + 1)):$((subuid_size - $container_uid)) \\\n    --uidmap=$container_uid:0:1 \\\n    --gidmap=0:1:$container_gid \\\n    --gidmap=$((container_gid + 1)):$((container_gid + 1)):$((subgid_size - $container_gid)) \\\n    --gidmap=$container_gid:0:1 \\\n    -d --name qwik-container \\\n    -p 3300:3300 -p 9229:9299 \\\n    -v .:/home/circleci/project:Z \\\n    -t qwik-container\n```\n\n#### Locally installed tools\n\nIf you're not able to use the dev container, make sure you have NodeJS v18+ installed, as well as `pnpm`.\n\nFurthermore, to build the optimizer you optionally need Rust.\n\n1. Make sure [Rust](https://www.rust-lang.org/tools/install) is installed.\n2. Install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) with `cargo install wasm-pack` .\n3. Node version >= `22`.\n4. Make sure you have [pnpm](https://pnpm.io/installation) installed.\n5. run `pnpm install`\n\n> On Windows, Rust requires [C++ build tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/). You can also select _Desktop development with C++_\n> while installing Visual Studio.\n\n---\n\n## Development\n\nTo build Qwik for local development, install the dev dependencies using [pnpm](https://pnpm.io/) and then do an initial build.\n\n```shell\npnpm install && pnpm build.local\n```\n\nIf you want to work on the Rust code, use `build.full` instead of `build.local`.\n\n> [!NOTE]\n> After running `build.local`, you may see Git diffs for API-related files and `JSXNode`. You should run the `api.update` script to resolve them.\n\n### Fast build\n\nThis will build only Qwik and Qwik City and their types. This is not enough to run the docs.\n\n```shell\npnpm build.core\n```\n\n### Custom build\n\nOnce you have done a full build, the types are built, and you can build just the code you're working on. For qwik and qwik-city, you can do very fast rebuilds with\n\n```shell\npnpm build --dev --qwik --qwikcity\n```\n\nThe `--dev` flag skips type checking and generating.\n\nYou can run `pnpm build` without parameters to see which flags are available. Notable:\n\n- `--tsc`: build types\n- `--api`: build API docs and type bundles. Requires `--tsc` to have run.\n- `--build`: Qwik (you'll probably also need `--dev`)\n- `--qwikcity`: Qwik City (you'll probably also need `--dev`)\n- `--qwikreact`: Qwik React\n- `--qwiklabs`: Qwik Labs\n- `--eslint`: Eslint plugin\n\nE.g. to build only the React integration, you'd run `pnpm build --qwikreact`.\n\n### Full build without Rust\n\nThis builds everything except Rust prerequisites and the optimizer binaries. Instead, those binaries are copied from the latest Qwik package on NPM.\n\n```shell\npnpm build.local\n```\n\n### Full build with Rust\n\nIt will build **everything**, including Rust packages and WASM.\n\n> First build might be very slow.\n\n- Builds each submodule\n- Generates bundled `.d.ts` files for each submodule with [API Extractor](https://api-extractor.com/)\n- Checks the public API hasn't changed\n- Builds a minified `core.min.mjs` file\n- Generates the publishing `package.json`\n\n```shell\npnpm build.full\n```\n\nThe build output will be written to `packages/qwik/dist`, which will be the directory that is published to [@builder.io/qwik](https://www.npmjs.com/package/@builder.io/qwik).\n\nTo update the Rust test snapshots after you've made changes to the Rust code, run `pnpm test.rust.update`.\n\n### Run in your own app\n\nSay you made changes to the repo and you want to try them out in your app. Once built, all the Qwik packages are directly usable in your project by using the linking in your package manager.\n\nThis is very easy to do with `pnpm`:\nAssuming qwik is in `../qwik`, run this inside the root of your app:\n\n```shell\npnpm link ../qwik/packages/qwik\npnpm link ../qwik/packages/qwik-city\n```\n\nOther package managers probably need to first be told about the packages. For example, with `bun` you need to `cd ../qwik/packages/qwik` and `bun link`, repeat for `qwik-city`. Then in your app run `bun link @builder.io/qwik @builder.io/qwik-city`.\n\nIf you can't use package linking, just copy the contents of `packages/qwik` into your projects' `node_modules/@builder.io/qwik` folder, and/or the contents of `packages/qwik-city` into your projects' `node_modules/@builder.io/qwik-city` folder.\n\n### Working on the docs site\n\nAt the root of the Qwik repo folder run:\n\n```shell\npnpm docs.dev\n```\n\n### To open the test apps for debugging run\n\n```shell\npnpm serve\n```\n\n### Unit Tests Only\n\nUnit tests use [vitest](https://vitest.dev)\n\n```shell\npnpm test.unit\n```\n\n### E2E Tests Only\n\nE2E tests use [Playwright](https://playwright.dev/).\n\nTo run the Playwright tests headless, from start to finish, run:\n\n```shell\npnpm test.e2e.chromium\n```\n\nFinally, you can use `pnpm --filter` command to run packages' commands, for example:\n\n```shell\npnpm --filter qwik-docs start\n```\n\nMore commands can be found in each package's package.json scripts section.\n\n### Updating dependencies\n\nTo update all dependencies, run:\n\n```shell\npnpm deps\n```\n\nThis will show an interactive UI to update all dependencies. Be careful about performing major updates, especially for the docs site, since not all functionality has test coverage there. Be sure to test thoroughly.\n\n## Starter CLI `create-qwik`\n\n- [Starter CLI](https://github.com/QwikDev/qwik/blob/main/starters/README.md)\n\n## Pull Requests\n\n- [Open Qwik in StackBlitz Codeflow](https://pr.new/github.com/QwikDev/qwik/)\n- Review PR in StackBlitz\n  ![image](https://user-images.githubusercontent.com/4918140/195581745-8dfca1f9-2dcd-4f6a-b7aa-705f3627f8fa.png)\n\n### Coding conventions\n\nWrite code that is clean, simple and easy to understand. Complicated one-liners are generally frowned upon, unless they are for performance reasons and are clearly marked as such with a comment and explanation.\n\nWhen code does something unexpected, add a comment explaining why.\n\nWhen a comment is longer, prefer using `/** */` JSDoc comments as that will be auto-formatted as Markdown.\nJSDoc comments will also become part of the API documentation when they apply to exports, so write them as such.\n\n`pnpm fmt` is your friend, and we recommend setting up Prettier and using format-on-save in your editor.\n\n### Commit conventions\n\nIf you don't follow these commit conventions, your PR will be squashed. This means your local branch will not be part of the commit history of the target branch.\nFor larger PRs, it would really help if you follow these guidelines.\n\n- Create a commit for each logical unit and make sure it passes linting.\n- Keep your commits focused and atomic. Each commit should represent a single, coherent change.\n- If you have commits like `wip lol` or `fixup`, squash them. Use `git rebase -i`.\n- Commits must follow the format: `type(scope): description`\n  For example: `feat(qwik-city): confetti animations` or `chore: pnpm api.update`\n\n  Common types include:\n  - feat: A new feature\n  - fix: A bug fix\n  - docs: Documentation only changes\n  - lint: Changes that do not affect the meaning of the code (white-space, formatting, etc)\n  - refactor: A code change that neither fixes a bug nor adds a feature\n  - perf: A code change that improves performance\n  - test: Adding missing tests or correcting existing tests\n  - chore: Changes to the build process or auxiliary tools and libraries such as documentation generation\n\n  The `scope` is optional and should be a short identifier for the changed part of the code.\n\n- Use the imperative mood in the description. For example, use \"add\" instead of \"added\" or \"adds\".\n- For consistency, there should not be a period at the end of the commit message's summary line (the first line of the commit message).\n\n### Writing good commit messages\n\nIn addition to writing properly formatted commit messages, it's important to include relevant information so other developers can later understand _why_ a change was made. While this information usually can be found by digging into the code, pull request discussions or upstream changes, it may require a lot of work.\n\n- Be clear and concise in your commit messages.\n- Explain the reason for the change, not just what was changed.\n- If the commit fixes a specific issue, reference it in the commit message (e.g., \"Fixes #123\").\n\n### Adding a changeset\n\nWhenever you make a change that requires mentioning in the changelog, you should add a changeset. This will automatically generate meaningful release notes and changelog files.\n\nYou can add multiple changesets in a PR, for example because you implement different features for different packages, or because you have multiple noteworthy commits.\n\nYou create a new changeset file by running:\n\n```shell\npnpm change\n```\n\nThis will ask you which packages should be included in the changeset, and if the changes require a new version bump. Generally you should not select `major`, and you should only select `minor` if there are new features or significant improvements. If you don't select either it will become `patch`.\n\nFor your convenience, we prepared a video tutorial that covers the process of adding a changeset:\n\n[📽 TUTORIAL: Adding a changeset](https://go.screenpal.com/watch/cZivIcVPJQV)\n\n## PR merging (maintainers)\n\nMake sure the PR follows all the guidelines in this document. Once you think the PR is good to merge, if the commits are \"nice\", you can merge the PR. If not, squash the PR.\n\nIn case the PR is stuck waiting for the original author to apply a trivial\nchange (a typo, capitalization change, etc.) and the author allowed the members\nto modify the PR, consider applying it yourself (or commit the existing review\nsuggestion). You should pay extra attention to make sure the addition doesn't go\nagainst the idea of the original PR and would not be opposed by the author.\n\n## Releasing (maintainers)\n\nMerge the \"version\" PR, that is automatically created when a PR with a changeset is merged. You can first edit the files it created to get a nicer changelog.\n\nOnce CI passes, the GitHub Action will publish the new version to NPM.\n"
  },
  {
    "path": "Cargo.toml",
    "content": "[workspace]\n\nmembers = [\n    \"packages/qwik/src/napi\",\n    \"packages/qwik/src/wasm\",\n    \"packages/qwik/src/optimizer/cli\",\n    \"packages/qwik/src/optimizer/core\",\n]\nexclude = [\"packages/qwik/src/wasm\"]\nresolver = \"2\"\n\n[profile.release]\ndebug = 0\nlto = true\ncodegen-units = 1\nopt-level = \"z\"\npanic = \"abort\"\n\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM node:16.12.0-buster\n\nRUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\nADD . /\nENV PATH=\"/root/.cargo/bin:${PATH}\"\nRUN make install-rust-deps\nRUN pnpm install\nRUN pnpm build\n"
  },
  {
    "path": "GOVERNANCE.md",
    "content": "# Qwik Project Governance\n\nThis governance document reflects our dedication to maintaining Qwik as an open, fair, and collaborative project and is a continuation of our [community values](https://docs.google.com/document/d/1MrSp2caaREETHUL56C2fIIJeFJsBA_sWJ9raL6hWoo8/edit#heading=h.bpbzghkvfgrn).\n\nQwik is rooted in a commitment to innovation and community-driven development where the needs of the community drive the framework's evolution.\n\nOur decisions are guided by what serves Qwik and the broader web ecosystem best, with a strong emphasis on seeking consensus.\n\nThe following outlines the structure of the project, including the roles and responsibilities of its members.\n\n## Community Contributors\n\nA Community contributor is any community member who contributes to the success of the framework.\n\nContributors usually are part of one or more of the following categories:\n\n1. **Code Contributors** - Developers who contribute by identifying issues, submitting pull requests, or maintaining community-driven Qwik projects.\n2. **Docs Contributors** - Members who enhance or correct the Qwik documentation, ensuring it remains accurate and accessible.\n3. **Support Contributors** - Members who assist other developers by answering questions and offering support.\n4. **Content Creators** - Those who produce educational content, tutorials, and other resources to help the community better understand and use Qwik.\n5. **Local Community Leaders** - Members who organize and lead local Qwik communities, fostering in-person engagement and knowledge sharing.\n\n## Qwik Heroes\n\nQwik Heroes are recognized as top contributors who have exceptional dedication and enthusiasm for Qwik.\n\nHeroes have easier access to the core team and participate in monthly meetings to provide feedback, ask questions, and discuss internal topics together with the team.\n\n#### Nomination\n\nAny community contributor can be nominated as a Qwik Hero by an existing member or by any of the leadership teams. Selections are made by the Community Management Team (and in conjunction with the core team for cases of “code heroes”).\n\n#### Status Change\n\nRemoval of Qwik Heroes is done by either a voluntary resignation or by a Community Management Team decision, or (in extreme cases) by a Stewardship Team motion.\n\nQwik Heroes who become inactive for 6 months are automatically reverted to regular community contributor status.\n\n## Core Team\n\nCore team members are contributors who have merging rights to the project and are actively involved in the ongoing development of Qwik. They are essential to the framework's evolution, participating in weekly sprint meetings and Core Leadership meetings (although only Core Leadership members can vote in these meetings).\n\nThe Core Team will have a Core Team Lead who will be in charge of the ongoing project management and development progress.\n\n#### Nomination\n\nA Qwik Hero member can be nominated as a Core Team member by any member of the Core Team. Nominations are decided upon by a standard Core Leadership motion.\n\n#### Status Change\n\nRemoval of Core Team members is done by either a voluntary resignation or by a standard Core Leadership motion, or (in extreme cases) by a Stewardship Team motion.\n\nA Core Team member will be automatically converted back to a \"Qwik Hero\" if they are not active in the project for over 3 months.\n\n## Core Leadership Team\n\nThe Core Leadership Team includes Core Team members who are granted voting rights on strategic technical decisions.\n\nThese individuals are selected because of their experience, judgment, good faith, and alignment with Qwik's core values.\n\nMembers of this team are expected to participate in Core Leadership Team activities and meetings and can cast votes when consensus is not reached on a specific decision.\n\n#### Nomination\n\nRegular Core Team members can be nominated to the Core Leadership Team by any current Core Leadership member, with the final decision made through a standard Core Leadership motion.\n\n#### Status Change\n\nRemoval of voting Core Leadership members is done by either a voluntary resignation or by a standard Core Leadership motion, or (in extreme cases) by a Stewardship Team motion.\n\nA Core Leadership member will be automatically converted to a regular Core Team member if they do not participate in 3 consecutive votes or have been inactive for over 4 months.\n\n## Docs Team\n\nThe Docs Team is responsible for maintaining and improving Qwik's documentation.\n\nThis team ensures that the documentation is up-to-date, accurate, and user-friendly, and also handles the triage of docs-related issues and the merging of related PRs.\n\n#### Nomination\n\nA Qwik Hero member can be nominated as a Docs Team member by any member of the Docs Team. Nominations need to be approved by the Growth Manager.\n\n#### Status Change\n\nRemoval of Docs Team members is done by either a voluntary resignation or by a Growth Manager decision, or (in extreme cases) by a Stewardship Team motion.\n\nA Docs Team member will be automatically converted back to a \"Qwik Hero\" if they are not active in the project for over 3 months.\n\n## Community Management Team\n\nThe Community Management Team oversees the onboarding, safety, and overall vibe of the Qwik community.\n\nThey ensure that the community remains a friendly and inclusive space where members follow the Qwik community guidelines.\n\nThe team is responsible for managing \"Local Community Leaders\" and \"Support Heroes\" and helping them succeed in their roles and contributions.\n\n#### Nomination\n\nQwik Heroes may be nominated to the Community Management Team by any current team member. Nominations need to be approved by the Growth Manager.\n\n#### Status Change\n\nRemoval of Community Management Team members is done by either a voluntary resignation or by a Growth Manager decision, or (in extreme cases) by a Stewardship Team motion.\n\nA Community Management Team member will be automatically converted back to a \"Qwik Hero\" if they are not active in the project for over 3 months.\n\n## Outreach Team\n\nThe Outreach Team is responsible of spreading Qwik's message, ensuring that more developers are introduced to the framework and give it a try. Their responsibilities include managing social media, collaborating with content creators, representing Qwik at conferences, and more.\n\n#### Nomination\n\nQwik Heroes may be nominated to the Outreach Team by any current team member. Nominations need to be approved by the Growth Manager.\n\n#### Status Change\n\nRemoval of Outreach Team members is done by either a voluntary resignation or by a Growth Manager decision, or (in extreme cases) by a Stewardship Team motion.\n\nAn Outreach Team member will be automatically converted back to a \"Qwik Hero\" if they are not active in the project for over 3 months.\n\n## Growth Manager\n\nThe Growth Manager is responsible for overseeing the Community Management, Outreach, and Docs Teams, ensuring that their efforts are aligned and that messaging across these teams remains consistent.\n\nThis role is crucial in driving the strategic direction of Qwik's growth and ensuring that all community-facing activities are cohesive and effective.\n\nThe Growth Manager is appointed or replaced by a standard Stewardship Team motion.\n\n## Stewardship Team\n\nThe project's stewards are in charge of all aspects regarding the framework.\n\nThis includes the development, community, and growth of the framework, but also creating proper management processes, managing sponsorships and budgets, collaborations, and more.\n\nThe project stewards are: Misko Hevery and Shai Reznik.\n\nThe project stewards will be used as \"tiebreakers\" in votes and hold veto rights on decisions (to protect the framework from rare and extreme cases).\n\nBecause the framework can be forked by the community at any point, the project stewards must manage the project in a fair, honest, and thoughtful way, taking into account what's good for the community and resolving conflicting needs as much as possible.\n\n---\n\ninspired by [Node](https://github.com/nodejs/node/blob/main/GOVERNANCE.md), [Vue](https://github.com/vuejs/vue/wiki/Governance-Document), [Astro](https://github.com/withastro/.github/blob/main/GOVERNANCE.md) and [Nuxt](https://github.com/nuxt/governance)\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2024 QwikDev\nCopyright (c) 2021 BuilderIO\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Makefile",
    "content": "install-rust:\n\tcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n\ninstall-rust-deps:\n\trustup update\n\trustup target add wasm32-unknown-unknown\n\tcargo install cargo-insta\n\trustup component add clippy\n\nadd-target:\n\trustup target add wasm32-unknown-unknown\n\ninstall-all: install-rust install-rust-deps\n\ninstall-cli:\n\tcd src/optimizer/cli && cargo install --path .\n\nfix:\n\tcargo fmt\n\ncheck:\n\tcargo fmt -- --check && cargo check --all-features\n\nlint:\n\tcargo clippy --all-features && cargo check --all-features && cargo fmt -- --check\n\n# We only test core because there are no other tests and qwik-napi breaks the build\ntest:\n\tcargo test --manifest-path packages/qwik/src/optimizer/core/Cargo.toml\n\ntest-update:\n\tif ! cargo test --manifest-path packages/qwik/src/optimizer/core/Cargo.toml; then \\\n\t\tcd packages/qwik/src/optimizer/core/src/snapshots/; \\\n\t\tfor i in *.new; do f=$$(basename $$i .new); mv $$i $$f; done; \\\n\t\tcd -; \\\n\t\tcargo test --manifest-path packages/qwik/src/optimizer/core/Cargo.toml; \\\n\tfi\n\npublish-core:\n\tcd src/optimizer/core && cargo publish --all-features\n\npublish-cli:\n\tcd src/optimizer/cli && cargo publish\n\npublish: publish-core publish-cli\n\nvalidate: check lint test\n"
  },
  {
    "path": "README.md",
    "content": "<br>\n<p align=\"center\">\n  <img alt=\"Qwik Logo\" width=\"400\" src=\"https://raw.githubusercontent.com/QwikDev/qwik/main/packages/docs/public/logos/qwik.svg\" />\n</p>\n<br>\n<p align=\"center\">\n   <a href=\"https://github.com/QwikDev/qwik/actions/workflows/ci.yml\"><img src=\"https://github.com/QwikDev/qwik/actions/workflows/ci.yml/badge.svg?event=push\" alt=\"Qwik CI\"></a>\n</p>\n<br>\n<br>\n\n<h1 align=\"center\">Instant-loading web apps, without effort</h1>\n\nQwik offers the fastest possible page load times - regardless of the complexity of your website. Qwik is so fast because it allows fully interactive sites to load with almost no JavaScript and [pickup from where the server left off](https://qwik.dev/docs/concepts/resumable/).\n\nAs users interact with the site, only the necessary parts of the site load on-demand. This [precision lazy-loading](https://qwik.dev/docs/concepts/progressive/) is what makes Qwik so quick.\n\n## Getting Started\n\n```sh\nnpm create qwik@latest\n# or\npnpm create qwik@latest\n# or\nyarn create qwik@latest\n# or\nbun create qwik@latest\n```\n\n- Understand the difference between [resumable and replayable](https://qwik.dev/docs/concepts/resumable/) applications.\n- Learn about Qwik's high level [mental model](https://qwik.dev/docs/concepts/think-qwik/).\n\n## Resources\n\n- [Docs](https://qwik.dev/)\n- [Examples](https://qwik.dev/examples/introduction/hello-world/)\n- [Tutorials](https://qwik.dev/tutorial/welcome/overview/)\n- [Videos](https://qwik.dev/media/#videos)\n- [Podcasts](https://qwik.dev/media/#podcasts)\n- [Presentations](https://qwik.dev/media/#presentations)\n- [Blogs](https://qwik.dev/media/#blogs)\n\n## Community\n\n- Ping us at [@QwikDev](https://twitter.com/QwikDev)\n- Join our [Discord](https://qwik.dev/chat) community\n- Join all the [other community groups](https://qwik.dev/ecosystem/#community)\n\n## Development\n\n- See [Contributing.md](https://github.com/QwikDev/qwik/blob/main/CONTRIBUTING.md) for more information on how to build Qwik from the source and contribute!\n\n## Related\n\n- [Partytown](https://partytown.qwik.dev/): Relocate resource intensive third-party scripts off of the main thread and into a web worker 🎉.\n- [Mitosis](https://github.com/BuilderIO/mitosis): Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and more.\n- [Builder](https://github.com/BuilderIO/builder): Drag and drop page builder and CMS for React, Vue, Angular, and more.\n\n<br>\n<br>\n\n<table align=\"center\">\n  <tr align=\"center\">\n    <td>special sponsor</td>\n  </tr>\n  <tr>\n    <td align=\"center\">\n      <a href=\"https://www.builder.io/m/developers\" rel=\"noopener\">\n        <picture>\n          <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/eT9FjKT.png\">\n          <img width=\"250\" alt=\"Special sponsor Builder.io\" src=\"https://i.imgur.com/32mv01X.png\">\n        </picture>\n      </a>\n    </td>\n  </tr>\n  <tr align=\"center\">\n    <td>sponsors</td>\n  </tr>\n  <tr>\n    <td align=\"center\">\n      <a href=\"https://kunaico.com/\" target=\"_blank\" rel=\"noopener\">\n        <picture>\n          <source srcset=\"https://github.com/user-attachments/assets/47c6d86a-5141-40c6-a0fb-5986266fa589\" media=\"(prefers-color-scheme: dark)\">\n          <source srcset=\"https://github.com/user-attachments/assets/84bff951-ed35-43e4-9515-ebe07e8b09e4\" media=\"(prefers-color-scheme: light)\">\n          <img width=\"250\" src=\"https://github.com/user-attachments/assets/84bff951-ed35-43e4-9515-ebe07e8b09e4\" alt=\"Company logo\">\n        </picture>\n      </a>    \n    </td>\n  </tr>\n  <tr>\n    <td align=\"center\">\n      <a href=\"http://hirez.io/\" target=\"_blank\" rel=\"noopener\">\n        <picture>\n          <source srcset=\"https://i.imgur.com/DHhJM0J.png\" media=\"(prefers-color-scheme: dark)\">\n          <source srcset=\"https://i.imgur.com/DIbsvQC.png\" media=\"(prefers-color-scheme: light)\">\n          <img width=\"250\" src=\"https://i.imgur.com/DIbsvQC.png\" alt=\"Company logo\">\n        </picture>\n      </a>    \n    </td>\n  </tr>\n</table>\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Reporting Security Issues\n\nThe Qwik team and community are dedicated to keeping our project secure, and we appreciate your help in identifying and disclosing security issues responsibly. Your efforts make a big difference!\n\nTo report a security issue, please use the \"[Report a Vulnerability](https://github.com/QwikDev/qwik/security/advisories/new)\" tab on our GitHub Security Advisory page.\n\nAfter you submit a report, we'll get back to you with the next steps. We'll keep you updated on our progress towards fixing the issue and any related announcements. If we need more information, we might reach out to you for further details.\n\nFor security issues in third-party modules, please contact the maintainer of the module directly. Alternatively, you can use the [npm contact form](https://www.npmjs.com/support) and select \"I'm reporting a security vulnerability.\"\n\nThanks for helping us keep Qwik safe and secure!\n"
  },
  {
    "path": "contributing/TRIAGE.md",
    "content": "# Triage Titans Guide\n\nHey there! Welcome to the wild world of the **Triage Titans**, where we tame bugs and nurture enhancements with the precision of true repository doctors.\n\nLet's keep the code healthy, the project smooth, and have some fun along the way.\n\n## Note about tags prefixes:\n\n1. **STATUS-1**: The initial `needs triage` gets automatically added to newly created issues\n2. **STATUS-2**: A \"waiting for someone/something\" status.\n3. **STATUS-3**: The final state of an issue. This is a \"resolution\" status.\n\n---\n\n👇 _Inspiration for the diagrams below came from the Vite project_\n\n## Bug Triaging Process\n\nOur bug triaging process makes sure every reported issue gets the attention it deserves. We categorize, prioritize, and assign bugs to the right person to squash them quickly.\n\nHere's how the Triage Titans handle bug reports in the Qwik repository:\n\n```mermaid\nflowchart TD\n    start{Missing information?}\n    start --YES--> close1[Tag with\\n'STATUS-2: missing info'\\n\\nBot will auto close if\\n no update for 14 days]\n    start --NO--> dupe{Is duplicate?}\n    dupe --YES--> close2[Close, point to duplicate\\n and tag with\\n'STATUS-3: duplication']\n    dupe --NO--> repro{Has proper\\nreproduction?}\n    repro --NO--> close3[Tag with\\n 'STATUS-2: needs reproduction'\\nBot will auto close if \\nno update for 14 days]\n    repro --YES--> real{Is actually a bug?}\n    real --NO--> intended{Is the intended\\nbehaviour?}\n    intended --YES--> explain[Explain and close.\\nPoint to docs if needed.\\nTag with\\n'STATUS-3: works as expected']\n    intended --NO--> open[Tag with\\n'STATUS-2: requires discussion'\\nand either\\n'WAITING FOR: team'\\n'WAITING FOR: user']\n    real --YES--> real2[\"1. Tag with 'STATUS-2: team is working on this'\\n2. Add related feature label if\\napplicable (e.g. 'COMP: runtime')\\n3. Add priority labels (see below)\"]\n    real2 --> unusable{Does the\\nbug make Qwik\\nunusable?}\n    unusable --YES--> maj{Does the bug\\naffect the majority\\nof Qwik users?}\n    maj --YES--> P4[P4: urgent]\n    maj --NO--> P3[P3: important]\n    unusable --NO--> workarounds{Are there\\nworkarounds for\\nthe bug?}\n    workarounds --NO--> P2[P2: minor]\n    workarounds --YES--> P1[P1: nice to have / fix]\n```\n\n---\n\n## Enhancement Triaging Process\n\nAlright, Triage Titans! Somebody got a cool new feature idea or an awesome improvement to boost Qwik?\n\nIt's our job to make sure these enhancements are properly evaluated, prioritized, and brought to life.\n\nWhat helps the team to prioritize work is the number of 👍 votes by the community on a specific issue.\n\n### A note about enhancements to the core:\n\nWe are very careful about which features we introduce into the Qwik core, because we know that every new feature adds complexity and maintenance tasks to the codebase.\n\nEvery feature is being carefully evaluated based on our vision and philosophy of \"automatic optimization\".\n\nThat's why we'll often encourage the community to implement a certain feature and evaluate its adoption over time to see if it should actually be part of the core.\n\n.\n\nNow, let's dive into how we handle enhancement requests in the Qwik repository:\n\n```mermaid\nflowchart TD\n    start{Missing information?}\n    start --YES--> close1[Tag with\\n'STATUS-2: missing info'\\n\\nBot will auto close if\\n no update for 14 days]\n    start --NO--> dupe{Is duplicate?}\n    dupe --YES--> close2[Close, point to duplicate\\n and tag with\\n'STATUS-3: duplication']\n    dupe --NO--> discussion{Requires further\\ndiscussion?}\n    discussion --YES--> close3[Tag with\\n 'STATUS-2: requires discussion'\\nand 'WAITING FOR: team'\\nor 'WAITING FOR: user']\n    discussion --NO--> implement{Should it be\\nimplemented by core?}\n    implement --NO--> community{Should it be implemented\\nby the community?}\n    community --YES--> incubate[Close and tag with either\\n'STATUS-3: incubation'\\nor 'STATUS-2: waiting for community PR'\\nand 'COMMUNITY: PR is welcomed']\n    community --NO--> wontfix[Close and tag with\\n'STATUS-3: won't be worked on']\n    implement --YES--> doimplement[\"1. Tag with 'STATUS-2: team is working on this'\\n2. Add related feature label if\\napplicable (e.g. 'COMP: runtime')\\n3. Add version \\nlabels (e.g. 'VERSION: upcoming major')\"]\n```\n\n## Thank You!\n\nA big shoutout to all our amazing contributors and Triage Titans! Your dedication, creativity, and hard work help keep Qwik running smoothly and evolving with exciting new features. We wouldn't be able to do it without you 🫶\n\nThank you for being a part of our journey and making Qwik awesome. Keep up the great work, and let's continue building something amazing together!\n"
  },
  {
    "path": "cspell.json",
    "content": "{\n  \"words\": [\n    \"Aboutus\",\n    \"accumsan\",\n    \"activedescendant\",\n    \"adipiscing\",\n    \"alertdialog\",\n    \"allowpopups\",\n    \"Almeida\",\n    \"amet\",\n    \"antipattern\",\n    \"Arcrole\",\n    \"asynchronicity\",\n    \"basepath\",\n    \"bbar\",\n    \"bbox\",\n    \"bday\",\n    \"beforeinput\",\n    \"bgsound\",\n    \"Bien\",\n    \"bindgen\",\n    \"bivariance\",\n    \"Bivariant\",\n    \"Bkxp\",\n    \"blinkfeatures\",\n    \"Booleanish\",\n    \"brotli\",\n    \"browsermain\",\n    \"builderio\",\n    \"buildtime\",\n    \"bunde\",\n    \"canonicalize\",\n    \"cdylib\",\n    \"cjsx\",\n    \"Clhb\",\n    \"clic\",\n    \"cmps\",\n    \"codegen\",\n    \"colcount\",\n    \"colindex\",\n    \"colspan\",\n    \"columnheader\",\n    \"combobox\",\n    \"complext\",\n    \"composability\",\n    \"consectetur\",\n    \"contentinfo\",\n    \"Counteradd\",\n    \"crossorigin\",\n    \"ctxt\",\n    \"datetime\",\n    \"Dblclick\",\n    \"Debouncer\",\n    \"deno\",\n    \"describedby\",\n    \"dfdfd\",\n    \"disableblinkfeatures\",\n    \"disableguestresize\",\n    \"disablewebsecurity\",\n    \"divfixture\",\n    \"dolor\",\n    \"dropeffect\",\n    \"elems\",\n    \"elit\",\n    \"elli\",\n    \"epressed\",\n    \"errormessage\",\n    \"espree\",\n    \"estree\",\n    \"execa\",\n    \"extensionless\",\n    \"extless\",\n    \"extname\",\n    \"extnames\",\n    \"fargs\",\n    \"Fboth\",\n    \"flowto\",\n    \"frontmatter\",\n    \"gesturechange\",\n    \"gestureend\",\n    \"gesturestart\",\n    \"Gettingstarted\",\n    \"gmsw\",\n    \"gridcell\",\n    \"guestinstance\",\n    \"hackmd\",\n    \"Hasher\",\n    \"haspopup\",\n    \"Hevery\",\n    \"hola\",\n    \"horiz\",\n    \"hostattrs\",\n    \"hotspot\",\n    \"httpreferrer\",\n    \"idents\",\n    \"imagesizes\",\n    \"imagesrcset\",\n    \"importee\",\n    \"Indexapi\",\n    \"inlines\",\n    \"inlist\",\n    \"insta\",\n    \"ipsum\",\n    \"itemprop\",\n    \"itsok\",\n    \"jsxs\",\n    \"keyof\",\n    \"keyshortcuts\",\n    \"Keyup\",\n    \"kleur\",\n    \"labelledby\",\n    \"Layoutapi\",\n    \"layoutname\",\n    \"listbox\",\n    \"listitem\",\n    \"listitems\",\n    \"lkei\",\n    \"Lorem\",\n    \"manu\",\n    \"manualmeida\",\n    \"maxage\",\n    \"mdast\",\n    \"mdxjs\",\n    \"menuitemcheckbox\",\n    \"menuitemradio\",\n    \"middlewares\",\n    \"mimalloc\",\n    \"misko\",\n    \"miško\",\n    \"mjsx\",\n    \"Mobify\",\n    \"mondodb\",\n    \"mpath\",\n    \"msvc\",\n    \"msvideo\",\n    \"mtsx\",\n    \"multiselectable\",\n    \"multistatus\",\n    \"myapp\",\n    \"napi\",\n    \"netify\",\n    \"nodeintegration\",\n    \"noopen\",\n    \"noscript\",\n    \"noserialize\",\n    \"nosniff\",\n    \"nothere\",\n    \"nulll\",\n    \"objs\",\n    \"odzdfdfd\",\n    \"oneline\",\n    \"onrender\",\n    \"onscrolling\",\n    \"onwarn\",\n    \"outdir\",\n    \"outfile\",\n    \"outro\",\n    \"panose\",\n    \"partytown\",\n    \"pathdiff\",\n    \"pfkgyr\",\n    \"Pinterest\",\n    \"posinset\",\n    \"posix\",\n    \"prefetching\",\n    \"prerender\",\n    \"pretium\",\n    \"progressbar\",\n    \"PROPPATCH\",\n    \"proto\",\n    \"QACTION\",\n    \"qcomponent\",\n    \"Qdata\",\n    \"qdev\",\n    \"qerror\",\n    \"qfunc\",\n    \"Qhook\",\n    \"qidle\",\n    \"qinit\",\n    \"qkssr\",\n    \"qprefetch\",\n    \"qqhook\",\n    \"qresume\",\n    \"qrls\",\n    \"QSLOT\",\n    \"qsymbol\",\n    \"quicktime\",\n    \"qvisible\",\n    \"qwik\",\n    \"qwikauth\",\n    \"qwikcity\",\n    \"qwikdeps\",\n    \"qwikdom\",\n    \"qwikevents\",\n    \"qwikfy\",\n    \"qwikify\",\n    \"qwikjson\",\n    \"qwikloader\",\n    \"qwikreact\",\n    \"radiogroup\",\n    \"Rctx\",\n    \"reboostrap\",\n    \"referrerpolicy\",\n    \"regs\",\n    \"rehype\",\n    \"renderz\",\n    \"reparse\",\n    \"replayable\",\n    \"resumability\",\n    \"revalidates\",\n    \"rlib\",\n    \"Roboto\",\n    \"roledescription\",\n    \"rowcount\",\n    \"rowgroup\",\n    \"rowheader\",\n    \"rowindex\",\n    \"rowspan\",\n    \"rsplitn\",\n    \"rsps\",\n    \"SAMEORIGIN\",\n    \"SAMESITE\",\n    \"sdfds\",\n    \"searchbox\",\n    \"serde\",\n    \"Serializability\",\n    \"setsize\",\n    \"shouldkebab\",\n    \"signin\",\n    \"signout\",\n    \"sit\",\n    \"slidein\",\n    \"slotdefault\",\n    \"somefn\",\n    \"somestring\",\n    \"sourcemaps\",\n    \"spinbutton\",\n    \"sref\",\n    \"sstyle\",\n    \"stemh\",\n    \"stemv\",\n    \"styff\",\n    \"stylesscopedblue\",\n    \"stylesscopedgreen\",\n    \"subdir\",\n    \"submitcompleted\",\n    \"svgz\",\n    \"SWC's\",\n    \"tablist\",\n    \"tabpanel\",\n    \"tagname\",\n    \"tdblg\",\n    \"textbox\",\n    \"Textfromdefault\",\n    \"threejs\",\n    \"tlsv\",\n    \"todoapp\",\n    \"todos\",\n    \"treegrid\",\n    \"treeitem\",\n    \"treeitems\",\n    \"treeshake\",\n    \"treeshaked\",\n    \"tsdoc\",\n    \"typecheck\",\n    \"typeof\",\n    \"typesafe\",\n    \"undici\",\n    \"unist\",\n    \"unselectable\",\n    \"unsub\",\n    \"urlset\",\n    \"valign\",\n    \"valuenow\",\n    \"valuetext\",\n    \"Vdom\",\n    \"vfile\",\n    \"vite\",\n    \"Vivamus\",\n    \"Vnode\",\n    \"Vnodes\",\n    \"vulputate\",\n    \"wbmp\",\n    \"webfont\",\n    \"webpreferences\",\n    \"webworker\",\n    \"wmode\",\n    \"xlink\"\n  ],\n  \"enableFiletypes\": [\"mdx\"]\n}\n"
  },
  {
    "path": "e2e/adapters-e2e/.gitignore",
    "content": "playwright-report\ndist\nlogs\nserver\ntmp"
  },
  {
    "path": "e2e/adapters-e2e/adapters/express/vite.config.ts",
    "content": "import { nodeServerAdapter } from '@builder.io/qwik-city/adapters/node-server/vite';\nimport { extendConfig } from '@builder.io/qwik-city/vite';\nimport baseConfig from '../../vite.config';\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['src/entry.express.tsx', '@qwik-city-plan'],\n      },\n    },\n    plugins: [nodeServerAdapter({ name: 'express' })],\n  };\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/package.json",
    "content": "{\n  \"name\": \"qwik-buffering-test-app\",\n  \"description\": \"Qwik buffering test app\",\n  \"engines\": {\n    \"node\": \"^18.17.0 || ^20.3.0 || >=21.0.0\"\n  },\n  \"private\": true,\n  \"scripts\": {\n    \"build\": \"qwik build\",\n    \"build.client\": \"vite build\",\n    \"build.preview\": \"vite build --ssr src/entry.preview.tsx\",\n    \"build.server\": \"vite build -c adapters/express/vite.config.ts\",\n    \"build.types\": \"tsc --incremental --noEmit\",\n    \"deploy\": \"vercel deploy\",\n    \"dev\": \"vite --mode ssr\",\n    \"dev.debug\": \"node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"express\": \"pnpm build && pnpm serve\",\n    \"fmt\": \"prettier --write .\",\n    \"fmt.check\": \"prettier --check .\",\n    \"lint\": \"eslint \\\"src/**/*.ts*\\\"\",\n    \"preview\": \"qwik build preview && vite preview --open\",\n    \"qwik\": \"qwik\",\n    \"serve\": \"node server/entry.express\",\n    \"start\": \"vite --open --mode ssr\",\n    \"test\": \"playwright test\",\n    \"test.debug\": \"playwright test --debug\",\n    \"test.ui\": \"playwright test --ui\"\n  },\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "e2e/adapters-e2e/playwright.config.ts",
    "content": "import { defineConfig, devices } from '@playwright/test';\n\n/** See https://playwright.dev/docs/test-configuration. */\nexport default defineConfig({\n  testDir: './tests',\n  fullyParallel: true,\n  forbidOnly: !!process.env.CI,\n  retries: process.env.CI ? 2 : 0,\n  workers: process.env.CI ? 1 : undefined,\n  reporter: 'line',\n\n  use: {\n    baseURL: 'http://localhost:3000',\n    // trace: 'on-first-retry',\n    // screenshot: 'only-on-failure',\n\n    // Increase timeouts for service worker operations\n    actionTimeout: 10000,\n    navigationTimeout: 10000,\n  },\n\n  // Increase global timeout for service worker tests\n  timeout: process.env.CI ? 120000 : 30000,\n\n  projects: [\n    {\n      name: 'chromium',\n      use: {\n        ...devices['Desktop Chrome'],\n      },\n    },\n    // {\n    //   name: 'firefox',\n    //   use: { ...devices['Desktop Firefox'] },\n    // },\n    {\n      name: 'webkit',\n      use: { ...devices['Desktop Safari'] },\n    },\n  ],\n\n  webServer: {\n    command: 'npm run express',\n    port: 3000,\n    stdout: 'pipe',\n    reuseExistingServer: !process.env.CI,\n    timeout: process.env.CI ? 120000 : 30000,\n  },\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/src/components/click-me/click-me.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\n// We need to extract the component to see the bug on 1.5.7\nexport default component$(() => {\n  const isOpenSig = useSignal(false);\n  return (\n    <>\n      <button\n        onClick$={() => {\n          return (isOpenSig.value = !isOpenSig.value);\n        }}\n      >\n        click me\n      </button>\n      {isOpenSig.value && <div data-testid=\"hi\">Hi 👋</div>}\n    </>\n  );\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { useDocumentHead, useLocation } from '@builder.io/qwik-city';\n\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.url.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n\n      {head.meta.map((m) => (\n        <meta key={m.key} {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link key={l.key} {...l} />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/src/entry.dev.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Development entry point using only client-side modules:\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nimport { render, type RenderOptions } from '@builder.io/qwik';\nimport Root from './root';\n\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "e2e/adapters-e2e/src/entry.express.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Express HTTP server when building for production.\n *\n * Learn more about Node.js server integrations here:\n * - https://qwik.dev/docs/deployments/node/\n *\n */\nimport { createQwikCity, type PlatformNode } from '@builder.io/qwik-city/middleware/node';\nimport 'dotenv/config';\nimport qwikCityPlan from '@qwik-city-plan';\nimport { manifest } from '@qwik-client-manifest';\nimport render from './entry.ssr';\nimport express from 'express';\nimport { fileURLToPath } from 'node:url';\nimport { join } from 'node:path';\n\ndeclare global {\n  type QwikCityPlatform = PlatformNode;\n}\n\n// Directories where the static assets are located\nconst distDir = join(fileURLToPath(import.meta.url), '..', '..', 'dist');\nconst buildDir = join(distDir, 'build');\n\n// Allow for dynamic port\nconst PORT = process.env.PORT ?? 3000;\n\n// Create the Qwik City Node middleware\nconst { router, notFound } = createQwikCity({\n  render,\n  qwikCityPlan,\n  manifest,\n  // getOrigin(req) {\n  //   // If deploying under a proxy, you may need to build the origin from the request headers\n  //   // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto\n  //   const protocol = req.headers[\"x-forwarded-proto\"] ?? \"http\";\n  //   // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host\n  //   const host = req.headers[\"x-forwarded-host\"] ?? req.headers.host;\n  //   return `${protocol}://${host}`;\n  // }\n});\n\n// Create the express server\n// https://expressjs.com/\nconst app = express();\n\n// Enable gzip compression\n// app.use(compression());\n\n// Static asset handlers\n// https://expressjs.com/en/starter/static-files.html\napp.use(`/build`, express.static(buildDir, { immutable: true, maxAge: '1y' }));\napp.use(express.static(distDir, { redirect: false }));\n\n// Use Qwik City's page and endpoint request handler\napp.use(router);\n\n// Use Qwik City's 404 handler\napp.use(notFound);\n\n// Start the express server\napp.listen(PORT, () => {\n  /* eslint-disable */\n  console.log(`Server started: http://localhost:${PORT}/`);\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/src/entry.preview.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the bundle entry point for `npm run preview`.\n * That is, serving your app built in production mode.\n *\n * Feel free to modify this file, but don't remove it!\n *\n * Learn more about Vite's preview command:\n * - https://vitejs.dev/config/preview-options.html#preview-options\n *\n */\nimport { createQwikCity } from '@builder.io/qwik-city/middleware/node';\nimport qwikCityPlan from '@qwik-city-plan';\n// make sure qwikCityPlan is imported before entry\nimport render from './entry.ssr';\n\n/** The default export is the QwikCity adapter used by Vite preview. */\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "e2e/adapters-e2e/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this entry point\n * will be the common one.\n *\n * - Server (express, cloudflare...)\n * - Npm run start\n * - Npm run preview\n * - Npm run build\n */\nimport { renderToStream, type RenderToStreamOptions } from '@builder.io/qwik/server';\nimport { manifest } from '@qwik-client-manifest';\nimport Root from './root';\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    manifest,\n    ...opts,\n    // Use container attributes to set attributes on the html tag.\n    containerAttributes: {\n      lang: 'en-us',\n      ...opts.containerAttributes,\n    },\n    // prefetchStrategy: {\n    //   implementation: {\n    //     linkInsert: \"html-append\",\n    //     linkRel: \"modulepreload\",\n    //   },\n    // },\n    serverData: {\n      ...opts.serverData,\n    },\n  });\n}\n"
  },
  {
    "path": "e2e/adapters-e2e/src/root.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city';\nimport { RouterHead } from './components/router-head/router-head';\n\nexport default component$(() => {\n  /**\n   * The root of a QwikCity site always start with the <QwikCityProvider> component, immediately\n   * followed by the document's <head> and <body>.\n   *\n   * Don't remove the `<head>` and `<body>` elements.\n   */\n\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charSet=\"utf-8\" />\n        <RouterHead />\n        {/* <PrefetchGraph />\n        <PrefetchServiceWorker /> */}\n      </head>\n      <body lang=\"en\">\n        <RouterOutlet />\n        <ServiceWorkerRegister />\n      </body>\n    </QwikCityProvider>\n  );\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/src/routes/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { type DocumentHead } from '@builder.io/qwik-city';\nimport ClickMe from '~/components/click-me/click-me';\n\nexport default component$(() => {\n  return (\n    <>\n      <a href=\"/profile\">go to profile</a>\n      <br />\n      <h1>Home page</h1>\n      <br />\n      {/* We need to extract the component to see the bug on 1.5.7 */}\n      <ClickMe />\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: 'Welcome to Qwik',\n  meta: [\n    {\n      name: 'description',\n      content: 'Qwik site description',\n    },\n  ],\n};\n"
  },
  {
    "path": "e2e/adapters-e2e/src/routes/layout.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <Slot />;\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/src/routes/profile/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <a href=\"/\">go to home</a>\n      <br />\n      <h1>Profile page 🙂</h1>\n    </>\n  );\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/src/routes/service-worker.ts",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * The service-worker.ts file is used to have state of the art prefetching.\n * https://qwik.dev/qwikcity/prefetching/overview/\n *\n * Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.\n * You can also use this file to add more functionality that runs in the service worker.\n */\nimport { setupServiceWorker } from '@builder.io/qwik-city/service-worker';\n\nsetupServiceWorker();\n\naddEventListener('install', () => self.skipWaiting());\n\naddEventListener('activate', () => self.clients.claim());\n\ndeclare const self: ServiceWorkerGlobalScope;\n"
  },
  {
    "path": "e2e/adapters-e2e/tests/express.spec.ts",
    "content": "import { expect, test } from '@playwright/test';\n\ntest.describe('Verifying Express Adapter', () => {\n  test('should ignore unknown qdata', async ({ page, request }) => {\n    page.goto('/');\n\n    const response = await request.post('/?qfunc=ThisDoesNotExist', {\n      headers: {\n        'X-Qrl': 'ThisDoesNotExist',\n        'Content-Type': 'application/qwik-json',\n      },\n      data: {\n        _entry: '2',\n        _objs: ['\\u0002_#s_ThisDoesNotExist', 1, ['0', '1']],\n      },\n    });\n\n    await expect(response.status()).toBe(500);\n\n    // Verify server is still responsive by making another request\n    const healthCheck = await request.get('/');\n    await expect(healthCheck.ok()).toBeTruthy();\n\n    await page.getByRole('link', { name: 'go to profile' }).click();\n\n    await expect(page.getByRole('heading', { name: 'Profile page' })).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "e2e/adapters-e2e/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"allowJs\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2022\",\n    \"lib\": [\"es2022\", \"DOM\", \"WebWorker\", \"DOM.Iterable\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"outDir\": \"tmp\",\n    \"noEmit\": true,\n    \"paths\": {\n      \"~/*\": [\"./src/*\"]\n    }\n  },\n\n  \"include\": [\"src\", \"./*.d.ts\", \"./*.config.ts\"]\n}\n"
  },
  {
    "path": "e2e/adapters-e2e/vite.config.ts",
    "content": "/**\n * This is the base config for vite. When building, the adapter config is used which loads this file\n * and extends it.\n */\nimport { qwikCity } from '@builder.io/qwik-city/vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport { defineConfig, type UserConfig } from 'vite';\nimport tsconfigPaths from 'vite-tsconfig-paths';\nimport pkg from './package.json';\n\ntype PkgDep = Record<string, string>;\nconst { dependencies = {}, devDependencies = {} } = pkg as any as {\n  dependencies: PkgDep;\n  devDependencies: PkgDep;\n  [key: string]: unknown;\n};\nerrorOnDuplicatesPkgDeps(devDependencies, dependencies);\n\n/**\n * Note that Vite normally starts from `index.html` but the qwikCity plugin makes start at\n * `src/entry.ssr.tsx` instead.\n */\nexport default defineConfig((): UserConfig => {\n  return {\n    plugins: [qwikCity(), qwikVite(), tsconfigPaths({ root: '.' })],\n    // This tells Vite which dependencies to pre-build in dev mode.\n    optimizeDeps: {\n      // Put problematic deps that break bundling here, mostly those with binaries.\n      // For example ['better-sqlite3'] if you use that in server functions.\n      exclude: [],\n    },\n\n    /**\n     * This is an advanced setting. It improves the bundling of your server code. To use it, make\n     * sure you understand when your consumed packages are dependencies or dev dependencies.\n     * (otherwise things will break in production)\n     */\n    // ssr:\n    //   command === \"build\" && mode === \"production\"\n    //     ? {\n    //         // All dev dependencies should be bundled in the server build\n    //         noExternal: Object.keys(devDependencies),\n    //         // Anything marked as a dependency will not be bundled\n    //         // These should only be production binary deps (including deps of deps), CLI deps, and their module graph\n    //         // If a dep-of-dep needs to be external, add it here\n    //         // For example, if something uses `bcrypt` but you don't have it as a dep, you can write\n    //         // external: [...Object.keys(dependencies), 'bcrypt']\n    //         external: Object.keys(dependencies),\n    //       }\n    //     : undefined,\n\n    server: {\n      headers: {\n        // Don't cache the server response in dev mode\n        'Cache-Control': 'public, max-age=0',\n      },\n    },\n    preview: {\n      headers: {\n        // Do cache the server response in preview (non-adapter production build)\n        'Cache-Control': 'public, max-age=360',\n      },\n    },\n  };\n});\n\n// *** utils ***\n\n/**\n * Function to identify duplicate dependencies and throw an error\n *\n * @param {Object} devDependencies - List of development dependencies\n * @param {Object} dependencies - List of production dependencies\n */\nfunction errorOnDuplicatesPkgDeps(devDependencies: PkgDep, dependencies: PkgDep) {\n  let msg = '';\n  // Create an array 'duplicateDeps' by filtering devDependencies.\n  // If a dependency also exists in dependencies, it is considered a duplicate.\n  const duplicateDeps = Object.keys(devDependencies).filter((dep) => dependencies[dep]);\n\n  // include any known qwik packages\n  const qwikPkg = Object.keys(dependencies).filter((value) => /qwik/i.test(value));\n\n  // any errors for missing \"qwik-city-plan\"\n  // [PLUGIN_ERROR]: Invalid module \"@qwik-city-plan\" is not a valid package\n  msg = `Move qwik packages ${qwikPkg.join(', ')} to devDependencies`;\n\n  if (qwikPkg.length > 0) {\n    throw new Error(msg);\n  }\n\n  // Format the error message with the duplicates list.\n  // The `join` function is used to represent the elements of the 'duplicateDeps' array as a comma-separated string.\n  msg = `\n    Warning: The dependency \"${duplicateDeps.join(', ')}\" is listed in both \"devDependencies\" and \"dependencies\".\n    Please move the duplicated dependencies to \"devDependencies\" only and remove it from \"dependencies\"\n  `;\n\n  // Throw an error with the constructed message.\n  if (duplicateDeps.length > 0) {\n    throw new Error(msg);\n  }\n}\n"
  },
  {
    "path": "e2e/docs-e2e/.gitignore",
    "content": "\n# Playwright\nnode_modules/\n/test-results/\n/playwright-report/\n/blob-report/\n/playwright/.cache/\n"
  },
  {
    "path": "e2e/docs-e2e/package.json",
    "content": "{\n  \"name\": \"docs-e2e\",\n  \"description\": \"\",\n  \"private\": true,\n  \"author\": \"\",\n  \"devDependencies\": {\n    \"@playwright/test\": \"1.54.1\",\n    \"@types/node\": \"20.19.0\"\n  },\n  \"keywords\": [],\n  \"license\": \"ISC\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"pnpm exec playwright test --config=playwright.config.ts --project=chromium\",\n    \"test-ui\": \"pnpm exec playwright test --config=playwright.config.ts --project=chromium --ui\"\n  },\n  \"type\": \"commonjs\"\n}\n"
  },
  {
    "path": "e2e/docs-e2e/playwright.config.ts",
    "content": "import { defineConfig, devices } from '@playwright/test';\n\n/** Read environment variables from file. https://github.com/motdotla/dotenv */\n// import dotenv from 'dotenv';\n// import path from 'path';\n// dotenv.config({ path: path.resolve(__dirname, '.env') });\n\n/** See https://playwright.dev/docs/test-configuration. */\n\nconst TestingURL = 'http://127.0.0.1:3000';\n\nexport default defineConfig({\n  testDir: './tests',\n  /* Global timeout for each test */\n  timeout: 60_000,\n  expect: { timeout: 60_000 },\n  /* Run tests in files in parallel */\n  fullyParallel: true,\n  /* Fail the build on CI if you accidentally left test.only in the source code. */\n  forbidOnly: !!process.env.CI,\n  /* Retry on CI only */\n  retries: process.env.CI ? 2 : 0,\n  /* Opt out of parallel tests on CI. */\n  workers: process.env.CI ? 1 : undefined,\n  /* Reporter to use. See https://playwright.dev/docs/test-reporters */\n  reporter: 'html',\n  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */\n  use: {\n    /* Base URL to use in actions like `await page.goto('/')`. */\n    baseURL: TestingURL,\n    actionTimeout: 30_000,\n    navigationTimeout: 60_000,\n    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */\n    trace: 'on-first-retry',\n  },\n\n  /* Configure projects for major browsers */\n  projects: [\n    {\n      name: 'chromium',\n      use: { ...devices['Desktop Chrome'] },\n    },\n    {\n      name: 'chrome',\n      use: { ...devices['Desktop Chrome'] },\n    },\n\n    {\n      name: 'firefox',\n      use: { ...devices['Desktop Firefox'] },\n    },\n\n    {\n      name: 'webkit',\n      use: { ...devices['Desktop Safari'] },\n    },\n\n    /* Test against mobile viewports. */\n    // {\n    //   name: 'Mobile Chrome',\n    //   use: { ...devices['Pixel 5'] },\n    // },\n    // {\n    //   name: 'Mobile Safari',\n    //   use: { ...devices['iPhone 12'] },\n    // },\n\n    /* Test against branded browsers. */\n    // {\n    //   name: 'Microsoft Edge',\n    //   use: { ...devices['Desktop Edge'], channel: 'msedge' },\n    // },\n    // {\n    //   name: 'Google Chrome',\n    //   use: { ...devices['Desktop Chrome'], channel: 'chrome' },\n    // },\n  ],\n\n  /* Run your local dev server before starting the tests */\n  webServer: {\n    command: 'pnpm -C ../../ run docs.dev',\n    url: TestingURL,\n    reuseExistingServer: !process.env.CI,\n  },\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/advanced-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Advanced Dollar Function page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/dollar/');\n\n  await expect(page).toHaveTitle('The $ dollar sign | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Containers page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/containers/');\n  await expect(page).toHaveTitle('Containers | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced QRL page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/qrl/');\n  await expect(page).toHaveTitle('QRL | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Library page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/library/');\n  await expect(page).toHaveTitle('Component library | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Qwikloader page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/qwikloader/');\n  await expect(page).toHaveTitle('Qwikloader | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Optimizer page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/optimizer/');\n  await expect(page).toHaveTitle('Optimizer Rules | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Prefetching Modules page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/modules-prefetching/');\n  await expect(page).toHaveTitle('Prefetching | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Custom Build Directory page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/custom-build-dir/');\n  await expect(page).toHaveTitle('Custom Build Output Directory | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Vite page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/vite/');\n  await expect(page).toHaveTitle('Vite | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Routing page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/routing/');\n  await expect(page).toHaveTitle('Advanced Routing | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Advanced Plugins page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/plugins/');\n  await expect(page).toHaveTitle('Qwik Plugins | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Advanced Request Handling page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/request-handling/');\n  await expect(page).toHaveTitle('Request Handling | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Speculative Module Fetching page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/speculative-module-fetching/');\n  await expect(page).toHaveTitle('Speculative Module Fetching | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Menu page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/menu/');\n  await expect(page).toHaveTitle('Menu | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Generating Sitemaps page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/sitemaps/');\n  await expect(page).toHaveTitle('Generating Sitemaps | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced ESLint-Rules page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/eslint/');\n  //   currently does not have a custom title\n  await expect(page).toHaveTitle('Qwik - Framework reimagined for the edge');\n});\n\ntest('Advanced Content Security Policy page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/content-security-policy/');\n  await expect(page).toHaveTitle('Content Security Policy | Advanced 📚 Qwik Documentation');\n});\n\ntest('Advanced Complex Forms page loads', async ({ page }) => {\n  await page.goto('/docs/advanced/complex-forms/');\n  await expect(page).toHaveTitle('Complex Forms | Advanced 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/community-pages.load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Community Projects page loads', async ({ page }) => {\n  await page.goto('/community/projects/');\n  await expect(page).toHaveTitle('Projects | Qwik Community 📚 Qwik Documentation');\n});\n\ntest('Community Groups page loads', async ({ page }) => {\n  await page.goto('/community/groups/');\n  await expect(page).toHaveTitle('Groups | Qwik Community 📚 Qwik Documentation');\n});\n\ntest('Community Values page loads', async ({ page }) => {\n  await page.goto('/community/values/');\n  await expect(page).toHaveTitle('Values | Qwik Community 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/concepts-pages-laod.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Concepts Think Qwik page loads', async ({ page }) => {\n  await page.goto('/docs/concepts/think-qwik/');\n  await expect(page).toHaveTitle('Think Qwik | Concepts 📚 Qwik Documentation');\n});\n\ntest('Concepts Resumable page loads', async ({ page }) => {\n  await page.goto('/docs/concepts/resumable/');\n  await expect(page).toHaveTitle('Resumable | Concepts 📚 Qwik Documentation');\n});\n\ntest('Concepts Progressive page loads', async ({ page }) => {\n  await page.goto('/docs/concepts/progressive/');\n  await expect(page).toHaveTitle('Progressive | Concepts 📚 Qwik Documentation');\n});\n\ntest('Concepts Reactivity page loads', async ({ page }) => {\n  await page.goto('/docs/concepts/reactivity/');\n  await expect(page).toHaveTitle('Reactivity | Concepts 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/cookbook-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Cookbook Overview page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/');\n  await expect(page).toHaveTitle('Cookbook | Overview 📚 Qwik Documentation');\n});\n\ntest('Cookbook Algolia Search page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/algolia-search/');\n  await expect(page).toHaveTitle('Cookbook | Algolia Search 📚 Qwik Documentation');\n});\n\ntest('Cookbook Combine Request Handlers page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/combine-request-handlers/');\n  await expect(page).toHaveTitle('Cookbook | Combine Request Handlers 📚 Qwik Documentation');\n});\n\ntest('Cookbook Debouncer page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/debouncer/');\n  await expect(page).toHaveTitle('Cookbook | Debouncer 📚 Qwik Documentation');\n});\n\ntest('Cookbook Fonts page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/fonts/');\n  await expect(page).toHaveTitle('Cookbook | Font optimization 📚 Qwik Documentation');\n});\n\ntest('Cookbook Glob Import & Dynamic Import page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/glob-import/');\n  await expect(page).toHaveTitle(\n    'Cookbook | Glob Import with import.meta.glob 📚 Qwik Documentation'\n  );\n});\n\ntest('Cookbook NavLink Component page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/nav-link/');\n  await expect(page).toHaveTitle('Cookbook | Navbar link 📚 Qwik Documentation');\n});\n\ntest('Cookbook Deploy with Node using Docker page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/node-docker-deploy/');\n  await expect(page).toHaveTitle('Cookbook | Deploy with Node using Docker 📚 Qwik Documentation');\n});\n\ntest('Cookbook Portals page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/portals/');\n  await expect(page).toHaveTitle('Cookbook | Portals 📚 Qwik Documentation');\n});\n\ntest('Cookbook Streaming/deferred loaders page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/streaming-deferred-loaders/');\n  await expect(page).toHaveTitle('Cookbook | Streaming/deferred loaders 📚 Qwik Documentation');\n});\n\ntest('Cookbook sync$ Events  page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/sync-events/');\n  await expect(page).toHaveTitle('Cookbook | Synchronous Events with State 📚 Qwik Documentation');\n});\n\ntest('Cookbook Theme Management page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/theme-management/');\n  await expect(page).toHaveTitle('Cookbook | Dark and Light Theme 📚 Qwik Documentation');\n});\n\ntest('Cookbook Drag & Drop page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/drag&drop/');\n  await expect(page).toHaveTitle('Cookbook | Drag & Drop 📚 Qwik Documentation');\n});\n\ntest('Cookbook View Transition API page loads', async ({ page }) => {\n  await page.goto('/docs/cookbook/view-transition/');\n  await expect(page).toHaveTitle('Cookbook | View Transition API 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/deployments-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Deployments Overview page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/');\n  await expect(page).toHaveTitle('Deployments | Guides 📚 Qwik Documentation');\n});\n\ntest('Deployments Azure Static Web Apps Middleware page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/azure-swa/');\n  await expect(page).toHaveTitle('Azure Static Web Apps | Deployments 📚 Qwik Documentation');\n});\n\ntest('Deployments AWS Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/aws-lambda/');\n  await expect(page).toHaveTitle('AWS Lambda | Deployments 📚 Qwik Documentation');\n});\n\ntest('Deployments Firebase Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/firebase/');\n  await expect(page).toHaveTitle('Firebase | Deployments 📚 Qwik Documentation');\n});\n\ntest('Deployments Google Cloud Run Middleware page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/gcp-cloud-run/');\n  await expect(page).toHaveTitle('Cloud Run Middleware | Deployments 📚 Qwik Documentation');\n});\n\ntest('Deployments Cloudflare Pages Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/cloudflare-pages/');\n  await expect(page).toHaveTitle(\n    'Cloudflare Pages Adapter and Middleware | Deployments 📚 Qwik Documentation'\n  );\n});\n\ntest('Deployments Cloudflare Workers Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/cloudflare-workers/');\n  await expect(page).toHaveTitle(\n    'Cloudflare Workers Adapter and Middleware | Deployments 📚 Qwik Documentation'\n  );\n});\n\ntest('Deployments Deno Middleware page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/deno/');\n  await expect(page).toHaveTitle('Deno Middleware | Deployments 📚 Qwik Documentation');\n});\n\ntest('Deployments Bun Middleware page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/bun/');\n  await expect(page).toHaveTitle('Bun Middleware | Deployments 📚 Qwik Documentation');\n});\n\ntest('Deployments Netlify Edge Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/netlify-edge/');\n  await expect(page).toHaveTitle(\n    'Netlify Edge Adapter and Middleware | Deployments 📚 Qwik Documentation'\n  );\n});\n\ntest('Deployments Node Middleware page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/node/');\n  await expect(page).toHaveTitle('Node Middleware | Deployments 📚 Qwik Documentation');\n});\n\ntest('Deployments Vercel Edge Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/vercel-edge/');\n  await expect(page).toHaveTitle(\n    'Vercel Edge Adapter and Middleware | Deployments 📚 Qwik Documentation'\n  );\n});\n\ntest('Deployments Static Site Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/static/');\n  await expect(page).toHaveTitle('Static Site 📚 Qwik Documentation');\n});\n\ntest('Deployments GitHub Pages Adapter page loads', async ({ page }) => {\n  await page.goto('/docs/deployments/github-pages/');\n  await expect(page).toHaveTitle('GitHub Pages 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/docs-components-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Components Overview page loads', async ({ page }) => {\n  await page.goto('/docs/core/overview/');\n  await expect(page).toHaveTitle('Overview | Components 📚 Qwik Documentation');\n});\n\ntest('Components State page loads', async ({ page }) => {\n  await page.goto('/docs/core/state/');\n  await expect(page).toHaveTitle('State | Components 📚 Qwik Documentation');\n});\n\ntest('Components Tasks and Lifecycle page loads', async ({ page }) => {\n  await page.goto('/docs/core/tasks/');\n  await expect(page).toHaveTitle('Tasks and Lifecycle | Components 📚 Qwik Documentation');\n});\n\ntest('Components Context page loads', async ({ page }) => {\n  await page.goto('/docs/core/context/');\n  await expect(page).toHaveTitle('Context | Components 📚 Qwik Documentation');\n});\n\ntest('Components Slots page loads', async ({ page }) => {\n  await page.goto('/docs/core/slots/');\n  await expect(page).toHaveTitle('Slots | Components 📚 Qwik Documentation');\n});\n\ntest('Components Rendering page loads', async ({ page }) => {\n  await page.goto('/docs/core/rendering/');\n  await expect(page).toHaveTitle('Rendering | Components 📚 Qwik Documentation');\n});\n\ntest('Components Styles page loads', async ({ page }) => {\n  await page.goto('/docs/core/styles/');\n  await expect(page).toHaveTitle('Styles | Components 📚 Qwik Documentation');\n});\n\ntest('Components API Reference page loads', async ({ page }) => {\n  await page.goto('/api/qwik/');\n\n  // todo V2: change this to @qwik.dev\n  await expect(page).toHaveTitle('@builder.io/qwik API Reference 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/guides-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Guides Qwik in a nutshell page loads', async ({ page }) => {\n  await page.goto('/docs/guides/qwik-nutshell/');\n  await expect(page).toHaveTitle('Qwik in a nutshell | Introduction 📚 Qwik Documentation');\n});\n\ntest('Guides MDX page loads', async ({ page }) => {\n  await page.goto('/docs/guides/mdx/');\n  await expect(page).toHaveTitle('Markdown and MDX | Guides 📚 Qwik Documentation');\n});\n\ntest('Guides SSG page loads', async ({ page }) => {\n  await page.goto('/docs/guides/static-site-generation/');\n  await expect(page).toHaveTitle(\n    'Static Site Generation (SSG) Overview | Guides 📚 Qwik Documentation'\n  );\n});\n\ntest('Guides Capacitor page loads', async ({ page }) => {\n  await page.goto('/docs/guides/capacitor/');\n  await expect(page).toHaveTitle('Qwik Hybrid Native App Overview | Guides 📚 Qwik Documentation');\n});\n\ntest('Guides React Cheat Sheet page loads', async ({ page }) => {\n  await page.goto('/docs/guides/react-cheat-sheet/');\n  await expect(page).toHaveTitle('Qwik for React developers 📚 Qwik Documentation');\n});\n\ntest('Guides Best Practices page loads', async ({ page }) => {\n  await page.goto('/docs/guides/best-practices/');\n  await expect(page).toHaveTitle('Best Practices | Guides 📚 Qwik Documentation');\n});\n\ntest('Guides Bundle Optimization page loads', async ({ page }) => {\n  await page.goto('/docs/guides/bundle/');\n  await expect(page).toHaveTitle('Bundle Optimization | Guides 📚 Qwik Documentation');\n});\n\ntest('Guides Environment Variables page loads', async ({ page }) => {\n  await page.goto('/docs/guides/env-variables/');\n  await expect(page).toHaveTitle('Environment variables | Qwik City 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/integrations-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Integrations Overview page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/');\n  await expect(page).toHaveTitle('Qwik City Integrations | Guides 📚 Qwik Documentation');\n});\n\ntest('Integrations Astro page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/astro/');\n  await expect(page).toHaveTitle('Astro | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Auth.js page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/authjs/');\n  await expect(page).toHaveTitle('Auth.js | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Bootstrap page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/bootstrap/');\n  await expect(page).toHaveTitle('Bootstrap | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Builder.io page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/builderio/');\n  await expect(page).toHaveTitle('Builder.io | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Cypress page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/cypress/');\n  await expect(page).toHaveTitle('Cypress | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Drizzle page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/drizzle/');\n  await expect(page).toHaveTitle('Drizzle | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Internationalization page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/i18n/');\n  await expect(page).toHaveTitle('Internationalization | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Icons page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/icons/');\n  await expect(page).toHaveTitle('Icons | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Image Optimization page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/image-optimization/');\n  await expect(page).toHaveTitle('Image Optimization | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations LeafletJS Map page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/leaflet-map/');\n  await expect(page).toHaveTitle('LeafletJS Map | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Modular Forms page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/modular-forms/');\n  await expect(page).toHaveTitle('Modular Forms | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Nx and enterprise scale monorepos page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/nx/');\n  await expect(page).toHaveTitle('Nx Monorepos | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations OG Image / Open Graph Image page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/og-img/');\n  await expect(page).toHaveTitle('OG Image (og-img) | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Orama page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/orama/');\n  await expect(page).toHaveTitle('Qwik City and Orama 📚 Qwik Documentation');\n});\n\ntest('Integrations Panda CSS page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/panda-css/');\n  await expect(page).toHaveTitle('Panda CSS | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Partytown page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/partytown/');\n  await expect(page).toHaveTitle('Partytown | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Playwright page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/playwright/');\n  await expect(page).toHaveTitle('Playwright | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations PostCSS page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/postcss/');\n  await expect(page).toHaveTitle('PostCSS | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Prisma page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/prisma/');\n  await expect(page).toHaveTitle('Prisma | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Qwik React page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/react/');\n  await expect(page).toHaveTitle('React | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Storybook page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/storybook/');\n  await expect(page).toHaveTitle('Storybook | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Styled Vanilla Extract page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/styled-vanilla-extract/');\n  await expect(page).toHaveTitle('Styled Vanilla Extract | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Supabase page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/supabase/');\n  await expect(page).toHaveTitle('Supabase | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Tailwind page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/tailwind/');\n  await expect(page).toHaveTitle('Tailwind | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Tauri page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/tauri/');\n  await expect(page).toHaveTitle('Tauri | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Turso page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/turso/');\n  await expect(page).toHaveTitle('Turso | Integrations 📚 Qwik Documentation');\n});\n\ntest('Integrations Vitest page loads', async ({ page }) => {\n  await page.goto('/docs/integrations/vitest/');\n  await expect(page).toHaveTitle('Vitest | Integrations 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/navBarOnMobile.spec.ts",
    "content": "import { test, expect, devices } from '@playwright/test';\n\ntest.use({\n  ...devices['iPhone 13'],\n});\n\ntest('navbar on mobile', async ({ page }) => {\n  await page.goto('/');\n  const openIcon = page.locator('.mobile-menu > .more-icon > svg');\n  const closeIcon = page.locator('.mobile-menu > .close-icon > svg');\n  const navToolKit = page.locator('.menu-toolkit');\n  const body = page.locator('body');\n\n  expect(body).not.toHaveClass('header-open');\n  await expect(openIcon).toBeVisible();\n  await openIcon.click();\n  expect(body).toHaveClass('header-open');\n  await expect(closeIcon).toBeVisible();\n\n  await expect(navToolKit).toBeVisible();\n  const menuItems = await page.locator('.menu-toolkit > li > a').allTextContents();\n  const expectedMenuLinks = [\n    'Docs',\n    'Ecosystem',\n    'Tutorial',\n    'Qwik Sandbox',\n    'Blog',\n    'GitHub',\n    '@QwikDev',\n    'Discord',\n  ];\n\n  expect(menuItems).toStrictEqual(expectedMenuLinks);\n\n  await closeIcon.click();\n  expect(body).not.toHaveClass('header-open');\n  await expect(closeIcon).not.toBeVisible();\n  await expect(openIcon).toBeVisible();\n  await expect(navToolKit).not.toBeVisible();\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/pages-load-test.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('home page loads', async ({ page }) => {\n  await page.goto('/');\n  await expect(page).toHaveTitle('Framework reimagined for the edge! 📚 Qwik Documentation');\n});\n\ntest('docs page loads', async ({ page }) => {\n  await page.goto('/docs/');\n\n  await expect(page).toHaveTitle('Overview | Introduction 📚 Qwik Documentation');\n\n  const introductionLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Introduction\")) ul li a')\n    .allTextContents();\n\n  const expectedIntroductionLinks = ['Overview', 'Getting Started', 'Project structure', 'FAQ'];\n\n  expect(introductionLinksOnPage).toStrictEqual(expectedIntroductionLinks);\n\n  const componentsLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Components\")) ul li a')\n    .allTextContents();\n\n  const expectedComponentLinks = [\n    'Overview',\n    'State',\n    'Events',\n    'Tasks & Lifecycle',\n    'Context',\n    'Slots',\n    'Rendering',\n    'Styling',\n    'API Reference',\n  ];\n\n  expect(componentsLinksOnPage).toStrictEqual(expectedComponentLinks);\n\n  const qwikCityLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Qwik City\")) ul li a')\n    .allTextContents();\n\n  const expectedQwikCityLinks = [\n    'Overview',\n    'Routing',\n    'Pages',\n    'Layouts',\n    'Loaders',\n    'Actions',\n    'Validators',\n    'Endpoints',\n    'Middleware',\n    'server$',\n    'Error handling',\n    'Re-exporting loaders',\n    'Caching',\n    'HTML attributes',\n    'API reference',\n  ];\n\n  expect(qwikCityLinksOnPage).toStrictEqual(expectedQwikCityLinks);\n\n  const cookbookLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Cookbook\")) ul li a')\n    .allTextContents();\n\n  const expectedCookbookLinks = [\n    'Overview',\n    'Algolia Search',\n    'Combine Handlers',\n    'Debouncer',\n    'Fonts',\n    'Glob Import',\n    'Media Controller',\n    'NavLink',\n    'Node Docker deploy',\n    'Portals',\n    'Streaming loaders',\n    'Sync events w state',\n    'Theme Management',\n    'Drag & Drop',\n    'View Transition',\n  ];\n\n  // if you are adding a new page to the cookbook, please add a new test for the page to load too\n  expect(cookbookLinksOnPage).toStrictEqual(expectedCookbookLinks);\n\n  const integrationsLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Integrations\")) ul li a')\n    .allTextContents();\n\n  const expectedIntegrationsLinks = [\n    'Overview',\n    'Astro',\n    'Auth.js',\n    'Bootstrap',\n    'Builder.io',\n    'Cypress',\n    'Drizzle',\n    'i18n',\n    'Icons',\n    'Image Optimization',\n    'Leaflet Map',\n    'Modular Forms',\n    'Nx Monorepos',\n    'OG Image',\n    'Orama',\n    'Panda CSS',\n    'Partytown',\n    'Playwright',\n    'PostCSS',\n    'Prisma',\n    'React',\n    'Storybook',\n    'Styled Vanilla Extract',\n    'Supabase',\n    'Tailwind',\n    'Tauri',\n    'Turso',\n    'Vitest',\n  ];\n\n  expect(integrationsLinksOnPage).toStrictEqual(expectedIntegrationsLinks);\n\n  const deploymentsLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Deployments\")) ul li a')\n    .allTextContents();\n\n  const expectedDeploymentsLinks = [\n    'Overview',\n    'Azure SWA',\n    'AWS',\n    'Firebase',\n    'Google Cloud Run',\n    'Cloudflare Pages',\n    'Cloudflare Workers',\n    'Deno',\n    'Bun',\n    'Netlify Edge',\n    'Node',\n    'Self-Hosting',\n    'Vercel Edge',\n    'Static Site',\n    'Azion',\n  ];\n\n  expect(deploymentsLinksOnPage).toStrictEqual(expectedDeploymentsLinks);\n\n  const guidesLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Guides\")) ul li a')\n    .allTextContents();\n\n  const expectedGuidesLinks = [\n    'Qwik in a nutshell',\n    'Markdown & MDX',\n    'SSG',\n    'Qwik Native Apps',\n    'React Cheat Sheet',\n    'Debugging',\n    'Best Practices',\n    'Bundle Optimization',\n    'Env variables',\n  ];\n\n  expect(guidesLinksOnPage).toStrictEqual(expectedGuidesLinks);\n\n  const conceptsLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Concepts\")) ul li a')\n    .allTextContents();\n\n  const expectedConceptsLinks = ['Think Qwik', 'Resumable', 'Progressive', 'Reactivity'];\n\n  expect(conceptsLinksOnPage).toStrictEqual(expectedConceptsLinks);\n\n  const advancedLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Advanced\")) ul li a')\n    .allTextContents();\n\n  const expectedAdvancedLinks = [\n    'The $ dollar sign',\n    'Containers',\n    'QRL',\n    'Library mode',\n    'Qwikloader',\n    'Optimizer',\n    'Modules Prefetching',\n    'Build Directory',\n    'Vite',\n    'Advanced Routing',\n    'Qwik Plugins',\n    'Request Handling',\n    'Speculative Module Fetching',\n    'Menus',\n    'Static Assets',\n    'Sitemaps',\n    'ESLint-Rules',\n    'Content Security Policy',\n    'Complex Forms',\n  ];\n\n  expect(advancedLinksOnPage).toStrictEqual(expectedAdvancedLinks);\n\n  const referenceLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Reference\")) ul li a')\n    .allTextContents();\n\n  const expectedReferenceLinks = ['API Reference', 'Deprecated Features'];\n\n  expect(referenceLinksOnPage).toStrictEqual(expectedReferenceLinks);\n\n  const qwikLabsLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Qwik Labs 🧪\")) ul li a')\n    .allTextContents();\n\n  const expectedQwikLabsLinks = [\n    'Overview',\n    'Insights',\n    'Typed Routes',\n    'Devtools',\n    'usePreventNavigate',\n  ];\n\n  expect(qwikLabsLinksOnPage).toStrictEqual(expectedQwikLabsLinks);\n\n  const communityLinksOnPage = await page\n    .locator('#qwik-sidebar')\n    .locator('details:has(summary h5:text(\"Community\")) ul li a')\n    .allTextContents();\n\n  const expectedCommunityLinks = ['GitHub', '@QwikDev', 'Discord', 'Community Projects', 'Values'];\n\n  expect(communityLinksOnPage).toStrictEqual(expectedCommunityLinks);\n});\n\ntest('getting started page loads', async ({ page }) => {\n  await page.goto('/docs/getting-started/');\n  await expect(page).toHaveTitle('Getting Started | Introduction 📚 Qwik Documentation');\n});\n\ntest('Project Structure page loads', async ({ page }) => {\n  await page.goto('/docs/project-structure/');\n  await expect(page).toHaveTitle('Project Structure | Qwik City 📚 Qwik Documentation');\n});\n\ntest('FAQ page loads', async ({ page }) => {\n  await page.goto('/docs/faq/');\n  await expect(page).toHaveTitle('Frequently Asked Questions | Introduction 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/qwik-city-pages-load.spec.ts",
    "content": "// todo V2: rename file to qwik-router-pages-load.spec.ts\n// todo V2: replace all instances of Qwik City with Qwik Router\nimport { test, expect } from '@playwright/test';\n\ntest('Qwik City Overview page loads', async ({ page }) => {\n  await page.goto('/docs/qwikcity/');\n  await expect(page).toHaveTitle('Overview | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Qwik City Routing page loads', async ({ page }) => {\n  await page.goto('/docs/routing/');\n  await expect(page).toHaveTitle('Routing | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Qwik City Pages page loads', async ({ page }) => {\n  await page.goto('/docs/pages/');\n  await expect(page).toHaveTitle('Pages | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Qwik City Layout page loads', async ({ page }) => {\n  await page.goto('/docs/layout/');\n  await expect(page).toHaveTitle('Layout & Middleware | Guides 📚 Qwik Documentation');\n});\n\ntest('Qwik City Route Loader page loads', async ({ page }) => {\n  await page.goto('/docs/route-loader/');\n  await expect(page).toHaveTitle('RouteLoader$ | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Qwik City Route Action page loads', async ({ page }) => {\n  await page.goto('/docs/action/');\n  await expect(page).toHaveTitle('RouteAction$ | QwikCity 📚 Qwik Documentation');\n});\n\ntest('Qwik City Endpoints page loads', async ({ page }) => {\n  await page.goto('/docs/endpoints/');\n  await expect(page).toHaveTitle('Endpoints | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Qwik City Middleware page loads', async ({ page }) => {\n  await page.goto('/docs/middleware/');\n  await expect(page).toHaveTitle('Middleware | Guides 📚 Qwik Documentation');\n});\n\ntest('Qwik City server$ page loads', async ({ page }) => {\n  await page.goto('/docs/server$/');\n  await expect(page).toHaveTitle('server$ | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Qwik City Error Handling page loads', async ({ page }) => {\n  await page.goto('/docs/error-handling/');\n  await expect(page).toHaveTitle('Error handling | Qwik City 📚 Qwik Documentation');\n});\n\ntest('Qwik City Re-exporting Loaders page loads', async ({ page }) => {\n  await page.goto('/docs/re-exporting-loaders/');\n  await expect(page).toHaveTitle('Cookbook | Re-exporting loaders 📚 Qwik Documentation');\n});\n\ntest('Qwik City HTML Attributes page loads', async ({ page }) => {\n  await page.goto('/docs/html-attributes/');\n  await expect(page).toHaveTitle('HTML attributes | QwikCity 📚 Qwik Documentation');\n});\n\ntest('Qwik City API Reference page loads', async ({ page }) => {\n  await page.goto('/docs/api/');\n  await expect(page).toHaveTitle('API Reference | Qwik City 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/qwik-labs-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Qwik Labs Overview page loads', async ({ page }) => {\n  await page.goto('/docs/labs/');\n  await expect(page).toHaveTitle('🧪 Qwik Labs | Overview 📚 Qwik Documentation');\n});\n\ntest('Qwik Labs Insights page loads', async ({ page }) => {\n  await page.goto('/docs/labs/insights/');\n  await expect(page).toHaveTitle('🧪 Insights | Qwik Labs 📚 Qwik Documentation');\n});\n\ntest('Qwik Labs usePreventNavigate page loads', async ({ page }) => {\n  await page.goto('/docs/labs/usePreventNavigate/');\n  await expect(page).toHaveTitle('🧪 usePreventNavigate | Qwik Labs 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/reference-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('API Reference page loads', async ({ page }) => {\n  await page.goto('/api/');\n  await expect(page).toHaveTitle('Qwik - Framework reimagined for the edge');\n});\n\ntest('API Reference Deprecated Features page loads', async ({ page }) => {\n  await page.goto('/docs/deprecated-features/');\n  await expect(page).toHaveTitle('Deprecated Features | Guides 📚 Qwik Documentation');\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Docs/searchBar.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('search bar with click results', async ({ page }) => {\n  await page.goto('/');\n  await page.getByRole('button', { name: 'Search' }).click();\n  await page.getByPlaceholder('Search docs').fill('getting started qwikly');\n  await page.waitForSelector('.DocSearch-Hit', { timeout: 5000 });\n  const countOfSearchResults = await page.locator('.DocSearch-Hit').count();\n  expect(countOfSearchResults).toBeGreaterThan(0);\n  await page.getByRole('link', { name: 'Getting Started Qwikly', exact: true }).click();\n  await expect(page).toHaveURL('docs/getting-started/#getting-started-qwikly');\n});\n\ntest('search with no results', async ({ page }) => {\n  await page.goto('/');\n  await page.getByRole('button', { name: 'Search' }).click();\n  await page.getByPlaceholder('Search docs').fill('xyz123nonexistentquery');\n  await page.waitForTimeout(1000);\n  const noResults = page.locator('.DocSearch-NoResults, .DocSearch-EmptyState');\n  await expect(noResults).toBeVisible();\n});\n\ntest('search bar opens and closes', async ({ page }) => {\n  await page.goto('/');\n  await page.getByRole('button', { name: 'Search' }).click();\n  await expect(page.getByPlaceholder('Search docs')).toBeVisible();\n  await page.keyboard.press('Escape');\n  await expect(page.getByPlaceholder('Search docs')).not.toBeVisible();\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Ecosystem/ecosystem-pages-load.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest('Ecosystem page loads', async ({ page }) => {\n  await page.goto('/ecosystem//');\n  await expect(page).toHaveTitle('Qwik Ecosystem 📚 Qwik Documentation');\n});\n\ntest('Ecosystem Media Blogs Page loads', async ({ page }) => {\n  await page.goto('/media/');\n  await expect(page).toHaveTitle(\n    'Qwik Presentations, Talks, Videos and Podcasts 📚 Qwik Documentation'\n  );\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Sandbox/autoComplete.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest.describe('Sandbox Auto-complete Example', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/reactivity/auto-complete/');\n  });\n\n  test('Sandbox Auto-complete page loads', async ({ page }) => {\n    await expect(page).toHaveTitle('Auto-complete 📚 Qwik Documentation');\n    const tabButtonsTop = page.getByText('app.tsxentry.server.tsxroot.');\n\n    await expect(tabButtonsTop.getByRole('button')).toHaveCount(3);\n    await expect(page.getByRole('button', { name: 'app.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'entry.server.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'root.tsx' })).toBeVisible();\n\n    const tabButtonsBottom = page.getByText('AppHTMLSymbolsClient');\n    await expect(tabButtonsBottom.getByRole('button')).toHaveCount(6);\n\n    await expect(tabButtonsBottom.getByRole('button', { name: 'App' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'HTML' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Symbols' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Client Bundles' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'SSR Module' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Diagnostics' })).toBeVisible();\n\n    const consoleTabBottom = page.getByText('ConsoleOptions');\n    await expect(consoleTabBottom.getByRole('button')).toHaveCount(2);\n    await expect(consoleTabBottom.getByRole('button', { name: 'Console' })).toBeVisible();\n    await expect(consoleTabBottom.getByRole('button', { name: 'Options' })).toBeVisible();\n  });\n\n  test('Auto-complete app.tsx loads', async ({ page }) => {\n    const replInputAppTsx = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: 'export default component$' })\n      .nth(4);\n    await expect(replInputAppTsx).toBeVisible();\n    const serverEntryButton = page.getByRole('button', { name: 'entry.server.tsx' });\n    serverEntryButton.click();\n    await expect(replInputAppTsx).not.toBeVisible();\n    const appTsxButton = page.getByRole('button', { name: 'app.tsx' });\n    appTsxButton.click();\n    await expect(replInputAppTsx).toBeVisible();\n  });\n\n  test('Auto-complete entry.server.tsx loads', async ({ page }) => {\n    const root = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { Root } from './root';\" })\n      .nth(4);\n\n    await expect(root).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'entry.server.tsx' });\n    button.click();\n    await expect(root).toBeVisible();\n  });\n\n  test('Auto-complete root.tsx loads', async ({ page }) => {\n    const importStatement = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import App from './app';\" })\n      .nth(4);\n    await expect(importStatement).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'root.tsx' });\n    await button.click();\n    await expect(importStatement).toBeVisible();\n  });\n\n  test('Auto-complete HTML Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'HTML' });\n    await button.click();\n    const htmlCode = page.locator('code.language-html');\n    await expect(htmlCode).toBeVisible();\n    await expect(htmlCode).toContainText('<!DOCTYPE html>');\n  });\n\n  test('Auto-complete Symbols Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Symbols' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const symbolsText = page.getByText('import { _jsxQ } from').first();\n    await expect(symbolsText).toBeVisible();\n  });\n\n  test('Auto-complete Client Bundles Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Client Bundles' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const bundles = page.locator('#file-modules-client-modules').getByText('build/app.js');\n    await expect(bundles).toBeVisible();\n  });\n\n  test('Auto-complete SSR Module Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'SSR Module' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const module = page.locator('#file-modules-client-modules').getByText('entry.server.js');\n    await expect(module).toBeVisible();\n  });\n\n  test('Auto-complete Diagnostics Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Diagnostics' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const diagnostics = page.locator('.output-result.output-diagnostics');\n    await expect(diagnostics).toBeVisible();\n    await expect(diagnostics).toHaveText('- No Reported Diagnostics -');\n  });\n\n  test('Auto-complete Options Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Options' });\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).toBeVisible();\n    await expect(button).toBeVisible();\n    await button.click();\n    await expect(serverConsoleText).not.toBeVisible();\n    const DebugCheckBox = page.locator('label').filter({ hasText: 'Debug' });\n    await expect(DebugCheckBox).toBeVisible();\n    await expect(DebugCheckBox).not.toBeChecked();\n    const consoleButton = page.getByRole('button', { name: 'Console' });\n    consoleButton.click();\n    await expect(serverConsoleText).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Sandbox/clockVisible.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest.describe('Sandbox Clock Example', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/visibility/clock/');\n  });\n\n  test('Sandbox Clock page loads', async ({ page }) => {\n    await expect(page).toHaveTitle('Below the fold Clock 📚 Qwik Documentation');\n    const tabButtonsTop = page.getByText('app.tsxclock.cssentry.server.');\n\n    await expect(tabButtonsTop.getByRole('button')).toHaveCount(4);\n    await expect(page.getByRole('button', { name: 'app.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'clock.css' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'entry.server.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'root.tsx' })).toBeVisible();\n\n    const tabButtonsBottom = page.getByText('AppHTMLSymbolsClient');\n    await expect(tabButtonsBottom.getByRole('button')).toHaveCount(6);\n\n    await expect(tabButtonsBottom.getByRole('button', { name: 'App' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'HTML' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Symbols' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Client Bundles' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'SSR Module' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Diagnostics' })).toBeVisible();\n\n    const consoleTabBottom = page.getByText('ConsoleOptions');\n    await expect(consoleTabBottom.getByRole('button')).toHaveCount(2);\n    await expect(consoleTabBottom.getByRole('button', { name: 'Console' })).toBeVisible();\n    await expect(consoleTabBottom.getByRole('button', { name: 'Options' })).toBeVisible();\n  });\n\n  test('Clock app.tsx loads', async ({ page }) => {\n    const replInputAppTsx = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: 'export default component$' })\n      .nth(4);\n    await expect(replInputAppTsx).toBeVisible();\n    const serverEntryButton = page.getByRole('button', { name: 'entry.server.tsx' });\n    serverEntryButton.click();\n    await expect(replInputAppTsx).not.toBeVisible();\n    const appTsxButton = page.getByRole('button', { name: 'app.tsx' });\n    appTsxButton.click();\n    await expect(replInputAppTsx).toBeVisible();\n  });\n\n  test('Clock Clock.css loads', async ({ page }) => {\n    const clockCSS = page.getByText('background: #fff;');\n    const button = page.getByRole('button', { name: 'clock.css' });\n    await expect(clockCSS).not.toBeVisible();\n    button.click();\n    await expect(clockCSS).toBeVisible();\n  });\n\n  test('Clock entry.server.tsx loads', async ({ page }) => {\n    const root = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { Root } from './root';\" })\n      .nth(4);\n\n    await expect(root).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'entry.server.tsx' });\n    button.click();\n    await expect(root).toBeVisible();\n  });\n\n  test('Clock root.tsx loads', async ({ page }) => {\n    const importStatement = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import App from './app';\" })\n      .nth(4);\n    await expect(importStatement).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'root.tsx' });\n    await button.click();\n    await expect(importStatement).toBeVisible();\n  });\n\n  test('Clock HTML Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'HTML' });\n    await button.click();\n    const htmlCode = page.locator('code.language-html');\n    await expect(htmlCode).toBeVisible();\n    await expect(htmlCode).toContainText('<!DOCTYPE html>');\n  });\n\n  test('Clock Symbols Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Symbols' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const symbolsText = page.getByText('import { _jsxQ } from').first();\n    await expect(symbolsText).toBeVisible();\n  });\n\n  test('Clock Client Bundles Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Client Bundles' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const bundles = page.locator('#file-modules-client-modules').getByText('build/app.js');\n    await expect(bundles).toBeVisible();\n  });\n\n  test('Clock SSR Module Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'SSR Module' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const module = page.locator('#file-modules-client-modules').getByText('entry.server.js');\n    await expect(module).toBeVisible();\n  });\n\n  test('Clock Diagnostics Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Diagnostics' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const diagnostics = page.locator('.output-result.output-diagnostics');\n    await expect(diagnostics).toBeVisible();\n    await expect(diagnostics).toHaveText('- No Reported Diagnostics -');\n  });\n\n  test('Clock Options Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Options' });\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).toBeVisible();\n    await expect(button).toBeVisible();\n    await button.click();\n    await expect(serverConsoleText).not.toBeVisible();\n    const DebugCheckBox = page.locator('label').filter({ hasText: 'Debug' });\n    await expect(DebugCheckBox).toBeVisible();\n    await expect(DebugCheckBox).not.toBeChecked();\n    const consoleButton = page.getByRole('button', { name: 'Console' });\n    consoleButton.click();\n    await expect(serverConsoleText).toBeVisible();\n  });\n\n  test('Clock Visible Task ', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const resumed = page.getByText('🟢 Resumed in client');\n\n    await expect(resumed).not.toBeVisible();\n    const outerFrame = await page.locator('iframe').elementHandle();\n    const outerFrameContent = await outerFrame?.contentFrame();\n    const innerFrameHandle = await outerFrameContent?.locator('iframe').elementHandle();\n    const innerFrame = await innerFrameHandle?.contentFrame();\n\n    await innerFrame?.evaluate(() => {\n      window.scrollTo(0, document.body.scrollHeight);\n    });\n\n    await expect(resumed).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Sandbox/counter.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest.describe('Sandbox Counter Example', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/reactivity/counter/');\n  });\n\n  test('Sandbox Counter page loads', async ({ page }) => {\n    await expect(page).toHaveTitle('Counter 📚 Qwik Documentation');\n    const tabButtonsTop = page.getByText('app.tsxentry.server.tsxroot.');\n\n    await expect(tabButtonsTop.getByRole('button')).toHaveCount(3);\n    await expect(page.getByRole('button', { name: 'app.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'entry.server.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'root.tsx' })).toBeVisible();\n\n    const tabButtonsBottom = page.getByText('AppHTMLSymbolsClient');\n    await expect(tabButtonsBottom.getByRole('button')).toHaveCount(6);\n\n    await expect(tabButtonsBottom.getByRole('button', { name: 'App' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'HTML' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Symbols' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Client Bundles' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'SSR Module' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Diagnostics' })).toBeVisible();\n\n    const consoleTabBottom = page.getByText('ConsoleOptions');\n    await expect(consoleTabBottom.getByRole('button')).toHaveCount(2);\n    await expect(consoleTabBottom.getByRole('button', { name: 'Console' })).toBeVisible();\n    await expect(consoleTabBottom.getByRole('button', { name: 'Options' })).toBeVisible();\n  });\n\n  test('Counter app.tsx loads', async ({ page }) => {\n    const replInputAppTsx = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: 'export default component$' })\n      .nth(4);\n    await expect(replInputAppTsx).toBeVisible();\n    const serverEntryButton = page.getByRole('button', { name: 'entry.server.tsx' });\n    serverEntryButton.click();\n    await expect(replInputAppTsx).not.toBeVisible();\n    const appTsxButton = page.getByRole('button', { name: 'app.tsx' });\n    appTsxButton.click();\n    await expect(replInputAppTsx).toBeVisible();\n  });\n\n  test('Counter entry.server.tsx loads', async ({ page }) => {\n    const root = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { Root } from './root';\" })\n      .nth(4);\n\n    await expect(root).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'entry.server.tsx' });\n    button.click();\n    await expect(root).toBeVisible();\n  });\n\n  test('Counter root.tsx loads', async ({ page }) => {\n    const importStatement = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import App from './app';\" })\n      .nth(4);\n    await expect(importStatement).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'root.tsx' });\n    await button.click();\n    await expect(importStatement).toBeVisible();\n  });\n\n  test('Counter Click Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const countValue = page\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .locator('main>p')\n      .first();\n    const button = page\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .getByRole('button', { name: 'Click' });\n    const resumed = page.getByText('🟢 Resumed in client');\n    await expect(resumed).not.toBeVisible();\n    await expect(countValue).toHaveText('Count: 0');\n    await button.click();\n\n    await expect(countValue).toHaveText('Count: 1');\n    await expect(resumed).toBeVisible();\n  });\n\n  test('Counter HTML Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'HTML' });\n    await button.click();\n    const htmlCode = page.locator('code.language-html');\n    await expect(htmlCode).toBeVisible();\n    await expect(htmlCode).toContainText('<!DOCTYPE html>');\n  });\n\n  test('Counter Symbols Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Symbols' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const symbolsText = page.getByText('import { _jsxQ } from');\n    await expect(symbolsText).toBeVisible();\n  });\n\n  test('Counter Client Bundles Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Client Bundles' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const bundles = page.locator('#file-modules-client-modules').getByText('build/app.js');\n    await expect(bundles).toBeVisible();\n  });\n\n  test('Counter SSR Module Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'SSR Module' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const module = page.locator('#file-modules-client-modules').getByText('entry.server.js');\n    await expect(module).toBeVisible();\n  });\n\n  test('Counter Diagnostics Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Diagnostics' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const diagnostics = page.locator('.output-result.output-diagnostics');\n    await expect(diagnostics).toBeVisible();\n    await expect(diagnostics).toHaveText('- No Reported Diagnostics -');\n  });\n\n  test('Counter Options Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Options' });\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).toBeVisible();\n    await expect(button).toBeVisible();\n    await button.click();\n    await expect(serverConsoleText).not.toBeVisible();\n    const DebugCheckBox = page.locator('label').filter({ hasText: 'Debug' });\n    await expect(DebugCheckBox).toBeVisible();\n    await expect(DebugCheckBox).not.toBeChecked();\n    const consoleButton = page.getByRole('button', { name: 'Console' });\n    consoleButton.click();\n    await expect(serverConsoleText).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Sandbox/partial.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest.describe('Sandbox Partials HackerNews Example', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/partial/hackernews-index/');\n  });\n\n  test('Partial HackerNews page loads', async ({ page }) => {\n    await expect(page).toHaveTitle('HackerNews 📚 Qwik Documentation');\n    const tabButtonsTop = page.getByText('app.tsxentry.server.tsxhacker');\n\n    await expect(tabButtonsTop.getByRole('button')).toHaveCount(4);\n    await expect(page.getByRole('button', { name: 'app.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'hacker-news.css' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'entry.server.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'root.tsx' })).toBeVisible();\n\n    const tabButtonsBottom = page.getByText('AppHTMLSymbolsClient');\n    await expect(tabButtonsBottom.getByRole('button')).toHaveCount(6);\n\n    await expect(tabButtonsBottom.getByRole('button', { name: 'App' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'HTML' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Symbols' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Client Bundles' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'SSR Module' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Diagnostics' })).toBeVisible();\n\n    const consoleTabBottom = page.getByText('ConsoleOptions');\n    await expect(consoleTabBottom.getByRole('button')).toHaveCount(2);\n    await expect(consoleTabBottom.getByRole('button', { name: 'Console' })).toBeVisible();\n    await expect(consoleTabBottom.getByRole('button', { name: 'Options' })).toBeVisible();\n  });\n\n  test('Partial HackerNews app.tsx loads', async ({ page }) => {\n    const replInputAppTsx = page\n      .getByRole('code')\n      .getByText('export const HackerNews = component$');\n    await expect(replInputAppTsx).toBeVisible();\n    const serverEntryButton = page.getByRole('button', { name: 'entry.server.tsx' });\n    serverEntryButton.click();\n    await expect(replInputAppTsx).not.toBeVisible();\n    const appTsxButton = page.getByRole('button', { name: 'app.tsx' });\n    appTsxButton.click();\n    await expect(replInputAppTsx).toBeVisible();\n  });\n\n  test('Partial HackerNews entry.server.tsx loads', async ({ page }) => {\n    const root = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { Root } from './root';\" })\n      .nth(4);\n\n    await expect(root).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'entry.server.tsx' });\n    button.click();\n    await expect(root).toBeVisible();\n  });\n\n  test('Partial HackerNews root.tsx loads', async ({ page }) => {\n    const importStatement = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { HackerNews } from './app';\" })\n      .nth(4);\n    await expect(importStatement).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'root.tsx' });\n    await button.click();\n    await expect(importStatement).toBeVisible();\n  });\n\n  test('Partial HackerNews hacker-news.css loads', async ({ page }) => {\n    const clockCSS = page.getByText('background-color: #f2f3f5;');\n    const button = page.getByRole('button', { name: 'hacker-news.css' });\n    await expect(clockCSS).not.toBeVisible();\n    button.click();\n    await expect(clockCSS).toBeVisible();\n  });\n\n  test('Partial HackerNews fetchRequest Loads', async ({ page }) => {\n    const linkToNextPage = page\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .getByRole('link', { name: 'Next Page' });\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    await expect(linkToNextPage).toBeVisible();\n  });\n\n  test('Partial HackerNews HTML Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'HTML' });\n    await button.click();\n    const htmlCode = page.locator('code.language-html');\n    await expect(htmlCode).toBeVisible();\n    await expect(htmlCode).toContainText('<!DOCTYPE html>');\n  });\n\n  test('Partial HackerNews Symbols Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Symbols' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const symbolsText = page.getByText('import { _jsxQ } from').first();\n    await expect(symbolsText).toBeVisible();\n  });\n\n  test('Partial HackerNews Client Bundles Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Client Bundles' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const bundles = page.locator('#file-modules-client-modules').getByText('build/app.js');\n    await expect(bundles).toBeVisible();\n  });\n\n  test('Partial HackerNews SSR Module Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'SSR Module' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const module = page.locator('#file-modules-client-modules').getByText('entry.server.js');\n    await expect(module).toBeVisible();\n  });\n\n  test('Partial HackerNews Diagnostics Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Diagnostics' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const diagnostics = page.locator('.output-result.output-diagnostics');\n    await expect(diagnostics).toBeVisible();\n    await expect(diagnostics).toHaveText('- No Reported Diagnostics -');\n  });\n\n  test('Clock Options Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Options' });\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).toBeVisible();\n    await expect(button).toBeVisible();\n    await button.click();\n    await expect(serverConsoleText).not.toBeVisible();\n    const DebugCheckBox = page.locator('label').filter({ hasText: 'Debug' });\n    await expect(DebugCheckBox).toBeVisible();\n    await expect(DebugCheckBox).not.toBeChecked();\n    const consoleButton = page.getByRole('button', { name: 'Console' });\n    consoleButton.click();\n    await expect(serverConsoleText).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Sandbox/routing.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest.describe('Sandbox Routing ', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/introduction/hello-world/');\n    const Links = page.locator('.examples-menu a');\n    const linkCount = await Links.count();\n    expect(linkCount).toBe(8);\n  });\n\n  test.afterEach(async ({ page }) => {\n    const link = page.getByRole('link', { name: '🌎 Hello World The simplest' });\n    await expect(link).toBeVisible();\n    await link.click();\n    await expect(page).toHaveTitle('Hello World - Qwik');\n  });\n\n  test('Routing runtime-less link test', async ({ page }) => {\n    const link = page.getByRole('link', { name: '🪶 Runtime-less' });\n    await expect(link).toBeVisible();\n    await link.click();\n    await page.waitForLoadState('networkidle');\n    expect(page.url()).toContain('/examples/introduction/runtime-less');\n  });\n\n  test('Routing useTask() link test', async ({ page }) => {\n    const link = page.getByRole('link', { name: '👀 Simple useTask()' });\n    await expect(link).toBeVisible();\n    await link.click();\n    await page.waitForLoadState('networkidle');\n    expect(page.url()).toContain('/examples/reactivity/task/');\n  });\n\n  test('Routing Counter link test', async ({ page }) => {\n    const link = page.getByRole('link', { name: '⏲ Counter' });\n    await expect(link).toBeVisible();\n    await link.click();\n    await page.waitForLoadState('networkidle');\n    expect(page.url()).toContain('/examples/reactivity/counter/');\n  });\n\n  test('Routing Auto Complete link test', async ({ page }) => {\n    const link = page.getByRole('link', { name: '🎬 Auto-complete' });\n    await expect(link).toBeVisible();\n    await link.click();\n    await page.waitForLoadState('networkidle');\n    expect(page.url()).toContain('/examples/reactivity/auto-complete/');\n  });\n\n  test('Routing Below the fold Clock  link test', async ({ page }) => {\n    const link = page.getByRole('link', { name: '⏰ Below the fold Clock' });\n    await expect(link).toBeVisible();\n    await link.click();\n    await page.waitForLoadState('networkidle');\n    expect(page.url()).toContain('/examples/visibility/clock/');\n  });\n  test('Routing Partials HN link test', async ({ page }) => {\n    const link = page.getByRole('link', { name: '📰 HackerNews HackerNews' });\n    await expect(link).toBeVisible();\n    await link.click();\n    await page.waitForLoadState('networkidle');\n    expect(page.url()).toContain('/examples/partial/hackernews-index/');\n  });\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Sandbox/sandbox.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest.describe('Sandbox Hello World Example', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/introduction/hello-world/');\n  });\n\n  test('Sandbox page loads', async ({ page }) => {\n    await expect(page).toHaveTitle('Hello World 📚 Qwik Documentation');\n    const tabButtonsTop = page.getByText('app.tsxentry.server.tsxroot.');\n\n    await expect(tabButtonsTop.getByRole('button')).toHaveCount(3);\n    await expect(page.getByRole('button', { name: 'app.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'entry.server.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'root.tsx' })).toBeVisible();\n\n    const tabButtonsBottom = page.getByText('AppHTMLSymbolsClient');\n    await expect(tabButtonsBottom.getByRole('button')).toHaveCount(6);\n    await expect(tabButtonsBottom.getByRole('button', { name: 'App' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'HTML' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Symbols' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Client Bundles' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'SSR Module' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Diagnostics' })).toBeVisible();\n\n    const consoleTabBottom = page.getByText('ConsoleOptions');\n    await expect(consoleTabBottom.getByRole('button')).toHaveCount(2);\n    await expect(consoleTabBottom.getByRole('button', { name: 'Console' })).toBeVisible();\n    await expect(consoleTabBottom.getByRole('button', { name: 'Options' })).toBeVisible();\n  });\n\n  test('Hello world app loads', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const appText = page\n      .getByRole('main')\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .getByText('Hello Qwik');\n    await expect(appText).toBeVisible();\n  });\n\n  test('Hello World app.tsx loads', async ({ page }) => {\n    const text = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: 'return <p>Hello Qwik</p>;' })\n      .nth(4);\n    await expect(text).toBeVisible();\n  });\n\n  test('Hello World update p tag', async ({ page }) => {\n    const text = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: 'return <p>Hello Qwik</p>;' })\n      .nth(4);\n    await expect(text).toBeVisible();\n    await text.click();\n    await page.keyboard.press('Home');\n    await page.keyboard.press('Shift+End');\n\n    await page.keyboard.type('return <p>Hello Test 1234</p>;');\n    await expect(text).not.toBeVisible();\n\n    const appText = page\n      .getByRole('main')\n      .locator('iframe')\n      .first()\n      .contentFrame()\n      .locator('iframe')\n      .first()\n      .contentFrame()\n      .getByText('Hello Test 1234');\n    await expect(appText).toBeVisible();\n  });\n\n  test('Hello World entry.server.tsx tab works', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'entry.server.tsx' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const root = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { Root } from './root';\" })\n      .nth(4);\n    await expect(root).toBeVisible();\n  });\n\n  test('Hello World root.tsx tab works', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'root.tsx' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const app = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import App from './app';\" })\n      .nth(4);\n    await expect(app).toBeVisible();\n  });\n\n  test('Hello world HTML Button', async ({ page }) => {\n    const htmlButton = page.getByRole('button', { name: 'HTML' });\n    await expect(htmlButton).toBeVisible();\n    await htmlButton.click();\n    const htmlCode = page.locator('code.language-html');\n    await expect(htmlCode).toBeVisible();\n    await expect(htmlCode).toContainText('<!DOCTYPE html>');\n  });\n\n  test('Hello world Symbols Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Symbols' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const symbolsText = page.getByText('import { _jsxQ } from');\n    await expect(symbolsText).toBeVisible();\n  });\n\n  test('Hello world Client Bundles Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Client Bundles' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const bundles = page.locator('#file-modules-client-modules').getByText('build/app.js');\n    await expect(bundles).toBeVisible();\n  });\n\n  test('Hello world SSR Module Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'SSR Module' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const module = page.locator('#file-modules-client-modules').getByText('entry.server.js');\n    await expect(module).toBeVisible();\n  });\n\n  test('Hello world Diagnostics Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Diagnostics' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const diagnostics = page.locator('.output-result.output-diagnostics');\n    await expect(diagnostics).toBeVisible();\n    await expect(diagnostics).toHaveText('- No Reported Diagnostics -');\n  });\n\n  test('Hello world Console', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Console' });\n    await expect(button).toBeVisible();\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).toBeVisible();\n  });\n\n  test('Hello world Options Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Options' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).not.toBeVisible();\n    const DebugCheckBox = page.locator('label').filter({ hasText: 'Debug' });\n    await expect(DebugCheckBox).toBeVisible();\n    await expect(DebugCheckBox).not.toBeChecked();\n  });\n});\n\ntest.describe('Sandbox Runtime-less Example', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/introduction/runtime-less/');\n  });\n  test('Sandbox Runtime-less page loads', async ({ page }) => {\n    await expect(page).toHaveTitle('Runtime-less 📚 Qwik Documentation');\n    const tabButtonsTop = page.getByText('app.tsxentry.server.tsxroot.');\n\n    await expect(tabButtonsTop.getByRole('button')).toHaveCount(3);\n    await expect(page.getByRole('button', { name: 'app.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'entry.server.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'root.tsx' })).toBeVisible();\n\n    const tabButtonsBottom = page.getByText('AppHTMLSymbolsClient');\n    await expect(tabButtonsBottom.getByRole('button')).toHaveCount(6);\n\n    await expect(tabButtonsBottom.getByRole('button', { name: 'App' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'HTML' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Symbols' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Client Bundles' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'SSR Module' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Diagnostics' })).toBeVisible();\n\n    const consoleTabBottom = page.getByText('ConsoleOptions');\n    await expect(consoleTabBottom.getByRole('button')).toHaveCount(2);\n    await expect(consoleTabBottom.getByRole('button', { name: 'Console' })).toBeVisible();\n    await expect(consoleTabBottom.getByRole('button', { name: 'Options' })).toBeVisible();\n\n    const consoleLogSSR = page.getByText('ssr render <App>');\n    await expect(consoleLogSSR).toHaveCount(1);\n    await expect(consoleLogSSR).toBeVisible();\n  });\n\n  test('Runtime-less APP.tsx loads', async ({ page }) => {\n    const replInputAppTsx = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"console.log('render <App>');\" })\n      .nth(4);\n    await expect(replInputAppTsx).toBeVisible();\n    const serverEntryButton = page.getByRole('button', { name: 'entry.server.tsx' });\n    serverEntryButton.click();\n    await expect(replInputAppTsx).not.toBeVisible();\n    const appTsxButton = page.getByRole('button', { name: 'app.tsx' });\n    appTsxButton.click();\n    await expect(replInputAppTsx).toBeVisible();\n  });\n\n  test('Runtime-less entry.server.tsx loads', async ({ page }) => {\n    const root = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { Root } from './root';\" })\n      .nth(4);\n\n    await expect(root).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'entry.server.tsx' });\n    button.click();\n    await expect(root).toBeVisible();\n  });\n\n  test('Runtime-less root.tsx loads', async ({ page }) => {\n    const importStatement = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import App from './app';\" })\n      .nth(4);\n    await expect(importStatement).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'root.tsx' });\n    await button.click();\n    await expect(importStatement).toBeVisible();\n  });\n\n  test('Runtime-less Action Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .getByRole('button', { name: 'Action' });\n    await button.click();\n    const clicked = page.getByText('client click');\n    await expect(clicked).toHaveCount(1);\n    await button.click();\n    await expect(clicked).toHaveCount(2);\n  });\n  test('Runtime-less HTML Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'HTML' });\n    await button.click();\n    const htmlCode = page.locator('code.language-html');\n    await expect(htmlCode).toBeVisible();\n    await expect(htmlCode).toContainText('<!DOCTYPE html>');\n  });\n\n  test('Runtime-less Symbols Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Symbols' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const symbolsText = page.getByText('import { _jsxQ } from');\n    await expect(symbolsText).toBeVisible();\n  });\n\n  test('Runtime-less Client Bundles Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Client Bundles' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const bundles = page.locator('#file-modules-client-modules').getByText('build/app.js');\n    await expect(bundles).toBeVisible();\n  });\n\n  test('Runtime-less SSR Module Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'SSR Module' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const module = page.locator('#file-modules-client-modules').getByText('entry.server.js');\n    await expect(module).toBeVisible();\n  });\n\n  test('Runtime-less Diagnostics Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Diagnostics' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const diagnostics = page.locator('.output-result.output-diagnostics');\n    await expect(diagnostics).toBeVisible();\n    await expect(diagnostics).toHaveText('- No Reported Diagnostics -');\n  });\n\n  test('Runtime-less Options Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Options' });\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).toBeVisible();\n    await expect(button).toBeVisible();\n    await button.click();\n    await expect(serverConsoleText).not.toBeVisible();\n    const DebugCheckBox = page.locator('label').filter({ hasText: 'Debug' });\n    await expect(DebugCheckBox).toBeVisible();\n    await expect(DebugCheckBox).not.toBeChecked();\n    const consoleButton = page.getByRole('button', { name: 'Console' });\n    consoleButton.click();\n    await expect(serverConsoleText).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "e2e/docs-e2e/tests/Sandbox/usetask.spec.ts",
    "content": "import { test, expect } from '@playwright/test';\n\ntest.describe('Sandbox useTask', () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto('/examples/reactivity/task/');\n  });\n\n  test('useTask page loads', async ({ page }) => {\n    await expect(page).toHaveTitle('Simple useTask() 📚 Qwik Documentation');\n    const tabButtonsTop = page.getByText('app.tsxentry.server.tsxroot.');\n\n    await expect(tabButtonsTop.getByRole('button')).toHaveCount(3);\n    await expect(page.getByRole('button', { name: 'app.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'entry.server.tsx' })).toBeVisible();\n    await expect(page.getByRole('button', { name: 'root.tsx' })).toBeVisible();\n\n    const tabButtonsBottom = page.getByText('AppHTMLSymbolsClient');\n    await expect(tabButtonsBottom.getByRole('button')).toHaveCount(6);\n    await expect(tabButtonsBottom.getByRole('button', { name: 'App' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'HTML' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Symbols' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Client Bundles' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'SSR Module' })).toBeVisible();\n    await expect(tabButtonsBottom.getByRole('button', { name: 'Diagnostics' })).toBeVisible();\n\n    const consoleTabBottom = page.getByText('ConsoleOptions');\n    await expect(consoleTabBottom.getByRole('button')).toHaveCount(2);\n    await expect(consoleTabBottom.getByRole('button', { name: 'Console' })).toBeVisible();\n    await expect(consoleTabBottom.getByRole('button', { name: 'Options' })).toBeVisible();\n  });\n\n  test('useTask app.tsx loads', async ({ page }) => {\n    const appTsxButton = page.getByRole('button', { name: 'app.tsx' });\n    const replInputAppTsx = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: 'export default component$' })\n      .nth(4);\n    await expect(replInputAppTsx).toBeVisible();\n    const serverEntryButton = page.getByRole('button', { name: 'entry.server.tsx' });\n    serverEntryButton.click();\n    await expect(replInputAppTsx).not.toBeVisible();\n\n    appTsxButton.click();\n    await expect(replInputAppTsx).toBeVisible();\n  });\n\n  test('useTask entry.server.tsx loads', async ({ page }) => {\n    const root = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import { Root } from './root';\" })\n      .nth(4);\n\n    await expect(root).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'entry.server.tsx' });\n    button.click();\n    await expect(root).toBeVisible();\n  });\n\n  test('useTask root.tsx loads', async ({ page }) => {\n    const importStatement = page\n      .getByRole('code')\n      .locator('div')\n      .filter({ hasText: \"import App from './app';\" })\n      .nth(4);\n    await expect(importStatement).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'root.tsx' });\n    await button.click();\n    await expect(importStatement).toBeVisible();\n  });\n\n  test('useTask Debounced Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .getByRole('button', { name: '+' });\n    const childValue = page\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .locator('#child');\n    const consoleUpdate = page.getByText('client count changed');\n    const resumed = page.getByText('🟢 Resumed in client');\n\n    const debouncedSelector = page\n      .locator('iframe')\n      .contentFrame()\n      .locator('iframe')\n      .contentFrame()\n      .locator('#debounced');\n    await expect(debouncedSelector).toHaveText('Debounced: 0');\n    await expect(childValue).toHaveText('0');\n    await expect(resumed).not.toBeVisible();\n    await expect(consoleUpdate).not.toBeVisible();\n\n    button.click();\n\n    await expect(consoleUpdate).toHaveCount(1);\n    await expect(consoleUpdate).toBeVisible();\n    await expect(resumed).toBeVisible();\n    await expect(debouncedSelector).toHaveText('Debounced: 1');\n    await expect(childValue).toHaveText('1');\n  });\n\n  test('useTask HTML Button', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n    const button = page.getByRole('button', { name: 'HTML' });\n    await button.click();\n    const htmlCode = page.locator('code.language-html');\n    await expect(htmlCode).toBeVisible();\n    await expect(htmlCode).toContainText('<!DOCTYPE html>');\n  });\n\n  test('useTask Symbols Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Symbols' });\n    await expect(button).toBeVisible();\n    await button.click();\n\n    const symbolsText = page.getByText('import { useLexicalScope } ').first();\n    await expect(symbolsText).toBeVisible();\n  });\n\n  test('useTask Client Bundles Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Client Bundles' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const bundles = page.locator('#file-modules-client-modules').getByText('build/app.js');\n    await expect(bundles).toBeVisible();\n  });\n\n  test('useTask SSR Module Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'SSR Module' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const module = page.locator('#file-modules-client-modules').getByText('entry.server.js');\n    await expect(module).toBeVisible();\n  });\n\n  test('useTask Diagnostics Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Diagnostics' });\n    await expect(button).toBeVisible();\n    await button.click();\n    const diagnostics = page.locator('.output-result.output-diagnostics');\n    await expect(diagnostics).toBeVisible();\n    await expect(diagnostics).toHaveText('- No Reported Diagnostics -');\n  });\n\n  test('useTask Options Button', async ({ page }) => {\n    const button = page.getByRole('button', { name: 'Options' });\n    const serverConsoleText = page.getByText('🔴 Paused in server');\n    await expect(serverConsoleText).toBeVisible();\n    await expect(button).toBeVisible();\n    await button.click();\n    await expect(serverConsoleText).not.toBeVisible();\n    const DebugCheckBox = page.locator('label').filter({ hasText: 'Debug' });\n    await expect(DebugCheckBox).toBeVisible();\n    await expect(DebugCheckBox).not.toBeChecked();\n    const consoleButton = page.getByRole('button', { name: 'Console' });\n    consoleButton.click();\n    await expect(serverConsoleText).toBeVisible();\n  });\n\n  test('useTask server console loads', async ({ page }) => {\n    const spinner = page.locator('.repl-spinner');\n    await expect(spinner).toBeVisible();\n    await expect(spinner).not.toBeVisible();\n\n    const ssrPageCount = page.getByText('ssr count changed');\n    const ssrAppRenders = page.getByText('ssr <App> renders');\n    const ssrChildRenders = page.getByText('ssr <Child> render');\n    const ssrGrandChildRenders = page.getByText('ssr <GrandChild> render');\n    const pausedInServer = page.getByText('🔴 Paused in server');\n\n    await expect(ssrPageCount).toBeVisible();\n    await expect(ssrAppRenders).toBeVisible();\n    await expect(ssrChildRenders).toBeVisible();\n    await expect(ssrGrandChildRenders).toBeVisible();\n    await expect(pausedInServer).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "e2e/qwik-cli-e2e/README.md",
    "content": "# CLI E2E tests for the Qwik Framework\n\nThis package provides isolated E2E tests by generating a new application with local packages and then running tests again that code by executing it and verifying expected behavior.\n\n## Description\n\nTests can be invoked by running `pnpm run test.e2e.cli`.\n\n**Note that running E2E tests requires the workspace projects to be prebuilt manually!**\n\nE2E project does the following internally:\n\n0. Vitest is configured to run a setup function once **PRIOR TO ALL** tests. During the setup `@builder.io/qwik`, `@builder.io/qwik-city` and `eslint-plugin-qwik` packages will be packed with `pnpm pack` Those will be used at a step 2 for every test. Tarballs are located in `temp/tarballs` folder within this repo. It is assumed that packages are built before E2E is executed.\n\n1. Simulates `npm create qwik` locally using direct command `node packages/create-qwik/create-qwik.cjs playground {outputDir}`\n   - By default `outputDir` is an auto-generated one using `tmp` npm package. The application that is created here will be removed after the test is executed\n   - It is possible to install into custom folder using environment variable `TEMP_E2E_PATH`. Here's how the command would look like in this case:\n   - with absolute path `TEMP_E2E_PATH=/Users/name/projects/tests pnpm run test.e2e.cli`\n   - with path relative to the qwik workspace `TEMP_E2E_PATH=temp/e2e-folder pnpm run test.e2e.cli`\n\n   Note that provided folder should exist. If custom path is used, generated application will not be removed after the test completes, which is helpful for debugging.\n\n2. Uses packed `@builder.io/qwik`, `@builder.io/qwik-city` and `eslint-plugin-qwik` packages to update package.json file of the generated application with `file:path-to-package.tgz`.\n\n3. Runs actual tests. Please pay attention at the `beforeAll` hook in the spec file\n\n```typescript\nbeforeAll(() => {\n  const config = scaffoldQwikProject();\n  global.tmpDir = config.tmpDir;\n\n  return async () => {\n    await killAllRegisteredProcesses();\n    config.cleanupFn();\n  };\n});\n```\n\nNotice that `beforeAll` returns a function, which will be executed after the test completes either with success or failure.\n\nBoth `config.cleanupFn();` and `killAllRegisteredProcesses` there are extremely important:\n\n- `config.cleanupFn()` is used in order to remove temporary folder with generated project after the test is executed (again, it's not being removed if `TEMP_E2E_PATH` is provided).\n- `killAllRegisteredProcesses` should be used to remove any active ports as we are serving the app during the test execution.\n  Processes are being registered internally when `runCommandUntil` is executed. If you're executing something manually, you can use `registerExecutedChildProcess` utility to register the process.\n  Despite `killAllRegisteredProcesses` will kill all processes when test exists, it is also a good practice to kill the process manually within the `it` statement using `await promisifiedTreeKill(yourChildProcess.pId, 'SIGKILL')`\n\n## Adding new tests\n\nRight now we have only one test file within this project. This means only one test application will be created and used, which is good from the execution time standpoint. If more files are added, it shouldn't potentially be a problem as we have `fileParallelism: false` set in the `vite.config.ts`, which means only one test will be executed at a time. This obviously slows down the execution time, but is safer, because we're working with a real file system.\n"
  },
  {
    "path": "e2e/qwik-cli-e2e/package.json",
    "content": "{\n  \"name\": \"qwik-cli-e2e\",\n  \"version\": \"0.0.0\",\n  \"dependencies\": {\n    \"kleur\": \"4.1.5\"\n  },\n  \"private\": true,\n  \"scripts\": {\n    \"e2e\": \"vitest run --config=vite.config.ts\",\n    \"e2e.watch\": \"vitest watch --config=vite.config.ts\"\n  }\n}\n"
  },
  {
    "path": "e2e/qwik-cli-e2e/tests/serve.spec.ts",
    "content": "/* eslint-disable no-console */\nimport { existsSync, readFileSync, writeFileSync } from 'fs';\nimport { join } from 'path';\nimport { assert, beforeAll, beforeEach, describe, expect, test } from 'vitest';\nimport {\n  assertHostUnused,\n  DEFAULT_TIMEOUT,\n  getPageHtml,\n  killAllRegisteredProcesses,\n  log,\n  promisifiedTreeKill,\n  runCommandUntil,\n  scaffoldQwikProject,\n  type QwikProjectType,\n} from '../utils';\n\nlet SERVE_PORT = 3535;\nbeforeEach(() => {\n  // the port doesn't clear immediately after the previous test\n  SERVE_PORT++;\n});\nfor (const type of ['empty', 'playground'] as QwikProjectType[]) {\n  describe(`template: ${type}`, () => {\n    beforeAll(() => {\n      console.log('================================================ scaffolding', type);\n      const config = scaffoldQwikProject(type);\n      global.tmpDir = config.tmpDir;\n\n      return async () => {\n        try {\n          await killAllRegisteredProcesses();\n        } catch (e) {\n          log(`Error during process cleanup: ${e.message}`);\n        }\n        config.cleanupFn();\n      };\n    });\n\n    if (type === 'playground') {\n      test(\n        'Should serve the app in dev mode and update the content on hot reload',\n        { timeout: DEFAULT_TIMEOUT },\n        async () => {\n          const host = `http://localhost:${SERVE_PORT}/`;\n          await assertHostUnused(host);\n          const p = await runCommandUntil(\n            `npm run dev -- --port ${SERVE_PORT}`,\n            global.tmpDir,\n            (output) => {\n              return output.includes(host);\n            }\n          );\n          assert.equal(existsSync(global.tmpDir), true);\n\n          await expectHtmlOnARootPage(host);\n\n          // Don't let process termination errors fail the test\n          try {\n            await promisifiedTreeKill(p.pid!, 'SIGKILL');\n          } catch (e) {\n            log(`Error terminating dev server: ${e.message}`);\n          }\n        }\n      );\n    }\n\n    test('Should preview the app', { timeout: DEFAULT_TIMEOUT }, async () => {\n      const host = `http://localhost:${SERVE_PORT}/`;\n      await assertHostUnused(host);\n\n      // First build the app\n      const buildProcess = await runCommandUntil(`npm run build`, global.tmpDir, (output) => {\n        return output.includes('dist/build') || output.includes('built in');\n      });\n\n      try {\n        await promisifiedTreeKill(buildProcess.pid!, 'SIGKILL');\n      } catch (e) {\n        log(`Error terminating build process: ${e.message}`);\n      }\n\n      // Now run the preview\n      const p = await runCommandUntil(\n        `npm run preview -- --no-open --port ${SERVE_PORT}`,\n        global.tmpDir,\n        (output) => {\n          return output.includes(host);\n        }\n      );\n\n      assert.equal(existsSync(global.tmpDir), true);\n\n      // Wait a bit for the server to fully start\n      await new Promise((resolve) => setTimeout(resolve, 2000));\n\n      const res = await fetch(host, { headers: { accept: 'text/html' } }).then((r) => r.text());\n      console.log('** res', res);\n\n      // Check for the appropriate content based on template type\n      if (type === 'playground') {\n        expect(res).toContain('fantastic');\n      } else if (type === 'empty') {\n        expect(res).toContain('Hi');\n        expect(res).toContain('qwik');\n      }\n\n      try {\n        await promisifiedTreeKill(p.pid!, 'SIGKILL');\n      } catch (e) {\n        log(`Error terminating preview server: ${e.message}`);\n      }\n    });\n  });\n}\n\nasync function expectHtmlOnARootPage(host: string) {\n  expect((await getPageHtml(host)).querySelector('.container h1')?.textContent).toBe(\n    `So fantasticto have you here`\n  );\n  const heroComponentPath = join(global.tmpDir, `src/components/starter/hero/hero.tsx`);\n  const heroComponentTextContent = readFileSync(heroComponentPath, 'utf-8');\n  writeFileSync(\n    heroComponentPath,\n    heroComponentTextContent.replace(\n      `to have <span class=\"highlight\">you</span> here`,\n      `to have <span class=\"highlight\">e2e tests</span> here`\n    )\n  );\n  // wait for the arbitrary amount of time before the app is reloaded\n  await new Promise((r) => setTimeout(r, 2000));\n  expect((await getPageHtml(host)).querySelector('.container h1')?.textContent).toBe(\n    `So fantasticto have e2e tests here`\n  );\n}\n"
  },
  {
    "path": "e2e/qwik-cli-e2e/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"types\": [\"vitest/globals\"],\n    \"esModuleInterop\": true\n  },\n  \"include\": [\"utils\", \"tests\"]\n}\n"
  },
  {
    "path": "e2e/qwik-cli-e2e/utils/index.ts",
    "content": "import { ChildProcess, exec, execSync } from 'child_process';\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs';\nimport { yellow } from 'kleur/colors';\nimport { dirname, join, resolve } from 'path';\nimport { dirSync } from 'tmp';\nimport treeKill from 'tree-kill';\nimport { promisify } from 'util';\nimport { createDocument } from '../../../packages/qwik/src/testing/document';\n\nexport type QwikProjectType = 'playground' | 'library' | 'empty';\nexport function scaffoldQwikProject(type: QwikProjectType): {\n  tmpDir: string;\n  cleanupFn: () => void;\n} {\n  const tmpHostDirData = getTmpDirSync(\n    process.env.TEMP_E2E_PATH ? `${process.env.TEMP_E2E_PATH}/${type}` : undefined\n  );\n  const cleanupFn = () => {\n    if (!tmpHostDirData.overridden) {\n      cleanup(tmpHostDirData.path);\n    } else {\n      log('Custom E2E test path was used, skipping the removal of test folder');\n    }\n  };\n  try {\n    const tmpDir = runCreateQwikCommand(tmpHostDirData.path, type);\n    log(`Created test application at \"${tmpDir}\"`);\n    replacePackagesWithLocalOnes(tmpDir);\n    return { cleanupFn, tmpDir };\n  } catch (error) {\n    cleanupFn();\n    throw error;\n  }\n}\n\nfunction cleanup(tmpDir: string) {\n  log(`Removing tmp dir \"${tmpDir}\"`);\n  rmSync(tmpDir, { recursive: true });\n}\n\nfunction getTmpDirSync(tmpDirOverride?: string) {\n  if (tmpDirOverride) {\n    tmpDirOverride = resolve(workspaceRoot, tmpDirOverride);\n  }\n\n  if (tmpDirOverride && !existsSync(tmpDirOverride)) {\n    throw new Error(`\"${tmpDirOverride}\" does not exist.`);\n  }\n  if (tmpDirOverride) {\n    const p = join(tmpDirOverride, 'qwik_e2e');\n    if (existsSync(p)) {\n      log(`Removing project folder \"${p}\" (will be recreated).`);\n      rmSync(p, { recursive: true });\n    }\n    mkdirSync(p);\n    return { path: p, overridden: true };\n  }\n  return { path: dirSync({ prefix: 'qwik_e2e' }).name, overridden: false };\n}\n\nfunction runCreateQwikCommand(tmpDir: string, type: 'playground' | 'library' | 'empty'): string {\n  const appDir = 'e2e-app';\n  execSync(\n    `node \"${workspaceRoot}/packages/create-qwik/create-qwik.cjs\" ${type} \"${join(tmpDir, appDir)}\"`\n  );\n  return join(tmpDir, appDir);\n}\n\nfunction replacePackagesWithLocalOnes(tmpDir: string) {\n  const tarballConfig = JSON.parse(\n    readFileSync(join(workspaceRoot, 'temp/tarballs/paths.json'), 'utf-8')\n  );\n  for (const { name, absolutePath } of tarballConfig) {\n    patchPackageJsonForPlugin(tmpDir, name, absolutePath);\n  }\n  execSync('pnpm i', {\n    cwd: tmpDir,\n    // only output errors\n    stdio: ['ignore', 'inherit', 'inherit'],\n  });\n}\n\nfunction patchPackageJsonForPlugin(tmpDirName: string, npmPackageName: string, distPath: string) {\n  const path = join(tmpDirName, 'package.json');\n  const json = JSON.parse(readFileSync(path, 'utf-8'));\n  json.devDependencies[npmPackageName] = `file:${distPath}`;\n  writeFileSync(path, JSON.stringify(json));\n}\n\nexport function registerExecutedChildProcess(process: ChildProcess) {\n  if (typeof global !== 'undefined') {\n    (global.pIds ??= []).push(process.pid);\n    log(`Registered a process with id \"${process.pid}\"`);\n  } else {\n    throw new Error('\"global\" is not defined');\n  }\n}\n\nexport function runCommandUntil(\n  command: string,\n  tmpDir: string,\n  criteria: (output: string) => boolean\n): Promise<ChildProcess> {\n  const p = exec(command, {\n    cwd: tmpDir,\n    encoding: 'utf-8',\n  });\n  registerExecutedChildProcess(p);\n  return new Promise<ChildProcess>((res, rej) => {\n    let output = '';\n    let complete = false;\n\n    function checkCriteria(c: any) {\n      output += c.toString();\n      console.warn(output);\n      if (criteria(stripConsoleColors(output)) && !complete) {\n        complete = true;\n        res(p);\n      }\n    }\n\n    p.stdout?.on('data', checkCriteria);\n    p.stderr?.on('data', checkCriteria);\n    p.on('exit', (code) => {\n      if (!complete) {\n        rej(`Exited with ${code}`);\n      } else {\n        res(p);\n      }\n    });\n  });\n}\n\nfunction stripConsoleColors(log: string): string {\n  return log.replace(\n    // eslint-disable-next-line no-control-regex\n    /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\n    ''\n  );\n}\n\nexport async function getPageHtml(pageUrl: string): Promise<Document> {\n  const res = await fetch(pageUrl, { headers: { accept: 'text/html' } }).then((r) => r.text());\n  return createDocument({ html: res });\n}\n\nexport async function assertHostUnused(host: string): Promise<void> {\n  try {\n    const response = await fetch(host, { headers: { accept: 'text/html' } });\n  } catch (error) {\n    // TODO: test this in different environments\n    if (error.cause.code === 'ECONNREFUSED') {\n      return;\n    }\n  }\n  throw new Error(`Host ${host} is already in use!`);\n}\n\n// promisify fails to get the proper type overload, so manually enforcing the type\nconst _promisifiedTreeKill = promisify(treeKill) as (pid: number, signal: string) => Promise<void>;\n\nexport const promisifiedTreeKill = async (pid: number, signal: string) => {\n  try {\n    return await _promisifiedTreeKill(pid, signal);\n  } catch (error) {\n    // Don't treat process termination failures as test failures\n    // This is especially important on Windows where processes may already be gone\n    // or may not be properly terminated with tree-kill\n    log(`Process ${pid} could not be killed, but continuing: ${error.message}`);\n    return Promise.resolve();\n  }\n};\n\nexport async function killAllRegisteredProcesses() {\n  const pIds = (global?.pIds as number[]) ?? [];\n  const result = await Promise.allSettled(pIds.map((pId) => promisifiedTreeKill(pId, 'SIGKILL')));\n  const stringifiedResult = JSON.stringify(\n    result.map((v, i) => ({\n      pId: pIds[i],\n      status: v.status === 'fulfilled' ? 'success' : 'failure',\n    }))\n  );\n  log('Cleaned up processes invoked by e2e test: ' + stringifiedResult);\n}\n\nexport const workspaceRoot = _computeWorkspaceRoot(process.cwd());\n\nfunction _computeWorkspaceRoot(cwd: string) {\n  if (dirname(cwd) === cwd) {\n    return process.cwd();\n  }\n\n  const packageJsonAtCwd = join(cwd, 'package.json');\n  if (existsSync(packageJsonAtCwd)) {\n    const content = JSON.parse(readFileSync(packageJsonAtCwd, 'utf-8'));\n    if (content.name === 'qwik-monorepo') {\n      return cwd;\n    }\n  }\n  return _computeWorkspaceRoot(dirname(cwd));\n}\n\nexport function log(text: string) {\n  // eslint-disable-next-line no-console\n  console.log(yellow('E2E: ' + text));\n}\n\nexport const DEFAULT_TIMEOUT = process.env.CI ? 120000 : 30000;\n"
  },
  {
    "path": "e2e/qwik-cli-e2e/utils/setup.ts",
    "content": "import { execSync } from 'child_process';\nimport { join } from 'path';\nimport { workspaceRoot } from '.';\nimport { existsSync, writeFileSync } from 'fs';\n\nconst packageCfg = {\n  '@builder.io/qwik': {\n    packagePath: 'packages/qwik',\n    distPath: 'packages/qwik/dist',\n  },\n  '@builder.io/qwik-city': {\n    packagePath: 'packages/qwik-city',\n    distPath: 'packages/qwik-city/lib',\n  },\n  'eslint-plugin-qwik': {\n    packagePath: 'packages/eslint-plugin-qwik',\n    distPath: 'packages/eslint-plugin-qwik/dist',\n  },\n};\nfunction ensurePackageBuilt() {\n  for (const [name, cfg] of Object.entries(packageCfg)) {\n    if (!existsSync(join(workspaceRoot, cfg.distPath))) {\n      throw new Error(`Looks like package \"${name}\" has not been built yet.`);\n    }\n  }\n}\nfunction packPackages() {\n  const tarballPaths: { name: string; absolutePath: string }[] = [];\n  const tarballOutDir = join(workspaceRoot, 'temp', 'tarballs');\n  for (const [name, cfg] of Object.entries(packageCfg)) {\n    const out = execSync(`pnpm pack --json --pack-destination=${tarballOutDir}`, {\n      cwd: join(workspaceRoot, cfg.packagePath),\n      encoding: 'utf-8',\n    });\n    const json = JSON.parse(out);\n    tarballPaths.push({ name, absolutePath: json.filename });\n  }\n  writeFileSync(join(tarballOutDir, 'paths.json'), JSON.stringify(tarballPaths));\n}\n\nensurePackageBuilt();\npackPackages();\n"
  },
  {
    "path": "e2e/qwik-cli-e2e/vite.config.ts",
    "content": "import { existsSync, mkdirSync } from 'fs';\nimport { resolve } from 'path';\nimport tsconfigPaths from 'vite-tsconfig-paths';\nimport { defineConfig } from 'vitest/config';\n\n// if we're running in github CI\nif (process.env.CI) {\n  // Workaround for npm/pnpm crashing in scaffoldQwikProject because \"name is too long\"\n  const testPath = resolve(process.cwd(), 'e2e-test-tmp');\n\n  // Create base directory if it doesn't exist\n  if (!existsSync(testPath)) {\n    mkdirSync(testPath);\n  }\n\n  // Create subdirectories for each template type\n  const templateTypes = ['empty', 'playground'];\n  for (const type of templateTypes) {\n    const templatePath = resolve(testPath, type);\n    if (!existsSync(templatePath)) {\n      mkdirSync(templatePath);\n    }\n  }\n\n  process.env.TEMP_E2E_PATH = testPath;\n}\n\nexport default defineConfig({\n  plugins: [tsconfigPaths({ root: '../../' })],\n  test: {\n    include: ['./tests/*.spec.?(c|m)[jt]s?(x)'],\n    setupFiles: ['./utils/setup.ts'],\n    // Run only one test at a time to avoid potential conflicts.\n    // These tests interact directly with the filesystem and/or run processes on localhost,\n    // which can lead to issues if multiple tests are executed simultaneously\n    fileParallelism: false,\n  },\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/.gitignore",
    "content": "playwright-report\ndist\nlogs\nserver\ntmp"
  },
  {
    "path": "e2e/qwik-react-e2e/adapters/express/vite.config.ts",
    "content": "import { nodeServerAdapter } from '@builder.io/qwik-city/adapters/node-server/vite';\nimport { extendConfig } from '@builder.io/qwik-city/vite';\nimport baseConfig from '../../vite.config';\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['src/entry.express.tsx', '@qwik-city-plan'],\n      },\n    },\n    plugins: [nodeServerAdapter({ name: 'express' })],\n  };\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/package.json",
    "content": "{\n  \"name\": \"qwik-react-test-app\",\n  \"description\": \"Qwik react test app\",\n  \"engines\": {\n    \"node\": \"^18.17.0 || ^20.3.0 || >=21.0.0\"\n  },\n  \"private\": true,\n  \"devDependencies\": {\n    \"@builder.io/qwik-react\": \"workspace:^\",\n    \"@types/react\": \"18.3.3\",\n    \"@types/react-dom\": \"18.3.0\",\n    \"react\": \"18.3.1\",\n    \"react-dom\": \"18.3.1\"\n  },\n  \"scripts\": {\n    \"build\": \"qwik build\",\n    \"build.client\": \"vite build\",\n    \"build.preview\": \"vite build --ssr src/entry.preview.tsx\",\n    \"build.server\": \"vite build -c adapters/express/vite.config.ts\",\n    \"build.types\": \"tsc --incremental --noEmit\",\n    \"deploy\": \"vercel deploy\",\n    \"dev\": \"vite --mode ssr\",\n    \"dev.debug\": \"node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"express\": \"pnpm build && pnpm serve\",\n    \"fmt\": \"prettier --write .\",\n    \"fmt.check\": \"prettier --check .\",\n    \"lint\": \"eslint \\\"src/**/*.ts*\\\"\",\n    \"preview\": \"qwik build preview && vite preview --open\",\n    \"qwik\": \"qwik\",\n    \"serve\": \"node server/entry.express\",\n    \"start\": \"vite --open --mode ssr\",\n    \"test\": \"playwright test\",\n    \"test.debug\": \"playwright test --debug\",\n    \"test.ui\": \"playwright test --ui\"\n  },\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "e2e/qwik-react-e2e/playwright.config.ts",
    "content": "import { defineConfig, devices } from '@playwright/test';\n\n/** See https://playwright.dev/docs/test-configuration. */\nexport default defineConfig({\n  testDir: './tests',\n  fullyParallel: true,\n  forbidOnly: !!process.env.CI,\n  retries: process.env.CI ? 2 : 0,\n  workers: process.env.CI ? 1 : undefined,\n  reporter: 'line',\n\n  use: {\n    baseURL: 'http://localhost:3000',\n    // trace: 'on-first-retry',\n    // screenshot: 'only-on-failure',\n\n    // Increase timeouts for service worker operations\n    actionTimeout: 10000,\n    navigationTimeout: 10000,\n  },\n\n  // Increase global timeout for service worker tests\n  timeout: process.env.CI ? 120000 : 30000,\n\n  projects: [\n    {\n      name: 'chromium',\n      use: {\n        ...devices['Desktop Chrome'],\n      },\n    },\n    // {\n    //   name: 'firefox',\n    //   use: { ...devices['Desktop Firefox'] },\n    // },\n    {\n      name: 'webkit',\n      use: { ...devices['Desktop Safari'] },\n    },\n  ],\n\n  webServer: {\n    command: 'npm run express',\n    port: 3000,\n    stdout: 'pipe',\n    reuseExistingServer: !process.env.CI,\n    timeout: process.env.CI ? 120000 : 30000,\n  },\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/components/counter/index.tsx",
    "content": "/** @jsxImportSource react */\nimport { useEffect, useState } from 'react';\nimport { qwikify$ } from '@builder.io/qwik-react';\n\ninterface IProps {\n  onMount(): void;\n  onUnmount(): void;\n}\n\nfunction Counter({ onMount, onUnmount }: IProps) {\n  const [count, setCount] = useState(0);\n\n  useEffect(() => {\n    onMount();\n    return () => onUnmount();\n  }, []);\n\n  return (\n    <div data-testid=\"test-component\">\n      <span data-testid=\"count\">count {count}</span>\n      <button data-testid=\"inc-btn\" onClick={() => setCount((v) => v + 1)}>\n        inc\n      </button>\n    </div>\n  );\n}\n\nexport const QCounter = qwikify$(Counter, { eagerness: 'hover' });\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { useDocumentHead, useLocation } from '@builder.io/qwik-city';\n\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.url.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n\n      {head.meta.map((m) => (\n        <meta key={m.key} {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link key={l.key} {...l} />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/entry.dev.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Development entry point using only client-side modules:\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nimport { render, type RenderOptions } from '@builder.io/qwik';\nimport Root from './root';\n\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/entry.express.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Express HTTP server when building for production.\n *\n * Learn more about Node.js server integrations here:\n * - https://qwik.dev/docs/deployments/node/\n *\n */\nimport { createQwikCity, type PlatformNode } from '@builder.io/qwik-city/middleware/node';\nimport 'dotenv/config';\nimport qwikCityPlan from '@qwik-city-plan';\nimport { manifest } from '@qwik-client-manifest';\nimport render from './entry.ssr';\nimport express from 'express';\nimport { fileURLToPath } from 'node:url';\nimport { join } from 'node:path';\n\ndeclare global {\n  type QwikCityPlatform = PlatformNode;\n}\n\n// Directories where the static assets are located\nconst distDir = join(fileURLToPath(import.meta.url), '..', '..', 'dist');\nconst buildDir = join(distDir, 'build');\n\n// Allow for dynamic port\nconst PORT = process.env.PORT ?? 3000;\n\n// Create the Qwik City Node middleware\nconst { router, notFound } = createQwikCity({\n  render,\n  qwikCityPlan,\n  manifest,\n  // getOrigin(req) {\n  //   // If deploying under a proxy, you may need to build the origin from the request headers\n  //   // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto\n  //   const protocol = req.headers[\"x-forwarded-proto\"] ?? \"http\";\n  //   // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host\n  //   const host = req.headers[\"x-forwarded-host\"] ?? req.headers.host;\n  //   return `${protocol}://${host}`;\n  // }\n});\n\n// Create the express server\n// https://expressjs.com/\nconst app = express();\n\n// Enable gzip compression\n// app.use(compression());\n\n// Static asset handlers\n// https://expressjs.com/en/starter/static-files.html\napp.use(`/build`, express.static(buildDir, { immutable: true, maxAge: '1y' }));\napp.use(express.static(distDir, { redirect: false }));\n\n// Use Qwik City's page and endpoint request handler\napp.use(router);\n\n// Use Qwik City's 404 handler\napp.use(notFound);\n\n// Start the express server\napp.listen(PORT, () => {\n  /* eslint-disable */\n  console.log(`Server started: http://localhost:${PORT}/`);\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/entry.preview.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the bundle entry point for `npm run preview`.\n * That is, serving your app built in production mode.\n *\n * Feel free to modify this file, but don't remove it!\n *\n * Learn more about Vite's preview command:\n * - https://vitejs.dev/config/preview-options.html#preview-options\n *\n */\nimport { createQwikCity } from '@builder.io/qwik-city/middleware/node';\nimport qwikCityPlan from '@qwik-city-plan';\n// make sure qwikCityPlan is imported before entry\nimport render from './entry.ssr';\n\n/** The default export is the QwikCity adapter used by Vite preview. */\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this entry point\n * will be the common one.\n *\n * - Server (express, cloudflare...)\n * - Npm run start\n * - Npm run preview\n * - Npm run build\n */\nimport { renderToStream, type RenderToStreamOptions } from '@builder.io/qwik/server';\nimport { manifest } from '@qwik-client-manifest';\nimport Root from './root';\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    manifest,\n    ...opts,\n    // Use container attributes to set attributes on the html tag.\n    containerAttributes: {\n      lang: 'en-us',\n      ...opts.containerAttributes,\n    },\n    // prefetchStrategy: {\n    //   implementation: {\n    //     linkInsert: \"html-append\",\n    //     linkRel: \"modulepreload\",\n    //   },\n    // },\n    serverData: {\n      ...opts.serverData,\n    },\n  });\n}\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/root.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city';\nimport { RouterHead } from './components/router-head/router-head';\n\nexport default component$(() => {\n  /**\n   * The root of a QwikCity site always start with the <QwikCityProvider> component, immediately\n   * followed by the document's <head> and <body>.\n   *\n   * Don't remove the `<head>` and `<body>` elements.\n   */\n\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charSet=\"utf-8\" />\n        <RouterHead />\n        {/* <PrefetchGraph />\n        <PrefetchServiceWorker /> */}\n      </head>\n      <body lang=\"en\">\n        <RouterOutlet />\n        <ServiceWorkerRegister />\n      </body>\n    </QwikCityProvider>\n  );\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/routes/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { type DocumentHead } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return <>render qwik</>;\n});\n\nexport const head: DocumentHead = {\n  title: 'Welcome to Qwik',\n  meta: [\n    {\n      name: 'description',\n      content: 'Qwik site description',\n    },\n  ],\n};\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/routes/layout.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return (\n    <>\n      <Link data-testid=\"qwik-link\" href=\"/\">\n        qwik\n      </Link>\n      <Link data-testid=\"react-link\" href=\"/react\">\n        react\n      </Link>\n      <br />\n      <main>\n        <Slot />\n      </main>\n    </>\n  );\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/src/routes/react/index.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$ } from '@builder.io/qwik';\nimport { type DocumentHead } from '@builder.io/qwik-city';\nimport { QCounter } from '~/components/counter';\n\nexport default component$(() => {\n  return (\n    <QCounter\n      onMount$={() => console.log('@@@@ Mount')}\n      onUnmount$={() => console.log('@@@@ Unmount')}\n    />\n  );\n});\n\nexport const head: DocumentHead = {\n  title: 'Welcome to React Qwik',\n  meta: [\n    {\n      name: 'description',\n      content: 'React Qwik site description',\n    },\n  ],\n};\n"
  },
  {
    "path": "e2e/qwik-react-e2e/tests/express.spec.ts",
    "content": "import { expect, test } from '@playwright/test';\n\ntest.describe('[SSR]', () => {\n  test('should NOT call unmount callback for non hydrated component', async ({ page }) => {\n    page.on('console', () => {\n      throw new Error(\"React component shouldn't hydrate\");\n    });\n\n    await page.goto('/react');\n\n    expect(await page.getByTestId('count').innerText()).toBe('count 0');\n\n    // unmount\n    await page.getByTestId('qwik-link').click();\n    await page.waitForURL('/', { waitUntil: 'networkidle' });\n\n    expect(await page.textContent('main')).toBe('render qwik');\n  });\n\n  test('should call unmount callback for hydrated component', async ({ page }) => {\n    await page.goto('/react');\n\n    expect(await page.getByTestId('count').innerText()).toBe('count 0');\n\n    // hydrate\n    const mountConsole = page.waitForEvent('console');\n    await page.getByTestId('test-component').hover();\n\n    // check if hydrated and called useEffect\n    const mountMsg = await mountConsole;\n    expect(await mountMsg.args()[0].jsonValue()).toBe('@@@@ Mount');\n\n    // check if react works\n    await page.getByTestId('inc-btn').click();\n    expect(await page.getByTestId('count').innerText()).toBe('count 1');\n\n    // unmount\n    const unmountConsole = page.waitForEvent('console');\n    await page.getByTestId('qwik-link').click();\n\n    const unmountMsg = await unmountConsole;\n    expect(await unmountMsg.args()[0].jsonValue()).toBe('@@@@ Unmount');\n  });\n});\n\ntest.describe('[CSR]', () => {\n  test('should call unmount callback', async ({ page }) => {\n    await page.goto('/');\n\n    // csr\n    const mountConsole = page.waitForEvent('console');\n    await page.getByTestId('react-link').click();\n    await page.waitForURL('/react/', { waitUntil: 'networkidle' });\n\n    expect(await page.getByTestId('count').innerText()).toBe('count 0');\n\n    // check if called useEffect\n    const mountMsg = await mountConsole;\n    expect(await mountMsg.args()[0].jsonValue()).toBe('@@@@ Mount');\n\n    // check if react works\n    await page.getByTestId('inc-btn').click();\n    expect(await page.getByTestId('count').innerText()).toBe('count 1');\n\n    // unmount\n    const unmountConsole = page.waitForEvent('console');\n    await page.getByTestId('qwik-link').click();\n    await page.waitForURL('/', { waitUntil: 'networkidle' });\n\n    const unmountMsg = await unmountConsole;\n    expect(await unmountMsg.args()[0].jsonValue()).toBe('@@@@ Unmount');\n  });\n});\n"
  },
  {
    "path": "e2e/qwik-react-e2e/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"allowJs\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2022\",\n    \"lib\": [\"es2022\", \"DOM\", \"WebWorker\", \"DOM.Iterable\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"outDir\": \"tmp\",\n    \"noEmit\": true,\n    \"paths\": {\n      \"~/*\": [\"./src/*\"]\n    }\n  },\n\n  \"include\": [\"src\", \"./*.d.ts\", \"./*.config.ts\"]\n}\n"
  },
  {
    "path": "e2e/qwik-react-e2e/vite.config.ts",
    "content": "/**\n * This is the base config for vite. When building, the adapter config is used which loads this file\n * and extends it.\n */\nimport { qwikCity } from '@builder.io/qwik-city/vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport { qwikReact } from '@builder.io/qwik-react/vite';\nimport { defineConfig, type UserConfig } from 'vite';\nimport tsconfigPaths from 'vite-tsconfig-paths';\nimport pkg from './package.json';\n\ntype PkgDep = Record<string, string>;\nconst { dependencies = {}, devDependencies = {} } = pkg as any as {\n  dependencies: PkgDep;\n  devDependencies: PkgDep;\n  [key: string]: unknown;\n};\nerrorOnDuplicatesPkgDeps(devDependencies, dependencies);\n\n/**\n * Note that Vite normally starts from `index.html` but the qwikCity plugin makes start at\n * `src/entry.ssr.tsx` instead.\n */\nexport default defineConfig((): UserConfig => {\n  return {\n    plugins: [qwikCity(), qwikVite(), tsconfigPaths({ root: '.' }), qwikReact()],\n    // This tells Vite which dependencies to pre-build in dev mode.\n    optimizeDeps: {\n      // Put problematic deps that break bundling here, mostly those with binaries.\n      // For example ['better-sqlite3'] if you use that in server functions.\n      exclude: [],\n    },\n\n    /**\n     * This is an advanced setting. It improves the bundling of your server code. To use it, make\n     * sure you understand when your consumed packages are dependencies or dev dependencies.\n     * (otherwise things will break in production)\n     */\n    // ssr:\n    //   command === \"build\" && mode === \"production\"\n    //     ? {\n    //         // All dev dependencies should be bundled in the server build\n    //         noExternal: Object.keys(devDependencies),\n    //         // Anything marked as a dependency will not be bundled\n    //         // These should only be production binary deps (including deps of deps), CLI deps, and their module graph\n    //         // If a dep-of-dep needs to be external, add it here\n    //         // For example, if something uses `bcrypt` but you don't have it as a dep, you can write\n    //         // external: [...Object.keys(dependencies), 'bcrypt']\n    //         external: Object.keys(dependencies),\n    //       }\n    //     : undefined,\n\n    server: {\n      headers: {\n        // Don't cache the server response in dev mode\n        'Cache-Control': 'public, max-age=0',\n      },\n    },\n    preview: {\n      headers: {\n        // Do cache the server response in preview (non-adapter production build)\n        'Cache-Control': 'public, max-age=360',\n      },\n    },\n  };\n});\n\n// *** utils ***\n\n/**\n * Function to identify duplicate dependencies and throw an error\n *\n * @param {Object} devDependencies - List of development dependencies\n * @param {Object} dependencies - List of production dependencies\n */\nfunction errorOnDuplicatesPkgDeps(devDependencies: PkgDep, dependencies: PkgDep) {\n  let msg = '';\n  // Create an array 'duplicateDeps' by filtering devDependencies.\n  // If a dependency also exists in dependencies, it is considered a duplicate.\n  const duplicateDeps = Object.keys(devDependencies).filter((dep) => dependencies[dep]);\n\n  // include any known qwik packages\n  const qwikPkg = Object.keys(dependencies).filter((value) => /qwik/i.test(value));\n\n  // any errors for missing \"qwik-city-plan\"\n  // [PLUGIN_ERROR]: Invalid module \"@qwik-city-plan\" is not a valid package\n  msg = `Move qwik packages ${qwikPkg.join(', ')} to devDependencies`;\n\n  if (qwikPkg.length > 0) {\n    throw new Error(msg);\n  }\n\n  // Format the error message with the duplicates list.\n  // The `join` function is used to represent the elements of the 'duplicateDeps' array as a comma-separated string.\n  msg = `\n    Warning: The dependency \"${duplicateDeps.join(', ')}\" is listed in both \"devDependencies\" and \"dependencies\".\n    Please move the duplicated dependencies to \"devDependencies\" only and remove it from \"dependencies\"\n  `;\n\n  // Throw an error with the constructed message.\n  if (duplicateDeps.length > 0) {\n    throw new Error(msg);\n  }\n}\n"
  },
  {
    "path": "eslint.config.js",
    "content": "import globals from 'globals';\nimport js from '@eslint/js';\nimport tseslint from 'typescript-eslint';\nimport noOnlyTests from 'eslint-plugin-no-only-tests';\nimport { globalIgnores } from 'eslint/config';\n// import { qwikEslint9Plugin } from 'eslint-plugin-qwik';\n\nconst ignores = [\n  '**/.history',\n  '**/.vscode',\n  '**/dist',\n  '**/dist-dev',\n  '**/lib',\n  '**/node_modules',\n  '**/tsc-out',\n  '**/external',\n  '**/*.',\n  '**/*.log',\n  '**/etc',\n  '**/target',\n  '**/temp',\n  '**/tsdoc-metadata.json',\n  '**/.DS_Store',\n  '**/*.mp4',\n  'scripts',\n  '**/server/**/*.js',\n  '**/*.tsbuildinfo',\n  'packages/docs/api',\n  'packages/docs/public/repl/repl-sw.js*',\n  'packages/docs/src/routes/examples/apps',\n  'packages/docs/src/routes/playground/app',\n  'packages/docs/src/routes/tutorial',\n  'packages/qwik/src/optimizer/core/src/fixtures',\n  'packages/qwik/bindings',\n  'packages/qwik-labs/lib',\n  'packages/qwik-labs/lib-types',\n  'packages/qwik-labs/vite',\n  'packages/insights/drizzle.config.ts',\n  'packages/insights/panda.config.ts',\n  'packages/qwik/src/napi',\n  'starters/apps/base',\n  'starters/apps/library',\n  'starters/templates',\n  '**/vite.config.ts',\n  // packages with eslint.config.mjs\n  'packages/qwik-labs',\n  'packages/insights',\n  // eslint.config.*\n  '**/eslint.config.mjs',\n  '**/eslint.config.js',\n  '.changeset',\n  'packages/docs/public/builder',\n];\n\nexport default tseslint.config(\n  globalIgnores(ignores),\n  js.configs.recommended,\n  tseslint.configs.recommended,\n  // qwikEslint9Plugin.configs.recommended,\n  {\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        ...globals.node,\n        ...globals.es2021,\n      },\n      parserOptions: {\n        // Needed when using the qwik plugin\n        // projectService: true,\n        // tsconfigRootDir: import.meta.dirname,\n      },\n    },\n  },\n  {\n    plugins: {\n      'no-only-tests': noOnlyTests,\n    },\n    rules: {\n      'no-only-tests/no-only-tests': 'error',\n    },\n    name: 'no-only-tests',\n  },\n  {\n    rules: {\n      '@typescript-eslint/no-explicit-any': 'off',\n      '@typescript-eslint/explicit-module-boundary-types': 'off',\n      '@typescript-eslint/no-inferrable-types': 'off',\n      '@typescript-eslint/no-non-null-assertion': 'off',\n      '@typescript-eslint/no-empty-interface': 'off',\n      '@typescript-eslint/no-namespace': 'off',\n      '@typescript-eslint/no-empty-function': 'off',\n      '@typescript-eslint/no-this-alias': 'off',\n      '@typescript-eslint/ban-types': 'off',\n      '@typescript-eslint/ban-ts-comment': 'off',\n      'prefer-spread': 'off',\n      'no-case-declarations': 'off',\n      'no-console': ['error', { allow: ['warn', 'error'] }],\n      'no-only-tests/no-only-tests': 'error',\n      '@typescript-eslint/no-unused-vars': 'off',\n      '@typescript-eslint/no-var-requires': 'off',\n      curly: 'error',\n      'no-new-func': 'error',\n      '@typescript-eslint/no-empty-object-type': 'off',\n      '@typescript-eslint/no-unused-expressions': 'off',\n      '@typescript-eslint/no-unsafe-function-type': 'off',\n      '@typescript-eslint/no-require-imports': 'off',\n      '@typescript-eslint/no-wrapper-object-types': 'off',\n    },\n  },\n  {\n    files: ['packages/docs/**/*.{ts,tsx}'],\n    rules: {\n      'no-console': 'off',\n    },\n  }\n);\n"
  },
  {
    "path": "flake.nix",
    "content": "# This is a Nix configuration file. It is used to define the environment\n# for the project. It is a declarative way to define the dependencies.\n# It is used by the `nix develop` command to create a development environment\n# with all the dependencies needed for the project.\n\n# To update the dependencies, run `nix flake update`.\n\n# Note: keep the playwright version in package.json syncpack the same as the nix version\n# We don't need to have the latest playwright all the time so not having to download\n# all the browsers on every version bump is a good thing.\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n    rust-overlay.url = \"github:oxalica/rust-overlay\";\n  };\n\n  outputs = { self, rust-overlay, nixpkgs }:\n    let\n      b = builtins;\n      devShell = system: _pkgs:\n        let\n          overlays = [ (import rust-overlay) ];\n          pkgs = import nixpkgs {\n            inherit system overlays;\n          };\n        in\n        {\n          default = pkgs.mkShell {\n            nativeBuildInputs = with pkgs; [\n              bashInteractive\n              gitMinimal\n\n              nodejs_22\n              corepack_22\n\n              # Playwright for the end-to-end tests\n              playwright-driver.browsers\n\n              # Qwik optimizer deps\n              wasm-pack\n              # Provides rustc and cargo\n              ((rust-bin.fromRustupToolchainFile\n                ./rust-toolchain).override {\n                # For rust-analyzer\n                extensions = [ \"rust-src\" ];\n                # For building wasm\n                targets = [ \"wasm32-unknown-unknown\" ];\n              })\n            ];\n            # https://github.com/microsoft/playwright/issues/5501\n            shellHook = ''\n              export PATH=$PWD/node_modules/.bin:$PATH\n              export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}\n              export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true\n              pwNixVersion=${pkgs.playwright-driver.version}\n              pwNpmVersion=$(${pkgs.jq}/bin/jq -r .version node_modules/@playwright/test/package.json 2>/dev/null)\n              if [ -n \"$pwNpmVersion\" ] && [ \"$pwNpmVersion\" != \"$pwNixVersion\" ]; then\n                echo \"!!! Playwright version mismatch: $pwNpmVersion (nodejs) != $pwNixVersion (nix). Please fix.\" >&2\n              fi\n            '';\n          };\n        };\n    in\n    {\n      devShells = b.mapAttrs (devShell) nixpkgs.legacyPackages;\n    };\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"qwik-monorepo\",\n  \"version\": \"0.0.0-read-qwik-package-json\",\n  \"comments\": {\n    \"01\": \"devDependencies includes reference to @builder.io/qwik: workspace: *. This is needed or e2e tests will fail\",\n    \"02\": \"  It would be nice to be able to remove this dependency and fix the test.\",\n    \"03\": \"devDependencies can't include reference to @builder.io/qwik-city or e2e test will fail.\"\n  },\n  \"config\": {\n    \"syncpack\": {\n      \"versionGroups\": [\n        {\n          \"label\": \"Be lenient in vite versions for prod. v4 is broken, v5 is good\",\n          \"dependencyTypes\": [\n            \"prod\",\n            \"peer\"\n          ],\n          \"dependencies\": [\n            \"vite\"\n          ],\n          \"pinVersion\": \">=5 <8\"\n        },\n        {\n          \"label\": \"use workspace protocol for local packages and allow patch versions (used in e.g. qwik-react)\",\n          \"dependencies\": [\n            \"$LOCAL\"\n          ],\n          \"dependencyTypes\": [\n            \"!local\",\n            \"!dev\"\n          ],\n          \"pinVersion\": \"workspace:^\"\n        },\n        {\n          \"label\": \"dev: use workspace protocol for local packages - split from prod and peer version group\",\n          \"dependencies\": [\n            \"$LOCAL\"\n          ],\n          \"dependencyTypes\": [\n            \"dev\"\n          ],\n          \"pinVersion\": \"workspace:^\"\n        },\n        {\n          \"label\": \"Separate prod deps from dev deps\",\n          \"dependencyTypes\": [\n            \"prod\",\n            \"peer\"\n          ]\n        },\n        {\n          \"label\": \"Playwright should have the same version as in flake.nix\",\n          \"dependencies\": [\n            \"@playwright/test\"\n          ],\n          \"dependencyTypes\": [\n            \"dev\"\n          ],\n          \"pinVersion\": \"1.54.1\"\n        }\n      ],\n      \"semverGroups\": [\n        {\n          \"label\": \"Undici should always be * until we remove it\",\n          \"dependencies\": [\n            \"undici\"\n          ],\n          \"range\": \"*\"\n        },\n        {\n          \"label\": \"use exact version numbers for devDependencies\",\n          \"dependencyTypes\": [\n            \"dev\"\n          ],\n          \"range\": \"\"\n        }\n      ]\n    }\n  },\n  \"contributors\": [\n    {\n      \"name\": \"Miško Hevery\",\n      \"email\": \"misko@hevery.com\",\n      \"url\": \"https://twitter.com/mhevery\"\n    },\n    {\n      \"name\": \"Adam Bradley\",\n      \"email\": \"adam@builder.io\",\n      \"url\": \"https://twitter.com/adamdbradley\"\n    },\n    {\n      \"name\": \"Manu Mtz.-Almeida\",\n      \"email\": \"manu@builder.io\",\n      \"url\": \"https://twitter.com/manucorporat\"\n    }\n  ],\n  \"dependencies\": {\n    \"esbuild-plugin-raw\": \"^0.2.0\"\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@builder.io/qwik-city\": \"workspace:^\",\n    \"@changesets/cli\": \"2.29.5\",\n    \"@changesets/get-github-info\": \"0.6.0\",\n    \"@changesets/types\": \"6.1.0\",\n    \"@clack/prompts\": \"0.7.0\",\n    \"@eslint/js\": \"9.32.0\",\n    \"@mdx-js/mdx\": \"3.1.1\",\n    \"@microsoft/api-documenter\": \"7.26.31\",\n    \"@microsoft/api-extractor\": \"7.52.10\",\n    \"@napi-rs/cli\": \"2.18.4\",\n    \"@napi-rs/triples\": \"1.2.0\",\n    \"@node-rs/helper\": \"1.6.0\",\n    \"@octokit/action\": \"6.1.0\",\n    \"@playwright/test\": \"1.54.1\",\n    \"@qwik.dev/partytown\": \"0.11.2\",\n    \"@types/brotli\": \"1.3.4\",\n    \"@types/bun\": \"1.2.19\",\n    \"@types/cross-spawn\": \"6.0.6\",\n    \"@types/express\": \"4.17.21\",\n    \"@types/node\": \"20.19.0\",\n    \"@types/path-browserify\": \"1.0.3\",\n    \"@types/prompts\": \"2.4.9\",\n    \"@types/react\": \"18.3.3\",\n    \"@types/semver\": \"7.7.0\",\n    \"@types/tmp\": \"0.2.6\",\n    \"@types/which-pm-runs\": \"1.0.2\",\n    \"@vitejs/plugin-basic-ssl\": \"2.1.0\",\n    \"all-contributors-cli\": \"6.26.1\",\n    \"brotli\": \"1.3.3\",\n    \"create-qwik\": \"workspace:^\",\n    \"cross-spawn\": \"7.0.6\",\n    \"csstype\": \"3.1.3\",\n    \"dotenv\": \"16.5.0\",\n    \"esbuild\": \"0.25.10\",\n    \"eslint\": \"9.32.0\",\n    \"eslint-plugin-no-only-tests\": \"3.3.0\",\n    \"eslint-plugin-qwik\": \"workspace:^\",\n    \"execa\": \"9.6.0\",\n    \"express\": \"4.22.0\",\n    \"globals\": \"16.4.0\",\n    \"install\": \"0.13.0\",\n    \"memfs\": \"4.49.0\",\n    \"monaco-editor\": \"0.45.0\",\n    \"mri\": \"1.2.0\",\n    \"path-browserify\": \"1.0.1\",\n    \"prettier\": \"3.6.2\",\n    \"prettier-plugin-jsdoc\": \"1.3.3\",\n    \"prettier-plugin-tailwindcss\": \"0.6.14\",\n    \"pretty-quick\": \"4.2.2\",\n    \"prompts\": \"2.4.2\",\n    \"rollup\": \"4.59.0\",\n    \"semver\": \"7.7.2\",\n    \"simple-git-hooks\": \"2.13.1\",\n    \"snoop\": \"1.0.4\",\n    \"source-map\": \"0.7.6\",\n    \"svgo\": \"3.3.3\",\n    \"syncpack\": \"12.3.3\",\n    \"terser\": \"5.44.0\",\n    \"tmp\": \"0.2.5\",\n    \"tree-kill\": \"1.2.2\",\n    \"typescript\": \"5.4.5\",\n    \"typescript-eslint\": \"8.38.0\",\n    \"undici\": \"*\",\n    \"vfile\": \"6.0.3\",\n    \"vite\": \"7.3.1\",\n    \"vite-imagetools\": \"9.0.0\",\n    \"vite-plugin-dts\": \"3.9.1\",\n    \"vite-tsconfig-paths\": \"5.1.4\",\n    \"vitest\": \"3.2.4\",\n    \"watchlist\": \"0.3.1\",\n    \"which-pm-runs\": \"1.1.0\",\n    \"zod\": \"3.25.48\"\n  },\n  \"engines\": {\n    \"node\": \">=22.18.0\",\n    \"npm\": \"please-use-pnpm\",\n    \"yarn\": \"please-use-pnpm\",\n    \"pnpm\": \">=10.14.0\"\n  },\n  \"packageManager\": \"pnpm@10.14.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"api.update\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --api --dev\",\n    \"build\": \"node --require ./scripts/runBefore.ts scripts/index.ts\",\n    \"build.changelog-formatter\": \"tsc .changeset/changelog-github-custom.ts && mv .changeset/changelog-github-custom.js .changeset/changelog-github-custom.cjs\",\n    \"build.clean\": \"node ./scripts/build-clean.ts\",\n    \"build.cli\": \"node --require ./scripts/runBefore.ts scripts/index.ts --cli --dev\",\n    \"build.cli.prod\": \"node --require ./scripts/runBefore.ts scripts/index.ts --cli\",\n    \"build.core\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --qwikcity --api --platform-binding\",\n    \"build.eslint\": \"node --require ./scripts/runBefore.ts scripts/index.ts --eslint\",\n    \"build.full\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding --wasm\",\n    \"build.local\": \"node  --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwiklabs --qwikreact --qwikauth --cli --platform-binding-wasm-copy\",\n    \"build.only_javascript\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api\",\n    \"build.packages.docs\": \"pnpm -C ./packages/docs/ run build\",\n    \"build.packages.insights\": \"pnpm -C ./packages/insights/ run build\",\n    \"build.platform\": \"node --require ./scripts/runBefore.ts scripts/index.ts --platform-binding\",\n    \"build.platform.copy\": \"node --require ./scripts/runBefore.ts scripts/index.ts --platform-binding-wasm-copy\",\n    \"build.qwik-city\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwikcity\",\n    \"build.qwik-react\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwikreact\",\n    \"build.validate\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api --eslint --qwikcity --platform-binding --wasm --validate\",\n    \"build.vite\": \"node --require ./scripts/runBefore.ts scripts/index.ts --tsc --build --api --qwikcity --eslint --platform-binding-wasm-copy\",\n    \"build.wasm\": \"node --require ./scripts/runBefore.ts scripts/index.ts --wasm\",\n    \"build.watch\": \"node --require ./scripts/runBefore.ts scripts/index.ts --build  --qwikcity --watch --dev --platform-binding\",\n    \"change\": \"changeset\",\n    \"cli\": \"pnpm build.cli && node packages/create-qwik/create-qwik.cjs && node --require ./scripts/runBefore.ts scripts/validate-cli.ts --copy-local-qwik-dist\",\n    \"cli.qwik\": \"pnpm build.cli && node packages/qwik/qwik-cli.cjs\",\n    \"cli.validate\": \"node --require ./scripts/runBefore.ts scripts/validate-cli.ts\",\n    \"deps\": \"corepack pnpm upgrade -i -r --latest && syncpack fix-mismatches && corepack pnpm dedupe\",\n    \"docs.dev\": \"pnpm -C packages/docs build.repl-sw && pnpm -C packages/docs dev\",\n    \"docs.preview\": \"pnpm -C packages/docs preview\",\n    \"docs.sync\": \"node --require ./scripts/runBefore.ts scripts/docs_sync/index.ts && pnpm fmt\",\n    \"docs.showcase\": \"pnpm -C packages/docs run build.showcase\",\n    \"eslint.update\": \"node --require ./scripts/runBefore.ts scripts/eslint-docs.ts\",\n    \"fmt\": \"pnpm prettier.fix && pnpm syncpack format\",\n    \"fmt.staged\": \"pretty-quick --staged\",\n    \"link.dist\": \"cd packages/qwik && pnpm link --global && cd ../qwik-city && pnpm link --global && cd ../eslint-plugin-qwik && pnpm link --global && cd ../qwik-react && pnpm link --global\",\n    \"link.dist.npm\": \"cd packages/qwik && npm link && cd ../qwik-city && npm link && cd ../eslint-plugin-qwik && npm link && cd ../qwik-react && npm link\",\n    \"link.dist.yarn\": \"cd packages/qwik && yarn link && cd ../qwik-city && yarn link && cd ../eslint-plugin-qwik && yarn link && cd ../qwik-react && yarn link\",\n    \"lint\": \"pnpm lint.eslint && pnpm lint.prettier && pnpm lint.rust\",\n    \"lint.eslint\": \"eslint --cache \\\"**/*.ts*\\\" && pnpm -r --parallel lint\",\n    \"lint.fix\": \"eslint --fix \\\"**/*.ts*\\\" && pnpm -r --parallel lint.fix && pnpm prettier.fix\",\n    \"lint.prettier\": \"prettier --cache --check .\",\n    \"lint.rust\": \"make lint\",\n    \"lint.syncpack\": \"syncpack list-mismatches\",\n    \"preinstall\": \"npx only-allow pnpm\",\n    \"prepare\": \"simple-git-hooks\",\n    \"prettier.fix\": \"prettier --cache --write .\",\n    \"qwik-push-build-repos\": \"node --require ./scripts/runBefore.ts ./scripts/qwik-push-build-repos.ts\",\n    \"release\": \"changeset publish\",\n    \"release.fixup-package-json\": \"syncpack fix-mismatches --config syncpack-release-conf.json\",\n    \"release.pkg-pr-new\": \"pnpm dlx pkg-pr-new@^0.0.9 publish --compact --pnpm ./packages/qwik ./packages/qwik-city ./packages/eslint-plugin-qwik ./packages/create-qwik\",\n    \"release.prepare\": \"pnpm build --prepare-release\",\n    \"serve\": \"node --require ./scripts/runBefore.ts --inspect --conditions=development starters/dev-server.ts 3300\",\n    \"serve.debug\": \"node --require ./scripts/runBefore.ts --inspect-brk --conditions=development starters/dev-server.ts 3300\",\n    \"start\": \"pnpm run --stream \\\"/.*\\\\.watch/\\\"\",\n    \"test\": \"pnpm build.full && pnpm test.unit && pnpm test.e2e\",\n    \"test.e2e\": \"pnpm test.e2e.chromium && pnpm test.e2e.webkit && test.e2e.integrations\",\n    \"test.e2e.chromium\": \"playwright test starters --browser=chromium --config starters/playwright.config.ts\",\n    \"test.e2e.chromium.debug\": \"PWDEBUG=1 playwright test starters --browser=chromium --config starters/playwright.config.ts\",\n    \"test.e2e.city\": \"playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts\",\n    \"test.e2e.cli\": \"pnpm --filter qwik-cli-e2e e2e\",\n    \"test.e2e.firefox\": \"playwright test starters --browser=firefox --config starters/playwright.config.ts\",\n    \"test.e2e.integrations.chromium\": \"playwright test e2e/adapters-e2e/tests --project=chromium --config e2e/adapters-e2e/playwright.config.ts\",\n    \"test.e2e.integrations.webkit\": \"playwright test e2e/adapters-e2e/tests --project=webkit --config e2e/adapters-e2e/playwright.config.ts\",\n    \"test.e2e.webkit\": \"playwright test starters --browser=webkit --config starters/playwright.config.ts\",\n    \"test.e2e.qwik-react.chromium\": \"playwright test e2e/qwik-react-e2e/tests --project=chromium --config e2e/qwik-react-e2e/playwright.config.ts\",\n    \"test.e2e.qwik-react.webkit\": \"playwright test e2e/qwik-react-e2e/tests --project=webkit --config e2e/qwik-react-e2e/playwright.config.ts\",\n    \"test.rust\": \"make test\",\n    \"test.rust.update\": \"make test-update\",\n    \"test.unit\": \"vitest packages\",\n    \"test.unit.debug\": \"vitest --inspect-brk packages\",\n    \"test.vite\": \"playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts\",\n    \"tsc.check\": \"tsc --noEmit\",\n    \"tsc.trace\": \"tsc -p tsconfig.json --traceResolution > tsc.log\",\n    \"tsc.watch\": \"tsc --noEmit --watch --preserveWatchOutput\",\n    \"update.qwik.builds\": \"node --require ./scripts/runBefore.ts scripts/update-qwik-builds.ts packages/docs && node scripts/update-qwik-builds.ts packages/insights; pnpm install\",\n    \"vitest\": \"vitest\"\n  },\n  \"simple-git-hooks\": {\n    \"pre-commit\": \"pnpm pretty-quick --staged\"\n  },\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "packages/create-qwik/.npmignore",
    "content": "src\n"
  },
  {
    "path": "packages/create-qwik/CHANGELOG.md",
    "content": "# create-qwik\n\n## 1.19.0\n\n### Patch Changes\n\n- ✨ cloudflare workers deployment adapter (by [@LazyClicks](https://github.com/LazyClicks) in [#8214](https://github.com/QwikDev/qwik/pull/8214))\n\n## 1.18.0\n\n### Patch Changes\n\n- execute cleanup cb for all component tree while calling dispose.cleanup method returned by render fn (by [@sashkashishka](https://github.com/sashkashishka) in [#8164](https://github.com/QwikDev/qwik/pull/8164))\n\n## 1.17.2\n\n## 1.17.1\n\n## 1.17.0\n\n## 1.16.1\n\n### Patch Changes\n\n- 🐞🩹 set sideEffects: false to the lib template, otherwise there might be some side effects imports when building a consumer project. (by [@gioboa](https://github.com/gioboa) in [#7855](https://github.com/QwikDev/qwik/pull/7855))\n\n- 🐞🩹 fix up vscode settings merge. Use JSON5 to parse settings.json to prevent parsing errors. (by [@gioboa](https://github.com/gioboa) in [#7858](https://github.com/QwikDev/qwik/pull/7858))\n\n- 🛠 use the new version of @croct/json5-parser to merge JSON5 and preserve comments (by [@gioboa](https://github.com/gioboa) in [#7884](https://github.com/QwikDev/qwik/pull/7884))\n\n## 1.16.0\n\n### Minor Changes\n\n- ✨ bump Vite to v7 (by [@gioboa](https://github.com/gioboa) in [#7762](https://github.com/QwikDev/qwik/pull/7762))\n\n### Patch Changes\n\n- 🐞🩹 fix up TypeScript compatibility in the localize starter (by [@FDiskas](https://github.com/FDiskas) in [#7617](https://github.com/QwikDev/qwik/pull/7617))\n\n## 1.15.0\n\n### Patch Changes\n\n- 🐞🩹 fix up vercel starter config (by [@cmbartschat](https://github.com/cmbartschat) in [#7663](https://github.com/QwikDev/qwik/pull/7663))\n\n- 🛠 update devDependencies and configurations (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7695](https://github.com/QwikDev/qwik/pull/7695))\n\n## 1.14.1\n\n### Patch Changes\n\n- 🐞🩹 starter app missing package and added preview cli test (by [@wmertens](https://github.com/wmertens) in [#7626](https://github.com/QwikDev/qwik/pull/7626))\n\n## 1.14.0\n\n### Patch Changes\n\n- 🐞🩹 create-qwik logAppCreated.ts now displays correct next steps for deno. (by [@LogProphet](https://github.com/LogProphet) in [#7566](https://github.com/QwikDev/qwik/pull/7566))\n\n  After using the create-qwik command, the logAppCreated.ts file was not displaying the correct next steps for deno. Prior to this fix it would display \"deno start\" instead of \"deno task start\". This would cause a failure to run, as deno requires the 'task' keyword. This fixes bug 7520\n\n- 🐞🩹 linting errors which were previously being ignored across the monorepo. (by [@better-salmon](https://github.com/better-salmon) in [#7418](https://github.com/QwikDev/qwik/pull/7418))\n\n## 1.13.0\n\n## 1.12.1\n\n## 1.12.0\n\n## 1.11.0\n\n## 1.10.0\n\n### Patch Changes\n\n- INFRA: migration from tsm to tsx (by [@JerryWu1234](https://github.com/JerryWu1234) in [#6877](https://github.com/QwikDev/qwik/pull/6877))\n\n## 1.9.1\n\n## 1.9.0\n\n### Patch Changes\n\n- ✨ tailwind starter dependencies upgraded to latest (by [@thejackshelton](https://github.com/thejackshelton) in [#6783](https://github.com/QwikDev/qwik/pull/6783))\n\n- ✨ added `preserveModules` to library starters to improve library bundling / tree-shaking (by [@thejackshelton](https://github.com/thejackshelton) in [#6773](https://github.com/QwikDev/qwik/pull/6773))\n\n## 1.8.0\n\n### Patch Changes\n\n- 🐞🩹 wrong version when creating a library (by [@shairez](https://github.com/shairez) in [#6757](https://github.com/QwikDev/qwik/pull/6757))\n\n## 1.7.3\n\n### Patch Changes\n\n- 🐞🩹 get the right version number in starter apps (by [@shairez](https://github.com/shairez) in [#6742](https://github.com/QwikDev/qwik/pull/6742))\n\n## 1.7.2\n\n### Patch Changes\n\n- - built files are now under dist/ or lib/. All tools that respect package export maps should just work. (by [@wmertens](https://github.com/wmertens) in [#6715](https://github.com/QwikDev/qwik/pull/6715))\n    If you have trouble with Typescript, ensure that you use `moduleResolution: \"Bundler\"` in your `tsconfig.json`.\n  - `@builder.io/qwik` no longer depends on `undici`\n"
  },
  {
    "path": "packages/create-qwik/README.md",
    "content": "# Create Qwik ⚡️\n\n## Interactive mode\n\n```\nnpm create qwik@latest\n```\n\n## Command mode\n\n```\nnpm create qwik@latest <starter> <projectName>\n```\n\n## API\n\n```javascript\nconst { createApp } = require('create-qwik');\n\nconst opts = {\n  projectName: 'my-project',\n  starterId: 'todo',\n  outDir: '/path/to/output/dir',\n};\n\nconst result = await createApp(opts);\nconsole.log(result);\n```\n\n## Community\n\n- Ping us at [@QwikDev](https://twitter.com/QwikDev)\n- Join our [Discord](https://qwik.dev/chat) community\n\n## Related\n\n- [Qwik](https://qwik.dev/)\n- [Partytown](https://partytown.qwik.dev)\n- [Mitosis](https://github.com/BuilderIO/mitosis)\n- [Builder.io](https://github.com/BuilderIO/)\n"
  },
  {
    "path": "packages/create-qwik/create-qwik.cjs",
    "content": "#!/usr/bin/env node\nconst createQwik = require('./dist/index.cjs');\ncreateQwik.runCli();\n"
  },
  {
    "path": "packages/create-qwik/index.ts",
    "content": "import { runCreateCli } from './src/run-create-cli';\nimport { runCreateInteractiveCli } from './src/run-create-interactive-cli';\nimport { panic, printHeader } from '../qwik/src/cli/utils/utils';\nimport { red, yellow } from 'kleur/colors';\nimport { createAppFacade } from './src/create-app-facade';\n\nexport async function runCli() {\n  printHeader();\n\n  checkNodeVersion();\n\n  try {\n    const args = process.argv.slice(2);\n\n    if (args.length > 0) {\n      await runCreateCli(...args);\n    } else {\n      // npm create qwik\n      await runCreateInteractiveCli();\n    }\n  } catch (e: any) {\n    panic(e.message || e);\n  }\n}\n\nfunction checkNodeVersion() {\n  const version = process.version;\n  const [majorVersion, minorVersion] = version.replace('v', '').split('.');\n  if (Number(majorVersion) < 16) {\n    console.error(\n      red(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${version}.`)\n    );\n    process.exit(1);\n  } else if (Number(majorVersion) === 16) {\n    if (Number(minorVersion) < 8) {\n      console.warn(\n        yellow(\n          `Node.js 16.8 or higher is recommended. You are currently running Node.js ${version}.`\n        )\n      );\n    }\n  } else if (Number(majorVersion) === 18) {\n    if (Number(minorVersion) < 11) {\n      console.error(\n        red(\n          `Node.js 18.11 or higher is REQUIRED. From Node 18.0.0 to 18.11.0, there is a bug preventing correct behavior of Qwik. You are currently running Node.js ${version}. https://github.com/QwikDev/qwik/issues/3035`\n        )\n      );\n    }\n  }\n}\n\nexport { createAppFacade as createApp, runCreateCli, runCreateInteractiveCli };\n"
  },
  {
    "path": "packages/create-qwik/package.json",
    "content": "{\n  \"name\": \"create-qwik\",\n  \"description\": \"Interactive CLI for create Qwik projects and adding features.\",\n  \"version\": \"1.19.0\",\n  \"author\": \"Builder.io Team\",\n  \"bin\": \"./create-qwik.cjs\",\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"devDependencies\": {\n    \"@clack/prompts\": \"0.7.0\",\n    \"@types/yargs\": \"17.0.33\",\n    \"kleur\": \"4.1.5\",\n    \"yargs\": \"17.7.2\"\n  },\n  \"engines\": {\n    \"node\": \"^18.17.0 || ^20.3.0 || >=21.0.0\",\n    \"npm\": \">=10.0.0\",\n    \"pnpm\": \">=8.0.0\",\n    \"yarn\": \">=3.0.0\"\n  },\n  \"engines-annotation\": \"Mostly required by sharp which needs a Node-API v9 compatible runtime\",\n  \"files\": [\n    \"README.md\",\n    \"create-qwik.cjs\",\n    \"dist\"\n  ],\n  \"homepage\": \"https://qwik.dev/\",\n  \"keywords\": [\n    \"builder.io\",\n    \"generator\",\n    \"qwik\",\n    \"starters\",\n    \"template\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"./dist/index.cjs\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/create-qwik\"\n  }\n}\n"
  },
  {
    "path": "packages/create-qwik/src/create-app-facade.ts",
    "content": "import type { CreateAppOptions, CreateAppResult } from '../../qwik/src/cli/types';\n\nimport { createApp } from './create-app';\nimport { getPackageManager } from '../../qwik/src/cli/utils/utils';\nimport { makeTemplateManager } from './helpers/templateManager';\n\nexport async function createAppFacade(opts: CreateAppOptions): Promise<CreateAppResult> {\n  const pkgManager = getPackageManager();\n\n  const templateManager = await makeTemplateManager('app');\n\n  return await createApp({\n    appId: opts.starterId,\n    templateManager,\n    outDir: opts.outDir,\n    pkgManager,\n  });\n}\n"
  },
  {
    "path": "packages/create-qwik/src/create-app.ts",
    "content": "import type { CreateAppResult, IntegrationData } from '../../qwik/src/cli/types';\nimport fs from 'node:fs';\nimport { isAbsolute, join } from 'node:path';\nimport { cleanPackageJson, writePackageJson } from '../../qwik/src/cli/utils/utils';\nimport { updateApp } from '../../qwik/src/cli/add/update-app';\nimport { type TemplateManager } from './helpers/templateManager';\n\ntype Options = {\n  appId: string;\n  templateManager: TemplateManager;\n  outDir: string;\n  pkgManager: string;\n};\n\ntype CreateFromStarterOptions = {\n  pkgManager: string;\n  baseApp: IntegrationData;\n  starterApp?: IntegrationData;\n  outDir: string;\n};\n\nfunction isValidOption(value: any) {\n  return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction validateOptions(opts: Options) {\n  if (!isValidOption(opts.outDir)) {\n    throw new Error(`Missing outDir`);\n  }\n\n  if (!isAbsolute(opts.outDir)) {\n    throw new Error(`outDir must be an absolute path`);\n  }\n}\n\nexport async function createApp(opts: Options): Promise<CreateAppResult> {\n  const { appId, outDir, pkgManager, templateManager } = opts;\n\n  const { baseApp, starterApp } = templateManager.getBootstrapApps(appId);\n\n  validateOptions(opts);\n\n  if (!fs.existsSync(outDir)) {\n    fs.mkdirSync(decodeURIComponent(outDir), { recursive: true });\n  }\n\n  const docs = await createFromStarter({ baseApp, starterApp, pkgManager, outDir });\n\n  return { starterId: opts.appId, outDir, pkgManager, docs };\n}\n\nasync function createFromStarter({\n  baseApp,\n  starterApp,\n  outDir,\n  pkgManager,\n}: CreateFromStarterOptions): Promise<string[]> {\n  const docs = [...baseApp.docs];\n\n  const appInfo = starterApp ?? baseApp;\n\n  const appPkgJson = cleanPackageJson({\n    ...baseApp.pkgJson,\n    name: `my-${appInfo.pkgJson.name}`,\n    description: appInfo.pkgJson.description,\n    scripts: undefined,\n    dependencies: undefined,\n    devDependencies: undefined,\n  });\n\n  await writePackageJson(outDir, appPkgJson);\n\n  const readmePath = join(outDir, 'README.md');\n  await fs.promises.writeFile(readmePath, '');\n\n  const baseUpdate = await updateApp(pkgManager, {\n    rootDir: outDir,\n    integration: baseApp.id,\n    installDeps: false,\n  });\n\n  await baseUpdate.commit(false);\n\n  if (starterApp) {\n    docs.push(...starterApp.docs);\n\n    const starterUpdate = await updateApp(pkgManager, {\n      rootDir: outDir,\n      integration: starterApp.id,\n      installDeps: false,\n    });\n\n    await starterUpdate.commit(false);\n  }\n\n  return docs;\n}\n"
  },
  {
    "path": "packages/create-qwik/src/helpers/clearDir.ts",
    "content": "import fs from 'node:fs';\nimport { join } from 'node:path';\n\nexport const clearDir = async (dir: string) => {\n  const files = await fs.promises.readdir(dir);\n\n  return await Promise.all(\n    files.map((pathToFile) => fs.promises.rm(join(dir, pathToFile), { recursive: true }))\n  );\n};\n"
  },
  {
    "path": "packages/create-qwik/src/helpers/installDepsCli.ts",
    "content": "import type { spinner } from '@clack/prompts';\n\ntype Sinner = ReturnType<typeof spinner>;\n\ntype Params = {\n  spinner: Sinner;\n  pkgManager: string;\n};\n\nexport async function installDepsCli(fn: () => Promise<boolean>, { pkgManager, spinner }: Params) {\n  spinner.start(`Installing ${pkgManager} dependencies...`);\n\n  const success = await fn();\n\n  spinner.stop(`${success ? 'Installed' : 'Failed to install'} ${pkgManager} dependencies 📋`);\n\n  return success;\n}\n"
  },
  {
    "path": "packages/create-qwik/src/helpers/jokes.json",
    "content": "[\n  [\"What's the best thing about a Boolean?\", \"Even if you're wrong, you're only off by a bit.\"],\n  [\"Why did the developer stay at home?\", \"Because he couldn't find his keys.\"],\n  [\"How many programmers does it take to change a lightbulb?\", \"None that's a hardware problem\"],\n  [\"A user interface is like a joke.\", \"If you have to explain it then it is not that good.\"],\n  [\"['hip', 'hip']\", \"(hip hip array)\"],\n  [\"A SQL query goes into a bar, walks up to two tables and asks:\", \"'Can I JOIN you?'\"],\n  [\"Why did the developer go to therapy?\", \"He had too many unresolved issues.\"],\n  [\n    \"Why do C# and Java developers keep breaking their keyboards?\",\n    \"Because they use a strongly typed language.\"\n  ],\n  [\"What's the object-oriented way to become wealthy?\", \"Inheritance\"],\n  [\"Where do programmers like to hangout?\", \"The Foo Bar.\"],\n  [\"Why do Java programmers wear glasses?\", \"Because they don't C#\"],\n  [\"To understand what recursion is...\", \"You must first understand what recursion is\"],\n  [\"The punchline often arrives before the set-up.\", \"Do you know the problem with UDP jokes?\"],\n  [\"Why did the programmer quit his job?\", \"Because he didn't get arrays.\"],\n  [\"Why was the computer tired when it got home?\", \"It had a hard drive.\"],\n  [\n    \"There are 10 types of people in this world...\",\n    \"Those who understand binary and those who don't\"\n  ],\n  [\"Why do programmers always mix up Halloween and Christmas?\", \"Because Oct 31 == Dec 25\"],\n  [\"I was gonna tell you a joke about UDP...\", \"...but you might not get it.\"],\n  [\"Normal People: give me just a second\", \"Developers: give me 1000 milliseconds!\"],\n  [\"Why do programmers prefer dark mode?\", \"Because light attracts bugs.\"],\n  [\"Why don't programmers like nature?\", \"It has too many bugs.\"],\n  [\"Why was the computer freezing?\", \"It left its Windows open!\"],\n  [\"What did the Java code say to the C code?\", \"You've got no class.\"],\n  [\"Why do programmers prefer the outdoors?\", \"Because it's free of bugs.\"],\n  [\"Why do programmers love movies?\", \"Because they can 'script' the ending.\"],\n  [\"why do desert animals hate Qwik?\", \"Because there's no hydration....\"],\n  [\"What can you do if you cannot push your git changes?\", \"Use the --force, Luke\"],\n  [\"How did the developer announce he's getting married?\", \"'She returned true!'\"],\n  [\"How many Prolog programmers does it take to change a lightbulb?\", \"Yes.\"],\n  [\"Why did the developer ground their kid?\", \"They weren't telling the truthy\"],\n  [\"!false\", \"It's funny 'cause it's true.\"],\n  [\"Where did the parallel function wash its hands?\", \"Async\"],\n  [\"How do functions break up?\", \"They stop calling each other\"],\n  [\"Why did the functions stop calling each other?\", \"Because they had constant arguments.\"],\n  [\"What's the second movie about a database engineer called?\", \"The SQL.\"],\n  [\"What did the computer do at lunchtime?\", \"NoSQL.\"],\n  [\"Why doesn't Hollywood make more Big Data movies?\", \"Had a byte!\"],\n  [\"What does a baby computer call his father?\", \"Data!\"],\n  [\"I never tell the same joke twice\", \"I have a DRY sense of humor.\"],\n  [\"How do programming pirates pass method parameters?\", \"ARRRRRGS.\"],\n  [\"Why don't bachelors like Git?\", \"Because they are afraid to commit.\"],\n  [\"Why do astronauts use Linux?\", \"They can't open Windows in space!\"],\n  [\"How do front end devs like their brownies?\", \"GUI\"],\n  [\"What do hackers do on a boat?\", \"Phishing.\"],\n  [\"Why couldn't the HTML list be trusted?\", \"There were LI's everywhere\"],\n  [\"To the person who invented zero:\", \"Thank's for nothing!\"],\n  [\"What do you call a bee that lives in America?\", \"A USB\"],\n  [\"want about to a race conditions hear joke?\", \"\"],\n  [\"What is a Package Managers favorite holiday?\", \"Dependency Day\"],\n  [\"Where do we get all of these dad jokes from?\", \"A dad-a-base!\"],\n  [\"What advice do you give to a JS developer who has never played baseball?\", \"Try catch.\"],\n  [\"We don't have any DNS jokes, know why?\", \"Because it may take 24 hours to get them\"],\n  [\"Why do Front-End Developers eat lunch alone?\", \"Because they don't know how to join tables.\"],\n  [\"How do you help JS errors?\", \"You `console` them!\"],\n  [\"When do front end developers go out to eat?\", \"On their lunch <br>.\"],\n  [\"What do you call optimistic front-end developers?\", \"Stack half-full developers.\"]\n]\n"
  },
  {
    "path": "packages/create-qwik/src/helpers/jokes.ts",
    "content": "import jokes from './jokes.json';\n\nexport function getRandomJoke() {\n  const index = Math.floor(Math.random() * jokes.length);\n  return jokes[index]!;\n}\n"
  },
  {
    "path": "packages/create-qwik/src/helpers/logAppCreated.ts",
    "content": "import { bgMagenta, bold, cyan, magenta } from 'kleur/colors';\n\nimport type { CreateAppResult } from '../../../qwik/src/cli/types';\nimport { logSuccessFooter } from '../../../qwik/src/cli/utils/log';\nimport { note } from '../../../qwik/src/cli/utils/utils';\nimport { outro } from '@clack/prompts';\nimport { relative } from 'node:path';\n\nexport function logAppCreated(pkgManager: string, result: CreateAppResult, ranInstall: boolean) {\n  const isCwdDir = process.cwd() === result.outDir;\n  const relativeProjectPath = relative(process.cwd(), result.outDir);\n  const outString = [];\n\n  if (isCwdDir) {\n    outString.push(`🦄 ${bgMagenta(' Success! ')}`);\n  } else {\n    outString.push(\n      `🦄 ${bgMagenta(' Success! ')} ${cyan(`Project created in`)} ${bold(\n        magenta(relativeProjectPath)\n      )} ${cyan(`directory`)}`\n    );\n  }\n  outString.push(``);\n\n  const qwikAdd = pkgManager !== 'npm' ? `${pkgManager} qwik add` : `npm run qwik add`;\n  outString.push(`🤍 ${cyan('Integrations? Add Netlify, Cloudflare, Tailwind...')}`);\n  outString.push(`   ${qwikAdd}`);\n  outString.push(``);\n\n  outString.push(logSuccessFooter(result.docs));\n\n  outString.push(`👀 ${cyan('Presentations, Podcasts and Videos:')}`);\n  outString.push(`   https://qwik.dev/media/`);\n  outString.push(``);\n\n  outString.push(`🐰 ${cyan(`Next steps:`)}`);\n  if (!isCwdDir) {\n    outString.push(`   cd ${relativeProjectPath}`);\n  }\n  if (!ranInstall) {\n    outString.push(`   ${pkgManager} install`);\n  }\n  if (pkgManager === 'deno') {\n    outString.push(`   deno task start`);\n  } else {\n    outString.push(`   ${pkgManager} start`);\n  }\n  outString.push(``);\n\n  note(outString.join('\\n'), 'Result');\n\n  outro('Happy coding! 🎉');\n}\n"
  },
  {
    "path": "packages/create-qwik/src/helpers/resolveRelativeDir.ts",
    "content": "import { resolve } from 'path';\nimport os from 'node:os';\n\nexport function resolveRelativeDir(dir: string) {\n  // check if the outDir start with home ~\n  if (dir.startsWith('~/')) {\n    return resolve(os.homedir(), dir);\n  } else {\n    return resolve(process.cwd(), dir);\n  }\n}\n"
  },
  {
    "path": "packages/create-qwik/src/helpers/templateManager.ts",
    "content": "import type { IntegrationData, IntegrationType } from 'packages/qwik/src/cli/types';\n\nimport { loadIntegrations } from 'packages/qwik/src/cli/utils/integrations';\n\nlet integrations: IntegrationData[] | undefined = undefined;\n\nconst LIBRARY_ID = 'library';\nconst BASE_ID = 'base';\n\nclass AppNotFoundError extends Error {\n  constructor(id: string, templates: IntegrationData[]) {\n    super();\n\n    this.message = `Invalid app id \"${id}\". It can only be one of${templates.map(\n      (app) => ` \"${app.id}\"`\n    )}.`;\n  }\n}\n\nexport const makeTemplateManager = async (type: IntegrationType) => {\n  if (!integrations) {\n    integrations = await loadIntegrations();\n  }\n\n  const templates = integrations.filter((i) => i.type === type);\n  const standaloneTemplates = templates.filter((i) => i.id !== BASE_ID);\n\n  function getAppById(\n    id: string,\n    isStandaloneInstallable: boolean = true\n  ): IntegrationData | undefined {\n    if (isStandaloneInstallable) {\n      return standaloneTemplates.find((t) => t.id === id);\n    }\n    return templates.find((t) => t.id === id);\n  }\n\n  function getBaseApp(): IntegrationData | undefined {\n    return getAppById(BASE_ID, false);\n  }\n\n  function getBootstrapApps(id: string): {\n    baseApp: IntegrationData;\n    starterApp?: IntegrationData;\n  } {\n    const isLibrary = id === LIBRARY_ID;\n\n    if (isLibrary) {\n      const libApp = getAppById(id);\n\n      if (!libApp) {\n        throw new AppNotFoundError(id, standaloneTemplates);\n      }\n\n      return { baseApp: libApp };\n    }\n\n    const baseApp = getAppById(BASE_ID, false);\n    const starterApp = getAppById(id);\n\n    if (!baseApp) {\n      throw new AppNotFoundError(BASE_ID, standaloneTemplates);\n    }\n\n    if (!starterApp) {\n      throw new AppNotFoundError(id, standaloneTemplates);\n    }\n\n    return { baseApp, starterApp };\n  }\n\n  return {\n    templates,\n    standaloneTemplates,\n    getAppById,\n    getBootstrapApps,\n    getBaseApp,\n  };\n};\n\nexport type TemplateManager = Awaited<ReturnType<typeof makeTemplateManager>>;\n"
  },
  {
    "path": "packages/create-qwik/src/run-create-cli.ts",
    "content": "import { cancel, intro, log, spinner as spinnerPrompt } from '@clack/prompts';\n\nimport type { CreateAppResult } from 'packages/qwik/src/cli/types';\nimport { bgBlue } from 'kleur/colors';\nimport { clearDir } from './helpers/clearDir';\nimport { createApp } from './create-app';\nimport fs from 'node:fs';\nimport { getPackageManager } from '../../qwik/src/cli/utils/utils';\nimport { installDepsCli } from './helpers/installDepsCli';\nimport { installDeps as installDepsFn } from 'packages/qwik/src/cli/utils/install-deps';\nimport { logAppCreated } from './helpers/logAppCreated';\nimport { makeTemplateManager } from './helpers/templateManager';\nimport { resolveRelativeDir } from './helpers/resolveRelativeDir';\nimport yargs from 'yargs';\n\ntype Args = {\n  outDir: string;\n  template: string;\n  installDeps: boolean;\n  force: boolean;\n};\n\nfunction parseArgs(args: string[], templates: string[]) {\n  const parsedArgs = yargs(args)\n    .strict()\n    .command('* <template> <outDir>', 'Create a new project powered by qwik', (yargs) => {\n      return yargs\n        .positional('template', {\n          type: 'string',\n          desc: 'Starter template',\n          choices: templates,\n        })\n        .positional('outDir', {\n          type: 'string',\n          desc: 'Directory of the project',\n        })\n        .option('force', {\n          alias: 'f',\n          type: 'boolean',\n          default: false,\n          desc: 'Overwrite target directory if it exists',\n        })\n        .option('installDeps', {\n          alias: 'i',\n          default: false,\n          type: 'boolean',\n          desc: 'Install dependencies',\n        })\n        .usage('npm create qwik@latest base ./my-project <options>');\n    }).argv as unknown as Args;\n\n  return parsedArgs;\n}\n\n/** @param args Pass here process.argv.slice(2) */\nexport async function runCreateCli(...args: string[]): Promise<CreateAppResult> {\n  const pkgManager = getPackageManager();\n  const templateManager = await makeTemplateManager('app');\n  const templateVariants = templateManager.standaloneTemplates.map(({ id }) => id);\n\n  const parsedArgs = parseArgs(args, templateVariants);\n  const { force, installDeps, template } = parsedArgs;\n\n  let outDir = parsedArgs.outDir;\n\n  intro(`Let's create a ${bgBlue(' Qwik App ')} ✨ (v${(globalThis as any).QWIK_VERSION})`);\n\n  if (writeToCwd()) {\n    // write to the current working directory\n    outDir = process.cwd();\n  } else {\n    // create a sub directory\n    outDir = resolveRelativeDir(outDir);\n\n    if (fs.existsSync(outDir) && fs.readdirSync(outDir).length > 0) {\n      if (force) {\n        await clearDir(outDir);\n      } else {\n        log.error(`Directory \"${outDir}\" already exists.`);\n        log.info(\n          `Please either remove this directory, choose another location or run the command again with '--force | -f' flag.`\n        );\n        cancel();\n        process.exit(1);\n      }\n    }\n  }\n\n  const result = await createApp({ outDir, appId: template, pkgManager, templateManager });\n  const spinner = spinnerPrompt();\n\n  let isDepsInstalled = false;\n\n  if (installDeps) {\n    isDepsInstalled = await installDepsCli(\n      async () => await installDepsFn(pkgManager, outDir).install,\n      { pkgManager, spinner }\n    );\n  }\n\n  logAppCreated(pkgManager, result, isDepsInstalled);\n\n  return result;\n}\n\nfunction writeToCwd() {\n  return isStackBlitz();\n}\n\nfunction isStackBlitz() {\n  try {\n    // /home/projects/abc123\n    return process.cwd().startsWith('/home/projects/');\n  } catch {\n    // ignore\n  }\n  return false;\n}\n"
  },
  {
    "path": "packages/create-qwik/src/run-create-interactive-cli.ts",
    "content": "import { backgroundInstallDeps, installDeps } from '../../qwik/src/cli/utils/install-deps';\nimport { bgBlue, gray, magenta, red } from 'kleur/colors';\nimport { cancel, confirm, intro, isCancel, log, select, spinner, text } from '@clack/prompts';\nimport { getPackageManager, note, runCommand, wait } from '../../qwik/src/cli/utils/utils';\nimport { join, relative } from 'node:path';\n\nimport type { CreateAppResult } from '../../qwik/src/cli/types';\nimport { clearDir } from './helpers/clearDir';\nimport { createApp } from './create-app';\n\nimport fs from 'node:fs';\nimport { getRandomJoke } from './helpers/jokes';\nimport { installDepsCli } from './helpers/installDepsCli';\nimport { logAppCreated } from './helpers/logAppCreated';\nimport { makeTemplateManager } from './helpers/templateManager';\nimport { resolveRelativeDir } from './helpers/resolveRelativeDir';\n\nexport async function runCreateInteractiveCli(): Promise<CreateAppResult> {\n  const pkgManager = getPackageManager();\n  const templateManager = await makeTemplateManager('app');\n  const defaultProjectName = './qwik-app';\n\n  intro(`Let's create a ${bgBlue(' Qwik App ')} ✨ (v${(globalThis as any).QWIK_VERSION})`);\n\n  await wait(500);\n\n  const projectNameAnswer =\n    (await text({\n      message: `Where would you like to create your new project? ${gray(\n        `(Use '.' or './' for current directory)`\n      )}`,\n      placeholder: defaultProjectName,\n    })) || defaultProjectName;\n\n  if (isCancel(projectNameAnswer)) {\n    cancel('Operation cancelled.');\n    process.exit(0);\n  }\n\n  const baseApp = templateManager.getBaseApp();\n\n  if (!baseApp) {\n    throw new Error('Base app not found');\n  }\n\n  // sorted alphabetically\n  const starterApps = templateManager.templates\n    .filter((a) => a.id !== baseApp.id)\n    .sort((a, b) => a.name.localeCompare(b.name));\n\n  const outDir: string = resolveRelativeDir(projectNameAnswer.trim());\n  baseApp.target = outDir;\n\n  const backgroundInstall = backgroundInstallDeps(pkgManager, baseApp);\n\n  const cancelProcess = async () => {\n    await backgroundInstall.abort();\n    cancel('Operation cancelled.');\n    process.exit(0);\n  };\n\n  log.info(`Creating new project in ${bgBlue(' ' + outDir + ' ')} ... 🐇`);\n\n  let removeExistingOutDirPromise: Promise<void | void[]> | null = null;\n\n  if (fs.existsSync(outDir) && fs.readdirSync(outDir).length > 0) {\n    const existingOutDirAnswer = await select({\n      message: `Directory \"./${relative(\n        process.cwd(),\n        outDir\n      )}\" already exists and is not empty. What would you like to do?`,\n      options: [\n        { value: 'exit', label: 'Do not overwrite this directory and exit' },\n        { value: 'replace', label: 'Remove contents of this directory' },\n      ],\n    });\n\n    if (isCancel(existingOutDirAnswer) || existingOutDirAnswer === 'exit') {\n      return await cancelProcess();\n    }\n\n    if (existingOutDirAnswer === 'replace') {\n      removeExistingOutDirPromise = clearDir(outDir);\n    }\n  }\n  const starterIdAnswer = await select({\n    message: 'Select a starter',\n    options: starterApps.map((s) => {\n      return { label: s.name, value: s.id, hint: s.pkgJson?.description };\n    }),\n  });\n\n  if (isCancel(starterIdAnswer)) {\n    return await cancelProcess();\n  }\n\n  const starterId = starterIdAnswer as string;\n\n  const runDepInstallAnswer = await confirm({\n    message: `Would you like to install ${pkgManager} dependencies?`,\n    initialValue: true,\n  });\n\n  if (isCancel(runDepInstallAnswer)) {\n    return await cancelProcess();\n  }\n\n  const gitInitAnswer = await confirm({\n    message: `Initialize a new git repository?`,\n    initialValue: true,\n  });\n\n  if (removeExistingOutDirPromise) {\n    await removeExistingOutDirPromise;\n  }\n\n  const runDepInstall: boolean = runDepInstallAnswer;\n\n  if (!runDepInstall) {\n    backgroundInstall.abort();\n  } else if (typeof backgroundInstall.success === 'undefined') {\n    try {\n      const joke = await confirm({\n        message: `Finishing the install. Wanna hear a joke?`,\n        initialValue: true,\n      });\n      if (!isCancel(joke) && joke) {\n        const [setup, punchline] = getRandomJoke();\n        note(magenta(`${setup!.trim()}\\n${punchline!.trim()}`), '🙈');\n      }\n    } catch (e) {\n      // Never crash on jokes\n    }\n  }\n\n  const s = spinner();\n\n  s.start('Creating App...');\n\n  const result = await createApp({ appId: starterId, outDir, pkgManager, templateManager });\n\n  s.stop('App Created 🐰');\n\n  if (gitInitAnswer) {\n    if (fs.existsSync(join(outDir, '.git'))) {\n      log.info(`Git has already been initialized before. Skipping...`);\n    } else {\n      s.start('Git initializing...');\n\n      try {\n        const res = [];\n        res.push(await runCommand('git', ['init'], outDir).install);\n        res.push(await runCommand('git', ['add', '-A'], outDir).install);\n        res.push(await runCommand('git', ['commit', '-m', 'Initial commit ⚡️'], outDir).install);\n\n        if (res.some((r) => r === false)) {\n          throw '';\n        }\n\n        s.stop('Git initialized 🎲');\n      } catch (e) {\n        s.stop('Git failed to initialize');\n        log.error(red(`Git failed to initialize. You can do this manually by running: git init`));\n      }\n    }\n  }\n\n  let successfulDepsInstall = false;\n\n  if (runDepInstall) {\n    successfulDepsInstall = await installDepsCli(\n      async () => {\n        const success = await backgroundInstall.complete(result.outDir);\n\n        if (success) {\n          return await installDeps(pkgManager, result.outDir).install;\n        }\n\n        return success;\n      },\n      { pkgManager, spinner: s }\n    );\n  }\n\n  logAppCreated(pkgManager, result, successfulDepsInstall);\n\n  return result;\n}\n"
  },
  {
    "path": "packages/create-qwik/src/types.ts",
    "content": "export type Args = {\n  outDir: string;\n  template: string;\n  installDeps: boolean;\n  force: boolean;\n};\n"
  },
  {
    "path": "packages/docs/.gitignore",
    "content": "# Build\nbuild\ndist\nserver\nfunctions/**/*.js\n# This is used in dev mode because service\n# workers don't support imports\npublic/repl/repl-sw.js*\n\n!src/routes/api/qwik/server/\n\n# Development\nnode_modules\n\n# Cache\n.cache\n.mf\n.vscode\n.rollup.cache\ntsconfig.tsbuildinfo\nq-insights.json\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\n# Editor\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\n# Cloudflare\n\n*.local\n"
  },
  {
    "path": "packages/docs/.node-version",
    "content": "18\n"
  },
  {
    "path": "packages/docs/.npmrc",
    "content": "package-lock=false"
  },
  {
    "path": "packages/docs/.prettierignore",
    "content": "**/*.log\n**/.DS_Store\n*.\n.vscode/settings.json\n.history\n.yarn\ndist\ndist-dev\netc\nexternal\nnode_modules\ntemp\ntsc-out\ntsdoc-metadata.json\ntarget\noutput\nbuild\nserver\n.cache\n.vscode\n.rollup.cache\ntsconfig.tsbuildinfo\nsrc/pages/**/*.mdx\nsrc/**/*.gen.*"
  },
  {
    "path": "packages/docs/README.md",
    "content": "# Qwik Docs Site ⚡️\n\n## Development Builds\n\n### Client only\n\nDuring development, the index.html is not a result of server-side rendering, but rather the Qwik app is built using client-side JavaScript only. This is ideal for development with Vite and its ability to reload modules quickly and on-demand. However, this mode is only for development and does not showcase \"how\" Qwik works since JavaScript is required to execute, and Vite imports many development modules for the app to work.\n\n```\npnpm dev\n```\n\n### Server-side Rendering (SSR) and Client\n\nServer-side rendered index.html, with client-side modules prefetched and loaded by the browser. This can be used to test out server-side rendered content during development, but will be slower than the client-only development builds.\n\n```\npnpm dev.ssr\n```\n\n## Production Builds\n\nA production build should generate the client and server modules by running both client and server build commands.\n\n```\npnpm build\n```\n\n### Client Modules\n\nProduction build that creates only the client-side modules that are dynamically imported by the browser.\n\n```\npnpm build.client\n```\n\n### Server Modules\n\nProduction build that creates the server-side render (SSR) module that is used by the server to render the HTML.\n\n```\npnpm build.ssr\n```\n\n## Cloudflare Pages\n\nCloudflare's [wrangler](https://github.com/cloudflare/wrangler) CLI can be used to preview a production build locally. To start a local server, run:\n\n```\npnpm serve\n```\n\nThen visit [http://localhost:8787/](http://localhost:8787/)\n\n### Deployments\n\n[Cloudflare Pages](https://pages.cloudflare.com/) are deployable through their [Git provider integrations](https://developers.cloudflare.com/pages/platform/git-integration/).\n\nIf you don't already have an account, then [create a Cloudflare account here](https://dash.cloudflare.com/sign-up/pages). Next go to your dashboard and follow the [Cloudflare Pages deployment guide](https://developers.cloudflare.com/pages/framework-guides/deploy-anything/).\n\nWithin the projects \"Settings\" for \"Build and deployments\", the \"Build command\" should be `pnpm build`, and the \"Build output directory\" should be set to `dist`.\n\n### Function Invocation Routes\n\nCloudflare Page's [function-invocation-routes config](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes) can be used to include, or exclude, certain paths to be used by the worker functions. Having a `_routes.json` file gives developers more granular control over when your Function is invoked.\nThis is useful to determine if a page response should be Server-Side Rendered (SSR) or if the response should use a static-site generated (SSG) `index.html` file.\n\nBy default, the Cloudflare pages adaptor _does not_ include a `public/_routes.json` config, but rather it is auto-generated from the build by the Cloudflare adaptor. An example of an auto-generate `dist/_routes.json` would be:\n\n```\n{\n  \"include\": [\n    \"/*\"\n  ],\n  \"exclude\": [\n    \"/_headers\",\n    \"/_redirects\",\n    \"/build/*\",\n    \"/favicon.ico\",\n    \"/manifest.json\",\n    \"/service-worker.js\",\n    \"/about\"\n  ],\n  \"version\": 1\n}\n```\n\nIn the above example, it's saying _all_ pages should be SSR'd. However, the root static files such as `/favicon.ico` and any static assets in `/build/*` should be excluded from the Functions, and instead treated as a static file.\n\nIn most cases the generated `dist/_routes.json` file is ideal. However, if you need more granular control over each path, you can instead provide you're own `public/_routes.json` file. When the project provides its own `public/_routes.json` file, then the Cloudflare adaptor will not auto-generate the routes config and instead use the one committed within the `public` directory.\n\n## Algolia search\n\nSTILL WIP\n\nresource: https://docsearch.algolia.com/\n\n### Crawler\n\nSetup in https://crawler.algolia.com/\n\n### Debug local site with crawler settings\n\nTo crawl localhost site for testing index settings for content hierarchy. use this docker command\n\n```shell\n# create apiKey via https://www.algolia.com/account/api-keys\ntouch .env\n# APPLICATION_ID=APPLICATION_ID\n# API_KEY=API_KEY\ndocker run -it --rm --env-file=.env -e \"CONFIG=$(cat ./packages/docs/algolia.json | jq -r tostring)\" algolia/docsearch-scraper\n```\n\nsee guide of [DocSearch-legacy docker command](https://docsearch.algolia.com/docs/legacy/run-your-own#run-the-crawl-from-the-docker-image)\n\n> In mac machines, docker containers can't access host's network directly, a workaround is to use host.docker.internal`\n"
  },
  {
    "path": "packages/docs/adapters/cloudflare-pages/vite.config.mts",
    "content": "import { cloudflarePagesAdapter } from '@builder.io/qwik-city/adapters/cloudflare-pages/vite';\nimport { extendConfig } from '@builder.io/qwik-city/vite';\n// @ts-ignore\nimport baseConfig from '../../vite.config.mts';\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['src/entry.cloudflare-pages.tsx', '@qwik-city-plan'],\n      },\n      minify: false,\n    },\n    plugins: [\n      cloudflarePagesAdapter({\n        ssg: {\n          include: ['/', '/*'],\n          exclude: ['/demo/*', '/shop/*'],\n          origin:\n            (process.env.CF_PAGES_BRANCH !== 'main' ? process.env.CF_PAGES_URL : null) ??\n            'https://qwik.builder.io',\n        },\n      }),\n    ],\n  };\n});\n"
  },
  {
    "path": "packages/docs/algolia.json",
    "content": "{\n  \"index_name\": \"qwik\",\n  \"sitemap_urls\": [\"http://qwik.dev/sitemap.xml\"],\n  \"selectors\": {\n    \"lvl0\": {\n      \"selector\": \"header a.active\",\n      \"global\": true\n    },\n    \"lvl1\": \"article h1\",\n    \"lvl2\": \"article h2\",\n    \"lvl3\": \"article h3\",\n    \"lvl4\": \"article h4\",\n    \"lvl5\": \"article h5\",\n    \"text\": \"article p,article li,article td\"\n  }\n}\n"
  },
  {
    "path": "packages/docs/check-qwik-build.ts",
    "content": "// verify that ../qwik/dist/core.d.ts exists or run `pnpm run build.core` in the root directory\n// Also make sure that the repl-sw.js file is present, for dev mode\n// we need it for development and for the REPL\n\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { spawnSync } from 'node:child_process';\n\nlet __dirname = path.dirname(new URL(import.meta.url).pathname);\nconst isWindows = process.platform === 'win32';\nif (isWindows && __dirname.startsWith('/')) {\n  // in Windows __dirname starts with a / causing errors\n  // before\n  //  /C:/Users/{location stuff}/qwik/packages/docs\n  __dirname = __dirname.substring(1);\n  // after\n  // C:/Users/{location stuff}/qwik/packages/docs\n}\nconst qwikPkgDir = path.join(__dirname, '..', 'qwik', 'dist');\n\nif (!fs.existsSync(path.join(qwikPkgDir, 'core.d.ts'))) {\n  console.warn(\n    `\\n\\n=== Running 'pnpm run build.local' to generate missing imports for the docs ===\\n`\n  );\n  const out = spawnSync('pnpm', ['run', 'build.local'], {\n    cwd: path.join(__dirname, '..', '..'),\n    stdio: 'inherit',\n  });\n  if (out.status !== 0) {\n    console.error('Failed to build local packages');\n    process.exit(1);\n  }\n}\n\nif (!fs.existsSync(path.join(__dirname, 'public', 'repl', 'repl-sw.js'))) {\n  console.warn(\n    `\\n\\n=== Running 'pnpm run build.repl-sw' to generate missing REPL service worker public/repl/repl-sw.js ===\\n`\n  );\n  const out = spawnSync('pnpm', ['run', 'build.repl-sw'], {\n    stdio: 'inherit',\n  });\n  if (out.status !== 0) {\n    console.error('Failed to build REPL service worker');\n    process.exit(1);\n  }\n}\n"
  },
  {
    "path": "packages/docs/codesandbox.sync.ts",
    "content": "import { readdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nfunction scanFiles(\n  path: string,\n  filePredicate: (path: string) => boolean,\n  fileCallback: (path: string) => void\n) {\n  readdirSync(path, { withFileTypes: true }).forEach((dirent) => {\n    if (dirent.isDirectory()) {\n      scanFiles(join(path, dirent.name), filePredicate, fileCallback);\n    } else if (dirent.isFile()) {\n      if (filePredicate(dirent.name)) {\n        fileCallback(join(path, dirent.name));\n      }\n    }\n  });\n}\n\nfunction mdxFiles(path: string) {\n  return path.endsWith('.mdx');\n}\n\nfunction transformFile(\n  path: string,\n  lineTransformFn: (path: string, lines: string[]) => string[]\n): void {\n  const lines = readFile(path);\n  const newLines = lineTransformFn(path, lines);\n  writeFileSync(path, newLines.join('\\n'));\n}\n\nfunction readFile(path: string) {\n  try {\n    const file = readFileSync(path, 'utf-8');\n    return file.split('\\n');\n  } catch (e) {\n    console.error('Error reading file: ' + path);\n    throw e;\n  }\n}\n\nfunction findCodeSandboxes(\n  codeSandboxTransformFn: (mdxPath: string, srcPath: string, lines: string[]) => string[],\n  mdxPath: string,\n  lines: string[]\n): string[] {\n  const newLines = [];\n  for (let lineNo = 0; lineNo < lines.length; lineNo++) {\n    const line = lines[lineNo];\n    newLines.push(line);\n    const match = line.match(/(.*)<(CodeSandbox|CodeFile) src=[\"']([^\"']*)[\"'].*>$/);\n    if (match) {\n      const [, prefix, tag, srcPath] = match;\n      const content: string[] = [];\n      let contentEndLine: string = '';\n      do {\n        if (lineNo > lines.length) {\n          throw new Error(tag + ' not closed');\n        }\n        const contentLine = lines[++lineNo];\n        if (contentLine.match(new RegExp('</' + tag + '>$'))) {\n          contentEndLine = contentLine;\n        } else if (contentLine.startsWith(prefix)) {\n          content.push(contentLine.slice(prefix.length));\n        } else {\n          throw new Error(\n            'Expecting content of `<' +\n              tag +\n              '>` to be indented with: ' +\n              JSON.stringify(prefix) +\n              ' Was: ' +\n              JSON.stringify(contentLine) +\n              ' in ' +\n              mdxPath +\n              ' at line ' +\n              lineNo\n          );\n        }\n      } while (!contentEndLine);\n      const newContent = codeSandboxTransformFn(mdxPath, srcPath, content);\n      newLines.push(...newContent.map((l) => prefix + l), contentEndLine);\n    }\n  }\n  return newLines;\n}\n\nfunction syncCodeSandboxes(path: string) {\n  transformFile(path, findCodeSandboxes.bind(null, syncCodeSandbox));\n}\n\nfunction syncCodeSandbox(mdxPath: string, srcPath: string, lines: string[]) {\n  console.log('SYNCING', mdxPath, srcPath);\n  const first = lines[0];\n  const newContent = readFile(join('.', srcPath));\n  while (newContent.length && newContent[newContent.length - 1] == '') {\n    newContent.pop();\n  }\n  const last = lines[lines.length - 1];\n  return [first, ...newContent, last];\n}\n\nscanFiles('src/routes', mdxFiles, syncCodeSandboxes);\n"
  },
  {
    "path": "packages/docs/contributors.ts",
    "content": "import { fetch } from 'undici';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport url from 'node:url';\nimport matter from 'gray-matter';\nimport { loadEnv } from 'vite';\n\nconst rootDir = path.join(path.dirname(url.fileURLToPath(import.meta.url)), '..', '..');\nexport const PRIVATE_GITHUB_ACCESS_TOKEN =\n  process.env.GITHUB_TOKEN || loadEnv('', '.', 'PRIVATE').PRIVATE_GITHUB_ACCESS_TOKEN;\n\nasync function updateContributors() {\n  const routesDir = path.join(rootDir, 'packages', 'docs', 'src', 'routes');\n  await updateDocsDir(routesDir);\n}\n\nasync function updateDocsDir(dir: string) {\n  const items = fs.readdirSync(dir);\n  for (const itemName of items) {\n    if (itemName === 'index.mdx') {\n      await updateGithubCommits(path.join(dir, itemName));\n    } else {\n      const itemPath = path.join(dir, itemName);\n      const itemStat = fs.statSync(itemPath);\n      if (itemStat.isDirectory()) {\n        await updateDocsDir(itemPath);\n      }\n    }\n  }\n}\n\nasync function updateGithubCommits(filePath: string) {\n  console.log('update:', filePath);\n\n  const gm = matter.read(filePath);\n\n  const repoPath = path.relative(rootDir, filePath).replace(/\\\\/g, '/');\n  const url = new URL(`https://api.github.com/repos/QwikDev/qwik/commits`);\n  url.searchParams.set('since', new Date('2022-01-01').toISOString());\n  url.searchParams.set('path', repoPath);\n\n  const response = await fetch(url.href, {\n    headers: {\n      'User-Agent': 'Qwik Workshop',\n      'X-GitHub-Api-Version': '2022-11-28',\n      ...(PRIVATE_GITHUB_ACCESS_TOKEN\n        ? {\n            Authorization: 'Bearer ' + PRIVATE_GITHUB_ACCESS_TOKEN,\n          }\n        : {}),\n    },\n  });\n  if (response.status !== 200) {\n    console.log('error', response.status, response.statusText, await response.text());\n    await new Promise((resolve) => setTimeout(resolve, 5000));\n    return;\n  }\n\n  const commits: any = await response.json();\n  if (!Array.isArray(commits)) {\n    console.log('error', JSON.stringify(commits));\n    await new Promise((resolve) => setTimeout(resolve, 5000));\n    return;\n  }\n\n  const contributors: { author: string; count: number }[] = [];\n\n  for (const commit of commits) {\n    const author = commit?.author?.login;\n    if (author) {\n      const contributor = contributors.find((c) => c.author === author);\n      if (contributor) {\n        contributor.count++;\n      } else {\n        contributors.push({ author, count: 1 });\n      }\n    }\n\n    if (commits.indexOf(commit) === 0) {\n      gm.data.updated_at = commit?.commit?.author?.date;\n    }\n\n    if (commits.indexOf(commit) === commits.length - 1) {\n      gm.data.created_at = commit?.commit?.author?.date;\n    }\n  }\n\n  contributors.sort((a, b) => {\n    if (a.count > b.count) {\n      return -1;\n    }\n    if (a.count < b.count) {\n      return 1;\n    }\n    return 0;\n  });\n\n  gm.data.contributors = gm.data.contributors || [];\n  for (const contributor of contributors) {\n    if (!gm.data.contributors.includes(contributor.author)) {\n      gm.data.contributors.push(contributor.author);\n    }\n  }\n\n  const md = matter.stringify(gm.content, gm.data);\n\n  fs.writeFileSync(filePath, md);\n\n  console.log(repoPath, contributors.length);\n\n  if (response.headers.get('x-ratelimit-remaining') === '0') {\n    const resetHeader = response.headers.get('x-ratelimit-reset');\n    const resetTime = resetHeader ? parseInt(resetHeader) * 1000 : Date.now() + 1000;\n    const waitTime = resetTime - Date.now();\n    console.log(\n      `next request is rate limited, waiting ${Math.round(waitTime / 1000 / 60)} minutes`\n    );\n    await new Promise((resolve) => setTimeout(resolve, waitTime));\n  }\n}\n\nupdateContributors();\n"
  },
  {
    "path": "packages/docs/global.d.ts",
    "content": "// handled by raw-source plugin in vite.repl-apps.ts\ndeclare module '*?raw-source' {\n  const url: string;\n  export default url;\n}\n\ndeclare module '*?compiled-string' {\n  const str: string;\n  export default str;\n}\n"
  },
  {
    "path": "packages/docs/package.json",
    "content": "{\n  \"name\": \"qwik-docs\",\n  \"description\": \"Qwik Docs Site\",\n  \"version\": \"0.0.1\",\n  \"author\": \"Builder.io Team\",\n  \"bugs\": \"https://github.com/QwikDev/qwik\",\n  \"devDependencies\": {\n    \"@algolia/autocomplete-core\": \"1.7.4\",\n    \"@algolia/client-search\": \"4.14.3\",\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@builder.io/qwik-city\": \"workspace:^\",\n    \"@builder.io/qwik-labs\": \"workspace:^\",\n    \"@builder.io/qwik-react\": \"workspace:^\",\n    \"@emotion/react\": \"11.14.0\",\n    \"@emotion/styled\": \"11.14.1\",\n    \"@modular-forms/qwik\": \"0.23.1\",\n    \"@mui/material\": \"5.16.4\",\n    \"@mui/system\": \"5.16.4\",\n    \"@mui/x-data-grid\": \"6.20.4\",\n    \"@qwik-ui/headless\": \"0.6.7\",\n    \"@qwik.dev/partytown\": \"0.11.2\",\n    \"@rolldown/browser\": \"1.0.0-beta.42\",\n    \"@shikijs/colorized-brackets\": \"3.12.2\",\n    \"@shikijs/langs\": \"3.12.2\",\n    \"@shikijs/rehype\": \"3.12.2\",\n    \"@shikijs/themes\": \"3.12.2\",\n    \"@shikijs/transformers\": \"3.12.2\",\n    \"@shikijs/types\": \"3.12.2\",\n    \"@supabase/supabase-js\": \"2.53.0\",\n    \"@tailwindcss/vite\": \"4.1.11\",\n    \"@types/leaflet\": \"1.9.20\",\n    \"@types/prismjs\": \"1.26.5\",\n    \"@types/react\": \"18.3.3\",\n    \"@types/react-dom\": \"18.3.0\",\n    \"@unpic/core\": \"0.0.42\",\n    \"@unpic/qwik\": \"0.0.38\",\n    \"algoliasearch\": \"4.16.0\",\n    \"fflate\": \"0.8.2\",\n    \"gray-matter\": \"4.0.3\",\n    \"leaflet\": \"1.9.4\",\n    \"magic-string\": \"0.30.17\",\n    \"openai\": \"3.3.0\",\n    \"prettier\": \"3.6.2\",\n    \"prism-themes\": \"1.9.0\",\n    \"prismjs\": \"1.30.0\",\n    \"playwright\": \"1.58.2\",\n    \"qwik-image\": \"0.0.16\",\n    \"react\": \"18.3.1\",\n    \"react-dom\": \"18.3.1\",\n    \"shiki\": \"3.13.0\",\n    \"snarkdown\": \"2.0.0\",\n    \"tailwindcss\": \"4.1.14\",\n    \"terser\": \"5.44.0\",\n    \"tsm\": \"2.3.0\",\n    \"typescript\": \"5.4.5\",\n    \"undici\": \"*\",\n    \"valibot\": \"1.2.0\",\n    \"vite\": \"7.3.1\",\n    \"vite-plugin-inspect\": \"11.3.3\",\n    \"vite-tsconfig-paths\": \"5.1.4\",\n    \"wrangler\": \"3.114.17\"\n  },\n  \"engines\": {\n    \"node\": \">=18.11\",\n    \"npm\": \"please-use-pnpm\",\n    \"yarn\": \"please-use-pnpm\",\n    \"pnpm\": \">=8.6.12\"\n  },\n  \"homepage\": \"https://qwik.dev/\",\n  \"license\": \"MIT\",\n  \"private\": true,\n  \"scripts\": {\n    \"build\": \"qwik build\",\n    \"build.client\": \"vite build\",\n    \"build.preview\": \"NODE_OPTIONS=--max-old-space-size=8192 vite build --ssr src/entry.preview.tsx\",\n    \"build.repl-sw\": \"vite --config vite.config-repl-sw.mts build\",\n    \"build.server\": \"NODE_OPTIONS=--max-old-space-size=8192 vite build -c adapters/cloudflare-pages/vite.config.mts\",\n    \"build.showcase\": \"node scripts/showcase.ts\",\n    \"codesandbox.sync\": \"node codesandbox.sync.ts\",\n    \"contributors\": \"node contributors.ts\",\n    \"deploy\": \"wrangler pages publish ./dist\",\n    \"dev\": \"node check-qwik-build.ts && vite --mode ssr --open\",\n    \"dev.debug\": \"node --inspect-brk ../../node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"prebuild.core\": \"node check-qwik-build.ts\",\n    \"preview\": \"qwik build preview && vite preview --open\",\n    \"preview.only\": \"NODE_DEBUG=net,http node --inspect-brk ../../node_modules/vite/bin/vite.js preview\",\n    \"preview.wrangler\": \"wrangler pages dev ./dist --compatibility-flags=nodejs_als\",\n    \"start\": \"pnpm dev\"\n  }\n}\n"
  },
  {
    "path": "packages/docs/public/_headers",
    "content": "/*\n  Cache-Control: public, max-age=3600, s-maxage=3600;\n  Cross-Origin-Opener-Policy: same-origin\n  Cross-Origin-Embedder-Policy: require-corp\n\n/assets/*\n  ! Cache-Control\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable;\n\n/build/*\n  ! Cache-Control\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable;\n\n/*.svg\n  ! Cache-Control\n  Cache-Control: public, max-age=86400, s-maxage=86400;\n\n/favicon.ico\n  ! Cache-Control\n  Cache-Control: public, max-age=604800, s-maxage=604800;\n"
  },
  {
    "path": "packages/docs/public/_redirects",
    "content": "# https://developers.cloudflare.com/pages/configuration/redirects/\n\n# Keep in sync with `src/routes/plugin@redirects.ts`\n\n# Discord\n\n/chat https://discord.gg/TsNCMd6uGW 307\n/chat/ https://discord.gg/TsNCMd6uGW 307\n\n# Cute redirects\n\n/examples /examples/introduction/hello-world/ 307\n/examples/ /examples/introduction/hello-world/ 307\n/guide /docs/ 307\n/guide/ /docs/ 307\n/tutorial /tutorial/welcome/overview/ 307\n/tutorial/ /tutorial/welcome/overview/ 307\n/tutorials /tutorial/welcome/overview/ 307\n/tutorials/ /tutorial/welcome/overview/ 307\n\n# Old URLs\n\n/tutorial/hooks/use-client-effect/ /tutorial/hooks/use-visible-task/ 308\n\n/integrations/deployments/azure-swa/ /deployments/azure-swa/ 308\n/integrations/deployments/cloudflare-pages/ /deployments/cloudflare-pages/ 308\n/integrations/deployments/express/ /deployments/express/ 308\n/integrations/deployments/netlify-edge/ /deployments/netlify-edge/ 308\n/integrations/deployments/vercel-edge/ /deployments/vercel-edge/ 308\n\n/qwikcity/advanced/prefetching/ /docs/advanced/modules-prefetching/\n/qwikcity/content/component/ /docs/pages/ 308\n/qwikcity/content/head/ /docs/pages/ 308\n/qwikcity/content/mdx/ /docs/guides/mdx/ 308\n/qwikcity/content/menu/ /docs/advanced/menu/ 308\n/qwikcity/data/endpoints/ /docs/endpoints/ 308\n/qwikcity/data/modify/ /docs/endpoints/ 308\n/qwikcity/data/overview/ /docs/routing/ 308\n/qwikcity/data/redirects/ /docs/guides/redirects/ 308\n/qwikcity/data/retrieve/ /docs/routing/ 308\n/qwikcity/directory-layout/ /docs/project-structure/ 308\n/qwikcity/layout/grouped/ /docs/advanced/routing/ 308\n/qwikcity/layout/named/ /docs/advanced/routing/ 308\n/qwikcity/layout/nested/ /docs/advanced/routing/ 308\n/qwikcity/layout/overview/ /docs/layout/ 308\n/qwikcity/loader/ /docs/route-loader/ 308\n/qwikcity/middleware/azure-swa/ /deployments/azure-swa/ 308\n/qwikcity/middleware/cloudflare-pages/ /deployments/cloudflare-pages/ 308\n/qwikcity/middleware/express/ /deployments/node/ 308\n/qwikcity/middleware/netlify-edge/ /deployments/netlify-edge/ 308\n/qwikcity/middleware/node/ /deployments/node/ 308\n/qwikcity/prefetching/overview/ /docs/advanced/speculative-module-fetching/ 308\n/qwikcity/prefetching/parallelizing-network-requests/ /docs/advanced/speculative-module-fetching/ 308\n/qwikcity/prefetching/request-response-cache/ /docs/advanced/speculative-module-fetching/ 308\n/qwikcity/prefetching/service-worker-prefetching/ /docs/advanced/speculative-module-fetching/ 308\n/qwikcity/routing/error-responses/ /docs/advanced/routing/ 308\n/qwikcity/routing/overview/ /docs/routing/ 308\n/qwikcity/routing/pathless/ /docs/layout/grouped/ 308\n/qwikcity/routing/route-parameters/ /docs/routing/ 308\n/qwikcity/static-assets/ /docs/advanced/static-assets/ 308\n/qwikcity/static-site-generation/dynamic-routes/ /docs/guides/static-site-generation/ 308\n/qwikcity/static-site-generation/overview/ /docs/guides/static-site-generation/ 308\n/qwikcity/static-site-generation/static-site-config/ /docs/guides/static-site-generation/ 308\n\n/docs/advanced/i18n/ /docs/integrations/i18n/ 308\n/docs/cheat/best-practices/ /docs/guides/best-practices/ 308\n/docs/cheat/qwik-react/ /docs/integrations/react/ 308\n/docs/cheat/serialization/ /docs/guides/serialization/ 308\n/docs/components/inline-components/ /docs/core/overview/ 308\n/docs/components/lifecycle/ /docs/core/tasks/ 308\n/docs/components/projection/ /docs/core/slots/ 308\n/docs/components/resource/ /docs/core/state/ 308\n/docs/cookbook/re-exporting-loaders/ /docs/re-exporting-loaders/ 308\n/docs/env-variables/ /docs/guides/env-variables/ 308\n/docs/overview /docs/ 308\n/docs/overview/ /docs/ 308\n/docs/think-qwik/ /docs/concepts/think-qwik/ 308\n\n# All wildcards (and only wildcards) must be below here\n\n/deployments/_ /docs/deployments/:splat 308\n/docs/components/_ /docs/core/:splat 308\n/integrations/_ /docs/integrations/:splat 308\n/qwikcity/_ /docs/:splat 308\n"
  },
  {
    "path": "packages/docs/public/_routes.json",
    "content": "{\n  \"version\": 1,\n  \"include\": [\"/*\"],\n  \"exclude\": [\n    \"/chat\",\n    \"/examples\",\n    \"/guide\",\n    \"/tutorial\",\n    \"/tutorials\",\n    \"/tutorial/hooks/use-client-effect/\",\n    \"/docs/overview/\",\n    \"/docs/cheat/qwik-react/\",\n    \"/docs/cheat/best-practices/\",\n    \"/docs/cheat/serialization/\",\n    \"/docs/core/lifecycle/\",\n    \"/docs/core/projection/\",\n    \"/docs/core/resource/\",\n    \"/qwikcity/*\",\n    \"/integrations/*\",\n    \"/deployments/*\",\n    \"/repl/*\"\n  ]\n}\n"
  },
  {
    "path": "packages/docs/public/builder/high.js",
    "content": "import{useLexicalScope}from\"./qwik-0.100.0.js\";export const Component856B004403F841C789CF61F2A180C93F_onClick_0=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft -= interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const Component856B004403F841C789CF61F2A180C93F_onClick_1=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft += interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const Component856B004403F841C789CF61F2A180C93F_onClick_2=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft -= interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const Component856B004403F841C789CF61F2A180C93F_onClick_3=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft += interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const __proxyMerge__=function __proxyMerge__(state,local){return new Proxy(state,{get:function(obj,prop){if(local && prop in local){return local[prop];}else{return state[prop];}},set:function(obj,prop,value){obj[prop] = value;return true;},});};export const Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_0=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft -= interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_1=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft += interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_2=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft -= interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_3=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { let interactiveScroller = document.querySelector(`#row${state.rowNumber}`);\ninteractiveScroller.scrollLeft += interactiveScroller.children[1].clientWidth;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0=(event)=>{const [s,l]=useLexicalScope();const state=__proxyMerge__(s,l);;\n    try { return state.slide = state.$index;\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };export const ComponentB417246B77124735ADE3A2694CB86BF9_onClick_0=(event)=>{\n    try { navigator.clipboard.writeText(`npm create qwik@latest`);\nevent.target.innerText = \"Copied to Clipboard\";\nsetTimeout(() => (event.target.innerText = \"npm create qwik@latest\"), 2000);\n }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n };"
  },
  {
    "path": "packages/docs/public/builder/med.js",
    "content": "import{componentQrl,h,qrl,useStore,useStylesQrl}from\"./qwik-0.100.0.js\";export const Component856B004403F841C789CF61F2A180C93FUsrStyles=\".builder-heading-1{font-size:2em;margin:.67em 0}.builder-heading-2{font-size:1.5em;margin:.75em 0}.builder-heading-3{font-size:1.17em;margin:.83em 0}.builder-heading-4,.builder-paragraph{margin:1.12em 0}.builder-heading-5{font-size:.83em;margin:1.5em 0}.builder-heading-6{font-size:.75em;margin:1.67em 0}.builder-heading-1,.builder-heading-2,.builder-heading-3,.builder-heading-4,.builder-heading-5,.builder-heading-6{font-weight:bolder}\\r\\n\\r\\n.interactive-scroller::-webkit-scrollbar {\\r\\n    display: none;\\r\\n  }\\r\\n\\r\\n\\r\\n .interactive-scroller {\\r\\n    -ms-overflow-style: none; \\r\\n    scrollbar-width: none; \\r\\n  }\\r\\n\\r\\n.information:hover{\\r\\n  opacity: 1;\\r\\n}\";export const Component856B004403F841C789CF61F2A180C93FOnMount=(p)=>{const s=useStore(()=>{const state=Object.assign({},structuredClone(typeof __STATE__===\"object\"&&__STATE__[p.serverStateId]),p);if(!state.hasOwnProperty(\"featuredContent\"))state.featuredContent=[{\"contentName\":\"Everlane\",\"contentType\":\"Podcast\",\"image\":\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2F329d8065fc13497e8588c3f03df1f49a\",\"link\":\"https://www.everlane.com/\"},{\"contentName\":\"Everlane\",\"contentType\":\"Podcast\",\"image\":\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2F329d8065fc13497e8588c3f03df1f49a\",\"link\":\"https://www.everlane.com/\"}];if(!state.hasOwnProperty(\"alignLeft\"))state.alignLeft=false;if(!state.hasOwnProperty(\"rowNumber\"))state.rowNumber=2;return state},{deep:true});const l={};const state=__proxyMerge__(s,l);useStylesQrl(qrl(\"./med.js\",\"Component856B004403F841C789CF61F2A180C93FUsrStyles\",[]));return (h(\"div\",{\"builder-id\":\"builder-45671151128e43d78d14606f5a7431f8\",class:\"catfy1 builder-block builder-block\"},h(\"div\",{\"builder-id\":\"builder-b13168e2732e4349aed054a738692035\",class:\"c3v64af\"},h(\"div\",{\"builder-id\":\"builder-0f809d92d25c4b3788cdf422e90a132b\",class:\"cv1pw7l\",\"onClick$\":qrl(\"./high.js\",\"Component856B004403F841C789CF61F2A180C93F_onClick_2\",[s,l])},h(Image,{\"builder-id\":\"builder-a3f50e2b423e42e985c5be47952135f1\",image:\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe4d535b208c844419f26d057e5490ab5\",backgroundSize:\"contain\",backgroundPosition:\"center\",class:\"clcdmxz\",lazy:false,fitContent:true,aspectRatio:1.667,lockAspectRatio:false,height:10,width:6,noWebp:true,srcsetSizes:10})),h(\"div\",{\"builder-id\":\"builder-6aedcf97961b4615b7bc68b29598f195\",class:\"cv1pw7l\",\"onClick$\":qrl(\"./high.js\",\"Component856B004403F841C789CF61F2A180C93F_onClick_3\",[s,l])},h(Image,{\"builder-id\":\"builder-b2523b0552dc47edbdea69b80cfe0014\",image:\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fa4604a3d47ab49cf9e4fc3772c0b62cb\",backgroundSize:\"contain\",backgroundPosition:\"center\",class:\"cm0gcj3\",lazy:false,fitContent:true,aspectRatio:1.667,lockAspectRatio:false,height:10,width:6,noWebp:true,srcsetSizes:10}))),h(\"div\",{\"builder-id\":\"builder-d08c40a189e84d06bcadb5d1d1edc591\",class:\"chye5ds\",\"onClick$\":qrl(\"./high.js\",\"Component856B004403F841C789CF61F2A180C93F_onClick_2\",[s,l])}),h(\"div\",{\"builder-id\":\"builder-509a829a989f4b9ba8bfeb9dd30b636a\",class:\"cglm7wr\",\"onClick$\":qrl(\"./high.js\",\"Component856B004403F841C789CF61F2A180C93F_onClick_3\",[s,l])}),h(\"div\",{class:\"cbmbzxo interactive-scroller\",\"builder-id\":\"builder-e6e1c8dee32744168f120bfd819ca70b\",id:`row${state.rowNumber}`,style:{ direction: (() => {\n    try { return state.alignLeft ? \"rtl\" : \"ltr\"; }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })(), }},h(\"div\",{\"builder-id\":\"builder-69bfb475c69f41c8b28806fa18916638\",class:\"cxiz55v\"}),(state.featuredContent||[]).map(((function(item,$index){const l={...this,featuredContentItem:item==null?{}:item,item:item,$index:$index};const state = __proxyMerge__(s,l);return(h(\"a\",{class:\"c9sroqn card\",\"builder-id\":\"builder-cd2dc332bf7c48b0a0fe6b5d8da7e2b7\",href:state.featuredContentItem.link},h(\"div\",{\"builder-id\":\"builder-434b5a960093412c91e3ba1524b28f14\",class:\"ci29ryq\"},h(Image,{\"builder-id\":\"builder-f418cf4ab5634ff68b1e1b04138875bd\",backgroundSize:\"cover\",backgroundPosition:\"top\",sizes:\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\",class:\"cajg5b6\",image:state.featuredContentItem.image,lazy:false,fitContent:true,aspectRatio:0.65,lockAspectRatio:true},h(\"div\",{\"builder-id\":\"builder-bc0f7c1bdf3340c287358088b0c1cd21\",class:\"c43zgy5\"}))),h(\"div\",{\"builder-id\":\"builder-6524c56f898147e8a0c03e8c013be2cc\",class:\"cpdwgtw\"},h(Image,{\"builder-id\":\"builder-b6abdb76b555490d81464c154a2d428a\",image:\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=30\",backgroundSize:\"cover\",backgroundPosition:\"center\",srcset:\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=100 100w, https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=200 200w, https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=400 400w, https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=800 800w, https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe2c98593b27343b0bf7b1e436769b80d?width=30 30w\",sizes:\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\",class:\"crhhdt\",lazy:false,fitContent:true,aspectRatio:1,lockAspectRatio:false,noWebp:true,height:20,width:20,srcsetSizes:30}),h(\"div\",{\"block-id\":\"builder-fbd2b04538384fbd830f83e198c0cde8\",class:\"cif4mvp\"},h(\"div\",{key:\"builder-b6abdb76b555490d81464c154a2d428a\",class:\"builder-text\",dangerouslySetInnerHTML:(() => {\n    try { var _virtual_index=state.featuredContentItem.contentType;return _virtual_index }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })()}))),h(\"div\",{\"block-id\":\"builder-73e7eef09de1471c89897b26d4edf1e1\",class:\"clabz1x\"},h(\"div\",{key:\"builder-6524c56f898147e8a0c03e8c013be2cc\",class:\"builder-text\",dangerouslySetInnerHTML:(() => {\n    try { var _virtual_index=state.featuredContentItem.contentName;return _virtual_index }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })()}))));}).bind(l))),h(\"div\",{\"builder-id\":\"builder-a1c14943c90244c7b2a32cad19e86a1c\",class:\"c38x0cp\"}))));;};export const Component856B004403F841C789CF61F2A180C93F=componentQrl(qrl(\"./med.js\",\"Component856B004403F841C789CF61F2A180C93FOnMount\",[]));export const Image=function Image(props){var _a;var jsx = props.children || [];var image = props.image;if(image){var isBuilderIoImage = !!(image || '').match(/\\.builder\\.io/)&& !props.noWebp;var isPixel =(_a = props.builderBlock)=== null || _a === void 0 ? void 0:_a.id.startsWith('builder-pixel-');var imgProps ={src:props.image,style:\"object-fit:\".concat(props.backgroundSize || 'cover',\";object-position:\").concat(props.backgroundPosition || 'center',\";\")+(props.aspectRatio ? 'position:absolute;height:100%;width:100%;top:0;left:0':''),sizes:props.sizes,alt:props.altText,role:!props.altText ? 'presentation':undefined,loading:isPixel ? 'eager':'lazy',srcset:undefined,};var qwikBugWorkaround = function(imgProps){return Object.keys(imgProps).forEach(function(k){return imgProps[k] === undefined && delete imgProps[k];});};qwikBugWorkaround(imgProps);if(isBuilderIoImage){var webpImage_1 = updateQueryParam(image,'format','webp');var srcset = ['100','200','400','800','1200','1600','2000'] .concat(props.srcsetSizes ? String(props.srcsetSizes).split(' '):[]).map(function(size){return updateQueryParam(webpImage_1,'width',size)+ ' ' + size + 'w';}).concat(tryAppendWidth(image)).join(',');imgProps.srcset = srcset;jsx = jsx = [ h('picture',{},[ h('source',{type:'image/webp',srcset:srcset}),h('img',imgProps,jsx),]),];}else{jsx = [h('img',imgProps,jsx)];}if(props.aspectRatio && !(props.fitContent && props.children && props.children.length)){var sizingDiv = h('div',{class:'builder-image-sizer',style:\"width:100%;padding-top:\".concat((props.aspectRatio || 1)* 100,\"%;pointer-events:none;font-size:0\"),});jsx.push(sizingDiv);}}var children = props.children ? [jsx].concat(props.children):[jsx];return h(props.href ? 'a':'div',__passThroughProps__({href:props.href,class:props.class},props),children);function updateQueryParam(uri,key,value){if(uri === void 0){uri = '';}var re = new RegExp('([?&])' + key + '=.*?(&|$)','i');var separator = uri.indexOf('?')!==-1 ? '&':'?';if(uri.match(re)){return uri.replace(re,'$1' + key + '=' + encodeURIComponent(value)+ '$2');}return uri + separator + key + '=' + encodeURIComponent(value);}function tryAppendWidth(url){var match = url.match(/[?&]width=(\\d+)/);var width = match && match[1];if(width){return [url + ' ' + width + 'w'];}return [];}};export const __passThroughProps__=function __passThroughProps__(dstProps,srcProps){for(var key in srcProps){if(Object.prototype.hasOwnProperty.call(srcProps,key)&&((key.startsWith('on')&& key.endsWith('$'))|| key == 'style')){dstProps[key] = srcProps[key];}}return dstProps;};export const __proxyMerge__=function __proxyMerge__(state,local){return new Proxy(state,{get:function(obj,prop){if(local && prop in local){return local[prop];}else{return state[prop];}},set:function(obj,prop,value){obj[prop] = value;return true;},});};export const Component2CB3CABC3EE84F0E987EB4525859E0A8UsrStyles=\".builder-heading-1{font-size:2em;margin:.67em 0}.builder-heading-2{font-size:1.5em;margin:.75em 0}.builder-heading-3{font-size:1.17em;margin:.83em 0}.builder-heading-4,.builder-paragraph{margin:1.12em 0}.builder-heading-5{font-size:.83em;margin:1.5em 0}.builder-heading-6{font-size:.75em;margin:1.67em 0}.builder-heading-1,.builder-heading-2,.builder-heading-3,.builder-heading-4,.builder-heading-5,.builder-heading-6{font-weight:bolder}\\r\\n\\r\\n.interactive-scroller::-webkit-scrollbar {\\r\\n    display: none;\\r\\n  }\\r\\n\\r\\n\\r\\n .interactive-scroller {\\r\\n    -ms-overflow-style: none; \\r\\n    scrollbar-width: none; \\r\\n  }\\r\\n\\r\\n.information:hover{\\r\\n  opacity: 1;\\r\\n}\";export const Component2CB3CABC3EE84F0E987EB4525859E0A8OnMount=(p)=>{const s=useStore(()=>{const state=Object.assign({},structuredClone(typeof __STATE__===\"object\"&&__STATE__[p.serverStateId]),p);if(!state.hasOwnProperty(\"featuredSites\"))state.featuredSites=[{\"image\":\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F4535a6d82a904eb28d6f4f6213624dea\",\"link\":\"https://www.everlane.com/\",\"performanceScore\":85,\"siteName\":\"Everlane\",\"strokeSize\":102},{\"image\":\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F4535a6d82a904eb28d6f4f6213624dea\",\"link\":\"https://www.everlane.com/\",\"performanceScore\":85,\"siteName\":\"Everlane\",\"strokeSize\":102}];if(!state.hasOwnProperty(\"alignLeft\"))state.alignLeft=false;if(!state.hasOwnProperty(\"rowNumber\"))state.rowNumber=1;return state},{deep:true});const l={};const state=__proxyMerge__(s,l);useStylesQrl(qrl(\"./med.js\",\"Component2CB3CABC3EE84F0E987EB4525859E0A8UsrStyles\",[]));return (h(\"div\",{\"builder-id\":\"builder-8e224839632741c5919cfaaf15cdc079\",class:\"catfy1 builder-block builder-block\"},h(\"div\",{\"builder-id\":\"builder-c4db49fe9a74445ab23b6a211885b11e\",class:\"cppa4w7\"},h(\"div\",{\"builder-id\":\"builder-38fcde6fe1114b8e9618d60d40ae2490\",class:\"cv1pw7l\",\"onClick$\":qrl(\"./high.js\",\"Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_2\",[s,l])},h(Image,{\"builder-id\":\"builder-f59da0468cf945998527ab893b3e1de6\",image:\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fe4d535b208c844419f26d057e5490ab5\",backgroundSize:\"contain\",backgroundPosition:\"center\",class:\"clcdmxz\",lazy:false,fitContent:true,aspectRatio:1.667,lockAspectRatio:false,height:10,width:6,noWebp:true,srcsetSizes:10})),h(\"div\",{\"builder-id\":\"builder-6b145e3999c341d3962098b376f51727\",class:\"cv1pw7l\",\"onClick$\":qrl(\"./high.js\",\"Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_3\",[s,l])},h(Image,{\"builder-id\":\"builder-2996aad19c034a9dae5446beb7d1f79f\",image:\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2Fa4604a3d47ab49cf9e4fc3772c0b62cb\",backgroundSize:\"contain\",backgroundPosition:\"center\",class:\"cm0gcj3\",lazy:false,fitContent:true,aspectRatio:1.667,lockAspectRatio:false,height:10,width:6,noWebp:true,srcsetSizes:10}))),h(\"div\",{\"builder-id\":\"builder-39a6a3f528fd4c64bdca447182899c81\",class:\"c8kb54b\",\"onClick$\":qrl(\"./high.js\",\"Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_2\",[s,l])}),h(\"div\",{\"builder-id\":\"builder-15d7f28001fd4178b7bb2f7a1531bf4c\",class:\"c3bwmck\",\"onClick$\":qrl(\"./high.js\",\"Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_3\",[s,l])}),h(\"div\",{class:\"clwho8x interactive-scroller\",\"builder-id\":\"builder-7ad645f14d364801b23b11b72470de6d\",id:`row${state.rowNumber}`,style:{ direction: (() => {\n    try { return state.alignLeft ? \"rtl\" : \"ltr\"; }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })(), }},h(\"div\",{\"builder-id\":\"builder-a2335740a3434f5d89136198c2ab6eae\",class:\"c3y3i5e\"}),(state.featuredSites||[]).map(((function(item,$index){const l={...this,featuredSitesItem:item==null?{}:item,item:item,$index:$index};const state = __proxyMerge__(s,l);return(h(\"a\",{class:\"cy3wjif card\",\"builder-id\":\"builder-3390809a33c64d3890bac879bdf3baf4\",href:state.featuredSitesItem?.link},h(\"div\",{\"builder-id\":\"builder-39a191d8723c4a94bb76f7aef6951ed5\",class:\"cxw2f6r\"},h(\"div\",{\"builder-id\":\"builder-55465aface484326b81ac8985f83dc49\",class:\"clzvnrc\",scriptsClientOnly:true,style:{ strokeDasharray: (() => {\n    try { return `${state.featuredSitesItem.strokeSize}, 1000`; }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })(), }},h(\"div\",{key:\"builder-55465aface484326b81ac8985f83dc49\",dangerouslySetInnerHTML:\"<svg viewbox=\\\"0 0 120 120\\\">\\n  <defs>\\n    <linearGradient id=\\\"gradient\\\">\\n      <stop id=\\\"stop1\\\" offset=\\\"0%\\\" stop-color=\\\"#18B6F6\\\" />\\n      <stop id=\\\"stop2\\\" offset=\\\"100%\\\" stop-color=\\\"#ac7ef4\\\" />\\n    </linearGradient>\\n  </defs>\\n\\n  <circle\\n    id=\\\"circle\\\"\\n    r=\\\"51\\\"\\n    cx=\\\"60\\\"\\n    cy=\\\"60\\\"\\n    stroke-width=\\\"14\\\"\\n    stroke=\\\"url('#gradient')\\\"\\n    fill=\\\"black\\\"\\n    class=\\\"circle-2\\\"\\n    style=\\\"stroke-linecap: round\\\"\\n  ></circle>\\n</svg>\\n\"})),h(\"div\",{\"block-id\":\"builder-5386a2819ec045b3b16859b743d4e0e2\",class:\"cy8hub5\"},h(\"div\",{key:\"builder-55465aface484326b81ac8985f83dc49\",class:\"builder-text\",dangerouslySetInnerHTML:(() => {\n    try { var _virtual_index=\"\".concat(state.featuredSitesItem.performanceScore,\"%\");return _virtual_index }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })()}))),h(Image,{\"builder-id\":\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\",backgroundSize:\"cover\",backgroundPosition:\"top\",sizes:\"(max-width: 638px) 48vw, (max-width: 998px) 66vw, 47vw\",class:\"c6307wf\",image:state.featuredSitesItem.image,lazy:false,fitContent:true,aspectRatio:0.65,lockAspectRatio:true}),h(\"div\",{\"block-id\":\"builder-74208b0179934788841c25658732c9be\",class:\"cxyrqhw\"},h(\"div\",{key:\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\",class:\"builder-text\",dangerouslySetInnerHTML:(() => {\n    try { var _virtual_index=state.featuredSitesItem.siteName;return _virtual_index }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })()}))));}).bind(l))),h(\"div\",{\"builder-id\":\"builder-762c787964de408b9d7dccc3d53f3c0c\",class:\"c38x0cp\"}))));;};export const Component2CB3CABC3EE84F0E987EB4525859E0A8=componentQrl(qrl(\"./med.js\",\"Component2CB3CABC3EE84F0E987EB4525859E0A8OnMount\",[]));export const Component3C0255D6D2D94E3390539DEE6AF8C7C0UsrStyles=\"/*\\n* Custom CSS styles\\n*\\n* Global by default, but use `&` to scope to just this content, e.g.\\n*\\n*   & .foo {\\n*     color: 'red'\\n*   }\\n*/\\n.feature-name >.builder-text{\\n    transition: color .3s cubic-bezier(.37,.01,0,.98);\\n}\\n\\n.feature-name >.builder-text:hover{\\n    color: rgba(230, 230, 230, 1)\\n}\";export const Component3C0255D6D2D94E3390539DEE6AF8C7C0OnMount=(p)=>{const s=useStore(()=>{const state=Object.assign({},structuredClone(typeof __STATE__===\"object\"&&__STATE__[p.serverStateId]),p);if(!state.hasOwnProperty(\"features\"))state.features=[{\"description\":\"Qwik does not do hydration because it is resumable. Hydration can take several seconds, depending on the complexity of your application and mobile device speed.\",\"featureLink\":\"https://qwik.builder.io/docs/\",\"image\":\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2F0e27d4f4dba042a998f88b4ac4a49189\",\"name\":\"Zero Loading\"},{\"description\":\"Qwik does not do hydration because it is resumable. Hydration can take several seconds, depending on the complexity of your application and mobile device speed.\",\"featureLink\":\"https://qwik.builder.io/docs/\",\"image\":\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2F0e27d4f4dba042a998f88b4ac4a49189\",\"name\":\"Zero Loading\"},{\"description\":\"Qwik does not do hydration because it is resumable. Hydration can take several seconds, depending on the complexity of your application and mobile device speed.\",\"featureLink\":\"https://qwik.builder.io/docs/\",\"image\":\"https://cdn.builder.io/api/v1/image/assets%2Ffe30f73e01ef40558cd69a9493eba2a2%2F0e27d4f4dba042a998f88b4ac4a49189\",\"name\":\"Zero Loading\"}];if(!state.hasOwnProperty(\"slide\"))state.slide=0;var __awaiter = function (e, n, t, r) {\n  return new (t || (t = Promise))(function (o, i) {\n    function a(e) {\n      try {\n        l(r.next(e));\n      } catch (e) {\n        i(e);\n      }\n    }\n\n    function u(e) {\n      try {\n        l(r.throw(e));\n      } catch (e) {\n        i(e);\n      }\n    }\n\n    function l(e) {\n      var n;\n      e.done ? o(e.value) : (n = e.value, n instanceof t ? n : new t(function (e) {\n        e(n);\n      })).then(a, u);\n    }\n\n    l((r = r.apply(e, n || [])).next());\n  });\n},\n    __generator = function (e, n) {\n  var t,\n      r,\n      o,\n      i,\n      a = {\n    label: 0,\n    sent: function () {\n      if (1 & o[0]) throw o[1];\n      return o[1];\n    },\n    trys: [],\n    ops: []\n  };\n  return i = {\n    next: u(0),\n    throw: u(1),\n    return: u(2)\n  }, \"function\" == typeof Symbol && (i[Symbol.iterator] = function () {\n    return this;\n  }), i;\n\n  function u(i) {\n    return function (u) {\n      return function (i) {\n        if (t) throw new TypeError(\"Generator is already executing.\");\n\n        for (; a;) try {\n          if (t = 1, r && (o = 2 & i[0] ? r.return : i[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) && !(o = o.call(r, i[1])).done) return o;\n\n          switch (r = 0, o && (i = [2 & i[0], o.value]), i[0]) {\n            case 0:\n            case 1:\n              o = i;\n              break;\n\n            case 4:\n              return a.label++, {\n                value: i[1],\n                done: !1\n              };\n\n            case 5:\n              a.label++, r = i[1], i = [0];\n              continue;\n\n            case 7:\n              i = a.ops.pop(), a.trys.pop();\n              continue;\n\n            default:\n              if (!(o = (o = a.trys).length > 0 && o[o.length - 1]) && (6 === i[0] || 2 === i[0])) {\n                a = 0;\n                continue;\n              }\n\n              if (3 === i[0] && (!o || i[1] > o[0] && i[1] < o[3])) {\n                a.label = i[1];\n                break;\n              }\n\n              if (6 === i[0] && a.label < o[1]) {\n                a.label = o[1], o = i;\n                break;\n              }\n\n              if (o && a.label < o[2]) {\n                a.label = o[2], a.ops.push(i);\n                break;\n              }\n\n              o[2] && a.ops.pop(), a.trys.pop();\n              continue;\n          }\n\n          i = n.call(e, a);\n        } catch (e) {\n          i = [6, e], r = 0;\n        } finally {\n          t = o = 0;\n        }\n\n        if (5 & i[0]) throw i[1];\n        return {\n          value: i[0] ? i[1] : void 0,\n          done: !0\n        };\n      }([i, u]);\n    };\n  }\n};\n\nfunction main() {\n  return __awaiter(this, void 0, void 0, function () {\n    return __generator(this, function (e) {\n      return Builder.isServer, Builder.isBrowser, [2];\n    });\n  });\n}\n\nvar _virtual_index = main();\n\n_virtual_index;;return state},{deep:true});const l={};const state=__proxyMerge__(s,l);useStylesQrl(qrl(\"./med.js\",\"Component3C0255D6D2D94E3390539DEE6AF8C7C0UsrStyles\",[]));return (h(\"div\",{\"builder-id\":\"builder-02050f46e326400ebb9a4b00e2f2eba6\",class:\"cxdh6gf builder-block builder-block\"},h(\"div\",{class:\"cgit9t0 builder-columns\"},h(\"div\",{class:\"civv4i9 builder-column\"},h(\"div\",{\"builder-id\":\"builder-ac19fef77ab34a509f18eeef6a955a36\",class:\"cjjpbna\"},(state.features||[]).map(((function(item,$index){const l={...this,featuresItem:item==null?{}:item,item:item,$index:$index};const state = __proxyMerge__(s,l);return(h(\"div\",{\"block-id\":\"builder-fe2cecd761254557b53b153193064f55\",class:\"cxmqbja feature-name\",\"onClick$\":qrl(\"./high.js\",\"Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0\",[s,l]),style:{ color: (() => {\n    try { return state.slide == state.$index ? 'rgba(24, 182, 246, 1)' : 'rgba(230, 230, 230, 0.16)'; }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })(), borderColor: (() => {\n    try { return state.slide == state.$index ? 'rgba(24, 182, 246, 1)' : 'rgba(230, 230, 230, 0.16)'; }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })(), }},h(\"div\",{key:\"default\",class:\"builder-text\",dangerouslySetInnerHTML:(() => {\n    try { var _virtual_index=state.featuresItem.name;return _virtual_index }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })()})));}).bind(l))))),h(\"div\",{class:\"cbe2pk1 builder-column\"},(state.features||[]).map(((function(item,$index){const l={...this,featuresItem:item==null?{}:item,item:item,$index:$index};const state = __proxyMerge__(s,l);return(state.$index == state.slide?h(\"div\",{\"builder-id\":\"builder-44c171f2c3764cada15b54d18a47c501\",class:\"cq489v6\"},h(Image,{\"builder-id\":\"builder-c0502681a93a4d7fb4b5461e4d7393c9\",backgroundSize:\"contain\",backgroundPosition:\"left\",class:\"c826kto\",image:state.featuresItem.image,lazy:false,fitContent:true,aspectRatio:0.55,lockAspectRatio:false,height:1500,width:1436,srcsetSizes:500}),h(\"div\",{\"builder-id\":\"builder-61da2fffb36949d58595300bf5d2f8bc\",class:\"c89a57i\"},h(\"div\",{\"builder-id\":\"builder-8fb3503ec1f94d04b75bc31489227f03\",class:\"cqwe493\"},h(\"div\",{\"block-id\":\"builder-44477e90706141afb8d57da3a6cd8b95\",class:\"ccj5ok3\"},h(\"div\",{key:\"builder-8fb3503ec1f94d04b75bc31489227f03\",class:\"builder-text\",dangerouslySetInnerHTML:(() => {\n    try { var _virtual_index=state.featuresItem.description;return _virtual_index }\n    catch (err) {\n      console.warn('Builder code error', err);\n    }\n  })()})),h(CoreButton,{\"builder-id\":\"builder-8717ff5be6f842a5800435f50ae94933\",text:\"Learn More\",class:\"cimr38a\",link:state.featuresItem.featureLink,openLinkInNewTab:false})))):null);}).bind(l)))))));;};export const Component3C0255D6D2D94E3390539DEE6AF8C7C0=componentQrl(qrl(\"./med.js\",\"Component3C0255D6D2D94E3390539DEE6AF8C7C0OnMount\",[]));export const CoreButton=function CoreButton(props){var hasLink = !!props.link;var hProps ={dangerouslySetInnerHTML:props.text || '',href:props.link,target:props.openInNewTab ? '_blank':'_self',class:props.class,};return h(hasLink ? 'a':props.tagName$ || 'span',__passThroughProps__(hProps,props));};export const ComponentB417246B77124735ADE3A2694CB86BF9=componentQrl(qrl(\"./low.js\",\"ComponentB417246B77124735ADE3A2694CB86BF9OnMount\",[]));export const ComponentLAZY_97A3DDC814674F85B6EF0D82DC2B6EB1=componentQrl(qrl(\"./low.js\",\"ComponentLAZY_97A3DDC814674F85B6EF0D82DC2B6EB1OnMount\",[]));export const Component97A3DDC814674F85B6EF0D82DC2B6EB1=componentQrl(qrl(\"./low.js\",\"Component97A3DDC814674F85B6EF0D82DC2B6EB1OnMount\",[]));"
  },
  {
    "path": "packages/docs/public/builder/qwik-0.100.0.js",
    "content": "/**\n * @license\n * @builder.io/qwik 0.100.0\n * Copyright Builder.io, Inc. All Rights Reserved.\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE\n */\nconst e=e=>function(t,...n){return e.call(null,Hi(t),...n)},t=!1,n=e=>{t&&Object.seal(e)},o=e=>e&&\"number\"==typeof e.nodeType,r=e=>e&&9===e.nodeType,s=e=>1===e.nodeType,i=e=>1===e.nodeType||111===e.nodeType,c=e=>{const t=e.nodeType;return 1===t||111===t||3===t},l=e=>111===e.nodeType,u=e=>3===e.nodeType,a=e=>8===e.nodeType;function f(e){if(t&&!i(e))throw console.error(\"Not a Qwik Element, got\",e),new Error(\"Not a Qwik Element\")}function d(e){if(t&&!s(e))throw console.error(\"Not a Element, got\",e),new Error(\"Not an Element\")}const h=t?\"background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;\":\"\",p=(e,...t)=>{const n=e instanceof Error?e:m(e),o=n.stack||n.message;return console.error(\"%cQWIK ERROR\",h,o,...g(t)),n},m=e=>new Error(e),$=(e,...t)=>p(e,...t),b=/*@__PURE__*/new Set,v=(e,...n)=>{if(t){const t=\"warn\"+String(e);b.has(t)||(b.add(t),w(e,...n))}},w=(e,...n)=>{t&&console.warn(\"%cQWIK WARN\",h,e,...g(n))},y=(e,...n)=>{t&&console.debug(\"%cQWIK\",h,e,...g(n))},g=e=>t?e.map((e=>o(e)&&s(e)?S(e):e)):e,S=e=>{const t=e._qc_,n=/*#__PURE__*/(()=>\"undefined\"!=typeof process&&!!process.versions&&!!process.versions.node)();return{tagName:e.tagName,renderQRL:t?.t?.getSymbol(),element:n?void 0:e,ctx:n?void 0:t}},x=(e,...t)=>{const n=k(e);return $(n,...t)},k=e=>t?`Code(${e}): ${[\"Error while serializing class attribute\",\"Can not serialize a HTML Node that is not an Element\",\"Runtime but no instance found on element.\",\"Only primitive and object literals can be serialized\",\"Crash while rendering\",\"You can render over a existing q:container. Skipping render().\",\"Set property\",\"Only function's and 'string's are supported.\",\"Only objects can be wrapped in 'QObject'\",\"Only objects literals can be wrapped in 'QObject'\",\"QRL is not a function\",\"Dynamic import not found\",\"Unknown type argument\",\"Actual value for useContext() can not be found, make sure some ancestor component has set a value using useContextProvider()\",\"Invoking 'use*()' method outside of invocation context.\",\"Cant access renderCtx for existing context\",\"Cant access document for existing context\",\"props are immutable\",\"<div> component can only be used at the root of a Qwik component$()\",\"Props are immutable by default.\",\"Calling a 'use*()' method outside 'component$(() => { HERE })' is not allowed. 'use*()' methods provide hooks to the 'component$' state and lifecycle, ie 'use' hooks can only be called synchronously within the 'component$' function or another 'use' method.\\nFor more information see: https://qwik.builder.io/docs/core/tasks/#use-method-rules\",\"Container is already paused. Skipping\",'Components using useServerMount() can only be mounted in the server, if you need your component to be mounted in the client, use \"useMount$()\" instead',\"When rendering directly on top of Document, the root node must be a <html>\",\"A <html> node must have 2 children. The first one <head> and the second one a <body>\",\"Invalid JSXNode type. It must be either a function or a string. Found:\",\"Tracking value changes can only be done to useStore() objects and component props\",\"Missing Object ID for captured object\",\"The provided Context reference is not a valid context created by createContextId()\",\"<html> is the root container, it can not be rendered inside a component\",\"QRLs can not be resolved because it does not have an attached container. This means that the QRL does not know where it belongs inside the DOM, so it cant dynamically import() from a relative path.\",\"QRLs can not be dynamically resolved, because it does not have a chunk path\",\"The JSX ref attribute must be a Signal\"][e]??\"\"}`:`Code(${e})`,q=e=>{const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},j=e=>e&&\"object\"==typeof e,C=e=>Array.isArray(e),O=e=>\"string\"==typeof e,T=e=>\"function\"==typeof e,E=()=>({isServer:!1,importSymbol(e,t,n){if(!t)throw x(31,n);if(!e)throw x(30,t,n);const o=P(e.ownerDocument,e,t).toString(),r=new URL(o);r.hash=\"\",r.search=\"\";const s=r.href;return import(s).then((e=>M(e,n)))},raf:e=>new Promise((t=>{requestAnimationFrame((()=>{t(e())}))})),nextTick:e=>new Promise((t=>{setTimeout((()=>{t(e())}))})),chunkForSymbol:(e,t)=>[e,t??\"_\"]}),M=(e,t)=>{if(t in e)return e[t];for(const n of Object.values(e))if(j(n)&&t in n)return n[t]},P=(e,t,n)=>{const o=e.baseURI,r=new URL(t.getAttribute(\"q:base\")??o,o);return new URL(n,r)};let L=/* @__PURE__ */E();const I=e=>L=e,R=()=>L;function N(e,n,...o){if(t){if(null!=e)return;throw $(n,...o)}}function z(e,n,o,...r){if(t){if(e===n)return;throw $(o,...r)}}function A(e,n,...o){if(t){if(!0===e)return;throw $(n,...o)}}function _(e,n,...o){if(t){if(\"number\"==typeof e)return;throw $(n,...o)}}const Q=e=>e instanceof Promise,H=(e,t,n)=>{try{const o=e();return Q(o)?o.then(t,n):t(o)}catch(e){return n(e)}},J=(e,t)=>Q(e)?e.then(t):t(e),D=e=>e.some(Q)?Promise.all(e):e,U=e=>e.length>0?Promise.all(e):e,X=e=>null!=e,W=e=>new Promise((t=>{setTimeout(t,e)})),F=[],V={};Object.freeze(F),Object.freeze(V);const K=/*@__PURE__*/new Set,B=(e,t,n=F,o=0)=>{let r=null,s=null;if(T(e))s=e;else{if(!O(e))throw x(12,e);r=e}return K.has(t)&&(K.add(t),_i(\"qprefetch\",{symbols:[Ri(t)]})),Ii(r,t,null,s,null,n,null)},G=(e,t,n=F)=>Ii(null,t,e,null,null,n,null),Y=(e,t=F)=>Ii(null,e,null,null,null,t,null),Z=(e,t,n,o=F)=>{const r=B(e,t,o,1);return r.dev=n,r},ee=(e,t,n,o=F)=>{const r=G(e,t,o);return r.dev=n,r},te=(e,t={})=>{A(!1,\"In order to serialize a QRL, qSerialize must be true\"),Ni(e);let n=e.o,o=e.l;const r=e.m??n,s=R();if(s){const t=s.chunkForSymbol(r,o);t&&(o=t[1],e.m||(n=t[0]))}if(!o)throw x(31,e.o);o.startsWith(\"./\")&&(o=o.slice(2));const i=[o,\"#\",n],c=e.$,l=e.v;if(l&&l.length){if(t.g){const e=l.map(t.g);i.push(`[${e.join(\" \")}]`)}else if(t.S){const e=l.map(t.S);i.push(`[${e.join(\" \")}]`)}}else c&&c.length>0&&i.push(`[${c.join(\" \")}]`);return i.join(\"\")},ne=(e,t)=>{d(t.k);const n={S:e=>se(t.j,e)};return e.map((e=>te(e,n))).join(\"\\n\")},oe=(e,t)=>{const n=e.length,o=re(e,0,\"#\"),r=re(e,o,\"[\"),s=Math.min(o,r),i=e.substring(0,s),c=o==n?o:o+1,l=r,u=c==l?\"default\":e.substring(c,l),a=r,f=n,d=a===f?F:e.substring(a+1,f-1).split(\" \"),h=Ii(i,u,null,null,d,null,null);return t&&h.C(t),h},re=(e,t,n)=>{const o=e.length,r=e.indexOf(n,t==o?0:t);return-1==r?o:r},se=(e,t)=>{const n=e.indexOf(t);return-1===n?(e.push(t),e.length-1):n},ie=(e,t)=>(N(e.$,\"invoke: qrl capture must be defined inside useLexicalScope()\",e),e.v=e.$.map((e=>{const n=parseInt(e,10),o=t.j[n];return A(t.j.length>n,\"out of bounds inflate access\",e),o}))),ce=(e,t)=>(void 0===globalThis.__qwik_reg_symbols&&(globalThis.__qwik_reg_symbols=new Map),globalThis.__qwik_reg_symbols.set(t,e),e),le=e=>e.replace(/([A-Z])/g,\"-$1\").toLowerCase(),ue=\"q:renderFn\",ae=\"⭐️\",fe=\"q:slot\",de=\"q:sref\",he=\"q:s\",pe=\"q:style\",me=\"q:sstyle\",$e=\"q:container\",be=\"[q\\\\:container]\",ve=\"qRender\",we=\"q:id\",ye=\"#\",ge=(e,t,n)=>e.setAttribute(t,n),Se=(e,t)=>e.getAttribute(t),xe=(e,t)=>e.removeAttribute(t),ke=Symbol(\"ContainerState\"),qe=e=>{let t=e[ke];return t||(e[ke]=t=je(e,Se(e,\"q:base\")??\"/\")),t},je=(e,t)=>{const o={O:e,T:0,M:new WeakMap,P:new Set,L:new Set,I:new Set,R:new Set,N:new Set,A:new Set,H:new Set,J:{},D:t,U:void 0,X:void 0,W:void 0,F:null};return n(o),o.F=Ei(o),o},Ce=(e,t)=>{if(T(e))return e(t);if(j(e)&&\"value\"in e)return e.value=t;throw x(32,e)},Oe=(e,t)=>{var n;const o=Me(e);try{((n=globalThis).qwikevents||(n.qwikevents=[])).push(o)}catch(e){w(e)}},Te=e=>e.toString(36),Ee=e=>parseInt(e,36),Me=e=>{const t=e.indexOf(\":\");return e?e.slice(t+1).replace(/-./g,(e=>e[1].toUpperCase())):e},Pe=/^(on|window:|document:)/,Le=\"preventdefault:\",Ie=e=>e.endsWith(\"$\")&&Pe.test(e),Re=e=>{if(0===e.length)return F;if(1===e.length){const t=e[0];return[[t[0],[t[1]]]]}const t=[];for(let n=0;n<e.length;n++){const o=e[n][0];t.includes(o)||t.push(o)}return t.map((t=>[t,e.filter((e=>e[0]===t)).map((e=>e[1]))]))},Ne=(e,t,n,o)=>{if(A(t.endsWith(\"$\"),\"render: event property does not end with $\",t),t=_e(t.slice(0,-1)),n)if(C(n)){const r=n.flat(1/0).filter((e=>null!=e)).map((e=>[t,Qe(e,o)]));e.push(...r)}else e.push([t,Qe(n,o)]);return t},ze=[\"on\",\"window:on\",\"document:on\"],Ae=[\"on\",\"on-window\",\"on-document\"],_e=e=>{let t=\"on\";for(let n=0;n<ze.length;n++){const o=ze[n];if(e.startsWith(o)){t=Ae[n],e=e.slice(o.length);break}}return t+\":\"+(e.startsWith(\"-\")?le(e.slice(1)):e.toLowerCase())},Qe=(e,t)=>{const n=Li(e)?e:Hi(e);return n.C(t),n};function He(e){return function(e){return e&&\"number\"==typeof e.nodeType}(e)&&1===e.nodeType}const Je=Symbol(\"proxy target\"),De=Symbol(\"proxy flags\"),Ue=Symbol(\"proxy manager\"),Xe=Symbol(\"IMMUTABLE\"),We=\"$$\",Fe=(e,t,n)=>new et(e,t,n);var Ve;const Ke=(e,t,n,o)=>{const r=t.F.K(o);return new Ze(e,r,n)},Be=Symbol(\"proxy manager\"),Ge=Symbol(\"unassigned signal\");class Ye{}class Ze extends Ye{constructor(e,t,n){super(),this[Ve]=0,this.untrackedValue=e,this[Ue]=t,this[Be]=n}valueOf(){throw new TypeError(\"Cannot coerce a Signal, use `.value` instead\")}toString(){return`[Signal ${String(this.value)}]`}toJSON(){return{value:this.value}}get value(){if(2&this[Be])throw Ge;const e=yt()?.B;return e&&this[Ue].G(e),this.untrackedValue}set value(e){if(t){if(1&this[Be])throw new Error(\"Cannot mutate immutable signal\");pi(e);const t=yt();t&&(t.Y===ve&&w(\"State mutation inside render function. Use useTask$() instead.\",t.Z),\"ComputedEvent\"===t.Y&&w(\"State mutation inside useComputed$() is an antipattern. Use useTask$() instead\",t.Z))}const n=this[Ue],o=this.untrackedValue;n&&o!==e&&(this.untrackedValue=e,n.ee())}}Ve=Be;class et extends Ye{constructor(e,t,n){super(),this.te=e,this.ne=t,this.oe=n}get value(){return this.te.apply(void 0,this.ne)}}class tt extends Ye{constructor(e,t){super(),this.ref=e,this.prop=t}get[Ue](){return ji(this.ref)}get value(){return this.ref[this.prop]}set value(e){this.ref[this.prop]=e}}const nt=e=>e instanceof Ye,ot=(e,t)=>{if(!j(e))return e[t];if(e instanceof Ze)return z(t,\"value\",\"Left side is a signal, prop must be value\"),e;if(e instanceof tt)return z(t,\"value\",\"Left side is a signal, prop must be value\"),e;const n=qi(e);if(n){const o=n[We+t];if(o)return A(nt(o),`${We} has to be a signal kind`),o;if(!0!==n[Xe]?.[t])return new tt(e,t)}const o=e[Xe]?.[t];return nt(o)?o:Xe},rt=(e,t)=>{const n=ot(e,t);return n===Xe?e[t]:n},st=(e,t,n=0)=>t.M.get(e)||(0!==n&&lt(e,n),it(e,t,void 0)),it=(e,t,n)=>{z(ki(e),e,\"Unexpected proxy at this location\",e),A(!t.M.has(e),\"Proxy was already created\",e),A(j(e),\"Target must be an object\"),A(q(e)||C(e),\"Target must be a serializable object\");const o=t.F.K(n),r=new Proxy(e,new at(t,o));return t.M.set(e,r),r},ct=()=>{const e={};return lt(e,2),e},lt=(e,t)=>{Object.defineProperty(e,De,{value:t,enumerable:!1})},ut=(e,t)=>{const n={};for(const o in e)t.includes(o)||(n[o]=e[o]);return n};class at{constructor(e,t){this.re=e,this.se=t}deleteProperty(e,t){if(2&e[De])throw x(17);return\"string\"==typeof t&&delete e[t]&&(this.se.ee(C(e)?void 0:t),!0)}get(e,t){if(\"symbol\"==typeof t)return t===Je?e:t===Ue?this.se:e[t];let n;const o=e[De]??0;_(o,\"flags must be an number\");const r=yt(),s=0!=(1&o),i=0!=(2&o);let c=e[t];if(r&&(n=r.B),i){const o=e[We+t],r=e[Xe]?.[t];(!(t in e)||o||nt(r)||r===Xe)&&(n=null),o&&(A(nt(o),\"$$ prop must be a signal\"),c=o.value)}if(n){const o=C(e);this.se.G(n,o?void 0:t)}return s?ft(c,this.re):c}set(e,n,o){if(\"symbol\"==typeof n)return e[n]=o,!0;const r=e[De]??0;if(_(r,\"flags must be an number\"),0!=(2&r))throw x(17);const s=0!=(1&r)?ki(o):o;if(t){pi(s);const e=yt();e&&e.Y===ve&&p(\"State mutation inside render function. Move mutation to useTask$() or useVisibleTask$()\",n)}return C(e)?(e[n]=s,this.se.ee(),!0):(e[n]!==s&&(e[n]=s,this.se.ee(n)),!0)}has(e,t){if(t===Je)return!0;const n=Object.prototype.hasOwnProperty;return!!n.call(e,t)||!(\"string\"!=typeof t||!n.call(e,We+t))}ownKeys(e){const t=e[De]??0;if(_(t,\"flags must be an number\"),0==(2&t)){let e=null;const t=yt();t&&(e=t.B),e&&this.se.G(e)}return C(e)?Reflect.ownKeys(e):Reflect.ownKeys(e).map((e=>\"string\"==typeof e&&e.startsWith(We)?e.slice(We.length):e))}getOwnPropertyDescriptor(e,t){return C(e)||\"symbol\"==typeof t?Object.getOwnPropertyDescriptor(e,t):{enumerable:!0,configurable:!0}}}const ft=(e,t)=>{if(j(e)){if(Object.isFrozen(e))return e;const n=ki(e);if(n!==e)return e;if(wi(n))return e;if(q(n)||C(n))return t.M.get(n)||st(n,t,1)}return e},dt=\"_qc_\",ht=e=>e[dt],pt=(e,t)=>{f(e);const n=ht(e);if(n)return n;const o=mt(e),r=Se(e,\"q:id\");if(r){const n=t.W;if(o.ie=r,n){const{getObject:s,meta:i,refs:c}=n;if(He(e)){const n=c[r];n&&(A(He(e),\"el must be an actual DOM element\"),o.j=n.split(\" \").map(s),o.li=((e,t)=>{const n=e.k.attributes,o=[];for(let r=0;r<n.length;r++){const{name:s,value:i}=n.item(r);if(s.startsWith(\"on:\")||s.startsWith(\"on-window:\")||s.startsWith(\"on-document:\")){const n=i.split(\"\\n\");for(const r of n){const n=oe(r,t);n.$&&ie(n,e),o.push([s,n])}}}return o})(o,t.O))}else{const n=e.getAttribute(me);o.ce=n?n.split(\"|\"):null;const c=i[r];if(c){const e=c.s,n=c.h,r=c.c,i=c.w;if(e&&(o.le=e.split(\" \").map(s)),i&&(o.ue=i.split(\" \").map(s)),r){o.ae=new Map;for(const e of r.split(\" \")){const[t,n]=e.split(\"=\");o.ae.set(t,s(n))}}if(n){const[e,r]=n.split(\" \");o.fe=4,e&&(o.t=s(e)),o.de=r?s(r):it(ct(),t)}}}}}return o},mt=e=>{const t={fe:0,ie:\"\",k:e,j:[],li:[],ue:null,le:null,he:null,ce:null,pe:null,de:null,me:null,t:null,ae:null,$e:null,be:null,ve:null};return n(t),e[dt]=t,t};let $t,bt;function vt(e){if(void 0===$t){const t=yt();if(t&&t.we)return t.we;if(void 0!==e)return e;throw new Error(\"Reading `locale` outside of context.\")}return $t}function wt(e,t){const n=$t;try{return $t=e,t()}finally{$t=n}}const yt=()=>{if(!bt){const e=\"undefined\"!=typeof document&&document&&document.__q_context__;if(!e)return;return C(e)?document.__q_context__=jt(e):e}return bt},gt=()=>{const e=yt();if(!e)throw x(14);return e},St=()=>{const e=yt();if(!e||e.Y!==ve)throw x(20);return N(e.Z,\"invoke: $hostElement$ must be defined\",e),N(e.ye,\"invoke: $waitOn$ must be defined\",e),N(e.ge,\"invoke: $renderCtx$ must be defined\",e),N(e.B,\"invoke: $subscriber$ must be defined\",e),e},xt=e=>{if(null==e)return e;const t=gt();return(...n)=>kt(t,e.bind(void 0,...n))};function kt(e,t,...n){const o=bt;let r;try{bt=e,r=t.apply(this,n)}finally{bt=o}return r}const qt=(e,t)=>{const n=e.ye;if(0===n.length){const e=t();Q(e)&&n.push(e)}else n.push(Promise.all(n).then(t))},jt=e=>{const t=e[0],n=t.closest(be),o=n?.getAttribute(\"q:locale\")||void 0;return o&&function(e){$t=e}(o),Ct(o,void 0,t,e[1],e[2])},Ct=(e,t,o,r,s)=>{const i={le:0,Z:t,k:o,Y:r,Se:s,xe:void 0,de:void 0,ge:void 0,B:void 0,ye:void 0,we:e};return n(i),i},Ot=e=>e.closest(be),Tt=e=>kt(void 0,e),Et=Ct(void 0,void 0,void 0,ve),Mt=(e,t)=>(Et.B=t,kt(Et,(()=>e.value))),Pt=()=>{const e=yt();if(e)return e.k??e.Z??e.xe?.C(void 0)},Lt=e=>{const t=yt();if(t&&t.Z&&t.ge){const e=t.Z;pt(e,t.ge.ke.re).fe|=8}return e},It=(e,t)=>zt(`on-${e}`,t),Rt=(e,t)=>zt(`document:on-${e}`,t),Nt=(e,t)=>zt(`window:on-${e}`,t),zt=(e,t)=>{const n=St(),o=pt(n.Z,n.ge.ke.re);Ni(t),\"string\"==typeof e?o.li.push([_e(e),t]):o.li.push(...e.map((e=>[_e(e),t]))),o.fe|=2},At=()=>{const e=St(),n=e.le,o=e.Z,r=pt(o,e.ge.ke.re),s=r.le?r.le:r.le=[];return e.le++,{get:s[n],set:e=>(t&&pi(e),s[n]=e),i:n,iCtx:e,elCtx:r}},_t=e=>document,Qt=(e,t,n,o)=>{e?e.qe.push({je:Ht,ne:[t,n,o]}):Ht(t,n,o)},Ht=(e,t,n)=>{if(null==n||!1===n)e.removeAttribute(t);else{const o=!0===n?\"\":String(n);ge(e,t,o)}},Jt=(e,t,n,o)=>{e?e.qe.push({je:Dt,ne:[t,n,o]}):Dt(t,n,o)},Dt=(e,t,n)=>{try{e[t]=n??\"\",null==n&&o(e)&&s(e)&&e.removeAttribute(t)}catch(o){p(k(6),{node:e,key:t,value:n},o)}},Ut=(e,t,n)=>n?e.createElementNS(qr,t):e.createElement(t),Xt=(e,t,n,o)=>(e.qe.push({je:rs,ne:[t,n,o||null]}),n),Wt=(e,t,n,o)=>(e.qe.push({je:os,ne:[t,n,o||null]}),n),Ft=(e,t,n)=>(e.qe.push({je:ts,ne:[t,n]}),n),Vt=(e,t)=>{e.re.A.add(t.styleId),e.Ce.push({je:Kt,ne:[e.re.O,t]})},Kt=(e,t)=>{const n=_t(),o=n.documentElement===e,r=n.head,s=n.createElement(\"style\");o&&!r&&w(\"document.head is undefined\"),ge(s,pe,t.styleId),ge(s,\"hidden\",\"\"),s.textContent=t.content,o&&r?ts(r,s):rs(e,s,e.firstChild)},Bt=(e,t)=>{rs(e,t,e.firstChild)},Gt=(e,t)=>{if(1===t.nodeType||111===t.nodeType){const n=e.re.F;es(t,e,n,!0)}e.qe.push({je:Yt,ne:[t,e]})},Yt=(e,n)=>{const o=e.parentElement;o?ns(o,e):t&&w(\"Trying to remove component already removed\",e)},Zt=(e,t)=>{const n=Ut(e,\"q:template\",!1);return ge(n,fe,t),ge(n,\"hidden\",\"\"),ge(n,\"aria-hidden\",\"true\"),n},en=e=>{for(const t of e.qe)t.je.apply(void 0,t.ne);nn(e)},tn=e=>Se(e,\"q:key\"),nn=e=>{const t=e.re.F;for(const n of e.Oe){const o=tn(n);N(o,\"slots must have a key\");const r=Mr(n,\"root\");if(r.length>0){const s=n.getAttribute(de),i=e.Te.find((e=>e.ie===s));if(i){const s=i.k;if(s.isConnected)if(Array.from(s.childNodes).some((e=>Nr(e)&&Se(e,fe)===o)))es(n,e,t,!1);else{const t=Zt(e.Ee,o);for(const e of r)ts(t,e);rs(s,t,s.firstChild)}else es(n,e,t,!1)}else es(n,e,t,!1)}}for(const[t,n]of e.Me){const e=tn(t);N(e,\"slots must have a key\");const o=Array.from(n.childNodes).find((t=>Nr(t)&&t.getAttribute(fe)===e));o&&(Mr(o,\"root\").forEach((e=>{ts(t,e)})),o.remove())}},on=e=>{if(t&&\"undefined\"!=typeof window&&null!=window.document){const t={};for(const n of e.qe)t[n.je.name]=(t[n.je.name]??0)+1;const n={byOp:t,roots:e.Te.map((e=>e.k)),hostElements:Array.from(e.Pe),operations:e.qe.map((e=>[e.je.name,...e.ne]))},o=0===e.qe.length;y(\"Render stats.\",o?\"No operations\":\"\",n)}},rn=\"__virtual\",sn=\":virtual\";class cn{constructor(e,t){this.open=e,this.close=t,this._qc_=null,this.nodeType=111,this.localName=sn,this.nodeName=sn;const o=this.ownerDocument=e.ownerDocument;this.template=Ut(o,\"template\",!1),this.attributes=(e=>{if(!e)return new Map;const t=e.split(\" \");return new Map(t.map((e=>{const t=e.indexOf(\"=\");return t>=0?[e.slice(0,t),(n=e.slice(t+1),n.replace(/\\+/g,\" \"))]:[e,\"\"];var n})))})(e.data.slice(3)),A(e.data.startsWith(\"qv \"),\"comment is not a qv\"),e[rn]=this,n(this)}insertBefore(e,t){const n=this.parentElement;if(n){const o=t||this.close;n.insertBefore(e,o)}else this.template.insertBefore(e,t);return e}remove(){const e=this.parentElement;if(e){const t=Array.from(this.childNodes);z(this.template.childElementCount,0,\"children should be empty\"),e.removeChild(this.open),this.template.append(...t),e.removeChild(this.close)}}appendChild(e){return this.insertBefore(e,null)}insertBeforeTo(e,t){const n=Array.from(this.childNodes);e.insertBefore(this.open,t);for(const o of n)e.insertBefore(o,t);e.insertBefore(this.close,t),z(this.template.childElementCount,0,\"children should be empty\")}appendTo(e){this.insertBeforeTo(e,null)}get namespaceURI(){return this.parentElement?.namespaceURI??\"\"}removeChild(e){this.parentElement?this.parentElement.removeChild(e):this.template.removeChild(e)}getAttribute(e){return this.attributes.get(e)??null}hasAttribute(e){return this.attributes.has(e)}setAttribute(e,t){this.attributes.set(e,t)}removeAttribute(e){this.attributes.delete(e)}matches(e){return!1}compareDocumentPosition(e){return this.open.compareDocumentPosition(e)}closest(e){const t=this.parentElement;return t?t.closest(e):null}querySelectorAll(e){const t=[];return Mr(this,\"elements\").forEach((n=>{i(n)&&(n.matches(e)&&t.push(n),t.concat(Array.from(n.querySelectorAll(e))))})),t}querySelector(e){for(const t of this.childNodes)if(s(t)){if(t.matches(e))return t;const n=t.querySelector(e);if(null!==n)return n}return null}get firstChild(){if(this.parentElement){const e=this.open.nextSibling;return e===this.close?null:e}return this.template.firstChild}get nextSibling(){return this.close.nextSibling}get previousSibling(){return this.open.previousSibling}get childNodes(){if(!this.parentElement)return this.template.childNodes;const e=[];let t=this.open;for(;(t=t.nextSibling)&&t!==this.close;)e.push(t);return e}get isConnected(){return this.open.isConnected}get parentElement(){return this.open.parentElement}}const ln=e=>{if(null==e)return null;if(a(e)){const t=un(e);if(t)return t}return e},un=e=>{const t=e[rn];if(t)return t;if(e.data.startsWith(\"qv \")){const t=an(e);return new cn(e,t)}return null},an=e=>{let t=e.nextSibling,n=1;for(;t;){if(a(t))if(t.data.startsWith(\"qv \"))n++;else if(\"/qv\"===t.data&&(n--,0===n))return t;t=t.nextSibling}throw new Error(\"close not found\")},fn=e=>null==e?null:l(e)?e.open:e,dn=e=>(A(/^[\\w/.-]+$/.test(e),\"Context name must only contain A-Z,a-z,0-9, _\",e),/*#__PURE__*/Object.freeze({id:le(e)})),hn=(e,n)=>{const{get:o,set:r,elCtx:s}=At();if(void 0!==o)return;t&&vn(e);let i=s.ae;i||(s.ae=i=new Map),t&&pi(n),i.set(e.id,n),r(!0)},pn=(e,n)=>{const{get:o,set:r,iCtx:s,elCtx:i}=At();if(void 0!==o)return o;t&&vn(e);const c=mn(e,i,s.ge.ke.re);if(\"function\"==typeof n)return r(kt(void 0,n,c));if(void 0!==c)return r(c);if(void 0!==n)return r(n);throw x(13,e.id)},mn=(e,t,n)=>{const o=e.id;if(t){let e=t.k,r=t.ve??t.be;for(;r;){if(e=r.k,r.ae){const e=r.ae.get(o);if(e)return e;if(!0===r.ae.get(\"_\"))break}r=r.ve??r.be}if(e.closest){const t=$n(e,n,o);if(void 0!==t)return t}}},$n=(e,t,n)=>{let o=e;for(;o;){let e,r=o;for(;r&&(e=bn(r));){const o=pt(e,t)?.ae;if(o&&o.has(n))return o.get(n);r=e}o=o.parentElement}},bn=e=>{let t=e,n=1;for(;t=t.previousSibling;)if(a(t))if(\"/qv\"===t.data)n++;else if(t.data.startsWith(\"qv \")&&(n--,0===n))return un(t);return null},vn=e=>{if(!j(e)||\"string\"!=typeof e.id||0===e.id.length)throw x(28,e)},wn=/*#__PURE__*/dn(\"qk-error\"),yn=(e,n,o)=>{const r=ht(n);if(t){if(\"undefined\"!=typeof document&&l(n)){r.me=null;const t=document.createElement(\"errored-host\");e&&e instanceof Error&&(t.props={error:e}),t.setAttribute(\"q:key\",\"_error_\"),t.append(...n.childNodes),n.appendChild(t)}if(e&&e instanceof Error&&(\"hostElement\"in e||(e.hostElement=n)),!gn(e))throw e}{const t=mn(wn,r,o.ke.re);if(void 0===t)throw e;t.error=e}},gn=e=>!(e&&e instanceof Error&&\"plugin\"in e),Sn=(e,t)=>{t.fe&=-2,t.fe|=4,t.he=[],t.li.length=0;const n=t.k,o=t.t,r=t.de,s=kn(e),i=Ct(e.ke.we,n,void 0,ve),c=i.ye=[];N(o,\"render: host element to render must has a $renderQrl$:\",t),N(r,\"render: host element to render must has defined props\",t),s.Le=t,s.Ie=null,i.B=[0,n],i.ge=e,o.C(e.ke.re.O);const l=o.getFn(i);return H((()=>l(r)),(n=>c.length>0?Promise.all(c).then((()=>1&t.fe?Sn(e,t):{node:n,rCtx:s})):1&t.fe?Sn(e,t):{node:n,rCtx:s}),(o=>o===Ge?Promise.all(c).then((()=>Sn(e,t))):(yn(o,n,e),{node:Ln,rCtx:s})))},xn=(e,t)=>{const o={ke:{Ee:e,we:t.J.locale,re:t,Pe:new Set,qe:[],Ce:[],Te:[],Me:[],Oe:[],Re:[]},Le:null,Ie:null};return n(o),n(o.ke),o},kn=e=>({ke:e.ke,Le:e.Le,Ie:e.Ie}),qn=(e,t)=>t&&t.ce?t.ce.join(\" \")+\" \"+jn(e):jn(e),jn=e=>e?O(e)?e.trim():C(e)?e.reduce(((e,t)=>{const n=jn(t);return n?e?`${e} ${n}`:n:e}),\"\"):Object.entries(e).reduce(((e,[t,n])=>n?e?`${e} ${t.trim()}`:t.trim():e),\"\"):\"\",Cn=e=>{if(null==e)return\"\";if(\"object\"==typeof e){if(C(e))throw x(0,e,\"style\");{const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];if(null!=o){const e=n.startsWith(\"--\")?n:le(n);t.push(e+\":\"+o)}}return t.join(\";\")}}return String(e)},On=e=>Te(e.ke.re.T++),Tn=(e,t)=>{const n=On(e);t.ie=n},En=e=>nt(e)?En(e.value):null==e||\"boolean\"==typeof e?\"\":String(e);function Mn(e){return e.startsWith(\"aria-\")}const Pn=(e,t)=>!!t.key&&(!vr(e)||!T(e.type)&&e.key!=t.key),Ln=Symbol(\"skip render\"),In=(e,t)=>fr(zn,null,null,e.children,2,t),Rn=()=>null,Nn=e=>hr(Rn,{data:`\\x3c!--${e.data}--\\x3e`},null),zn=e=>e.children,An=e=>[hr(Nn,{data:\"qkssr-pu\"}),e.children,hr(Nn,{data:\"qkssr-po\"})],_n=(e,t)=>hr(In,{children:hr(Hn,e)},t),Qn=()=>null,Hn=()=>null,Jn=(e,t=0)=>{if(0===e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Number(Math.abs(t)).toString(36)},Dn=e=>{const t=e.join(\"|\");if(t.length>0)return t},Un=async(e,t)=>{const n={},o=Fn(n);let r;for(to(e,o,!1);(r=o.Ne).length>0;)o.Ne=[],await Promise.all(r);const s=Array.from(o.ze.keys());let i=0;const c=new Map;for(const e of s)c.set(e,Te(i)),i++;if(o.Ae.length>0){const e=c.get(void 0);N(e,\"undefined ID must be defined\");for(const t of o.Ae)c.set(t,e)}const l=e=>{let t=\"\";if(Q(e)){const n=eo(e);if(!n)throw x(27,e);e=n.value,n.resolved?t+=\"~\":t+=\"_\"}if(j(e)){const n=qi(e);n&&(t+=\"!\",e=n)}const n=c.get(e);if(void 0===n)throw x(27,e);return n+t},u=s.map((e=>{if(null===e)return null;const t=typeof e;switch(t){case\"undefined\":return Ks;case\"number\":if(!Number.isFinite(e))break;return e;case\"string\":case\"boolean\":return e}const r=ui(e,l,o,n);if(void 0!==r)return r;if(\"object\"===t){if(C(e))return e.map(l);if(q(e)){const t={};for(const n of Object.keys(e))t[n]=l(e[n]);return t}}throw x(3,e)}));return JSON.stringify({_entry:l(e),_objs:u})},Xn=async(e,n,r)=>{const c=Fn(n);let u,a=!1;for(const n of e)if(n.ue)for(const e of n.ue)t&&(e.fe&ks&&w(\"Serializing dirty watch. Looks like an internal error.\"),xi(e)||w(\"Serializing disconnected watch. Looks like an internal error.\")),Ms(e)&&c._e.push(e.Qe),zs(e);for(const t of e){const e=t.k,n=t.li;for(const t of n)if(s(e)){const e=t[1],n=e.v;if(n)for(const e of n)to(e,c,!0);c.He.push(e),a=!0}}if(!a)return{state:{refs:{},ctx:{},objs:[],subs:[]},objs:[],funcs:[],qrls:[],resources:c._e,mode:\"static\"};for(;(u=c.Ne).length>0;)c.Ne=[],await Promise.all(u);const f=c.Je.length>0;if(f){for(const e of c.De)Bn(e,c,e.k);for(const t of e)Wn(t,c)}for(;(u=c.Ne).length>0;)c.Ne=[],await Promise.all(u);const h=new Map,p=Array.from(c.ze.keys()),m=new Map,$=e=>{let t=\"\";if(Q(e)){const n=eo(e);if(!n)return null;e=n.value,n.resolved?t+=\"~\":t+=\"_\"}if(j(e)){const n=qi(e);if(n)t+=\"!\",e=n;else if(i(e)){const n=(e=>{let t=h.get(e);return void 0===t&&(t=ro(e),t||console.warn(\"Missing ID\",e),h.set(e,t)),t})(e);return n?ye+n+t:null}}const n=m.get(e);return n?n+t:r?r(e):null},b=e=>{const t=$(e);if(null===t)throw x(27,e);return t},v=new Map;p.forEach((e=>{const t=oo(e,n)?.Ue;if(!t)return null;const r=Ci(e)??0,s=[];r>0&&s.push(r);for(const e of t){const t=e[1];0===e[0]&&o(t)&&l(t)&&!c.Je.includes(ht(t))||s.push(e)}s.length>0&&v.set(e,s)})),p.sort(((e,t)=>(v.has(e)?0:1)-(v.has(t)?0:1)));let y=0;for(const e of p)m.set(e,Te(y)),y++;if(c.Ae.length>0){const e=m.get(void 0);N(e,\"undefined ID must be defined\");for(const t of c.Ae)m.set(t,e)}const g=[];for(const e of p){const t=v.get(e);if(null==t)break;g.push(t.map((e=>\"number\"==typeof e?`_${e}`:Oi(e,$))).filter(X))}z(g.length,v.size,\"missing subscriptions to serialize\",g,v);const S=p.map((e=>{if(null===e)return null;const t=typeof e;switch(t){case\"undefined\":return Ks;case\"number\":if(!Number.isFinite(e))break;return e;case\"string\":case\"boolean\":return e}const o=ui(e,b,c,n);if(void 0!==o)return o;if(\"object\"===t){if(C(e))return e.map(b);if(q(e)){const t={};for(const n of Object.keys(e)){const o=$(e[n]);null!==o&&(t[n]=o)}return t}}throw x(3,e)})),k={},O={};return e.forEach((e=>{const t=e.k,n=e.ie,o=e.j,r=e.de,s=e.ae,i=e.ue,u=e.t,a=e.le,h={},p=l(t)&&c.Je.includes(e);if(N(n,\"pause: can not generate ID for dom node\",t),o.length>0){d(t);const e=o.map(b).join(\" \");e&&(O[n]=e)}else if(f){let e=!1;if(p){N(u,\"renderQrl must be defined\");const t=$(r);h.h=b(u)+(t?\" \"+t:\"\"),e=!0}else{const t=$(r);t&&(h.h=\" \"+t,e=!0)}if(i&&i.length>0){const t=i.map($).filter(X).join(\" \");t&&(h.w=t,e=!0)}if(p&&a&&a.length>0){const t=a.map(b).join(\" \");h.s=t,e=!0}if(s){const t=[];s.forEach(((e,n)=>{const o=$(e);o&&t.push(`${n}=${o}`)}));const n=t.join(\" \");n&&(h.c=n,e=!0)}e&&(k[n]=h)}})),t&&h.forEach(((e,t)=>{e||w(\"unconnected element\",t.nodeName,\"\\n\")})),{state:{refs:O,ctx:k,objs:S,subs:g},objs:p,funcs:c.Xe,resources:c._e,qrls:c.He,mode:f?\"render\":\"listeners\"}},Wn=(e,t)=>{const n=e.be,o=e.de;if(n&&o&&!so(o)&&t.Je.includes(n)){const n=ji(o)?.Ue,r=e.k;if(n)for(const e of n){if(0===e[0]&&e[1]===r)return void Kn(r,t);to(o,t,!1)}}},Fn=e=>({re:e,We:new Set,ze:new Set,Fe:0,Ae:[],Xe:[],_e:[],Je:[],He:[],De:[],Ne:[]}),Vn=(e,t)=>{const n=ht(e);t.Je.includes(n)||(t.Je.push(n),t.Fe++,8&n.fe?Bn(n,t,!0):t.De.push(n),t.Fe--)},Kn=(e,t)=>{const n=ht(e);if(n){if(t.Je.includes(n))return;t.Je.push(n),Bn(n,t,e)}},Bn=(e,t,n)=>{if(e.de&&!so(e.de)&&to(e.de,t,n),e.t&&to(e.t,t,n),e.le)for(const o of e.le)to(o,t,n);if(e.ue){const o=t.re.F.Ve;for(const r of e.ue)o.has(r)&&to(r,t,n)}if(n&&(Gn(e,t),e.$e))for(const n of e.$e)Gn(n,t)},Gn=(e,t)=>{for(;e;){if(e.ae){for(const n of e.ae.values())to(n,t,!0);if(!0===e.ae.get(\"_\"))break}e=e.ve??e.be}},Yn=(e,t,n)=>{if(t.We.has(e))return;t.We.add(e);const r=e.Ue;N(r,\"subs must be defined\");for(const e of r){const r=e[0];if(r>0&&to(e[2],t,!0),!0===n){const n=e[1];o(n)&&l(n)?0===r&&Vn(n,t):to(n,t,!0)}}},Zn=Symbol(),eo=e=>e[Zn],to=(e,t,n)=>{if(null!==e){const s=typeof e;switch(s){case\"function\":case\"object\":{const i=t.We;if(i.has(e))return;if(i.add(e),wi(e))return t.ze.add(void 0),void t.Ae.push(e);const c=e,l=qi(e);if(l){if(e=l,i.has(e))return;if(i.add(e),Yn(ji(c),t,n),yi(c))return void t.ze.add(e)}if(li(e,t,n))return void t.ze.add(e);if(Q(e))return void t.Ne.push((r=e,r.then((e=>{const t={resolved:!0,value:e};return r[Zn]=t,e}),(e=>{const t={resolved:!1,value:e};return r[Zn]=t,e}))).then((e=>{to(e,t,n)})));if(\"object\"===s){if(o(e))return;if(C(e))for(let o=0;o<e.length;o++)to(c[o],t,n);else if(q(e))for(const o of Object.keys(e))to(c[o],t,n)}break}}}var r;t.ze.add(e)},no=e=>{const t=ln(e);if(i(t)){const e=ht(t);if(e&&e.ie)return e}},oo=(e,t)=>{if(!j(e))return;if(e instanceof Ze)return ji(e);const n=t.M.get(e);return n?ji(n):void 0},ro=e=>{const t=ht(e);return t?t.ie:null},so=e=>0===Object.keys(e).length,io=\"0.100.0\";var co;const lo=\"\\x3c!--qkssr-f--\\x3e\";class uo{constructor(e){this.nodeType=e,this[co]=null,n(this)}}co=dt;const ao=async(e,o)=>{const r=o.containerTagName,s=yo(1).k,i=je(s,o.base??\"/\");i.J.locale=o.serverData?.locale;const c=new uo(9),l=xn(c,i),u=o.beforeContent??[],a={ke:{ae:[],Ke:!1,Be:\"html\"===r?u:[],we:o.serverData?.locale},Ge:void 0,Ye:void 0,Ze:void 0};n(a);let f=t?\"ssr-dev\":\"ssr\";o.containerAttributes[\"q:render\"]&&(f=`${o.containerAttributes[\"q:render\"]}-${f}`);const d={...o.containerAttributes,\"q:container\":\"paused\",\"q:version\":io,\"q:render\":f,\"q:base\":o.base,\"q:locale\":o.serverData?.locale,children:\"html\"===r?[e]:[u,e]};\"html\"!==r&&(d.class=\"qc📦\"+(d.class?\" \"+d.class:\"\")),i.J={url:o.url,...o.serverData},e=hr(r,d),i.X=new Set,await Promise.resolve().then((()=>fo(e,l,a,o.stream,i,o)))},fo=async(e,n,o,r,s,i)=>{const c=i.beforeClose;return await go(e,n,o,r,0,c?e=>{const t=c(o.ke.ae,s,o.ke.Ke);return So(t,n,o,e,0,void 0)}:void 0),t&&o.ke.Be.length>0&&p(\"Missing <head>. Global styles could not be rendered. Please render a <head> element at the root of the app\"),n},ho=(e,t,n,o,r,s,i,c)=>{const l=e.props,u=l[ue];if(u)return t.t=u,bo(o,r,s,t,e,i,c);let a=\"\\x3c!--qv\"+mo(l);const f=he in l,d=null!=e.key?String(e.key):null;if(f&&(N(o.Le?.ie,\"hostId must be defined for a slot\"),a+=\" q:sref=\"+o.Le.ie),null!=d&&(a+=\" q:key=\"+d),a+=\"--\\x3e\",s.write(a),n)for(const e of n)$o(e.type,e.props,s);const h=xo(e.children,o,r,s,i);return J(h,(()=>{if(!f&&!c)return void s.write(po);let e;if(f){N(d,\"key must be defined for a slot\");const n=r.Ge?.[d];if(n){const[o,c]=r.Ye,l=kn(o);l.Ie=t,r.Ge[d]=void 0,e=So(n,l,c,s,i)}}return c&&(e=J(e,(()=>c(s)))),J(e,(()=>{s.write(po)}))}))},po=\"\\x3c!--/qv--\\x3e\",mo=e=>{let t=\"\";for(const n of Object.keys(e)){if(\"children\"===n)continue;const o=e[n];null!=o&&(t+=\" \"+(\"\"===o?n:n+\"=\"+o))}return t},$o=(e,t,n)=>{if(n.write(\"<\"+e+(e=>{let t=\"\";for(const n of Object.keys(e)){if(\"dangerouslySetInnerHTML\"===n)continue;const o=e[n];null!=o&&(t+=\" \"+(\"\"===o?n:n+'=\"'+o+'\"'))}return t})(t)+\">\"),Mo[e])return;const o=t.dangerouslySetInnerHTML;null!=o&&n.write(o),n.write(`</${e}>`)},bo=(e,t,n,o,r,s,i)=>{const c=r.props;return jo(e,o,c.props),J(Sn(e,o),(c=>{const l=o.k,u=c.rCtx,a=Ct(t.ke.we,l,void 0);a.B=[0,l],a.ge=u;const f={...t,Ge:wo(r.children,t),Ye:[e,t],Ze:a},d=[];if(o.pe){const e=4&s?t.ke.Be:d;for(const t of o.pe)e.push(hr(\"style\",{[pe]:t.styleId,hidden:\"\",dangerouslySetInnerHTML:t.content}))}const h=On(e),p=o.ce?Dn(o.ce):void 0,m=hr(r.type,{[me]:p,[we]:h,children:c.node},r.key);return o.ie=h,t.ke.ae.push(o),ho(m,o,d,u,f,n,s,(n=>{if(2&o.fe){const r=yo(1),s=r.li;s.push(...o.li),o.fe&=-3,r.ie=On(e);const i={type:\"placeholder\",hidden:\"\",\"q:id\":r.ie};t.ke.ae.push(r);const c=Re(s);for(const t of c){const n=Xo(t[0]);i[n]=ne(t[1],r),Oe(n,e.ke.re)}$o(\"script\",i,n)}return i?J(vo(e,f,n),(()=>i(n))):vo(e,f,n)}))}))},vo=(e,t,n)=>{const o=t.Ge;if(o){const r=Object.keys(o).map((e=>{const t=o[e];if(t)return hr(\"q:template\",{[fe]:e,hidden:\"\",\"aria-hidden\":\"true\",children:t})}));return So(r,e,t,n,0,void 0)}},wo=(e,t)=>{const n=ko(e,t);if(null===n)return;const o={};for(const e of n){let t=\"\";vr(e)&&(t=e.props[fe]??\"\");let n=o[t];n||(o[t]=n=[]),n.push(e)}return o},yo=e=>{const t=new uo(e);return mt(t)},go=(e,n,o,r,s,i)=>{const c=e.type,l=n.Le;if(\"string\"==typeof c){const u=e.key,a=e.props,f=e.immutableProps,h=yo(1),m=h.k,$=\"head\"===c;let b=\"<\"+c,v=!1,w=!1,y=\"\",g=null;if(d(m),t&&a.class&&a.className)throw new TypeError(\"Can only have one of class or className\");if(f)for(const e of Object.keys(f)){let o=f[e];if(Ie(e)){Ne(h.li,e,o,void 0);continue}const r=Co(e);if(nt(o)&&(N(l,\"Signals can not be used outside the root\"),o=Mt(o,[1,m,o,l.k,r]),v=!0),\"dangerouslySetInnerHTML\"===e){g=o;continue}e.startsWith(Le)&&Oe(e.slice(Le.length),n.ke.re);const s=Oo(r,o);null!=s&&(\"class\"===r?y=s:\"value\"===r&&\"textarea\"===c?g=_o(s):Jo(r)?t&&p(\"Attribute value is unsafe for SSR\"):b+=\" \"+(\"\"===o?r:r+'=\"'+Qo(s)+'\"'))}for(const e of Object.keys(a)){let o=a[e];if(\"ref\"===e){Ce(o,m),w=!0;continue}if(Ie(e)){Ne(h.li,e,o,void 0);continue}const r=Co(e);if(nt(o)&&(N(l,\"Signals can not be used outside the root\"),o=Mt(o,[2,l.k,o,m,r]),v=!0),\"dangerouslySetInnerHTML\"===e){g=o;continue}e.startsWith(Le)&&Oe(e.slice(Le.length),n.ke.re);const s=Oo(r,o);null!=s&&(\"class\"===r?y=s:\"value\"===r&&\"textarea\"===c?g=_o(s):Jo(r)?t&&p(\"Attribute value is unsafe for SSR\"):b+=\" \"+(\"\"===o?r:r+'=\"'+Qo(s)+'\"'))}const S=h.li;if(l){if(t&&\"html\"===c)throw x(29);if(l.ce?.length){const e=l.ce.join(\" \");y=y?`${e} ${y}`:e}2&l.fe&&(S.push(...l.li),l.fe&=-3)}if(t){if(32&s&&!(512&s)&&!No[c])throw xr(`<${c}> can not be rendered because one of its ancestor is a <p> or a <pre>.\\n\\nThis goes against the HTML spec: https://html.spec.whatwg.org/multipage/dom.html#phrasing-content-2`,e);if(\"table\"===c)s|=256;else{if(256&s&&!Io[c])throw xr(`The <table> element requires that its direct children to be '<tbody>', '<thead>', '<tfoot>' or '<caption>' instead, '<${c}>' was rendered.`,e);s&=-257}if(\"button\"===c){if(128&s)throw xr(`<${c}> can not be rendered because one of its ancestor is already a <button>.\\n\\nThis goes against the HTML spec: https://html.spec.whatwg.org/multipage/dom.html#interactive-content`,e);s|=128}if(\"a\"===c){if(64&s)throw xr(`<${c}> can not be rendered because one of its ancestor is already a <a>.\\n\\nThis goes against the HTML spec: https://html.spec.whatwg.org/multipage/dom.html#interactive-content`,e);s|=64}if(\"svg\"!==c&&\"math\"!==c||(s|=512),1&s&&!Ro[c])throw xr(`<${c}> can not be rendered because it's not a valid children of the <head> element. https://html.spec.whatwg.org/multipage/dom.html#metadata-content`,e);if(4&s&&!Lo[c])throw xr(`<${c}> can not be rendered because it's not a valid direct children of the <html> element, only <head> and <body> are allowed.`,e);Po[c]&&(s|=32)}if($&&(s|=1),To[c]&&(s|=16),Eo[c]&&(s|=8),y&&(b+=' class=\"'+Qo(y)+'\"'),S.length>0){const e=Re(S),t=0!=(16&s);for(const o of e){const e=t?Xo(o[0]):o[0];b+=\" \"+e+'=\"'+ne(o[1],h)+'\"',Oe(e,n.ke.re)}}if(null!=u&&(b+=' q:key=\"'+Qo(u)+'\"'),w||v||S.length>0){if(w||v||Do(S)){const e=On(n);b+=' q:id=\"'+e+'\"',h.ie=e}o.ke.ae.push(h)}if(1&s&&(b+=\" q:head\"),b+=\">\",r.write(b),Mo[c])return;if(null!=g)return r.write(String(g)),void r.write(`</${c}>`);\"html\"===c?s|=4:s&=-5,2&e.flags&&(s|=1024);const k=So(e.children,n,o,r,s);return J(k,(()=>{if($){for(const e of o.ke.Be)$o(e.type,e.props,r);o.ke.Be.length=0}if(i)return J(i(r),(()=>{r.write(`</${c}>`)}));r.write(`</${c}>`)}))}if(c===zn){const t=yo(111);return t.be=n.Le,t.ve=n.Ie,l&&8&l.fe&&Uo(l,t),ho(e,t,void 0,n,o,r,s,i)}if(c===Rn)return void r.write(e.props.data);if(c===Hn)return(async(e,t,n,o,r)=>{o.write(lo);const s=e.props.children;let i;if(T(s)){const e=s({write(e){o.write(e),o.write(lo)}});if(Q(e))return e;i=e}else i=s;for await(const e of i)await So(e,t,n,o,r,void 0),o.write(lo)})(e,n,o,r,s);if(c===Qn&&!0===e.props.dynamic)return void(o.ke.Ke=!0);const u=kt(o.Ze,c,e.props,e.key,e.flags);return Pn(u,e)?go(hr(zn,{children:u},e.key),n,o,r,s,i):So(u,n,o,r,s,i)},So=(e,t,n,o,r,s)=>{if(null!=e&&\"boolean\"!=typeof e){if(!O(e)&&\"number\"!=typeof e){if(vr(e))return go(e,t,n,o,r,s);if(C(e))return xo(e,t,n,o,r);if(nt(e)){const s=8&r,i=t.Le?.k;let c;if(i){if(!s){const n=On(t);return c=Mt(e,1024&r?[3,\"#\"+n,e,\"#\"+n]:[4,i,e,\"#\"+n]),void o.write(`\\x3c!--t=${n}--\\x3e${_o(En(c))}\\x3c!----\\x3e`)}c=kt(n.Ze,(()=>e.value))}return void o.write(_o(En(c)))}return Q(e)?(o.write(lo),e.then((e=>So(e,t,n,o,r,s)))):void w(\"A unsupported value was passed to the JSX, skipping render. Value:\",e)}o.write(_o(String(e)))}},xo=(e,t,n,o,r)=>{if(null==e)return;if(!C(e))return So(e,t,n,o,r);if(1===e.length)return So(e[0],t,n,o,r);if(0===e.length)return;let s=0;const i=[];return e.reduce(((e,c,l)=>{const u=[];i.push(u);const a=So(c,t,n,e?{write(e){s===l?o.write(e):u.push(e)}}:o,r),f=()=>{s++,i.length>s&&i[s].forEach((e=>o.write(e)))};return Q(a)&&e?Promise.all([a,e]).then(f):Q(a)?a.then(f):e?e.then(f):void s++}),void 0)},ko=(e,t)=>{if(null==e)return null;const n=qo(e,t),o=C(n)?n:[n];return 0===o.length?null:o},qo=(e,t)=>{if(null==e)return null;if(C(e))return e.flatMap((e=>qo(e,t)));if(vr(e)&&T(e.type)&&e.type!==Rn&&e.type!==Hn&&e.type!==zn){const n=kt(t.Ze,e.type,e.props,e.key,e.flags);return ko(n,t)}return e},jo=(e,t,n)=>{const o=Object.keys(n),r=ct();if(t.de=it(r,e.ke.re),0===o.length)return;const s=r[Xe]=n[Xe]??V;for(const e of o)\"children\"!==e&&e!==fe&&(nt(s[e])?r[We+e]=s[e]:r[e]=n[e])},Co=e=>\"htmlFor\"===e?\"for\":e,Oo=(e,t)=>\"class\"===e?jn(t):\"style\"===e?Cn(t):Mn(e)||\"draggable\"===e||\"spellcheck\"===e?null!=t?String(t):t:!1===t||null==t?null:!0===t?\"\":String(t),To={head:!0,style:!0,script:!0,link:!0,meta:!0},Eo={title:!0,style:!0,script:!0,noframes:!0,textarea:!0},Mo={area:!0,base:!0,basefont:!0,bgsound:!0,br:!0,col:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Po={p:!0,pre:!0},Lo={head:!0,body:!0},Io={tbody:!0,thead:!0,tfoot:!0,caption:!0,colgroup:!0},Ro={meta:!0,title:!0,link:!0,style:!0,script:!0,noscript:!0,template:!0,base:!0},No={a:!0,abbr:!0,area:!0,audio:!0,b:!0,bdi:!0,bdo:!0,br:!0,button:!0,canvas:!0,cite:!0,code:!0,command:!0,data:!0,datalist:!0,del:!0,dfn:!0,em:!0,embed:!0,i:!0,iframe:!0,img:!0,input:!0,ins:!0,itemprop:!0,kbd:!0,keygen:!0,label:!0,link:!0,map:!0,mark:!0,math:!0,meta:!0,meter:!0,noscript:!0,object:!0,option:!0,output:!0,picture:!0,progress:!0,q:!0,ruby:!0,s:!0,samp:!0,script:!0,select:!0,slot:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0,svg:!0,template:!0,textarea:!0,time:!0,u:!0,var:!0,video:!0,wbr:!0},zo=/[&<>]/g,Ao=/[&\"]/g,_o=e=>e.replace(zo,(e=>{switch(e){case\"&\":return\"&amp;\";case\"<\":return\"&lt;\";case\">\":return\"&gt;\";default:return\"\"}})),Qo=e=>e.replace(Ao,(e=>{switch(e){case\"&\":return\"&amp;\";case'\"':return\"&quot;\";default:return\"\"}})),Ho=/[>/=\"'\\u0009\\u000a\\u000c\\u0020]/,Jo=e=>Ho.test(e),Do=e=>e.some((e=>e[1].v&&e[1].v.length>0)),Uo=(e,t)=>{let n=e.$e;n||(e.$e=n=[]),n.includes(t)||n.push(t)},Xo=e=>\"on:qvisible\"===e?\"on-document:qinit\":e,Wo=(e,t,n)=>{const o=!(4&t.fe),r=t.k,s=e.ke.re;return s.N.delete(t),s.F.et(r),J(Sn(e,t),(s=>{const i=e.ke,c=s.rCtx,l=Ct(e.ke.we,r);if(i.Pe.add(r),l.B=[0,r],l.ge=c,o&&t.pe)for(const e of t.pe)Vt(i,e);const u=Go(s.node,l);return J(u,(e=>{const o=Bo(r,e),s=Fo(t);return J(Cr(c,s,o,\"root\",n),(()=>{t.me=o}))}))}))},Fo=e=>(e.me||(e.me=Ir(e.k)),e.me);class Vo{constructor(e,t,o,r,s,i){this.tt=e,this.de=t,this.nt=o,this.ot=r,this.fe=s,this.rt=i,this.st=null,this.it=\"\",this.ct=null,this.ie=e+(i?\":\"+i:\"\"),n(this)}}const Ko=(e,t)=>{const{key:n,type:o,props:r,children:s,flags:i,immutableProps:c}=e;let l=\"\";if(O(o))l=o;else{if(o!==zn){if(T(o)){const s=kt(t,o,r,n,i);return Pn(s,e)?Ko(dr(zn,{children:s},0,n),t):Go(s,t)}throw x(25,o)}l=sn}let u=F;return null!=s?J(Go(s,t),(e=>(void 0!==e&&(u=C(e)?e:[e]),new Vo(l,r,c,u,i,n)))):new Vo(l,r,c,u,i,n)},Bo=(e,t)=>{const n=void 0===t?F:C(t)?t:[t],o=new Vo(\":virtual\",{},null,n,0,null);return o.st=e,o},Go=(e,t)=>{if(null!=e&&\"boolean\"!=typeof e){if(Yo(e)){const t=new Vo(\"#text\",V,null,F,0,null);return t.it=String(e),t}if(vr(e))return Ko(e,t);if(nt(e)){const t=new Vo(\"#text\",V,null,F,0,null);return t.ct=e,t}if(C(e)){const n=D(e.flatMap((e=>Go(e,t))));return J(n,(e=>e.flat(100).filter(X)))}return Q(e)?e.then((e=>Go(e,t))):e===Ln?new Vo(pr,V,null,F,0,null):void w(\"A unsupported value was passed to the JSX, skipping render. Value:\",e)}},Yo=e=>O(e)||\"number\"==typeof e,Zo=e=>{\"paused\"===Se(e,$e)&&tr(e)},er=(e,t)=>{const n=JSON.parse(e);if(\"object\"!=typeof n)return null;const{_objs:r,_entry:s}=n;if(void 0===r||void 0===s)return null;let c={},l={};if(o(t)&&i(t)){const e=Ot(t);e&&(l=qe(e),c=e.ownerDocument)}const u=ai(l,c);for(let e=0;e<r.length;e++){const t=r[e];O(t)&&(r[e]=t===Ks?void 0:u.prepare(t))}const a=e=>r[Ee(e)];for(const e of r)or(e,a,u);return a(s)},tr=e=>{if(!s(n=e)||!n.hasAttribute($e))return void w(\"Skipping hydration because parent element is not q:container\");var n;const o=e._qwikjson_??(e=>{const t=_t(),n=e===t.documentElement?t.body:e,o=cr(n,\"type\");if(o){const e=o.firstChild.data;return JSON.parse(sr(e)||\"{}\")}})(e);if(e._qwikjson_=null,!o)return void w(\"Skipping hydration qwik/json metadata was not found.\");const r=_t(),i=e===r.documentElement?r.body:e;if(t&&!cr(i,\"type\"))return void w(\"Skipping hydration qwik/json metadata was not found.\");const c=ir(i),l=qe(e);rr(e,l);const u=new Map;let f=null,d=0;const h=r.createTreeWalker(e,128);for(;f=h.nextNode();){const e=f.data;if(0===d)if(e.startsWith(\"qv \")){const t=ar(e);t>=0&&u.set(t,f)}else if(e.startsWith(\"t=\")){const t=e.slice(2),n=Ee(t);u.set(n,lr(f))}\"cq\"===e?d++:\"/cq\"===e&&d--}const p=0!==e.getElementsByClassName(\"qc📦\").length;e.querySelectorAll(\"[q\\\\:id]\").forEach((t=>{if(p&&t.closest(\"[q\\\\:container]\")!==e)return;const n=Se(t,we);N(n,\"resume: element missed q:id\",t);const o=Ee(n);u.set(o,t)}));const m=ai(l,r),$=new Map,b=new Set,v=e=>(A(\"string\"==typeof e&&e.length>0,\"resume: id must be an non-empty string, got:\",e),$.has(e)?$.get(e):g(e)),g=e=>{if(e.startsWith(ye)){const t=e.slice(ye.length),n=Ee(t);A(u.has(n),\"missing element for id:\",t);const o=u.get(n);if(N(o,\"missing element for id:\",t),a(o)){if(!o.isConnected)return void $.set(e,void 0);const t=an(o),n=new cn(o,t);return $.set(e,n),pt(n,l),n}return s(o)?($.set(e,o),pt(o,l),o):($.set(e,o),o)}if(e.startsWith(\"@\")){const t=e.slice(\"@\".length),n=Ee(t),o=c[n];return N(o,\"missing inlined function for id:\",t),o}const t=Ee(e),n=o.objs;A(n.length>t,\"resume: index is out of bounds\",e);let r=n[t];O(r)&&(r=r===Ks?void 0:m.prepare(r));let i=r;for(let t=e.length-1;t>=0;t--){const n=e[t],o=fi[n];if(!o)break;i=o(i,l)}return $.set(e,i),Yo(r)||b.has(t)||(b.add(t),nr(r,t,o.subs,v,l,m),or(r,v,m)),i};l.T=1e5,l.W={getObject:v,meta:o.ctx,refs:o.refs},ge(e,$e,\"resumed\"),y(\"Container resumed\"),((e,t,n,o)=>{e&&\"function\"==typeof CustomEvent&&e.dispatchEvent(new CustomEvent(\"qresume\",{detail:void 0,bubbles:!0,composed:!0}))})(e)},nr=(e,t,n,o,r,s)=>{const i=n[t];if(i){const t=[];let n=0;for(const e of i)if(e.startsWith(\"_\"))n=parseInt(e.slice(1),10);else{const n=Ti(e,o);n&&t.push(n)}if(n>0&&lt(e,n),!s.subs(e,t)){const n=r.M.get(e);n?ji(n).lt(t):it(e,r,t)}}},or=(e,t,n)=>{if(!n.fill(e,t)&&e&&\"object\"==typeof e)if(C(e))for(let n=0;n<e.length;n++)e[n]=t(e[n]);else if(q(e))for(const n of Object.keys(e))e[n]=t(e[n])},rr=(e,t)=>{const n=e.ownerDocument.head;e.querySelectorAll(\"style[q\\\\:style]\").forEach((e=>{t.A.add(Se(e,pe)),n.appendChild(e)}))},sr=e=>e.replace(/\\\\x3C(\\/?script)/g,\"<$1\"),ir=e=>{const t=cr(e,\"q:func\");return t?.qFuncs??F},cr=(e,t)=>{let n=e.lastElementChild;for(;n;){if(\"SCRIPT\"===n.tagName&&\"qwik/json\"===Se(n,t))return n;n=n.previousElementSibling}},lr=e=>{const t=e.nextSibling;if(u(t))return t;{const t=e.ownerDocument.createTextNode(\"\");return e.parentElement.insertBefore(t,e),t}},ur=e=>{e.qwik={pause:()=>(async(e,n)=>{const i=_t(),c=i.documentElement,l=r(e)?c:e;if(\"paused\"===Se(l,$e))throw x(21);const f=l===i.documentElement?i.body:l,d=qe(l),h=((e,t)=>{const n=[],o=t(e);void 0!==o&&n.push(o);const r=e.ownerDocument.createTreeWalker(e,129,{acceptNode(e){if(s(o=e)&&o.hasAttribute($e))return 2;var o;const r=t(e);return void 0!==r&&n.push(r),3}});for(;r.nextNode(););return n})(l,no);ge(l,$e,\"paused\");for(const e of h){const t=e.k,n=e.li;if(e.ce){const n=Dn(e.ce);n&&t.setAttribute(me,n)}if(e.ie&&t.setAttribute(we,e.ie),s(t)&&n.length>0){const o=Re(n);for(const n of o)t.setAttribute(n[0],ne(n[1],e))}}const p=await Xn(h,d,(e=>o(e)&&u(e)?((e,t)=>{const n=e.previousSibling;if(n&&a(n)&&n.data.startsWith(\"t=\"))return ye+n.data.slice(2);const o=e.ownerDocument,r=Te(t.T++),s=o.createComment(`t=${r}`),i=o.createComment(\"\"),c=e.parentElement;return c.insertBefore(s,e),c.insertBefore(i,e.nextSibling),ye+r})(e,d):null)),m=i.createElement(\"script\");ge(m,\"type\",\"qwik/json\"),m.textContent=JSON.stringify(p.state,void 0,t?\"  \":void 0).replace(/<(\\/?script)/g,\"\\\\x3C$1\"),f.appendChild(m);const $=Array.from(d.H,(e=>JSON.stringify(e))),b=i.createElement(\"script\");return b.textContent=`window.qwikevents||=[];window.qwikevents.push(${$.join(\", \")})`,f.appendChild(b),p})(e),state:qe(e)}},ar=e=>{const t=e.indexOf(\"q:id=\");return t>0?Ee(e.slice(t+5)):-1},fr=(e,o,r,s,i,c,l)=>{const u=null==c?null:String(c),a=new mr(e,o??V,r,s,i,u);return t&&l&&(a.dev={stack:(new Error).stack,...l}),$r(a),n(a),a},dr=(e,o,r,s,i)=>{const c=null==s?null:String(s),l=o??V,u=new mr(e,l,null,l.children,r,c);return\"string\"==typeof e&&o&&delete o.children,t&&i&&(u.dev={stack:(new Error).stack,...i}),$r(u),n(u),u},hr=(e,o,r)=>{const s=null==r?null:String(r),i=Tt((()=>{const t=o.children;return\"string\"==typeof e&&delete o.children,t}));O(e)&&\"className\"in o&&(o.class=o.className,delete o.className,t&&v(\"jsx: `className` is deprecated. Use `class` instead.\"));const c=new mr(e,o,null,i,0,s);return $r(c),n(c),c},pr=\":skipRender\";class mr{constructor(e,t,n,o,r,s=null){this.type=e,this.props=t,this.immutableProps=n,this.children=o,this.flags=r,this.key=s}}const $r=e=>{const{type:n,props:o,immutableProps:r,children:s}=e;t&&kt(void 0,(()=>{if(o&&r){const e=Object.keys(o),t=Object.keys(r),n=e.filter((e=>t.includes(e)));n.length>0&&v(`JSX is receiving duplicate props (${n.join(\", \")}). This is likely because you are spreading {...props}, make sure the props you are spreading are not already defined in the JSX.`)}const t=Xi(n);if(!O(n)&&!T(n))throw xr(`The <Type> of the JSX element must be either a string or a function. Instead, it's a \"${typeof n}\": ${String(n)}.`,e);if(s){const o=C(s)?s.flat():[s];if((O(n)||t)&&o.forEach((t=>{if(!wr(t)){const o=typeof t;let r=\"\";throw\"object\"===o?r=t?.constructor?`it's an instance of \"${t?.constructor.name}\".`:`it's a object literal: ${br(t)} `:\"function\"===o?r+=`it's a function named \"${t.name}\".`:r=`it's a \"${o}\": ${String(t)}.`,xr(`One of the children of <${n}> is not an accepted value. JSX children must be either: string, boolean, number, <element>, Array, undefined/null, or a Promise/Signal. Instead, ${r}\\n`,e)}})),T(n)||r){const e={};o.forEach((t=>{if(vr(t)&&null!=t.key){const n=String(t.type)+\":\"+t.key;if(e[n]){const e=xr(\"Multiple JSX sibling nodes with the same key.\\nThis is likely caused by missing a custom key in a for loop\",t);e&&(O(t.type),v(e))}else e[n]=!0}}))}}if(o)for(const n of Object.keys(o)){const r=o[n];if(n.endsWith(\"$\")&&r&&!Li(r)&&!Array.isArray(r))throw xr(`The value passed in ${n}={...}> must be a QRL, instead you passed a \"${typeof r}\". Make sure your ${typeof r} is wrapped with $(...), so it can be serialized. Like this:\\n$(${String(r)})`,e);\"children\"!==n&&t&&r&&pi(r,`The value of the JSX attribute \"${n}\" can not be serialized`)}O(n)&&(\"style\"===n&&s&&v(\"jsx: Using <style>{content}</style> will escape the content, effectively breaking the CSS.\\nIn order to disable content escaping use '<style dangerouslySetInnerHTML={content}/>'\\n\\nHowever, if the use case is to inject component styleContent, use 'useStyles$()' instead, it will be a lot more efficient.\\nSee https://qwik.builder.io/docs/core/styles/#usestyles for more information.\"),\"script\"===n&&s&&v(\"jsx: Using <script>{content}<\\/script> will escape the content, effectively breaking the inlined JS.\\nIn order to disable content escaping use '<script dangerouslySetInnerHTML={content}/>'\"))}))},br=e=>`{ ${Object.keys(e).map((e=>`\"${e}\"`)).join(\", \")} }`,vr=e=>t?e instanceof mr||!!(j(e)&&\"key\"in e&&\"props\"in e&&\"type\"in e)&&(w('Duplicate implementations of \"JSXNode\" found'),!0):e instanceof mr,wr=e=>!e||e===Ln||!(!O(e)&&\"number\"!=typeof e&&\"boolean\"!=typeof e)||!!vr(e)||(C(e)?e.every(wr):nt(e)?wr(e.value):!!Q(e)),yr=e=>e.children,gr=(e,o,r,s,i,c)=>{const l=null==r?null:String(r),u=Tt((()=>{const t=o.children;return\"string\"==typeof e&&delete o.children,t}));O(e)&&\"className\"in o&&(o.class=o.className,delete o.className,t&&v(\"jsx: `className` is deprecated. Use `class` instead.\"));const a=new mr(e,o,null,u,0,l);return a.dev={stack:(new Error).stack,...i},$r(a),n(a),a},Sr=new Set,xr=(e,t)=>{const n=new Error(e);if(!t.dev)return n;const o=t.dev.fileName,r=`${e}${o}:${t.dev.lineNumber}:${t.dev.columnNumber}`;return Sr.has(r)?void 0:(Object.assign(n,{id:o,loc:{file:o,column:t.dev.columnNumber,line:t.dev.lineNumber}}),n.stack=`JSXError: ${e}\\n${kr(t.dev.stack,1)}`,Sr.add(r),n)},kr=(e,t=0)=>e.split(\"\\n\").slice(t).filter((e=>!e.includes(\"/node_modules/@builder.io/qwik\")&&!e.includes(\"(node:\"))).join(\"\\n\"),qr=\"http://www.w3.org/2000/svg\",jr=[],Cr=(e,t,n,o,r)=>{f(t.st);const s=n.ot;if(1===s.length&&s[0].tt===pr)return;const i=t.st;t.ot===jr&&\"HEAD\"===i.nodeName&&(o=\"head\",r|=2);const c=Or(t,o);return c.length>0&&s.length>0?Tr(e,i,c,s,r):c.length>0&&0===s.length?Hr(e.ke,c,0,c.length-1):s.length>0?Qr(e,i,null,s,0,s.length-1,r):void 0},Or=(e,t)=>{const n=e.ot,o=e.st;return n===jr?e.ot=Pr(o,t):n},Tr=(e,t,n,o,r)=>{let s,i,c,l=0,u=0,a=n.length-1,f=n[0],d=n[a],h=o.length-1,p=o[0],m=o[h];const $=[],b=e.ke;for(;l<=a&&u<=h;)if(null==f)f=n[++l];else if(null==d)d=n[--a];else if(null==p)p=o[++u];else if(null==m)m=o[--h];else if(f.ie===p.ie)$.push(Ar(e,f,p,r)),f=n[++l],p=o[++u];else if(d.ie===m.ie)$.push(Ar(e,d,m,r)),d=n[--a],m=o[--h];else if(f.rt&&f.ie===m.ie)N(f.st,\"oldStartVnode $elm$ must be defined\"),N(d.st,\"oldEndVnode $elm$ must be defined\"),$.push(Ar(e,f,m,r)),Wt(b,t,f.st,d.st),f=n[++l],m=o[--h];else if(d.rt&&d.ie===p.ie)N(f.st,\"oldStartVnode $elm$ must be defined\"),N(d.st,\"oldEndVnode $elm$ must be defined\"),$.push(Ar(e,d,p,r)),Xt(b,t,d.st,f.st),d=n[--a],p=o[++u];else{if(void 0===s&&(s=ss(n,l,a)),i=s[p.rt],void 0===i){const n=Ur(e,p,r,$);Xt(b,t,n,f?.st)}else if(c=n[i],c.tt!==p.tt){const n=Ur(e,p,r,$);J(n,(e=>{Xt(b,t,e,f?.st)}))}else $.push(Ar(e,c,p,r)),n[i]=void 0,N(c.st,\"elmToMove $elm$ must be defined\"),Xt(b,t,c.st,f.st);p=o[++u]}if(u<=h){const n=null==o[h+1]?null:o[h+1].st;$.push(Qr(e,t,n,o,u,h,r))}let v=D($);return l<=a&&(v=J(v,(()=>{Hr(b,n,l,a)}))),v},Er=(e,t)=>{const n=l(e)?e.close:null,o=[];let r=e.firstChild;for(;(r=ln(r))&&(t(r)&&o.push(r),r=r.nextSibling,r!==n););return o},Mr=(e,t)=>{switch(t){case\"root\":return Er(e,zr);case\"head\":return Er(e,Rr);case\"elements\":return Er(e,c)}},Pr=(e,t)=>Mr(e,t).map(Lr),Lr=e=>s(e)?ht(e)?.me??Ir(e):Ir(e),Ir=e=>{if(i(e)){const t=new Vo(e.localName,{},null,jr,0,tn(e));return t.st=e,t}if(u(e)){const t=new Vo(e.nodeName,V,null,jr,0,null);return t.it=e.data,t.st=e,t}throw new Error(\"invalid node\")},Rr=e=>{const t=e.nodeType;return 1===t?e.hasAttribute(\"q:head\"):111===t},Nr=e=>\"Q:TEMPLATE\"===e.nodeName,zr=e=>{const t=e.nodeType;if(3===t||111===t)return!0;if(1!==t)return!1;const n=e.nodeName;return\"Q:TEMPLATE\"!==n&&(\"HEAD\"!==n||e.hasAttribute(\"q:head\"))},Ar=(e,n,o,r)=>{z(n.tt,o.tt,\"old and new vnodes type must be the same\"),z(n.rt,o.rt,\"old and new vnodes key must be the same\"),z(n.ie,o.ie,\"old and new vnodes key must be the same\");const s=n.st,i=o.tt,c=e.ke,l=e.Le;if(N(s,\"while patching element must be defined\"),N(l,\"while patching current component must be defined\"),o.st=s,\"#text\"===i){e.ke.Re.push(s);const t=o.ct;return t&&(o.it=En(Mt(t,[4,l.k,t,s]))),void Jt(c,s,\"data\",o.it)}f(s);const u=o.de,a=o.fe,h=pt(s,e.ke.re);if(i!==sn){let f=0!=(1&r);if(f||\"svg\"!==i||(r|=1,f=!0),u!==V){0==(1&a)&&(h.li.length=0);const e=n.de;o.de=e;const t=Object.keys(u);for(const n of t){let t=u[n];\"ref\"!==n?Ie(n)?is(c,h,n,t):(nt(t)&&(t=Mt(t,[1,l.k,t,s,n])),\"class\"===n?t=qn(t,l):\"style\"===n&&(t=Cn(t)),e[n]!==t&&(e[n]=t,Gr(c,s,n,t,f))):(d(s),Ce(t,s))}}if(2&a)return;if(f&&\"foreignObject\"===i&&(r&=-2),void 0!==u[Kr])return void(t&&o.ot.length>0&&w(\"Node can not have children when innerHTML is set\"));if(\"textarea\"===i)return;return Cr(e,n,o,\"root\",r)}if(ue in u){const t=u.props;Zr(h,e,t);let n=!!(1&h.fe);return n||h.t||h.k.hasAttribute(we)||(Tn(e,h),h.t=t[ue],Ni(h.t),n=!0),n?J(Wo(e,h,r),(()=>_r(e,h,o,r))):_r(e,h,o,r)}return he in u?(N(l.he,\"current component slots must be a defined array\"),void l.he.push(o)):2&a?void 0:Cr(e,n,o,\"root\",r)},_r=(e,t,n,o)=>{if(2&n.fe)return;const r=n.ot,s=e.ke,i=(e=>{const t={};for(const n of e){const e=Dr(n);(t[e]??(t[e]=new Vo(sn,{[he]:\"\"},null,[],0,e))).ot.push(n)}return t})(r),c=Xr(t);for(const e of Object.keys(c.slots))if(!i[e]){const t=c.slots[e],n=Pr(t,\"root\");if(n.length>0){const e=ht(t);e&&e.me&&(e.me.ot=[]),Hr(s,n,0,n.length-1)}}for(const e of Object.keys(c.templates)){const t=c.templates[e];t&&!i[e]&&(c.templates[e]=void 0,Gt(s,t))}return D(Object.keys(i).map((n=>{const r=i[n],l=Jr(s,c,t,n,e.ke.re),u=Fo(l),a=kn(e);a.Ie=l,l.me=r,r.st=l.k;const f=s.Me.findIndex((e=>e[0]===l.k));return f>=0&&s.Me.splice(f,1),Cr(a,u,r,\"root\",o)})))},Qr=(e,t,n,o,r,s,i)=>{const c=[];for(;r<=s;++r){const s=o[r];N(s,\"render: node must be defined at index\",r,o);const l=Ur(e,s,i,c);Xt(e.ke,t,l,n)}return U(c)},Hr=(e,t,n,o)=>{for(;n<=o;++n){const o=t[n];o&&(N(o.st,\"vnode elm must be defined\"),Gt(e,o.st))}},Jr=(e,t,n,o,r)=>{const s=t.slots[o];if(s)return pt(s,r);const i=t.templates[o];if(i)return pt(i,r);const c=Zt(e.Ee,o),l=mt(c);return l.be=n,((e,t,n)=>{e.qe.push({je:Bt,ne:[t,n]})})(e,n.k,c),t.templates[o]=c,l},Dr=e=>e.de[fe]??\"\",Ur=(e,n,o,r)=>{const s=n.tt,i=e.ke.Ee,c=e.Le;if(\"#text\"===s){const e=n.ct,t=i.createTextNode(n.it);if(e){N(c,\"signals can not be used outside components\");const r=4&o?[3,t,e,t]:[4,c.k,e,t];t.data=n.it=En(Mt(e,r))}return n.st=t}let l,u=!!(1&o);u||\"svg\"!==s||(o|=1,u=!0);const a=s===sn,f=n.de,d=e.ke;a?l=(e=>{const t=e.createComment(\"qv \"),n=e.createComment(\"/qv\");return new cn(t,n)})(i):\"head\"===s?(l=i.head,o|=2):(l=Ut(i,s,u),o&=-3),2&n.fe&&(o|=4),n.st=l;const h=mt(l);if(h.be=e.Le,h.ve=e.Ie,a){if(ue in f){const s=f[ue];Ni(s);const i=e.ke.re,c=ct(),u=i.F.K(),a=new Proxy(c,new at(i,u)),p=f.props;if(i.M.set(c,a),h.de=a,p!==V){const e=Object.keys(p),t=c[Xe]=p[Xe]??V;for(const n of e)if(\"children\"!==n&&n!==fe){const e=t[n];nt(e)?c[We+n]=e:c[n]=p[n]}}if(Tn(e,h),t){const e=s.o;e&&ge(l,\"data-qrl\",e)}h.t=s;const m=J(Wo(e,h,o),(()=>{let t=n.ot;if(0===t.length)return;1===t.length&&t[0].tt===pr&&(t=t[0].ot);const r=Xr(h),s=[];for(const n of t){const t=Jr(d,r,h,Dr(n),d.re),i=kn(e);i.Ie=t;const c=Ur(i,n,o,s);N(n.st,\"vnode elm must be defined\"),z(c,n.st,\"vnode elm must be defined\"),Ft(d,t.k,c)}return U(s)}));return Q(m)&&r.push(m),l}he in f&&(N(c,\"slot can only be used inside component\"),N(c.he,\"current component slots must be a defined array\"),p=l,null!==(m=n.rt)&&ge(p,\"q:key\",m),ge(l,de,c.ie),ge(l,he,\"\"),c.he.push(n),d.Me.push([l,c.k]))}else{if(n.nt&&Yr(d,h,c,n.nt,u,!0),f!==V&&(h.me=n,n.de=Yr(d,h,c,f,u,!1)),u&&\"foreignObject\"===s&&(u=!1,o&=-2),c){const e=c.ce;e&&e.forEach((e=>{l.classList.add(e)})),2&c.fe&&(h.li.push(...c.li),c.fe&=-3)}if(void 0!==f[Kr])return t&&n.ot.length>0&&w(\"Node can not have children when innerHTML is set\"),l;u&&\"foreignObject\"===s&&(u=!1,o&=-2)}var p,m;let $=n.ot;if(0===$.length)return l;1===$.length&&$[0].tt===pr&&($=$[0].ot);const b=$.map((t=>Ur(e,t,o,r)));for(const e of b)ts(l,e);return l},Xr=e=>{const t=(e=>e.he||(N(e.k.parentElement,\"component should be already attached to the dom\"),e.he=Wr(e)))(e),n={},o={},r=Array.from(e.k.childNodes).filter(Nr);for(const e of t)f(e.st),n[e.rt??\"\"]=e.st;for(const e of r)o[Se(e,fe)??\"\"]=e;return{slots:n,templates:o}},Wr=e=>{const t=e.k.parentElement;return N(t,\"component should be already attached to the dom\"),((e,t,n)=>{const o=((e,t,n)=>e.ownerDocument.createTreeWalker(e,128,{acceptNode(e){const o=un(e);return o&&Se(o,t)===n?1:2}}))(e,t,n),r=[];let s=null;for(;s=o.nextNode();)r.push(un(s));return r})(t,de,e.ie).map(Ir)},Fr=(e,t,n,o)=>(n in t&&t[n]!==o&&Jt(e,t,n,o),!0),Vr=(e,t,n,o)=>(Qt(e,t,n.toLowerCase(),o),!0),Kr=\"dangerouslySetInnerHTML\",Br={style:(e,t,n,o)=>(Jt(e,t.style,\"cssText\",o),!0),class:(e,t,n,o)=>(A(null==o||\"string\"==typeof o,\"class newValue must be either nullish or string\",o),t.namespaceURI===qr?Qt(e,t,\"class\",o):Jt(e,t,\"className\",o),!0),value:Fr,checked:Fr,href:Vr,list:Vr,form:Vr,tabIndex:Vr,download:Vr,[Kr]:(e,t,n,o)=>(Kr in t?Jt(e,t,Kr,o):\"innerHTML\"in t&&Jt(e,t,\"innerHTML\",o),!0),innerHTML:()=>!0},Gr=(e,t,n,o,r)=>{if(Mn(n))return void Qt(e,t,n,null!=o?String(o):o);const s=Br[n];s&&s(e,t,n,o)||(r||!(n in t)?(n.startsWith(Le)&&Oe(n.slice(Le.length),e.re),Qt(e,t,n,o)):Jt(e,t,n,o))},Yr=(e,n,o,r,s,i)=>{const c={},l=n.k,u=Object.keys(r);for(const a of u){let u=r[a];if(\"ref\"!==a)if(Ie(a))is(e,n,a,u);else{if(nt(u)&&(N(o,\"Signals can only be used in components\"),u=Mt(u,i?[1,l,u,o.k,a]:[2,o.k,u,l,a])),\"class\"===a){if(t&&c.class)throw new TypeError(\"Can only provide one of class or className\");if(u=qn(u,o),!u)continue}else\"style\"===a&&(u=Cn(u));c[a]=u,Gr(e,l,a,u,s)}else d(l),Ce(u,l)}return c},Zr=(e,t,n)=>{let o=e.de;if(o||(e.de=o=it(ct(),t.ke.re)),n===V)return;const r=Object.keys(n),s=ji(o);N(s,\"props have to be a proxy, but it is not\",o);const i=qi(o);N(i,\"props have to be a proxy, but it is not\",o);const c=i[Xe]=n[Xe]??V;for(const e of r)if(\"children\"!==e&&e!==fe&&!c[e]){const t=n[e];i[e]!==t&&(i[e]=t,s.ee(e))}},es=(e,t,n,o)=>{if(n.et(e),i(e)){if(o&&e.hasAttribute(he))return void t.Oe.push(e);const r=ht(e);r&&((e,t)=>{e.ue?.forEach((e=>{t.et(e),zs(e)})),e.t=null,e.le=null,e.ue=null})(r,n);const s=l(e)?e.close:null;let i=e.firstChild;for(;(i=ln(i))&&(es(i,t,n,!0),i=i.nextSibling,i!==s););}},ts=(e,t)=>{l(t)?t.appendTo(e):e.appendChild(t)},ns=(e,t)=>{l(t)?t.remove():e.removeChild(t)},os=(e,t,n)=>{l(t)?t.insertBeforeTo(e,fn(n)?.nextSibling):e.insertBefore(t,fn(n)?.nextSibling)},rs=(e,t,n)=>{l(t)?t.insertBeforeTo(e,fn(n)):e.insertBefore(t,fn(n))},ss=(e,t,n)=>{const o={};for(let r=t;r<=n;++r){const t=e[r].rt;null!=t&&(o[t]=r)}return o},is=(e,t,n,o)=>{const r=e.re,s=Ne(t.li,n,o,r.O);n.startsWith(\"on\")||Qt(e,t.k,s,\"\"),Oe(s)},cs=()=>{const e=gt();let t=e.xe;if(t)Ni(t),N(t.v,\"invoke: qrl $captureRef$ must be defined inside useLexicalScope()\",t);else{const n=e.k;N(n,\"invoke: element must be defined inside useLexicalScope()\",e);const o=Ot(n);N(o,\"invoke: cant find parent q:container of\",n),t=oe(decodeURIComponent(String(e.Se)),o),Ni(t),Zo(o);const r=pt(n,qe(o));ie(t,r)}return t.v},ls=(e,t)=>{if(0===e[0]){const n=e[1];Qs(n)?fs(n,t):us(n,t)}else as(e,t)},us=(e,t)=>{Zo(t.O);const n=pt(e,t);N(n.t,\"render: notified host element must have a defined $renderQrl$\",n),1&n.fe||(n.fe|=1,void 0!==t.X?t.N.add(n):(t.R.add(n),ds(t)))},as=(e,t)=>{const n=void 0!==t.X;t.P.add(e),n||ds(t)},fs=(e,t)=>{e.fe&ks||(e.fe|=ks,void 0!==t.X?t.I.add(e):(t.L.add(e),ds(t)))},ds=e=>(void 0===e.U&&(e.U=R().nextTick((()=>ps(e)))),e.U),hs=()=>{const[e]=cs();fs(e,qe(Ot(e.ut)))},ps=async e=>{const n=_t(e.O);try{const o=xn(n,e),r=o.ke,s=e.X=new Set(e.R);e.R.clear(),await bs(e,o),e.N.forEach((e=>{s.add(e)})),e.N.clear();const i=Array.from(e.P);e.P.clear();const c=Array.from(s);ws(c);for(const e of c){const n=e.k;if(!r.Pe.has(n)&&e.t){A(n.isConnected,\"element must be connected to the dom\"),r.Te.push(e);try{await Wo(o,e,ms(n.parentElement))}catch(e){if(t)throw e;p(e)}}}return i.forEach((e=>{((e,t)=>{try{const n=t[0];switch(n){case 1:case 2:{let o,r;1===n?(o=t[1],r=t[3]):(o=t[3],r=t[1]);const s=ht(o);if(null==s)return;const i=t[4],c=o.namespaceURI===qr;let l=t[2].value;\"class\"===i?l=qn(l,ht(r)):\"style\"===i&&(l=Cn(l));const u=Fo(s);if(u.de[i]===l)return;return u.de[i]=l,Gr(e,o,i,l,c)}case 3:case 4:{const n=t[3];if(!e.Re.includes(n)){const o=t[2].value;return Jt(e,n,\"data\",En(o))}}}}catch(e){}})(r,e)})),r.qe.push(...r.Ce),0===r.qe.length?(on(r),void await $s(e,o)):((({ke:e})=>{en(e)})(o),on(r),$s(e,o))}catch(e){p(e)}},ms=e=>{let t=0;return e&&(e.namespaceURI===qr&&(t|=1),\"HEAD\"===e.tagName&&(t|=2)),t},$s=async(e,t)=>{const n=t.ke.Pe;await vs(e,t,((e,t)=>0!=(e.fe&gs)&&(!t||n.has(e.ut)))),e.N.forEach((t=>{e.R.add(t)})),e.N.clear(),e.X=void 0,e.U=void 0,e.R.size+e.L.size+e.P.size>0&&(e.U=ps(e))},bs=async(e,t)=>{const n=e.O,o=[],r=[],s=e=>0!=(e.fe&Ss),i=e=>0!=(e.fe&xs);e.L.forEach((t=>{s(t)&&(r.push(J(t.xe.ft(n),(()=>t))),e.L.delete(t)),i(t)&&(o.push(J(t.xe.ft(n),(()=>t))),e.L.delete(t))}));do{if(e.I.forEach((t=>{s(t)?r.push(J(t.xe.ft(n),(()=>t))):i(t)?o.push(J(t.xe.ft(n),(()=>t))):e.L.add(t)})),e.I.clear(),r.length>0){const n=await Promise.all(r);ys(n),await Promise.all(n.map((n=>Ps(n,e,t)))),r.length=0}}while(e.I.size>0);if(o.length>0){const n=await Promise.all(o);ys(n),n.forEach((n=>Ps(n,e,t)))}},vs=async(e,t,n)=>{const o=[],r=e.O;e.L.forEach((t=>{n(t,!1)&&(o.push(J(t.xe.ft(r),(()=>t))),e.L.delete(t))}));do{if(e.I.forEach((t=>{n(t,!0)?o.push(J(t.xe.ft(r),(()=>t))):e.L.add(t)})),e.I.clear(),o.length>0){const n=await Promise.all(o);ys(n);for(const o of n)await Ps(o,e,t);o.length=0}}while(e.I.size>0)},ws=e=>{e.sort(((e,t)=>2&e.k.compareDocumentPosition(fn(t.k))?1:-1))},ys=e=>{e.sort(((e,t)=>e.ut===t.ut?e.dt<t.dt?-1:1:0!=(2&e.ut.compareDocumentPosition(fn(t.ut)))?1:-1))},gs=1,Ss=2,xs=4,ks=16,qs=(e,t)=>{const{get:n,set:o,iCtx:r,i:s,elCtx:i}=At();if(n)return;Ni(e);const c=r.ge.ke.re,l=new Hs(ks|Ss,s,i.k,e,void 0);o(!0),e.ft(c.O),i.ue||(i.ue=[]),i.ue.push(l),qt(r,(()=>Is(l,c,r.ge)))},js=e=>{const{get:t,set:n,iCtx:o,i:r,elCtx:s}=At();if(t)return t;Ni(e);const i=o.ge.ke.re,c=Ke(void 0,i,3,void 0),l=new Hs(ks|Ss|8,r,s.k,e,c);return e.ft(i.O),s.ue||(s.ue=[]),s.ue.push(l),qt(o,(()=>Rs(l,i,o.ge))),n(c)},Cs=e(js),Os=/*#__PURE__*/e(qs),Ts=(e,t)=>{const{get:n,set:o,i:r,iCtx:s,elCtx:i}=At(),c=t?.strategy??\"intersection-observer\";if(n)return;Ni(e);const l=new Hs(gs,r,i.k,e,void 0),u=s.ge.ke.re;i.ue||(i.ue=[]),i.ue.push(l),o(l),As(l,c),e.ft(u.O),fs(l,u)},Es=/*#__PURE__*/e(Ts),Ms=e=>0!=(e.fe&xs),Ps=async(e,t,n)=>(z(!!(e.fe&ks),!0,\"Resource is not dirty\",e),Ms(e)?Ls(e,t,n):(e=>0!=(8&e.fe))(e)?Rs(e,t,n):Is(e,t,n)),Ls=(e,t,n,o)=>{e.fe&=~ks,Ns(e);const r=e.ut,s=Ct(n.ke.we,r,void 0,\"WatchEvent\"),{F:i}=t,c=e.xe.getFn(s,(()=>{i.et(e)})),l=[],u=e.Qe;N(u,'useResource: when running a resource, \"watch.r\" must be a defined.',e);const a=ki(u),f={track:(t,n)=>{if(T(t)){const n=Ct();return n.B=[0,e],kt(n,t)}const o=ji(t);return o?o.G([0,e],n):$(k(26),t),n?t[n]:nt(t)?t.value:t},cleanup(e){l.push(e)},cache(e){let t=0;t=\"immutable\"===e?1/0:e,u._cache=t},previous:a._resolved};let d,h,p=!1;const m=(e,t)=>!p&&(p=!0,e?(p=!0,u.loading=!1,u._state=\"resolved\",u._resolved=t,u._error=void 0,d(t)):(p=!0,u.loading=!1,u._state=\"rejected\",u._error=t,h(t)),!0);kt(s,(()=>{u._state=\"pending\",u.loading=!0,u.value=new Promise(((e,t)=>{d=e,h=t}))})),e.ht=gi((()=>{p=!0,l.forEach((e=>e()))}));const b=H((()=>J(o,(()=>c(f)))),(e=>{m(!0,e)}),(e=>{m(!1,e)})),v=a._timeout;return v>0?Promise.race([b,W(v).then((()=>{m(!1,new Error(\"timeout\"))&&Ns(e)}))]):b},Is=(e,t,n)=>{e.fe&=~ks,Ns(e);const o=e.ut,r=Ct(n.ke.we,o,void 0,\"WatchEvent\"),{F:s}=t,i=e.xe.getFn(r,(()=>{s.et(e)})),c=[];e.ht=gi((()=>{c.forEach((e=>e()))}));const l={track:(t,n)=>{if(T(t)){const n=Ct();return n.B=[0,e],kt(n,t)}const o=ji(t);return o?o.G([0,e],n):$(k(26),t),n?t[n]:t},cleanup(e){c.push(e)}};return H((()=>i(l)),(e=>{T(e)&&c.push(e)}),(e=>{yn(e,o,n)}))},Rs=(e,n,o)=>{!function(e){if(t&&!nt(e))throw new Error(\"Not a Signal\")}(e.Qe),e.fe&=~ks,Ns(e);const r=e.ut,s=Ct(o.ke.we,r,void 0,\"ComputedEvent\");s.B=[0,e];const{F:i}=n,c=e.xe.getFn(s,(()=>{i.et(e)}));return H(c,(t=>Tt((()=>{const n=e.Qe;n[Be]&=-3,n.untrackedValue=t,n[Ue].ee()}))),(e=>{yn(e,r,o)}))},Ns=e=>{const t=e.ht;if(t){e.ht=void 0;try{t()}catch(e){p(e)}}},zs=e=>{32&e.fe?(e.fe&=-33,(0,e.xe)()):Ns(e)},As=(e,t)=>{\"visible\"===t||\"intersection-observer\"===t?It(\"qvisible\",_s(e)):\"load\"===t||\"document-ready\"===t?Rt(\"qinit\",_s(e)):\"idle\"!==t&&\"document-idle\"!==t||Rt(\"qidle\",_s(e))},_s=e=>{const t=e.xe;return Ii(t.l,\"_hW\",hs,null,null,[e],t.o)},Qs=e=>j(e)&&e instanceof Hs;class Hs{constructor(e,t,n,o,r){this.fe=e,this.dt=t,this.ut=n,this.xe=o,this.Qe=r}}const Js=(e,t)=>{const{get:n,set:o,i:r,iCtx:s,elCtx:i}=At();if(null!=n)return n;Ni(e);const c=s.ge.ke.re,l=Ws(c,t),u=i.k,a=new Hs(ks|xs,r,u,e,l),f=Promise.all(s.ye.slice());return Ls(a,c,s.ge,f),i.ue||(i.ue=[]),i.ue.push(a),o(l),l},Ds=(e,t)=>Js(Hi(e),t),Us=e=>{const t=e.value;let n;if(Fs(t)){if(e.onRejected&&(t.value.catch((()=>{})),\"rejected\"===t._state))return e.onRejected(t._error);if(e.onPending){const n=t._state;if(\"resolved\"===n)return e.onResolved(t._resolved);if(\"pending\"===n)return e.onPending();if(\"rejected\"===n)throw t._error}if(void 0!==Tt((()=>t._resolved)))return e.onResolved(t._resolved);n=t.value}else if(t instanceof Promise)n=t;else{if(!nt(t))return e.onResolved(t);n=Promise.resolve(t.value)}return hr(yr,{children:n.then(xt(e.onResolved),xt(e.onRejected))})},Xs=e=>({__brand:\"resource\",value:void 0,loading:!0,_resolved:void 0,_error:void 0,_state:\"pending\",_timeout:e?.timeout??-1,_cache:0}),Ws=(e,t,n)=>{const o=Xs(t);return o.value=n,it(o,e,void 0)},Fs=e=>j(e)&&\"resource\"===e.__brand,Vs=e=>dr(zn,{[he]:\"\"},0,e.name??\"\"),Ks=\"\u0001\",Bs={prefix:\"\u0002\",test:e=>Li(e),collect:(e,t,n)=>{if(e.v)for(const o of e.v)to(o,t,n);0===t.Fe&&t.He.push(e)},serialize:(e,t)=>te(e,{g:t}),prepare:(e,t)=>oe(e,t.O),fill:(e,t)=>{e.$&&e.$.length>0&&(e.v=e.$.map(t),e.$=null)}},Gs={prefix:\"\u0003\",test:e=>Qs(e),collect:(e,t,n)=>{to(e.xe,t,n),e.Qe&&to(e.Qe,t,n)},serialize:(e,t)=>((e,t)=>{let n=`${Te(e.fe)} ${Te(e.dt)} ${t(e.xe)} ${t(e.ut)}`;return e.Qe&&(n+=` ${t(e.Qe)}`),n})(e,t),prepare:e=>(e=>{const[t,n,o,r,s]=e.split(\" \");return new Hs(Ee(t),Ee(n),r,o,s)})(e),fill:(e,t)=>{e.ut=t(e.ut),e.xe=t(e.xe),e.Qe&&(e.Qe=t(e.Qe))}},Ys={prefix:\"\u0004\",test:e=>Fs(e),collect:(e,t,n)=>{to(e.value,t,n),to(e._resolved,t,n)},serialize:(e,t)=>((e,t)=>{const n=e._state;return\"resolved\"===n?`0 ${t(e._resolved)}`:\"pending\"===n?\"1\":`2 ${t(e._error)}`})(e,t),prepare:e=>(e=>{const[t,n]=e.split(\" \"),o=Xs(void 0);return o.value=Promise.resolve(),\"0\"===t?(o._state=\"resolved\",o._resolved=n,o.loading=!1):\"1\"===t?(o._state=\"pending\",o.value=new Promise((()=>{})),o.loading=!0):\"2\"===t&&(o._state=\"rejected\",o._error=n,o.loading=!1),o})(e),fill:(e,t)=>{if(\"resolved\"===e._state)e._resolved=t(e._resolved),e.value=Promise.resolve(e._resolved);else if(\"rejected\"===e._state){const n=Promise.reject(e._error);n.catch((()=>null)),e._error=t(e._error),e.value=n}}},Zs={prefix:\"\u0005\",test:e=>e instanceof URL,serialize:e=>e.href,prepare:e=>new URL(e),fill:void 0},ei={prefix:\"\u0006\",test:e=>e instanceof Date,serialize:e=>e.toISOString(),prepare:e=>new Date(e),fill:void 0},ti={prefix:\"\u0007\",test:e=>e instanceof RegExp,serialize:e=>`${e.flags} ${e.source}`,prepare:e=>{const t=e.indexOf(\" \"),n=e.slice(t+1),o=e.slice(0,t);return new RegExp(n,o)},fill:void 0},ni={prefix:\"\u000e\",test:e=>e instanceof Error,serialize:e=>e.message,prepare:e=>{const t=new Error(e);return t.stack=void 0,t},fill:void 0},oi={prefix:\"\u000f\",test:e=>r(e),serialize:void 0,prepare:(e,t,n)=>n,fill:void 0},ri=Symbol(\"serializable-data\"),si={prefix:\"\u0010\",test:e=>Xi(e),serialize:(e,t)=>{const[n]=e[ri];return te(n,{g:t})},prepare:(e,t)=>{const n=oe(e,t.O);return Ui(n)},fill:(e,t)=>{const[n]=e[ri];n.$&&n.$.length>0&&(n.v=n.$.map(t),n.$=null)}},ii=[Bs,{prefix:\"\u0012\",test:e=>e instanceof Ze,collect:(e,t,n)=>(to(e.untrackedValue,t,n),!0===n&&Yn(e[Ue],t,n),e),serialize:(e,t)=>t(e.untrackedValue),prepare:(e,t)=>new Ze(e,t?.F?.K(),0),subs:(e,t)=>{e[Ue].lt(t)},fill:(e,t)=>{e.untrackedValue=t(e.untrackedValue)}},{prefix:\"\u0013\",test:e=>e instanceof tt,collect(e,t,n){if(to(e.ref,t,n),yi(e.ref)){const o=ji(e.ref);di(t.re.F,o,n)&&to(e.ref[e.prop],t,n)}return e},serialize:(e,t)=>`${t(e.ref)} ${e.prop}`,prepare:e=>{const[t,n]=e.split(\" \");return new tt(t,n)},fill:(e,t)=>{e.ref=t(e.ref)}},Gs,Ys,Zs,ei,ti,ni,oi,si,{prefix:\"\u0011\",test:e=>e instanceof et,collect:(e,t,n)=>{if(e.ne)for(const o of e.ne)to(o,t,n)},serialize:(e,t,n)=>{const o=(e=>{const t=\"null\";return N(t,\"If qSerialize is true then fnStr must be provided.\"),`(${e.ne.map(((e,t)=>`p${t}`)).join(\",\")})=>(${t})`})(e);let r=n.Xe.indexOf(o);return r<0&&(n.Xe.push(o),r=n.Xe.length-1),e.ne.map(t).join(\" \")+\" @\"+Te(r)},prepare:e=>{const t=e.split(\" \"),n=t.slice(0,-1),o=t[t.length-1];return new et(o,n,o)},fill:(e,n)=>{!function(e,n,...o){if(t){if(\"string\"==typeof e)return;throw $(\"fn.$func$ should be a string\",...o)}}(e.te),e.te=n(e.te),e.ne=e.ne.map(n)}},{prefix:\"\u0014\",test:e=>\"number\"==typeof e,serialize:e=>String(e),prepare:e=>Number(e),fill:void 0},{prefix:\"\u0015\",test:e=>e instanceof URLSearchParams,serialize:e=>e.toString(),prepare:e=>new URLSearchParams(e),fill:void 0},{prefix:\"\u0016\",test:e=>\"undefined\"!=typeof FormData&&e instanceof globalThis.FormData,serialize:e=>{const t=[];return e.forEach(((e,n)=>{\"string\"==typeof e?t.push([n,e]):t.push([n,e.name])})),JSON.stringify(t)},prepare:e=>{const t=JSON.parse(e),n=new FormData;for(const[e,o]of t)n.append(e,o);return n},fill:void 0},{prefix:\"\u0017\",test:e=>vr(e),collect:(e,t,n)=>{to(e.children,t,n),to(e.props,t,n),to(e.immutableProps,t,n);let o=e.type;o===Vs?o=\":slot\":o===yr&&(o=\":fragment\"),to(o,t,n)},serialize:(e,t)=>{let n=e.type;return n===Vs?n=\":slot\":n===yr&&(n=\":fragment\"),`${t(n)} ${t(e.props)} ${t(e.immutableProps)} ${t(e.children)} ${e.flags}`},prepare:e=>{const[t,n,o,r,s]=e.split(\" \");return new mr(t,n,o,r,parseInt(s,10))},fill:(e,t)=>{e.type=hi(t(e.type)),e.props=t(e.props),e.immutableProps=t(e.immutableProps),e.children=t(e.children)}}],ci=/*#__PURE__*/ii.filter((e=>e.collect)),li=(e,t,n)=>{for(const o of ci)if(o.test(e))return o.collect(e,t,n),!0;return!1},ui=(e,t,n,o)=>{for(const r of ii)if(r.test(e)){let s=r.prefix;return r.serialize&&(s+=r.serialize(e,t,n,o)),s}},ai=(e,t)=>{const n=new Map,o=new Map;return{prepare(r){for(const s of ii){const i=s.prefix;if(r.startsWith(i)){const c=s.prepare(r.slice(i.length),e,t);return s.fill&&n.set(c,s),s.subs&&o.set(c,s),c}}return r},subs(t,n){const r=o.get(t);return!!r&&(r.subs(t,n,e),!0)},fill(t,o){const r=n.get(t);return!!r&&(r.fill(t,o,e),!0)}}},fi={\"!\":(e,t)=>t.M.get(e)??st(e,t),\"~\":e=>Promise.resolve(e),_:e=>Promise.reject(e)},di=(e,t,n)=>{if(\"boolean\"==typeof n)return n;const o=e.Ve.get(n);return!!(o&&o.length>0)&&(1!==o.length||o[0]!==t)},hi=e=>\":slot\"===e?Vs:\":fragment\"===e?yr:e,pi=(e,t)=>{const n=new Set;return mi(e,n,\"_\",t)},mi=(e,t,n,r)=>{const s=ki(e);if(null==s)return e;if(vi(s)){if(t.has(s))return e;if(t.add(s),(e=>{for(const t of ii)if(t.test(e))return!0;return!1})(s))return e;const i=typeof s;switch(i){case\"object\":if(Q(s))return e;if(o(s))return e;if(C(s)){let o=0;return s.forEach(((e,r)=>{if(r!==o)throw x(3,s);mi(e,t,n+\"[\"+r+\"]\"),o=r+1})),e}if(q(s)){for(const[e,o]of Object.entries(s))mi(o,t,n+\".\"+e);return e}break;case\"boolean\":case\"string\":case\"number\":return e}let c=\"\";if(c=r||\"Value cannot be serialized\",\"_\"!==n&&(c+=` in ${n},`),\"object\"===i)c+=` because it's an instance of \"${e?.constructor.name}\". You might need to use 'noSerialize()' or use an object literal instead. Check out https://qwik.builder.io/docs/advanced/dollar/`;else if(\"function\"===i){const t=e.name;c+=` because it's a function named \"${t}\". You might need to convert it to a QRL using $(fn):\\n\\nconst ${t} = $(${String(e)});\\n\\nPlease check out https://qwik.builder.io/docs/advanced/qrl/ for more information.`}throw console.error(\"Trying to serialize\",e),m(c)}return e},$i=/*#__PURE__*/new WeakSet,bi=/*#__PURE__*/new WeakSet,vi=e=>!j(e)&&!T(e)||!$i.has(e),wi=e=>$i.has(e),yi=e=>bi.has(e),gi=e=>(null!=e&&$i.add(e),e),Si=e=>(bi.add(e),e),xi=e=>Qs(e)?xi(e.ut):!!ht(e)||e.isConnected,ki=e=>j(e)?qi(e)??e:e,qi=e=>e[Je],ji=e=>e[Ue],Ci=e=>e[De],Oi=(e,t)=>{const n=e[0],o=\"string\"==typeof e[1]?e[1]:t(e[1]);if(!o)return;let r=n+\" \"+o;if(0===n)e[2]&&(r+=\" \"+e[2]);else if(n<=2)r+=` ${Pi(t(e[2]))} ${Pi(t(e[3]))} ${e[4]}`;else if(n<=4){const n=\"string\"==typeof e[3]?e[3]:Pi(t(e[3]));r+=` ${Pi(t(e[2]))} ${n}`}return r},Ti=(e,t)=>{const n=e.split(\" \"),o=parseInt(n[0],10);A(n.length>=2,\"At least 2 parts\");const r=t(n[1]);if(!r)return;if(Qs(r)&&!r.ut)return;const s=[o,r];return 0===o?(A(n.length<=3,\"Max 3 parts\"),s.push(n[2])):o<=2?(A(5===n.length,\"Type 1 has 5\"),s.push(t(n[2]),t(n[3]),n[4],n[5])):o<=4&&(A(4===n.length,\"Type 2 has 4\"),s.push(t(n[2]),t(n[3]),n[4])),s},Ei=e=>{const t=new Map,o={Ve:t,K:n=>new Mi(t,e,n),et:e=>{const n=t.get(e);if(n){for(const t of n)t.$t(e);t.delete(e),n.length=0}}};return n(o),o};class Mi{constructor(e,t,o){this.Ve=e,this.re=t,this.Ue=[],o&&this.lt(o),n(this)}lt(e){this.Ue.push(...e);for(const e of this.Ue)this.bt(e[1],this)}bt(e,t){let n=this.Ve.get(e);n||this.Ve.set(e,n=[]),n.includes(t)||n.push(t)}$t(e){const t=this.Ue;for(let n=0;n<t.length;n++)t[n][1]===e&&(t.splice(n,1),n--)}G(e,t){const n=this.Ue,o=e[1];0===e[0]&&n.some((([e,n,r])=>0===e&&n===o&&r===t))||(n.push([...e,t]),this.bt(o,this))}ee(e){const t=this.Ue;for(const n of t){const t=n[n.length-1];e&&t&&t!==e||ls(n,this.re)}}}const Pi=e=>{if(null==e)throw p(\"must be non null\",e);return e},Li=e=>\"function\"==typeof e&&\"function\"==typeof e.getSymbol,Ii=(e,o,r,s,i,c,l)=>{if(t&&c)for(const e of c)pi(e,\"Captured variable in the closure can not be serialized\");let u;const a=e=>(u||(u=e),u),f=async t=>{if(t&&a(t),null!==r)return r;if(null!==s)return r=s().then((e=>r=e[o]));{const t=R().importSymbol(u,e,o);return r=J(t,(e=>r=e))}},d=e=>null!==r?r:f(e);function h(e,t){return(...n)=>{const r=Qi(),s=d();return J(s,(s=>{if(T(s)){if(t&&!1===t())return;const i={...p(e),xe:v};return Ai(o,i.k,r),kt.call(this,i,s,...n)}throw x(10)}))}}const p=e=>null==e?Ct():C(e)?jt(e):e,m=async function(...e){const t=h.call(this);return await t(...e)},$=l??o,b=Ri($),v=m,w={getSymbol:()=>$,getHash:()=>b,getCaptured:()=>c,resolve:f,ft:d,C:a,l:e,o,m:l,vt:b,getFn:h,$:i,v:c,dev:null},y=Object.assign(m,w);return n(y),y},Ri=e=>{const t=e.lastIndexOf(\"_\");return t>-1?e.slice(t+1):e};function Ni(e){if(t&&!Li(e))throw new Error(\"Not a QRL\")}const zi=/*@__PURE__*/new Set,Ai=(e,t,n)=>{zi.has(e)||(zi.add(e),_i(\"qsymbol\",{symbol:e,element:t,reqTime:n}))},_i=(e,t)=>{\"object\"==typeof document&&document.dispatchEvent(new CustomEvent(e,{bubbles:!1,detail:t}))},Qi=()=>\"object\"==typeof performance?performance.now():0,Hi=e=>{throw new Error(\"Optimizer should replace all usages of $() with some special syntax. If you need to create a QRL manually, use inlinedQrl() instead.\")},Ji=e=>e,Di=e(Ji),Ui=e=>{function t(t,n,o){Ni(e),_(o,\"The Qwik Component was not invocated correctly\");const r=e.vt.slice(0,4)+\":\"+(n||\"\");return dr(zn,{[ue]:e,[fe]:t[fe],[Xe]:t[Xe],children:t.children,props:t},o,r)}return t[ri]=[e],t},Xi=e=>\"function\"==typeof e&&void 0!==e[ri],Wi=e=>Ui(Hi(e)),Fi=(e,t)=>{t||(t=[]);for(const n of e)C(n)?Fi(n,t):t.push(n);return t};function Vi(e,t,...n){const o={children:arguments.length>2?Fi(n):F};let r,s;for(s in t)\"key\"==s?r=t[s]:o[s]=t[s];return hr(e,o,r)}const Ki=async(e,n,o)=>{vr(n)||(n=hr(n,null));const r=_t(),s=Gi(e);if(t&&s.hasAttribute($e))throw x(5,s);Yi(s);const i=qe(s),c=o?.serverData;c&&Object.assign(i.J,c);const l=xn(r,i);return i.X=new Set,await Bi(l,s,n,r,i,s),await $s(i,l),{cleanup(){!function(e,t){const n=e.ke.re.F;es(t,e.ke,n,!0),(e=>{delete e[ke]})(t),xe(t,\"q:version\"),xe(t,$e),xe(t,\"q:render\"),t.replaceChildren()}(l,s)}}},Bi=async(e,n,o,r,s,i)=>{const c=e.ke;try{const t=await Go(o),r=Ir(n);await Cr(e,r,Bo(n,t),\"root\",0)}catch(e){p(e)}c.qe.push(...c.Ce),en(c),t&&ur(i),on(c)},Gi=e=>r(e)?e.documentElement:e,Yi=e=>{ge(e,\"q:version\",io),ge(e,$e,\"resumed\"),ge(e,\"q:render\",t?\"dom-dev\":\"dom\")},Zi=(e,t)=>{const{get:n,set:o,iCtx:r}=At();if(null!=n)return n;const s=T(e)?kt(void 0,e):e;if(!1===t?.reactive)return o(s),s;{const e=r.ge.ke.re,n=st(s,e,t?.deep?1:0);return o(n),n}},ec=()=>{const{get:e,set:t,elCtx:n,iCtx:o}=At();if(null!=e)return e;const r=o.ge?.ke?.re?.D||\"\";return t(`${r?Jn(r):\"\"}-${n.t?.getHash()||\"\"}-${On(o.ge)||\"\"}`)};function tc(e,t){return St().ge.ke.re.J[e]??t}const nc=new Map,oc=(e,n)=>{if(t)return rc(e,n);let o=nc.get(n);return o||nc.set(n,o=rc(e,n)),o},rc=(e,t)=>{const n=e.length,o=[],r=[];let s=0,i=s,c=uc,l=0;for(;s<n;){const t=s;let n=e.charCodeAt(s++);n===Nc&&(s++,n=Lc);const o=Uc[c];for(let h=0;h<o.length;h++){const p=o[h],[m,$,b]=p;if((m===l||m===vc||m===wc&&sc(l)||m===gc&&lc(l))&&($===n||$===vc||$===wc&&sc(n)||$===yc&&!sc(n)&&n!==Tc||$===gc&&lc(n))&&(3==p.length||f(p))){if(p.length>3&&(n=e.charCodeAt(s-1)),b===$c||b==bc){b===bc&&(c!==ac||d()?ic(n)||a(s-($==yc?1:$==Cc?2:0)):(ic(n)?u(s-2):a(s-2),i++)),$===yc&&(s--,n=l);do{c=r.pop()||uc,c===fc&&(u(s-1),i++)}while(cc(c))}else r.push(c),c===fc&&b===uc?(u(s-8),i=s):b===dc&&a(t),c=b;break}}l=n}return u(s),o.join(\"\");function u(t){o.push(e.substring(i,t)),i=t}function a(e){c===fc||d()||(u(e),o.push(\".\",ae,t))}function f(t){let n=0;if(e.charCodeAt(s)===Oc)for(let t=1;t<10;t++)if(e.charCodeAt(s+t)===Oc){n=t+1;break}e:for(let o=3;o<t.length;o++){const r=t[o];for(let t=0;t<r.length;t++)if((e.charCodeAt(s+t+n)|Ac)!==r.charCodeAt(t))continue e;return s+=r.length+n,!0}return!1}function d(){return-1!==r.indexOf(fc)||-1!==r.indexOf(hc)}},sc=e=>e>=Ec&&e<=Mc||e>=Lc&&e<=Ic||e>=_c&&e<=Qc||e>=128||e===zc||e===Oc,ic=e=>e===Pc||e===Tc||e===Rc||e===jc||sc(e),cc=e=>e===pc||e===hc||e===mc||e===fc,lc=e=>e===qc||e===Sc||e===xc||e===kc,uc=0,ac=2,fc=5,dc=6,hc=10,pc=11,mc=12,$c=17,bc=18,vc=0,wc=1,yc=2,gc=3,Sc=9,xc=10,kc=13,qc=32,jc=35,Cc=41,Oc=45,Tc=46,Ec=48,Mc=57,Pc=58,Lc=65,Ic=90,Rc=91,Nc=92,zc=95,Ac=32,_c=97,Qc=122,Hc=123,Jc=125,Dc=[[vc,39,14],[vc,34,15],[vc,47,16,\"*\"]],Uc=[[[vc,42,ac],[vc,Rc,7],[vc,Pc,dc,\":\",\"before\",\"after\",\"first-letter\",\"first-line\"],[vc,Pc,fc,\"global\"],[vc,Pc,3,\"has\",\"host-context\",\"not\",\"where\",\"is\",\"matches\",\"any\"],[vc,Pc,4],[vc,wc,1],[vc,Tc,1],[vc,jc,1],[vc,64,hc,\"keyframe\"],[vc,64,pc,\"media\",\"supports\"],[vc,64,mc],[vc,Hc,13],[47,42,16],[vc,59,$c],[vc,Jc,$c],[vc,Cc,$c],...Dc],[[vc,yc,bc]],[[vc,yc,bc]],[[vc,40,uc],[vc,yc,bc]],[[vc,40,8],[vc,yc,bc]],[[vc,40,uc],[vc,yc,$c]],[[vc,yc,$c]],[[vc,93,bc],[vc,39,14],[vc,34,15]],[[vc,Cc,$c],...Dc],[[vc,Jc,$c],...Dc],[[vc,Jc,$c],[gc,wc,1],[vc,Pc,fc,\"global\"],[vc,Hc,13],...Dc],[[vc,Hc,uc],[vc,59,$c],...Dc],[[vc,59,$c],[vc,Hc,9],...Dc],[[vc,Jc,$c],[vc,Hc,13],[vc,40,8],...Dc],[[vc,39,$c]],[[vc,34,$c]],[[42,47,$c]]],Xc=e=>{Kc(e,(e=>e),!1)},Wc=/*#__PURE__*/e(Xc),Fc=e=>({scopeId:ae+Kc(e,oc,!0)}),Vc=/*#__PURE__*/e(Fc),Kc=(e,t,n)=>{Ni(e);const{get:o,set:r,iCtx:s,i,elCtx:c}=At();if(o)return o;const l=(a=i,Ni(u=e),`${Jn(u.vt)}-${a}`);var u,a;const f=s.ge.ke.re;if(r(l),c.pe||(c.pe=[]),c.ce||(c.ce=[]),n&&c.ce.push((e=>ae+e)(l)),((e,t)=>e.A.has(t))(f,l))return l;f.A.add(l);const d=e.ft(f.O),h=e=>{N(c.pe,\"appendStyles must be defined\"),c.pe.push({styleId:l,content:t(e,l)})};return Q(d)?s.ye.push(d.then(h)):h(d),l},Bc=e=>{const{get:t,set:n,iCtx:o}=At();if(null!=t)return t;const r=o.ge.ke.re,s=T(e)?kt(void 0,e):e;return n(Ke(s,r,0,void 0))},Gc=()=>{const e=Zi({error:void 0});return It(\"error-boundary\",B(\"/runtime\",\"error\",[e])),hn(wn,e),e};export{Hi as $,yr as Fragment,In as RenderOnce,Us as Resource,Nn as SSRComment,Qn as SSRHint,Rn as SSRRaw,_n as SSRStream,An as SSRStreamBlock,Ln as SkipRender,Vs as Slot,Xe as _IMMUTABLE,er as _deserializeData,Fe as _fnSignal,Pt as _getContextElement,hs as _hW,Lt as _jsxBranch,dr as _jsxC,fr as _jsxQ,Y as _noopQrl,Xn as _pauseFromContexts,ce as _regSymbol,ao as _renderSSR,ut as _restProps,Un as _serializeData,pi as _verifySerializable,Si as _weakSerialize,ot as _wrapProp,rt as _wrapSignal,Wi as component$,Ui as componentQrl,dn as createContextId,Vi as createElement,Di as event$,Ji as eventQrl,vt as getLocale,R as getPlatform,Vi as h,e as implicit$FirstArg,G as inlinedQrl,ee as inlinedQrlDEV,hr as jsx,gr as jsxDEV,hr as jsxs,gi as noSerialize,B as qrl,Z as qrlDEV,Ki as render,I as setPlatform,Tt as untrack,Cs as useComputed$,js as useComputedQrl,pn as useContext,hn as useContextProvider,Gc as useErrorBoundary,ec as useId,cs as useLexicalScope,It as useOn,Rt as useOnDocument,Nt as useOnWindow,Ds as useResource$,Js as useResourceQrl,tc as useServerData,Bc as useSignal,Zi as useStore,Wc as useStyles$,Xc as useStylesQrl,Vc as useStylesScoped$,Fc as useStylesScopedQrl,Os as useTask$,qs as useTaskQrl,Es as useVisibleTask$,Ts as useVisibleTaskQrl,io as version,wt as withLocale};\n"
  },
  {
    "path": "packages/docs/public/docs/qwikcity/README.md",
    "content": "The images in this folder were created: https://docs.google.com/presentation/d/1HjlWpOpnPAmjdxEV7F2uttjvkWf1FOLvXaWMcxGLs38/\n"
  },
  {
    "path": "packages/docs/public/robots.txt",
    "content": "User-agent: *\nDisallow: /demo/\nAllow: /\nSitemap: https://qwik.dev/sitemap.xml\n"
  },
  {
    "path": "packages/docs/scripts/pages.json",
    "content": "[\n  { \"href\": \"https://abdhashem.com\", \"tags\": \"portfolio\" },\n  { \"href\": \"https://abn.ooo/\" },\n  { \"href\": \"https://ale.gimona.it/\" },\n  { \"href\": \"https://amo.co/\" },\n  { \"href\": \"https://bato.si/\" },\n  { \"href\": \"https://birdflop.com/\", \"tags\": \"site\", \"repo\": \"https://github.com/birdflop/web\" },\n  { \"href\": \"https://blueagle.top/\", \"tags\": \"portfolio,site,blog\" },\n  { \"href\": \"https://bot-whatsapp.netlify.app/\", \"tags\": \"site\" },\n  { \"href\": \"https://builtwith.appwrite.io/\" },\n  { \"href\": \"https://finallyweb.com/\", \"tags\": \"stock market education\" },\n  { \"href\": \"https://frostytools.com\", \"size\": \"large\", \"tags\": \"saas\" },\n  { \"href\": \"https://goshi.dev/\", \"tags\": \"portfolio\" },\n  { \"href\": \"https://itbusinesshub.com/\", \"tags\": \"blog\" },\n  { \"href\": \"https://jobibox.fr/\" },\n  { \"href\": \"https://juneikerc.com\", \"tags\": \"portfolio,site,blog,services\" },\n  { \"href\": \"https://leonerd.blog\", \"tags\": \"portfolio\" },\n  { \"href\": \"https://linkfang-portfolio.vercel.app/\", \"tags\": \"portfolio\" },\n  { \"href\": \"https://ohayo-dev-design.com/\", \"tags\": \"web, dev, agency\" },\n  { \"href\": \"https://pricing.oasisdigital.com/\", \"tags\": \"saas\" },\n  { \"href\": \"https://pulsestax.com/\", \"tags\": \"saas\" },\n  { \"href\": \"https://qit.tools/\", \"tags\": \"online,tools,converters\" },\n  { \"href\": \"https://quotemingle.com/\", \"tags\": \"site\" },\n  { \"href\": \"https://qwik-pokedex.vercel.app/en\" },\n  { \"href\": \"https://qwik-storefront.vendure.io/\", \"size\": \"large\", \"tags\": \"ecommerce\" },\n  { \"href\": \"https://qwik.dev\" },\n  { \"href\": \"https://qwikpdf.alexismoren.fr/\", \"tags\": \"pdf,services,free\" },\n  { \"href\": \"https://qwind.pages.dev/\", \"tags\": \"template\", \"size\": \"large\" },\n  { \"href\": \"https://reflect.app/\", \"tags\": \"saas\" },\n  { \"href\": \"https://sakenowa.com\", \"tags\": \"sns,app\" },\n  { \"href\": \"https://sanyamjainqwik.vercel.app/\", \"tags\": \"portfolio\" },\n  { \"href\": \"https://sasthyaseba.com\", \"tags\": \"healthcare\" },\n  { \"href\": \"https://seifen.vercel.app/\", \"tags\": \"site\" },\n  { \"href\": \"https://si.com/\", \"size\": \"large\" },\n  { \"href\": \"https://todaysdatenow.com/\", \"tags\": \"site,tools,time\" },\n  { \"href\": \"https://travelcalc.pages.dev\", \"tags\": \"app\" },\n  { \"href\": \"https://valibot.dev/\", \"tags\": \"site,documentation\" },\n  { \"href\": \"https://wope.com/\", \"tags\": \"saas\" },\n  { \"href\": \"https://www.aimfox.com/\" },\n  { \"href\": \"https://www.brainrush.fun/\" },\n  { \"href\": \"https://www.burgersonfleek.ca/\" },\n  { \"href\": \"https://www.herold.at/\" },\n  { \"href\": \"https://www.honda.com.tr/\" },\n  { \"href\": \"https://www.le-cv-du-bantu.com/\" },\n  { \"href\": \"https://www.learn-qwik.com/\", \"size\": \"large\", \"tags\": \"site,tutorial,learn\" },\n  { \"href\": \"https://www.nau.ch/\" },\n  { \"href\": \"https://www.placementpreparation.io/\", \"tags\": \"aptitude,learning,platform\" },\n  { \"href\": \"https://www.sport-thieme.de/\" },\n  { \"href\": \"https://www.uswitch.com/\" }\n]\n"
  },
  {
    "path": "packages/docs/scripts/showcase.ts",
    "content": "import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';\nimport { chromium, devices, type Page } from 'playwright';\nimport { fetch } from 'undici';\nimport pages from './pages.json' with { type: 'json' };\n\ntype InputPageData = {\n  href: string;\n  tags?: string[];\n  size?: 'small' | 'large';\n  repo?: string;\n};\ntype PageData = InputPageData & {\n  title?: string;\n  imgSrc?: string;\n  perf?: {\n    score?: number;\n    inpMs?: number;\n    clsScore?: number;\n    ttfbMs?: number;\n    fcpDisplay?: string;\n    fcpScore?: number;\n    lcpDisplay?: string;\n    lcpScore?: number;\n    ttiDisplay?: string;\n    ttiScore?: number;\n    ttiTime?: number;\n  };\n  version?: string;\n  ts: number;\n};\nconst OUTPUT_JSON = 'src/routes/(ecosystem)/showcase/generated-pages.json';\nasync function captureMultipleScreenshots() {\n  if (!existsSync('public/showcases')) {\n    mkdirSync('public/showcases');\n  }\n\n  let browser = null;\n  try {\n    // launch headless Chromium browser\n    browser = await chromium.launch({\n      headless: true,\n    });\n    const context = await browser.newContext({\n      // pretend to be a desktop browser\n      ...devices['Desktop Chrome'],\n    });\n    let existingJson: PageData[] = [];\n    try {\n      const data = readFileSync(OUTPUT_JSON, 'utf8');\n      existingJson = JSON.parse(data) as PageData[];\n    } catch {\n      // ignore\n    }\n\n    for (const pageData of pages) {\n      let page: Page;\n      try {\n        page = await context.newPage();\n\n        // set viewport width and height\n        await page.setViewportSize({\n          width: 1440,\n          height: 980,\n        });\n\n        const href = pageData.href;\n        let existing = existingJson.find((item) => item.href === href);\n        if (!existing) {\n          existing = { ...pageData, ts: 0 } as PageData;\n          existingJson.push(existing);\n        }\n        if (Date.now() - existing.ts < 1000 * 60 * 60 * 24 * 7) {\n          console.log('Skipping recently updated', href);\n          continue;\n        }\n        console.log('Opening page', href);\n        await page.goto(href);\n\n        const title = await page.title();\n        const html = page.locator('html');\n        const hasContainer = await html.evaluate((node) => node.hasAttribute('q:container'));\n        if (!hasContainer) {\n          console.warn('❌ Not a Qwik Site', href, await html.getAttribute('q:container'));\n          existingJson.splice(existingJson.indexOf(existing), 1);\n          writeFileSync(OUTPUT_JSON, JSON.stringify(existingJson, undefined, 2) + '\\n');\n          continue;\n        }\n        const version = await html.getAttribute('q:version');\n        const filename = href\n          .replace('https://', '')\n          .replace('/', '_')\n          .replace('.', '_')\n          .replace('.', '_')\n          .toLowerCase();\n\n        await wait(5000);\n        const path = `public/showcases/${filename}.jpeg`;\n        const [pagespeedOutput, _] = await Promise.all([\n          getPagespeedData(href),\n          page.screenshot({\n            path: path,\n            type: 'jpeg',\n            quality: 50,\n          }),\n        ]);\n        const fcpDisplay =\n          pagespeedOutput.lighthouseResult?.audits?.['first-contentful-paint']?.displayValue;\n        const fcpScore =\n          pagespeedOutput?.lighthouseResult?.audits?.['first-contentful-paint']?.score;\n\n        const lcpDisplay =\n          pagespeedOutput?.lighthouseResult?.audits?.['largest-contentful-paint']?.displayValue;\n        const lcpScore =\n          pagespeedOutput?.lighthouseResult?.audits?.['largest-contentful-paint']?.score;\n\n        const loadExpMetrics = pagespeedOutput.loadingExperience?.metrics;\n        // ms score of the 75th percentile of the page users\n        const inpMs = loadExpMetrics?.INTERACTION_TO_NEXT_PAINT?.percentile;\n        // no unit, less than 0.1 is good\n        const clsScore = loadExpMetrics?.CUMULATIVE_LAYOUT_SHIFT_SCORE?.percentile / 100;\n        // not core but interesting\n        const ttfbMs = loadExpMetrics?.EXPERIMENTAL_TIME_TO_FIRST_BYTE?.percentile;\n\n        const ttiDisplay = pagespeedOutput?.lighthouseResult?.audits?.interactive?.displayValue;\n        const ttiScore = pagespeedOutput?.lighthouseResult?.audits?.interactive?.score;\n\n        const ttiTime = pagespeedOutput?.lighthouseResult?.audits?.interactive?.numericValue;\n\n        const score = pagespeedOutput?.lighthouseResult?.categories?.performance?.score;\n        const perf = {\n          score,\n          inpMs,\n          clsScore,\n          ttfbMs,\n          fcpDisplay,\n          fcpScore,\n          lcpDisplay,\n          lcpScore,\n          ttiDisplay,\n          ttiScore,\n          ttiTime,\n        };\n        Object.assign(existing, {\n          ...pageData,\n          ts: Date.now(),\n          title,\n          imgSrc: `/showcases/${filename}.jpeg`,\n          perf,\n          version,\n        });\n        writeFileSync(OUTPUT_JSON, JSON.stringify(existingJson, undefined, 2) + '\\n');\n        console.log(`✅ ${title} - (${href})`);\n      } catch (err) {\n        console.error(err);\n      } finally {\n        if (page!) {\n          await page.close();\n        }\n      }\n    }\n  } catch (err) {\n    console.log(`❌ Error: ${(err as Error)?.message || err}`);\n  } finally {\n    if (browser) {\n      await browser.close();\n    }\n    console.log(`\\n🎉 ${pages.length} screenshots captured.`);\n  }\n}\n\nasync function getPagespeedData(url: string) {\n  const requestURL = `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${encodeURIComponent(\n    url\n  )}&key=AIzaSyApBC9gblaCzWrtEBgHnZkd_B37OF49BfM&category=PERFORMANCE&strategy=MOBILE`;\n  return await fetch(requestURL, {\n    headers: {\n      referer: 'https://www.builder.io/',\n    },\n  }).then(async (res) => {\n    if (!res.ok) {\n      throw new Error(await res.text());\n    }\n    return res.json() as Promise<{\n      lighthouseResult: any;\n      loadingExperience: any;\n      pagespeedResult: any;\n    }>;\n  });\n}\ncaptureMultipleScreenshots();\n\nfunction wait(ms: number) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"
  },
  {
    "path": "packages/docs/src/components/code-block/code-block.css",
    "content": "/* === PrismJS Theme === */\n:root {\n  --p-background: #ffffff;\n  --p-text: #2e3440;\n  --p-comment: #6a737d;\n  --p-keyword: #d73a49;\n  --p-string: #032f62;\n  --p-function: #6f42c1;\n  --p-tag: #22863a;\n  --p-attr-name: #6f42c1;\n  --p-attr-value: #032f62;\n  --p-punctuation: #24292e;\n  --p-class-name: #e36209;\n  --p-operator: #d73a49;\n  --p-number: #005cc5;\n  --p-property: #005cc5;\n  --p-selector: #22863a;\n  --p-code-block-bg: #f6f8fa;\n  --p-code-block-border: #e1e4e8;\n}\n\nhtml[data-theme='dark'] {\n  --p-background: #0d1117;\n  --p-text: #c9d1d9;\n  --p-comment: #8b949e;\n  --p-keyword: #ff7b72;\n  --p-string: #a5d6ff;\n  --p-function: #d2a8ff;\n  --p-tag: #7ee787;\n  --p-attr-name: #d2a8ff;\n  --p-attr-value: #a5d6ff;\n  --p-punctuation: #c9d1d9;\n  --p-class-name: #ffa657;\n  --p-operator: #ff7b72;\n  --p-number: #79c0ff;\n  --p-property: #79c0ff;\n  --p-selector: #7ee787;\n  --p-code-block-bg: #161b22;\n  --p-code-block-border: #30363d;\n}\n\ncode[class*='language-'],\npre[class*='language-'] {\n  color: var(--p-text);\n  background: var(--p-code-block-bg);\n  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n  text-align: left;\n  white-space: pre;\n  word-spacing: normal;\n  word-break: normal;\n  word-wrap: normal;\n  line-height: 1.5;\n  tab-size: 4;\n  hyphens: none;\n}\n\npre[class*='language-'] {\n  padding: 1em;\n  margin: 0.5em 0;\n  overflow: auto;\n  border: 1px solid var(--p-code-block-border);\n  border-radius: 6px;\n}\n\n:not(pre) > code[class*='language-'],\npre[class*='language-'] {\n  background: var(--p-code-block-bg);\n}\n\n:not(pre) > code[class*='language-'] {\n  padding: 0.1em 0.3em;\n  border-radius: 0.3em;\n  white-space: normal;\n}\n\n.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n  color: var(--p-comment);\n}\n\n.token.punctuation {\n  color: var(--p-punctuation);\n}\n\n.token.namespace {\n  opacity: 0.7;\n}\n\n.token.property,\n.token.tag,\n.token.constant,\n.token.symbol,\n.token.deleted {\n  color: var(--p-tag);\n}\n\n.token.number {\n  color: var(--p-number);\n}\n\n.token.boolean,\n.token.keyword {\n  color: var(--p-keyword);\n}\n\n.token.attr-name {\n  color: var(--p-attr-name);\n}\n\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted {\n  color: var(--p-string);\n}\n\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string,\n.token.variable {\n  color: var(--p-operator);\n}\n\n.token.atrule,\n.token.attr-value,\n.token.function,\n.token.class-name {\n  color: var(--p-function);\n}\n\n.token.regex,\n.token.important {\n  color: var(--p-string);\n}\n\n.token.important,\n.token.bold {\n  font-weight: bold;\n}\n\n.token.italic {\n  font-style: italic;\n}\n\n.token.entity {\n  cursor: help;\n}\n\n.language-markup .token.tag,\n.language-markup .token.attr-name,\n.language-markup .token.attr-value {\n  color: var(--p-tag);\n}\n\n.language-css .token.selector {\n  color: var(--p-selector);\n}\n\n.language-css .token.property {\n  color: var(--p-property);\n}\n\n.language-javascript .token.function {\n  color: var(--p-function);\n}\n\n.language-javascript .token.class-name {\n  color: var(--p-class-name);\n}\n/* ===  Prettier Toggle Styles === */\n.prettier-toggle {\n  cursor: pointer;\n  display: inline-block;\n  position: absolute;\n  top: 30px;\n  right: 9px;\n  z-index: 10;\n}\n\n.prettier-toggle span {\n  display: inline-block;\n  padding: 0px 4px;\n  background: var(--p-background);\n  border: 1px solid var(--p-border);\n  color: var(--p-text);\n  font-weight: normal;\n  font-size: 14px;\n  border-radius: 4px;\n}\n\n.prettier-toggle span.checked {\n  background: #264f78;\n  color: #ffffff;\n  font-weight: bold;\n}\n.prettier-toggle span.checked.error {\n  background: #db4c69;\n}\n"
  },
  {
    "path": "packages/docs/src/components/code-block/code-block.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useStyles$,\n  useTask$,\n  useVisibleTask$,\n  type QRL,\n  type Signal,\n} from '@builder.io/qwik';\n\nimport { CopyCode } from '../copy-code/copy-code-block';\nimport styles from './code-block.css?inline';\nimport { highlight } from './prismjs';\nimport { format } from 'prettier/standalone';\nimport parserHtml from 'prettier/plugins/html';\nimport parserTs from 'prettier/plugins/typescript';\nimport parserEstree from 'prettier/plugins/estree';\ninterface CodeBlockProps {\n  path?: string;\n  language?: 'markup' | 'css' | 'javascript' | 'json' | 'jsx' | 'tsx';\n  code: string;\n  format?: boolean;\n  pathInView$?: QRL<(name: string) => void>;\n  observerRootId?: string;\n}\n\nexport const CodeBlock = component$((props: CodeBlockProps) => {\n  const listSig = useSignal<Element>();\n  const codeSig = useSignal<string | null>(props.format ? null : props.code);\n  const formatSig = useSignal(!!props.format);\n  const formatError = useSignal<string>();\n\n  const language =\n    props.language ||\n    (props.path\n      ? /\\.([cm]?[jt]sx?|json)$/.test(props.path)\n        ? 'javascript'\n        : props.path.endsWith('.html')\n          ? 'markup'\n          : props.path.endsWith('.css')\n            ? 'css'\n            : null\n      : null);\n\n  useStyles$(styles);\n\n  useTask$(async ({ track }) => {\n    track(() => props.code);\n    track(formatSig);\n\n    if (formatSig.value) {\n      try {\n        // simple formatting for html and js\n        if (language === 'markup') {\n          codeSig.value = await format(props.code, {\n            parser: 'html',\n            plugins: [parserHtml],\n            htmlWhitespaceSensitivity: 'ignore',\n          });\n        } else if (language === 'javascript') {\n          codeSig.value = await format(props.code, {\n            parser: 'typescript',\n            plugins: [parserTs, parserEstree],\n          });\n        }\n        formatError.value = undefined;\n      } catch (e: any) {\n        formatError.value = e.message;\n        codeSig.value = props.code;\n      }\n    } else {\n      codeSig.value = props.code;\n    }\n  });\n\n  useVisibleTask$(async () => {\n    const { pathInView$, path, observerRootId } = props;\n    if (pathInView$ && path && listSig.value !== undefined) {\n      const el = listSig.value;\n      const intersectionObserver = new IntersectionObserver(\n        ([{ isIntersecting }]) => isIntersecting && pathInView$(path),\n        {\n          //to avoid any edge case\n          root: observerRootId ? document.getElementById(observerRootId) : null,\n        }\n      );\n      intersectionObserver.observe(el);\n      return () => {\n        intersectionObserver.unobserve(el);\n      };\n    }\n  });\n\n  const highlighted =\n    codeSig.value != null && language ? highlight(codeSig.value, language) : codeSig.value;\n  const className = `language-${language}`;\n  return (\n    <div class=\"relative\">\n      <pre class={className} ref={listSig}>\n        {highlighted && <code class={className} dangerouslySetInnerHTML={highlighted} />}\n      </pre>\n      {(language === 'markup' || language === 'javascript') && (\n        <PrettierToggle bind:value={formatSig} />\n      )}\n      <CopyCode code={props.code} />\n    </div>\n  );\n});\n\nconst PrettierToggle = component$((props: { 'bind:value': Signal<boolean>; error?: string }) => {\n  return (\n    <label\n      class=\"prettier-toggle\"\n      title={`Toggle Prettier ${props.error ? `\\n${props.error}` : ''}`}\n      aria-label=\"Toggle Prettier\"\n    >\n      <input type=\"checkbox\" bind:checked={props['bind:value']} style=\"display: none;\" />\n      <span class={[props['bind:value'].value ? 'checked' : '', props.error ? 'error' : '']}>\n        P\n      </span>\n    </label>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/code-block/prismjs.ts",
    "content": "import prismjs from 'prismjs';\nimport 'prismjs/components/prism-jsx';\nimport 'prismjs/components/prism-tsx';\n\nexport const highlight = (code?: string, language?: string) => {\n  if (!code || !language || !prismjs.languages[language]) {\n    return `<code class=\"language-${language}\"><pre>${code}</pre></code>`;\n  }\n  return prismjs.highlight(code, prismjs.languages[language], language);\n};\n"
  },
  {
    "path": "packages/docs/src/components/code-sandbox/index.css",
    "content": ".browser iframe {\n  margin: 0;\n  padding: 8px;\n  border: none;\n}\n\n:global(:root[data-theme='dark']) .browser iframe {\n  border: 1px solid #333;\n  border-top: none;\n}\n\n:global(:root[data-theme='dark']) .browser .bar {\n  background-color: #1f1f1f;\n}\n\n:global(:root[data-theme='dark']) .browser .url {\n  background-color: #161616;\n}\n\n.browser .bar > ul {\n  display: flex;\n  flex-direction: row;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  align-items: center;\n  gap: 8px;\n}\n\n.browser .bar > ul > li {\n  margin: 0;\n  padding: 0;\n}\n\n.browser .bar > ul > li.edit {\n  position: relative;\n  top: -2px;\n}\n.browser .bar > ul > li.edit > a {\n  color: #666;\n}\n.browser .bar > ul > li.edit > a:hover {\n  color: #222;\n}\n:global(:root[data-theme='dark']) .browser .bar > ul > li.edit > a:hover {\n  color: #aaa;\n}\n\n.browser .url .url-link {\n  text-decoration: none;\n  color: #666;\n}\n\n.slot-container {\n  border-radius: 8px;\n}\n\n.tabs {\n  display: flex;\n  justify-content: flex-start;\n  align-items: center;\n  border-bottom: 1px solid #ccc;\n}\n\n.tab {\n  padding: 10px;\n  cursor: pointer;\n}\n\n.tab.active {\n  border-radius: 8px 8px 0 0;\n  background-color: var(--repl-tab-bg-color);\n  border-bottom: 2px solid blue;\n}\n"
  },
  {
    "path": "packages/docs/src/components/code-sandbox/index.tsx",
    "content": "import { component$, useContext, useStylesScoped$, Slot, useSignal } from '@builder.io/qwik';\nimport CSS from './index.css?inline';\nimport { GlobalStore } from '../../context';\nimport { EditIcon } from '../svgs/edit-icon';\n\nexport default component$<{\n  src?: string;\n  url?: string;\n  tabs?: string[];\n  console?: boolean;\n  maxHeight?: number;\n  style?: Record<string, string>;\n}>(({ url, tabs, src, style, console, maxHeight }) => {\n  const activeTab = useSignal(0);\n  useStylesScoped$(CSS);\n  const state = useContext(GlobalStore);\n  const exampleUrl = (url || src) + (console ? '?console=true' : '');\n  return (\n    <>\n      {tabs && (\n        <div class=\"tabs\">\n          {tabs.map((tab, idx) => (\n            <span\n              key={idx}\n              onClick$={() => (activeTab.value = idx)}\n              class={{ tab: true, active: idx == activeTab.value }}\n            >\n              {tab}\n            </span>\n          ))}\n        </div>\n      )}\n      <div class=\"overflow-auto slot-container mb-4\">\n        <Slot name={tabs ? String(activeTab.value) : ''} />\n      </div>\n      <div class=\"browser shadow-xl\">\n        <div class=\"bar bg-slate-200 rounded-tl-md rounded-tr-md flex flex-row justify-left px-5 py-2 gap-5\">\n          <ul>\n            <li>\n              <span class=\"bg-red-600 rounded-full w-3 h-3 inline-block\"></span>\n            </li>\n            <li>\n              <span class=\"bg-yellow-500 rounded-full w-3 h-3 inline-block\"></span>\n            </li>\n            <li>\n              <span class=\"bg-lime-500 rounded-full w-3 h-3 inline-block\"></span>\n            </li>\n          </ul>\n          <div class=\"url bg-slate-300 rounded-md inline-grid whitespace-nowrap text-xs px-2 py-1 content-center w-full\">\n            <a\n              href={examplePath(exampleUrl)}\n              target=\"_blank\"\n              class=\"url-link text-ellipsis overflow-hidden\"\n            >\n              {new URL(examplePath(exampleUrl), 'https://qwik.dev').toString()}\n            </a>\n          </div>\n          <ul>\n            <li class=\"edit\">\n              <a\n                href={'https://github.com/QwikDev/qwik/blob/main/packages/docs/' + (url || src)}\n                rel=\"noopener\"\n                target=\"_blank\"\n                title=\"edit this snippet\"\n              >\n                <EditIcon width={20} height={20} />\n              </a>\n            </li>\n          </ul>\n        </div>\n        <div>\n          <iframe\n            loading=\"lazy\"\n            src={examplePath({ path: exampleUrl, theme: state.theme, includeTheme: true })}\n            style={{ width: '100%', height: '200px', ...style }}\n          />\n        </div>\n      </div>\n    </>\n  );\n});\n\nfunction examplePath(\n  opts:\n    | {\n        path: string;\n        theme?: string;\n        includeTheme?: boolean;\n      }\n    | string\n) {\n  const {\n    path,\n    theme = 'light',\n    includeTheme = false,\n  } = typeof opts === 'string' ? ({ path: opts } as any) : opts;\n  const newPath = path\n    .replace('/(qwik)/', '/')\n    .replace('/(qwikcity)/', '/')\n    .replace('/src/routes/demo', '/demo')\n    .replace(/\\/[\\w\\d]+\\.tsx?$/, '/');\n\n  if (!includeTheme) {\n    return newPath;\n  }\n\n  if (newPath.indexOf('?') > -1) {\n    return newPath + '&theme=' + theme;\n  }\n\n  return newPath + '?theme=' + theme;\n}\n\nexport const CodeFile = component$<{ src: string }>((props) => {\n  return <Slot />;\n});\n"
  },
  {
    "path": "packages/docs/src/components/content-nav/content-nav.css",
    "content": ".content-nav .prev,\n.content-nav .next {\n  position: relative;\n  background-color: var(--content-nav-button-bg-color);\n  border: 1px solid var(--content-nav-button-bg-color);\n  border-radius: 5px;\n  padding: 6px 16px;\n  text-decoration: none;\n  color: white;\n  display: inline-block;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  margin: 10px 0;\n  max-width: 150px;\n}\n\n@media (min-width: 540px) {\n  .content-nav .prev,\n  .content-nav .next {\n    max-width: 250px;\n  }\n}\n\n.content-nav .prev:hover,\n.content-nav .next:hover {\n  background-color: var(--content-nav-button-hover-bg-color);\n  border: 1px solid var(--content-nav-button-text-color);\n  color: var(--content-nav-button-text-color);\n}\n\n.content-nav .prev {\n  padding-left: 24px;\n}\n\n.content-nav .next {\n  padding-right: 24px;\n}\n\n.content-nav .prev::before {\n  position: absolute;\n  content: '\\2039';\n  top: 5px;\n  left: 11px;\n}\n\n.content-nav .next::after {\n  position: absolute;\n  content: '\\203A';\n  top: 5px;\n  right: 11px;\n}\n"
  },
  {
    "path": "packages/docs/src/components/content-nav/content-nav.tsx",
    "content": "import { type ContentMenu, useContent, useLocation, Link } from '@builder.io/qwik-city';\nimport { component$, useSignal, useStyles$, useTask$ } from '@builder.io/qwik';\nimport styles from './content-nav.css?inline';\n\nexport const ContentNav = component$(() => {\n  useStyles$(styles);\n\n  const { menu } = useContent();\n  const { url } = useLocation();\n\n  if (!menu) {\n    return null;\n  }\n\n  const items = flattenMenu(menu);\n\n  const prev = useSignal<ContentMenu | undefined>(undefined);\n  const next = useSignal<ContentMenu | undefined>(undefined);\n\n  useTask$(({ track }) => {\n    track(() => url.pathname);\n    prev.value = getNav(items, url.pathname, -1);\n    next.value = getNav(items, url.pathname, 1);\n  });\n\n  return (\n    <nav class=\"content-nav border-t border-slate-300 flex flex-wrap py-4\">\n      <div class=\"flex-1\">\n        {prev.value ? (\n          <Link class=\"px-3 py-1 prev\" href={prev.value?.href}>\n            {prev.value?.text}\n          </Link>\n        ) : null}\n      </div>\n\n      <div class=\"flex-1 text-right\">\n        {next.value ? (\n          <Link class=\"px-3 py-1 next\" href={next.value?.href}>\n            {next.value?.text}\n          </Link>\n        ) : null}\n      </div>\n    </nav>\n  );\n});\n\nexport const getNav = (items: ContentMenu[], currentPathname: string, direction: -1 | 1) => {\n  const currentIndex = items.findIndex((p) => p.href === currentPathname);\n  if (currentIndex > -1) {\n    let item = items[currentIndex + direction];\n    if (item && item.href) {\n      return item;\n    }\n    item = items[currentIndex + direction + direction];\n    if (item && item.href) {\n      return item;\n    }\n  }\n};\n\nexport const flattenMenu = (menu: ContentMenu) => {\n  const items: ContentMenu[] = [];\n  const readMenu = (m: ContentMenu) => {\n    items.push(m);\n    if (m.items) {\n      for (const item of m.items) {\n        readMenu(item);\n      }\n    }\n  };\n  readMenu(menu);\n  return items;\n};\n"
  },
  {
    "path": "packages/docs/src/components/contributors/contributors.css",
    "content": ".wrapper {\n  margin: 50px 0;\n}\n\n.list {\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n  justify-content: left;\n  gap: 8px;\n  align-items: center;\n  list-style: none;\n  margin: 0;\n  padding: 0;\n}\n\n.contributor {\n  display: inline-block;\n  margin: 0;\n  padding: 0;\n}\n\n.avatar {\n  border-radius: 50%;\n  width: 40px;\n  height: auto;\n}\n"
  },
  {
    "path": "packages/docs/src/components/contributors/index.tsx",
    "content": "import { component$, useId, useStylesScoped$ } from '@builder.io/qwik';\nimport styles from './contributors.css?inline';\nimport { useDocumentHead } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  useStylesScoped$(styles);\n  const { frontmatter } = useDocumentHead<{ contributors?: string[] }>();\n  const contributors = frontmatter.contributors || [];\n\n  if (!contributors.length) {\n    return null;\n  }\n\n  return (\n    <div class=\"wrapper card\">\n      <h3>Contributors</h3>\n      <p>Thanks to all the contributors who have helped make this documentation better!</p>\n      <ul class=\"list\">\n        {contributors.map((contributor: string) => {\n          const id = useId();\n          return (\n            <li key={id} class=\"contributor\">\n              <a href={`https://github.com/${contributor}`} target=\"_blank\" rel=\"noreferrer\">\n                <img\n                  loading=\"lazy\"\n                  src={`https://github.com/${contributor}.png?size=80`}\n                  width=\"40\"\n                  height=\"40\"\n                  alt={contributor}\n                  class=\"avatar\"\n                />\n              </a>\n            </li>\n          );\n        })}\n      </ul>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/copy-code/copy-code-block.tsx",
    "content": "import { component$, useSignal, useStyles$ } from '@builder.io/qwik';\nimport { CopyCode as CopyCodeIcon } from '../svgs/copy-code-icon';\nimport styles from './copy-code.css?inline';\n\nconst Check = component$(({ height = 12, width = 12 }: { height?: number; width?: number }) => {\n  useStyles$(styles);\n\n  return (\n    <svg\n      class=\"w-3.5 h-3.5 text-white \"\n      height={height}\n      width={width}\n      aria-hidden=\"true\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      fill=\"none\"\n      viewBox=\"0 0 16 12\"\n    >\n      <path\n        stroke=\"currentColor\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        stroke-width=\"2\"\n        d=\"M1 5.917 5.724 10.5 15 1.5\"\n      />\n    </svg>\n  );\n});\nexport const CopyCode = component$(({ code }: { code: string }) => {\n  const copied = useSignal(false);\n  return (\n    <button\n      preventdefault:click\n      onClick$={async (e) => {\n        copied.value = !copied.value;\n        if (copied.value) {\n          setTimeout(() => (copied.value = false), 1500);\n        }\n        if (navigator.clipboard) {\n          await navigator.clipboard.writeText(code);\n        }\n      }}\n      class=\"absolute text-[--secondary-text-color] right-2 top-2 shadow-2xl z-10\"\n    >\n      <span\n        class={{\n          animate: true,\n          visible: copied.value,\n          hidden: !copied.value,\n        }}\n      >\n        <Check />\n      </span>\n      <span\n        class={{\n          animate: true,\n          visible: !copied.value,\n          hidden: copied.value,\n        }}\n      >\n        <CopyCodeIcon />\n      </span>\n    </button>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/copy-code/copy-code.css",
    "content": ".animate {\n  opacity: 1;\n  animation: check-in 1 1s;\n}\n\n@keyframes check-in {\n  0% {\n    opacity: 0;\n  }\n\n  100% {\n    opacity: 1;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/README.md",
    "content": "# Docsearch in qwik\n\nAll the credits goes to Algolia's [docsearch-react](https://github.com/algolia/docsearch/tree/main/packages/docsearch-react)\n\nOnly render part port to qwik's component.\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/algolia-logo.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ntype AlgoliaLogoTranslations = Partial<{\n  searchByText: string;\n}>;\n\nexport type AlgoliaLogoProps = {\n  translations?: AlgoliaLogoTranslations;\n};\n\nexport const AlgoliaLogo = component$(({ translations = {} }: AlgoliaLogoProps) => {\n  const { searchByText = 'Search by' } = translations;\n\n  return (\n    <a\n      href={`https://www.algolia.com/ref/docsearch/?utm_source=${window.location.hostname}&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch`}\n      target=\"_blank\"\n      rel=\"noopener noreferrer\"\n    >\n      <span class=\"DocSearch-Label\">{searchByText}</span>\n      <svg width=\"77\" height=\"19\" aria-label=\"Algolia\" role=\"img\">\n        <path\n          d=\"M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z\"\n          fill=\"currentColor\"\n          fill-rule=\"evenodd\"\n        />\n      </svg>\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/constants.ts",
    "content": "export const MAX_QUERY_SIZE = 100;\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/context.ts",
    "content": "import { createContextId } from '@builder.io/qwik';\n\nexport const SearchContext = createContextId<any>('docsearch');\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/doc-search-button.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { SearchIcon } from './icons/SearchIcon';\n\nexport function isAppleDevice() {\n  return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n}\n\nexport type ButtonTranslations = Partial<{\n  buttonText: string;\n  buttonAriaLabel: string;\n}>;\n\nexport interface DocSearchButtonProps {\n  ref: any;\n  translations?: ButtonTranslations;\n  onClick$: () => void;\n}\n\nexport const DocSearchButton = component$((props: DocSearchButtonProps) => {\n  // const ACTION_KEY_DEFAULT = 'Ctrl' as const;\n  // const ACTION_KEY_APPLE = '⌘' as const;\n  // const { translations = {} } = props;\n  const { buttonText = 'Search', buttonAriaLabel = 'Search' } = props.translations ?? {};\n  return (\n    <button\n      ref={props.ref}\n      onClick$={props.onClick$}\n      type=\"button\"\n      class=\"DocSearch DocSearch-Button\"\n      aria-label={buttonAriaLabel}\n    >\n      <span class=\"DocSearch-Button-Container\">\n        <SearchIcon />\n        <span class=\"DocSearch-Button-Placeholder\">{buttonText}</span>\n      </span>\n    </button>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/doc-search-modal.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  noSerialize,\n  useContextProvider,\n  useTask$,\n  type Signal,\n} from '@builder.io/qwik';\nimport { MAX_QUERY_SIZE } from './constants';\nimport { SearchContext } from './context';\nimport type { DocSearchProps, DocSearchState } from './doc-search';\nimport { handleSearch } from './handleSearch';\nimport type { ScreenStateTranslations } from './screen-state';\nimport { ScreenState } from './screen-state';\nimport type { SearchBoxTranslations } from './search-box';\nimport { SearchBox } from './search-box';\nimport type { DocSearchHit } from './types';\n\nimport { identity } from './utils';\nimport { clearStalled, setStalled } from './utils/stalledControl';\nimport { AIButton } from './result';\nimport { isBrowser } from '@builder.io/qwik';\n\nexport type ModalTranslations = Partial<{\n  searchBox: SearchBoxTranslations;\n}> &\n  ScreenStateTranslations;\n\nexport type DocSearchModalProps = DocSearchProps & {\n  translations?: ModalTranslations;\n  state: DocSearchState;\n  aiResultOpen?: boolean;\n  isOpen: Signal<boolean>;\n};\n\nexport const DocSearchModal = component$(\n  ({\n    appId,\n    apiKey,\n    indexName,\n    state,\n    transformItems$ = identity,\n    aiResultOpen,\n    disableUserPersonalization = false,\n    isOpen,\n  }: DocSearchModalProps) => {\n    const containerRef = useSignal<Element>();\n    const modalRef = useSignal<Element>();\n    const formElementRef = useSignal<Element>();\n    const dropdownRef = useSignal<Element>();\n    const inputRef = useSignal<Element>();\n\n    const onSelectItem = noSerialize(({ item, event }: any) => {\n      if (event) {\n        if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n          isOpen.value = false;\n        }\n      }\n    }) as any;\n\n    const onInput = noSerialize((event: Event) => {\n      // TODO: cancelable request\n      clearStalled();\n      const query = (event.target as HTMLInputElement).value.slice(0, MAX_QUERY_SIZE);\n      state.query = query;\n      state.activeItemId = null;\n      state.status = 'loading';\n      // set new stalledId\n      setStalled(() => {\n        state.status = 'stalled';\n      });\n      handleSearch(query, {\n        state: state,\n        appId: appId,\n        apiKey: apiKey,\n        indexName: indexName,\n        snippetLength: 10,\n        transformItems: (data: DocSearchHit[]) => {\n          return transformItems$.apply(undefined, [data]);\n        },\n      })\n        .then(({ collections }) => {\n          state.status = 'idle';\n          state.collections = collections.reverse().map((c) => ({\n            ...c,\n            source: {\n              items: c.items,\n              sourceId: c.sourceId,\n            },\n          }));\n          // TODO:\n          // if not opened, ensure open\n          // if actived before, set active\n        })\n        .finally(() => {\n          clearStalled();\n          state.status = 'idle';\n        });\n    });\n    useContextProvider(SearchContext, {\n      onSelectItem,\n      onInput,\n    });\n\n    // useTouchEvents({\n    //   getEnvironmentProps,\n    //   panelElement: dropdownRef.current as any,\n    //   formElement: formElementRef.current as any,\n    //   inputElement: inputRef.current as any,\n    // });\n\n    // TODO:\n    // useTrapFocus(containerRef as any);\n\n    useTask$(() => {\n      if (isBrowser) {\n        document.body.classList.add('DocSearch--active');\n\n        return () => {\n          document.body.classList.remove('DocSearch--active');\n          document.body.style.overflow = '';\n        };\n      }\n    });\n\n    useTask$(({ track }) => {\n      if (isBrowser) {\n        track(() => state.query);\n        if (dropdownRef.value) {\n          dropdownRef.value.scrollTop = 0;\n        }\n      }\n    });\n\n    // We rely on a CSS property to set the modal height to the full viewport height\n    // because all mobile browsers don't compute their height the same way.\n    // See https://css-tricks.com/the-trick-to-viewport-units-on-mobile/\n    useTask$(() => {\n      if (isBrowser) {\n        const setFullViewportHeight = () => {\n          if (modalRef.value) {\n            const vh = window.innerHeight * 0.01;\n            // @ts-ignore\n            modalRef.value.style.setProperty('--docsearch-vh', `${vh}px`);\n          }\n        };\n\n        setFullViewportHeight();\n\n        window.addEventListener('resize', setFullViewportHeight);\n\n        return () => {\n          window.removeEventListener('resize', setFullViewportHeight);\n        };\n      }\n    });\n\n    return (\n      <div\n        ref={containerRef}\n        aria-expanded=\"true\"\n        aria-haspopup=\"listbox\"\n        aria-owns=\"docsearch-list\"\n        aria-labelledby=\"docsearch-list\"\n        class={[\n          'DocSearch',\n          'DocSearch-Container',\n          state.status === 'stalled' && 'DocSearch-Container--Stalled',\n          state.status === 'error' && 'DocSearch-Container--Errored',\n        ]}\n        role=\"button\"\n        tabIndex={0}\n        onMouseDown$={(event) => {\n          if (event.target === containerRef.value) {\n            isOpen.value = false;\n          }\n        }}\n      >\n        <div class=\"DocSearch-Modal\" ref={modalRef}>\n          <header class=\"DocSearch-SearchBar\" ref={formElementRef}>\n            <SearchBox isOpen={isOpen} state={state} autoFocus={true} inputRef={inputRef as any} />\n          </header>\n\n          <div class=\"DocSearch-Dropdown\" ref={dropdownRef}>\n            <div class=\"DocSearch-Dropdown-Container\">\n              <section class=\"DocSearch-Hits\">\n                <ul role=\"listbox\" aria-labelledby=\"docsearch-label\" id=\"docsearch-list\">\n                  <AIButton state={state} />\n                </ul>\n              </section>\n            </div>\n            <ScreenState\n              state={state}\n              disableUserPersonalization={disableUserPersonalization}\n              inputRef={inputRef as any}\n            />\n          </div>\n        </div>\n      </div>\n    );\n  }\n);\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/doc-search.css",
    "content": "/*! @docsearch/css 3.9.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */\n:root {\n  --docsearch-primary-color: #5468ff;\n  --docsearch-text-color: #1c1e21;\n  --docsearch-spacing: 12px;\n  --docsearch-icon-stroke-width: 1.4;\n  --docsearch-highlight-color: var(--docsearch-primary-color);\n  --docsearch-muted-color: #969faf;\n  --docsearch-container-background: rgba(101, 108, 133, 0.8);\n  --docsearch-logo-color: #5468ff;\n  --docsearch-modal-width: 560px;\n  --docsearch-modal-height: 600px;\n  --docsearch-modal-background: #f5f6f7;\n  --docsearch-modal-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), 0 3px 8px 0 #555a64;\n  --docsearch-searchbox-height: 56px;\n  --docsearch-searchbox-background: #ebedf0;\n  --docsearch-searchbox-focus-background: #fff;\n  --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);\n  --docsearch-hit-height: 56px;\n  --docsearch-hit-color: #444950;\n  --docsearch-hit-active-color: #fff;\n  --docsearch-hit-background: #fff;\n  --docsearch-hit-shadow: 0 1px 3px 0 #d4d9e1;\n  --docsearch-key-gradient: linear-gradient(-225deg, #d5dbe4, #f8f8f8);\n  --docsearch-key-shadow:\n    inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);\n  --docsearch-key-pressed-shadow:\n    inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, 0 1px 1px 0 rgba(30, 35, 90, 0.4);\n  --docsearch-footer-height: 44px;\n  --docsearch-footer-background: #fff;\n  --docsearch-footer-shadow: 0 -1px 0 0 #e0e3e8, 0 -3px 6px 0 rgba(69, 98, 155, 0.12);\n}\nhtml[data-theme='dark'] {\n  --docsearch-text-color: #f5f6f7;\n  --docsearch-container-background: rgba(9, 10, 17, 0.8);\n  --docsearch-modal-background: #15172a;\n  --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;\n  --docsearch-searchbox-background: #090a11;\n  --docsearch-searchbox-focus-background: #000;\n  --docsearch-hit-color: #bec3c9;\n  --docsearch-hit-shadow: none;\n  --docsearch-hit-background: #090a11;\n  --docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b);\n  --docsearch-key-shadow:\n    inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, 0.3);\n  --docsearch-key-pressed-shadow:\n    inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 1px 1px 0 #0304094d;\n  --docsearch-footer-background: #1e2136;\n  --docsearch-footer-shadow:\n    inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px 0 rgba(0, 0, 0, 0.2);\n  --docsearch-logo-color: #fff;\n  --docsearch-muted-color: #7f8497;\n}\n\n.DocSearch-Button {\n  --docsearch-text-color: var(--interactive-text-color);\n  --docsearch-muted-color: var(--interactive-text-color);\n  align-items: center;\n  background: var(--docsearch-searchbox-background);\n  border: 2px solid var(--interactive-text-color);\n  border-radius: 40px;\n  color: var(--docsearch-muted-color);\n  cursor: pointer;\n  display: flex;\n  font-weight: 500;\n  height: 36px;\n  justify-content: space-between;\n  padding: 12px;\n  user-select: none;\n}\n.DocSearch-Button:active,\n.DocSearch-Button:focus,\n.DocSearch-Button:hover {\n  background: var(--docsearch-searchbox-focus-background);\n  box-shadow: var(--docsearch-searchbox-shadow);\n  color: var(--docsearch-text-color);\n  outline: none;\n}\n.DocSearch-Button-Container {\n  align-items: center;\n  display: flex;\n}\n.DocSearch-Search-Icon {\n  stroke-width: 1.6;\n}\n.DocSearch-Button .DocSearch-Search-Icon {\n  color: var(--docsearch-text-color);\n}\n.DocSearch-Button-Placeholder {\n  font-size: 1rem;\n  padding: 0 12px 0 6px;\n}\n.DocSearch-Button-Keys {\n  display: flex;\n  min-width: calc(40px + 0.8em);\n}\n.DocSearch-Button-Key {\n  align-items: center;\n  background: var(--docsearch-key-gradient);\n  border: 0;\n  border-radius: 3px;\n  box-shadow: var(--docsearch-key-shadow);\n  color: var(--docsearch-muted-color);\n  display: flex;\n  height: 18px;\n  justify-content: center;\n  margin-right: 4em;\n  padding: 0 0 2px;\n  position: relative;\n  top: -1px;\n  transition-duration: 0.1s;\n  transition-property: all;\n  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n  width: 20px;\n}\n@media (prefers-reduced-motion) {\n  .DocSearch-Button-Key {\n    transition: none;\n  }\n}\n.DocSearch-Button-Key--pressed {\n  box-shadow: var(--docsearch-key-pressed-shadow);\n  transform: translate3d(0, 1px, 0);\n}\n\n.DocSearch--active {\n  overflow: hidden !important;\n  ::backdrop {\n    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 1) 100%);\n  }\n}\n.DocSearch-Container,\n.DocSearch-Container * {\n  box-sizing: border-box;\n}\n.DocSearch-Container {\n  background-color: var(--docsearch-container-background);\n  height: 100vh;\n  left: 0;\n  position: fixed;\n  top: 0;\n  width: 100vw;\n  z-index: 200;\n}\n.DocSearch-Container a {\n  text-decoration: none;\n}\n.DocSearch-Link {\n  appearance: none;\n  background: none;\n  border: 0;\n  color: var(--docsearch-highlight-color);\n  cursor: pointer;\n  font: inherit;\n  margin: 0;\n  padding: 0;\n}\n.DocSearch-Modal {\n  background: var(--docsearch-modal-background);\n  border-radius: 6px;\n  box-shadow: var(--docsearch-modal-shadow);\n  flex-direction: column;\n  margin: 60px auto auto;\n  max-width: var(--docsearch-modal-width);\n  position: relative;\n}\n.DocSearch-SearchBar {\n  display: flex;\n  padding: var(--docsearch-spacing) var(--docsearch-spacing) 0;\n}\n.DocSearch-Form {\n  align-items: center;\n  background: var(--docsearch-searchbox-focus-background);\n  border-radius: 4px;\n  box-shadow: var(--docsearch-searchbox-shadow);\n  display: flex;\n  height: var(--docsearch-searchbox-height);\n  margin: 0;\n  padding: 0 var(--docsearch-spacing);\n  position: relative;\n  width: 100%;\n}\n.DocSearch-Input {\n  appearance: none;\n  background: transparent;\n  border: 0;\n  color: var(--docsearch-text-color);\n  flex: 1;\n  font: inherit;\n  font-size: 1.2em;\n  height: 100%;\n  outline: none;\n  padding: 0 0 0 8px;\n  width: 80%;\n}\n.DocSearch-Input::placeholder {\n  color: var(--docsearch-muted-color);\n  opacity: 1;\n}\n.DocSearch-Input::-webkit-search-cancel-button,\n.DocSearch-Input::-webkit-search-decoration,\n.DocSearch-Input::-webkit-search-results-button,\n.DocSearch-Input::-webkit-search-results-decoration {\n  display: none;\n}\n.DocSearch-LoadingIndicator,\n.DocSearch-MagnifierLabel,\n.DocSearch-Reset {\n  margin: 0;\n  padding: 0;\n}\n.DocSearch-MagnifierLabel,\n.DocSearch-Reset {\n  align-items: center;\n  color: var(--docsearch-highlight-color);\n  display: flex;\n  justify-content: center;\n}\n.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,\n.DocSearch-LoadingIndicator {\n  display: none;\n}\n.DocSearch-Container--Stalled .DocSearch-LoadingIndicator {\n  align-items: center;\n  color: var(--docsearch-highlight-color);\n  display: flex;\n  justify-content: center;\n}\n@media screen and (prefers-reduced-motion: reduce) {\n  .DocSearch-Reset {\n    animation: none;\n    appearance: none;\n    background: none;\n    border: 0;\n    border-radius: 50%;\n    color: var(--docsearch-icon-color);\n    cursor: pointer;\n    right: 0;\n    stroke-width: var(--docsearch-icon-stroke-width);\n  }\n}\n.DocSearch-Reset {\n  animation: fade-in 0.1s ease-in forwards;\n  appearance: none;\n  background: none;\n  border: 0;\n  border-radius: 50%;\n  color: var(--docsearch-icon-color);\n  cursor: pointer;\n  padding: 2px;\n  right: 0;\n  stroke-width: var(--docsearch-icon-stroke-width);\n}\n.DocSearch-Reset[hidden] {\n  display: none;\n}\n.DocSearch-Reset:hover {\n  color: var(--docsearch-highlight-color);\n}\n.DocSearch-LoadingIndicator svg,\n.DocSearch-MagnifierLabel svg {\n  height: 24px;\n  width: 24px;\n}\n.DocSearch-Cancel {\n  display: none;\n}\n.DocSearch-Dropdown {\n  max-height: calc(\n    var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) -\n      var(--docsearch-footer-height)\n  );\n  min-height: var(--docsearch-spacing);\n  overflow-y: auto;\n  overflow-y: overlay;\n  padding: 0 var(--docsearch-spacing);\n  scrollbar-color: var(--docsearch-muted-color) var(--docsearch-modal-background);\n  scrollbar-width: thin;\n}\n.DocSearch-Dropdown::-webkit-scrollbar {\n  width: 12px;\n}\n.DocSearch-Dropdown::-webkit-scrollbar-track {\n  background: transparent;\n}\n.DocSearch-Dropdown::-webkit-scrollbar-thumb {\n  background-color: var(--docsearch-muted-color);\n  border: 3px solid var(--docsearch-modal-background);\n  border-radius: 20px;\n}\n.DocSearch-Dropdown ul {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n}\n.DocSearch-Label {\n  font-size: 0.75em;\n  line-height: 1.6em;\n}\n.DocSearch-Help,\n.DocSearch-Label {\n  color: var(--docsearch-muted-color);\n}\n.DocSearch-Help {\n  font-size: 0.9em;\n  margin: 0;\n  user-select: none;\n}\n.DocSearch-Title {\n  font-size: 1.2em;\n}\n.DocSearch-Logo a {\n  display: flex;\n}\n.DocSearch-Logo svg {\n  color: var(--docsearch-logo-color);\n  margin-left: 8px;\n}\n.DocSearch-Hits:last-of-type {\n  margin-bottom: 24px;\n}\n.DocSearch-Hits mark {\n  background: none;\n  color: var(--docsearch-highlight-color);\n}\n.DocSearch-HitsFooter {\n  color: var(--docsearch-muted-color);\n  display: flex;\n  font-size: 0.85em;\n  justify-content: center;\n  margin-bottom: var(--docsearch-spacing);\n  padding: var(--docsearch-spacing);\n}\n.DocSearch-HitsFooter a {\n  border-bottom: 1px solid;\n  color: inherit;\n}\n.DocSearch-Hit {\n  border-radius: 4px;\n  display: flex;\n  padding: 4px;\n  position: relative;\n  scroll-margin-top: 40px;\n}\n@media screen and (prefers-reduced-motion: reduce) {\n  .DocSearch-Hit--deleting {\n    transition: none;\n  }\n}\n.DocSearch-Hit--deleting {\n  opacity: 0;\n  transition: all 0.25s linear;\n}\n@media screen and (prefers-reduced-motion: reduce) {\n  .DocSearch-Hit--favoriting {\n    transition: none;\n  }\n}\n.DocSearch-Hit--favoriting {\n  transform: scale(0);\n  transform-origin: top center;\n  transition: all 0.25s linear;\n  transition-delay: 0.25s;\n}\n.DocSearch-Hit a {\n  background: var(--docsearch-hit-background);\n  border-radius: 4px;\n  box-shadow: var(--docsearch-hit-shadow);\n  display: block;\n  padding-left: var(--docsearch-spacing);\n  width: 100%;\n}\n.DocSearch-Hit-source {\n  background: var(--docsearch-modal-background);\n  color: var(--docsearch-highlight-color);\n  font-size: 0.85em;\n  font-weight: 600;\n  line-height: 32px;\n  margin: 0 -4px;\n  padding: 8px 4px 0;\n  position: sticky;\n  top: 0;\n  z-index: 10;\n}\n.DocSearch-Hit-Tree {\n  color: var(--docsearch-muted-color);\n  height: var(--docsearch-hit-height);\n  opacity: 0.5;\n  stroke-width: var(--docsearch-icon-stroke-width);\n  width: 24px;\n}\n.DocSearch-Hit[aria-selected='true'] a {\n  background-color: var(--docsearch-highlight-color);\n}\n.DocSearch-Hit[aria-selected='true'] mark {\n  text-decoration: underline;\n}\n.DocSearch-Hit-Container {\n  align-items: center;\n  color: var(--docsearch-hit-color);\n  display: flex;\n  flex-direction: row;\n  height: var(--docsearch-hit-height);\n  padding: 0 var(--docsearch-spacing) 0 0;\n}\n.DocSearch-Hit-icon {\n  height: 20px;\n  width: 20px;\n}\n.DocSearch-Hit-action,\n.DocSearch-Hit-icon {\n  color: var(--docsearch-muted-color);\n  stroke-width: var(--docsearch-icon-stroke-width);\n}\n.DocSearch-Hit-action {\n  align-items: center;\n  display: flex;\n  height: 22px;\n  width: 22px;\n}\n.DocSearch-Hit-action svg {\n  display: block;\n  height: 18px;\n  width: 18px;\n}\n.DocSearch-Hit-action + .DocSearch-Hit-action {\n  margin-left: 6px;\n}\n.DocSearch-Hit-action-button {\n  appearance: none;\n  background: none;\n  border: 0;\n  border-radius: 50%;\n  color: inherit;\n  cursor: pointer;\n  padding: 2px;\n}\nsvg.DocSearch-Hit-Select-Icon {\n  display: none;\n}\n.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Select-Icon {\n  display: block;\n}\n.DocSearch-Hit-action-button:focus,\n.DocSearch-Hit-action-button:hover {\n  background: rgba(0, 0, 0, 0.2);\n  transition: background-color 0.1s ease-in;\n}\n@media screen and (prefers-reduced-motion: reduce) {\n  .DocSearch-Hit-action-button:focus,\n  .DocSearch-Hit-action-button:hover {\n    transition: none;\n  }\n}\n.DocSearch-Hit-action-button:focus path,\n.DocSearch-Hit-action-button:hover path {\n  fill: #fff;\n}\n.DocSearch-Hit-content-wrapper {\n  display: flex;\n  flex: 1 1 auto;\n  flex-direction: column;\n  font-weight: 500;\n  justify-content: center;\n  line-height: 1.2em;\n  margin: 0 8px;\n  overflow-x: hidden;\n  position: relative;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  width: 80%;\n}\n.DocSearch-Hit-title {\n  font-size: 0.9em;\n}\n.DocSearch-Hit-path {\n  color: var(--docsearch-muted-color);\n  font-size: 0.75em;\n}\n.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Tree,\n.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-action,\n.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-icon,\n.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-path,\n.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-text,\n.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-title,\n.DocSearch-Hit[aria-selected='true'] mark {\n  color: var(--docsearch-hit-active-color) !important;\n}\n@media screen and (prefers-reduced-motion: reduce) {\n  .DocSearch-Hit-action-button:focus,\n  .DocSearch-Hit-action-button:hover {\n    background: rgba(0, 0, 0, 0.2);\n    transition: none;\n  }\n}\n.DocSearch-ErrorScreen,\n.DocSearch-NoResults,\n.DocSearch-StartScreen {\n  font-size: 0.9em;\n  margin: 0 auto;\n  padding: 36px 0;\n  text-align: center;\n  width: 80%;\n}\n.DocSearch-Screen-Icon {\n  color: var(--docsearch-muted-color);\n  padding-bottom: 12px;\n}\n.DocSearch-NoResults-Prefill-List {\n  display: inline-block;\n  padding-bottom: 24px;\n  text-align: left;\n}\n.DocSearch-NoResults-Prefill-List ul {\n  display: inline-block;\n  padding: 8px 0 0;\n}\n.DocSearch-NoResults-Prefill-List li {\n  list-style-position: inside;\n  list-style-type: '» ';\n}\n.DocSearch-Prefill {\n  appearance: none;\n  background: none;\n  border: 0;\n  border-radius: 1em;\n  color: var(--docsearch-highlight-color);\n  cursor: pointer;\n  display: inline-block;\n  font-size: 1em;\n  font-weight: 700;\n  padding: 0;\n}\n.DocSearch-Prefill:focus,\n.DocSearch-Prefill:hover {\n  outline: none;\n  text-decoration: underline;\n}\n.DocSearch-Footer {\n  align-items: center;\n  background: var(--docsearch-footer-background);\n  border-radius: 0 0 8px 8px;\n  box-shadow: var(--docsearch-footer-shadow);\n  display: flex;\n  flex-direction: row-reverse;\n  flex-shrink: 0;\n  height: var(--docsearch-footer-height);\n  justify-content: space-between;\n  padding: 0 var(--docsearch-spacing);\n  position: relative;\n  user-select: none;\n  width: 100%;\n  z-index: 300;\n}\n.DocSearch-Commands {\n  color: var(--docsearch-muted-color);\n  display: flex;\n  list-style: none;\n  margin: 0;\n  padding: 0;\n}\n.DocSearch-Commands li {\n  align-items: center;\n  display: flex;\n}\n.DocSearch-Commands li:not(:last-of-type) {\n  margin-right: 0.8em;\n}\n.DocSearch-Commands-Key {\n  align-items: center;\n  background: var(--docsearch-key-gradient);\n  border: 0;\n  border-radius: 2px;\n  box-shadow: var(--docsearch-key-shadow);\n  color: var(--docsearch-muted-color);\n  display: flex;\n  height: 18px;\n  justify-content: center;\n  margin-right: 0.4em;\n  padding: 0 0 1px;\n  width: 20px;\n}\n.DocSearch-VisuallyHiddenForAccessibility {\n  clip: rect(0 0 0 0);\n  clip-path: inset(50%);\n  height: 1px;\n  overflow: hidden;\n  position: absolute;\n  white-space: nowrap;\n  width: 1px;\n}\n@media (max-width: 768px) {\n  :root {\n    --docsearch-spacing: 10px;\n    --docsearch-footer-height: 40px;\n  }\n  .DocSearch-Dropdown {\n    height: 100%;\n  }\n  .DocSearch-Container {\n    height: 100vh;\n    height: -webkit-fill-available;\n    height: calc(var(--docsearch-vh, 1vh) * 100);\n  }\n  .DocSearch-Footer {\n    border-radius: 0;\n    bottom: 0;\n    position: absolute;\n  }\n\n  .DocSearch-Modal {\n    border-radius: 0;\n    box-shadow: none;\n    height: 100vh;\n    height: -webkit-fill-available;\n    margin: 0;\n    max-width: 100%;\n    width: 100%;\n  }\n\n  .DocSearch-Cancel {\n    appearance: none;\n    background: none;\n    border: 0;\n    color: var(--docsearch-highlight-color);\n    cursor: pointer;\n    display: inline-block;\n    flex: none;\n    font: inherit;\n    font-size: 1em;\n    font-weight: 500;\n    margin-left: var(--docsearch-spacing);\n    outline: none;\n    overflow: hidden;\n    padding: 0;\n    user-select: none;\n    white-space: nowrap;\n  }\n  .DocSearch-Commands,\n  .DocSearch-Hit-Tree {\n    display: none;\n  }\n}\n@keyframes fade-in {\n  0% {\n    opacity: 0;\n  }\n  to {\n    opacity: 1;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/doc-search.tsx",
    "content": "import type { SearchClient } from 'algoliasearch/lite';\nimport {\n  component$,\n  useStore,\n  useStyles$,\n  useSignal,\n  createContextId,\n  useContextProvider,\n  type Signal,\n  $,\n  sync$,\n} from '@builder.io/qwik';\nimport { Modal } from '@qwik-ui/headless';\nimport type { DocSearchHit, InternalDocSearchHit } from './types';\nimport { type ButtonTranslations } from './doc-search-button';\nimport { DocSearchModal, type ModalTranslations } from './doc-search-modal';\nimport styles from './doc-search.css?inline';\n\nexport type DocSearchTranslations = Partial<{\n  button: ButtonTranslations;\n  modal: ModalTranslations;\n}>;\n\nexport type DocSearchState = {\n  query: string;\n  collections: {\n    items: InternalDocSearchHit[];\n  }[];\n  context: {\n    searchSuggestions: string[];\n  };\n  activeItemId: null | number;\n  snippetLength: number;\n  status: 'idle' | 'loading' | 'stalled' | 'error';\n  initialQuery?: string;\n};\nexport interface DocSearchProps {\n  isOpen: Signal<boolean>;\n  appId: string;\n  apiKey: string;\n  indexName: string;\n  transformItems$?: (items: DocSearchHit[]) => DocSearchHit[];\n  transformSearchClient?: (searchClient: SearchClient) => SearchClient;\n  disableUserPersonalization?: boolean;\n  translations?: DocSearchTranslations;\n}\n\nexport function isEditingContent(event: KeyboardEvent): boolean {\n  const { isContentEditable, tagName } = event.target as HTMLElement;\n\n  return isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA';\n}\n\nexport const AiResultOpenContext = createContextId<Signal<boolean>>('aiResultOpen');\n\nexport const DocSearch = component$((props: DocSearchProps) => {\n  useStyles$(styles);\n\n  const aiResultOpen = useSignal(false);\n\n  useContextProvider(AiResultOpenContext, aiResultOpen);\n\n  const state = useStore<DocSearchState>({\n    initialQuery: '',\n    query: '',\n    collections: [],\n    context: {\n      searchSuggestions: [],\n    },\n    activeItemId: null,\n    status: 'idle',\n    snippetLength: 10,\n  });\n\n  const searchButtonRef = useSignal<Element>();\n  return (\n    <div\n      class={{ docsearch: true, 'ai-result-open': aiResultOpen.value }}\n      window:onKeyDown$={[\n        sync$((event: KeyboardEvent) => {\n          if (event.key === 'k' && (event.metaKey || event.ctrlKey)) {\n            event.preventDefault();\n          }\n        }),\n        $((event) => {\n          function open() {\n            // We check that no other DocSearch modal is showing before opening\n            // another one.\n            if (!document.body.classList.contains('DocSearch--active')) {\n              props.isOpen.value = true;\n            }\n          }\n          if (\n            (event.key === 'Escape' && props.isOpen.value) ||\n            // The `Cmd+K` shortcut both opens and closes the modal.\n            (event.key === 'k' && (event.metaKey || event.ctrlKey)) ||\n            // The `/` shortcut opens but doesn't close the modal because it's\n            // a character.\n            (!isEditingContent(event) && event.key === '/' && !props.isOpen.value)\n          ) {\n            event.preventDefault();\n            if (props.isOpen.value) {\n              props.isOpen.value = false;\n            } else if (!document.body.classList.contains('DocSearch--active')) {\n              open();\n            }\n          }\n\n          if (searchButtonRef && searchButtonRef.value === document.activeElement) {\n            if (/[a-zA-Z0-9]/.test(String.fromCharCode(event.keyCode))) {\n              props.isOpen.value = true;\n              state.initialQuery = event.key;\n            }\n          }\n        }),\n      ]}\n    >\n      <Modal.Root bind:show={props.isOpen}>\n        <Modal.Panel>\n          {props.isOpen.value && (\n            <DocSearchModal\n              isOpen={props.isOpen}\n              aiResultOpen={aiResultOpen.value}\n              indexName={props.indexName}\n              apiKey={props.apiKey}\n              appId={props.appId}\n              state={state}\n            />\n          )}\n        </Modal.Panel>\n      </Modal.Root>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/error-screen.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { ErrorIcon } from './icons/ErrorIcon';\n\nexport type ErrorScreenTranslations = Partial<{\n  titleText: string;\n  helpText: string;\n}>;\n\nexport const ErrorScreen = component$(() => {\n  return (\n    <div class=\"DocSearch-ErrorScreen\">\n      <div class=\"DocSearch-Screen-Icon\">\n        <ErrorIcon />\n      </div>\n      <p class=\"DocSearch-Title\">Unable to fetch results</p>\n      <p class=\"DocSearch-Help\">You might want to check your network connection.</p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/handleSearch.ts",
    "content": "// @ts-ignore\nimport algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser';\nimport type { SearchClient } from 'algoliasearch/lite';\nimport { preResolve, postResolve, resolve } from '@algolia/autocomplete-core/dist/esm/resolve';\nimport { reshape } from '@algolia/autocomplete-core/dist/esm/reshape';\nimport type { DocSearchHit } from './types';\nimport { groupBy, removeHighlightTags } from './utils';\n\nimport { version } from './version';\n\nlet client: SearchClient;\n\nexport function handleSearch(\n  query: string,\n  { state, appId, apiKey, indexName, snippetLength, transformItems }: any\n) {\n  if (!client) {\n    client = algoliasearch(appId, apiKey);\n    client.addAlgoliaAgent('docsearch', version);\n  }\n\n  let q = Promise.resolve([] as any[]);\n  if (query) {\n    q = client\n      .search<DocSearchHit>([\n        {\n          query,\n          indexName,\n          params: {\n            attributesToRetrieve: [\n              'hierarchy.lvl0',\n              'hierarchy.lvl1',\n              'hierarchy.lvl2',\n              'hierarchy.lvl3',\n              'hierarchy.lvl4',\n              'hierarchy.lvl5',\n              'hierarchy.lvl6',\n              'content',\n              'type',\n              'url',\n            ],\n            attributesToSnippet: [\n              `hierarchy.lvl1:${snippetLength}`,\n              `hierarchy.lvl2:${snippetLength}`,\n              `hierarchy.lvl3:${snippetLength}`,\n              `hierarchy.lvl4:${snippetLength}`,\n              `hierarchy.lvl5:${snippetLength}`,\n              `hierarchy.lvl6:${snippetLength}`,\n              `content:${snippetLength}`,\n            ],\n            snippetEllipsisText: '…',\n            highlightPreTag: '<mark>',\n            highlightPostTag: '</mark>',\n            hitsPerPage: 20,\n          },\n        },\n      ])\n      .then(({ results }) => {\n        const { hits, nbHits } = results[0];\n        const rawSources = groupBy(hits, (hit) => removeHighlightTags(hit));\n\n        // We store the `lvl0`s to display them as search suggestions\n        // in the \"no results\" screen.\n        if ((state.context.searchSuggestions as any[]).length < Object.keys(rawSources).length) {\n          state.context.searchSuggestions = Object.keys(rawSources);\n        }\n        state.context.nbHits = nbHits;\n\n        return Object.values<DocSearchHit[]>(rawSources).map((items, index) => {\n          return {\n            sourceId: `hits${index}`,\n            items,\n            getItemUrl: ({ item }: any) => item.url,\n            getItemInputValue: () => {},\n            onSelect: () => {},\n            getItems() {\n              return Promise.all(\n                Object.values(groupBy(items, (item) => item.hierarchy.lvl1)).map((x) => {\n                  if (transformItems) {\n                    return transformItems(x);\n                  }\n                  return x;\n                })\n              ).then((resp) => {\n                return resp\n                  .map((groupedHits) =>\n                    groupedHits.map((item: any) => {\n                      return {\n                        ...item,\n                        __docsearch_parent:\n                          item.type !== 'lvl1' &&\n                          groupedHits.find(\n                            (siblingItem: any) =>\n                              siblingItem.type === 'lvl1' &&\n                              siblingItem.hierarchy.lvl1 === item.hierarchy.lvl1\n                          ),\n                      };\n                    })\n                  )\n                  .flat();\n              });\n            },\n          };\n        });\n      });\n  }\n  return q\n    .then((sources) => {\n      return Promise.all(\n        sources.map((source) => {\n          return Promise.resolve(source.getItems()).then((itemsOrDescription) =>\n            preResolve<any>(itemsOrDescription, source.sourceId)\n          );\n        })\n      )\n        .then(resolve)\n        .then((responses) => postResolve(responses, sources as any))\n        .then((collections) => {\n          return reshape({\n            collections,\n            props: {\n              reshape: ({ sources }: any) => sources,\n            } as any,\n            state: {} as any,\n          });\n        });\n    })\n    .then((collections) => {\n      let baseItemId = 0;\n      const value = collections.map<any>((collection) => ({\n        ...collection,\n        // We flatten the stored items to support calling `getAlgoliaResults`\n        // from the source itself.\n        items: (collection.items as any[]).flat(Infinity).map((item: any) => ({\n          ...item,\n          __autocomplete_id: baseItemId++,\n        })),\n      }));\n\n      return {\n        collections: value,\n      };\n    });\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/hit.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\nimport type { InternalDocSearchHit, StoredDocSearchHit } from './types';\n\ninterface HitProps {\n  hit: InternalDocSearchHit | StoredDocSearchHit;\n}\n\nexport const Hit = component$((props: HitProps) => {\n  return (\n    <Link href={props.hit.url}>\n      <Slot />\n    </Link>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/ControlKeyIcon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const ControlKeyIcon = component$(() => {\n  return (\n    <svg width=\"15\" height=\"15\" class=\"DocSearch-Control-Key-Icon\">\n      <path\n        d=\"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953\"\n        stroke-width=\"1.2\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        stroke-linecap=\"square\"\n      />\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/ErrorIcon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const ErrorIcon = component$(() => {\n  return (\n    <svg\n      width=\"40\"\n      height=\"40\"\n      viewBox=\"0 0 20 20\"\n      fill=\"none\"\n      fill-rule=\"evenodd\"\n      stroke=\"currentColor\"\n      stroke-linecap=\"round\"\n      stroke-linejoin=\"round\"\n    >\n      <path d=\"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0\"></path>\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/LoadingIcon.tsx",
    "content": "export const LoadingIcon = () => {\n  return (\n    <svg viewBox=\"0 0 38 38\" stroke=\"currentColor\" stroke-opacity=\".5\">\n      <g fill=\"none\" fill-rule=\"evenodd\">\n        <g transform=\"translate(1 1)\" stroke-width=\"2\">\n          <circle stroke-opacity=\".3\" cx=\"18\" cy=\"18\" r=\"18\" />\n          <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n            <animateTransform\n              attributeName=\"transform\"\n              type=\"rotate\"\n              from=\"0 18 18\"\n              to=\"360 18 18\"\n              dur=\"1s\"\n              repeatCount=\"indefinite\"\n            />\n          </path>\n        </g>\n      </g>\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/NoResultsIcon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const NoResultsIcon = component$(() => {\n  return (\n    <svg\n      width=\"40\"\n      height=\"40\"\n      viewBox=\"0 0 20 20\"\n      fill=\"none\"\n      fill-rule=\"evenodd\"\n      stroke=\"currentColor\"\n      stroke-linecap=\"round\"\n      stroke-linejoin=\"round\"\n    >\n      <path d=\"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2\"></path>\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/RecentIcon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const RecentIcon = component$(() => {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n      <path\n        d=\"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n      />\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/ResetIcon.tsx",
    "content": "export const ResetIcon = () => {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n      <path\n        d=\"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n      />\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/SearchIcon.tsx",
    "content": "export const SearchIcon = () => {\n  return (\n    <svg width=\"24\" height=\"24\" class=\"DocSearch-Search-Icon\" viewBox=\"0 0 20 20\">\n      <path\n        d=\"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n      />\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/SelectIcon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const SelectIcon = component$(() => {\n  return (\n    <svg class=\"DocSearch-Hit-Select-Icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n      <g\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n      >\n        <path d=\"M18 3v4c0 2-2 4-4 4H2\" />\n        <path d=\"M8 17l-6-6 6-6\" />\n      </g>\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/SourceIcon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const LvlIcon = () => {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n      <path\n        d=\"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linejoin=\"round\"\n      />\n    </svg>\n  );\n};\n\nexport const SourceIcon = component$((props: { type: string }) => {\n  switch (props.type) {\n    case 'lvl1':\n      return <LvlIcon />;\n    case 'content':\n      return <ContentIcon />;\n    default:\n      return <AnchorIcon />;\n  }\n});\n\nexport function AnchorIcon() {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n      <path\n        d=\"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n      />\n    </svg>\n  );\n}\n\nexport function ContentIcon() {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n      <path\n        d=\"M17 5H3h14zm0 5H3h14zm0 5H3h14z\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linejoin=\"round\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/icons/StarIcon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const StarIcon = component$(() => {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\">\n      <path\n        d=\"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z\"\n        stroke=\"currentColor\"\n        fill=\"none\"\n        fill-rule=\"evenodd\"\n        stroke-linejoin=\"round\"\n      />\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/no-results-screen.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport type { DocSearchState } from './doc-search';\nimport { NoResultsIcon } from './icons/NoResultsIcon';\n\nexport type NoResultsScreenTranslations = Partial<{\n  noResultsText: string;\n  suggestedQueryText: string;\n  reportMissingResultsText: string;\n  reportMissingResultsLinkText: string;\n}>;\n\ntype NoResultsScreenProps = {\n  translations?: NoResultsScreenTranslations;\n  state: DocSearchState;\n};\n\nexport const NoResultsScreen = component$((props: NoResultsScreenProps) => {\n  return (\n    <div class=\"DocSearch-NoResults\">\n      <div class=\"DocSearch-Screen-Icon\">\n        <NoResultsIcon />\n      </div>\n      <p class=\"DocSearch-Title\">\n        No results for \"<strong>{props.state.query}</strong>\"\n      </p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/result.tsx",
    "content": "import { Slot, component$, useContext, useSignal, useStore, useTask$ } from '@builder.io/qwik';\n// import { QwikGPT } from '../qwik-gpt';\nimport { SearchContext } from './context';\nimport { AiResultOpenContext, type DocSearchState } from './doc-search';\nimport { Snippet } from './snippet';\nimport type { InternalDocSearchHit } from './types';\nimport { Link } from '@builder.io/qwik-city';\n\nexport const Result = component$(\n  ({ state, item }: { state: DocSearchState; item: InternalDocSearchHit }) => {\n    const actionStore = useStore({\n      isDeleting: false,\n      isFavoriting: false,\n      action: null,\n    });\n    const context: any = useContext(SearchContext);\n\n    return (\n      <li\n        role=\"option\"\n        aria-selected={state.activeItemId === item.__autocomplete_id ? 'true' : undefined}\n        id={`docsearch-item-${item.__autocomplete_id}`}\n        onMouseOver$={() => {\n          if (state.activeItemId !== item.__autocomplete_id) {\n            state.activeItemId = item.__autocomplete_id;\n          }\n        }}\n        onClick$={(event) => {\n          const searchList = [\n            event.target,\n            // @ts-ignore\n            event.target?.parentElement,\n            // @ts-ignore\n            event.target?.parentElement.parentElement,\n          ];\n          if (searchList.some((el) => el?.hasAttribute?.('preventdefault:click'))) {\n            return;\n          }\n          context.onSelectItem({\n            item,\n            event,\n          });\n        }}\n        class={[\n          'DocSearch-Hit',\n          (item as unknown as InternalDocSearchHit).__docsearch_parent && 'DocSearch-Hit--Child',\n          actionStore.isDeleting && 'DocSearch-Hit--deleting',\n          actionStore.isFavoriting && 'DocSearch-Hit--favoriting',\n        ]\n          .filter(Boolean)\n          .join(' ')}\n      >\n        <Link\n          href={item.url.replace('https://qwik.dev/', '/').replace('https://qwik.builder.io/', '/')}\n        >\n          <div class=\"DocSearch-Hit-Container\">\n            <Slot name=\"start-action\"></Slot>\n            {/* @ts-ignore */}\n            {item.hierarchy[item.type] && item.type === 'lvl1' && (\n              <div class=\"DocSearch-Hit-content-wrapper\">\n                <Snippet\n                  class=\"DocSearch-Hit-title\"\n                  hit={item}\n                  attribute={'hierarchy.lvl1'}\n                  key=\"s--1\"\n                />\n                {item.content && (\n                  <Snippet class=\"DocSearch-Hit-path\" hit={item} attribute={'content'} key=\"s-0\" />\n                )}\n              </div>\n            )}\n\n            {/* @ts-ignore */}\n            {item.hierarchy[item.type] &&\n              (item.type === 'lvl2' ||\n                item.type === 'lvl3' ||\n                item.type === 'lvl4' ||\n                item.type === 'lvl5' ||\n                item.type === 'lvl6') && (\n                <div class=\"DocSearch-Hit-content-wrapper\">\n                  <Snippet class=\"DocSearch-Hit-title\" hit={item} attribute={undefined} key=\"s-1\" />\n                  <Snippet\n                    class=\"DocSearch-Hit-path\"\n                    hit={item}\n                    attribute={'hierarchy.lvl1'}\n                    key=\"s-2\"\n                  />\n                </div>\n              )}\n\n            {item.type === 'content' && (\n              <div class=\"DocSearch-Hit-content-wrapper\">\n                <Snippet class=\"DocSearch-Hit-title\" hit={item} attribute={'content'} key=\"s-3\" />\n                <Snippet\n                  class=\"DocSearch-Hit-path\"\n                  hit={item}\n                  attribute={'hierarchy.lvl1'}\n                  key=\"s-4\"\n                />\n              </div>\n            )}\n            <Slot name=\"end-action\"></Slot>\n          </div>\n        </Link>\n      </li>\n    );\n  }\n);\n\nexport const AIButton = component$(({ state }: { state: DocSearchState }) => {\n  const gpt = useSignal<string>();\n  const aiResultOpen = useContext(AiResultOpenContext);\n\n  useTask$(({ track }) => {\n    aiResultOpen.value = Boolean(track(() => gpt.value?.trim()));\n  });\n\n  useTask$(({ track }) => {\n    // When query changes, reset gpt value\n    track(() => state.query);\n    gpt.value = '';\n  });\n\n  const ai = -1;\n  return (\n    <>\n      {state.query.length > 3 && (\n        <li\n          role=\"option\"\n          style={{ 'margin-top': '10px' }}\n          id={`docsearch-item-${ai}`}\n          aria-selected={state.activeItemId === ai ? 'true' : undefined}\n          class=\"ai-li\"\n          onMouseOver$={() => {\n            if (state.activeItemId !== ai) {\n              state.activeItemId = ai;\n            }\n          }}\n        >\n          {/* <div class=\"ai-button\">\n            <button\n              onClick$={() => {\n                gpt.value = state.query;\n              }}\n            >\n              <span>\n                🤖 Ask QwikAI (beta)\n                {state.query === '' ? (\n                  '...'\n                ) : (\n                  <>\n                    {': '}\n                    <strong>{state.query}</strong>\n                  </>\n                )}\n              </span>\n            </button>\n            {gpt.value && (\n              <div class=\"qwikgpt-box\">\n                <QwikGPT query={gpt.value}></QwikGPT>\n              </div>\n            )}\n          </div> */}\n        </li>\n      )}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/results-screen.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Result } from './result';\nimport { removeHighlightTags } from './utils';\nimport { SelectIcon } from './icons/SelectIcon';\nimport { SourceIcon } from './icons/SourceIcon';\nimport type { DocSearchState } from './doc-search';\n\nexport const ResultsScreen = component$((props: { state: DocSearchState }) => {\n  return (\n    <div class=\"DocSearch-Dropdown-Container\">\n      {props.state.collections.map((collection) => {\n        if (collection.items.length === 0) {\n          return null;\n        }\n\n        const title = removeHighlightTags(collection.items[0]);\n        return (\n          <section class=\"DocSearch-Hits\" key={title}>\n            <div class=\"DocSearch-Hit-source\">{title}</div>\n\n            <ul role=\"listbox\" aria-labelledby=\"docsearch-label\" id=\"docsearch-list\">\n              {collection.items.map((item, index) => {\n                return (\n                  <Result state={props.state} item={item} key={item.objectID}>\n                    {item.__docsearch_parent && (\n                      <svg q:slot=\"start-action\" class=\"DocSearch-Hit-Tree\" viewBox=\"0 0 24 54\">\n                        <g\n                          stroke=\"currentColor\"\n                          fill=\"none\"\n                          fill-rule=\"evenodd\"\n                          stroke-linecap=\"round\"\n                          stroke-linejoin=\"round\"\n                        >\n                          {item.__docsearch_parent !==\n                          collection.items[index + 1]?.__docsearch_parent ? (\n                            <path d=\"M8 6v21M20 27H8.3\" />\n                          ) : (\n                            <path d=\"M8 6v42M20 27H8.3\" />\n                          )}\n                        </g>\n                      </svg>\n                    )}\n                    <div q:slot=\"start-action\" class=\"DocSearch-Hit-icon\">\n                      <SourceIcon type={item.type} />\n                    </div>\n                    <div q:slot=\"end-action\" class=\"DocSearch-Hit-action\">\n                      <SelectIcon />\n                    </div>\n                  </Result>\n                );\n              })}\n            </ul>\n          </section>\n        );\n      })}\n\n      {/* {props.resultsFooterComponent && (\n        <section class=\"DocSearch-HitsFooter\">\n          <props.resultsFooterComponent state={props.state} />\n        </section>\n      )} */}\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/screen-state.tsx",
    "content": "import { component$, type Signal } from '@builder.io/qwik';\nimport type { DocSearchState } from './doc-search';\nimport type { ErrorScreenTranslations } from './error-screen';\nimport { ErrorScreen } from './error-screen';\nimport type { NoResultsScreenTranslations } from './no-results-screen';\nimport { NoResultsScreen } from './no-results-screen';\nimport { ResultsScreen } from './results-screen';\nimport { StartScreen } from './start-screen';\n\nexport type ScreenStateTranslations = Partial<{\n  errorScreen: ErrorScreenTranslations;\n  noResultsScreen: NoResultsScreenTranslations;\n}>;\n\nexport interface ScreenStateProps {\n  state: DocSearchState;\n  inputRef: Signal<HTMLInputElement | undefined>;\n  disableUserPersonalization: boolean;\n}\n\nexport const ScreenState = component$((props: ScreenStateProps) => {\n  if (props.state.status === 'error') {\n    return <ErrorScreen />;\n  }\n\n  const hasCollections = props.state.collections.some((collection) => collection.items.length > 0);\n\n  if (!props.state.query) {\n    return <StartScreen />;\n  }\n\n  if (hasCollections === false) {\n    return <NoResultsScreen state={props.state} />;\n  }\n\n  return <ResultsScreen state={props.state} />;\n});\n\n// TODO: prevent UI flickering\n// function areEqual(_prevProps, nextProps) {\n//   // We don't update the screen when Autocomplete is loading or stalled to\n//   // avoid UI flashes:\n//   //  - Empty screen → Results screen\n//   //  - NoResults screen → NoResults screen with another query\n//   return nextProps.state.status === 'loading' || nextProps.state.status === 'stalled';\n// }\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/search-box.tsx",
    "content": "import { component$, useVisibleTask$, useContext, type Signal } from '@builder.io/qwik';\n\nimport { MAX_QUERY_SIZE } from './constants';\nimport { SearchContext } from './context';\nimport type { DocSearchState } from './doc-search';\nimport { LoadingIcon } from './icons/LoadingIcon';\nimport { SearchIcon } from './icons/SearchIcon';\n\nexport type SearchBoxTranslations = Partial<{\n  resetButtonTitle: string;\n  resetButtonAriaLabel: string;\n  cancelButtonText: string;\n  cancelButtonAriaLabel: string;\n}>;\n\ninterface SearchBoxProps {\n  state: DocSearchState;\n  isOpen: Signal<boolean>;\n  autoFocus: boolean;\n  inputRef: Signal<HTMLInputElement | null>;\n}\n\nexport const SearchBox = component$((props: SearchBoxProps) => {\n  useVisibleTask$(() => {\n    if (props.autoFocus) {\n      props.inputRef.value?.focus();\n    }\n  });\n  const context = useContext(SearchContext);\n  return (\n    <>\n      <form\n        class=\"DocSearch-Form\"\n        noValidate={true}\n        role=\"search\"\n        action=\"\"\n        preventdefault:submit\n        onReset$={() => {\n          props.state.query = '';\n          props.state.status = 'idle';\n          props.state.activeItemId = null;\n        }}\n      >\n        <label class=\"DocSearch-MagnifierLabel\" for=\"docsearch-input\" id=\"docsearch-label\">\n          <SearchIcon />\n        </label>\n\n        <div class=\"DocSearch-LoadingIndicator\">\n          <LoadingIcon />\n        </div>\n\n        <input\n          class=\"DocSearch-Input\"\n          aria-autocomplete=\"both\"\n          aria-control=\"docsearch-list\"\n          aria-labelledby=\"docsearch-label\"\n          value={props.state.query}\n          id=\"docsearch-input\"\n          autoComplete=\"off\"\n          autoCorrect=\"off\"\n          autoCapitalize=\"off\"\n          maxLength={MAX_QUERY_SIZE}\n          enterKeyHint={props.state.activeItemId ? 'go' : 'search'}\n          spellcheck={false}\n          autoFocus={props.autoFocus}\n          placeholder=\"Search docs\"\n          type=\"search\"\n          ref={props.inputRef as any}\n          onInput$={(event) => {\n            context.onInput?.(event);\n          }}\n          // TODO: preventdefault:keydown by key's condition\n          onKeyDown$={(event) => {\n            if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n              const nextActiveId = getNextActiveItemId(\n                event.key === 'ArrowUp' ? -1 : 1,\n                props.state.activeItemId,\n                getItemsCount(props.state),\n                null\n              );\n              if (nextActiveId !== props.state.activeItemId) {\n                props.state.activeItemId = nextActiveId;\n                // scroll to if necessary\n                if (typeof document !== 'undefined') {\n                  const nodeItem = document.getElementById(\n                    `docsearch-item-${props.state.activeItemId}`\n                  );\n                  if (nodeItem) {\n                    if ((nodeItem as any).scrollIntoViewIfNeeded) {\n                      (nodeItem as any).scrollIntoViewIfNeeded(false);\n                    } else {\n                      nodeItem.scrollIntoView(false);\n                    }\n                  }\n                }\n              }\n            }\n            if (event.key === 'Escape') {\n              props.isOpen.value = false;\n            }\n            if (event.key === 'Enter') {\n              if (props.state.activeItemId !== null) {\n                const id = `docsearch-item-${props.state.activeItemId}`;\n                const element = document.querySelector(`#${id} a, #${id} button`) as HTMLElement;\n                if (element) {\n                  element.click();\n                }\n              }\n            }\n          }}\n          onFocus$={(e) => {\n            // noop\n          }}\n          onClick$={(e) => {\n            // noop\n          }}\n        />\n      </form>\n\n      <button\n        class=\"DocSearch-Cancel\"\n        type=\"reset\"\n        aria-label=\"Cancel\"\n        onClick$={() => (props.isOpen.value = false)}\n      >\n        Cancel\n      </button>\n    </>\n  );\n});\n\nexport function getNextActiveItemId(\n  moveAmount: number,\n  baseIndex: number | null,\n  itemCount: number,\n  defaultActiveItemId: number | null\n) {\n  if (!itemCount) {\n    return null;\n  }\n\n  if (\n    moveAmount < 0 &&\n    (baseIndex === null || (defaultActiveItemId !== null && baseIndex === -1))\n  ) {\n    return itemCount + moveAmount;\n  }\n\n  const numericIndex = (baseIndex === null ? -2 : baseIndex) + moveAmount;\n\n  if (numericIndex <= -2 || numericIndex >= itemCount) {\n    return defaultActiveItemId === null ? null : -1;\n  }\n\n  return numericIndex;\n}\nexport function getItemsCount(state: DocSearchState) {\n  if (state.collections.length === 0) {\n    return 0;\n  }\n\n  return state.collections.reduce(function (sum, collection) {\n    return sum + collection.items.length;\n  }, 0);\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/snippet.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport function getPropertyByPath(object: Record<string, any>, path: string): any {\n  const parts = path.split('.');\n\n  return parts.reduce((prev, current) => {\n    if (prev?.[current]) {\n      return prev[current];\n    }\n    return null;\n  }, object);\n}\n\ninterface SnippetProps<TItem> {\n  hit: TItem;\n  attribute?: string;\n  tagName?: string;\n  [prop: string]: unknown;\n}\n\nexport const Snippet = component$(\n  ({ hit, attribute, tagName = 'span', ...rest }: SnippetProps<any>) => {\n    let data =\n      getPropertyByPath(hit, `_snippetResult.${attribute ?? `hierarchy.${hit.type}`}.value`) ||\n      getPropertyByPath(hit, attribute ?? `hierarchy.${hit.type}`) ||\n      getPropertyByPath(hit, 'hierarchy.lvl0') + ' ' + getPropertyByPath(hit, 'hierarchy.lvl2');\n\n    const cleanedData = data.replace('<mark>', '').replace('</mark>', '').toLowerCase();\n    if (cleanedData === 'runtime-less') {\n      const paths = hit.url.split('/');\n      paths.pop();\n      data = `example: ${paths.pop()}`;\n    }\n\n    return <span {...rest} dangerouslySetInnerHTML={data} />;\n  }\n);\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/start-screen.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const StartScreen = component$(() => {\n  return null;\n});\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/stored-searches.ts",
    "content": "import { noSerialize } from '@builder.io/qwik';\nimport type { DocSearchHit, StoredDocSearchHit } from './types';\n\nfunction isLocalStorageSupported() {\n  const key = '__TEST_KEY__';\n\n  try {\n    localStorage.setItem(key, '');\n    localStorage.removeItem(key);\n    return true;\n  } catch (error) {\n    return false;\n  }\n}\n\nfunction createStorage<TItem>(key: string) {\n  if (isLocalStorageSupported() === false) {\n    return {\n      setItem() {},\n      getItem() {\n        return [];\n      },\n    };\n  }\n\n  return {\n    setItem(item: TItem[]) {\n      try {\n        return window.localStorage.setItem(key, JSON.stringify(item));\n      } catch (err) {\n        //\n      }\n    },\n    getItem(): TItem[] {\n      let item = [];\n      try {\n        const value = window.localStorage.getItem(key) || '[]';\n        item = JSON.parse(value);\n      } catch (err) {\n        //\n      }\n      return item;\n    },\n  };\n}\n\ntype CreateStoredSearchesOptions = {\n  key: string;\n  limit?: number;\n};\n\nexport type StoredSearchPlugin<TItem> = {\n  add: (item: TItem) => void;\n  remove: (item: TItem) => void;\n  getAll: () => TItem[];\n};\n\nexport function createStoredSearches<TItem extends StoredDocSearchHit>({\n  key,\n  limit = 5,\n}: CreateStoredSearchesOptions): StoredSearchPlugin<TItem> {\n  const storage = createStorage<TItem>(key);\n  let items = storage.getItem().slice(0, limit);\n\n  // @ts-ignore\n  return noSerialize({\n    add(item: TItem) {\n      const { _highlightResult, _snippetResult, ...hit } = item as unknown as DocSearchHit;\n\n      const isQueryAlreadySaved = items.findIndex((x) => x.objectID === hit.objectID);\n\n      if (isQueryAlreadySaved > -1) {\n        items.splice(isQueryAlreadySaved, 1);\n      }\n\n      items.unshift(hit as TItem);\n      items = items.slice(0, limit);\n\n      storage.setItem(items);\n    },\n    remove(item: TItem) {\n      items = items.filter((x) => x.objectID !== item.objectID);\n\n      storage.setItem(items);\n    },\n    getAll() {\n      return items;\n    },\n  });\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/types/DocSearchHit.ts",
    "content": "type ContentType = 'content' | 'lvl0' | 'lvl1' | 'lvl2' | 'lvl3' | 'lvl4' | 'lvl5' | 'lvl6';\n\ninterface DocSearchHitAttributeHighlightResult {\n  value: string;\n  matchLevel: 'full' | 'none' | 'partial';\n  matchedWords: string[];\n  fullyHighlighted?: boolean;\n}\n\ninterface DocSearchHitHighlightResultHierarchy {\n  lvl0: DocSearchHitAttributeHighlightResult;\n  lvl1: DocSearchHitAttributeHighlightResult;\n  lvl2: DocSearchHitAttributeHighlightResult;\n  lvl3: DocSearchHitAttributeHighlightResult;\n  lvl4: DocSearchHitAttributeHighlightResult;\n  lvl5: DocSearchHitAttributeHighlightResult;\n  lvl6: DocSearchHitAttributeHighlightResult;\n}\n\ninterface DocSearchHitHighlightResult {\n  content: DocSearchHitAttributeHighlightResult;\n  hierarchy: DocSearchHitHighlightResultHierarchy;\n  hierarchy_camel: DocSearchHitHighlightResultHierarchy[];\n}\n\ninterface DocSearchHitAttributeSnippetResult {\n  value: string;\n  matchLevel: 'full' | 'none' | 'partial';\n}\n\ninterface DocSearchHitSnippetResult {\n  content: DocSearchHitAttributeSnippetResult;\n  hierarchy: DocSearchHitHighlightResultHierarchy;\n  hierarchy_camel: DocSearchHitHighlightResultHierarchy[];\n}\n\nexport declare type DocSearchHit = {\n  objectID: string;\n  content: string | null;\n  url: string;\n  url_without_anchor: string;\n  type: ContentType;\n  anchor: string | null;\n  hierarchy: {\n    lvl0: string;\n    lvl1: string;\n    lvl2: string | null;\n    lvl3: string | null;\n    lvl4: string | null;\n    lvl5: string | null;\n    lvl6: string | null;\n  };\n  _highlightResult: DocSearchHitHighlightResult;\n  _snippetResult: DocSearchHitSnippetResult;\n  _rankingInfo?: {\n    promoted: boolean;\n    nbTypos: number;\n    firstMatchedWord: number;\n    proximityDistance?: number;\n    geoDistance: number;\n    geoPrecision?: number;\n    nbExactWords: number;\n    words: number;\n    filters: number;\n    userScore: number;\n    matchedGeoLocation?: {\n      lat: number;\n      lng: number;\n      distance: number;\n    };\n  };\n  _distinctSeqID?: number;\n};\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/types/InternalDocSearchHit.ts",
    "content": "import type { DocSearchHit } from './DocSearchHit';\n\nexport type InternalDocSearchHit = DocSearchHit & {\n  __docsearch_parent: InternalDocSearchHit | null;\n  __autocomplete_id: number;\n};\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/types/StoredDocSearchHit.ts",
    "content": "import type { DocSearchHit } from './DocSearchHit';\n\nexport type StoredDocSearchHit = Omit<DocSearchHit, '_highlightResult' | '_snippetResult'>;\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/types/index.ts",
    "content": "export * from './DocSearchHit';\nexport * from './InternalDocSearchHit';\nexport * from './StoredDocSearchHit';\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/useTouchEvents.ts",
    "content": "import type { AutocompleteApi } from '@algolia/autocomplete-core';\nimport { useTask$ } from '@builder.io/qwik';\n\ninterface UseTouchEventsProps {\n  getEnvironmentProps: AutocompleteApi<any>['getEnvironmentProps'];\n  panelElement: HTMLDivElement | null;\n  formElement: HTMLDivElement | null;\n  inputElement: HTMLInputElement | null;\n}\n\nexport function useTouchEvents({\n  getEnvironmentProps,\n  panelElement,\n  formElement,\n  inputElement,\n}: UseTouchEventsProps) {\n  useTask$(() => {\n    // TODO:\n    // if (!(panelElement && formElement && inputElement)) {\n    //   return undefined;\n    // }\n    // const { onTouchStart, onTouchMove } = getEnvironmentProps({\n    //   panelElement,\n    //   formElement,\n    //   inputElement,\n    // });\n    // window.addEventListener('touchstart', onTouchStart);\n    // window.addEventListener('touchmove', onTouchMove);\n    // return () => {\n    //   window.removeEventListener('touchstart', onTouchStart);\n    //   window.removeEventListener('touchmove', onTouchMove);\n    // };\n  });\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/useTrapFocus.ts",
    "content": "import { useTask$, type Signal } from '@builder.io/qwik';\n\ninterface UseTrapFocusProps {\n  containerRef: Signal<Element>;\n}\n\nexport function useTrapFocus(props: UseTrapFocusProps) {\n  useTask$(({ track }) => {\n    const container = track(() => props.containerRef.value) as HTMLElement;\n    if (!container) {\n      return undefined;\n    }\n\n    const focusableElements = container.querySelectorAll<HTMLElement>(\n      'a[href]:not([disabled]), button:not([disabled]), input:not([disabled])'\n    );\n    const firstElement = focusableElements[0];\n    const lastElement = focusableElements[focusableElements.length - 1];\n\n    function trapFocus(event: KeyboardEvent) {\n      if (event.key !== 'Tab') {\n        return;\n      }\n\n      if (event.shiftKey) {\n        if (document.activeElement === firstElement) {\n          event.preventDefault();\n          lastElement.focus();\n        }\n      } else if (document.activeElement === lastElement) {\n        event.preventDefault();\n        firstElement.focus();\n      }\n    }\n\n    container.addEventListener('keydown', trapFocus);\n\n    return () => {\n      container.removeEventListener('keydown', trapFocus);\n    };\n  });\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/utils/groupBy.ts",
    "content": "export function groupBy<TValue extends Record<string, unknown>>(\n  values: TValue[],\n  predicate: (value: TValue) => string\n): Record<string, TValue[]> {\n  return values.reduce<Record<string, TValue[]>>((acc, item) => {\n    const key = predicate(item);\n\n    if (!Object.prototype.hasOwnProperty.call(acc, key)) {\n      acc[key] = [];\n    }\n\n    // We limit each section to show 5 hits maximum.\n    // This acts as a frontend alternative to `distinct`.\n    if (acc[key].length < 5) {\n      acc[key].push(item);\n    }\n\n    return acc;\n  }, {});\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/utils/identity.ts",
    "content": "export function identity<TParam>(x: TParam): TParam {\n  return x;\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/utils/index.ts",
    "content": "export * from './groupBy';\nexport * from './identity';\nexport * from './noop';\nexport * from './removeHighlightTags';\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/utils/isSamsung.ts",
    "content": "const regex = /((gt|sm)-|galaxy nexus)|samsung[- ]/i;\n\nexport function isSamsung(userAgent: string) {\n  return Boolean(userAgent && userAgent.match(regex));\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/utils/noop.ts",
    "content": "export function noop(..._args: any[]): void {}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/utils/removeHighlightTags.ts",
    "content": "import type { DocSearchHit, InternalDocSearchHit } from '../types';\n\nconst regexHighlightTags = /(<mark>|<\\/mark>)/g;\nconst regexHasHighlightTags = RegExp(regexHighlightTags.source);\n\nexport function removeHighlightTags(hit: DocSearchHit | InternalDocSearchHit): string {\n  const internalDocSearchHit = hit as InternalDocSearchHit;\n\n  if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) {\n    return hit.hierarchy.lvl0;\n  }\n\n  const { value } =\n    (internalDocSearchHit.__docsearch_parent\n      ? internalDocSearchHit.__docsearch_parent?._highlightResult?.hierarchy?.lvl0\n      : hit._highlightResult?.hierarchy?.lvl0) || {};\n\n  return value && regexHasHighlightTags.test(value) ? value.replace(regexHighlightTags, '') : value;\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/utils/stalledControl.ts",
    "content": "const stallThreshold = 200;\nlet stalledTimer: any;\n\nexport function setStalled(cb: () => void) {\n  stalledTimer = setTimeout(() => {\n    cb();\n  }, stallThreshold);\n}\n\nexport function clearStalled() {\n  if (stalledTimer) {\n    clearTimeout(stalledTimer);\n    stalledTimer = undefined;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/components/docsearch/version.ts",
    "content": "export const version = '3.2.0';\n"
  },
  {
    "path": "packages/docs/src/components/footer/footer.css",
    "content": "footer {\n  padding: 20px 0;\n}\n\n.made-with-love {\n  font-size: 12px;\n  margin-bottom: 9px;\n  color: var(--made-with-love-text-color);\n}\n\n.footer-top {\n  display: flex;\n  justify-content: space-between;\n  border-bottom: 1px solid var(--text-color);\n  padding-bottom: 15px;\n}\n\n.footer-social {\n  list-style: none;\n  display: flex;\n}\n\n.footer-social li {\n  padding: 10px;\n}\n\n.footer-bottom {\n  padding-top: 5px;\n  font-size: 12px;\n}\n\n.builder-logo {\n  margin-right: 10px;\n}\n"
  },
  {
    "path": "packages/docs/src/components/footer/footer.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\n\nimport { QwikLogo } from '~/components/svgs/qwik-logo';\nimport { DiscordLogo } from '~/components/svgs/discord-logo';\nimport { GithubLogo } from '~/components/svgs/github-logo';\nimport { TwitterLogo } from '~/components/svgs/twitter-logo';\nimport { BlueskyLogo } from '~/components/svgs/bluesky-logo';\n\nconst linkColumns = [\n  [\n    { title: 'Docs', href: `/docs/` },\n    { title: 'Qwik City', href: `/docs/qwikcity/` },\n    { title: 'Ecosystem', href: `/ecosystem/` },\n    { title: 'Playground', href: `/playground/` },\n  ],\n  [\n    { title: 'Integrations', href: `/ecosystem/#integrations` },\n    { title: 'Deployments', href: `/ecosystem/#deployments` },\n    { title: 'Media', href: `/ecosystem/#videos` },\n    { title: 'Showcase', href: `/showcase/` },\n  ],\n  [\n    { title: 'Tutorial', href: `/ecosystem/#courses` },\n    { title: 'Presentations', href: `/ecosystem/#presentations` },\n    { title: 'Community', href: `/ecosystem/#community` },\n    { title: 'Press', href: `/press/` },\n  ],\n];\n\nexport const Footer = component$(() => {\n  return (\n    <footer class=\"mb-12 mt-10\">\n      <div class=\"flex justify-center my-12\">\n        <div class=\"flex flex-grow justify-center flex-wrap max-w-screen-xl flex-col sm:flex-row gap-y-4\">\n          <div class=\"flex-1 sm:flex-[2] flex sm:justify-center sm:block mb-4 sm:mb-0\">\n            <QwikLogo width={170} height={54} />\n          </div>\n          <div class=\"flex flex-1 sm:flex-[3] max-w-screen-sm flex-wrap gap-y-8 gap-x-20 text-xs sm:px-4\">\n            <FooterLinks />\n          </div>\n        </div>\n      </div>\n      <div class=\"flex justify-center\">\n        <div class=\"max-w-screen-xl w-full\">\n          <div class=\"italic text-xs\">\n            <p>\n              Made with <span class=\"not-italic\">❤️</span> by\n            </p>\n            <p class=\"text-xl sm:text-2xl\">\n              The <strong>Qwik</strong> Team\n            </p>\n          </div>\n          <div class=\"border border-b-0 border-current mt-2\"></div>\n          <div class=\"flex justify-between items-end\">\n            <p class=\"text-xs\">MIT License © {new Date().getFullYear()}</p>\n            <FooterSocialLinks />\n          </div>\n        </div>\n      </div>\n    </footer>\n  );\n});\n\nexport const FooterLinks = component$(() => {\n  return (\n    <>\n      {linkColumns.map((column, colIndex) => (\n        <div key={colIndex} class=\"flex flex-col gap-4 flex-1\">\n          {column.map((link, linkIndex) => (\n            <Link\n              key={linkIndex}\n              class=\"text-[color:var(--text-color)] hover:text-interactive-blue z-[10]\"\n              href={link.href}\n            >\n              {link.title}\n            </Link>\n          ))}\n        </div>\n      ))}\n    </>\n  );\n});\n\nexport const FooterSocialLinks = component$(() => {\n  const socialLinks = [\n    { href: 'https://qwik.dev/chat', title: 'Discord', Logo: DiscordLogo },\n    { href: 'https://github.com/QwikDev/qwik', title: 'GitHub', Logo: GithubLogo },\n    { href: 'https://twitter.com/QwikDev', title: 'Twitter', Logo: TwitterLogo },\n    { href: 'https://bsky.app/profile/qwik.dev', title: 'Bluesky', Logo: BlueskyLogo },\n  ];\n\n  return (\n    <ul class=\"flex gap-4 mt-4\">\n      {socialLinks.map(({ title, href, Logo }) => (\n        <li key={title} class=\"list-none\">\n          <a href={href} target=\"_blank\" title={title}>\n            <span>\n              <Logo width={22} height={22} />\n            </span>\n          </a>\n        </li>\n      ))}\n    </ul>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/header/header.css",
    "content": "@reference \"tailwindcss\";\n\n.header-container {\n  height: var(--header-height);\n  background: var(--bg-color);\n  position: sticky;\n  top: 0;\n  z-index: 100;\n}\n\n@media (min-width: 1024px) {\n  .header-container {\n    background: var(--bg-header-color);\n    backdrop-filter: blur(23px) saturate(4.5);\n  }\n}\n\n.header-container.home-page-header {\n  background: transparent !important;\n  color: white;\n}\n\n.header-open .header-container.home-page-header .menu-toolkit {\n  background: #101010 !important;\n}\n\n.home-page-header .sun-and-moon:not(:hover) > :is(.moon, .sun, .sun-beams) {\n  fill: #e3e2e9 !important;\n  stroke: #e3e2e9 !important;\n}\n\n.home-page-header.sun-and-moon:is(:hover) > :is(.moon, .sun, .sun-beams) {\n  fill: #b9b8be !important;\n  stroke: #b9b8be !important;\n}\n\n.fixed-header .header-container {\n  width: 100%;\n  z-index: 40;\n}\n\n.builder-bar {\n  position: relative;\n  z-index: 50;\n}\n\nheader li {\n  @apply px-2 text-right;\n  @apply py-4 lg:py-0;\n\n  font-size: 14px;\n  font-weight: 500;\n}\n\nheader a.active {\n  color: var(--interactive-text-color);\n}\n\nheader a:hover {\n  text-decoration: underline;\n}\n\nheader li a:hover svg {\n  opacity: 0.8;\n}\n\nheader .mobile-menu {\n  height: var(--header-height);\n  position: absolute;\n  right: 0;\n  @apply p-5 lg:hidden;\n}\n\nheader .menu-toolkit {\n  @apply hidden lg:flex;\n  @apply pt-0 lg:pt-0 pb-0;\n  height: 100%;\n  align-items: center;\n}\n\nheader .more-icon {\n  display: block;\n}\n\nheader .close-icon {\n  display: none;\n}\n\nheader .header-inner {\n  @apply flex items-center;\n  max-width: var(--container-max-width);\n  margin-left: auto;\n  margin-right: auto;\n  position: relative;\n  height: var(--header-height);\n}\n\n.full-width header .header-inner {\n  max-width: 100%;\n}\n\nheader .header-logo {\n  padding-left: 1rem;\n  display: flex;\n  align-items: center;\n  height: var(--header-height);\n}\n\n.full-width header .header-logo {\n  left: 0;\n}\n\n@media (max-width: 1023px) {\n  header .qwik-logo {\n    width: auto;\n    height: 33px;\n    @apply ml-2;\n  }\n\n  header .header-logo {\n    @apply pl-2;\n  }\n\n  header .mobile-menu {\n    padding: 0.5rem 1rem;\n  }\n\n  .header-open header ul:not([role='listbox']) {\n    position: absolute;\n    z-index: 10;\n    display: block;\n    top: var(--header-height);\n    width: 100%;\n    background: var(--bg-color);\n    height: auto;\n  }\n\n  .header-open header .more-icon {\n    display: none;\n  }\n\n  .header-open header .close-icon {\n    display: block;\n  }\n\n  .header-open .menu-toolkit li {\n    text-align: center;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/components/header/header.tsx",
    "content": "import { Link, useLocation } from '@builder.io/qwik-city';\nimport {\n  component$,\n  useStyles$,\n  useContext,\n  useVisibleTask$,\n  type PropsOf,\n  useSignal,\n  $,\n} from '@builder.io/qwik';\nimport { DocSearch } from '../docsearch/doc-search';\nimport { CloseIcon } from '../svgs/close-icon';\nimport { DiscordLogo } from '../svgs/discord-logo';\nimport { GithubLogo } from '../svgs/github-logo';\nimport { MoreIcon } from '../svgs/more-icon';\nimport { QwikLogo } from '../svgs/qwik-logo';\nimport { TwitterLogo } from '../svgs/twitter-logo';\nimport styles from './header.css?inline';\nimport { GlobalStore } from '../../context';\nimport {\n  getColorPreference,\n  setPreference,\n  ThemeToggle,\n  getEffectiveTheme,\n} from '../theme-toggle/theme-toggle';\nimport { SearchIcon } from '../docsearch/icons/SearchIcon';\nimport { getPkgManagerPreference } from '../package-manager-tabs';\nimport { colorSchemeChangeListener } from '../theme-toggle/theme-script';\n\nexport const SearchButton = component$<PropsOf<'button'>>(({ ...props }) => {\n  return (\n    <button\n      {...props}\n      class={['DocSearch-Button', props.class]}\n      type=\"button\"\n      title=\"Search\"\n      aria-label=\"Search\"\n    >\n      <span class=\"mr-2 md:inline-block sm:hidden hidden sm:visible\">Search</span>\n      <SearchIcon />\n    </button>\n  );\n});\n\nexport const Header = component$(() => {\n  useStyles$(styles);\n  const shouldActivate = useSignal(false);\n  const globalStore = useContext(GlobalStore);\n  const pathname = useLocation().url.pathname;\n\n  useVisibleTask$(() => {\n    globalStore.pkgManager = getPkgManagerPreference();\n    const pref = getColorPreference();\n    globalStore.theme = getEffectiveTheme(pref);\n    return colorSchemeChangeListener((isDark) => {\n      const currentPref = getColorPreference();\n      if (currentPref === 'auto') {\n        globalStore.theme = isDark ? 'dark' : 'light';\n        setPreference('auto');\n      }\n    });\n  });\n\n  const closeHeaderMenuOpen = $(() => {\n    globalStore.headerMenuOpen = false;\n  });\n\n  return (\n    <>\n      <header\n        class={{\n          'header-container': true,\n          'home-page-header': pathname === '/',\n        }}\n      >\n        <div class=\"header-inner\">\n          <div class=\"header-logo\">\n            <Link href=\"/\">\n              <span class=\"sr-only\">Qwik Homepage</span>\n              <QwikLogo width={130} height={44} />\n            </Link>\n          </div>\n          <div class=\"flex items-center lg:hidden\">\n            <SearchButton\n              onClick$={() => {\n                shouldActivate.value = true;\n              }}\n              class=\"absolute right-14 lg:hidden\"\n            />\n          </div>\n          <button\n            onClick$={() => {\n              globalStore.headerMenuOpen = !globalStore.headerMenuOpen;\n            }}\n            class=\"mobile-menu\"\n            type=\"button\"\n            title=\"Toggle right menu\"\n            aria-label=\"Toggle right menu\"\n          >\n            <span class=\"more-icon\">\n              <MoreIcon width={30} height={30} />\n            </span>\n            <span class=\"close-icon\">\n              <CloseIcon width={30} height={30} />\n            </span>\n          </button>\n          <ul class=\"lg:grow lg:flex lg:justify-end lg:p-4 menu-toolkit\">\n            <li>\n              <Link\n                href=\"/docs/\"\n                class={{ active: pathname.startsWith('/docs') }}\n                onClick$={closeHeaderMenuOpen}\n              >\n                <span>Docs</span>\n              </Link>\n            </li>\n            <li>\n              <Link\n                href=\"/ecosystem/\"\n                class={{ active: pathname.startsWith('/ecosystem') }}\n                onClick$={closeHeaderMenuOpen}\n              >\n                <span>Ecosystem</span>\n              </Link>\n            </li>\n            <li>\n              <a\n                href=\"/tutorial/welcome/overview/\"\n                class={{ active: pathname.startsWith('/tutorial') }}\n              >\n                <span>Tutorial</span>\n              </a>\n            </li>\n            <li>\n              <a\n                href=\"/examples/introduction/hello-world/\"\n                class={{ active: pathname.startsWith('/examples') }}\n                aria-label=\"Qwik playground\"\n              >\n                <span class=\"qwiksand\" aria-hidden=\"true\">\n                  Qwik Sandbox\n                </span>\n              </a>\n            </li>\n            <li>\n              <Link\n                href=\"/blog/\"\n                class={{ active: pathname.startsWith('/blog') }}\n                aria-label=\"Qwik blog\"\n                onClick$={closeHeaderMenuOpen}\n              >\n                <span>Blog</span>\n              </Link>\n            </li>\n            <li class=\"hidden lg:flex\">\n              <SearchButton\n                onClick$={() => {\n                  shouldActivate.value = true;\n                }}\n              />\n            </li>\n            <li>\n              <ThemeToggle />\n            </li>\n            <li>\n              <a href=\"https://github.com/QwikDev/qwik\" target=\"_blank\" title=\"GitHub\">\n                <span class=\"lg:hidden\">GitHub</span>\n                <span class=\"hidden lg:block\">\n                  <GithubLogo width={22} height={22} />\n                </span>\n              </a>\n            </li>\n            <li>\n              <a href=\"https://twitter.com/QwikDev\" target=\"_blank\" title=\"Twitter\">\n                <span class=\"lg:hidden\">@QwikDev</span>\n                <span class=\"hidden lg:block\">\n                  <TwitterLogo width={22} height={22} />\n                </span>\n              </a>\n            </li>\n            <li>\n              <a href=\"https://qwik.dev/chat\" target=\"_blank\" title=\"Discord\">\n                <span class=\"lg:hidden\">Discord</span>\n                <span class=\"hidden lg:block\">\n                  <DiscordLogo width={22} height={22} />\n                </span>\n              </a>\n            </li>\n          </ul>\n        </div>\n        <DocSearch\n          isOpen={shouldActivate}\n          appId={import.meta.env.VITE_ALGOLIA_APP_ID}\n          apiKey={import.meta.env.VITE_ALGOLIA_SEARCH_KEY}\n          indexName={import.meta.env.VITE_ALGOLIA_INDEX}\n        />\n      </header>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/on-this-page/on-this-page.css",
    "content": "@reference \"tailwindcss\";\n\n.on-this-page {\n  @apply py-8 pt-10;\n  @apply text-base;\n\n  position: sticky;\n  top: var(--header-height);\n  min-width: var(--aside-width);\n  height: calc(100vh - var(--header-height));\n}\n\n.on-this-page h6 {\n  @apply font-bold text-center pb-3 uppercase;\n}\n\n.on-this-page li {\n  @apply rounded-lg;\n}\n\n.on-this-page-item {\n  @apply block px-3 py-2 whitespace-nowrap overflow-hidden text-ellipsis;\n}\n\n.more-item {\n  @apply inline-flex gap-x-2 px-3 py-2 items-center;\n}\n"
  },
  {
    "path": "packages/docs/src/components/on-this-page/on-this-page.tsx",
    "content": "import { $, component$, useContext, useOnDocument, useSignal, useStyles$ } from '@builder.io/qwik';\nimport { Link, useContent, useLocation } from '@builder.io/qwik-city';\nimport { GlobalStore } from '../../context';\nimport { AlertIcon } from '../svgs/alert-icon';\nimport { ChatIcon } from '../svgs/chat-icon';\nimport { EditIcon } from '../svgs/edit-icon';\nimport { GithubLogo } from '../svgs/github-logo';\nimport { TwitterLogo } from '../svgs/twitter-logo';\nimport styles from './on-this-page.css?inline';\n\nconst QWIK_GROUP = [\n  'components',\n  'concepts',\n  'faq',\n  'getting-started',\n  'index',\n  'deprecated-features',\n];\n\nconst QWIK_ADVANCED_GROUP = [\n  'containers',\n  'custom-build-dir',\n  'dollar',\n  'eslint',\n  'library',\n  'optimizer',\n  'modules-prefetching',\n  'qrl',\n  'qwikloader',\n  'vite',\n];\n\nconst QWIKCITY_GROUP = [\n  'action',\n  'api',\n  'caching',\n  'endpoints',\n  'error-handling',\n  'guides',\n  'html-attributes',\n  'layout',\n  'middleware',\n  'pages',\n  'project-structure',\n  'qwikcity',\n  're-exporting-loaders',\n  'route-loader',\n  'routing',\n  'server$',\n  'validator',\n];\n\nconst QWIKCITY_ADVANCED_GROUP = [\n  'complex-forms',\n  'content-security-policy',\n  'menu',\n  'plugins',\n  'request-handling',\n  'routing',\n  'sitemaps',\n  'speculative-module-fetching',\n  'static-assets',\n];\n\nconst makeEditPageUrl = (url: string): string => {\n  const segments = url.split('/').filter((part) => part !== '');\n  if (segments[0] !== 'docs') {\n    return url;\n  }\n\n  let group = '';\n  if (segments.length === 1) {\n    // Handle root /docs path - it maps to the qwik overview page\n    return 'docs/(qwik)';\n  }\n\n  if (segments[1] == 'advanced') {\n    if (QWIK_ADVANCED_GROUP.includes(segments[2])) {\n      group = '(qwik)';\n    } else if (QWIKCITY_ADVANCED_GROUP.includes(segments[2])) {\n      group = '(qwikcity)';\n    }\n  } else if (QWIK_GROUP.includes(segments[1])) {\n    group = '(qwik)';\n  } else if (QWIKCITY_GROUP.includes(segments[1])) {\n    group = '(qwikcity)';\n  }\n\n  if (group) {\n    segments.splice(1, 0, group);\n  }\n\n  // Handle special cases for components and concepts which have a different structure\n  if (segments.includes('components') || segments.includes('concepts')) {\n    // Check if this is a subpage under components or concepts\n    const componentIndex = segments.indexOf('components');\n    const conceptIndex = segments.indexOf('concepts');\n    const index = componentIndex !== -1 ? componentIndex : conceptIndex;\n\n    // If there's a subpage (like components/overview or concepts/resumable)\n    if (index !== -1 && index + 1 >= segments.length) {\n      // These are directory paths without subpaths, map to their overview pages\n      if (componentIndex !== -1) {\n        return 'docs/(qwik)/core/overview';\n      } else if (conceptIndex !== -1) {\n        return 'docs/(qwik)/concepts/think-qwik';\n      }\n    }\n  }\n\n  return segments.join('/');\n};\n\nexport const OnThisPage = component$(() => {\n  useStyles$(styles);\n  const theme = useContext(GlobalStore);\n  const { headings } = useContent();\n  const contentHeadings = headings?.filter((h) => h.level <= 3) || [];\n\n  const { url } = useLocation();\n\n  const githubEditRoute = makeEditPageUrl(url.pathname);\n\n  const editUrl = `https://github.com/QwikDev/qwik/edit/main/packages/docs/src/routes/${githubEditRoute}/index.mdx`;\n\n  const OnThisPageMore = [\n    {\n      href: editUrl,\n      text: 'Edit this Page',\n      icon: EditIcon,\n    },\n    {\n      href: 'https://github.com/QwikDev/qwik/issues/new/choose',\n      text: 'Create an issue',\n      icon: AlertIcon,\n    },\n    {\n      href: 'https://qwik.dev/chat',\n      text: 'Join our community',\n      icon: ChatIcon,\n    },\n    {\n      href: 'https://github.com/QwikDev/qwik',\n      text: 'GitHub',\n      icon: GithubLogo,\n    },\n    {\n      href: 'https://twitter.com/QwikDev',\n      text: '@QwikDev',\n      icon: TwitterLogo,\n    },\n  ];\n\n  const useActiveItem = (itemIds: string[]) => {\n    const activeId = useSignal<string | null>(null);\n    useOnDocument(\n      'scroll',\n      $(() => {\n        const observer = new IntersectionObserver(\n          (entries) => {\n            entries.forEach((entry) => {\n              if (entry.isIntersecting) {\n                activeId.value = entry.target.id;\n              }\n            });\n          },\n          { rootMargin: '0% 0% -80% 0%' }\n        );\n\n        itemIds.forEach((id) => {\n          const element = document.getElementById(id);\n          if (element) {\n            observer.observe(element);\n          }\n        });\n\n        return () => {\n          itemIds.forEach((id) => {\n            const element = document.getElementById(id);\n            if (element) {\n              observer.unobserve(element);\n            }\n          });\n        };\n      })\n    );\n\n    return activeId;\n  };\n\n  const activeId = useActiveItem(contentHeadings.map((h) => h.id));\n\n  return (\n    <aside class=\"on-this-page text-sm overflow-y-auto hidden xl:block\">\n      {contentHeadings.length > 0 ? (\n        <>\n          <h6>On This Page</h6>\n          <ul class=\"px-2 font-medium text-[var(--interactive-text-color)]\">\n            {contentHeadings.map((h) => (\n              <li\n                key={h.id}\n                style={{ paddingLeft: `${(h.level - 2) * 16}px` }}\n                class={`${\n                  theme.theme === 'light'\n                    ? 'hover:bg-[var(--qwik-light-blue)]'\n                    : 'hover:bg-[var(--on-this-page-hover-bg-color)]'\n                }`}\n              >\n                {activeId.value === h.id ? (\n                  <span class=\"on-this-page-item\">{h.text}</span>\n                ) : (\n                  <Link href={`#${h.id}`} class={`on-this-page-item`}>\n                    {h.text}\n                  </Link>\n                )}\n              </li>\n            ))}\n          </ul>\n        </>\n      ) : null}\n\n      <h6>More</h6>\n      <ul class=\"px-2 font-medium text-[var(--interactive-text-color)]\">\n        {OnThisPageMore.map((el, index) => {\n          return (\n            <li\n              class={`${\n                theme.theme === 'light'\n                  ? 'hover:bg-[var(--qwik-light-blue)]'\n                  : 'hover:bg-[var(--on-this-page-hover-bg-color)]'\n              } rounded-lg`}\n              key={`more-items-on-this-page-${index}`}\n            >\n              <a class=\"more-item\" href={el.href} rel=\"noopener\" target=\"_blank\">\n                <el.icon width={20} height={20} />\n                <span>{el.text}</span>\n              </a>\n            </li>\n          );\n        })}\n      </ul>\n    </aside>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/package-manager-tabs/index.tsx",
    "content": "import {\n  Slot,\n  component$,\n  useContext,\n  useSignal,\n  $,\n  type PropsOf,\n  isBrowser,\n} from '@builder.io/qwik';\nimport { Tabs } from '@qwik-ui/headless';\nimport { GlobalStore } from '~/context';\n\nconst pkgManagers = ['pnpm', 'npm', 'yarn', 'bun'] as const;\nexport type PkgManagers = (typeof pkgManagers)[number];\n\nconst pkgManagerStorageKey = 'pkg-manager-preference';\n\nconst setPreference = (value: PkgManagers) => {\n  if (isBrowser) {\n    localStorage.setItem(pkgManagerStorageKey, value);\n  }\n};\n\nexport const getPkgManagerPreference = () => {\n  try {\n    return (localStorage.getItem(pkgManagerStorageKey) || 'pnpm') as PkgManagers;\n  } catch (err) {\n    return 'pnpm';\n  }\n};\n\nexport default component$(() => {\n  const globalStore = useContext(GlobalStore);\n  const activeClass = `${globalStore.theme === 'light' ? 'bg-gray-300 text-black' : 'bg-slate-800 text-white'}`;\n\n  return (\n    <Tabs.Root\n      selectedTabId={globalStore.pkgManager}\n      onSelectedTabIdChange$={(pkgManager) => {\n        const value = pkgManager as PkgManagers;\n        globalStore.pkgManager = value;\n        setPreference(value);\n      }}\n    >\n      <Tabs.List>\n        <Tabs.Tab\n          tabId=\"pnpm\"\n          class={`px-4 pt-2 rounded-md ${globalStore.pkgManager === 'pnpm' ? `font-bold ${activeClass}` : ''}`}\n        >\n          <span class=\"inline-flex items-center gap-x-2\">\n            <PnpmIcon />\n            <span>pnpm</span>\n          </span>\n        </Tabs.Tab>\n        <Tabs.Tab\n          tabId=\"npm\"\n          class={`px-4 pt-2 rounded-md ${globalStore.pkgManager === 'npm' ? `font-bold ${activeClass}` : ''}`}\n        >\n          <span class=\"inline-flex items-center gap-x-2\">\n            <NpmIcon />\n            <span>npm</span>\n          </span>\n        </Tabs.Tab>\n        <Tabs.Tab\n          tabId=\"yarn\"\n          class={`px-4 pt-2 rounded-md ${globalStore.pkgManager === 'yarn' ? `font-bold ${activeClass}` : ''}`}\n        >\n          <span class=\"inline-flex items-center gap-x-2\">\n            <YarnIcon />\n            <span>yarn</span>\n          </span>\n        </Tabs.Tab>\n        <Tabs.Tab\n          tabId=\"bun\"\n          class={`px-4 pt-2 rounded-md ${globalStore.pkgManager === 'bun' ? `font-bold ${activeClass}` : ''}`}\n        >\n          <span class=\"inline-flex items-center gap-x-2\">\n            <BunIcon />\n            <span>bun</span>\n          </span>\n        </Tabs.Tab>\n      </Tabs.List>\n\n      <Tabs.Panel class=\"relative\">\n        <Slot name=\"pnpm\" />\n        <CopyButton />\n      </Tabs.Panel>\n      <Tabs.Panel class=\"relative\">\n        <Slot name=\"npm\" />\n        <CopyButton />\n      </Tabs.Panel>\n      <Tabs.Panel class=\"relative\">\n        <Slot name=\"yarn\" />\n        <CopyButton />\n      </Tabs.Panel>\n      <Tabs.Panel class=\"relative\">\n        <Slot name=\"bun\" />\n        <CopyButton />\n      </Tabs.Panel>\n    </Tabs.Root>\n  );\n});\n\n// TODO: refactor qwik ui tabs to pass in refs and allow content inside of the tabs root (for example, absolute positioning)\nconst CopyButton = component$(() => {\n  const isClickedSig = useSignal(false);\n\n  const copyToClipboard$ = $((_: Event, target: HTMLButtonElement) => {\n    isClickedSig.value = true;\n\n    const activePanel = target.parentElement;\n    if (activePanel) {\n      const content = activePanel.textContent || '';\n      navigator.clipboard.writeText(content);\n    }\n\n    setTimeout(() => {\n      isClickedSig.value = false;\n    }, 3000);\n  });\n\n  return (\n    <button\n      onClick$={copyToClipboard$}\n      class=\"px-5 rounded-sm absolute right-0 top-0 text-white h-full group\"\n      aria-label={isClickedSig.value ? 'Copied to clipboard' : 'Copy to clipboard'}\n      title={isClickedSig.value ? 'Copied!' : 'Copy to clipboard'}\n    >\n      {isClickedSig.value ? (\n        <CheckIcon class=\"w-6 h-6\" aria-hidden=\"true\" />\n      ) : (\n        <CopyIcon\n          class=\"w-6 h-6 transition duration-300 ease group-hover:opacity-100 text-white opacity-50\"\n          aria-hidden=\"true\"\n        />\n      )}\n    </button>\n  );\n});\n\nconst CopyIcon = component$((props: PropsOf<'svg'>) => {\n  return (\n    <svg\n      {...props}\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm-4 4q-.825 0-1.412-.587T3 20V7q0-.425.288-.712T4 6t.713.288T5 7v13h10q.425 0 .713.288T16 21t-.288.713T15 22z\"\n      ></path>\n    </svg>\n  );\n});\n\nconst CheckIcon = component$((props: PropsOf<'svg'>) => {\n  return (\n    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" {...props}>\n      <path\n        fill=\"currentColor\"\n        d=\"m9.55 15.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175 9.2q-.3.3-.7.3t-.7-.3L4.55 13q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z\"\n      />\n    </svg>\n  );\n});\n\nconst PnpmIcon = component$((props: PropsOf<'svg'>) => {\n  return (\n    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 256 256\" {...props}>\n      <g fill=\"none\">\n        <g clip-path=\"url(#skillIconsPnpmLight0)\">\n          <path\n            fill=\"#F4F2ED\"\n            d=\"M196 0H60C26.863 0 0 26.863 0 60v136c0 33.137 26.863 60 60 60h136c33.137 0 60-26.863 60-60V60c0-33.137-26.863-60-60-60\"\n          />\n          <path\n            fill=\"#F9AD00\"\n            d=\"M40 41h55v55H40zm60 0h55v55h-55zm60 0h55v55h-55zm0 60h55v55h-55z\"\n          />\n          <path fill=\"#4E4E4E\" d=\"M160 161h55v55h-55zm-60 0h55v55h-55zm-60 0h55v55H40z\" />\n          <path fill=\"#F4F2ED\" d=\"M40 101h55v55H40z\" />\n          <path fill=\"#4E4E4E\" d=\"M100 101h55v55h-55z\" />\n        </g>\n        <defs>\n          <clipPath id=\"skillIconsPnpmLight0\">\n            <path fill=\"#fff\" d=\"M0 0h256v256H0z\" />\n          </clipPath>\n        </defs>\n      </g>\n    </svg>\n  );\n});\n\nconst YarnIcon = component$((props: PropsOf<'svg'>) => {\n  return (\n    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 256 256\" {...props}>\n      <path\n        fill=\"#368FB9\"\n        d=\"M128 0C57.328 0 0 57.328 0 128s57.328 128 128 128s128-57.328 128-128S198.672 0 128 0\"\n      />\n      <path\n        fill=\"#FFF\"\n        d=\"M203.317 174.06c-7.907 1.878-11.91 3.608-21.695 9.983c-15.271 9.884-31.976 14.48-31.976 14.48s-1.383 2.076-5.387 3.015c-6.918 1.68-32.963 3.114-35.335 3.163c-6.376.05-10.28-1.63-11.367-4.25c-3.311-7.907 4.744-11.367 4.744-11.367s-1.779-1.087-2.817-2.076c-.939-.939-1.927-2.816-2.224-2.125c-1.235 3.015-1.878 10.379-5.189 13.69c-4.547 4.596-13.146 3.064-18.236.395c-5.585-2.965.395-9.933.395-9.933s-3.015 1.779-5.436-1.878c-2.175-3.36-4.2-9.094-3.657-16.16c.593-8.056 9.587-15.865 9.587-15.865s-1.581-11.91 3.608-24.117c4.695-11.12 17.347-20.065 17.347-20.065s-10.626-11.762-6.672-22.338c2.57-6.92 3.608-6.87 4.448-7.166c2.965-1.137 5.831-2.373 7.957-4.695c10.625-11.466 24.166-9.292 24.166-9.292s6.425-19.52 12.356-15.715c1.828 1.186 8.401 15.814 8.401 15.814s7.018-4.102 7.809-2.57c4.25 8.254 4.744 24.019 2.866 33.607c-3.163 15.814-11.07 24.315-14.233 29.652c-.741 1.236 8.5 5.14 14.332 21.3c5.387 14.777.593 27.182 1.433 28.566c.148.247.198.346.198.346s6.177.494 18.582-7.166c6.622-4.102 14.48-8.698 23.425-8.797c8.65-.149 9.094 9.983 2.57 11.564m11.763-7.265c-.89-7.017-6.82-11.86-14.431-11.762c-11.367.148-20.905 6.03-27.231 9.934c-2.471 1.532-4.596 2.669-6.425 3.509c.395-5.733.05-13.245-2.916-21.498c-3.608-9.885-8.45-15.963-11.91-19.472c4.003-5.832 9.489-14.332 12.058-27.478c2.224-11.219 1.533-28.664-3.558-38.45c-1.038-1.976-2.767-3.41-4.942-4.003c-.89-.247-2.57-.741-5.881.198c-4.991-10.329-6.721-11.416-8.056-12.306c-2.767-1.779-6.029-2.174-9.093-1.038c-4.102 1.483-7.61 5.437-10.922 12.454a51.47 51.47 0 0 0-1.334 3.015c-6.277.445-16.161 2.718-24.513 11.762c-1.038 1.137-3.064 1.977-5.19 2.768h.05c-4.349 1.532-6.326 5.09-8.747 11.515c-3.361 8.994.098 17.84 3.508 23.574c-4.645 4.151-10.823 10.773-14.084 18.532c-4.053 9.588-4.498 18.978-4.35 24.068c-3.459 3.658-8.796 10.527-9.39 18.237c-.79 10.773 3.114 18.088 4.844 20.756c.494.791 1.038 1.434 1.63 2.076c-.197 1.334-.246 2.768.05 4.25c.643 3.46 2.817 6.277 6.128 8.056c6.524 3.46 15.617 4.942 22.635 1.433c2.52 2.669 7.117 5.239 15.469 5.239h.494c2.125 0 29.109-1.433 36.967-3.36c3.509-.841 5.93-2.324 7.512-3.658c5.04-1.582 18.977-6.326 32.123-14.826c9.291-6.03 12.504-7.315 19.423-8.995c6.72-1.63 10.922-7.759 10.082-14.53\"\n      />\n    </svg>\n  );\n});\n\nconst NpmIcon = component$((props: PropsOf<'svg'>) => {\n  return (\n    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 256 256\" {...props}>\n      <path fill=\"#C12127\" d=\"M0 256V0h256v256z\" />\n      <path fill=\"#FFF\" d=\"M48 48h160v160h-32V80h-48v128H48z\" />\n    </svg>\n  );\n});\n\nconst BunIcon = component$((props: PropsOf<'svg'>) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"36.41\"\n      height=\"32\"\n      viewBox=\"0 0 256 225\"\n      {...props}\n    >\n      <path d=\"M228.747 65.588a38.198 38.198 0 0 0-1.62-1.62c-.55-.519-1.07-1.102-1.62-1.62c-.551-.52-1.07-1.102-1.62-1.62c-.551-.52-1.07-1.103-1.62-1.621c-.552-.519-1.07-1.102-1.62-1.62c-.552-.519-1.07-1.102-1.621-1.62c-.551-.52-1.07-1.102-1.62-1.62a85.744 85.744 0 0 1 25.632 59.819c0 53.695-54.505 97.377-121.519 97.377c-37.525 0-71.097-13.707-93.424-35.192l1.62 1.62l1.62 1.62l1.62 1.62l1.621 1.621l1.62 1.62l1.62 1.62l1.621 1.62c22.295 22.393 56.612 36.813 95.044 36.813c67.014 0 121.519-43.682 121.519-97.215c0-22.878-9.851-44.557-27.253-61.602\" />\n      <path\n        fill=\"#FBF0DF\"\n        d=\"M234.937 114.066c0 49.288-50.779 89.243-113.418 89.243S8.101 163.354 8.101 114.066c0-30.558 19.443-57.552 49.32-73.56C87.3 24.498 105.9 8.101 121.52 8.101c15.62 0 28.97 13.384 64.097 32.405c29.878 16.008 49.32 43.002 49.32 73.56\"\n      />\n      <path\n        fill=\"#F6DECE\"\n        d=\"M234.937 114.066a70.222 70.222 0 0 0-2.593-18.73c-8.846 107.909-140.476 113.093-192.227 80.818a129.62 129.62 0 0 0 81.402 27.155c62.542 0 113.418-40.02 113.418-89.243\"\n      />\n      <path\n        fill=\"#FFFEFC\"\n        d=\"M77.87 34.576c14.484-8.684 33.733-24.984 52.658-25.017a30.104 30.104 0 0 0-9.009-1.458c-7.842 0-16.203 4.05-26.734 10.143c-3.662 2.139-7.453 4.504-11.472 6.967c-7.55 4.666-16.202 9.948-25.924 15.23c-30.85 16.69-49.288 44.201-49.288 73.625v3.856C27.74 48.542 63.417 43.261 77.87 34.576\"\n      />\n      <path\n        fill=\"#CCBEA7\"\n        d=\"M112.186 16.3a53.177 53.177 0 0 1-18.244 40.409c-.907.81-.194 2.365.972 1.912c10.92-4.245 25.665-16.948 19.443-42.58c-.259-1.459-2.17-1.07-2.17.259m7.356 0a52.626 52.626 0 0 1 5.217 43.65c-.388 1.134 1.005 2.106 1.783 1.166c7.096-9.073 13.286-27.09-5.25-46.534c-.94-.842-2.398.454-1.75 1.588zm8.944-.551a53.21 53.21 0 0 1 22.198 38.108a1.07 1.07 0 0 0 2.106.357c2.981-11.31 1.296-30.59-23.235-40.604c-1.296-.518-2.138 1.232-1.069 2.01zM68.666 49.45a54.894 54.894 0 0 0 33.928-29.164c.584-1.167 2.43-.713 2.14.583c-5.607 25.924-24.37 31.336-36.035 30.623c-1.232.032-1.2-1.685-.033-2.042\"\n      />\n      <path d=\"M121.519 211.443C54.505 211.443 0 167.761 0 114.066c0-32.405 20.026-62.64 53.566-80.754c9.721-5.184 18.05-10.402 25.47-14.97c4.083-2.528 7.94-4.894 11.666-7.097C102.076 4.505 111.797 0 121.519 0c9.722 0 18.212 3.889 28.84 10.175c3.241 1.847 6.482 3.856 9.949 6.06c8.069 4.99 17.175 10.629 29.164 17.077c33.54 18.115 53.566 48.316 53.566 80.754c0 53.695-54.505 97.377-121.519 97.377m0-203.342c-7.842 0-16.203 4.05-26.734 10.143c-3.662 2.139-7.453 4.504-11.472 6.967c-7.55 4.666-16.202 9.948-25.924 15.23c-30.85 16.69-49.288 44.201-49.288 73.625c0 49.223 50.876 89.276 113.418 89.276c62.542 0 113.418-40.053 113.418-89.276c0-29.424-18.439-56.936-49.32-73.56c-12.25-6.48-21.81-12.573-29.554-17.369c-3.532-2.17-6.773-4.18-9.722-5.962c-9.818-5.833-16.98-9.074-24.822-9.074\" />\n      <path\n        fill=\"#B71422\"\n        d=\"M144.365 137.722a28.938 28.938 0 0 1-9.463 15.263a22.068 22.068 0 0 1-12.962 6.092a22.165 22.165 0 0 1-13.383-6.092a28.938 28.938 0 0 1-9.333-15.263a2.333 2.333 0 0 1 2.593-2.625h39.988a2.333 2.333 0 0 1 2.56 2.625\"\n      />\n      <path\n        fill=\"#FF6164\"\n        d=\"M108.557 153.244a22.392 22.392 0 0 0 13.351 6.157a22.392 22.392 0 0 0 13.318-6.157a34.447 34.447 0 0 0 3.241-3.468a22.133 22.133 0 0 0-15.879-7.485a19.93 19.93 0 0 0-16.202 9.008c.745.681 1.393 1.33 2.171 1.945\"\n      />\n      <path d=\"M109.076 150.684a17.37 17.37 0 0 1 13.577-6.74a19.443 19.443 0 0 1 12.962 5.476a51.225 51.225 0 0 0 2.139-2.495a22.684 22.684 0 0 0-15.263-6.254a20.61 20.61 0 0 0-15.846 7.647a30.882 30.882 0 0 0 2.43 2.366\" />\n      <path d=\"M121.81 161.021a24.045 24.045 0 0 1-14.42-6.481a30.85 30.85 0 0 1-10.077-16.365a3.889 3.889 0 0 1 .842-3.24a4.57 4.57 0 0 1 3.662-1.653h39.988a4.666 4.666 0 0 1 3.661 1.653a3.856 3.856 0 0 1 .81 3.24A30.85 30.85 0 0 1 136.2 154.54c-3.93 3.717-9 6-14.388 6.481m-19.993-23.98c-.519 0-.648.227-.68.292a26.864 26.864 0 0 0 8.846 14.16a20.188 20.188 0 0 0 11.828 5.672a20.35 20.35 0 0 0 11.828-5.606a26.896 26.896 0 0 0 8.814-14.161a.68.68 0 0 0-.648-.292z\" />\n      <g transform=\"translate(53.792 88.4)\">\n        <ellipse cx=\"117.047\" cy=\"40.183\" fill=\"#FEBBD0\" rx=\"18.957\" ry=\"11.147\" />\n        <ellipse cx=\"18.957\" cy=\"40.183\" fill=\"#FEBBD0\" rx=\"18.957\" ry=\"11.147\" />\n        <path d=\"M27.868 35.71a17.855 17.855 0 1 0-17.822-17.854c0 9.848 7.974 17.837 17.822 17.855m80.268 0A17.855 17.855 0 1 0 90.41 17.857c-.018 9.818 7.908 17.801 17.726 17.855\" />\n        <path\n          fill=\"#FFF\"\n          d=\"M22.36 18.99a6.708 6.708 0 1 0 .064-13.416a6.708 6.708 0 0 0-.065 13.416m80.267 0a6.708 6.708 0 1 0-.065 0z\"\n        />\n      </g>\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/panel-toggle/panel-toggle.css",
    "content": ".panel-toggle {\n  position: -webkit-sticky;\n  position: sticky;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  background-color: var(--panel-toggle-background-color);\n  width: 100vw;\n  height: var(--panel-toggle-height);\n}\n\n.panel-toggle button {\n  background-color: var(--tutorial-nav-button-bg-color);\n  color: var(--tutorial-nav-button-text-color);\n  border: 1px solid var(--tutorial-nav-button-text-color);\n  border-radius: 3px;\n  min-width: 60px;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  padding: 4px 6px;\n  margin: 0 8px;\n  font-size: 12px;\n}\n\n.panel-toggle button.active,\n.panel-toggle button:hover {\n  background-color: var(--tutorial-nav-button-hover-bg-color);\n  color: var(--qwik-blue);\n}\n\n@media (min-width: 380px) {\n  .panel-toggle button {\n    padding: 4px 8px;\n    margin: 0 10px;\n    min-width: 70px;\n    font-size: 14px;\n  }\n}\n\n@media (min-width: 768px) {\n  .panel-toggle {\n    display: none;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/components/panel-toggle/panel-toggle.tsx",
    "content": "import { component$, useStyles$ } from '@builder.io/qwik';\nimport styles from './panel-toggle.css?inline';\n\nexport interface PanelToggleProps {\n  panelStore: {\n    active: string;\n    list: string[];\n  };\n}\n\nexport const PanelToggle = component$((props: PanelToggleProps) => {\n  useStyles$(styles);\n\n  return (\n    <div class=\"panel-toggle\">\n      {props.panelStore.list.map((p) => (\n        <button\n          key={p}\n          onClick$={() => {\n            props.panelStore.active = p;\n          }}\n          type=\"button\"\n          preventdefault:click\n          class={{ active: props.panelStore.active === p }}\n        >\n          {p}\n        </button>\n      ))}\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/qwik-gpt/gpt.md",
    "content": "## Qwik Components\n\n[Qwik](https://qwik.dev/) components are very similar to React components, they are functions that return JSX, but there are some main differences:\n\n- Non of the React APIs are available, instead Qwik provides a set of hooks and components that are designed to work with Qwik.\n- Components are always declared with the `component$` function.\n- Components can use the `useSignal` hook to create reactive state.\n- Event handlers are declared with the `$` suffix.\n- JSX prefers HTML attributes. `class` instead of `className`. `for` instead of `htmlFor`.\n- Content projection is done by the `<Slot/>` component. Slots can be named, and can be projected into using the `q:slot` attribute.\n\n```tsx\nimport { component$, $, useSignal, useVisibleTask$ } from '@builder.io/qwik';\nimport US_PRESIDENTS from './us-presidents.json';\nimport { MyOtherComponent } from './my-other-component';\n\n// CSS modules are supported by default\nimport styles from './my-component.module.css';\n\ninterface MyComponentProps {\n  step: number;\n}\n\n// Components are always declared with the `component$` function.\nexport const MyComponent = component$((props: MyComponentProps) => {\n  // Components use the `useSignal` hook to create reactive state.\n  const seconds = useSignal(0); // { value: 0 }\n  const count = useSignal(0); // Signal<number>\n\n  useVisibleTask$(async (taskCtx) => {\n    // `useVisibleTask$` runs only in the browser AFTER the component is first mounted in the DOM.\n    // It's ok to inspect the DOM, or use browser APIS, initialize browser-only libraries, start an animation, or a timer...\n    const timer = setInterval(() => {\n      seconds.value = seconds.value + 1;\n    }, 1000);\n\n    taskCtx.onCleanup(() => {\n      clearInterval(timer);\n    });\n  });\n\n  // Event handler that are not inlined must be wrapped in the `$` function.\n  const toggleDarkMode = $(() => {\n    darkMode.value = !darkMode.value;\n    document.body.classList.toggle('dark-mode', darkMode.value);\n  });\n\n  return (\n    <>\n      <header>\n        <button\n          class={{\n            button: true,\n            [styles.darkMode]: darkMode.value, // Conditional classes are supported\n          }}\n          onClick$={toggleDarkMode}\n        >\n          Toggle Dark Mode\n        </button>\n      </header>\n      <main class={styles.main}>\n        <button\n          onClick$={() => {\n            // Event handlers have the `$` suffix.\n            count.value = count.value + props.step;\n          }}\n        >\n          Count: {count.value}\n        </button>\n        <MyOtherComponent>{count.value > 10 && <p>Count is greater than 10</p>}</MyOtherComponent>\n        <ul>\n          {US_PRESIDENTS.map((president) => (\n            <li key={president.id}>{president.name}</li>\n          ))}\n        </ul>\n      </main>\n      <footer>Seconds: {seconds.value}</footer>\n    </>\n  );\n});\n```\n\n## Routing\n\nQwik comes with a file-based router, which is similar to Next.js. The router is based on the file-system, creating a new `index.tsx` file in `src/routes/` will create a new route. For example, `src/routes/home/[id]/index.tsx` will create a route at `/home/:id/`.\n\nTo link to other routes, you can use the `Link` component, it is like `<a>` but allows for SPA navigation.\n\n```tsx title=\"src/routes/user/[userID]/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$, useLocation, Link } from '@builder.io/qwik-city';\n\nexport const useUserData = routeLoader$(async (requestEvent) => {\n  const { userID } = requestEvent.params;\n  const db = await createDB(requestEvent.env.get('DB_KEY'));\n  const user = await db.from('users').filter('id', userID);\n  return {\n    name: user.name,\n    email: user.email,\n  };\n});\n\nexport default component$(() => {\n  const loc = useLocation();\n  const userData = useUserData(); // Signal<{name, email}>\n\n  return (\n    <>\n      <nav>\n        <Link href=\"/about/\">SPA navigate to /about/</Link>\n        <a href=\"/about/\">Full page navigate to /about/</a>\n      </nav>\n      <main>\n        <h1>User: {loc.params.userID}</h1>\n        <div>Name: {userData.value.name}</div>\n        <div>Email: {userData.value.email}</div>\n        <div>Current URL: {loc.url.href}</div>\n      </main>\n    </>\n  );\n});\n```\n"
  },
  {
    "path": "packages/docs/src/components/qwik-gpt/index.tsx",
    "content": "import { component$, useComputed$, useSignal } from '@builder.io/qwik';\n// import { qwikGPT, rateResponse } from './search';\nimport { CodeBlock } from '../code-block/code-block';\n// import { isBrowser } from '@builder.io/qwik';\nimport snarkdown from 'snarkdown';\n\nconst snarkdownEnhanced = (md: string) => {\n  const htmls = md\n    .split(/(?:\\r?\\n){2,}/)\n    .map((l) =>\n      [' ', '\\t', '#', '-', '*'].some((ch) => l.startsWith(ch))\n        ? snarkdown(l)\n        : `<p>${snarkdown(l)}</p>`\n    );\n\n  return htmls.join('\\n\\n');\n};\n\nexport const QwikGPT = component$((props: { query: string }) => {\n  const message = useSignal('');\n  // const done = useSignal(false);\n  // const id = useSignal<string>();\n  // const rated = useSignal(false);\n\n  const process = useComputed$(() => {\n    const rawLines = message.value.split('\\n');\n    const lines: { type: any; [key: string]: any }[] = [];\n    let insideCode = false;\n    let accumulated = '';\n    for (const line of rawLines) {\n      const lineParsed = line.trim();\n      if (insideCode) {\n        if (lineParsed.startsWith('```')) {\n          insideCode = false;\n          lines.push({\n            type: CodeBlock,\n            code: accumulated,\n            language: 'tsx',\n          });\n          accumulated = '';\n        } else {\n          accumulated += line + '\\n';\n        }\n      } else {\n        if (lineParsed.startsWith('```')) {\n          lines.push({\n            type: 'div',\n            dangerouslySetInnerHTML: snarkdownEnhanced(accumulated),\n          });\n          accumulated = '';\n          insideCode = true;\n        } else {\n          accumulated += line + '\\n';\n        }\n      }\n    }\n    if (insideCode) {\n      lines.push({\n        type: CodeBlock,\n        code: accumulated,\n        language: 'tsx',\n      });\n    } else {\n      lines.push({\n        type: 'div',\n        dangerouslySetInnerHTML: snarkdownEnhanced(accumulated),\n      });\n    }\n\n    return lines;\n  });\n\n  // useTask$(({ track }) => {\n  //   const query = track(() => props.query);\n  //   if (isBrowser) {\n  //     message.value = '';\n  //     done.value = false;\n  //     rated.value = false;\n  //     id.value = undefined;\n  //     if (props.query !== '') {\n  //       const run = async () => {\n  //         done.value = false;\n  //         const response = await qwikGPT(query);\n  //         for await (const value of response) {\n  //           if (typeof value === 'string') {\n  //             message.value += value;\n  //           } else if (value.type === 'id') {\n  //             id.value = value.content;\n  //           }\n  //         }\n  //         done.value = true;\n  //       };\n  //       run();\n  //     }\n  //   }\n  // });\n\n  if (message.value === '' && props.query !== '') {\n    return (\n      <div class=\"indeterminate-progress-bar\">\n        <div class=\"indeterminate-progress-bar__progress\"></div>\n      </div>\n    );\n  }\n\n  return (\n    <>\n      <div>\n        {process.value.map(({ type: Type, children, ...rest }, index) => {\n          return (\n            <Type key={index} {...rest}>\n              {children}\n            </Type>\n          );\n        })}\n      </div>\n      {/* {done.value && (\n        <div class=\"ai-rate\">\n          {rated.value ? (\n            <>Thank you very much!</>\n          ) : (\n            <>\n              Help us improve! Rate the answer:\n              <button\n                class=\"rate-good\"\n                onClick$={async () => {\n                  rated.value = true;\n                  await rateResponse(id.value!, 1);\n                }}\n              >\n                👍\n              </button>\n              <button\n                class=\"rate-bad\"\n                onClick$={async () => {\n                  rated.value = true;\n                  await rateResponse(id.value!, -1);\n                }}\n              >\n                👎\n              </button>\n            </>\n          )}\n        </div>\n      )} */}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/qwik-gpt/search.tsx",
    "content": "// import { server$ } from '@builder.io/qwik-city';\n// import { createClient } from '@supabase/supabase-js';\nimport gpt from './gpt.md?raw';\n// import { chatCompletion } from './streaming-gpt';\n\nconst files = new Map<string, Promise<string>>();\n\n// export const qwikGPT = server$(async function* (query: string) {\n//   const supabase = createClient(this.env.get('SUPABASE_URL')!, this.env.get('SUPABASE_KEY')!);\n//   const normalizedQuery = normalizeLine(query);\n//   const response = await fetch('https://api.openai.com/v1/embeddings', {\n//     method: 'POST',\n//     headers: {\n//       'Content-Type': 'application/json',\n//       Authorization: `Bearer ${this.env.get('OPENAI_KEY')}`,\n//     },\n//     body: JSON.stringify({\n//       input: normalizedQuery,\n//       model: 'text-embedding-ada-002',\n//     }),\n//   });\n//   const data = await response.json();\n//   const embeddings = data.data[0].embedding;\n\n//   const docs = await supabase.rpc('match_docs_10', {\n//     query_text: normalizedQuery.replaceAll(' ', '|'),\n//     query_embedding: embeddings,\n//     match_count: 6,\n//     similarity_threshold: 0.79,\n//   });\n\n//   const resultsHash = await getResultsHash(docs.data);\n//   const existingQuery = await supabase.rpc('match_query_3', {\n//     query_embedding: embeddings,\n//     similarity_threshold: 0.95,\n//     hash: resultsHash,\n//   });\n//   if (existingQuery.data.length === 1) {\n//     const entry = existingQuery.data[0];\n//     yield {\n//       type: 'id',\n//       content: entry.id,\n//     };\n//     yield entry.output;\n//     return;\n//   }\n\n//   // Download docs\n//   try {\n//     const docsStr = await resolveContext(docs.data);\n//     let model = 'gpt-4';\n//     if (docsStr.length < 3500 * 3 && Math.random() < 0.5) {\n//       model = 'gpt-3.5-turbo';\n//     }\n//     const insert = supabase\n//       .from('search_queries')\n//       .insert({\n//         query: query,\n//         embedding: embeddings,\n//         results: docs.data,\n//         results_hash: resultsHash,\n//         model,\n//       })\n//       .select('id');\n\n//     const id = (await insert).data?.[0].id as string;\n//     yield {\n//       type: 'id',\n//       content: id,\n//     };\n\n//     if (docs.data.length === 0) {\n//       yield 'We could not find any documentation that matches your question. Please try again rephrasing your question to be more factual.';\n//       return;\n//     }\n\n//     const generator = chatCompletion(this.env.get('OPENAI_KEY')!, {\n//       model: model,\n//       temperature: 0,\n//       messages: [\n//         {\n//           role: 'system',\n//           content:\n//             'You are QwikGPT, your job is to answer questions about Qwik, a new javascript framework focused on instant interactivity and server-side rendering.\\nRelevant Qwik documentation and the user question will be provided. Try to answer the question in a short and concise way.',\n//         },\n//         {\n//           role: 'user',\n//           content: docsStr,\n//         },\n//         {\n//           role: 'user',\n//           content: `User question, respond in markdown including links to the sources, if you are not sure about the answer, say that you do not know:\\n\\n${query}`,\n//         },\n//       ],\n//     });\n\n//     let output = '';\n//     for await (const chunk of generator) {\n//       output += chunk;\n//       yield chunk as string;\n//     }\n//     await supabase.from('search_queries').update({ output }).eq('id', id);\n//   } catch (e) {\n//     console.error(e);\n//   }\n// });\n\n// export const rateResponse = server$(async function (query_id: string, rate: number) {\n//   const supabase = createClient(this.env.get('SUPABASE_URL')!, this.env.get('SUPABASE_KEY')!);\n//   await supabase.from('search_rate').insert({\n//     query_id: query_id,\n//     rate: rate,\n//   });\n// });\n\nexport function normalizeLine(line: string) {\n  line = line.replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, '$1');\n  line = line.toLowerCase();\n  line = line.replaceAll('`', '');\n  line = line.replaceAll('*', '');\n  line = line.replaceAll('_', ' ');\n  line = line.replaceAll('#', '');\n  line = line.replaceAll('-', ' ');\n  line = line.replaceAll('...', '.');\n  line = line.replaceAll('>', '');\n  line = line.replaceAll('<', '');\n  line = line.replaceAll('..', '.');\n  line = line.replaceAll('  ', ' ');\n  line = line.trim();\n  return line;\n}\n\nexport async function getResultsHash(docsData: any[]) {\n  const key = docsData.map((result) => `${result.commit_hash}:${result.file}`).join(',');\n  const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(key));\n  const hash = new Uint32Array(digest);\n  return `${hash[0]}'${hash[1]}`;\n}\n\nexport async function resolveContext(docsData: any[]) {\n  // Download docs\n  const dataCloned = [];\n  try {\n    for (const result of docsData) {\n      const commit_hash = result.commit_hash;\n      const file_path = result.file;\n      const url = `https://raw.githubusercontent.com/QwikDev/qwik/${commit_hash}/${file_path}`;\n      if (!files.has(url)) {\n        files.set(\n          url,\n          fetch(url).then((r) => r.text())\n        );\n      }\n      const copied = {\n        ...result,\n        url: url,\n        content: await files.get(url),\n      };\n      dataCloned.push(copied);\n    }\n\n    // Parse docs\n    const docsRanges: Record<string, [number, number][]> = {};\n    for (const result of dataCloned) {\n      const file = result.content;\n      let range = docsRanges[result.url];\n      if (!range) {\n        docsRanges[result.url] = range = [];\n      }\n      get_docs_ranges(range, file, result['line']);\n    }\n\n    const docsLines: string[] = [];\n\n    for (const [url, ranges] of Object.entries(docsRanges)) {\n      const file = await files.get(url)!;\n      const lines = file.split('\\n').filter((_, index) => {\n        for (const [start, end] of ranges) {\n          if (index >= start && index < end) {\n            return true;\n          }\n        }\n        return false;\n      });\n      if (lines.length > 0) {\n        const parts = new URL(url).pathname\n          .split('/')\n          .slice(8, -1)\n          .filter((a) => !a.startsWith('('))\n          .join('/');\n        const docsURL = `https://qwik.dev/${parts}/`;\n        docsLines.push('FROM (' + docsURL + '):\\n');\n        docsLines.push(...lines);\n        docsLines.push('');\n      }\n    }\n    const docsStr = gpt + '\\n\\n' + docsLines.filter((a) => !a.includes('CodeSandbox')).join('\\n');\n    return docsStr;\n  } catch (e) {\n    console.error(e);\n  }\n  return '';\n}\n\nfunction get_docs_ranges(ranges: [number, number][], fileContent: string, line: number) {\n  const lines = fileContent.split('\\n');\n\n  // find top header\n  let current_level = 0;\n  let top_header = 0;\n  let bottom_header = lines.length - 1;\n  line = line - 1;\n\n  for (let i = line - 1; i >= 0; i--) {\n    const match = lines[i].match(/^(#+)\\s/);\n    if (match) {\n      top_header = i;\n      current_level = match[1].length;\n      break;\n    }\n  }\n  // find bottom header\n  for (let i = line + 1; i < lines.length; i++) {\n    if (lines[i].startsWith('#')) {\n      bottom_header = i;\n      break;\n    }\n  }\n  ranges.push([top_header, bottom_header]);\n  if (current_level > 1) {\n    const find_top_header = '#'.repeat(current_level - 1) + ' ';\n    for (let i = top_header - 1; i >= 0; i--) {\n      if (lines[i].startsWith(find_top_header)) {\n        for (let j = i + 1; j < top_header; j++) {\n          if (lines[j].startsWith('#')) {\n            ranges.push([i, j]);\n            return;\n          }\n        }\n        return;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/components/qwik-gpt/streaming-gpt.ts",
    "content": "import type { CreateChatCompletionRequest } from 'openai';\n\nexport async function* chatCompletion(apiKey: string, request: CreateChatCompletionRequest) {\n  const response = await fetch('https://api.openai.com/v1/chat/completions', {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      Authorization: `Bearer ${apiKey}`,\n    },\n    body: JSON.stringify({\n      ...request,\n      stream: true,\n    }),\n  });\n\n  for await (const chunk of toIterable(response.body!)) {\n    yield chunk as string;\n  }\n}\n\nasync function* toIterable(data: ReadableStream<Uint8Array>) {\n  const reader = data.getReader();\n  const encoder = new TextDecoder();\n  let currentLine = '';\n  while (true) {\n    const { done, value } = await reader.read();\n    if (done) {\n      return;\n    }\n    const lines = encoder.decode(value).split('\\n\\n');\n    for (let i = 0; i < lines.length - 1; i++) {\n      const line = currentLine + lines[i];\n      if (line.length === 0) {\n        return;\n      } else {\n        const message = parseEvent(line).trim();\n        if (message === '[DONE]') {\n          return;\n        }\n        const json = JSON.parse(message);\n        const token = json.choices?.[0]?.delta?.content;\n        if (token) {\n          yield token;\n        }\n        currentLine = '';\n      }\n    }\n    currentLine += lines[lines.length - 1];\n  }\n}\n\nconst parseEvent = (message: string): string => {\n  const lines = message.split('\\n');\n  let data = '';\n  for (const line of lines) {\n    if (line.startsWith('data: ')) {\n      data += line.slice(6) + '\\n';\n    }\n  }\n  return data;\n};\n"
  },
  {
    "path": "packages/docs/src/components/real-metrics-optimization/real-metrics-optimization.tsx",
    "content": "export default (props: RealMetricsOptimizationProps) => (\n  <script\n    dangerouslySetInnerHTML={`\n  ((d, sentStats) => {\n    const id = () => Math.round(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);\n    const pageId = id();\n    const sessionId = (sessionStorage[\"q:sId\"] = sessionStorage[\"q:sId\"] || id());\n    const now = Date.now();\n    const sessionStart = parseInt((sessionStorage[\"q:sTs\"] = sessionStorage[\"q:sTs\"] || now), 10);\n    const sessionOffset = now - sessionStart;\n    const visitorId = (localStorage[\"q:vId\"] = localStorage[\"q:vId\"] || id());\n    const qEvents = [];\n    const loggedQrls = new Set();\n\n    const send = () => {\n      if (qEvents.length > 0) {\n        fetch(\"https://cdn.builder.io/api/v1/track\", {\n          method: \"POST\",\n          body: JSON.stringify({ events: qEvents }),\n          keepalive: true,\n        });\n        qEvents.length = 0;\n      }\n\n    };\n\n    const queue = (type, metadata) => {\n      qEvents.push({\n        type: type,\n        data: {\n          metadata: {\n            url: location.href,\n            pageId: pageId,\n            sessionOffset: sessionOffset,\n            ...metadata\n          },\n          ownerId: ${JSON.stringify(props.builderApiKey)},\n          sessionId: sessionId,\n          visitorId: visitorId\n        },\n      });\n    };\n\n    d.addEventListener(\"qsymbol\", (ev) => {\n      try {\n        const detail = ev.detail;\n        const qsymbol = detail?.symbol;\n        console.debug('Symbol', qsymbol);\n        if (qsymbol && !loggedQrls.has(qsymbol)) {\n          loggedQrls.add(qsymbol);\n\n          queue(\"qrl\", {\n            reqTime: Math.round(detail?.reqTime ?? -1),\n            execTime: Math.round(performance.now()),\n            qsymbol: qsymbol,\n          });\n\n          if (qEvents.length > 9) {\n            send();\n          }\n        }\n      } catch (e) {\n        console.error(e);\n      }\n    });\n\n    d.addEventListener(\"visibilitychange\", () => {\n      if (d.visibilityState === \"hidden\") {\n        try {\n          if (!sentStats) {\n            sentStats = true;\n\n            const metadata = {\n              perf: [],\n              ua: navigator.userAgent,\n            };\n            const entryTypes = [\"navigation\", \"paint\", \"longtask\"];\n\n            if (performance.getEntriesByType) {\n              for (const entryTypeName of entryTypes) {\n                for (const entry of performance.getEntriesByType(entryTypeName)) {\n                  metadata.perf.push(entry.toJSON());\n                }\n              }\n            }\n\n            if (navigator.connection) {\n              metadata.conn = {};\n              for (const n in navigator.connection) {\n                if (navigator.connection[n] && typeof navigator.connection[n] !== \"function\") {\n                  metadata.conn[n] = navigator.connection[n];\n                }\n              }\n            }\n            queue('qstats', metadata);\n          }\n          send();\n        } catch (e) {\n          console.error(e);\n        }\n      }\n    });\n  })(document);\n`}\n  />\n);\n\ninterface RealMetricsOptimizationProps {\n  builderApiKey: string;\n}\n"
  },
  {
    "path": "packages/docs/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { useDocumentHead, useLocation } from '@builder.io/qwik-city';\nimport { Social } from './social';\nimport { Vendor } from './vendor';\nimport { ThemeScript } from '../theme-toggle/theme-script';\n\nexport const RouterHead = component$(() => {\n  const { url } = useLocation();\n  const head = useDocumentHead();\n  const title = head.title\n    ? `${head.title} 📚 Qwik Documentation`\n    : `Qwik - Framework reimagined for the edge`;\n  const description =\n    head.meta.find((m) => m.name === 'description')?.content ||\n    `No hydration, auto lazy-loading, edge-optimized, and fun 🎉!`;\n\n  const OGImage = {\n    imageURL: '',\n    ogImgTitle: '',\n    ogImgSubTitle: '' as string | undefined,\n\n    get URL() {\n      //turn the title into array with [0] -> Title [1] -> subTitle\n      const arrayedTitle = title.split(' | ');\n      const ogImageUrl = new URL('https://opengraphqwik.vercel.app/api/og?level=1');\n\n      // biggerTitle\n      this.ogImgTitle = arrayedTitle[0];\n      //smallerTitle\n      this.ogImgSubTitle = arrayedTitle[1]\n        ? arrayedTitle[1].replace(' 📚 Qwik Documentation', '')\n        : undefined;\n\n      //decide whether or not to show dynamic OGimage or use docs default social card\n      if (this.ogImgSubTitle == undefined || this.ogImgTitle == undefined) {\n        this.imageURL = new URL(`/logos/social-card.jpg`, url).href;\n\n        return this.imageURL;\n      } else {\n        ogImageUrl.searchParams.set('title', this.ogImgTitle);\n        ogImageUrl.searchParams.set('subtitle', this.ogImgSubTitle);\n        // ogImageUrl.searchParams.set('level', this.routeLevel.toString());\n\n        this.imageURL = ogImageUrl.toString();\n\n        return this.imageURL;\n      }\n    },\n  };\n\n  return (\n    <>\n      <title>{title}</title>\n      <meta name=\"description\" content={description} />\n      <link rel=\"canonical\" href={head.frontmatter?.canonical || url.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n      <meta name=\"apple-mobile-web-app-title\" content=\"Qwik\" />\n      <meta name=\"application-name\" content=\"Qwik\" />\n      <meta name=\"apple-mobile-web-app-title\" content=\"Qwik\" />\n      <meta name=\"theme-color\" content=\"#006ce9\" />\n      <meta name=\"color-scheme\" content=\"dark light\" />\n\n      <link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\" />\n      <link rel=\"icon\" href=\"/favicons/favicon.svg\" type=\"image/svg+xml\" />\n\n      {import.meta.env.PROD && (\n        <>\n          <Social title={title} description={description} href={url.href} ogImage={OGImage.URL} />\n          <Vendor />\n        </>\n      )}\n\n      {head.meta\n        // Skip description because that was already added at the top\n        .filter((s) => s.name !== 'description')\n        .map((m, key) => (\n          <meta key={key} {...m} />\n        ))}\n\n      {head.links.map((l, key) => (\n        <link key={key} {...l} />\n      ))}\n\n      {head.styles.map((s, key) => (\n        <style key={key} {...s.props} dangerouslySetInnerHTML={s.style} />\n      ))}\n\n      <ThemeScript />\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/router-head/social.tsx",
    "content": "export const Social = ({ title, description, href, ogImage }: SocialProps) => {\n  const imgAlt =\n    'Image of Qwik Framework Logo, Framework reimagined for the edge. Code snippet npm create qwik@latest';\n\n  return (\n    <>\n      {/*  Open Graph: https://ogp.me/  */}\n      <meta property=\"og:url\" content={href} />\n      <meta property=\"og:title\" content={title} />\n      <meta property=\"og:description\" content={description} />\n      <meta property=\"og:image\" content={ogImage} />\n      <meta property=\"og:image:alt\" content={imgAlt} />\n      <meta property=\"og:image:width\" content=\"800\" />\n      <meta property=\"og:image:height\" content=\"418\" />\n      <meta property=\"og:type\" content=\"website\" />\n      <meta property=\"og:site_name\" content=\"Qwik\" />\n      <meta property=\"og:locale\" content=\"en_US\" />\n\n      {/*  Twitter: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards  */}\n      <meta name=\"twitter:card\" content=\"summary_large_image\" />\n      <meta name=\"twitter:site\" content=\"@QwikDev\" />\n      <meta name=\"twitter:title\" content={title} />\n      <meta name=\"twitter:description\" content={description} />\n      <meta name=\"twitter:image\" content={ogImage} />\n      <meta name=\"twitter:image:alt\" content={imgAlt} />\n\n      {/*  Facebook  */}\n      <meta property=\"fb:app_id\" content=\"676395883130092\" />\n    </>\n  );\n};\n\ninterface SocialProps {\n  title: string;\n  description: string;\n  href: string;\n  ogImage?: string;\n}\n"
  },
  {
    "path": "packages/docs/src/components/router-head/vendor.tsx",
    "content": "import { partytownSnippet } from '@qwik.dev/partytown/integration';\n\nexport const Vendor = () => {\n  return (\n    <>\n      {/*  Analytics  */}\n      <script\n        dangerouslySetInnerHTML={partytownSnippet({\n          forward: ['dataLayer.push'],\n        })}\n      />\n      <script\n        type=\"text/partytown\"\n        dangerouslySetInnerHTML={`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','GTM-NR2STLN');`}\n      />\n\n      <script\n        type=\"text/partytown\"\n        src=\"https://cdn.jsdelivr.net/npm/@builder.io/persist-attribution@0.0.1-beta-2/dist/persist-attribution.min.js\"\n        id=\"persist-attribution-init\"\n        data-send-page-view-events=\"true\"\n      />\n\n      {/*  DNS Prefetch  */}\n      <link rel=\"dns-prefetch\" href=\"https://cdn.jsdelivr.net/\" />\n      <link rel=\"dns-prefetch\" href=\"https://cdn.builder.io/\" />\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/components/sidebar/sidebar.css",
    "content": "@reference \"tailwindcss\";\n\n.sidebar {\n  @apply hidden lg:block;\n\n  position: sticky;\n  top: var(--header-height);\n  min-width: fit-content;\n  max-height: calc(100vh - var(--header-height));\n}\n\n.sidebar summary {\n  cursor: pointer;\n  display: block;\n  margin-top: 3px;\n  margin-bottom: 3px;\n}\n\n.sidebar summary h5 {\n  transition: color 0.2s ease-in-out;\n}\n\n.sidebar summary:hover h5 {\n  color: var(--text-color);\n}\n\n.sidebar summary::marker,\n.sidebar summary::-webkit-details-marker {\n  display: none;\n  content: '';\n}\n\n.sidebar details[open] summary {\n  font-weight: 800;\n}\n\n.breadcrumbs {\n  @apply sticky z-10 w-[100%];\n  top: var(--header-height);\n  @apply border-b;\n  @apply px-1;\n  @apply flex;\n\n  /* large */\n  @apply lg:hidden;\n\n  color: var(--text-color);\n  background-color: var(--bg-color);\n  border-color: var(--bg-secondary-color);\n}\n\n.breadcrumbs button {\n  @apply block;\n  @apply p-4;\n  @apply opacity-70;\n  @apply hover:opacity-100;\n}\n\n.breadcrumbs ol {\n  @apply flex text-sm leading-6 whitespace-nowrap min-w-0;\n  @apply flex items-center;\n}\n\n.breadcrumbs li {\n  @apply pl-1 pr-5;\n  position: relative;\n}\n\n.breadcrumbs li:after {\n  position: absolute;\n  content: '\\203A';\n  top: -1px;\n  right: 6px;\n}\n\n.breadcrumbs li:last-child::after {\n  content: '';\n}\n\n.menu {\n  @apply py-8 pt-10;\n  @apply h-full overflow-y-auto;\n\n  /* large */\n  @apply lg:pl-4 lg:pr-4;\n  @apply lg:w-[14rem];\n\n  border-right: 1px solid #8c8c8c66;\n  overscroll-behavior: contain;\n}\n\n.menu h5 {\n  @apply px-3 py-1 mb-2 rounded-md whitespace-nowrap;\n  color: var(--interactive-text-color);\n}\n\n.menu li:first-child h5,\n.menu li:first-child summary {\n  margin-top: 0;\n  padding-top: 0;\n}\n\n.menu ul {\n  @apply border-slate-100;\n  padding-bottom: 15px;\n}\n\n.menu li {\n  @apply whitespace-nowrap;\n}\n\ndetails li {\n  @apply py-1 pl-3 block overflow-hidden text-ellipsis;\n  padding: unset;\n  transition: background-color 0.2s ease-in-out;\n}\n\ndetails li:hover {\n  background-color: var(--bg-secondary-color);\n  border-radius: 4px;\n}\n\ndetails li a {\n  @apply block overflow-hidden text-ellipsis;\n}\n\n.menu li a {\n  color: var(--secondary-text-color);\n  padding: 0.5rem 20px;\n  border-radius: 4px;\n}\n\n.menu li a.is-active {\n  font-weight: 800;\n  background-color: #b1b1b13a;\n}\n\n.updated {\n  background-color: var(--interactive-text-color);\n  width: 6px;\n  height: 6px;\n  border-radius: 50%;\n  margin-top: 0.2rem;\n  margin-left: 0.3rem;\n  position: absolute;\n  transform: translateX(-15px);\n}\n\n@media (max-width: 1023px) {\n  .breadcrumbs button {\n    @apply p-2;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/components/sidebar/sidebar.tsx",
    "content": "import { $, component$, sync$, useContext, useOnDocument, useStyles$ } from '@builder.io/qwik';\nimport {\n  type ContentMenu,\n  useContent,\n  useLocation,\n  routeLoader$,\n  Link,\n} from '@builder.io/qwik-city';\nimport { GlobalStore } from '../../context';\nimport { CloseIcon } from '../svgs/close-icon';\nimport styles from './sidebar.css?inline';\n\nexport const useMarkdownItems = routeLoader$(async () => {\n  const rawData = await Promise.all(\n    Object.entries(import.meta.glob<{ frontmatter?: MDX }>('../../routes/**/*.{md,mdx}')).map(\n      async ([k, v]) => {\n        return [\n          k\n            .replace('../../routes', '')\n            .replace('(qwikcity)/', '')\n            .replace('(qwik)/', '')\n            .replaceAll(/([()])/g, '')\n            .replace('index.mdx', '')\n            .replace('index.md', ''),\n          await v(),\n        ] as const;\n      }\n    )\n  );\n  const markdownItems: MarkdownItems = {};\n  rawData.map(([k, v]) => {\n    if (v.frontmatter?.updated_at) {\n      markdownItems[k] = {\n        title: v.frontmatter.title,\n        contributors: v.frontmatter.contributors,\n        created_at: v.frontmatter.created_at,\n        updated_at: v.frontmatter.updated_at,\n      };\n    }\n  });\n\n  return markdownItems;\n});\n\ntype MarkdownItems = Record<string, MDX>;\ntype MDX = {\n  title: string;\n  contributors: string[];\n  created_at: string;\n  updated_at: string;\n};\n\nexport const SideBar = component$((props: { allOpen?: boolean }) => {\n  useStyles$(styles);\n\n  const globalStore = useContext(GlobalStore);\n  const { menu } = useContent();\n  const { url } = useLocation();\n  const markdownItems = useMarkdownItems();\n  const allOpen = url.pathname.startsWith('/qwikcity/') || props.allOpen;\n\n  useOnDocument(\n    'DOMContentLoaded',\n    sync$(() => {\n      try {\n        const val = sessionStorage.getItem('qwik-sidebar');\n        const savedScroll = !val || /null|NaN/.test(val) ? 0 : +val;\n        const el = document.getElementById('qwik-sidebar');\n        if (el) {\n          el.scrollTop = savedScroll;\n          el.style.visibility = 'visible';\n        }\n      } catch (err) {\n        //\n      }\n    })\n  );\n\n  const closeSideMenuOpen = $(() => {\n    globalStore.sideMenuOpen = false;\n  });\n\n  return (\n    <aside class=\"sidebar\">\n      <nav id=\"qwik-sidebar\" class=\"menu\">\n        <button class=\"menu-close lg:hidden\" onClick$={closeSideMenuOpen} type=\"button\">\n          <CloseIcon width={24} height={24} />\n        </button>\n        <Items\n          items={menu?.items}\n          pathname={url.pathname}\n          allOpen={allOpen}\n          markdownItems={markdownItems.value}\n          onLinkClick$={closeSideMenuOpen}\n        />\n      </nav>\n    </aside>\n  );\n});\n\nexport function Items({\n  items,\n  pathname,\n  allOpen,\n  markdownItems,\n  onLinkClick$,\n}: {\n  items?: ContentMenu[];\n  pathname: string;\n  allOpen?: boolean;\n  markdownItems: MarkdownItems;\n  onLinkClick$: () => void;\n}) {\n  return (\n    <ul>\n      {items &&\n        items.map((item, i) => (\n          <li key={i}>\n            {item.items ? (\n              <details\n                open={allOpen || i < 1 || item.items?.some((item) => pathname === item.href)}\n              >\n                <summary>\n                  <h5>{item.text}</h5>\n                </summary>\n                <Items\n                  items={item.items}\n                  pathname={pathname}\n                  markdownItems={markdownItems}\n                  onLinkClick$={onLinkClick$}\n                />\n              </details>\n            ) : (\n              <Link\n                href={item.href}\n                class={[\n                  'flex relative',\n                  {\n                    'is-active': pathname === item.href,\n                  },\n                ]}\n                onClick$={onLinkClick$}\n              >\n                {item.text}\n              </Link>\n            )}\n          </li>\n        ))}\n    </ul>\n  );\n}\n\nexport function createBreadcrumbs(menu: ContentMenu | undefined, pathname: string) {\n  if (menu?.items) {\n    for (const breadcrumbA of menu.items) {\n      if (breadcrumbA.href === pathname) {\n        return [breadcrumbA];\n      }\n\n      if (breadcrumbA.items) {\n        for (const breadcrumbB of breadcrumbA.items) {\n          if (breadcrumbB.href === pathname) {\n            return [breadcrumbA, breadcrumbB];\n          }\n\n          if (breadcrumbB.items) {\n            for (const breadcrumbC of breadcrumbB.items) {\n              if (breadcrumbC.href === pathname) {\n                return [breadcrumbA, breadcrumbB, breadcrumbC];\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  return [];\n}\n"
  },
  {
    "path": "packages/docs/src/components/sponsors/sponsors.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { BuilderLogo } from '../svgs/builder-logo';\n\nexport const Sponsors = component$(() => {\n  // the margin tops are to counterract the margin in the builder block\n  return (\n    <div class=\"mb-5 md:mb-20 border-t border-b border-dotted border-[#343434] px-4 mt-[-19px] sm:mt-[-80px] isolate\">\n      <div class=\"max-w-screen-xl mx-auto flex items-center py-4 md:justify-center justify-center flex-col md:flex-row gap-4 md:gap-8\">\n        <span class=\"font-semibold text-[14px] md:text-base md:mt-1\">Special Sponsor</span>\n        <a href=\"https://builder.io/\">\n          <BuilderLogo width={200} height={40} />\n        </a>\n        <span class=\"text-[14px] md:text-base font-semibold md:mt-1\">Visual Headless CMS</span>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/svgs/alert-icon.tsx",
    "content": "interface AlertIconProps {\n  width: number;\n  height: number;\n}\n\nexport const AlertIcon = ({ width, height }: AlertIconProps) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width=\"21\"\n    height=\"21\"\n    aria-hidden=\"true\"\n    viewBox=\"0 0 512 512\"\n  >\n    <path\n      d=\"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      stroke-miterlimit=\"10\"\n      stroke-width=\"32\"\n    />\n    <path\n      d=\"M250.26 166.05L256 288l5.73-121.95a5.74 5.74 0 00-5.79-6h0a5.74 5.74 0 00-5.68 6z\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      stroke-linecap=\"round\"\n      stroke-linejoin=\"round\"\n      stroke-width=\"32\"\n    />\n    <path d=\"M256 367.91a20 20 0 1120-20 20 20 0 01-20 20z\" fill=\"currentColor\" />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/bluesky-logo.tsx",
    "content": "interface Props {\n  width: number;\n  height: number;\n}\n\nexport const BlueskyLogo = ({ width, height }: Props) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width={width}\n    height={height}\n    viewBox=\"0 -3.268 64 68.414\"\n    role=\"img\"\n    aria-label=\"Bluesky Logo\"\n  >\n    <path\n      class=\"fill-[var(--text-color)]\"\n      d=\"M13.873 3.805C21.21 9.332 29.103 20.537 32 26.55v15.882c0-.338-.13.044-.41.867-1.512 4.456-7.418 21.847-20.923 7.944-7.111-7.32-3.819-14.64 9.125-16.85-7.405 1.264-15.73-.825-18.014-9.015C1.12 23.022 0 8.51 0 6.55 0-3.268 8.579-.182 13.873 3.805zm36.254 0C42.79 9.332 34.897 20.537 32 26.55v15.882c0-.338.13.044.41.867 1.512 4.456 7.418 21.847 20.923 7.944 7.111-7.32 3.819-14.64-9.125-16.85 7.405 1.264 15.73-.825 18.014-9.015C62.88 23.022 64 8.51 64 6.55c0-9.818-8.578-6.732-13.873-2.745z\"\n    />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/builder-logo.tsx",
    "content": "interface BuilderLogoProps {\n  width: number;\n  height: number;\n}\n\nexport const BuilderLogo = ({ width, height }: BuilderLogoProps) => (\n  <svg\n    width={width}\n    height={height}\n    viewBox=\"0 0 312 67\"\n    fill=\"none\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n    role=\"img\"\n    aria-label=\"Builder Logo\"\n  >\n    <g clip-path=\"url(#clip0_2_46)\">\n      <path\n        d=\"M58.5952 18.8422C58.5983 21.6525 57.9717 24.4278 56.7617 26.964C55.5516 29.5002 53.7889 31.7328 51.6029 33.4978L1.32849 4.94869C1.13619 4.83906 0.957774 4.70667 0.797093 4.55439C0.54498 4.30715 0.344641 4.01213 0.207782 3.68656C0.070922 3.36099 0.000285894 3.01139 0 2.6582C0 1.9532 0.279931 1.27708 0.778211 0.77857C1.27649 0.28006 1.9523 0 2.65698 0L39.7617 0C44.7566 0 49.547 1.98516 53.079 5.51876C56.611 9.05236 58.5952 13.845 58.5952 18.8422Z\"\n        fill=\"#18B4F4\"\n      />\n      <path\n        d=\"M58.5952 48.1533C58.5958 50.6281 58.1091 53.0787 57.1628 55.3653C56.2166 57.6518 54.8295 59.7295 53.0805 61.4797C51.3316 63.2298 49.2552 64.6181 46.97 65.5653C44.6847 66.5125 42.2353 67 39.7617 67H2.65697C2.13137 66.9943 1.61925 66.8329 1.1854 66.536C0.75156 66.2391 0.415485 65.8201 0.219699 65.3321C0.0239124 64.844 -0.0227877 64.3089 0.0855068 63.7943C0.193801 63.2797 0.452224 62.8088 0.82808 62.4412C0.977894 62.2907 1.14601 62.1598 1.32848 62.0513L21.1141 50.816L51.5985 33.5022C53.7842 35.2667 55.5471 37.4985 56.7579 40.0338C57.9686 42.5691 58.5964 45.3435 58.5952 48.1533Z\"\n        fill=\"#FD6B3C\"\n      />\n      <path\n        d=\"M51.6029 33.4978L21.1141 50.816L1.32851 62.0513C1.13852 62.1568 0.962902 62.2864 0.805969 62.4367C8.35007 54.6957 12.5682 44.3093 12.5587 33.4978C12.5729 22.6849 8.35596 12.2959 0.810398 4.55438C0.971079 4.70667 1.14949 4.83905 1.34179 4.94868L51.6029 33.4978Z\"\n        fill=\"#A97FF2\"\n      />\n      <path\n        d=\"M99.8005 24.5706C108.493 24.5706 113.404 31.5174 113.404 39.9306C113.404 48.3438 108.493 55.2374 99.8005 55.2374C95.2836 55.2374 91.8295 53.4299 89.9209 50.3641L89.1327 54.5463H83.6948V14.1771H90.4258V29.0852C92.0642 26.582 95.2836 24.5706 99.8005 24.5706ZM98.4454 49.3052C103.525 49.3052 106.686 45.185 106.686 39.9306C106.686 34.5655 103.525 30.4984 98.4454 30.4984C93.3662 30.4984 90.1999 34.5566 90.1999 39.9306C90.1999 45.1894 93.3086 49.3052 98.4454 49.3052Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M137.056 42.4737V25.2529H143.773V42.1325C143.773 49.6641 140.333 55.2375 130.847 55.2375C121.362 55.2375 117.921 49.6464 117.921 42.1325V25.2529H124.639V42.4737C124.639 47.0458 126.782 49.3052 130.838 49.3052C134.895 49.3052 137.056 47.0458 137.056 42.4737Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M149.149 16.215C149.127 15.6253 149.227 15.0373 149.443 14.488C149.659 13.9388 149.986 13.4404 150.404 13.0241C150.822 12.6078 151.322 12.2827 151.872 12.0694C152.422 11.8561 153.011 11.7592 153.6 11.7847C156.151 11.7847 157.988 13.6233 157.988 16.2372C157.988 18.8511 156.151 20.5656 153.6 20.5656C151.049 20.5656 149.149 18.7625 149.149 16.215Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M268.997 16.215C268.974 15.6272 269.074 15.0411 269.288 14.4935C269.503 13.9458 269.828 13.4485 270.244 13.0325C270.66 12.6166 271.157 12.291 271.704 12.0763C272.252 11.8616 272.838 11.7623 273.425 11.7847C275.976 11.7847 277.814 13.6233 277.814 16.2372C277.814 18.8511 275.976 20.5656 273.425 20.5656C270.874 20.5656 268.997 18.7625 268.997 16.215Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M256.071 50.466C256.048 49.878 256.146 49.2916 256.361 48.7436C256.575 48.1957 256.901 47.698 257.316 47.282C257.732 46.8659 258.23 46.5404 258.777 46.3259C259.325 46.1114 259.911 46.0126 260.499 46.0356C263.05 46.0356 264.887 47.8742 264.887 50.466C264.887 53.0577 263.05 54.7988 260.499 54.7988C257.948 54.7988 256.071 53.0178 256.071 50.466Z\"\n        fill=\"currentColor\"\n      />\n      <path d=\"M156.93 25.2485H150.212V54.5596H156.93V25.2485Z\" fill=\"currentColor\" />\n      <path d=\"M163.648 54.5596V14.1771H170.365V54.5685L163.648 54.5596Z\" fill=\"currentColor\" />\n      <path\n        d=\"M198.082 14.1771H204.8V54.5685H199.375L198.587 50.3862C196.727 53.4387 193.273 55.2596 188.712 55.2596C180.072 55.2596 175.161 48.3128 175.161 39.9528C175.161 31.5927 180.072 24.5928 188.712 24.5928C193.282 24.5928 196.444 26.6219 198.082 29.1073V14.1771ZM190.111 30.5073C185.032 30.5073 181.87 34.5743 181.87 39.9395C181.87 45.1939 185.032 49.3141 190.111 49.3141C195.19 49.3141 198.352 45.1939 198.352 39.9395C198.361 34.5566 195.257 30.4984 190.12 30.4984L190.111 30.5073Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M237.596 46.5407C235.51 51.7907 230.652 55.2375 224.275 55.2375C215.419 55.2375 209.662 48.6274 209.662 39.8731C209.662 31.3447 215.534 24.5707 224.227 24.5707C232.92 24.5707 238.623 31.1763 238.623 39.7623C238.651 40.4627 238.59 41.1639 238.442 41.849H216.26C216.765 46.4831 219.759 49.4736 224.444 49.4736C227.663 49.4736 230.316 47.892 231.556 44.9591L237.596 46.5407ZM216.371 36.8826H231.954C231.387 32.8155 228.567 30.0466 224.218 30.0466C219.869 30.0466 217.049 32.8731 216.371 36.8826Z\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M259.162 31.2915C258.657 31.2213 258.148 31.1829 257.638 31.1763C252.896 31.1763 250.075 33.6617 250.075 39.3104V54.5596H243.357V25.2529H248.782L249.565 29.3155C250.637 27.4548 253.108 24.9694 258.205 24.9694C258.484 24.9694 259.162 25.027 259.162 25.027V31.2915Z\"\n        fill=\"currentColor\"\n      />\n      <path d=\"M276.777 25.2485H270.06V54.5596H276.777V25.2485Z\" fill=\"currentColor\" />\n      <path\n        d=\"M281.573 39.9307C281.573 31.6858 287.445 24.5707 296.758 24.5707C306.071 24.5707 312 31.6858 312 39.9307C312 48.1755 306.133 55.2375 296.758 55.2375C287.383 55.2375 281.573 48.1755 281.573 39.9307ZM296.758 49.3053C301.673 49.3053 305.282 45.5793 305.282 39.9307C305.282 34.282 301.673 30.4985 296.758 30.4985C291.842 30.4985 288.282 34.2244 288.282 39.9307C288.282 45.6369 291.904 49.3053 296.758 49.3053Z\"\n        fill=\"currentColor\"\n      />\n    </g>\n    <defs>\n      <clipPath id=\"clip0_2_46\">\n        <rect width=\"312\" height=\"67\" fill=\"white\" />\n      </clipPath>\n    </defs>\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/chat-icon.tsx",
    "content": "interface ChatIconProps {\n  width: number;\n  height: number;\n}\n\nexport const ChatIcon = ({ width, height }: ChatIconProps) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width={width}\n    height={height}\n    viewBox=\"0 0 512 512\"\n    aria-hidden=\"true\"\n  >\n    <path\n      d=\"M408 64H104a56.16 56.16 0 00-56 56v192a56.16 56.16 0 0056 56h40v80l93.72-78.14a8 8 0 015.13-1.86H408a56.16 56.16 0 0056-56V120a56.16 56.16 0 00-56-56z\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      stroke-linejoin=\"round\"\n      stroke-width=\"32\"\n    />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/close-icon.tsx",
    "content": "interface CloseIconProps {\n  width: number;\n  height: number;\n}\n\nexport const CloseIcon = ({ width, height }: CloseIconProps) => (\n  <svg width={width} height={height} viewBox=\"0 0 10 10\" role=\"img\" aria-label=\"Close Icon\">\n    <path\n      d=\"M0 0L10 10M10 0L0 10\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      stroke-width=\"2\"\n      stroke-linecap=\"round\"\n    />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/copy-code-icon.tsx",
    "content": "interface CopyIconProps {\n  width?: number;\n  height?: number;\n}\n\nexport const CopyCode = ({ height = 18, width = 18 }: CopyIconProps) => {\n  return (\n    <svg\n      width={width}\n      height={height}\n      viewBox=\"0 0 24 24\"\n      stroke-width=\"2\"\n      stroke=\"currentColor\"\n      fill=\"none\"\n      stroke-linecap=\"round\"\n      stroke-linejoin=\"round\"\n    >\n      {' '}\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" /> <rect x=\"8\" y=\"8\" width=\"12\" height=\"12\" rx=\"2\" />\n      <path d=\"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2\" />\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/components/svgs/discord-logo.tsx",
    "content": "import type { PropsOf } from '@builder.io/qwik';\n\ntype DiscordLogoProps = {\n  width: number;\n  height: number;\n} & PropsOf<'svg'>;\n\nexport const DiscordLogo = ({ width, height }: DiscordLogoProps) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width={width}\n    height={height}\n    viewBox=\"0 0 512 512\"\n    role=\"img\"\n    aria-label=\"Discord Logo\"\n    fill=\"currentColor\"\n  >\n    <path d=\"M464 66.52A50 50 0 00414.12 17L97.64 16A49.65 49.65 0 0048 65.52V392c0 27.3 22.28 48 49.64 48H368l-13-44 109 100zM324.65 329.81s-8.72-10.39-16-19.32C340.39 301.55 352.5 282 352.5 282a139 139 0 01-27.85 14.25 173.31 173.31 0 01-35.11 10.39 170.05 170.05 0 01-62.72-.24 184.45 184.45 0 01-35.59-10.4 141.46 141.46 0 01-17.68-8.21c-.73-.48-1.45-.72-2.18-1.21-.49-.24-.73-.48-1-.48-4.36-2.42-6.78-4.11-6.78-4.11s11.62 19.09 42.38 28.26c-7.27 9.18-16.23 19.81-16.23 19.81-53.51-1.69-73.85-36.47-73.85-36.47 0-77.06 34.87-139.62 34.87-139.62 34.87-25.85 67.8-25.12 67.8-25.12l2.42 2.9c-43.59 12.32-63.44 31.4-63.44 31.4s5.32-2.9 14.28-6.77c25.91-11.35 46.5-14.25 55-15.21a24 24 0 014.12-.49 205.62 205.62 0 0148.91-.48 201.62 201.62 0 0172.89 22.95s-19.13-18.15-60.3-30.45l3.39-3.86s33.17-.73 67.81 25.16c0 0 34.87 62.56 34.87 139.62 0-.28-20.35 34.5-73.86 36.19z\" />\n    <path d=\"M212.05 218c-13.8 0-24.7 11.84-24.7 26.57s11.14 26.57 24.7 26.57c13.8 0 24.7-11.83 24.7-26.57.25-14.76-10.9-26.57-24.7-26.57zM300.43 218c-13.8 0-24.7 11.84-24.7 26.57s11.14 26.57 24.7 26.57c13.81 0 24.7-11.83 24.7-26.57S314 218 300.43 218z\" />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/edit-icon.tsx",
    "content": "interface EditIconProps {\n  width: number;\n  height: number;\n}\n\nexport const EditIcon = ({ width, height }: EditIconProps) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width={width}\n    height={height}\n    viewBox=\"0 0 512 512\"\n    aria-hidden=\"true\"\n  >\n    <path\n      d=\"M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      stroke-linecap=\"round\"\n      stroke-linejoin=\"round\"\n      stroke-width=\"32\"\n    />\n    <path\n      fill=\"currentColor\"\n      d=\"M459.94 53.25a16.06 16.06 0 00-23.22-.56L424.35 65a8 8 0 000 11.31l11.34 11.32a8 8 0 0011.34 0l12.06-12c6.1-6.09 6.67-16.01.85-22.38zM399.34 90L218.82 270.2a9 9 0 00-2.31 3.93L208.16 299a3.91 3.91 0 004.86 4.86l24.85-8.35a9 9 0 003.93-2.31L422 112.66a9 9 0 000-12.66l-9.95-10a9 9 0 00-12.71 0z\"\n    />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/github-logo.tsx",
    "content": "interface GithubLogoProps {\n  width: number;\n  height: number;\n}\n\nexport const GithubLogo = ({ width, height }: GithubLogoProps) => (\n  <svg\n    viewBox=\"0 0 16 16\"\n    width={width}\n    height={height}\n    role=\"img\"\n    aria-label=\"GitHub Logo\"\n    fill=\"currentColor\"\n  >\n    <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z\" />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/more-icon.tsx",
    "content": "interface MoreIconProps {\n  width: number;\n  height: number;\n}\n\nexport const MoreIcon = ({ width, height }: MoreIconProps) => (\n  <svg width={width} height={height} fill=\"currentColor\" viewBox=\"0 0 512 512\" aria-hidden=\"true\">\n    <circle cx=\"256\" cy=\"256\" r=\"48\" />\n    <circle cx=\"256\" cy=\"416\" r=\"48\" />\n    <circle cx=\"256\" cy=\"96\" r=\"48\" />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/svgs/qwik-logo.tsx",
    "content": "import { component$, type PropsOf } from '@builder.io/qwik';\nimport QwikUwu from '~/media/images/qwik-uwu.webp?url';\ntype QwikLogoProps = {\n  width: number;\n  height: number;\n} & PropsOf<'svg'>;\n\nexport const QwikLogo = component$((props: QwikLogoProps) => {\n  return (\n    <>\n      <svg\n        {...props}\n        width={props.width}\n        height={props.height}\n        viewBox=\"0 0 167 53\"\n        fill=\"none\"\n        xmlns=\"http://www.w3.org/2000/svg\"\n        role=\"img\"\n        aria-label=\"Qwik Logo\"\n        class={['qwik-logo', props.class]}\n      >\n        <path\n          d=\"M81.9545 46.5859H75.5513V35.4045C73.4363 36.8579 71.0496 37.5749 68.4884 37.5749C65.0151 37.5749 62.4344 36.6253 60.8239 34.6487C59.2134 32.6915 58.3984 29.2034 58.3984 24.2231C58.3984 19.1266 59.3492 15.5997 61.2702 13.5456C63.23 11.4721 66.3734 10.4644 70.7004 10.4644C74.7946 10.4644 78.5201 11.0264 81.9545 12.131V46.5859ZM75.5513 16.278C74.096 15.8323 72.4661 15.6191 70.7004 15.6191C68.5272 15.6191 66.9749 16.1811 66.1017 17.3244C65.2479 18.4871 64.7823 20.6962 64.7823 23.9712C64.7823 27.0524 65.1897 29.1065 66.0435 30.2304C66.8973 31.335 68.3719 31.897 70.5452 31.897C73.3781 31.897 75.5513 30.7343 75.5513 29.2809V16.278Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M91.133 11.1426C93.4033 17.4406 95.3242 23.7386 96.993 30.0948C99.205 23.5836 101.087 17.2856 102.542 11.1426H108.15C110.265 17.4406 112.031 23.7386 113.447 30.0948C115.97 23.196 117.949 16.8787 119.404 11.1426H125.71C123.033 20.173 120.064 28.777 116.785 36.8966H109.256C108.402 32.3039 107.044 26.7617 105.22 20.1536C104.056 25.2889 102.445 30.8893 100.33 36.8966H92.8018C90.2793 27.5174 87.5434 18.9522 84.6328 11.1426H91.133Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M132.832 7.55758C129.999 7.55758 129.203 6.85996 129.203 3.97257C129.203 1.39523 130.018 0.794495 132.832 0.794495C135.665 0.794495 136.46 1.39523 136.46 3.97257C136.46 6.85996 135.665 7.55758 132.832 7.55758ZM129.649 11.1426H136.053V36.8966H129.649V11.1426Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M166.303 11.1426C161.763 17.5956 158.581 21.5295 156.815 22.9441C158.27 23.8937 162.17 28.8933 167.002 36.916H159.628C153.613 27.7887 150.742 23.8549 149.325 23.2542V36.916H142.922V0H149.325V23.2348C150.78 22.169 153.963 18.1382 158.872 11.1426H166.303Z\"\n          fill=\"currentColor\"\n        />\n        <path\n          d=\"M40.973 52.5351L32.0861 43.6985L31.9503 43.7179V43.621L13.0511 24.9595L17.708 20.4637L14.9721 4.76715L1.99103 20.8513C-0.220992 23.0798 -0.628467 26.7036 0.962635 29.3778L9.07337 42.8265C10.3152 44.9 12.566 46.1402 14.9915 46.1208L19.0081 46.082L40.973 52.5351Z\"\n          fill=\"#18B6F6\"\n        />\n        <path\n          d=\"M45.8232 20.5411L44.038 17.2468L43.1066 15.5609L42.738 14.902L42.6992 14.9408L37.8094 6.47238C36.587 4.34075 34.2974 3.02301 31.8137 3.04239L27.5255 3.15865L14.7384 3.19741C12.313 3.21679 10.101 4.49577 8.87853 6.56927L1.09766 21.9945L15.0101 4.72831L33.2496 24.7656L30.0091 28.0406L31.9495 43.7178L31.9689 43.679V43.7178H31.9301L31.9689 43.7565L33.4824 45.2293L40.8364 52.4187C41.1469 52.7094 41.6514 52.3606 41.4379 51.9924L36.8975 43.0589L44.8142 28.4282L45.0664 28.1375C45.1634 28.0212 45.2604 27.905 45.3381 27.7887C46.8904 25.6764 47.1038 22.8472 45.8232 20.5411Z\"\n          fill=\"#AC7EF4\"\n        />\n        <path\n          d=\"M33.3076 24.6882L15.0099 4.74774L17.61 20.3668L12.9531 24.882L31.9105 43.6985L30.203 28.0794L33.3076 24.6882Z\"\n          fill=\"white\"\n        />\n      </svg>\n      {/* loading=lazy to prevent download if hidden */}\n      <img\n        loading=\"lazy\"\n        src={QwikUwu}\n        alt=\"Qwik Logo\"\n        class=\"uwu-logo\"\n        width={props.width}\n        height={props.height}\n      />\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/svgs/twitter-logo.tsx",
    "content": "interface TwitterLogoProps {\n  width: number;\n  height: number;\n}\n\nexport const TwitterLogo = ({ width, height }: TwitterLogoProps) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width={width}\n    height={height}\n    viewBox=\"0 0 512 512\"\n    role=\"img\"\n    aria-label=\"Twitter Logo\"\n    fill=\"currentColor\"\n  >\n    <path d=\"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z\" />\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/Brilliance.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ninterface BrillianceIconProps {\n  class?: string;\n}\n\nexport const BrillianceIcon = component$<BrillianceIconProps>(({ class: className, ...props }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      fill=\"currentColor\"\n      class={className}\n      viewBox=\"0 0 16 16\"\n      {...props}\n    >\n      <path d=\"M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16M1 8a7 7 0 0 0 7 7 3.5 3.5 0 1 0 0-7 3.5 3.5 0 1 1 0-7 7 7 0 0 0-7 7\" />\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/Moon.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ninterface MoonIconProps {\n  class?: string;\n}\n\nexport const MoonIcon = component$<MoonIconProps>(({ class: className, ...props }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      fill=\"none\"\n      viewBox=\"0 0 24 24\"\n      stroke-width=\"1.5\"\n      stroke=\"currentColor\"\n      class={className}\n      {...props}\n    >\n      <path\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        d=\"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z\"\n      />\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/README.md",
    "content": "# Theme switch\n\nBased on: [GUI challenges - Theme Toggle](https://github.com/argyleink/gui-challenges/tree/main/theme-switch)\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/Sun.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ninterface SunIconProps {\n  class?: string;\n}\n\nexport const SunIcon = component$<SunIconProps>(({ class: className, ...props }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      fill=\"none\"\n      viewBox=\"0 0 24 24\"\n      stroke-width=\"1.5\"\n      stroke=\"currentColor\"\n      class={className}\n      {...props}\n    >\n      <path\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        d=\"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z\"\n      />\n    </svg>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/load-theme.js",
    "content": "try {\n  const getItem = localStorage.getItem('theme-preference');\n  const el = document.firstElementChild;\n  if (!el) {\n    throw new Error('documentElement not found');\n  }\n\n  if (getItem === 'light' || getItem === 'dark') {\n    el.setAttribute('data-theme', getItem);\n  } else {\n    const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;\n    el.setAttribute('data-theme', isDark ? 'dark' : 'light');\n  }\n} catch (err) {\n  console.error(err);\n}\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/theme-script.tsx",
    "content": "import loadThemeScript from './load-theme?compiled-string';\nexport const themeStorageKey = 'theme-preference';\n\nexport const colorSchemeChangeListener = (onColorSchemeChange: (isDark: boolean) => void) => {\n  const listener = ({ matches: isDark }: MediaQueryListEvent) => {\n    onColorSchemeChange(isDark);\n  };\n  window\n    .matchMedia('(prefers-color-scheme: dark)')\n    .addEventListener('change', (event) => listener(event));\n\n  return () =>\n    window.matchMedia('(prefers-color-scheme: dark)').removeEventListener('change', listener);\n};\n\nexport const ThemeScript = () => {\n  return <script dangerouslySetInnerHTML={loadThemeScript} />;\n};\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/theme-toggle.css",
    "content": ".themeIcon {\n  opacity: 0;\n  transition: opacity 400ms ease-in-out;\n  width: 25px;\n  height: 25px;\n}\n\n.themeIcon.auto {\n  width: 21px;\n  height: 21px;\n}\n\nbutton.pref-light .themeIcon.light,\nbutton.pref-dark .themeIcon.dark,\nbutton.pref-auto .themeIcon.auto {\n  opacity: 1;\n}\n"
  },
  {
    "path": "packages/docs/src/components/theme-toggle/theme-toggle.tsx",
    "content": "import { component$, event$, isServer, useSignal, useStyles$ } from '@builder.io/qwik';\nimport { themeStorageKey } from './theme-script';\nimport themeToggle from './theme-toggle.css?inline';\nimport { SunIcon } from './Sun';\nimport { MoonIcon } from './Moon';\nimport { BrillianceIcon } from './Brilliance';\nexport type ThemePreference = 'dark' | 'light' | 'auto';\n\nexport const getSystemIsDark = (): boolean =>\n  window.matchMedia('(prefers-color-scheme: dark)').matches;\n\nexport const getEffectiveTheme = (preference: ThemePreference): 'light' | 'dark' => {\n  if (preference === 'auto') {\n    return getSystemIsDark() ? 'dark' : 'light';\n  }\n  return preference;\n};\nexport const setPreference = (theme: ThemePreference) => {\n  if (theme === 'auto') {\n    const el = document.firstElementChild;\n    if (!el) {\n      return;\n    }\n    el.setAttribute('data-theme', getEffectiveTheme('auto'));\n  } else {\n    const el = document.firstElementChild;\n    if (!el) {\n      return;\n    }\n    el.setAttribute('data-theme', theme!);\n  }\n\n  localStorage.setItem(themeStorageKey, theme);\n};\n\nexport const getColorPreference = (): ThemePreference => {\n  if (isServer) {\n    return 'auto';\n  }\n  let theme;\n  try {\n    theme = localStorage.getItem(themeStorageKey);\n  } catch {\n    //\n  }\n  return (theme as ThemePreference) || 'auto';\n};\n\nexport const ThemeToggle = component$(() => {\n  useStyles$(themeToggle);\n  const preference = useSignal<ThemePreference>(getColorPreference());\n  const onClick$ = event$(() => {\n    let currentTheme = preference.value;\n    if (currentTheme === 'dark') {\n      currentTheme = 'light';\n    } else if (currentTheme === 'light') {\n      currentTheme = 'auto';\n    } else if (currentTheme === 'auto') {\n      currentTheme = 'dark';\n    }\n    setPreference(currentTheme);\n    preference.value = currentTheme;\n  });\n\n  return (\n    <>\n      <button\n        onClick$={onClick$}\n        class={[\n          'group relative flex h-8 m-auto items-center justify-center rounded-md bg-background text-foreground hover:opacity-60 sm:w-8 sm:px-0',\n          {\n            'pref-light': preference.value === 'light',\n            'pref-dark': preference.value === 'dark',\n            'pref-auto': preference.value === 'auto',\n          },\n        ]}\n      >\n        <div class=\"absolute inset-0 hidden sm:grid place-items-center transition-transform duration-200 ease-out group-hover:scale-110 group-active:scale-75\">\n          <SunIcon class=\"themeIcon light col-start-1 row-start-1\" />\n          <MoonIcon class=\"themeIcon dark col-start-1 row-start-1\" />\n          <BrillianceIcon class=\"themeIcon auto col-start-1 row-start-1\" />\n        </div>\n        <div class=\"lg:hidden font-medium leading-none\">\n          {preference.value === 'light'\n            ? 'Light theme'\n            : preference.value === 'dark'\n              ? 'Dark theme'\n              : 'Auto'}\n        </div>\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/constants.ts",
    "content": "export const BUILDER_PUBLIC_API_KEY = 'YJIGb4i01jvw0SRdL5Bt'; // ggignore\nexport const QWIK_PUBLIC_API_KEY = 'fe30f73e01ef40558cd69a9493eba2a2'; // ggignore\nexport const BUILDER_TOP_BAR_MODEL = 'oss-top-bar';\nexport const BUILDER_FOOTER_MODEL = 'oss-footer';\nexport const QWIK_MODEL = 'content-page';\n"
  },
  {
    "path": "packages/docs/src/context.ts",
    "content": "import { createContextId } from '@builder.io/qwik';\nimport type { ThemePreference } from './components/theme-toggle/theme-toggle';\nimport type { PkgManagers } from './components/package-manager-tabs';\n\nexport interface SiteStore {\n  headerMenuOpen: boolean;\n  sideMenuOpen: boolean;\n  theme: ThemePreference | 'auto';\n  pkgManager: PkgManagers;\n}\n\nexport const GlobalStore = createContextId<SiteStore>('site-store');\n"
  },
  {
    "path": "packages/docs/src/empty.ts",
    "content": "// HACK: used to override npm imports in vite.config.js\n// For example @supabase/node-fetch polyfill should not be imported in the edge\n\nexport default undefined;\n\nexport const Headers = undefined;\n"
  },
  {
    "path": "packages/docs/src/entry.cloudflare-pages.tsx",
    "content": "import { createQwikCity } from '@builder.io/qwik-city/middleware/cloudflare-pages';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\nconst fetch = createQwikCity({ render, qwikCityPlan });\n\nexport { fetch };\n"
  },
  {
    "path": "packages/docs/src/entry.dev.tsx",
    "content": "import { render, type RenderOptions } from '@builder.io/qwik';\nimport Root from './root';\n\n/**\n * Development entry point using only client-side modules:\n *\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/entry.preview.tsx",
    "content": "import { createQwikCity } from '@builder.io/qwik-city/middleware/node';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\n/** The default export is the QwikCity adapter used by Vite preview. */\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "packages/docs/src/entry.ssr.tsx",
    "content": "import type { PreloaderOptions, RenderToStreamOptions } from '@builder.io/qwik/server';\nimport { renderToStream } from '@builder.io/qwik/server';\nimport Root from './root';\n\n// You can pass these as query parameters, as well as `preloadDebug`\nconst preloaderSettings = ['ssrPreloads', 'ssrPreloadProbability', 'maxIdlePreloads'] as const;\n\nexport default function (opts: RenderToStreamOptions) {\n  const { serverData } = opts;\n  const urlStr = serverData?.url;\n  if (urlStr) {\n    const { searchParams } = new URL(urlStr);\n    if (searchParams.size) {\n      const newOpts = {\n        ...opts,\n        preloader: {\n          ...(typeof opts.preloader === 'object' ? opts.preloader : undefined),\n        },\n      } as Omit<RenderToStreamOptions, 'preloader'> & { preloader: PreloaderOptions };\n      if (searchParams.has('preloaderDebug')) {\n        newOpts.preloader!.debug = true;\n      }\n      for (const type of preloaderSettings) {\n        if (searchParams.has(type)) {\n          newOpts.preloader[type] = Number(searchParams.get(type));\n        }\n      }\n      opts = newOpts;\n    }\n  }\n  return renderToStream(<Root />, {\n    ...opts,\n    containerAttributes: {\n      lang: 'en',\n      ...opts.containerAttributes,\n    },\n  });\n}\n"
  },
  {
    "path": "packages/docs/src/global.css",
    "content": "@import 'tailwindcss';\n\n@theme {\n  --color-interactive-blue: '#009dfd';\n}\n\n/* latin */\n@font-face {\n  font-family: 'Poppins';\n  font-style: normal;\n  font-weight: 400;\n  font-display: optional;\n  src: url(./fonts/poppins-400.woff2) format('woff2');\n  unicode-range:\n    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* latin */\n@font-face {\n  font-family: 'Poppins';\n  font-style: normal;\n  font-weight: 500;\n  font-display: optional;\n  src: url(./fonts/poppins-500.woff2) format('woff2');\n  unicode-range:\n    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* latin */\n@font-face {\n  font-family: 'Poppins';\n  font-style: normal;\n  font-weight: 700;\n  font-display: optional;\n  src: url(./fonts/poppins-700.woff2) format('woff2');\n  unicode-range:\n    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n.docs article pre code[data-language='tsx'] {\n  font-family: Menlo, Monaco, 'Lucida Console', Consolas, 'Courier New', monospace;\n  font-weight: normal;\n  font-size: 14px;\n  font-feature-settings:\n    'liga' 0,\n    'calt' 0;\n  line-height: 1.7;\n  letter-spacing: 0px;\n  text-shadow: none;\n}\n\n* {\n  -webkit-tap-highlight-color: transparent;\n  -webkit-touch-callout: none;\n}\n\n:root body {\n  --docsearch-modal-width: 600px;\n  --docsearch-modal-height: 800px;\n}\n\n:root {\n  color-scheme: light;\n  --header-height: 80px;\n  --aside-width: 300px;\n  --container-max-width: 1400px;\n  --builder-bar-height: 56px;\n  --panel-toggle-height: 0px;\n  --scroll-margin-top: calc(var(--header-height) + var(--builder-bar-height) + 10px);\n\n  --qwik-blue: #0093ee;\n  --qwik-dark-blue: #006ce9;\n  --qwik-light-blue: #daf0ff;\n  --qwik-purple: #ac7ef4;\n  --qwik-dark-purple: #6000ff;\n  --qwik-dark-purple-bg: #151934;\n\n  --bg-color: #ffffff;\n  --bg-secondary-color: #f7f8fb;\n  --bg-header-color: #ffffff9e;\n  --text-color: #0e201a;\n  --secondary-text-color: #171a19;\n  --interactive-text-color: var(--qwik-dark-blue);\n\n  --code-bg-color: #e0e0e0;\n  --code-border-color: #bfbfbf;\n  --blockquote-bg-color: #f1f5fe;\n\n  --repl-tab-button-hover-bg-color: #ffffff75;\n  --repl-tab-button-hover-border-color: #0084ff75;\n  --repl-tab-button-input-hover-border-color: #564ce175;\n  --repl-tab-button-input-active-border-color: var(--qwik-purple);\n  --repl-tab-button-active-border-color: var(--qwik-blue);\n  --repl-diagnostics-hover-border-color: #ff009075;\n  --repl-diagnostics-active-border-color: #ff0090;\n  --repl-commands-color: var(--qwik-blue);\n  --repl-tab-height: 56px;\n  --repl-tab-bg-color: var(--qwik-light-blue);\n  --repl-diagnostics-text-color: #c90674;\n  --repl-log-build: #f3f4cb;\n  --repl-log-ssr: #e3e400;\n  --repl-log-client: #78fa83;\n  --repl-log-network: #f4f4f4;\n  --repl-log-warning: #d9d900;\n  --repl-log-text: #0e201a;\n  --repl-border-color: #e3e3e3;\n\n  --tutorial-nav-button-bg-color: var(--qwik-dark-blue);\n  --tutorial-nav-button-hover-bg-color: var(--bg-color);\n  --tutorial-nav-button-text-color: #ffffff;\n\n  --examples-header-text-color: #494949;\n  --examples-active-bg-color: #e2ebff;\n  --examples-hover-bg-color: #f7f7f7;\n  --examples-border-color: #e3e3e3;\n  --examples-main-border-color: #dfdede;\n\n  --content-nav-button-text-color: var(--interactive-text-color);\n  --content-nav-button-bg-color: var(--qwik-dark-blue);\n  --content-nav-button-hover-bg-color: var(--bg-color);\n\n  --made-with-love-text-color: #333333;\n\n  --on-this-page-hover-bg-color: #0093ee17;\n\n  --media-separator-color: #dddddd;\n  --media-video-shadow-color: var(--qwik-dark-blue);\n\n  --panel-toggle-background-color: var(--qwik-light-blue);\n}\n\n:root[data-theme='dark'] {\n  color-scheme: dark;\n  --qwik-blue: #009dfd;\n\n  --bg-color: #101010;\n  --bg-secondary-color: #232323;\n  --bg-header-color: #00000006;\n  --text-color: #e3e2e9;\n  --secondary-text-color: #ffffffc3;\n  --interactive-text-color: var(--qwik-blue);\n\n  --code-bg-color: #1d1d1d;\n  --code-border-color: #525252;\n  --blockquote-bg-color: #353639;\n\n  --repl-tab-button-hover-bg-color: #ffffff25;\n  --repl-tab-button-input-hover-border-color: #c3c1de75;\n  --repl-tab-button-input-active-border-color: #d8c2fa;\n  --repl-tab-button-active-border-color: var(--qwik-light-blue);\n  --repl-diagnostics-hover-border-color: rgba(255, 0, 144, 0.46);\n  --repl-diagnostics-active-border-color: rgb(255, 0, 144);\n  --repl-commands-color: var(--qwik-light-blue);\n  --repl-tab-bg-color: var(--bg-color);\n  --repl-border-color: rgba(255, 255, 255, 0.2);\n\n  --examples-header-text-color: var(--text-color);\n  --examples-active-bg-color: #1d1d1d;\n  --examples-hover-bg-color: #353639;\n  --examples-border-color: rgba(255, 255, 255, 0.2);\n  --examples-main-border-color: rgba(255, 255, 255, 0.1);\n\n  --made-with-love-text-color: #c6c5cb;\n\n  --media-separator-color: rgba(255, 255, 255, 0.1);\n  --media-video-shadow-color: var(--qwik-blue);\n\n  --panel-toggle-background-color: var(--qwik-dark-blue);\n}\n\n@media (max-width: 768px) {\n  :root {\n    --panel-toggle-height: 56px;\n    --builder-bar-height: 40px;\n    --header-height: 60px;\n  }\n}\n\nhtml {\n  font-family:\n    Poppins,\n    ui-sans-serif,\n    system-ui,\n    -apple-system,\n    BlinkMacSystemFont,\n    Segoe UI,\n    Roboto,\n    Helvetica Neue,\n    Arial,\n    Noto Sans,\n    sans-serif,\n    'Apple Color Emoji',\n    'Segoe UI Emoji',\n    Segoe UI Symbol,\n    'Noto Color Emoji';\n  background-color: var(--bg-color);\n  color: var(--text-color);\n  overflow: auto;\n}\n\n.uwu-logo {\n  display: none;\n}\nhtml.uwu .qwik-logo {\n  display: none;\n}\nhtml.uwu .uwu-logo {\n  display: block !important;\n}\n\na,\nbutton,\ntextarea,\ninput,\nselect {\n  touch-action: manipulation;\n}\n\nbody {\n  @apply antialiased h-screen;\n  scrollbar-gutter: stable;\n}\n\n@media (max-width: 1023px) {\n  .menu-open .sidebar {\n    @apply block fixed z-50 top-0 bottom-0 left-0 max-h-none w-full;\n  }\n\n  .menu-open .menu {\n    @apply block;\n\n    @apply top-0;\n    @apply p-3 pt-6 pr-16;\n    width: 360px;\n\n    background: var(--bg-color);\n  }\n\n  .menu-open .menu h5 {\n    @apply p-2;\n  }\n\n  .menu-open .menu li a,\n  .menu-open .menu li a.is-active {\n    @apply p-3;\n  }\n\n  .menu-close {\n    display: block;\n    position: fixed;\n    top: 0;\n    left: 300px;\n    width: 100%;\n    height: 100vh;\n    padding-left: 12px;\n    cursor: default;\n    color: var(--qwik-dark-blue);\n    background: color-mix(in hsl, var(--bg-color), transparent 20%);\n    backdrop-filter: blur(3px);\n  }\n\n  .menu-close svg {\n    position: fixed;\n    top: calc(20px + var(--builder-bar-height));\n    width: 24px;\n    height: 24px;\n    cursor: pointer;\n  }\n}\n\n@media (max-width: 540px) {\n  .menu-open .menu {\n    -webkit-user-select: none;\n    user-select: none;\n  }\n\n  .menu-open .menu a:hover {\n    @apply bg-transparent;\n    color: rgb(241 245 249) !important;\n  }\n}\n@media (min-width: 1024px) {\n  #qwik-sidebar.menu {\n    width: 17rem;\n  }\n}\n\n@media (min-width: 1300px) {\n  #qwik-sidebar.menu {\n    width: 20rem;\n  }\n}\n/* Builder */\n:root[data-theme='dark'] .builder .dark-mode {\n  filter: invert(90%) hue-rotate(180deg);\n}\n\n:root[data-theme='dark'] .dark-mode-invert {\n  filter: invert(100%) hue-rotate(180deg);\n}\n\n:root[data-theme='dark'] .dark-mode-hide {\n  display: none !important;\n}\n\n:root[data-theme='light'] .light-mode-hide {\n  display: none !important;\n}\n\n:root[data-theme='dark'] .builder .dark-mode :is(img, iframe, video) {\n  filter: invert(100%) hue-rotate(180deg);\n}\n\n/* Temporary workaround */\n:root[data-theme='dark'] .builder .csoetdv,\n:root[data-theme='dark'] .builder .cvha93q {\n  filter: invert(90%) hue-rotate(180deg);\n}\n\n.purple-bg {\n  background-color: var(--qwik-dark-purple-bg);\n  height: auto;\n}\n\n.purple-bg header.header-container {\n  background-color: var(--qwik-dark-purple-bg);\n}\n\ncode .line.line--highlighted {\n  background: rgba(200, 200, 255, 0.1);\n  border-left-color: #60a5fa;\n}\n\ncode .word {\n  background: rgba(200, 200, 255, 0.15);\n  padding: 0.25rem;\n  border-radius: 0.25rem;\n}\n\n.ai-button {\n  background: var(--docsearch-hit-background);\n  border-radius: 4px;\n  box-shadow: var(--docsearch-hit-shadow);\n  display: block;\n  width: 100%;\n  overflow: hidden;\n  color: var(--docsearch-hit-color);\n}\n\n.ai-button > button {\n  display: block;\n  width: 100%;\n  text-align: left;\n  padding-left: 12px;\n  padding: 15px;\n  color: inherit;\n}\n\n.ai-li[aria-selected='true'] button {\n  background-color: var(--docsearch-highlight-color);\n  color: white;\n}\n\n.qwikgpt-box {\n  background: var(--docsearch-hit-background);\n  padding: 10px;\n  margin: 0;\n  font-weight: 100;\n  font-size: 14px;\n}\n\n.qwikgpt-box p {\n  margin: 10px 0;\n}\n\n.qwikgpt-box ol,\n.qwikgpt-box ul {\n  margin: 10px 15px 0;\n  list-style: auto;\n}\n\n.qwikgpt-box li {\n  font-weight: initial;\n}\n\n.qwikgpt-box code:not(.language-tsx) {\n  background: #5468ff5c;\n  padding: 2px 5px;\n  border-radius: 5px;\n}\n\n.qwikgpt-box a {\n  color: var(--interactive-text-color);\n  text-decoration: underline;\n}\n\n.qwikgpt-box pre {\n  font-size: 12px !important;\n  border-radius: 12px;\n  margin: 10px 0;\n}\n\n.indeterminate-progress-bar {\n  /* Color */\n  background-color: #d1d5db;\n\n  /* Rounded border */\n  border-radius: 9999px;\n\n  /* Size */\n  height: 0.5rem;\n\n  position: relative;\n  overflow: hidden;\n\n  margin: 80px;\n}\n\n.indeterminate-progress-bar__progress {\n  /* Color */\n  background-color: #3b82f6;\n\n  /* Rounded border */\n  border-radius: 9999px;\n\n  /* Absolute position */\n  position: absolute;\n  bottom: 0;\n  top: 0;\n  width: 50%;\n\n  /* Move the bar infinitely */\n  animation-duration: 2s;\n  animation-iteration-count: infinite;\n  animation-name: indeterminate-progress-bar;\n}\n\n@keyframes indeterminate-progress-bar {\n  from {\n    left: -50%;\n  }\n  to {\n    left: 100%;\n  }\n}\n\n.ai-rate {\n  text-align: right;\n  margin-top: 20px;\n  border-top: 1px solid #cdcdcd;\n  padding: 10px 13px 0 0;\n  font-size: 12px;\n}\n\n.ai-rate button {\n  padding: 0px 18px;\n  font-size: 18px;\n  border-radius: 10px;\n  margin: 0 5px;\n}\n\n.ai-rate button.rate-good {\n  background: #c2ffc6;\n  border: 2px solid green;\n}\n\n.ai-rate button.rate-bad {\n  background: #ffc2c2;\n  border: 2px solid red;\n}\n\n.qwiksand {\n  cursor:\n    url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'  width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>🏖️</text></svg>\")\n      16 0,\n    auto;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/README.md",
    "content": "# Qwik Docs REPL\n\nThis folder contains the client-side REPL (Read-Eval-Print Loop) used in the Qwik docs site. The REPL lets users write and run Qwik/TypeScript code snippets in the browser, see results, and share runnable examples.\n\nThis README gives a high-level overview of how the REPL is structured, what each area is responsible for, and some development notes and suggested improvements.\n\n---\n\n## High-level architecture\n\nThe REPL is a browser-first system composed of three main parts:\n\n- Bundler subsystem (web-worker + helpers): transforms user code, resolves imports, bundles modules, and prepares runnable artifacts.\n- Service worker: Intercepts requests to `/repl/` and messages the bundler subsystem (via BroadcastChannel) to get responses. This allows the REPL to work without a server.\n- UI (React/Qwik components + Monaco): editor, panels, console, options and controls that let users edit code and view outputs.\n\nThe codebase keeps bundling and heavy work off the main thread by using a web worker script per Qwik version.\n\n## Key directories & files\n\n- `repl-sw.ts` and `register-repl-sw.ts`\n  - Service worker script and registration helper. The script is actually served via the route `/src/routes/repl/repl-sw.js/entry.ts`, which becomes the served path `/repl/repl-sw.js`.\n\n- `bundler/`\n  - `bundled.tsx` — provides the current development version of Qwik, so that the REPL can show the latest features, and it can work while developing offline.\n  - `bundler-registry.ts` — maintains the per-version Qwik WebWorkers.\n  - `bundler-worker.ts` — bundles and runs the REPL user code.\n  - `repl-ssr-worker.ts` — executes the SSR bundle in a separate worker served from `/repl/`, so that the imports can be intercepted by the service worker.\n\n- `ui/`\n  - `repl-instance.ts` — orchestration or single-instance logic for a REPL embed on a page.\n  - `editor.tsx`, `monaco.tsx` — Monaco editor wiring and editor UI glue.\n  - `repl-*.tsx` — UI components for console, input/output panels, tabs, share URL, version display, etc.\n\n## How it works\n\n1. The UI component (`ui/editor.tsx` + `ui/monaco.tsx`) presents a code editor and controls.\n2. When code is executed, the bundler subsystem is invoked. The UI posts a message to the bundler worker.\n3. The bundler worker (`bundler-worker.ts`) makes the client and SSR bundles, and executes `render()` from the `entry.ssr` to get the SSR result HTML.\n4. The UI also shows an iframe, loading `/repl/client/[id]/`.\n5. The service worker intercepts all requests and uses messages to get the bundle + html files from the worker.\n\n### Flow diagram\n\n- The iframe requests `/repl/client/[id]/`\n- The service worker intercepts and sends a message to the REPL instance\n- The REPL instance messages the bundler to bundle the user code\n- The bundler messages the REPL instance with the result\n- The REPL instance then runs the SSR bundle in a separate worker, again with messages\n- The REPL instance messages the service worker with the requested file\n- The service worker fulfills the request\n\n```mermaid\nflowchart TD\n  Iframe[\"Iframe - /repl/client/[replId]/\"]\n  ServiceWorker[\"Service Worker (/repl/*)\"]\n  ReplInstance[\"REPL instance\"]\n  BundlerWorker[\"Bundler Worker\"]\n  SSRWorker[\"SSR Worker\"]\n\n  ReplInstance -->|REPL user code| BundlerWorker\n\tBundlerWorker -->|ReplResult| ReplInstance\n  ReplInstance -->|SSR bundled code| SSRWorker\n  SSRWorker -->|HTML result| ReplInstance\n  ServiceWorker -->|message: fetch pathname| ReplInstance\n  Iframe -->|HTTP request| ServiceWorker\n  ReplInstance -->|file contents| ServiceWorker\n  ServiceWorker -->|respond to iframe| Iframe\n```\n\n## Running the REPL\n\nThe REPL is part of the docs site — start the docs dev server (project root):\n\n```bash\npnpm docs.dev\n```\n\nThen visit `/playground`.\n"
  },
  {
    "path": "packages/docs/src/repl/bundler/bundled.tsx",
    "content": "import { version as qwikVersion } from '@builder.io/qwik';\nimport type { PkgUrls } from '../types';\n\nimport qBuild from '../../../node_modules/@builder.io/qwik/dist/build/index.d.ts?raw-source';\nimport qCoreDts from '../../../node_modules/@builder.io/qwik/dist/core.d.ts?raw-source';\nimport qCoreMinMjs from '../../../node_modules/@builder.io/qwik/dist/core.min.mjs?raw-source';\nimport qCoreMjs from '../../../node_modules/@builder.io/qwik/dist/core.mjs?raw-source';\nimport qOptimizerMjs from '../../../node_modules/@builder.io/qwik/dist/optimizer.mjs?raw-source';\nimport qPreloaderMjs from '../../../node_modules/@builder.io/qwik/dist/preloader.mjs?raw-source';\n// we use the debug version for the repl so it's understandable\nimport qQwikLoaderJs from '../../../node_modules/@builder.io/qwik/dist/qwikloader.debug.js?raw-source';\nimport qServerMjs from '../../../node_modules/@builder.io/qwik/dist/server.mjs?raw-source';\nimport qServerDts from '../../../node_modules/@builder.io/qwik/dist/server.d.ts?raw-source';\nimport qWasmMjs from '../../../node_modules/@builder.io/qwik/bindings/qwik.wasm.mjs?raw-source';\nimport qWasmBinUrl from '../../../node_modules/@builder.io/qwik/bindings/qwik_wasm_bg.wasm?raw-source';\n\nimport { QWIK_PKG_NAME_V1, QWIK_PKG_NAME_V2 } from '../repl-constants';\n\nexport const getNpmCdnUrl = (\n  bundled: PkgUrls,\n  pkgName: string,\n  pkgVersion: string,\n  pkgPath: string\n) => {\n  if (pkgVersion === 'bundled') {\n    const files = bundled[pkgName];\n    if (files) {\n      pkgVersion = files.version;\n      const url = files[pkgPath];\n      if (url) {\n        return url;\n      }\n    } else {\n      // fall back to latest\n      pkgVersion =\n        pkgName === QWIK_PKG_NAME_V1 || pkgName === QWIK_PKG_NAME_V2\n          ? qwikVersion.split('-dev')[0]\n          : '';\n    }\n  }\n  return `https://cdn.jsdelivr.net/npm/${pkgName}${pkgVersion ? '@' + pkgVersion : ''}${pkgPath}`;\n};\n\nconst qwikUrls: PkgUrls[string] = {\n  version: qwikVersion,\n  // For bundled version, use local files\n  '/dist/build/index.d.ts': qBuild,\n  '/dist/core.d.ts': qCoreDts,\n  '/dist/core.min.mjs': qCoreMinMjs,\n  '/dist/core.mjs': qCoreMjs,\n  '/dist/optimizer.mjs': qOptimizerMjs,\n  '/dist/server.mjs': qServerMjs,\n  '/dist/server.d.ts': qServerDts,\n  '/dist/preloader.mjs': qPreloaderMjs,\n  '/dist/qwikloader.js': qQwikLoaderJs,\n  '/bindings/qwik.wasm.mjs': qWasmMjs,\n  '/bindings/qwik_wasm_bg.wasm': qWasmBinUrl,\n};\nexport const bundled: PkgUrls = {\n  [QWIK_PKG_NAME_V1]: qwikUrls,\n  [QWIK_PKG_NAME_V2]: qwikUrls,\n};\n\nexport const getDeps = (qwikVersion: string) => {\n  const out = { ...bundled };\n  if (qwikVersion !== 'bundled') {\n    const [M, m, p] = qwikVersion.split('-')[0].split('.').map(Number);\n    const prefix = M > 1 || (M == 1 && (m > 7 || (m == 7 && p >= 2))) ? '/dist/' : '/';\n    const isV2 = qwikVersion >= '2';\n    const pkgName = isV2 ? QWIK_PKG_NAME_V2 : QWIK_PKG_NAME_V1;\n    out[QWIK_PKG_NAME_V1] = {\n      version: qwikVersion,\n    };\n    for (const p of [\n      `/dist/core.mjs`,\n      `/dist/core.min.mjs`,\n      `/dist/optimizer.mjs`,\n      `/dist/server.mjs`,\n      `/bindings/qwik.wasm.mjs`,\n      `/bindings/qwik_wasm_bg.wasm`,\n      `/dist/qwikloader.js`,\n      `/dist/preloader.mjs`,\n      '/handlers.mjs',\n    ]) {\n      out[QWIK_PKG_NAME_V1][p] = getNpmCdnUrl(\n        bundled,\n        pkgName,\n        qwikVersion,\n        p.replace('/dist/', prefix)\n      );\n    }\n    out[QWIK_PKG_NAME_V1]['/dist/core.d.ts'] = getNpmCdnUrl(\n      bundled,\n      pkgName,\n      qwikVersion,\n      isV2 ? '/dist/core-internal.d.ts' : `${prefix}core.d.ts`\n    );\n    out[QWIK_PKG_NAME_V2] = out[QWIK_PKG_NAME_V1];\n  }\n  return out;\n};\n"
  },
  {
    "path": "packages/docs/src/repl/bundler/bundler-worker.ts",
    "content": "import { rolldown, type OutputAsset, type OutputChunk } from '@rolldown/browser';\nimport type { PkgUrls, ReplInputOptions, ReplModuleOutput, ReplResult } from '../types';\nimport { definesPlugin, replCss, replMinify, replResolver } from './rollup-plugins';\nimport { QWIK_PKG_NAME_V1 } from '../repl-constants';\n\n// Worker message types\ninterface MessageBase {\n  type: string;\n}\n\nexport interface InitMessage extends MessageBase {\n  type: 'init';\n  version: string;\n  deps: PkgUrls;\n}\n\nexport interface BundleMessage extends MessageBase {\n  type: 'bundle';\n  buildId: number;\n  data: Omit<ReplInputOptions, 'version' | 'serverUrl'>;\n}\n\nexport interface ReadyMessage extends MessageBase {\n  type: 'ready';\n}\n\nexport interface ResultMessage extends MessageBase {\n  type: 'result';\n  buildId: number;\n  result: ReplResult;\n}\n\nexport interface ErrorMessage extends MessageBase {\n  type: 'error';\n  buildId: number;\n  error: string;\n  stack?: string;\n}\n\ntype IncomingMessage = InitMessage | BundleMessage;\nexport type OutgoingMessage = ReadyMessage | ResultMessage | ErrorMessage;\n\nlet qwikOptimizer: typeof import('@builder.io/qwik/optimizer') | null = null;\nlet binding: any = null;\nlet loaded: Promise<void> | null = null;\nlet deps: PkgUrls;\n\nself.onmessage = async (e: MessageEvent<IncomingMessage>) => {\n  const { type } = e.data;\n\n  switch (type) {\n    case 'init':\n      deps = e.data.deps;\n      loaded = loadOptimizer();\n      break;\n\n    case 'bundle':\n      await loaded;\n      try {\n        const result = await performBundle(e.data);\n        const message: ResultMessage = {\n          type: 'result',\n          buildId: e.data.buildId,\n          result,\n        };\n        self.postMessage(message);\n      } catch (error) {\n        console.error(`Bundler worker for %s failed`, deps[QWIK_PKG_NAME_V1].version, error);\n        const message: ErrorMessage = {\n          type: 'error',\n          buildId: e.data.buildId,\n          error: (error as Error)?.message || String(error),\n          stack: (error as Error)?.stack,\n        };\n        self.postMessage(message);\n      }\n      break;\n\n    default:\n      console.warn('Unknown message type:', type);\n  }\n};\n\nlet version: number[];\nasync function loadOptimizer() {\n  const qwikDeps = deps[QWIK_PKG_NAME_V1];\n  version = qwikDeps.version.split('.').map((v) => parseInt(v, 10));\n  const wasmLoader = await import(/* @vite-ignore */ qwikDeps['/bindings/qwik.wasm.mjs']);\n\n  const wasmBuffer = await fetch(qwikDeps['/bindings/qwik_wasm_bg.wasm']).then((r) =>\n    r.arrayBuffer()\n  );\n  const wasm = await WebAssembly.compile(wasmBuffer);\n  await wasmLoader.default(wasm);\n  binding = wasmLoader;\n\n  qwikOptimizer = await import(/* @vite-ignore */ qwikDeps['/dist/optimizer.mjs']);\n  console.warn(`Bundler for ${qwikDeps.version} ready`);\n}\n\nconst getOutput = (o: OutputChunk | OutputAsset) => {\n  const f: ReplModuleOutput = {\n    path: o.fileName,\n    code: '',\n    size: '',\n  };\n  if (o.type === 'chunk') {\n    f.code = o.code || '';\n  } else if (o.type === 'asset') {\n    f.code = String(o.source || '');\n  }\n  f.size = `${f.code.length} B`;\n  return f;\n};\n\nasync function performBundle(message: BundleMessage): Promise<ReplResult> {\n  const { buildId } = message;\n  const { srcInputs, buildMode, entryStrategy: _entryStrategy, replId, debug } = message.data;\n\n  // Handle the renamed entry strategy for older Qwik versions\n  const entryStrategy =\n    _entryStrategy?.type === 'segment' && version[0] < 2 && version[1] < 8\n      ? { type: 'hook' as 'segment' }\n      : _entryStrategy;\n\n  let start = performance.now();\n\n  const baseUrl = `/repl/client/${replId}/`;\n  const defines = {\n    'import.meta.env.BASE_URL': JSON.stringify(baseUrl),\n    'import.meta.env': JSON.stringify({}),\n  };\n\n  const onwarn = (warning: any) => {\n    const diagnostic: ReplResult['diagnostics'][number] = {\n      scope: 'rollup-ssr',\n      code: warning.code ?? null,\n      message: warning.message,\n      category: 'warning',\n      highlights: [],\n      file: warning.id || '',\n      suggestions: null,\n    };\n    const loc = warning.loc;\n    if (loc && loc.file) {\n      diagnostic.file = loc.file;\n      diagnostic.highlights.push({\n        startCol: loc.column,\n        endCol: loc.column + 1,\n        startLine: loc.line,\n        endLine: loc.line + 1,\n        lo: 0,\n        hi: 0,\n      });\n    }\n    result.diagnostics.push(diagnostic);\n  };\n\n  const result = {\n    buildId,\n    manifest: undefined,\n    diagnostics: [] as any[],\n    events: [] as any[],\n  } as ReplResult;\n\n  const clientBuild = await rolldown({\n    cwd: '/',\n    input: srcInputs.find((i) => i.path.endsWith('app.tsx'))?.path,\n    plugins: [\n      definesPlugin(defines),\n      replCss({ srcInputs }),\n      qwikOptimizer!.qwikRollup({\n        optimizerOptions: { binding },\n        target: 'client',\n        buildMode,\n        debug,\n        srcInputs,\n        entryStrategy,\n        manifestOutput: (m: any) => {\n          result.manifest = m;\n        },\n        transformedModuleOutput: (t: any) => {\n          result.transformedModules = t;\n        },\n      }),\n      replResolver(deps, { srcInputs, buildMode }, 'client'),\n      replMinify(buildMode),\n    ],\n    onwarn,\n  });\n\n  const clientBundle = await clientBuild.generate({\n    format: 'es',\n    sourcemap: false,\n  });\n\n  result.events.push({\n    start,\n    end: performance.now(),\n    kind: 'console-log',\n    scope: 'build',\n    message: [`Client build: ${(performance.now() - start).toFixed(2)}ms`],\n  });\n\n  result.clientBundles = clientBundle.output\n    .map(getOutput)\n    .sort((a, b) => a.path.localeCompare(b.path));\n\n  start = performance.now();\n  // Perform SSR bundle\n  const ssrBuild = await rolldown({\n    cwd: '/',\n    input: srcInputs.find((i) => i.path.endsWith('entry.server.tsx'))?.path,\n    plugins: [\n      definesPlugin(defines),\n      replCss({ srcInputs }),\n      qwikOptimizer!.qwikRollup({\n        optimizerOptions: { binding },\n        target: 'ssr',\n        buildMode,\n        debug,\n        srcInputs,\n        entryStrategy,\n      }),\n      replResolver(deps, { srcInputs, buildMode }, 'ssr'),\n      replMinify(buildMode),\n    ],\n    onwarn,\n  });\n\n  const ssrBundle = await ssrBuild.generate({\n    format: 'es',\n    inlineDynamicImports: true,\n    sourcemap: false,\n  });\n\n  result.events.push({\n    start,\n    end: performance.now(),\n    kind: 'console-log',\n    scope: 'build',\n    message: [`SSR build: ${(performance.now() - start).toFixed(2)}ms`],\n  });\n\n  result.ssrModules = ssrBundle.output.map(getOutput).sort((a, b) => a.path.localeCompare(b.path));\n\n  // SSR execution moved to separate SSR worker\n  result.html = '';\n\n  return result;\n}\n\nself.postMessage({ type: 'ready' } as ReadyMessage);\n"
  },
  {
    "path": "packages/docs/src/repl/bundler/client-events-listener.ts",
    "content": "import type { QwikSymbolEvent } from '@builder.io/qwik';\nimport type { ReplEvent } from '../types';\n\n(() => {\n  const replId = location.pathname.split('/')[3];\n  const origConsole: Record<string, any> = {};\n\n  const sendToServerWindow = (data: Omit<ReplEvent, 'start'>) => {\n    try {\n      parent.postMessage({\n        type: 'event',\n        replId,\n        event: { ...data, start: performance.now() },\n      });\n    } catch {\n      // ignore\n    }\n  };\n\n  const wrapConsole = (kind: 'log' | 'warn' | 'error' | 'debug') => {\n    origConsole[kind] = console[kind];\n    console[kind] = (...args: any[]) => {\n      sendToServerWindow({\n        kind: `console-${kind}` as any,\n        scope: 'client',\n        message: args.map((a) => String(a)),\n      });\n      origConsole[kind](...args);\n    };\n  };\n  wrapConsole('log');\n  wrapConsole('warn');\n  wrapConsole('error');\n  // wrapConsole('debug');\n\n  document.addEventListener('qsymbol', (ev) => {\n    const customEv: QwikSymbolEvent = ev as any;\n    const symbolName = customEv.detail?.symbol;\n    sendToServerWindow({\n      kind: 'symbol',\n      scope: 'client',\n      message: [symbolName],\n    });\n  });\n\n  document.addEventListener('qresume', () => {\n    sendToServerWindow({\n      kind: 'resume',\n      scope: 'client',\n      message: [''],\n    });\n  });\n\n  // Ensure all external links open in a new tab\n  document.addEventListener(\n    'click',\n    (ev) => {\n      try {\n        if (ev.target && (ev.target as Element).tagName === 'A') {\n          const anchor = ev.target as HTMLAnchorElement;\n          const href = anchor.href;\n          if (href && href !== '#') {\n            const url = new URL(anchor.href, origin);\n            if (url.origin !== origin) {\n              anchor.setAttribute('target', '_blank');\n            }\n          }\n        }\n      } catch (e) {\n        console.error('repl-request-handler', e);\n      }\n    },\n    true\n  );\n})();\n"
  },
  {
    "path": "packages/docs/src/repl/bundler/index.ts",
    "content": "/** Bundler registry that manages WebWorkers per Qwik version */\n\nimport type { ReplInputOptions, ReplResult } from '../types';\nimport { getDeps } from './bundled';\nimport type { InitMessage, BundleMessage, OutgoingMessage } from './bundler-worker';\nimport bundlerWorkerUrl from './bundler-worker?worker&url';\n\nconst bundlers = new Map<string, Bundler>();\n\nclass Bundler {\n  public worker: Worker | null = null;\n  private initP: Promise<void> | null = null;\n  private ready: (() => void) | null = null;\n\n  timer: any = null;\n  buildPromises = new Map<\n    number,\n    { resolve: (value: ReplResult) => void; reject: (reason?: any) => void }\n  >();\n  nextBuildId = 1;\n\n  constructor(public version: string) {\n    this.initWorker();\n    this.keepAlive();\n  }\n\n  initWorker() {\n    this.initP = new Promise<void>((res) => (this.ready = res));\n    // Start from /repl so repl-sw can add COEP headers\n    this.worker = new Worker(`/repl${bundlerWorkerUrl}`, { type: 'module' });\n    this.worker.addEventListener('message', this.messageHandler);\n    this.worker.addEventListener('error', (e: ErrorEvent) => {\n      console.error(`Bundler worker for ${this.version} failed`, e.message);\n      this.terminateWorker();\n    });\n  }\n\n  messageHandler = (e: MessageEvent<OutgoingMessage>) => {\n    const { type } = e.data;\n    if (type === 'ready') {\n      const { version } = this;\n      const message: InitMessage = {\n        type: 'init',\n        version,\n        deps: getDeps(version),\n      };\n      this.worker!.postMessage(message);\n      this.ready!();\n    } else if (type === 'result' || type === 'error') {\n      const { buildId } = e.data;\n      const promise = this.buildPromises.get(buildId);\n      if (promise) {\n        this.buildPromises.delete(buildId);\n        if (type === 'result') {\n          promise.resolve(e.data.result);\n        } else {\n          const { error, stack } = e.data;\n          const err = new Error(error);\n          if (stack) {\n            err.stack = stack;\n          }\n          promise.reject(err);\n        }\n      }\n    }\n  };\n\n  keepAlive() {\n    clearTimeout(this.timer);\n    this.timer = setTimeout(() => this.terminateWorker(), 1000 * 60 * 5);\n  }\n\n  bundle(options: Omit<ReplInputOptions, 'version' | 'serverUrl'>): Promise<ReplResult> {\n    if (!this.worker) {\n      this.initWorker();\n    }\n    this.keepAlive();\n    return this.initP!.then(() => {\n      return new Promise((resolve, reject) => {\n        const buildId = this.nextBuildId++;\n        this.buildPromises.set(buildId, { resolve, reject });\n        const message: BundleMessage = {\n          type: 'bundle',\n          buildId,\n          data: options,\n        };\n        this.worker?.postMessage(message);\n      });\n    });\n  }\n\n  terminateWorker(): void {\n    if (this.worker) {\n      this.worker.removeEventListener('message', this.messageHandler);\n      this.worker.terminate();\n      this.worker = null;\n      this.buildPromises.forEach((p) => p.reject(new Error('Worker terminated')));\n      this.buildPromises.clear();\n      console.debug(`Bundler worker for ${this.version} terminated`);\n    }\n  }\n}\n\nexport const getBundler = (version: string): Bundler => {\n  let bundler = bundlers.get(version);\n  if (!bundler) {\n    bundler = new Bundler(version);\n    bundlers.set(version, bundler);\n  }\n  return bundler;\n};\n"
  },
  {
    "path": "packages/docs/src/repl/bundler/repl-ssr-worker.ts",
    "content": "// SSR Worker - handles server-side rendering execution\n// MUST be served from /repl/ so that its imports are intercepted by the REPL service worker\nimport type { QwikManifest } from '@builder.io/qwik/optimizer';\nimport type { RenderToString } from '@builder.io/qwik/server';\nimport type { ReplEvent } from '../types';\n\n// Worker message types\ninterface MessageBase {\n  type: string;\n}\n\nexport interface InitSSRMessage extends MessageBase {\n  type: 'run-ssr';\n  replId: string;\n  entry: string;\n  baseUrl: string;\n  manifest: QwikManifest | undefined;\n}\n\nexport interface SSRReadyMessage extends MessageBase {\n  type: 'ready';\n}\n\nexport interface SSRResultMessage extends MessageBase {\n  type: 'ssr-result';\n  html: string;\n  events: any[];\n}\n\nexport interface SSRErrorMessage extends MessageBase {\n  type: 'ssr-error';\n  error: string;\n  stack?: string;\n}\n\ntype IncomingMessage = InitSSRMessage;\nexport type OutgoingMessage = SSRReadyMessage | SSRResultMessage | SSRErrorMessage;\n\nlet replId: string;\n\nself.onmessage = async (e: MessageEvent<IncomingMessage>) => {\n  const { type } = e.data;\n\n  switch (type) {\n    case 'run-ssr':\n      replId = e.data.replId;\n      try {\n        const result = await executeSSR(e.data);\n        const message: SSRResultMessage = {\n          type: 'ssr-result',\n          html: result.html,\n          events: result.events,\n        };\n        self.postMessage(message);\n      } catch (error) {\n        console.error(`SSR worker for %s failed`, replId, error);\n        const message: SSRErrorMessage = {\n          type: 'ssr-error',\n          error: (error as Error)?.message || String(error),\n          stack: (error as Error)?.stack,\n        };\n        self.postMessage(message);\n      }\n      break;\n\n    default:\n      console.warn('Unknown SSR worker message type:', type);\n  }\n};\n\n// Workaround so vite doesn't try to process this import\nconst importFrom = (url: string) => {\n  return import(/*@vite-ignore*/ url);\n};\n\nasync function executeSSR(message: InitSSRMessage): Promise<{ html: string; events: any[] }> {\n  const { baseUrl, manifest, entry } = message;\n  const start = performance.now();\n\n  // We prevent Vite from touching this import() and replace it after bundling\n  const module = await importFrom(`/repl/ssr/${replId}/${entry}`);\n  const server = module.default;\n\n  const render: RenderToString = typeof server === 'function' ? server : server?.render;\n  if (typeof render !== 'function') {\n    throw new Error(`Server module ${entry} does not export default render function`);\n  }\n\n  const events: ReplEvent[] = [];\n  const orig: Record<string, any> = {};\n\n  const wrapConsole = (kind: 'log' | 'warn' | 'error' | 'debug') => {\n    orig[kind] = console[kind];\n    console[kind] = (...args: any[]) => {\n      events.push({\n        kind: `console-${kind}` as any,\n        scope: 'ssr',\n        message: args.map((a) => String(a)),\n        start: performance.now(),\n      });\n      orig[kind](...args);\n    };\n  };\n  wrapConsole('log');\n  wrapConsole('warn');\n  wrapConsole('error');\n  wrapConsole('debug');\n\n  const ssrResult = await render({\n    base: baseUrl,\n    manifest,\n    prefetchStrategy: null,\n    preloader: false,\n  });\n\n  events.push({\n    kind: 'console-log',\n    scope: 'build',\n    message: [`SSR: ${Math.round(performance.now() - start)}ms`],\n    start,\n    end: performance.now(),\n  });\n\n  // Restore console methods\n  console.log = orig.log;\n  console.warn = orig.warn;\n  console.error = orig.error;\n  console.debug = orig.debug;\n\n  return {\n    html: ssrResult.html,\n    events,\n  };\n}\n\nself.postMessage({ type: 'ready' } as SSRReadyMessage);\n"
  },
  {
    "path": "packages/docs/src/repl/bundler/rollup-plugins.ts",
    "content": "import type { Plugin } from '@rolldown/browser';\nimport type { MinifyOptions } from 'terser';\nimport { minify } from 'terser';\nimport type { PkgUrls, ReplInputOptions } from '../types';\nimport { QWIK_PKG_NAME_V1 } from '../repl-constants';\n\nexport const definesPlugin = (defines: Record<string, string>): Plugin => {\n  return {\n    name: 'repl-defines',\n    transform(code) {\n      const regex = new RegExp(Object.keys(defines).join('|'), 'g');\n      if (!regex.test(code)) {\n        return null;\n      }\n      let didReplace = false;\n      const result = code.replace(regex, (matched) => {\n        if (defines[matched]) {\n          didReplace = true;\n          return defines[matched];\n        }\n        return matched;\n      });\n      return didReplace ? { code: result, map: null } : null;\n    },\n  };\n};\n\nexport const replResolver = (\n  deps: PkgUrls,\n  options: Pick<ReplInputOptions, 'srcInputs' | 'buildMode'>,\n  target: 'client' | 'ssr'\n): Plugin => {\n  const srcInputs = options.srcInputs;\n  const getSrcPath = (id: string) => {\n    return srcInputs.find((i) => i.path === id)?.path;\n  };\n\n  const resolveQwik = (id: string, external?: true) => {\n    const path = deps[QWIK_PKG_NAME_V1][id];\n    if (!path) {\n      throw new Error(`Unknown Qwik path: ${id}`);\n    }\n    return {\n      // Make sure this matches the regexes in manifest.ts\n      id: `/qwik${id}`,\n      sideEffects: false,\n      // It would be nice to load qwik as external, but\n      // we import core and core/build so we need processing\n    };\n  };\n  const plugin: Plugin = {\n    name: 'repl-resolver',\n\n    resolveId(id, importer) {\n      // Assets and vite dev mode\n      if (id.startsWith('/assets/') || id.startsWith('/raw-fs/')) {\n        return { id: new URL(id, location.href).href, external: true };\n      }\n      if (id.startsWith('http')) {\n        return { id, external: true };\n      }\n      // re-resolve\n      if (id.startsWith('/qwik/')) {\n        return id;\n      }\n      const match = id.match(/(@builder\\.io\\/qwik|@qwik\\.dev\\/core)(.*)/);\n      if (match) {\n        const pkgName = match[2];\n\n        if (pkgName === '/build') {\n          return `/qwik/build`;\n        }\n        if (!pkgName || pkgName === '/jsx-runtime' || pkgName === '/jsx-dev-runtime') {\n          return resolveQwik('/dist/core.mjs');\n        }\n        if (pkgName === '/server') {\n          return resolveQwik('/dist/server.mjs');\n        }\n        if (pkgName.includes('/preloader')) {\n          return resolveQwik('/dist/preloader.mjs');\n        }\n        if (pkgName.includes('/qwikloader')) {\n          return resolveQwik('/dist/qwikloader.js');\n        }\n        if (pkgName.includes('/handlers')) {\n          return resolveQwik('/handlers.mjs');\n        }\n      }\n      // Simple relative file resolution\n      if (/^[./]/.test(id)) {\n        const fileId =\n          id.startsWith('.') && importer\n            ? (importer.replace(/\\/[^/]+$/, '') + '/' + id)\n                .replace(/\\/\\.\\//g, '/')\n                .replace(/\\/[^/]+\\/\\.\\.\\//g, '/')\n            : id;\n        const extensions = ['', '.tsx', '.ts', '.jsx', '.js'];\n        for (const ext of extensions) {\n          const path = getSrcPath(fileId + ext);\n          if (path) {\n            return path;\n          }\n        }\n      }\n    },\n\n    async load(id) {\n      const input = options.srcInputs.find((i) => i.path === id);\n      if (input && typeof input.code === 'string') {\n        return input.code;\n      }\n      if (id.startsWith('/qwik/')) {\n        const path = id.slice('/qwik'.length);\n        if (path === '/build') {\n          // Virtual module for Qwik build\n          const isDev = options.buildMode === 'development';\n          const isServer = target === 'ssr';\n          return `\n            export const isDev = ${isDev};\n            export const isServer = ${isServer};\n            export const isClient = ${!isServer};\n          `;\n        }\n        const url = deps[QWIK_PKG_NAME_V1][path];\n        if (url) {\n          const rsp = await fetch(url);\n          if (rsp.ok) {\n            return rsp.text();\n          }\n        }\n        throw new Error(`Unable to load Qwik module: ${path}`);\n      }\n      // We're the fallback, we know all the files\n      if (/\\.[jt]sx?$/.test(id)) {\n        throw new Error(`load: unknown module ${id}`);\n      }\n    },\n  };\n  return plugin;\n};\n\nexport const replCss = (options: Pick<ReplInputOptions, 'srcInputs'>): Plugin => {\n  const isStylesheet = (id: string) =>\n    ['.css', '.scss', '.sass', '.less', '.styl', '.stylus'].some((ext) =>\n      id.endsWith(`${ext}?inline`)\n    );\n\n  return {\n    name: 'repl-css',\n\n    resolveId(id) {\n      if (isStylesheet(id)) {\n        return id.startsWith('.') ? id.slice(1) : id;\n      }\n      return null;\n    },\n\n    load(id) {\n      if (isStylesheet(id)) {\n        const input = options.srcInputs.find((i) => i.path.endsWith(id.replace(/\\?inline$/, '')));\n        if (input && typeof input.code === 'string') {\n          return `const css = ${JSON.stringify(input.code)}; export default css;`;\n        }\n      }\n      return null;\n    },\n  };\n};\n\nexport const replMinify = (buildMode: ReplInputOptions['buildMode']): Plugin => {\n  return {\n    name: 'repl-minify',\n\n    async generateBundle(_, bundle) {\n      if (buildMode === 'production') {\n        for (const fileName in bundle) {\n          const chunk = bundle[fileName];\n          if (chunk.type === 'chunk') {\n            const result = await minify(chunk.code, TERSER_OPTIONS);\n            if (result) {\n              chunk.code = result.code!;\n            }\n          }\n        }\n      }\n    },\n  };\n};\n\nconst TERSER_OPTIONS: MinifyOptions = {\n  ecma: 2020,\n  module: true,\n  toplevel: true,\n};\n"
  },
  {
    "path": "packages/docs/src/repl/register-repl-sw.ts",
    "content": "let promise: Promise<ServiceWorkerRegistration | null> | null = null;\n\nconst _registerReplSW = async (retries = 5) => {\n  // We provide repl-sw.js via /routes/repl/repl-sw.js/entry.ts\n  try {\n    const reg = await navigator.serviceWorker.register('/repl/repl-sw.js', {\n      scope: '/repl/',\n    });\n\n    // Always listen for updates. A new installing worker can appear at any time.\n    reg.addEventListener('updatefound', () => {\n      const newWorker = reg.installing;\n      if (!newWorker) {\n        return;\n      }\n      let isRefreshing = false;\n      newWorker.addEventListener('statechange', (ev: any) => {\n        const state = ev?.target?.state;\n        // console.debug('Qwik REPL service worker installing state: %s', state);\n        if (state === 'activated') {\n          // Wait for the new worker to take control of the page before reloading.\n          const reloadWhenControlled = () => {\n            if (isRefreshing) {\n              return;\n            }\n            isRefreshing = true;\n            navigator.serviceWorker.removeEventListener('controllerchange', reloadWhenControlled);\n            window.location.reload();\n          };\n\n          if (navigator.serviceWorker.controller) {\n            // If there's already a controller, reload now.\n            reloadWhenControlled();\n          } else {\n            // Otherwise wait for controllerchange which signals the new worker controls the page.\n            navigator.serviceWorker.addEventListener('controllerchange', reloadWhenControlled);\n          }\n        } else if (state === 'redundant') {\n          // console.warn('Qwik REPL service worker became redundant during installation');\n          // If no active worker remains, try re-registering to get a new one\n          if (!reg.active) {\n            if (retries > 0) {\n              // console.debug(\n              //   `No active worker after redundancy, retrying registration (${retries} left)`\n              // );\n              return _registerReplSW(retries - 1);\n            }\n            console.warn('Max retries reached, not attempting to re-register service worker');\n            return null;\n          }\n        }\n      });\n    });\n\n    // If there's already an active worker, we're good.\n    if (reg.active) {\n      // console.debug('Qwik REPL service worker active');\n      return reg;\n    }\n\n    // If worker is waiting (installed but not activated), return registration and let\n    // the SW decide activation (skipWaiting in the SW) or the page handle it.\n    if (reg.waiting) {\n      // console.debug('Qwik REPL service worker waiting');\n      try {\n        // Ask the waiting worker to skip waiting so it can activate immediately.\n        reg.waiting.postMessage?.({ type: 'SKIP_WAITING' });\n      } catch (e) {\n        // ignore\n      }\n\n      // Wait for the new worker to take control before resolving; this prevents\n      // the page from reloading too early and creating redundant workers.\n      await new Promise<void>((resolve) => {\n        const onControllerChange = () => {\n          navigator.serviceWorker.removeEventListener('controllerchange', onControllerChange);\n          resolve();\n        };\n        navigator.serviceWorker.addEventListener('controllerchange', onControllerChange);\n      });\n\n      return reg;\n    }\n\n    // If worker is currently installing, wait for it to become activated (or redundant).\n    if (reg.installing) {\n      await new Promise<void>((resolve) => {\n        const installing = reg.installing!;\n        installing.addEventListener('statechange', function listener(ev: any) {\n          const state = ev?.target?.state;\n          // console.debug('Qwik REPL service worker installing state (wait): %s', state);\n          if (state === 'activated' || state === 'redundant') {\n            installing.removeEventListener('statechange', listener as any);\n            resolve();\n          }\n        });\n      });\n      return reg;\n    }\n\n    // Fallback: wait until a service worker is ready for this scope.\n    const readyReg = await navigator.serviceWorker.ready;\n    return readyReg;\n  } catch (err) {\n    console.error('Qwik REPL service worker registration failed:', err);\n    return null;\n  }\n};\nexport const registerReplSW = () => {\n  if (\n    typeof window === 'undefined' ||\n    !('navigator' in window) ||\n    !('serviceWorker' in navigator)\n  ) {\n    return Promise.resolve(null);\n  }\n  return (promise ||= _registerReplSW());\n};\n"
  },
  {
    "path": "packages/docs/src/repl/repl-constants.ts",
    "content": "export const QWIK_PKG_NAME_V1 = '@builder.io/qwik';\nexport const QWIK_PKG_NAME_V2 = '@qwik.dev/core';\n"
  },
  {
    "path": "packages/docs/src/repl/repl-instance.ts",
    "content": "/** Maintains the state for a REPL instance */\n\nimport { isServer, unwrapStore } from '@builder.io/qwik';\nimport { getBundler } from './bundler';\nimport { registerReplSW } from './register-repl-sw';\nimport type { RequestMessage, ResponseMessage } from './repl-sw';\nimport type { ReplAppInput, ReplResult, ReplStore } from './types';\nimport { updateReplOutput } from './ui/repl-output-update';\nimport type {\n  InitSSRMessage,\n  OutgoingMessage as SSROutgoingMessage,\n} from './bundler/repl-ssr-worker';\nimport ssrWorkerUrl from './bundler/repl-ssr-worker?worker&url';\nimport listenerScript from './bundler/client-events-listener?compiled-string';\n\nlet channel: BroadcastChannel;\nlet registered = false;\n\nexport class ReplInstance {\n  public replId: string;\n  public dirtyBundle: boolean = true;\n  public lastResult: ReplResult | null = null;\n\n  constructor(\n    public store: ReplStore,\n    public input: ReplAppInput\n  ) {\n    this.replId = store.replId;\n    if (isServer) {\n      return;\n    }\n    if (!channel!) {\n      channel = new BroadcastChannel('qwik-docs-repl');\n    }\n    channel.onmessage = (ev: MessageEvent<RequestMessage>) => {\n      if (ev.data?.type === 'repl-request' && ev.data.replId === this.replId) {\n        this.handleReplRequest(ev.data);\n      }\n    };\n  }\n\n  private buildPromise: Promise<void> | null = null;\n  private bundlePromise: Promise<void> | null = null;\n  async _ensureBundled() {\n    if (this.dirtyBundle && this.input.version) {\n      // Notice when input changed during build by changing before\n      this.dirtyBundle = false;\n      if (!registered) {\n        await registerReplSW();\n        registered = true;\n      }\n\n      this.lastResult = await this.rebuild().catch((e) => {\n        return {\n          html: `<html><h1>Build Error</h1><pre><code>${String(e).replaceAll('<', '&lt;')}</code></pre></html>`,\n          clientBundles: [],\n          ssrModules: [],\n          diagnostics: [\n            {\n              scope: 'rollup-ssr',\n              code: null,\n              message: e.message,\n              category: 'warning' as const,\n              highlights: [],\n              file: '',\n              suggestions: null,\n            },\n          ],\n          manifest: undefined,\n          buildId: 0,\n          transformedModules: [],\n          events: [],\n          isLoading: false,\n        };\n      });\n\n      if (this.dirtyBundle) {\n        setTimeout(() => this.ensureBuilt(), 50);\n      }\n    }\n  }\n\n  async _ensureSsr() {\n    if (this.lastResult) {\n      // We clear html when new SSR is needed\n      if (!this.lastResult.html) {\n        const ssrResult = await this.executeSSR(this.lastResult);\n        if (this.lastResult) {\n          this.lastResult.html = ssrResult.html;\n          if (ssrResult.events) {\n            this.lastResult.events.push(...ssrResult.events);\n          }\n        }\n      }\n      updateReplOutput(this.store, this.lastResult);\n    }\n  }\n\n  ensureBuilt() {\n    if (!this.buildPromise) {\n      const showLoader = setTimeout(() => {\n        this.store.isLoading = true;\n      }, 400);\n      this.bundlePromise = this._ensureBundled();\n      this.buildPromise = this.bundlePromise\n        .then(() => this._ensureSsr())\n        .catch((e) => {\n          console.error(e);\n          this.lastResult!.html = errorHtml(e.message, 'Build');\n          updateReplOutput(this.store, this.lastResult!);\n        })\n        .finally(() => {\n          this.buildPromise = null;\n          clearTimeout(showLoader);\n          this.store.isLoading = false;\n          console.log(\n            this.lastResult!.events.filter((e) => e.scope === 'build')\n              .map((e) => e.message)\n              .join(' | ')\n          );\n        });\n    }\n    return this.buildPromise;\n  }\n\n  private async rebuild(): Promise<ReplResult> {\n    // Get bundler for this Qwik version\n    const bundler = getBundler(this.input.version);\n    const result = await bundler.bundle({\n      replId: this.replId,\n      // You can't pass proxies to web workers\n      srcInputs: this.input.files.map(unwrapStore),\n      buildMode: this.input.buildMode,\n      entryStrategy: { type: (this.input.entryStrategy as any) || 'component' },\n      debug: this.input.debug,\n    });\n\n    updateReplOutput(this.store, result);\n\n    return result;\n  }\n\n  handleReplRequest = async (msg: RequestMessage) => {\n    const { requestId, url } = msg;\n    let error: string | null = null;\n    const fileContent = await this.getFile(url).catch((e) => {\n      error = e.message;\n      return null;\n    });\n    const status = fileContent === null ? 404 : error ? 500 : 200;\n    const statusText =\n      status === 200 ? 'OK' : status === 404 ? 'Not Found' : 'Internal Server Error';\n    const headers: Record<string, string> = {\n      'Cache-Control': 'no-store, no-cache, max-age=0',\n      // Needed for SharedArrayBuffer\n      'Cross-Origin-Opener-Policy': 'same-origin',\n      'Cross-Origin-Embedder-Policy': 'require-corp',\n    };\n    if (status === 200) {\n      headers['Content-Type'] = this.getContentType(url);\n    }\n\n    const message: ResponseMessage = {\n      type: 'repl-response',\n      requestId,\n      response: {\n        status,\n        statusText,\n        headers,\n        body: fileContent || '',\n      },\n    };\n    channel!.postMessage(message);\n  };\n\n  getContentType = (url: string): string => {\n    const noQuery = url.split('?')[0];\n    if (noQuery.endsWith('/')) {\n      return 'text/html';\n    }\n    const ext = noQuery.split('.').pop()?.toLowerCase();\n    if (ext) {\n      switch (ext) {\n        case 'js':\n        case 'mjs':\n        case 'cjs':\n          return 'application/javascript';\n        case 'json':\n          return 'application/json';\n        case 'css':\n          return 'text/css';\n        case 'html':\n        case 'htm':\n          return 'text/html';\n        case 'svg':\n          return 'image/svg+xml';\n      }\n    }\n    return 'text/plain';\n  };\n\n  async getFile(path: string): Promise<string | null> {\n    const match = path.match(/\\/repl\\/(client|ssr)\\/([a-z0-9]+)\\/(.*)/);\n    if (!match) {\n      throw new Error(`Invalid REPL path ${path}`);\n    }\n    const [, target, , filePath] = match;\n\n    const ssrPromise = this.ensureBuilt();\n    // First wait only for the bundles\n    await this.bundlePromise?.catch(() => {});\n    if (!this.lastResult) {\n      return null;\n    }\n\n    // Serve SSR modules at /server/* path\n    if (target === 'ssr') {\n      // vite adds ?import to some imports, remove it for matching\n      const serverPath = filePath.replace(/\\?import$/, '');\n      for (const module of this.lastResult.ssrModules) {\n        if (serverPath === module.path) {\n          return module.code;\n        }\n      }\n      return null;\n    }\n\n    // Serve client bundles\n    for (const bundle of this.lastResult.clientBundles) {\n      if (filePath === bundle.path) {\n        return bundle.code;\n      }\n    }\n\n    if (filePath === 'index.html' || filePath === '') {\n      // Here, also wait for SSR\n      await ssrPromise.catch(() => {});\n      if (this.lastResult.html) {\n        // Inject the event listener script\n        return this.lastResult.html + `<script>${listenerScript}</script>`;\n      }\n      return errorHtml('No HTML generated', 'REPL');\n    }\n\n    return null;\n  }\n\n  private async executeSSR(result: ReplResult): Promise<{ html: string; events?: any[] }> {\n    /**\n     * We perform SSR in a separate web worker to avoid polluting the main thread, and to prepare\n     * for routed apps, and to allow importing from the generated build with proxied import()\n     */\n    return new Promise((resolve, reject) => {\n      const entryModule = result.ssrModules.find((m) => m.path.endsWith('.js'));\n      if (!entryModule || typeof entryModule.code !== 'string') {\n        return resolve({ html: errorHtml('No SSR module found', 'SSR') });\n      }\n\n      // Start from /repl so repl-sw can intercept the requests\n      const ssrWorker = new Worker(`/repl${ssrWorkerUrl}`, { type: 'module' });\n\n      ssrWorker.onmessage = (e: MessageEvent<SSROutgoingMessage>) => {\n        const { type } = e.data;\n\n        if (type === 'ready') {\n          const initMessage: InitSSRMessage = {\n            type: 'run-ssr',\n            replId: this.replId,\n            entry: entryModule.path,\n            baseUrl: `/repl/client/${this.replId}/build/`,\n            manifest: result.manifest,\n          };\n          ssrWorker.postMessage(initMessage);\n        } else if (type === 'ssr-result') {\n          resolve({\n            html: e.data.html,\n            events: e.data.events,\n          });\n          ssrWorker.terminate();\n        } else if (type === 'ssr-error') {\n          resolve({ html: errorHtml(e.data.error, 'SSR') });\n          ssrWorker.terminate();\n        } else {\n          resolve({ html: errorHtml(`Unknown SSR worker response: ${type}`, 'SSR') });\n          ssrWorker.terminate();\n        }\n      };\n\n      ssrWorker.onerror = (error) => {\n        resolve({ html: errorHtml('Worker failed to load', 'SSR ') });\n        ssrWorker.terminate();\n      };\n    });\n  }\n\n  markDirty(): void {\n    this.dirtyBundle = true;\n    setTimeout(() => this.ensureBuilt(), 50);\n  }\n}\n\nfunction errorHtml(error: any, type: string) {\n  return `<html><h1>${type} Error</h1><pre><code>${String(error).replaceAll('<', '&lt;')}</code></pre></html>`;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/repl-sw.ts",
    "content": "/**\n * Simple proxy, proxies requests for /repl/* to the main thread\n *\n * - /repl/client/[id]/* => client-side only requests\n * - /repl/ssr/[id]/* => ssr scripts\n * - /repl/* => proxy to / with COEP headers\n *\n * This allows the REPL to load scripts from the same origin, which is required when using `COEP:\n * require-corp`, and it also allows us to still use vite for worker bundling.\n */\n\nconst channel = new BroadcastChannel('qwik-docs-repl');\n\nexport type RequestMessage = {\n  type: 'repl-request';\n  requestId: number;\n  replId: string;\n  url: string;\n};\nexport type ResponseMessage = {\n  type: 'repl-response';\n  requestId: number;\n  response: {\n    status: number;\n    statusText: string;\n    headers: Record<string, string>;\n    body: string;\n  } | null;\n};\n\nconst pendingRequests = new Map<number, { resolve: (r: Response) => void; timeoutId: any }>();\n\nlet nextId = 1;\n\n/** Intercept requests for `/repl/[id]/*` and request them over the broadcast channel */\n(self as any as ServiceWorkerGlobalScope).addEventListener('fetch', (ev: FetchEvent) => {\n  // Only GET requests\n  if (ev.request.method === 'GET') {\n    const reqUrl = new URL(ev.request.url);\n    const origin = self.location.origin;\n    if (reqUrl.origin === origin) {\n      const pathname = reqUrl.pathname;\n      const match = pathname.match(/^\\/repl\\/(client|ssr)\\/([a-z0-9]+)\\//);\n      // Only paths that look like a REPL id\n      if (match) {\n        const replId = match[2];\n        ev.respondWith(\n          new Promise((resolve) => {\n            const requestId = nextId++;\n\n            const timeoutId = setTimeout(() => {\n              if (pendingRequests.has(requestId)) {\n                pendingRequests.delete(requestId);\n                resolve(new Response('504 - Request timeout - try reloading', { status: 504 }));\n              }\n            }, 10000);\n\n            pendingRequests.set(requestId, { resolve, timeoutId });\n\n            // Send request to main thread\n            channel.postMessage({\n              type: 'repl-request',\n              requestId,\n              replId,\n              url: pathname + reqUrl.search,\n              // useful later when adding Qwik Router support\n              // method: ev.request.method,\n              // headers: Object.fromEntries(ev.request.headers.entries()),\n            });\n          })\n        );\n        return;\n      } else {\n        // Proxy other requests to / and return COEP headers\n        const url = pathname.replace(/^\\/repl\\//, '/') + reqUrl.search;\n        const req = new Request(url, {\n          method: ev.request.method,\n          headers: ev.request.headers,\n          redirect: 'manual',\n        });\n        ev.respondWith(\n          fetch(req).then((res) => {\n            // Create a new response so we can modify headers\n            const newHeaders = new Headers(res.headers);\n            newHeaders.set('Cross-Origin-Embedder-Policy', 'require-corp');\n            newHeaders.set('Cross-Origin-Opener-Policy', 'same-origin');\n            return new Response(res.body, {\n              status: res.status,\n              statusText: res.statusText,\n              headers: newHeaders,\n            });\n          })\n        );\n        return;\n      }\n    }\n  }\n\n  // Fallback to network\n  ev.respondWith(fetch(ev.request));\n});\n\n/** Receive responses for the REPL requests */\nchannel.onmessage = (ev: MessageEvent<ResponseMessage>) => {\n  const msg = ev.data;\n\n  if (msg.type === 'repl-response') {\n    const { requestId, response } = msg;\n\n    if (pendingRequests.has(requestId)) {\n      const { resolve, timeoutId } = pendingRequests.get(requestId)!;\n      pendingRequests.delete(requestId);\n      clearTimeout(timeoutId);\n\n      if (response) {\n        const res = new Response(response.body, {\n          status: response.status,\n          statusText: response.statusText,\n          headers: response.headers,\n        });\n        resolve(res);\n      } else {\n        resolve(new Response('404 - Not found', { status: 404 }));\n      }\n    }\n  }\n};\n\nself.addEventListener('install', (ev) => {\n  (self as any as ServiceWorkerGlobalScope).skipWaiting();\n});\n\nself.addEventListener('activate', (ev) => {\n  (self as any as ServiceWorkerGlobalScope).clients.claim();\n});\n"
  },
  {
    "path": "packages/docs/src/repl/types.ts",
    "content": "import type { NoSerialize, Signal } from '@builder.io/qwik';\nimport type {\n  Diagnostic,\n  QwikManifest,\n  QwikRollupPluginOptions,\n  TransformModule,\n} from '@builder.io/qwik/optimizer';\nimport type { ReplInstance } from './repl-instance';\n\nexport interface ReplAppInput {\n  files: ReplModuleInput[];\n  version: string;\n  buildMode: 'development' | 'production';\n  entryStrategy: string;\n  debug?: boolean;\n}\n\nexport type PkgUrls = { [pkgName: string]: { [path: string]: string; version: string } };\nexport interface ReplInputOptions extends Omit<QwikRollupPluginOptions, 'srcDir'> {\n  replId: string;\n  srcInputs: ReplModuleInput[];\n  version: string;\n  buildMode: 'development' | 'production';\n  debug?: boolean;\n}\n\nexport interface ReplStore {\n  replId: string;\n  html: string;\n  transformedModules: TransformModule[];\n  clientBundles: ReplModuleOutput[];\n  ssrModules: ReplModuleOutput[];\n  diagnostics: Diagnostic[];\n  monacoDiagnostics: Diagnostic[];\n  selectedInputPath: string;\n  selectedOutputPanel: OutputPanel;\n  selectedOutputDetail: OutputDetail;\n  enableHtmlOutput: boolean;\n  enableClientOutput: boolean;\n  enableSsrOutput: boolean;\n  ssrBuild: boolean;\n  debug: boolean;\n  versions: string[];\n  events: ReplEvent[];\n  isLoading: boolean;\n  reload: number;\n  instance: NoSerialize<ReplInstance> | null;\n}\n\nexport interface ReplModuleInput {\n  path: string;\n  code: string;\n  hidden?: boolean;\n}\n\nexport interface ReplModuleOutput {\n  path: string;\n  code: string;\n  size?: string;\n  shorten?: Signal<boolean>;\n}\n\nexport interface ReplEvent {\n  start: number;\n  end?: number;\n  kind:\n    | 'console-log'\n    | 'console-debug'\n    | 'console-warn'\n    | 'console-error'\n    | 'symbol'\n    | 'pause'\n    | 'resume'\n    | 'client-module'\n    | 'prefetch';\n  scope: 'ssr' | 'client' | 'build' | 'network';\n  message: string[];\n  element?: Element;\n}\n\nexport interface ReplResult {\n  buildId: number;\n  html: string;\n  transformedModules: TransformModule[];\n  clientBundles: ReplModuleOutput[];\n  ssrModules: ReplModuleOutput[];\n  manifest: QwikManifest | undefined;\n  diagnostics: Diagnostic[];\n  events: ReplEvent[];\n}\n\nexport interface ReplMessageBase {\n  type: string;\n  clientId: string;\n}\n\n// SSR Worker message types\nexport interface InitSSRMessage {\n  type: 'run-ssr';\n  replId: string;\n}\n\nexport interface ExecuteSSRMessage {\n  type: 'execute-ssr';\n  buildId: number;\n  ssrModules: ReplModuleOutput[];\n  baseUrl: string;\n  manifest: QwikManifest | undefined;\n}\n\nexport interface SSRResultMessage {\n  type: 'ssr-result';\n  buildId: number;\n  html: string;\n  events: ReplEvent[];\n}\n\nexport interface SSRErrorMessage {\n  type: 'ssr-error';\n  buildId: number;\n  error: string;\n  stack?: string;\n}\n\nexport type OutputPanel =\n  | 'app'\n  | 'html'\n  | 'segments'\n  | 'clientBundles'\n  | 'serverModules'\n  | 'diagnostics';\n\nexport type OutputDetail = 'options' | 'console';\n"
  },
  {
    "path": "packages/docs/src/repl/ui/editor.tsx",
    "content": "import {\n  component$,\n  type NoSerialize,\n  type QRL,\n  useVisibleTask$,\n  useContext,\n  useSignal,\n  useStore,\n  useTask$,\n} from '@builder.io/qwik';\nimport type { IStandaloneCodeEditor } from './monaco';\nimport {\n  addQwikLibs,\n  getEditorTheme,\n  type ICodeEditorViewState,\n  initMonacoEditor,\n  updateMonacoEditor,\n} from './monaco';\nimport type { ReplAppInput, ReplStore } from '../types';\nimport { GlobalStore } from '../../context';\n\nexport const Editor = component$((props: EditorProps) => {\n  const hostRef = useSignal<Element>();\n\n  const store = useStore<EditorStore>({\n    editor: undefined,\n    onChangeDebounce: undefined,\n    onChangeSubscription: undefined,\n    viewStates: {},\n  });\n\n  const globalStore = useContext(GlobalStore);\n\n  useVisibleTask$(async () => {\n    if (!store.editor) {\n      await initMonacoEditor(hostRef.value, props, store, props.store);\n    }\n    return () => {\n      if (store.editor) {\n        store.editor.dispose();\n      }\n    };\n  });\n\n  useVisibleTask$(({ track }) => {\n    track(() => globalStore.theme);\n    if (globalStore.theme !== 'auto') {\n      store.editor?.updateOptions({\n        theme: getEditorTheme(globalStore.theme === 'dark'),\n      });\n    }\n  });\n\n  useTask$(async ({ track }) => {\n    const v = track(() => props.input.version);\n    track(() => store.editor);\n\n    if (v && store.editor) {\n      await addQwikLibs(v);\n    }\n  });\n\n  useTask$(async ({ track }) => {\n    track(() => store.editor);\n    track(() => props.input.version);\n    track(() => props.input.files);\n    track(() => props.store.selectedInputPath);\n\n    if (props.input.version && store.editor) {\n      await updateMonacoEditor(props, store);\n    }\n  });\n\n  return <div ref={hostRef} class=\"editor-container\" />;\n});\n\nexport interface EditorProps {\n  input: ReplAppInput;\n  ariaLabel: string;\n  lineNumbers: 'on' | 'off';\n  onChange$: QRL<(path: string, code: string) => void>;\n  wordWrap: 'on' | 'off';\n  store: ReplStore;\n}\n\nexport interface EditorStore {\n  editor: NoSerialize<IStandaloneCodeEditor>;\n  onChangeDebounce: NoSerialize<any>;\n  onChangeSubscription: NoSerialize<any>;\n  viewStates: Record<string, NoSerialize<ICodeEditorViewState>>;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/index.tsx",
    "content": "import {\n  component$,\n  noSerialize,\n  useStyles$,\n  useStore,\n  useTask$,\n  useVisibleTask$,\n  $,\n  useOnWindow,\n} from '@builder.io/qwik';\nimport { ReplInputPanel } from './repl-input-panel';\nimport { ReplOutputPanel } from './repl-output-panel';\nimport styles from './repl.css?inline';\nimport type { ReplStore, ReplAppInput } from '../types';\nimport { ReplDetailPanel } from './repl-detail-panel';\nimport { getReplVersion } from './repl-version';\nimport { ReplInstance } from '../repl-instance';\n\nexport const Repl = component$((props: ReplProps) => {\n  useStyles$(styles);\n\n  const input = props.input;\n\n  const store = useStore(() => {\n    const initStore: ReplStore = {\n      replId: Math.round(Math.random() * Number.MAX_SAFE_INTEGER)\n        .toString(36)\n        .toLowerCase(),\n      html: '',\n      transformedModules: [],\n      clientBundles: [],\n      ssrModules: [],\n      diagnostics: [],\n      monacoDiagnostics: [],\n      enableClientOutput: props.enableClientOutput !== false,\n      enableHtmlOutput: props.enableHtmlOutput !== false,\n      enableSsrOutput: props.enableSsrOutput !== false,\n      selectedInputPath: '',\n      selectedOutputPanel: 'app',\n      selectedOutputDetail: 'console',\n      ssrBuild: true,\n      debug: false,\n      versions: [],\n      events: [],\n      isLoading: true,\n      instance: null,\n      reload: 0,\n    };\n    return initStore;\n  });\n\n  useTask$(({ track }) => {\n    track(() => input.files);\n\n    if (!input.files.some((i) => i.path === props.selectedInputPath) && input.files.length > 0) {\n      store.selectedInputPath = input.files[0].path;\n    }\n  });\n\n  const onInputChange$ = $((path: string, code: string) => {\n    const file = input.files.find((i) => i.path === path);\n    if (file) {\n      file.code = code;\n\n      store.instance!.markDirty();\n    }\n  });\n\n  const onInputDelete$ = $((path: string) => {\n    input.files = input.files.filter((i) => i.path !== path);\n    if (store.selectedInputPath === path) {\n      if (input.files.length > 0) {\n        store.selectedInputPath = input.files[0].path;\n      } else {\n        store.selectedInputPath = '';\n      }\n    }\n  });\n\n  useVisibleTask$(\n    async () => {\n      (store as any).instance = noSerialize(new ReplInstance(store, input));\n\n      // Get the version asap, most likely it will be cached.\n      const v = await getReplVersion(input.version, true);\n      store.versions = v.versions;\n      input.version = v.version || 'bundled';\n\n      store.instance!.markDirty();\n\n      // Now get the version from the network\n      const vNew = await getReplVersion(input.version, false);\n      store.versions = vNew.versions;\n      if (vNew.version !== input.version) {\n        input.version = v.version;\n      }\n    },\n    { strategy: 'document-ready' }\n  );\n\n  useVisibleTask$(({ track }) => {\n    track(input);\n\n    store.instance?.markDirty();\n  });\n\n  // Messages from ../bundler/client-events-listener.ts\n  useOnWindow(\n    'message',\n    $((event: MessageEvent) => {\n      if (\n        event.data &&\n        event.data.type === 'event' &&\n        event.data.replId === store.replId &&\n        event.data.event\n      ) {\n        store.events.push(event.data.event);\n      }\n    })\n  );\n\n  return (\n    <>\n      <ReplInputPanel\n        input={input}\n        store={store}\n        onInputChange$={onInputChange$}\n        onInputDelete$={onInputDelete$}\n        enableCopyToPlayground={props.enableCopyToPlayground}\n        enableDownload={props.enableDownload}\n      />\n      <ReplOutputPanel input={input} store={store} />\n      <ReplDetailPanel input={input} store={store} />\n    </>\n  );\n});\n\nexport interface ReplProps {\n  /** This has to be a Store, we keep a reference to it */\n  input: ReplAppInput;\n  selectedInputPath?: string;\n  enableHtmlOutput?: boolean;\n  enableClientOutput?: boolean;\n  enableSsrOutput?: boolean;\n  enableInputDelete?: boolean;\n  enableDownload?: boolean;\n  enableCopyToPlayground?: boolean;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/monaco.tsx",
    "content": "import { noSerialize } from '@builder.io/qwik';\nimport type { Diagnostic } from '@builder.io/qwik/optimizer';\nimport type MonacoTypes from 'monaco-editor';\nimport type { EditorProps, EditorStore } from './editor';\nimport type { ReplStore } from '../types';\nimport { getColorPreference } from '../../components/theme-toggle/theme-toggle';\nimport { bundled, getDeps, getNpmCdnUrl } from '../bundler/bundled';\nimport { isServer } from '@builder.io/qwik';\nimport { QWIK_PKG_NAME_V1, QWIK_PKG_NAME_V2 } from '../repl-constants';\nimport cssTypes from '../../../../qwik/node_modules/csstype/index.d.ts?raw';\n\nexport const initMonacoEditor = async (\n  containerElm: any,\n  props: EditorProps,\n  editorStore: EditorStore,\n  replStore: ReplStore\n) => {\n  const monaco = await getMonaco();\n  const ts = monaco.languages.typescript;\n\n  ts.typescriptDefaults.setCompilerOptions({\n    ...ts.typescriptDefaults.getCompilerOptions(),\n    allowJs: true,\n    allowNonTsExtensions: true,\n    esModuleInterop: true,\n    isolatedModules: true,\n    jsx: ts.JsxEmit.ReactJSX,\n    jsxImportSource: '@builder.io/qwik',\n    moduleResolution: ts.ModuleResolutionKind.NodeJs,\n    noEmit: true,\n    skipLibCheck: true,\n    target: ts.ScriptTarget.Latest,\n  });\n\n  ts.javascriptDefaults.setDiagnosticsOptions({\n    noSemanticValidation: true,\n    noSyntaxValidation: false,\n  });\n\n  ts.javascriptDefaults.setCompilerOptions({\n    target: ts.ScriptTarget.ESNext,\n    allowNonTsExtensions: true,\n  });\n\n  ts.javascriptDefaults.workerOptions;\n\n  const editor = monaco.editor.create(containerElm, {\n    ...defaultEditorOpts,\n    ariaLabel: props.ariaLabel,\n    lineNumbers: props.lineNumbers,\n    wordWrap: props.wordWrap,\n    model: null,\n    theme: getEditorTheme(getColorPreference() === 'dark'),\n  });\n\n  ts.typescriptDefaults.setEagerModelSync(true);\n\n  if (props.onChange$) {\n    let debounceTmrId: any = null;\n    let diagnosticsTmrId: any = null;\n\n    editorStore.onChangeSubscription = noSerialize(\n      editor.onDidChangeModelContent(async () => {\n        clearTimeout(debounceTmrId);\n        debounceTmrId = setTimeout(() => {\n          props.onChange$(props.store.selectedInputPath, editor.getValue());\n        }, 200);\n\n        clearTimeout(diagnosticsTmrId);\n        diagnosticsTmrId = setTimeout(() => {\n          checkDiagnostics(monaco, editor, replStore);\n        }, 50);\n      })\n    );\n  }\n\n  editorStore.editor = noSerialize(editor);\n};\n\nexport const updateMonacoEditor = async (props: EditorProps, editorStore: EditorStore) => {\n  const monaco = await getMonaco();\n\n  const selectedPath = props.store.selectedInputPath;\n  const inputs = props.input.files;\n  const existingModels = monaco.editor.getModels();\n\n  for (const existingModel of existingModels) {\n    try {\n      const input = inputs.find((i) => getUri(monaco, i.path).fsPath === existingModel.uri.fsPath);\n      if (input) {\n        if (input.code !== existingModel.getValue()) {\n          existingModel.setValue(input.code);\n        }\n      } else {\n        existingModel.dispose();\n      }\n    } catch (e) {\n      console.error(existingModel.uri.fsPath, e);\n    }\n  }\n\n  for (const input of inputs) {\n    try {\n      const uri = getUri(monaco, input.path);\n      const existingModel = monaco.editor.getModel(uri);\n      if (!existingModel) {\n        monaco.editor.createModel(input.code, undefined, uri);\n      }\n    } catch (e) {\n      console.error(input.path, e);\n    }\n  }\n\n  if (editorStore.editor) {\n    const selectedFsPath = getUri(monaco, selectedPath).fsPath;\n    const previousSelectedModel = editorStore.editor.getModel();\n    if (previousSelectedModel) {\n      const viewState = editorStore.editor.saveViewState();\n      if (viewState) {\n        editorStore.viewStates[previousSelectedModel.uri.fsPath] = noSerialize(viewState);\n      }\n    }\n\n    if (!previousSelectedModel || previousSelectedModel.uri.fsPath !== selectedFsPath) {\n      const selectedModel = monaco.editor.getModels().find((m) => m.uri.fsPath === selectedFsPath);\n      if (selectedModel) {\n        editorStore.editor.setModel(selectedModel);\n\n        const viewState = editorStore.viewStates[selectedModel.uri.fsPath];\n        if (viewState) {\n          editorStore.editor.restoreViewState(viewState);\n        }\n        editorStore.editor.focus();\n      }\n    }\n  }\n};\n\nexport const getEditorTheme = (isDark: boolean) => {\n  return isDark ? 'vs-dark' : 'vs';\n};\n\nconst checkDiagnostics = async (\n  monaco: Monaco,\n  editor: IStandaloneCodeEditor,\n  replStore: ReplStore\n) => {\n  if (!monacoCtx.tsWorker) {\n    const getTsWorker = await monaco.languages.typescript.getTypeScriptWorker();\n    monacoCtx.tsWorker = await getTsWorker(editor.getModel()!.uri);\n  }\n  const tsWorker = monacoCtx.tsWorker;\n\n  const models = monaco.editor.getModels();\n  const tsDiagnostics: TypeScriptDiagnostic[] = [];\n\n  await Promise.all(\n    models.map(async (m) => {\n      const filePath = `file://${m.uri.fsPath}`;\n      const semPromise = tsWorker.getSemanticDiagnostics(filePath);\n      const synPromise = tsWorker.getSyntacticDiagnostics(filePath);\n      tsDiagnostics.push(...(await semPromise));\n      tsDiagnostics.push(...(await synPromise));\n    })\n  );\n\n  if (tsDiagnostics.length > 0) {\n    replStore.monacoDiagnostics = tsDiagnostics.map((tsd) => {\n      const d: Diagnostic = {\n        message: getTsDiagnosticMessage(tsd.messageText),\n        category: 'error',\n        highlights: [],\n        code: `TSC: ${tsd.code}`,\n        file: tsd.file?.fileName || '',\n        scope: 'monaco',\n        suggestions: null,\n      };\n      return d;\n    });\n  } else if (replStore.monacoDiagnostics.length > 0) {\n    replStore.monacoDiagnostics = [];\n\n    if (replStore.selectedOutputPanel === 'diagnostics' && replStore.diagnostics.length === 0) {\n      replStore.selectedOutputPanel = 'app';\n    }\n  }\n};\n\nconst getTsDiagnosticMessage = (m: string | DiagnosticMessageChain) => {\n  if (m) {\n    if (typeof m === 'string') {\n      return m;\n    }\n    return m.messageText;\n  }\n  return '';\n};\n\nexport const addQwikLibs = async (version: string) => {\n  const monaco = await getMonaco();\n  const typescriptDefaults = monaco.languages.typescript.typescriptDefaults;\n\n  const deps = await loadDeps(version);\n  deps.forEach((dep) => {\n    if (dep && typeof dep.code === 'string') {\n      typescriptDefaults.addExtraLib(\n        `declare module '${dep.pkgName}${dep.import}' { ${dep.code}\\n }`,\n        `/node_modules/${dep.pkgName}${dep.pkgPath}`\n      );\n    }\n  });\n  typescriptDefaults.addExtraLib(\n    `declare module '@builder.io/qwik/jsx-runtime' { export * from '@builder.io/qwik' }`,\n    '/node_modules/@builder.io/qwik/dist/jsx-runtime.d.ts'\n  );\n  typescriptDefaults.addExtraLib(CLIENT_LIB);\n  typescriptDefaults.addExtraLib(cssTypes, '/node_modules/csstype/index.d.ts');\n};\n\nconst loadDeps = async (pkgVersion: string) => {\n  const deps: NodeModuleDep[] = [\n    // qwik\n    {\n      pkgName: QWIK_PKG_NAME_V1,\n      pkgVersion,\n      pkgPath: `/dist/core.d.ts`,\n      import: '',\n    },\n    // server API\n    {\n      pkgName: QWIK_PKG_NAME_V1,\n      pkgVersion,\n      pkgPath: `/dist/server.d.ts`,\n      import: '/server',\n    },\n    // build constants\n    {\n      pkgName: QWIK_PKG_NAME_V1,\n      pkgVersion,\n      pkgPath: `/dist/build/index.d.ts`,\n      import: '/build',\n    },\n    // qwik\n    {\n      pkgName: QWIK_PKG_NAME_V2,\n      pkgVersion,\n      pkgPath: `/dist/core.d.ts`,\n      import: '',\n    },\n    // server API\n    {\n      pkgName: QWIK_PKG_NAME_V2,\n      pkgVersion,\n      pkgPath: `/dist/server.d.ts`,\n      import: '/server',\n    },\n    // build constants\n    {\n      pkgName: QWIK_PKG_NAME_V2,\n      pkgVersion,\n      pkgPath: `/dist/build/index.d.ts`,\n      import: '/build',\n    },\n  ];\n\n  const depUrls = getDeps(pkgVersion);\n  const toFetch: Record<string, Promise<string>> = {};\n  for (const dep of deps) {\n    let storedDep = monacoCtx.deps.find(\n      (d) =>\n        d.pkgName === dep.pkgName && d.pkgPath === dep.pkgPath && d.pkgVersion === dep.pkgVersion\n    );\n    if (!storedDep) {\n      storedDep = {\n        pkgName: dep.pkgName,\n        pkgVersion: dep.pkgVersion,\n        pkgPath: dep.pkgPath,\n        import: dep.import,\n      };\n      monacoCtx.deps.push(storedDep);\n\n      const url = depUrls[dep.pkgName][dep.pkgPath];\n      if (!url) {\n        console.error(`Missing URL for ${dep.pkgName}${dep.pkgPath} (${dep.pkgVersion})`);\n        break;\n      }\n      toFetch[url] ||= fetch(url).then((r) => r.text());\n      toFetch[url].then(\n        (code) => {\n          storedDep!.code = code;\n        },\n        (error) => {\n          console.error(error);\n        }\n      );\n    }\n  }\n  await Promise.all(Object.values(toFetch));\n\n  return monacoCtx.deps;\n};\n\nconst getMonaco = async (): Promise<Monaco> => {\n  if (isServer) {\n    throw new Error('Monaco cannot be used on the server');\n  }\n  if (!monacoCtx.loader) {\n    // lazy-load the monaco AMD script ol' school\n    monacoCtx.loader = new Promise<Monaco>((resolve, reject) => {\n      const script = document.createElement('script');\n      script.addEventListener('error', reject);\n      script.addEventListener('load', () => {\n        require.config({ paths: { vs: MONACO_VS_URL } });\n\n        // https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs/editor/editor.main.js\n        require(['vs/editor/editor.main'], () => {\n          resolve((globalThis as any).monaco);\n        });\n      });\n      script.async = true;\n      script.src = MONACO_LOADER_URL;\n      document.head.appendChild(script);\n    });\n  }\n  return monacoCtx.loader;\n};\n\nconst getUri = (monaco: Monaco, filePath: string) => {\n  return new monaco.Uri().with({ path: filePath });\n};\n\nconst defaultEditorOpts: IStandaloneEditorConstructionOptions = {\n  automaticLayout: true,\n  lineDecorationsWidth: 5,\n  lineNumbersMinChars: 3,\n  minimap: { enabled: false },\n  roundedSelection: false,\n  scrollBeyondLastLine: false,\n  tabSize: 2,\n};\n\nconst monacoCtx: MonacoContext = {\n  deps: [],\n  loader: null,\n  tsWorker: null,\n};\n\nconst MONACO_VERSION = '0.45.0';\nconst MONACO_VS_URL = getNpmCdnUrl(bundled, 'monaco-editor', MONACO_VERSION, '/min/vs');\nconst MONACO_LOADER_URL = `${MONACO_VS_URL}/loader.js`;\n\nconst CLIENT_LIB = `\ndeclare module '*.css' {}\ndeclare module '*.css?inline' {\n  const css: string\n  export default css\n}\n`;\n\nexport type Monaco = typeof MonacoTypes;\nexport type IStandaloneCodeEditor = MonacoTypes.editor.IStandaloneCodeEditor;\nexport type ICodeEditorViewState = MonacoTypes.editor.ICodeEditorViewState;\nexport type IStandaloneEditorConstructionOptions =\n  MonacoTypes.editor.IStandaloneEditorConstructionOptions;\nexport type IModelContentChangedEvent = MonacoTypes.editor.IModelContentChangedEvent;\nexport type TypeScriptWorker = MonacoTypes.languages.typescript.TypeScriptWorker;\nexport type TypeScriptDiagnostic = MonacoTypes.languages.typescript.Diagnostic;\nexport type DiagnosticMessageChain = MonacoTypes.languages.typescript.DiagnosticMessageChain;\n\ninterface MonacoContext {\n  deps: NodeModuleDep[];\n  loader: Promise<Monaco> | null;\n  tsWorker: null | TypeScriptWorker;\n}\n\ninterface NodeModuleDep {\n  pkgName: string;\n  pkgPath: string;\n  import: string;\n  pkgVersion: string;\n  code?: string;\n}\n\ndeclare const require: any;\n\n// don't let these globals accidentally get used\n// they need to use the lazy loaded versions\ndeclare const editor: never;\ndeclare const monaco: never;\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-commands.tsx",
    "content": "import { createPlaygroundShareUrl } from './repl-share-url';\nimport type { ReplAppInput } from '../types';\n\nexport const ReplCommands = ({ input, enableCopyToPlayground }: ReplCommandProps) => {\n  return (\n    <div class=\"repl-commands\">\n      {enableCopyToPlayground ? (\n        <button\n          onClick$={() => {\n            location.href = createPlaygroundShareUrl(input);\n          }}\n          class=\"copy-to-playground\"\n          type=\"button\"\n          title=\"Copy To Playground\"\n          aria-label=\"Copy To Playground\"\n        >\n          <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n            <rect\n              x=\"128\"\n              y=\"128\"\n              width=\"336\"\n              height=\"336\"\n              rx=\"57\"\n              ry=\"57\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              stroke-linejoin=\"round\"\n              stroke-width=\"32\"\n            />\n            <path\n              d=\"M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              stroke-linecap=\"round\"\n              stroke-linejoin=\"round\"\n              stroke-width=\"32\"\n            />\n          </svg>\n          Open in Playground\n        </button>\n      ) : null}\n\n      {/* {enableDownload ? (\n        <button type=\"button\" title=\"Download\" aria-label=\"Download\">\n          <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n            <path\n              fill=\"none\"\n              stroke=\"currentColor\"\n              stroke-linecap=\"round\"\n              stroke-linejoin=\"round\"\n              stroke-width=\"32\"\n              d=\"M160 368L32 256l128-112M352 368l128-112-128-112M192 288.1l64 63.9 64-63.9M256 160v176.03\"\n            />\n          </svg>\n        </button>\n      ) : null} */}\n    </div>\n  );\n};\n\ninterface ReplCommandProps {\n  input: ReplAppInput;\n  enableCopyToPlayground?: boolean;\n  enableDownload?: boolean;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-console.tsx",
    "content": "import { component$, jsx } from '@builder.io/qwik';\nimport type { ReplEvent, ReplStore } from '../types';\n\nexport interface ReplConsoleProps {\n  store: ReplStore;\n}\nexport const ReplConsole = component$(({ store }: ReplConsoleProps) => {\n  return (\n    <div class=\"detail-logs\">\n      {store.events.map((ev, i) => (\n        <ReplLog log={ev} key={i} />\n      ))}\n    </div>\n  );\n});\n\nexport function ReplLog({ log }: { log: ReplEvent }) {\n  let elapsed = '';\n  if (log.end) {\n    elapsed = renderElapsed(log.end - log.start);\n  }\n  if (log.scope === 'build') {\n    return null;\n  }\n  switch (log.kind) {\n    case 'pause':\n      return (\n        <div class=\"line paused\">\n          <div class=\"content\">🔴 Paused in server</div>\n        </div>\n      );\n    case 'resume':\n      return (\n        <div class=\"line resumed\">\n          <div class=\"content\">🟢 Resumed in client</div>\n          {elapsed ? <div class=\"elapsed\">{elapsed}</div> : null}\n        </div>\n      );\n    case 'console-log':\n    case 'console-debug':\n    case 'console-error':\n    case 'console-warn':\n      return (\n        <div class={['log', log.kind]}>\n          <div class={['platform', log.scope]}>{log.scope}</div>\n          <div class=\"content\">{renderConsoleMessage(log.message)}</div>\n          {elapsed ? <div class=\"elapsed\">{elapsed}</div> : null}\n        </div>\n      );\n    case 'prefetch':\n      return (\n        <div class={['log', log.kind]}>\n          <div class={['platform', log.scope]}>{log.scope}</div>\n          <div class=\"content\">{log.message}</div>\n        </div>\n      );\n    case 'client-module':\n      return (\n        <div class={['log', log.kind]}>\n          <div class={['platform', log.scope]}>{log.scope}</div>\n          <div class=\"content\">{basename(log.message.join(' '))}</div>\n        </div>\n      );\n  }\n  return null;\n}\n\nconst styleprefix = '%c';\nfunction renderConsoleMessage(texts: string[]) {\n  const nodes: any[] = [];\n  for (let i = 0; i < texts.length; i++) {\n    const msg = texts[i];\n    if (msg.startsWith(styleprefix)) {\n      nodes.push(jsx('span', { style: texts[i + 1], children: msg.slice(styleprefix.length) }));\n      i++;\n    } else {\n      nodes.push(' ' + msg);\n    }\n  }\n  return nodes;\n}\n\nfunction basename(str: string) {\n  const index = str.lastIndexOf('/');\n  if (index > 0) {\n    return str.slice(index + 1);\n  }\n  return str;\n}\n\nfunction renderElapsed(millis: number) {\n  if (millis < 1000) {\n    return `${millis.toFixed(1)}ms`;\n  }\n  return `${(millis / 1000).toFixed(2)}s`;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-detail-panel.tsx",
    "content": "import { bundled } from '../bundler/bundled';\nimport { QWIK_PKG_NAME_V1 } from '../repl-constants';\nimport type { ReplAppInput, ReplStore } from '../types';\nimport { ReplConsole } from './repl-console';\nimport { ReplOptions } from './repl-options';\nimport { ReplTabButton } from './repl-tab-button';\nimport { ReplTabButtons } from './repl-tab-buttons';\n\nexport const ReplDetailPanel = ({ input, store }: ReplDetailPanelProps) => {\n  return (\n    <div class=\"repl-panel repl-detail-panel\">\n      <ReplTabButtons>\n        <ReplTabButton\n          text=\"Console\"\n          isActive={store.selectedOutputDetail === 'console'}\n          onClick$={async () => {\n            store.selectedOutputDetail = 'console';\n          }}\n        />\n        <ReplTabButton\n          text=\"Options\"\n          isActive={store.selectedOutputDetail === 'options'}\n          onClick$={async () => {\n            store.selectedOutputDetail = 'options';\n          }}\n        />\n      </ReplTabButtons>\n\n      <div class=\"repl-tab\">\n        {store.selectedOutputDetail === 'console' ? <ReplConsole store={store} /> : null}\n        {store.selectedOutputDetail === 'options' ? (\n          <ReplOptions\n            input={input}\n            versions={store.versions}\n            qwikVersion={bundled[QWIK_PKG_NAME_V1].version}\n          />\n        ) : null}\n      </div>\n    </div>\n  );\n};\n\ninterface ReplDetailPanelProps {\n  input: ReplAppInput;\n  store: ReplStore;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-input-panel.tsx",
    "content": "import type { QRL } from '@builder.io/qwik';\nimport { Editor } from './editor';\nimport { ReplCommands } from './repl-commands';\nimport { ReplTabButton } from './repl-tab-button';\nimport { ReplTabButtons } from './repl-tab-buttons';\nimport type { ReplAppInput, ReplStore } from '../types';\n\nexport const ReplInputPanel = ({\n  input,\n  store,\n  onInputChange$,\n  onInputDelete$,\n  enableCopyToPlayground,\n  enableDownload,\n  enableInputDelete,\n}: ReplInputPanelProps) => {\n  return (\n    <div class=\"repl-panel repl-input-panel\" translate=\"no\">\n      <ReplTabButtons>\n        {input.files.map((f) =>\n          f.hidden ? null : (\n            <ReplTabButton\n              key={f.path}\n              text={formatFilePath(f.path)}\n              isActive={store.selectedInputPath === f.path}\n              onClick$={async () => {\n                store.selectedInputPath = f.path;\n              }}\n              onClose$={async () => {\n                const shouldDelete = confirm(`Are you sure you want to delete \"${f.path}\"?`);\n                if (shouldDelete) {\n                  onInputDelete$(f.path);\n                }\n              }}\n              enableInputDelete={enableInputDelete}\n            />\n          )\n        )}\n        <ReplCommands\n          input={input}\n          enableCopyToPlayground={enableCopyToPlayground}\n          enableDownload={enableDownload}\n        />\n      </ReplTabButtons>\n\n      <div class=\"repl-tab\">\n        <Editor\n          input={input}\n          onChange$={onInputChange$}\n          store={store}\n          ariaLabel=\"File Input\"\n          lineNumbers=\"on\"\n          wordWrap=\"off\"\n        />\n      </div>\n    </div>\n  );\n};\n\nconst formatFilePath = (path: string) => {\n  const parts = path.split('/');\n  return parts[parts.length - 1];\n};\n\ninterface ReplInputPanelProps {\n  input: ReplAppInput;\n  store: ReplStore;\n  onInputChange$: QRL<(path: string, code: string) => void>;\n  onInputDelete$: QRL<(path: string) => void>;\n  enableDownload?: boolean;\n  enableCopyToPlayground?: boolean;\n  enableInputDelete?: boolean;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-options.tsx",
    "content": "import type { ReplAppInput } from '../types';\n\nexport const ReplOptions = ({ input, versions, qwikVersion }: ReplOptionsProps) => {\n  return (\n    <div class=\"output-detail detail-options\">\n      <StoreOption\n        label=\"Version\"\n        inputProp=\"version\"\n        options={versions}\n        labels={{ bundled: qwikVersion }}\n        input={input}\n        isLoading={versions.length === 0}\n      />\n\n      <StoreOption label=\"Mode\" inputProp=\"buildMode\" options={BUILD_MODE_OPTIONS} input={input} />\n\n      <StoreOption\n        label=\"Entry Strategy\"\n        inputProp=\"entryStrategy\"\n        options={ENTRY_STRATEGY_OPTIONS}\n        input={input}\n      />\n\n      <StoreBoolean label=\"Debug\" inputProp=\"debug\" input={input} />\n    </div>\n  );\n};\n\nconst StoreBoolean = (props: StoreBooleanProps) => {\n  return (\n    <label>\n      <span>{props.label}</span>\n      <input\n        type=\"checkbox\"\n        checked={!!props.input[props.inputProp]}\n        onChange$={(ev?: any) => {\n          const input: HTMLInputElement = ev.target;\n          (props.input as any)[props.inputProp] = input.checked;\n        }}\n      />\n    </label>\n  );\n};\n\nconst StoreOption = (props: StoreOptionProps) => {\n  return (\n    <label>\n      <span>{props.label}</span>\n      <select\n        onChange$={(ev?: any) => {\n          const select: HTMLSelectElement = ev.target;\n          (props.input as any)[props.inputProp] = select.value as any;\n        }}\n        disabled={!!props.isLoading}\n      >\n        {props.options.map((value) => (\n          <option\n            value={value}\n            selected={value === props.input[props.inputProp] ? true : undefined}\n            key={value}\n          >\n            {props.labels?.[value] || value}\n          </option>\n        ))}\n        {props.isLoading ? <option>Loading...</option> : null}\n      </select>\n    </label>\n  );\n};\n\nexport const BUILD_MODE_OPTIONS = ['development', 'production'];\n\n// We don't support `inline` and `hoist` for client bundles\nexport const ENTRY_STRATEGY_OPTIONS = ['component', 'segment', 'single', 'smart'];\n\ninterface StoreOptionProps {\n  label: string;\n  options: string[];\n  labels?: { [value: string]: string };\n  input: ReplAppInput;\n  inputProp: keyof ReplAppInput;\n  isLoading?: boolean;\n}\n\ninterface StoreBooleanProps {\n  label: string;\n  input: ReplAppInput;\n  inputProp: keyof ReplAppInput;\n}\n\ninterface ReplOptionsProps {\n  input: ReplAppInput;\n  versions: string[];\n  qwikVersion: string;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-output-modules.tsx",
    "content": "import { $, component$, createSignal, useSignal } from '@builder.io/qwik';\nimport { CodeBlock } from '../../components/code-block/code-block';\nimport type { ReplModuleOutput } from '../types';\nconst FILE_MODULE_DIV_ID = 'file-modules-client-modules';\n\nexport const ReplOutputModules = component$(({ outputs, headerText }: ReplOutputModulesProps) => {\n  const selectedPath = useSignal(outputs.length ? outputs[0].path : '');\n  const pathInView$ = $((path: string) => {\n    selectedPath.value = path;\n  });\n  return (\n    <div class=\"output-result output-modules\">\n      <div class=\"file-tree\">\n        <div class=\"file-tree-header\">{outputs.length > 0 ? headerText : ''}</div>\n        <div class=\"file-tree-items\">\n          {outputs.map((o, i) => (\n            <div key={o.path}>\n              <a\n                href=\"#\"\n                onClick$={() => {\n                  const fileItem = document.querySelector(`[data-output-item=\"${i}\"]`);\n                  if (fileItem) {\n                    fileItem.scrollIntoView({ behavior: 'smooth' });\n                  }\n                }}\n                class={{ 'in-view': selectedPath.value === o.path }}\n                preventdefault:click\n                key={o.path}\n                title={o.path}\n              >\n                {o.path}\n              </a>\n            </div>\n          ))}\n        </div>\n      </div>\n      <div class=\"file-modules\" id={FILE_MODULE_DIV_ID}>\n        {outputs.map((o, i) => {\n          const isLarge = o.code.length > 3000;\n          if (isLarge && !o.shorten) {\n            o.shorten = createSignal(true);\n          }\n          const code = o.shorten?.value ? o.code.slice(0, 3000) : o.code;\n          return (\n            <div class=\"file-item\" data-output-item={i} key={o.path}>\n              <div class=\"file-info\">\n                <span>{o.path}</span>\n                {o.size ? <span class=\"file-size\">({o.size})</span> : null}\n              </div>\n              <div class=\"file-text\">\n                <CodeBlock\n                  pathInView$={pathInView$}\n                  path={o.path}\n                  code={code}\n                  observerRootId={FILE_MODULE_DIV_ID}\n                />\n                {o.shorten && (\n                  <button onClick$={() => (o.shorten!.value = !o.shorten!.value)}>\n                    {o.shorten!.value ? 'Truncated - show more' : 'Show less'}\n                  </button>\n                )}\n              </div>\n            </div>\n          );\n        })}\n      </div>\n    </div>\n  );\n});\n\ninterface ReplOutputModulesProps {\n  headerText: string;\n  outputs: ReplModuleOutput[];\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-output-panel.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { CodeBlock } from '../../components/code-block/code-block';\nimport type { ReplAppInput, ReplStore } from '../types';\nimport { ReplOutputModules } from './repl-output-modules';\nimport { ReplOutputSymbols } from './repl-output-segments';\nimport { ReplTabButton } from './repl-tab-button';\nimport { ReplTabButtons } from './repl-tab-buttons';\n\nexport const ReplOutputPanel = component$(({ input, store }: ReplOutputPanelProps) => {\n  const diagnosticsLen = store.diagnostics.length + store.monacoDiagnostics.length;\n\n  return (\n    <div class=\"repl-panel repl-output-panel\">\n      <ReplTabButtons>\n        <ReplTabButton\n          text=\"App\"\n          isActive={store.selectedOutputPanel === 'app'}\n          onClick$={async () => {\n            store.selectedOutputPanel = 'app';\n          }}\n        />\n\n        {store.enableHtmlOutput ? (\n          <ReplTabButton\n            text=\"HTML\"\n            isActive={store.selectedOutputPanel === 'html'}\n            onClick$={async () => {\n              store.selectedOutputPanel = 'html';\n            }}\n          />\n        ) : null}\n\n        {store.enableClientOutput ? (\n          <ReplTabButton\n            text=\"Segments\"\n            isActive={store.selectedOutputPanel === 'segments'}\n            onClick$={async () => {\n              store.selectedOutputPanel = 'segments';\n            }}\n          />\n        ) : null}\n\n        {store.enableClientOutput ? (\n          <ReplTabButton\n            text=\"Client Bundles\"\n            isActive={store.selectedOutputPanel === 'clientBundles'}\n            onClick$={async () => {\n              store.selectedOutputPanel = 'clientBundles';\n            }}\n          />\n        ) : null}\n\n        {store.enableSsrOutput ? (\n          <ReplTabButton\n            text=\"SSR Module\"\n            isActive={store.selectedOutputPanel === 'serverModules'}\n            onClick$={async () => {\n              store.selectedOutputPanel = 'serverModules';\n            }}\n          />\n        ) : null}\n\n        <ReplTabButton\n          text={`Diagnostics${diagnosticsLen > 0 ? ` (${diagnosticsLen})` : ``}`}\n          cssClass={{ 'repl-tab-diagnostics': true, 'has-errors': diagnosticsLen > 0 }}\n          isActive={store.selectedOutputPanel === 'diagnostics'}\n          onClick$={async () => {\n            store.selectedOutputPanel = 'diagnostics';\n          }}\n        />\n      </ReplTabButtons>\n\n      <div\n        class={{\n          'repl-tab': true,\n          'repl-mode-production': input.buildMode === 'production',\n          'repl-mode-development': input.buildMode !== 'production',\n        }}\n      >\n        <div\n          class={{\n            'output-result': true,\n            'output-app': true,\n            'output-app-active': store.selectedOutputPanel === 'app',\n          }}\n        >\n          {store.isLoading && (\n            <div class=\"repl-loading\">\n              <svg class=\"repl-spinner\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n                <circle\n                  cx=\"50\"\n                  cy=\"50\"\n                  r=\"24\"\n                  stroke-width=\"4\"\n                  stroke-dasharray=\"37.69911184307752 37.69911184307752\"\n                  fill=\"none\"\n                  stroke-linecap=\"round\"\n                />\n              </svg>\n            </div>\n          )}\n          {store.reload > 0 && (\n            <iframe\n              key={store.reload}\n              class=\"repl-server\"\n              src={`/repl/client/${store.replId}/`}\n              sandbox=\"allow-popups allow-modals allow-scripts allow-same-origin\"\n            />\n          )}\n        </div>\n\n        {store.selectedOutputPanel === 'html' ? (\n          <div class=\"output-result output-html\">\n            <CodeBlock language=\"markup\" format code={store.html} />\n          </div>\n        ) : null}\n\n        {store.selectedOutputPanel === 'segments' ? (\n          <ReplOutputSymbols outputs={store.transformedModules} />\n        ) : null}\n\n        {store.selectedOutputPanel === 'clientBundles' ? (\n          <ReplOutputModules headerText=\"/dist/\" outputs={store.clientBundles} />\n        ) : null}\n\n        {store.selectedOutputPanel === 'serverModules' ? (\n          <ReplOutputModules headerText=\"/server/\" outputs={store.ssrModules} />\n        ) : null}\n\n        {store.selectedOutputPanel === 'diagnostics' ? (\n          <div class=\"output-result output-diagnostics\">\n            {diagnosticsLen === 0 ? (\n              <p class=\"no-diagnostics\">- No Reported Diagnostics -</p>\n            ) : (\n              [...store.diagnostics, ...store.monacoDiagnostics].map((d, key) => (\n                <p key={key}>{d.message}</p>\n              ))\n            )}\n          </div>\n        ) : null}\n      </div>\n    </div>\n  );\n});\n\ninterface ReplOutputPanelProps {\n  input: ReplAppInput;\n  store: ReplStore;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-output-segments.tsx",
    "content": "import type { TransformModule } from '@builder.io/qwik/optimizer';\nimport { CodeBlock } from '../../components/code-block/code-block';\nimport { $, component$, useSignal } from '@builder.io/qwik';\nconst FILE_MODULE_DIV_ID = 'file-modules-symbol';\n\ntype TransformModuleV2 = TransformModule & {\n  segment?: { canonicalFilename: string; paramNames: string[]; captureNames: string[] };\n};\n\nexport const ReplOutputSymbols = component$(({ outputs }: ReplOutputSymbolsProps) => {\n  const selectedPath = useSignal(outputs.length ? outputs[0].path : '');\n  const pathInView$ = $((path: string) => {\n    selectedPath.value = path;\n  });\n\n  const segments = outputs.filter((o) => !!o.segment);\n\n  return (\n    <div class=\"output-result output-modules\">\n      <div class=\"file-tree\">\n        <div class=\"file-tree-header\">Segments</div>\n        <div class=\"file-tree-items\">\n          {segments.map((o, i) => (\n            <div key={o.path}>\n              <a\n                href=\"#\"\n                onClick$={() => {\n                  const fileItem = document.querySelector(`[data-symbol-item=\"${i}\"]`);\n                  if (fileItem) {\n                    selectedPath.value = o.path;\n                    fileItem.scrollIntoView({ behavior: 'smooth' });\n                  }\n                }}\n                class={{ 'in-view': selectedPath.value === o.path }}\n                preventdefault:click\n                title={o.segment?.canonicalFilename}\n              >\n                {o.segment?.canonicalFilename}\n              </a>\n            </div>\n          ))}\n        </div>\n      </div>\n      <div class=\"file-modules\" id={FILE_MODULE_DIV_ID}>\n        {(segments as TransformModuleV2[]).map((o, i) => (\n          <div class=\"file-item\" data-symbol-item={i} key={o.path}>\n            <div class=\"file-info\">\n              <span>{o.segment?.canonicalFilename}</span>\n              {o.segment!.paramNames && (\n                <div>\n                  Params: <code>{o.segment!.paramNames.join(', ')}</code>\n                </div>\n              )}\n              {o.segment!.captureNames && (\n                <div>\n                  Captures: <code>{o.segment!.captureNames.join(', ')}</code>\n                </div>\n              )}\n            </div>\n            <div class=\"file-text\">\n              <CodeBlock\n                pathInView$={pathInView$}\n                path={o.path}\n                code={o.code}\n                observerRootId={FILE_MODULE_DIV_ID}\n              />\n            </div>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n});\n\ninterface ReplOutputSymbolsProps {\n  outputs: TransformModule[];\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-output-update.ts",
    "content": "import { unwrapStore } from '@builder.io/qwik';\nimport type { ReplResult, ReplStore } from '../types';\n\n// Maybe we should change useStore to recursively notify subscribers when a top-level property changes\nconst deepUpdate = (prev: any, next: any) => {\n  for (const key in next) {\n    if (prev[key] && typeof next[key] === 'object' && typeof prev[key] === 'object') {\n      deepUpdate(prev[key], next[key]);\n    } else {\n      if (unwrapStore(prev[key]) !== next[key]) {\n        prev[key] = next[key];\n      }\n    }\n  }\n  if (Array.isArray(prev)) {\n    if (prev.length !== next.length) {\n      prev.length = next.length;\n    }\n  } else {\n    for (const key in prev) {\n      if (!(key in next)) {\n        delete prev[key];\n      }\n    }\n  }\n};\n\nexport const updateReplOutput = async (store: ReplStore, result: ReplResult) => {\n  deepUpdate(store.diagnostics, result.diagnostics);\n  deepUpdate(store.transformedModules, result.transformedModules);\n  deepUpdate(store.clientBundles, result.clientBundles);\n  deepUpdate(store.ssrModules, result.ssrModules);\n\n  if (result.diagnostics.length === 0) {\n    if (result.html && store.html !== result.html) {\n      store.html = result.html;\n      store.events = result.events;\n      store.reload++;\n    }\n  }\n\n  if (store.selectedOutputPanel === 'diagnostics' && store.monacoDiagnostics.length === 0) {\n    store.selectedOutputPanel = 'app';\n  }\n};\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-share-url.ts",
    "content": "import { BUILD_MODE_OPTIONS, ENTRY_STRATEGY_OPTIONS } from './repl-options';\n// We use deflate because it has no metadata, just raw compression\nimport { deflateSync, inflateSync, strFromU8, strToU8 } from 'fflate';\n\nconst dataDefaults: PlaygroundShareUrl = {\n  version: '',\n  buildMode: 'development',\n  entryStrategy: 'segment',\n  files: [],\n};\nexport const parsePlaygroundShareUrl = (shareable: string) => {\n  if (typeof shareable === 'string' && shareable.length > 0) {\n    try {\n      const params = new URLSearchParams(shareable);\n      const data = { ...dataDefaults };\n\n      const version = params.get('v')! || params.get('version')!;\n      data.version =\n        typeof version === 'string' && version.split('.').length > 2 ? version : 'bundled';\n\n      const buildMode = params.get('buildMode')!;\n      if (BUILD_MODE_OPTIONS.includes(buildMode)) {\n        data.buildMode = buildMode;\n      }\n\n      const entryStrategy = params.get('entryStrategy')!;\n      if (ENTRY_STRATEGY_OPTIONS.includes(entryStrategy)) {\n        data.entryStrategy = entryStrategy;\n      }\n\n      if (params.has('files')) {\n        // Old URLs that didn't compress\n        // the files, used the `files` key\n        const filesBase64 = params.get('files')!;\n        if (typeof filesBase64 === 'string') {\n          data.files = parseUncompressedFiles(filesBase64);\n        }\n      } else if (params.has('f')) {\n        const filesBase64 = params.get('f');\n        if (typeof filesBase64 === 'string') {\n          data.files = parseCompressedFiles(filesBase64);\n        }\n      }\n      if (data.files.length > 0) {\n        return data;\n      }\n    } catch (e) {\n      console.error(e);\n    }\n    return null;\n  }\n};\n\nexport const filesToStr = (files: any[]) =>\n  files.map((f) => `${f.path.length}|${f.path}|${f.code.length}|${f.code}`).join('|');\nconst readChunk = (str: string) => {\n  const sepIdx = str.indexOf('|');\n  if (sepIdx < 1) {\n    console.error(str);\n    throw new Error(`corrupt string`);\n  }\n  const length = Number(str.slice(0, sepIdx));\n  if (isNaN(length) || str.length < sepIdx + length + 1) {\n    throw new Error('string too short');\n  }\n  const chunk = str.slice(sepIdx + 1, sepIdx + 1 + length);\n  const rest = str.slice(sepIdx + length + 2);\n  return { chunk, rest };\n};\nexport const strToFiles = (str: string) => {\n  const files = [];\n  while (str.length) {\n    const { chunk: path, rest } = readChunk(str);\n    const { chunk: code, rest: next } = readChunk(rest);\n    str = next;\n    files.push({ path, code });\n  }\n  return files;\n};\n\n// NEVER CHANGE THIS DATA or the filesToStr() output\n// Do not re-order, change or remove entries\n// This is a dictionary used for compression\n// changes will BREAK older URLs\n// You can add new entries to the beginning though.\nexport const dictionary = strToU8(\n  filesToStr([\n    {\n      path: '/app.tsx',\n      code: `import { component$ } from '@qwik.dev/core';\\n\\nexport default component$(() => {\\n  return (\\n    <div>\\n      <h1>Hello from Qwik!</h1>\\n    </div>\\n  );\\n`,\n    },\n    {\n      path: '',\n      // Extra words to help with compression\n      // generated with\n      // cat packages/docs/src/routes/examples/apps/*/*/app.tsx|sed -E 's/[^a-zA-Z0-9$_]+/\\n/g'|sort|uniq -c|sort -rn|awk '$1>=2&&length($2)>2{printf $2 \" \"}'\n      // and\n      // find packages/ -name api.json | xargs cat | jq -r '.members | map(select(.kind == \"Variable\")) | .[].name'\n      // and edited a bit\n      // DO NOT CHANGE\n      // you can NOT add new words to the end\n      // You need to add a new section like this before this section instead\n      code: `<div>  </div>  </button> props: class return ( story component$( store string state export const span type href={ page strong count useSignal< useStore< qwik import { } from searchInput console.log( searchResults builder useTask$( stories style={ news export default data </article> track onClick$= new nav map link debounced controller user useStyles$( useStylesScoped$( url title timeoutId time_ago second response Date.now() minute main item interface hour disabled aria any State update transform the target suggestion setTimeout selectedValue rotate render people number list label https:// header deg debouncedGetPeople debounce component comments_count comments clock background await new Promise args SuggestionsListComponent IStory IState IComment GrandChild Clock Child AutoComplete 360 yellow with view useVisibleTask$( true tmrId timer then swapi styles signal section search results resolve rel prev points parsedResponse null noreferrer name more length json job items isServer index github getPeople function fetch example domain dev delay css container com click clearTimeout async api _blank Star Wars API This The StoryPreview Stories ReturnType Qwik App Page Nav HackerNewsCSS AbortController server$( routeAction$( routeLoader$( useContent( useDocumentHead( useLocation( useNavigate( validator$( zod$( noSerialize(  </Slot> useComputed$( useOnDocument( useOnWindow( useResource$( useContext( useContextProvider( createContextId<`,\n    },\n    // The old default hello world app + supporting files\n    {\n      path: '/app.tsx',\n      code: `import { component$ } from '@builder.io/qwik';\\n\\nexport default component$(() => {\\n  return <p>Hello Qwik</p>;\\n});\\n`,\n    },\n    {\n      path: '/entry.server.tsx',\n      code: `import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\\nimport { Root } from './root';\\n\\nexport default function (opts: RenderOptions) {\\n  return renderToString(<Root />, opts);\\n}\\n`,\n    },\n    {\n      path: '/root.tsx',\n      code: `import App from './app';\\n\\nexport const Root = () => {\\n  return (\\n    <>\\n      <head>\\n        <title>Hello Qwik</title>\\n      </head>\\n      <body>\\n        <App />\\n      </body>\\n    </>\\n  );\\n};\\n`,\n    },\n  ])\n);\n\nexport const createPlaygroundShareUrl = (data: PlaygroundShareUrl, pathname = '/playground/') => {\n  const params = new URLSearchParams();\n  if (data.version !== 'bundled') {\n    params.set('v', data.version);\n  }\n  if (data.buildMode !== dataDefaults.buildMode) {\n    params.set('buildMode', data.buildMode);\n  }\n  if (data.entryStrategy !== dataDefaults.entryStrategy) {\n    params.set('entryStrategy', data.entryStrategy);\n  }\n\n  params.set('f', compressFiles(data.files));\n\n  return `${pathname}#${params.toString()}`;\n};\n\nexport function compressFiles(files: any[]) {\n  const filesStr = filesToStr(files);\n  const filesBuf = strToU8(filesStr);\n  const compressedUint8Array = deflateSync(filesBuf, { dictionary });\n  const compressedString = strFromU8(compressedUint8Array, true);\n  let filesBase64 = btoa(compressedString);\n  // We can remove the padding\n  if (filesBase64.endsWith('==')) {\n    filesBase64 = filesBase64.slice(0, -2);\n  } else if (filesBase64.endsWith('=')) {\n    filesBase64 = filesBase64.slice(0, -1);\n  }\n  return filesBase64;\n}\n\nfunction parseUncompressedFiles(filesBase64: string) {\n  const encoded = atob(filesBase64);\n  const filesStr = decodeURIComponent(encoded);\n  const files = JSON.parse(filesStr);\n\n  if (Array.isArray(files)) {\n    return files.filter((f) => typeof f.code === 'string' && typeof f.path === 'string');\n  }\n\n  return [];\n}\n\nexport function parseCompressedFiles(filesBase64: string) {\n  const encoded = atob(filesBase64);\n  const compressedUint8Array = strToU8(encoded, true);\n\n  let filesStr = '';\n\n  try {\n    const filesBuf = inflateSync(compressedUint8Array, { dictionary });\n    filesStr = strFromU8(filesBuf);\n  } catch (error) {\n    console.error('Could not decode URL, falling back to uncompressed');\n    // Treat string as not compressed\n    filesStr = decodeURIComponent(encoded);\n  }\n\n  return strToFiles(filesStr);\n}\n\ninterface PlaygroundShareUrl {\n  version: any;\n  buildMode: any;\n  entryStrategy: any;\n  files: any[];\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-share-url.unit.ts",
    "content": "import { strFromU8 } from 'fflate';\nimport { assert, expect, test } from 'vitest';\nimport {\n  compressFiles,\n  createPlaygroundShareUrl,\n  dictionary,\n  filesToStr,\n  parseCompressedFiles,\n  parsePlaygroundShareUrl,\n  strToFiles,\n} from './repl-share-url';\n\nconst data = {\n  version: '1.2.3',\n  buildMode: 'development',\n  entryStrategy: 'segment',\n  files: [\n    {\n      path: 'foo.js',\n      code: 'console.log(\"foo\");',\n    },\n    {\n      path: 'bar.js',\n      code: 'console.log(\"bar\");',\n    },\n  ],\n};\ntest('filesToStr', () => {\n  assert.equal(\n    filesToStr(data.files),\n    '6|foo.js|19|console.log(\"foo\");|6|bar.js|19|console.log(\"bar\");'\n  );\n});\ntest('round trip str', () => {\n  assert.deepEqual(strToFiles(filesToStr(data.files)), data.files);\n});\ntest('compressFiles', () => {\n  assert.equal(compressFiles(data.files), 'M6tJy8/XyyoGeqYGub5UAgoraVrXmNUkJRZhkwcKA+UB');\n});\ntest('parseCompressedFiles', () => {\n  assert.deepEqual(\n    parseCompressedFiles('M6tJy8/XyyoGeqYGub5UAgoraVrXmNUkJRZhkwcKA+UB'),\n    data.files\n  );\n});\ntest('round trip compressed', () => {\n  assert.deepEqual(parseCompressedFiles(compressFiles(data.files)), data.files);\n});\ntest('createPlaygroundShareUrl', () => {\n  assert.deepEqual(\n    createPlaygroundShareUrl(data),\n    '/playground/#v=1.2.3&f=M6tJy8%2FXyyoGeqYGub5UAgoraVrXmNUkJRZhkwcKA%2BUB'\n  );\n});\ntest('createPlaygroundShareUrl 2', () => {\n  assert.equal(\n    createPlaygroundShareUrl({\n      ...data,\n      buildMode: 'production',\n      entryStrategy: 'module',\n      files: [],\n    }),\n    '/playground/#v=1.2.3&buildMode=production&entryStrategy=module&f=AwA'\n  );\n});\n\ntest('dictionary is unchanged', () => {\n  const dictionaryAsString = strFromU8(dictionary);\n  // !!! THIS DICTIONARY MUST NEVER CHANGE - ONLY ALLOW PREPENDING !!!\n  expect(dictionaryAsString).toMatchInlineSnapshot(`\n    \"8|/app.tsx|149|import { component$ } from '@qwik.dev/core';\n\n    export default component$(() => {\n      return (\n        <div>\n          <h1>Hello from Qwik!</h1>\n        </div>\n      );\n    |0||1448|<div>  </div>  </button> props: class return ( story component$( store string state export const span type href={ page strong count useSignal< useStore< qwik import { } from searchInput console.log( searchResults builder useTask$( stories style={ news export default data </article> track onClick$= new nav map link debounced controller user useStyles$( useStylesScoped$( url title timeoutId time_ago second response Date.now() minute main item interface hour disabled aria any State update transform the target suggestion setTimeout selectedValue rotate render people number list label https:// header deg debouncedGetPeople debounce component comments_count comments clock background await new Promise args SuggestionsListComponent IStory IState IComment GrandChild Clock Child AutoComplete 360 yellow with view useVisibleTask$( true tmrId timer then swapi styles signal section search results resolve rel prev points parsedResponse null noreferrer name more length json job items isServer index github getPeople function fetch example domain dev delay css container com click clearTimeout async api _blank Star Wars API This The StoryPreview Stories ReturnType Qwik App Page Nav HackerNewsCSS AbortController server$( routeAction$( routeLoader$( useContent( useDocumentHead( useLocation( useNavigate( validator$( zod$( noSerialize(  </Slot> useComputed$( useOnDocument( useOnWindow( useResource$( useContext( useContextProvider( createContextId<|8|/app.tsx|114|import { component$ } from '@builder.io/qwik';\n\n    export default component$(() => {\n      return <p>Hello Qwik</p>;\n    });\n    |17|/entry.server.tsx|201|import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\n    import { Root } from './root';\n\n    export default function (opts: RenderOptions) {\n      return renderToString(<Root />, opts);\n    }\n    |9|/root.tsx|192|import App from './app';\n\n    export const Root = () => {\n      return (\n        <>\n          <head>\n            <title>Hello Qwik</title>\n          </head>\n          <body>\n            <App />\n          </body>\n        </>\n      );\n    };\n    \"\n  `);\n});\n\ntest('previous URLs still work', () => {\n  expect(parsePlaygroundShareUrl('f=G000o4mG5EQDAA')).toHaveProperty(\n    'files',\n    // DO NOT UPDATE THIS TEST - all these URLs must work forever\n    expect.arrayContaining([\n      expect.objectContaining({\n        path: '/app.tsx',\n        code: \"import { component$ } from '@builder.io/qwik';\\n\\nexport default component$(() => {\\n  return <p>Hello Qwik</p>;\\n});\\n\",\n      }),\n    ])\n  );\n  expect(\n    parsePlaygroundShareUrl(\n      'f=Q0o0xgaW2BKNDrDkqNCB15QUpyFIgKTl51uBeGA%2BKO%2BBIwaW0W1A6SI%2FDWQzyKm1wKBDVwyU0lAqUNJRqE4GFc3AqLNSCnENDlGq1QTpAGJ43a5RDa6oa0FOgBsDbxkAXQIMCqAWMIktXqqBSvRgNoNMRg7C0XQ%2FJNM9AA'\n    )\n  ).toHaveProperty(\n    'files',\n    // DO NOT UPDATE THIS TEST - all these URLs must work forever\n    expect.arrayContaining([\n      expect.objectContaining({\n        path: '/app.tsx',\n        code: `import { component$, jsx, useTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const foo:{\n    contents: ReturnType<typeof jsx>\n  } = {\n    contents: jsx(\"p\", {children:\"TEST\"})\n  }\n  useTask$(({track}) =>{\n    console.log(foo);\n  });\n  return (\n    <>\n    {foo.contents}\n    </>\n  );\n});\n`,\n      }),\n    ])\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-tab-button.tsx",
    "content": "import type { PropsOf, Component } from '@builder.io/qwik';\nimport { CloseIcon } from '../../components/svgs/close-icon';\n\nexport const ReplTabButton: Component<ReplTabButtonProps> = (props) => {\n  return (\n    <div\n      key={props.text}\n      class={{ 'active-tab': props.isActive, 'repl-tab-button': true, ...props.cssClass }}\n    >\n      <button\n        class=\"repl-tab-button-select\"\n        onClick$={props.onClick$}\n        type=\"button\"\n        preventdefault:click\n      >\n        {props.text}\n      </button>\n      {props.onClose$ && props.enableInputDelete ? (\n        <button\n          class=\"repl-tab-button-close\"\n          onClick$={props.onClose$}\n          type=\"button\"\n          preventdefault:click\n        >\n          <CloseIcon width={9} height={9} />\n        </button>\n      ) : null}\n    </div>\n  );\n};\n\ninterface ReplTabButtonProps {\n  text: string;\n  isActive: boolean;\n  onClick$: PropsOf<'button'>['onClick$'];\n  onClose$?: PropsOf<'button'>['onClick$'];\n  cssClass?: Record<string, boolean>;\n  enableInputDelete?: boolean;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-tab-buttons.tsx",
    "content": "export const ReplTabButtons = (props: ReplTabButtonsProps) => {\n  return (\n    <div class=\"repl-tab-buttons\" translate=\"no\">\n      <div class=\"repl-tab-buttons-inner\">{props.children}</div>\n    </div>\n  );\n};\n\ninterface ReplTabButtonsProps {\n  children: any;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl-version.ts",
    "content": "import { bundled } from '../bundler/bundled';\nimport { QWIK_PKG_NAME_V1 } from '../repl-constants';\n\nconst bundledVersion = bundled[QWIK_PKG_NAME_V1].version;\n\n// The golden oldies\nconst keepList = new Set('1.0.0,1.1.5,1.2.13,1.4.5'.split(','));\n\n// The bad apples - add versions that break the REPL here\nconst blockList = new Set(\n  '1.2.0,1.2.1,1.2.2,1.2.3,1.2.4,1.2.5,1.2.6,1.2.7,1.2.8,1.2.9,1.2.10,1.2.11,1.2.14,1.2.15,1.3.0,1.6.0'.split(\n    ','\n  )\n);\n\nexport const getReplVersion = async (version: string | undefined, offline: boolean) => {\n  let npmData: NpmData | null = null;\n\n  try {\n    npmData = JSON.parse(localStorage.getItem(NPM_STORAGE_KEY)!);\n    if (!offline && isExpiredNpmData(npmData)) {\n      // fetch most recent NPM version data\n      console.debug(`Qwik REPL, fetch npm data: ${QWIK_NPM_V1_DATA}`);\n      const npmData = await fetch(QWIK_NPM_V1_DATA).then((r) => r.json());\n      npmData.timestamp = Date.now();\n      const v2Data = await fetch(QWIK_NPM_V2_DATA).then((r) => r.json());\n      npmData.versions.unshift(...v2Data.versions);\n      localStorage.setItem(NPM_STORAGE_KEY, JSON.stringify(npmData));\n    } else {\n      console.debug(`Qwik REPL, using cached npm data`);\n    }\n  } catch (e) {\n    console.warn('getReplVersion', e);\n  }\n  const npmVersions = npmData?.versions || [];\n\n  let hasVersion = false;\n  let versions = npmVersions.filter((v) => {\n    if (keepList.has(v) || v === bundledVersion) {\n      // always include keepList, but we add them back later\n      return false;\n    }\n    if (v === version) {\n      hasVersion = true;\n      return true;\n    }\n    if (blockList.has(v)) {\n      // always exclude blockList\n      return false;\n    }\n    if (npmData?.tags.latest === v) {\n      // always include \"latest\"\n      return true;\n    }\n    const parts = v.split('.');\n    if (!parts[2] || /-(dev|alpha)/.test(parts[2])) {\n      // exclude dev and alpha versions\n      return false;\n    }\n    // mini-semver check, must be >= than 0.0.100\n    if (parts[0] === '0' && parts[1] === '0') {\n      if (parseInt(parts[2], 10) < 100) {\n        return false;\n      }\n    }\n    return true;\n  });\n  if (versions.length > 19 - keepList.size) {\n    versions = versions.slice(0, 19 - keepList.size);\n  }\n  versions.unshift(...keepList);\n  if (hasVersion && !versions.includes(version!)) {\n    versions.push(version!);\n  }\n  // sort by version number\n  versions.sort((a, b) => {\n    const aParts = a.split('.');\n    const bParts = b.split('.');\n    for (let i = 0; i < 3; i++) {\n      const aNum = parseInt(aParts[i], 10);\n      const bNum = parseInt(bParts[i], 10);\n      if (aNum > bNum) {\n        return -1;\n      }\n      if (aNum < bNum) {\n        return 1;\n      }\n    }\n    return 0;\n  });\n\n  versions.unshift('bundled');\n  if (!hasVersion || !version) {\n    version = 'bundled';\n  }\n\n  return { version, versions };\n};\n\nconst isExpiredNpmData = (npmData: NpmData | null) => {\n  if (npmData && typeof npmData.timestamp === 'number') {\n    if (npmData.timestamp + 1000 * 60 * 60 * 2 > Date.now()) {\n      return false;\n    }\n  }\n  return true;\n};\n\nconst QWIK_NPM_V1_DATA = `https://data.jsdelivr.com/v1/package/npm/@builder.io/qwik`;\nconst QWIK_NPM_V2_DATA = `https://data.jsdelivr.com/v1/package/npm/@qwik.dev/core`;\n\nconst NPM_STORAGE_KEY = `qwikNpmData`;\n\ninterface NpmData {\n  tags: { latest: string; next: string };\n  versions: string[];\n  timestamp: number;\n}\n"
  },
  {
    "path": "packages/docs/src/repl/ui/repl.css",
    "content": "@reference \"tailwindcss\";\n\n.repl {\n  color: var(--text-color);\n  background-color: var(--bg-color);\n}\n\n.repl-panel {\n  position: relative;\n  height: 100%;\n  max-height: 100%;\n  display: flex;\n  flex-direction: column;\n  overflow: hidden;\n}\n\n.repl-tab-buttons {\n  flex-grow: 0;\n  height: var(--repl-tab-height);\n  font-size: 14px;\n  overflow-x: auto;\n  overflow-y: hidden;\n  white-space: nowrap;\n\n  background: linear-gradient(\n    var(--repl-tab-bg-color) 0% calc(var(--repl-tab-height) - 14px),\n    var(--bg-color) 40px var(--repl-tab-height)\n  );\n}\n\n.repl-tab-buttons-inner {\n  height: calc(var(--repl-tab-height) - 14px);\n}\n\n.repl-tab {\n  position: relative;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: calc(100% - var(--repl-tab-height));\n  overflow: auto;\n}\n\n.repl-input-panel {\n  grid-area: repl-input-panel;\n}\n\n.repl-output-panel {\n  grid-area: repl-output-panel;\n}\n\n.repl-detail-panel {\n  grid-area: repl-detail-panel;\n}\n\n.repl-tab-button {\n  display: inline-block;\n  border-top: 4px solid transparent;\n  height: calc(var(--repl-tab-height) - 22px);\n  margin: 8px 0 0 0;\n  padding: 0;\n  min-width: 70px;\n  text-align: center;\n}\n\n.repl-tab-button.active-tab {\n  border-top-color: var(--repl-tab-button-active-border-color);\n  background-color: var(--bg-color);\n}\n\n.repl-tab-button:not(.active-tab):hover {\n  border-top-color: var(--repl-tab-button-hover-border-color);\n  background-color: var(--repl-tab-button-hover-bg-color);\n}\n\n.repl-commands {\n  float: right;\n  padding: 8px 15px 0 15px;\n  color: var(--repl-commands-color);\n}\n\n.repl-commands svg {\n  width: 22px;\n  height: 22px;\n}\n\n.repl-commands .copy-to-playground {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  border: 1px solid;\n  padding: 2px 8px;\n  border-radius: 5px;\n}\n\n.repl-input-panel .repl-tab-button.active-tab {\n  border-top-color: var(--repl-tab-button-input-active-border-color);\n}\n\n.repl-input-panel .repl-tab-button:not(.active-tab):hover {\n  border-top-color: var(--repl-tab-button-input-hover-border-color);\n}\n\n.repl-detail-panel .repl-tab-button.active-tab {\n  border-top-color: #4ce152;\n}\n\n.repl-detail-panel .repl-tab-button:not(.active-tab):hover {\n  border-top-color: #4ce15275;\n}\n\n.repl-tab-diagnostics.active-tab {\n  border-top-color: var(--repl-diagnostics-active-border-color);\n}\n\n.repl-tab-diagnostics.has-errors {\n  color: red;\n}\n\n.repl-tab-diagnostics:not(.active-tab):hover {\n  border-top-color: var(--repl-diagnostics-hover-border-color);\n}\n\n.repl-tab-button-select {\n  padding: 3px 12px 4px 12px;\n}\n\n.repl-tab-button-close {\n  padding: 5px 8px 5px 0;\n  margin-left: 2px;\n  opacity: 0.2;\n}\n\n.repl-tab-button-delete:hover {\n  opacity: 1;\n}\n\n.repl-output-panel .repl-tab {\n  background-color: var(--bg-color);\n\n  font-family: Menlo, Monaco, 'Lucida Console', Consolas, 'Courier New', monospace;\n  font-weight: normal;\n  font-size: 12px;\n  font-feature-settings:\n    'liga' 0,\n    'calt' 0;\n  line-height: 18px;\n  letter-spacing: 0px;\n}\n\n.output-result {\n  position: absolute;\n  top: 0;\n  right: 0;\n  width: 100%;\n  height: 100%;\n  z-index: 0;\n  background-color: var(--bg-color);\n}\n\n.output-result.output-app {\n  pointer-events: none;\n}\n\n.output-result.output-app-active {\n  z-index: 10;\n  pointer-events: auto;\n  display: block;\n}\n\n.output-app iframe {\n  position: absolute;\n  top: 0;\n  left: 10px;\n  width: calc(100% - 10px);\n  height: 100%;\n}\n\n.repl-loading {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  z-index: 20;\n  background-color: var(--bg-color);\n  border-radius: 10px;\n  width: 80px;\n  height: 80px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.repl-spinner {\n  position: absolute;\n  top: 0;\n  left: 15px;\n  width: 50px;\n  height: 50px;\n  animation: rotating 1s linear infinite;\n  z-index: 10;\n  stroke: var(--qwik-blue);\n}\n\n@keyframes rotating {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n\n.editor-container {\n  height: 100%;\n}\n\n.output-html {\n  padding: 0 15px 15px 15px;\n  height: 100%;\n  overflow: auto;\n}\n\n.output-html pre {\n  height: 100%;\n}\n\n.repl-mode-production .output-html {\n  white-space: pre-wrap;\n}\n\n@utility sm-grid-column {\n  grid-template-columns: 100%;\n}\n@utility md-grid-column {\n  grid-template-columns: minmax(200px, 25%) auto;\n}\n\n.output-modules {\n  display: grid;\n  grid-template-areas: 'repl-file-tree repl-file-text';\n  @media screen and (max-width: 768px) {\n    grid-template-areas: 'repl-file-tree' 'repl-file-text';\n  }\n\n  height: 100%;\n  overflow: hidden;\n  @apply sm-grid-column;\n  @apply md:md-grid-column;\n}\n\n.output-modules .file-tree {\n  padding: 0 15px 15px 15px;\n  grid-area: repl-file-tree;\n  overflow-y: auto;\n}\n\n.output-modules .file-tree-header {\n  font-weight: bold;\n  margin-bottom: 5px;\n}\n\n.output-modules .file-tree-items a {\n  display: block;\n  margin: 4px 0px 2px 9px;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  overflow: hidden;\n}\n\n.output-modules .file-tree-items a:hover,\n.output-modules .file-tree-items a.in-view {\n  color: var(--qwik-blue);\n}\n\n.output-modules .file-modules {\n  padding: 0 15px 15px 0;\n  grid-area: repl-file-text;\n  overflow-y: auto;\n  overflow-x: hidden;\n}\n\n.output-modules .file-item {\n  margin-bottom: 30px;\n  padding-bottom: 30px;\n  border: 1px solid rgb(33 104 170 / 15%);\n  border-radius: 2px;\n}\n\n.output-modules .file-info {\n  font-weight: bold;\n  margin-bottom: 15px;\n  background-color: rgb(33 104 170 / 15%);\n  padding: 5px 10px;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.output-modules .file-size {\n  font-weight: normal;\n  color: var(--qwik-blue);\n  padding-left: 8px;\n}\n\n.output-modules .file-text {\n  padding-left: 10px;\n  padding-right: 10px;\n  overflow-x: auto;\n}\n\n.repl-mode-production .output-modules .file-text code {\n  white-space: pre-wrap;\n}\n\n.output-diagnostics {\n  color: var(--repl-diagnostics-text-color);\n  font-weight: bold;\n  padding: 0 15px 0 15px;\n}\n\n.output-diagnostics p {\n  padding-bottom: 20px;\n}\n\n.output-diagnostics p.no-diagnostics {\n  text-align: center;\n  color: rgb(180, 180, 180);\n  font-weight: normal;\n}\n\n.details-panel {\n  grid-area: details-panel;\n}\n\n.details-tab-buttons {\n  grid-area: details-tab-buttons;\n}\n\n.details-panel {\n  grid-area: repl-details-panel;\n}\n\n.output-detail {\n  padding: 0 15px 15px 15px;\n}\n\n.detail-options label {\n  display: block;\n  margin: 10px;\n  font-size: 14px;\n}\n\n.detail-options label span {\n  font-weight: bold;\n  display: inline-block;\n  width: 130px;\n}\n\n.detail-options select {\n  background-color: var(--repl-tab-bg-color);\n  border: 1px solid var(--repl-tab-bg-color);\n  border-radius: 3px;\n}\n\n.log {\n  font-size: 14px;\n  border-bottom: 1px solid var(--repl-border-color);\n  display: flex;\n}\n\n.log > .platform {\n  width: 50px;\n  text-align: center;\n  padding: 5px 0;\n  font-size: 12px;\n  color: var(--repl-log-text);\n}\n\n.log > .platform.build {\n  background: var(--repl-log-build);\n}\n\n.log > .platform.ssr {\n  background: var(--repl-log-ssr);\n}\n\n.log > .platform.client {\n  background: var(--repl-log-client);\n}\n\n.log > .platform.network {\n  background: var(--repl-log-network);\n}\n\n.log.console-warn > .content {\n  background: var(--repl-log-warning);\n  font-weight: 500;\n}\n\n.log.console-error .content {\n  background: #d90047;\n  color: white;\n}\n\n.log.client-module > .content {\n  font-family: monospace;\n  font-size: 12px;\n}\n\n.log > .content {\n  flex: 1;\n  padding: 5px;\n  line-break: anywhere;\n  white-space: pre-wrap;\n}\n\n.line.paused,\n.line.resumed {\n  text-align: center;\n  padding: 10px 0;\n  font-size: 12px;\n  font-weight: 700;\n}\n\n.line.paused {\n  border-bottom: 2px solid var(--repl-border-color);\n}\n\n.line.resumed {\n  border-top: 2px solid var(--repl-border-color);\n}\n\n.elapsed {\n  border-radius: 5px;\n  padding: 4px;\n  font-size: 12px;\n  background: #eeeeee;\n  display: inline;\n  height: max-content;\n  margin: 0 5px;\n}\n\n.detail-logs {\n  height: 100%;\n  overflow: auto;\n  padding-bottom: 100px;\n}\n"
  },
  {
    "path": "packages/docs/src/root.tsx",
    "content": "import { component$, useContextProvider, useStore, useStyles$ } from '@builder.io/qwik';\nimport { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city';\nimport { Insights } from '@builder.io/qwik-labs';\nimport RealMetricsOptimization from './components/real-metrics-optimization/real-metrics-optimization';\nimport { RouterHead } from './components/router-head/router-head';\nimport { BUILDER_PUBLIC_API_KEY } from './constants';\nimport { GlobalStore, type SiteStore } from './context';\nimport styles from './global.css?inline';\n\nexport const uwu = /*javascript*/ `\n;(function () {\n  try {\n    var preferredUwu;\n    try {\n      preferredUwu = localStorage.getItem('uwu');\n    } catch (err) { }\n\n    const isUwuValue = window.location\n      && window.location.search\n      && window.location.search.match(/uwu=(true|false)/);\n\n    if (isUwuValue) {\n      const isUwu = isUwuValue[1] === 'true';\n      if (isUwu) {\n        try {\n          localStorage.setItem('uwu', true);\n        } catch (err) { }\n        document.documentElement.classList.add('uwu');\n        console.log('uwu mode enabled. turn off with ?uwu=false')\n        console.log('logo credit to @sawaratsuki1004 via https://github.com/SAWARATSUKI/ServiceLogos');\n      } else {\n        try {\n          localStorage.removeItem('uwu', false);\n        } catch (err) { }\n      }\n    } else if (preferredUwu) {\n      document.documentElement.classList.add('uwu');\n    }\n  } catch (err) { }\n})();\n`;\n\nexport default component$(() => {\n  useStyles$(styles);\n  const store = useStore<SiteStore>({\n    headerMenuOpen: false,\n    sideMenuOpen: false,\n    theme: 'auto',\n    pkgManager: 'pnpm',\n  });\n\n  useContextProvider(GlobalStore, store);\n\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charset=\"utf-8\" />\n        <script dangerouslySetInnerHTML={uwu} />\n        <RouterHead />\n\n        <ServiceWorkerRegister />\n\n        <script dangerouslySetInnerHTML={`(${collectSymbols})()`} />\n        <Insights publicApiKey={import.meta.env.PUBLIC_QWIK_INSIGHTS_KEY} />\n      </head>\n      <body\n        class={{\n          'header-open': store.headerMenuOpen,\n          'menu-open': store.sideMenuOpen,\n        }}\n      >\n        <RouterOutlet />\n        <RealMetricsOptimization builderApiKey={BUILDER_PUBLIC_API_KEY} />\n      </body>\n    </QwikCityProvider>\n  );\n});\n\nexport function collectSymbols() {\n  (window as any).symbols = [];\n  document.addEventListener('qsymbol', (e) =>\n    (window as any).symbols.push((e as any).detail.symbol)\n  );\n}\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/astro-qwik/index.mdx",
    "content": "---\ntitle: 'Astro + Qwik: Houston, we have Resumability!'\nauthors:\n  - Jack Shelton\ntags: ['Qwik']\ndate: 'November 8, 2023'\ncanonical: 'https://www.builder.io/blog/astro-qwik'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nHey Devs! My name is [Jack](https://twitter.com/TheJackShelton), and I am a freelance fullstack developer based in Texas. I also work on this thing called [Qwik UI](https://qwikui.com/) in my free time. 🙂\n\n## The problem\n\nIn mid-late 2022, I had the opportunity to try [Astro](https://astro.build/), a server-first, content-focused, and extremely flexible meta-framework on my day job.\n\nIt quickly became my go-to for creating landing pages, marketing websites, and even small web apps. If my clients needed something, it was almost always a click and integration guide away.\n\n![An image of a rocket on a notebook in space.](https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fed9d96db1222462b89baf4f03e80617e?width=707)\n\nAstro sites significantly outperformed the previous static site generators I had used. I appreciated the speed and found it intuitive to work with.\n\nUnfortunately, as I added more interactivity, my Astro sites began to slow down, despite Astro being the fastest meta-framework I had used up to that point!\n\nMy clients and I took notice of this. I spent a lot of time researching how to improve site speed, but in the end it always felt like an uphill battle of optimizing versus adding the stuff my clients needed.\n\n## The journey\n\nIn an ideal world, you could build your application, and it would be extremely fast, regardless of the level of interactivity or the size of your page. This appears to be an unsolvable problem. The more components we add, the slower it gets.\n\nI wondered, did it have to be this way? Is it even possible to have a fast and easy development process? Is it the [developer’s fault](https://www.builder.io/blog/dont-blame-the-developer-for-what-the-frameworks-did) when our apps are slow?\n\nLooking back, I’d say no! Developers should focus on what matters most: building the product! So, how do we solve this issue? For a while, it was a big what if. 😅\n\nThat what if quickly became a reality when I discovered Qwik’s [resumability](https://www.builder.io/blog/resumability-from-ground-up). I was 100% certain it was exactly what I was looking for.\n\nSo I did some research. I saw a lot of comparisons between the two in terms of performance. April this year I thought “why don’t we use them together?” One is a meta-framework, and the other a UI framework.\n\nWould it still be resumable?\n\nIs Astro’s partial hydration approach going to be a problem with a framework that doesn’t have [hydration](https://www.builder.io/blog/hydration-is-pure-overhead)?\n\nHow would it work with islands?\n\nWell, turns out I wasn’t the only one!\n\n![A screenshot of a Discord chat between Misko and Jack.](https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F988e08cd27f34323b77b937432ed88d5?width=707)\n\nAfter some awesome help from Misko, creator of Angular and Qwik, as well as the Astro core team, I can finally answer that question I had back in April.\n\n## Introducing @qwikdev/astro:\n\nAstro’s first resumable UI framework.\n\n### Starts fast, stays fast\n\nOne of Astro's key features is **Zero JS, by default**.\n\nUnfortunately, this is usually not the case after adding a JavaScript framework and any subsequent components.\n\nIf we want to introduce interactivity with a framework, such as React, Vue, Svelte, and so on, the framework runtime is then introduced. The number of components added to the page also increases linearly O(n) with the amount of JavaScript.\n\n### Adding Qwik\n\nQwik builds on top of Astro's **Zero JS, by default** principle and then some. Thanks to resumability, the components are not executed unless resumed. Even with interactivity, the framework is also not executed until it needs to be. [It is O(1) constant](https://www.builder.io/blog/our-current-frameworks-are-on-we-need-o1), … with zero effort on the developer.\n\n![An Illustration of hydration vs resumability.](https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F41f896cda32b43279d7c32ee6725c79f?width=707)\n\nThis integration for Astro enables resumability, fine-grained lazy loading, and many of the Qwik core stuff we know and love.\n\nThis includes all of the Astro goodies, like view transitions, MDX collections, and the hundreds of integrations that Astro provides.\n\n**So where would @qwikdev/astro make sense?**\n\nYou can use it anywhere you’re currently using a framework component in Astro! Using Qwik and resumability should significantly speed up your site.\n\n### Do Qwik components need hydration directives?\n\nShort answer, no!\n\nIn other UI frameworks, a hydration directive, such as `client:only` or `client:load`, would be needed for interactivity. However, these are not needed with Qwik because there is no hydration!\n\nWhen using Qwik inside a meta-framework like Astro or Qwik City, components are loaded on the server, prefetched in a separate thread, and \"resumed\" on the client.\n\nFor example, here's how we use a Qwik counter component in Astro.\n\n**counter.tsx**\n\n```tsx\nimport { component$, useSignal } from \"@builder.io/qwik\";\n\nexport const Counter = component$(() => {\n  const counter = useSignal(0);\n\n  return <button onClick$={() => counter.value++}>{counter.value}</button>;\n});\n```\n\n**index.astro**\n\n```tsx\n---\nimport { Counter } from \"../components/counter\";\n---\n\n<html lang=\"en\">\n  <body>\n      <h1>Astro.js - Qwik</h1>\n      /* no hydration directive! */\n      <Counter />\n  </body>\n</html>\n```\n\n### Does resumability work?\n\nYes! We can lazily execute code on interaction, just like using Qwik with Qwik City.\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F7be046307ece4278a81789e386737813%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=7be046307ece4278a81789e386737813&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nHere, we are refreshing the page, and you'll notice that nothing was executed until the button was clicked. Without resumability, our `<counter></counter>` component would have been executed on page load.\n\nThe 402 byte q-chunk is our Counter's `onClick$` handler.\n\n### What's in that 17.61kb chunk?\n\nThat's the framework! We do not execute it until it is needed. In this case, it is gzipped using SSG.\n\n**How about islands?**\n\nInstead of islands, we have Qwik containers! These fit quite well into Astro’s island model, having similar limitations.\n\nBelow is an example of a Qwik container in Astro. In the DOM, you'll notice there aren't any custom elements. This is because, to Astro, Qwik appears as static data.\n\n![Untitled](https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F1f8b5720be2b4157a614b754abd8f041?width=707)\n\nThis is just the beginning! You can try out the integration in Alpha today, by running:\n\n```bash\nnpx astro add @qwikdev/astro\n```\n\n> This integration is currently in Alpha release. We encourage you to try it and share your feedback.<br></br>If you run into any problems, open up an issue in our [GitHub Repository](https://github.com/QwikDev/astro/issues).\n\nYou can also view the package on [NPM](https://www.npmjs.com/package/@qwikdev/astro), [Github](https://github.com/QwikDev/astro), [Qwik integration page](https://qwik.dev/docs/integrations/astro/), and the [Astro integration page](https://astro.build/integrations/?search=qwik).<br></br>\nJoin the fun and [contribute](https://github.com/QwikDev/astro/blob/main/contributing.md)!\n\nStay awesome devs,\n\n-Jack\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/fontless/index.mdx",
    "content": "---\ntitle: 'Effortlessly optimize web fonts with fontless.'\nauthors:\n  - 'Giorgio Boa'\ntags: ['Web development', 'Fontaine', 'Qwik']\ndate: 'August 26, 2025'\ncanonical: 'https://qwik.dev/blog/fontless'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport { Image } from 'qwik-image';\nimport firstMeeting from './first-meeting.webp';\nimport secondMeeting from './second-meeting.webp';\n\n<ArticleBlock>\n\n<br/>\n<br/>\n\n## Zero-runtime CSS solution\n\nZero-runtime CSS solution for Google Fonts, Bunny Fonts, and more. Reduce CLS and boost performance.<br/>\nSome time ago, we came across an impressive library called [Fontaine](https://github.com/unjs/fontaine), created and maintained by the talented [Daniel Roe](https://github.com/danielroe).\n\nThe idea behind the library is to optimize the way [Nuxt](https://nuxt.com/) developers use fonts by providing a similar native font while the font files are being downloaded, \nso when the switch to the actual font happens - the “glitch” will be minimal, and by that reducing the bad CLS score on google core web vitals.\n\nOut of curiosity, we attempted to integrate it into a Qwik project and noticed there could be an opportunity to make it framework agnostic.\n\n> After diving into the source code, we figured out pretty quickly that the core of the library is generic enough and can be adopted by all the frameworks powered by [Vite](https://vite.dev/).\n\nMotivated by this idea, we decided to join forces - the Nuxt and Qwik teams and to create an open-source library as a Vite plugin that will benefit all frameworks. \n\n<br/>\n<Image class=\"mx-auto\" src={firstMeeting} alt=\"First meeting between NUXT and QWIK ❤️\" />\n<br/>\n\nDaniel Roe was super generous to provide the product of his hard work and to extract it into a generic mutual core and we had a wonderful time  collaborating  with him for the good of the JavaScript community.\n\nAfter a few weeks of hard work, [Damian Pumar](https://github.com/damianpumar) had the solution up and running in his local machine.<br/> \nIt was incredible to see how smooth the integration is with pretty much all the frameworks.<br/>\n\n<br/>\n<Image class=\"mx-auto\" src={secondMeeting} alt=\"Second meeting between NUXT and QWIK 🍰\" />\n<br/>\n\nWe'd like to thank Daniel Roe, the Nuxt team and the [unjs](https://unjs.io/) project for helping us make this vision of making this brilliant work of Daniel on font optimization available for all frameworks.\n\nThis is a great example of how the shared vision of “automatic optimization” for the web comes into fruition.\n\nAutomatic font optimization? Yes, please! Say goodbye to CLS issues with Fontless. [Install it now](https://www.npmjs.com/package/fontless)!\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/framer-motion-qwik/index.mdx",
    "content": "---\ntitle: 'Building Framer Motion Animations Inside a Qwik Application'\nauthors:\n  - 'Yoav Ganbar'\ntags: ['Web development']\ndate: 'March 21, 2023'\ncanonical: 'https://www.builder.io/blog/framer-motion-qwik'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nAnimations are one of the coolest things you can add to your site to make it pop and be different than the rest of the cohort.\n\nYou can do most animations with CSS, but you have to know a lot to get good results.\n\nThat is why a lot of people in the React ecosystem love [Framer Motion](https://www.framer.com/motion/).\n\nIt has a clear, declarative, and concise API that makes it a joy to build animations on the web.\n\n## Advantages of using Framer Motion\n\nFramer Motion is a powerful animation library that can create smooth and beautiful animations on web pages. Here are some of the advantages of using Framer Motion:\n\n- **User-friendly**: Framer Motion has an intuitive API that makes it easy to create animations, even for those new to animation.\n- **Declarative**: Framer Motion uses a declarative syntax that clarifies what is happening in your animations.\n- **Customizable**: Framer Motion provides a wide range of customizable options that help you create animations that fit your specific needs.\n- **Performance**: Framer Motion is optimized for performance, so you can create complex animations without worrying about slowing down your site.\n- **Community**: Framer Motion has a large and active community that provides support and resources to help you get the most out of the library.\n\n## Integration with Qwik\n\n> You can find the code in this post on [GitHub](https://github.com/BuilderIO/qwik-react-framer-motion).\n\nI’ve previously written about [how to run React inside Qwik](https://www.builder.io/blog/resumable-react-how-to-use-react-inside-qwik), but here’s a TLDR; refresher:\n\n1.  Start a new Qwik app: `pnpm create qwik@latest`\n2.  Add React integration: `pnpm run qwik add react`\n\nThen we can add `framer-motion`:\n\n```bash\npnpm install framer-motion\n```\n\nNow we can write a React component with `framer-motion`.\n\n## Creating a “Qwikified” component\n\nIt’s pretty straightforward. Let’s say we have this code:\n\n```tsx\nimport { motion } from \"framer-motion\";\n\nconst MyComponent = () => {\n  return (\n    <motion.div\n      animate={{\n      scale: [1, 2, 2, 1, 1],\n      rotate: [0, 0, 270, 270, 0],\n      borderRadius: ['20%', '20%', '50%', '50%', '20%'],\n      backgroundColor: ['#ff008c', '#d309e1', '#9c1aff', '#7700ff', '#ff008c'],\n      transition: { duration: 2 },\n    }}\n      className=\"h-52 w-52 rounded-sm bg-green-500\"\n    />\n  );\n};\n```\n\nAll we need to do to “Qwikify” it is:\n\n```tsx\n// FILE: src/integrations/react/framer.tsx\n// ==========================================\n\n// 👇🏽 this tells Qwik that the JSX here is React\n/** @jsxImportSource react */\n\nimport { motion } from \"framer-motion\";\n\n// one function to import \nimport { qwikify$ } from '@builder.io/qwik-react';\n\nconst MyComponent = () => (\n  <motion.div\n    animate={{\n      scale: [1, 2, 2, 1, 1],\n      rotate: [0, 0, 270, 270, 0],\n      borderRadius: ['20%', '20%', '50%', '50%', '20%'],\n      backgroundColor: ['#ff008c', '#d309e1', '#9c1aff', '#7700ff', '#ff008c'],\n      transition: { duration: 2 },\n    }}\n    className=\"h-52 w-52 rounded-sm bg-green-500\"\n  />\n);\n\n// All you need is to export:\nexport const FramerQwik = qwikify$(MyComponent);\n```\n\nWith the help of our good old friend GitHub Copilot, let’s break it down:\n\n1.  Import the `qwikify$` function from `@builder.io/qwik-react`.\n2.  Import the `motion` component from `framer-motion`.\n3.  Create a `MyComponent` functional component that returns a `div` element.\n4.  Pass the `animate` prop to the `motion.div` element.\n5.  Pass an object as the value of the animate prop that contains the animation properties.\n6.  Pass the `className` prop to the `motion.div` element.\n7.  Export the component using `qwikify$` function.\n\nThen we can use it in a Qwik app:\n\n```tsx\n// FILE: src/routes/index.tsx\n// ==========================================\n\nimport { component$ } from '@builder.io/qwik';\nimport { FramerQwik } from '~/integrations/react/framer';\n\nexport default component$(() => {\n  return (\n    <div class=\"flex flex-col gap-4\">\n      <h1 class=\"text-3xl\">Qwik/React Framer Motion</h1>\n      <div class=\"grid place-content-center\">\n        <FramerQwik client:idle />\n      </div>\n    </div>\n  );\n});\n```\n\nNote in the above example, we use `client:idle` which is a directive as to when to hydrate a React component. This tells Qwik to wait for the browser `idle` event and only then hydrate React, resulting in a React island within the Qwik ocean.\n\nHow about something more complicated?\n\n### React Framer Motion Image gallery inside Qwik\n\nLet’s take an example from the `framer-motion` docs and convert it to a Qwik component.\n\n#### Little image gallery example:\n\nLet’s create a new file: `src/integrations/react/image-gallery.tsx`.\n\nWe’ll put it all in one file except for the CSS which I’ll just drop in `src/global.css`.\n\n```tsx\n/** @jsxImportSource react */\n\nimport { useState } from 'react';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { wrap } from 'popmotion';\nimport { qwikify$ } from '@builder.io/qwik-react';\n\nconst images = [\n  'https://d33wubrfki0l68.cloudfront.net/dd23708ebc4053551bb33e18b7174e73b6e1710b/dea24/static/images/wallpapers/shared-colors@2x.png',\n  'https://d33wubrfki0l68.cloudfront.net/49de349d12db851952c5556f3c637ca772745316/cfc56/static/images/wallpapers/bridge-02@2x.png',\n  'https://d33wubrfki0l68.cloudfront.net/594de66469079c21fc54c14db0591305a1198dd6/3f4b1/static/images/wallpapers/bridge-01@2x.png',\n];\n\nconst variants = {\n  enter: (direction: number) => {\n    return {\n      x: direction > 0 ? 1000 : -1000,\n      opacity: 0,\n    };\n  },\n  center: {\n    zIndex: 1,\n    x: 0,\n    opacity: 1,\n  },\n  exit: (direction: number) => {\n    return {\n      zIndex: 0,\n      x: direction < 0 ? 1000 : -1000,\n      opacity: 0,\n    };\n  },\n};\n\nconst swipeConfidenceThreshold = 10000;\nconst swipePower = (offset: number, velocity: number) => {\n  return Math.abs(offset) * velocity;\n};\n\nexport const Example = () => {\n  const [[page, direction], setPage] = useState([0, 0]);\n\n  const imageIndex = wrap(0, images.length, page);\n\n  const paginate = (newDirection: number) => {\n    setPage([page + newDirection, newDirection]);\n  };\n\n  return (\n    <div className='framer-gallery'>\n      <AnimatePresence initial={false} custom={direction}>\n        <motion.img\n          key={page}\n          src={images[imageIndex]}\n          custom={direction}\n          variants={variants}\n          initial=\"enter\"\n          animate=\"center\"\n          exit=\"exit\"\n          transition={{\n            x: { type: 'spring', stiffness: 300, damping: 30 },\n            opacity: { duration: 0.2 },\n          }}\n          drag=\"x\"\n          dragConstraints={{ left: 0, right: 0 }}\n          dragElastic={1}\n          onDragEnd={(e, { offset, velocity }) => {\n            const swipe = swipePower(offset.x, velocity.x);\n\n            if (swipe < -swipeConfidenceThreshold) {\n              paginate(1);\n            } else if (swipe > swipeConfidenceThreshold) {\n              paginate(-1);\n            }\n          }}\n        />\n      </AnimatePresence>\n      <div className=\"next\" onClick={() => paginate(1)}>\n        {'‣'}\n      </div>\n      <div className=\"prev\" onClick={() => paginate(-1)}>\n        {'‣'}\n      </div>\n    </div>\n  );\n};\n\nexport const ImageGallery = qwikify$(Example);\n```\n\nAt this point all we have to do is import the component in our `src/routes/index.tsx` and decide how to load it:\n\n```tsx\n// FILE: src/routes/index.tsx\n// ==========================================\n\nimport { component$ } from '@builder.io/qwik';\nimport { FramerQwik } from '~/integrations/react/framer';\nimport { ImageGallery } from '~/integrations/react/image-gallery';\n\nexport default component$(() => {\n  return (\n    <div class=\"flex flex-col gap-4\">\n      <h1 class=\"text-3xl\">Qwik/React Framer Motion</h1>\n      <div class=\"grid place-content-center\">\n        <FramerQwik client:idle />\n      </div>\n      <ImageGallery client:visible />\n    </div>\n  );\n});\n```\n\nOne thing to note is the slight difference from the original CodeSandbox is that I've changed the fragment (`<>`) to a\n\nwith a `className` just to make styling easier. Otherwise, in case of the component, we’ve added the `client:visible` loading strategy to hydrate this React island only when the gallery is visible in the viewport.\n\nThis is what it looks like:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fc0bae22d9a4c40ec8029514921b30ccc%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=c0bae22d9a4c40ec8029514921b30ccc&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nEverything works!\n\nOne of the coolest parts here (at least to nerdy me 😅) is that the code for the gallery only executes when it’s in view.\n\nCheck it out (notice the Network tab):\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fe285870471984c5c9b9614087358294b%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=e285870471984c5c9b9614087358294b&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Bonus: “Motion One” an alternative to `framer-motion`\n\nUsing `framer-motion` is cool and all, but it comes with the cost of importing React and hydration.\n\nWhat if I told you that there’s an animation library that is just as performant as Framer, weighs less, and has a very similar API?\n\nAlso, it was created by the same person that built `framer-motion` (and [Pose](https://popmotion.io/pose/), and [Popmotion](https://popmotion.io/pose/)) — [Matt Perry](https://github.com/mattgperry)!\n\nI’m talking about [Motion One](https://motion.dev/).\n\nThis is not a React library, but a Vanilla JS animation library that is built for performance and has a very low bundle footprint of 3.8Kb.\n\nMotion One has all the same bells and whistles that framer has, integrations with Solid & Vue. [Get started](https://motion.dev/docs/quick-start).\n\nNeed I say more?\n\n### Qwik Motion One example\n\nThough this doesn’t have a Qwik SDK, let’s see how we’d add a basic animation with it.\n\nBecause this library is pure JS, we can use a Qwik method, `useVisibleTask()`, to run this code only in the browser, as in the example below:\n\n```tsx\nimport { component$, useVisibleTask$ } from '@builder.io/qwik';\nimport { animate } from 'motion';\n\nexport default component$(() => {\n  useVisibleTask$(() => {\n    animate(\n      '#animation-target',\n      {\n        scale: [1, 2, 2, 1, 1],\n        rotate: [0, 0, 270, 270, 0],\n        borderRadius: ['20%', '20%', '50%', '50%', '20%'],\n        backgroundColor: [\n          '#ff008c',\n          '#d309e1',\n          '#9c1aff',\n          '#7700ff',\n          '#ff008c',\n        ],\n      },\n      {\n        duration: 2,\n        easing: 'ease-in-out',\n        repeat: 2,\n        direction: 'alternate',\n      }\n    );\n  });\n  return (\n    <div\n      id=\"animation-target\"\n      // Some tailwind styling for sizing and initial color\n      class=\"m-auto mt-24 w-52 h-52 bg-slate-500\"\n    ></div>\n  );\n});\n\nfunction yuval() { }\n```\n\nWe’re using the same values for the animation, as in the `framer-motion` example. However, we pass the values as an object.\n\nAlso notice that the third argument to the `animate` function is where the options go, unlike in `framer` where there’s a `transition` key that gets passed down in the `animate` prop.\n\n## Conclusion\n\nIn this post I’ve shown how we can use both `framer-motion` and `Motion One` inside a Qwik application.\n\nUsing powerful animation libraries with such little friction is a huge win in my view.\n\nIf you are already versed with `framer-motion`, there’s very little friction in just adding the same animations you may have already built in a React application.\n\nHaving this option might help with incremental adoption of Qwik in cases in which both performance and beautiful motion design are paramount.\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/introducing-qwik-starters/index.mdx",
    "content": "---\ntitle: 'Introducing Qwik starters - get up and running with Qwik now'\nauthors:\n  - 'Miško Hevery'\ntags: ['Qwik']\ndate: 'December 14, 2021'\ncanonical: 'https://www.builder.io/blog/introducing-qwik-starters'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nNothing is more satisfying than playing with code and discovering new things! Yes, it is finally here, `npm init qwik` for you to try and discover a different way to build web apps that stay lean and performant no matter their size. It is the same technology that is powering [builder.io](https://www.builder.io) and gets [100/100 PageSpeed](https://www.builder.io/blog/how-we-cut-99-percent-js-with-qwik-and-partytown).\n\nQwik starter CLI is a simple starter for you to try experimenting with Qwik first hand and to get a better understanding of just how different it is.\n\nThe CLI consist of these four examples, that will be expanded in the near future:\n\n1.  `starter`: A basic hello world.\n2.  `starter-builder`: A basic hello world integrated with Builder's [Qwik API](https://www.builder.io/c/docs/qwik-api).\n3.  `starter-partytown`: A basic hello world showing how expensive tasks can be run on web-worker with [Partytown](https://github.com/QwikDev/partytown)\n4.  `todo`: A classic [TodoMVC](https://todomvc.com/) application.\n\n## Basic Starter\n\n```shell\n> npm init qwik\n💫 Let's create a Qwik project 💫\n\n✔ Project name … qwik-starter\n✔ Select a starter › Starter\n✔ Select a server › Express\n\n⭐️ Success! Project saved in qwik-starter directory\n\n📟 Next steps:\n  cd qwik-starter\n  npm install\n  npm start\n\n> (cd qwik-starter; npm install; npm start)\n```\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F17ab71fc12be4fbb9a8b19415998995f?width=800\" alt=\"starter app\" />\n\nTry it in [StackBlitz](https://stackblitz.com/edit/qwik-starter).\n\n## Starter with Builder Qwik API\n\n```shell\n> npm init qwik\n💫 Let's create a Qwik project 💫\n\n✔ Project name … qwik-builder\n✔ Select a starter › Starter Builder\n✔ Select a server › Express\n\n⭐️ Success! Project saved in qwik-builder directory\n\n📟 Next steps:\n  cd qwik-builder\n  npm install\n  npm start\n\n> (cd qwik-builder; npm install; npm start)\n```\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F8c4425a663a84a41a85555f53f2665fc?width=800\" alt=\"qwik builder app\" />\n\nTry it in [StackBlitz](https://stackblitz.com/edit/qwik-todo-builder).\n\n## Starter with Partytown\n\n```shell\n> npm init qwik\n💫 Let's create a Qwik project 💫\n\n✔ Project name … qwik-partytown\n✔ Select a starter › Starter Partytown\n✔ Select a server › Express\n\n⭐️ Success! Project saved in qwik-partytown directory\n\n📟 Next steps:\n  cd qwik-partytown\n  npm install\n  npm start\n\n> (cd qwik-partytown; npm install; npm start)\n```\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F00c19642f9ac4f618f0d7356b9bc46cf?width=800\" alt=\"qwik partytown app\" />\n\n## Classic TodoMVC\n\n```shell\n> npm init qwik\n💫 Let's create a Qwik project 💫\n\n✔ Project name … qwik-todo\n✔ Select a starter › Todo\n✔ Select a server › Express\n\n⭐️ Success! Project saved in qwik-todo directory\n\n📟 Next steps:\n  cd qwik-todo\n  npm install\n  npm start\n\n> (cd qwik-todo; npm install; npm start)\n```\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fc7c0ea671c4547ecb2cd7da50843b97f?width=800\" alt=\"qwik todo app\" />\n\nTry it in [StackBlitz](https://stackblitz.com/edit/qwik-todo-demo).\n\n## Profile away\n\nWe encourage you to open the dev tools and put all of the examples through the profiler to see how little time is spent on the main thread.\n\nHappy coding and please provide feedback 🚀\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/module-extraction-the-silent-web-revolution/index.mdx",
    "content": "---\ntitle: 'Code Extraction: The Silent Web Revolution'\nauthors:\n  - 'Manu Mtz.-Almeida'\ntags: ['Qwik']\ndate: 'February 21, 2023'\ncanonical: 'https://www.builder.io/blog/module-extraction-the-silent-web-revolution'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nCode or Module Extraction is the new silent revolution of the web happening right now.\n\nBundling tooling in JS, like Webpack, Rollup and Vite do one thing very well: **merge modules and remove what's not used** (tree-shaking), but they have no clue how to split code automatically. **Code splitting is not what you think it is.**\n\nUndoubtedly, putting things together takes less energy; even the [2nd law of thermodynamics](https://en.wikipedia.org/wiki/Second_law_of_thermodynamics) states this. Separating things is much harder.\n\n> In opposition to nuclear physics, web tooling solved **fusion** (merge) years ago. The hard part here is **fission** (split).\n\n## What module extraction really is\n\nModern meta frameworks such as Qwik, Remix, Solid Start, and Next 13 are already doing module extraction without you knowing. The main use case is allowing developers to write server- and client-side in the same module.\n\nModule Extraction radically differs from code splitting because developers are not doing it explicitly by creating a new module or dynamic import. Instead, the meta-framework uses internal rules and custom transforms to **extract** parts of the source code into different **modules that can execute independently**.\n\nEven if you don't like mixing server and client code, it's an ongoing trend enabling magnificent DX and performant improvements.\n\n## Why we put things together\n\nOur brain uses the [<em>working memory</em>](https://en.wikipedia.org/wiki/Working_memory) to store a small amount of information that can later be used for the execution of cognitive tasks. The problem is that cognitive load grows exponentially for the number of items we keep in memory. When we separate things, we need to remember the current task and where everything is located. When related topics are close together, our brain is at ease, this even explains the popularity of tools like Tailwind.\n\nFor a long time, CSS, HTML, and JS had to live in 3 different files, but modern frameworks realized that the inherent coupling is too high between them. **Most of the time, the separation of concerns creates even more complexity**.\n\n> The goal of a software engineer is NOT to reduce coupling or separate concerns but to reduce the net complexity of the system. Patterns like [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) [and SOLID](https://en.wikipedia.org/wiki/SOLID) are guides that we must use wisely. **Always make it clear and concise**.\n\n- Svelte and Vue invented _single file components_ using their own DSL (Domain Specific Language) to assemble HTML, CSS, and JS into a single file.\n- React introduced JSX, bringing HTML-like syntax to JS, and later, CSS-in-JS libraries did the rest for styles.\n\nThanks to all of them, the web is the industry that it is today. They enabled the creation of massively complex applications by big teams.\n\n## Why we separate things\n\n### Performance\n\nAny web developer working in a sufficiently large app is **forced** to do code splitting, and dynamically import components and styles.\n\nYes! **They are forced to.**\n\nStop for a second and realize that C++, Java, Swift, and Rust developers never have to think about this. **The compiler and operating system solve this problem by automatically** [loading and unloading](https://en.wikipedia.org/wiki/Virtual_memory) the program dynamically as it's needed.\n\n> 1GB of C binary can start immediately; unfortunately, we can not say the same about 1GB of Javascript. Even with WebAssembly, we need to deal with the network.\n\n### Server compared to client\n\nApps usually require writing code that executes only on the server side; this is needed to implement user authentication or allow direct access to a database.\n\nLike in the early days of the web, developers today are **forced** to separate server and client logic into different files, even if the logic between both worlds is deeply related.\n\n**Yes! They are forced to.**\n\nIt was not always that way, even good old [ASP.NET](http://asp.net/) has concepts to collocate Client and Server code next to each other. What if we could have the best of both worlds?\n\n```tsx\n<button onClick={server$(() => console.log('runs in the server'))}>\n   Runs in server\n</button>\n```\n\n### Refactoring\n\n**Separating things can be good when it's not a requirement;** sometimes it's good to keep things separated.\n\nFor instance, React, Vue, and Solid are **highly composable**, allowing us to move pieces of functionality to different modules.\n\nIn React, `use-` methods allow teams to refactor parts of functionality that they are using across different components and **keep related logic in the same place.**\n\nFrameworks like React and Qwik are designed to be used by big teams and complex apps in need of this ability.\n\n## Module Extraction as a primitive\n\nLike [Ryan Carniato](https://twitter.com/RyanCarniato) (creator of [Solid.js](https://www.solidjs.com/)) would say: \"**Primitives, not frameworks\"**.\n\nQwik is the first framework to have module extraction as a primitive, a **primitive that developers can extend** and use for many more things than Server/Client execution.\n\nIn Qwik, we use the `$` sign to signal the developer when to extract a piece of code; think about module extraction as the ability to create multiple modules inside a single file.\n\nWhile we could make `ME` transparent and hide the `$`, it's beneficial for developers to know when it's happening.\n\nBecause `$` is a primitive, developers can create their Module Extraction utilities, and the semantics are well explained and documented.\n\nUp until this time, module extraction was an internal trick mostly used by meta-frameworks when they recognize well-named exports or functions, like `export const loaders` or `export const actions`.\n\nQwik uses module extraction extensively; for example, each event handler is extracted so that when a user interacts, we can run that single piece of the original module in isolation, enabling apps that are instantly interactive regardless of complexity!\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fb48bdfe207bb49ccb9bf0a404dafaad9?width=800\" alt='a slide with a graph showing a figurative x-axis showing how Qwik enables O(1) apps. Text on the right: \"Correlation between functionality and amount of JS is broken' />\n\nModule extraction is the main primitive of how [Qwik achieves resumability](https://www.builder.io/blog/resumability-vs-hydration); not only that, it can even [make React resumable](https://www.builder.io/blog/resumable-react-how-to-use-react-inside-qwik) 🤯.\n\n- **✅ Composable:** developers can create their Module Extraction.\n- **✅ Closure extraction:** `$` can work at the closure level and extract functions that capture the scope.\n- **✅ Fully co-locatable:** `$` can be in any file, and at any level, even inside JSX. It's not a root-level module extraction only.\n- **✅ Nested:** `$` can even be inside another `$`.\n\n## How Module Extraction works in Qwik\n\nAt the core of Qwik’s module extraction is the ability to perform “**closure extraction**”.\n\nA closure is a term in computer science to refer to a function that uses captured scope variables.\n\nNotice this example:\n\n```typescript\n// This is a pure function: takes inputs as arguments and returns an output.\nfunction thisIsAFunction(a, b) {\n  return a + b;\n}\n\nfunction main() {\n  const captured = 10;\n  // This is a closure: in addition, the function captures the variable \"captured\".\n  function thisIsAClosure(a, b) {\n    return (a + b) * captured;\n  }\n}\n```\n\nAs you can tell, a closure is just like a function that captures the state through [lexical scoping](<https://en.wikipedia.org/wiki/Scope_(computer_science)#Lexical_scope>).\n\n### Extracting closures is not trivial\n\nSo, extracting pure functions is as easy as copying the entire function body somewhere else, and everything will still work, but how about moving a closure?\n\n```typescript\nfunction thisIsAClosure(a, b) {\n  // Exception: \"captured\" is undefined\n  return (a + b) * captured;\n}\n```\n\nIf we move the closure from the previous example, some variables are missing, which will not work.\n\n### Qwik Optimizer to the rescue\n\nTo solve this problem, we created the Qwik Optimizer in [Rust](https://www.rust-lang.org/) using [SWC](https://github.com/swc-project/swc), the same tech used by [TurboBuild](https://turbo.build/), to perform advanced optimizations without sacrificing build times.\n\nThe Optimizer looks for `$` and applies a transformation that extracts the expression following the `$` and turns it into a lazy-loadable and importable symbol.\n\nLet's start by looking at a simple `Counter` example:\n\n```typescript\nexport const Counter = component$(() => {\n  const store = useStore({ count: 0 });\n\n  return <button onClick$={() => store.count++}>{store.count}</button>;\n});\n```\n\nThe above code represents what a developer would write to describe the component. Below are the transformations the Optimizer applies to the code to make the code lazy-loadable.\n\n```typescript\nconst Counter = component(qrl('./chunk-a.js', 'Counter_onMount'));\n```\n\n`chunk-a.js`:\n\n```typescript\nexport const Counter_onMount = () => {\n  const store = useStore({ count: 0 });\n  return <button onClick$={qrl('./chunk-b.js', 'Counter_onClick', [store])}>{store.count}</button>;\n};\n```\n\n`chunk-b.js`:\n\n```typescript\nconst Counter_onClick = () => {\n  const [store] = useLexicalScope();\n  return store.count++;\n};\n```\n\nNotice that every occurrence of `$` results in a new lazy loadable symbol.\n\nIf you want to know more, check out the 1-hour video below, where I explain all the details of our Optimizer, or check the following links:\n\n- [The dollar $ sign](https://qwik.dev/docs/advanced/dollar/)\n- [QRL](https://qwik.dev/docs/advanced/qrl/)\n\n<div style='position:relative;padding-bottom:56.25%;height:0;'>\n\t<iframe\n\t\tsrc='https://www.youtube.com/embed/cL9DLUCrDx0?rel=0'\n\t\tstyle='position:absolute;top:0;left:0;width:100%;height:100%;border:0;'\n\t\tallowfullscreen\n\t\tallow='accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share;'\n\t></iframe>\n</div>\n\n## Closing notes\n\nModule extraction is the new silent revolution of the web happening right now! Its properties are so powerful that we will hear more and more about it. Qwik was the first framework to introduce it as a primitive, but our prediction is that other frameworks will begin embracing ME as a primitive, too, not a hidden set of rules implemented at the meta-framework level.\n\nNew meta-frameworks like Solid Start are taking the proper steps and adopting Qwik's semantics to implement module extraction with their new `server$`.\n\nWho said you need to choose between edge or serverless?\n\nWhat if you could write a single component file and leverage the entire cloud infrastructure or even web workers?\n\nThe future is bright, from new styling solutions to fully leveraging the power of the cloud, all from a single file.\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-1-14-preloader/index.mdx",
    "content": "---\ntitle: 'Qwik 1.14.0: Introducing the Preloader'\nauthors:\n  - 'Wout Mertens'\n  - 'Maïeul Chevalier'\n  - 'Shai Reznik'\ntags: ['Web development']\ndate: 'May 23, 2025'\ncanonical: 'https://qwik.dev/blog/qwik-1-14-preloader'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport { DiscordLink } from '~/routes/(blog)/blog/components/mdx/discord-link';\nimport { Image } from 'qwik-image';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\nimport serviceWorkerDelayDemo from './service-worker-delay-demo-crop.webm';\nimport modulepreloadNoDelayDemo from './modulepreload-no-delay-demo-crop.webm';\nimport serviceWorkerVsModulepreloadIllustration from './service-worker-vs-modulepreload-illustration.webp';\nimport serviceWorkerRegistrationPenalty from './service-worker-registration-penalty.webp';\n\n<ArticleBlock>\n\nWe're super excited to announce the release of Qwik 1.14.0, our most fundamental update to Qwik since the release of 1.0.0!\n\nYou can try it out on a new Qwik project with `npm create qwik@latest` or update your existing project with `npm i @builder.io/qwik@latest @builder.io/qwik-city@latest eslint-plugin-qwik@latest`.\n\n## A Qwik recap\n\nOne of the core features that makes Qwik so... well... quick... is what we call \"**Javascript Streaming**\" - the unique ability to execute a part of the code as soon as it is ready, before all the code has been downloaded - speeding up your website's [TTI (Time To Interactive)](https://developer.mozilla.org/en-US/docs/Glossary/Time_to_interactive) similarly to how [video streaming](https://www.cloudflare.com/learning/video/what-is-buffering/) is significantly faster than downloading an entire video and then playing it thanks to buffering and on demand delivery.\n\nThis mechanism is first enabled at build-time thanks to the [Qwik optimizer](https://qwik.dev/docs/advanced/optimizer/#optimizer), which looks for $ signs and splits your application code into smaller pieces (called \"segments\"). Then the bundler ([Rollup](https://rollupjs.org/)) groups these segments into small javascript files (called \"bundles\") that hold related segments together. \n\nThe goal is to have bundles neither too big nor small, where each corresponds to an interactive part of the UI.\n\nThen at runtime, the framework can leverage a service-worker to prefetch and cache all the bundles available on the page so that when a user interacts with a certain component, the code for it is already buffered and can be \"lazy-executed\" **right away** (unlike \"lazy loaded\" on demand). \n\nIf the user interacts but the network is really slow and therefore prefetching is still going on, Qwik will prioritize downloading those bundles and will execute them as soon as they're available.\n\nIn comparison, the other frameworks need to execute at least all of the visible UI code to attach the event listeners, and therefore they must download all of that code before executing it in a process called \"hydration\".\n\nFor hydration based apps on a slow 3G network, TTI often reaches ~20s, and even 60s plus for more complex applications as it increases proportionally to the amount of components that need to hydrate. \n\nOn the other hand with Qwik on a slow 3G network, TTI can often be as fast as ~5s (and even faster) no matter how complex the application becomes.\n\nJavaScript Streaming enables **loading time performance that scales seamlessly**, from simple marketing websites to enterprise level applications.\n\n### A long standing \"buffering\" issue\n\nIn Qwik 1.11.0 and 1.13.0, we fixed some long lasting bugs that were leading to \"under-prefetching\" and \"over-prefetching\" under certain conditions. With those fixes, we made sure that all and only the bundles required for the user interactions available on a page are prefetched, therefore preventing any sort of network delays.\n\nBut there were still 2 somewhat hidden issues we only uncovered recently through manual testing on a used up low-end smartphone. It turns out there is a small cost to serving bundles from the cache through the service worker:\n\n- **For old/low-end devices with poor CPUs** the first interactions on Qwik components would lead to small delays, even with a good network connection.  \n-  **A small startup penalty** to register the service worker, preventing any reprioritization of the bundles before the registration.\n\nThankfully, using a service worker isn't the only way we can prefetch and cache javascript bundles on the client, and we have found an even better alternative to it.\n\n## What's new: a better way to \"buffer\" javascript bundles\n\nIn Qwik 1.14, we've transitioned away from using a service worker in favor of a solution leveraging [`<link rel=\"modulepreload\">`](https://devdocs.io/html/reference/attributes/rel/modulepreload) as the new default. \n\nThe solution consists of a small script called the \"Qwik Preloader\". Once it is downloaded on the client, it adds the `<link rel=\"modulepreload\" href=\"my-bundle.js#segment123456\">` to the html `<head>`, which tells the browser to preload and buffer the corresponding JavaScript bundles.\n\nBy doing so, we not only get rid of any startup penalty, but also make any interaction on Qwik components absolutely instant once the bundles for it have been preloaded, even on devices with poor CPUs 🚀\n\n### No more first interaction delays on old/low-end devices\n\nOn our tests on a pretty used up Xiaomi note 7 pro, the delays only reached ~100ms and were barely noticeable to the human eye. This means that only very old or used-up devices should have suffered from this bottleneck, but this is still an area we wanted to improve upon.\n\n<div class=\"flex flex-col sm:flex-row gap-4 sm:gap-8 justify-center\">\n  <figure>\n    <video src={serviceWorkerDelayDemo} controls muted class=\"lg:max-w-md sm:max-w-xs max-w-full\" />\n    <figcaption class=\"text-center mt-2\">Service Worker delay</figcaption>\n  </figure>\n\n  <figure>\n    <video src={modulepreloadNoDelayDemo} controls muted class=\"lg:max-w-md sm:max-w-xs max-w-full\" />\n    <figcaption class=\"text-center mt-2\">modulepreload</figcaption>\n  </figure>\n</div>\n\nIt is hard to feel on a screen recording, but if you look closely at the two recordings above, you will notice that with the service worker, the first interaction on the Accordion component is a little slower. With modulepreload, all interactions are instant. (You might want to set the video to 0.5x speed to better see the difference.)\n\nThe reason why there is such a delay with the service worker on devices where the CPU is slow is because retrieving a chunk from the CacheControl with the Service Worker doesn't always take 1ms, but sometimes 10ms or more. So for example to retrieve 15 bundles on a first click, an old device can in total take 150ms or more instead of 15ms. Once the bundles have been executed and live in the browser memory or disk cache, the interactions are instant.\n\nIn contrast, modulepreloaded bundles are downloaded and compiled by the browser. They live in memory and are ready to be executed instantly on request. So if all the bundles required for an interaction have been preloaded, the interaction will be instant. There is no network request, no service worker interception, no retrieving of bundles from the CacheStorage.\n\nHere's a small Excalidraw to illustrate the difference:\n\n<Image src={serviceWorkerVsModulepreloadIllustration} alt=\"Service Worker vs modulepreload illustration\" />\n\n### No more startup penalty\n\nThe Service Worker had to be registered before any prefetching could happen. Not only did this negatively affect TTI and [TBT (Total Blocking Time)](https://developer.chrome.com/docs/lighthouse/performance/lighthouse-total-blocking-time#:~:text=Blocking%20Time%20audit-,What%20TBT%20measures,Paint%20and%20Time%20to%20Interactive.) a little, but it also prevented Qwik from reprioritizing bundles if the user interacted before the registration.\n<Image src={serviceWorkerRegistrationPenalty} alt=\"Service Worker registration penalty\" />\n\nWith modulepreload, we can now start preloading bundles as soon as the html is rendered. The default makes sure that [FCP (First Contentful Paint)](https://web.dev/articles/fcp) and [LCP (Largest Contentful Paint)](https://web.dev/articles/optimize-lcp#:~:text=Largest%20Contentful%20Paint%20(LCP)%20is,is%20rendered%20within%20the%20viewport.) remain as fast as possible, and slightly improves TTI and TBT scores over the service worker.\n\n### Even better prioritization based on heuristics\n\nA powerful feature that already existed in the Qwik service worker that is also implemented in the Qwik Preloader is the ability to \"**reprioritize**\" bundles on user interaction. If some bundles are at the bottom of the preload queue, we can tell the browser to start preloading them right away. This means that no matter what, TTI remains constant as it doesn't increase proportionally to the number and size of bundles that need to be loaded.\n\nBut it's even better if the framework can already know ahead of time what to \"buffer\" in which order. Qwik can now out of the box guess which bundles are more likely to be requested by the user based on what is most likely to be interacted with first.\n\nIt is not perfect (for that we have [Qwik Insights](https://qwik.dev/docs/labs/insights/)), but it's quite a bit better than before! Qwik now gives \"better scores\" to more important things like \"user events\" or \"above the fold\" components over things it assumes are less important.\n\nFor example, Qwik assumes that the search input on the navbar above the fold is more likely to be used sooner than a Button on a footer far down below the fold, but if a user on a very slow network scrolls and clicks the button on the footer, Qwik will **re-prioritize** its bundles before the search input so that the button code is executed as soon as possible. \n\n### Faster CI times\n\nThanks to the performance improvements above, our full CI tests on [qwik.dev](<http://qwik.dev>) now run in about ~10 minutes instead of ~15, and most of it can be attributed to the E2E tests which do many renders in a browser and were therefore bootstrapping a lot of service workers.\n## **How do I get all of this goodness?** (**Migration steps)**\n\nMigrating to Qwik 1.14.0 with the Qwik Preloader as the new default should not require much effort on your end, but there are a few changes you should know about. \n\nCurrently 93% of browsers support \"modulepreload\", which wasn't the case when we started using the service worker for \"buffering\". For non-supported devices, the preloader will fallback to `<link rel=preload>`, which doesn't compile the code in advance but still works and brings the support to 100%. In effect, you can rest assured all your users will experience lightning speed regardless of their device.\n\nHere are the Steps you need to follow:\n\n### 1. Unregister the service worker\n\nThe service worker is no longer used, but to make sure it is being uninstalled from your user's browser (to prevent it making your app slower) we recommend waiting a few weeks/months before removing the `<ServiceWorkerRegister />` from your root component.\n\nBoth the qwik-city service worker and the experimental Qwik prefetch service worker have been updated to do this automatically for you.\n\nSo do not remove the service worker registration (in `root.tsx`) from your app just yet. Wait until your users have loaded your site at least once, or long enough for their browser to have cleared the site data.\n\n### 2. IMPORTANT: Configure your Cache-Control headers\n\nWith the service worker no longer forcibly caching bundles, it's important that you configure appropriate HTTP caching headers using your cloud provider's recommended way of setting them up, for example using vercel.json for Vercel or netlify.toml for Netlify.\n\nThe bundles and assets are normally served at `/build` and `/assets`, respectively. Their filenames contain a content-based hash, making them immutable. If they change, their name changes as well. You can therefore set long-lived caching headers for these.\n\nThe recommended header is:\n\n```json\nCache-Control: public, max-age=31536000, immutable\n```\n\n> 💡 tip: You can re-add the starter for your deployment target with `npx qwik add`, which should update the deployment configuration to use the correct headers.\n\n### 3. Configure translations caching\n\nIf your app uses [`compiled-i18n`](https://github.com/wmertens/compiled-i18n) or [`qwik-speak`](https://github.com/robisim74/qwik-speak), translated bundles (`build/[locale]/*.js`) might retain identical filenames across builds, even when translations change. Consider how long you want to cache these files for so users get the latest translations.\n\nNote that this was also a problem with the service worker, and now you have the ability to configure the cache headers for these files, so it's a positive change.\n\n### 4. Enjoy a much faster experience!\n\nWe've worked countless hours for the past few months, manually testing fixes on simulated and real (old phones) environments in order to pin-point all the issues and make sure Qwik holds true to its promise of delivering the best user experience.. \n\nNow that this is fixed, we are shifting our focus back to the upcoming release of Qwik V2. \n\nSo stay tuned!\n\n*In the meantime, we'd love your feedback* — let us know how this update improves your apps on our discord <DiscordLink/>. \n\n</ArticleBlock>\n\n\n\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-1-2-performance-autopilot/index.mdx",
    "content": "---\ntitle: 'Qwik 1.2: Performance in Autopilot'\nauthors:\n  - 'Manu Mtz.-Almeida'\ntags: ['Web development']\ndate: 'June 29, 2023'\ncanonical: 'https://www.builder.io/blog/qwik-1-2-performance-autopilot'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport { DiscordLink } from '~/routes/(blog)/blog/components/mdx/discord-link';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\n## Qwik 1.2.0 is full of new features, fixes, and performance improvements designed to make you fall in love.\n\n```json\n\"@builder.io/qwik\": \"~1.2.0\",\n\"@builder.io/qwik-city\": \"~1.2.0\",\n\"eslint-plugin-qwik\": \"~1.2.0\",\n```\n\n## Don’t blame developers for bad performance\n\nPerformance issues are often a human-design problem, not just a technical one.\n\nQwik's philosophy puts the responsibility on the framework (us), not the developers. Sites are usually not slow because of a lack of diligence among developers, but because it takes too much effort to make sites fast.\n\n**Our dream is to never write a list of **performance** best practices or 100-tricks-to-make-your-site-fast!**\n\n## Continuous performance visibility\n\nDevelopers need visibility of the issues in order to fix them. Debuggers, audit tools, and dev tools are all tools created with the idea of increasing visibility. What if we could do the same for performance and make it continuous?\n\n> “Until you make the unconscious conscious,\n> it will direct your life and you will call it fate.”\n> – Carl Jung\n\nWe want Qwik developers to have a continuous and passive look at common performance issues in their apps and give them tools to fix those with no effort.\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fc1a27f6c5f7243ffae25aa636813ea97%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=c1a27f6c5f7243ffae25aa636813ea97&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nStarting with 1.2.0, developers will have constant visibility of easy-to-solve performance issues in their app. We are starting with images, but will extend it to fonts and third-party scripts like Google Analytics soon.\n\n## Component-less image optimization\n\nImage optimization is an essential optimization that all web developers should be familiar with. Qwik 1.2.0 is releasing a new image optimization API that relies on the `vite-imagetools` package, a battle-tested plugin used by thousands of existing apps.\n\nWe took it a step further by giving developers a way to import images as JSX:\n\n```tsx\nimport QwikLogo from './logo.png?jsx';\n\nexport default component$(() => {\n  return (\n    <section>\n      <QwikLogo />\n    </section>\n  );\n});\n```\n\n👆 this little snippet will generate the following `<img>` tag 👇\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F92eeee761ef84984a25be151e96f21fb?format=webp&amp;width=700\" alt=\"image optimization\" />\n\nThe community and the Qwik team love this API for a number of reasons:\n\n- Zero runtime, zero JS\n- Zero props by default, simple API\n- Zero 404, strongly typed API\n- Zero layout reflows (Automatic width/height)\n- Hashed images, immutable cached\n- Automatic `.webap` / `.avif` format optimization\n- Automated `srcSet` generation\n- Extendable (use any `<img>` attribute)\n- Loading lazy and async decoding by default\n- Lightweight, a single `<img>` node in the HTML\n\n<br></br>\n<br></br>\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fe1f99b0d93bb4b239073ad37eaf760d0%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=e1f99b0d93bb4b239073ad37eaf760d0&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Zero-runtime styling with PandaCSS\n\nPandaCSS is a new CSS-in-JS, zero-runtime, atomic styling solution that works in Qwik, Next.js, Vue, Remix, and so on:\n\n- CSS-in-JS: You can inline all your styles, like in emotion-js.\n- Zero-runtime: Just like Tailwind or Vanilla Extract, all the CSS is generated at compiler time.\n- Atomic: The amount of CSS scales well. As the number of components grows, the amount of CSS will remain almost constant.\n\nQwik and PandaCSS share a lot of core principles:\n\n- Performance by default, without extra effort\n- No performance footguns. You will not find “best practices” to make Panda CSS fast. It’s always fast.\n- Refactorizable: inlined CSS or not, it’s up to you!\n\nTo celebrate it, you can run the following command in your Qwik app! And voilà! It’s done!\n\n```shell\npnpm qwik add pandacss\n```\n\n(No more installation steps!)\n\nCheck it out!\n\n```tsx\nimport { component$ } from \"@builder.io/qwik\";\nimport { css } from \"~/styled-system/css\";\n\nexport default component$(() => {\n  return (\n    <div\n      class={css({\n        padding: 10,\n        bg: \"red.400\",\n        height: \"dvh\",\n        margin: 100,\n        fontSize: 30,\n      })}\n    >\n      This box is styled with PandaCSS.\n    </div>\n  );\n});\n```\n\n## npm run qwik new\n\nBig shout-out to our [Roman (@zanettin)](https://github.com/zanettin), he has been a key part of our community, helping in <DiscordLink text=\"our Discord\" />, triaging issues and shipping new features!\n\nThe new `new` 😅 command, allows developers to create new components and routes.\n\nYou want a new route for the /about page?\n\n```shell\npnpm qwik new /about\n```\n\nYou want a new component? sure thing\n\n```shell\npnpm qwik new my-button\n```\n\nIt's also beautiful, check it out 👇\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fa0dbe86ddcb14953a81b31b98f63199a%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=a0dbe86ddcb14953a81b31b98f63199a&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## AWS lambda integration\n\nOur community hero, [Leifer](https://twitter.com/LeiferMendez) contributed AWS lambda support for Qwik! He and his team have been using Qwik with AWS for a while now and decided to help the rest of the mortals to do the same.\n\n**AWS Lambda** joins Google Cloud, Vercel, and Netlify as one of the supported deployment targets for Qwik. Starting with 1.2.0, this is the only command you need to type to deploy to AWS!\n\n```bash\npnpm qwik add aws-lambda\n```\n\nWe are especially excited about this contribution because it empowers enterprise users even more.\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd9484e8cb94147c9b5fcb0a6ce7063fa%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d9484e8cb94147c9b5fcb0a6ce7063fa&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## `clientConn` API\n\nNow it’s easier than ever to know key information about your users. This new API helps you get not only the IP address of the user, but their country and city as well.\n\nIt is built on top of `edge` APIs of Cloudflare, Vercel, Netlify, and Google Cloud.\n\n```tsx\nexport const useGetCountryAndIP = routeLoader$(({clientConn}) => {\n  return {\n    ip: clientConn.ip,\n    country: clientConn.country\n  };\n});\n```\n\nThe best part is that you don’t need to know how any of those work. ClientConn API abstracts this complexity and provides a normalized API you can use regardless of where you deploy or self-host.\n\n## SPA navigation improvements\n\nOur community members `@jordanw66` and `@billykwok` deserve a big shout out. They have been rocking it making the SPA navigation buttery smooth, from fixing bugs to adding new APIs, like perfect scroll restoration and `replace` instead of push for navigation.\n\n- feat: Critical DX/UX improvement to SPA navigation in Qwik City by @billykwok\n- feat: frame-perfect and state-backed durable SPA scroll restoration by @jordanw66\n- feat: bulletproof SPA recovery by @jordanw66\n- feat: scroll opt-out on nav() and Link by @jordanw66\n- fix: save scrollState on visibilitychange by @jordanw66\n- fix: perfect hash scroll by @jordanw66\n\n## Rendering performance\n\nQwik is getting faster and smarter without missing a beat. Improvements mostly focus in the optimizer, allowing to better understand how the JSX can be dynamic, and which components are invariable. This information is critical for Qwik’s dynamic data tree shaking that only serializes the bare minimum!\n\n- perf: optimizer knows non-variadic components by @manucorporat\n- feat: transform compiler architecture by @manucorporat\n\nWe have also made improvements to our prefetching algorithms to emit `modulepreload` only for ESM modules with a lot of dependents. The idea behind this optimization is to reduce even more the FID (First Input Delay) on the slowest devices. This new strategy allows the browsers to pre-parse and compile the most likely modules to execute before they are even needed.\n\n- perf: enable navigationPreload by @manucorporat\n- perf: leverage modulepreload for common chunks by @manucorporat\n\n## Qwik Labs 🧪 to infinity and beyond\n\nWe are thrilled to introduce Qwik Labs, a place designed for sharing and experimenting with the new ideas we are currently developing. The primary objective of Qwik Labs is to make it effortless for our community to test our upcoming ideas and provide early feedback, thereby enhancing their quality.\n\nNote that Qwik Labs are not intended for production use, and the API will probably change based on developer feedback, hence the reason they are packaged in a separate NPM package.\n\nWe are excited to keep the Qwik Labs with these projects:\n\n- [Qwik Insights](https://qwik.dev/docs/labs/insights/): a way to collect real-world metrics about how the users are using the Qwik Application and then use the information to create ideal bundles to further improve the prefetching and application startup performance. (A form of [profile-guided optimization](https://en.wikipedia.org/wiki/Profile-guided_optimization).)\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F733086ea420f4ff6937e68e265e6b2ec?format=webp&amp;width=700\" alt=\"Qwik Insights chart\" />\n\n*   Typed Routes: TypeScript is great at telling us all the places we need to change when we refactor our code – except one place; routes URLs, params, and queries. Typed Routes is a plugin for Vite that generates type information for your routes so that TypeScript can let you know if the application URL does not match the route definitions.\n\n## Qwik $hop!!\n\nYes! Another amazing community leader [Giorgio Boa](https://bsky.app/profile/gioboa.bsky.social), built our official shop from the ground up!\n\n[Go check it out and get some socks](https://qwik.dev/shop/); I heard they can make you run qwiker.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F16a1660c84e444958271c06a2303bd6d?format=webp&amp;width=700\" alt=\"Qwik shop\" />\n\nhttps://qwik.dev/shop/\n\n## Other features and fixes\n\n- feat: serialize support for Set and Map by @manucorporat in https://github.com/QwikDev/qwik/pull/4375\n- feat(adapter): aws starter adapter by @leifermendez in https://github.com/QwikDev/qwik/pull/4390\n- feat: CLI option new by @zanettin in https://github.com/QwikDev/qwik/pull/4273\n- feat: client info API by @manucorporat in https://github.com/QwikDev/qwik/pull/4433\n- docs: fix link to speculative-module-fetching by @Craiqser in https://github.com/QwikDev/qwik/pull/4421\n- fix: use levenshtein distance to provide even better 404 by @manucorporat in https://github.com/QwikDev/qwik/pull/4389\n- docs: add CodeSandbox demo to Modular Forms guide by @fabian-hiller in https://github.com/QwikDev/qwik/pull/4095\n- docs: fix link to Bundle Optimization by @Craiqser in https://github.com/QwikDev/qwik/pull/4418\n- feat: image performance dev tools by @manucorporat in https://github.com/QwikDev/qwik/pull/4424\n- fix: slow test by @manucorporat in [https://github.com/QwikDev/qwik/pull/4431](https://github.com/QwikDev/qwik/pull/4431](https://github.com/QwikDev/qwik/pull/4431))\n- docs: qwiksand-box by @manucorporat in https://github.com/QwikDev/qwik/pull/4429\n- fix: image-size dep by @manucorporat in https://github.com/QwikDev/qwik/pull/4435\n- docs: fix example to match by @hamatoyogi in https://github.com/QwikDev/qwik/pull/4439\n- chore: remove unused starter file by @adamdbradley in https://github.com/QwikDev/qwik/pull/4446\n- fix: set qwik builder counter initial value by @adamdbradley in https://github.com/QwikDev/qwik/pull/4449\n- fix: cli background install by @adamdbradley in https://github.com/QwikDev/qwik/pull/4450\n- fix: jsx rendering order by @manucorporat in https://github.com/QwikDev/qwik/pull/4458\n- Reorganize .gitignore by @szepeviktor in https://github.com/QwikDev/qwik/pull/4456\n- docs: Routing - Change getLocation() to useLocation() by @chsanch in https://github.com/QwikDev/qwik/pull/4454\n- fix: visible task execution after removal by @manucorporat in https://github.com/QwikDev/qwik/pull/4459\n- Fix typo in MDX example code by @erikras in https://github.com/QwikDev/qwik/pull/4457\n- fix(use-on.ts): fixed useOn methods to pass correct eventName to _useOn by @OrenSayag in https://github.com/QwikDev/qwik/pull/4453\n- docs: routeLoader adjustment by @hamatoyogi in https://github.com/QwikDev/qwik/pull/4462\n- fix: root gitignore file by @zanettin in https://github.com/QwikDev/qwik/pull/4460\n- fix: add missing nonce to popstate script by @DustinJSilk in https://github.com/QwikDev/qwik/pull/4468\n- Include a woman in the \"community\" emoji by @erikras in https://github.com/QwikDev/qwik/pull/4471\n- docs: Update the middleware / endpoint documentation by @mhevery in https://github.com/QwikDev/qwik/pull/4442\n- fix: prefetch urls with different search queries by @DustinJSilk in https://github.com/QwikDev/qwik/pull/4474\n- refactor: improve DX of \"qwik new\" by @manucorporat in https://github.com/QwikDev/qwik/pull/4472\n- fix: bundling for testing by @manucorporat in https://github.com/QwikDev/qwik/pull/4475\n- feat: image vite transform by @manucorporat in https://github.com/QwikDev/qwik/pull/4479\n- refactor: containerState for appendHeadStyle by @manucorporat in https://github.com/QwikDev/qwik/pull/4478\n- fix: implicitly end middleware chain on response by @mhevery in https://github.com/QwikDev/qwik/pull/4441\n- refactor: visible tasks can run in parallel by @manucorporat in https://github.com/QwikDev/qwik/pull/4477\n- Update pages.json by @hexa-it in https://github.com/QwikDev/qwik/pull/4473\n- feat: update starter dev-tools by @adamdbradley in https://github.com/QwikDev/qwik/pull/4483\n- Add new documentation for deprecated features. by @nsdonato in https://github.com/QwikDev/qwik/pull/4476\n- feat: add no-unnecessary-condition eslint rule by @manucorporat in https://github.com/QwikDev/qwik/pull/4485\n- fix(parse-pathname): path segment encoding by @Varixo in https://github.com/QwikDev/qwik/pull/4486\n- docs(*): update contribution docs by @Wimpert in https://github.com/QwikDev/qwik/pull/4490\n- Allow replace state when navigating by @Wimpert in https://github.com/QwikDev/qwik/pull/4488\n- fix: test bundle mode by @manucorporat in https://github.com/QwikDev/qwik/pull/4491\n- fix: 'Numberish' type used for width/height didn't allow % by @KenAKAFrosty in https://github.com/QwikDev/qwik/pull/4434\n- fix: missing navigation update to static page by @manucorporat in https://github.com/QwikDev/qwik/pull/4493\n- 🦄 by @manucorporat in https://github.com/QwikDev/qwik/pull/4495\n- feat: add image to starter by @manucorporat in https://github.com/QwikDev/qwik/pull/4497\n- fix: $localize optimizer bug by @manucorporat in https://github.com/QwikDev/qwik/pull/4498\n- docs(adding content security policy to the advanced topics) by @the-zimmermann in https://github.com/QwikDev/qwik/pull/4440\n- fix: clientConn types by @manucorporat in https://github.com/QwikDev/qwik/pull/4501\n- Pr docs qwik city by @mhevery in https://github.com/QwikDev/qwik/pull/4494\n- chore: fix dev release by @manucorporat in https://github.com/QwikDev/qwik/pull/4511\n- refactor: simplify new templates by @manucorporat in https://github.com/QwikDev/qwik/pull/4512\n- fix: cli new interactive by @manucorporat in https://github.com/QwikDev/qwik/pull/4516\n- feat: svg optimization with esm by @manucorporat in https://github.com/QwikDev/qwik/pull/4526\n- fix: spa redirects from non-pages by @manucorporat in https://github.com/QwikDev/qwik/pull/4518\n- docs: fix typos in Overview and State files. by @eecopa in https://github.com/QwikDev/qwik/pull/4524\n- docs: fixed a typo in image link by @avanderpluijm in https://github.com/QwikDev/qwik/pull/4514\n- docs: fixed small typos in qwik-city documentation. by @VinuB-Dev in https://github.com/QwikDev/qwik/pull/4522\n- feat: pandacss integration by @manucorporat in https://github.com/QwikDev/qwik/pull/4515\n- docs: added custom icons by @LoganAffleck in https://github.com/QwikDev/qwik/pull/4513\n- Update app.tsx in runtime-less example by @primeagen-rustaceans in https://github.com/QwikDev/qwik/pull/4467\n- docs: fix typos by @enesflow in https://github.com/QwikDev/qwik/pull/4500\n- docs: move think-qwik page to concepts route by @moinulmoin in https://github.com/QwikDev/qwik/pull/4499\n- docs: fixed typos in comments and docs by @ehrencrona in https://github.com/QwikDev/qwik/pull/4430\n- doc: add redirect to new think-qwik docs by @manucorporat in https://github.com/QwikDev/qwik/pull/4533\n- fix: missing component in layout by @manucorporat in https://github.com/QwikDev/qwik/pull/4535\n- fix(router): use encodeURI instead by @manucorporat in https://github.com/QwikDev/qwik/pull/4534\n- fix: click to component for svg by @manucorporat in https://github.com/QwikDev/qwik/pull/4537\n- fix: regression when navigating to / by @manucorporat in https://github.com/QwikDev/qwik/pull/4538\n- feat: automatically set qwik icons by @manucorporat in https://github.com/QwikDev/qwik/pull/4539\n- fix: renderToString mode is always ignored and returns an empty page by @ncharalampidis in https://github.com/QwikDev/qwik/pull/4528\n- fix: image?jsx strip export default by @manucorporat in https://github.com/QwikDev/qwik/pull/4541\n- fix(router): redirect handling by @manucorporat in https://github.com/QwikDev/qwik/pull/4543\n- chore: update deps by @manucorporat in https://github.com/QwikDev/qwik/pull/4540\n- chore: create @builder.io/qwik-labs by @mhevery in https://github.com/QwikDev/qwik/pull/4545\n- Sidebar style by @LoganAffleck in https://github.com/QwikDev/qwik/pull/4554\n- fix: QwikIntrinsicElements does not include ref by @manucorporat in https://github.com/QwikDev/qwik/pull/4555\n- docs: add panda css by @anubra266 in https://github.com/QwikDev/qwik/pull/4544\n- feat(insights): create a new insights application by @mhevery in https://github.com/QwikDev/qwik/pull/4547\n- docs: add ss-link to showcase by @Leizhenpeng in https://github.com/QwikDev/qwik/pull/2689\n- fix: navigationPreload waitUntil by @manucorporat in https://github.com/QwikDev/qwik/pull/4561\n- feat: layout shift detection by @manucorporat in https://github.com/QwikDev/qwik/pull/4560\n- docs: add resource + fix css by @hamatoyogi in https://github.com/QwikDev/qwik/pull/4562\n- fix(qwik-city buildtime): make generated file ids unique by @hbendev in https://github.com/QwikDev/qwik/pull/4564\n- feat(insights): basic UI for seeing symbols by @mhevery in https://github.com/QwikDev/qwik/pull/4565\n- docs: Add Qwik Labs section by @mhevery in https://github.com/QwikDev/qwik/pull/4568\n- chore: fix broken lock file by @manucorporat in https://github.com/QwikDev/qwik/pull/4574\n- fix: route new template by @manucorporat in https://github.com/QwikDev/qwik/pull/4576\n- docs(qwik-labs edit link route): fixed qwik labs \"edit page\" link & so… by @thejackshelton in https://github.com/QwikDev/qwik/pull/4571\n- feat(labs): typed routes by @mhevery in https://github.com/QwikDev/qwik/pull/4580\n- docs(labs): add typed routes by @mhevery in https://github.com/QwikDev/qwik/pull/4582\n- chore: fix saving of artifacts to build by @mhevery in https://github.com/QwikDev/qwik/pull/4583\n- chore(labs): fix distribution build by @mhevery in https://github.com/QwikDev/qwik/pull/4584\n- Internal renaming suggestions by @shairez in https://github.com/QwikDev/qwik/pull/4581\n- fix(labs): encodeencodeURIComponent for params by @mhevery in https://github.com/QwikDev/qwik/pull/4587\n- feat: panda css use vite-macro plugin by @manucorporat in https://github.com/QwikDev/qwik/pull/4588\n- Qwik shop 🎁 by @gioboa in https://github.com/QwikDev/qwik/pull/4225\n- fix: shop cache by @manucorporat in https://github.com/QwikDev/qwik/pull/4590\n- docs(advanced & concepts docs improvements): clarity / structure changes by @thejackshelton in https://github.com/QwikDev/qwik/pull/4592\n- Add replaceState to link component by @Wimpert in https://github.com/QwikDev/qwik/pull/4492\n- docs: simplify menu by @manucorporat in https://github.com/QwikDev/qwik/pull/4593\n- fix: improve pandacss integration by @manucorporat in https://github.com/QwikDev/qwik/pull/4594\n- fix: default prettier format for starters by @manucorporat in https://github.com/QwikDev/qwik/pull/4595\n- chore(labs): copy build artifacts into the build git repo by @mhevery in https://github.com/QwikDev/qwik/pull/4589\n- chore: update deps by @manucorporat in https://github.com/QwikDev/qwik/pull/4597\n- docs: fix insights docs by @gioboa in https://github.com/QwikDev/qwik/pull/4598\n- chore(labs): include package.json in full build by @mhevery in https://github.com/QwikDev/qwik/pull/4599\n- docs: Dynamic og image implementation by @mrhoodz in https://github.com/QwikDev/qwik/pull/4579\n- fix: correct documentation URLs for rules created by ESLintUtils.RuleCreator by @wtlin1228 in https://github.com/QwikDev/qwik/pull/4604\n- fix: Social and Vendor are production only components by @wtlin1228 in https://github.com/QwikDev/qwik/pull/4610\n- docs: image optimization by @manucorporat in https://github.com/QwikDev/qwik/pull/4608\n- chore: change useStore link by @GustavoMelloGit in https://github.com/QwikDev/qwik/pull/4601\n- fix(qwik-core): add types for the style attribute by @hbendev in https://github.com/QwikDev/qwik/pull/4577\n- docs: Update deprecation information about the basePathname by @julianobrasil in https://github.com/QwikDev/qwik/pull/4437\n- docs: fix typos on Qwik City home by @corydeppen in https://github.com/QwikDev/qwik/pull/4602\n- feat: improve error message for duplicated loaders by @manucorporat in https://github.com/QwikDev/qwik/pull/4619\n- docs: dynamic ogImage feature url format fix and clean up by @mrhoodz in https://github.com/QwikDev/qwik/pull/4617\n- fix: detect invalid html by @manucorporat in https://github.com/QwikDev/qwik/pull/4623\n- 1.2.0 by @manucorporat in https://github.com/QwikDev/qwik/pull/4600\n- fix: image devtools by @manucorporat in https://github.com/QwikDev/qwik/pull/4626\n- feat: qwik add builder.io by @adamdbradley in https://github.com/QwikDev/qwik/pull/4627\n\n## New Contributors\n\n- @erikras made their first contribution in https://github.com/QwikDev/qwik/pull/4457\n- @OrenSayag made their first contribution in https://github.com/QwikDev/qwik/pull/4453\n- @hexa-it made their first contribution in https://github.com/QwikDev/qwik/pull/4473\n- @the-zimmermann made their first contribution in https://github.com/QwikDev/qwik/pull/4440\n- @eecopa made their first contribution in https://github.com/QwikDev/qwik/pull/4524\n- @avanderpluijm made their first contribution in https://github.com/QwikDev/qwik/pull/4514\n- @VinuB-Dev made their first contribution in https://github.com/QwikDev/qwik/pull/4522\n- @LoganAffleck made their first contribution in https://github.com/QwikDev/qwik/pull/4513\n- @primeagen-rustaceans made their first contribution in https://github.com/QwikDev/qwik/pull/4467\n- @enesflow made their first contribution in https://github.com/QwikDev/qwik/pull/4500\n- @moinulmoin made their first contribution in https://github.com/QwikDev/qwik/pull/4499\n- @jordanw66 made their first contribution in https://github.com/QwikDev/qwik/pull/4509\n- @ehrencrona made their first contribution in https://github.com/QwikDev/qwik/pull/4430\n- @ncharalampidis made their first contribution in https://github.com/QwikDev/qwik/pull/4528\n- @anubra266 made their first contribution in https://github.com/QwikDev/qwik/pull/4544\n- @Leizhenpeng made their first contribution in https://github.com/QwikDev/qwik/pull/2689\n- @mrhoodz made their first contribution in https://github.com/QwikDev/qwik/pull/4579\n- @corydeppen made their first contribution in https://github.com/QwikDev/qwik/pull/4602\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-2-coming-soon/index.mdx",
    "content": "---\ntitle: 'Towards Qwik 2.0: Lighter, Faster, Better'\nauthors:\n  - 'The Qwik Team'\ntags: ['Qwik']\ndate: 'February 9, 2024'\ncanonical: 'https://www.builder.io/blog/qwik-2-coming-soon'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nQwik prides itself on having instant-on applications with an HTML-first approach. We have performed a lot of comparison testing, and in each case, resumability wins over hydration in terms of JS downloaded, executed, and delayed before the user interaction is processed, and we’re really excited about that!\n\nBut resumability comes with a cost. In Qwik v2.0, we will focus on lowering these costs further, and we would like to discuss them here.\n\nFor a system to be resumable, the HTML must encode additional information:\n\n1.  **Listener location** — This is in the form of an attribute, and it is very small (not much improvement possible here).\n2.  **Component boundaries** — This bit is a nontrivial amount of additional HTML text. We will focus on this part in this post.\n3.  **Application state** — We are also making improvements here, but this will be for a later post.\n\n> We are committed to backward compatibility, so, we're not planning to introduce ANY breaking changes in this release. However, we feel this is a significant rewrite of the internals, so...it is a reason to celebrate!\n\n## Understanding the application\n\nWhichever framework you choose, the framework must understand the application's internal structure. By this, we mean knowing where the component boundaries are, which text nodes are bound to which expressions, where to insert new rows in a loop, and so on. This data is a kind of tree where the framework has references to relevant DOM nodes so that it can update them.\n\nSo, how do you get a hold of that tree? Well, there are two choices:\n\n1.  Re-execute the application and rebuild the tree from code. ⇒ That’s hydration.\n2.  Serialize the tree into the HTML somehow. ⇒ It turns out HTML is already such a tree; it’s just missing a few things.\n\n## How it's done in Qwik v1\n\nLet’s assume we have a minimal component:\n\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const Counter = component$(() => {\n  const count = useSignal(123);\n  return (\n    <>\n      Count: {count.value}! \n      <button onClick$={() => count.value++}>+1</button>\n    </>\n  );\n});\n\nexport const Layout = component$(() => {\n  return (\n    <main>\n      <Slot />\n    </main>\n  );\n});\n\n// Think of it as: <main> <Counter/> </main>\n```\n\nThe output HTML looks like this:\n\n```html\n<div q:container=\"paused\" q:render=\"static-ssr\" q:version=\"dev\" \n     q:base=\"/build/\" q:locale q:manifest-hash=\"dev\">\n  <main>\n    <!--qv q:s q:sref=5 q:key=-->\n      <!--qv q:id=7 q:key=xYL1:zl_0-->\n        <!--qv q:key=H1_0-->\n          Count: \n          <!--t=8-->123<!---->! \n          <button on:click=\"...\" q:id=\"9\">\n            +1\n          </button>\n        <!--/qv-->\n      <!--/qv-->\n    <!--/qv-->\n  </main>\n  <script type=\"qwik/json\">{...}</script>\n</div>\n```\n\nRight away, you might notice that Qwik needs to create “virtual nodes” in the form of comments. So why does Qwik need this information?\n\n- `<!--qv q:s q:sref=5 q:key=-->`: In this example, a parent [Layout](https://qwik.dev/docs/layout/) component (not shown) is used for routing. The parent component creates the `<main/>` element and [projects the route content](https://qwik.dev/docs/core/slots/#slots) (Counter) into the layout component. So, the framework needs to know where the component projected output should be inserted. Qwik needs a virtual node for that.\n- `<!--qv q:id=7 q:key=xYL1:zl_0-->`: This virtual node represents the Counter component. The component requires component props, which are stored in the data section (`<script type=\"qwik/json\">`). The additional attributes are used to cross-reference the props with this virtual node. A key point of resumability is that one should be able to re-render a component without the parent component needing to be resumed as well. But components get props from the parent, so the props need to be serialized and recoverable so that this component can render independently of others. Qwik needs a virtual node for that.\n- `<!--qv q:key=H1_0-->`: The Counter component JSX has a top-level Fragment represented by `<>...</>`. Qwik needs a virtual node for that.\n- `<!--t=8-->123<!---->`: When the counter updates, Qwik needs to be able to update the text node associated with the signal. HTML merges neighboring text nodes, and there is no easy way to refer to text nodes. So Qwik needs a virtual node for that.\n- `q:id/q:sref/t`: Throughout the HTML, there are id attributes that allow the serialized state of the application (not shown) to refer back to the DOM nodes.\n\n## Let’s talk about inefficiencies\n\n### Pruning\n\nIn the above example, the `Counter` component will never be downloaded to the client. This is because a user interaction can not trigger a structural change (adding/removing DOM elements), and Qwik can already update the count signal without the component present, **meaning the extra virtual nodes we’ve been maintaining are not needed**!\n\nThe complication is that Qwik streams the data to the client. Qwik can’t determine that a component is static (and therefore not needed) until after Qwik sees the whole application because there could be some component later on that could do some sneaky stuff. Qwik is forced to generate this extra content just-in-case™.\n\n### IDs\n\nWhen serializing data, Qwik needs to be able to refer back to the DOM nodes. For example, attaching props to components, updating signal values, or having references for the components. However, because Qwik streams HTML as it renders, Qwik does not know if the data will be needed (have not gotten to that point in the stream), and by the time Qwik has sufficient information to make that determination, the content has already been sent to the client.\n\n> For context, all frameworks need this information, so this is not unique to Qwik. The unique bit is that other frameworks get this information by re-running the components on the client side (hydration), whereas Qwik gets it from the HTML so that it can resume. (See [hydration vs resumability](https://qwik.dev/docs/concepts/resumable/))\n\n## Qwik 2.0\n\nin Qwik 2.0, we are fixing serialization issues to make Qwik even faster and more efficient. The philosophy is:\n\n1.  Move all non-human readable data to the end of the HTML stream. We still need to know where the component boundaries are, but by moving them to the end of HTML, we can render the UI faster, and then deliver the data for the framework runtime.\n2.  Come up with a more efficient encoding scheme for the virtual nodes.\n3.  Make the resuming algorithm even lazier, so we materialize only the virtual nodes that are needed for processing to handle user input, further reducing the runtime cost.\n\nWe are excited to share that we are progressing excellently on this front! Let’s find out what the new HTML looks like:\n\n```html\n<div q:container=\"paused\" q:render=\"static-ssr\" q:version=\"dev\" \n     q:base=\"/build/\" q:locale q:manifest-hash=\"dev\">\n  <main>\n   Count: 123!\n   <button on:click=\"...\">+1</button>\n  </main>\n  <script type=\"qwik/state\">[...]</script>\n  <script type=\"qwik/vnode\">!{{HDB1}}</script>\n</div>\n```\n\nWOW! No more comment nodes! The output is super clean! And yet, all the same information is still encoded in the output. Let’s go over it. Visit the Qwik [container](https://qwik.dev/docs/advanced/containers/) documentation for more details.\n\n### Moving virtual nodes to the end of the HTML\n\nInstead of having the virtual node information mixed with the HTML output, it is now all moved into the `<script type=\"qwik/vnode\">` placed at the end of the document.\n\nThis means that the content rendered by the browser for the user can get to the user even faster!\n\n### Recovering virtual nodes\n\nQwik still needs to have the virtual nodes! So, that information can’t disappear but is now shrunken to just these nine characters: `!{HDB1}`.\n\n\nThat is mind-blowing!\n\n<img class=\"mx-auto\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F4b6f0d1119374ce3ab848186972a6f27?width=250\" alt='mind-blowing meme' />\n\nLet’s unpack it. The content we need to recover is this:\n\n```jsx\n<main>\n  <Counter>\n    <>\n      {'Count: '}\n      {signal.value}\n      {'!'}\n      <button on:click=\"...\">+1</button>\n    </>\n  </Counter>\n</main>\n```\n\nNote that this is more of a vDOM than HTML.\n\nSpecifically, we need to:\n\n1.  Identify the `<main>` element.\n2.  Identify that `<main>` contains a virtual node represented by `<Counter>`.\n3.  Identify that `<Counter/>` contains a virtual fragment represented by `<>`.\n4.  Identify that there are three text nodes and that the second text node is bound to the signal. (This can be tricky because the HTML merges the text nodes into a single text node.)\n\nSo how does it work?\n\n1.  We use the [`document.createTreeWalker`](https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker) API to retrieve all DOM nodes in [depth in the first order](https://en.wikipedia.org/wiki/Depth-first_search). Our benchmarks show that retrieving 50,000 nodes in about 20 ms is possible. 50,000 nodes is an extremely large document! For comparison Qwik only has to retrieve the elements, where as hydration must retrieve, walk and reconcile the elements. Additionally, the tree-walker API does not need to be consumed all at once. Instead, you can split it over many idle microtasks to spread the load (we already use this API to retrieve all of the comments in the current implementation and it is performant.)\n2.  We use [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) sequence numbers to identify each node. This way, we don’t have to assign IDs to each node. Even without an explicit ID, Qwik can identify any node, whether a real Element or a virtual node, such as a text node.\n\n> We have ways to identify browser extensions that inject extra nodes, but that is for a different blog post.\n\nSo what is encoded in `!{HDB1}`?\n\n- `!`: encodes how many elements to skip to get to `<main>` element.\n- `{`: The `<main>` element will have a virtual element. This one stores component props, but that information is stored in `<script type=\"qwik/state\">`, which is not covered in this blog post.\n- `{`: The component element will contain an additional virtual node represented by `<>`.\n- `H`: Letter `H` is the seventh (0-based) letter. Therefore, we know that the first seven characters of the `Count: 123!` ⇒ `Count:` belong to the first node.\n- `D`: Letter `D` is the third (0-based) letter. Therefore, the next text node contains `123`.\n- `B`: Letter `B` is the first (0-based) letter. Therefore, the next text node contains `!`.\n- `1`: Represents the number of elements to consume, in this case, one `<button>`.\n\n> Yes, we can store strings longer than 26 characters. Also, we can use lowercase letters to extend the encoding to grab any number of characters. The uppercase letters are used both to encode length as well as a delimiter for next encoding (saving a `,`).\n\n### Advantages\n\nBy shifting the encoding of the virtual nodes to the end, Qwik can now perform additional tree shaking of the data. Because Qwik has seen all of the components in the application at this point, it can safely apply heuristics and remove unneeded data for example it can drop the virtual nodes and their IDs.\n\nOur `Counter` example shows that it encodes all its virtual nodes to simplify the example.\n\nStill, Qwik would determine that no code path would require structural change, and hence, it would determine that these virtual nodes are not needed and remove them.\n\nThis would further decrease the amount of HTML being sent. And because the new encoding uses depth-first-index, no additional unneeded IDs are left behind.\n\n## Lazy virtual nodes\n\nWe mostly talked about encoding, but there is also a runtime discussion to be had. We will not go deeply into it here, but we wanted to point out some things.\n\n1.  The new virtual node implementation uses arrays to store data rather than objects. Arrays facilitate growing the data you store easily without being penalized. You can store all your data for a virtual node in a single array, relieving memory pressure. Another advantage is that arrays are always [monomorphic](https://www.builder.io/blog/monomorphic-javascript) and have fast access under all conditions. All of this is done to lower the memory pressure of the virtual nodes.\n2.  The new implementation follows a \"lazy\" approach, it prioritizes efficiency and minimizes unnecessary work. Parsing the `<script type=\"qwik/vnode\"> `does not create any virtual nodes eagerly. The virtual nodes are created lazily on an as-needed basis to further save on memory allocation. The result is that the virtual node tree is very sparse and only contains a materialized view of the nodes needed for the operation. In our example, only the virtual nodes would be related to the signal, not the whole component.\n3.  Finally, the virtual nodes understand that the underlying DOM has a single text node and several virtual nodes share the text nodes. The system retains a single text node until Qwik writes into the signal node, and it is only at that time that the system creates new text nodes and splits the text over them.\n\n## Coming next: data serialization\n\nWe haven’t discussed changes that we are doing to the data serialization. That will be a topic for another blog post, but these changes are equally as important (and an interesting deep dive as well!).\n\n## Exciting future for the Qwik community\n\nBefore we end this “2.0 teaser” blog post we wanted to also share another thing we are planning for the upcoming version.\n\nDuring the past few months we ran a few surveys and gathered feedback from a lot of you Qwik developers in our community.\n\nWe asked what you loved about Qwik and what you thought could be improved.\n\nThe most common feedback we got from you was:\n\n1.  You want more Qwik ecosystem projects (like a component library).\n2.  You want Qwik to feel more like a community project.\n3.  You want even more activity on the core framework.\n\nSo we invested time in helping out community projects like [Qwik UI](https://qwikui.com) which is about to be beta released soon.\n\nBut we also decided to listen to our community and to make Qwik feel more open to more contributors and companies who’d like to support its development.\n\nThat’s why in the upcoming weeks there will be a few changes to make Qwik an even more welcoming community-driven project.\n\nStay tuned!\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-and-qwik-city-have-reached-beta/index.mdx",
    "content": "---\ntitle: 'Qwik and Qwik City have reached beta! 🎉'\nauthors:\n  - 'Miško Hevery'\ntags: ['Web development']\ndate: 'September 19, 2022'\ncanonical: 'https://www.builder.io/blog/qwik-and-qwik-city-have-reached-beta'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nThe Qwik team is excited to announce that [Qwik](https://qwik.dev/) and Qwik City are in beta!\n\nTo us, beta is an important milestone that we don't take lightly. To us, beta means:\n\n- **Complete features:** All of the goals we set out to implement in this version have been implemented.\n- **Stable APIs:** We’re not aware of any API deficiencies that would need to be address and don't have any plans to change them for now.\n- **No blocking issues:** While no software is ever bug-free, we’re not aware of any blocking issues which would prevent people from using Qwik in production.\n- **Documentation:** While documentation is an ever-evolving goal, beta signals that all of the public APIs are documented, and we have sufficient documentation to enable developers to be successful.\n\n## **About Qwik**\n\n[Qwik](https://qwik.dev/) is a new framework aiming to let developers build instant-on web applications in a familiar React-like component mental model. Qwik achieves this by focusing on server-side-rendering and [forgoing hydration in favor of resumability](https://www.builder.io/blog/hydration-is-pure-overhead). The results are web applications with [O(1) scalability](https://www.builder.io/blog/our-current-frameworks-are-on-we-need-o1) that perform great even on slow networks or mobile devices.\n\nQwik City is an accompanying meta-framework for building Qwik sites. Qwik City provides directory base routing, data fetching, bundle optimization, prefetching, streaming, and interoperability with edge function providers to ensure that out of the box, your site can take full advantage of Qwik and deliver instant-on web apps. Qwik City lets you focus on the site, not fine-tuning the delivery of HTML, CSS, JavaScript, bundling, and prefetching to make your site fast.\n\nQwik is part of a new breed of web frameworks that own all of the concerns associated with building a fast site. Because Qwik is vertically integrated, it owns rendering, style splitting, SSR, bundle optimization, prefetching, data serialization, and resumability. By owning the whole problem space, Qwik can optimize better, frequently delivering close to zero JavaScript on site startup and seamlessly transitioning to a fully interactive app. It is our no-compromise philosophy.\n\nQwik is designed from the ground up to:\n\n- Provide **instant-on** experience for end users, even on slow networks or devices, through [resumability](https://www.builder.io/blog/hydration-is-pure-overhead).\n- Have **composable HTML**: Multiple servers can collaborate on building an SSR response, which enables fast responses that are fully personalizable. This is especially useful for large teams working with micro-frontend architectures.\n- Be **streamable**, taking into account data fetching, styling, and promises to get every last bit of performance out of our infrastructure.\n\n## **What’s next?**\n\nWe will let the beta get some use from our community to ensure that no issues exist, and if they do, we can quickly take care of them. After this settling period, we will declare 1.0.\n\nAfter 1.0, we have exciting plans to attack areas that don't have good performance solutions in our industry. One such area is delivering personalized content to our users. Personalization is hard because executing the framework across the whole application on the server is computationally expensive. We think the solution is to break the application into smaller chunks. By breaking the application into chunks (we call them containers), we can:\n\n- Heavily cache the containers: While caching a user response is not feasible on page level (each user has a different response), caching is possible on a subsection of page level.\n- Render each container on a different edge function.\n- Provide fast and computationally inexpensive personalization by only rendering parts that are different between users and focusing on assembling the responses from pre-existing containers (either cached or delivered from other edge workers).\n- Stream out of order, allowing us to render a placeholder and continue streaming past it, returning once the data is available on the server.\n\n## **Check out our other open-source projects**\n\nBuilder.io prides itself on building open-source technologies to solve today's web problems.\n\n- [**Partytown**](https://partytown.qwik.dev/): Third-party scripts are often the source of slow site startup, executing eagerly and creating contention for the main thread. Partytown is a way to offload third-party scripts from your main thread to a web worker, leaving the main thread free to focus on user interactions. Integration of partytown often results in significant PageSpeed score improvement!\n- [**Builder.io Qwik SDK**](https://www.builder.io/c/docs/getting-started): Now you can integrate Qwik City sites with [Builder.io Visual CMS](https://www.builder.io/visual-development-platform) and give business team members a Visual Editor to create, edit, and personalize content quickly using your Qwik components. Business teams get the freedom to make changes, and engineers retain control of the site or app without having to be involved in each change.\n- [**Mitosis**](https://mitosis.builder.io/): Write code once in Mitosis, and generate canonical output for all of today's popular frameworks. Allows your team to write code once and support many different outputs. Especially useful for creating design systems consistent across an organization where different teams use different tech stacks.\n\nTogether, these solutions will help developers create fast websites — and ultimately, a better internet. Happy building!\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-city-routing/index.mdx",
    "content": "---\ntitle: 'Qwik City Routing: A Visual Guide'\nauthors:\n  - 'Vishwas Gopinath'\ntags: ['Web development']\ndate: 'July 20, 2023'\ncanonical: 'https://www.builder.io/blog/qwik-city-routing'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock >\n\nRouting plays a crucial role in the world of web development, allowing seamless navigation between various pages or views within an application. In this blog post, we will explore [Qwik’s](https://qwik.dev/) routing capabilities with a visual guide.\n\n## Getting started\n\nWhile Qwik primarily focuses on the Component API, the routing feature is supported by **[Qwik City](https://qwik.dev/docs/qwikcity/)**. Qwik City can be thought of as the equivalent of Next.js for React, Nuxt for Vue, SvelteKit for Svelte, and Analog for Angular.\n\nTo begin, follow these commands in the terminal to create and run a new Qwik City project:\n\n> 📖 Select “Empty App” as your starter template when creating the app.\n\n```bash\nnpm create qwik@latest\ncd qwik-app\nnpm start\n```\n\nOpen the project in your preferred code editor.\n\n## Routing conventions\n\nQwik City employs a directory-based routing mechanism, where URL paths in the browser are determined by files and folders in the codebase. Following conventions is crucial for proper routing functionality. Let's discuss and understand the different conventions.\n\n> 📖 In this blog post, we will concentrate solely on pages (UI) within Qwik City's routes, without delving into endpoints (API requests). Endpoints will be addressed comprehensively in a separate blog post.\n\n## Root route\n\nAt the heart of Qwik City’s routing is the `routes` folder within the `src` folder. To create a route for the root URL (`localhost:5173`), follow these steps:\n\n- Inside the `routes` folder, create an `index.tsx` file. This file is special to Qwik City and represents the route.\n- Define a simple Qwik component in the `index.tsx` file, to represent the Home page:\n\n```tsx\n// routes/index.tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>Welcome home!</h1>\n})\n```\n\nLuckily for us, the starter ships with a root route. Open your browser and navigate to `localhost:5173` to display the “Welcome home” message.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F812b72f8d1a94457bb16c3181b162732%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=812b72f8d1a94457bb16c3181b162732&alt=media&optimized=true\"  type=\"video/mp4\"/>\n</video>\n\n## Adding more routes\n\nLet's now create two more routes: one for the About page and another for the Profile page.\n\n- Create a `src/routes/about` folder.\n- Inside the `about` folder, create an `index.tsx` file. This file represents the route.\n- Define a minimal Qwik component in `index.tsx` file to represent the About page:\n\n```tsx\n// routes/about/index.tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>About me</h1>\n})\n```\n\n- Similarly, create a `src/routes/profile` folder.\n- Inside the `profile` folder, create an `index.tsx` file. This file represents the route.\n- Define a simple Qwik component in the `index.tsx` file to represent the \"Profile\" page:\n\n```tsx\n// routes/profile/index.tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>My profile</h1>\n})\n```\n\nWhen you visit the root URL, `localhost:5173`, the home page will still be displayed. However, if you navigate to `localhost:5173/about`, you will see the About me page. Similarly, changing the URL to `/profile` will render the My profile page.\n\nThis demonstrates that routes are associated with a file based on the containing folder's name within the `routes` folder. The `index.tsx` file within the `about` folder corresponds to `/about`, while the `index.tsx` file within the `profile` folder corresponds to `/profile`.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F006cfdab3cbb4a59881cecbc83ed97fc%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=006cfdab3cbb4a59881cecbc83ed97fc&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n### Handling non-matching routes\n\nWhat happens if you enter a URL that cannot map to a file within the `routes` folder? For example, `/dashboard`. Qwik City will automatically respond with a `404 Not Found` response and a view displaying possible routes in the app in dev mode. You don't have to explicitly handle non-matching routes, as Qwik City takes care of this for you.\n\n> 📖 You can also define a [custom 404 page](https://qwik.dev/docs/advanced/routing/#custom-404-page) or a [dynamic 404 page](https://qwik.dev/docs/advanced/routing/#dynamic-404-page).\n\n## Nested routes\n\nIn addition to basic routes, Qwik City offers support for nested routes, so you can establish a hierarchical structure within your application. Let’s aim to render a page when the user navigates to the URL `localhost:5173/blog`. Furthermore, we need to render pages for `localhost:5173/blog/first` and `localhost:5173/blog/second`.\n\nTo implement nested routes, follow these steps:\n\n- Create a `src/routes/blog` folder.\n- Inside the `blog` folder, create an `index.tsx` file for the main blog page:\n\n```tsx\n// routes/blog/index.tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>My blog</h1>\n})\n```\n\n- Navigate to `localhost:5173/blog` to see the _My blog_ page.\n- To implement `/blog/first` and `/blog/second` routes, create `index.tsx` files in the `src/routes/blog/first` and `src/routes/blog/second` folders:\n\n```tsx\n// routes/blog/first/index.tsx\n\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>First blog post</h1>\n})\n```\n\n```tsx\n// routes/blog/second/index.tsx\n\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>Second blog post</h1>\n})\n```\n\nNow, navigating to `localhost:5173/blog/first` displays the first blog post, and `localhost:5173/blog/second` shows the second blog post.\n\nBy creating a nested folder structure, Qwik City automatically routes the files accordingly. This simplifies the process of creating nested routes and enhances the organization and structure of your application.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F677ffc29940a42ab911464f1b9d50758%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=677ffc29940a42ab911464f1b9d50758&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Dynamic routes\n\nPredefined paths like `/blog/first` and `/blog/second` may not always be suitable for complex applications with hundreds of routes. Qwik City supports dynamic routes to handle such scenarios. Let’s create dynamic routes to handle a product listing and detail page.\n\nTo create dynamic routes, follow these steps:\n\n- Create a `src/routes/products` folder.\n- Inside the `products` folder, create an `index.tsx` file to display a list of three products:\n\n```tsx\n// routes/products/index.tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Product List</h1>\n      <h2>Product 1</h2>\n      <h2>Product 2</h2>\n      <h2>Product 3</h2>\n    </>\n  );\n});\n```\n\n- By navigating to `localhost:5173/products` in the browser, the list of products displays.\n- For the details page, within the `products` folder, create a new folder named `[productId]`. The square brackets indicate a dynamic route segment.\n- Inside the `[productId]` folder, create an `index.tsx` file:\n\n```tsx\n// routes/products/[productId]/index.tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>Details about the product</h1>\n});\n```\n\nNow, when you navigate to `localhost:5173/products/1`, you'll get the product details page. Similarly, accessing `/products/2`, `/products/3`, or even `/products/100` will display the same details page. `[productId]` is the dynamic route segment that can accommodate values like 1, 2, 3, and so on.\n\nTo display the specific product ID, you can make use of the `useLocation()` function from Qwik City. Modify the component as follows:\n\n```tsx\n// routes/products/[productId]/index.tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation();\n  return <h1>Details about product {loc.params.productId}</h1>\n});\n```\n\nNow, when you navigate to `localhost:5173/products/1`, the details about product 1 display. Similarly, visiting `/products/100` displays details about product 100.\n\nDynamic routes are beneficial when implementing the list-detail pattern in any UI application. By understanding how to create dynamic routes in Qwik City, you can build flexible and scalable applications that adapt to varying user interactions.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F68bf83be55a14884a5b4c77079e2612d%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=68bf83be55a14884a5b4c77079e2612d&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Nested dynamic routes\n\nIn the previous section, we learned about dynamic routes. Now, let's take it a step further and explore nested dynamic routes.\n\nComplex applications often require multiple dynamic route segments. For instance, when navigating to `/products/1`, the user expects to get the details for product 1. Similarly, visiting `/products/1/reviews/1` should display the first review for that product. Let's go over how we can achieve this.\n\nTo create nested dynamic routes, follow these steps:\n\n- Create a `src/routes/products/[productId]/reviews` folder. This structure takes us to the route \"/products/productId/reviews.\" However, we also need a dynamic `reviewId`.\n- Within the `reviews` folder, create a new folder named `[reviewId]`. Once again, the square brackets indicate a dynamic route segment.\n- Inside the `[reviewId]` folder, create a `index.tsx` file where we'll define a Qwik component to display both the `productId` and the `reviewId`.\n\n```tsx\n// routes/products/[productId]/reviews/[reviewId]/index.tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation();\n  const { productId, reviewId } = loc.params\n  return <h1>Review {reviewId} for product {productId}</h1>\n});\n```\n\nNow, if we navigate to `localhost:5173/products/1/reviews/1` in the browser, the expected text displays. Similarly, navigating to `productId` 100 and `reviewId` 5 will reflect the corresponding IDs in the UI.\n\nThe key takeaway from this section is that it is possible to create nested dynamic routes by having dynamic segments in the folder names.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fb5e3716e5aa140fc9b70c0ca1ef3894d%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=b5e3716e5aa140fc9b70c0ca1ef3894d&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Catch-all routes\n\nQwik City provides the catch-all routes feature which allows for flexible routing. Let's say we want to create a documentation site with multiple features and concepts, where each concept has its own unique route. Instead of creating separate files for each route, we can use a catch-all route.\n\nTo implement a catch-all route, follow these steps:\n\n- Create a `src/routes/docs` folder.\n- Inside the `docs` folder, create a folder with a special name recognized by Qwik City. Use square brackets and three dots (for example, `[...slug]`) to enclose a name of your choice.\n- Inside the `slug` folder, create an `index.tsx` file with a basic Qwik component representing the documentation home page.\n\n```tsx\n// routes/docs/[...slug]/index.tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>Docs home page</h1>\n});\n```\n\nBy using this structure, the `index.tsx` file will match any URL that contains the `/docs` segment in the path. This way, we can define a single file that handles all the route segments in the URL.\n\nTo access the different segments in the URL, rely on the `useLocation()` function that Qwik City provides. For example: `localhost:5173/docs/routing/catch-all-segments` can render the following component:\n\n```tsx\n// routes/docs/[...slug]/index.tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation()\n  const slugArr = loc.params.slug.split('/')\n  if (params.slug.length === 2) {\n    return (\n      <h1>\n         Docs for feature {params.slug[0]} and concept {params.slug[1]}\n      </h1>\n    );\n  } else if (params.slug.length === 1) {\n    return <h1>Viewing docs for feature {params.slug[0]}</h1>;\n  }\n});\n```\n\nWith catch-all segments, you can create a hierarchical structure for your routes, allowing better organization and SEO, while reusing a single file for different variations of the URL. This approach is particularly useful for documentation websites.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F7a07a0debb65432d9d79c75dea4b964d%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=7a07a0debb65432d9d79c75dea4b964d&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Layouts\n\nWe’ve learned that a page represents a unique UI for a specific route. However, in many cases, we want to have a consistent layout across multiple pages in our application, such as a header at the top and a footer at the bottom. With layouts, achieving this becomes much easier and more flexible.\n\n### Layouts in Qwik City\n\nSo, what exactly are layouts? A layout in Qwik City is a UI component that is shared between multiple pages in an application. It allows us to define a common structure and appearance for a group of pages, reducing redundancy and promoting code reusability.\n\n## Creating a layout\n\nTo create a layout, we need to define a Qwik component that exports as the default from a file named `layout.tsx`. This component should render a `Slot` component, which will be populated with the content of the child page during rendering.\n\nThis way, the child page becomes a part of the layout, and we can design a consistent UI around it.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fb8b9ea8919344d7e8f0a5dc85f02cf72%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=b8b9ea8919344d7e8f0a5dc85f02cf72&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nWith an empty Qwik app, a special layout file, `layout.tsx` is automatically generated in the `routes` folder.\n\n```tsx\n// routes/layout.tsx\nimport { component$, Slot } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <Slot />;\n});\n```\n\nThe layout component contains a `Slot`, which represents the child page component rendered within the layout. For `http://localhost:5173/about`, `Slot` is replaced by the component defined in `routes/about/index.tsx` file.\n\nHere’s the same layout with a Header and Footer component:\n\n```tsx\n// routes/layout.tsx\nimport { component$, Slot } from '@builder.io/qwik';\n\nimport Header from '~/component/header/header';\nimport Footer from '~/components/footer/footer';\n\nexport default component$(() => {\n  return (\n    <>\n      <Header />\n      <main>\n        <Slot />\n      </main>\n      <Footer />\n    </>\n  );\n});\n```\n\nThe header and footer can be customized according to our needs, providing the desired layout structure and styles. It's important to note that since the layout is applied to every page, the header and footer will be visible regardless of the current route. This means that if we navigate to different pages like `/about` or `/products`, the header and footer sections remain consistent.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ff70fe881a58747f4a81563826fc1f941%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=f70fe881a58747f4a81563826fc1f941&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Nested layouts\n\nIn addition to the Root layout, Qwik City supports the concept of nested layouts. This feature allows us to define layouts specific to certain areas of our application.\n\nConsider a product details page that dynamically reads the product ID from the route parameters. Here is the folder structure for the dynamic route:\n\nThe `routes` folder contains a layout file and a `products` folder. The `products` folder, in turn, contains the dynamic `[productId]` folder.\n\nThe `index.tsx` file in the `[productId]` folder contains the `ProductDetails` component. This component displays the product ID in the JSX.\n\n```tsx\n// routes/products/[productId]/index.tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation();\n  return <h1>Details about product {loc.params.productId}</h1>\n});\n```\n\nIf we want to create a layout specifically for the product details page, we can create a separate `layout.tsx` file within the `[productId]` folder. The nested layout file can have its own structure and content, tailored specifically to enhance the display of product details pages. Here’s the code for the product details layout file:\n\n```tsx\n// routes/products/[productId]/layout.tsx\nimport { component$, Slot } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <Slot />\n      <h2>Featured products</h2>\n      {/* Carousel of featured products */}\n    </>\n  );\n});\n```\n\nWe define the nested layout as a Qwik component, similar to the Root layout, and it should also accept a `Slot` component. In this case, the `Slot` component represents the content of the product details page. As part of the layout, we render a carousel of featured products.\n\nBy nesting layouts, we can create a hierarchy of shared UI components that apply only to specific areas of our application. For instance, the Root layout can contain the main structure, such as the header and footer, while the nested layout within the `productId` folder can focus on displaying featured products related to that specific product.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F79ff3e1e756044c5b13fae8562d5fc9f%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=79ff3e1e756044c5b13fae8562d5fc9f&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Grouped layouts\n\nGrouped layouts allow logical grouping of routes that share a layout without impacting the URL structure. They can be created by wrapping a folder in parentheses: `(folderName)`.\n\nFor instance, `routes/(auth)/register/index.tsx`, `routes/(auth)/login/index.tsx`, and `routes/(auth)/reset/index.tsx` can be accessed at `/register`, `/login`, and `/reset`, respectively. All three routes will use the layout defined in `routes/(auth)/layout.tsx`.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ffc8d936f6b7741519c3cb0f6dbf65651%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=fc8d936f6b7741519c3cb0f6dbf65651&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Named layouts\n\nIn certain cases, sibling routes may require distinct layouts that differ significantly from one another. Qwik City provides the ability to define multiple layouts for sibling routes, including a default layout and additional named layouts. This allows child routes to request a specific named layout based on their requirements.\n\nTo create a named layout, the filename should start with \"layout\" followed by a dash \"-\" and a unique name. For example, a named layout could be named `layout-two.tsx`. A route can then request the named layout by adding the suffix “@two” to the file name: `routes/(auth)/reset/index@two.tsx`.\n\n### Visual representation\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F86ddf689716648f793175436b2e53df2%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=86ddf689716648f793175436b2e53df2&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Conclusion\n\nIn this blog post, we explored the basics of routing in Qwik City. We discussed routing conventions, created routes for different scenarios, and highlighted Qwik City's convention over configuration approach for routing.\n\nLayouts allow us to define consistent UI structures across multiple pages, reduce code duplication, and easily manage shared components. Nested layouts take this concept even further, enabling us to create specialized layouts for different sections of our application. Grouped layouts, on the other hand, allow us to share UI without affecting the URL. Named layouts allow us to select a layout for a specific route.\n\nWith Qwik City, you can easily define and manage routes by leveraging the file and folder structure of your codebase, eliminating the need for additional routing configuration.\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-city-server-functions/index.mdx",
    "content": "---\ntitle: 'Introducing Qwik City Server Functions'\nauthors:\n  - 'Manu Mtz.-Almeida'\ntags: ['Qwik']\ndate: 'February 15, 2023'\ncanonical: 'https://www.builder.io/blog/qwik-city-server-functions'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport { DiscordLink } from '~/routes/(blog)/blog/components/mdx/discord-link';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nToday we are thrilled to show what the [Qwik](https://qwik.dev/) Core Team has been working on:\n\n- **Data Loaders**: reactive low latency data loading in the server.\n- **Form Actions**: run server code on user interaction\n\n```tsx\nexport const useGetServerTime = loader$(() => {\n  // This code runs in the server\n  return new Date();\n});\n\nexport const useAddUser = action$(async (user) => {\n  const userID = await db.users.add(user);\n  return {\n    success: true,\n    userID,\n  };\n});\n\nexport default component$(() => {\n  // Data can be consumed during SSR and SPA!!\n  // Rendering data using signals\n  // no need for async and await - Qwik handles it for you!\n  const serverTime = useGetServerTime();\n  const addUser = useAddUser();\n  return (\n    <div>\n      <p>Server time: {serverTime.value.toISOString()}</p>\n      <Form action={addUser}>\n        <input name=\"name\" />\n        <button type=\"submit\">Add user</button>\n        {addUser.value?.success && <div>User added successfully</div>}\n      </Form>\n    </div>\n  );\n})\n```\n\n## The Server vs. Browser Duality\n\nOne of the core ideas of Qwik is to run your app on the server and continue its execution on the browser when the user interacts. While Qwik was designed from the ground up to be a Server-Side Rendered (SSR) and Single-Page Application (SPA) technology, **it doesn't distinguish between server and browser**, ie, it treats all code equally, all code might run in the server or the browser.\n\nThat's where [Qwik City](https://qwik.dev/qwikcity/overview/) enters the scene, a meta framework built on top of the resumability capabilities of Qwik to bring routing and data-fetching patterns. Qwik City is to Qwik, what NextJS is to React, Sveltekit is to Svelte or Solid Start is to Solid.\n\n## Data fetching ecosystem\n\nIn this great tweet from [Theo](https://twitter.com/t3dotgg) (CEO of [ping.gg](http://ping.gg/)), he points out 3 big camps of solutions for the server/client communication problem:\n\n- Different teams/companies: [GraphQL](https://graphql.org/) / REST\n- Same team: [tRPC](https://trpc.io/) / GraphQL\n- **Same team using typescript: tRPC / Qwik City**\n\ntRPC hits the sweet spot for most web apps! This is exactly the problem that Qwik City **server functions** solve.\n\nIn the context of Qwik City, the problem becomes a little bit more complicated than hitting an HTTP endpoint, reactivity, validation, streaming, avoiding request waterfalls, caching, and the list goes on. That’s why this is a problem that’s worth solving at the meta-framework level!\n\n## Introducing Qwik `loader$()`\n\nQwik's Data Loader solves the issue of quickly fetching data to be displayed in the HTML. It helps to ensure that the data is available in a timely manner. This helps to improve the user experience and reduce loading times.\n\nQwik City goes a long way to execute all relevant loaders as soon as possible and in parallel to keep latency as low as possible, in addition, loaders are connected to the reactivity system of Qwik powered by [signals](https://qwik.dev/docs/core/state/#usesignal), so new data will automatically and efficiently update all parts of the app that depend on it.\n\n```tsx\nimport { loader$ } from '@builder.io/qwik-city';\n\nexport const useGetServerTime = loader$(() => {\n  return new Date().toIsoString();\n});\n\nexport default component$(() => {\n  const serverTime = useGetServerTime();\n  return (\n    <div>{serverTime}</div>\n  )\n});\n```\n\nThanks to `defer`, loaders can return a promise and start streaming HTML before completion, meaning that we can render and send parts of the site before the loader has resolved. This way, loaders that might take a longer time to resolve will not block the whole site.\n\n```tsx\nimport { loader$ } from '@builder.io/qwik-city';\n\nexport const useGetProduct = loader$(({defer}) => {\n  const promise = expensiveFetch();\n  return defer(promise);\n});\n\nexport default component$(() => {\n  const productResource = useGetProduct();\n  return (\n    <Resource value={productResource}\n      onResolved={(value) => (\n        <article>\n          <div>Product name: {value.name}</div>\n          <img src={value.src} />\n        </article>\n      )}\n    />\n  );\n});\n```\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fbef031efb09f4b4e9046b9af45e32818%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=bef031efb09f4b4e9046b9af45e32818&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nData loaders are equivalent to [Next's](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props) [`getServerProps()`](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props),\n[Remix](https://remix.run/docs/en/v1/route/loader) [`loaders`](https://remix.run/docs/en/v1/route/loader),\n[SvelteKit’s](https://kit.svelte.dev/docs/load) [`load function`](https://kit.svelte.dev/docs/load) and SolidStart’s [`createResource`](https://www.solidjs.com/docs/latest/api#createresource)\nfunction. They are server-only routines that are executed as soon as possible to\nreduce latency and provide data to the later rendering process.\n\nHowever, Qwik is able to take these concepts even further and `loader$()` comes with some advantages!\n\n### Zero-effort type safety\n\nServer loaders are just exported functions that can be consumed, imported, and bring all the type information without any extra errors or manual, error-prone typing.\n\nIn other solutions, developers are required to manually specify the types, because the loaders and the components are connected through some internal magic that the type system does not understand, for example:\n\n```tsx\nexport const loader = () => {\n  return {\n    id: '42',\n    name: 'Xmas pants',\n    description: 'Ugly Xmas pants to surprise all your family'\n  }\n};\n\nexport default () => {\n  const product = useLoaderData();\n  // product: any\n  return (\n    <div>Product: {product.name}</div>\n  )\n}\n```\n\nWith Qwik, the type information naturally flows because the loaders references are implicitly imported, allowing TS to do its job for you:\n\n```tsx\nexport const useGetProduct = loader$(() => {\n  return {\n    id: '42',\n    name: 'Valentines Teddy-Bear',\n    description: 'Handmade and Guaranteed For Life.'\n  };\n});\n\nexport default component$(() => {\n  const product = useGetProduct();\n  // Type of product: {id: string, name: string, description: string}\n  return (\n    <div>{product.value.name}</div>\n  )\n})\n```\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F8db7184f5fac4bbeaff1756fdc440904%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=8db7184f5fac4bbeaff1756fdc440904&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n### Colocation\n\nLoaders can be located anywhere and referenced and imported from any file, bringing with them their types and data efficiently.\n\n```tsx\n// Notice we're importing a loader from a different file!\nimport { useAuthSessionLoader } from '../../layout.ts';\n\n// and we can have multiple loaders.\nexport const useGetLoggedInUserMessage = loader$(() => { \n  return { \n    message:'Glad to have you back!'\n  }\n});\n  \nexport default component$(() => {\n  const signal = useAuthSessionLoader();\n  const loggedInUserMessage = useGetLoggedInUserMessage();\n\n  return (\n    <div>\n      { signal.value.isLogin\n        ? loggedInUserMessage.value.message\n        : 'You are NOT logged in'\n      }\n    </div>\n  )\n})\n```\n\n### Low-level HTTP request access\n\nLoaders are internally implemented as [middleware](https://en.wikipedia.org/wiki/Middleware). This means that loaders get full access to the Request and Response, allowing them to take control of the request header, status, and HTTP body.\n\nEven Qwiks streaming SSR is implemented as a middleware, so even a custom error middleware can capture a crash coming from a component.\n\n```typescript\nexport const useGetActiveUser = loader(async ({params, redirect}) => {\n  const productID = params['id'];\n  const product = await db.getProduct(id);\n  if (!product) {\n    throw redirect(301, '/all-products');\n  }\n  return user;\n});\n```\n\n## Introducing Qwik `action$()`\n\n**Form Actions** solve the problem of executing code in the server when there is some user interaction such as: submitting a form, signing in, or adding an item to the cart.\n\n```typescript\nimport { action$ } from '@builder.io/qwik';\n\nexport const useAddUser = action$((user) => {\n  const userID = db.users.add(user);\n  return {\n    success: true,\n    userID,\n  };\n});\n```\n\n### First-class `<form>` support\n\nActions can be invoked programmatically with JS from the browser, but they work better as a `<form>` action endpoint.\n\nThanks to good old forms, actions can be executed even if the JS is disabled.\n\n```tsx\nimport { action$, Form } from '@builder.io/qwik-city';\nimport { component$ } from '@builder.io/qwik';\n\nexport const useAddUser = action$((user) => {\n  const userID = db.users.add(user);\n  return {\n    success: true,\n    userID,\n  };\n});\n\nexport default component$(() => {\n  const action = useAddUser();\n  return (\n    <Form action={action}>\n      <input name=\"name\" />\n      <button>Add user</button>\n      {action.value?.success && <div>User added successfully</div>}\n    </Form>\n  );\n});\n```\n\n### Built-in validation\n\nForm actions, such as RESTful APIs, receive data from external sources, such as a browser, so validating is an extremely good practice.\n\nHowever, the developer usually neglects this diligence because the lack of validation is usually not a problem until YouAreUnderAttackt™️.\n\nQwik City Actions put validation and type safety together to enjoy the benefits and boost security.\n\nBy default, actions come with built-in support for [Zod](https://zod.dev/), a _TypeScript-first schema validation with static type inference_.\n\n```typescript\nexport const useAddUser = action$(\n  (user) => {\n    // `user` is typed { name: string }\n    const userID = db.users.add(user);\n    return {\n      success: true,\n      userID,\n    };\n  },\n  zod$({\n    name: z.string(),\n    age: z.coerce.number(),\n  })\n);\n```\n\n## Show me the code\n\nWanna see a live app using the new APIs? Give a try to [Promptle](https://promptle.art/) a game built with Qwik and Form Actions!\n\nYou can also see the [source code on Github](https://github.com/manucorporat/promptle).\n\n## The future is bright\n\nWe're thrilled to ship these features following all the iterative feedback, and we can't thank the community enough for all the help.\n\nA lot of work has been put into this release as we are honing in `v1` for Qwik and Qwik City.\n\nIf you have any feedback, we’d love to hear it!\n\nYou can find the core team in our <DiscordLink /> or you can tweet out to [QwikDev](https://twitter.com/QwikDev).\n\nLet’s make the web Qwik!\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-next-leap/index.mdx",
    "content": "---\ntitle: 'Qwik’s Next Leap - Moving Forward Together'\nauthors:\n  - 'Wout Mertens'\n  - 'Maïeul Chevalier'\n  - 'Shai Reznik'\ntags: ['Web Development']\ndate: 'March 26, 2024'\ncanonical: 'https://www.builder.io/blog/qwik-next-leap'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\n## We’ve got some exciting news to share with you today!\n\nQwik, which started as a small project we really needed for our own product, has grown into a worldwide phenomenon.\n\nEver since Qwik 1.0 got released we’ve been fortunate to have a lot of excited developers joining our community and wanting to contribute and help.\n\nSince the beginning, our goal with Qwik was to benefit the entire JavaScript community and to help push the web forward.\n\nThat’s why we’ve made it a first priority to listen very carefully to the needs of our community members and the companies who are using Qwik in production and to make sure Qwik solves their issues, too.\n\nTo achieve that we kept monitoring our discord and social media accounts and also proactively sent community surveys to gather feedback about what our developers need and how the project can be further improved.\n\n**In the past year, we heard 3 things that kept repeating:**\n\n1.  Bigger ecosystem for Qwik\n2.  More (and faster) activity on core\n3.  Make Qwik a true community-driven project\n\n## **You spoke, we listened**\n\nYou told us — “This is the time to make Qwik grow faster and better,” and you are completely right!\n\nThis means, for example, more ecosystem projects that fill in the missing gaps large-scale applications need.\n\nThat’s why we focused some of our efforts on helping out community-led projects such as [Qwik UI](https://qwikui.com/) and others to be the most robust and “optimized for Qwik” they can be.\n\nBut growing faster and better also means **better collaboration**.\n\nWe know that *our community is the lifeblood of Qwik*.\n\nOur very talented and hardworking team — Misko, Adam, and Manu — managed to create a fully featured framework (and meta-framework) in a relatively short time compared to the team size.\n\nWe are now ready to take it to the next step.\n\nQwik has matured and gone from an experimental new framework to a project companies depend on.\n\nSo in order to respect these companies and based on the feedback we got, we decided to expand the core team, and decided to do it in collaboration with other companies and our awesome community.\n\n## **Now, it’ll be all about Qwik**\n\nWe are really proud of the products we’re building here at Builder.io, and we believe they are a really great fit for Qwik (that’s why we built this framework in the first place).\n\nBut in order to bring more people along for the journey, we realized that a few changes are needed.\n\nFirst of all - branding.\n\nWe (Builder.io) will keep supporting and sponsoring the efforts behind Qwik, but we would like to make it easier for other companies that are invested in Qwik to support it as well, in the way of an open collective.\n\nThat’s why, in the next couple of weeks, you’ll start noticing some changes around the Qwik brand.\n\nOur discord will be renamed to `Qwik`, our GitHub repo will be moved to our (already existing) `QwikDev` repo, and for version 2, the only breaking change we’re planning to introduce will be a new npm organization named `@QwikDev`, which 2.x versions will get published under.\n\nOur logo will still be the leading sponsor of the project and you might notice more logos in the future in a sponsors section, but the focus will be on Qwik.\n\nWe feel these changes reflect what you’ve been asking for — more and faster activity on the core framework and a true community project feel for the contributors involved, while staying true to our core values and the driving philosophy behind Qwik.\n\nIn addition to these changes, we’ll start implementing a new project management process and governance model that will make it easier for community members and companies to join the effort and help to materialize Qwik’s vision of **Automatic Optimization** (with JavaScript Streaming and Resumability) for the benefit of all web developers.\n\n> Qwik belongs to all of us, and now it’ll be driven by all of us…together! 🙌\n\n## **What’s next**\n\nWe’re working hard on making Qwik V2 awesome without any breaking API changes.\n\nAs always, we’ll keep you updated on our progress using our Qwik discord and our new (and soon-to-be-revealed) blog on the new [`qwik.dev`](https://qwik.dev/) website.\n\nWe wanted to take this opportunity to also thank our awesome community members who contribute to Qwik core. Without them it wouldn’t be where it is today — Wout Mertens, Giorgio Boa, Roman Zanettin, Jack Shelton, Dmitry Stepanenko, Michal Popek, Ken Parsons, Sebastian Rapport, PatrickJS, and many many more!\n\nThank you. 🙏\n\nWe’re excited to see Qwik become…well…Qwiker! 😊💪⚡\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-rc-milestone/index.mdx",
    "content": "---\ntitle: 'Qwik Reaches RC Milestone'\nauthors:\n  - 'The Qwik Team'\ntags: ['Qwik']\ndate: 'March 30, 2023'\ncanonical: 'https://www.builder.io/blog/qwik-rc-milestone'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport { DiscordLink } from '~/routes/(blog)/blog/components/mdx/discord-link';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\nToday we are excited to announce Qwik v1 Release Candidate! This is a major milestone for our team, and we are grateful for the support of our community.\n\n## **Qwik: a modern framework**\n\nQwik is a next-gen web application framework (and meta-framework) designed for instant application startup, no matter how big the app is. Qwik uses a modern and innovative approach that “<a href=\"https://www.builder.io/blog/speculative-module-fetching\" rel=\"noopener noreferrer\" target=\"_blank\">streams</a>” chunks of JavaScript to the end user — and it does it **automatically!**\n\nThis removes a lot of manual performance optimizations needed in other frameworks, which leads to a much better developer experience. Speaking of DX, Qwik is designed to be familiar, minimal, and straightforward to use. That’s why it uses the well-known JSX syntax, functional components with hooks API style, and is reactive by utilizing <a href=\"https://www.builder.io/blog/usesignal-is-the-future-of-web-frameworks\" rel=\"noopener noreferrer\" target=\"_blank\">signals</a>.\n\nQwik’s unique JavaScript Streaming powered by the <a href=\"https://www.builder.io/blog/resumability-from-ground-up\" rel=\"noopener noreferrer\" target=\"_blank\">resumable</a> execution model enables unmatched user experience and the highest Google <a href=\"https://web.dev/learn-core-web-vitals/\" rel=\"noopener noreferrer\" target=\"_blank\">Core-Web-Vitals</a> scores, all possible thanks to <a href=\"https://www.builder.io/blog/wtf-is-code-extraction\" rel=\"noopener noreferrer\" target=\"_blank\">code-extraction</a>. This means companies that deploy Qwik apps <a href=\"https://web.dev/tags/case-study/\" rel=\"noopener noreferrer\" target=\"_blank\">increase their competitive advantage</a> in terms of conversions, customer happiness, and SEO ranking.\n\n## **RC means Qwik (and Qwik City) are ready for production**\n\nRC (Release Candidate) means that:\n\n- The API is feature complete.We’ve reached all the goals we set out for building applications with Qwik. There are no plans to add or change any more APIs or features before v1.\n- We are not aware of any significant issues which would keep you from succeeding in building amazingly performant production web apps and websites with it.\n- We need your feedback: RC is a period where we want even more feedback from the community to iron out any surprises that would keep v1 from being stable and provide a delightful developer experience.\n\n## **Our favorite features**\n\nQwik (and Qwik City) are packed with many cool features, but here are some that we are incredibly proud of and would like to highlight.\n\n- **Performance at scale**: Qwik applications stay performant even as their complexity grows over time. Sure, any hello-world app, with little to no interactivity, can be fast, but as features are added, Qwik retains consistent startup performance through <a href=\"https://www.builder.io/blog/hydration-is-pure-overhead\" rel=\"noopener noreferrer\" target=\"_blank\">resumability</a>. and it does that - **automatically**!\n- **Edge first + middleware**: Qwik adapters bring Qwik to all major edge providers in a deployment-agnostic way. No lock-in here. Easily deploy the same application with many providers.\n- **Server functions:** During our beta period, we introduced the ability to <a href=\"https://www.builder.io/blog/qwik-city-server-functions\" rel=\"noopener noreferrer\" target=\"_blank\">load data, execute form actions</a> and run any server-side code by using special functions like **routeLoader$()**, routeActions$(), and server$(). This unifies the execution model for all of your code — think of it as RPC without all of the fuss — and the best part is that it even works without JavaScript enabled in the browser, with progressive enhancement by default.\n- **Directory-based routing:** Qwik City is designed with convention-based routing. File-based routing is a familiar feature in today's meta-frameworks. Qwik extends file-based routing with an easy way to compose middleware.\n- **Ecosystem**: our awesome community members have already created many integrations with popular tools like <a href=\"https://storybook.js.org/\" rel=\"noopener noreferrer\" target=\"_blank\">Storybook</a>, <a href=\"https://www.cypress.io/\" rel=\"noopener noreferrer\" target=\"_blank\">Cypress</a>, <a href=\"https://nx.dev/\" rel=\"noopener noreferrer\" target=\"_blank\">nx</a>, <a href=\"https://authjs.dev/\" rel=\"noopener noreferrer\" target=\"_blank\">auth.js</a>, <a href=\"https://vitest.dev/\" rel=\"noopener noreferrer\" target=\"_blank\">vitest</a>, <a href=\"https://vanilla-extract.style/\" rel=\"noopener noreferrer\" target=\"_blank\">vanilla-extract</a>, and there is also a native and accessible UI component library soon to be released (<a href=\"https://github.com/qwikifiers/qwik-ui\" rel=\"noopener noreferrer\" target=\"_blank\">qwik-ui</a>). We are adding more integrations in the next couple of months — yep, things are moving qwikly! ;)\n- **Qwik-react**: it is possible to use React inside a qwik application, but without the cost of hydration. This could bridge the gap for developers coming from the React ecosystem and save time by directly importing React components into a Qwik application (Qwik-angular and Qwik-vue are in the works as well! 🤩).\n\n## **The path to v1**\n\nBetween now and the v1 release, we will focus on polishing, paying special attention to the documentation, and getting started. And, of course, we’ll fixing any surprise bugs which may come up.\n\n## **Special thanks to the Qwik community**\n\nSpecial thanks to the awesome Qwik community for helping us test Qwik during its development. Qwik has gone through growing pains; however, our lovely community members were able to provide us with useful feedback to make it better. It is because of you that Qwik is where it is today.\n\nWe would LOVE to hear what you think. Please share it with us on our <DiscordLink text=\"Discord channel\" /> — and if you’re not part of it, come and experience first-hand how amazing and friendly our Qwik community members are.\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-tasks/index.mdx",
    "content": "---\ntitle: \"Boost Your Site Perf with Qwik's useVisibleTask$ Hook\"\nauthors:\n  - 'Steve Sewell'\ntags: ['Web development']\ndate: 'May 9, 2023'\ncanonical: 'https://www.builder.io/blog/qwik-tasks'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n<ArticleBlock>\n\nLet me show you a technique you can use with the Qwik framework to have incredible stunning animated pages like this, while having a perfect performance score, even on mobile devices.\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F17a4cfac8a634c1fabb83bf46ffc35df%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=17a4cfac8a634c1fabb83bf46ffc35df&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nThe trick, in a nutshell, is to never execute JavaScript until you *absolutely* need it.\n\nAs I scroll through the page below, the Network tab shows that JavaScript is streaming in only a bit at a time, executing only as needed.\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ffdfb11fe2ca64f34a73db816de7ccde3%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=fdfb11fe2ca64f34a73db816de7ccde3&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nThe JavaScript that's sent is extremely minimal — bite-size amounts of code generated by the [Qwik compiler](https://qwik.dev/docs/advanced/optimizer/) only to run when needed.\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fc6067dad66e6497ca8d795c5b670c50f%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=c6067dad66e6497ca8d795c5b670c50f&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Using visible tasks in Qwik\n\nWith Qwik, this takes no extra work. All we need is this [useVisibleTask$](https://qwik.dev/docs/core/tasks/#usevisibletask) hook.\n\n```jsx\nimport { component$, useSignal, useVisibleTask$ } from \"@builder.io/qwik\";\n\nexport const Animated = component$(() => {\n  const animate = useSignal(false);\n\n  useVisibleTask$(() => {\n    animate.value = true;\n  });\n\n  return (\n    <div\n      class={{\n        animate: animate.value,\n      }}\n    >\n      {/* Animated Stuff */}\n    </div>\n  );\n});\n```\n\nAs you may be able to tell from the code above, it is similar in some ways to the `useEffect` hook in React, except:\n\n1.  It only runs when a component is visible\n2.  This component _never_ hydrates\n3.  The component gets compiled down to its bare minimum pieces\n\nLet’s break those down a little further, in reverse order:\n\n### The component gets compiled down to its bare minimum pieces\n\nRather than your entire component downloading and executing on visible, which would simply be hydration on visible (aka progressive hydration), Qwik takes things further and just extracts the bare minimum logic needed.\n\nSo our component above simply compiles to these below 5 lines of code:\n\n```jsx\nimport { useLexicalScope } from '@builder.io/qwik';\n\nexport const app_component_useVisibleTask_wbBu0Yp42Vw = () => {\n    const [animate] = useLexicalScope();\n    animate.value = true;\n};\n```\n\nThis is the absolute bare minimum code that needs to run in the client for this component.\n\nEven if our component had a massive DOM tree and a ton of initialization logic, it wouldn't matter — the above is all you need in the browser so that’s all you get.\n\nFor instance, your component could instead be something like this:\n\n```jsx\nimport { component$, useSignal, useVisibleTask$ } from \"@builder.io/qwik\";\nimport doReallyExpensiveWork from './huge-file'\nimport { SomeHugeComponent, LotsMoreComponents } from './huge-components'\n\nexport const Animated = component$(() => {\n  const animate = useSignal(false);\n\n  useVisibleTask$(() => {\n    animate.value = true;\n  });\n\n  // NBD, this will only run on server\n  const value = doReallyExpensiveWork()\n\n  return (\n    <div\n      class={{\n        animate: animate.value,\n      }}\n    >\n      {/* NBD, these won't load in the browser, even tho this component does */}\n      <SomeHugeComponent value={value} />\n      <LotsMoreComponents />\n    </div>\n  );\n});\n```\n\nBut that’s ok. Even with all that extra work to do, the amount of code needed in the browser is the same, so that tiny snippet of code above is _**still**_ all we would send to the browser.\n\n### The component never hydrates\n\nImportantly, our component will deliver as pure HTML. This is all the browser gets:\n\n```html\n  <div\n    on:qvisible=\"app_component_usevisibletask_wbbu0yp42vw.js\"\n  >\n    <!-- Animated stuff! -->\n  </div>\n```\n\nUnlike today's frameworks, no JavaScript specific to this component will run on startup of your page. This is how we achieve such great performance scores — there is no better way to be fast than to do no work at all.\n\nSo with that tiny HTML, and the [Qwikloader](https://qwik.dev/docs/advanced/qwikloader/) (a tiny \\<1kb JS file that listens to events and loads files), we can [prefetch](https://qwik.dev/docs/advanced/speculative-module-fetching/) that tiny JS in advance and be ready to execute it only when needed.\n\n### The component only runs when visible\n\nOnce our page loads, our Qwikloader will find that JS URL in the DOM and prefetch it.\n\nThen, once this element is visible, we will execute the bare minimum code we showed previously:\n\n```jsx\nimport { useLexicalScope } from '@builder.io/qwik';\n\nexport const app_component_useVisibleTask_wbBu0Yp42Vw = () => {\n    const [animate] = useLexicalScope();\n    animate.value = true;\n};\n```\n\nBecause this code simply changes a signal, and Qwik can listen to signal changes and granularly update the DOM directly (no vdom involved), our UI is now updated with its beautiful animations.\n\nNow keep in mind we are showing a simple example here, but think of how this scales. No matter how complex your site gets, the goal here is to load and execute as little as possible, as late as possible.\n\nThis is in contrast to standard hydration, that must download and execute the whole world (all code for all components on your page) right on startup, wether or not you even need any of it, just to create the initial state tree, bindings, and event listeners.\n\nLuckily, we don’t need any of this with Qwik, due to the painstaking work we did on the framework to create a whole new model for all of this, which we call [Resumability](https://qwik.dev/docs/concepts/resumable/).\n\n## Conclusion\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fa9c381dc8f1e4681afda431dca93c044%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=a9c381dc8f1e4681afda431dca93c044&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nOur goal with Qwik is to make it as effortless as possible to build incredible applications.\n\nThey should be easy, they should run fast, and that should require no extra work from you.\n\nIf you haven’t already, go check out [reflect.app](https://reflect.app/home) for yourself, or any other site in the [Qwik showcase](https://qwik.dev/showcase/).\n\nOr, if you would like to try out Qwik for yourself, you can get started in just one command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm create qwik@latest\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm create qwik@latest\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn create qwik\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun create qwik@latest\n```\n</span>\n</PackageManagerTabs>\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/qwik-v1/index.mdx",
    "content": "---\ntitle: 'Qwik Reaches v1.0'\nauthors:\n  - 'The Qwik Team'\ntags: ['Qwik']\ndate: 'May 1, 2023'\ncanonical: 'https://www.builder.io/blog/qwik-v1'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport { DiscordLink } from '~/routes/(blog)/blog/components/mdx/discord-link';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nThe Qwik team is excited to announce that Qwik has reached v1.0. [Qwik](https://qwik.dev) is a full-stack web framework that brings a fundamentally new approach to delivering instant apps at scale!\n\n> 📽️ Watch our [announcement live stream here](https://www.youtube.com/watch?v=5VQatViWw2k).\n\n## Why another framework?\n\nFrameworks such as React, Vue,&nbsp;Angular,&nbsp;Svelte, SolidJS, and their meta frameworks (Next.js, Nuxt, SvelteKit, SolidStart, Astro) have revolutionized web development by providing powerful tools and abstractions that simplify the process of building complex applications.\n\nThese frameworks have inspired many developers to create innovative solutions that enhance the user experience, and developer experience, and improved the overall quality of web applications.\n\nQwik has drawn much inspiration from these frameworks, leveraging their strengths to provide fast, scalable, and maintainable solutions for building web applications.&nbsp;\n\nBy building on the foundations laid by these frameworks, Qwik is able to provide developers with a powerful toolset that enables them to build web applications quickly and efficiently, while maintaining a high level of quality and performance.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd2366b9aed754cbaa322db2d8c302256?format=webp&width=2000\" alt=\"image optimization\" />\n\nAs web applications get large, their startup performance degrades because current frameworks send too much JavaScript to the client. Keeping the initial bundle size small is a never-ending battle that’s no fun, and we usually lose.\n\nQwik delivers instant applications to the user. This is achieved by keeping the initial JavaScript cost [constant](https://www.builder.io/blog/our-current-frameworks-are-on-we-need-o1), even as your application grows in complexity. Qwik then delivers only the JavaScript for the specific user interaction.\n\nThis ensures that JavaScript does not overwhelm the browser, no matter how large the application gets. Finally, [speculative code fetching](https://www.builder.io/blog/speculative-module-fetching) ensures instant interactivity even on slow and intermittent networks.\n\nThink of it as **streaming for your JavaScript**.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F04e1a9cbc609428fa97f2d46abffaa7d?format=webp&width=2000\" alt=\"image optimization\" />\n\n## Key Features\n\nQwik’s philosophy is to ensure the easy path is the performant path. That’s why, out of the box, Qwik solves for:\n\n### Amazing user experience out of the box\n\n- **Instant loading time with JavaScript streaming**: Deliver applications that ace the [CWV](https://web.dev/vitals/) scores, and maintain them even as the application grows in complexity over time.\n- **Speculative code fetching**: Deliver the code you need exactly when users need it to ensure instant user interactivity, even on slow mobile devices with an unreliable network.\n- **Lazy execution**: Qwik’s [resumable](https://qwik.dev/docs/concepts/resumable/) technology delays the execution of code in the browser as long as possible to keep the browser’s main thread free and responsive to user interactions.\n- **Optimized rendering time**: Qwik is reactive, meaning that by default, it only updates what’s absolutely needed and not more.\n- **Data fetching:** start fetching data on the server to prevent the “waterfall” delays.\n\n### Great developer experience\n\n- **Familiar:** JSX\n- **Directory-based routing**: Create sites with directory-based routing, an industry’s preferred way to declare routes.\n- **First class data access**: Qwik data loaders and form actions give you easy access to your server data with 100% end-to-end type safety and user input validation right out of the box\n- **Middleware**: Declare middleware logic in a portable way allowing you to deploy to all major hosting providers.\n- **A unified execution model**: We all say we are full-stack developers. With Qwik writing front-end and back-end code comes naturally together in a single application codebase and type safety. By default, Qwik applications execute in both server and browser, but it is easy to pin functions to be always server (`server$()`) (or always browser.)\n\n## Integrations\n\nWe are ready for the real world. Qwik offers a rapidly expanding universe of ready-to-use integrations with your favorite libraries and frameworks. Just run `npx qwik add` from the command line and pick what you need from the list.\n\nQwik installs everything in all the right places to get you going. Stable, secure, tested and ready to rock. Everything you need to get started:\n\n- **Write once, deploy anywhere**: We have adapters for Azure, Cloudflare, Google Cloud Run, Netlify, Node.js, Deno, Vercel, and the list is growing. Write your application in a hosting-provider agnostic way to prevent vendor lock-in.\n- **UI Components**: Choose from [QwikUI](https://github.com/qwikifiers/qwik-ui), [Papanasi UI](https://papanasi.js.org/), or battle-tested UI libraries like [Material UI](https://mui.com/), [ChakraUI](https://chakra-ui.com/), [Radix](https://www.radix-ui.com/), or any other React based library via [Qwik-React](https://qwik.dev/docs/integrations/react/).\n- **Image Optimization**: Optimize Images for the best possible user experience with [@unpic/qwik](https://qwik.dev/docs/integrations/image-optimization/#unpicqwik) and [qwik-image](https://qwik.dev/docs/integrations/image-optimization/#unpicqwik).\n- **Internationalization**: Deliver your application in multiple languages using [$localize](https://qwik.dev/docs/integrations/i18n/) and [qwik-speak](https://qwik.dev/docs/integrations/i18n/).\n- **Authentication**: Use industry-leading [AuthJS](https://qwik.dev/docs/integrations/authjs/) to add multiple authentication strategies to your application.\n- **CMS**: Qwik comes with a native integration with [Builder.io](https://www.builder.io/) for structured data and component-level headless content creation and publishing.\n- **Styling**: Qwik allows for lazy loading and component scoping of styles. Combine that with popular solutions such as [PostCSS](https://qwik.dev/docs/integrations/postcss/), [Vanilla Extract](https://qwik.dev/docs/integrations/styled-vanilla-extract/), or [Tailwind](https://qwik.dev/docs/integrations/tailwind/) for your styling needs.\n- **Testing**: Unit test with [Vitest](https://vitest.dev/) and e2e with Playwright and Cypress. Develop and test components with Storybook.\n- **Enterprise Readiness:** Develop enterprise-scale applications and monoreos with qwik-nx, which provides special generators and executors for your NX monorepo.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F1000a84285994e27b63531a667dac5a2?format=webp&width=2000\" alt=\"image optimization\" />\n\n## Interoperability\n\n[Qwik-React](https://qwik.dev/docs/integrations/react/) allows you to lazy hydrate React components within the Qwik application. [Leverage the existing React ecosystem](https://www.builder.io/blog/resumable-react-how-to-use-react-inside-qwik) from within Qwik, use Qwik-React to migrate over to Qwik incrementally, or speed up your React application by delay hydrating parts of it. Qwik-react brings island architecture design-pattern to your React app.\n\nSvelte, Vue, and Angular wrappers are in the works by the community.\n\n## Huge thanks to our amazing community!\n\nQwik boasts a diverse and inclusive [community](https://qwik.dev/community/groups/) of passionate developers, enthusiastic contributors, and supportive users worldwide. This community is always buzzing with energy, constantly collaborating, sharing ideas, and pushing the boundaries of what the framework can achieve.\n\nThere’s also a fast-growing group of community leaders all over the world with developer groups and meetups from France, Netherlands, England, United States, Israel, Portugal, Taiwan, Hungary, and many more that are joining this wonderful group of Qwik community leaders.\n\nIf you’re interested in starting a Qwik community group as well, [please fill in this form](https://forms.gle/m5heWq8gTxrMuQsRA); we’d love to help you out!\n\nOur <DiscordLink text=\"Discord\" /> community is always available to help with any questions you might have. Additionally, we recognize outstanding community members through our Qwik Heroes program, consisting of folks who have gone above and beyond in helping Qwik grow and become better.\n\nWe are proud of the Qwik community and its growth. Check out our tremendous progress in community growth over the past three months.\n\nThe number of <DiscordLink /> members in the last three months has increased from 4k to well over 5k:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F0bccf78cb1854c97885d935aac769ff2?format=webp&width=2000\" alt=\"image optimization\" />\n\nAnd finally, check out our [GitHub page](https://github.com/QwikDev/qwik), where you can be part of the revolution.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Faa080a4135cd423c9f493c1d73d97543?format=webp&width=2000\" alt=\"image optimization\" />\n\nSpecial shout out to our community members for getting us ready for v1: [Giorgio Boa](https://github.com/gioboa), [Shai Reznik](https://github.com/shairez), [Leo](https://github.com/wtlin1228), [Roman Zanettin](https://github.com/zanettin), [Dmitriy Stepanenko](https://github.com/dmitry-stepanenko), [Joshua Reilly](https://github.com/ulic75), [Sai Srikar Dumpeti](https://github.com/the-r3aper7), [Salama Ashoush](https://github.com/salamaashoush), [Paulo H. C. de Oliveira](https://github.com/phcoliveira), [Sebastian Rapport](https://github.com/n8sabes), [PatrickJS](https://github.com/PatrickJS), [Sami Jaber](https://github.com/samijaber), [Yoav Ganbar](https://github.com/hamatoyogi).\n\n## Start using Qwik today!\n\nCheck out our [getting started](https://qwik.dev/docs/getting-started/) page, our [tutorial](https://qwik.dev/tutorial/welcome/overview/), or [Stackblitz](https://qwik.new/) to start playing with Qwik today.\n\nYou will find everything you need to get started Qwikly and learn how Qwik provides a new and innovative way to build your web applications whose performance will not deteriorate as the application grows.\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/resumable-react-how-to-use-react-inside-qwik/index.mdx",
    "content": "---\ntitle: 'Resumable React: How to Use React Inside Qwik'\nauthors:\n  - 'Yoav Ganbar'\ntags: ['Web development']\ndate: 'January 30, 2023'\ncanonical: 'https://www.builder.io/blog/resumable-react-how-to-use-react-inside-qwik'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nDid you know you can leverage almost the entirety of the React ecosystem inside a Qwik application?\n\nBasically, you can build React applications, without ever loading React in the user's browser. Sounds good, doesn't it? Let’s see how this works.\n\n> You can download the code in this blog post on [GitHub](https://github.com/BuilderIO/resumable-react-post).\n\n## Kicking off\n\nFirst, we need a new Qwik app. To create and bootstrap an app, we can run this command — I chose [`pnpm`](https://pnpm.io/) as my package manager, but you can do the same command with `npm`:\n\n```\npnpm create qwik@latest\n```\n\nFollow the CLI (command line interface) prompts. When you finish, it should look something like this:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fbf6f21f590f145c3b7427ab8ead72507?format=webp&width=800\" alt=\"a screenshot showing the CLI output of creating a new Qwik app.\" />\n\n## Installing `qwik-react`\n\nNext, we need to add [`qwik-react`](https://qwik.dev/integrations/react/) so we can wrap our React components with the `qwikify$()` method:\n\n```bash\npnpm run qwik add react\n```\n\nThis will once again give us a CLI output that looks like this:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ffb3bde63f5744eb0bd4c539433c892d8?width=800\" alt=\"a screenshot showing the CLI output of running pnpm run qwik add react.\" />\n\nThe above image shows that this has installed:\n\n- `@builder.io/qwik-react 0.2.1`\n- `@emotion/react 11.10.4`\n- `@emotion/styled 11.10.4`\n- `@mui/material 5.10.10`\n- `@mui/x-data-grid 5.17.8`\n- `@types/react 18.0.14`\n- `@types/react-dom 18.0.5`\n- `react 18.2.0`\n- `react-dom 18.2.0`\n\nMost of these packages help showcase [Material UI](https://mui.com/) working within Qwik, which needs `emotion` as a dependency. The real substance is in `qwik-react` and the `react` and `react-dom` dependencies.\n\n## Initial demo\n\nLet’s run our app in development mode:\n\n```bash\npnpm run dev\n```\n\nNow, if we go to [`http://localhost:5173/`](http://localhost:5173/) the initial page renders:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F4de09e8f126e447c96543d3e6688a331?width=800\" alt=\"A screenshot of a newly created Qwik app.\" />\n\nFor the generated UI, we can go to [`http://localhost:5173/react`](http://localhost:5173/react) to display some React Material UI components inside our Qwik app:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F589ecbdb31484def8d65e8b41318ce3f?width=800\" alt=\"A screenshot of a qwik app using React MaterialUI components.\" />\n\nAnd if we interact with the components, they all work:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F890c91a979964c73b3dc6174a2ec8b87%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=890c91a979964c73b3dc6174a2ec8b87&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## A look under the hood\n\nLet’s open up `src/integrations/react` and check out what the CLI generated:\n\n```tsx\n/** @jsxImportSource react */\n\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { Button, Slider } from '@mui/material';\nimport { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid';\n\nexport const MUIButton = qwikify$(Button);\nexport const MUISlider = qwikify$(Slider, { eagerness: 'hover' });\n\nexport const TableApp = qwikify$(() => {\n  const columns: GridColDef[] = [\n    { field: 'id', headerName: 'ID', width: 70 },\n    { field: 'firstName', headerName: 'First name', width: 130 },\n    { field: 'lastName', headerName: 'Last name', width: 130 },\n    {\n      field: 'age',\n      headerName: 'Age',\n      type: 'number',\n      width: 90,\n    },\n    {\n      field: 'fullName',\n      headerName: 'Full name',\n      description: 'This column has a value getter and is not sortable.',\n      sortable: false,\n      width: 160,\n      valueGetter: (params: GridValueGetterParams) =>\n        `${params.row.firstName || ''} ${params.row.lastName || ''}`,\n    },\n  ];\n\n  const rows = [\n    { id: 1, lastName: 'Snow', firstName: 'Jon', age: 35 },\n    // more rows with same object shape ,removed for brevity.\n  ];\n\n  return (\n    <>\n      <h1>Hello from React</h1>\n\n      <div style={{ height: 400, width: '100%' }}>\n        <DataGrid\n          rows={rows}\n          columns={columns}\n          pageSize={5}\n          rowsPerPageOptions={[5]}\n          checkboxSelection\n          disableSelectionOnClick\n        />\n      </div>\n    </>\n  );\n});\n```\n\nThere are a few things to notice here.\n\nThe first is `/** @jsxImportSource react */` at the top of the file; this instructs the Qwik compiler to use React to produce the JSX.\n\nThe second thing is how React components are _qwikified:_\n\n```typescript\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { Button, Slider } from '@mui/material';\n\nexport const MUIButton = qwikify$(Button);\nexport const MUISlider = qwikify$(Slider, { eagerness: 'hover' });\n```\n\nThe `MUIButton` is declared as a wrapper for `Button` from inside the `@mui/material` package and is exported and ready to use within a Qwik app.\n\nIt is important to note that a component wrapped this way is not interactive by default and renders only the markup.\n\n## Adding interactivity\n\n`MUISlider` has a second argument passed with the `{ eagerness: 'hover'}` option.\n\nThis is how we trigger the React hydration step, which makes the component interactive.\n\nThere are several ways we can define when hydration is triggered.\n\n### With the second argument for `qwikify$`\n\n> The `QwikifyOptions` are undocumented at the moment of writing, as Qwik is still in beta and the docs are still being worked on. You can find the definitions [inside the source code](https://github.com/QwikDev/qwik/blob/HEAD/packages/qwik-react/src/react/types.ts).\n\nFor the `eagerness` property we can pass in one of the following options:\n\n- `load`: triggered once the document loads. Good for UI elements that need to be as interactive as soon as possible.\n- `visible`: hydrate once the component is in the viewport. Good for low-priority UI elements that might be further down the page; that is, below the fold.\n- `idle`: the component hydrates when the browser becomes idle after every important task has been completed.\n- `hover`: trigger hydration when the mouse hovers over the element.\n\n### Client strategies (directives)\n\nSimilar to [Astro’s client directives](https://docs.astro.build/en/reference/directives-reference/#client-directives), Qwik has the `client:` JSX property. They are the same as the aforementioned strategies but you can put them on the component’s markup:\n\n```tsx\nexport default component$(() => {\n  return (\n    <>\n      <MUISlider client:load></MUISlider>\n      <MUISlider client:visible></MUISlider>\n      <MUISlider client:idle></MUISlider>\n      <MUISlider client:hover></MUISlider>\n    </>\n  );\n});\n```\n\nHowever, there are three more strategies:\n\n- `client:signal`\n- `client:event`\n- `client-only`\n\nLet's look at each.\n\n`client:signal`, based on Qwik’s reactive hook `useSignal()`, allows hydration whenever a signal’s value becomes `true`:\n\n```tsx\nexport default component$(() => {\n  const shouldHydrate = useSignal(false);\n  return (\n    <>\n      <button onClick$={() => (shouldHydrate.value = true)}>Hydrate Slider when click</button>\n\n      <MUISlider client:signal={shouldHydrate}></MUISlider>\n    </>\n  );\n});\n```\n\n`client:event` triggers when specific DOM events are dispatched:\n\n```tsx\nexport default component$(() => {\n\tconst count = useSignal(0);\n  return (\n    <>\n      <p>This slider will only run hydration after a click on it</p>\n      <MUIEventSlider\n        client:event=\"click\"\n        value={count.value}\n        onChange$={(_, value) => {\n          count.value = value as number;\n        }}\n      />\n    </>\n  );\n});\n```\n\n`client:only`: will not run server-side render, only on the browser.\n\n## Loading React without React runtime\n\nNow that we know the options, let’s see how we can load a React component without actually loading the code.\n\nFor this, we’ll create a new route in our application and add the `MUIButton` component:\n\n```tsx\n// src/routes/no-react/index.tsx\n\nimport { component$ } from '@builder.io/qwik';\nimport { MUIButton } from '~/integrations/react/mui';\n\nexport default component$(() => {\n  return (\n    <div>\n      <h2>React component with no React code</h2>\n      <MUIButton variant=\"contained\">I'm a button from react</MUIButton>\n    </div>\n  );\n});\n```\n\nIf we now navigate to our newly created route we can see that everything renders correctly:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F2dc7a88861ec411c9e23058398e5794c?width=800\" alt=\"a screenshot of a React component with no React code inside a Qwik app.\" />\n\n### Adding interactivity via Qwik\n\nWhat we’ve done in the above example is nice, but we would like the button to actually do something. We want an event listener but without React’s [synthetic events](https://beta.reactjs.org/reference/react-dom/components/common#react-event-object).\n\nAt first, I thought that this would work:\n\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { MUIButton } from '~/integrations/react/mui';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      <h2>React component with Qwik sigal</h2> // ❌\n      <MUIButton\n        variant=\"contained\"\n        onClick$={() => {\n          count.value++;\n        }}\n      >\n        I'm a button from react\n      </MUIButton>\n      <p>current count is: {count.value}</p>\n    </div>\n  );\n});\n```\n\nMy reasoning behind this was that using `useSignal()` would give me the reactivity I needed, and then an `onClick$` on the `MUIButton` would be enough.\n\nHowever, there’s a good reason this doesn’t work, as [Manu](https://twitter.com/manucorporat) (Qwik core maintainer) explained to me:\n\n> Passing an `onClick` this way will pass down the callback method into React, and then it’s up to it to execute it (with its synthetic event system).\n\nIt’s not actually a DOM event listener as I thought it would be.\n\nSo, to get this to work we could add one of the client directives, like `client:visble`. Then we’d have:\n\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { MUIButton } from '~/integrations/react/mui';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      <h2>Visibly hydrated React component</h2>\n      <MUIButton\n        client:visible\n        variant=\"contained\"\n        onClick$={() => {\n          count.value++;\n        }}\n      >\n        I'm a button from react\n      </MUIButton>\n      <p>current count is: {count.value}</p>\n    </div>\n  );\n});\n```\n\nThis works. However, notice from the video below, React is loaded, as my React DevTools on the right show:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fabac48a50e7f43b198129c1a8429d46b%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=abac48a50e7f43b198129c1a8429d46b&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nIn order to get the result we want, we need to use the `host:` attribute, which allows us to [listen to DOM events without hydration](https://qwik.dev/integrations/react/#listen-to-dom-events-without-hydration).\n\nLet’s refactor a bit and see what this looks like:\n\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { MUIButton } from '~/integrations/react/mui';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      <h2>React component with no React code</h2>\n      <MUIButton\n        // we removed the hydration directive\n        variant=\"contained\"\n        // and just added \"host:\" in front of our onClick$\n        host:onClick$={() => {\n          count.value++;\n        }}\n      >\n        I'm a button from react\n      </MUIButton>\n      <p>current count is: {count.value}</p>\n    </div>\n  );\n});\n```\n\nNow it works without React! 🎉🎉🎉\n\nWe can infer this since our dev tools are not showing the React DevTools extension as they did before:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F106b0b982c5d4a34b7bef04cc48ec4de%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=106b0b982c5d4a34b7bef04cc48ec4de&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nOne last thing to notice is that now we do not get that nice Material UI ripple effect because it needs to be triggered internally by React code.\n\nBut we did get a React component that is pure HTML with reactivity from Qwik signals, which is way less code.\n\n<video muted loop autoplay class=\"w-full\">\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fb3f864be4c284ec2975c992791b7f14d%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=b3f864be4c284ec2975c992791b7f14d&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## Less code\n\nTime to look at some numbers. When I say less code, what do I mean? (This is after building and running locally on my very fast machine.)\n\nQwikified React component with hydration with signal: **95.6KB** of JS over the network.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F008d6cf4e746417aad0d5eab7b837d34?width=800\" alt=\"A screenshot of a Qwik app with a hydrated React component and the devtools network pane on the right side.\" />\n\nFor fun, I built the same minimal example with a brand new `vite` / `React` project and installed the same React dependencies.\n\nThis is the React app code:\n\n```tsx\nimport { useState } from 'react';\n\nimport './App.css';\nimport { Button } from '@mui/material';\n\nfunction App() {\n  const [count, setCount] = useState(0);\n\n  return (\n    <div className=\"App\">\n      <div>\n        <h2>Regular React component</h2>\n        <Button\n          variant=\"contained\"\n          onClick={() => {\n            setCount(count + 1);\n          }}\n        >\n          I'm a button from react\n        </Button>\n        <p>current count is: {count}</p>\n      </div>\n    </div>\n  );\n}\n\nexport default App;\n```\n\nReact Vite build is less JS over the network: **71.9KB** of JS in one single file.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F55660795b82143539e59911095105600?width=800\" alt=\"A screenshot of a React app with the devtools network pane on the right side.\" />\n\nHowever, it seems that the React app has twice as much time-to-interactive than Qwik running React (on my machine, running lighthouse with a new Arc browser space with no extensions).\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F6b5c75a6e1254e78a58602329f4c8532?width=800\" alt=\"screenshot showing a lighthouse score of 0.6s for Qwik app.\" />\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F9e53f1e6ed8245e8b81e0c3f4da2e02b?width=800\" alt=\"screenshot showing a lighthouse score of 1.2s for React app.\" />\n\nQwikified React component with no react code: **7.7KB**\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F239064e3579a4f1b8c6be4dad8cf8c05?width=800\" alt=\"A screenshot of a Qwik app with the devtools network pane on the right that shows only 7.7KB transfer over the network.\" />\n\n## Things to look out for\n\nAt the time of this writing, Qwik is still in beta. So, as APIs are still changing and docs are still being polished there is still some work to be done.\n\nSome things to keep in mind:\n\n- Every Qwikified React component is isolated — it’s a fully isolated app. It's an island similar to [Astro Islands](https://docs.astro.build/en/concepts/islands/). However, here they hydrate independently.\n- Things can get duplicated, like styles.\n- You cannot inherit React context\n- Interactivity is disabled by default.\n\nKnown issues:\n\n- When playing around with new routes that use `qwik-react`, you need to restart the server.\n\n## Conclusion\n\nIn this post:\n\n- We went over how to load React code inside of a Qwik application.\n- We learned how to make it interactive via the different hydration strategies available.\n- We learned how to make React resumable by loading the React component as HTML and allowing Qwik to handle interactions.\n\nHaving the option not to duplicate what you might have done in the past and have the ability to port it to a different foundation is exciting.\n\nI see how this method could be leveraged to migrate React SPAs to Instant Reactive Qwik apps in the future.\n\nTo learn more, check out:\n\n- [Qwik React docs](https://qwik.dev/docs/integrations/react/#listening-to-react-events)\n- [Resumable React - Leveraging the React ecosystem with Qwik](https://www.youtube.com/watch?v=IGIPBAWRw_M)\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/the-qase-for-qwik-love-at-first-tti/index.mdx",
    "content": "---\ntitle: 'The Qase for Qwik: Love At First TTI'\nauthors:\n  - 'Yoav Ganbar'\ntags: ['Qwik']\ndate: 'December 19, 2022'\ncanonical: 'https://www.builder.io/blog/the-qase-for-qwik-love-at-first-tti'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\n## The need for speed: it’s hard to do the right things\n\nI love Qwik. [It’s no secret](https://www.hamatoyogi.dev/blog/qwik-next-big-thing), and I'm not just saying that because it's built by the company I work for. It’s because I’ve felt the pain of the problems it solves. And I’m not the only one.\n\nJust a little while ago, [Tejas Kumar](https://twitter.com/TejasKumar_), a well-known web developer & speaker, released his first impressions of Qwik in this video:\n\n<div style='position:relative;padding-bottom:56.25%;height:0;'>\n\t<iframe\n\t\tsrc='https://www.youtube.com/embed/l2mBk9meSvc?rel=0'\n\t\tstyle='position:absolute;top:0;left:0;width:100%;height:100%;border:0;'\n\t\tallowfullscreen\n\t\tallow='accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share;'\n\t></iframe>\n</div>\n\nHe starts by telling a story of way back in the day when he and his colleague thought about ways to make web applications faster. In a later part of the video, he explains some of the hard work it takes to attempt this sort of endeavor.\n\nI am no stranger to being in that place either. Back when I was working on an SEO-focused web app, we also attempted to “make it faster”. There was a lot of code juggling that needed to be done in order to see any sort of improvement.\n\nIt’s a painful process…and many other devs have probably felt it as well.\n\nYou might be wondering what we needed to do and how we went about it, but we’ll get to that later. First, we need to understand what slows apps down.\n\n## Why web apps are slow\n\nLong story short, **web apps are slow because we ship way too much JavaScript.**\n\n<div class=\"twitter-tweet twitter-tweet-rendered\" style=\"width: 100%; margin: 10px auto; display: flex; max-width: 550px;\"><iframe id=\"twitter-widget-3\" scrolling=\"no\" frameborder=\"0\" allowtransparency=\"true\" allowfullscreen=\"true\" class=\"\" style=\"position: static; visibility: visible; width: 550px; height: 225px; display: block; flex-grow: 1;\" title=\"X Post\" src=\"https://platform.twitter.com/embed/Tweet.html?creatorScreenName=builderio&amp;dnt=true&amp;embedId=twitter-widget-3&amp;features=eyJ0ZndfdGltZWxpbmVfbGlzdCI6eyJidWNrZXQiOltdLCJ2ZXJzaW9uIjpudWxsfSwidGZ3X2ZvbGxvd2VyX2NvdW50X3N1bnNldCI6eyJidWNrZXQiOnRydWUsInZlcnNpb24iOm51bGx9LCJ0ZndfdHdlZXRfZWRpdF9iYWNrZW5kIjp7ImJ1Y2tldCI6Im9uIiwidmVyc2lvbiI6bnVsbH0sInRmd19yZWZzcmNfc2Vzc2lvbiI6eyJidWNrZXQiOiJvbiIsInZlcnNpb24iOm51bGx9LCJ0ZndfZm9zbnJfc29mdF9pbnRlcnZlbnRpb25zX2VuYWJsZWQiOnsiYnVja2V0Ijoib24iLCJ2ZXJzaW9uIjpudWxsfSwidGZ3X21peGVkX21lZGlhXzE1ODk3Ijp7ImJ1Y2tldCI6InRyZWF0bWVudCIsInZlcnNpb24iOm51bGx9LCJ0ZndfZXhwZXJpbWVudHNfY29va2llX2V4cGlyYXRpb24iOnsiYnVja2V0IjoxMjA5NjAwLCJ2ZXJzaW9uIjpudWxsfSwidGZ3X3Nob3dfYmlyZHdhdGNoX3Bpdm90c19lbmFibGVkIjp7ImJ1Y2tldCI6Im9uIiwidmVyc2lvbiI6bnVsbH0sInRmd19kdXBsaWNhdGVfc2NyaWJlc190b19zZXR0aW5ncyI6eyJidWNrZXQiOiJvbiIsInZlcnNpb24iOm51bGx9LCJ0ZndfdXNlX3Byb2ZpbGVfaW1hZ2Vfc2hhcGVfZW5hYmxlZCI6eyJidWNrZXQiOiJvbiIsInZlcnNpb24iOm51bGx9LCJ0ZndfdmlkZW9faGxzX2R5bmFtaWNfbWFuaWZlc3RzXzE1MDgyIjp7ImJ1Y2tldCI6InRydWVfYml0cmF0ZSIsInZlcnNpb24iOm51bGx9LCJ0ZndfbGVnYWN5X3RpbWVsaW5lX3N1bnNldCI6eyJidWNrZXQiOnRydWUsInZlcnNpb24iOm51bGx9LCJ0ZndfdHdlZXRfZWRpdF9mcm9udGVuZCI6eyJidWNrZXQiOiJvbiIsInZlcnNpb24iOm51bGx9fQ%3D%3D&amp;frame=false&amp;hideCard=false&amp;hideThread=false&amp;id=1591870444776439810&amp;lang=en&amp;origin=https%3A%2F%2Fwww.builder.io%2Fblog%2Fthe-qase-for-qwik-love-at-first-tti&amp;sessionId=7a58eb2a6171f8033694e9c0a7692622d0a5416d&amp;siteScreenName=builderio&amp;theme=light&amp;widgetsVersion=2615f7e52b7e0%3A1702314776716&amp;width=550px\" data-tweet-id=\"1591870444776439810\"></iframe></div>\n\nLately, even [Dan Shappir](https://twitter.com/DanShappir) (performance tech lead at [Next Insurance](https://www.nextinsurance.com/) and co-host of [JS Jabber](https://topenddevs.com/podcasts/javascript-jabber)), showed us [what the median origin page weight by framework was](https://www.smashingmagazine.com/2022/05/google-crux-analysis-comparison-performance-javascript-frameworks/) in the past year:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72d1b43302fc4c01bae34c33478eb346?width=705\" alt=\"Graph showing median origin page weight by framework was over the year. Trend shows JS bundle size growing.\" />\n\nLet's take a moment to dwell on that. Why does a lot of JS make a web app slow?\n\nThere are a few of steps in the way:\n\n1.  Download\n2.  Parse\n3.  Execute\n\nEach of these takes time, which means users need to wait. That’s not a good experience for anyone. Especially when you pay double or triple the cost if your internet is shoddy and your device isn’t the latest and greatest.\n\nWhen you don’t have a good user experience you abandon ship, whether it’s your shopping cart, that sign-up flow, or a post you’re reading. That business can forget about those conversions — 💰&nbsp;&nbsp;down the toilet.\n\nThings used to be lighter, as Tejas also demonstrated in his video when he showed the current [Reddit](https://reddit.com) website compared to the [\"old Reddit\"](https://old.reddit.com).\n\nHere we can see the total JS over the network for the “old Reddit”:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F6bc3b1ab96984b499d697f629a318562?width=800\" alt='Screenshot of \"old Reddit\" network pane emphasizing transfer weight, resource weight, and load finish time.' />\n\nHere is the same for the “new Reddit\":\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F0d7938d82e754f2690d089a2cbf8141a?width=800\" alt='Screenshot of \"new Reddit\" network pane emphasizing transfer weight, resource weight, and load finish time.' />\n\n### Notice the difference?\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F208e2206946b4b83bb7cf6da49b31246?width=800\" alt='A screenshot showing the number differences for transferred JS, JS resources dowloaded, and load finish time between \"old\" and \"new\" Reddit.' />\n\nIt takes forever, and that’s without doing anything. JavaScript is for adding interactivity. Yet we got a ton of it — without any interaction.\n\n## Why there is so much JavaScript\n\nThere are a few reasons I can think of:\n\n*   It has never been easier to `npm install` (or `yarn add`) your problems away, whether it’s a library to format dates or some animation library.\n*   Third-party scripts like analytics, chat, or whatever your marketing team stuck inside [GTM](https://tagmanager.google.com/#/home).\n*   First-party code.\n\nAs developer experience improved, our JS bundle sizes grew, and they have been growing for the past decade or so, as in this graph displays:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fec0bdf9a9d704da684710044b2119e97?width=800\" alt='JavaScript bundle size growth over the years.' />\n\nBut why is it steadily growing? I would say it’s due to product requirements and user expectations for rich interactive experiences. **The more features we add, the more code we generate, the more JavaScript we ship.**\n\nFurthermore, there is somewhat of a correlation between DX (developer experience) and UX (user experience). To better understand this, we can look at this slide from a recent talk that [Shai Reznik](https://twitter.com/shai_reznik) (international speaker and Founder of [HiRez.io](http://HiRez.io)) gave:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72ff51d95b434de88b0792eb542052c4?width=800\" alt='A graph showing correlation between UX/DX and framework generation over time. When we improve DX we degraded UX.' />\n\n*UX/DX correlation over time by framework generation (slide courtesy of Shai Reznik).*\n\nThis graph shows that whenever we improved the DX, we degraded the UX.\n\nFirst, we had static pages that easily served HTML documents on demand.\n\nThereafter, servers could inject data into HTML templates that hit the database (DB) to create a personalized experience and send that response back to the browser — and load times increased.\n\nThen we had JavaScript sprinkles in the form of [jQuery](https://jquery.com/) da OG DOM manipulator.\n\nLater came the age of [Rich Internet Applications (RIA)](https://en.wikipedia.org/wiki/Rich_web_application), popularized by tech such as Adobe Flash and Microsoft Silverlight. These are buried deep in our collective mind [because Steve Jobs decided to basically kill it](https://www.howtogeek.com/805605/this-is-how-steve-jobs-killed-adobe-flash/).\n\nAfter that came the second half of gen 2 web apps with the birth of SPAs (Single Page Applications), which were led by frameworks such as Backbone, Knockout, Angular, React, Vue, and so on.\n\nThis came with the rise of Node.js and [NPM](https://www.npmjs.com/), which saved devs time, as they could install packages easily. However, that increased bundle size, which in turn increased TTI.\n\nAccording to Shai Reznik, we’re now at gen 2.5, though [Shawn @swyx Wang](https://twitter.com/swyx) — writer, speaker, and DevRel — might have [a different definition](https://www.swyx.io/js-third-age/). Also, [Kent C. Dodds](https://twitter.com/kentcdodds) has [one of his own](https://www.epicweb.dev/the-webs-next-transition), which kind of combines the best of static pages; dynamic server-side rendered pages along with a SPA experience on the client.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fa73ececc179c4041839a5b2f5fd58935?width=800\" alt=\"An illustration showing how client side rendering and server-side rendering work.\" />\n\nHowever, the caveat of current generation frameworks is that as the app size grows, so does the JavaScript bundle, and in turn [Time To Interaction (TTI)](https://developer.mozilla.org/en-US/docs/Glossary/Time_to_interactive#:~:text=Time%20to%20Interactive%20(TTI)%20is,network%20and%20main%20thread%20inactivity.).\n\nThe main reason for this is hydration, which is the process of attaching behavior to declarative content to make it interactive.\n\nI’m not going to dwell on what hydration is, as it’s been covered well by [Miško Hevery](https://twitter.com/mhevery) in [Hydration is Pure Overhead](https://www.builder.io/blog/hydration-is-pure-overhead).\n\n## **What we can do about it**\n\nOne possible solution to improve TTI on a web app is code splitting. It is a technique in which a large codebase is divided into smaller, more manageable chunks or modules.\n\nThis can improve the performance of an application by reducing the amount of code that needs to be loaded at once and allowing different parts of the code to be loaded on demand, as needed.\n\nAnother would be lazy loading. JavaScript lazy loading is a technique that defers the loading of JavaScript resources until they are needed, potentially improving web app performance.\n\n### Lazy is not lazy at all\n\nHowever, these methods are manual and tedious. As Tejas states in his video, this is something he and his co-worker initially thought to do when they tried to improve performance.\n\nI’ve also tried this method myself once. It’s really easy to screw it up. You have to take a lot of things into account and play around with chunks and caching.\n\nFurthermore, you’d have to think about what happens if there’s a network connection error; what should we do then? Do we prefetch? Do we use a service worker?\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fda36b76063964693b5cadf0d1e39c2a4?width=800\" alt=\"An image of Russel Crow from the movie Beautiful Minds next to a chalk board looking confused.\" />\n\n### Hydration: hard work down the drain\n\nBesides, the process of hydration can negate a lot of these hard work effects, as there is still a need for the whole bootstrap phase which includes eagerly loading all those lazy JS chunks.\n\n> **It’s like playing a video game — you progress on a level and collect loot, but then you accidentally die and have to restart the level from square one.**\n\nFor a site to be interactive in traditional frameworks, it must have event listeners attached to the DOM; click, mouse move, and other events that trigger when a user performs the action. There are two problems with this:\n\n1.  The framework has to know where the event handlers need to be attached.\n2.  The framework needs to know what should happen when the event is triggered.\n\nTo figure out where the events should be attached, the framework must download all visible components and execute their templates. By executing the templates, the framework learns the location of the events and can register the events with DOM.\n\nThis brings us to the second point. What should happen if the event is triggered? It requires the code for the event handler to be present.\n\nIt does not matter if the user interacts with a menu or not. The code still needs to be eagerly loaded. And therein lies the problem.\n\n> **Hydration forces eager download and execution of the code. It’s just how frameworks work.**\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ffd261206acf2431a8d91cc299365593a?width=800\" alt=\"A slide explaining why hydration is like replaying an app. Rendering runs twice. All logic needs to be dowloaded.\" />\n\n## **What comes next**\n\n### Partial hydration\n\nWith the realization that site startup performance does matter, the industry has started taking strides in the right direction.\n\nReact 18 and [server components](https://www.patterns.dev/posts/react-server-components/) promise to deliver less JavaScript to the browser by sending only HTML to the client when there’s no interaction.\n\n[Next.js](https://nextjs.org/) 13 is in effect the only framework that currently supports RSC as well as many more optimizations that improve performance. This is definitely an improvement, but it still requires the developer to think about it on a component-by-component basis.\n\n[Astro](https://astro.build/) has a different approach with their “islands architecture”:\n\n**_“Astro Islands represent a leading paradigm shift for frontend web architecture. Astro extracts your UI into smaller, isolated components on the page. Unused JavaScript is replaced with lightweight HTML, guaranteeing faster loads and time-to-interactive (TTI).”_** —Astro website\n\nThis is pretty awesome, as it also allows you to write components in almost any frontend framework you like. You can make an island interactive on a case-by-case basis and with specific directives to control hydration, which they call partial hydration.\n\n[I myself use Astro for my blog](https://hamatoyogi.dev), and I’m really enjoying it. Even though I thought I’d write different components in different frameworks, I ended up mostly writing Astro components. 😅\n\nAgain, this is great, but there’s the caveat of triggering hydration in any framework because it would once again eagerly load your JS.\n\n### Resumability: the solution to hydration\n\n[Marko](https://markojs.com/) is a huge leap in the right direction. It has streaming, partial hydration, a compiler that optimizes your output, and a small runtime. I’ve also heard through the grapevine that Marko V6 adds resumability to the framework as well.\n\nIn an ideal world, no JavaScript gets downloaded and executed until the user interacts with a particular part of the page. If the user clicks the \"buy\" button, then the framework should bring in only the code which is necessary for processing the \"buy\" button; it should not have to bring the code associated with the \"menu.”\n\nThe problem is not that there is too much JavaScript; rather, the JavaScript must be eagerly downloaded and executed. (As I’ve mentioned, many existing systems have lazy loading, but only for components not currently in the render tree).\n\n### Understanding resumability\n\nIn a nutshell, with hydration we run our code on the server and then on the client. Resumability means running the app once, pausing execution, and then resuming where we left off, just on the client.\n\nIt’s kind of like how VMs work. A virtual machine can run an app, say a text editor, on an operating system and then be stopped, moved to another machine, and then resumed.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F0fc18d23965146978693d6f2033d1f77?width=800\" alt='A slide explaining resumability. Leverage what already ran on the server. Server serializes app state then it resumes.' />\n\nResumable frameworks are not new. For almost a decade, Google has been using Wiz (an internal framework at Google), which powers Google Search and Photos. Marko, a framework from eBay, is promising resumability in their next version.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F370aa063cf4d4a95a2f38d689f799bf5?width=800\" alt='An image showing icons of replayable frameworks next to resumable frameworks.' />\n\nBut, we’re not here to talk about other frameworks, we’re here to talk about one framework in particular — Qwik, which is the first open source framework whose primary focus is Resumabilty.\n\n## **What Qwik does**\n\nQwik takes on a new approach to the problem space. It’s a paradigm shift in the way we’re used to serving JS to the browser.\n\nLet’s talk about that for a second. The JS required for most frameworks to boot up is something like 100Kb-200Kb (un-minified, not Gzipped). Even if you do code split and lazy load, it starts off from that starting point, and then more JS gets loaded.\n\nQwik loads JavaScript on demand. It starts with a constant of 1Kb of JS until there’s a user interaction. To put it into more “computer sciencey” terms, [most frameworks are O(n), while Qwik is O(1)](https://www.builder.io/blog/our-current-frameworks-are-on-we-need-o1).\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F6725b62151ab40ccb580147cb81cbca3?width=800\" alt='A graph showing JS execution over time per number of user interactions - traditional frameworks compared to resumable frameworks. The Y axis shows executed JS, the X axis shows time & number of user interactions.' />\n\nIf you don’t add interactions, there’s no need to load more JavaScript.\n\nRendering performance is important, but time to interaction matters more when we look at real user experiences.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3dd274cd6d034d6e8eb4032e4a94d6af?width=800\" alt='A graph and a table showing startup performance on todo application in different frameworks with the Mitosis logo in the bottom left.' />\n\nResumability solves the time-to-interactive (TTI) problem because there is nothing for the framework to do on startup (outside of setting up global listeners). The application is ready instantly.\n\nIn contrast to other frameworks, Qwik considers bundling, serialization, and prefetching to be core competencies and has a holistic approach to fast startup performance. This allows it to be resumable.\n\nLet’s see it in action!\n\n## **Qwik in action**\n\n### An example\n\nLet’s see how this looks with some code:\n\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport type { DocumentHead } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      <h1>\n        Counter is {count.value} <span class='lightning'>⚡️</span>\n      </h1>\n      <button onClick$={() => count.value++}>Increment</button>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: 'Welcome to Qwik Demo',\n  meta: [\n    {\n      name: 'description',\n      content: 'Qwik site description',\n    },\n  ],\n};\n```\n\nThis is the result:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F7dcdcef346664e4dba0b7b926adf2845%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&amp;token=7dcdcef346664e4dba0b7b926adf2845&amp;alt=media&amp;optimized=true\" type=\"video/mp4\"/>\n</video>\n\n> **For demo purposes, I’m not going to go into how to start a Qwik project. For more info on getting started with Qwik,** [**check out the Qwik docs**](https://qwik.dev/) **or our** [**Stackblitz Qwik Starter**](https://stackblitz.com/)**.**\n\nWhat we’ve done is create a simple counter component inside a [QwikCity](https://qwik.dev/qwikcity/overview/) project, which is the meta-framework for Qwik. Basically, it’s like SvelteKit for Svelte, or [SolidStart](https://start.solidjs.com/getting-started/what-is-solidstart) for Solid. It is generally in charge of routing and the build.\n\nIf you're coming from React (or Solid), you can see that a lot of the above looks familiar. As Qwik uses JSX, you should feel right at home. A [signal](https://qwik.dev/docs/core/state/#usesignal) is a reactive piece of state, similar to [Solid.js signals](https://www.solidjs.com/tutorial/introduction_signals), which consists of an object with a single property (`signal.value`) that when changed will update any component that uses it. Similarly, `useStore` is almost the same as a signal but accepts an object as a parameter, that then becomes reactive.\n\nThe second thing to notice is the `$` sign after `component$` and `onClick$`, which is [a symbol in Qwik.](https://qwik.dev/docs/advanced/dollar/) These are hints for the optimizer to break our code into pieces that can later be loaded intelligently. It’s important to note that only serializable data can be used in a lazy-loaded boundary.\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F7c770f33ae5e449abfe9053db642bb17%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&amp;token=7c770f33ae5e449abfe9053db642bb17&amp;alt=media&amp;optimized=true\" type=\"video/mp4\"/>\n</video>\n\n### Qwik loads only the JavaScript that it needs when the user needs it\n\nIf we go back to our counter example, devtools shows this in action:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F346b83d8805049bea52b89f86636c86a%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&amp;token=346b83d8805049bea52b89f86636c86a&amp;alt=media&amp;optimized=true\" type=\"video/mp4\"/>\n</video>\n\nWhat’s happening there?\n\nWhile on the `Network` pane of devtools, I’ve selected only to show JS requests. At first, it shows two files: `client` and `enb.mjs`. Those are files from [Vite](https://vitejs.dev/); our dev server, which also powers Qwik and QwikCity. To hide those files so we can get to the actual JS that a production build would serve, we can filter any path that has Vite in it. After I’ve hidden all Vite-related files, I hit refresh again (with `cmd + R`), then…no JavaScript is downloaded!! 🤯\n\nThen, when I go on to click the **Increment** button, the real magic happens! Two files get downloaded, and the button actually works and increments our count. The beauty of it is that now there’s no need to load that JS again! Qwik has divided the code into separate files, which can be loaded as needed.\n\nLet's review what these files are:\n\n1.  `core.mjs?v=a2bc250a` : this file is the main Qwik core runtime script from the dev server (unzipped). Breaking it down is beyond the scope of this post.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3afeda28406d43a4b836abf83c4382b9?width=800\" alt=\"A screenshot of devtools network pane showing the downloaded JS core runtime script.\" />\n\n1.  `routes_component_div_button_onclick_gurwhjlhap8.js`: this file is actually what handles our signal and the `onClick` (as the name might suggest, followed by a hash). Let’s look at the contents of this file:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F5b57e2250dd9453597b9fc04b73b202f?width800\" alt=\"A screenshot of devtools network pane showing the downloaded JS onClick script.\" />\n\nHere we have a variable that references a function that extracts the count variable from within the `useLexicalScope()` hook and then returns an incremented count.value. The `useLexicalScope()` hook is how Qwik retrieves the reactive variables reference, whether it’s a store or a signal.\n\nNow for the HTML:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F201521a817764a4d82efe426a99af80d?width=800\" alt=\"a screenshot of devtools HTML pane showing the added HTML attributes Qwik puts in.\" />\n\nWe can see where the reference to the script is ☝🏽.\n\nAnd then we can see where more information is stored:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3fdee7eb6f904541b06c2f8c51a77a60?width=800\" alt=\"a screenshot of devtools HTML pane showing the JSON data Qwik puts inside a script tag.\" />\n\nOn top of that, Qwik attaches event listeners to inform it when it needs to load something. It can also tell what JS is more likely to be used and prefetches it. For example, it’ll load your shopping cart code, before the newsletters.\n\n### Resumablity in action\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F2122a8666d054d6181f855eb046319f0?width=800\" alt=\"A graph showing other tools and Qwik's start up process. The X axis shows time, the Y axis labels other tools and Qwik.\" />\n\n*Courtesy of Tejas’s video*\n\nOther tools need to do a lot of stuff before they can be interactive. For the most part, Qwik downloads only HTML.\n\nAs we covered above, we have information stored in the DOM, but it’s not just information, it’s serialized. Qwik runs on the server and generates info, serializes it, and pauses. When the server sends the HTML to the client, it has all the info.\n\nIt’s kind of like a video you’re streaming:\n\n<div align=\"center\">\n  <blockquote class=\"twitter-tweet\" data-dnt=\"true\" align=\"center\" data-twitter-extracted-i1735345243861130926=\"true\"><p lang=\"en\" dir=\"ltr\">Hydration is watching the whole 2 hour movie just to see the 10 minutes you missed at the end...<br></br><br></br>Resumability is pressing play from '01:50'.<br></br><br></br>- <a href=\"https://twitter.com/KenAKAFrosty?ref_src=twsrc%5Etfw\">@KenAKAFrosty</a> - <a href=\"https://twitter.com/QwikDev?ref_src=twsrc%5Etfw\">@QwikDev</a> hero<br></br><br></br>(Some younger folks probably have no idea what she's doing 🤣👇🏾) <a href=\"https://t.co/FcdwADgPKQ\">pic.twitter.com/FcdwADgPKQ</a></p>— Yoav Ganbar ⚒️ @BuilderIO (@HamatoYogi) <a href=\"https://twitter.com/HamatoYogi/status/1600849837649727488?ref_src=twsrc%5Etfw\">December 8, 2022</a></blockquote>\n  <script async=\"\" src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n</div>\n\nYou can resume your app once it’s in your browser.\n\nAnd then, you can even pause it, with all its state, and resume it on another browser 🤯\n\nBehold:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fe8c69a32753a470c986205ddeec55db1%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&amp;token=e8c69a32753a470c986205ddeec55db1&amp;alt=media&amp;optimized=true\" type=\"video/mp4\"/>\n</video>\n\nWhat just happened in that video? 🥴\n\n*   I interacted with the app on browser A.\n*   Paused the app with `$0.qwik.pause()` (`$0` in devtools is a way to select the element you’re inspecting), it ran on the `<html>` element, which is a Qwik container.\n*   Copied the HTML.\n*   Opened a new browser (Safari, not that it matters).\n*   Went to our app’s URL, where I got the counter once again with a `0` state.\n*   Deleted the HTML.\n*   Pasted the “paused” app HTML.\n*   The state was restored in a new browser 🕺🏽.\n*   Everything is still interactive.\n\nIf that doesn’t blow your mind, I’m not sure what will. The use cases this opens up are endless.\n\nAs long as the Qwik loader had run, when you move from one Qwik to another or one Qwik container to another, you can transfer state.\n\nMull over that.\n\n### A Qwik pause\n\nSo we’ve talked about the why, what, and how. Why are we at this point where we need a new paradigm? Why you should consider using Qwik? How does it work? And we'll cover some cool features.\n\nBut we still haven’t shown how it’s fast and performant it is.\n\nLet’s dig in.\n\n## Measuring performance\n\nMost people measure web apps and website performance nowadays with Google Lighthouse, [Page Speed Insights](https://pagespeed.web.dev/) , or the good old [WebPageTest](https://www.webpagetest.org).\n\nTo be able to compare a web app it’s always better to compare apples to apples. So, in order to do so, we’ll look at the [Builder.io](https://www.builder.io/) website. Specifically the home page.\n\n\"Why?\" you may ask. Because the Builder home page has 2 versions:\n\n1.  Qwik\n2.  Next.js (v10)\n\nConsidering that there have been major improvements in Next in the last 3 versions, this is the closest thing we have that has similar content and functionality.\n\nIn order to render the old Next.js version we have a query param to use, so when we hit `http://www.builder.io/?render=next` we’ll get it.\n\nTo compare the two, I ran a [WebPageTest on both versions of our home page](https://www.webpagetest.org/video/compare.php?tests=221212_BiDcBQ_C35,221212_BiDc2T_C34&amp;thumbSize=200&amp;ival=1000&amp;end=visual) (Mobile 4G USA test configuration) and used the comparison feature.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72df61989dcd43448b093e77d7eb80d7?width=800\" alt=\"An image of the filmstrip output from WebPageTest of Builder.io's Next.js site version next to Qwik site version depicting load time.\" />\n\nRight away, the Next.js site starts loading something visual while Qwik showed almost everything after 2.5 seconds.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F6806377578ba426fa919b469bf4d431f?width=800\" alt=\"An image of the filmstrip output from WebPageTest of Builder.io's Next.js site version load time.\" />\n\nThe Next.js version fully loads after 9.5 seconds.\n\nNow let’s look at all the timings (**notice that Qwik version is red and Next.js is blue**):\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fe15c79d065364f1e8087c4f10a835b6f?width=800\" alt=\"A screenshot of the timings graph from WebPageTest comparing Builder's Next.js site version vs Builder's Qwik site version.\" />\n\nNote that TTI metric on the bottom doesn’t show for the Next.js version, not because it’s at `0` but because for some reason WebPageTest has issues with getting that metric. So, I ran Page Speed Insights on it:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F8a477ecd0b8747cf99c61d5196a4aa61?width=800\" alt=\"A screenshot of Lighthouse score for Builder's Next.js site version version. The performance score is 33.\" />\n\nThis run worked, but I had many failed runs attempted. And, as we can see TTI on it is benched at 10.6 seconds.\n\nIt’s still early days to get a lot of real user performance data from [Google Chrome User Experience Report](https://developers.google.com/web/tools/chrome-user-experience-report) (CrUX for short) to show how Qwik performs. But there is some:\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F2f7dd984b82b445e9359f9393d16b0f3?width=800\" alt=\"A grpah of metrics from Crux that shows the percentage of good CWV scores. Arrows pointing at Qwik lines and table data. The Y axis is origins having good CWV, the X axis is a timeline from January 2020 to September 2022.\" />\n\nYes, a whopping 4 is the number of sites that show up on the report when choosing popular frontend tech, but it’s somewhat of an indication.\n\n## Conclusion\n\nQwik is made by 3 performance nerds (they said it, not me 😉) that have 4 frontend frameworks under their belt.\n\n<img class=\"w-full\" src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F7a17c9c66a31475cb9fbf422789b0fbe?width=800\" alt=\"An image of the Qwik team: Misko Hevery, Manu Almeida, and Adam Bradley with the title 'Built by Performance Nerds'.\" />\n\nThey are inspired by all the latest frameworks and hard work that has been done by incredible engineers, and in so, they have brought a lot of the loved features of those frameworks.\n\nThe general realization they came to, that birthed the innovation for Qwik, was that server-side rendering for all SPA frameworks was an afterthought. At some point, you hit the hydration bottleneck, and you simply cannot optimize anymore on your end as a developer.\n\nit’s easy to put things together, but It’s hard to split things up.\n\n<div align=\"center\">\n<blockquote class=\"twitter-tweet\" data-dnt=\"true\" data-theme=\"light\"><p lang=\"en\" dir=\"ltr\">The idea is not to hydrate a whole app at once, it&#39;s to keep it dormant until a user interaction is needed. And then, only hydrate that one part.&#10;&#10;This is a great representation of how Qwik&#39;s lazy loading, of only what&#39;s needed, works. <a href=\"https://t.co/fS1xZ8xT8V\">pic.twitter.com/fS1xZ8xT8V</a></p>&mdash; Builder.io (@builderio) <a href=\"https://twitter.com/builderio/status/1595387907476684803?ref_src=twsrc%5Etfw\">November 23, 2022</a></blockquote>\n<script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n</div>\n\n> Qwik does not just support SSR/SSG/SPA, it is a hybrid. You can choose whichever fits your needs.\n\nThe demo in this post doesn’t do justice in demonstrating Qwik’s full capabilities — it’s not real-world enough. It shines in highly interactive big apps, as it would perform the same as our simple example. It doesn’t matter how many features or lines of code an app has.\n\nOne of Qwik’s best features is it makes doing the right thing achievable. You don’t have to work hard with it to get good performance. It’s a given, just by its nature.\n\nOther than that, there are more features to Qwik:\n\n*   [Easy Micro Frontends](https://blog.cloudflare.com/better-micro-frontends/)\n*   You can [leverage the entire React ecosystem](https://www.youtube.com/watch?v=IGIPBAWRw_M&amp;t=174s) within Qwik\n*   DX: Click to go to component source code, and more on the way!\n\nQwik and QwikCity are still in beta, but the community is starting to blossom. **It’s never been more straightforward to build fast web apps than it is with Qwik. So what are you waiting for? Give it a try, the team is looking for more feedback** 🙂.\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/(articles)/type-safe-forms-in-qwik/index.mdx",
    "content": "---\ntitle: 'Type Safe Forms in Qwik with Modular Forms'\nauthors:\n  - 'Yoav Ganbar'\ntags: ['Web development']\ndate: 'April 11, 2023'\ncanonical: 'https://www.builder.io/blog/type-safe-forms-in-qwik'\n---\n\nimport { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block';\nimport CodeSandbox from '~/components/code-sandbox/index.tsx';\n\n<ArticleBlock>\n\nAs Qwik has reached RC status, let’s explore how Modular Forms with Qwik can enhance your developer experience while ensuring both client and server type safety.\n\nLet’s dig in!\n\n## Server-side type safety with Zod\n\nIf you have been paying attention to all the TypeScript nerds lately, you’ve probably heard of [Zod](https://zod.dev/).\n\nAnd I’m not talking about the villain from Superman 2 (which appeared also in more recent movies from the franchise).\n\n<video muted loop autoplay class=\"mx-auto\">\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fafcc097ba4844f6da51ffab34457c457%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=afcc097ba4844f6da51ffab34457c457&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nIn case you haven’t, Zod is a TypeScript-first schema declaration and validation library.\n\nZod is all about making your life easier as a developer. The whole point is to get rid of all that boring type declaration stuff and validation.\n\nBasically, you just gotta declare your validator _one freakin' time,_ and boom! Zod takes care of the rest by automatically figuring out the TypeScript type.\n\nPlus, you can mix and match simple types to make more complex data structures like it ain't no thang.\n\nBonus points:\n\n- Works with Vanilla JavaScript\n- No dependencies\n- Small bundle footprint (13.1kB [according to Bundleaphobia](https://bundlephobia.com/package/zod@3.21.4), although the site advertises 8k)\n\n### Server validation\n\nWhat does this have to do with Qwik? Glad you asked (patting my own back).\n\nZod, which has first-class support inside Qwik’s `routeAction$()` function, can handle form validation server-side.\n\nTake this code as an example:\n\n```tsx\n// FILE: src/routes/index.tsx\n\nimport { routeAction$ } from '@builder.io/qwik-city';\n \nexport const useAddUser = routeAction$(async (user) => {\n  // `user` is typed Record<string, any>\n  const userID = await db.users.add(user);\n  return {\n    success: true,\n    userID,\n  };\n}); \n```\n\nQwik does a decent job of giving us a type of `Record<string, any>`, but that is not ideal. There’s no validation that the `user` payload actually has what is needed to create a user inside our database.\n\nThis is where Zod comes into play:\n\n```tsx\n// FILE: src/routes/index.tsx\n\nimport { routeAction$, zod$, z } from '@builder.io/qwik-city';\n \nexport const useAddUser = routeAction$(\n  async (user) => {\n    // `user` is typed { name: string }\n    const userID = await db.users.add(user);\n    return {\n      success: true,\n      userID,\n    };\n  },\n  zod$({\n    name: z.string(),\n  })\n);\n```\n\nBy adding the `zod$` function and passing in our validation scheme with the `z` primitive, we can get the correct type for the `user` object, as well as server-side validation.\n\nThis means that if we accidentally pass a `user` object (or an attacker tries something fishy) that doesn’t have the `name` property, the server will throw an error.\n\n> For more information about handling errors in Qwik `routeAction`, check out the Qwik [Action Failures](https://qwik.dev/docs/action/#action-failures) documentation.\n\n## About the client side\n\nAs in the above, MPA (Multi-Page Application) form handling on the server is pretty nice. However, this is still not amazing UX.\n\nFor a user to understand that something wrong has happened, such as having entered the wrong type of input, they still need to wait for a server response.\n\nThat’s a frustrating experience if you ask me.\n\nThere’s a reason the React ecosystem has a slew of libraries that handle forms. To create a good client-side user experience, there’s a lot of boilerplate you’d need to write and edge cases that you need to handle.\n\nNotable mentions are: <a href=\"https://github.com/jaredpalmer/formik\" rel=\"noopener noreferrer\" target=\"_blank\">Formik</a>, <a href=\"https://react-hook-form.com/\" rel=\"noopener noreferrer\" target=\"_blank\">React Hook Form</a>, and <a href=\"https://final-form.org/react\" rel=\"noopener noreferrer\" target=\"_blank\">React Final Form</a>, which have made writing complex forms much easier.\n\n## Modular Forms\n\n<a href=\"https://modularforms.dev/\" rel=\"noopener noreferrer\" target=\"_blank\">Modular Forms</a> is a form library for Qwik and <a href=\"https://www.solidjs.com/\" rel=\"noopener noreferrer\" target=\"_blank\">SolidJS</a> created by <a href=\"https://twitter.com/FabianHiller\" rel=\"noopener noreferrer\" target=\"_blank\"><strong>Fabian Hiller</strong></a><strong>.</strong>\n\nFabian created a complex form for his SaaS business in 2018, but found that manually handling all the form validation was tiring and prone to errors. He decided to create a `useForm` hook to offload the repetitive code and make it reusable.\n\nHowever, he was unsatisfied with the development experience and tested different form libraries before creating his own. Every decision in the library has a well-thought-out reason, as he’s listed on the library site.\n\n## Client-side form validation with Modular Forms\n\nSince Qwik already uses Zod, Modular Forms supports defining the form values as a Zod schema.\n\n### Defining a form\n\nLet’s create a minimal login form using this approach:\n\n```tsx\n// FILE: src/routes/modular-forms/index.tsx\n\nimport { routeLoader$, z } from '@builder.io/qwik-city';\nimport { InitialValues } from '@modular-forms/qwik';\n\nconst formSchema = z.object({\n  email: z.string().nonempty(),\n  password: z.string().min(8),\n});\n\n// Note: you can also use z.input \n// since Zod supports data transformation.\ntype LoginForm = z.infer<typeof formSchema>;\n\nexport const useLoginForm = routeLoader$<InitialValues<LoginForm>>(() => ({\n  email: '',\n  password: '',\n}));\n```\n\nWe have created a `routeLoader$`, which is data from the server with default values for our form.\n\nModular Forms need the default values to initialize the store of the form. Thanks to Qwik's resumability, this step can be done entirely on the server without runtime costs in the browser.\n\n### Creating a form\n\nNow we can create our `useForm` hook to build out our form UI and client validations:\n\n```tsx\nexport default component$(() => {\n  const [loginForm, { Form, Field, FieldArray }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n  });\n});\n```\n\nNote that the hook returns a tuple which we can name whatever we want à la React `useState` hook style.\n\nAs we can tell from the above, we get three components out of this hook that we can use to build out our UI: `Form`, `Field`, and `FieldArray`.\n\nThe `Field` component uses a headless approach, which means that it does not render any HTML, which gives you, as a developer, maximum flexibility.\n\n### Adding fields to the form\n\nAll we have to do to add fields to our form is the following:\n\n```tsx\nexport default component$(() => {\n  const [loginForm, { Form, Field }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n  });\n\n  return (\n    <Form>\n      <Field name=\"email\">\n        {(field, props) => <input {...props} type=\"email\" />}\n      </Field>\n      <Field name=\"password\">\n        {(field, props) => <input {...props} type=\"password\" />}\n      </Field>\n      <button class=\"w-max\" type=\"submit\">\n        Login\n       </button>\n    </Form>\n  );\n});\n```\n\n### Validating on the client side\n\nAt this point, we will get no indication to any errors on the client, or on the server, as we do not have a `routeAction$` to handle the form submission, nor any sort of client validation functions.\n\nModular Forms comes with its own validation functions, which you can use, but for the sake of this post, I will continue using Zod.\n\n> **Tip:** It’s important to note that validations in Modular Forms, except for server actions, happen on the browser.\n\nTo add Zod validations we need to change our schema a bit, like so:\n\n```tsx\nconst formSchema = z.object({\n  email: z.string().nonempty(),\n  password: z.string().min(8),\n  email: z\n    .string()\n    .nonempty('please enter your email')\n    .email('enter a valid email'),\n  password: z\n    .string()\n    .min(1, 'please enter a password')\n    .min(8, 'You password must have 8 characters or more.'),\n});\n```\n\nThe second argument to the Zod’s validation helper functions is just the error message that will be thrown.\n\nIn order to activate those validations, we need to pull in the `zodForm$` adapter and add it as an argument to the `useForm` hook:\n\n```tsx\nconst [loginForm, { Form, Field }] = useForm<LoginForm>({\n  loader: useFormLoader(),\n  validate: zodForm$(formSchema),\n});\n```\n\nOnce we’ve added that, we need to display these errors. They will now be a part of the `field` argument. In case there is an error, the message will appear in the `error` property of that field.\n\nTo show the error, we can then add the following to our `JSX`:\n\n```tsx\nexport default component$(() => {\n  const [_, { Form, Field }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n    validate: zodForm$(formSchema),\n  });\n\n  return (\n    <section class=\"p-4\">\n      <h1>Qwik Modular Forms</h1>\n      <Form class=\"flex flex-col gap-2\">\n        <Field name=\"email\">\n          {(field, props) => (\n            <>\n              <input\n                class=\"w-96\"\n                placeholder=\"enter email\"\n                {...props}\n                type=\"email\"\n              />\n              {field.error && <div>{field.error}</div>}\n            </>\n          )}\n        </Field>\n        <Field name=\"password\">\n          {(field, props) => (\n            <>\n              <input\n                class={'w-96'}\n                placeholder=\"enter password\"\n                {...props}\n                type=\"password\"\n              />\n              {field.error && <div>{field.error}</div>}\n            </>\n          )}\n        </Field>\n        <button class=\"w-max\" type=\"submit\">\n          Login\n        </button>\n      </Form>\n    </section>\n  );\n});\n```\n\nThe result is that the error messages will render underneath the field, in case the field is invalid:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fc4d52092565c47df90169c863f825718%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=c4d52092565c47df90169c863f825718&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n### Handling submissions\n\nIf you’ve been observant enough, you might have noticed that even though we have validation on the client, we still don’t actually submit it.\n\nNow, to add this to our form, all we have to do is add a `formAction$` function to our `useForm`:\n\n```tsx\n// FILE: src/routes/modular-forms/index.tsx\n\n// .... our previous code\n\nexport const useFormAction = formAction$<LoginForm>((values) => {\n  // Runs on server\n  console.log(values);\n  // This validates the values on the server side.\n  // And cannot be manipulated by an attacker. ✅ \n}, zodForm$(formSchema));\n\nexport default component$(() => {\n  const [_, { Form, Field }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n    validate: zodForm$(formSchema),\n    action: useFormAction(),\n  });\n\n  // ... the rest of our previous code\n}\n```\n\nTo optionally process the form values client-side as well, we can add a function that is passed to the `onSubmit$` property of the `Form` component.\n\n```tsx\nexport default component$(() => {\n  // ... \n\n  const handleSubmit: SubmitHandler<LoginForm> = $((values, event) => {\n    // Runs on client\n  });\n\n  return (\n    <Form onSubmit$={handleSubmit}>\n      …\n    </Form>\n  );\n}\n```\n\nSomething that I have not found clear was how you get the response from the server back on the client. Perhaps this is a needed feature to request, as this library is still in beta.\n\nIt’s just something that I got accustomed to with `routeAction$`, and I expected it to behave the same and give me a signal with the server response.\n\nI asked Fabian, the creator of the library, and he helped me out.\n\nAs the library is both for SolidJS and Qwik, the intention is to keep a similar API. All that to say that in order to access the server response, all you need to do is return it with the `FormActionResult` signature.\n\nTo get our end to end types correct, we now need to add a return type as a second generic to our `formAction$` call:\n\n```tsx\nexport const useFormAction = formAction$<LoginForm, LoginResponse>(\n  async ({ email, password }) => {\n    // Runs on server\n    // simulating adding a user to the DB.\n    const createdUserID = await db.users.add({ email, password })\n    return {\n      status: 'success',\n      message: 'User added successfully',\n      data: { createdUserID },\n    };\n  },\n  zodForm$(formSchema)\n);\n```\n\nNow we get that sweet auto complete in our client-side code:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F66df5ff3e04c4ded80408ec28eb4b8ce%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=66df5ff3e04c4ded80408ec28eb4b8ce&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\nNotice that we also get a loading state through the `submitting` property as well as the response data once the server responds:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F71557150d6d74bf6ab6eac654c55b27c%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=71557150d6d74bf6ab6eac654c55b27c&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n\n### Bonus: Progressively enhanced form out of the box\n\nThis is more a feature of Qwik than the Modular Forms library, however, it’s worth noting. To show this off, all we need is to turn off JavaScript in your browser (Chrome devtools → open command palette → Disable JavaScript).\n\nOnce deactivated, the form will still work as below:\n\n<video muted loop autoplay>\n  <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2F5d090afa01ba40e3b9f5e2395c004deb%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=5d090afa01ba40e3b9f5e2395c004deb&alt=media&optimized=true\" type=\"video/mp4\"/>\n</video>\n\n## TL;DR\n\nSo, basically, if you're a developer and you want to build forms that are easy to use and maintain while ensuring type safety on both the client and server side, then you should check out the combination of Modular Forms and Qwik.\n\nOne of the cool things about Modular Forms is that it uses Zod for validation and schema definition on the server-side. This makes it super efficient and reliable. Also, it has built-in validation functions that you use to validate form data on the client-side. This helps to improve the user experience and prevent errors.\n\nNow, Qwik is also pretty sweet because it has a progressively enhanced form feature. This means that even if JavaScript is off in the user's browser, the forms still work. So, everyone can use the forms, no matter what their browser settings are.\n\nAll in all, Modular Forms and Qwik make it super straightforward and safe for developers to build forms for their web applications and websites. So, if that's something you need to do, you should definitely give this combo a try!\n\n</ArticleBlock>"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/components/articles-grid.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\nimport { Image } from 'qwik-image';\nimport { blogArticles } from '../../data';\nimport { ClockIcon } from '../icons/clock-icon';\n\nexport const ArticlesGrid = component$(() => {\n  return (\n    <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6\">\n      {blogArticles.map((post, key) => (\n        <article\n          key={key}\n          class=\"group rounded-xl overflow-hidden shadow-xs hover:shadow-xl transition-shadow duration-300 cursor-pointer z-10\"\n        >\n          <Link href={post.path}>\n            <div class=\"relative h-48 overflow-hidden\">\n              <Image\n                layout=\"constrained\"\n                class=\"w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-500\"\n                src={post.image}\n                alt={post.title}\n              />\n            </div>\n\n            <div class=\"p-6 bg-[color:var(--text-color)]\">\n              <h3 class=\"pb-4 text-xl font-bold text-[color:var(--bg-color)] min-h-[72px] group-hover:opacity-70 transition-colors\">\n                {post.title}\n              </h3>\n\n              <div class=\"pb-4\">\n                {post.tags.map((tag, key) => (\n                  <span\n                    key={key}\n                    class=\"px-3 py-1 mr-2 text-xs font-semibold text-[color:var(--text-color)] bg-[color:var(--bg-color)] rounded-full\"\n                  >\n                    {tag}\n                  </span>\n                ))}\n              </div>\n              <div class=\"flex items-center space-x-4 text-sm text-[color:var(--bg-color)]\">\n                <div class=\"flex items-center\">\n                  <ClockIcon />\n                  <span>{post.readingTime || '5'} min read</span>\n                </div>\n              </div>\n            </div>\n          </Link>\n        </article>\n      ))}\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/components/featured-article.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\nimport { Image } from 'qwik-image';\nimport { ClockIcon } from '../icons/clock-icon';\nimport { blogArticles } from '../../data';\n\nexport const FeaturedArticle = component$(() => {\n  return (\n    <article class=\"relative group cursor-pointer\">\n      <Link href={blogArticles[0].path}>\n        <div class=\"relative max-w-[1200px] overflow-hidden rounded-xl\">\n          <Image\n            layout=\"fullWidth\"\n            objectFit=\"fill\"\n            class=\"transform group-hover:scale-105 transition-transform duration-500\"\n            src={blogArticles[0].image}\n            alt={blogArticles[0].title}\n          />\n        </div>\n\n        <div\n          class={{\n            'hidden md:block absolute p-14 text-white': true,\n            'bottom-0': blogArticles[0].featuredTitlePosition === 'bottom',\n            'top-0': blogArticles[0].featuredTitlePosition === 'top',\n            hidden: blogArticles[0].featuredTitlePosition === 'none',\n          }}\n        >\n          <h2 class=\"pb-4 text-3xl font-bold leading-tight hover:text-slate-200 transition-colors\">\n            {blogArticles[0].title}\n          </h2>\n          <div class=\"pb-4\">\n            {blogArticles[0].tags.map((tag, key) => (\n              <span\n                key={key}\n                class=\"mb-4 px-3 py-1 mr-2 text-xs text-[#0e201a] bg-white rounded-full backdrop-blur-xs\"\n              >\n                {tag}\n              </span>\n            ))}\n          </div>\n          <div class=\"mb-4 flex items-center space-x-4 text-sm\">\n            <div class=\"flex items-center\">\n              <ClockIcon />\n              <span>{blogArticles[0].readingTime || '5'} min read</span>\n            </div>\n          </div>\n        </div>\n      </Link>\n    </article>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/components/mdx/article-block.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport { useDocumentHead, useLocation } from '@builder.io/qwik-city';\nimport { authors, blogArticles } from '~/routes/(blog)/data';\nimport { ArticleHero } from './article-hero';\n\ntype Props = { authorLink: string };\n\nexport const ArticleBlock = component$<Props>(({ authorLink }) => {\n  const location = useLocation();\n  const { frontmatter } = useDocumentHead();\n  const article = blogArticles.find(({ path }) => path === location.url.pathname);\n  const authorLinks = frontmatter.authors.map((author: string) => authors[author].socialLink);\n\n  return (\n    <div class=\"docs\">\n      <ArticleHero image={article?.image || ''} authorLinks={authorLinks} />\n      <article class=\"max-w-[900px] mx-auto\">\n        <Slot />\n      </article>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/components/mdx/article-hero.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Link, useDocumentHead } from '@builder.io/qwik-city';\nimport { Image } from 'qwik-image';\n\ntype Props = { image: string; authorLinks: string[] };\n\nexport const ArticleHero = component$<Props>(({ image, authorLinks }) => {\n  const { title, frontmatter } = useDocumentHead();\n\n  if (\n    !frontmatter.authors ||\n    !Array.isArray(frontmatter.authors) ||\n    frontmatter.authors.length === 0 ||\n    !frontmatter.tags ||\n    !frontmatter.date\n  ) {\n    return <>Missing frontmatter props or authors array is empty</>;\n  }\n\n  return (\n    <>\n      <div class=\"pt-4\">\n        <Link\n          class=\"text-[color:var(--text-color)] flex items-center space-x-1 pl-2\"\n          rel=\"noopener\"\n          href=\"/blog\"\n        >\n          <svg\n            aria-hidden=\"true\"\n            height=\"16\"\n            viewBox=\"0 0 16 16\"\n            version=\"1.1\"\n            width=\"16\"\n            data-view-component=\"true\"\n            fill=\"currentcolor\"\n          >\n            <path d=\"M7.78 12.53a.75.75 0 0 1-1.06 0L2.47 8.28a.75.75 0 0 1 0-1.06l4.25-4.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L4.81 7h7.44a.75.75 0 0 1 0 1.5H4.81l2.97 2.97a.75.75 0 0 1 0 1.06Z\"></path>\n          </svg>\n          <span class=\"text-xl\">Back to blog</span>\n        </Link>\n      </div>\n      <div class=\"max-w-[1000px] pb-8 mx-auto\">\n        <div class=\"flex flex-col justify-center\">\n          <h4 class=\"text-xl text-[color:var(--qwik-blue)] font-semibold uppercase text-center pt-6 tracking-wide\">\n            {frontmatter.tags.map((tag: string) => (\n              <span class=\"pr-2\">{tag}</span>\n            ))}\n          </h4>\n          <h1 class=\"text-[48px] text-[color:var(--text-color)] font-bold text-center tracking-wide pt-6\">\n            {title}\n          </h1>\n          <div class=\"flex justify-center pt-8 pb-10 text-[color:var(--text-color)] text-xl\">\n            <h4 class=\"font-semibold uppercase text-center\">{frontmatter.date}</h4>\n            <div class=\"border border-[color:var(--text-color)] mx-4\"></div>\n            <div class=\"font-semibold uppercase text-center\">\n              {frontmatter.authors.length > 1 && 'Co-'}Written by{' '}\n              {frontmatter.authors.map((author: string, index: number) => (\n                <span key={author}>\n                  <a\n                    class=\"text-[color:var(--qwik-blue)]\"\n                    target=\"_blank\"\n                    rel=\"noopener\"\n                    href={authorLinks[index]}\n                  >\n                    {author}\n                  </a>\n                  {index < frontmatter.authors.length - 1 &&\n                    (index === frontmatter.authors.length - 2 ? ' & ' : ', ')}\n                </span>\n              ))}\n            </div>\n          </div>\n        </div>\n      </div>\n      <div class=\"relative max-w-[1200px] bg-[color:var(--text-color)]\">\n        <Image alt={title} src={image} layout=\"fullWidth\" class=\"max-w-[1200px]\" />\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/components/mdx/discord-link.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ntype Props = { text?: string };\n\nexport const DiscordLink = component$<Props>(({ text = 'Discord server' }) => (\n  <a href=\"https://discord.gg/7QZ85hCkSM\" rel=\"noopener noreferrer\" target=\"_blank\">\n    {text}\n  </a>\n));\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/icons/clock-icon.tsx",
    "content": "export const ClockIcon = () => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width=\"24\"\n    height=\"24\"\n    viewBox=\"0 0 24 24\"\n    fill=\"none\"\n    stroke=\"currentColor\"\n    stroke-width=\"2\"\n    stroke-linecap=\"round\"\n    stroke-linejoin=\"round\"\n    class=\"w-4 h-4 mr-1\"\n  >\n    <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n    <polyline points=\"12 6 12 12 16 14\"></polyline>\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/icons/send-icon.tsx",
    "content": "export const SendIcon = () => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width=\"24\"\n    height=\"24\"\n    viewBox=\"0 0 24 24\"\n    fill=\"none\"\n    stroke=\"currentColor\"\n    stroke-width=\"2\"\n    stroke-linecap=\"round\"\n    stroke-linejoin=\"round\"\n    class=\"w-4 h-4 ml-2\"\n  >\n    <path d=\"m22 2-7 20-4-9-9-4Z\"></path>\n    <path d=\"M22 2 11 13\"></path>\n  </svg>\n);\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/blog/index.tsx",
    "content": "import { component$, useStyles$ } from '@builder.io/qwik';\nimport type { DocumentHead } from '@builder.io/qwik-city';\nimport { FeaturedArticle } from './components/featured-article';\nimport { ArticlesGrid } from './components/articles-grid';\n\nexport default component$(() => {\n  useStyles$(`\n    .blog .purple-gradient {\n      position: fixed;\n      pointer-events: none;\n      width: 1400px;\n      height: 800px;\n      top: 100px;\n      right: -400px;\n      background: radial-gradient(\n        57.58% 57.58% at 48.79% 42.42%,\n        rgba(24, 180, 244, 0.5) 0%,\n        rgba(46, 55, 114, 0) 63.22%\n      );\n      transform: rotate(5deg);\n    }\n\n    .blog .blue-gradient {\n      position: fixed;\n      pointer-events: none;\n      width: 1400px;\n      height: 1200px;\n      top: 600px;\n      left: -200px;\n      background: radial-gradient(\n        50% 50% at 50% 50%,\n        rgba(172, 127, 244, 0.5) 0%,\n        rgba(21, 25, 52, 0) 100%\n      );\n      transform: rotate(-5deg);\n    }`);\n\n  return (\n    <div class=\"py-8\">\n      <section class=\"pb-8\">\n        <FeaturedArticle />\n      </section>\n      <section>\n        <h2 class=\"pb-4 text-2xl font-bold text-[color:var(--text-color)]\">Latest Articles</h2>\n        <ArticlesGrid />\n      </section>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: 'Qwik Blog',\n};\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/data.ts",
    "content": "import fontlessImage from './blog/(articles)/fontless/fontless-hero.webp';\nimport preloaderImage from './blog/(articles)/qwik-1-14-preloader/qwik-preloader-hero.webp';\n\nexport const authors: Record<string, { socialLink: string }> = {\n  'The Qwik Team': { socialLink: 'https://bsky.app/profile/qwik.dev' },\n  'Jack Shelton': { socialLink: 'https://x.com/TheJackShelton' },\n  'Vishwas Gopinath': { socialLink: 'https://x.com/CodevolutionWeb' },\n  'Manu Mtz.-Almeida': { socialLink: 'https://x.com/manucorporat' },\n  'Steve Sewell': { socialLink: 'https://x.com/steve8708' },\n  'Yoav Ganbar': { socialLink: 'https://x.com/HamatoYogi' },\n  'Miško Hevery': { socialLink: 'https://x.com/mhevery' },\n  'Maïeul Chevalier': { socialLink: 'https://x.com/maiieul' },\n  'Shai Reznik': { socialLink: 'https://x.com/shai_reznik' },\n  'Wout Mertens': { socialLink: 'https://x.com/woutmertens' },\n  'Giorgio Boa': { socialLink: 'https://github.com/gioboa' },\n};\n\ntype BlogArticle = {\n  title: string;\n  image: string;\n  path: string;\n  tags: string[];\n  featuredTitlePosition?: 'top' | 'bottom' | 'none';\n  readingTime: number;\n};\n\nexport const blogArticles: BlogArticle[] = [\n  {\n    title: 'Effortlessly optimize web fonts with fontless.',\n    image: fontlessImage,\n    path: '/blog/fontless/',\n    tags: ['Fontaine', 'Qwik'],\n    featuredTitlePosition: 'top',\n    readingTime: 2,\n  },\n  {\n    title: 'Introducing the Qwik Preloader',\n    image: preloaderImage,\n    path: '/blog/qwik-1-14-preloader/',\n    tags: ['Qwik'],\n    readingTime: 10,\n  },\n  {\n    title: 'Moving Forward Together',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F78b0d6ebdc154e2db77876ec00aef6f7',\n    path: '/blog/qwik-next-leap/',\n    tags: ['Web Development'],\n    readingTime: 3,\n  },\n  {\n    title: 'Towards Qwik 2.0: Lighter, Faster, Better',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F9dd98bcf8fee4b42a718449c5151d53d',\n    path: '/blog/qwik-2-coming-soon/',\n    tags: ['Qwik'],\n    readingTime: 9,\n  },\n  {\n    title: 'Astro + Qwik: Houston, we have Resumability!',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F2418eac0b25046b197bf7b8bf5dfd637',\n    path: '/blog/astro-qwik/',\n    tags: ['Qwik'],\n    readingTime: 4,\n  },\n  {\n    title: 'Qwik City Routing: A Visual Guide',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F4f52dab5f87142a38002269540e69cef',\n    path: '/blog/qwik-city-routing/',\n    tags: ['Web Development'],\n    readingTime: 11,\n  },\n  {\n    title: 'Qwik 1.2: Performance in Autopilot',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F447d6d0349d4442496c3d7e246ce3d24',\n    path: '/blog/qwik-1-2-performance-autopilot/',\n    tags: ['Web Development'],\n    readingTime: 10,\n  },\n  {\n    title: \"Boost Your Site Perf with Qwik's useVisibleTask$ Hook\",\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F5d90a118ceac4678a9e0576e61a955a9',\n    path: '/blog/qwik-tasks/',\n    tags: ['Web Development'],\n    readingTime: 4,\n  },\n  {\n    title: 'Qwik Reaches v1.0',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fca46e4da83b7429ea159e2a42a197288',\n    path: '/blog/qwik-v1/',\n    tags: ['Qwik'],\n    readingTime: 5,\n  },\n  {\n    title: 'Type Safe Forms in Qwik with Modular Forms',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F7abec2f848764aa99fead32861505344',\n    path: '/blog/type-safe-forms-in-qwik/',\n    tags: ['Web Development'],\n    readingTime: 8,\n  },\n  {\n    title: 'Qwik Reaches RC Milestone',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F043bec968cb7465fac152147b9e5bd57',\n    path: '/blog/qwik-rc-milestone/',\n    tags: ['Qwik'],\n    readingTime: 2,\n  },\n  {\n    title: 'Building Framer Motion Animations with Qwik',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fbf1420524b2241619cc68efbba7b7c13',\n    path: '/blog/framer-motion-qwik/',\n    tags: ['Web Development'],\n    readingTime: 7,\n  },\n  {\n    title: 'Code Extraction: The Silent Web Revolution',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F0a8170ff2659474883ee032a0129cddd',\n    path: '/blog/module-extraction-the-silent-web-revolution/',\n    tags: ['Qwik'],\n    readingTime: 9,\n  },\n  {\n    title: 'Introducing Qwik City Server Functions',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F48d8fd6d22ae4c3b9c1ec4817ce4046d',\n    path: '/blog/qwik-city-server-functions/',\n    tags: ['Qwik'],\n    readingTime: 6,\n  },\n  {\n    title: 'Resumable React: How to Use React Inside Qwik',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F9071a7def0b240e5b5ca6aab756e81b8',\n    path: '/blog/resumable-react-how-to-use-react-inside-qwik/',\n    tags: ['Web Development'],\n    readingTime: 8,\n  },\n  {\n    title: 'The Qase for Qwik: Love At First TTI',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F69e3a278f34d4bfc9deb783dc705cd9a',\n    path: '/blog/the-qase-for-qwik-love-at-first-tti/',\n    tags: ['Qwik'],\n    readingTime: 18,\n  },\n  {\n    title: 'Qwik and Qwik City have reached beta! 🎉',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F5f8db18f68c74f6f9919f3877b6246b4',\n    path: '/blog/qwik-and-qwik-city-have-reached-beta/',\n    tags: ['Web Development'],\n    readingTime: 3,\n  },\n  {\n    title: 'Introducing Qwik starters - get up and running with Qwik now',\n    image:\n      'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F85209017e99f4753a56614f6712817c5',\n    path: '/blog/introducing-qwik-starters/',\n    tags: ['Qwik'],\n    readingTime: 1,\n  },\n];\n"
  },
  {
    "path": "packages/docs/src/routes/(blog)/layout.tsx",
    "content": "import { $, component$, Slot, useStyles$ } from '@builder.io/qwik';\nimport { Header } from '../../components/header/header';\nimport { Footer } from '../../components/footer/footer';\nimport { type RequestHandler } from '@builder.io/qwik-city';\nimport { useImageProvider, type ImageTransformerProps } from 'qwik-image';\nimport docsStyles from '../docs/docs.css?inline';\n\nexport const onRequest: RequestHandler = async (request) => {\n  request.cacheControl(600);\n};\n\nexport default component$(() => {\n  useStyles$(docsStyles);\n  useStyles$(`\n    .docs article p {\n      font-size: 18px;\n    }\n\n    #qwik-image-warning-container {\n      display: none;\n    }`);\n\n  useImageProvider({ imageTransformer$: $(({ src }: ImageTransformerProps): string => src) });\n\n  return (\n    <>\n      <Header />\n      <main>\n        <div class=\"blog\">\n          <div class=\"purple-gradient\" role=\"presentation\" />\n          <div class=\"blue-gradient\" role=\"presentation\" />\n          <div class=\"flex flex-wrap gap-9 max-w-[1200px] mb-20 mx-auto\">\n            <div class=\"w-full px-10 xl:px-0\">\n              <Slot />\n            </div>\n          </div>\n        </div>\n      </main>\n      <div class=\"px-4\">\n        <Footer />\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/ecosystem/ecosystem-menu.tsx",
    "content": "import { MenuItems } from './menu-items';\n\nexport const EcosystemMenu = () => {\n  return (\n    <aside class=\"hidden lg:block lg:pl-6\">\n      <div class=\"ecosystem-menu\">\n        <h3>Explore</h3>\n        <ul>\n          <MenuItems />\n        </ul>\n      </div>\n    </aside>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/ecosystem/index.tsx",
    "content": "import { component$, useStyles$, type FunctionComponent } from '@builder.io/qwik';\nimport type { DocumentHead } from '@builder.io/qwik-city';\nimport { Link } from '@builder.io/qwik-city';\nimport ImgQwikNewsletter from '~/media/ecosystem/qwik-newsletter.svg?jsx';\nimport styles from '../ecosystem.css?inline';\nimport data from '../ecosystem.json';\nimport { MEDIA, type MediaEntry } from '../media/index';\nimport SHOWCASE from '../showcase/generated-pages.json';\nimport { EcosystemMenu } from './ecosystem-menu';\nimport { MobileEcosystemMenu } from './mobile-ecosystem-menu';\nimport { QwikPlusLogo } from './qwik-plus-logo';\n\nconst getRandomSites = (sites: typeof SHOWCASE) => {\n  return sites\n    .filter((site) => site.perf.score >= 0.9)\n    .sort(() => (Math.random() > 0.5 ? 1 : -1))\n    .slice(0, 6);\n};\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  const mediaFilter = (item: MediaEntry) => item?.promoted;\n\n  const courses = MEDIA.courses.filter(mediaFilter);\n  const videos = MEDIA.videos.filter(mediaFilter);\n  const podcasts = MEDIA.podcasts.filter(mediaFilter);\n  const presentations = MEDIA.presentations.filter(mediaFilter);\n  const showcaseSites = getRandomSites(SHOWCASE);\n\n  return (\n    <>\n      <div class=\"ecosystem lg:grid grid-cols-[240px,1fr] m-auto max-w-screen-xl gap-8 custom-grid-cols-240px-1fr-tailwind-workaround\">\n        <EcosystemMenu />\n        <MobileEcosystemMenu />\n\n        <article class=\"px-6\">\n          <QwikPlusLogo />\n\n          <div class=\"purple-gradient\" role=\"presentation\" />\n          <div class=\"blue-gradient\" role=\"presentation\" />\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"deployments\">\n            <h2>\n              <Link href=\"/docs/deployments/\">Deployments</Link>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {data.deployments.map((item, i) => (\n                <GridItem\n                  title={item.title}\n                  href={item.href}\n                  imgSrc={item.imgSrc}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n              <AddIntegrationItem\n                title=\"Add A Deployment\"\n                href=\"/docs/deployments/#add-a-new-deployment\"\n              />\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"integrations\">\n            <h2>\n              <span>\n                <Link href=\"/docs/integrations/\">Integrations</Link>\n              </span>\n              <span>\n                <Link href=\"/docs/integrations/\" class=\"text-sm\">\n                  See All\n                </Link>\n              </span>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {data.integrations.map((item, i) => (\n                <GridItem\n                  title={item.title}\n                  href={item.href}\n                  imgSrc={item.imgSrc}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n              <AddIntegrationItem\n                title=\"Add An Integration\"\n                href=\"/docs/integrations/#add-a-new-integration\"\n              />\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"libraries\">\n            <h2>\n              <span>Libraries</span>\n              <span></span>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {data.libraries.map((item, i) => (\n                <LibraryGridItem\n                  title={item.title}\n                  href={item.github}\n                  imgSrc={item.imgSrc}\n                  width={item.width || 90}\n                  height={item.height || 90}\n                  description={item.description}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n              <AddIntegrationItem title=\"Add A Library\" href=\"/docs/advanced/library/\" />\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\">\n            <h2>Newsletter</h2>\n            <a href=\"https://qwiknewsletter.com\" target=\"_blank\">\n              <div class=\"flex flex-col items-center gap-8\">\n                <div\n                  class=\"flex justify-center p-4 w-full bg-[--qwik-dark-purple]\n        bg-gradient-to-r from-[--qwik-dark-purple-bg] via-purple-500 to-[--qwik-dark-purple-bg]\"\n                >\n                  <ImgQwikNewsletter />\n                </div>\n                <div class=\"text-2xl font-bold\">Qwikly Newsletter - Weekly news about Qwik</div>\n              </div>\n            </a>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"courses\">\n            <h2>\n              <span>\n                <Link href=\"/media/#courses\">Courses</Link>\n              </span>\n              <span>\n                <Link href=\"/media/#courses\" class=\"text-sm\">\n                  See All\n                </Link>\n              </span>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {courses.map((item, i) => (\n                <GridItem\n                  title={item.title}\n                  href={item.href}\n                  imgSrc={item.imgSrc}\n                  imgCover={true}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n              <AddIntegrationItem\n                title=\"Add A Course\"\n                href=\"https://github.com/QwikDev/qwik/blob/main/packages/docs/src/routes/(ecosystem)/media/index.tsx\"\n              />\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"videos\">\n            <h2>\n              <span>\n                <Link href=\"/media/#videos\">Videos</Link>\n              </span>\n              <span>\n                <a\n                  href=\"https://youtube.com/playlist?list=PLq_6N4Z1G7mSAh_v9jfVUcu_R1vOM5Nob&si=46Ko4cy1sCUzJFJJ\"\n                  class=\"text-sm\"\n                >\n                  See All\n                </a>\n              </span>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {videos.map((item, i) => (\n                <GridItem\n                  title={item.title}\n                  href={item.href}\n                  imgSrc={item.imgSrc}\n                  imgCover={true}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"podcasts\">\n            <h2>\n              <span>\n                <Link href=\"/media/#podcasts\">Podcasts</Link>\n              </span>\n              <span>\n                <Link href=\"/media/#podcasts\" class=\"text-sm\">\n                  See All\n                </Link>\n              </span>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {podcasts.map((item, i) => (\n                <GridItem\n                  title={item.title}\n                  href={item.href}\n                  imgSrc={item.imgSrc}\n                  imgCover={true}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n              <AddIntegrationItem\n                title=\"Add A Podcast\"\n                href=\"https://github.com/QwikDev/qwik/blob/main/packages/docs/src/routes/(ecosystem)/media/index.tsx\"\n              />\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"showcase\">\n            <h2>\n              <span>\n                <Link href=\"/showcase/\">Showcase</Link>\n              </span>\n              <span>\n                <Link href=\"/showcase/\" class=\"text-sm\">\n                  See All\n                </Link>\n              </span>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {showcaseSites.map((item, i) => (\n                <GridItem\n                  title={item.title}\n                  href={item.href}\n                  imgSrc={item.imgSrc}\n                  imgCover={true}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"presentations\">\n            <h2>\n              <span>\n                <Link href=\"/media/#presentations\">Presentations</Link>\n              </span>\n              <span>\n                <Link href=\"/media/#presentations\" class=\"text-sm\">\n                  See All\n                </Link>\n              </span>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {presentations.map((item, i) => (\n                <GridItem\n                  title={item.title}\n                  href={item.href}\n                  imgSrc={item.imgSrc}\n                  imgCover={true}\n                  key={i}\n                  thumbnailBg={true}\n                />\n              ))}\n              <AddIntegrationItem\n                title=\"Add A Presentation\"\n                href=\"https://github.com/QwikDev/qwik/blob/main/packages/docs/src/routes/(ecosystem)/media/index.tsx\"\n              />\n            </ul>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"community\">\n            <h2>\n              <Link href=\"/community/groups/\">Community</Link>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-4\">\n              {data.communities.map((item, i) => (\n                <GridItem title={item.title} href={item.href} imgSrc={item.imgSrc} key={i} />\n              ))}\n            </ul>\n\n            <aside class=\"mt-6 text-center\">\n              <p>Interested in starting a local Qwik community as well?</p>\n              <p>\n                <a\n                  class=\"text-blue-600 font-bold\"\n                  href=\"https://forms.gle/S1rxiKiVdhZqkk8RA\"\n                  target=\"_blank\"\n                >\n                  Please apply here\n                </a>{' '}\n                for the Qwik Community Leaders program\n              </p>\n            </aside>\n          </section>\n\n          <section class=\"scroll-m-20 lg:scroll-m-24\" id=\"social\">\n            <h2>\n              <Link href=\"/community/groups/\">Social</Link>\n            </h2>\n            <ul class=\"grid gap-8 grid-cols-2 md:grid-cols-3\">\n              {data.social.map((item, i) => (\n                <GridItem title={item.title} href={item.href} imgSrc={item.imgSrc} key={i} />\n              ))}\n            </ul>\n          </section>\n        </article>\n      </div>\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: 'Qwik Ecosystem',\n};\n\nexport const GridItem: FunctionComponent<GridItemProps> = (props) => {\n  return (\n    <li class=\"grid-item\">\n      <Link href={props.href}>\n        <div class={{ thumbnail: props.thumbnailBg, cover: props.imgCover }}>\n          <img src={props.imgSrc} alt={props.title} width=\"250\" height=\"120\" loading=\"lazy\" />\n        </div>\n        <div class=\"text\">{props.title}</div>\n      </Link>\n    </li>\n  );\n};\n\nexport const LibraryGridItem: FunctionComponent<LibraryGridItemProps> = (props) => {\n  return (\n    <li class=\"grid-item\">\n      <Link href={props.href}>\n        <div class={{ thumbnail: props.thumbnailBg, cover: props.imgCover }}>\n          <img\n            src={props.imgSrc}\n            alt={props.title}\n            width={props.width || 90}\n            height={props.height || 90}\n            loading=\"lazy\"\n          />\n        </div>\n        <div class=\"text\">{props.title}</div>\n        <div class=\"description\">{props.description}</div>\n      </Link>\n    </li>\n  );\n};\n\nexport const AddIntegrationItem: FunctionComponent<GridItemProps> = (props) => {\n  return (\n    <li class=\"grid-item add-integration\">\n      <Link href={props.href}>\n        <div class=\"thumbnail\">\n          <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 64 64\">\n            <path fill=\"currentColor\" d=\"M38 26V2H26v24H2v12h24v24h12V38h24V26z\" />\n          </svg>\n        </div>\n        <div class=\"text\">{props.title}</div>\n      </Link>\n    </li>\n  );\n};\n\ninterface GridItemProps {\n  title: string;\n  href: string;\n  imgSrc?: string;\n  imgCover?: boolean;\n  thumbnailBg?: boolean;\n}\n\ninterface LibraryGridItemProps {\n  title: string;\n  href: string;\n  description: string;\n  imgSrc?: string;\n  width?: number;\n  height?: number;\n  imgCover?: boolean;\n  thumbnailBg: boolean;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/ecosystem/menu-items.tsx",
    "content": "import { Link } from '@builder.io/qwik-city';\nimport { $ } from '@builder.io/qwik';\n\nexport const MenuItems = () => {\n  const scrollIntoView = $((_: any, elm: HTMLAnchorElement) => {\n    const id = elm.getAttribute('href')?.replace('#', '');\n    const target = document.getElementById(id!);\n    if (target) {\n      target.scrollIntoView({ behavior: 'smooth' });\n      history.pushState(null, '', `#${id}`);\n    }\n  });\n\n  return (\n    <>\n      <li>\n        <Link href=\"#deployments\" onClick$={scrollIntoView} preventdefault:click>\n          <svg\n            width=\"22\"\n            height=\"19\"\n            viewBox=\"0 0 22 19\"\n            fill=\"none\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n            aria-hidden=\"true\"\n          >\n            <g clip-path=\"url(#clip0_1800_3901)\">\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M1.92302 4.04938C1.90718 3.78325 2.10142 3.55371 2.35696 3.53721C2.37625 3.53577 2.39553 3.53577 2.41482 3.53721H4.52941C4.78495 3.55371 4.97919 3.78325 4.96335 4.04938C4.94888 4.29256 4.76291 4.48624 4.52941 4.5013H2.41482C2.15928 4.5178 1.93887 4.31552 1.92302 4.04938Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M1.92302 6.52204C1.90718 6.25519 2.10142 6.02636 2.35696 6.00987C2.37625 6.00843 2.39553 6.00843 2.41482 6.00987H6.05991C6.31545 6.02636 6.50969 6.25519 6.49384 6.52204C6.47938 6.7645 6.29341 6.9589 6.05991 6.97396H2.41482C2.15928 6.99046 1.93887 6.78817 1.92302 6.52204Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M2.44168 8.47681H7.59108C7.84663 8.49331 8.04086 8.72213 8.02502 8.98827C8.01056 9.23144 7.82458 9.42512 7.59108 9.4409H2.44168C2.18614 9.42369 1.9919 9.19486 2.00774 8.92873C2.0222 8.68555 2.20818 8.49187 2.44168 8.47681Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M9.96949 11.4049C9.98533 11.671 9.79109 11.8999 9.53555 11.9164C9.51626 11.9178 9.49698 11.9178 9.47769 11.9164H2.41482C2.15928 11.9336 1.93887 11.7306 1.92302 11.4644C1.90718 11.1983 2.10142 10.9695 2.35696 10.953C2.37625 10.9515 2.39553 10.9515 2.41482 10.953H9.47769C9.73323 10.9358 9.95364 11.1388 9.96949 11.4049Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M9.53555 11.9164C9.51626 11.9178 9.49698 11.9178 9.47769 11.9164H2.41482C2.15928 11.9336 1.93887 11.7306 1.92302 11.4644C1.90718 11.1983 2.10142 10.9695 2.35696 10.953C2.37625 10.9515 2.39553 10.9515 2.41482 10.953H9.47769C9.73323 10.9358 9.95364 11.1388 9.96949 11.4049C9.98533 11.671 9.79109 11.8999 9.53555 11.9164Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M8.02502 8.98827C8.01056 9.23144 7.82458 9.42512 7.59108 9.4409H2.44168C2.18614 9.42369 1.9919 9.19486 2.00774 8.92873C2.0222 8.68555 2.20818 8.49187 2.44168 8.47681H7.59108C7.84663 8.49331 8.04086 8.72213 8.02502 8.98827Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M6.49384 6.52204C6.47938 6.7645 6.29341 6.9589 6.05991 6.97396H2.41482C2.15928 6.99046 1.93887 6.78817 1.92302 6.52204C1.90718 6.25519 2.10142 6.02636 2.35696 6.00987C2.37625 6.00843 2.39553 6.00843 2.41482 6.00987H6.05991C6.31545 6.02636 6.50969 6.25519 6.49384 6.52204Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M4.96335 4.04938C4.94888 4.29256 4.76291 4.48624 4.52941 4.5013H2.41482C2.15928 4.5178 1.93887 4.31552 1.92302 4.04938C1.90718 3.78325 2.10142 3.55371 2.35696 3.53721C2.37625 3.53577 2.39553 3.53577 2.41482 3.53721H4.52941C4.78495 3.55371 4.97919 3.78325 4.96335 4.04938Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M1.92302 4.04938C1.90718 3.78325 2.10142 3.55371 2.35696 3.53721C2.37625 3.53577 2.39553 3.53577 2.41482 3.53721H4.52941C4.78495 3.55371 4.97919 3.78325 4.96335 4.04938C4.94888 4.29256 4.76291 4.48624 4.52941 4.5013H2.41482C2.15928 4.5178 1.93887 4.31552 1.92302 4.04938Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M1.92302 6.52204C1.90718 6.25519 2.10142 6.02636 2.35696 6.00987C2.37625 6.00843 2.39553 6.00843 2.41482 6.00987H6.05991C6.31545 6.02636 6.50969 6.25519 6.49384 6.52204C6.47938 6.7645 6.29341 6.9589 6.05991 6.97396H2.41482C2.15928 6.99046 1.93887 6.78817 1.92302 6.52204Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M2.44168 8.47681H7.59108C7.84663 8.49331 8.04086 8.72213 8.02502 8.98827C8.01056 9.23144 7.82458 9.42512 7.59108 9.4409H2.44168C2.18614 9.42369 1.9919 9.19486 2.00774 8.92873C2.0222 8.68555 2.20818 8.49187 2.44168 8.47681Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M9.96949 11.4049C9.98533 11.671 9.79109 11.8999 9.53555 11.9164C9.51626 11.9178 9.49698 11.9178 9.47769 11.9164H2.41482C2.15928 11.9336 1.93887 11.7306 1.92302 11.4644C1.90718 11.1983 2.10142 10.9695 2.35696 10.953C2.37625 10.9515 2.39553 10.9515 2.41482 10.953H9.47769C9.73323 10.9358 9.95364 11.1388 9.96949 11.4049Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M11.637 9.38488L14.0078 7.98608V9.38488H13.9933L12.4663 9.98099L13.9933 10.5857V11.9838L11.637 10.5857V9.38488Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M15.9345 7.31323H16.9422L15.6886 12.3676H14.6809L15.9345 7.31323Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M19.7814 9.38488V10.5857L17.4133 11.9838V10.5857L18.9383 9.98099L17.4133 9.38488V7.98608L19.7814 9.38488Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M21.4021 0H0.597876C0.269323 0.00143467 0.00276045 0.276891 5.2883e-06 0.619058V14.9765C-0.00137229 15.3215 0.266568 15.602 0.597876 15.6027H21.4021C21.7321 15.602 21.9993 15.3237 22 14.9801V0.622645C21.9993 0.279043 21.7321 0.00143467 21.4021 0ZM20.4461 0.917469C20.6438 0.917469 20.8043 1.08461 20.8043 1.29048C20.8043 1.49636 20.6438 1.6635 20.4461 1.6635C20.2484 1.6635 20.0879 1.49636 20.0879 1.29048C20.0879 1.08461 20.2484 0.917469 20.4461 0.917469ZM19.2428 0.917469C19.4405 0.917469 19.6009 1.08461 19.6009 1.29048C19.6009 1.49636 19.4405 1.6635 19.2428 1.6635C19.0451 1.6635 18.8846 1.49636 18.8846 1.29048C18.8846 1.08461 19.0451 0.917469 19.2428 0.917469ZM18.0395 0.917469C18.2371 0.917469 18.3976 1.08461 18.3976 1.29048C18.3976 1.49636 18.2371 1.6635 18.0395 1.6635C17.8418 1.6635 17.6813 1.49636 17.6813 1.29048C17.6813 1.08461 17.8418 0.917469 18.0395 0.917469ZM10.316 2.17208H12.9638C12.9761 2.25099 12.9823 2.33133 12.9817 2.41096C12.9334 3.10462 12.4031 3.65625 11.737 3.70718C10.9959 3.76385 10.3505 3.18352 10.2961 2.41096C10.2967 2.33133 10.3029 2.25099 10.316 2.17208ZM21.4572 13.209C21.4572 13.5174 21.2169 13.7685 20.9207 13.7685H1.09036C0.793493 13.7685 0.553105 13.5174 0.553105 13.209V2.17998H8.26619V2.68354C8.26619 2.87148 8.4129 3.02428 8.59337 3.02428H9.10032C9.15198 3.25884 9.23326 3.48552 9.34208 3.69785L8.95154 4.10243C8.82894 4.23513 8.82894 4.4446 8.95154 4.5773L9.43714 5.08302C9.43714 5.08302 9.43852 5.08517 9.43989 5.08589C9.56801 5.21788 9.77396 5.21645 9.90069 5.08302L10.2589 4.71001C10.4538 4.83769 10.6646 4.9374 10.885 5.00627V5.58085C10.8864 5.76879 11.0324 5.92087 11.2128 5.9223H11.9058C12.0862 5.92087 12.2323 5.76879 12.2336 5.58085V5.05505C12.4582 5.00125 12.6751 4.9166 12.8777 4.80326L13.2682 5.20999C13.3963 5.34198 13.6023 5.34198 13.7304 5.20999L14.2153 4.70427C14.3427 4.57156 14.3427 4.35636 14.2153 4.22366L13.8571 3.85064C13.9804 3.64692 14.0768 3.42742 14.1437 3.19787H14.6809C14.8621 3.19787 15.0088 3.04508 15.0088 2.85642V2.17208H21.4572V13.209Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                fill-rule=\"evenodd\"\n                clip-rule=\"evenodd\"\n                d=\"M8.28764 16.4585H13.7126C13.727 17.4355 14.1134 18.3121 15.1611 19H6.83911C7.68219 18.3644 8.29108 17.594 8.28764 16.4585Z\"\n                fill=\"currentColor\"\n              />\n            </g>\n            <defs>\n              <clipPath id=\"clip0_1800_3901\">\n                <rect width=\"22\" height=\"19\" fill=\"white\" />\n              </clipPath>\n            </defs>\n          </svg>\n\n          <span>Deployments</span>\n        </Link>\n      </li>\n\n      <li>\n        <Link href=\"#integrations\" onClick$={scrollIntoView} preventdefault:click>\n          <svg\n            width=\"20\"\n            height=\"19\"\n            viewBox=\"0 0 20 19\"\n            fill=\"none\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n            aria-hidden=\"true\"\n          >\n            <g clip-path=\"url(#clip0_1800_3922)\">\n              <path\n                d=\"M18.3871 14.5763H16.9742C16.7959 14.5763 16.6516 14.4346 16.6516 14.2594C16.6516 14.0842 16.7959 13.9425 16.9742 13.9425H18.3871C18.9207 13.9425 19.3548 13.5161 19.3548 12.9919V1.58438C19.3548 1.06017 18.9207 0.633751 18.3871 0.633751H1.6129C1.07926 0.633751 0.645161 1.06017 0.645161 1.58438V12.9919C0.645161 13.5161 1.07926 13.9425 1.6129 13.9425H3.02581C3.20415 13.9425 3.34839 14.0842 3.34839 14.2594C3.34839 14.4346 3.20415 14.5763 3.02581 14.5763H1.6129C0.723502 14.5763 0 13.8656 0 12.9919V1.58438C0 0.710706 0.723502 0 1.6129 0H18.3871C19.2765 0 20 0.710706 20 1.58438V12.9919C20 13.8656 19.2765 14.5763 18.3871 14.5763Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                d=\"M18.3871 3.16866H1.61286C1.43452 3.16866 1.29028 3.02697 1.29028 2.85179C1.29028 2.6766 1.43452 2.53491 1.61286 2.53491H18.3871C18.5654 2.53491 18.7096 2.6766 18.7096 2.85179C18.7096 3.02697 18.5654 3.16866 18.3871 3.16866Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                d=\"M2.25813 1.9012C2.23693 1.9012 2.21573 1.89893 2.19499 1.89486C2.17472 1.89079 2.15444 1.8849 2.13463 1.87675C2.11527 1.86906 2.09638 1.8591 2.07886 1.84778C2.06135 1.83646 2.04476 1.82288 2.03002 1.8084C1.97011 1.74955 1.93555 1.66762 1.93555 1.58432C1.93555 1.5635 1.93785 1.54268 1.942 1.52231C1.94615 1.50239 1.95214 1.48247 1.96043 1.463C1.96827 1.44399 1.9784 1.42543 1.98992 1.40823C2.00145 1.39103 2.01527 1.37473 2.03002 1.36025C2.04476 1.34576 2.06135 1.33218 2.07886 1.32086C2.09638 1.30955 2.11527 1.29959 2.13463 1.29189C2.15444 1.28374 2.17472 1.27786 2.19499 1.27378C2.23647 1.26518 2.27933 1.26518 2.32126 1.27378C2.34154 1.27786 2.36181 1.28374 2.38163 1.29189C2.40098 1.29959 2.41988 1.30955 2.43739 1.32086C2.4549 1.33218 2.47149 1.34576 2.48624 1.36025C2.50098 1.37473 2.51481 1.39103 2.52633 1.40823C2.53785 1.42543 2.54799 1.44399 2.55582 1.463C2.56412 1.48247 2.57011 1.50239 2.57426 1.52231C2.5784 1.54268 2.58071 1.5635 2.58071 1.58432C2.58071 1.66762 2.54615 1.74955 2.48624 1.8084C2.47149 1.82288 2.4549 1.83646 2.43739 1.84778C2.41988 1.8591 2.40098 1.86906 2.38163 1.87675C2.36181 1.8849 2.34154 1.89079 2.32126 1.89486C2.30052 1.89893 2.27933 1.9012 2.25813 1.9012Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                d=\"M3.54841 1.90135C3.52721 1.90135 3.50601 1.89954 3.48528 1.89501C3.465 1.89094 3.44426 1.88505 3.42491 1.8769C3.40555 1.86921 3.38666 1.85925 3.36915 1.84793C3.35164 1.83661 3.33505 1.82303 3.3203 1.80855C3.30555 1.79406 3.29173 1.77777 3.28021 1.76056C3.26869 1.74336 3.25855 1.7248 3.25071 1.70579C3.24242 1.68632 3.23643 1.66641 3.23228 1.64649C3.22767 1.62612 3.22583 1.60529 3.22583 1.58447C3.22583 1.56365 3.22767 1.54282 3.23228 1.52245C3.23643 1.50254 3.24242 1.48262 3.25071 1.46315C3.25855 1.44414 3.26869 1.42558 3.28021 1.40838C3.29173 1.39118 3.30555 1.37488 3.3203 1.3604C3.33505 1.34591 3.35164 1.33233 3.36915 1.32101C3.38666 1.3097 3.40555 1.29974 3.42491 1.29204C3.44426 1.28389 3.465 1.27801 3.48528 1.27393C3.52675 1.26579 3.57007 1.26579 3.61154 1.27393C3.63182 1.27801 3.6521 1.28389 3.67191 1.29204C3.69127 1.29974 3.71016 1.3097 3.72767 1.32101C3.74518 1.33233 3.76177 1.34591 3.77652 1.3604C3.79127 1.37488 3.80463 1.39118 3.81661 1.40838C3.82813 1.42558 3.83827 1.44414 3.84611 1.46315C3.8544 1.48217 3.86039 1.50254 3.86454 1.52245C3.86869 1.54282 3.87099 1.56365 3.87099 1.58447C3.87099 1.60529 3.86869 1.62612 3.86454 1.64649C3.86039 1.66641 3.8544 1.68632 3.84611 1.70579C3.83827 1.7248 3.82813 1.74336 3.81661 1.76056C3.80463 1.77777 3.79127 1.79406 3.77652 1.80855C3.76177 1.82303 3.74518 1.83661 3.72767 1.84793C3.71016 1.85925 3.69127 1.86921 3.67191 1.8769C3.6521 1.88505 3.63182 1.89094 3.61154 1.89501C3.59081 1.89954 3.56961 1.90135 3.54841 1.90135Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                d=\"M4.83869 1.90135C4.8175 1.90135 4.7963 1.89908 4.77556 1.89501C4.75528 1.89094 4.73455 1.88505 4.71519 1.8769C4.69584 1.86921 4.67694 1.85925 4.65943 1.84793C4.64192 1.83616 4.62533 1.82303 4.61058 1.80855C4.59584 1.79406 4.58247 1.77777 4.57049 1.76056C4.55897 1.74336 4.54883 1.7248 4.541 1.70579C4.5327 1.68632 4.52671 1.66641 4.52256 1.64649C4.51842 1.62612 4.51611 1.60529 4.51611 1.58447C4.51611 1.50118 4.55068 1.41924 4.61058 1.3604C4.62533 1.34591 4.64192 1.33278 4.65943 1.32101C4.67694 1.3097 4.69584 1.29974 4.71519 1.29204C4.73455 1.28389 4.75482 1.27801 4.77556 1.27393C4.81703 1.26579 4.86035 1.26579 4.90183 1.27393C4.9221 1.27801 4.94238 1.28389 4.9622 1.29204C4.98155 1.29974 5.00044 1.3097 5.0175 1.32101C5.03547 1.33278 5.05206 1.34591 5.0668 1.3604C5.08155 1.37488 5.09492 1.39118 5.1069 1.40838C5.11842 1.42558 5.12856 1.44414 5.13639 1.46315C5.14468 1.48262 5.15068 1.50254 5.15482 1.52245C5.15897 1.54282 5.16127 1.56365 5.16127 1.58447C5.16127 1.60529 5.15897 1.62612 5.15482 1.64649C5.15068 1.66641 5.14468 1.68632 5.13639 1.70579C5.12856 1.7248 5.11842 1.74336 5.1069 1.76056C5.09492 1.77777 5.08155 1.79406 5.0668 1.80855C5.05206 1.82303 5.03547 1.83616 5.0175 1.84793C5.00044 1.85925 4.98155 1.86921 4.9622 1.8769C4.94238 1.88505 4.9221 1.89094 4.90183 1.89501C4.88109 1.89908 4.85989 1.90135 4.83869 1.90135Z\"\n                fill=\"currentColor\"\n              />\n              <path\n                d=\"M15.1844 11.7696H15.0572C14.7941 11.7696 14.5636 11.6053 14.4724 11.3631C14.4309 11.2531 14.3848 11.1449 14.3355 11.0385C14.2254 10.8031 14.2696 10.5266 14.4558 10.3432L14.5457 10.2549C14.7885 10.0164 14.7885 9.62934 14.5457 9.39078L13.666 8.52662C13.4231 8.28805 13.0291 8.28805 12.7862 8.52662L12.6964 8.61489C12.5097 8.79822 12.2282 8.84168 11.9885 8.73304C11.8807 8.68415 11.7706 8.63933 11.6581 8.59859C11.4116 8.50851 11.2443 8.28262 11.2443 8.02414V7.8992C11.2443 7.5615 10.966 7.28809 10.6222 7.28809H9.37793C9.03416 7.28809 8.75582 7.5615 8.75582 7.8992V8.02414C8.75582 8.28262 8.58853 8.50896 8.34199 8.59859C8.23001 8.63933 8.11987 8.6846 8.01158 8.73304C7.77194 8.84123 7.49038 8.79777 7.30374 8.61489L7.21388 8.52662C6.97102 8.28805 6.57701 8.28805 6.33416 8.52662L5.45443 9.39078C5.21158 9.62934 5.21158 10.0164 5.45443 10.2549L5.54429 10.3432C5.73093 10.5266 5.77517 10.8031 5.66457 11.0385C5.6148 11.1445 5.56918 11.2527 5.5277 11.3631C5.436 11.6053 5.20605 11.7696 4.94291 11.7696H4.81572C4.47194 11.7696 4.1936 12.043 4.1936 12.3807V13.603C4.1936 13.9407 4.47194 14.2141 4.81572 14.2141H4.94291C5.20605 14.2141 5.43646 14.3784 5.5277 14.6206C5.56918 14.7306 5.61526 14.8388 5.66457 14.9452C5.77471 15.1805 5.73047 15.4571 5.54429 15.6405L5.45443 15.7287C5.21158 15.9673 5.21158 16.3543 5.45443 16.5929L6.33416 17.4571C6.57701 17.6956 6.97102 17.6956 7.21388 17.4571L7.30374 17.3688C7.49038 17.1855 7.77194 17.142 8.01158 17.2506C8.11941 17.2995 8.22955 17.3444 8.34199 17.3851C8.58853 17.4752 8.75582 17.7011 8.75582 17.9595V18.0845C8.75582 18.4222 9.03416 18.6956 9.37793 18.6956H10.6222C10.966 18.6956 11.2443 18.4222 11.2443 18.0845V17.9595C11.2443 17.7011 11.4116 17.4747 11.6581 17.3851C11.7701 17.3444 11.8802 17.2991 11.9885 17.2506C12.2282 17.1425 12.5097 17.1859 12.6964 17.3688L12.7862 17.4571C13.0291 17.6956 13.4231 17.6956 13.666 17.4571L14.5457 16.5929C14.7885 16.3543 14.7885 15.9673 14.5457 15.7287L14.4558 15.6405C14.2692 15.4571 14.2249 15.1805 14.3355 14.9452C14.3853 14.8392 14.4309 14.731 14.4724 14.6206C14.5641 14.3784 14.7941 14.2141 15.0572 14.2141H15.1844C15.5282 14.2141 15.8065 13.9407 15.8065 13.603V12.3807C15.8065 12.043 15.5282 11.7696 15.1844 11.7696ZM10.0001 15.8437C9.99637 15.8437 9.99222 15.8437 9.98853 15.8437C9.98485 15.8437 9.9807 15.8437 9.97701 15.8437C8.37379 15.8437 7.07379 14.5667 7.07379 12.9918C7.07379 11.417 8.37379 10.14 9.97701 10.14C9.9807 10.14 9.98485 10.14 9.98853 10.14C9.99222 10.14 9.99637 10.14 10.0001 10.14C11.601 10.14 12.9033 11.4192 12.9033 12.9918C12.9033 14.5645 11.601 15.8437 10.0001 15.8437Z\"\n                fill=\"currentColor\"\n              />\n            </g>\n            <defs>\n              <clipPath id=\"clip0_1800_3922\">\n                <rect width=\"20\" height=\"18.6957\" fill=\"white\" />\n              </clipPath>\n            </defs>\n          </svg>\n          <span>Integrations</span>\n        </Link>\n      </li>\n\n      <li>\n        <Link href=\"#courses\" onClick$={scrollIntoView} preventdefault:click>\n          <svg\n            width=\"20\"\n            height=\"19\"\n            viewBox=\"5 5 37 37\"\n            fill=\"none\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n            aria-hidden=\"true\"\n          >\n            <g fill=\"none\" stroke=\"currentColor\" stroke-linejoin=\"round\" stroke-width=\"4\">\n              <path d=\"M8 7h32v24H8z\"></path>\n              <path\n                stroke-linecap=\"round\"\n                d=\"M4 7h40M15 41l9-10l9 10M16 13h16m-16 6h12m-12 6h6\"\n              ></path>\n            </g>\n          </svg>{' '}\n          <span>Courses</span>\n        </Link>\n      </li>\n\n      <li>\n        <Link href=\"#videos\" onClick$={scrollIntoView} preventdefault:click>\n          <svg\n            width=\"20\"\n            height=\"18\"\n            viewBox=\"0 0 20 18\"\n            fill=\"none\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n            aria-hidden=\"true\"\n          >\n            <path\n              d=\"M9.88965 17.7793C12.0171 17.7793 13.7793 16.0171 13.7793 13.8896C13.7793 11.7622 12.0131 10 9.88563 10C7.76218 10 6 11.7622 6 13.8896C6 16.0171 7.76218 17.7793 9.88965 17.7793ZM9.1631 15.427C8.97845 15.5394 8.76972 15.4471 8.76972 15.2585V12.5249C8.76972 12.3362 8.99451 12.2559 9.1631 12.3563L11.407 13.6809C11.5675 13.7773 11.5716 14.0101 11.407 14.1064L9.1631 15.427Z\"\n              fill=\"currentColor\"\n              fill-opacity=\"0.7\"\n            />\n            <path\n              d=\"M18.3871 14.5763H16.9742C16.7959 14.5763 16.6516 14.4346 16.6516 14.2594C16.6516 14.0842 16.7959 13.9425 16.9742 13.9425H18.3871C18.9207 13.9425 19.3548 13.5161 19.3548 12.9919V1.58438C19.3548 1.06017 18.9207 0.633751 18.3871 0.633751H1.6129C1.07926 0.633751 0.645161 1.06017 0.645161 1.58438V12.9919C0.645161 13.5161 1.07926 13.9425 1.6129 13.9425H3.02581C3.20415 13.9425 3.34839 14.0842 3.34839 14.2594C3.34839 14.4346 3.20415 14.5763 3.02581 14.5763H1.6129C0.723502 14.5763 0 13.8656 0 12.9919V1.58438C0 0.710706 0.723502 0 1.6129 0H18.3871C19.2765 0 20 0.710706 20 1.58438V12.9919C20 13.8656 19.2765 14.5763 18.3871 14.5763Z\"\n              fill=\"currentColor\"\n            />\n            <path\n              d=\"M18.3868 3.16866H1.61262C1.43428 3.16866 1.29004 3.02697 1.29004 2.85179C1.29004 2.6766 1.43428 2.53491 1.61262 2.53491H18.3868C18.5652 2.53491 18.7094 2.6766 18.7094 2.85179C18.7094 3.02697 18.5652 3.16866 18.3868 3.16866Z\"\n              fill=\"currentColor\"\n            />\n            <path\n              d=\"M2.25813 1.9012C2.23693 1.9012 2.21573 1.89893 2.19499 1.89486C2.17472 1.89079 2.15444 1.8849 2.13463 1.87675C2.11527 1.86906 2.09638 1.8591 2.07886 1.84778C2.06135 1.83646 2.04476 1.82288 2.03002 1.8084C1.97011 1.74955 1.93555 1.66762 1.93555 1.58432C1.93555 1.5635 1.93785 1.54268 1.942 1.52231C1.94615 1.50239 1.95214 1.48247 1.96043 1.463C1.96827 1.44399 1.9784 1.42543 1.98992 1.40823C2.00145 1.39103 2.01527 1.37473 2.03002 1.36025C2.04476 1.34576 2.06135 1.33218 2.07886 1.32086C2.09638 1.30955 2.11527 1.29959 2.13463 1.29189C2.15444 1.28374 2.17472 1.27786 2.19499 1.27378C2.23647 1.26518 2.27933 1.26518 2.32126 1.27378C2.34154 1.27786 2.36181 1.28374 2.38163 1.29189C2.40098 1.29959 2.41988 1.30955 2.43739 1.32086C2.4549 1.33218 2.47149 1.34576 2.48624 1.36025C2.50098 1.37473 2.51481 1.39103 2.52633 1.40823C2.53785 1.42543 2.54799 1.44399 2.55582 1.463C2.56412 1.48247 2.57011 1.50239 2.57426 1.52231C2.5784 1.54268 2.58071 1.5635 2.58071 1.58432C2.58071 1.66762 2.54615 1.74955 2.48624 1.8084C2.47149 1.82288 2.4549 1.83646 2.43739 1.84778C2.41988 1.8591 2.40098 1.86906 2.38163 1.87675C2.36181 1.8849 2.34154 1.89079 2.32126 1.89486C2.30052 1.89893 2.27933 1.9012 2.25813 1.9012Z\"\n              fill=\"currentColor\"\n            />\n            <path\n              d=\"M3.54817 1.90135C3.52697 1.90135 3.50577 1.89954 3.48503 1.89501C3.46476 1.89094 3.44402 1.88505 3.42466 1.8769C3.40531 1.86921 3.38642 1.85925 3.3689 1.84793C3.35139 1.83661 3.3348 1.82303 3.32006 1.80855C3.30531 1.79406 3.29148 1.77777 3.27996 1.76056C3.26844 1.74336 3.2583 1.7248 3.25047 1.70579C3.24218 1.68632 3.23618 1.66641 3.23204 1.64649C3.22743 1.62612 3.22559 1.60529 3.22559 1.58447C3.22559 1.56365 3.22743 1.54282 3.23204 1.52245C3.23618 1.50254 3.24218 1.48262 3.25047 1.46315C3.2583 1.44414 3.26844 1.42558 3.27996 1.40838C3.29148 1.39118 3.30531 1.37488 3.32006 1.3604C3.3348 1.34591 3.35139 1.33233 3.3689 1.32101C3.38642 1.3097 3.40531 1.29974 3.42466 1.29204C3.44402 1.28389 3.46476 1.27801 3.48503 1.27393C3.52651 1.26579 3.56983 1.26579 3.6113 1.27393C3.63158 1.27801 3.65185 1.28389 3.67167 1.29204C3.69102 1.29974 3.70992 1.3097 3.72743 1.32101C3.74494 1.33233 3.76153 1.34591 3.77628 1.3604C3.79102 1.37488 3.80439 1.39118 3.81637 1.40838C3.82789 1.42558 3.83803 1.44414 3.84586 1.46315C3.85416 1.48217 3.86015 1.50254 3.8643 1.52245C3.86844 1.54282 3.87075 1.56365 3.87075 1.58447C3.87075 1.60529 3.86844 1.62612 3.8643 1.64649C3.86015 1.66641 3.85416 1.68632 3.84586 1.70579C3.83803 1.7248 3.82789 1.74336 3.81637 1.76056C3.80439 1.77777 3.79102 1.79406 3.77628 1.80855C3.76153 1.82303 3.74494 1.83661 3.72743 1.84793C3.70992 1.85925 3.69102 1.86921 3.67167 1.8769C3.65185 1.88505 3.63158 1.89094 3.6113 1.89501C3.59056 1.89954 3.56936 1.90135 3.54817 1.90135Z\"\n              fill=\"currentColor\"\n            />\n            <path\n              d=\"M4.83918 1.90135C4.81798 1.90135 4.79679 1.89908 4.77605 1.89501C4.75577 1.89094 4.73503 1.88505 4.71568 1.8769C4.69633 1.86921 4.67743 1.85925 4.65992 1.84793C4.64241 1.83616 4.62582 1.82303 4.61107 1.80855C4.59633 1.79406 4.58296 1.77777 4.57098 1.76056C4.55946 1.74336 4.54932 1.7248 4.54149 1.70579C4.53319 1.68632 4.5272 1.66641 4.52305 1.64649C4.51891 1.62612 4.5166 1.60529 4.5166 1.58447C4.5166 1.50118 4.55116 1.41924 4.61107 1.3604C4.62582 1.34591 4.64241 1.33278 4.65992 1.32101C4.67743 1.3097 4.69633 1.29974 4.71568 1.29204C4.73503 1.28389 4.75531 1.27801 4.77605 1.27393C4.81752 1.26579 4.86084 1.26579 4.90232 1.27393C4.92259 1.27801 4.94287 1.28389 4.96268 1.29204C4.98204 1.29974 5.00093 1.3097 5.01798 1.32101C5.03596 1.33278 5.05255 1.34591 5.06729 1.3604C5.08204 1.37488 5.0954 1.39118 5.10738 1.40838C5.11891 1.42558 5.12904 1.44414 5.13688 1.46315C5.14517 1.48262 5.15116 1.50254 5.15531 1.52245C5.15946 1.54282 5.16176 1.56365 5.16176 1.58447C5.16176 1.60529 5.15946 1.62612 5.15531 1.64649C5.15116 1.66641 5.14517 1.68632 5.13688 1.70579C5.12904 1.7248 5.11891 1.74336 5.10738 1.76056C5.0954 1.77777 5.08204 1.79406 5.06729 1.80855C5.05255 1.82303 5.03596 1.83616 5.01798 1.84793C5.00093 1.85925 4.98204 1.86921 4.96268 1.8769C4.94287 1.88505 4.92259 1.89094 4.90232 1.89501C4.88158 1.89908 4.86038 1.90135 4.83918 1.90135Z\"\n              fill=\"currentColor\"\n            />\n          </svg>\n          <span>Videos</span>\n        </Link>\n      </li>\n\n      <li>\n        <Link href=\"#showcase\" onClick$={scrollIntoView} preventdefault:click>\n          <svg\n            width=\"20\"\n            height=\"20\"\n            viewBox=\"0 0 14 14\"\n            fill=\"none\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n            aria-hidden=\"true\"\n          >\n            <path\n              d=\"M6.7793 13.9551C10.4023 13.9551 13.4033 10.9541 13.4033 7.33105C13.4033 3.70801 10.3955 0.707031 6.77246 0.707031C3.15625 0.707031 0.155273 3.70801 0.155273 7.33105C0.155273 10.9541 3.15625 13.9551 6.7793 13.9551ZM5.00195 6.05957C4.98145 5.81348 4.86523 5.58789 4.69434 5.42383C5.26172 4.00195 6.15723 2.70996 7.31934 1.66406C7.40137 1.6709 7.49023 1.68457 7.57227 1.69824C6.74512 3.11328 6.24609 4.69922 6.11621 6.34668C5.74023 6.27832 5.36426 6.18262 5.00195 6.05957ZM2.03516 4.21387C2.94434 2.83984 4.44141 1.86914 6.14355 1.6709C5.18652 2.68262 4.44141 3.8584 3.93555 5.13672C3.7373 5.14355 3.55957 5.20508 3.40918 5.30762C2.91016 5 2.45215 4.63086 2.03516 4.21387ZM8.7959 4.27539C8.78906 3.55078 8.88477 2.82617 9.09668 2.14258C10.3408 2.70996 11.3594 3.71484 11.9404 4.95215C11.2773 5.45801 10.5322 5.84082 9.74609 6.09375C9.56152 5.86133 9.27441 5.7041 8.95996 5.69727C8.85742 5.23926 8.80273 4.76074 8.7959 4.27539ZM7.98242 4.28223C7.98926 4.87695 8.06445 5.45801 8.19434 6.02539C8.08496 6.1416 8.00293 6.27832 7.96191 6.43555C7.79785 6.44922 7.63379 6.45605 7.46973 6.45605C7.28516 6.45605 7.10742 6.44922 6.92969 6.44238C7.03906 4.91797 7.49023 3.46191 8.24219 2.16309C8.06445 2.84668 7.97559 3.55078 7.98242 4.28223ZM1.0918 7.33105C1.0918 6.49023 1.27637 5.69043 1.61133 4.96582C2.02832 5.35547 2.47949 5.7041 2.96484 6.00488C2.95801 6.05273 2.95117 6.10742 2.95117 6.16211C2.95117 6.51074 3.12207 6.81836 3.38867 7.00293C3.25879 7.66602 3.18359 8.34277 3.18359 9.0332C2.44531 8.6709 1.74805 8.21973 1.09863 7.67285C1.0918 7.56348 1.0918 7.44727 1.0918 7.33105ZM12.4736 7.33105C12.4736 7.87109 12.3916 8.4043 12.248 8.90332C11.8721 9.10156 11.4893 9.27246 11.0996 9.42285C10.4912 8.8623 9.98535 8.20605 9.60254 7.48145C9.77344 7.33105 9.89648 7.12598 9.9375 6.89355C10.7578 6.63379 11.5371 6.25098 12.248 5.75195C12.3916 6.25098 12.4736 6.78418 12.4736 7.33105ZM6.08887 7.17383C6.08887 8.00781 6.18457 8.82812 6.3623 9.62109C6.25977 9.70996 6.16406 9.81934 6.10254 9.94238C5.38477 9.83301 4.68066 9.64844 3.99707 9.38867C3.97656 8.63672 4.03809 7.8916 4.18164 7.17383C4.40723 7.13281 4.6123 7.00977 4.75586 6.83887C5.18652 6.98242 5.63086 7.0918 6.08887 7.16016V7.17383ZM7.46973 7.26953C7.6748 7.26953 7.87305 7.2627 8.07129 7.24902C8.23535 7.50195 8.50195 7.68652 8.81641 7.7207C9.17871 8.45215 9.65723 9.12207 10.2314 9.70312C9.48633 9.9082 8.72754 10.0244 7.96875 10.0518C7.83203 9.70996 7.52441 9.45703 7.15527 9.40918C6.99121 8.70508 6.90918 7.9873 6.90234 7.25586C7.08691 7.2627 7.27832 7.26953 7.46973 7.26953ZM1.30371 8.86914C1.90527 9.29297 2.54102 9.65527 3.2041 9.94238C3.23828 10.626 3.34082 11.3096 3.51855 11.9727C2.46582 11.2275 1.66602 10.1338 1.30371 8.86914ZM6.7793 13.0254C6 13.0254 5.24805 12.8613 4.56445 12.5605C4.28418 11.8223 4.11328 11.0566 4.04492 10.2705C4.69434 10.4961 5.35742 10.6602 6.03418 10.7559C6.1709 11.1455 6.5332 11.4326 6.96387 11.4531C7.18945 11.9658 7.44922 12.4648 7.75 12.9365C7.43555 12.9912 7.10742 13.0254 6.7793 13.0254ZM7.72949 11.1592C7.81836 11.0771 7.88672 10.9746 7.94141 10.8652C8.95312 10.8311 9.95801 10.6602 10.9355 10.3457C11.0791 10.4551 11.2227 10.5645 11.373 10.667C10.6826 11.6104 9.70508 12.3418 8.57715 12.7246C8.24902 12.2256 7.96191 11.7061 7.72949 11.1592Z\"\n              fill=\"currentColor\"\n            />\n          </svg>\n          <span>Showcase</span>\n        </Link>\n      </li>\n\n      <li>\n        <Link href=\"#presentations\" onClick$={scrollIntoView} preventdefault:click>\n          <svg\n            width=\"20\"\n            height=\"20\"\n            viewBox=\"0 0 14 14\"\n            fill=\"none\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n            aria-hidden=\"true\"\n          >\n            <path\n              d=\"M6.7793 13.9551C10.4023 13.9551 13.4033 10.9541 13.4033 7.33105C13.4033 3.70801 10.3955 0.707031 6.77246 0.707031C3.15625 0.707031 0.155273 3.70801 0.155273 7.33105C0.155273 10.9541 3.15625 13.9551 6.7793 13.9551ZM5.54199 9.94922C5.22754 10.1406 4.87207 9.9834 4.87207 9.66211V5.00684C4.87207 4.68555 5.25488 4.54883 5.54199 4.71973L9.36328 6.97559C9.63672 7.13965 9.64355 7.53613 9.36328 7.7002L5.54199 9.94922Z\"\n              fill=\"currentColor\"\n            />\n          </svg>\n          <span>Presentations</span>\n        </Link>\n      </li>\n\n      <li>\n        <Link href=\"#community\" onClick$={scrollIntoView} preventdefault:click>\n          <svg width=\"18\" viewBox=\"0 0 13 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n            <path\n              d=\"M3.18359 1.63867H9.49316C9.45898 1.07812 9.1377 0.78418 8.5293 0.78418H4.1543C3.5459 0.78418 3.22461 1.07812 3.18359 1.63867ZM2.0625 3.45703H10.6143C10.5186 2.8623 10.2314 2.52734 9.56836 2.52734H3.11523C2.45215 2.52734 2.1582 2.8623 2.0625 3.45703ZM2.71191 15.8916H10.1699C11.3594 15.8916 12.0498 15.208 12.0498 13.8613V6.5332C12.0498 5.17969 11.3525 4.49609 9.98535 4.49609H2.71191C1.34473 4.49609 0.647461 5.17969 0.647461 6.5332V13.8613C0.647461 15.208 1.34473 15.8916 2.71191 15.8916ZM4.27734 11.9199C3.01953 11.9199 2.09668 12.6514 1.76855 13.4717V6.60156C1.76855 5.94531 2.11719 5.61035 2.74609 5.61035H9.95117C10.5732 5.61035 10.9287 5.94531 10.9287 6.60156V13.0889C10.4434 12.4463 9.56152 11.9336 8.39941 11.9336C6.54688 11.9336 5.38477 13.2598 5.38477 14.2988C5.38477 14.5107 5.43262 14.668 5.50098 14.7773H4.69434C4.65332 14.627 4.63281 14.4629 4.63281 14.2988C4.63281 13.5264 5.00195 12.8018 5.61035 12.2412C5.25488 12.0293 4.81738 11.9199 4.27734 11.9199ZM8.39941 11.1611C9.17188 11.1611 9.82812 10.4775 9.82812 9.58203C9.82812 8.7002 9.17188 8.04395 8.39941 8.04395C7.63379 8.04395 6.96387 8.7207 6.9707 9.5957C6.9707 10.4775 7.63379 11.1611 8.39941 11.1611ZM4.28418 11.25C4.9541 11.25 5.52832 10.6484 5.52832 9.8623C5.52832 9.09668 4.9541 8.5293 4.28418 8.5293C3.61426 8.5293 3.0332 9.11035 3.0332 9.86914C3.0332 10.6484 3.61426 11.25 4.28418 11.25Z\"\n              fill=\"currentColor\"\n            />\n          </svg>\n          <span>Community</span>\n        </Link>\n      </li>\n      <li>\n        <Link href=\"/media/#blogs\">\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n            version=\"1.1\"\n            id=\"_x32_\"\n            width=\"20px\"\n            height=\"20px\"\n            viewBox=\"0 0 512 512\"\n            xml:space=\"preserve\"\n            fill=\"currentColor\"\n          >\n            <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\" />\n\n            <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\n            <g id=\"SVGRepo_iconCarrier\">\n              <g>\n                <path\n                  class=\"st0\"\n                  d=\"M421.073,221.719c-0.578,11.719-9.469,26.188-23.797,40.094v183.25c-0.016,4.719-1.875,8.719-5.016,11.844 c-3.156,3.063-7.25,4.875-12.063,4.906H81.558c-4.781-0.031-8.891-1.844-12.047-4.906c-3.141-3.125-4.984-7.125-5-11.844V152.219 c0.016-4.703,1.859-8.719,5-11.844c3.156-3.063,7.266-4.875,12.047-4.906h158.609c12.828-16.844,27.781-34.094,44.719-49.906 c0.078-0.094,0.141-0.188,0.219-0.281H81.558c-18.75-0.016-35.984,7.531-48.25,19.594c-12.328,12.063-20.016,28.938-20,47.344 v292.844c-0.016,18.406,7.672,35.313,20,47.344C45.573,504.469,62.808,512,81.558,512h298.641c18.781,0,36.016-7.531,48.281-19.594 c12.297-12.031,20-28.938,19.984-47.344V203.469c0,0-0.125-0.156-0.328-0.313C440.37,209.813,431.323,216.156,421.073,221.719z\"\n                />\n                <path\n                  class=\"st0\"\n                  d=\"M498.058,0c0,0-15.688,23.438-118.156,58.109C275.417,93.469,211.104,237.313,211.104,237.313 c-15.484,29.469-76.688,151.906-76.688,151.906c-16.859,31.625,14.031,50.313,32.156,17.656 c34.734-62.688,57.156-119.969,109.969-121.594c77.047-2.375,129.734-69.656,113.156-66.531c-21.813,9.5-69.906,0.719-41.578-3.656 c68-5.453,109.906-56.563,96.25-60.031c-24.109,9.281-46.594,0.469-51-2.188C513.386,138.281,498.058,0,498.058,0z\"\n                />\n              </g>\n            </g>\n          </svg>\n          <span>Blogs</span>\n        </Link>\n      </li>\n      <li>\n        <Link href=\"/media/#case%20studies\">\n          <svg\n            width=\"20px\"\n            height=\"20px\"\n            fill=\"currentColor\"\n            viewBox=\"0 0 24 24\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n          >\n            <path d=\"M7 5V2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h4ZM4 16v3h16v-3H4Zm0-2h16V7H4v7ZM9 3v2h6V3H9Zm2 8h2v2h-2v-2Z\"></path>\n          </svg>\n          <span>Case Studies</span>\n        </Link>\n      </li>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/ecosystem/mobile-ecosystem-menu.tsx",
    "content": "import { MenuItems } from './menu-items';\n\nexport const MobileEcosystemMenu = () => {\n  return (\n    <nav class=\"moblie-ecosystem-menu px-6 lg:hidden\">\n      <details>\n        <summary class=\"font-bold border border-transparent px-6 py-1 rounded-[5px] transi\">\n          Menu\n        </summary>\n        <ul class=\"flex flex-col gap-4 mt-2 p-4 border border-transparent\">\n          <MenuItems />\n        </ul>\n      </details>\n    </nav>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/ecosystem/qwik-plus-logo.tsx",
    "content": "export const QwikPlusLogo = () => {\n  return (\n    <svg\n      class=\"qwik-plus-logo\"\n      viewBox=\"0 0 307 158\"\n      fill=\"none\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M20.361 73.4451C20.361 61.2089 27.409 53.4756 38.5684 53.4756C49.532 53.4756 56.6779 61.2089 56.6779 73.4451C56.6779 85.4855 49.532 93.4145 38.5684 93.4145C27.409 93.4145 20.361 85.4855 20.361 73.4451ZM73.7107 73.4451C73.7107 52.7904 58.1463 38.3028 38.5684 38.3028C19.0884 38.3028 3.23035 52.7904 3.23035 73.4451C3.23035 94.0997 19.0884 108.685 38.5684 108.685C41.2114 108.685 43.7565 108.392 46.2038 107.902L55.0138 119.747H75.2769L60.2019 101.637C68.4246 95.3723 73.7107 85.4855 73.7107 73.4451ZM89.0921 108H107.495L116.403 72.5641L125.017 108H143.519L158.3 53.3778H142.54L134.904 92.2398L125.605 53.3778H107.887L98.6852 92.4356L90.952 53.3778H74.2129L89.0921 108ZM161.359 108H178.099V53.3778H161.359V108ZM169.778 47.7002C175.651 47.7002 179.665 43.6867 179.665 38.6944C179.665 33.6041 175.651 29.5906 169.778 29.5906C163.807 29.5906 159.793 33.6041 159.793 38.6944C159.793 43.6867 163.807 47.7002 169.778 47.7002ZM186.905 108H203.644V85.0939L220.286 108H241.038L218.132 80.7868L240.842 53.3778H220.188L203.644 75.5986V35.5619H186.905V108Z\"\n        fill=\"white\"\n        class=\"qwik-plus-logo-text\"\n      />\n      <path\n        d=\"M267.728 58.982V58.5568H267.303V58.982H267.728ZM267.728 76.5042V76.9294H268.153V76.5042H267.728ZM250.695 76.5042V76.079H250.27V76.5042H250.695ZM250.695 91.4813H250.27V91.9065H250.695V91.4813ZM267.728 91.4813H268.153V91.0561H267.728V91.4813ZM267.728 108.906H267.303V109.331H267.728V108.906ZM283.586 108.906V109.331H284.011V108.906H283.586ZM283.586 91.4813V91.0561H283.161V91.4813H283.586ZM300.619 91.4813V91.9065H301.044V91.4813H300.619ZM300.619 76.5042H301.044V76.079H300.619V76.5042ZM283.586 76.5042H283.161V76.9294H283.586V76.5042ZM283.586 58.982H284.011V58.5568H283.586V58.982ZM267.303 58.982V76.5042H268.153V58.982H267.303ZM267.728 76.079H250.695V76.9294H267.728V76.079ZM250.27 76.5042V91.4813H251.121V76.5042H250.27ZM250.695 91.9065H267.728V91.0561H250.695V91.9065ZM267.303 91.4813V108.906H268.153V91.4813H267.303ZM267.728 109.331H283.586V108.48H267.728V109.331ZM284.011 108.906V91.4813H283.161V108.906H284.011ZM283.586 91.9065H300.619V91.0561H283.586V91.9065ZM301.044 91.4813V76.5042H300.194V91.4813H301.044ZM300.619 76.079H283.586V76.9294H300.619V76.079ZM284.011 76.5042V58.982H283.161V76.5042H284.011ZM283.586 58.5568H267.728V59.4072H283.586V58.5568Z\"\n        fill=\"url(#paint0_linear_1800_2809)\"\n      />\n      <path\n        d=\"M264.326 55.5802V73.1024H247.293V88.0794H264.326V105.504H280.184V88.0794H297.217V73.1024H280.184V55.5802H264.326Z\"\n        fill=\"url(#paint1_linear_1800_2809)\"\n      />\n      <defs>\n        <linearGradient\n          id=\"paint0_linear_1800_2809\"\n          x1=\"275.495\"\n          y1=\"53.4016\"\n          x2=\"275.495\"\n          y2=\"108.208\"\n          gradientUnits=\"userSpaceOnUse\"\n        >\n          <stop stop-color=\"#18B6F6\" />\n          <stop offset=\"1\" stop-color=\"#AC7FF4\" />\n        </linearGradient>\n        <linearGradient\n          id=\"paint1_linear_1800_2809\"\n          x1=\"260.408\"\n          y1=\"80.0622\"\n          x2=\"295.02\"\n          y2=\"88.8193\"\n          gradientUnits=\"userSpaceOnUse\"\n        >\n          <stop stop-color=\"#AC7FF4\" />\n          <stop offset=\"1\" stop-color=\"#18B6F6\" />\n        </linearGradient>\n      </defs>\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/ecosystem.css",
    "content": ".ecosystem {\n  position: relative;\n}\n\n.ecosystem section {\n  position: relative;\n  z-index: 1;\n  margin: 0 auto 80px auto;\n}\n\n.qwik-plus-logo {\n  width: 240px;\n  height: auto;\n  margin: 0 auto;\n}\n\n[data-theme='light'] .qwik-plus-logo-text {\n  filter: invert(1);\n}\n\n.ecosystem .purple-gradient {\n  position: fixed;\n  width: 1400px;\n  height: 800px;\n  top: 100px;\n  right: -400px;\n  background: radial-gradient(\n    57.58% 57.58% at 48.79% 42.42%,\n    rgba(24, 180, 244, 0.5) 0%,\n    rgba(46, 55, 114, 0) 63.22%\n  );\n  transform: rotate(5deg);\n  pointer-events: none;\n}\n\n.ecosystem .blue-gradient {\n  position: fixed;\n  width: 1400px;\n  height: 1200px;\n  top: 600px;\n  left: -200px;\n  background: radial-gradient(\n    50% 50% at 50% 50%,\n    rgba(172, 127, 244, 0.5) 0%,\n    rgba(21, 25, 52, 0) 100%\n  );\n  transform: rotate(-5deg);\n}\n\n.ecosystem-menu {\n  position: sticky;\n  z-index: 1;\n  top: 0;\n  width: 240px;\n  height: 700px;\n  background: transparent;\n  padding: 125px 20px 20px 20px;\n}\n\n.moblie-ecosystem-menu summary,\n.moblie-ecosystem-menu ul {\n  background:\n    linear-gradient(var(--qwik-dark-purple-bg), var(--qwik-dark-purple-bg)) padding-box,\n    linear-gradient(to bottom, #ac7ff4, #18b6f6) border-box;\n}\n\n.moblie-ecosystem-menu summary {\n  padding: 1rem;\n  display: block;\n  padding-left: 2.2rem;\n  position: relative;\n  cursor: pointer;\n}\n\n.moblie-ecosystem-menu summary:before {\n  content: '';\n  border-width: 0.4rem;\n  border-style: solid;\n  border-color: transparent transparent transparent #ac7ff4;\n  position: absolute;\n  top: 1.3rem;\n  left: 1rem;\n  transform: rotate(0);\n  transition-property: transform, border-color;\n  transform-origin: 0.2rem 50%;\n  transition: 0.25s transform ease;\n}\n\n.ecosystem details[open] > summary:before {\n  transform: rotate(90deg);\n  border-color: transparent transparent transparent #18b6f6;\n}\n\n.ecosystem details summary::-webkit-details-marker {\n  display: none;\n}\n\n.moblie-ecosystem-menu li a {\n  display: flex;\n  align-items: center;\n  gap: 1rem;\n}\n\n.ecosystem h2,\n.ecosystem-menu h3 {\n  font-size: 18px;\n  font-weight: 500;\n  padding-bottom: 15px;\n  margin-bottom: 25px;\n  border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n[data-theme='light'] .ecosystem h2,\n[data-theme='light'] .ecosystem-menu h3 {\n  border-color: rgba(0, 0, 0, 0.3);\n}\n\n.ecosystem h2 {\n  margin-bottom: 40px;\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n}\n\n.ecosystem h2 span:last-child {\n  text-align: right;\n}\n\n.ecosystem-menu a {\n  padding: 10px 10px;\n  margin: 5px 0;\n  display: flex;\n  align-items: center;\n  border: 1px solid transparent;\n  border-radius: 5px;\n}\n\n.ecosystem-menu a:hover {\n  background: linear-gradient(180deg, rgba(46, 51, 90, 0.3) 0%, rgba(28, 27, 51, 0.3) 100%);\n  border: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n.ecosystem-menu svg {\n  display: inline-block;\n  opacity: 0.7;\n}\n\n.ecosystem-menu span {\n  padding-left: 20px;\n}\n\n.grid-item a {\n  display: block;\n}\n\n.grid-item .thumbnail {\n  display: grid;\n  aspect-ratio: 16/9;\n  position: relative;\n\n  background:\n    linear-gradient(var(--qwik-dark-purple-bg), var(--qwik-dark-purple-bg)) padding-box,\n    linear-gradient(to bottom, #ac7ff4, #18b6f6) border-box;\n  border-radius: 5px;\n  border: 1px solid transparent;\n  overflow: hidden;\n  color: currentColor;\n}\n\n.grid-item .thumbnail::before {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 5px;\n  aspect-ratio: 16/9;\n  content: '';\n\n  background:\n    linear-gradient(0deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),\n    conic-gradient(\n      from 180deg at 53.75% 37.25%,\n      #7976e8 -110.28deg,\n      #f449f4 6.37deg,\n      #0019c0 153.67deg,\n      #7976e8 249.72deg,\n      #f449f4 366.37deg\n    );\n  border-radius: 5px;\n  opacity: 0.3;\n}\n\n.grid-item a:hover .thumbnail::before {\n  opacity: 0.1;\n}\n\n.grid-item img {\n  position: relative;\n  margin: auto;\n  max-width: 90px;\n  max-height: 90px;\n}\n\n.grid-item .thumbnail img {\n  margin: auto;\n  max-width: 160px;\n  max-height: 90px;\n  object-fit: contain;\n}\n\n.grid-item .cover img {\n  width: 100%;\n  max-width: initial;\n  max-height: initial;\n  height: auto;\n  object-fit: cover;\n  aspect-ratio: 16/9;\n}\n\n.grid-item .text {\n  position: relative;\n  padding: 10px;\n  text-align: center;\n  font-weight: bold;\n}\n\n.grid-item a:hover .text {\n  text-decoration: underline;\n}\n\n.grid-item .description {\n  text-align: center;\n  font-size: 0.9em;\n}\n\n.add-integration .thumbnail {\n  opacity: 0.4;\n  border: 2px dotted currentColor;\n}\n.add-integration .thumbnail,\n.add-integration .thumbnail::before {\n  background: transparent;\n}\n\n.add-integration a:hover .thumbnail {\n  opacity: 0.8;\n}\n\n.add-integration svg {\n  margin: auto;\n}\n\n[data-theme='dark'] [alt='GitHub'],\n[data-theme='dark'] [alt='Twitter'] {\n  filter: invert(1);\n}\n\n.custom-grid-cols-240px-1fr-tailwind-workaround {\n  /* temporary workaround .grid-cols-\\[240px\\,1fr\\] is not currently working in tailwind */\n  grid-template-columns: 240px 1fr;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/ecosystem.json",
    "content": "{\n  \"integrations\": [\n    {\n      \"title\": \"Qwik/React\",\n      \"href\": \"/docs/integrations/react/\",\n      \"imgSrc\": \"/ecosystem/react.svg\"\n    },\n    {\n      \"title\": \"Builder.io CMS\",\n      \"href\": \"/docs/integrations/builderio/\",\n      \"imgSrc\": \"/ecosystem/builderio.svg\"\n    },\n    {\n      \"title\": \"Partytown\",\n      \"href\": \"/docs/integrations/partytown/\",\n      \"imgSrc\": \"/ecosystem/partytown.svg\"\n    },\n    {\n      \"title\": \"Auth.js\",\n      \"href\": \"/docs/integrations/authjs/\",\n      \"imgSrc\": \"/ecosystem/authjs.png\"\n    },\n    {\n      \"title\": \"Cypress\",\n      \"href\": \"/docs/integrations/cypress/\",\n      \"imgSrc\": \"/ecosystem/cypress.svg\"\n    },\n    {\n      \"title\": \"Nx\",\n      \"href\": \"/docs/integrations/nx/\",\n      \"imgSrc\": \"/ecosystem/nx.svg\"\n    },\n    {\n      \"title\": \"Playwright\",\n      \"href\": \"/docs/integrations/playwright/\",\n      \"imgSrc\": \"/ecosystem/playwright.svg\"\n    },\n    {\n      \"title\": \"PostCSS\",\n      \"href\": \"/docs/integrations/postcss/\",\n      \"imgSrc\": \"/ecosystem/postcss.svg\"\n    },\n    {\n      \"title\": \"Prisma\",\n      \"href\": \"/docs/integrations/prisma/\",\n      \"imgSrc\": \"/ecosystem/prisma.svg\"\n    },\n    {\n      \"title\": \"Storybook\",\n      \"href\": \"/docs/integrations/storybook/\",\n      \"imgSrc\": \"/ecosystem/storybook.svg\"\n    },\n    {\n      \"title\": \"Styled-Vanilla-Extract\",\n      \"href\": \"/docs/integrations/styled-vanilla-extract/\",\n      \"imgSrc\": \"/ecosystem/styled-vanilla-extract.svg\"\n    },\n    {\n      \"title\": \"Supabase\",\n      \"href\": \"/docs/integrations/supabase/\",\n      \"imgSrc\": \"/ecosystem/supabase.svg\"\n    },\n    {\n      \"title\": \"Tailwind\",\n      \"href\": \"/docs/integrations/tailwind/\",\n      \"imgSrc\": \"/ecosystem/tailwind.svg\"\n    },\n    {\n      \"title\": \"Vitest\",\n      \"href\": \"/docs/integrations/vitest/\",\n      \"imgSrc\": \"/ecosystem/vitest.svg\"\n    }\n  ],\n  \"deployments\": [\n    {\n      \"title\": \"Aws\",\n      \"href\": \"/docs/deployments/aws-lambda/\",\n      \"imgSrc\": \"/ecosystem/aws.svg\"\n    },\n    {\n      \"title\": \"Azure\",\n      \"href\": \"/docs/deployments/azure-swa/\",\n      \"imgSrc\": \"/ecosystem/azure.svg\"\n    },\n    {\n      \"title\": \"Cloudflare\",\n      \"href\": \"/docs/deployments/cloudflare-pages/\",\n      \"imgSrc\": \"/ecosystem/cloudflare.svg\"\n    },\n    {\n      \"title\": \"Deno\",\n      \"href\": \"/docs/deployments/deno/\",\n      \"imgSrc\": \"/ecosystem/deno.svg\"\n    },\n    {\n      \"title\": \"Bun\",\n      \"href\": \"/docs/deployments/bun/\",\n      \"imgSrc\": \"/ecosystem/bun.svg\"\n    },\n    {\n      \"title\": \"Firebase\",\n      \"href\": \"/docs/deployments/firebase/\",\n      \"imgSrc\": \"/ecosystem/firebase.svg\"\n    },\n    {\n      \"title\": \"Google Cloud Run\",\n      \"href\": \"/docs/deployments/gcp-cloud-run/\",\n      \"imgSrc\": \"/ecosystem/google-cloud.svg\"\n    },\n    {\n      \"title\": \"Netlify\",\n      \"href\": \"/docs/deployments/netlify-edge/\",\n      \"imgSrc\": \"/ecosystem/netlify.svg\"\n    },\n    {\n      \"title\": \"Node.js\",\n      \"href\": \"/docs/deployments/node/\",\n      \"imgSrc\": \"/ecosystem/nodejs.svg\"\n    },\n    {\n      \"title\": \"Vercel\",\n      \"href\": \"/docs/deployments/vercel-edge/\",\n      \"imgSrc\": \"/ecosystem/vercel.svg\"\n    },\n    {\n      \"title\": \"Azion\",\n      \"href\": \"/docs/deployments/azion/\",\n      \"imgSrc\": \"/ecosystem/azion.svg\"\n    }\n  ],\n  \"libraries\": [\n    {\n      \"title\": \"@modular-forms/qwik\",\n      \"github\": \"https://modularforms.dev/qwik/guides/introduction\",\n      \"imgSrc\": \"/ecosystem/modular-forms.svg\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"The modular and type-safe form library\"\n    },\n    {\n      \"title\": \"@qwikest/icons\",\n      \"github\": \"https://github.com/qwikest/icons\",\n      \"imgSrc\": \"/ecosystem/rocket.svg\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Thousand of Open Source icons\"\n    },\n    {\n      \"title\": \"qwik-speak\",\n      \"github\": \"https://github.com/robisim74/qwik-speak\",\n      \"imgSrc\": \"/ecosystem/speak.svg\",\n      \"description\": \"Easy i18n\"\n    },\n    {\n      \"title\": \"qwik-rive\",\n      \"github\": \"https://github.com/qwikverse/qwik-rive\",\n      \"imgSrc\": \"/ecosystem/rive.png\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Rive animations\"\n    },\n    {\n      \"title\": \"qwik-lottie\",\n      \"github\": \"https://github.com/qwikverse/qwik-lottie\",\n      \"imgSrc\": \"/ecosystem/lottie.png\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Lottie animations\"\n    },\n    {\n      \"title\": \"@papanasi/qwik\",\n      \"github\": \"https://github.com/CKGrafico/papanasi\",\n      \"imgSrc\": \"/ecosystem/papanasi.svg\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Cross platform UI library\"\n    },\n    {\n      \"title\": \"qwik-wrap-balancer\",\n      \"github\": \"https://github.com/harshmangalam/qwik-wrap-balancer\",\n      \"imgSrc\": \"/ecosystem/balance.svg\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Good looking balanced paragraphs\"\n    },\n    {\n      \"title\": \"@qwik-ui/headless\",\n      \"github\": \"https://github.com/qwikifiers/qwik-ui\",\n      \"imgSrc\": \"/ecosystem/qwik-ui.png\",\n      \"width\": 231,\n      \"height\": 90,\n      \"description\": \"Headless UI library\"\n    },\n    {\n      \"title\": \"@qwikbits/headless-ui\",\n      \"github\": \"https://github.com/genie-design/qwikbits\",\n      \"imgSrc\": \"/ecosystem/qwikbits.svg\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Headless UI components and other helpers\"\n    },\n    {\n      \"title\": \"qwik-spin-delay\",\n      \"github\": \"https://github.com/harshmangalam/qwik-spin-delay\",\n      \"imgSrc\": \"/ecosystem/qwik-spin-delay.png\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Smart spinner component for Qwik, to manage the duration of loading states.\"\n    },\n    {\n      \"title\": \"qwik-image\",\n      \"github\": \"https://github.com/qwikifiers/qwik-image\",\n      \"imgSrc\": \"/ecosystem/qwik-image-logo.png\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"Performant images with automatic optimization.\"\n    },\n    {\n      \"title\": \"qwik-d3\",\n      \"github\": \"https://github.com/gilf/qwik-d3\",\n      \"imgSrc\": \"/ecosystem/qwik-d3.png\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"A small library to integrate d3 into your Qwik project.\"\n    },\n    {\n      \"title\": \"qwik-storefront-ui\",\n      \"github\": \"https://github.com/qwikifiers/qwik-storefront-ui\",\n      \"imgSrc\": \"/ecosystem/qwik-storefront-ui.png\",\n      \"width\": 231,\n      \"height\": 90,\n      \"description\": \"UI library that helps developers create storefronts\"\n    },\n    {\n      \"title\": \"flowbite-qwik\",\n      \"github\": \"https://flowbite-qwik.com/\",\n      \"imgSrc\": \"/ecosystem/flowbite.svg\",\n      \"width\": 90,\n      \"height\": 90,\n      \"description\": \"UI component Library based on the utility-first Tailwind CSS.\"\n    }\n  ],\n  \"communities\": [\n    {\n      \"title\": \"France\",\n      \"href\": \"https://www.linkedin.com/groups/14153723/\",\n      \"imgSrc\": \"/ecosystem/qwik-france.svg\"\n    },\n    {\n      \"title\": \"Israel\",\n      \"href\": \"https://www.facebook.com/groups/qwikisrael\",\n      \"imgSrc\": \"/ecosystem/qwik-israel.svg\"\n    },\n    {\n      \"title\": \"Taiwan\",\n      \"href\": \"https://www.facebook.com/groups/836365297555873\",\n      \"imgSrc\": \"/ecosystem/qwik-taiwan.svg\"\n    },\n    {\n      \"title\": \"London\",\n      \"href\": \"https://www.meetup.com/qwik-london/\",\n      \"imgSrc\": \"/ecosystem/qwik-london.svg\"\n    },\n    {\n      \"title\": \"Amsterdam\",\n      \"href\": \"https://www.meetup.com/qwik-amsterdam-meetup-group/\",\n      \"imgSrc\": \"/ecosystem/qwik-amsterdam.svg\"\n    },\n    {\n      \"title\": \"India\",\n      \"href\": \"https://www.meetup.com/qwik-india/\",\n      \"imgSrc\": \"/ecosystem/qwik-india.svg\"\n    },\n    {\n      \"title\": \"Uruguay\",\n      \"href\": \"https://www.meetup.com/qwik-uruguay/\",\n      \"imgSrc\": \"/ecosystem/qwik-uruguay.svg\"\n    },\n    {\n      \"title\": \"Argentina\",\n      \"href\": \"https://www.meetup.com/qwik-argentina/\",\n      \"imgSrc\": \"/ecosystem/qwik-argentina.svg\"\n    }\n  ],\n  \"social\": [\n    {\n      \"title\": \"Twitter\",\n      \"href\": \"https://twitter.com/QwikDev\",\n      \"imgSrc\": \"/ecosystem/twitter.svg\"\n    },\n    {\n      \"title\": \"GitHub\",\n      \"href\": \"https://github.com/QwikDev/qwik\",\n      \"imgSrc\": \"/ecosystem/github.svg\"\n    },\n    {\n      \"title\": \"Discord\",\n      \"href\": \"https://qwik.dev/chat\",\n      \"imgSrc\": \"/ecosystem/discord.svg\"\n    },\n    {\n      \"title\": \"Facebook\",\n      \"href\": \"https://www.facebook.com/groups/qwikdevs\",\n      \"imgSrc\": \"/ecosystem/facebook.svg\"\n    },\n    {\n      \"title\": \"Reddit\",\n      \"href\": \"https://www.reddit.com/r/qwik/\",\n      \"imgSrc\": \"/ecosystem/reddit.svg\"\n    },\n    {\n      \"title\": \"LinkedIn\",\n      \"href\": \"https://www.linkedin.com/groups/12677766/\",\n      \"imgSrc\": \"/ecosystem/linkedin.svg\"\n    }\n  ]\n}\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/layout.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport { Header } from '../../components/header/header';\nimport { Footer } from '../../components/footer/footer';\n\nexport default component$(() => {\n  return (\n    <>\n      <Header />\n      <main>\n        <Slot />\n      </main>\n      <div class=\"px-4\">\n        <Footer />\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/media/index.tsx",
    "content": "import { component$, useStyles$ } from '@builder.io/qwik';\n\nimport { type DocumentHead } from '@builder.io/qwik-city';\nimport styles from './media.css?inline';\n\n/***/\n/* This file is used to generate the ecosystem and media pages.\n/* Please find the appropriate section in the MEDIA variable\n/* to add your content.\n/* Thanks!!!\n/*************************************************************/\n\nexport const MEDIA = mediaObj({\n  /***/\n  /* Courses\n  /*****************************************/\n  courses: [\n    youtube('The Net Ninja', 'W0xjcx4mrkE', {\n      playlist: 'PL4cUxeGkcC9gOUlY-uCHurFIpqogsdOnw',\n      promoted: true,\n      author: 'The Net Ninja',\n    }),\n    {\n      href: 'https://qwikschool.com/',\n      imgSrc:\n        'https://user-images.githubusercontent.com/1430726/234708569-7a51fe77-3a65-4a28-9617-73ad159aa551.png',\n      title: 'QwikSchool.com',\n      language: 'en',\n      promoted: true,\n      author: 'HiRez.io',\n    },\n    youtube('Qwik JS - Crash Introduction to Building a Super Fast Application', 'zLHYDY9dAbs', {\n      playlist: 'PLkswEDcfBXYcl1gW7L5zyCVF9LpGhlOqu',\n      promoted: true,\n      author: 'Code Raiders',\n    }),\n    {\n      href: 'https://frontendmasters.com/courses/qwik/',\n      imgSrc: 'https://static.frontendmasters.com/assets/courses/2023-02-28-qwik/posterframe.webp',\n      title: 'FrontendMasters: Qwik for Instant-Loading Websites & Apps',\n      language: 'en',\n      promoted: true,\n      author: 'Miško Hevery',\n    },\n    youtube('Qwik en 2 horas', 'FF3D4tppyag', {\n      language: 'es',\n      promoted: true,\n      author: 'Leifer Mendez',\n    }),\n    {\n      href: 'https://cursos.devtalles.com/courses/qwik-introduccion',\n      imgSrc:\n        'https://import.cdn.thinkific.com/643563/courses/2285840/hD0Nof2mTK2cVOWvRJg2_QWIK-COVER-CURSO.jpg',\n      title: 'Fernando Herrera + DevTalles',\n      language: 'es',\n      author: 'Dev Talles',\n      promoted: true,\n    },\n    youtube('⭐️ Domina QWIK, el revolucionario framework de JS', 'X4puVLRTr4k', {\n      language: 'es',\n      author: 'Manuel Sánchez WEB',\n    }),\n    {\n      href: 'https://www.udemy.com/course/curso-intermedio-qwik-espanol/?referralCode=3D453D600C0CB529D84B',\n      imgSrc: 'https://www.manuelsanchezweb.com/img/qwik-intermedio.png',\n      title: 'Qwik intermedio-avanzado con proyectos',\n      language: 'es',\n      author: 'Manuel Sánchez',\n    },\n    youtube('Qwik 1.0 - новый подход frontend разработки?', 'ajTNL88BN5E', {\n      language: 'ru',\n      promoted: true,\n      author: 'PurpleSchool | Anton Larichev',\n    }),\n    youtube('QwikJS course in Arabic', 'irQDABJZw5c', {\n      playlist: 'PLJaZ4a7YGFlJIxcL0br5FPsh5f9qFKKdd',\n      language: 'ar',\n      author: 'Alhareth Turab',\n    }),\n  ],\n\n  /***/\n  /* Videos\n  /*****************************************/\n  videos: [\n    youtube(\"Qwik… the world's first O(1) JavaScript framework?\", 'x2eF3YLiNhY', {\n      promoted: true,\n      author: 'Fireship',\n    }),\n    youtube('Qwik: Performance is a Human Design Issue | ViteConf 2023', 'bvSlEweRyjE', {\n      promoted: true,\n    }),\n    youtube(\n      'Miško Hevery: Creator of AngularJS & now Qwik | The Frontend Masters Podcast Ep.4',\n      'CcLgQaJIyn0',\n      {\n        promoted: true,\n      }\n    ),\n    youtube(\n      'Using Qwik To Turn React Application Into Lazy Hydration Islands - Misko Hevery',\n      'XvpwF_xTZcU',\n      {\n        promoted: true,\n      }\n    ),\n    youtube(\n      'Effortless Server Communication & Multithreading in Qwik - Yoav Ganbar',\n      'lEc2BM5HmJ8',\n      {\n        promoted: true,\n      }\n    ),\n    youtube('JavaScript Streaming: A Qwik Glimpse Into The Future - Shai Reznik', '5vckrrqtWto', {\n      promoted: true,\n    }),\n    youtube('Get Started With Qwik: The JavaScript Framework Game-Changer', 'uXVaeKzN44Y', {\n      promoted: true,\n      author: 'camelCase',\n    }),\n  ],\n\n  /***/\n  /* Podcasts\n  /*****************************************/\n  podcasts: [\n    youtube('Qwik City for Resumable, Dynamic Apps', 'cJJdrYnsl6U', {\n      promoted: true,\n      author: 'Learn with Jason',\n    }),\n    youtube('Qwik + React State (and a new mic!)', 'fa6-Mn0Eybg', {\n      promoted: true,\n      author: 'Theo - t3.gg',\n    }),\n    youtube(\n      'Miško Hevery: Qwik, PartyTown, and Lessons from Angular [Swyx Mixtape]',\n      'T3K_DrgLPXM',\n      { promoted: true, author: 'swyx' }\n    ),\n    youtube('Introducing Qwik w/ Misko Hevery & Shai Reznik', 'iJZaT-AvJ-o', {\n      promoted: true,\n      author: 'Angular Nation',\n    }),\n    youtube('Resumable Apps in Qwik', 'LbMRs7l4czI', { promoted: true, author: 'Tony Alicea' }),\n    youtube('Qwik: A no-hydration instant-on personalized web applications', '0tCuUQe_ZA0', {\n      promoted: true,\n      author: 'This Dot Media',\n    }),\n    youtube('QWIK - Set of great demos by Misko Hevery', '7MgNMIPISY4', {\n      author: 'JS Poland Conf',\n    }),\n    youtube('Qwik the HTML First Framework', 'GdIZh42etYk', { author: 'CodingCatDev' }),\n    youtube('Build Resumable Apps with Qwik', '_PDpoJUacuc', { author: 'Learn With Jason' }),\n    youtube('Introduction to Qwik - Misko Hevery', 'gYbHdss_y04', { author: 'JavaScript Israel' }),\n    youtube(\n      'Build Performant, Resumable Sites with Qwik and Partytown (with Miško Hevery) | Some Antics',\n      'aGuJPcIdX0A',\n      { author: 'Ben Myers' }\n    ),\n    youtube('Qwik with Miško Hevery (JS Party Live!)', 'rS8hXFHWKJQ', { author: 'Changelog' }),\n    youtube(\n      'JSMP 4: Misko Hevery on Qwik - No hydration, auto lazy-loading, edge cacheable, and fun',\n      'wMnqgjHkLiY',\n      { author: 'JS Poland Conf' }\n    ),\n    {\n      href: 'https://podrocket.logrocket.com/qwik',\n      imgSrc:\n        'https://assets.fireside.fm/file/fireside-images/podcasts/images/3/3911462c-bca2-48c2-9103-610ba304c673/episodes/e/e4fc6b6c-9e69-426d-ad23-2e7c79931d11/header.jpg?v=1',\n      title: 'Qwik with Yoav Ganbar',\n      author: 'Paul Mikulskis',\n    },\n    {\n      href: 'https://open.spotify.com/episode/5AnveNaA0SG9b85VChMAjD',\n      imgSrc: 'https://i.scdn.co/image/ab6765630000ba8a18aa5c33cbb1658d26724fcf',\n      title: 'FedBites: Qwik Special with Miško Hevery & Adam Bradley',\n      author: 'FedBites',\n    },\n    {\n      href: 'https://open.spotify.com/episode/2dl2QegrUBnepz0RHZ17rG?si=EfvbNWURT1-9u1Z34BVd1g',\n      imgSrc: 'https://devtalles.com/files/qwik/podcast-banner.jpg',\n      title: 'DevTalles 113: qwik v1.0',\n      author: 'DevTalles',\n    },\n  ],\n\n  /***/\n  /* Presentations\n  /*****************************************/\n  presentations: [\n    youtube('Qwik framework overview', 'Jf_E1_19aB4', {\n      startTime: 629,\n      promoted: true,\n      author: 'Misko Hevery',\n    }),\n    youtube(\n      'Mindblowing Google PageSpeed Scores with Qwik | Misko Hevery | Reliable Web Summit 2021',\n      'sCPLWf2cEY0',\n      { promoted: true, author: 'ng-conf' }\n    ),\n    youtube(\n      'WWC22 - Qwik + Partytown: How to remove 99% of JavaScript from main thread',\n      '0dC11DMR3fU',\n      { startTime: 154, promoted: true, author: 'WeAreDevelopers' }\n    ),\n    youtube(\n      'Qwik: A holly grail of progressive hydration for ultimate speed by Miško Hevery',\n      'JxYbg7eZNLY',\n      { promoted: true, author: 'JNation' }\n    ),\n    youtube('Qwik: A no hydration instant', 'Zddw6qy5pf0', { promoted: true, author: 'Devoxx' }),\n    youtube(\n      'Qwik City: Reimangined meta-framework for the edge, Adam Bradley, ViteConf 2022',\n      'dSLWJBGWigs',\n      { promoted: true, author: 'ViteConf' }\n    ),\n    youtube('Qwik Workshop Part 1 - Live Coding', 'GHbNaDSWUX8', { author: 'Pull Request' }),\n    youtube('Qwik: Beta and Beyond', 'Tfd62DiRTKc', { author: 'Builder' }),\n    youtube('Qwik Core Developers Training', 'Mi7udzhcCDQ', { author: 'Misko Hevery' }),\n  ],\n\n  /***/\n  /* Blogs\n  /*****************************************/\n  blogs: [\n    {\n      href: 'https://www.builder.io/blog/resumability-from-ground-up',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fa6d8c3bacc3c4cf88446e41a71cda21c?format=webp&width=1200',\n      title: 'Understanding Resumability from the Ground Up',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/speculative-module-fetching',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72106cceede74975947a7686d083a38a?format=webp&width=1200',\n      title: 'Speculative Module Fetching: a Modern Approach to Faster App Interactivity',\n      author: 'Adam Bradley',\n    },\n    {\n      href: 'https://www.builder.io/blog/wtf-is-code-extraction',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ff13459284f13474a828d6030d442c477?format=webp&width=1200',\n      title: 'WTF Is Code Extraction',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/module-extraction-the-silent-web-revolution',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F0a8170ff2659474883ee032a0129cddd?format=webp&width=1200',\n      title: 'Code Extraction: The Silent Web Revolution',\n      author: 'Manu Mtz.-Almeida',\n    },\n    {\n      href: 'https://www.builder.io/blog/usesignal-is-the-future-of-web-frameworks',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F0c790086a43f446a88bc03569a01bf73?format=webp&width=1200',\n      title: 'useSignal() is the Future of Web Frameworks',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/qwik-city-server-functions',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F48d8fd6d22ae4c3b9c1ec4817ce4046d?format=webp&width=1200',\n      title: 'Introducing Qwik City Server Functions',\n      author: 'Manu Mtz.-Almeida',\n    },\n    {\n      href: 'https://www.builder.io/blog/resumable-react-how-to-use-react-inside-qwik',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F9071a7def0b240e5b5ca6aab756e81b8?format=webp&width=1200',\n      title: 'Resumable React: How to Use React Inside Qwik',\n      author: 'Yoav Ganbar',\n    },\n    {\n      href: 'https://www.builder.io/blog/resumability-vs-hydration',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Ffc214101f7ed4e2fa61fd7d93ac880b1?format=webp&width=300',\n      title: 'Resumability vs Hydration',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/the-qase-for-qwik-love-at-first-tti',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F69e3a278f34d4bfc9deb783dc705cd9a?format=webp&width=2000',\n      title: 'The Qase for Qwik: Love At First TTI',\n      author: 'Yoav Ganbar',\n    },\n    {\n      href: 'https://www.builder.io/blog/movies-app-in-7-frameworks-which-is-fastest-and-why',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fcb655f8d61654e96a8c551404a834004?format=webp&width=2000',\n      title: 'Movies app in 7 frameworks - which is fastest and why?',\n      author: 'Miško Hevery & Yoav Ganbar',\n    },\n    {\n      href: 'https://www.builder.io/blog/hydration-is-pure-overhead',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fa6d8c3bacc3c4cf88446e41a71cda21c?format=webp&width=2000',\n      title: 'Hydration is Pure Overhead',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/why-progressive-hydration-is-harder-than-you-think',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F23067e673a904628bf62edb3a8ebfbd5?format=webp&width=2000',\n      title: 'Why Progressive Hydration is Harder than You Think',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/why-is-builderio-creating-qwik-and-partytown',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F67a0b5b521fb4a5d9422d5555695c3e7?format=webp&width=2000',\n      title: 'Why is Builder.io creating Qwik and Partytown?',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/dont-blame-the-developer-for-what-the-frameworks-did',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F0b20ce9152c143b798540cc2f61e89d1?format=webp&width=2000',\n      title: \"Don't blame the developer for what the frameworks did!\",\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/our-current-frameworks-are-on-we-need-o1',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F91dd9092a56a4cbf991e1b7d4e75569e?format=webp&width=2000',\n      title: 'Our current frameworks are O(n); we need O(1)',\n      author: 'Miško Hevery',\n    },\n    {\n      href: 'https://www.builder.io/blog/streaming-is-it-worth-it',\n      imgSrc:\n        'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fbd10ac7b629341ee9526d03d000a06a8?format=webp&width=2000',\n      title: 'Streaming: is it worth it?',\n      author: 'Misko Hevery, Taylor Hunt & Ryan Carniato',\n    },\n    {\n      href: 'https://dev.to/builderio/a-first-look-at-qwik-the-html-first-framework-af',\n      imgSrc:\n        'https://res.cloudinary.com/practicaldev/image/fetch/s--I8Btkl4y--/c_imagga_scale,f_auto,fl_progressive,h_500,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gl136wplgijcmgz4wly0.png',\n      title: 'A first look at Qwik - the HTML first framework',\n      author: 'Builder.io',\n    },\n    {\n      href: 'https://dev.to/mhevery/death-by-closure-and-how-qwik-solves-it-44jj',\n      imgSrc:\n        'https://res.cloudinary.com/practicaldev/image/fetch/s--3-Um0T29--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpbp3xiujhqbe9ycpti0.png',\n      title: 'Death by Closure (and how Qwik solves it)',\n      author: 'Builder.io',\n    },\n    {\n      href: 'https://dev.to/builderio/html-first-javascript-last-the-secret-to-web-speed-4ic9',\n      imgSrc:\n        'https://res.cloudinary.com/practicaldev/image/fetch/s--DDi82wMF--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igcz0gwpcadh1mlrwj07.png',\n      title: 'HTML-first, JavaScript last: the secret to web speed!',\n      author: 'Builder.io',\n    },\n    {\n      href: 'https://dev.to/mhevery/qwik-the-answer-to-optimal-fine-grained-lazy-loading-2hdp',\n      imgSrc:\n        'https://res.cloudinary.com/practicaldev/image/fetch/s--BSSeczM_--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdhlus87hpih96oa0rbb.png',\n      title: 'Qwik: the answer to optimal fine-grained lazy loading',\n      author: 'Builder.io',\n    },\n    {\n      href: 'https://dev.to/builderio/how-to-score-100-on-google-pagespeed-insights-on-mobile-2e0i',\n      imgSrc:\n        'https://res.cloudinary.com/practicaldev/image/fetch/s--pAtgTncG--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hbv99ammwti7euofkdxn.png',\n      title: 'How to score 100 on Google PageSpeed Insights on Mobile',\n      author: 'Builder.io',\n    },\n    {\n      href: 'https://dev.to/builderio/your-bundler-is-doing-it-wrong-ic0',\n      imgSrc:\n        'https://res.cloudinary.com/practicaldev/image/fetch/s--MSdEMfio--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9weo7picbo9wg5nt61e.png',\n      title: 'Your bundler is doing it wrong',\n      author: 'Builder.io',\n    },\n    {\n      href: 'https://dev.to/builderio/how-we-cut-99-of-our-javascript-with-qwik-partytown-3i3k',\n      imgSrc:\n        'https://res.cloudinary.com/practicaldev/image/fetch/s--bvLSSb4K--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ea4nlhnx1iq4rx814gj.jpg',\n      title: 'How we cut 99% of our JavaScript with Qwik + Partytown',\n      author: 'Builder.io',\n    },\n    {\n      href: 'https://dev.to/builderio/introducing-qwik-starters-get-up-and-running-with-qwik-now-3ap2',\n      imgSrc: '',\n      title: 'Introducing Qwik starters - get up and running with Qwik now',\n      author: 'Builder.io',\n    },\n  ],\n\n  /***/\n  /* Case Studies\n  /*****************************************/\n\n  ['case studies']: [\n    {\n      href: 'https://tzdesign.de/en/blog/how-10-engineers-deliver-exactly-what-the-browser-wants-with-qwik',\n      imgSrc: '',\n      title:\n        'How 10 Engineers Deliver Exactly What the Browser Wants with Qwik - by Tobias Zimmermann',\n    },\n    {\n      href: 'https://www.theseus.fi/bitstream/handle/10024/795367/Cao_Xuan-An.pdf',\n      imgSrc: '',\n      title:\n        'HEADLESS CMS AND QWIK FRAMEWORK; their practicalities in the future of application development - by Xuan-An Cao',\n    },\n    {\n      href: 'https://www.dropbox.com/s/fsznus0ynnbui1z/sci_2023_lonka_touko.pdf',\n      imgSrc: '',\n      title:\n        'Improving the Initial Rendering Performance of React Applications Through Contemporary Rendering Approaches - by Touko Lonka',\n    },\n  ],\n\n  /***/\n  /* Resources\n  /*****************************************/\n  resources: [\n    {\n      href: 'https://docs.google.com/presentation/d/1q0eILmAAdFyE0tHkvd_fSuFtcHsHzUn0nZnz5FDgU4k/edit#slide=id.gff298a2a9a_1_2',\n      title: 'Qwik City - Google Presentation Template',\n      author: '',\n    },\n    {\n      href: 'https://docs.google.com/presentation/d/1Jj1iw0lmaecxtUpqyNdF1aBzbCVnSlbPGLbOpN2xydc/edit#slide=id.g13225ffe116_6_234',\n      title: 'Qwik - Google Presentation Template',\n    },\n    {\n      href: 'https://docs.google.com/presentation/d/1cGbC-FFMrLCQ62YDGG17jf3Eh0hqwMBlyDQZGeoFNyw/edit#slide=id.g1620a79b097_0_300',\n      title: 'Qwik the O(1) framework',\n    },\n    { href: '/logos/qwik-logo.svg', title: 'Qwik Logo [svg]' },\n    { href: '/logos/qwik.svg', title: 'Qwik Logo and Text [svg]' },\n    { href: '/logos/qwik.png', title: 'Qwik Logo and Text [png]' },\n  ],\n});\n\nexport interface MediaEntry {\n  title: string;\n  href: string;\n  width?: number;\n  height?: number;\n  author?: string;\n  language?: string;\n  imgSrc?: string;\n  promoted?: boolean;\n}\n\nexport const ThumbnailLink = component$((props: { entry: MediaEntry; imgLoading?: 'eager' }) => {\n  const itemURL = new URL(props.entry.href);\n  return (\n    <li>\n      <a href={props.entry.href} target=\"_blank\" rel=\"noreferrer\">\n        <div class=\"relative\">\n          <img\n            src={props.entry.imgSrc ? props.entry.imgSrc : '/ecosystem/qwik-blog-fallback.png'}\n            width={props.entry.width || 360}\n            height={props.entry.height || 200}\n            loading={props.imgLoading === 'eager' ? undefined : 'lazy'}\n            decoding={props.imgLoading === 'eager' ? undefined : 'async'}\n            class=\"thumbnail\"\n            aria-hidden=\"true\"\n          />\n          <div class=\"info\">\n            {props.entry.language ? (\n              <span class=\"info-bg font-bold\">{props.entry.language}</span>\n            ) : null}\n          </div>\n        </div>\n        <div class=\"flex gap-2\">\n          <img\n            src={`https://t0.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://${itemURL.host}&size=128`}\n            width={128}\n            height={128}\n            alt={`${itemURL.host.split('.').at(1)} logo`}\n            class=\"icon\"\n          />\n          <div class=\"flex flex-col\">\n            <p class=\"line-clamp-2\">{props.entry.title}</p>\n            <p class={`text-gray-400 text-xs`}>by {props.entry.author}</p>\n          </div>\n        </div>\n      </a>\n    </li>\n  );\n});\n\nexport const BulletLink = component$((props: { entry: MediaEntry }) => {\n  return (\n    <li>\n      <a href={props.entry.href} target=\"_blank\" rel=\"noreferrer\">\n        {props.entry.title}\n      </a>\n    </li>\n  );\n});\n\nexport const Section = component$(\n  (props: {\n    id: keyof typeof MEDIA;\n    listStyle: 'thumbnails' | 'bullets';\n    imgLoading?: 'eager';\n  }) => {\n    const entriesInOtherLanguages: MediaEntry[] = [];\n    return (\n      <section id={props.id} class=\"scroll-m-16 md:scroll-m-20\">\n        <h2>\n          <a class=\"capitalize\" href={`#${props.id}`}>\n            {props.id}\n          </a>\n        </h2>\n\n        <ul class={props.listStyle}>\n          {MEDIA[props.id].map((entry, key) => {\n            if (entry.language && entry.language !== 'en') {\n              entriesInOtherLanguages.push(entry);\n              return null;\n            }\n            if (props.listStyle === 'thumbnails') {\n              return <ThumbnailLink key={key} entry={entry} imgLoading={props.imgLoading} />;\n            }\n            return <BulletLink key={key} entry={entry} />;\n          })}\n        </ul>\n\n        {(entriesInOtherLanguages.length && (\n          <>\n            <h3>Other languages</h3>\n            <ul class={props.listStyle}>\n              {entriesInOtherLanguages.map((entry, key) =>\n                props.listStyle === 'thumbnails' ? (\n                  <ThumbnailLink key={key} entry={entry} imgLoading={props.imgLoading} />\n                ) : (\n                  <BulletLink key={key} entry={entry} />\n                )\n              )}\n            </ul>\n          </>\n        )) ||\n          null}\n      </section>\n    );\n  }\n);\n\nexport default component$(() => {\n  useStyles$(styles);\n  return (\n    <article class=\"media\">\n      <h1>Qwik Courses, Presentations, Talks, Videos and Podcasts</h1>\n\n      <Section id=\"courses\" listStyle=\"thumbnails\" imgLoading=\"eager\" />\n\n      <Section id=\"videos\" listStyle=\"thumbnails\" imgLoading=\"eager\" />\n\n      <Section id=\"podcasts\" listStyle=\"thumbnails\" />\n\n      <Section id=\"presentations\" listStyle=\"thumbnails\" />\n\n      <Section id=\"blogs\" listStyle=\"thumbnails\" />\n\n      <Section id=\"case studies\" listStyle=\"bullets\" />\n\n      <Section id=\"resources\" listStyle=\"bullets\" />\n\n      <section>\n        <h2>Add Media</h2>\n        <p>This page missing any great resources or in need of an update?</p>\n        <p>\n          <a\n            href=\"https://github.com/QwikDev/qwik/edit/main/packages/docs/src/routes/(ecosystem)/media/index.tsx\"\n            target=\"_blank\"\n            class=\"edit-page\"\n          >\n            Edit this page!\n          </a>\n        </p>\n      </section>\n    </article>\n  );\n});\n\n/** A helper for defining YouTube Media Entries */\nexport function youtube(\n  title: string,\n  id: string,\n  {\n    startTime,\n    playlist,\n    author,\n    language = 'en',\n    promoted = false,\n  }: {\n    startTime?: number;\n    playlist?: string;\n    language?: string;\n    promoted?: boolean;\n    author?: string;\n  } = {}\n): MediaEntry {\n  const url = new URL('https://www.youtube.com/watch');\n  url.searchParams.append('v', id);\n  // if there's a start_time and it's not 0\n  if (startTime) {\n    url.searchParams.append('t', startTime.toString());\n  }\n  if (playlist) {\n    url.searchParams.append('list', playlist);\n  }\n  return {\n    href: url.href,\n    imgSrc: `https://i3.ytimg.com/vi/${id}/hqdefault.jpg`,\n    title,\n    author,\n    language,\n    promoted,\n  };\n}\n\nexport const head: DocumentHead = {\n  title: 'Qwik Presentations, Talks, Videos and Podcasts',\n};\n\n// Media Listing\n\n// Helper function to allow autocompletions for Media Entries and Record keys\nexport function mediaObj<T extends string>(obj: Record<T, MediaEntry[]>) {\n  return obj;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/media/media.css",
    "content": "@reference \"tailwindcss\";\n\n.media {\n  margin: 10px auto;\n  padding: 0 20px;\n  max-width: 960px;\n}\n\n.media h1 {\n  font-size: 28px;\n  font-weight: bold;\n}\n\n.media section {\n  margin: 40px 0;\n}\n\n.media h2,\n.media h3 {\n  font-size: 24px;\n  font-weight: bold;\n  margin: 0 0 15px 0;\n  padding: 0 0 5px 0;\n  border-bottom: 1px solid var(--media-separator-color);\n}\n\n.media h3 {\n  font-size: 18px;\n  margin-top: 30px;\n  padding: 0 0 2px 0;\n}\n\n.media .thumbnails {\n  display: grid;\n  grid-template-columns: repeat(4, 1fr);\n  grid-gap: 30px;\n}\n\n.media li .thumbnail {\n  display: inline-block;\n  aspect-ratio: 16/9;\n  object-fit: cover;\n  margin: 0 0 10px 0;\n  border-radius: 5px;\n  width: 100%;\n  overflow: hidden;\n  border: 1px solid black;\n  box-shadow: var(--qwik-purple) 2px 2px 2px 0px;\n  transition: ease-in-out 250ms;\n}\n\n.media li a {\n  color: var(--interactive-text-color);\n  display: block;\n  font-size: 0.9em;\n}\n\n.media li a:hover {\n  color: var(--qwik-purple);\n}\n\n.media li a:hover .thumbnail {\n  opacity: 0.9;\n  border: 2.5px solid var(--media-video-shadow-color);\n  box-shadow: none;\n}\n\n.media .edit-page {\n  font-weight: 400;\n  display: inline-block;\n  padding: 12px 0;\n  color: var(--interactive-text-color);\n}\n\n.media .edit-page:hover {\n  text-decoration: underline;\n}\n\n@media screen and (max-width: 540px) {\n  .media .thumbnails {\n    grid-template-columns: repeat(2, 1fr);\n    grid-gap: 20px;\n  }\n}\n\n.media .bullets {\n  margin: 20px 0 20px 30px;\n  list-style: square;\n}\n\n.media .bullets {\n  margin: 20px 0 20px 30px;\n  list-style: square;\n}\n\n.icon {\n  @apply rounded-full aspect-square w-9 h-9 flex-none;\n}\n\n.info {\n  @apply absolute bottom-4 right-2;\n}\n\n.info-bg {\n  @apply uppercase text-white bg-black/40 backdrop-blur-md px-1 rounded-md;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/showcase/generated-pages.json",
    "content": "[\n  {\n    \"href\": \"https://www.learn-qwik.com/\",\n    \"size\": \"large\",\n    \"tags\": \"site,tutorial,learn\",\n    \"ts\": 1762982111351,\n    \"title\": \"Learn Qwik | Start building with Qwik\",\n    \"imgSrc\": \"/showcases/www_learn-qwik_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.97,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.8 s\",\n      \"fcpScore\": 0.89,\n      \"lcpDisplay\": \"2.1 s\",\n      \"lcpScore\": 0.96,\n      \"ttiDisplay\": \"2.1 s\",\n      \"ttiScore\": 0.99,\n      \"ttiTime\": 2105.8329231017133\n    },\n    \"version\": \"1.8.0\"\n  },\n  {\n    \"href\": \"https://sasthyaseba.com\",\n    \"size\": \"large\",\n    \"tags\": \"site,healthcare,services,webrtc,websocket\",\n    \"ts\": 1762982145495,\n    \"title\": \"Book Doctor Appointment and Ambulance Service Online | Sasthya Seba\",\n    \"imgSrc\": \"/showcases/sasthyaseba_com.jpeg\",\n    \"perf\": {\n      \"score\": 0.97,\n      \"inpMs\": 207,\n      \"clsScore\": 0.02,\n      \"ttfbMs\": 731,\n      \"fcpDisplay\": \"1.4 s\",\n      \"fcpScore\": 0.98,\n      \"lcpDisplay\": \"1.5 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"4.8 s\",\n      \"ttiScore\": 0.79,\n      \"ttiTime\": 4798.561280120796\n    },\n    \"version\": \"1.5.5\"\n  },\n  {\n    \"href\": \"https://ohayo-dev-design.com/\",\n    \"tags\": \"web, dev, agency\",\n    \"ts\": 1762982164210,\n    \"title\": \"Ohayo Dev & Design | Conception de site web Madagascar\",\n    \"imgSrc\": \"/showcases/ohayo-dev-design_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.9,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.1 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"3.6 s\",\n      \"lcpScore\": 0.61,\n      \"ttiDisplay\": \"3.6 s\",\n      \"ttiScore\": 0.91,\n      \"ttiTime\": 3616\n    },\n    \"version\": \"1.12.0\"\n  },\n  {\n    \"href\": \"https://linkfang-portfolio.vercel.app/\",\n    \"tags\": \"portfolio\",\n    \"ts\": 1762982179894,\n    \"title\": \"Wep Apps | Zhou's Portfolio\",\n    \"imgSrc\": \"/showcases/linkfang-portfolio_vercel_app_.jpeg\",\n    \"perf\": {\n      \"score\": 0.99,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.5 s\",\n      \"fcpScore\": 0.95,\n      \"lcpDisplay\": \"2.1 s\",\n      \"lcpScore\": 0.96,\n      \"ttiDisplay\": \"2.1 s\",\n      \"ttiScore\": 0.99,\n      \"ttiTime\": 2103\n    },\n    \"version\": \"1.5.2\"\n  },\n  {\n    \"href\": \"https://blueagle.top/\",\n    \"tags\": \"portfolio,site,blog\",\n    \"ts\": 1762982201759,\n    \"title\": \"Blueagle\",\n    \"imgSrc\": \"/showcases/blueagle_top_.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"1.5 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.5 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1501.024723638424\n    },\n    \"version\": \"1.8.0\"\n  },\n  {\n    \"href\": \"https://quotemingle.com/\",\n    \"tags\": \"site\",\n    \"ts\": 1762982253404,\n    \"title\": \"QuoteMingle - California Car insurance made easy!\",\n    \"imgSrc\": \"/showcases/quotemingle_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.97,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.6 s\",\n      \"fcpScore\": 0.95,\n      \"lcpDisplay\": \"2.4 s\",\n      \"lcpScore\": 0.91,\n      \"ttiDisplay\": \"2.4 s\",\n      \"ttiScore\": 0.98,\n      \"ttiTime\": 2417.1721215\n    },\n    \"version\": \"1.5.5\"\n  },\n  {\n    \"href\": \"https://frostytools.com\",\n    \"tags\": \"saas\",\n    \"ts\": 1762982338270,\n    \"title\": \"FrostyTools | AI Twitch Chat Bot & Other Streaming Tools\",\n    \"imgSrc\": \"/showcases/frostytools_com.jpeg\",\n    \"perf\": {\n      \"score\": 0.97,\n      \"inpMs\": 107,\n      \"clsScore\": 0.01,\n      \"ttfbMs\": 769,\n      \"fcpDisplay\": \"1.5 s\",\n      \"fcpScore\": 0.95,\n      \"lcpDisplay\": \"2.4 s\",\n      \"lcpScore\": 0.91,\n      \"ttiDisplay\": \"2.4 s\",\n      \"ttiScore\": 0.98,\n      \"ttiTime\": 2401\n    },\n    \"version\": \"1.15.0\"\n  },\n  {\n    \"href\": \"https://wope.com/\",\n    \"tags\": \"saas\",\n    \"ts\": 1762982401158,\n    \"title\": \"Wope: The New Era of SEO Research\",\n    \"imgSrc\": \"/showcases/wope_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.77,\n      \"inpMs\": 243,\n      \"clsScore\": 0,\n      \"ttfbMs\": 1312,\n      \"fcpDisplay\": \"1.5 s\",\n      \"fcpScore\": 0.96,\n      \"lcpDisplay\": \"3.9 s\",\n      \"lcpScore\": 0.52,\n      \"ttiDisplay\": \"11.8 s\",\n      \"ttiScore\": 0.17,\n      \"ttiTime\": 11809.631255921002\n    },\n    \"version\": \"1.2.6\"\n  },\n  {\n    \"href\": \"https://reflect.app/\",\n    \"tags\": \"saas\",\n    \"ts\": 1762982422371,\n    \"title\": \"Reflect Notes\",\n    \"imgSrc\": \"/showcases/reflect_app_.jpeg\",\n    \"perf\": {\n      \"score\": 0.99,\n      \"inpMs\": 228,\n      \"clsScore\": 0,\n      \"ttfbMs\": 641,\n      \"fcpDisplay\": \"1.4 s\",\n      \"fcpScore\": 0.97,\n      \"lcpDisplay\": \"2.1 s\",\n      \"lcpScore\": 0.96,\n      \"ttiDisplay\": \"5.4 s\",\n      \"ttiScore\": 0.71,\n      \"ttiTime\": 5424.253362892558\n    },\n    \"version\": \"0.103.0\"\n  },\n  {\n    \"href\": \"https://qwik-storefront.vendure.io/\",\n    \"tags\": \"ecommerce\",\n    \"ts\": 1762982470256,\n    \"title\": \"Vendure Qwik Storefront\",\n    \"imgSrc\": \"/showcases/qwik-storefront_vendure_io_.jpeg\",\n    \"perf\": {\n      \"score\": 0.99,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"2.3 s\",\n      \"lcpScore\": 0.94,\n      \"ttiDisplay\": \"2.3 s\",\n      \"ttiScore\": 0.99,\n      \"ttiTime\": 2252.004099455705\n    },\n    \"version\": \"2.0.0-beta.13-dev+cb19ff7\"\n  },\n  {\n    \"href\": \"https://qwind.pages.dev/\",\n    \"tags\": \"template\",\n    \"repo\": \"https://github.com/onwidget/qwind\",\n    \"size\": \"large\",\n    \"ts\": 1762982488926,\n    \"title\": \"Qwind — Free template for Qwik + Tailwind CSS to build your new website.\",\n    \"imgSrc\": \"/showcases/qwind_pages_dev_.jpeg\",\n    \"perf\": {\n      \"score\": 0.99,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.2 s\",\n      \"fcpScore\": 0.99,\n      \"lcpDisplay\": \"2.0 s\",\n      \"lcpScore\": 0.97,\n      \"ttiDisplay\": \"2.0 s\",\n      \"ttiScore\": 0.99,\n      \"ttiTime\": 2039.0168165818086\n    },\n    \"version\": \"1.8.0\"\n  },\n  {\n    \"href\": \"https://bot-whatsapp.netlify.app/\",\n    \"tags\": \"site\",\n    \"ts\": 1762982554275,\n    \"title\": \"Crear chatbot WhatsApp en minutos — Servicio de chatbot para whatspp gratis proyecto OpenSource\",\n    \"imgSrc\": \"/showcases/bot-whatsapp_netlify_app_.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"inpMs\": 103,\n      \"clsScore\": 0.01,\n      \"ttfbMs\": 1622,\n      \"fcpDisplay\": \"1.0 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"1.0 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.0 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1023.5628483958196\n    },\n    \"version\": \"0.16.1\"\n  },\n  {\n    \"href\": \"https://pricing.oasisdigital.com/\",\n    \"tags\": \"saas\",\n    \"ts\": 1762982604163,\n    \"title\": \"Private Training Package Builder - Oasis Digital\",\n    \"imgSrc\": \"/showcases/pricing_oasisdigital_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.92,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"3.3 s\",\n      \"lcpScore\": 0.7,\n      \"ttiDisplay\": \"3.3 s\",\n      \"ttiScore\": 0.94,\n      \"ttiTime\": 3278.7257104089194\n    },\n    \"version\": \"0.0.105\"\n  },\n  {\n    \"href\": \"https://www.burgersonfleek.ca/\",\n    \"tags\": \"site\",\n    \"repo\": \"https://github.com/saboooor/burgersonfleek\",\n    \"ts\": 1762982624486,\n    \"title\": \"Burgers on Fleek - Home\",\n    \"imgSrc\": \"/showcases/www_burgersonfleek_ca_.jpeg\",\n    \"perf\": {\n      \"score\": 0.68,\n      \"clsScore\": 0.02,\n      \"fcpDisplay\": \"3.6 s\",\n      \"fcpScore\": 0.33,\n      \"lcpDisplay\": \"6.9 s\",\n      \"lcpScore\": 0.07,\n      \"ttiDisplay\": \"6.9 s\",\n      \"ttiScore\": 0.54,\n      \"ttiTime\": 6888.147140925176\n    },\n    \"version\": \"1.17.2\"\n  },\n  {\n    \"href\": \"https://birdflop.com/\",\n    \"tags\": \"site\",\n    \"repo\": \"https://github.com/birdflop/web\",\n    \"ts\": 1762982646392,\n    \"title\": \"Birdflop - Server Hosting & Resources\",\n    \"imgSrc\": \"/showcases/birdflop_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.79,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"3.0 s\",\n      \"fcpScore\": 0.51,\n      \"lcpDisplay\": \"4.5 s\",\n      \"lcpScore\": 0.37,\n      \"ttiDisplay\": \"4.5 s\",\n      \"ttiScore\": 0.82,\n      \"ttiTime\": 4501.101065540428\n    },\n    \"version\": \"1.17.1\"\n  },\n  {\n    \"href\": \"https://goshi.dev/\",\n    \"tags\": \"portfolio\",\n    \"ts\": 1762982664214,\n    \"title\": \"Guille Scura\",\n    \"imgSrc\": \"/showcases/goshi_dev_.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.3 s\",\n      \"fcpScore\": 0.98,\n      \"lcpDisplay\": \"1.4 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.4 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1436.5\n    },\n    \"version\": \"1.5.5\"\n  },\n  {\n    \"href\": \"https://sanyamjainqwik.vercel.app/\",\n    \"tags\": \"portfolio\",\n    \"ts\": 1762982680786,\n    \"title\": \"Sanyam Jain\",\n    \"imgSrc\": \"/showcases/sanyamjainqwik_vercel_app_.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.8 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"0.8 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"0.8 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 790.6790000000001\n    },\n    \"version\": \"0.12.1\"\n  },\n  {\n    \"href\": \"https://qwik.dev\",\n    \"tags\": \"site\",\n    \"repo\": \"https://github.com/QwikDev/qwik/tree/main/packages/docs\",\n    \"ts\": 1762982704880,\n    \"title\": \"Framework reimagined for the edge! 📚 Qwik Documentation\",\n    \"imgSrc\": \"/showcases/qwik_dev.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"inpMs\": 57,\n      \"clsScore\": 0,\n      \"ttfbMs\": 934,\n      \"fcpDisplay\": \"1.2 s\",\n      \"fcpScore\": 0.99,\n      \"lcpDisplay\": \"1.5 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.5 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1501.5086559201732\n    },\n    \"version\": \"1.17.1-dev+c673828\"\n  },\n  {\n    \"href\": \"https://pulsestax.com/\",\n    \"tags\": \"saas\",\n    \"ts\": 1762982719902,\n    \"title\": \"Pulsestax | Check the uptime and pulse of any website\",\n    \"imgSrc\": \"/showcases/pulsestax_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.89,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.5 s\",\n      \"fcpScore\": 0.96,\n      \"lcpDisplay\": \"1.6 s\",\n      \"lcpScore\": 0.99,\n      \"ttiDisplay\": \"1.6 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1563.7203809617772\n    },\n    \"version\": \"0.16.1\"\n  },\n  {\n    \"href\": \"https://abdhashem.com\",\n    \"tags\": \"portfolio\",\n    \"ts\": 1762982741338,\n    \"title\": \"Abdulrahman Hashem | Full Stack & Front End Enthusiast\",\n    \"imgSrc\": \"/showcases/abdhashem_com.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"0.9 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"0.9 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 942.6000000000001\n    },\n    \"version\": \"0.16.2\"\n  },\n  {\n    \"href\": \"https://itbusinesshub.com/\",\n    \"tags\": \"blog\",\n    \"ts\": 1762982755979,\n    \"title\": \"Home\",\n    \"imgSrc\": \"/showcases/itbusinesshub_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.96,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"2.8 s\",\n      \"lcpScore\": 0.83,\n      \"ttiDisplay\": \"3.0 s\",\n      \"ttiScore\": 0.96,\n      \"ttiTime\": 2962.1984654891307\n    },\n    \"version\": \"1.6.0\"\n  },\n  {\n    \"href\": \"https://travelcalc.pages.dev\",\n    \"tags\": \"app\",\n    \"ts\": 1762982772409,\n    \"title\": \"Main page - Travel Calculator\",\n    \"imgSrc\": \"/showcases/travelcalc_pages_dev.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"1.2 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.2 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1210.1810874938965\n    },\n    \"version\": \"0.17.5\"\n  },\n  {\n    \"href\": \"https://leonerd.blog\",\n    \"tags\": \"portfolio\",\n    \"ts\": 1762982801555,\n    \"title\": \"Welcome to LeoNerd\",\n    \"imgSrc\": \"/showcases/leonerd_blog.jpeg\",\n    \"perf\": {\n      \"score\": 0.91,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.1 s\",\n      \"fcpScore\": 0.99,\n      \"lcpDisplay\": \"3.5 s\",\n      \"lcpScore\": 0.64,\n      \"ttiDisplay\": \"3.5 s\",\n      \"ttiScore\": 0.92,\n      \"ttiTime\": 3489.5\n    },\n    \"version\": \"1.8.0\"\n  },\n  {\n    \"href\": \"https://seifen.vercel.app/\",\n    \"tags\": \"site\",\n    \"ts\": 1762982819018,\n    \"title\": \"Seifen - detergente ultra concentrado para ropa deportiva\",\n    \"imgSrc\": \"/showcases/seifen_vercel_app_.jpeg\",\n    \"perf\": {\n      \"score\": 0.88,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"3.8 s\",\n      \"lcpScore\": 0.54,\n      \"ttiDisplay\": \"3.8 s\",\n      \"ttiScore\": 0.89,\n      \"ttiTime\": 3836.5\n    },\n    \"version\": \"1.1.4\"\n  },\n  {\n    \"href\": \"https://builtwith.appwrite.io/\",\n    \"tags\": \"site\",\n    \"repo\": \"https://github.com/appwrite/builtwith\",\n    \"ts\": 1762982843727,\n    \"title\": \"Built with Appwrite\",\n    \"imgSrc\": \"/showcases/builtwith_appwrite_io_.jpeg\",\n    \"perf\": {\n      \"score\": 0.73,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"2.7 s\",\n      \"fcpScore\": 0.59,\n      \"lcpDisplay\": \"5.3 s\",\n      \"lcpScore\": 0.21,\n      \"ttiDisplay\": \"5.3 s\",\n      \"ttiScore\": 0.72,\n      \"ttiTime\": 5333.51566461786\n    },\n    \"version\": \"1.2.15\"\n  },\n  {\n    \"href\": \"https://juneikerc.com\",\n    \"tags\": \"portfolio,site,blog,services\",\n    \"ts\": 1762982860208,\n    \"title\": \"Juneiker Castillo - Frontend Web Developer.\",\n    \"imgSrc\": \"/showcases/juneikerc_com.jpeg\",\n    \"perf\": {\n      \"score\": 0.93,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.7 s\",\n      \"fcpScore\": 0.93,\n      \"lcpDisplay\": \"3.2 s\",\n      \"lcpScore\": 0.74,\n      \"ttiDisplay\": \"3.2 s\",\n      \"ttiScore\": 0.95,\n      \"ttiTime\": 3168\n    },\n    \"version\": \"1.2.19\"\n  },\n  {\n    \"href\": \"https://valibot.dev/\",\n    \"tags\": \"site,documentation\",\n    \"ts\": 1762982879142,\n    \"title\": \"Valibot: The modular and type safe schema library\",\n    \"imgSrc\": \"/showcases/valibot_dev_.jpeg\",\n    \"perf\": {\n      \"score\": 0.96,\n      \"inpMs\": 80,\n      \"clsScore\": 0,\n      \"ttfbMs\": 667,\n      \"fcpDisplay\": \"1.3 s\",\n      \"fcpScore\": 0.98,\n      \"lcpDisplay\": \"2.7 s\",\n      \"lcpScore\": 0.85,\n      \"ttiDisplay\": \"2.7 s\",\n      \"ttiScore\": 0.97,\n      \"ttiTime\": 2701\n    },\n    \"version\": \"1.17.2\"\n  },\n  {\n    \"href\": \"https://todaysdatenow.com/\",\n    \"tags\": \"site,tools,time\",\n    \"ts\": 1762982903248,\n    \"title\": \"Today’s Date 📅\",\n    \"imgSrc\": \"/showcases/todaysdatenow_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.54,\n      \"inpMs\": 229,\n      \"clsScore\": 0.17,\n      \"ttfbMs\": 614,\n      \"fcpDisplay\": \"3.5 s\",\n      \"fcpScore\": 0.35,\n      \"lcpDisplay\": \"7.7 s\",\n      \"lcpScore\": 0.03,\n      \"ttiDisplay\": \"7.7 s\",\n      \"ttiScore\": 0.45,\n      \"ttiTime\": 7729.740700565177\n    },\n    \"version\": \"1.16.0\"\n  },\n  {\n    \"href\": \"https://finallyweb.com/\",\n    \"tags\": \"stock market education\",\n    \"ts\": 1762982922473,\n    \"title\": \"Finally, the Free and Fun Way to learn Stock Investing\",\n    \"imgSrc\": \"/showcases/finallyweb_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.87,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.9 s\",\n      \"fcpScore\": 0.87,\n      \"lcpDisplay\": \"3.6 s\",\n      \"lcpScore\": 0.62,\n      \"ttiDisplay\": \"3.6 s\",\n      \"ttiScore\": 0.91,\n      \"ttiTime\": 3609.2981081485086\n    },\n    \"version\": \"1.17.0\"\n  },\n  {\n    \"href\": \"https://qit.tools/\",\n    \"tags\": \"online,tools,converters\",\n    \"ts\": 1762982940274,\n    \"title\": \"Qit.tools 🪄 online web tools\",\n    \"imgSrc\": \"/showcases/qit_tools_.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.2 s\",\n      \"fcpScore\": 0.99,\n      \"lcpDisplay\": \"1.2 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.2 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1201.9539935847938\n    },\n    \"version\": \"1.5.6\"\n  },\n  {\n    \"href\": \"https://www.placementpreparation.io/\",\n    \"tags\": \"aptitude,learning,platform\",\n    \"ts\": 1762982968102,\n    \"title\": \"Placement Preparation | Get Placement Ready with Ease\",\n    \"imgSrc\": \"/showcases/www_placementpreparation_io_.jpeg\",\n    \"perf\": {\n      \"score\": 0.71,\n      \"inpMs\": 112,\n      \"clsScore\": 0,\n      \"ttfbMs\": 935,\n      \"fcpDisplay\": \"3.0 s\",\n      \"fcpScore\": 0.49,\n      \"lcpDisplay\": \"7.0 s\",\n      \"lcpScore\": 0.06,\n      \"ttiDisplay\": \"7.0 s\",\n      \"ttiScore\": 0.53,\n      \"ttiTime\": 6998.511211120101\n    },\n    \"version\": \"1.2.17\"\n  },\n  {\n    \"href\": \"https://sakenowa.com\",\n    \"tags\": \"sns,app\",\n    \"ts\": 1762982993265,\n    \"title\": \"さけのわ\",\n    \"imgSrc\": \"/showcases/sakenowa_com.jpeg\",\n    \"perf\": {\n      \"score\": 0.99,\n      \"inpMs\": 191,\n      \"clsScore\": 0,\n      \"ttfbMs\": 646,\n      \"fcpDisplay\": \"1.5 s\",\n      \"fcpScore\": 0.96,\n      \"lcpDisplay\": \"1.7 s\",\n      \"lcpScore\": 0.99,\n      \"ttiDisplay\": \"1.7 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1666\n    },\n    \"version\": \"1.12.1-dev+7061ec0-20250220223946\"\n  },\n  {\n    \"href\": \"https://qwikpdf.alexismoren.fr/\",\n    \"tags\": \"pdf,services,free\",\n    \"ts\": 1762983013985,\n    \"title\": \"QwikPDF\",\n    \"imgSrc\": \"/showcases/qwikpdf_alexismoren_fr_.jpeg\",\n    \"perf\": {\n      \"score\": 0.99,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.8 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"1.1 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.1 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1051\n    },\n    \"version\": \"1.8.0\"\n  },\n  {\n    \"href\": \"https://abn.ooo/\",\n    \"ts\": 1763307602884,\n    \"title\": \"Abner Rodrigues - Creative Developer\",\n    \"imgSrc\": \"/showcases/abn_ooo_.jpeg\",\n    \"perf\": {\n      \"score\": 0.81,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.7 s\",\n      \"fcpScore\": 0.91,\n      \"lcpDisplay\": \"4.6 s\",\n      \"lcpScore\": 0.35,\n      \"ttiDisplay\": \"4.6 s\",\n      \"ttiScore\": 0.81,\n      \"ttiTime\": 4583.5\n    },\n    \"version\": \"1.13.0-dev+97aa67d\"\n  },\n  {\n    \"href\": \"https://ale.gimona.it/\",\n    \"ts\": 1763307628088,\n    \"title\": \"Ale\",\n    \"imgSrc\": \"/showcases/ale_gimona_it_.jpeg\",\n    \"perf\": {\n      \"score\": 0.94,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"2.1 s\",\n      \"lcpScore\": 0.96,\n      \"ttiDisplay\": \"2.1 s\",\n      \"ttiScore\": 0.99,\n      \"ttiTime\": 2101\n    },\n    \"version\": \"2.0.0-beta.8-dev+434cd18\"\n  },\n  {\n    \"href\": \"https://amo.co/\",\n    \"ts\": 1763307645182,\n    \"title\": \"Welcome to amo\",\n    \"imgSrc\": \"/showcases/amo_co_.jpeg\",\n    \"perf\": {\n      \"score\": 0.92,\n      \"inpMs\": 56,\n      \"clsScore\": 0,\n      \"ttfbMs\": 1383,\n      \"fcpDisplay\": \"2.0 s\",\n      \"fcpScore\": 0.84,\n      \"lcpDisplay\": \"3.1 s\",\n      \"lcpScore\": 0.74,\n      \"ttiDisplay\": \"3.1 s\",\n      \"ttiScore\": 0.95,\n      \"ttiTime\": 3123.926980000001\n    },\n    \"version\": \"1.2.17\"\n  },\n  {\n    \"href\": \"https://bato.si/\",\n    \"ts\": 1763307668227,\n    \"title\": \"BATOTO - Read Free Manga Online\",\n    \"imgSrc\": \"/showcases/bato_si_.jpeg\",\n    \"perf\": {\n      \"score\": 0.55,\n      \"inpMs\": 161,\n      \"clsScore\": 0.16,\n      \"ttfbMs\": 895,\n      \"fcpDisplay\": \"39.2 s\",\n      \"fcpScore\": 0,\n      \"lcpDisplay\": \"55.2 s\",\n      \"lcpScore\": 0,\n      \"ttiDisplay\": \"56.2 s\",\n      \"ttiScore\": 0,\n      \"ttiTime\": 56176.37287888823\n    },\n    \"version\": \"1.11.0\"\n  },\n  {\n    \"href\": \"https://www.brainrush.fun/\",\n    \"ts\": 1763307690911,\n    \"title\": \"Play Brain Games Online | Weekly Memory & Logic Puzzles\",\n    \"imgSrc\": \"/showcases/www_brainrush_fun_.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.1 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"1.1 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.1 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1065\n    },\n    \"version\": \"2.0.0-beta.7-dev+2dd89a6\"\n  },\n  {\n    \"href\": \"https://jobibox.fr/\",\n    \"ts\": 1763307717782,\n    \"title\": \"Jobibox\",\n    \"imgSrc\": \"/showcases/jobibox_fr_.jpeg\",\n    \"perf\": {\n      \"score\": 0.99,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.2 s\",\n      \"fcpScore\": 0.99,\n      \"lcpDisplay\": \"1.9 s\",\n      \"lcpScore\": 0.98,\n      \"ttiDisplay\": \"1.9 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1885.5674405584878\n    },\n    \"version\": \"1.15.0\"\n  },\n  {\n    \"href\": \"https://www.le-cv-du-bantu.com/\",\n    \"ts\": 1763307745355,\n    \"title\": \"Yves Romuald BAHOKEN – Fullstack JS Developer | Portfolio\",\n    \"imgSrc\": \"/showcases/www_le-cv-du-bantu_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.65,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"2.9 s\",\n      \"fcpScore\": 0.53,\n      \"lcpDisplay\": \"9.6 s\",\n      \"lcpScore\": 0,\n      \"ttiDisplay\": \"9.6 s\",\n      \"ttiScore\": 0.29,\n      \"ttiTime\": 9602.188489749846\n    },\n    \"version\": \"1.13.0-dev+97aa67d\"\n  },\n  {\n    \"href\": \"https://qwik-pokedex.vercel.app/en\",\n    \"ts\": 1763307763972,\n    \"title\": \"Pokedex\",\n    \"imgSrc\": \"/showcases/qwik-pokedex_vercel_app_en.jpeg\",\n    \"perf\": {\n      \"score\": 1,\n      \"clsScore\": null,\n      \"fcpDisplay\": \"1.5 s\",\n      \"fcpScore\": 0.95,\n      \"lcpDisplay\": \"1.5 s\",\n      \"lcpScore\": 1,\n      \"ttiDisplay\": \"1.5 s\",\n      \"ttiScore\": 1,\n      \"ttiTime\": 1523\n    },\n    \"version\": \"2.0.0-beta.1-dev+495e8d9\"\n  },\n  {\n    \"href\": \"https://si.com/\",\n    \"size\": \"large\",\n    \"ts\": 1763307810379,\n    \"title\": \"Sports Illustrated\",\n    \"imgSrc\": \"/showcases/si_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.35,\n      \"inpMs\": 113,\n      \"clsScore\": 0.01,\n      \"ttfbMs\": 1186,\n      \"fcpDisplay\": \"4.2 s\",\n      \"fcpScore\": 0.2,\n      \"lcpDisplay\": \"6.0 s\",\n      \"lcpScore\": 0.13,\n      \"ttiDisplay\": \"30.4 s\",\n      \"ttiScore\": 0,\n      \"ttiTime\": 30386.522025351613\n    },\n    \"version\": \"1.15.0\"\n  },\n  {\n    \"href\": \"https://www.aimfox.com/\",\n    \"ts\": 1763307843646,\n    \"title\": \"Aimfox - Built for LinkedIn Outreach. Made to Close Deals.\",\n    \"imgSrc\": \"/showcases/www_aimfox_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.44,\n      \"inpMs\": 261,\n      \"clsScore\": 0,\n      \"ttfbMs\": 1569,\n      \"fcpDisplay\": \"12.8 s\",\n      \"fcpScore\": 0,\n      \"lcpDisplay\": \"33.3 s\",\n      \"lcpScore\": 0,\n      \"ttiDisplay\": \"34.9 s\",\n      \"ttiScore\": 0,\n      \"ttiTime\": 34926.61373492815\n    },\n    \"version\": \"1.16.0\"\n  },\n  {\n    \"href\": \"https://www.herold.at/\",\n    \"ts\": 1763307864738,\n    \"title\": \"Herold | Firmensuche & Online Marketing für Unternehmen\",\n    \"imgSrc\": \"/showcases/www_herold_at_.jpeg\",\n    \"perf\": {\n      \"score\": 0.67,\n      \"inpMs\": 148,\n      \"clsScore\": 0,\n      \"ttfbMs\": 598,\n      \"fcpDisplay\": \"2.8 s\",\n      \"fcpScore\": 0.55,\n      \"lcpDisplay\": \"15.8 s\",\n      \"lcpScore\": 0,\n      \"ttiDisplay\": \"15.9 s\",\n      \"ttiScore\": 0.06,\n      \"ttiTime\": 15879.017440755084\n    },\n    \"version\": \"1.13.0-dev+97aa67d\"\n  },\n  {\n    \"href\": \"https://www.honda.com.tr/\",\n    \"ts\": 1763307912656,\n    \"title\": \"Honda Türkiye | Otomobil, Motosiklet | Honda Türkiye\",\n    \"imgSrc\": \"/showcases/www_honda_com.tr_.jpeg\",\n    \"perf\": {\n      \"score\": 0.96,\n      \"inpMs\": 134,\n      \"clsScore\": 0.22,\n      \"ttfbMs\": 523,\n      \"fcpDisplay\": \"0.9 s\",\n      \"fcpScore\": 1,\n      \"lcpDisplay\": \"2.7 s\",\n      \"lcpScore\": 0.84,\n      \"ttiDisplay\": \"2.7 s\",\n      \"ttiScore\": 0.97,\n      \"ttiTime\": 2743.9989000797186\n    },\n    \"version\": \"1.17.2\"\n  },\n  {\n    \"href\": \"https://www.uswitch.com/\",\n    \"ts\": 1763307941107,\n    \"title\": \"Uswitch.com - We Put U First - Uswitch\",\n    \"imgSrc\": \"/showcases/www_uswitch_com_.jpeg\",\n    \"perf\": {\n      \"score\": 0.81,\n      \"inpMs\": 88,\n      \"clsScore\": 0,\n      \"ttfbMs\": 438,\n      \"fcpDisplay\": \"2.6 s\",\n      \"fcpScore\": 0.65,\n      \"lcpDisplay\": \"4.0 s\",\n      \"lcpScore\": 0.5,\n      \"ttiDisplay\": \"6.8 s\",\n      \"ttiScore\": 0.55,\n      \"ttiTime\": 6835.1500000000015\n    },\n    \"version\": \"1.14.1\"\n  },\n  {\n    \"href\": \"https://www.nau.ch/\",\n    \"ts\": 1763307989817,\n    \"title\": \"News für die Schweiz - Nau.ch\",\n    \"imgSrc\": \"/showcases/www_nau_ch_.jpeg\",\n    \"perf\": {\n      \"score\": 0.47,\n      \"inpMs\": 129,\n      \"clsScore\": 0.51,\n      \"ttfbMs\": 262,\n      \"fcpDisplay\": \"5.1 s\",\n      \"fcpScore\": 0.08,\n      \"lcpDisplay\": \"11.0 s\",\n      \"lcpScore\": 0,\n      \"ttiDisplay\": \"15.0 s\",\n      \"ttiScore\": 0.07,\n      \"ttiTime\": 15049.319363454902\n    },\n    \"version\": \"1.16.1\"\n  },\n  {\n    \"href\": \"https://www.sport-thieme.de/\",\n    \"ts\": 1763319871552,\n    \"title\": \"Sport, Fitness, Therapie: Sportgeräte von Sport-Thieme\",\n    \"imgSrc\": \"/showcases/www_sport-thieme_de_.jpeg\",\n    \"perf\": {\n      \"score\": 0.67,\n      \"inpMs\": 167,\n      \"clsScore\": 0.39,\n      \"ttfbMs\": 886,\n      \"fcpDisplay\": \"2.5 s\",\n      \"fcpScore\": 0.66,\n      \"lcpDisplay\": \"4.7 s\",\n      \"lcpScore\": 0.33,\n      \"ttiDisplay\": \"14.7 s\",\n      \"ttiScore\": 0.08,\n      \"ttiTime\": 14670.339378955397\n    },\n    \"version\": \"1.17.1\"\n  }\n]\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/showcase/index.tsx",
    "content": "import { component$, useStyles$ } from '@builder.io/qwik';\nimport type { DocumentHead } from '@builder.io/qwik-city';\nimport pages from './generated-pages.json';\nimport styles from './styles.css?inline';\n\nexport interface MediaEntry {\n  title: string;\n  href: string;\n  imgSrc: string;\n  size: 'small' | 'large';\n  perf: {\n    score: number;\n    inpMs: number;\n    clsScore: number;\n    ttfbMs: number;\n    fcpDisplay: string;\n    fcpScore: number;\n    lcpDisplay: string;\n    lcpScore: number;\n    ttiDisplay: string;\n    ttiScore: number;\n    ttiTime: number;\n  };\n}\n\nexport default component$(() => {\n  useStyles$(styles);\n  pages.sort(() => (Math.random() > 0.5 ? 1 : -1));\n  const greatSites = pages.filter((site) => site.perf.score >= 0.9);\n  const runnerUpSites = pages.filter((site) => site.perf.score >= 0.8 && site.perf.score < 0.9);\n  return (\n    <article class=\"showcase\">\n      <h1>Showcase</h1>\n\n      <ul class=\"grid\">\n        {greatSites.map((entry) => (\n          <SiteLink entry={entry as any} key={entry.href} />\n        ))}\n      </ul>\n      <h1>Honorable Mentions</h1>\n\n      <ul class=\"grid\">\n        {runnerUpSites.map((entry) => (\n          <SiteLink entry={entry as any} key={entry.href} />\n        ))}\n      </ul>\n      <section>\n        <h2>How are the scores calculated?</h2>\n        <p>\n          The scores are calculated using the{' '}\n          <a href=\"https://developers.google.com/speed/docs/insights/v5/get-started\">\n            PageSpeed Insights API\n          </a>\n          , analyzed with the{' '}\n          <a href=\"https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed#strategy\">\n            MOBILE strategy\n          </a>\n          .\n        </p>\n      </section>\n    </article>\n  );\n});\n\nexport const SiteLink = component$((props: { entry: MediaEntry }) => {\n  const { size, href, imgSrc, perf, title } = props.entry;\n  return (\n    <li class={size}>\n      <Score speedScore={perf.score} url={href}></Score>\n      <a class=\"card\" href={href} target=\"_blank\" rel=\"nofollow noreferrer\">\n        <img width=\"1440\" height=\"980\" loading=\"lazy\" src={imgSrc} aria-hidden=\"true\" />\n        <div class=\"backdrop\">\n          <div class=\"metrics\">\n            {perf.inpMs ? (\n              <div\n                style={{\n                  '--color': getLighthouseColorForMs(perf.inpMs, 200, 500),\n                }}\n              >\n                <h3>INP</h3>\n                <p>{perf.inpMs}ms</p>\n              </div>\n            ) : (\n              <div\n                style={{\n                  '--color': getLighthouseColorForScore(perf.ttiScore),\n                }}\n              >\n                <h3>TTI</h3>\n                <p>{perf.ttiDisplay}</p>\n              </div>\n            )}\n            {perf.lcpDisplay ? (\n              <div\n                style={{\n                  '--color': getLighthouseColorForScore(perf.lcpScore),\n                }}\n              >\n                <h3>LCP</h3>\n                <p>{perf.lcpDisplay}</p>\n              </div>\n            ) : (\n              <div\n                style={{\n                  '--color': getLighthouseColorForScore(perf.fcpScore),\n                }}\n              >\n                <h3>FCP</h3>\n                <p>{perf.fcpDisplay}</p>\n              </div>\n            )}\n            {perf.clsScore != null && (\n              <div\n                style={{\n                  '--color': getLighthouseColorForCls(perf.clsScore),\n                }}\n              >\n                <h3>CLS</h3>\n                <p>{perf.clsScore}</p>\n              </div>\n            )}\n            {perf.ttfbMs && (\n              <div\n                style={{\n                  '--color': getLighthouseColorForMs(perf.ttfbMs, 800, 1800),\n                }}\n              >\n                <h3>TTFB</h3>\n                <p>{perf.ttfbMs}ms</p>\n              </div>\n            )}\n          </div>\n          <p class=\"title\">{title}</p>\n        </div>\n      </a>\n    </li>\n  );\n});\n\nexport const Score = ({ speedScore, url }: { speedScore: number; url: string }) => {\n  return (\n    <a\n      class=\"score\"\n      style={{\n        '--color': getLighthouseColorForScore(speedScore),\n      }}\n      title=\"Mobile perf score from PageSpeed Insights\"\n      target=\"_blank\"\n      rel=\"noreferrer\"\n      href={getPagespeedInsightsUrl(url)}\n    >\n      <div class=\"score-inner\">\n        <svg viewBox=\"0 0 120 120\">\n          <circle class=\"circle-1\" r=\"56\" cx=\"60\" cy=\"60\" stroke-width=\"8\"></circle>\n          <circle\n            r=\"56\"\n            cx=\"60\"\n            cy=\"60\"\n            stroke-width=\"8\"\n            class=\"circle-2\"\n            style={{\n              transform: `rotate(-87.9537deg)`,\n              strokeDasharray: `${(speedScore * 350).toFixed(2)} 1000`,\n            }}\n          ></circle>\n        </svg>\n        <div class=\"score-text\">{Math.round(speedScore * 100)}</div>\n      </div>\n    </a>\n  );\n};\n\nconst lighthouseRed = '#f33';\nconst lighthouseOrange = '#ffaa32';\nconst lighthouseGreen = '#0c6';\n\nfunction getLighthouseColorForScore(score: number) {\n  return score < 0.5 ? lighthouseRed : score < 0.9 ? lighthouseOrange : lighthouseGreen;\n}\nfunction getLighthouseColorForMs(ms: number, goodMs: number, badMs: number) {\n  return ms < goodMs ? lighthouseGreen : ms < badMs ? lighthouseOrange : lighthouseRed;\n}\nfunction getLighthouseColorForCls(cls: number) {\n  return cls < 0.1 ? lighthouseGreen : cls < 0.25 ? lighthouseOrange : lighthouseRed;\n}\nfunction getPagespeedInsightsUrl(url: string) {\n  return `https://pagespeed.web.dev/report?url=${encodeURIComponent(url)}`;\n}\n\nexport const head: DocumentHead = {\n  title: 'Qwik Sites Showcase',\n};\n"
  },
  {
    "path": "packages/docs/src/routes/(ecosystem)/showcase/styles.css",
    "content": ".showcase {\n  margin: 10px auto;\n  padding: 0 30px;\n  max-width: 1060px;\n}\n\n.showcase h1 {\n  font-size: 60px;\n  font-weight: 800;\n  text-align: center;\n  margin-bottom: 70px;\n}\n\n.showcase .grid {\n  grid-template-columns: repeat(1, minmax(0, 1fr));\n  grid-auto-flow: row dense;\n  display: grid;\n  gap: 30px;\n}\n\n@media (min-width: 600px) {\n  .showcase .grid {\n    grid-template-columns: repeat(2, 1fr);\n  }\n\n  .showcase li.large {\n    grid-column: span 2;\n    grid-row: span 2;\n  }\n}\n\n@media (min-width: 900px) {\n  .showcase .grid {\n    grid-template-columns: repeat(3, 1fr);\n  }\n}\n\n.showcase li {\n  display: block;\n  position: relative;\n}\n.showcase .card {\n  position: relative;\n  border-radius: 11px;\n  overflow: hidden;\n  display: block;\n  --tw-ring-offset-shadow: 0 0 #0000;\n  --tw-ring-shadow: 0 0 #0000;\n  --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n  --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n  box-shadow:\n    var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.showcase li .canvas {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\n.showcase li .backdrop {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  background: rgba(0, 0, 0, 0.8);\n  opacity: 0;\n  transition: opacity 0.2s ease-in-out;\n  pointer-events: none;\n}\n\n.showcase li:hover .backdrop {\n  opacity: 1;\n}\n\n.showcase li .title {\n  opacity: 1;\n  position: absolute;\n  bottom: 0;\n  padding: 10px;\n  width: 100%;\n  height: 60px;\n  background: black;\n  color: white;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  text-align: center;\n}\n\n.showcase .score {\n  margin-top: 10px;\n  padding: 15px;\n  display: flex;\n  flex-direction: column;\n  text-align: center;\n  font-size: 34px;\n  color: var(--color);\n\n  --color: #0c6;\n  position: absolute;\n  right: -56px;\n  top: -56px;\n  background: #ffffffdb;\n  border-radius: 100%;\n  backdrop-filter: blur(4px) saturate(6.5);\n  transition: scale 0.2s ease-in-out;\n  scale: 0.5;\n  z-index: 10;\n}\n\n.showcase .score:hover {\n  background: #ffffff;\n  scale: 0.6;\n}\n\n.showcase .score-inner {\n  position: relative;\n  margin: auto;\n  width: 100px;\n}\n\n.showcase .score-text {\n  position: absolute;\n  top: 30px;\n  font-weight: bold;\n  text-align: center;\n  width: 100%;\n  left: 0;\n  font-size: 30px;\n}\n\n.showcase .metrics {\n  color: white;\n  font-size: 26px;\n  font-weight: 900;\n  display: flex;\n  gap: 20px;\n  justify-content: center;\n  align-items: center;\n  margin-top: 50px;\n}\n\n.showcase .metrics > div {\n  text-align: center;\n  color: var(--color);\n}\n\n.showcase .metrics p {\n  font-size: 20px;\n  font-weight: 400;\n}\n\n.showcase .metrics > div {\n  display: block;\n}\n\n.circle-1 {\n  opacity: 0.1;\n  fill: var(--color);\n  stroke: var(--color);\n}\n\n.circle-2 {\n  fill: none;\n  transform-origin: 50% 50%;\n  animation: load-gauge 1s ease forwards;\n  animation-delay: 250ms;\n  stroke-linecap: round;\n  stroke: var(--color);\n}\n\n.showcase section a {\n  font-weight: 400;\n  display: inline-block;\n  padding: 12px 0;\n  color: var(--qwik-dark-blue);\n}\n\n.showcase section a:hover {\n  text-decoration: underline;\n}\n.showcase section {\n  margin: 40px 0;\n}\n\n.showcase h2 {\n  font-size: 24px;\n  font-weight: bold;\n  margin: 0 0 15px 0;\n  padding: 0 0 5px 0;\n  border-bottom: 1px solid #ddd;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/404/index.tsx",
    "content": "import _404 from '../404';\nexport default _404;\n"
  },
  {
    "path": "packages/docs/src/routes/404.css",
    "content": ".c3fbp0c {\n  display: flex;\n  flex-direction: column;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  margin-top: 0px;\n  padding-left: 20px;\n  padding-right: 20px;\n  padding-top: 200px;\n  padding-bottom: 166px;\n  width: 100vw;\n  margin-left: calc(50% - 50vw);\n  background-color: rgba(21, 25, 52, 1);\n  height: 100vh;\n  overflow: hidden;\n}\n.c8o0ofp {\n  display: flex;\n  flex-direction: column;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  margin-top: 0px;\n  padding-left: 20px;\n  padding-right: 20px;\n  padding-top: 200px;\n  padding-bottom: 166px;\n  width: 100%;\n  margin-left: auto;\n  background-color: rgba(21, 25, 52, 1);\n  height: 100vh;\n  overflow: hidden;\n  align-self: stretch;\n  flex-grow: 1;\n  max-width: 1200px;\n  align-items: stretch;\n  margin-right: auto;\n}\n.ch99mph {\n  display: flex;\n  flex-direction: column;\n  position: absolute;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  margin-top: 0px;\n  bottom: -155px;\n  left: 10vw;\n  z-index: 1;\n  pointer-events: none;\n}\n.coxpa3x {\n  display: flex;\n  flex-direction: column;\n  position: absolute;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  margin-top: 0px;\n  top: 0;\n  bottom: 0px;\n  right: 0;\n  z-index: 1;\n  pointer-events: none;\n}\n.c88ivna {\n  display: flex;\n  flex-direction: column;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  margin-top: 0px;\n  height: auto;\n  padding-bottom: 0px;\n  margin-bottom: auto;\n  z-index: 2;\n}\n.cpcp8ob {\n  display: flex;\n  flex-direction: row;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  justify-content: center;\n  align-items: center;\n  gap: 31px;\n}\n.cq8sxte {\n  display: flex;\n  flex-direction: column;\n  align-items: stretch;\n  flex-shrink: 0;\n  position: relative;\n  margin-top: 32px;\n  text-align: center;\n  line-height: 36px;\n  height: auto;\n  font-size: 24px;\n  font-family: 'Poppins', sans-serif;\n  letter-spacing: -0.03em;\n  max-width: 400px;\n  margin-left: auto;\n  margin-right: auto;\n  color: rgba(255, 255, 255, 1);\n}\n.cdd0lhi {\n  display: flex;\n  flex-direction: column;\n  align-items: stretch;\n  flex-shrink: 0;\n  position: relative;\n  margin-top: 32px;\n  text-align: center;\n  line-height: 28px;\n  height: auto;\n  font-size: 18px;\n  font-family: 'Poppins', sans-serif;\n  letter-spacing: -0.03em;\n  max-width: 400px;\n  margin-left: auto;\n  margin-right: auto;\n  color: rgba(255, 255, 255, 1);\n}\n.cxoynd0 {\n  display: flex;\n  flex-direction: row;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  margin-top: 45px;\n  padding-bottom: 0px;\n  margin-left: auto;\n  margin-right: auto;\n  gap: 30px;\n}\n.c7vsibe {\n  display: flex;\n  flex-direction: column;\n  align-items: stretch;\n  flex-shrink: 0;\n  position: relative;\n  text-align: center;\n  line-height: 20rem;\n  height: auto;\n  font-size: 20rem;\n  font-family: 'Poppins', sans-serif;\n  font-weight: 800;\n  max-width: 620px;\n  color: rgba(255, 255, 255, 1);\n}\n.cv7i9m5 {\n  display: flex;\n  flex-direction: column;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  width: 240px;\n  height: 240px;\n  border-radius: 200px;\n  overflow: hidden;\n  border-style: solid;\n  border-width: 8px;\n  border-color: #ab7df2;\n  background-color: #ab7df2;\n}\n.creulwa {\n  display: flex;\n  flex-direction: column;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  appearance: none;\n  padding-top: 14px;\n  padding-bottom: 14px;\n  padding-left: 25px;\n  padding-right: 25px;\n  color: rgba(255, 255, 255, 1);\n  border-radius: 8px;\n  text-align: center;\n  cursor: pointer;\n  width: auto;\n  align-self: center;\n  border-color: rgba(1, 185, 255, 1);\n  font-family: 'Poppins', sans-serif;\n  font-size: 16px;\n  background-color: rgba(24, 182, 246, 1);\n  font-weight: 500;\n  line-height: 24px;\n}\n.c5p6san {\n  display: flex;\n  flex-direction: column;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  appearance: none;\n  padding-top: 14px;\n  padding-bottom: 14px;\n  padding-left: 25px;\n  padding-right: 25px;\n  color: rgba(255, 255, 255, 1);\n  border-radius: 8px;\n  text-align: center;\n  cursor: pointer;\n  width: auto;\n  align-self: center;\n  border-color: #ab7df2;\n  font-family: 'Poppins', sans-serif;\n  font-size: 16px;\n  background-color: #ab7df2;\n  font-weight: 500;\n  line-height: 24px;\n  border-width: 1px;\n}\n.crjn1wl {\n  display: flex;\n  flex-direction: column;\n  position: relative;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  width: 100%;\n  min-height: 20px;\n  min-width: 20px;\n  max-width: 240px;\n  height: 240px;\n}\n.cll733z {\n  position: relative;\n}\n.cd2p4ty {\n  width: 100%;\n  height: 240px;\n  object-fit: cover;\n  object-position: center;\n  border-radius: 1;\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  min-height: 20px;\n  min-width: 20px;\n  max-width: 240px;\n}\n.c4vjsfu {\n  width: 100%;\n  padding-top: 100%;\n  pointer-events: none;\n  font-size: 0;\n}\n@media (max-width: 640px) {\n  .c3fbp0c {\n    padding-top: 250px;\n    padding-bottom: 29px;\n  }\n}\n@media (max-width: 640px) {\n  .c8o0ofp {\n    padding-top: 250px;\n    padding-bottom: 29px;\n  }\n}\n@media (max-width: 991px) {\n  .ch99mph {\n    left: -200px;\n  }\n}\n@media (max-width: 991px) {\n  .coxpa3x {\n    right: -200px;\n  }\n}\n@media (max-width: 640px) {\n  .coxpa3x {\n    z-index: 1;\n  }\n}\n@media (max-width: 991px) {\n  .c88ivna {\n    margin-top: 20px;\n  }\n}\n@media (max-width: 640px) {\n  .c88ivna {\n    z-index: 2;\n  }\n}\n@media (max-width: 640px) {\n  .cpcp8ob {\n    gap: 0px;\n  }\n}\n@media (max-width: 991px) {\n  .cq8sxte {\n    text-align: center;\n    margin-left: auto;\n    margin-right: auto;\n  }\n}\n@media (max-width: 640px) {\n  .cq8sxte {\n    line-height: normal;\n    font-size: 18px;\n    margin-top: 20px;\n    text-align: center;\n    max-width: 300px;\n  }\n}\n@media (max-width: 991px) {\n  .cdd0lhi {\n    text-align: center;\n    margin-left: auto;\n    margin-right: auto;\n  }\n}\n@media (max-width: 640px) {\n  .cdd0lhi {\n    line-height: normal;\n    font-size: 18px;\n    margin-top: 20px;\n    text-align: center;\n    max-width: 300px;\n  }\n}\n@media (max-width: 991px) {\n  .cxoynd0 {\n    justify-content: flex-start;\n    margin-left: auto;\n    margin-right: auto;\n  }\n}\n@media (max-width: 640px) {\n  .cxoynd0 {\n    display: flex;\n    flex-direction: column;\n    align-items: stretch;\n    padding-bottom: 0px;\n    margin-top: 20px;\n  }\n}\n@media (max-width: 991px) {\n  .c7vsibe {\n    font-size: 15rem;\n    text-align: center;\n    max-width: 400px;\n    margin-left: auto;\n    margin-right: auto;\n    line-height: 15rem;\n  }\n}\n@media (max-width: 640px) {\n  .c7vsibe {\n    font-size: 7rem;\n    line-height: 1.3000000000000003em;\n    text-align: center;\n    max-width: 300px;\n  }\n}\n@media (max-width: 640px) {\n  .cv7i9m5 {\n    height: 120px;\n    width: 120px;\n  }\n}\n@media (max-width: 640px) {\n  .creulwa {\n    margin-left: 0px;\n    width: 100%;\n  }\n}\n@media (max-width: 640px) {\n  .c5p6san {\n    margin-left: 0px;\n    width: 100%;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/routes/404.tsx",
    "content": "import { component$, useStyles$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\n\nimport { Header } from '../components/header/header';\nimport catVideo from '../media/images/404-cat.mp4?url';\n\nimport styles from './404.css?inline';\n\nexport default component$(() => {\n  useStyles$(styles);\n  return (\n    <div>\n      <Header />\n      <div class=\"c3fbp0c\">\n        <section class=\"c8o0ofp\">\n          <div class=\"ch99mph\">\n            <div>\n              <svg\n                width=\"1440\"\n                height=\"821\"\n                viewBox=\"0 0 1440 821\"\n                fill=\"none\"\n                xmlns=\"http://www.w3.org/2000/svg\"\n              >\n                <ellipse\n                  cx=\"657.051\"\n                  cy=\"410.5\"\n                  rx=\"842.051\"\n                  ry=\"410.5\"\n                  fill=\"url(#paint0_radial_1855_2477)\"\n                  fill-opacity=\"0.6\"\n                ></ellipse>\n                <defs>\n                  <radialGradient\n                    id=\"paint0_radial_1855_2477\"\n                    cx=\"0\"\n                    cy=\"0\"\n                    r=\"1\"\n                    gradientUnits=\"userSpaceOnUse\"\n                    gradientTransform=\"translate(657.051 410.5) rotate(90) scale(410.5 700.051)\"\n                  >\n                    <stop stop-color=\"#AC7FF4\"></stop>\n                    <stop offset=\"1\" stop-color=\"#151934\" stop-opacity=\"0\"></stop>\n                  </radialGradient>\n                </defs>\n              </svg>\n            </div>\n          </div>\n          <div class=\"coxpa3x\">\n            <div>\n              <svg\n                width=\"1440\"\n                height=\"1141\"\n                viewBox=\"0 0 1440 1141\"\n                fill=\"none\"\n                xmlns=\"http://www.w3.org/2000/svg\"\n              >\n                <ellipse\n                  cx=\"774.844\"\n                  cy=\"479.424\"\n                  rx=\"1054.64\"\n                  ry=\"658\"\n                  transform=\"rotate(-4.48315 774.844 479.424)\"\n                  fill=\"url(#paint0_radial_1855_2450)\"\n                  fill-opacity=\"0.5\"\n                ></ellipse>\n                <defs>\n                  <radialGradient\n                    id=\"paint0_radial_1855_2450\"\n                    cx=\"0\"\n                    cy=\"0\"\n                    r=\"1\"\n                    gradientUnits=\"userSpaceOnUse\"\n                    gradientTransform=\"translate(649.289 479.632) rotate(95) scale(758.222 1000)\"\n                  >\n                    <stop stop-color=\"#18B4F4\"></stop>\n                    <stop offset=\"0.632219\" stop-color=\"#2E3772\" stop-opacity=\"0\"></stop>\n                  </radialGradient>\n                </defs>\n              </svg>\n            </div>\n          </div>\n          <div class=\"c88ivna\">\n            <div class=\"cpcp8ob\">\n              <div class=\"c7vsibe\">\n                <div>\n                  <p>4</p>\n                </div>\n              </div>\n              <div class=\"cv7i9m5\">\n                <div class=\"crjn1wl\">\n                  <div class=\"cll733z\">\n                    <video autoplay muted playsInline loop class=\"cd2p4ty\">\n                      <source type=\"video/mp4\" src={catVideo} />\n                    </video>\n                    <div class=\"c4vjsfu\"></div>\n                  </div>\n                </div>\n              </div>\n              <div class=\"c7vsibe\">\n                <div>\n                  <p>4</p>\n                </div>\n              </div>\n            </div>\n            <div class=\"cq8sxte\">\n              <div>\n                <p>Well, this is awkward...</p>\n              </div>\n            </div>\n            <div class=\"cdd0lhi\">\n              <div>\n                <p>The page you're trying to view no longer exists or was moved.</p>\n              </div>\n            </div>\n            <div class=\"cxoynd0\">\n              <Link href=\"/\" target=\"_self\" class=\"creulwa\">\n                Go home\n              </Link>\n              <Link href=\"/docs/\" target=\"_self\" class=\"c5p6san\">\n                Explore the docs\n              </Link>\n            </div>\n          </div>\n        </section>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/api/api.css",
    "content": "@reference \"tailwindcss\";\n\n.docs.api h1:not(.overview) {\n  font-size: 2rem;\n}\n\n.docs.api h2 {\n  font-size: 1.25rem;\n  margin-top: 0;\n  width: 100%;\n}\n\n/* styling for sections on detail view */\n.docs.api h2:not(:not([id])) {\n  margin-top: 50px;\n  position: relative;\n  width: 100%;\n}\n.docs.api h2:not(:not([id])):not(:nth-of-type(1)) {\n  border-top: 1px solid #eee;\n  padding-top: 50px;\n}\n[data-theme=\"dark\"] .docs.api h2:not(:not([id])):not(:nth-of-type(1)) {\n  border-top: 1px solid #373737;\n}\n\n.docs.api article a {\n  text-decoration: underline;\n}\n\n.docs.api h1 a,\n.docs.api table a {\n  text-decoration: none;\n}\n\n.docs.api article a[href*=\"github.com\"] {\n  display: inline-block;\n  position: relative;\n  left: calc(100% - 115px);\n  border-radius: 4px;\n  @apply bg-slate-100;\n  border-radius: 4px;\n  padding: 4px 8px;\n  font-size: 0.8rem;\n  text-decoration: none;\n}\n\n[data-theme=\"dark\"] .docs.api article a[href*=\"github.com\"] {\n  background: #373737;\n}\n\n.docs.api table {\n  font-size: 0.8rem;\n  border-radius: 8px;\n  box-shadow: 0 0 30px 0 rgba(0,0,0,0.1);\n  margin-bottom: 20px;\n  overflow: hidden;\n  width: 100%;\n}\n[data-theme=\"dark\"] .docs.api table {\n  box-shadow: 0 0 30px 0 rgba(80,80,80,0.1);\n}\n.docs.api article thead tr {\n  background: #f6f6f6;\n  text-align: left;\n}\n.docs.api article thead tr p {\n  font-weight: bold;\n}\n[data-theme=\"dark\"] .docs.api thead tr {\n  background: #373737;\n}\n.docs.api thead th,\n.docs.api tbody tr td {\n  padding: 12px 24px;\n}\n.docs.api tbody tr:hover,\n.docs.api tbody tr:nth-child(even) {\n  background: #f6f6f6;\n}\n[data-theme=\"dark\"] .docs.api tbody tr:hover,\n[data-theme=\"dark\"] .docs.api tbody tr:nth-child(even) {\n  background: black;\n}\n\n.docs.api .docs-container {\n  margin: 10px auto;\n  padding: 80px 30px 0;\n  max-width: 1060px;\n  overflow: hidden;\n}\n\n.docs.api .section-title {\n  @apply bg-slate-100;\n  display: flex;\n  font-weight: 100;\n  font-size: 0.8rem;\n  border-radius: 4px;\n  position: relative;\n  margin-top: 0;\n  width: 100%;\n}\n[data-theme=\"dark\"] .docs.api .section-title {\n  background: #373737;\n}\n@media screen and (min-width: 768px) {\n  .docs.api .section-title {\n    font-size: 1rem;\n  }\n}\n.docs.api .section-title:before {\n  content: attr(data-icon);\n  display: inline-grid;\n  justify-content: center;\n  align-content: center;\n  background: var(--qwik-blue);\n  border-radius: 4px 0 0 4px;\n  padding: 8px 0;\n  color: white;\n  min-width: 40px;\n  font-weight: 400;\n}\n.docs.api .section-title span {\n  padding: 8px;\n  display: inline-block;\n}\n@media screen and (min-width: 768px) {\n  .docs.api .section-title span {\n    padding: 8px 16px;\n  }\n}\n\n.docs.api h3 {\n  font-size: 1rem;\n  margin-top: 0;\n}\n\n.docs.api a {\n    display: inline-block;\n    color: black;\n    text-decoration: none;\n}\n[data-theme=\"dark\"] .docs.api a {\n    color: inherit;\n}\n\n.docs.api a {\n  display: inline-block;\n  color: black;\n  text-decoration: none;\n}\n[data-theme=\"dark\"] .docs.api a {\n  color: inherit;\n}\n\n.docs.api ul {\n  margin: 0;\n}\n\n.docs.api ul li.api-item {\n  padding: 0;\n}\n\n.api-detail-section {\n  padding: 50px 0;\n  border-bottom: 1px solid #eee;\n  position: relative;\n}\n[data-theme=\"dark\"] .api-detail-section {\n  border-bottom: 1px solid #373737;\n}\n\n.docs.api .api-edit {\n  position: absolute;\n  top: 50px;\n  right: 0;\n  margin: 0px;\n}\n.docs.api .api-edit a {\n  font-size: 0.8rem;\n  background: #eee;\n  border-radius: 4px;\n  padding: 4px 8px;\n}\n[data-theme=\"dark\"] .docs.api .api-edit a {\n  background: #373737;\n}\n\n.docs.api .filter-item {\n  @apply bg-slate-100;\n  line-height: 2;\n}\n[data-theme=\"dark\"] .docs.api .filter-item {\n  background: #373737;\n}\n@media screen and (min-width: 768px) {\n  .docs.api .filter-item {\n    line-height: 1.5;\n  }\n}\n.docs.api .filter-item[data-kind-label]:before {\n  border-radius: 4px 0 0 4px;\n}\n.docs.api .filter-item[data-kind-label]:not(.active):before {\n  background: #bbb;\n  color: #444;\n}\n\n.docs.api [data-kind-label]:before {\n  border-radius: 4px;\n  color: white;\n  display: inline-block;\n  margin-right: 8px;\n  text-align: center;\n  min-width: 32px; /* ensure the label is always the same width on the overview */\n  padding: 2px 10px;\n}\n\n.docs.api [data-kind-label=\"V\"]:before {\n  content: 'V';\n  background: var(--qwik-purple);\n}\n.docs.api [data-kind-label=\"P\"]:before {\n  content: 'P';\n  background: var(--qwik-blue);\n}\n.docs.api [data-kind-label=\"I\"]:before {\n    content: 'I';\n    background: var(--qwik-dark-blue);\n}\n.docs.api [data-kind-label=\"T\"]:before {\n    content: 'T';\n    background: var(--qwik-dark-purple);\n}\n.docs.api [data-kind-label=\"M\"]:before {\n    content: 'M';\n    background: #c3ba4c;\n}\n.docs.api [data-kind-label=\"F\"]:before {\n    content: 'F';\n    background: #5bc0de;\n}\n.docs.api [data-kind-label=\"N\"]:before {\n    content: 'N';\n    background: #5cb85c;\n}\n.docs.api .table-wrapper {\n  overflow-x: auto;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/api/index.tsx",
    "content": "import { $, component$, useOn, useSignal, useStore, useTask$, isBrowser } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\nimport { toSnakeCase } from '../../utils/utils';\n\n// TODO: load the content of these files using fs instead of importing them\nimport qwikCityMiddlewareAzureSwaApiData from './qwik-city-middleware-azure-swa/api.json';\nimport qwikCityMiddlewareCloudflarePagesApiData from './qwik-city-middleware-cloudflare-pages/api.json';\nimport qwikCityMiddlewareFirebaseApiData from './qwik-city-middleware-firebase/api.json';\nimport qwikCityMiddlewareNetlifyEdgeApiData from './qwik-city-middleware-netlify-edge/api.json';\nimport qwikCityMiddlewareNodeApiData from './qwik-city-middleware-node/api.json';\nimport qwikCityMiddlewareRequestHandlerApiData from './qwik-city-middleware-request-handler/api.json';\nimport qwikCityMiddlewareVercelEdgeApiData from './qwik-city-middleware-vercel-edge/api.json';\nimport qwikCityStaticApiData from './qwik-city-static/api.json';\nimport qwikCityViteAzureSwaApiData from './qwik-city-vite-azure-swa/api.json';\nimport qwikCityViteCloudRunApiData from './qwik-city-vite-cloud-run/api.json';\nimport qwikCityViteCloudflarePagesApiData from './qwik-city-vite-cloudflare-pages/api.json';\nimport qwikCityViteNetlifyEdgeApiData from './qwik-city-vite-netlify-edge/api.json';\nimport qwikCityViteNodeServerApiData from './qwik-city-vite-node-server/api.json';\nimport qwikCityViteStaticApiData from './qwik-city-vite-static/api.json';\nimport qwikCityViteVercelApiData from './qwik-city-vite-vercel/api.json';\nimport qwikCityApiData from './qwik-city/api.json';\nimport qwikOptimizerApiData from './qwik-optimizer/api.json';\nimport qwikServerApiData from './qwik-server/api.json';\nimport qwikTestingApiData from './qwik-testing/api.json';\nimport qwikApiData from './qwik/api.json';\n\nconst _KINDS = new Set<string>();\n\nconst apiData = {\n  qwik: qwikApiData,\n  'qwik-city': qwikCityApiData,\n  'qwik-city-middleware-azure-swa': qwikCityMiddlewareAzureSwaApiData,\n  'qwik-city-middleware-cloudflare-pages': qwikCityMiddlewareCloudflarePagesApiData,\n  'qwik-city-middleware-netlify-edge': qwikCityMiddlewareNetlifyEdgeApiData,\n  'qwik-city-middleware-node': qwikCityMiddlewareNodeApiData,\n  'qwik-city-middleware-request-handler': qwikCityMiddlewareRequestHandlerApiData,\n  'qwik-city-middleware-vercel-edge': qwikCityMiddlewareVercelEdgeApiData,\n  'qwik-city-middleware-firebase': qwikCityMiddlewareFirebaseApiData,\n  'qwik-city-static': qwikCityStaticApiData,\n  'qwik-city-vite-azure-swa': qwikCityViteAzureSwaApiData,\n  'qwik-city-vite-cloud-run': qwikCityViteCloudRunApiData,\n  'qwik-city-vite-cloudflare-pages': qwikCityViteCloudflarePagesApiData,\n  'qwik-city-vite-node-server': qwikCityViteNodeServerApiData,\n  'qwik-city-vite-netlify-edge': qwikCityViteNetlifyEdgeApiData,\n  'qwik-city-vite-static': qwikCityViteStaticApiData,\n  'qwik-city-vite-vercel': qwikCityViteVercelApiData,\n  'qwik-optimizer': qwikOptimizerApiData,\n  'qwik-server': qwikServerApiData,\n  'qwik-testing': qwikTestingApiData,\n};\n\nconst getUniqueKinds = () => {\n  if (_KINDS.size) {\n    return _KINDS;\n  }\n\n  apiData['qwik'].members.forEach((member) => _KINDS.add(toSnakeCase(member.kind)));\n  return _KINDS;\n};\n\nconst getInitialFilterState = () => {\n  return (\n    Array.from(getUniqueKinds()).reduce((acc: any, kind) => {\n      if (typeof kind !== 'string') {\n        return acc;\n      }\n      acc[kind] = true;\n      return acc;\n    }, {}) || {}\n  );\n};\n\nexport default component$(() => {\n  const filters = useStore(getInitialFilterState());\n\n  return (\n    <>\n      <h1 class=\"overview\">API Reference</h1>\n\n      <h2>Filters</h2>\n      <div class=\"grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 mb-10\">\n        {Array.from(getUniqueKinds()).map((kind) => (\n          <button\n            key={`filter-${kind}`}\n            onClick$={() => {\n              filters[kind] = !filters[kind];\n            }}\n            class={`filter-item block text-sm rounded-md text-left ${\n              filters[kind] ? 'active' : ''\n            }`}\n            data-kind-label={kind.substring(0, 1).toUpperCase()}\n          >\n            {kind.split('-').join(' ')}\n          </button>\n        ))}\n      </div>\n\n      <h2>References</h2>\n      {Object.keys(apiData).map((key) => (\n        <ApiMemberWrapper key={`api-member-wrapper-${apiData[key as keyof typeof apiData].id}`} id={apiData[key as keyof typeof apiData].id} data={apiData[key as keyof typeof apiData]} filters={filters} />\n      ))}\n    </>\n  );\n});\n\nexport const ApiMemberWrapper = component$(({ id, data, filters }: any) => {\n  const isCollapsed = useSignal(true);\n\n  useTask$(({track}) => {\n    track(filters);\n    if (isBrowser) {\n      isCollapsed.value = false;\n    }\n  });\n\n  // TODO: find a solution to get this work\n  useOn('beforematch', $(() => {\n    isCollapsed.value = false;\n  }));\n\n  if(!data.members.length) {\n    return null;\n  }\n\n  return (\n    <div class={`section ${isCollapsed.value}`}>\n      <h2\n        data-icon={isCollapsed.value ? '→' : '↓'}\n        class=\"section-title cursor-pointer\"\n        onClick$={(e) => isCollapsed.value = !isCollapsed.value }\n      >\n        <span>{data.id}</span>\n      </h2>\n      <div hidden={isCollapsed.value ? 'until-found' : false}>\n        <ApiMemberList id={id} data={data} filters={filters} />\n      </div>\n    </div>\n  );\n});\n\n\nexport const ApiMemberList = component$(({ id, data, filters }: any) => {\n  const nameCounts = data.members.reduce((acc: Record<string, number>, m: any) => {\n    if (m.name) {\n      const normalizedName = m.name.toLowerCase();\n      acc[normalizedName] = (acc[normalizedName] || 0) + 1;\n    }\n    return acc;\n  }, {});\n  return (\n    <ul class=\"grid sm:grid-cols-2 lg:grid-cols-3 pb-5\">\n      {data.members.map((member: any) => {\n        const kind = toSnakeCase(member.kind);\n\n        if (!member.name) {\n          return;\n        }\n      \n        const name = member.name.toLowerCase()\n            .replace(/[$]/g, '_')\n            .replace(/[^a-zA-Z0-9_]/g, '')\n            .replace(/ /g, '-');\n\n        const anchorId = nameCounts[member.name.toLowerCase()] > 1 \n            ? `${name}-${kind}`\n            : name;\n\n        return (\n          <li\n            key={`${id}-member-${member.id}-${kind}`}\n            data-kind={kind}\n            data-kind-label={kind.substring(0, 1).toUpperCase()}\n            class={`api-item list-none text-xs ${\n              (kind in filters && !filters[kind] && 'hidden') || ''\n            }`}\n          >\n            <Link href={`${data.id}#${anchorId}`}>{member.name}</Link>\n          </li>\n        );\n      })}\n    </ul>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/api/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from '@builder.io/qwik'; \nimport { ContentNav } from '../../components/content-nav/content-nav';\nimport { Footer } from '../../components/footer/footer';\nimport { Header } from '../../components/header/header';\nimport apiStyles from './api.css?inline';\nimport docsStyles from '../docs/docs.css?inline';\n\nexport default component$(() => { \n  useStyles$(docsStyles);\n  useStyles$(apiStyles);\n\n  return (\n    <div class=\"docs api fixed-header\">\n      <Header />\n      <main>\n        <div class=\"docs-container\">\n          <article>\n            <Slot />\n          </article>\n          <ContentNav />\n          <Footer />\n        </div> \n      </main>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik/api.json",
    "content": "{\n  \"id\": \"qwik\",\n  \"package\": \"@builder.io/qwik\",\n  \"members\": [\n    {\n      \"name\": \"_qrlSync\",\n      \"id\": \"_qrlsync\",\n      \"hierarchy\": [\n        {\n          \"name\": \"_qrlSync\",\n          \"id\": \"_qrlsync\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\nExtract function into a synchronously loadable QRL.\\n\\nNOTE: Synchronous QRLs functions can't close over any variables, including exports.\\n\\n\\n```typescript\\n_qrlSync: <TYPE extends Function>(fn: TYPE, serializedFn?: string) => SyncQRL<TYPE>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nfn\\n\\n\\n</td><td>\\n\\nTYPE\\n\\n\\n</td><td>\\n\\nExtracted function\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nserializedFn\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ Serialized function in string form.\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[SyncQRL](#syncqrl)<!-- -->&lt;TYPE&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik._qrlsync.md\"\n    },\n    {\n      \"name\": \"\\\"q:slot\\\"\",\n      \"id\": \"componentbaseprops-_q_slot_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ComponentBaseProps\",\n          \"id\": \"componentbaseprops-_q_slot_\"\n        },\n        {\n          \"name\": \"\\\"q:slot\\\"\",\n          \"id\": \"componentbaseprops-_q_slot_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'q:slot'?: string;\\n```\",\n      \"mdFile\": \"qwik.componentbaseprops._q_slot_.md\"\n    },\n    {\n      \"name\": \"\\\"xlink:actuate\\\"\",\n      \"id\": \"svgattributes-_xlink_actuate_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xlink_actuate_\"\n        },\n        {\n          \"name\": \"\\\"xlink:actuate\\\"\",\n          \"id\": \"svgattributes-_xlink_actuate_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xlink:actuate'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xlink_actuate_.md\"\n    },\n    {\n      \"name\": \"\\\"xlink:arcrole\\\"\",\n      \"id\": \"svgattributes-_xlink_arcrole_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xlink_arcrole_\"\n        },\n        {\n          \"name\": \"\\\"xlink:arcrole\\\"\",\n          \"id\": \"svgattributes-_xlink_arcrole_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xlink:arcrole'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xlink_arcrole_.md\"\n    },\n    {\n      \"name\": \"\\\"xlink:href\\\"\",\n      \"id\": \"svgattributes-_xlink_href_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xlink_href_\"\n        },\n        {\n          \"name\": \"\\\"xlink:href\\\"\",\n          \"id\": \"svgattributes-_xlink_href_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xlink:href'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xlink_href_.md\"\n    },\n    {\n      \"name\": \"\\\"xlink:role\\\"\",\n      \"id\": \"svgattributes-_xlink_role_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xlink_role_\"\n        },\n        {\n          \"name\": \"\\\"xlink:role\\\"\",\n          \"id\": \"svgattributes-_xlink_role_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xlink:role'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xlink_role_.md\"\n    },\n    {\n      \"name\": \"\\\"xlink:show\\\"\",\n      \"id\": \"svgattributes-_xlink_show_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xlink_show_\"\n        },\n        {\n          \"name\": \"\\\"xlink:show\\\"\",\n          \"id\": \"svgattributes-_xlink_show_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xlink:show'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xlink_show_.md\"\n    },\n    {\n      \"name\": \"\\\"xlink:title\\\"\",\n      \"id\": \"svgattributes-_xlink_title_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xlink_title_\"\n        },\n        {\n          \"name\": \"\\\"xlink:title\\\"\",\n          \"id\": \"svgattributes-_xlink_title_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xlink:title'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xlink_title_.md\"\n    },\n    {\n      \"name\": \"\\\"xlink:type\\\"\",\n      \"id\": \"svgattributes-_xlink_type_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xlink_type_\"\n        },\n        {\n          \"name\": \"\\\"xlink:type\\\"\",\n          \"id\": \"svgattributes-_xlink_type_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xlink:type'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xlink_type_.md\"\n    },\n    {\n      \"name\": \"\\\"xml:base\\\"\",\n      \"id\": \"svgattributes-_xml_base_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xml_base_\"\n        },\n        {\n          \"name\": \"\\\"xml:base\\\"\",\n          \"id\": \"svgattributes-_xml_base_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xml:base'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xml_base_.md\"\n    },\n    {\n      \"name\": \"\\\"xml:lang\\\"\",\n      \"id\": \"svgattributes-_xml_lang_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xml_lang_\"\n        },\n        {\n          \"name\": \"\\\"xml:lang\\\"\",\n          \"id\": \"svgattributes-_xml_lang_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xml:lang'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xml_lang_.md\"\n    },\n    {\n      \"name\": \"\\\"xml:space\\\"\",\n      \"id\": \"svgattributes-_xml_space_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xml_space_\"\n        },\n        {\n          \"name\": \"\\\"xml:space\\\"\",\n          \"id\": \"svgattributes-_xml_space_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xml:space'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xml_space_.md\"\n    },\n    {\n      \"name\": \"\\\"xmlns:xlink\\\"\",\n      \"id\": \"svgattributes-_xmlns_xlink_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes-_xmlns_xlink_\"\n        },\n        {\n          \"name\": \"\\\"xmlns:xlink\\\"\",\n          \"id\": \"svgattributes-_xmlns_xlink_\"\n        }\n      ],\n      \"kind\": \"PropertySignature\",\n      \"content\": \"```typescript\\n'xmlns:xlink'?: string | undefined;\\n```\",\n      \"mdFile\": \"qwik.svgattributes._xmlns_xlink_.md\"\n    },\n    {\n      \"name\": \"$\",\n      \"id\": \"_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"$\",\n          \"id\": \"_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Qwik Optimizer marker function.\\n\\nUse `$(...)` to tell Qwik Optimizer to extract the expression in `$(...)` into a lazy-loadable resource referenced by `QRL`<!-- -->.\\n\\n\\n```typescript\\n$: <T>(expression: T) => QRL<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nexpression\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\nExpression which should be lazy loaded\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[QRL](#qrl)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik._.md\"\n    },\n    {\n      \"name\": \"AnchorHTMLAttributes\",\n      \"id\": \"anchorhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"AnchorHTMLAttributes\",\n          \"id\": \"anchorhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface AnchorHTMLAttributes<T extends Element> extends Attrs<'a', T> \\n```\\n**Extends:** Attrs&lt;'a', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.anchorhtmlattributes.md\"\n    },\n    {\n      \"name\": \"AreaHTMLAttributes\",\n      \"id\": \"areahtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"AreaHTMLAttributes\",\n          \"id\": \"areahtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface AreaHTMLAttributes<T extends Element> extends Attrs<'area', T> \\n```\\n**Extends:** Attrs&lt;'area', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.areahtmlattributes.md\"\n    },\n    {\n      \"name\": \"AriaAttributes\",\n      \"id\": \"ariaattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"AriaAttributes\",\n          \"id\": \"ariaattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"TS defines these with the React syntax which is not compatible with Qwik. E.g. `ariaAtomic` instead of `aria-atomic`<!-- -->.\\n\\n\\n```typescript\\nexport interface AriaAttributes \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[\\\"aria-activedescendant\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-atomic\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-autocomplete\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'none' \\\\| 'inline' \\\\| 'list' \\\\| 'both' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-busy\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-checked\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| 'false' \\\\| 'mixed' \\\\| 'true' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the current \\\"checked\\\" state of checkboxes, radio buttons, and other widgets.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-colcount\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the total number of columns in a table, grid, or treegrid.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-colindex\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-colspan\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-controls\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies the element (or elements) whose contents or presence are controlled by the current element.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-current\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| 'false' \\\\| 'true' \\\\| 'page' \\\\| 'step' \\\\| 'location' \\\\| 'date' \\\\| 'time' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the element that represents the current item within a container or set of related elements.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-describedby\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies the element (or elements) that describes the object.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-details\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies the element that provides a detailed, extended description for the object.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-disabled\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-dropeffect\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'none' \\\\| 'copy' \\\\| 'execute' \\\\| 'link' \\\\| 'move' \\\\| 'popup' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates what functions can be performed when a dragged object is released on the drop target.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-errormessage\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies the element that provides an error message for the object.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-expanded\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-flowto\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-grabbed\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates an element's \\\"grabbed\\\" state in a drag-and-drop operation.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-haspopup\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| 'false' \\\\| 'true' \\\\| 'menu' \\\\| 'listbox' \\\\| 'tree' \\\\| 'grid' \\\\| 'dialog' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-hidden\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates whether the element is exposed to an accessibility API.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-invalid\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| 'false' \\\\| 'true' \\\\| 'grammar' \\\\| 'spelling' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the entered value does not conform to the format expected by the application.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-keyshortcuts\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-label\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines a string value that labels the current element.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-labelledby\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies the element (or elements) that labels the current element.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-level\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the hierarchical level of an element within a structure.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-live\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'off' \\\\| 'assertive' \\\\| 'polite' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-modal\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates whether an element is modal when displayed.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-multiline\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates whether a text box accepts multiple lines of input or only a single line.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-multiselectable\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates that the user may select more than one item from the current selectable descendants.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-orientation\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'horizontal' \\\\| 'vertical' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-owns\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-placeholder\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-posinset\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-pressed\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| 'false' \\\\| 'mixed' \\\\| 'true' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the current \\\"pressed\\\" state of toggle buttons.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-readonly\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates that the element is not editable, but is otherwise operable.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-relevant\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'additions' \\\\| 'additions removals' \\\\| 'additions text' \\\\| 'all' \\\\| 'removals' \\\\| 'removals additions' \\\\| 'removals text' \\\\| 'text' \\\\| 'text additions' \\\\| 'text removals' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-required\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates that user input is required on the element before a form may be submitted.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-roledescription\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines a human-readable, author-localized description for the role of an element.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-rowcount\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the total number of rows in a table, grid, or treegrid.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-rowindex\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-rowspan\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-selected\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the current \\\"selected\\\" state of various widgets.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-setsize\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-sort\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'none' \\\\| 'ascending' \\\\| 'descending' \\\\| 'other' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates if items in a table or grid are sorted in ascending or descending order.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-valuemax\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the maximum allowed value for a range widget.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-valuemin\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the minimum allowed value for a range widget.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-valuenow\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the current value for a range widget.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"aria-valuetext\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the human readable text alternative of aria-valuenow for a range widget.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.ariaattributes.md\"\n    },\n    {\n      \"name\": \"AriaRole\",\n      \"id\": \"ariarole\",\n      \"hierarchy\": [\n        {\n          \"name\": \"AriaRole\",\n          \"id\": \"ariarole\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem' | (string & {});\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.ariarole.md\"\n    },\n    {\n      \"name\": \"AudioHTMLAttributes\",\n      \"id\": \"audiohtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"AudioHTMLAttributes\",\n          \"id\": \"audiohtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface AudioHTMLAttributes<T extends Element> extends Attrs<'audio', T> \\n```\\n**Extends:** Attrs&lt;'audio', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.audiohtmlattributes.md\"\n    },\n    {\n      \"name\": \"BaseHTMLAttributes\",\n      \"id\": \"basehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"BaseHTMLAttributes\",\n          \"id\": \"basehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface BaseHTMLAttributes<T extends Element> extends Attrs<'base', T> \\n```\\n**Extends:** Attrs&lt;'base', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.basehtmlattributes.md\"\n    },\n    {\n      \"name\": \"BlockquoteHTMLAttributes\",\n      \"id\": \"blockquotehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"BlockquoteHTMLAttributes\",\n          \"id\": \"blockquotehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface BlockquoteHTMLAttributes<T extends Element> extends Attrs<'blockquote', T> \\n```\\n**Extends:** Attrs&lt;'blockquote', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.blockquotehtmlattributes.md\"\n    },\n    {\n      \"name\": \"Booleanish\",\n      \"id\": \"booleanish\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Booleanish\",\n          \"id\": \"booleanish\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type Booleanish = boolean | `${boolean}`;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.booleanish.md\"\n    },\n    {\n      \"name\": \"ButtonHTMLAttributes\",\n      \"id\": \"buttonhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ButtonHTMLAttributes\",\n          \"id\": \"buttonhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ButtonHTMLAttributes<T extends Element> extends Attrs<'button', T> \\n```\\n**Extends:** Attrs&lt;'button', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.buttonhtmlattributes.md\"\n    },\n    {\n      \"name\": \"cache\",\n      \"id\": \"resourcectx-cache\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceCtx\",\n          \"id\": \"resourcectx-cache\"\n        },\n        {\n          \"name\": \"cache\",\n          \"id\": \"resourcectx-cache\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\ncache(policyOrMilliseconds: number | 'immutable'): void;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npolicyOrMilliseconds\\n\\n\\n</td><td>\\n\\nnumber \\\\| 'immutable'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"mdFile\": \"qwik.resourcectx.cache.md\"\n    },\n    {\n      \"name\": \"CanvasHTMLAttributes\",\n      \"id\": \"canvashtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CanvasHTMLAttributes\",\n          \"id\": \"canvashtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface CanvasHTMLAttributes<T extends Element> extends Attrs<'canvas', T> \\n```\\n**Extends:** Attrs&lt;'canvas', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.canvashtmlattributes.md\"\n    },\n    {\n      \"name\": \"ClassList\",\n      \"id\": \"classlist\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ClassList\",\n          \"id\": \"classlist\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"A class list can be a string, a boolean, an array, or an object.\\n\\nIf it's an array, each item is a class list and they are all added.\\n\\nIf it's an object, then the keys are class name strings, and the values are booleans that determine if the class name string should be added or not.\\n\\n\\n```typescript\\nexport type ClassList = string | undefined | null | false | Record<string, boolean | string | number | null | undefined> | ClassList[];\\n```\\n**References:** [ClassList](#classlist)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.classlist.md\"\n    },\n    {\n      \"name\": \"cleanup\",\n      \"id\": \"renderresult-cleanup\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderResult\",\n          \"id\": \"renderresult-cleanup\"\n        },\n        {\n          \"name\": \"cleanup\",\n          \"id\": \"renderresult-cleanup\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\ncleanup(): void;\\n```\\n**Returns:**\\n\\nvoid\",\n      \"mdFile\": \"qwik.renderresult.cleanup.md\"\n    },\n    {\n      \"name\": \"ColgroupHTMLAttributes\",\n      \"id\": \"colgrouphtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ColgroupHTMLAttributes\",\n          \"id\": \"colgrouphtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ColgroupHTMLAttributes<T extends Element> extends Attrs<'colgroup', T> \\n```\\n**Extends:** Attrs&lt;'colgroup', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.colgrouphtmlattributes.md\"\n    },\n    {\n      \"name\": \"ColHTMLAttributes\",\n      \"id\": \"colhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ColHTMLAttributes\",\n          \"id\": \"colhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ColHTMLAttributes<T extends Element> extends Attrs<'col', T> \\n```\\n**Extends:** Attrs&lt;'col', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.colhtmlattributes.md\"\n    },\n    {\n      \"name\": \"Component\",\n      \"id\": \"component\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Component\",\n          \"id\": \"component\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Type representing the Qwik component.\\n\\n`Component` is the type returned by invoking `component$`<!-- -->.\\n\\n```tsx\\ninterface MyComponentProps {\\n  someProp: string;\\n}\\nconst MyComponent: Component<MyComponentProps> = component$((props: MyComponentProps) => {\\n  return <span>{props.someProp}</span>;\\n});\\n```\\n\\n\\n```typescript\\nexport type Component<PROPS = unknown> = FunctionComponent<PublicProps<PROPS>>;\\n```\\n**References:** [FunctionComponent](#functioncomponent)<!-- -->, [PublicProps](#publicprops)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts\",\n      \"mdFile\": \"qwik.component.md\"\n    },\n    {\n      \"name\": \"component$\",\n      \"id\": \"component_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"component$\",\n          \"id\": \"component_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Declare a Qwik component that can be used to create UI.\\n\\nUse `component$` to declare a Qwik component. A Qwik component is a special kind of component that allows the Qwik framework to lazy load and execute the component independently of other Qwik components as well as lazy load the component's life-cycle hooks and event handlers.\\n\\nSide note: You can also declare regular (standard JSX) components that will have standard synchronous behavior.\\n\\nQwik component is a facade that describes how the component should be used without forcing the implementation of the component to be eagerly loaded. A minimum Qwik definition consists of:\\n\\n\\\\#\\\\#\\\\# Example\\n\\nAn example showing how to create a counter component:\\n\\n```tsx\\nexport interface CounterProps {\\n  initialValue?: number;\\n  step?: number;\\n}\\nexport const Counter = component$((props: CounterProps) => {\\n  const state = useStore({ count: props.initialValue || 0 });\\n  return (\\n    <div>\\n      <span>{state.count}</span>\\n      <button onClick$={() => (state.count += props.step || 1)}>+</button>\\n    </div>\\n  );\\n});\\n```\\n- `component$` is how a component gets declared. - `{ value?: number; step?: number }` declares the public (props) interface of the component. - `{ count: number }` declares the private (state) interface of the component.\\n\\nThe above can then be used like so:\\n\\n```tsx\\nexport const OtherComponent = component$(() => {\\n  return <Counter initialValue={100} />;\\n});\\n```\\nSee also: `component`<!-- -->, `useCleanup`<!-- -->, `onResume`<!-- -->, `onPause`<!-- -->, `useOn`<!-- -->, `useOnDocument`<!-- -->, `useOnWindow`<!-- -->, `useStyles`\\n\\n\\n```typescript\\ncomponent$: <PROPS = unknown>(onMount: OnRenderFn<PROPS>) => Component<PROPS>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nonMount\\n\\n\\n</td><td>\\n\\n[OnRenderFn](#onrenderfn)<!-- -->&lt;PROPS&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[Component](#component)<!-- -->&lt;PROPS&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts\",\n      \"mdFile\": \"qwik.component_.md\"\n    },\n    {\n      \"name\": \"ComponentBaseProps\",\n      \"id\": \"componentbaseprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ComponentBaseProps\",\n          \"id\": \"componentbaseprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ComponentBaseProps \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[\\\"q:slot\\\"?](#componentbaseprops-_q_slot_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[key?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| null \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.componentbaseprops.md\"\n    },\n    {\n      \"name\": \"componentQrl\",\n      \"id\": \"componentqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"componentQrl\",\n          \"id\": \"componentqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Declare a Qwik component that can be used to create UI.\\n\\nUse `component$` to declare a Qwik component. A Qwik component is a special kind of component that allows the Qwik framework to lazy load and execute the component independently of other Qwik components as well as lazy load the component's life-cycle hooks and event handlers.\\n\\nSide note: You can also declare regular (standard JSX) components that will have standard synchronous behavior.\\n\\nQwik component is a facade that describes how the component should be used without forcing the implementation of the component to be eagerly loaded. A minimum Qwik definition consists of:\\n\\n\\\\#\\\\#\\\\# Example\\n\\nAn example showing how to create a counter component:\\n\\n```tsx\\nexport interface CounterProps {\\n  initialValue?: number;\\n  step?: number;\\n}\\nexport const Counter = component$((props: CounterProps) => {\\n  const state = useStore({ count: props.initialValue || 0 });\\n  return (\\n    <div>\\n      <span>{state.count}</span>\\n      <button onClick$={() => (state.count += props.step || 1)}>+</button>\\n    </div>\\n  );\\n});\\n```\\n- `component$` is how a component gets declared. - `{ value?: number; step?: number }` declares the public (props) interface of the component. - `{ count: number }` declares the private (state) interface of the component.\\n\\nThe above can then be used like so:\\n\\n```tsx\\nexport const OtherComponent = component$(() => {\\n  return <Counter initialValue={100} />;\\n});\\n```\\nSee also: `component`<!-- -->, `useCleanup`<!-- -->, `onResume`<!-- -->, `onPause`<!-- -->, `useOn`<!-- -->, `useOnDocument`<!-- -->, `useOnWindow`<!-- -->, `useStyles`\\n\\n\\n```typescript\\ncomponentQrl: <PROPS extends Record<any, any>>(componentQrl: QRL<OnRenderFn<PROPS>>) => Component<PROPS>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\ncomponentQrl\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;[OnRenderFn](#onrenderfn)<!-- -->&lt;PROPS&gt;&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[Component](#component)<!-- -->&lt;PROPS&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts\",\n      \"mdFile\": \"qwik.componentqrl.md\"\n    },\n    {\n      \"name\": \"ComputedFn\",\n      \"id\": \"computedfn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ComputedFn\",\n          \"id\": \"computedfn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ComputedFn<T> = () => T;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.computedfn.md\"\n    },\n    {\n      \"name\": \"ContextId\",\n      \"id\": \"contextid\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ContextId\",\n          \"id\": \"contextid\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"ContextId is a typesafe ID for your context.\\n\\nContext is a way to pass stores to the child components without prop-drilling.\\n\\nUse `createContextId()` to create a `ContextId`<!-- -->. A `ContextId` is just a serializable identifier for the context. It is not the context value itself. See `useContextProvider()` and `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can track context providers and consumers in a way that survives resumability.\\n\\n\\\\#\\\\#\\\\# Example\\n\\n```tsx\\n// Declare the Context type.\\ninterface TodosStore {\\n  items: string[];\\n}\\n// Create a Context ID (no data is saved here.)\\n// You will use this ID to both create and retrieve the Context.\\nexport const TodosContext = createContextId<TodosStore>('Todos');\\n\\n// Example of providing context to child components.\\nexport const App = component$(() => {\\n  useContextProvider(\\n    TodosContext,\\n    useStore<TodosStore>({\\n      items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\\n    })\\n  );\\n\\n  return <Items />;\\n});\\n\\n// Example of retrieving the context provided by a parent component.\\nexport const Items = component$(() => {\\n  const todos = useContext(TodosContext);\\n  return (\\n    <ul>\\n      {todos.items.map((item) => (\\n        <li>{item}</li>\\n      ))}\\n    </ul>\\n  );\\n});\\n\\n```\\n\\n\\n```typescript\\nexport interface ContextId<STATE> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[\\\\_\\\\_brand\\\\_context\\\\_type\\\\_\\\\_](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nSTATE\\n\\n\\n</td><td>\\n\\nDesign-time property to store type information for the context.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[id](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nA unique ID for the context.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts\",\n      \"mdFile\": \"qwik.contextid.md\"\n    },\n    {\n      \"name\": \"CorePlatform\",\n      \"id\": \"coreplatform\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CorePlatform\",\n          \"id\": \"coreplatform\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"Low-level API for platform abstraction.\\n\\nDifferent platforms (browser, node, service workers) may have different ways of handling things such as `requestAnimationFrame` and imports. To make Qwik platform-independent Qwik uses the `CorePlatform` API to access the platform API.\\n\\n`CorePlatform` also is responsible for importing symbols. The import map is different on the client (browser) then on the server. For this reason, the server has a manifest that is used to map symbols to javascript chunks. The manifest is encapsulated in `CorePlatform`<!-- -->, for this reason, the `CorePlatform` can't be global as there may be multiple applications running at server concurrently.\\n\\nThis is a low-level API and there should not be a need for you to access this.\\n\\n\\n```typescript\\nexport interface CorePlatform \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[chunkForSymbol](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(symbolName: string, chunk: string \\\\| null, parent?: string) =&gt; readonly \\\\[symbol: string, chunk: string\\\\] \\\\| undefined\\n\\n\\n</td><td>\\n\\nRetrieve chunk name for the symbol.\\n\\nWhen the application is running on the server the symbols may be imported from different files (as server build is typically a single javascript chunk.) For this reason, it is necessary to convert the chunks from server format to client (browser) format. This is done by looking up symbols (which are globally unique) in the manifest. (Manifest is the mapping of symbols to the client chunk names.)\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[importSymbol](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(containerEl: Element \\\\| undefined, url: string \\\\| URL \\\\| undefined \\\\| null, symbol: string) =&gt; [ValueOrPromise](#valueorpromise)<!-- -->&lt;any&gt;\\n\\n\\n</td><td>\\n\\nRetrieve a symbol value from QRL.\\n\\nQwik needs to lazy load data and closures. For this Qwik uses QRLs that are serializable references of resources that are needed. The QRLs contain all the information necessary to retrieve the reference using `importSymbol`<!-- -->.\\n\\nWhy not use `import()`<!-- -->? Because `import()` is relative to the current file, and the current file is always the Qwik framework. So QRLs have additional information that allows them to serialize imports relative to application base rather than the Qwik framework file.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[isServer](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\nTrue of running on the server platform.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[nextTick](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(fn: () =&gt; any) =&gt; Promise&lt;any&gt;\\n\\n\\n</td><td>\\n\\nPerform operation on next tick.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[raf](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(fn: () =&gt; any) =&gt; Promise&lt;any&gt;\\n\\n\\n</td><td>\\n\\nPerform operation on next request-animation-frame.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/platform/types.ts\",\n      \"mdFile\": \"qwik.coreplatform.md\"\n    },\n    {\n      \"name\": \"CorrectedToggleEvent\",\n      \"id\": \"correctedtoggleevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CorrectedToggleEvent\",\n          \"id\": \"correctedtoggleevent\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"This corrects the TS definition for ToggleEvent\\n\\n\\n```typescript\\nexport interface CorrectedToggleEvent extends Event \\n```\\n**Extends:** Event\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[newState](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n'open' \\\\| 'closed'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[prevState](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n'open' \\\\| 'closed'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.correctedtoggleevent.md\"\n    },\n    {\n      \"name\": \"createComputed$\",\n      \"id\": \"createcomputed_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createComputed$\",\n          \"id\": \"createcomputed_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> This is a technology preview\\n> \\n\\nReturns read-only signal that updates when signals used in the `ComputedFn` change. Unlike useComputed$, this is not a hook and it always creates a new signal.\\n\\n\\n```typescript\\ncreateComputed$: <T>(qrl: ComputedFn<T>) => Signal<Awaited<T>>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[ComputedFn](#computedfn)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[Signal](#signal)<!-- -->&lt;Awaited&lt;T&gt;&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.createcomputed_.md\"\n    },\n    {\n      \"name\": \"createComputedQrl\",\n      \"id\": \"createcomputedqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createComputedQrl\",\n          \"id\": \"createcomputedqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\ncreateComputedQrl: <T>(qrl: QRL<ComputedFn<T>>) => Signal<Awaited<T>>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;[ComputedFn](#computedfn)<!-- -->&lt;T&gt;&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[Signal](#signal)<!-- -->&lt;Awaited&lt;T&gt;&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.createcomputedqrl.md\"\n    },\n    {\n      \"name\": \"createContextId\",\n      \"id\": \"createcontextid\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createContextId\",\n          \"id\": \"createcontextid\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Create a context ID to be used in your application. The name should be written with no spaces.\\n\\nContext is a way to pass stores to the child components without prop-drilling.\\n\\nUse `createContextId()` to create a `ContextId`<!-- -->. A `ContextId` is just a serializable identifier for the context. It is not the context value itself. See `useContextProvider()` and `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can track context providers and consumers in a way that survives resumability.\\n\\n\\\\#\\\\#\\\\# Example\\n\\n```tsx\\n// Declare the Context type.\\ninterface TodosStore {\\n  items: string[];\\n}\\n// Create a Context ID (no data is saved here.)\\n// You will use this ID to both create and retrieve the Context.\\nexport const TodosContext = createContextId<TodosStore>('Todos');\\n\\n// Example of providing context to child components.\\nexport const App = component$(() => {\\n  useContextProvider(\\n    TodosContext,\\n    useStore<TodosStore>({\\n      items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\\n    })\\n  );\\n\\n  return <Items />;\\n});\\n\\n// Example of retrieving the context provided by a parent component.\\nexport const Items = component$(() => {\\n  const todos = useContext(TodosContext);\\n  return (\\n    <ul>\\n      {todos.items.map((item) => (\\n        <li>{item}</li>\\n      ))}\\n    </ul>\\n  );\\n});\\n\\n```\\n\\n\\n```typescript\\ncreateContextId: <STATE = unknown>(name: string) => ContextId<STATE>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nname\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nThe name of the context.\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[ContextId](#contextid)<!-- -->&lt;STATE&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts\",\n      \"mdFile\": \"qwik.createcontextid.md\"\n    },\n    {\n      \"name\": \"createSignal\",\n      \"id\": \"createsignal\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createSignal\",\n          \"id\": \"createsignal\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> This is a technology preview\\n> \\n\\nCreates a signal.\\n\\nIf the initial state is a function, the function is invoked to calculate the actual initial state.\\n\\n\\n```typescript\\ncreateSignal: UseSignal\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts\",\n      \"mdFile\": \"qwik.createsignal.md\"\n    },\n    {\n      \"name\": \"CSSProperties\",\n      \"id\": \"cssproperties\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CSSProperties\",\n          \"id\": \"cssproperties\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number> \\n```\\n**Extends:** CSS.Properties&lt;string \\\\| number&gt;, CSS.PropertiesHyphen&lt;string \\\\| number&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.cssproperties.md\"\n    },\n    {\n      \"name\": \"DataHTMLAttributes\",\n      \"id\": \"datahtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DataHTMLAttributes\",\n          \"id\": \"datahtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DataHTMLAttributes<T extends Element> extends Attrs<'data', T> \\n```\\n**Extends:** Attrs&lt;'data', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.datahtmlattributes.md\"\n    },\n    {\n      \"name\": \"DelHTMLAttributes\",\n      \"id\": \"delhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DelHTMLAttributes\",\n          \"id\": \"delhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DelHTMLAttributes<T extends Element> extends Attrs<'del', T> \\n```\\n**Extends:** Attrs&lt;'del', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.delhtmlattributes.md\"\n    },\n    {\n      \"name\": \"DetailsHTMLAttributes\",\n      \"id\": \"detailshtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DetailsHTMLAttributes\",\n          \"id\": \"detailshtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DetailsHTMLAttributes<T extends Element> extends Attrs<'details', T> \\n```\\n**Extends:** Attrs&lt;'details', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.detailshtmlattributes.md\"\n    },\n    {\n      \"name\": \"DevJSX\",\n      \"id\": \"devjsx\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DevJSX\",\n          \"id\": \"devjsx\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DevJSX \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[columnNumber](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[fileName](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[lineNumber](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stack?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts\",\n      \"mdFile\": \"qwik.devjsx.md\"\n    },\n    {\n      \"name\": \"DialogHTMLAttributes\",\n      \"id\": \"dialoghtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DialogHTMLAttributes\",\n          \"id\": \"dialoghtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DialogHTMLAttributes<T extends Element> extends Attrs<'dialog', T> \\n```\\n**Extends:** Attrs&lt;'dialog', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.dialoghtmlattributes.md\"\n    },\n    {\n      \"name\": \"DOMAttributes\",\n      \"id\": \"domattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DOMAttributes\",\n          \"id\": \"domattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"The Qwik-specific attributes that DOM elements accept\\n\\n\\n```typescript\\nexport interface DOMAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL> \\n```\\n**Extends:** DOMAttributesBase&lt;EL&gt;, QwikEvents&lt;EL&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[class?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[ClassList](#classlist) \\\\| [Signal](#signal)<!-- -->&lt;[ClassList](#classlist)<!-- -->&gt; \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.domattributes.md\"\n    },\n    {\n      \"name\": \"EagernessOptions\",\n      \"id\": \"eagernessoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"EagernessOptions\",\n          \"id\": \"eagernessoptions\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> use useVisibleTask$ or useResource$, useTask$ is for running tasks as part of the initial SSR render\\n> \\n\\n\\n```typescript\\nexport type EagernessOptions = 'visible' | 'load' | 'idle';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.eagernessoptions.md\"\n    },\n    {\n      \"name\": \"Element\",\n      \"id\": \"qwikjsx-element\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikJSX\",\n          \"id\": \"qwikjsx-element\"\n        },\n        {\n          \"name\": \"Element\",\n          \"id\": \"qwikjsx-element\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\ntype Element = JSXOutput;\\n```\\n**References:** [JSXOutput](#jsxoutput)\",\n      \"mdFile\": \"qwik.qwikjsx.element.md\"\n    },\n    {\n      \"name\": \"ElementChildrenAttribute\",\n      \"id\": \"qwikjsx-elementchildrenattribute\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikJSX\",\n          \"id\": \"qwikjsx-elementchildrenattribute\"\n        },\n        {\n          \"name\": \"ElementChildrenAttribute\",\n          \"id\": \"qwikjsx-elementchildrenattribute\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\ninterface ElementChildrenAttribute \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[children](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[JSXChildren](#jsxchildren)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"mdFile\": \"qwik.qwikjsx.elementchildrenattribute.md\"\n    },\n    {\n      \"name\": \"ElementType\",\n      \"id\": \"qwikjsx-elementtype\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikJSX\",\n          \"id\": \"qwikjsx-elementtype\"\n        },\n        {\n          \"name\": \"ElementType\",\n          \"id\": \"qwikjsx-elementtype\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\ntype ElementType = string | FunctionComponent<Record<any, any>>;\\n```\\n**References:** [FunctionComponent](#functioncomponent)\",\n      \"mdFile\": \"qwik.qwikjsx.elementtype.md\"\n    },\n    {\n      \"name\": \"EmbedHTMLAttributes\",\n      \"id\": \"embedhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"EmbedHTMLAttributes\",\n          \"id\": \"embedhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface EmbedHTMLAttributes<T extends Element> extends Attrs<'embed', T> \\n```\\n**Extends:** Attrs&lt;'embed', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.embedhtmlattributes.md\"\n    },\n    {\n      \"name\": \"ErrorBoundaryStore\",\n      \"id\": \"errorboundarystore\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ErrorBoundaryStore\",\n          \"id\": \"errorboundarystore\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ErrorBoundaryStore \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[error](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nany \\\\| undefined\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/error-handling.ts\",\n      \"mdFile\": \"qwik.errorboundarystore.md\"\n    },\n    {\n      \"name\": \"event$\",\n      \"id\": \"event_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"event$\",\n          \"id\": \"event_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nevent$: <T>(qrl: T) => QRL<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[QRL](#qrl)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik.event_.md\"\n    },\n    {\n      \"name\": \"EventHandler\",\n      \"id\": \"eventhandler\",\n      \"hierarchy\": [\n        {\n          \"name\": \"EventHandler\",\n          \"id\": \"eventhandler\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"A DOM event handler\\n\\n\\n```typescript\\nexport type EventHandler<EV = Event, EL = Element> = {\\n    bivarianceHack(event: EV, element: EL): any;\\n}['bivarianceHack'];\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.eventhandler.md\"\n    },\n    {\n      \"name\": \"eventQrl\",\n      \"id\": \"eventqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"eventQrl\",\n          \"id\": \"eventqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\neventQrl: <T>(qrl: QRL<T>) => QRL<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[QRL](#qrl)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik.eventqrl.md\"\n    },\n    {\n      \"name\": \"FieldsetHTMLAttributes\",\n      \"id\": \"fieldsethtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"FieldsetHTMLAttributes\",\n          \"id\": \"fieldsethtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface FieldsetHTMLAttributes<T extends Element> extends Attrs<'fieldset', T> \\n```\\n**Extends:** Attrs&lt;'fieldset', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.fieldsethtmlattributes.md\"\n    },\n    {\n      \"name\": \"FormHTMLAttributes\",\n      \"id\": \"formhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"FormHTMLAttributes\",\n          \"id\": \"formhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface FormHTMLAttributes<T extends Element> extends Attrs<'form', T> \\n```\\n**Extends:** Attrs&lt;'form', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.formhtmlattributes.md\"\n    },\n    {\n      \"name\": \"Fragment\",\n      \"id\": \"fragment\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Fragment\",\n          \"id\": \"fragment\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nFragment: FunctionComponent<{\\n    children?: any;\\n    key?: string | number | null;\\n}>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts\",\n      \"mdFile\": \"qwik.fragment.md\"\n    },\n    {\n      \"name\": \"FunctionComponent\",\n      \"id\": \"functioncomponent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"FunctionComponent\",\n          \"id\": \"functioncomponent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Any function taking a props object that returns JSXOutput.\\n\\nThe `key`<!-- -->, `flags` and `dev` parameters are for internal use.\\n\\n\\n```typescript\\nexport type FunctionComponent<P = unknown> = {\\n    renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;\\n}['renderFn'];\\n```\\n**References:** [DevJSX](#devjsx)<!-- -->, [JSXOutput](#jsxoutput)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts\",\n      \"mdFile\": \"qwik.functioncomponent.md\"\n    },\n    {\n      \"name\": \"getPlatform\",\n      \"id\": \"getplatform\",\n      \"hierarchy\": [\n        {\n          \"name\": \"getPlatform\",\n          \"id\": \"getplatform\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Retrieve the `CorePlatform`<!-- -->.\\n\\nThe `CorePlatform` is also responsible for retrieving the Manifest, that contains mappings from symbols to javascript import chunks. For this reason, `CorePlatform` can't be global, but is specific to the application currently running. On server it is possible that many different applications are running in a single server instance, and for this reason the `CorePlatform` is associated with the application document.\\n\\n\\n```typescript\\ngetPlatform: () => CorePlatform\\n```\\n**Returns:**\\n\\n[CorePlatform](#coreplatform)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/platform/platform.ts\",\n      \"mdFile\": \"qwik.getplatform.md\"\n    },\n    {\n      \"name\": \"h\",\n      \"id\": \"h\",\n      \"hierarchy\": [\n        {\n          \"name\": \"h\",\n          \"id\": \"h\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare namespace h \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nFunction\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[h(type)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, data)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, text)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, children)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, data, text)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, data, children)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(sel, data, children)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/factory.ts\",\n      \"mdFile\": \"qwik.h.md\"\n    },\n    {\n      \"name\": \"h\",\n      \"id\": \"h\",\n      \"hierarchy\": [\n        {\n          \"name\": \"h\",\n          \"id\": \"h\"\n        }\n      ],\n      \"kind\": \"Namespace\",\n      \"content\": \"```typescript\\nexport declare namespace h \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nFunction\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[h(type)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, data)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, text)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, children)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, data, text)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(type, data, children)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h(sel, data, children)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/factory.ts\",\n      \"mdFile\": \"qwik.h.md\"\n    },\n    {\n      \"name\": \"HrHTMLAttributes\",\n      \"id\": \"hrhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HrHTMLAttributes\",\n          \"id\": \"hrhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface HrHTMLAttributes<T extends Element> extends Attrs<'hr', T> \\n```\\n**Extends:** Attrs&lt;'hr', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.hrhtmlattributes.md\"\n    },\n    {\n      \"name\": \"HTMLAttributeAnchorTarget\",\n      \"id\": \"htmlattributeanchortarget\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLAttributeAnchorTarget\",\n          \"id\": \"htmlattributeanchortarget\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlattributeanchortarget.md\"\n    },\n    {\n      \"name\": \"HTMLAttributeReferrerPolicy\",\n      \"id\": \"htmlattributereferrerpolicy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLAttributeReferrerPolicy\",\n          \"id\": \"htmlattributereferrerpolicy\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type HTMLAttributeReferrerPolicy = ReferrerPolicy;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlattributereferrerpolicy.md\"\n    },\n    {\n      \"name\": \"HTMLAttributes\",\n      \"id\": \"htmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLAttributes\",\n          \"id\": \"htmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface HTMLAttributes<E extends Element> extends HTMLElementAttrs, DOMAttributes<E> \\n```\\n**Extends:** [HTMLElementAttrs](#htmlelementattrs)<!-- -->, [DOMAttributes](#domattributes)<!-- -->&lt;E&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlattributes.md\"\n    },\n    {\n      \"name\": \"HTMLCrossOriginAttribute\",\n      \"id\": \"htmlcrossoriginattribute\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLCrossOriginAttribute\",\n          \"id\": \"htmlcrossoriginattribute\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type HTMLCrossOriginAttribute = 'anonymous' | 'use-credentials' | '' | undefined;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlcrossoriginattribute.md\"\n    },\n    {\n      \"name\": \"HTMLElementAttrs\",\n      \"id\": \"htmlelementattrs\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLElementAttrs\",\n          \"id\": \"htmlelementattrs\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement> \\n```\\n**Extends:** HTMLAttributesBase, FilterBase&lt;HTMLElement&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlelementattrs.md\"\n    },\n    {\n      \"name\": \"HTMLFragment\",\n      \"id\": \"htmlfragment\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLFragment\",\n          \"id\": \"htmlfragment\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nHTMLFragment: FunctionComponent<{\\n    dangerouslySetInnerHTML: string;\\n}>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts\",\n      \"mdFile\": \"qwik.htmlfragment.md\"\n    },\n    {\n      \"name\": \"HtmlHTMLAttributes\",\n      \"id\": \"htmlhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HtmlHTMLAttributes\",\n          \"id\": \"htmlhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface HtmlHTMLAttributes<T extends Element> extends Attrs<'html', T> \\n```\\n**Extends:** Attrs&lt;'html', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlhtmlattributes.md\"\n    },\n    {\n      \"name\": \"HTMLInputAutocompleteAttribute\",\n      \"id\": \"htmlinputautocompleteattribute\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLInputAutocompleteAttribute\",\n          \"id\": \"htmlinputautocompleteattribute\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type HTMLInputAutocompleteAttribute = 'on' | 'off' | 'billing' | 'shipping' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'url' | 'photo';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlinputautocompleteattribute.md\"\n    },\n    {\n      \"name\": \"HTMLInputTypeAttribute\",\n      \"id\": \"htmlinputtypeattribute\",\n      \"hierarchy\": [\n        {\n          \"name\": \"HTMLInputTypeAttribute\",\n          \"id\": \"htmlinputtypeattribute\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type HTMLInputTypeAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.htmlinputtypeattribute.md\"\n    },\n    {\n      \"name\": \"IframeHTMLAttributes\",\n      \"id\": \"iframehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"IframeHTMLAttributes\",\n          \"id\": \"iframehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface IframeHTMLAttributes<T extends Element> extends Attrs<'iframe', T> \\n```\\n**Extends:** Attrs&lt;'iframe', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.iframehtmlattributes.md\"\n    },\n    {\n      \"name\": \"ImgHTMLAttributes\",\n      \"id\": \"imghtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ImgHTMLAttributes\",\n          \"id\": \"imghtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ImgHTMLAttributes<T extends Element> extends Attrs<'img', T> \\n```\\n**Extends:** Attrs&lt;'img', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.imghtmlattributes.md\"\n    },\n    {\n      \"name\": \"implicit$FirstArg\",\n      \"id\": \"implicit_firstarg\",\n      \"hierarchy\": [\n        {\n          \"name\": \"implicit$FirstArg\",\n          \"id\": \"implicit_firstarg\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Create a `____$(...)` convenience method from `___(...)`<!-- -->.\\n\\nIt is very common for functions to take a lazy-loadable resource as a first argument. For this reason, the Qwik Optimizer automatically extracts the first argument from any function which ends in `$`<!-- -->.\\n\\nThis means that `foo$(arg0)` and `foo($(arg0))` are equivalent with respect to Qwik Optimizer. The former is just a shorthand for the latter.\\n\\nFor example, these function calls are equivalent:\\n\\n- `component$(() => {...})` is same as `component($(() => {...}))`\\n\\n```tsx\\nexport function myApi(callback: QRL<() => void>): void {\\n  // ...\\n}\\n\\nexport const myApi$ = implicit$FirstArg(myApi);\\n// type of myApi$: (callback: () => void): void\\n\\n// can be used as:\\nmyApi$(() => console.log('callback'));\\n\\n// will be transpiled to:\\n// FILE: <current file>\\nmyApi(qrl('./chunk-abc.js', 'callback'));\\n\\n// FILE: chunk-abc.js\\nexport const callback = () => console.log('callback');\\n```\\n\\n\\n```typescript\\nimplicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET)\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nfn\\n\\n\\n</td><td>\\n\\n(qrl: [QRL](#qrl)<!-- -->&lt;FIRST&gt;, ...rest: REST) =&gt; RET\\n\\n\\n</td><td>\\n\\nA function that should have its first argument automatically `$`<!-- -->.\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n((qrl: FIRST, ...rest: REST) =&gt; RET)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/util/implicit_dollar.ts\",\n      \"mdFile\": \"qwik.implicit_firstarg.md\"\n    },\n    {\n      \"name\": \"InputHTMLAttributes\",\n      \"id\": \"inputhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"InputHTMLAttributes\",\n          \"id\": \"inputhtmlattributes\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type InputHTMLAttributes<T extends Element> = Attrs<'input', T, HTMLInputElement>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.inputhtmlattributes.md\"\n    },\n    {\n      \"name\": \"InsHTMLAttributes\",\n      \"id\": \"inshtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"InsHTMLAttributes\",\n          \"id\": \"inshtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface InsHTMLAttributes<T extends Element> extends Attrs<'ins', T> \\n```\\n**Extends:** Attrs&lt;'ins', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.inshtmlattributes.md\"\n    },\n    {\n      \"name\": \"IntrinsicAttributes\",\n      \"id\": \"qwikjsx-intrinsicattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikJSX\",\n          \"id\": \"qwikjsx-intrinsicattributes\"\n        },\n        {\n          \"name\": \"IntrinsicAttributes\",\n          \"id\": \"qwikjsx-intrinsicattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\ninterface IntrinsicAttributes extends QwikIntrinsicAttributes \\n```\\n**Extends:** QwikIntrinsicAttributes\",\n      \"mdFile\": \"qwik.qwikjsx.intrinsicattributes.md\"\n    },\n    {\n      \"name\": \"IntrinsicElements\",\n      \"id\": \"intrinsicelements\",\n      \"hierarchy\": [\n        {\n          \"name\": \"IntrinsicElements\",\n          \"id\": \"intrinsicelements\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface IntrinsicElements extends IntrinsicHTMLElements, IntrinsicSVGElements \\n```\\n**Extends:** IntrinsicHTMLElements, IntrinsicSVGElements\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.intrinsicelements.md\"\n    },\n    {\n      \"name\": \"isSignal\",\n      \"id\": \"issignal\",\n      \"hierarchy\": [\n        {\n          \"name\": \"isSignal\",\n          \"id\": \"issignal\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Checks if a given object is a `Signal`<!-- -->.\\n\\n\\n```typescript\\nisSignal: <T = unknown>(obj: any) => obj is Signal<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nobj\\n\\n\\n</td><td>\\n\\nany\\n\\n\\n</td><td>\\n\\nThe object to check if `Signal`<!-- -->.\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nobj is [Signal](#signal)<!-- -->&lt;T&gt;\\n\\nBoolean - True if the object is a `Signal`<!-- -->.\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/signal.ts\",\n      \"mdFile\": \"qwik.issignal.md\"\n    },\n    {\n      \"name\": \"jsx\",\n      \"id\": \"jsx\",\n      \"hierarchy\": [\n        {\n          \"name\": \"jsx\",\n          \"id\": \"jsx\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Used by the JSX transpilers to create a JSXNode. Note that the optimizer will not use this, instead using \\\\_jsxQ, \\\\_jsxS, and \\\\_jsxC directly.\\n\\n\\n```typescript\\njsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>, key?: string | number | null) => JSXNode<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\ntype\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nprops\\n\\n\\n</td><td>\\n\\nT extends [FunctionComponent](#functioncomponent)<!-- -->&lt;infer PROPS&gt; ? PROPS : Record&lt;any, unknown&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nkey\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[JSXNode](#jsxnode)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts\",\n      \"mdFile\": \"qwik.jsx.md\"\n    },\n    {\n      \"name\": \"JSXChildren\",\n      \"id\": \"jsxchildren\",\n      \"hierarchy\": [\n        {\n          \"name\": \"JSXChildren\",\n          \"id\": \"jsxchildren\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;\\n```\\n**References:** [JSXChildren](#jsxchildren)<!-- -->, [Signal](#signal)<!-- -->, [JSXNode](#jsxnode)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.jsxchildren.md\"\n    },\n    {\n      \"name\": \"jsxDEV\",\n      \"id\": \"jsxdev\",\n      \"hierarchy\": [\n        {\n          \"name\": \"jsxDEV\",\n          \"id\": \"jsxdev\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\njsxDEV: <T extends string | FunctionComponent<Record<any, unknown>>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>, key: string | number | null | undefined, _isStatic: boolean, opts: JsxDevOpts, _ctx: unknown) => JSXNode<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\ntype\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nprops\\n\\n\\n</td><td>\\n\\nT extends [FunctionComponent](#functioncomponent)<!-- -->&lt;infer PROPS&gt; ? PROPS : Record&lt;any, unknown&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nkey\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| null \\\\| undefined\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n\\\\_isStatic\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\nJsxDevOpts\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n\\\\_ctx\\n\\n\\n</td><td>\\n\\nunknown\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[JSXNode](#jsxnode)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts\",\n      \"mdFile\": \"qwik.jsxdev.md\"\n    },\n    {\n      \"name\": \"JSXNode\",\n      \"id\": \"jsxnode\",\n      \"hierarchy\": [\n        {\n          \"name\": \"JSXNode\",\n          \"id\": \"jsxnode\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.\\n\\n\\n```typescript\\nexport interface JSXNode<T extends string | FunctionComponent | unknown = unknown> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[children](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[JSXChildren](#jsxchildren) \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[dev?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[DevJSX](#devjsx)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[key](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[props](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nT extends [FunctionComponent](#functioncomponent)<!-- -->&lt;infer P&gt; ? P : Record&lt;any, unknown&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[type](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts\",\n      \"mdFile\": \"qwik.jsxnode.md\"\n    },\n    {\n      \"name\": \"JSXOutput\",\n      \"id\": \"jsxoutput\",\n      \"hierarchy\": [\n        {\n          \"name\": \"JSXOutput\",\n          \"id\": \"jsxoutput\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Any valid output for a component\\n\\n\\n```typescript\\nexport type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];\\n```\\n**References:** [JSXNode](#jsxnode)<!-- -->, [JSXOutput](#jsxoutput)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts\",\n      \"mdFile\": \"qwik.jsxoutput.md\"\n    },\n    {\n      \"name\": \"JSXTagName\",\n      \"id\": \"jsxtagname\",\n      \"hierarchy\": [\n        {\n          \"name\": \"JSXTagName\",\n          \"id\": \"jsxtagname\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.jsxtagname.md\"\n    },\n    {\n      \"name\": \"KeygenHTMLAttributes\",\n      \"id\": \"keygenhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"KeygenHTMLAttributes\",\n          \"id\": \"keygenhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> in html5\\n> \\n\\n\\n```typescript\\nexport interface KeygenHTMLAttributes<T extends Element> extends Attrs<'base', T> \\n```\\n**Extends:** Attrs&lt;'base', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.keygenhtmlattributes.md\"\n    },\n    {\n      \"name\": \"KnownEventNames\",\n      \"id\": \"knowneventnames\",\n      \"hierarchy\": [\n        {\n          \"name\": \"KnownEventNames\",\n          \"id\": \"knowneventnames\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"The names of events that Qwik knows about. They are all lowercase, but on the JSX side, they are PascalCase for nicer DX. (`onAuxClick$` vs `onauxclick$`<!-- -->)\\n\\n\\n```typescript\\nexport type KnownEventNames = LiteralUnion<AllEventKeys, string>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.knowneventnames.md\"\n    },\n    {\n      \"name\": \"LabelHTMLAttributes\",\n      \"id\": \"labelhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"LabelHTMLAttributes\",\n          \"id\": \"labelhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface LabelHTMLAttributes<T extends Element> extends Attrs<'label', T> \\n```\\n**Extends:** Attrs&lt;'label', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.labelhtmlattributes.md\"\n    },\n    {\n      \"name\": \"LiHTMLAttributes\",\n      \"id\": \"lihtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"LiHTMLAttributes\",\n          \"id\": \"lihtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface LiHTMLAttributes<T extends Element> extends Attrs<'li', T> \\n```\\n**Extends:** Attrs&lt;'li', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.lihtmlattributes.md\"\n    },\n    {\n      \"name\": \"LinkHTMLAttributes\",\n      \"id\": \"linkhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"LinkHTMLAttributes\",\n          \"id\": \"linkhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface LinkHTMLAttributes<T extends Element> extends Attrs<'link', T> \\n```\\n**Extends:** Attrs&lt;'link', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.linkhtmlattributes.md\"\n    },\n    {\n      \"name\": \"MapHTMLAttributes\",\n      \"id\": \"maphtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"MapHTMLAttributes\",\n          \"id\": \"maphtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface MapHTMLAttributes<T extends Element> extends Attrs<'map', T> \\n```\\n**Extends:** Attrs&lt;'map', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.maphtmlattributes.md\"\n    },\n    {\n      \"name\": \"MediaHTMLAttributes\",\n      \"id\": \"mediahtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"MediaHTMLAttributes\",\n          \"id\": \"mediahtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface MediaHTMLAttributes<T extends Element> extends HTMLAttributes<T>, Augmented<HTMLMediaElement, {\\n    crossOrigin?: HTMLCrossOriginAttribute;\\n}> \\n```\\n**Extends:** [HTMLAttributes](#htmlattributes)<!-- -->&lt;T&gt;, Augmented&lt;HTMLMediaElement, { crossOrigin?: [HTMLCrossOriginAttribute](#htmlcrossoriginattribute)<!-- -->; }&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[crossOrigin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[HTMLCrossOriginAttribute](#htmlcrossoriginattribute)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.mediahtmlattributes.md\"\n    },\n    {\n      \"name\": \"MenuHTMLAttributes\",\n      \"id\": \"menuhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"MenuHTMLAttributes\",\n          \"id\": \"menuhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface MenuHTMLAttributes<T extends Element> extends Attrs<'menu', T> \\n```\\n**Extends:** Attrs&lt;'menu', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.menuhtmlattributes.md\"\n    },\n    {\n      \"name\": \"MetaHTMLAttributes\",\n      \"id\": \"metahtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"MetaHTMLAttributes\",\n          \"id\": \"metahtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface MetaHTMLAttributes<T extends Element> extends Attrs<'meta', T> \\n```\\n**Extends:** Attrs&lt;'meta', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.metahtmlattributes.md\"\n    },\n    {\n      \"name\": \"MeterHTMLAttributes\",\n      \"id\": \"meterhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"MeterHTMLAttributes\",\n          \"id\": \"meterhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface MeterHTMLAttributes<T extends Element> extends Attrs<'meter', T> \\n```\\n**Extends:** Attrs&lt;'meter', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.meterhtmlattributes.md\"\n    },\n    {\n      \"name\": \"NativeAnimationEvent\",\n      \"id\": \"nativeanimationevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeAnimationEvent\",\n          \"id\": \"nativeanimationevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `AnimationEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeAnimationEvent = AnimationEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativeanimationevent.md\"\n    },\n    {\n      \"name\": \"NativeClipboardEvent\",\n      \"id\": \"nativeclipboardevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeClipboardEvent\",\n          \"id\": \"nativeclipboardevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `ClipboardEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeClipboardEvent = ClipboardEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativeclipboardevent.md\"\n    },\n    {\n      \"name\": \"NativeCompositionEvent\",\n      \"id\": \"nativecompositionevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeCompositionEvent\",\n          \"id\": \"nativecompositionevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `CompositionEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeCompositionEvent = CompositionEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativecompositionevent.md\"\n    },\n    {\n      \"name\": \"NativeDragEvent\",\n      \"id\": \"nativedragevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeDragEvent\",\n          \"id\": \"nativedragevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `DragEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeDragEvent = DragEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativedragevent.md\"\n    },\n    {\n      \"name\": \"NativeFocusEvent\",\n      \"id\": \"nativefocusevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeFocusEvent\",\n          \"id\": \"nativefocusevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `FocusEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeFocusEvent = FocusEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativefocusevent.md\"\n    },\n    {\n      \"name\": \"NativeKeyboardEvent\",\n      \"id\": \"nativekeyboardevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeKeyboardEvent\",\n          \"id\": \"nativekeyboardevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `KeyboardEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeKeyboardEvent = KeyboardEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativekeyboardevent.md\"\n    },\n    {\n      \"name\": \"NativeMouseEvent\",\n      \"id\": \"nativemouseevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeMouseEvent\",\n          \"id\": \"nativemouseevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `MouseEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeMouseEvent = MouseEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativemouseevent.md\"\n    },\n    {\n      \"name\": \"NativePointerEvent\",\n      \"id\": \"nativepointerevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativePointerEvent\",\n          \"id\": \"nativepointerevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `PointerEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativePointerEvent = PointerEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativepointerevent.md\"\n    },\n    {\n      \"name\": \"NativeTouchEvent\",\n      \"id\": \"nativetouchevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeTouchEvent\",\n          \"id\": \"nativetouchevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `TouchEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeTouchEvent = TouchEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativetouchevent.md\"\n    },\n    {\n      \"name\": \"NativeTransitionEvent\",\n      \"id\": \"nativetransitionevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeTransitionEvent\",\n          \"id\": \"nativetransitionevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `TransitionEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeTransitionEvent = TransitionEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativetransitionevent.md\"\n    },\n    {\n      \"name\": \"NativeUIEvent\",\n      \"id\": \"nativeuievent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeUIEvent\",\n          \"id\": \"nativeuievent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `UIEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeUIEvent = UIEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativeuievent.md\"\n    },\n    {\n      \"name\": \"NativeWheelEvent\",\n      \"id\": \"nativewheelevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NativeWheelEvent\",\n          \"id\": \"nativewheelevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `WheelEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type NativeWheelEvent = WheelEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.nativewheelevent.md\"\n    },\n    {\n      \"name\": \"noSerialize\",\n      \"id\": \"noserialize\",\n      \"hierarchy\": [\n        {\n          \"name\": \"noSerialize\",\n          \"id\": \"noserialize\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Returned type of the `noSerialize()` function. It will be TYPE or undefined.\\n\\n\\n```typescript\\nexport type NoSerialize<T> = (T & {\\n    __no_serialize__: true;\\n}) | undefined;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/common.ts\",\n      \"mdFile\": \"qwik.noserialize.md\"\n    },\n    {\n      \"name\": \"NoSerialize\",\n      \"id\": \"noserialize\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NoSerialize\",\n          \"id\": \"noserialize\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Returned type of the `noSerialize()` function. It will be TYPE or undefined.\\n\\n\\n```typescript\\nexport type NoSerialize<T> = (T & {\\n    __no_serialize__: true;\\n}) | undefined;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/common.ts\",\n      \"mdFile\": \"qwik.noserialize.md\"\n    },\n    {\n      \"name\": \"Numberish\",\n      \"id\": \"numberish\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Numberish\",\n          \"id\": \"numberish\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type Numberish = number | `${number}`;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.numberish.md\"\n    },\n    {\n      \"name\": \"ObjectHTMLAttributes\",\n      \"id\": \"objecthtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ObjectHTMLAttributes\",\n          \"id\": \"objecthtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ObjectHTMLAttributes<T extends Element> extends Attrs<'object', T> \\n```\\n**Extends:** Attrs&lt;'object', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.objecthtmlattributes.md\"\n    },\n    {\n      \"name\": \"OlHTMLAttributes\",\n      \"id\": \"olhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OlHTMLAttributes\",\n          \"id\": \"olhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface OlHTMLAttributes<T extends Element> extends Attrs<'ol', T> \\n```\\n**Extends:** Attrs&lt;'ol', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.olhtmlattributes.md\"\n    },\n    {\n      \"name\": \"OnRenderFn\",\n      \"id\": \"onrenderfn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OnRenderFn\",\n          \"id\": \"onrenderfn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type OnRenderFn<PROPS> = (props: PROPS) => JSXOutput;\\n```\\n**References:** [JSXOutput](#jsxoutput)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts\",\n      \"mdFile\": \"qwik.onrenderfn.md\"\n    },\n    {\n      \"name\": \"OnVisibleTaskOptions\",\n      \"id\": \"onvisibletaskoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OnVisibleTaskOptions\",\n          \"id\": \"onvisibletaskoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface OnVisibleTaskOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[strategy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[VisibleTaskStrategy](#visibletaskstrategy)\\n\\n\\n</td><td>\\n\\n_(Optional)_ The strategy to use to determine when the \\\"VisibleTask\\\" should first execute.\\n\\n- `intersection-observer`<!-- -->: the task will first execute when the element is visible in the viewport, under the hood it uses the IntersectionObserver API. - `document-ready`<!-- -->: the task will first execute when the document is ready, under the hood it uses the document `load` event. - `document-idle`<!-- -->: the task will first execute when the document is idle, under the hood it uses the requestIdleCallback API.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.onvisibletaskoptions.md\"\n    },\n    {\n      \"name\": \"OptgroupHTMLAttributes\",\n      \"id\": \"optgrouphtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OptgroupHTMLAttributes\",\n          \"id\": \"optgrouphtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface OptgroupHTMLAttributes<T extends Element> extends Attrs<'optgroup', T> \\n```\\n**Extends:** Attrs&lt;'optgroup', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.optgrouphtmlattributes.md\"\n    },\n    {\n      \"name\": \"OptionHTMLAttributes\",\n      \"id\": \"optionhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OptionHTMLAttributes\",\n          \"id\": \"optionhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface OptionHTMLAttributes<T extends Element> extends Attrs<'option', T> \\n```\\n**Extends:** Attrs&lt;'option', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.optionhtmlattributes.md\"\n    },\n    {\n      \"name\": \"OutputHTMLAttributes\",\n      \"id\": \"outputhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OutputHTMLAttributes\",\n          \"id\": \"outputhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface OutputHTMLAttributes<T extends Element> extends Attrs<'output', T> \\n```\\n**Extends:** Attrs&lt;'output', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.outputhtmlattributes.md\"\n    },\n    {\n      \"name\": \"ParamHTMLAttributes\",\n      \"id\": \"paramhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ParamHTMLAttributes\",\n          \"id\": \"paramhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Old DOM API\\n> \\n\\n\\n```typescript\\nexport interface ParamHTMLAttributes<T extends Element> extends Attrs<'base', T, HTMLParamElement> \\n```\\n**Extends:** Attrs&lt;'base', T, HTMLParamElement&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.paramhtmlattributes.md\"\n    },\n    {\n      \"name\": \"PrefetchGraph\",\n      \"id\": \"prefetchgraph\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PrefetchGraph\",\n          \"id\": \"prefetchgraph\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n> Warning: This API is now obsolete.\\n> \\n> This is no longer needed as the preloading happens automatically in qrl-class. You can remove this component from your app.\\n> \\n\\n\\n```typescript\\nPrefetchGraph: (opts?: {\\n    base?: string;\\n    manifestHash?: string;\\n    manifestURL?: string;\\n    nonce?: string;\\n}) => JSXOutput\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n{ base?: string; manifestHash?: string; manifestURL?: string; nonce?: string; }\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[JSXOutput](#jsxoutput)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts\",\n      \"mdFile\": \"qwik.prefetchgraph.md\"\n    },\n    {\n      \"name\": \"PrefetchServiceWorker\",\n      \"id\": \"prefetchserviceworker\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PrefetchServiceWorker\",\n          \"id\": \"prefetchserviceworker\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n> Warning: This API is now obsolete.\\n> \\n> This is no longer needed as the preloading happens automatically in qrl-class.ts. Leave this in your app for a while so it uninstalls existing service workers, but don't use it for new projects.\\n> \\n\\n\\n```typescript\\nPrefetchServiceWorker: (opts: {\\n    base?: string;\\n    scope?: string;\\n    path?: string;\\n    verbose?: boolean;\\n    fetchBundleGraph?: boolean;\\n    nonce?: string;\\n}) => JSXNode<'script'>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nJSXNode&lt;'script'&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts\",\n      \"mdFile\": \"qwik.prefetchserviceworker.md\"\n    },\n    {\n      \"name\": \"ProgressHTMLAttributes\",\n      \"id\": \"progresshtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ProgressHTMLAttributes\",\n          \"id\": \"progresshtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ProgressHTMLAttributes<T extends Element> extends Attrs<'progress', T> \\n```\\n**Extends:** Attrs&lt;'progress', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.progresshtmlattributes.md\"\n    },\n    {\n      \"name\": \"PropFnInterface\",\n      \"id\": \"propfninterface\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PropFnInterface\",\n          \"id\": \"propfninterface\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `QRL<>` instead\\n> \\n\\n\\n```typescript\\nexport type PropFnInterface<ARGS extends any[], RET> = {\\n    __qwik_serializable__?: any;\\n    (...args: ARGS): Promise<RET>;\\n};\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik.propfninterface.md\"\n    },\n    {\n      \"name\": \"PropFunction\",\n      \"id\": \"propfunction\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PropFunction\",\n          \"id\": \"propfunction\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Alias for `QRL<T>`<!-- -->. Of historic relevance only.\\n\\n\\n```typescript\\nexport type PropFunction<T> = QRL<T>;\\n```\\n**References:** [QRL](#qrl)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik.propfunction.md\"\n    },\n    {\n      \"name\": \"PropFunctionProps\",\n      \"id\": \"propfunctionprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PropFunctionProps\",\n          \"id\": \"propfunctionprops\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `QRL<>` on your function props instead\\n> \\n\\n\\n```typescript\\nexport type PropFunctionProps<PROPS extends Record<any, any>> = {\\n    [K in keyof PROPS]: PROPS[K] extends undefined ? PROPS[K] : PROPS[K] extends ((...args: infer ARGS) => infer RET) | undefined ? PropFnInterface<ARGS, Awaited<RET>> : PROPS[K];\\n};\\n```\\n**References:** [PropFnInterface](#propfninterface)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts\",\n      \"mdFile\": \"qwik.propfunctionprops.md\"\n    },\n    {\n      \"name\": \"PropsOf\",\n      \"id\": \"propsof\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PropsOf\",\n          \"id\": \"propsof\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Infers `Props` from the component or tag.\\n\\n\\n```typescript\\nexport type PropsOf<COMP> = COMP extends string ? COMP extends keyof QwikIntrinsicElements ? QwikIntrinsicElements[COMP] : QwikIntrinsicElements['span'] : NonNullable<COMP> extends never ? never : COMP extends FunctionComponent<infer PROPS> ? PROPS extends Record<any, infer V> ? IsAny<V> extends true ? never : ObjectProps<PROPS> : COMP extends Component<infer OrigProps> ? ObjectProps<OrigProps> : PROPS : never;\\n```\\n**References:** [QwikIntrinsicElements](#qwikintrinsicelements)<!-- -->, [FunctionComponent](#functioncomponent)<!-- -->, [Component](#component)\\n\\n\\n\\n```tsx\\nconst Desc = component$(({desc, ...props}: { desc: string } & PropsOf<'div'>) => {\\n return <div {...props}>{desc}</div>;\\n});\\n\\nconst TitleBox = component$(({title, ...props}: { title: string } & PropsOf<Box>) => {\\n  return <Box {...props}><h1>{title}</h1></Box>;\\n});\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts\",\n      \"mdFile\": \"qwik.propsof.md\"\n    },\n    {\n      \"name\": \"PublicProps\",\n      \"id\": \"publicprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PublicProps\",\n          \"id\": \"publicprops\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Extends the defined component PROPS, adding the default ones (children and q:slot) and allowing plain functions to QRL arguments.\\n\\n\\n```typescript\\nexport type PublicProps<PROPS> = (PROPS extends Record<any, any> ? Omit<PROPS, `${string}$`> & _Only$<PROPS> : unknown extends PROPS ? {} : PROPS) & ComponentBaseProps & ComponentChildren<PROPS>;\\n```\\n**References:** [ComponentBaseProps](#componentbaseprops)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts\",\n      \"mdFile\": \"qwik.publicprops.md\"\n    },\n    {\n      \"name\": \"qrl\",\n      \"id\": \"qrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"qrl\",\n          \"id\": \"qrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"The `QRL` type represents a lazy-loadable AND serializable resource.\\n\\nQRL stands for Qwik URL.\\n\\nUse `QRL` when you want to refer to a lazy-loaded resource. `QRL`<!-- -->s are most often used for code (functions) but can also be used for other resources such as `string`<!-- -->s in the case of styles.\\n\\n`QRL` is an opaque token that is generated by the Qwik Optimizer. (Do not rely on any properties in `QRL` as it may change between versions.)\\n\\n\\\\#\\\\# Creating `QRL` references\\n\\nCreating `QRL` is done using `$(...)` function. `$(...)` is a special marker for the Qwik Optimizer that marks that the code should be extracted into a lazy-loaded symbol.\\n\\n```tsx\\nuseOnDocument(\\n  'mousemove',\\n  $((event) => console.log('mousemove', event))\\n);\\n```\\nIn the above code, the Qwik Optimizer detects `$(...)` and transforms the code as shown below:\\n\\n```tsx\\n// FILE: <current file>\\nuseOnDocument('mousemove', qrl('./chunk-abc.js', 'onMousemove'));\\n\\n// FILE: chunk-abc.js\\nexport const onMousemove = () => console.log('mousemove');\\n```\\nNOTE: `qrl(...)` is a result of Qwik Optimizer transformation. You should never have to invoke this function directly in your application. The `qrl(...)` function should be invoked only after the Qwik Optimizer transformation.\\n\\n\\\\#\\\\# Using `QRL`<!-- -->s\\n\\nUse `QRL` type in your application when you want to get a lazy-loadable reference to a resource (most likely a function).\\n\\n```tsx\\n// Example of declaring a custom functions which takes callback as QRL.\\nexport function useMyFunction(callback: QRL<() => void>) {\\n  doExtraStuff();\\n  // The callback passed to `onDocument` requires `QRL`.\\n  useOnDocument('mousemove', callback);\\n}\\n```\\nIn the above example, the way to think about the code is that you are not asking for a callback function but rather a reference to a lazy-loadable callback function. Specifically, the function loading should be delayed until it is actually needed. In the above example, the function would not load until after a `mousemove` event on `document` fires.\\n\\n\\\\#\\\\# Resolving `QRL` references\\n\\nAt times it may be necessary to resolve a `QRL` reference to the actual value. This can be performed using `QRL.resolve(..)` function.\\n\\n```tsx\\n// Assume you have QRL reference to a greet function\\nconst lazyGreet: QRL<() => void> = $(() => console.log('Hello World!'));\\n\\n// Use `qrlImport` to load / resolve the reference.\\nconst greet: () => void = await lazyGreet.resolve();\\n\\n//  Invoke it\\ngreet();\\n```\\nNOTE: `element` is needed because `QRL`<!-- -->s are relative and need a base location to resolve against. The base location is encoded in the HTML in the form of `<div q:base=\\\"/url\\\">`<!-- -->.\\n\\n\\\\#\\\\# `QRL.resolved`\\n\\nOnce `QRL.resolve()` returns, the value is stored under `QRL.resolved`<!-- -->. This allows the value to be used without having to await `QRL.resolve()` again.\\n\\n\\\\#\\\\# Question: Why not just use `import()`<!-- -->?\\n\\nAt first glance, `QRL` serves the same purpose as `import()`<!-- -->. However, there are three subtle differences that need to be taken into account.\\n\\n1. `QRL`<!-- -->s must be serializable into HTML. 2. `QRL`<!-- -->s must be resolved by framework relative to `q:base`<!-- -->. 3. `QRL`<!-- -->s must be able to capture lexically scoped variables. 4. `QRL`<!-- -->s encapsulate the difference between running with and without Qwik Optimizer. 5. `QRL`<!-- -->s allow expressing lazy-loaded boundaries without thinking about chunk and symbol names.\\n\\nLet's assume that you intend to write code such as this:\\n\\n```tsx\\nreturn <button onClick={() => (await import('./chunk-abc.js')).onClick}>\\n```\\nThe above code needs to be serialized into DOM such as:\\n\\n```\\n<div q:base=\\\"/build/\\\">\\n  <button on:click=\\\"./chunk-abc.js#onClick\\\">...</button>\\n</div>\\n```\\n1. Notice there is no easy way to extract chunk (`./chunk-abc.js`<!-- -->) and symbol (`onClick`<!-- -->) into HTML. 2. Notice that even if you could extract it, the `import('./chunk-abc.js')` would become relative to where the `import()` file is declared. Because it is our framework doing the load, the `./chunk-abc.js` would become relative to the framework file. This is not correct, as it should be relative to the original file generated by the bundler. 3. Next, the framework needs to resolve the `./chunk-abc.js` and needs a base location that is encoded in the HTML. 4. The QRL needs to be able to capture lexically scoped variables. (`import()` only allows loading top-level symbols which don't capture variables.) 5. As a developer, you don't want to think about `import` and naming the chunks and symbols. You just want to say: \\\"this should be lazy.\\\"\\n\\nThese are the main reasons why Qwik introduces its own concept of `QRL`<!-- -->.\\n\\n\\n```typescript\\nexport type QRL<TYPE = unknown> = {\\n    __qwik_serializable__?: any;\\n    __brand__QRL__: TYPE;\\n    resolve(): Promise<TYPE>;\\n    resolved: undefined | TYPE;\\n    getCaptured(): unknown[] | null;\\n    getSymbol(): string;\\n    getHash(): string;\\n    dev: QRLDev | null;\\n} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.ts\",\n      \"mdFile\": \"qwik.qrl.md\"\n    },\n    {\n      \"name\": \"QRL\",\n      \"id\": \"qrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QRL\",\n          \"id\": \"qrl\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"The `QRL` type represents a lazy-loadable AND serializable resource.\\n\\nQRL stands for Qwik URL.\\n\\nUse `QRL` when you want to refer to a lazy-loaded resource. `QRL`<!-- -->s are most often used for code (functions) but can also be used for other resources such as `string`<!-- -->s in the case of styles.\\n\\n`QRL` is an opaque token that is generated by the Qwik Optimizer. (Do not rely on any properties in `QRL` as it may change between versions.)\\n\\n\\\\#\\\\# Creating `QRL` references\\n\\nCreating `QRL` is done using `$(...)` function. `$(...)` is a special marker for the Qwik Optimizer that marks that the code should be extracted into a lazy-loaded symbol.\\n\\n```tsx\\nuseOnDocument(\\n  'mousemove',\\n  $((event) => console.log('mousemove', event))\\n);\\n```\\nIn the above code, the Qwik Optimizer detects `$(...)` and transforms the code as shown below:\\n\\n```tsx\\n// FILE: <current file>\\nuseOnDocument('mousemove', qrl('./chunk-abc.js', 'onMousemove'));\\n\\n// FILE: chunk-abc.js\\nexport const onMousemove = () => console.log('mousemove');\\n```\\nNOTE: `qrl(...)` is a result of Qwik Optimizer transformation. You should never have to invoke this function directly in your application. The `qrl(...)` function should be invoked only after the Qwik Optimizer transformation.\\n\\n\\\\#\\\\# Using `QRL`<!-- -->s\\n\\nUse `QRL` type in your application when you want to get a lazy-loadable reference to a resource (most likely a function).\\n\\n```tsx\\n// Example of declaring a custom functions which takes callback as QRL.\\nexport function useMyFunction(callback: QRL<() => void>) {\\n  doExtraStuff();\\n  // The callback passed to `onDocument` requires `QRL`.\\n  useOnDocument('mousemove', callback);\\n}\\n```\\nIn the above example, the way to think about the code is that you are not asking for a callback function but rather a reference to a lazy-loadable callback function. Specifically, the function loading should be delayed until it is actually needed. In the above example, the function would not load until after a `mousemove` event on `document` fires.\\n\\n\\\\#\\\\# Resolving `QRL` references\\n\\nAt times it may be necessary to resolve a `QRL` reference to the actual value. This can be performed using `QRL.resolve(..)` function.\\n\\n```tsx\\n// Assume you have QRL reference to a greet function\\nconst lazyGreet: QRL<() => void> = $(() => console.log('Hello World!'));\\n\\n// Use `qrlImport` to load / resolve the reference.\\nconst greet: () => void = await lazyGreet.resolve();\\n\\n//  Invoke it\\ngreet();\\n```\\nNOTE: `element` is needed because `QRL`<!-- -->s are relative and need a base location to resolve against. The base location is encoded in the HTML in the form of `<div q:base=\\\"/url\\\">`<!-- -->.\\n\\n\\\\#\\\\# `QRL.resolved`\\n\\nOnce `QRL.resolve()` returns, the value is stored under `QRL.resolved`<!-- -->. This allows the value to be used without having to await `QRL.resolve()` again.\\n\\n\\\\#\\\\# Question: Why not just use `import()`<!-- -->?\\n\\nAt first glance, `QRL` serves the same purpose as `import()`<!-- -->. However, there are three subtle differences that need to be taken into account.\\n\\n1. `QRL`<!-- -->s must be serializable into HTML. 2. `QRL`<!-- -->s must be resolved by framework relative to `q:base`<!-- -->. 3. `QRL`<!-- -->s must be able to capture lexically scoped variables. 4. `QRL`<!-- -->s encapsulate the difference between running with and without Qwik Optimizer. 5. `QRL`<!-- -->s allow expressing lazy-loaded boundaries without thinking about chunk and symbol names.\\n\\nLet's assume that you intend to write code such as this:\\n\\n```tsx\\nreturn <button onClick={() => (await import('./chunk-abc.js')).onClick}>\\n```\\nThe above code needs to be serialized into DOM such as:\\n\\n```\\n<div q:base=\\\"/build/\\\">\\n  <button on:click=\\\"./chunk-abc.js#onClick\\\">...</button>\\n</div>\\n```\\n1. Notice there is no easy way to extract chunk (`./chunk-abc.js`<!-- -->) and symbol (`onClick`<!-- -->) into HTML. 2. Notice that even if you could extract it, the `import('./chunk-abc.js')` would become relative to where the `import()` file is declared. Because it is our framework doing the load, the `./chunk-abc.js` would become relative to the framework file. This is not correct, as it should be relative to the original file generated by the bundler. 3. Next, the framework needs to resolve the `./chunk-abc.js` and needs a base location that is encoded in the HTML. 4. The QRL needs to be able to capture lexically scoped variables. (`import()` only allows loading top-level symbols which don't capture variables.) 5. As a developer, you don't want to think about `import` and naming the chunks and symbols. You just want to say: \\\"this should be lazy.\\\"\\n\\nThese are the main reasons why Qwik introduces its own concept of `QRL`<!-- -->.\\n\\n\\n```typescript\\nexport type QRL<TYPE = unknown> = {\\n    __qwik_serializable__?: any;\\n    __brand__QRL__: TYPE;\\n    resolve(): Promise<TYPE>;\\n    resolved: undefined | TYPE;\\n    getCaptured(): unknown[] | null;\\n    getSymbol(): string;\\n    getHash(): string;\\n    dev: QRLDev | null;\\n} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik.qrl.md\"\n    },\n    {\n      \"name\": \"QRLEventHandlerMulti\",\n      \"id\": \"qrleventhandlermulti\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QRLEventHandlerMulti\",\n          \"id\": \"qrleventhandlermulti\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\nAn event handler for Qwik events, can be a handler QRL or an array of handler QRLs.\\n\\n\\n```typescript\\nexport type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[] | EventHandler<EV, EL>;\\n```\\n**References:** [QRL](#qrl)<!-- -->, [EventHandler](#eventhandler)<!-- -->, [QRLEventHandlerMulti](#qrleventhandlermulti)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.qrleventhandlermulti.md\"\n    },\n    {\n      \"name\": \"QuoteHTMLAttributes\",\n      \"id\": \"quotehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QuoteHTMLAttributes\",\n          \"id\": \"quotehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QuoteHTMLAttributes<T extends Element> extends Attrs<'q', T> \\n```\\n**Extends:** Attrs&lt;'q', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.quotehtmlattributes.md\"\n    },\n    {\n      \"name\": \"QwikAnimationEvent\",\n      \"id\": \"qwikanimationevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikAnimationEvent\",\n          \"id\": \"qwikanimationevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `AnimationEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikAnimationEvent<T = Element> = NativeAnimationEvent;\\n```\\n**References:** [NativeAnimationEvent](#nativeanimationevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikanimationevent.md\"\n    },\n    {\n      \"name\": \"QwikAttributes\",\n      \"id\": \"qwikattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikAttributes\",\n          \"id\": \"qwikattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"The Qwik DOM attributes without plain handlers, for use as function parameters\\n\\n\\n```typescript\\nexport interface QwikAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL, false> \\n```\\n**Extends:** DOMAttributesBase&lt;EL&gt;, QwikEvents&lt;EL, false&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[class?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[ClassList](#classlist) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts\",\n      \"mdFile\": \"qwik.qwikattributes.md\"\n    },\n    {\n      \"name\": \"QwikChangeEvent\",\n      \"id\": \"qwikchangeevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikChangeEvent\",\n          \"id\": \"qwikchangeevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `Event` and use the second argument to the handler function for the current event target. Also note that in Qwik, onInput$ with the InputEvent is the event that behaves like onChange in React.\\n> \\n\\n\\n```typescript\\nexport type QwikChangeEvent<T = Element> = Event;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikchangeevent.md\"\n    },\n    {\n      \"name\": \"QwikClipboardEvent\",\n      \"id\": \"qwikclipboardevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikClipboardEvent\",\n          \"id\": \"qwikclipboardevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `ClipboardEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikClipboardEvent<T = Element> = NativeClipboardEvent;\\n```\\n**References:** [NativeClipboardEvent](#nativeclipboardevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikclipboardevent.md\"\n    },\n    {\n      \"name\": \"QwikCompositionEvent\",\n      \"id\": \"qwikcompositionevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCompositionEvent\",\n          \"id\": \"qwikcompositionevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `CompositionEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikCompositionEvent<T = Element> = NativeCompositionEvent;\\n```\\n**References:** [NativeCompositionEvent](#nativecompositionevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikcompositionevent.md\"\n    },\n    {\n      \"name\": \"QwikDOMAttributes\",\n      \"id\": \"qwikdomattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikDOMAttributes\",\n          \"id\": \"qwikdomattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikDOMAttributes extends DOMAttributes<Element> \\n```\\n**Extends:** [DOMAttributes](#domattributes)<!-- -->&lt;Element&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik.ts\",\n      \"mdFile\": \"qwik.qwikdomattributes.md\"\n    },\n    {\n      \"name\": \"QwikDragEvent\",\n      \"id\": \"qwikdragevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikDragEvent\",\n          \"id\": \"qwikdragevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `DragEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikDragEvent<T = Element> = NativeDragEvent;\\n```\\n**References:** [NativeDragEvent](#nativedragevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikdragevent.md\"\n    },\n    {\n      \"name\": \"QwikFocusEvent\",\n      \"id\": \"qwikfocusevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikFocusEvent\",\n          \"id\": \"qwikfocusevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `FocusEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikFocusEvent<T = Element> = NativeFocusEvent;\\n```\\n**References:** [NativeFocusEvent](#nativefocusevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikfocusevent.md\"\n    },\n    {\n      \"name\": \"QwikHTMLElements\",\n      \"id\": \"qwikhtmlelements\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikHTMLElements\",\n          \"id\": \"qwikhtmlelements\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"The DOM props without plain handlers, for use inside functions\\n\\n\\n```typescript\\nexport type QwikHTMLElements = {\\n    [tag in keyof HTMLElementTagNameMap]: Augmented<HTMLElementTagNameMap[tag], SpecialAttrs[tag]> & HTMLElementAttrs & QwikAttributes<HTMLElementTagNameMap[tag]>;\\n};\\n```\\n**References:** [HTMLElementAttrs](#htmlelementattrs)<!-- -->, [QwikAttributes](#qwikattributes)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.qwikhtmlelements.md\"\n    },\n    {\n      \"name\": \"QwikIdleEvent\",\n      \"id\": \"qwikidleevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikIdleEvent\",\n          \"id\": \"qwikidleevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Emitted by qwik-loader on document when the document first becomes idle\\n\\n\\n```typescript\\nexport type QwikIdleEvent = CustomEvent<{}>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikidleevent.md\"\n    },\n    {\n      \"name\": \"QwikInitEvent\",\n      \"id\": \"qwikinitevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikInitEvent\",\n          \"id\": \"qwikinitevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Emitted by qwik-loader on document when the document first becomes interactive\\n\\n\\n```typescript\\nexport type QwikInitEvent = CustomEvent<{}>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikinitevent.md\"\n    },\n    {\n      \"name\": \"QwikIntrinsicElements\",\n      \"id\": \"qwikintrinsicelements\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikIntrinsicElements\",\n          \"id\": \"qwikintrinsicelements\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"The interface holds available attributes of both native DOM elements and custom Qwik elements. An example showing how to define a customizable wrapper component:\\n\\n```tsx\\nimport { component$, Slot, type QwikIntrinsicElements } from \\\"@builder.io/qwik\\\";\\n\\ntype WrapperProps = {\\n  attributes?: QwikIntrinsicElements[\\\"div\\\"];\\n};\\n\\nexport default component$<WrapperProps>(({ attributes }) => {\\n  return (\\n    <div {...attributes} class=\\\"p-2\\\">\\n      <Slot />\\n    </div>\\n  );\\n});\\n```\\nNote: It is shorter to use `PropsOf<'div'>`\\n\\n\\n```typescript\\nexport interface QwikIntrinsicElements extends QwikHTMLElements, QwikSVGElements \\n```\\n**Extends:** [QwikHTMLElements](#qwikhtmlelements)<!-- -->, [QwikSVGElements](#qwiksvgelements)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-elements.ts\",\n      \"mdFile\": \"qwik.qwikintrinsicelements.md\"\n    },\n    {\n      \"name\": \"QwikInvalidEvent\",\n      \"id\": \"qwikinvalidevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikInvalidEvent\",\n          \"id\": \"qwikinvalidevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `Event` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikInvalidEvent<T = Element> = Event;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikinvalidevent.md\"\n    },\n    {\n      \"name\": \"QwikJSX\",\n      \"id\": \"qwikjsx\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikJSX\",\n          \"id\": \"qwikjsx\"\n        }\n      ],\n      \"kind\": \"Namespace\",\n      \"content\": \"```typescript\\nexport declare namespace QwikJSX \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nInterface\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[ElementChildrenAttribute](#qwikjsx-elementchildrenattribute)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[IntrinsicAttributes](#qwikjsx-intrinsicattributes)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[IntrinsicElements](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n\\n<table><thead><tr><th>\\n\\nType Alias\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[Element](#qwikjsx-element)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ElementType](#qwikjsx-elementtype)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik.ts\",\n      \"mdFile\": \"qwik.qwikjsx.md\"\n    },\n    {\n      \"name\": \"QwikKeyboardEvent\",\n      \"id\": \"qwikkeyboardevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikKeyboardEvent\",\n          \"id\": \"qwikkeyboardevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `KeyboardEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikKeyboardEvent<T = Element> = NativeKeyboardEvent;\\n```\\n**References:** [NativeKeyboardEvent](#nativekeyboardevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikkeyboardevent.md\"\n    },\n    {\n      \"name\": \"QwikMouseEvent\",\n      \"id\": \"qwikmouseevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikMouseEvent\",\n          \"id\": \"qwikmouseevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `MouseEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikMouseEvent<T = Element, E = NativeMouseEvent> = E;\\n```\\n**References:** [NativeMouseEvent](#nativemouseevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikmouseevent.md\"\n    },\n    {\n      \"name\": \"QwikPointerEvent\",\n      \"id\": \"qwikpointerevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikPointerEvent\",\n          \"id\": \"qwikpointerevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `PointerEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikPointerEvent<T = Element> = NativePointerEvent;\\n```\\n**References:** [NativePointerEvent](#nativepointerevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikpointerevent.md\"\n    },\n    {\n      \"name\": \"QwikSubmitEvent\",\n      \"id\": \"qwiksubmitevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikSubmitEvent\",\n          \"id\": \"qwiksubmitevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `SubmitEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikSubmitEvent<T = Element> = SubmitEvent;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwiksubmitevent.md\"\n    },\n    {\n      \"name\": \"QwikSVGElements\",\n      \"id\": \"qwiksvgelements\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikSVGElements\",\n          \"id\": \"qwiksvgelements\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"The SVG props without plain handlers, for use inside functions\\n\\n\\n```typescript\\nexport type QwikSVGElements = {\\n    [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: SVGProps<SVGElementTagNameMap[K]>;\\n};\\n```\\n**References:** [SVGProps](#svgprops)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.qwiksvgelements.md\"\n    },\n    {\n      \"name\": \"QwikSymbolEvent\",\n      \"id\": \"qwiksymbolevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikSymbolEvent\",\n          \"id\": \"qwiksymbolevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Emitted by qwik-loader when a module was lazily loaded\\n\\n\\n```typescript\\nexport type QwikSymbolEvent = CustomEvent<{\\n    symbol: string;\\n    element: Element;\\n    reqTime: number;\\n    qBase?: string;\\n    qManifest?: string;\\n    qVersion?: string;\\n    href?: string;\\n}>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwiksymbolevent.md\"\n    },\n    {\n      \"name\": \"QwikTouchEvent\",\n      \"id\": \"qwiktouchevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikTouchEvent\",\n          \"id\": \"qwiktouchevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `TouchEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikTouchEvent<T = Element> = NativeTouchEvent;\\n```\\n**References:** [NativeTouchEvent](#nativetouchevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwiktouchevent.md\"\n    },\n    {\n      \"name\": \"QwikTransitionEvent\",\n      \"id\": \"qwiktransitionevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikTransitionEvent\",\n          \"id\": \"qwiktransitionevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `TransitionEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikTransitionEvent<T = Element> = NativeTransitionEvent;\\n```\\n**References:** [NativeTransitionEvent](#nativetransitionevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwiktransitionevent.md\"\n    },\n    {\n      \"name\": \"QwikUIEvent\",\n      \"id\": \"qwikuievent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikUIEvent\",\n          \"id\": \"qwikuievent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `UIEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikUIEvent<T = Element> = NativeUIEvent;\\n```\\n**References:** [NativeUIEvent](#nativeuievent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikuievent.md\"\n    },\n    {\n      \"name\": \"QwikVisibleEvent\",\n      \"id\": \"qwikvisibleevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikVisibleEvent\",\n          \"id\": \"qwikvisibleevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Emitted by qwik-loader when an element becomes visible. Used by `useVisibleTask$`\\n\\n\\n```typescript\\nexport type QwikVisibleEvent = CustomEvent<IntersectionObserverEntry>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikvisibleevent.md\"\n    },\n    {\n      \"name\": \"QwikWheelEvent\",\n      \"id\": \"qwikwheelevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikWheelEvent\",\n          \"id\": \"qwikwheelevent\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `WheelEvent` and use the second argument to the handler function for the current event target\\n> \\n\\n\\n```typescript\\nexport type QwikWheelEvent<T = Element> = NativeWheelEvent;\\n```\\n**References:** [NativeWheelEvent](#nativewheelevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts\",\n      \"mdFile\": \"qwik.qwikwheelevent.md\"\n    },\n    {\n      \"name\": \"ReadonlySignal\",\n      \"id\": \"readonlysignal\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ReadonlySignal\",\n          \"id\": \"readonlysignal\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ReadonlySignal<T = unknown> = Readonly<Signal<T>>;\\n```\\n**References:** [Signal](#signal)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/signal.ts\",\n      \"mdFile\": \"qwik.readonlysignal.md\"\n    },\n    {\n      \"name\": \"render\",\n      \"id\": \"render\",\n      \"hierarchy\": [\n        {\n          \"name\": \"render\",\n          \"id\": \"render\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Render JSX.\\n\\nUse this method to render JSX. This function does reconciling which means it always tries to reuse what is already in the DOM (rather then destroy and recreate content.) It returns a cleanup function you could use for cleaning up subscriptions.\\n\\n\\n```typescript\\nrender: (parent: Element | Document, jsxOutput: JSXOutput | FunctionComponent<any>, opts?: RenderOptions) => Promise<RenderResult>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nparent\\n\\n\\n</td><td>\\n\\nElement \\\\| Document\\n\\n\\n</td><td>\\n\\nElement which will act as a parent to `jsxNode`<!-- -->. When possible the rendering will try to reuse existing nodes.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\njsxOutput\\n\\n\\n</td><td>\\n\\n[JSXOutput](#jsxoutput) \\\\| [FunctionComponent](#functioncomponent)<!-- -->&lt;any&gt;\\n\\n\\n</td><td>\\n\\nJSX to render\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[RenderOptions](#renderoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nPromise&lt;[RenderResult](#renderresult)<!-- -->&gt;\\n\\nAn object containing a cleanup function.\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/dom/render.public.ts\",\n      \"mdFile\": \"qwik.render.md\"\n    },\n    {\n      \"name\": \"RenderOnce\",\n      \"id\": \"renderonce\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderOnce\",\n          \"id\": \"renderonce\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nRenderOnce: FunctionComponent<{\\n    children?: unknown;\\n    key?: string | number | null | undefined;\\n}>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts\",\n      \"mdFile\": \"qwik.renderonce.md\"\n    },\n    {\n      \"name\": \"RenderOptions\",\n      \"id\": \"renderoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderOptions\",\n          \"id\": \"renderoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[serverData?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/dom/render.public.ts\",\n      \"mdFile\": \"qwik.renderoptions.md\"\n    },\n    {\n      \"name\": \"RenderResult\",\n      \"id\": \"renderresult\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderResult\",\n          \"id\": \"renderresult\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderResult \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nMethod\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[cleanup()](#renderresult-cleanup)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/dom/render.public.ts\",\n      \"mdFile\": \"qwik.renderresult.md\"\n    },\n    {\n      \"name\": \"RenderSSROptions\",\n      \"id\": \"renderssroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderSSROptions\",\n          \"id\": \"renderssroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderSSROptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[base?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[beforeClose?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(contexts: QContext\\\\[\\\\], containerState: ContainerState, containsDynamic: boolean, textNodes: Map&lt;string, string&gt;) =&gt; Promise&lt;[JSXNode](#jsxnode)<!-- -->&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[beforeContent?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[JSXNode](#jsxnode)<!-- -->&lt;string&gt;\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[containerAttributes](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[containerTagName](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[manifestHash](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[serverData?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stream](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[StreamWriter](#streamwriter)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/ssr/render-ssr.ts\",\n      \"mdFile\": \"qwik.renderssroptions.md\"\n    },\n    {\n      \"name\": \"Resource\",\n      \"id\": \"resource\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Resource\",\n          \"id\": \"resource\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"This method works like an async memoized function that runs whenever some tracked value changes and returns some data.\\n\\n`useResource` however returns immediate a `ResourceReturn` object that contains the data and a state that indicates if the data is available or not.\\n\\nThe status can be one of the following:\\n\\n- 'pending' - the data is not yet available. - 'resolved' - the data is available. - 'rejected' - the data is not available due to an error or timeout.\\n\\n\\\\#\\\\#\\\\# Example\\n\\nExample showing how `useResource` to perform a fetch to request the weather, whenever the input city name changes.\\n\\n```tsx\\nconst Cmp = component$(() => {\\n  const cityS = useSignal('');\\n\\n  const weatherResource = useResource$(async ({ track, cleanup }) => {\\n    const cityName = track(cityS);\\n    const abortController = new AbortController();\\n    cleanup(() => abortController.abort('cleanup'));\\n    const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\\n      signal: abortController.signal,\\n    });\\n    const data = await res.json();\\n    return data as { temp: number };\\n  });\\n\\n  return (\\n    <div>\\n      <input name=\\\"city\\\" bind:value={cityS} />\\n      <Resource\\n        value={weatherResource}\\n        onResolved={(weather) => {\\n          return <div>Temperature: {weather.temp}</div>;\\n        }}\\n      />\\n    </div>\\n  );\\n});\\n```\\n\\n\\n```typescript\\nResource: <T>(props: ResourceProps<T>) => JSXOutput\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nprops\\n\\n\\n</td><td>\\n\\n[ResourceProps](#resourceprops)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[JSXOutput](#jsxoutput)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts\",\n      \"mdFile\": \"qwik.resource.md\"\n    },\n    {\n      \"name\": \"ResourceCtx\",\n      \"id\": \"resourcectx\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceCtx\",\n          \"id\": \"resourcectx\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResourceCtx<T> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[previous](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nT \\\\| undefined\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[track](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[Tracker](#tracker)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n\\n<table><thead><tr><th>\\n\\nMethod\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[cache(policyOrMilliseconds)](#resourcectx-cache)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[cleanup(callback)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.resourcectx.md\"\n    },\n    {\n      \"name\": \"ResourceFn\",\n      \"id\": \"resourcefn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceFn\",\n          \"id\": \"resourcefn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ResourceFn<T> = (ctx: ResourceCtx<unknown>) => ValueOrPromise<T>;\\n```\\n**References:** [ResourceCtx](#resourcectx)<!-- -->, [ValueOrPromise](#valueorpromise)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.resourcefn.md\"\n    },\n    {\n      \"name\": \"ResourceOptions\",\n      \"id\": \"resourceoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceOptions\",\n          \"id\": \"resourceoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"Options to pass to `useResource$()`\\n\\n\\n```typescript\\nexport interface ResourceOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[timeout?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ Timeout in milliseconds. If the resource takes more than the specified millisecond, it will timeout. Resulting on a rejected resource.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts\",\n      \"mdFile\": \"qwik.resourceoptions.md\"\n    },\n    {\n      \"name\": \"ResourcePending\",\n      \"id\": \"resourcepending\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourcePending\",\n          \"id\": \"resourcepending\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResourcePending<T> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[loading](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[value](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nPromise&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.resourcepending.md\"\n    },\n    {\n      \"name\": \"ResourceProps\",\n      \"id\": \"resourceprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceProps\",\n          \"id\": \"resourceprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResourceProps<T> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[onPending?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; [JSXOutput](#jsxoutput) \\\\| Promise&lt;[JSXOutput](#jsxoutput)<!-- -->&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[onRejected?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(reason: Error) =&gt; [JSXOutput](#jsxoutput) \\\\| Promise&lt;[JSXOutput](#jsxoutput)<!-- -->&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[onResolved](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(value: T) =&gt; [JSXOutput](#jsxoutput) \\\\| Promise&lt;[JSXOutput](#jsxoutput)<!-- -->&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[value](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[ResourceReturn](#resourcereturn)<!-- -->&lt;T&gt; \\\\| [Signal](#signal)<!-- -->&lt;Promise&lt;T&gt; \\\\| T&gt; \\\\| Promise&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts\",\n      \"mdFile\": \"qwik.resourceprops.md\"\n    },\n    {\n      \"name\": \"ResourceRejected\",\n      \"id\": \"resourcerejected\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceRejected\",\n          \"id\": \"resourcerejected\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResourceRejected<T> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[loading](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[value](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nPromise&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.resourcerejected.md\"\n    },\n    {\n      \"name\": \"ResourceResolved\",\n      \"id\": \"resourceresolved\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceResolved\",\n          \"id\": \"resourceresolved\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResourceResolved<T> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[loading](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[value](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nPromise&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.resourceresolved.md\"\n    },\n    {\n      \"name\": \"ResourceReturn\",\n      \"id\": \"resourcereturn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResourceReturn\",\n          \"id\": \"resourcereturn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ResourceReturn<T> = ResourcePending<T> | ResourceResolved<T> | ResourceRejected<T>;\\n```\\n**References:** [ResourcePending](#resourcepending)<!-- -->, [ResourceResolved](#resourceresolved)<!-- -->, [ResourceRejected](#resourcerejected)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.resourcereturn.md\"\n    },\n    {\n      \"name\": \"ScriptHTMLAttributes\",\n      \"id\": \"scripthtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ScriptHTMLAttributes\",\n          \"id\": \"scripthtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ScriptHTMLAttributes<T extends Element> extends Attrs<'script', T> \\n```\\n**Extends:** Attrs&lt;'script', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.scripthtmlattributes.md\"\n    },\n    {\n      \"name\": \"SelectHTMLAttributes\",\n      \"id\": \"selecthtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SelectHTMLAttributes\",\n          \"id\": \"selecthtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SelectHTMLAttributes<T extends Element> extends Attrs<'select', T> \\n```\\n**Extends:** Attrs&lt;'select', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.selecthtmlattributes.md\"\n    },\n    {\n      \"name\": \"setPlatform\",\n      \"id\": \"setplatform\",\n      \"hierarchy\": [\n        {\n          \"name\": \"setPlatform\",\n          \"id\": \"setplatform\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Sets the `CorePlatform`<!-- -->.\\n\\nThis is useful to override the platform in tests to change the behavior of, `requestAnimationFrame`<!-- -->, and import resolution.\\n\\n\\n```typescript\\nsetPlatform: (plt: CorePlatform) => CorePlatform\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nplt\\n\\n\\n</td><td>\\n\\n[CorePlatform](#coreplatform)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[CorePlatform](#coreplatform)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/platform/platform.ts\",\n      \"mdFile\": \"qwik.setplatform.md\"\n    },\n    {\n      \"name\": \"Signal\",\n      \"id\": \"signal\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Signal\",\n          \"id\": \"signal\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"A signal is a reactive value which can be read and written. When the signal is written, all tasks which are tracking the signal will be re-run and all components that read the signal will be re-rendered.\\n\\nFurthermore, when a signal value is passed as a prop to a component, the optimizer will automatically forward the signal. This means that `return <div title={signal.value}>hi</div>` will update the `title` attribute when the signal changes without having to re-render the component.\\n\\n\\n```typescript\\nexport interface Signal<T = any> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[value](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/signal.ts\",\n      \"mdFile\": \"qwik.signal.md\"\n    },\n    {\n      \"name\": \"Size\",\n      \"id\": \"size\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Size\",\n          \"id\": \"size\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type Size = number | string;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.size.md\"\n    },\n    {\n      \"name\": \"SkipRender\",\n      \"id\": \"skiprender\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SkipRender\",\n          \"id\": \"skiprender\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nSkipRender: JSXNode\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.skiprender.md\"\n    },\n    {\n      \"name\": \"Slot\",\n      \"id\": \"slot\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Slot\",\n          \"id\": \"slot\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"Allows to project the children of the current component. `<Slot/>` can only be used within the context of a component defined with `component$`<!-- -->.\\n\\n\\n```typescript\\nSlot: FunctionComponent<{\\n    name?: string;\\n}>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/slot.public.ts\",\n      \"mdFile\": \"qwik.slot.md\"\n    },\n    {\n      \"name\": \"SlotHTMLAttributes\",\n      \"id\": \"slothtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SlotHTMLAttributes\",\n          \"id\": \"slothtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SlotHTMLAttributes<T extends Element> extends Attrs<'slot', T> \\n```\\n**Extends:** Attrs&lt;'slot', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.slothtmlattributes.md\"\n    },\n    {\n      \"name\": \"SnapshotListener\",\n      \"id\": \"snapshotlistener\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SnapshotListener\",\n          \"id\": \"snapshotlistener\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SnapshotListener \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[el](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nElement\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[key](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[qrl](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;any&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts\",\n      \"mdFile\": \"qwik.snapshotlistener.md\"\n    },\n    {\n      \"name\": \"SnapshotMeta\",\n      \"id\": \"snapshotmeta\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SnapshotMeta\",\n          \"id\": \"snapshotmeta\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type SnapshotMeta = Record<string, SnapshotMetaValue>;\\n```\\n**References:** [SnapshotMetaValue](#snapshotmetavalue)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts\",\n      \"mdFile\": \"qwik.snapshotmeta.md\"\n    },\n    {\n      \"name\": \"SnapshotMetaValue\",\n      \"id\": \"snapshotmetavalue\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SnapshotMetaValue\",\n          \"id\": \"snapshotmetavalue\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SnapshotMetaValue \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[c?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[h?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[s?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[w?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts\",\n      \"mdFile\": \"qwik.snapshotmetavalue.md\"\n    },\n    {\n      \"name\": \"SnapshotResult\",\n      \"id\": \"snapshotresult\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SnapshotResult\",\n          \"id\": \"snapshotresult\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SnapshotResult \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[funcs](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mode](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'render' \\\\| 'listeners' \\\\| 'static'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[objs](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nany\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[qrls](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[resources](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nResourceReturnInternal&lt;any&gt;\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[state](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[SnapshotState](#snapshotstate)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts\",\n      \"mdFile\": \"qwik.snapshotresult.md\"\n    },\n    {\n      \"name\": \"SnapshotState\",\n      \"id\": \"snapshotstate\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SnapshotState\",\n          \"id\": \"snapshotstate\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SnapshotState \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[ctx](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[SnapshotMeta](#snapshotmeta)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[objs](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nany\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[refs](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[subs](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nany\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts\",\n      \"mdFile\": \"qwik.snapshotstate.md\"\n    },\n    {\n      \"name\": \"SourceHTMLAttributes\",\n      \"id\": \"sourcehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SourceHTMLAttributes\",\n          \"id\": \"sourcehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SourceHTMLAttributes<T extends Element> extends Attrs<'source', T> \\n```\\n**Extends:** Attrs&lt;'source', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.sourcehtmlattributes.md\"\n    },\n    {\n      \"name\": \"SSRComment\",\n      \"id\": \"ssrcomment\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SSRComment\",\n          \"id\": \"ssrcomment\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nSSRComment: FunctionComponent<{\\n    data: string;\\n}>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.ssrcomment.md\"\n    },\n    {\n      \"name\": \"SSRHint\",\n      \"id\": \"ssrhint\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SSRHint\",\n          \"id\": \"ssrhint\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> - It has no effect\\n> \\n\\n\\n```typescript\\nSSRHint: FunctionComponent<SSRHintProps>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.ssrhint.md\"\n    },\n    {\n      \"name\": \"SSRHintProps\",\n      \"id\": \"ssrhintprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SSRHintProps\",\n          \"id\": \"ssrhintprops\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type SSRHintProps = {\\n    dynamic?: boolean;\\n};\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.ssrhintprops.md\"\n    },\n    {\n      \"name\": \"SSRRaw\",\n      \"id\": \"ssrraw\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SSRRaw\",\n          \"id\": \"ssrraw\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nSSRRaw: FunctionComponent<{\\n    data: string;\\n}>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.ssrraw.md\"\n    },\n    {\n      \"name\": \"SSRStream\",\n      \"id\": \"ssrstream\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SSRStream\",\n          \"id\": \"ssrstream\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nSSRStream: FunctionComponent<SSRStreamProps>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.ssrstream.md\"\n    },\n    {\n      \"name\": \"SSRStreamBlock\",\n      \"id\": \"ssrstreamblock\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SSRStreamBlock\",\n          \"id\": \"ssrstreamblock\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nSSRStreamBlock: FunctionComponent<{\\n    children?: any;\\n}>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.ssrstreamblock.md\"\n    },\n    {\n      \"name\": \"SSRStreamProps\",\n      \"id\": \"ssrstreamprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SSRStreamProps\",\n          \"id\": \"ssrstreamprops\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type SSRStreamProps = {\\n    children: AsyncGenerator<JSXChildren, void, any> | ((stream: StreamWriter) => Promise<void>) | (() => AsyncGenerator<JSXChildren, void, any>);\\n};\\n```\\n**References:** [JSXChildren](#jsxchildren)<!-- -->, [StreamWriter](#streamwriter)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts\",\n      \"mdFile\": \"qwik.ssrstreamprops.md\"\n    },\n    {\n      \"name\": \"StreamWriter\",\n      \"id\": \"streamwriter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StreamWriter\",\n          \"id\": \"streamwriter\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type StreamWriter = {\\n    write: (chunk: string) => void;\\n};\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/ssr/render-ssr.ts\",\n      \"mdFile\": \"qwik.streamwriter.md\"\n    },\n    {\n      \"name\": \"StyleHTMLAttributes\",\n      \"id\": \"stylehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StyleHTMLAttributes\",\n          \"id\": \"stylehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface StyleHTMLAttributes<T extends Element> extends Attrs<'style', T> \\n```\\n**Extends:** Attrs&lt;'style', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.stylehtmlattributes.md\"\n    },\n    {\n      \"name\": \"SVGAttributes\",\n      \"id\": \"svgattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGAttributes\",\n          \"id\": \"svgattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"The TS types don't include the SVG attributes so we have to define them ourselves\\n\\nNOTE: These props are probably not complete\\n\\n\\n```typescript\\nexport interface SVGAttributes<T extends Element = Element> extends AriaAttributes \\n```\\n**Extends:** [AriaAttributes](#ariaattributes)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[\\\"accent-height\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"alignment-baseline\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'auto' \\\\| 'baseline' \\\\| 'before-edge' \\\\| 'text-before-edge' \\\\| 'middle' \\\\| 'central' \\\\| 'after-edge' \\\\| 'text-after-edge' \\\\| 'ideographic' \\\\| 'alphabetic' \\\\| 'hanging' \\\\| 'mathematical' \\\\| 'inherit' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"arabic-form\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'initial' \\\\| 'medial' \\\\| 'terminal' \\\\| 'isolated' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"baseline-shift\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"cap-height\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"clip-path\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"clip-rule\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"color-interpolation-filters\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'auto' \\\\| 's-rGB' \\\\| 'linear-rGB' \\\\| 'inherit' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"color-interpolation\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"color-profile\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"color-rendering\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"dominant-baseline\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"edge-mode\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"enable-background\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"fill-opacity\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"fill-rule\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'nonzero' \\\\| 'evenodd' \\\\| 'inherit' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"flood-color\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"flood-opacity\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"font-family\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"font-size-adjust\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"font-size\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"font-stretch\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"font-style\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"font-variant\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"font-weight\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"glyph-name\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"glyph-orientation-horizontal\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"glyph-orientation-vertical\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"horiz-adv-x\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"horiz-origin-x\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"image-rendering\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"letter-spacing\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"lighting-color\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"marker-end\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"marker-mid\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"marker-start\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"overline-position\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"overline-thickness\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"paint-order\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"pointer-events\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"rendering-intent\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"shape-rendering\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stop-color\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stop-opacity\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"strikethrough-position\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"strikethrough-thickness\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stroke-dasharray\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stroke-dashoffset\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stroke-linecap\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'butt' \\\\| 'round' \\\\| 'square' \\\\| 'inherit' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stroke-linejoin\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'miter' \\\\| 'round' \\\\| 'bevel' \\\\| 'inherit' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stroke-miterlimit\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stroke-opacity\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"stroke-width\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"text-anchor\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"text-decoration\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"text-rendering\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"underline-position\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"underline-thickness\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"unicode-bidi\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"unicode-range\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"units-per-em\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"v-alphabetic\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"v-hanging\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"v-ideographic\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"v-mathematical\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"vector-effect\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"vert-adv-y\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"vert-origin-x\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"vert-origin-y\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"word-spacing\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"writing-mode\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"x-channel-selector\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"x-height\\\"?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xlink:actuate\\\"?](#svgattributes-_xlink_actuate_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xlink:arcrole\\\"?](#svgattributes-_xlink_arcrole_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xlink:href\\\"?](#svgattributes-_xlink_href_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xlink:role\\\"?](#svgattributes-_xlink_role_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xlink:show\\\"?](#svgattributes-_xlink_show_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xlink:title\\\"?](#svgattributes-_xlink_title_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xlink:type\\\"?](#svgattributes-_xlink_type_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xml:base\\\"?](#svgattributes-_xml_base_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xml:lang\\\"?](#svgattributes-_xml_lang_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xml:space\\\"?](#svgattributes-_xml_space_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\"xmlns:xlink\\\"?](#svgattributes-_xmlns_xlink_)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[accumulate?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'none' \\\\| 'sum' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[additive?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'replace' \\\\| 'sum' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[allowReorder?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'no' \\\\| 'yes' \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[alphabetic?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[amplitude?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ascent?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[attributeName?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[attributeType?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[autoReverse?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Booleanish](#booleanish) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[azimuth?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[baseFrequency?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[baseProfile?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[bbox?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[begin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[bias?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[by?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[calcMode?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[clip?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[clipPathUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[color?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[contentScriptType?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[contentStyleType?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[crossOrigin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[HTMLCrossOriginAttribute](#htmlcrossoriginattribute)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[cursor?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[cx?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[cy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[d?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[decelerate?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[descent?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[diffuseConstant?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[direction?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[display?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[divisor?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[dur?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[dx?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[dy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[elevation?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[end?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[exponent?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[externalResourcesRequired?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[fill?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[filter?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[filterRes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[filterUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[focusable?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[format?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[fr?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[from?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[fx?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[fy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[g1?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[g2?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[glyphRef?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[gradientTransform?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[gradientUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[hanging?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[height?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Size](#size) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[href?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[id?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ideographic?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[in?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[in2?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[intercept?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[k?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[k1?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[k2?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[k3?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[k4?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[kernelMatrix?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[kernelUnitLength?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[kerning?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[keyPoints?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[keySplines?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[keyTimes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[lang?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[lengthAdjust?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[limitingConeAngle?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[local?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[markerHeight?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[markerUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[markerWidth?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mask?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[maskContentUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[maskUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mathematical?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[max?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[media?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[method?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[min?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mode?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[name?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[numOctaves?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[offset?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[opacity?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[operator?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[order?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[orient?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[orientation?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[origin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[overflow?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[panose1?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[path?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[pathLength?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[patternContentUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[patternTransform?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[patternUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[points?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[pointsAtX?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[pointsAtY?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[pointsAtZ?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[preserveAlpha?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[preserveAspectRatio?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[primitiveUnits?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[r?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[radius?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[refX?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[refY?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[repeatCount?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[repeatDur?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[requiredextensions?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[requiredFeatures?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[restart?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[result?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[role?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rotate?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rx?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ry?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[scale?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[seed?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[slope?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[spacing?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[specularConstant?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[specularExponent?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[speed?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[spreadMethod?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[startOffset?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stdDeviation?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stemh?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stemv?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stitchTiles?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[string?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stroke?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[style?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[CSSProperties](#cssproperties) \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[surfaceScale?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[systemLanguage?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[tabindex?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[tableValues?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[target?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[targetX?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[targetY?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[textLength?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[to?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[transform?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[type?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[u1?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[u2?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[unicode?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[values?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[version?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[viewBox?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[viewTarget?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[visibility?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[width?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Size](#size) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[widths?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[x?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[x1?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[x2?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[xmlns?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[y?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[y1?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[y2?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[yChannelSelector?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[z?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| string \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[zoomAndPan?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.svgattributes.md\"\n    },\n    {\n      \"name\": \"SVGProps\",\n      \"id\": \"svgprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SVGProps\",\n          \"id\": \"svgprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T> \\n```\\n**Extends:** [SVGAttributes](#svgattributes)<!-- -->, [QwikAttributes](#qwikattributes)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.svgprops.md\"\n    },\n    {\n      \"name\": \"sync$\",\n      \"id\": \"sync_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"sync$\",\n          \"id\": \"sync_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\nExtract function into a synchronously loadable QRL.\\n\\nNOTE: Synchronous QRLs functions can't close over any variables, including exports.\\n\\n\\n```typescript\\nsync$: <T extends Function>(fn: T) => SyncQRL<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nfn\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\nFunction to extract.\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[SyncQRL](#syncqrl)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik.sync_.md\"\n    },\n    {\n      \"name\": \"SyncQRL\",\n      \"id\": \"syncqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SyncQRL\",\n          \"id\": \"syncqrl\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nexport interface SyncQRL<TYPE extends Function = any> extends QRL<TYPE> \\n```\\n**Extends:** [QRL](#qrl)<!-- -->&lt;TYPE&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[\\\\_\\\\_brand\\\\_\\\\_SyncQRL\\\\_\\\\_](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nTYPE\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_**\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[dev](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nQRLDev \\\\| null\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_**\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[resolved](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nTYPE\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_**\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts\",\n      \"mdFile\": \"qwik.syncqrl.md\"\n    },\n    {\n      \"name\": \"TableHTMLAttributes\",\n      \"id\": \"tablehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TableHTMLAttributes\",\n          \"id\": \"tablehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TableHTMLAttributes<T extends Element> extends Attrs<'table', T> \\n```\\n**Extends:** Attrs&lt;'table', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.tablehtmlattributes.md\"\n    },\n    {\n      \"name\": \"TaskCtx\",\n      \"id\": \"taskctx\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TaskCtx\",\n          \"id\": \"taskctx\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TaskCtx \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[track](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Tracker](#tracker)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n\\n<table><thead><tr><th>\\n\\nMethod\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[cleanup(callback)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.taskctx.md\"\n    },\n    {\n      \"name\": \"TaskFn\",\n      \"id\": \"taskfn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TaskFn\",\n          \"id\": \"taskfn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => void)>;\\n```\\n**References:** [TaskCtx](#taskctx)<!-- -->, [ValueOrPromise](#valueorpromise)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.taskfn.md\"\n    },\n    {\n      \"name\": \"TdHTMLAttributes\",\n      \"id\": \"tdhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TdHTMLAttributes\",\n          \"id\": \"tdhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TdHTMLAttributes<T extends Element> extends Attrs<'td', T> \\n```\\n**Extends:** Attrs&lt;'td', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.tdhtmlattributes.md\"\n    },\n    {\n      \"name\": \"TextareaHTMLAttributes\",\n      \"id\": \"textareahtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TextareaHTMLAttributes\",\n          \"id\": \"textareahtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TextareaHTMLAttributes<T extends Element> extends Attrs<'textarea', T> \\n```\\n**Extends:** Attrs&lt;'textarea', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.textareahtmlattributes.md\"\n    },\n    {\n      \"name\": \"ThHTMLAttributes\",\n      \"id\": \"thhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ThHTMLAttributes\",\n          \"id\": \"thhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ThHTMLAttributes<T extends Element> extends Attrs<'tr', T> \\n```\\n**Extends:** Attrs&lt;'tr', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.thhtmlattributes.md\"\n    },\n    {\n      \"name\": \"TimeHTMLAttributes\",\n      \"id\": \"timehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TimeHTMLAttributes\",\n          \"id\": \"timehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TimeHTMLAttributes<T extends Element> extends Attrs<'time', T> \\n```\\n**Extends:** Attrs&lt;'time', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.timehtmlattributes.md\"\n    },\n    {\n      \"name\": \"TitleHTMLAttributes\",\n      \"id\": \"titlehtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TitleHTMLAttributes\",\n          \"id\": \"titlehtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TitleHTMLAttributes<T extends Element> extends Attrs<'title', T> \\n```\\n**Extends:** Attrs&lt;'title', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.titlehtmlattributes.md\"\n    },\n    {\n      \"name\": \"Tracker\",\n      \"id\": \"tracker\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Tracker\",\n          \"id\": \"tracker\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"Used to signal to Qwik which state should be watched for changes.\\n\\nThe `Tracker` is passed into the `taskFn` of `useTask`<!-- -->. It is intended to be used to wrap state objects in a read proxy which signals to Qwik which properties should be watched for changes. A change to any of the properties causes the `taskFn` to rerun.\\n\\n\\\\#\\\\#\\\\# Example\\n\\nThe `obs` passed into the `taskFn` is used to mark `state.count` as a property of interest. Any changes to the `state.count` property will cause the `taskFn` to rerun.\\n\\n```tsx\\nconst Cmp = component$(() => {\\n  const store = useStore({ count: 0, doubleCount: 0 });\\n  const signal = useSignal(0);\\n  useTask$(({ track }) => {\\n    // Any signals or stores accessed inside the task will be tracked\\n    const count = track(() => store.count);\\n    // You can also pass a signal to track() directly\\n    const signalCount = track(signal);\\n    store.doubleCount = count + signalCount;\\n  });\\n  return (\\n    <div>\\n      <span>\\n        {store.count} / {store.doubleCount}\\n      </span>\\n      <button\\n        onClick$={() => {\\n          store.count++;\\n          signal.value++;\\n        }}\\n      >\\n        +\\n      </button>\\n    </div>\\n  );\\n});\\n```\\n\\n\\n```typescript\\nexport interface Tracker \\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.tracker.md\"\n    },\n    {\n      \"name\": \"TrackHTMLAttributes\",\n      \"id\": \"trackhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TrackHTMLAttributes\",\n          \"id\": \"trackhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TrackHTMLAttributes<T extends Element> extends Attrs<'track', T> \\n```\\n**Extends:** Attrs&lt;'track', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.trackhtmlattributes.md\"\n    },\n    {\n      \"name\": \"untrack\",\n      \"id\": \"untrack\",\n      \"hierarchy\": [\n        {\n          \"name\": \"untrack\",\n          \"id\": \"untrack\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Get the value of the expression without tracking listeners. A function will be invoked, signals will return their value, and stores will be unwrapped (they return the backing object).\\n\\nWhen you pass a function, you can also pass additional arguments that the function will receive.\\n\\nNote that stores are not unwrapped recursively.\\n\\n\\n```typescript\\nuntrack: <T, A extends any[]>(expr: ((...args: A) => T) | Signal<T> | T, ...args: A) => T\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nexpr\\n\\n\\n</td><td>\\n\\n((...args: A) =&gt; T) \\\\| [Signal](#signal)<!-- -->&lt;T&gt; \\\\| T\\n\\n\\n</td><td>\\n\\nThe function or object to evaluate without tracking.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nargs\\n\\n\\n</td><td>\\n\\nA\\n\\n\\n</td><td>\\n\\nAdditional arguments to pass when `expr` is a function.\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nT\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-core.ts\",\n      \"mdFile\": \"qwik.untrack.md\"\n    },\n    {\n      \"name\": \"unwrapStore\",\n      \"id\": \"unwrapstore\",\n      \"hierarchy\": [\n        {\n          \"name\": \"unwrapStore\",\n          \"id\": \"unwrapstore\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Get the target value of the Proxy. Useful if you want to clone a store (structureClone, IndexedDB,...)\\n\\n\\n```typescript\\nunwrapProxy: <T>(proxy: T) => T\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nproxy\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nT\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/common.ts\",\n      \"mdFile\": \"qwik.unwrapstore.md\"\n    },\n    {\n      \"name\": \"useComputed$\",\n      \"id\": \"usecomputed_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useComputed$\",\n          \"id\": \"usecomputed_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Returns a computed signal which is calculated from the given function. A computed signal is a signal which is calculated from other signals. When the signals change, the computed signal is recalculated, and if the result changed, all tasks which are tracking the signal will be re-run and all components that read the signal will be re-rendered.\\n\\nThe function must be synchronous and must not have any side effects.\\n\\nAsync functions are deprecated because:\\n\\n- When calculating the first time, it will see it's a promise and it will restart the render function. - Qwik can't track used signals after the first await, which leads to subtle bugs. - Both `useTask$` and `useResource$` are available, without these problems.\\n\\nIn v2, async functions won't work.\\n\\n\\n```typescript\\nuseComputed$: <T>(qrl: ComputedFn<T>) => Signal<Awaited<T>>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[ComputedFn](#computedfn)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[Signal](#signal)<!-- -->&lt;Awaited&lt;T&gt;&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.usecomputed_.md\"\n    },\n    {\n      \"name\": \"useComputedQrl\",\n      \"id\": \"usecomputedqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useComputedQrl\",\n          \"id\": \"usecomputedqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nuseComputedQrl: <T>(qrl: QRL<ComputedFn<T>>) => Signal<Awaited<T>>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;[ComputedFn](#computedfn)<!-- -->&lt;T&gt;&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[Signal](#signal)<!-- -->&lt;Awaited&lt;T&gt;&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.usecomputedqrl.md\"\n    },\n    {\n      \"name\": \"useConstant\",\n      \"id\": \"useconstant\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useConstant\",\n          \"id\": \"useconstant\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> This is a technology preview\\n> \\n\\nStores a value which is retained for the lifetime of the component.\\n\\nIf the value is a function, the function is invoked to calculate the actual value.\\n\\n\\n```typescript\\nuseConstant: <T>(value: (() => T) | T) => T\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nvalue\\n\\n\\n</td><td>\\n\\n(() =&gt; T) \\\\| T\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nT\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts\",\n      \"mdFile\": \"qwik.useconstant.md\"\n    },\n    {\n      \"name\": \"useContext\",\n      \"id\": \"usecontext\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useContext\",\n          \"id\": \"usecontext\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"Retrieve Context value.\\n\\nUse `useContext()` to retrieve the value of context in a component. To retrieve a value a parent component needs to invoke `useContextProvider()` to assign a value.\\n\\n\\\\#\\\\#\\\\# Example\\n\\n```tsx\\n// Declare the Context type.\\ninterface TodosStore {\\n  items: string[];\\n}\\n// Create a Context ID (no data is saved here.)\\n// You will use this ID to both create and retrieve the Context.\\nexport const TodosContext = createContextId<TodosStore>('Todos');\\n\\n// Example of providing context to child components.\\nexport const App = component$(() => {\\n  useContextProvider(\\n    TodosContext,\\n    useStore<TodosStore>({\\n      items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\\n    })\\n  );\\n\\n  return <Items />;\\n});\\n\\n// Example of retrieving the context provided by a parent component.\\nexport const Items = component$(() => {\\n  const todos = useContext(TodosContext);\\n  return (\\n    <ul>\\n      {todos.items.map((item) => (\\n        <li>{item}</li>\\n      ))}\\n    </ul>\\n  );\\n});\\n\\n```\\n\\n\\n```typescript\\nuseContext: UseContext\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts\",\n      \"mdFile\": \"qwik.usecontext.md\"\n    },\n    {\n      \"name\": \"useContextProvider\",\n      \"id\": \"usecontextprovider\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useContextProvider\",\n          \"id\": \"usecontextprovider\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Assign a value to a Context.\\n\\nUse `useContextProvider()` to assign a value to a context. The assignment happens in the component's function. Once assigned, use `useContext()` in any child component to retrieve the value.\\n\\nContext is a way to pass stores to the child components without prop-drilling. Note that scalar values are allowed, but for reactivity you need signals or stores.\\n\\n\\\\#\\\\#\\\\# Example\\n\\n```tsx\\n// Declare the Context type.\\ninterface TodosStore {\\n  items: string[];\\n}\\n// Create a Context ID (no data is saved here.)\\n// You will use this ID to both create and retrieve the Context.\\nexport const TodosContext = createContextId<TodosStore>('Todos');\\n\\n// Example of providing context to child components.\\nexport const App = component$(() => {\\n  useContextProvider(\\n    TodosContext,\\n    useStore<TodosStore>({\\n      items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\\n    })\\n  );\\n\\n  return <Items />;\\n});\\n\\n// Example of retrieving the context provided by a parent component.\\nexport const Items = component$(() => {\\n  const todos = useContext(TodosContext);\\n  return (\\n    <ul>\\n      {todos.items.map((item) => (\\n        <li>{item}</li>\\n      ))}\\n    </ul>\\n  );\\n});\\n\\n```\\n\\n\\n```typescript\\nuseContextProvider: <STATE>(context: ContextId<STATE>, newValue: STATE) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\ncontext\\n\\n\\n</td><td>\\n\\n[ContextId](#contextid)<!-- -->&lt;STATE&gt;\\n\\n\\n</td><td>\\n\\nThe context to assign a value to.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nnewValue\\n\\n\\n</td><td>\\n\\nSTATE\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts\",\n      \"mdFile\": \"qwik.usecontextprovider.md\"\n    },\n    {\n      \"name\": \"useErrorBoundary\",\n      \"id\": \"useerrorboundary\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useErrorBoundary\",\n          \"id\": \"useerrorboundary\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nuseErrorBoundary: () => ErrorBoundaryStore\\n```\\n**Returns:**\\n\\n[ErrorBoundaryStore](#errorboundarystore)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-error-boundary.ts\",\n      \"mdFile\": \"qwik.useerrorboundary.md\"\n    },\n    {\n      \"name\": \"useId\",\n      \"id\": \"useid\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useId\",\n          \"id\": \"useid\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nuseId: () => string\\n```\\n**Returns:**\\n\\nstring\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-id.ts\",\n      \"mdFile\": \"qwik.useid.md\"\n    },\n    {\n      \"name\": \"useOn\",\n      \"id\": \"useon\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useOn\",\n          \"id\": \"useon\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Register a listener on the current component's host element.\\n\\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.\\n\\n\\n```typescript\\nuseOn: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nevent\\n\\n\\n</td><td>\\n\\nT \\\\| T\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\neventQrl\\n\\n\\n</td><td>\\n\\nEventQRL&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-on.ts\",\n      \"mdFile\": \"qwik.useon.md\"\n    },\n    {\n      \"name\": \"useOnDocument\",\n      \"id\": \"useondocument\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useOnDocument\",\n          \"id\": \"useondocument\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Register a listener on `document`<!-- -->.\\n\\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX.\\n\\n\\n```typescript\\nuseOnDocument: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nevent\\n\\n\\n</td><td>\\n\\nT \\\\| T\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\neventQrl\\n\\n\\n</td><td>\\n\\nEventQRL&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-on.ts\",\n      \"mdFile\": \"qwik.useondocument.md\"\n    },\n    {\n      \"name\": \"useOnWindow\",\n      \"id\": \"useonwindow\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useOnWindow\",\n          \"id\": \"useonwindow\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Register a listener on `window`<!-- -->.\\n\\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX.\\n\\n\\n```typescript\\nuseOnWindow: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nevent\\n\\n\\n</td><td>\\n\\nT \\\\| T\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\neventQrl\\n\\n\\n</td><td>\\n\\nEventQRL&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-on.ts\",\n      \"mdFile\": \"qwik.useonwindow.md\"\n    },\n    {\n      \"name\": \"useResource$\",\n      \"id\": \"useresource_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useResource$\",\n          \"id\": \"useresource_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"This method works like an async memoized function that runs whenever some tracked value changes and returns some data.\\n\\n`useResource` however returns immediate a `ResourceReturn` object that contains the data and a state that indicates if the data is available or not.\\n\\nThe status can be one of the following:\\n\\n- 'pending' - the data is not yet available. - 'resolved' - the data is available. - 'rejected' - the data is not available due to an error or timeout.\\n\\n\\\\#\\\\#\\\\# Example\\n\\nExample showing how `useResource` to perform a fetch to request the weather, whenever the input city name changes.\\n\\n```tsx\\nconst Cmp = component$(() => {\\n  const cityS = useSignal('');\\n\\n  const weatherResource = useResource$(async ({ track, cleanup }) => {\\n    const cityName = track(cityS);\\n    const abortController = new AbortController();\\n    cleanup(() => abortController.abort('cleanup'));\\n    const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\\n      signal: abortController.signal,\\n    });\\n    const data = await res.json();\\n    return data as { temp: number };\\n  });\\n\\n  return (\\n    <div>\\n      <input name=\\\"city\\\" bind:value={cityS} />\\n      <Resource\\n        value={weatherResource}\\n        onResolved={(weather) => {\\n          return <div>Temperature: {weather.temp}</div>;\\n        }}\\n      />\\n    </div>\\n  );\\n});\\n```\\n\\n\\n```typescript\\nuseResource$: <T>(generatorFn: ResourceFn<T>, opts?: ResourceOptions) => ResourceReturn<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\ngeneratorFn\\n\\n\\n</td><td>\\n\\n[ResourceFn](#resourcefn)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[ResourceOptions](#resourceoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[ResourceReturn](#resourcereturn)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts\",\n      \"mdFile\": \"qwik.useresource_.md\"\n    },\n    {\n      \"name\": \"useResourceQrl\",\n      \"id\": \"useresourceqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useResourceQrl\",\n          \"id\": \"useresourceqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"This method works like an async memoized function that runs whenever some tracked value changes and returns some data.\\n\\n`useResource` however returns immediate a `ResourceReturn` object that contains the data and a state that indicates if the data is available or not.\\n\\nThe status can be one of the following:\\n\\n- `pending` - the data is not yet available. - `resolved` - the data is available. - `rejected` - the data is not available due to an error or timeout.\\n\\nAvoid using a `try/catch` statement in `useResource$`<!-- -->. If you catch the error instead of passing it, the resource status will never be `rejected`<!-- -->.\\n\\n\\\\#\\\\#\\\\# Example\\n\\nExample showing how `useResource` to perform a fetch to request the weather, whenever the input city name changes.\\n\\n```tsx\\nconst Cmp = component$(() => {\\n  const cityS = useSignal('');\\n\\n  const weatherResource = useResource$(async ({ track, cleanup }) => {\\n    const cityName = track(cityS);\\n    const abortController = new AbortController();\\n    cleanup(() => abortController.abort('cleanup'));\\n    const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\\n      signal: abortController.signal,\\n    });\\n    const data = await res.json();\\n    return data as { temp: number };\\n  });\\n\\n  return (\\n    <div>\\n      <input name=\\\"city\\\" bind:value={cityS} />\\n      <Resource\\n        value={weatherResource}\\n        onResolved={(weather) => {\\n          return <div>Temperature: {weather.temp}</div>;\\n        }}\\n      />\\n    </div>\\n  );\\n});\\n```\\n\\n\\n```typescript\\nuseResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: ResourceOptions) => ResourceReturn<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;[ResourceFn](#resourcefn)<!-- -->&lt;T&gt;&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[ResourceOptions](#resourceoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[ResourceReturn](#resourcereturn)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts\",\n      \"mdFile\": \"qwik.useresourceqrl.md\"\n    },\n    {\n      \"name\": \"useServerData\",\n      \"id\": \"useserverdata\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useServerData\",\n          \"id\": \"useserverdata\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function useServerData<T>(key: string): T | undefined;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nkey\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nT \\\\| undefined\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-env-data.ts\",\n      \"mdFile\": \"qwik.useserverdata.md\"\n    },\n    {\n      \"name\": \"useSignal\",\n      \"id\": \"usesignal\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useSignal\",\n          \"id\": \"usesignal\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"Hook that creates a signal that is retained for the lifetime of the component.\\n\\n\\n```typescript\\nuseSignal: UseSignal\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts\",\n      \"mdFile\": \"qwik.usesignal.md\"\n    },\n    {\n      \"name\": \"UseSignal\",\n      \"id\": \"usesignal\",\n      \"hierarchy\": [\n        {\n          \"name\": \"UseSignal\",\n          \"id\": \"usesignal\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"Hook that creates a signal that is retained for the lifetime of the component.\\n\\n\\n```typescript\\nuseSignal: UseSignal\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts\",\n      \"mdFile\": \"qwik.usesignal.md\"\n    },\n    {\n      \"name\": \"useStore\",\n      \"id\": \"usestore\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useStore\",\n          \"id\": \"usestore\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Creates an object that Qwik can track across serializations.\\n\\nUse `useStore` to create a state for your application. The returned object is a proxy that has a unique ID. The ID of the object is used in the `QRL`<!-- -->s to refer to the store.\\n\\n\\\\#\\\\#\\\\# Example\\n\\nExample showing how `useStore` is used in Counter example to keep track of the count.\\n\\n```tsx\\nconst Stores = component$(() => {\\n  const counter = useCounter(1);\\n\\n  // Reactivity happens even for nested objects and arrays\\n  const userData = useStore({\\n    name: 'Manu',\\n    address: {\\n      address: '',\\n      city: '',\\n    },\\n    orgs: [],\\n  });\\n\\n  // useStore() can also accept a function to calculate the initial value\\n  const state = useStore(() => {\\n    return {\\n      value: expensiveInitialValue(),\\n    };\\n  });\\n\\n  return (\\n    <div>\\n      <div>Counter: {counter.value}</div>\\n      <Child userData={userData} state={state} />\\n    </div>\\n  );\\n});\\n\\nfunction useCounter(step: number) {\\n  // Multiple stores can be created in custom hooks for convenience and composability\\n  const counterStore = useStore({\\n    value: 0,\\n  });\\n  useVisibleTask$(() => {\\n    // Only runs in the client\\n    const timer = setInterval(() => {\\n      counterStore.value += step;\\n    }, 500);\\n    return () => {\\n      clearInterval(timer);\\n    };\\n  });\\n  return counterStore;\\n}\\n```\\n\\n\\n```typescript\\nuseStore: <STATE extends object>(initialState: STATE | (() => STATE), opts?: UseStoreOptions) => STATE\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\ninitialState\\n\\n\\n</td><td>\\n\\nSTATE \\\\| (() =&gt; STATE)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[UseStoreOptions](#usestoreoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nSTATE\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-store.public.ts\",\n      \"mdFile\": \"qwik.usestore.md\"\n    },\n    {\n      \"name\": \"UseStoreOptions\",\n      \"id\": \"usestoreoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"UseStoreOptions\",\n          \"id\": \"usestoreoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface UseStoreOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[deep?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ If `true` then all nested objects and arrays will be tracked as well. Default is `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[reactive?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ If `false` then the object will not be tracked for changes. Default is `true`<!-- -->.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-store.public.ts\",\n      \"mdFile\": \"qwik.usestoreoptions.md\"\n    },\n    {\n      \"name\": \"useStyles$\",\n      \"id\": \"usestyles_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useStyles$\",\n          \"id\": \"usestyles_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"A lazy-loadable reference to a component's styles.\\n\\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\\n\\n```tsx\\nimport styles from './code-block.css?inline';\\n\\nexport const CmpStyles = component$(() => {\\n  useStyles$(styles);\\n\\n  return <div>Some text</div>;\\n});\\n```\\n\\n\\n```typescript\\nuseStyles$: (qrl: string) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts\",\n      \"mdFile\": \"qwik.usestyles_.md\"\n    },\n    {\n      \"name\": \"useStylesQrl\",\n      \"id\": \"usestylesqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useStylesQrl\",\n          \"id\": \"usestylesqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"A lazy-loadable reference to a component's styles.\\n\\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\\n\\n```tsx\\nimport styles from './code-block.css?inline';\\n\\nexport const CmpStyles = component$(() => {\\n  useStyles$(styles);\\n\\n  return <div>Some text</div>;\\n});\\n```\\n\\n\\n```typescript\\nuseStylesQrl: (styles: QRL<string>) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nstyles\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;string&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts\",\n      \"mdFile\": \"qwik.usestylesqrl.md\"\n    },\n    {\n      \"name\": \"UseStylesScoped\",\n      \"id\": \"usestylesscoped\",\n      \"hierarchy\": [\n        {\n          \"name\": \"UseStylesScoped\",\n          \"id\": \"usestylesscoped\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface UseStylesScoped \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[scopeId](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts\",\n      \"mdFile\": \"qwik.usestylesscoped.md\"\n    },\n    {\n      \"name\": \"useStylesScoped$\",\n      \"id\": \"usestylesscoped_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useStylesScoped$\",\n          \"id\": \"usestylesscoped_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"A lazy-loadable reference to a component's styles, that is scoped to the component.\\n\\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\\n\\n```tsx\\nimport scoped from './code-block.css?inline';\\n\\nexport const CmpScopedStyles = component$(() => {\\n  useStylesScoped$(scoped);\\n\\n  return <div>Some text</div>;\\n});\\n```\\n\\n\\n```typescript\\nuseStylesScoped$: (qrl: string) => UseStylesScoped\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[UseStylesScoped](#usestylesscoped)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts\",\n      \"mdFile\": \"qwik.usestylesscoped_.md\"\n    },\n    {\n      \"name\": \"useStylesScopedQrl\",\n      \"id\": \"usestylesscopedqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useStylesScopedQrl\",\n          \"id\": \"usestylesscopedqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"A lazy-loadable reference to a component's styles, that is scoped to the component.\\n\\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\\n\\n```tsx\\nimport scoped from './code-block.css?inline';\\n\\nexport const CmpScopedStyles = component$(() => {\\n  useStylesScoped$(scoped);\\n\\n  return <div>Some text</div>;\\n});\\n```\\n\\n\\n```typescript\\nuseStylesScopedQrl: (styles: QRL<string>) => UseStylesScoped\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nstyles\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;string&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[UseStylesScoped](#usestylesscoped)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts\",\n      \"mdFile\": \"qwik.usestylesscopedqrl.md\"\n    },\n    {\n      \"name\": \"useTask$\",\n      \"id\": \"usetask_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useTask$\",\n          \"id\": \"usetask_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Reruns the `taskFn` when the observed inputs change.\\n\\nUse `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when those inputs change.\\n\\nThe `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs` function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to rerun.\\n\\n\\n```typescript\\nuseTask$: (qrl: TaskFn, opts?: UseTaskOptions | undefined) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[TaskFn](#taskfn)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[UseTaskOptions](#usetaskoptions) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.usetask_.md\"\n    },\n    {\n      \"name\": \"UseTaskOptions\",\n      \"id\": \"usetaskoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"UseTaskOptions\",\n          \"id\": \"usetaskoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> use useVisibleTask$ or useResource$, useTask$ is for running tasks as part of the initial SSR render\\n> \\n\\n\\n```typescript\\nexport interface UseTaskOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[eagerness?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[EagernessOptions](#eagernessoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_ - `visible`<!-- -->: run the effect when the element is visible. - `load`<!-- -->: eagerly run the effect when the application resumes.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.usetaskoptions.md\"\n    },\n    {\n      \"name\": \"useTaskQrl\",\n      \"id\": \"usetaskqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useTaskQrl\",\n          \"id\": \"usetaskqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Reruns the `taskFn` when the observed inputs change.\\n\\nUse `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when those inputs change.\\n\\nThe `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs` function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to rerun.\\n\\n\\n```typescript\\nuseTaskQrl: (qrl: QRL<TaskFn>, opts?: UseTaskOptions) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;[TaskFn](#taskfn)<!-- -->&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[UseTaskOptions](#usetaskoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.usetaskqrl.md\"\n    },\n    {\n      \"name\": \"useVisibleTask$\",\n      \"id\": \"usevisibletask_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useVisibleTask$\",\n          \"id\": \"usevisibletask_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```tsx\\nconst Timer = component$(() => {\\n  const store = useStore({\\n    count: 0,\\n  });\\n\\n  useVisibleTask$(() => {\\n    // Only runs in the client\\n    const timer = setInterval(() => {\\n      store.count++;\\n    }, 500);\\n    return () => {\\n      clearInterval(timer);\\n    };\\n  });\\n\\n  return <div>{store.count}</div>;\\n});\\n```\\n\\n\\n```typescript\\nuseVisibleTask$: (qrl: TaskFn, opts?: OnVisibleTaskOptions | undefined) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[TaskFn](#taskfn)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[OnVisibleTaskOptions](#onvisibletaskoptions) \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.usevisibletask_.md\"\n    },\n    {\n      \"name\": \"useVisibleTaskQrl\",\n      \"id\": \"usevisibletaskqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useVisibleTaskQrl\",\n          \"id\": \"usevisibletaskqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```tsx\\nconst Timer = component$(() => {\\n  const store = useStore({\\n    count: 0,\\n  });\\n\\n  useVisibleTask$(() => {\\n    // Only runs in the client\\n    const timer = setInterval(() => {\\n      store.count++;\\n    }, 500);\\n    return () => {\\n      clearInterval(timer);\\n    };\\n  });\\n\\n  return <div>{store.count}</div>;\\n});\\n```\\n\\n\\n```typescript\\nuseVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[QRL](#qrl)<!-- -->&lt;[TaskFn](#taskfn)<!-- -->&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[OnVisibleTaskOptions](#onvisibletaskoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.usevisibletaskqrl.md\"\n    },\n    {\n      \"name\": \"ValueOrPromise\",\n      \"id\": \"valueorpromise\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ValueOrPromise\",\n          \"id\": \"valueorpromise\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Type representing a value which is either resolve or a promise.\\n\\n\\n```typescript\\nexport type ValueOrPromise<T> = T | Promise<T>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/util/types.ts\",\n      \"mdFile\": \"qwik.valueorpromise.md\"\n    },\n    {\n      \"name\": \"version\",\n      \"id\": \"version\",\n      \"hierarchy\": [\n        {\n          \"name\": \"version\",\n          \"id\": \"version\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"QWIK\\\\_VERSION\\n\\n\\n```typescript\\nversion: string\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/version.ts\",\n      \"mdFile\": \"qwik.version.md\"\n    },\n    {\n      \"name\": \"VideoHTMLAttributes\",\n      \"id\": \"videohtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"VideoHTMLAttributes\",\n          \"id\": \"videohtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface VideoHTMLAttributes<T extends Element> extends Attrs<'video', T> \\n```\\n**Extends:** Attrs&lt;'video', T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.videohtmlattributes.md\"\n    },\n    {\n      \"name\": \"VisibleTaskStrategy\",\n      \"id\": \"visibletaskstrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"VisibleTaskStrategy\",\n          \"id\": \"visibletaskstrategy\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type VisibleTaskStrategy = 'intersection-observer' | 'document-ready' | 'document-idle';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts\",\n      \"mdFile\": \"qwik.visibletaskstrategy.md\"\n    },\n    {\n      \"name\": \"WebViewHTMLAttributes\",\n      \"id\": \"webviewhtmlattributes\",\n      \"hierarchy\": [\n        {\n          \"name\": \"WebViewHTMLAttributes\",\n          \"id\": \"webviewhtmlattributes\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> This is the type for a React Native WebView. It doesn't belong in Qwik (yet?) but we're keeping it for backwards compatibility.\\n> \\n\\n\\n```typescript\\nexport interface WebViewHTMLAttributes<T extends Element> extends HTMLAttributes<T> \\n```\\n**Extends:** [HTMLAttributes](#htmlattributes)<!-- -->&lt;T&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[allowFullScreen?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[allowpopups?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[autoFocus?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[autosize?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[blinkfeatures?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[disableblinkfeatures?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[disableguestresize?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[disablewebsecurity?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[guestinstance?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[httpreferrer?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[nodeintegration?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[partition?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[plugins?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[preload?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[src?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[useragent?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[webpreferences?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts\",\n      \"mdFile\": \"qwik.webviewhtmlattributes.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik\n\n<h2 id=\"_qrlsync\">_qrlSync</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nExtract function into a synchronously loadable QRL.\n\nNOTE: Synchronous QRLs functions can't close over any variables, including exports.\n\n```typescript\n_qrlSync: <TYPE extends Function>(fn: TYPE, serializedFn?: string) =>\n  SyncQRL<TYPE>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nfn\n\n</td><td>\n\nTYPE\n\n</td><td>\n\nExtracted function\n\n</td></tr>\n<tr><td>\n\nserializedFn\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ Serialized function in string form.\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[SyncQRL](#syncqrl)&lt;TYPE&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"componentbaseprops-_q_slot_\">\"q:slot\"</h2>\n\n```typescript\n'q:slot'?: string;\n```\n\n<h2 id=\"svgattributes-_xlink_actuate_\">\"xlink:actuate\"</h2>\n\n```typescript\n'xlink:actuate'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xlink_arcrole_\">\"xlink:arcrole\"</h2>\n\n```typescript\n'xlink:arcrole'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xlink_href_\">\"xlink:href\"</h2>\n\n```typescript\n'xlink:href'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xlink_role_\">\"xlink:role\"</h2>\n\n```typescript\n'xlink:role'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xlink_show_\">\"xlink:show\"</h2>\n\n```typescript\n'xlink:show'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xlink_title_\">\"xlink:title\"</h2>\n\n```typescript\n'xlink:title'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xlink_type_\">\"xlink:type\"</h2>\n\n```typescript\n'xlink:type'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xml_base_\">\"xml:base\"</h2>\n\n```typescript\n'xml:base'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xml_lang_\">\"xml:lang\"</h2>\n\n```typescript\n'xml:lang'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xml_space_\">\"xml:space\"</h2>\n\n```typescript\n'xml:space'?: string | undefined;\n```\n\n<h2 id=\"svgattributes-_xmlns_xlink_\">\"xmlns:xlink\"</h2>\n\n```typescript\n'xmlns:xlink'?: string | undefined;\n```\n\n<h2 id=\"_\">$</h2>\n\nQwik Optimizer marker function.\n\nUse `$(...)` to tell Qwik Optimizer to extract the expression in `$(...)` into a lazy-loadable resource referenced by `QRL`.\n\n```typescript\n$: <T>(expression: T) => QRL<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nexpression\n\n</td><td>\n\nT\n\n</td><td>\n\nExpression which should be lazy loaded\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[QRL](#qrl)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"anchorhtmlattributes\">AnchorHTMLAttributes</h2>\n\n```typescript\nexport interface AnchorHTMLAttributes<T extends Element> extends Attrs<'a', T>\n```\n\n**Extends:** Attrs&lt;'a', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"areahtmlattributes\">AreaHTMLAttributes</h2>\n\n```typescript\nexport interface AreaHTMLAttributes<T extends Element> extends Attrs<'area', T>\n```\n\n**Extends:** Attrs&lt;'area', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"ariaattributes\">AriaAttributes</h2>\n\nTS defines these with the React syntax which is not compatible with Qwik. E.g. `ariaAtomic` instead of `aria-atomic`.\n\n```typescript\nexport interface AriaAttributes\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[\"aria-activedescendant\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.\n\n</td></tr>\n<tr><td>\n\n[\"aria-atomic\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.\n\n</td></tr>\n<tr><td>\n\n[\"aria-autocomplete\"?](#)\n\n</td><td>\n\n</td><td>\n\n'none' \\| 'inline' \\| 'list' \\| 'both' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.\n\n</td></tr>\n<tr><td>\n\n[\"aria-busy\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.\n\n</td></tr>\n<tr><td>\n\n[\"aria-checked\"?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| 'false' \\| 'mixed' \\| 'true' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates the current \"checked\" state of checkboxes, radio buttons, and other widgets.\n\n</td></tr>\n<tr><td>\n\n[\"aria-colcount\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the total number of columns in a table, grid, or treegrid.\n\n</td></tr>\n<tr><td>\n\n[\"aria-colindex\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n\n</td></tr>\n<tr><td>\n\n[\"aria-colspan\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n\n</td></tr>\n<tr><td>\n\n[\"aria-controls\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies the element (or elements) whose contents or presence are controlled by the current element.\n\n</td></tr>\n<tr><td>\n\n[\"aria-current\"?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| 'false' \\| 'true' \\| 'page' \\| 'step' \\| 'location' \\| 'date' \\| 'time' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates the element that represents the current item within a container or set of related elements.\n\n</td></tr>\n<tr><td>\n\n[\"aria-describedby\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies the element (or elements) that describes the object.\n\n</td></tr>\n<tr><td>\n\n[\"aria-details\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies the element that provides a detailed, extended description for the object.\n\n</td></tr>\n<tr><td>\n\n[\"aria-disabled\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n\n</td></tr>\n<tr><td>\n\n[\"aria-dropeffect\"?](#)\n\n</td><td>\n\n</td><td>\n\n'none' \\| 'copy' \\| 'execute' \\| 'link' \\| 'move' \\| 'popup' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates what functions can be performed when a dragged object is released on the drop target.\n\n</td></tr>\n<tr><td>\n\n[\"aria-errormessage\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies the element that provides an error message for the object.\n\n</td></tr>\n<tr><td>\n\n[\"aria-expanded\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.\n\n</td></tr>\n<tr><td>\n\n[\"aria-flowto\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.\n\n</td></tr>\n<tr><td>\n\n[\"aria-grabbed\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates an element's \"grabbed\" state in a drag-and-drop operation.\n\n</td></tr>\n<tr><td>\n\n[\"aria-haspopup\"?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| 'false' \\| 'true' \\| 'menu' \\| 'listbox' \\| 'tree' \\| 'grid' \\| 'dialog' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.\n\n</td></tr>\n<tr><td>\n\n[\"aria-hidden\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates whether the element is exposed to an accessibility API.\n\n</td></tr>\n<tr><td>\n\n[\"aria-invalid\"?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| 'false' \\| 'true' \\| 'grammar' \\| 'spelling' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates the entered value does not conform to the format expected by the application.\n\n</td></tr>\n<tr><td>\n\n[\"aria-keyshortcuts\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.\n\n</td></tr>\n<tr><td>\n\n[\"aria-label\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines a string value that labels the current element.\n\n</td></tr>\n<tr><td>\n\n[\"aria-labelledby\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies the element (or elements) that labels the current element.\n\n</td></tr>\n<tr><td>\n\n[\"aria-level\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the hierarchical level of an element within a structure.\n\n</td></tr>\n<tr><td>\n\n[\"aria-live\"?](#)\n\n</td><td>\n\n</td><td>\n\n'off' \\| 'assertive' \\| 'polite' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.\n\n</td></tr>\n<tr><td>\n\n[\"aria-modal\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates whether an element is modal when displayed.\n\n</td></tr>\n<tr><td>\n\n[\"aria-multiline\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates whether a text box accepts multiple lines of input or only a single line.\n\n</td></tr>\n<tr><td>\n\n[\"aria-multiselectable\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates that the user may select more than one item from the current selectable descendants.\n\n</td></tr>\n<tr><td>\n\n[\"aria-orientation\"?](#)\n\n</td><td>\n\n</td><td>\n\n'horizontal' \\| 'vertical' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.\n\n</td></tr>\n<tr><td>\n\n[\"aria-owns\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n\n</td></tr>\n<tr><td>\n\n[\"aria-placeholder\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.\n\n</td></tr>\n<tr><td>\n\n[\"aria-posinset\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n\n</td></tr>\n<tr><td>\n\n[\"aria-pressed\"?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| 'false' \\| 'mixed' \\| 'true' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates the current \"pressed\" state of toggle buttons.\n\n</td></tr>\n<tr><td>\n\n[\"aria-readonly\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates that the element is not editable, but is otherwise operable.\n\n</td></tr>\n<tr><td>\n\n[\"aria-relevant\"?](#)\n\n</td><td>\n\n</td><td>\n\n'additions' \\| 'additions removals' \\| 'additions text' \\| 'all' \\| 'removals' \\| 'removals additions' \\| 'removals text' \\| 'text' \\| 'text additions' \\| 'text removals' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n\n</td></tr>\n<tr><td>\n\n[\"aria-required\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates that user input is required on the element before a form may be submitted.\n\n</td></tr>\n<tr><td>\n\n[\"aria-roledescription\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines a human-readable, author-localized description for the role of an element.\n\n</td></tr>\n<tr><td>\n\n[\"aria-rowcount\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the total number of rows in a table, grid, or treegrid.\n\n</td></tr>\n<tr><td>\n\n[\"aria-rowindex\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n\n</td></tr>\n<tr><td>\n\n[\"aria-rowspan\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n\n</td></tr>\n<tr><td>\n\n[\"aria-selected\"?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates the current \"selected\" state of various widgets.\n\n</td></tr>\n<tr><td>\n\n[\"aria-setsize\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n\n</td></tr>\n<tr><td>\n\n[\"aria-sort\"?](#)\n\n</td><td>\n\n</td><td>\n\n'none' \\| 'ascending' \\| 'descending' \\| 'other' \\| undefined\n\n</td><td>\n\n_(Optional)_ Indicates if items in a table or grid are sorted in ascending or descending order.\n\n</td></tr>\n<tr><td>\n\n[\"aria-valuemax\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the maximum allowed value for a range widget.\n\n</td></tr>\n<tr><td>\n\n[\"aria-valuemin\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the minimum allowed value for a range widget.\n\n</td></tr>\n<tr><td>\n\n[\"aria-valuenow\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the current value for a range widget.\n\n</td></tr>\n<tr><td>\n\n[\"aria-valuetext\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_ Defines the human readable text alternative of aria-valuenow for a range widget.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"ariarole\">AriaRole</h2>\n\n```typescript\nexport type AriaRole =\n  | \"alert\"\n  | \"alertdialog\"\n  | \"application\"\n  | \"article\"\n  | \"banner\"\n  | \"button\"\n  | \"cell\"\n  | \"checkbox\"\n  | \"columnheader\"\n  | \"combobox\"\n  | \"complementary\"\n  | \"contentinfo\"\n  | \"definition\"\n  | \"dialog\"\n  | \"directory\"\n  | \"document\"\n  | \"feed\"\n  | \"figure\"\n  | \"form\"\n  | \"grid\"\n  | \"gridcell\"\n  | \"group\"\n  | \"heading\"\n  | \"img\"\n  | \"link\"\n  | \"list\"\n  | \"listbox\"\n  | \"listitem\"\n  | \"log\"\n  | \"main\"\n  | \"marquee\"\n  | \"math\"\n  | \"menu\"\n  | \"menubar\"\n  | \"menuitem\"\n  | \"menuitemcheckbox\"\n  | \"menuitemradio\"\n  | \"navigation\"\n  | \"none\"\n  | \"note\"\n  | \"option\"\n  | \"presentation\"\n  | \"progressbar\"\n  | \"radio\"\n  | \"radiogroup\"\n  | \"region\"\n  | \"row\"\n  | \"rowgroup\"\n  | \"rowheader\"\n  | \"scrollbar\"\n  | \"search\"\n  | \"searchbox\"\n  | \"separator\"\n  | \"slider\"\n  | \"spinbutton\"\n  | \"status\"\n  | \"switch\"\n  | \"tab\"\n  | \"table\"\n  | \"tablist\"\n  | \"tabpanel\"\n  | \"term\"\n  | \"textbox\"\n  | \"timer\"\n  | \"toolbar\"\n  | \"tooltip\"\n  | \"tree\"\n  | \"treegrid\"\n  | \"treeitem\"\n  | (string & {});\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"audiohtmlattributes\">AudioHTMLAttributes</h2>\n\n```typescript\nexport interface AudioHTMLAttributes<T extends Element> extends Attrs<'audio', T>\n```\n\n**Extends:** Attrs&lt;'audio', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"basehtmlattributes\">BaseHTMLAttributes</h2>\n\n```typescript\nexport interface BaseHTMLAttributes<T extends Element> extends Attrs<'base', T>\n```\n\n**Extends:** Attrs&lt;'base', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"blockquotehtmlattributes\">BlockquoteHTMLAttributes</h2>\n\n```typescript\nexport interface BlockquoteHTMLAttributes<T extends Element> extends Attrs<'blockquote', T>\n```\n\n**Extends:** Attrs&lt;'blockquote', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"booleanish\">Booleanish</h2>\n\n```typescript\nexport type Booleanish = boolean | `${boolean}`;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"buttonhtmlattributes\">ButtonHTMLAttributes</h2>\n\n```typescript\nexport interface ButtonHTMLAttributes<T extends Element> extends Attrs<'button', T>\n```\n\n**Extends:** Attrs&lt;'button', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"resourcectx-cache\">cache</h2>\n\n```typescript\ncache(policyOrMilliseconds: number | 'immutable'): void;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npolicyOrMilliseconds\n\n</td><td>\n\nnumber \\| 'immutable'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n<h2 id=\"canvashtmlattributes\">CanvasHTMLAttributes</h2>\n\n```typescript\nexport interface CanvasHTMLAttributes<T extends Element> extends Attrs<'canvas', T>\n```\n\n**Extends:** Attrs&lt;'canvas', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"classlist\">ClassList</h2>\n\nA class list can be a string, a boolean, an array, or an object.\n\nIf it's an array, each item is a class list and they are all added.\n\nIf it's an object, then the keys are class name strings, and the values are booleans that determine if the class name string should be added or not.\n\n```typescript\nexport type ClassList =\n  | string\n  | undefined\n  | null\n  | false\n  | Record<string, boolean | string | number | null | undefined>\n  | ClassList[];\n```\n\n**References:** [ClassList](#classlist)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"renderresult-cleanup\">cleanup</h2>\n\n```typescript\ncleanup(): void;\n```\n\n**Returns:**\n\nvoid\n\n<h2 id=\"colgrouphtmlattributes\">ColgroupHTMLAttributes</h2>\n\n```typescript\nexport interface ColgroupHTMLAttributes<T extends Element> extends Attrs<'colgroup', T>\n```\n\n**Extends:** Attrs&lt;'colgroup', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"colhtmlattributes\">ColHTMLAttributes</h2>\n\n```typescript\nexport interface ColHTMLAttributes<T extends Element> extends Attrs<'col', T>\n```\n\n**Extends:** Attrs&lt;'col', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"component\">Component</h2>\n\nType representing the Qwik component.\n\n`Component` is the type returned by invoking `component$`.\n\n```tsx\ninterface MyComponentProps {\n  someProp: string;\n}\nconst MyComponent: Component<MyComponentProps> = component$(\n  (props: MyComponentProps) => {\n    return <span>{props.someProp}</span>;\n  },\n);\n```\n\n```typescript\nexport type Component<PROPS = unknown> = FunctionComponent<PublicProps<PROPS>>;\n```\n\n**References:** [FunctionComponent](#functioncomponent), [PublicProps](#publicprops)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts)\n\n<h2 id=\"component_\">component$</h2>\n\nDeclare a Qwik component that can be used to create UI.\n\nUse `component$` to declare a Qwik component. A Qwik component is a special kind of component that allows the Qwik framework to lazy load and execute the component independently of other Qwik components as well as lazy load the component's life-cycle hooks and event handlers.\n\nSide note: You can also declare regular (standard JSX) components that will have standard synchronous behavior.\n\nQwik component is a facade that describes how the component should be used without forcing the implementation of the component to be eagerly loaded. A minimum Qwik definition consists of:\n\n### Example\n\nAn example showing how to create a counter component:\n\n```tsx\nexport interface CounterProps {\n  initialValue?: number;\n  step?: number;\n}\nexport const Counter = component$((props: CounterProps) => {\n  const state = useStore({ count: props.initialValue || 0 });\n  return (\n    <div>\n      <span>{state.count}</span>\n      <button onClick$={() => (state.count += props.step || 1)}>+</button>\n    </div>\n  );\n});\n```\n\n- `component$` is how a component gets declared. - `{ value?: number; step?: number }` declares the public (props) interface of the component. - `{ count: number }` declares the private (state) interface of the component.\n\nThe above can then be used like so:\n\n```tsx\nexport const OtherComponent = component$(() => {\n  return <Counter initialValue={100} />;\n});\n```\n\nSee also: `component`, `useCleanup`, `onResume`, `onPause`, `useOn`, `useOnDocument`, `useOnWindow`, `useStyles`\n\n```typescript\ncomponent$: <PROPS = unknown>(onMount: OnRenderFn<PROPS>) => Component<PROPS>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nonMount\n\n</td><td>\n\n[OnRenderFn](#onrenderfn)&lt;PROPS&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[Component](#component)&lt;PROPS&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts)\n\n<h2 id=\"componentbaseprops\">ComponentBaseProps</h2>\n\n```typescript\nexport interface ComponentBaseProps\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[\"q:slot\"?](#componentbaseprops-_q_slot_)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[key?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| number \\| null \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"componentqrl\">componentQrl</h2>\n\nDeclare a Qwik component that can be used to create UI.\n\nUse `component$` to declare a Qwik component. A Qwik component is a special kind of component that allows the Qwik framework to lazy load and execute the component independently of other Qwik components as well as lazy load the component's life-cycle hooks and event handlers.\n\nSide note: You can also declare regular (standard JSX) components that will have standard synchronous behavior.\n\nQwik component is a facade that describes how the component should be used without forcing the implementation of the component to be eagerly loaded. A minimum Qwik definition consists of:\n\n### Example\n\nAn example showing how to create a counter component:\n\n```tsx\nexport interface CounterProps {\n  initialValue?: number;\n  step?: number;\n}\nexport const Counter = component$((props: CounterProps) => {\n  const state = useStore({ count: props.initialValue || 0 });\n  return (\n    <div>\n      <span>{state.count}</span>\n      <button onClick$={() => (state.count += props.step || 1)}>+</button>\n    </div>\n  );\n});\n```\n\n- `component$` is how a component gets declared. - `{ value?: number; step?: number }` declares the public (props) interface of the component. - `{ count: number }` declares the private (state) interface of the component.\n\nThe above can then be used like so:\n\n```tsx\nexport const OtherComponent = component$(() => {\n  return <Counter initialValue={100} />;\n});\n```\n\nSee also: `component`, `useCleanup`, `onResume`, `onPause`, `useOn`, `useOnDocument`, `useOnWindow`, `useStyles`\n\n```typescript\ncomponentQrl: <PROPS extends Record<any, any>>(\n  componentQrl: QRL<OnRenderFn<PROPS>>,\n) => Component<PROPS>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\ncomponentQrl\n\n</td><td>\n\n[QRL](#qrl)&lt;[OnRenderFn](#onrenderfn)&lt;PROPS&gt;&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[Component](#component)&lt;PROPS&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts)\n\n<h2 id=\"computedfn\">ComputedFn</h2>\n\n```typescript\nexport type ComputedFn<T> = () => T;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"contextid\">ContextId</h2>\n\nContextId is a typesafe ID for your context.\n\nContext is a way to pass stores to the child components without prop-drilling.\n\nUse `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier for the context. It is not the context value itself. See `useContextProvider()` and `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can track context providers and consumers in a way that survives resumability.\n\n### Example\n\n```tsx\n// Declare the Context type.\ninterface TodosStore {\n  items: string[];\n}\n// Create a Context ID (no data is saved here.)\n// You will use this ID to both create and retrieve the Context.\nexport const TodosContext = createContextId<TodosStore>(\"Todos\");\n\n// Example of providing context to child components.\nexport const App = component$(() => {\n  useContextProvider(\n    TodosContext,\n    useStore<TodosStore>({\n      items: [\"Learn Qwik\", \"Build Qwik app\", \"Profit\"],\n    }),\n  );\n\n  return <Items />;\n});\n\n// Example of retrieving the context provided by a parent component.\nexport const Items = component$(() => {\n  const todos = useContext(TodosContext);\n  return (\n    <ul>\n      {todos.items.map((item) => (\n        <li>{item}</li>\n      ))}\n    </ul>\n  );\n});\n```\n\n```typescript\nexport interface ContextId<STATE>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[\\_\\_brand_context_type\\_\\_](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nSTATE\n\n</td><td>\n\nDesign-time property to store type information for the context.\n\n</td></tr>\n<tr><td>\n\n[id](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\nA unique ID for the context.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts)\n\n<h2 id=\"coreplatform\">CorePlatform</h2>\n\nLow-level API for platform abstraction.\n\nDifferent platforms (browser, node, service workers) may have different ways of handling things such as `requestAnimationFrame` and imports. To make Qwik platform-independent Qwik uses the `CorePlatform` API to access the platform API.\n\n`CorePlatform` also is responsible for importing symbols. The import map is different on the client (browser) then on the server. For this reason, the server has a manifest that is used to map symbols to javascript chunks. The manifest is encapsulated in `CorePlatform`, for this reason, the `CorePlatform` can't be global as there may be multiple applications running at server concurrently.\n\nThis is a low-level API and there should not be a need for you to access this.\n\n```typescript\nexport interface CorePlatform\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[chunkForSymbol](#)\n\n</td><td>\n\n</td><td>\n\n(symbolName: string, chunk: string \\| null, parent?: string) =&gt; readonly [symbol: string, chunk: string] \\| undefined\n\n</td><td>\n\nRetrieve chunk name for the symbol.\n\nWhen the application is running on the server the symbols may be imported from different files (as server build is typically a single javascript chunk.) For this reason, it is necessary to convert the chunks from server format to client (browser) format. This is done by looking up symbols (which are globally unique) in the manifest. (Manifest is the mapping of symbols to the client chunk names.)\n\n</td></tr>\n<tr><td>\n\n[importSymbol](#)\n\n</td><td>\n\n</td><td>\n\n(containerEl: Element \\| undefined, url: string \\| URL \\| undefined \\| null, symbol: string) =&gt; [ValueOrPromise](#valueorpromise)&lt;any&gt;\n\n</td><td>\n\nRetrieve a symbol value from QRL.\n\nQwik needs to lazy load data and closures. For this Qwik uses QRLs that are serializable references of resources that are needed. The QRLs contain all the information necessary to retrieve the reference using `importSymbol`.\n\nWhy not use `import()`? Because `import()` is relative to the current file, and the current file is always the Qwik framework. So QRLs have additional information that allows them to serialize imports relative to application base rather than the Qwik framework file.\n\n</td></tr>\n<tr><td>\n\n[isServer](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\nTrue of running on the server platform.\n\n</td></tr>\n<tr><td>\n\n[nextTick](#)\n\n</td><td>\n\n</td><td>\n\n(fn: () =&gt; any) =&gt; Promise&lt;any&gt;\n\n</td><td>\n\nPerform operation on next tick.\n\n</td></tr>\n<tr><td>\n\n[raf](#)\n\n</td><td>\n\n</td><td>\n\n(fn: () =&gt; any) =&gt; Promise&lt;any&gt;\n\n</td><td>\n\nPerform operation on next request-animation-frame.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/platform/types.ts)\n\n<h2 id=\"correctedtoggleevent\">CorrectedToggleEvent</h2>\n\nThis corrects the TS definition for ToggleEvent\n\n```typescript\nexport interface CorrectedToggleEvent extends Event\n```\n\n**Extends:** Event\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[newState](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n'open' \\| 'closed'\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[prevState](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n'open' \\| 'closed'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"createcomputed_\">createComputed$</h2>\n\n> Warning: This API is now obsolete.\n>\n> This is a technology preview\n\nReturns read-only signal that updates when signals used in the `ComputedFn` change. Unlike useComputed$, this is not a hook and it always creates a new signal.\n\n```typescript\ncreateComputed$: <T>(qrl: ComputedFn<T>) => Signal<Awaited<T>>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[ComputedFn](#computedfn)&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[Signal](#signal)&lt;Awaited&lt;T&gt;&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"createcomputedqrl\">createComputedQrl</h2>\n\n```typescript\ncreateComputedQrl: <T>(qrl: QRL<ComputedFn<T>>) => Signal<Awaited<T>>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[QRL](#qrl)&lt;[ComputedFn](#computedfn)&lt;T&gt;&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[Signal](#signal)&lt;Awaited&lt;T&gt;&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"createcontextid\">createContextId</h2>\n\nCreate a context ID to be used in your application. The name should be written with no spaces.\n\nContext is a way to pass stores to the child components without prop-drilling.\n\nUse `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier for the context. It is not the context value itself. See `useContextProvider()` and `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can track context providers and consumers in a way that survives resumability.\n\n### Example\n\n```tsx\n// Declare the Context type.\ninterface TodosStore {\n  items: string[];\n}\n// Create a Context ID (no data is saved here.)\n// You will use this ID to both create and retrieve the Context.\nexport const TodosContext = createContextId<TodosStore>(\"Todos\");\n\n// Example of providing context to child components.\nexport const App = component$(() => {\n  useContextProvider(\n    TodosContext,\n    useStore<TodosStore>({\n      items: [\"Learn Qwik\", \"Build Qwik app\", \"Profit\"],\n    }),\n  );\n\n  return <Items />;\n});\n\n// Example of retrieving the context provided by a parent component.\nexport const Items = component$(() => {\n  const todos = useContext(TodosContext);\n  return (\n    <ul>\n      {todos.items.map((item) => (\n        <li>{item}</li>\n      ))}\n    </ul>\n  );\n});\n```\n\n```typescript\ncreateContextId: <STATE = unknown>(name: string) => ContextId<STATE>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nname\n\n</td><td>\n\nstring\n\n</td><td>\n\nThe name of the context.\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[ContextId](#contextid)&lt;STATE&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts)\n\n<h2 id=\"createsignal\">createSignal</h2>\n\n> Warning: This API is now obsolete.\n>\n> This is a technology preview\n\nCreates a signal.\n\nIf the initial state is a function, the function is invoked to calculate the actual initial state.\n\n```typescript\ncreateSignal: UseSignal;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts)\n\n<h2 id=\"cssproperties\">CSSProperties</h2>\n\n```typescript\nexport interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number>\n```\n\n**Extends:** CSS.Properties&lt;string \\| number&gt;, CSS.PropertiesHyphen&lt;string \\| number&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"datahtmlattributes\">DataHTMLAttributes</h2>\n\n```typescript\nexport interface DataHTMLAttributes<T extends Element> extends Attrs<'data', T>\n```\n\n**Extends:** Attrs&lt;'data', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"delhtmlattributes\">DelHTMLAttributes</h2>\n\n```typescript\nexport interface DelHTMLAttributes<T extends Element> extends Attrs<'del', T>\n```\n\n**Extends:** Attrs&lt;'del', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"detailshtmlattributes\">DetailsHTMLAttributes</h2>\n\n```typescript\nexport interface DetailsHTMLAttributes<T extends Element> extends Attrs<'details', T>\n```\n\n**Extends:** Attrs&lt;'details', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"devjsx\">DevJSX</h2>\n\n```typescript\nexport interface DevJSX\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[columnNumber](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[fileName](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[lineNumber](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[stack?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts)\n\n<h2 id=\"dialoghtmlattributes\">DialogHTMLAttributes</h2>\n\n```typescript\nexport interface DialogHTMLAttributes<T extends Element> extends Attrs<'dialog', T>\n```\n\n**Extends:** Attrs&lt;'dialog', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"domattributes\">DOMAttributes</h2>\n\nThe Qwik-specific attributes that DOM elements accept\n\n```typescript\nexport interface DOMAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL>\n```\n\n**Extends:** DOMAttributesBase&lt;EL&gt;, QwikEvents&lt;EL&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[class?](#)\n\n</td><td>\n\n</td><td>\n\n[ClassList](#classlist) \\| [Signal](#signal)&lt;[ClassList](#classlist)&gt; \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"eagernessoptions\">EagernessOptions</h2>\n\n> Warning: This API is now obsolete.\n>\n> use useVisibleTask$ or useResource$, useTask$ is for running tasks as part of the initial SSR render\n\n```typescript\nexport type EagernessOptions = \"visible\" | \"load\" | \"idle\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"qwikjsx-element\">Element</h2>\n\n```typescript\ntype Element = JSXOutput;\n```\n\n**References:** [JSXOutput](#jsxoutput)\n\n<h2 id=\"qwikjsx-elementchildrenattribute\">ElementChildrenAttribute</h2>\n\n```typescript\ninterface ElementChildrenAttribute\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[children](#)\n\n</td><td>\n\n</td><td>\n\n[JSXChildren](#jsxchildren)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n<h2 id=\"qwikjsx-elementtype\">ElementType</h2>\n\n```typescript\ntype ElementType = string | FunctionComponent<Record<any, any>>;\n```\n\n**References:** [FunctionComponent](#functioncomponent)\n\n<h2 id=\"embedhtmlattributes\">EmbedHTMLAttributes</h2>\n\n```typescript\nexport interface EmbedHTMLAttributes<T extends Element> extends Attrs<'embed', T>\n```\n\n**Extends:** Attrs&lt;'embed', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"errorboundarystore\">ErrorBoundaryStore</h2>\n\n```typescript\nexport interface ErrorBoundaryStore\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[error](#)\n\n</td><td>\n\n</td><td>\n\nany \\| undefined\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/error-handling.ts)\n\n<h2 id=\"event_\">event$</h2>\n\n```typescript\nevent$: <T>(qrl: T) => QRL<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[QRL](#qrl)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"eventhandler\">EventHandler</h2>\n\nA DOM event handler\n\n```typescript\nexport type EventHandler<EV = Event, EL = Element> = {\n  bivarianceHack(event: EV, element: EL): any;\n}[\"bivarianceHack\"];\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"eventqrl\">eventQrl</h2>\n\n```typescript\neventQrl: <T>(qrl: QRL<T>) => QRL<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[QRL](#qrl)&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[QRL](#qrl)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"fieldsethtmlattributes\">FieldsetHTMLAttributes</h2>\n\n```typescript\nexport interface FieldsetHTMLAttributes<T extends Element> extends Attrs<'fieldset', T>\n```\n\n**Extends:** Attrs&lt;'fieldset', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"formhtmlattributes\">FormHTMLAttributes</h2>\n\n```typescript\nexport interface FormHTMLAttributes<T extends Element> extends Attrs<'form', T>\n```\n\n**Extends:** Attrs&lt;'form', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"fragment\">Fragment</h2>\n\n```typescript\nFragment: FunctionComponent<{\n  children?: any;\n  key?: string | number | null;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts)\n\n<h2 id=\"functioncomponent\">FunctionComponent</h2>\n\nAny function taking a props object that returns JSXOutput.\n\nThe `key`, `flags` and `dev` parameters are for internal use.\n\n```typescript\nexport type FunctionComponent<P = unknown> = {\n  renderFn(\n    props: P,\n    key: string | null,\n    flags: number,\n    dev?: DevJSX,\n  ): JSXOutput;\n}[\"renderFn\"];\n```\n\n**References:** [DevJSX](#devjsx), [JSXOutput](#jsxoutput)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts)\n\n<h2 id=\"getplatform\">getPlatform</h2>\n\nRetrieve the `CorePlatform`.\n\nThe `CorePlatform` is also responsible for retrieving the Manifest, that contains mappings from symbols to javascript import chunks. For this reason, `CorePlatform` can't be global, but is specific to the application currently running. On server it is possible that many different applications are running in a single server instance, and for this reason the `CorePlatform` is associated with the application document.\n\n```typescript\ngetPlatform: () => CorePlatform;\n```\n\n**Returns:**\n\n[CorePlatform](#coreplatform)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/platform/platform.ts)\n\n<h2 id=\"h-function\">h</h2>\n\n```typescript\nexport declare namespace h\n```\n\n<table><thead><tr><th>\n\nFunction\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[h(type)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, data)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, text)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, children)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, data, text)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, data, children)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(sel, data, children)](#)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/factory.ts)\n\n<h2 id=\"h-namespace\">h</h2>\n\n```typescript\nexport declare namespace h\n```\n\n<table><thead><tr><th>\n\nFunction\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[h(type)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, data)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, text)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, children)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, data, text)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(type, data, children)](#)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[h(sel, data, children)](#)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/factory.ts)\n\n<h2 id=\"hrhtmlattributes\">HrHTMLAttributes</h2>\n\n```typescript\nexport interface HrHTMLAttributes<T extends Element> extends Attrs<'hr', T>\n```\n\n**Extends:** Attrs&lt;'hr', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlattributeanchortarget\">HTMLAttributeAnchorTarget</h2>\n\n```typescript\nexport type HTMLAttributeAnchorTarget =\n  | \"_self\"\n  | \"_blank\"\n  | \"_parent\"\n  | \"_top\"\n  | (string & {});\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlattributereferrerpolicy\">HTMLAttributeReferrerPolicy</h2>\n\n```typescript\nexport type HTMLAttributeReferrerPolicy = ReferrerPolicy;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlattributes\">HTMLAttributes</h2>\n\n```typescript\nexport interface HTMLAttributes<E extends Element> extends HTMLElementAttrs, DOMAttributes<E>\n```\n\n**Extends:** [HTMLElementAttrs](#htmlelementattrs), [DOMAttributes](#domattributes)&lt;E&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlcrossoriginattribute\">HTMLCrossOriginAttribute</h2>\n\n```typescript\nexport type HTMLCrossOriginAttribute =\n  | \"anonymous\"\n  | \"use-credentials\"\n  | \"\"\n  | undefined;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlelementattrs\">HTMLElementAttrs</h2>\n\n```typescript\nexport interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement>\n```\n\n**Extends:** HTMLAttributesBase, FilterBase&lt;HTMLElement&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlfragment\">HTMLFragment</h2>\n\n```typescript\nHTMLFragment: FunctionComponent<{\n  dangerouslySetInnerHTML: string;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts)\n\n<h2 id=\"htmlhtmlattributes\">HtmlHTMLAttributes</h2>\n\n```typescript\nexport interface HtmlHTMLAttributes<T extends Element> extends Attrs<'html', T>\n```\n\n**Extends:** Attrs&lt;'html', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlinputautocompleteattribute\">HTMLInputAutocompleteAttribute</h2>\n\n```typescript\nexport type HTMLInputAutocompleteAttribute =\n  | \"on\"\n  | \"off\"\n  | \"billing\"\n  | \"shipping\"\n  | \"name\"\n  | \"honorific-prefix\"\n  | \"given-name\"\n  | \"additional-name\"\n  | \"family-name\"\n  | \"honorific-suffix\"\n  | \"nickname\"\n  | \"username\"\n  | \"new-password\"\n  | \"current-password\"\n  | \"one-time-code\"\n  | \"organization-title\"\n  | \"organization\"\n  | \"street-address\"\n  | \"address-line1\"\n  | \"address-line2\"\n  | \"address-line3\"\n  | \"address-level4\"\n  | \"address-level3\"\n  | \"address-level2\"\n  | \"address-level1\"\n  | \"country\"\n  | \"country-name\"\n  | \"postal-code\"\n  | \"cc-name\"\n  | \"cc-given-name\"\n  | \"cc-additional-name\"\n  | \"cc-family-name\"\n  | \"cc-number\"\n  | \"cc-exp\"\n  | \"cc-exp-month\"\n  | \"cc-exp-year\"\n  | \"cc-csc\"\n  | \"cc-type\"\n  | \"transaction-currency\"\n  | \"transaction-amount\"\n  | \"language\"\n  | \"bday\"\n  | \"bday-day\"\n  | \"bday-month\"\n  | \"bday-year\"\n  | \"sex\"\n  | \"url\"\n  | \"photo\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"htmlinputtypeattribute\">HTMLInputTypeAttribute</h2>\n\n```typescript\nexport type HTMLInputTypeAttribute =\n  | \"button\"\n  | \"checkbox\"\n  | \"color\"\n  | \"date\"\n  | \"datetime-local\"\n  | \"email\"\n  | \"file\"\n  | \"hidden\"\n  | \"image\"\n  | \"month\"\n  | \"number\"\n  | \"password\"\n  | \"radio\"\n  | \"range\"\n  | \"reset\"\n  | \"search\"\n  | \"submit\"\n  | \"tel\"\n  | \"text\"\n  | \"time\"\n  | \"url\"\n  | \"week\"\n  | (string & {});\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"iframehtmlattributes\">IframeHTMLAttributes</h2>\n\n```typescript\nexport interface IframeHTMLAttributes<T extends Element> extends Attrs<'iframe', T>\n```\n\n**Extends:** Attrs&lt;'iframe', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"imghtmlattributes\">ImgHTMLAttributes</h2>\n\n```typescript\nexport interface ImgHTMLAttributes<T extends Element> extends Attrs<'img', T>\n```\n\n**Extends:** Attrs&lt;'img', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"implicit_firstarg\">implicit$FirstArg</h2>\n\nCreate a `____$(...)` convenience method from `___(...)`.\n\nIt is very common for functions to take a lazy-loadable resource as a first argument. For this reason, the Qwik Optimizer automatically extracts the first argument from any function which ends in `$`.\n\nThis means that `foo$(arg0)` and `foo($(arg0))` are equivalent with respect to Qwik Optimizer. The former is just a shorthand for the latter.\n\nFor example, these function calls are equivalent:\n\n- `component$(() => {...})` is same as `component($(() => {...}))`\n\n```tsx\nexport function myApi(callback: QRL<() => void>): void {\n  // ...\n}\n\nexport const myApi$ = implicit$FirstArg(myApi);\n// type of myApi$: (callback: () => void): void\n\n// can be used as:\nmyApi$(() => console.log(\"callback\"));\n\n// will be transpiled to:\n// FILE: <current file>\nmyApi(qrl(\"./chunk-abc.js\", \"callback\"));\n\n// FILE: chunk-abc.js\nexport const callback = () => console.log(\"callback\");\n```\n\n```typescript\nimplicit$FirstArg: <FIRST, REST extends any[], RET>(\n    fn: (qrl: QRL<FIRST>, ...rest: REST) => RET,\n  ) =>\n  (qrl: FIRST, ...rest: REST) =>\n    RET;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nfn\n\n</td><td>\n\n(qrl: [QRL](#qrl)&lt;FIRST&gt;, ...rest: REST) =&gt; RET\n\n</td><td>\n\nA function that should have its first argument automatically `$`.\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n((qrl: FIRST, ...rest: REST) =&gt; RET)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/util/implicit_dollar.ts)\n\n<h2 id=\"inputhtmlattributes\">InputHTMLAttributes</h2>\n\n```typescript\nexport type InputHTMLAttributes<T extends Element> = Attrs<\n  \"input\",\n  T,\n  HTMLInputElement\n>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"inshtmlattributes\">InsHTMLAttributes</h2>\n\n```typescript\nexport interface InsHTMLAttributes<T extends Element> extends Attrs<'ins', T>\n```\n\n**Extends:** Attrs&lt;'ins', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"qwikjsx-intrinsicattributes\">IntrinsicAttributes</h2>\n\n```typescript\ninterface IntrinsicAttributes extends QwikIntrinsicAttributes\n```\n\n**Extends:** QwikIntrinsicAttributes\n\n<h2 id=\"intrinsicelements\">IntrinsicElements</h2>\n\n```typescript\nexport interface IntrinsicElements extends IntrinsicHTMLElements, IntrinsicSVGElements\n```\n\n**Extends:** IntrinsicHTMLElements, IntrinsicSVGElements\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"issignal\">isSignal</h2>\n\nChecks if a given object is a `Signal`.\n\n```typescript\nisSignal: <T = unknown>(obj: any) => obj is Signal<T>\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nobj\n\n</td><td>\n\nany\n\n</td><td>\n\nThe object to check if `Signal`.\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nobj is [Signal](#signal)&lt;T&gt;\n\nBoolean - True if the object is a `Signal`.\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/signal.ts)\n\n<h2 id=\"jsx\">jsx</h2>\n\nUsed by the JSX transpilers to create a JSXNode. Note that the optimizer will not use this, instead using \\_jsxQ, \\_jsxS, and \\_jsxC directly.\n\n```typescript\njsx: <T extends string | FunctionComponent<any>>(\n  type: T,\n  props: T extends FunctionComponent<infer PROPS>\n    ? PROPS\n    : Record<any, unknown>,\n  key?: string | number | null,\n) => JSXNode<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\ntype\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nprops\n\n</td><td>\n\nT extends [FunctionComponent](#functioncomponent)&lt;infer PROPS&gt; ? PROPS : Record&lt;any, unknown&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nkey\n\n</td><td>\n\nstring \\| number \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[JSXNode](#jsxnode)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts)\n\n<h2 id=\"jsxchildren\">JSXChildren</h2>\n\n```typescript\nexport type JSXChildren =\n  | string\n  | number\n  | boolean\n  | null\n  | undefined\n  | Function\n  | RegExp\n  | JSXChildren[]\n  | Promise<JSXChildren>\n  | Signal<JSXChildren>\n  | JSXNode;\n```\n\n**References:** [JSXChildren](#jsxchildren), [Signal](#signal), [JSXNode](#jsxnode)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"jsxdev\">jsxDEV</h2>\n\n```typescript\njsxDEV: <T extends string | FunctionComponent<Record<any, unknown>>>(\n  type: T,\n  props: T extends FunctionComponent<infer PROPS>\n    ? PROPS\n    : Record<any, unknown>,\n  key: string | number | null | undefined,\n  _isStatic: boolean,\n  opts: JsxDevOpts,\n  _ctx: unknown,\n) => JSXNode<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\ntype\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nprops\n\n</td><td>\n\nT extends [FunctionComponent](#functioncomponent)&lt;infer PROPS&gt; ? PROPS : Record&lt;any, unknown&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nkey\n\n</td><td>\n\nstring \\| number \\| null \\| undefined\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n\\_isStatic\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\nJsxDevOpts\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n\\_ctx\n\n</td><td>\n\nunknown\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[JSXNode](#jsxnode)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts)\n\n<h2 id=\"jsxnode\">JSXNode</h2>\n\nA JSX Node, an internal structure. You probably want to use `JSXOutput` instead.\n\n```typescript\nexport interface JSXNode<T extends string | FunctionComponent | unknown = unknown>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[children](#)\n\n</td><td>\n\n</td><td>\n\n[JSXChildren](#jsxchildren) \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[dev?](#)\n\n</td><td>\n\n</td><td>\n\n[DevJSX](#devjsx)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[key](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[props](#)\n\n</td><td>\n\n</td><td>\n\nT extends [FunctionComponent](#functioncomponent)&lt;infer P&gt; ? P : Record&lt;any, unknown&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[type](#)\n\n</td><td>\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts)\n\n<h2 id=\"jsxoutput\">JSXOutput</h2>\n\nAny valid output for a component\n\n```typescript\nexport type JSXOutput =\n  | JSXNode\n  | string\n  | number\n  | boolean\n  | null\n  | undefined\n  | JSXOutput[];\n```\n\n**References:** [JSXNode](#jsxnode), [JSXOutput](#jsxoutput)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-node.ts)\n\n<h2 id=\"jsxtagname\">JSXTagName</h2>\n\n```typescript\nexport type JSXTagName =\n  | keyof HTMLElementTagNameMap\n  | Omit<string, keyof HTMLElementTagNameMap>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"keygenhtmlattributes\">KeygenHTMLAttributes</h2>\n\n> Warning: This API is now obsolete.\n>\n> in html5\n\n```typescript\nexport interface KeygenHTMLAttributes<T extends Element> extends Attrs<'base', T>\n```\n\n**Extends:** Attrs&lt;'base', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"knowneventnames\">KnownEventNames</h2>\n\nThe names of events that Qwik knows about. They are all lowercase, but on the JSX side, they are PascalCase for nicer DX. (`onAuxClick$` vs `onauxclick$`)\n\n```typescript\nexport type KnownEventNames = LiteralUnion<AllEventKeys, string>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"labelhtmlattributes\">LabelHTMLAttributes</h2>\n\n```typescript\nexport interface LabelHTMLAttributes<T extends Element> extends Attrs<'label', T>\n```\n\n**Extends:** Attrs&lt;'label', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"lihtmlattributes\">LiHTMLAttributes</h2>\n\n```typescript\nexport interface LiHTMLAttributes<T extends Element> extends Attrs<'li', T>\n```\n\n**Extends:** Attrs&lt;'li', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"linkhtmlattributes\">LinkHTMLAttributes</h2>\n\n```typescript\nexport interface LinkHTMLAttributes<T extends Element> extends Attrs<'link', T>\n```\n\n**Extends:** Attrs&lt;'link', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"maphtmlattributes\">MapHTMLAttributes</h2>\n\n```typescript\nexport interface MapHTMLAttributes<T extends Element> extends Attrs<'map', T>\n```\n\n**Extends:** Attrs&lt;'map', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"mediahtmlattributes\">MediaHTMLAttributes</h2>\n\n```typescript\nexport interface MediaHTMLAttributes<T extends Element> extends HTMLAttributes<T>, Augmented<HTMLMediaElement, {\n    crossOrigin?: HTMLCrossOriginAttribute;\n}>\n```\n\n**Extends:** [HTMLAttributes](#htmlattributes)&lt;T&gt;, Augmented&lt;HTMLMediaElement, \\{ crossOrigin?: [HTMLCrossOriginAttribute](#htmlcrossoriginattribute); }&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[crossOrigin?](#)\n\n</td><td>\n\n</td><td>\n\n[HTMLCrossOriginAttribute](#htmlcrossoriginattribute)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"menuhtmlattributes\">MenuHTMLAttributes</h2>\n\n```typescript\nexport interface MenuHTMLAttributes<T extends Element> extends Attrs<'menu', T>\n```\n\n**Extends:** Attrs&lt;'menu', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"metahtmlattributes\">MetaHTMLAttributes</h2>\n\n```typescript\nexport interface MetaHTMLAttributes<T extends Element> extends Attrs<'meta', T>\n```\n\n**Extends:** Attrs&lt;'meta', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"meterhtmlattributes\">MeterHTMLAttributes</h2>\n\n```typescript\nexport interface MeterHTMLAttributes<T extends Element> extends Attrs<'meter', T>\n```\n\n**Extends:** Attrs&lt;'meter', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"nativeanimationevent\">NativeAnimationEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `AnimationEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeAnimationEvent = AnimationEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativeclipboardevent\">NativeClipboardEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `ClipboardEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeClipboardEvent = ClipboardEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativecompositionevent\">NativeCompositionEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `CompositionEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeCompositionEvent = CompositionEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativedragevent\">NativeDragEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `DragEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeDragEvent = DragEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativefocusevent\">NativeFocusEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `FocusEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeFocusEvent = FocusEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativekeyboardevent\">NativeKeyboardEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `KeyboardEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeKeyboardEvent = KeyboardEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativemouseevent\">NativeMouseEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `MouseEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeMouseEvent = MouseEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativepointerevent\">NativePointerEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `PointerEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativePointerEvent = PointerEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativetouchevent\">NativeTouchEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `TouchEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeTouchEvent = TouchEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativetransitionevent\">NativeTransitionEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `TransitionEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeTransitionEvent = TransitionEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativeuievent\">NativeUIEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `UIEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeUIEvent = UIEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"nativewheelevent\">NativeWheelEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `WheelEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type NativeWheelEvent = WheelEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"noserialize-function\">noSerialize</h2>\n\nReturned type of the `noSerialize()` function. It will be TYPE or undefined.\n\n```typescript\nexport type NoSerialize<T> =\n  | (T & {\n      __no_serialize__: true;\n    })\n  | undefined;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/common.ts)\n\n<h2 id=\"noserialize-type-alias\">NoSerialize</h2>\n\nReturned type of the `noSerialize()` function. It will be TYPE or undefined.\n\n```typescript\nexport type NoSerialize<T> =\n  | (T & {\n      __no_serialize__: true;\n    })\n  | undefined;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/common.ts)\n\n<h2 id=\"numberish\">Numberish</h2>\n\n```typescript\nexport type Numberish = number | `${number}`;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"objecthtmlattributes\">ObjectHTMLAttributes</h2>\n\n```typescript\nexport interface ObjectHTMLAttributes<T extends Element> extends Attrs<'object', T>\n```\n\n**Extends:** Attrs&lt;'object', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"olhtmlattributes\">OlHTMLAttributes</h2>\n\n```typescript\nexport interface OlHTMLAttributes<T extends Element> extends Attrs<'ol', T>\n```\n\n**Extends:** Attrs&lt;'ol', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"onrenderfn\">OnRenderFn</h2>\n\n```typescript\nexport type OnRenderFn<PROPS> = (props: PROPS) => JSXOutput;\n```\n\n**References:** [JSXOutput](#jsxoutput)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts)\n\n<h2 id=\"onvisibletaskoptions\">OnVisibleTaskOptions</h2>\n\n```typescript\nexport interface OnVisibleTaskOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[strategy?](#)\n\n</td><td>\n\n</td><td>\n\n[VisibleTaskStrategy](#visibletaskstrategy)\n\n</td><td>\n\n_(Optional)_ The strategy to use to determine when the \"VisibleTask\" should first execute.\n\n- `intersection-observer`: the task will first execute when the element is visible in the viewport, under the hood it uses the IntersectionObserver API. - `document-ready`: the task will first execute when the document is ready, under the hood it uses the document `load` event. - `document-idle`: the task will first execute when the document is idle, under the hood it uses the requestIdleCallback API.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"optgrouphtmlattributes\">OptgroupHTMLAttributes</h2>\n\n```typescript\nexport interface OptgroupHTMLAttributes<T extends Element> extends Attrs<'optgroup', T>\n```\n\n**Extends:** Attrs&lt;'optgroup', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"optionhtmlattributes\">OptionHTMLAttributes</h2>\n\n```typescript\nexport interface OptionHTMLAttributes<T extends Element> extends Attrs<'option', T>\n```\n\n**Extends:** Attrs&lt;'option', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"outputhtmlattributes\">OutputHTMLAttributes</h2>\n\n```typescript\nexport interface OutputHTMLAttributes<T extends Element> extends Attrs<'output', T>\n```\n\n**Extends:** Attrs&lt;'output', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"paramhtmlattributes\">ParamHTMLAttributes</h2>\n\n> Warning: This API is now obsolete.\n>\n> Old DOM API\n\n```typescript\nexport interface ParamHTMLAttributes<T extends Element> extends Attrs<'base', T, HTMLParamElement>\n```\n\n**Extends:** Attrs&lt;'base', T, HTMLParamElement&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"prefetchgraph\">PrefetchGraph</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n> Warning: This API is now obsolete.\n>\n> This is no longer needed as the preloading happens automatically in qrl-class. You can remove this component from your app.\n\n```typescript\nPrefetchGraph: (opts?: {\n  base?: string;\n  manifestHash?: string;\n  manifestURL?: string;\n  nonce?: string;\n}) => JSXOutput;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n\\{ base?: string; manifestHash?: string; manifestURL?: string; nonce?: string; }\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[JSXOutput](#jsxoutput)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts)\n\n<h2 id=\"prefetchserviceworker\">PrefetchServiceWorker</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n> Warning: This API is now obsolete.\n>\n> This is no longer needed as the preloading happens automatically in qrl-class.ts. Leave this in your app for a while so it uninstalls existing service workers, but don't use it for new projects.\n\n```typescript\nPrefetchServiceWorker: (opts: {\n  base?: string;\n  scope?: string;\n  path?: string;\n  verbose?: boolean;\n  fetchBundleGraph?: boolean;\n  nonce?: string;\n}) => JSXNode<\"script\">;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n\\{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nJSXNode&lt;'script'&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts)\n\n<h2 id=\"progresshtmlattributes\">ProgressHTMLAttributes</h2>\n\n```typescript\nexport interface ProgressHTMLAttributes<T extends Element> extends Attrs<'progress', T>\n```\n\n**Extends:** Attrs&lt;'progress', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"propfninterface\">PropFnInterface</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `QRL<>` instead\n\n```typescript\nexport type PropFnInterface<ARGS extends any[], RET> = {\n  __qwik_serializable__?: any;\n  (...args: ARGS): Promise<RET>;\n};\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"propfunction\">PropFunction</h2>\n\nAlias for `QRL<T>`. Of historic relevance only.\n\n```typescript\nexport type PropFunction<T> = QRL<T>;\n```\n\n**References:** [QRL](#qrl)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"propfunctionprops\">PropFunctionProps</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `QRL<>` on your function props instead\n\n```typescript\nexport type PropFunctionProps<PROPS extends Record<any, any>> = {\n  [K in keyof PROPS]: PROPS[K] extends undefined\n    ? PROPS[K]\n    : PROPS[K] extends ((...args: infer ARGS) => infer RET) | undefined\n      ? PropFnInterface<ARGS, Awaited<RET>>\n      : PROPS[K];\n};\n```\n\n**References:** [PropFnInterface](#propfninterface)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts)\n\n<h2 id=\"propsof\">PropsOf</h2>\n\nInfers `Props` from the component or tag.\n\n```typescript\nexport type PropsOf<COMP> = COMP extends string\n  ? COMP extends keyof QwikIntrinsicElements\n    ? QwikIntrinsicElements[COMP]\n    : QwikIntrinsicElements[\"span\"]\n  : NonNullable<COMP> extends never\n    ? never\n    : COMP extends FunctionComponent<infer PROPS>\n      ? PROPS extends Record<any, infer V>\n        ? IsAny<V> extends true\n          ? never\n          : ObjectProps<PROPS>\n        : COMP extends Component<infer OrigProps>\n          ? ObjectProps<OrigProps>\n          : PROPS\n      : never;\n```\n\n**References:** [QwikIntrinsicElements](#qwikintrinsicelements), [FunctionComponent](#functioncomponent), [Component](#component)\n\n```tsx\nconst Desc = component$(\n  ({ desc, ...props }: { desc: string } & PropsOf<\"div\">) => {\n    return <div {...props}>{desc}</div>;\n  },\n);\n\nconst TitleBox = component$(\n  ({ title, ...props }: { title: string } & PropsOf<Box>) => {\n    return (\n      <Box {...props}>\n        <h1>{title}</h1>\n      </Box>\n    );\n  },\n);\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts)\n\n<h2 id=\"publicprops\">PublicProps</h2>\n\nExtends the defined component PROPS, adding the default ones (children and q:slot) and allowing plain functions to QRL arguments.\n\n```typescript\nexport type PublicProps<PROPS> = (PROPS extends Record<any, any>\n  ? Omit<PROPS, `${string}$`> & _Only$<PROPS>\n  : unknown extends PROPS\n    ? {}\n    : PROPS) &\n  ComponentBaseProps &\n  ComponentChildren<PROPS>;\n```\n\n**References:** [ComponentBaseProps](#componentbaseprops)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/component/component.public.ts)\n\n<h2 id=\"qrl-function\">qrl</h2>\n\nThe `QRL` type represents a lazy-loadable AND serializable resource.\n\nQRL stands for Qwik URL.\n\nUse `QRL` when you want to refer to a lazy-loaded resource. `QRL`s are most often used for code (functions) but can also be used for other resources such as `string`s in the case of styles.\n\n`QRL` is an opaque token that is generated by the Qwik Optimizer. (Do not rely on any properties in `QRL` as it may change between versions.)\n\n\\#\\# Creating `QRL` references\n\nCreating `QRL` is done using `$(...)` function. `$(...)` is a special marker for the Qwik Optimizer that marks that the code should be extracted into a lazy-loaded symbol.\n\n```tsx\nuseOnDocument(\n  \"mousemove\",\n  $((event) => console.log(\"mousemove\", event)),\n);\n```\n\nIn the above code, the Qwik Optimizer detects `$(...)` and transforms the code as shown below:\n\n```tsx\n// FILE: <current file>\nuseOnDocument(\"mousemove\", qrl(\"./chunk-abc.js\", \"onMousemove\"));\n\n// FILE: chunk-abc.js\nexport const onMousemove = () => console.log(\"mousemove\");\n```\n\nNOTE: `qrl(...)` is a result of Qwik Optimizer transformation. You should never have to invoke this function directly in your application. The `qrl(...)` function should be invoked only after the Qwik Optimizer transformation.\n\n\\#\\# Using `QRL`s\n\nUse `QRL` type in your application when you want to get a lazy-loadable reference to a resource (most likely a function).\n\n```tsx\n// Example of declaring a custom functions which takes callback as QRL.\nexport function useMyFunction(callback: QRL<() => void>) {\n  doExtraStuff();\n  // The callback passed to `onDocument` requires `QRL`.\n  useOnDocument(\"mousemove\", callback);\n}\n```\n\nIn the above example, the way to think about the code is that you are not asking for a callback function but rather a reference to a lazy-loadable callback function. Specifically, the function loading should be delayed until it is actually needed. In the above example, the function would not load until after a `mousemove` event on `document` fires.\n\n\\#\\# Resolving `QRL` references\n\nAt times it may be necessary to resolve a `QRL` reference to the actual value. This can be performed using `QRL.resolve(..)` function.\n\n```tsx\n// Assume you have QRL reference to a greet function\nconst lazyGreet: QRL<() => void> = $(() => console.log(\"Hello World!\"));\n\n// Use `qrlImport` to load / resolve the reference.\nconst greet: () => void = await lazyGreet.resolve();\n\n//  Invoke it\ngreet();\n```\n\nNOTE: `element` is needed because `QRL`s are relative and need a base location to resolve against. The base location is encoded in the HTML in the form of `<div q:base=\"/url\">`.\n\n\\#\\# `QRL.resolved`\n\nOnce `QRL.resolve()` returns, the value is stored under `QRL.resolved`. This allows the value to be used without having to await `QRL.resolve()` again.\n\n\\#\\# Question: Why not just use `import()`?\n\nAt first glance, `QRL` serves the same purpose as `import()`. However, there are three subtle differences that need to be taken into account.\n\n1. `QRL`s must be serializable into HTML. 2. `QRL`s must be resolved by framework relative to `q:base`. 3. `QRL`s must be able to capture lexically scoped variables. 4. `QRL`s encapsulate the difference between running with and without Qwik Optimizer. 5. `QRL`s allow expressing lazy-loaded boundaries without thinking about chunk and symbol names.\n\nLet's assume that you intend to write code such as this:\n\n```tsx\nreturn <button onClick={() => (await import('./chunk-abc.js')).onClick}>\n```\n\nThe above code needs to be serialized into DOM such as:\n\n```\n<div q:base=\"/build/\">\n  <button on:click=\"./chunk-abc.js#onClick\">...</button>\n</div>\n```\n\n1. Notice there is no easy way to extract chunk (`./chunk-abc.js`) and symbol (`onClick`) into HTML. 2. Notice that even if you could extract it, the `import('./chunk-abc.js')` would become relative to where the `import()` file is declared. Because it is our framework doing the load, the `./chunk-abc.js` would become relative to the framework file. This is not correct, as it should be relative to the original file generated by the bundler. 3. Next, the framework needs to resolve the `./chunk-abc.js` and needs a base location that is encoded in the HTML. 4. The QRL needs to be able to capture lexically scoped variables. (`import()` only allows loading top-level symbols which don't capture variables.) 5. As a developer, you don't want to think about `import` and naming the chunks and symbols. You just want to say: \"this should be lazy.\"\n\nThese are the main reasons why Qwik introduces its own concept of `QRL`.\n\n```typescript\nexport type QRL<TYPE = unknown> = {\n  __qwik_serializable__?: any;\n  __brand__QRL__: TYPE;\n  resolve(): Promise<TYPE>;\n  resolved: undefined | TYPE;\n  getCaptured(): unknown[] | null;\n  getSymbol(): string;\n  getHash(): string;\n  dev: QRLDev | null;\n} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.ts)\n\n<h2 id=\"qrl-type-alias\">QRL</h2>\n\nThe `QRL` type represents a lazy-loadable AND serializable resource.\n\nQRL stands for Qwik URL.\n\nUse `QRL` when you want to refer to a lazy-loaded resource. `QRL`s are most often used for code (functions) but can also be used for other resources such as `string`s in the case of styles.\n\n`QRL` is an opaque token that is generated by the Qwik Optimizer. (Do not rely on any properties in `QRL` as it may change between versions.)\n\n\\#\\# Creating `QRL` references\n\nCreating `QRL` is done using `$(...)` function. `$(...)` is a special marker for the Qwik Optimizer that marks that the code should be extracted into a lazy-loaded symbol.\n\n```tsx\nuseOnDocument(\n  \"mousemove\",\n  $((event) => console.log(\"mousemove\", event)),\n);\n```\n\nIn the above code, the Qwik Optimizer detects `$(...)` and transforms the code as shown below:\n\n```tsx\n// FILE: <current file>\nuseOnDocument(\"mousemove\", qrl(\"./chunk-abc.js\", \"onMousemove\"));\n\n// FILE: chunk-abc.js\nexport const onMousemove = () => console.log(\"mousemove\");\n```\n\nNOTE: `qrl(...)` is a result of Qwik Optimizer transformation. You should never have to invoke this function directly in your application. The `qrl(...)` function should be invoked only after the Qwik Optimizer transformation.\n\n\\#\\# Using `QRL`s\n\nUse `QRL` type in your application when you want to get a lazy-loadable reference to a resource (most likely a function).\n\n```tsx\n// Example of declaring a custom functions which takes callback as QRL.\nexport function useMyFunction(callback: QRL<() => void>) {\n  doExtraStuff();\n  // The callback passed to `onDocument` requires `QRL`.\n  useOnDocument(\"mousemove\", callback);\n}\n```\n\nIn the above example, the way to think about the code is that you are not asking for a callback function but rather a reference to a lazy-loadable callback function. Specifically, the function loading should be delayed until it is actually needed. In the above example, the function would not load until after a `mousemove` event on `document` fires.\n\n\\#\\# Resolving `QRL` references\n\nAt times it may be necessary to resolve a `QRL` reference to the actual value. This can be performed using `QRL.resolve(..)` function.\n\n```tsx\n// Assume you have QRL reference to a greet function\nconst lazyGreet: QRL<() => void> = $(() => console.log(\"Hello World!\"));\n\n// Use `qrlImport` to load / resolve the reference.\nconst greet: () => void = await lazyGreet.resolve();\n\n//  Invoke it\ngreet();\n```\n\nNOTE: `element` is needed because `QRL`s are relative and need a base location to resolve against. The base location is encoded in the HTML in the form of `<div q:base=\"/url\">`.\n\n\\#\\# `QRL.resolved`\n\nOnce `QRL.resolve()` returns, the value is stored under `QRL.resolved`. This allows the value to be used without having to await `QRL.resolve()` again.\n\n\\#\\# Question: Why not just use `import()`?\n\nAt first glance, `QRL` serves the same purpose as `import()`. However, there are three subtle differences that need to be taken into account.\n\n1. `QRL`s must be serializable into HTML. 2. `QRL`s must be resolved by framework relative to `q:base`. 3. `QRL`s must be able to capture lexically scoped variables. 4. `QRL`s encapsulate the difference between running with and without Qwik Optimizer. 5. `QRL`s allow expressing lazy-loaded boundaries without thinking about chunk and symbol names.\n\nLet's assume that you intend to write code such as this:\n\n```tsx\nreturn <button onClick={() => (await import('./chunk-abc.js')).onClick}>\n```\n\nThe above code needs to be serialized into DOM such as:\n\n```\n<div q:base=\"/build/\">\n  <button on:click=\"./chunk-abc.js#onClick\">...</button>\n</div>\n```\n\n1. Notice there is no easy way to extract chunk (`./chunk-abc.js`) and symbol (`onClick`) into HTML. 2. Notice that even if you could extract it, the `import('./chunk-abc.js')` would become relative to where the `import()` file is declared. Because it is our framework doing the load, the `./chunk-abc.js` would become relative to the framework file. This is not correct, as it should be relative to the original file generated by the bundler. 3. Next, the framework needs to resolve the `./chunk-abc.js` and needs a base location that is encoded in the HTML. 4. The QRL needs to be able to capture lexically scoped variables. (`import()` only allows loading top-level symbols which don't capture variables.) 5. As a developer, you don't want to think about `import` and naming the chunks and symbols. You just want to say: \"this should be lazy.\"\n\nThese are the main reasons why Qwik introduces its own concept of `QRL`.\n\n```typescript\nexport type QRL<TYPE = unknown> = {\n  __qwik_serializable__?: any;\n  __brand__QRL__: TYPE;\n  resolve(): Promise<TYPE>;\n  resolved: undefined | TYPE;\n  getCaptured(): unknown[] | null;\n  getSymbol(): string;\n  getHash(): string;\n  dev: QRLDev | null;\n} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"qrleventhandlermulti\">QRLEventHandlerMulti</h2>\n\n> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nAn event handler for Qwik events, can be a handler QRL or an array of handler QRLs.\n\n```typescript\nexport type QRLEventHandlerMulti<EV extends Event, EL> =\n  | QRL<EventHandler<EV, EL>>\n  | undefined\n  | null\n  | QRLEventHandlerMulti<EV, EL>[]\n  | EventHandler<EV, EL>;\n```\n\n**References:** [QRL](#qrl), [EventHandler](#eventhandler), [QRLEventHandlerMulti](#qrleventhandlermulti)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"quotehtmlattributes\">QuoteHTMLAttributes</h2>\n\n```typescript\nexport interface QuoteHTMLAttributes<T extends Element> extends Attrs<'q', T>\n```\n\n**Extends:** Attrs&lt;'q', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"qwikanimationevent\">QwikAnimationEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `AnimationEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikAnimationEvent<T = Element> = NativeAnimationEvent;\n```\n\n**References:** [NativeAnimationEvent](#nativeanimationevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikattributes\">QwikAttributes</h2>\n\nThe Qwik DOM attributes without plain handlers, for use as function parameters\n\n```typescript\nexport interface QwikAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL, false>\n```\n\n**Extends:** DOMAttributesBase&lt;EL&gt;, QwikEvents&lt;EL, false&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[class?](#)\n\n</td><td>\n\n</td><td>\n\n[ClassList](#classlist) \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts)\n\n<h2 id=\"qwikchangeevent\">QwikChangeEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `Event` and use the second argument to the handler function for the current event target. Also note that in Qwik, onInput$ with the InputEvent is the event that behaves like onChange in React.\n\n```typescript\nexport type QwikChangeEvent<T = Element> = Event;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikclipboardevent\">QwikClipboardEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `ClipboardEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikClipboardEvent<T = Element> = NativeClipboardEvent;\n```\n\n**References:** [NativeClipboardEvent](#nativeclipboardevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikcompositionevent\">QwikCompositionEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `CompositionEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikCompositionEvent<T = Element> = NativeCompositionEvent;\n```\n\n**References:** [NativeCompositionEvent](#nativecompositionevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikdomattributes\">QwikDOMAttributes</h2>\n\n```typescript\nexport interface QwikDOMAttributes extends DOMAttributes<Element>\n```\n\n**Extends:** [DOMAttributes](#domattributes)&lt;Element&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik.ts)\n\n<h2 id=\"qwikdragevent\">QwikDragEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `DragEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikDragEvent<T = Element> = NativeDragEvent;\n```\n\n**References:** [NativeDragEvent](#nativedragevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikfocusevent\">QwikFocusEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `FocusEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikFocusEvent<T = Element> = NativeFocusEvent;\n```\n\n**References:** [NativeFocusEvent](#nativefocusevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikhtmlelements\">QwikHTMLElements</h2>\n\nThe DOM props without plain handlers, for use inside functions\n\n```typescript\nexport type QwikHTMLElements = {\n  [tag in keyof HTMLElementTagNameMap]: Augmented<\n    HTMLElementTagNameMap[tag],\n    SpecialAttrs[tag]\n  > &\n    HTMLElementAttrs &\n    QwikAttributes<HTMLElementTagNameMap[tag]>;\n};\n```\n\n**References:** [HTMLElementAttrs](#htmlelementattrs), [QwikAttributes](#qwikattributes)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"qwikidleevent\">QwikIdleEvent</h2>\n\nEmitted by qwik-loader on document when the document first becomes idle\n\n```typescript\nexport type QwikIdleEvent = CustomEvent<{}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikinitevent\">QwikInitEvent</h2>\n\nEmitted by qwik-loader on document when the document first becomes interactive\n\n```typescript\nexport type QwikInitEvent = CustomEvent<{}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikintrinsicelements\">QwikIntrinsicElements</h2>\n\nThe interface holds available attributes of both native DOM elements and custom Qwik elements. An example showing how to define a customizable wrapper component:\n\n```tsx\nimport { component$, Slot, type QwikIntrinsicElements } from \"@builder.io/qwik\";\n\ntype WrapperProps = {\n  attributes?: QwikIntrinsicElements[\"div\"];\n};\n\nexport default component$<WrapperProps>(({ attributes }) => {\n  return (\n    <div {...attributes} class=\"p-2\">\n      <Slot />\n    </div>\n  );\n});\n```\n\nNote: It is shorter to use `PropsOf<'div'>`\n\n```typescript\nexport interface QwikIntrinsicElements extends QwikHTMLElements, QwikSVGElements\n```\n\n**Extends:** [QwikHTMLElements](#qwikhtmlelements), [QwikSVGElements](#qwiksvgelements)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-elements.ts)\n\n<h2 id=\"qwikinvalidevent\">QwikInvalidEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `Event` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikInvalidEvent<T = Element> = Event;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikjsx\">QwikJSX</h2>\n\n```typescript\nexport declare namespace QwikJSX\n```\n\n<table><thead><tr><th>\n\nInterface\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[ElementChildrenAttribute](#qwikjsx-elementchildrenattribute)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[IntrinsicAttributes](#qwikjsx-intrinsicattributes)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[IntrinsicElements](#)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n<table><thead><tr><th>\n\nType Alias\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[Element](#qwikjsx-element)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[ElementType](#qwikjsx-elementtype)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik.ts)\n\n<h2 id=\"qwikkeyboardevent\">QwikKeyboardEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `KeyboardEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikKeyboardEvent<T = Element> = NativeKeyboardEvent;\n```\n\n**References:** [NativeKeyboardEvent](#nativekeyboardevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikmouseevent\">QwikMouseEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `MouseEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikMouseEvent<T = Element, E = NativeMouseEvent> = E;\n```\n\n**References:** [NativeMouseEvent](#nativemouseevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikpointerevent\">QwikPointerEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `PointerEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikPointerEvent<T = Element> = NativePointerEvent;\n```\n\n**References:** [NativePointerEvent](#nativepointerevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwiksubmitevent\">QwikSubmitEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `SubmitEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikSubmitEvent<T = Element> = SubmitEvent;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwiksvgelements\">QwikSVGElements</h2>\n\nThe SVG props without plain handlers, for use inside functions\n\n```typescript\nexport type QwikSVGElements = {\n  [K in keyof Omit<\n    SVGElementTagNameMap,\n    keyof HTMLElementTagNameMap\n  >]: SVGProps<SVGElementTagNameMap[K]>;\n};\n```\n\n**References:** [SVGProps](#svgprops)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"qwiksymbolevent\">QwikSymbolEvent</h2>\n\nEmitted by qwik-loader when a module was lazily loaded\n\n```typescript\nexport type QwikSymbolEvent = CustomEvent<{\n  symbol: string;\n  element: Element;\n  reqTime: number;\n  qBase?: string;\n  qManifest?: string;\n  qVersion?: string;\n  href?: string;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwiktouchevent\">QwikTouchEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `TouchEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikTouchEvent<T = Element> = NativeTouchEvent;\n```\n\n**References:** [NativeTouchEvent](#nativetouchevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwiktransitionevent\">QwikTransitionEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `TransitionEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikTransitionEvent<T = Element> = NativeTransitionEvent;\n```\n\n**References:** [NativeTransitionEvent](#nativetransitionevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikuievent\">QwikUIEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `UIEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikUIEvent<T = Element> = NativeUIEvent;\n```\n\n**References:** [NativeUIEvent](#nativeuievent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikvisibleevent\">QwikVisibleEvent</h2>\n\nEmitted by qwik-loader when an element becomes visible. Used by `useVisibleTask$`\n\n```typescript\nexport type QwikVisibleEvent = CustomEvent<IntersectionObserverEntry>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"qwikwheelevent\">QwikWheelEvent</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `WheelEvent` and use the second argument to the handler function for the current event target\n\n```typescript\nexport type QwikWheelEvent<T = Element> = NativeWheelEvent;\n```\n\n**References:** [NativeWheelEvent](#nativewheelevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts)\n\n<h2 id=\"readonlysignal\">ReadonlySignal</h2>\n\n```typescript\nexport type ReadonlySignal<T = unknown> = Readonly<Signal<T>>;\n```\n\n**References:** [Signal](#signal)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/signal.ts)\n\n<h2 id=\"render\">render</h2>\n\nRender JSX.\n\nUse this method to render JSX. This function does reconciling which means it always tries to reuse what is already in the DOM (rather then destroy and recreate content.) It returns a cleanup function you could use for cleaning up subscriptions.\n\n```typescript\nrender: (\n  parent: Element | Document,\n  jsxOutput: JSXOutput | FunctionComponent<any>,\n  opts?: RenderOptions,\n) => Promise<RenderResult>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nparent\n\n</td><td>\n\nElement \\| Document\n\n</td><td>\n\nElement which will act as a parent to `jsxNode`. When possible the rendering will try to reuse existing nodes.\n\n</td></tr>\n<tr><td>\n\njsxOutput\n\n</td><td>\n\n[JSXOutput](#jsxoutput) \\| [FunctionComponent](#functioncomponent)&lt;any&gt;\n\n</td><td>\n\nJSX to render\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[RenderOptions](#renderoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;[RenderResult](#renderresult)&gt;\n\nAn object containing a cleanup function.\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/dom/render.public.ts)\n\n<h2 id=\"renderonce\">RenderOnce</h2>\n\n```typescript\nRenderOnce: FunctionComponent<{\n  children?: unknown;\n  key?: string | number | null | undefined;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/jsx-runtime.ts)\n\n<h2 id=\"renderoptions\">RenderOptions</h2>\n\n```typescript\nexport interface RenderOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[serverData?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, any&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/dom/render.public.ts)\n\n<h2 id=\"renderresult\">RenderResult</h2>\n\n```typescript\nexport interface RenderResult\n```\n\n<table><thead><tr><th>\n\nMethod\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[cleanup()](#renderresult-cleanup)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/dom/render.public.ts)\n\n<h2 id=\"renderssroptions\">RenderSSROptions</h2>\n\n```typescript\nexport interface RenderSSROptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[base?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[beforeClose?](#)\n\n</td><td>\n\n</td><td>\n\n(contexts: QContext[], containerState: ContainerState, containsDynamic: boolean, textNodes: Map&lt;string, string&gt;) =&gt; Promise&lt;[JSXNode](#jsxnode)&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[beforeContent?](#)\n\n</td><td>\n\n</td><td>\n\n[JSXNode](#jsxnode)&lt;string&gt;[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[containerAttributes](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[containerTagName](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[manifestHash](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[serverData?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, any&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stream](#)\n\n</td><td>\n\n</td><td>\n\n[StreamWriter](#streamwriter)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/ssr/render-ssr.ts)\n\n<h2 id=\"resource\">Resource</h2>\n\nThis method works like an async memoized function that runs whenever some tracked value changes and returns some data.\n\n`useResource` however returns immediate a `ResourceReturn` object that contains the data and a state that indicates if the data is available or not.\n\nThe status can be one of the following:\n\n- 'pending' - the data is not yet available. - 'resolved' - the data is available. - 'rejected' - the data is not available due to an error or timeout.\n\n### Example\n\nExample showing how `useResource` to perform a fetch to request the weather, whenever the input city name changes.\n\n```tsx\nconst Cmp = component$(() => {\n  const cityS = useSignal(\"\");\n\n  const weatherResource = useResource$(async ({ track, cleanup }) => {\n    const cityName = track(cityS);\n    const abortController = new AbortController();\n    cleanup(() => abortController.abort(\"cleanup\"));\n    const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\n      signal: abortController.signal,\n    });\n    const data = await res.json();\n    return data as { temp: number };\n  });\n\n  return (\n    <div>\n      <input name=\"city\" bind:value={cityS} />\n      <Resource\n        value={weatherResource}\n        onResolved={(weather) => {\n          return <div>Temperature: {weather.temp}</div>;\n        }}\n      />\n    </div>\n  );\n});\n```\n\n```typescript\nResource: <T>(props: ResourceProps<T>) => JSXOutput;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nprops\n\n</td><td>\n\n[ResourceProps](#resourceprops)&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[JSXOutput](#jsxoutput)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts)\n\n<h2 id=\"resourcectx\">ResourceCtx</h2>\n\n```typescript\nexport interface ResourceCtx<T>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[previous](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nT \\| undefined\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[track](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[Tracker](#tracker)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n<table><thead><tr><th>\n\nMethod\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[cache(policyOrMilliseconds)](#resourcectx-cache)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[cleanup(callback)](#)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"resourcefn\">ResourceFn</h2>\n\n```typescript\nexport type ResourceFn<T> = (ctx: ResourceCtx<unknown>) => ValueOrPromise<T>;\n```\n\n**References:** [ResourceCtx](#resourcectx), [ValueOrPromise](#valueorpromise)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"resourceoptions\">ResourceOptions</h2>\n\nOptions to pass to `useResource$()`\n\n```typescript\nexport interface ResourceOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[timeout?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ Timeout in milliseconds. If the resource takes more than the specified millisecond, it will timeout. Resulting on a rejected resource.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts)\n\n<h2 id=\"resourcepending\">ResourcePending</h2>\n\n```typescript\nexport interface ResourcePending<T>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[loading](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[value](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nPromise&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"resourceprops\">ResourceProps</h2>\n\n```typescript\nexport interface ResourceProps<T>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[onPending?](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; [JSXOutput](#jsxoutput) \\| Promise&lt;[JSXOutput](#jsxoutput)&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[onRejected?](#)\n\n</td><td>\n\n</td><td>\n\n(reason: Error) =&gt; [JSXOutput](#jsxoutput) \\| Promise&lt;[JSXOutput](#jsxoutput)&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[onResolved](#)\n\n</td><td>\n\n</td><td>\n\n(value: T) =&gt; [JSXOutput](#jsxoutput) \\| Promise&lt;[JSXOutput](#jsxoutput)&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[value](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[ResourceReturn](#resourcereturn)&lt;T&gt; \\| [Signal](#signal)&lt;Promise&lt;T&gt; \\| T&gt; \\| Promise&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts)\n\n<h2 id=\"resourcerejected\">ResourceRejected</h2>\n\n```typescript\nexport interface ResourceRejected<T>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[loading](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[value](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nPromise&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"resourceresolved\">ResourceResolved</h2>\n\n```typescript\nexport interface ResourceResolved<T>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[loading](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[value](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nPromise&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"resourcereturn\">ResourceReturn</h2>\n\n```typescript\nexport type ResourceReturn<T> =\n  | ResourcePending<T>\n  | ResourceResolved<T>\n  | ResourceRejected<T>;\n```\n\n**References:** [ResourcePending](#resourcepending), [ResourceResolved](#resourceresolved), [ResourceRejected](#resourcerejected)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"scripthtmlattributes\">ScriptHTMLAttributes</h2>\n\n```typescript\nexport interface ScriptHTMLAttributes<T extends Element> extends Attrs<'script', T>\n```\n\n**Extends:** Attrs&lt;'script', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"selecthtmlattributes\">SelectHTMLAttributes</h2>\n\n```typescript\nexport interface SelectHTMLAttributes<T extends Element> extends Attrs<'select', T>\n```\n\n**Extends:** Attrs&lt;'select', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"setplatform\">setPlatform</h2>\n\nSets the `CorePlatform`.\n\nThis is useful to override the platform in tests to change the behavior of, `requestAnimationFrame`, and import resolution.\n\n```typescript\nsetPlatform: (plt: CorePlatform) => CorePlatform;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nplt\n\n</td><td>\n\n[CorePlatform](#coreplatform)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[CorePlatform](#coreplatform)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/platform/platform.ts)\n\n<h2 id=\"signal\">Signal</h2>\n\nA signal is a reactive value which can be read and written. When the signal is written, all tasks which are tracking the signal will be re-run and all components that read the signal will be re-rendered.\n\nFurthermore, when a signal value is passed as a prop to a component, the optimizer will automatically forward the signal. This means that `return <div title={signal.value}>hi</div>` will update the `title` attribute when the signal changes without having to re-render the component.\n\n```typescript\nexport interface Signal<T = any>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[value](#)\n\n</td><td>\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/signal.ts)\n\n<h2 id=\"size\">Size</h2>\n\n```typescript\nexport type Size = number | string;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"skiprender\">SkipRender</h2>\n\n```typescript\nSkipRender: JSXNode;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"slot\">Slot</h2>\n\nAllows to project the children of the current component. `<Slot/>` can only be used within the context of a component defined with `component$`.\n\n```typescript\nSlot: FunctionComponent<{\n  name?: string;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/slot.public.ts)\n\n<h2 id=\"slothtmlattributes\">SlotHTMLAttributes</h2>\n\n```typescript\nexport interface SlotHTMLAttributes<T extends Element> extends Attrs<'slot', T>\n```\n\n**Extends:** Attrs&lt;'slot', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"snapshotlistener\">SnapshotListener</h2>\n\n```typescript\nexport interface SnapshotListener\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[el](#)\n\n</td><td>\n\n</td><td>\n\nElement\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[key](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[qrl](#)\n\n</td><td>\n\n</td><td>\n\n[QRL](#qrl)&lt;any&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts)\n\n<h2 id=\"snapshotmeta\">SnapshotMeta</h2>\n\n```typescript\nexport type SnapshotMeta = Record<string, SnapshotMetaValue>;\n```\n\n**References:** [SnapshotMetaValue](#snapshotmetavalue)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts)\n\n<h2 id=\"snapshotmetavalue\">SnapshotMetaValue</h2>\n\n```typescript\nexport interface SnapshotMetaValue\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[c?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[h?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[s?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[w?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts)\n\n<h2 id=\"snapshotresult\">SnapshotResult</h2>\n\n```typescript\nexport interface SnapshotResult\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[funcs](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[mode](#)\n\n</td><td>\n\n</td><td>\n\n'render' \\| 'listeners' \\| 'static'\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[objs](#)\n\n</td><td>\n\n</td><td>\n\nany[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[qrls](#)\n\n</td><td>\n\n</td><td>\n\n[QRL](#qrl)[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[resources](#)\n\n</td><td>\n\n</td><td>\n\nResourceReturnInternal&lt;any&gt;[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[state](#)\n\n</td><td>\n\n</td><td>\n\n[SnapshotState](#snapshotstate)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts)\n\n<h2 id=\"snapshotstate\">SnapshotState</h2>\n\n```typescript\nexport interface SnapshotState\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[ctx](#)\n\n</td><td>\n\n</td><td>\n\n[SnapshotMeta](#snapshotmeta)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[objs](#)\n\n</td><td>\n\n</td><td>\n\nany[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[refs](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[subs](#)\n\n</td><td>\n\n</td><td>\n\nany[]\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/container/container.ts)\n\n<h2 id=\"sourcehtmlattributes\">SourceHTMLAttributes</h2>\n\n```typescript\nexport interface SourceHTMLAttributes<T extends Element> extends Attrs<'source', T>\n```\n\n**Extends:** Attrs&lt;'source', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"ssrcomment\">SSRComment</h2>\n\n```typescript\nSSRComment: FunctionComponent<{\n  data: string;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"ssrhint\">SSRHint</h2>\n\n> Warning: This API is now obsolete.\n>\n> - It has no effect\n\n```typescript\nSSRHint: FunctionComponent<SSRHintProps>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"ssrhintprops\">SSRHintProps</h2>\n\n```typescript\nexport type SSRHintProps = {\n  dynamic?: boolean;\n};\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"ssrraw\">SSRRaw</h2>\n\n```typescript\nSSRRaw: FunctionComponent<{\n  data: string;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"ssrstream\">SSRStream</h2>\n\n```typescript\nSSRStream: FunctionComponent<SSRStreamProps>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"ssrstreamblock\">SSRStreamBlock</h2>\n\n```typescript\nSSRStreamBlock: FunctionComponent<{\n  children?: any;\n}>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"ssrstreamprops\">SSRStreamProps</h2>\n\n```typescript\nexport type SSRStreamProps = {\n  children:\n    | AsyncGenerator<JSXChildren, void, any>\n    | ((stream: StreamWriter) => Promise<void>)\n    | (() => AsyncGenerator<JSXChildren, void, any>);\n};\n```\n\n**References:** [JSXChildren](#jsxchildren), [StreamWriter](#streamwriter)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/utils.public.ts)\n\n<h2 id=\"streamwriter\">StreamWriter</h2>\n\n```typescript\nexport type StreamWriter = {\n  write: (chunk: string) => void;\n};\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/ssr/render-ssr.ts)\n\n<h2 id=\"stylehtmlattributes\">StyleHTMLAttributes</h2>\n\n```typescript\nexport interface StyleHTMLAttributes<T extends Element> extends Attrs<'style', T>\n```\n\n**Extends:** Attrs&lt;'style', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"svgattributes\">SVGAttributes</h2>\n\nThe TS types don't include the SVG attributes so we have to define them ourselves\n\nNOTE: These props are probably not complete\n\n```typescript\nexport interface SVGAttributes<T extends Element = Element> extends AriaAttributes\n```\n\n**Extends:** [AriaAttributes](#ariaattributes)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[\"accent-height\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"alignment-baseline\"?](#)\n\n</td><td>\n\n</td><td>\n\n'auto' \\| 'baseline' \\| 'before-edge' \\| 'text-before-edge' \\| 'middle' \\| 'central' \\| 'after-edge' \\| 'text-after-edge' \\| 'ideographic' \\| 'alphabetic' \\| 'hanging' \\| 'mathematical' \\| 'inherit' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"arabic-form\"?](#)\n\n</td><td>\n\n</td><td>\n\n'initial' \\| 'medial' \\| 'terminal' \\| 'isolated' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"baseline-shift\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"cap-height\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"clip-path\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"clip-rule\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"color-interpolation-filters\"?](#)\n\n</td><td>\n\n</td><td>\n\n'auto' \\| 's-rGB' \\| 'linear-rGB' \\| 'inherit' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"color-interpolation\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"color-profile\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"color-rendering\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"dominant-baseline\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"edge-mode\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"enable-background\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"fill-opacity\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"fill-rule\"?](#)\n\n</td><td>\n\n</td><td>\n\n'nonzero' \\| 'evenodd' \\| 'inherit' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"flood-color\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"flood-opacity\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"font-family\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"font-size-adjust\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"font-size\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"font-stretch\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"font-style\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"font-variant\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"font-weight\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"glyph-name\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"glyph-orientation-horizontal\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"glyph-orientation-vertical\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"horiz-adv-x\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"horiz-origin-x\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"image-rendering\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"letter-spacing\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"lighting-color\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"marker-end\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"marker-mid\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"marker-start\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"overline-position\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"overline-thickness\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"paint-order\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"pointer-events\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"rendering-intent\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"shape-rendering\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stop-color\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stop-opacity\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"strikethrough-position\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"strikethrough-thickness\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stroke-dasharray\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| number \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stroke-dashoffset\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| number \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stroke-linecap\"?](#)\n\n</td><td>\n\n</td><td>\n\n'butt' \\| 'round' \\| 'square' \\| 'inherit' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stroke-linejoin\"?](#)\n\n</td><td>\n\n</td><td>\n\n'miter' \\| 'round' \\| 'bevel' \\| 'inherit' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stroke-miterlimit\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stroke-opacity\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"stroke-width\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"text-anchor\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"text-decoration\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"text-rendering\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"underline-position\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"underline-thickness\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"unicode-bidi\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"unicode-range\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"units-per-em\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"v-alphabetic\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"v-hanging\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"v-ideographic\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"v-mathematical\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"vector-effect\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"vert-adv-y\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"vert-origin-x\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"vert-origin-y\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"word-spacing\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"writing-mode\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"x-channel-selector\"?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"x-height\"?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xlink:actuate\"?](#svgattributes-_xlink_actuate_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xlink:arcrole\"?](#svgattributes-_xlink_arcrole_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xlink:href\"?](#svgattributes-_xlink_href_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xlink:role\"?](#svgattributes-_xlink_role_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xlink:show\"?](#svgattributes-_xlink_show_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xlink:title\"?](#svgattributes-_xlink_title_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xlink:type\"?](#svgattributes-_xlink_type_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xml:base\"?](#svgattributes-_xml_base_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xml:lang\"?](#svgattributes-_xml_lang_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xml:space\"?](#svgattributes-_xml_space_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\"xmlns:xlink\"?](#svgattributes-_xmlns_xlink_)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[accumulate?](#)\n\n</td><td>\n\n</td><td>\n\n'none' \\| 'sum' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[additive?](#)\n\n</td><td>\n\n</td><td>\n\n'replace' \\| 'sum' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[allowReorder?](#)\n\n</td><td>\n\n</td><td>\n\n'no' \\| 'yes' \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[alphabetic?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[amplitude?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[ascent?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[attributeName?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[attributeType?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[autoReverse?](#)\n\n</td><td>\n\n</td><td>\n\n[Booleanish](#booleanish) \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[azimuth?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[baseFrequency?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[baseProfile?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[bbox?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[begin?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[bias?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[by?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[calcMode?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[clip?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[clipPathUnits?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[color?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[contentScriptType?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[contentStyleType?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[crossOrigin?](#)\n\n</td><td>\n\n</td><td>\n\n[HTMLCrossOriginAttribute](#htmlcrossoriginattribute)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[cursor?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[cx?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[cy?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[d?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[decelerate?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[descent?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[diffuseConstant?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[direction?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[display?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[divisor?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[dur?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[dx?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[dy?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[elevation?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[end?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[exponent?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[externalResourcesRequired?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[fill?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[filter?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[filterRes?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[filterUnits?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[focusable?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[format?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[fr?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[from?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[fx?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[fy?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[g1?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[g2?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[glyphRef?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[gradientTransform?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[gradientUnits?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[hanging?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[height?](#)\n\n</td><td>\n\n</td><td>\n\n[Size](#size) \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[href?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[id?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[ideographic?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[in?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[in2?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[intercept?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[k?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[k1?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[k2?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[k3?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[k4?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[kernelMatrix?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[kernelUnitLength?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[kerning?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[keyPoints?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[keySplines?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[keyTimes?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[lang?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[lengthAdjust?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[limitingConeAngle?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[local?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[markerHeight?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[markerUnits?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[markerWidth?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[mask?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[maskContentUnits?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[maskUnits?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[mathematical?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[max?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[media?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[method?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[min?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[mode?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[name?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[numOctaves?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[offset?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[opacity?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[operator?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[order?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[orient?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[orientation?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[origin?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[overflow?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[panose1?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[path?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[pathLength?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[patternContentUnits?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[patternTransform?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[patternUnits?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[points?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[pointsAtX?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[pointsAtY?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[pointsAtZ?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[preserveAlpha?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[preserveAspectRatio?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[primitiveUnits?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[r?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[radius?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[refX?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[refY?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[repeatCount?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[repeatDur?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[requiredextensions?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[requiredFeatures?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[restart?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[result?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[role?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[rotate?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[rx?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[ry?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[scale?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[seed?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[slope?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[spacing?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[specularConstant?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[specularExponent?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[speed?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[spreadMethod?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[startOffset?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stdDeviation?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stemh?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stemv?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stitchTiles?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[string?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stroke?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[style?](#)\n\n</td><td>\n\n</td><td>\n\n[CSSProperties](#cssproperties) \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[surfaceScale?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[systemLanguage?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[tabindex?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[tableValues?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[target?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[targetX?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[targetY?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[textLength?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[to?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[transform?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[type?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[u1?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[u2?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[unicode?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[values?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[version?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[viewBox?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[viewTarget?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[visibility?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[width?](#)\n\n</td><td>\n\n</td><td>\n\n[Size](#size) \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[widths?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[x?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[x1?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[x2?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[xmlns?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[y?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[y1?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[y2?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[yChannelSelector?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[z?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| string \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[zoomAndPan?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"svgprops\">SVGProps</h2>\n\n```typescript\nexport interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T>\n```\n\n**Extends:** [SVGAttributes](#svgattributes), [QwikAttributes](#qwikattributes)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"sync_\">sync$</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nExtract function into a synchronously loadable QRL.\n\nNOTE: Synchronous QRLs functions can't close over any variables, including exports.\n\n```typescript\nsync$: <T extends Function>(fn: T) => SyncQRL<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nfn\n\n</td><td>\n\nT\n\n</td><td>\n\nFunction to extract.\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[SyncQRL](#syncqrl)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"syncqrl\">SyncQRL</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nexport interface SyncQRL<TYPE extends Function = any> extends QRL<TYPE>\n```\n\n**Extends:** [QRL](#qrl)&lt;TYPE&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[\\_\\_brand\\_\\_SyncQRL\\_\\_](#)\n\n</td><td>\n\n</td><td>\n\nTYPE\n\n</td><td>\n\n**_(ALPHA)_**\n\n</td></tr>\n<tr><td>\n\n[dev](#)\n\n</td><td>\n\n</td><td>\n\nQRLDev \\| null\n\n</td><td>\n\n**_(ALPHA)_**\n\n</td></tr>\n<tr><td>\n\n[resolved](#)\n\n</td><td>\n\n</td><td>\n\nTYPE\n\n</td><td>\n\n**_(ALPHA)_**\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/qrl/qrl.public.ts)\n\n<h2 id=\"tablehtmlattributes\">TableHTMLAttributes</h2>\n\n```typescript\nexport interface TableHTMLAttributes<T extends Element> extends Attrs<'table', T>\n```\n\n**Extends:** Attrs&lt;'table', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"taskctx\">TaskCtx</h2>\n\n```typescript\nexport interface TaskCtx\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[track](#)\n\n</td><td>\n\n</td><td>\n\n[Tracker](#tracker)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n<table><thead><tr><th>\n\nMethod\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[cleanup(callback)](#)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"taskfn\">TaskFn</h2>\n\n```typescript\nexport type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => void)>;\n```\n\n**References:** [TaskCtx](#taskctx), [ValueOrPromise](#valueorpromise)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"tdhtmlattributes\">TdHTMLAttributes</h2>\n\n```typescript\nexport interface TdHTMLAttributes<T extends Element> extends Attrs<'td', T>\n```\n\n**Extends:** Attrs&lt;'td', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"textareahtmlattributes\">TextareaHTMLAttributes</h2>\n\n```typescript\nexport interface TextareaHTMLAttributes<T extends Element> extends Attrs<'textarea', T>\n```\n\n**Extends:** Attrs&lt;'textarea', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"thhtmlattributes\">ThHTMLAttributes</h2>\n\n```typescript\nexport interface ThHTMLAttributes<T extends Element> extends Attrs<'tr', T>\n```\n\n**Extends:** Attrs&lt;'tr', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"timehtmlattributes\">TimeHTMLAttributes</h2>\n\n```typescript\nexport interface TimeHTMLAttributes<T extends Element> extends Attrs<'time', T>\n```\n\n**Extends:** Attrs&lt;'time', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"titlehtmlattributes\">TitleHTMLAttributes</h2>\n\n```typescript\nexport interface TitleHTMLAttributes<T extends Element> extends Attrs<'title', T>\n```\n\n**Extends:** Attrs&lt;'title', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"tracker\">Tracker</h2>\n\nUsed to signal to Qwik which state should be watched for changes.\n\nThe `Tracker` is passed into the `taskFn` of `useTask`. It is intended to be used to wrap state objects in a read proxy which signals to Qwik which properties should be watched for changes. A change to any of the properties causes the `taskFn` to rerun.\n\n### Example\n\nThe `obs` passed into the `taskFn` is used to mark `state.count` as a property of interest. Any changes to the `state.count` property will cause the `taskFn` to rerun.\n\n```tsx\nconst Cmp = component$(() => {\n  const store = useStore({ count: 0, doubleCount: 0 });\n  const signal = useSignal(0);\n  useTask$(({ track }) => {\n    // Any signals or stores accessed inside the task will be tracked\n    const count = track(() => store.count);\n    // You can also pass a signal to track() directly\n    const signalCount = track(signal);\n    store.doubleCount = count + signalCount;\n  });\n  return (\n    <div>\n      <span>\n        {store.count} / {store.doubleCount}\n      </span>\n      <button\n        onClick$={() => {\n          store.count++;\n          signal.value++;\n        }}\n      >\n        +\n      </button>\n    </div>\n  );\n});\n```\n\n```typescript\nexport interface Tracker\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"trackhtmlattributes\">TrackHTMLAttributes</h2>\n\n```typescript\nexport interface TrackHTMLAttributes<T extends Element> extends Attrs<'track', T>\n```\n\n**Extends:** Attrs&lt;'track', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"untrack\">untrack</h2>\n\nGet the value of the expression without tracking listeners. A function will be invoked, signals will return their value, and stores will be unwrapped (they return the backing object).\n\nWhen you pass a function, you can also pass additional arguments that the function will receive.\n\nNote that stores are not unwrapped recursively.\n\n```typescript\nuntrack: <T, A extends any[]>(\n  expr: ((...args: A) => T) | Signal<T> | T,\n  ...args: A\n) => T;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nexpr\n\n</td><td>\n\n((...args: A) =&gt; T) \\| [Signal](#signal)&lt;T&gt; \\| T\n\n</td><td>\n\nThe function or object to evaluate without tracking.\n\n</td></tr>\n<tr><td>\n\nargs\n\n</td><td>\n\nA\n\n</td><td>\n\nAdditional arguments to pass when `expr` is a function.\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nT\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-core.ts)\n\n<h2 id=\"unwrapstore\">unwrapStore</h2>\n\nGet the target value of the Proxy. Useful if you want to clone a store (structureClone, IndexedDB,...)\n\n```typescript\nunwrapProxy: <T>(proxy: T) => T;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nproxy\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nT\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/state/common.ts)\n\n<h2 id=\"usecomputed_\">useComputed$</h2>\n\nReturns a computed signal which is calculated from the given function. A computed signal is a signal which is calculated from other signals. When the signals change, the computed signal is recalculated, and if the result changed, all tasks which are tracking the signal will be re-run and all components that read the signal will be re-rendered.\n\nThe function must be synchronous and must not have any side effects.\n\nAsync functions are deprecated because:\n\n- When calculating the first time, it will see it's a promise and it will restart the render function. - Qwik can't track used signals after the first await, which leads to subtle bugs. - Both `useTask$` and `useResource$` are available, without these problems.\n\nIn v2, async functions won't work.\n\n```typescript\nuseComputed$: <T>(qrl: ComputedFn<T>) => Signal<Awaited<T>>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[ComputedFn](#computedfn)&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[Signal](#signal)&lt;Awaited&lt;T&gt;&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"usecomputedqrl\">useComputedQrl</h2>\n\n```typescript\nuseComputedQrl: <T>(qrl: QRL<ComputedFn<T>>) => Signal<Awaited<T>>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[QRL](#qrl)&lt;[ComputedFn](#computedfn)&lt;T&gt;&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[Signal](#signal)&lt;Awaited&lt;T&gt;&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"useconstant\">useConstant</h2>\n\n> Warning: This API is now obsolete.\n>\n> This is a technology preview\n\nStores a value which is retained for the lifetime of the component.\n\nIf the value is a function, the function is invoked to calculate the actual value.\n\n```typescript\nuseConstant: <T>(value: (() => T) | T) => T;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nvalue\n\n</td><td>\n\n(() =&gt; T) \\| T\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nT\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts)\n\n<h2 id=\"usecontext\">useContext</h2>\n\nRetrieve Context value.\n\nUse `useContext()` to retrieve the value of context in a component. To retrieve a value a parent component needs to invoke `useContextProvider()` to assign a value.\n\n### Example\n\n```tsx\n// Declare the Context type.\ninterface TodosStore {\n  items: string[];\n}\n// Create a Context ID (no data is saved here.)\n// You will use this ID to both create and retrieve the Context.\nexport const TodosContext = createContextId<TodosStore>(\"Todos\");\n\n// Example of providing context to child components.\nexport const App = component$(() => {\n  useContextProvider(\n    TodosContext,\n    useStore<TodosStore>({\n      items: [\"Learn Qwik\", \"Build Qwik app\", \"Profit\"],\n    }),\n  );\n\n  return <Items />;\n});\n\n// Example of retrieving the context provided by a parent component.\nexport const Items = component$(() => {\n  const todos = useContext(TodosContext);\n  return (\n    <ul>\n      {todos.items.map((item) => (\n        <li>{item}</li>\n      ))}\n    </ul>\n  );\n});\n```\n\n```typescript\nuseContext: UseContext;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts)\n\n<h2 id=\"usecontextprovider\">useContextProvider</h2>\n\nAssign a value to a Context.\n\nUse `useContextProvider()` to assign a value to a context. The assignment happens in the component's function. Once assigned, use `useContext()` in any child component to retrieve the value.\n\nContext is a way to pass stores to the child components without prop-drilling. Note that scalar values are allowed, but for reactivity you need signals or stores.\n\n### Example\n\n```tsx\n// Declare the Context type.\ninterface TodosStore {\n  items: string[];\n}\n// Create a Context ID (no data is saved here.)\n// You will use this ID to both create and retrieve the Context.\nexport const TodosContext = createContextId<TodosStore>(\"Todos\");\n\n// Example of providing context to child components.\nexport const App = component$(() => {\n  useContextProvider(\n    TodosContext,\n    useStore<TodosStore>({\n      items: [\"Learn Qwik\", \"Build Qwik app\", \"Profit\"],\n    }),\n  );\n\n  return <Items />;\n});\n\n// Example of retrieving the context provided by a parent component.\nexport const Items = component$(() => {\n  const todos = useContext(TodosContext);\n  return (\n    <ul>\n      {todos.items.map((item) => (\n        <li>{item}</li>\n      ))}\n    </ul>\n  );\n});\n```\n\n```typescript\nuseContextProvider: <STATE>(context: ContextId<STATE>, newValue: STATE) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\ncontext\n\n</td><td>\n\n[ContextId](#contextid)&lt;STATE&gt;\n\n</td><td>\n\nThe context to assign a value to.\n\n</td></tr>\n<tr><td>\n\nnewValue\n\n</td><td>\n\nSTATE\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-context.ts)\n\n<h2 id=\"useerrorboundary\">useErrorBoundary</h2>\n\n```typescript\nuseErrorBoundary: () => ErrorBoundaryStore;\n```\n\n**Returns:**\n\n[ErrorBoundaryStore](#errorboundarystore)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-error-boundary.ts)\n\n<h2 id=\"useid\">useId</h2>\n\n```typescript\nuseId: () => string;\n```\n\n**Returns:**\n\nstring\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-id.ts)\n\n<h2 id=\"useon\">useOn</h2>\n\nRegister a listener on the current component's host element.\n\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.\n\n```typescript\nuseOn: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nevent\n\n</td><td>\n\nT \\| T[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\neventQrl\n\n</td><td>\n\nEventQRL&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-on.ts)\n\n<h2 id=\"useondocument\">useOnDocument</h2>\n\nRegister a listener on `document`.\n\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX.\n\n```typescript\nuseOnDocument: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nevent\n\n</td><td>\n\nT \\| T[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\neventQrl\n\n</td><td>\n\nEventQRL&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-on.ts)\n\n<h2 id=\"useonwindow\">useOnWindow</h2>\n\nRegister a listener on `window`.\n\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX.\n\n```typescript\nuseOnWindow: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nevent\n\n</td><td>\n\nT \\| T[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\neventQrl\n\n</td><td>\n\nEventQRL&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-on.ts)\n\n<h2 id=\"useresource_\">useResource$</h2>\n\nThis method works like an async memoized function that runs whenever some tracked value changes and returns some data.\n\n`useResource` however returns immediate a `ResourceReturn` object that contains the data and a state that indicates if the data is available or not.\n\nThe status can be one of the following:\n\n- 'pending' - the data is not yet available. - 'resolved' - the data is available. - 'rejected' - the data is not available due to an error or timeout.\n\n### Example\n\nExample showing how `useResource` to perform a fetch to request the weather, whenever the input city name changes.\n\n```tsx\nconst Cmp = component$(() => {\n  const cityS = useSignal(\"\");\n\n  const weatherResource = useResource$(async ({ track, cleanup }) => {\n    const cityName = track(cityS);\n    const abortController = new AbortController();\n    cleanup(() => abortController.abort(\"cleanup\"));\n    const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\n      signal: abortController.signal,\n    });\n    const data = await res.json();\n    return data as { temp: number };\n  });\n\n  return (\n    <div>\n      <input name=\"city\" bind:value={cityS} />\n      <Resource\n        value={weatherResource}\n        onResolved={(weather) => {\n          return <div>Temperature: {weather.temp}</div>;\n        }}\n      />\n    </div>\n  );\n});\n```\n\n```typescript\nuseResource$: <T>(generatorFn: ResourceFn<T>, opts?: ResourceOptions) =>\n  ResourceReturn<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\ngeneratorFn\n\n</td><td>\n\n[ResourceFn](#resourcefn)&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[ResourceOptions](#resourceoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[ResourceReturn](#resourcereturn)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts)\n\n<h2 id=\"useresourceqrl\">useResourceQrl</h2>\n\nThis method works like an async memoized function that runs whenever some tracked value changes and returns some data.\n\n`useResource` however returns immediate a `ResourceReturn` object that contains the data and a state that indicates if the data is available or not.\n\nThe status can be one of the following:\n\n- `pending` - the data is not yet available. - `resolved` - the data is available. - `rejected` - the data is not available due to an error or timeout.\n\nAvoid using a `try/catch` statement in `useResource$`. If you catch the error instead of passing it, the resource status will never be `rejected`.\n\n### Example\n\nExample showing how `useResource` to perform a fetch to request the weather, whenever the input city name changes.\n\n```tsx\nconst Cmp = component$(() => {\n  const cityS = useSignal(\"\");\n\n  const weatherResource = useResource$(async ({ track, cleanup }) => {\n    const cityName = track(cityS);\n    const abortController = new AbortController();\n    cleanup(() => abortController.abort(\"cleanup\"));\n    const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\n      signal: abortController.signal,\n    });\n    const data = await res.json();\n    return data as { temp: number };\n  });\n\n  return (\n    <div>\n      <input name=\"city\" bind:value={cityS} />\n      <Resource\n        value={weatherResource}\n        onResolved={(weather) => {\n          return <div>Temperature: {weather.temp}</div>;\n        }}\n      />\n    </div>\n  );\n});\n```\n\n```typescript\nuseResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: ResourceOptions) =>\n  ResourceReturn<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[QRL](#qrl)&lt;[ResourceFn](#resourcefn)&lt;T&gt;&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[ResourceOptions](#resourceoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[ResourceReturn](#resourcereturn)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-resource.ts)\n\n<h2 id=\"useserverdata\">useServerData</h2>\n\n```typescript\nexport declare function useServerData<T>(key: string): T | undefined;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nkey\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nT \\| undefined\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-env-data.ts)\n\n<h2 id=\"usesignal-variable\">useSignal</h2>\n\nHook that creates a signal that is retained for the lifetime of the component.\n\n```typescript\nuseSignal: UseSignal;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts)\n\n<h2 id=\"usesignal-interface\">UseSignal</h2>\n\nHook that creates a signal that is retained for the lifetime of the component.\n\n```typescript\nuseSignal: UseSignal;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-signal.ts)\n\n<h2 id=\"usestore\">useStore</h2>\n\nCreates an object that Qwik can track across serializations.\n\nUse `useStore` to create a state for your application. The returned object is a proxy that has a unique ID. The ID of the object is used in the `QRL`s to refer to the store.\n\n### Example\n\nExample showing how `useStore` is used in Counter example to keep track of the count.\n\n```tsx\nconst Stores = component$(() => {\n  const counter = useCounter(1);\n\n  // Reactivity happens even for nested objects and arrays\n  const userData = useStore({\n    name: \"Manu\",\n    address: {\n      address: \"\",\n      city: \"\",\n    },\n    orgs: [],\n  });\n\n  // useStore() can also accept a function to calculate the initial value\n  const state = useStore(() => {\n    return {\n      value: expensiveInitialValue(),\n    };\n  });\n\n  return (\n    <div>\n      <div>Counter: {counter.value}</div>\n      <Child userData={userData} state={state} />\n    </div>\n  );\n});\n\nfunction useCounter(step: number) {\n  // Multiple stores can be created in custom hooks for convenience and composability\n  const counterStore = useStore({\n    value: 0,\n  });\n  useVisibleTask$(() => {\n    // Only runs in the client\n    const timer = setInterval(() => {\n      counterStore.value += step;\n    }, 500);\n    return () => {\n      clearInterval(timer);\n    };\n  });\n  return counterStore;\n}\n```\n\n```typescript\nuseStore: <STATE extends object>(\n  initialState: STATE | (() => STATE),\n  opts?: UseStoreOptions,\n) => STATE;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\ninitialState\n\n</td><td>\n\nSTATE \\| (() =&gt; STATE)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[UseStoreOptions](#usestoreoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nSTATE\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-store.public.ts)\n\n<h2 id=\"usestoreoptions\">UseStoreOptions</h2>\n\n```typescript\nexport interface UseStoreOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[deep?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ If `true` then all nested objects and arrays will be tracked as well. Default is `true`.\n\n</td></tr>\n<tr><td>\n\n[reactive?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ If `false` then the object will not be tracked for changes. Default is `true`.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-store.public.ts)\n\n<h2 id=\"usestyles_\">useStyles$</h2>\n\nA lazy-loadable reference to a component's styles.\n\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\n\n```tsx\nimport styles from \"./code-block.css?inline\";\n\nexport const CmpStyles = component$(() => {\n  useStyles$(styles);\n\n  return <div>Some text</div>;\n});\n```\n\n```typescript\nuseStyles$: (qrl: string) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts)\n\n<h2 id=\"usestylesqrl\">useStylesQrl</h2>\n\nA lazy-loadable reference to a component's styles.\n\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\n\n```tsx\nimport styles from \"./code-block.css?inline\";\n\nexport const CmpStyles = component$(() => {\n  useStyles$(styles);\n\n  return <div>Some text</div>;\n});\n```\n\n```typescript\nuseStylesQrl: (styles: QRL<string>) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nstyles\n\n</td><td>\n\n[QRL](#qrl)&lt;string&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts)\n\n<h2 id=\"usestylesscoped\">UseStylesScoped</h2>\n\n```typescript\nexport interface UseStylesScoped\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[scopeId](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts)\n\n<h2 id=\"usestylesscoped_\">useStylesScoped$</h2>\n\nA lazy-loadable reference to a component's styles, that is scoped to the component.\n\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\n\n```tsx\nimport scoped from \"./code-block.css?inline\";\n\nexport const CmpScopedStyles = component$(() => {\n  useStylesScoped$(scoped);\n\n  return <div>Some text</div>;\n});\n```\n\n```typescript\nuseStylesScoped$: (qrl: string) => UseStylesScoped;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[UseStylesScoped](#usestylesscoped)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts)\n\n<h2 id=\"usestylesscopedqrl\">useStylesScopedQrl</h2>\n\nA lazy-loadable reference to a component's styles, that is scoped to the component.\n\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\n\n```tsx\nimport scoped from \"./code-block.css?inline\";\n\nexport const CmpScopedStyles = component$(() => {\n  useStylesScoped$(scoped);\n\n  return <div>Some text</div>;\n});\n```\n\n```typescript\nuseStylesScopedQrl: (styles: QRL<string>) => UseStylesScoped;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nstyles\n\n</td><td>\n\n[QRL](#qrl)&lt;string&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[UseStylesScoped](#usestylesscoped)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-styles.ts)\n\n<h2 id=\"usetask_\">useTask$</h2>\n\nReruns the `taskFn` when the observed inputs change.\n\nUse `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when those inputs change.\n\nThe `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs` function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to rerun.\n\n```typescript\nuseTask$: (qrl: TaskFn, opts?: UseTaskOptions | undefined) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[TaskFn](#taskfn)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[UseTaskOptions](#usetaskoptions) \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"usetaskoptions\">UseTaskOptions</h2>\n\n> Warning: This API is now obsolete.\n>\n> use useVisibleTask$ or useResource$, useTask$ is for running tasks as part of the initial SSR render\n\n```typescript\nexport interface UseTaskOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[eagerness?](#)\n\n</td><td>\n\n</td><td>\n\n[EagernessOptions](#eagernessoptions)\n\n</td><td>\n\n_(Optional)_ - `visible`: run the effect when the element is visible. - `load`: eagerly run the effect when the application resumes.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"usetaskqrl\">useTaskQrl</h2>\n\nReruns the `taskFn` when the observed inputs change.\n\nUse `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when those inputs change.\n\nThe `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs` function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to rerun.\n\n```typescript\nuseTaskQrl: (qrl: QRL<TaskFn>, opts?: UseTaskOptions) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[QRL](#qrl)&lt;[TaskFn](#taskfn)&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[UseTaskOptions](#usetaskoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"usevisibletask_\">useVisibleTask$</h2>\n\n```tsx\nconst Timer = component$(() => {\n  const store = useStore({\n    count: 0,\n  });\n\n  useVisibleTask$(() => {\n    // Only runs in the client\n    const timer = setInterval(() => {\n      store.count++;\n    }, 500);\n    return () => {\n      clearInterval(timer);\n    };\n  });\n\n  return <div>{store.count}</div>;\n});\n```\n\n```typescript\nuseVisibleTask$: (qrl: TaskFn, opts?: OnVisibleTaskOptions | undefined) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[TaskFn](#taskfn)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[OnVisibleTaskOptions](#onvisibletaskoptions) \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"usevisibletaskqrl\">useVisibleTaskQrl</h2>\n\n```tsx\nconst Timer = component$(() => {\n  const store = useStore({\n    count: 0,\n  });\n\n  useVisibleTask$(() => {\n    // Only runs in the client\n    const timer = setInterval(() => {\n      store.count++;\n    }, 500);\n    return () => {\n      clearInterval(timer);\n    };\n  });\n\n  return <div>{store.count}</div>;\n});\n```\n\n```typescript\nuseVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[QRL](#qrl)&lt;[TaskFn](#taskfn)&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nopts\n\n</td><td>\n\n[OnVisibleTaskOptions](#onvisibletaskoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"valueorpromise\">ValueOrPromise</h2>\n\nType representing a value which is either resolve or a promise.\n\n```typescript\nexport type ValueOrPromise<T> = T | Promise<T>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/util/types.ts)\n\n<h2 id=\"version\">version</h2>\n\nQWIK_VERSION\n\n```typescript\nversion: string;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/version.ts)\n\n<h2 id=\"videohtmlattributes\">VideoHTMLAttributes</h2>\n\n```typescript\nexport interface VideoHTMLAttributes<T extends Element> extends Attrs<'video', T>\n```\n\n**Extends:** Attrs&lt;'video', T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n\n<h2 id=\"visibletaskstrategy\">VisibleTaskStrategy</h2>\n\n```typescript\nexport type VisibleTaskStrategy =\n  | \"intersection-observer\"\n  | \"document-ready\"\n  | \"document-idle\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-task.ts)\n\n<h2 id=\"webviewhtmlattributes\">WebViewHTMLAttributes</h2>\n\n> Warning: This API is now obsolete.\n>\n> This is the type for a React Native WebView. It doesn't belong in Qwik (yet?) but we're keeping it for backwards compatibility.\n\n```typescript\nexport interface WebViewHTMLAttributes<T extends Element> extends HTMLAttributes<T>\n```\n\n**Extends:** [HTMLAttributes](#htmlattributes)&lt;T&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[allowFullScreen?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[allowpopups?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[autoFocus?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[autosize?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[blinkfeatures?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[disableblinkfeatures?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[disableguestresize?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[disablewebsecurity?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[guestinstance?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[httpreferrer?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[nodeintegration?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[partition?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[plugins?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[preload?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[src?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[useragent?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[webpreferences?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/render/jsx/types/jsx-generated.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city/api.json",
    "content": "{\n  \"id\": \"qwik-city\",\n  \"package\": \"@builder.io/qwik-city\",\n  \"members\": [\n    {\n      \"name\": \"Action\",\n      \"id\": \"action\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Action\",\n          \"id\": \"action\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type Action<RETURN, INPUT = Record<string, unknown>, OPTIONAL extends boolean = true> = {\\n    (): ActionStore<RETURN, INPUT, OPTIONAL>;\\n};\\n```\\n**References:** [ActionStore](#actionstore)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.action.md\"\n    },\n    {\n      \"name\": \"ActionConstructor\",\n      \"id\": \"actionconstructor\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ActionConstructor\",\n          \"id\": \"actionconstructor\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ActionConstructor = {\\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {\\n        readonly id?: string;\\n        readonly validation: [VALIDATOR, ...REST];\\n    }): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;\\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {\\n        readonly id?: string;\\n        readonly validation: [VALIDATOR];\\n    }): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;\\n    <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {\\n        readonly id?: string;\\n        readonly validation: REST;\\n    }): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: VALIDATOR, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;\\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: VALIDATOR): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;\\n    <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\\n    <OBJ>(actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, options?: {\\n        readonly id?: string;\\n    }): Action<StrictUnion<OBJ>>;\\n};\\n```\\n**References:** [TypedDataValidator](#typeddatavalidator)<!-- -->, [DataValidator](#datavalidator)<!-- -->, [GetValidatorOutputType](#getvalidatoroutputtype)<!-- -->, [Action](#action)<!-- -->, [StrictUnion](#strictunion)<!-- -->, [FailReturn](#failreturn)<!-- -->, [ValidatorErrorType](#validatorerrortype)<!-- -->, [GetValidatorInputType](#getvalidatorinputtype)<!-- -->, [FailOfRest](#failofrest)<!-- -->, [JSONObject](#jsonobject)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.actionconstructor.md\"\n    },\n    {\n      \"name\": \"ActionReturn\",\n      \"id\": \"actionreturn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ActionReturn\",\n          \"id\": \"actionreturn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ActionReturn<RETURN> = {\\n    readonly status?: number;\\n    readonly value: RETURN;\\n};\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.actionreturn.md\"\n    },\n    {\n      \"name\": \"ActionStore\",\n      \"id\": \"actionstore\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ActionStore\",\n          \"id\": \"actionstore\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ActionStore<RETURN, INPUT, OPTIONAL extends boolean = true> = {\\n    readonly actionPath: string;\\n    readonly isRunning: boolean;\\n    readonly status?: number;\\n    readonly formData: FormData | undefined;\\n    readonly value: RETURN | undefined;\\n    readonly submit: QRL<OPTIONAL extends true ? (form?: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>> : (form: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>>>;\\n    readonly submitted: boolean;\\n};\\n```\\n**References:** [ActionReturn](#actionreturn)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.actionstore.md\"\n    },\n    {\n      \"name\": \"ContentHeading\",\n      \"id\": \"contentheading\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ContentHeading\",\n          \"id\": \"contentheading\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ContentHeading \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[id](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[level](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[text](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.contentheading.md\"\n    },\n    {\n      \"name\": \"ContentMenu\",\n      \"id\": \"contentmenu\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ContentMenu\",\n          \"id\": \"contentmenu\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ContentMenu \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[href?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[items?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[ContentMenu](#contentmenu)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[text](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.contentmenu.md\"\n    },\n    {\n      \"name\": \"DataValidator\",\n      \"id\": \"datavalidator\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DataValidator\",\n          \"id\": \"datavalidator\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type DataValidator<T extends Record<string, any> = {}> = {\\n    validate(ev: RequestEvent, data: unknown): Promise<ValidatorReturn<T>>;\\n};\\n```\\n**References:** [ValidatorReturn](#validatorreturn)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.datavalidator.md\"\n    },\n    {\n      \"name\": \"DocumentHead\",\n      \"id\": \"documenthead\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DocumentHead\",\n          \"id\": \"documenthead\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type DocumentHead = DocumentHeadValue | ((props: DocumentHeadProps) => DocumentHeadValue);\\n```\\n**References:** [DocumentHeadValue](#documentheadvalue)<!-- -->, [DocumentHeadProps](#documentheadprops)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.documenthead.md\"\n    },\n    {\n      \"name\": \"DocumentHeadProps\",\n      \"id\": \"documentheadprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DocumentHeadProps\",\n          \"id\": \"documentheadprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DocumentHeadProps extends RouteLocation \\n```\\n**Extends:** [RouteLocation](#routelocation)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[head](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[ResolvedDocumentHead](#resolveddocumenthead)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[resolveValue](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nResolveSyncValue\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[withLocale](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n&lt;T&gt;(fn: () =&gt; T) =&gt; T\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.documentheadprops.md\"\n    },\n    {\n      \"name\": \"DocumentHeadValue\",\n      \"id\": \"documentheadvalue\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DocumentHeadValue\",\n          \"id\": \"documentheadvalue\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DocumentHeadValue<FrontMatter extends Record<string, any> = Record<string, unknown>> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[frontmatter?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nReadonly&lt;FrontMatter&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_ Arbitrary object containing custom data. When the document head is created from markdown files, the frontmatter attributes that are not recognized as a well-known meta names (such as title, description, author, etc...), are stored in this property.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[links?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nreadonly [DocumentLink](#documentlink)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Used to manually append `<link>` elements to the `<head>`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[meta?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nreadonly [DocumentMeta](#documentmeta)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Used to manually set meta tags in the head. Additionally, the `data` property could be used to set arbitrary data which the `<head>` component could later use to generate `<meta>` tags.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[scripts?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nreadonly [DocumentScript](#documentscript)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Used to manually append `<script>` elements to the `<head>`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[styles?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nreadonly [DocumentStyle](#documentstyle)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Used to manually append `<style>` elements to the `<head>`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[title?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ Sets `document.title`<!-- -->.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.documentheadvalue.md\"\n    },\n    {\n      \"name\": \"DocumentLink\",\n      \"id\": \"documentlink\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DocumentLink\",\n          \"id\": \"documentlink\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DocumentLink \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[as?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[crossorigin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[disabled?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[href?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[hreflang?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[id?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[imagesizes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[imagesrcset?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[integrity?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[key?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[media?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[prefetch?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[referrerpolicy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rel?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sizes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[title?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[type?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.documentlink.md\"\n    },\n    {\n      \"name\": \"DocumentMeta\",\n      \"id\": \"documentmeta\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DocumentMeta\",\n          \"id\": \"documentmeta\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DocumentMeta \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[content?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[httpEquiv?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[itemprop?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[key?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[media?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[name?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[property?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.documentmeta.md\"\n    },\n    {\n      \"name\": \"DocumentScript\",\n      \"id\": \"documentscript\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DocumentScript\",\n          \"id\": \"documentscript\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nexport interface DocumentScript \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[key?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** _(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[props?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nReadonly&lt;QwikIntrinsicElements\\\\['script'\\\\]&gt;\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** _(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[script?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** _(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.documentscript.md\"\n    },\n    {\n      \"name\": \"DocumentStyle\",\n      \"id\": \"documentstyle\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DocumentStyle\",\n          \"id\": \"documentstyle\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface DocumentStyle \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[key?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[props?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nReadonly&lt;QwikIntrinsicElements\\\\['style'\\\\]&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[style](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.documentstyle.md\"\n    },\n    {\n      \"name\": \"ErrorBoundary\",\n      \"id\": \"errorboundary\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ErrorBoundary\",\n          \"id\": \"errorboundary\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nErrorBoundary: import(\\\"@builder.io/qwik\\\").Component<ErrorBoundaryProps>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/error-boundary.tsx\",\n      \"mdFile\": \"qwik-city.errorboundary.md\"\n    },\n    {\n      \"name\": \"FailOfRest\",\n      \"id\": \"failofrest\",\n      \"hierarchy\": [\n        {\n          \"name\": \"FailOfRest\",\n          \"id\": \"failofrest\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type FailOfRest<REST extends readonly DataValidator[]> = REST extends readonly DataValidator<infer ERROR>[] ? ERROR : never;\\n```\\n**References:** [DataValidator](#datavalidator)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.failofrest.md\"\n    },\n    {\n      \"name\": \"FailReturn\",\n      \"id\": \"failreturn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"FailReturn\",\n          \"id\": \"failreturn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type FailReturn<T> = T & Failed;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.failreturn.md\"\n    },\n    {\n      \"name\": \"Form\",\n      \"id\": \"form\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Form\",\n          \"id\": \"form\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nForm: <O, I>({ action, spaReset, reloadDocument, onSubmit$, ...rest }: FormProps<O, I>, key: string | null) => import(\\\"@builder.io/qwik\\\").JSXOutput\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n{ action, spaReset, reloadDocument, onSubmit$, ...rest }\\n\\n\\n</td><td>\\n\\n[FormProps](#formprops)<!-- -->&lt;O, I&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nkey\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nimport(\\\"@builder.io/qwik\\\").JSXOutput\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/form-component.tsx\",\n      \"mdFile\": \"qwik-city.form.md\"\n    },\n    {\n      \"name\": \"FormProps\",\n      \"id\": \"formprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"FormProps\",\n          \"id\": \"formprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface FormProps<O, I> extends Omit<QwikJSX.IntrinsicElements['form'], 'action' | 'method'> \\n```\\n**Extends:** Omit&lt;QwikJSX.IntrinsicElements\\\\['form'\\\\], 'action' \\\\| 'method'&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[action?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[ActionStore](#actionstore)<!-- -->&lt;O, I, true \\\\| false&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_ Reference to the action returned by `action()`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[key?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[onSubmit$?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nQRLEventHandlerMulti&lt;SubmitEvent, HTMLFormElement&gt; \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Event handler executed right when the form is submitted.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[onSubmitCompleted$?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nQRLEventHandlerMulti&lt;CustomEvent&lt;[FormSubmitCompletedDetail](#formsubmitsuccessdetail)<!-- -->&lt;O&gt;&gt;, HTMLFormElement&gt; \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_ Event handler executed right after the action is executed successfully and returns some data.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[reloadDocument?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ When `true` the form submission will cause a full page reload, even if SPA mode is enabled and JS is available.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[spaReset?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ When `true` all the form inputs will be reset in SPA mode, just like happens in a full page form submission.\\n\\nDefaults to `false`\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/form-component.tsx\",\n      \"mdFile\": \"qwik-city.formprops.md\"\n    },\n    {\n      \"name\": \"FormSubmitSuccessDetail\",\n      \"id\": \"formsubmitsuccessdetail\",\n      \"hierarchy\": [\n        {\n          \"name\": \"FormSubmitSuccessDetail\",\n          \"id\": \"formsubmitsuccessdetail\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface FormSubmitCompletedDetail<T> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[status](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[value](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/form-component.tsx\",\n      \"mdFile\": \"qwik-city.formsubmitsuccessdetail.md\"\n    },\n    {\n      \"name\": \"GetValidatorInputType\",\n      \"id\": \"getvalidatorinputtype\",\n      \"hierarchy\": [\n        {\n          \"name\": \"GetValidatorInputType\",\n          \"id\": \"getvalidatorinputtype\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type GetValidatorInputType<VALIDATOR extends TypedDataValidator> = VALIDATOR extends ValibotDataValidator<infer TYPE> ? v.InferInput<TYPE> : VALIDATOR extends ZodDataValidator<infer TYPE> ? z.input<TYPE> : never;\\n```\\n**References:** [TypedDataValidator](#typeddatavalidator)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.getvalidatorinputtype.md\"\n    },\n    {\n      \"name\": \"GetValidatorOutputType\",\n      \"id\": \"getvalidatoroutputtype\",\n      \"hierarchy\": [\n        {\n          \"name\": \"GetValidatorOutputType\",\n          \"id\": \"getvalidatoroutputtype\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type GetValidatorOutputType<VALIDATOR extends TypedDataValidator> = VALIDATOR extends ValibotDataValidator<infer TYPE> ? v.InferOutput<TYPE> : VALIDATOR extends ZodDataValidator<infer TYPE> ? z.output<TYPE> : never;\\n```\\n**References:** [TypedDataValidator](#typeddatavalidator)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.getvalidatoroutputtype.md\"\n    },\n    {\n      \"name\": \"GetValidatorType\",\n      \"id\": \"getvalidatortype\",\n      \"hierarchy\": [\n        {\n          \"name\": \"GetValidatorType\",\n          \"id\": \"getvalidatortype\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type GetValidatorType<VALIDATOR extends TypedDataValidator> = GetValidatorOutputType<VALIDATOR>;\\n```\\n**References:** [TypedDataValidator](#typeddatavalidator)<!-- -->, [GetValidatorOutputType](#getvalidatoroutputtype)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.getvalidatortype.md\"\n    },\n    {\n      \"name\": \"globalAction$\",\n      \"id\": \"globalaction_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"globalAction$\",\n          \"id\": \"globalaction_\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nglobalAction$: ActionConstructor\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.globalaction_.md\"\n    },\n    {\n      \"name\": \"globalActionQrl\",\n      \"id\": \"globalactionqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"globalActionQrl\",\n          \"id\": \"globalactionqrl\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nglobalActionQrl: ActionConstructorQRL\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.globalactionqrl.md\"\n    },\n    {\n      \"name\": \"JSONObject\",\n      \"id\": \"jsonobject\",\n      \"hierarchy\": [\n        {\n          \"name\": \"JSONObject\",\n          \"id\": \"jsonobject\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type JSONObject = {\\n    [x: string]: JSONValue;\\n};\\n```\\n**References:** [JSONValue](#jsonvalue)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.jsonobject.md\"\n    },\n    {\n      \"name\": \"JSONValue\",\n      \"id\": \"jsonvalue\",\n      \"hierarchy\": [\n        {\n          \"name\": \"JSONValue\",\n          \"id\": \"jsonvalue\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type JSONValue = string | number | boolean | {\\n    [x: string]: JSONValue;\\n} | Array<JSONValue>;\\n```\\n**References:** [JSONValue](#jsonvalue)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.jsonvalue.md\"\n    },\n    {\n      \"name\": \"Link\",\n      \"id\": \"link\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Link\",\n          \"id\": \"link\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nLink: import(\\\"@builder.io/qwik\\\").Component<LinkProps>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/link-component.tsx\",\n      \"mdFile\": \"qwik-city.link.md\"\n    },\n    {\n      \"name\": \"LinkProps\",\n      \"id\": \"linkprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"LinkProps\",\n          \"id\": \"linkprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface LinkProps extends AnchorAttributes \\n```\\n**Extends:** AnchorAttributes\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[prefetch?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| 'js'\\n\\n\\n</td><td>\\n\\n_(Optional)_ \\\\*\\\\*Defaults to \\\\_true\\\\_.\\\\*\\\\*\\n\\nWhether Qwik should prefetch and cache the target page of this \\\\*\\\\*`Link`<!-- -->\\\\*\\\\*, this includes invoking any \\\\*\\\\*`routeLoader$`<!-- -->\\\\*\\\\*, \\\\*\\\\*`onGet`<!-- -->\\\\*\\\\*, etc.\\n\\nThis \\\\*\\\\*improves UX performance\\\\*\\\\* for client-side (\\\\*\\\\*SPA\\\\*\\\\*) navigations.\\n\\nPrefetching occurs when a the Link enters the viewport in production (\\\\*\\\\*`on:qvisible`<!-- -->\\\\*\\\\*), or with \\\\*\\\\*`mouseover`<!-- -->/`focus`<!-- -->\\\\*\\\\* during dev.\\n\\nPrefetching will not occur if the user has the \\\\*\\\\*data saver\\\\*\\\\* setting enabled.\\n\\nSetting this value to \\\\*\\\\*`\\\"js\\\"`<!-- -->\\\\*\\\\* will prefetch only javascript bundles required to render this page on the client, \\\\*\\\\*`false`<!-- -->\\\\*\\\\* will disable prefetching altogether.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[reload?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[replaceState?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[scroll?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/link-component.tsx\",\n      \"mdFile\": \"qwik-city.linkprops.md\"\n    },\n    {\n      \"name\": \"Loader_2\",\n      \"id\": \"loader_2\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Loader_2\",\n          \"id\": \"loader_2\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type Loader<RETURN> = {\\n    (): LoaderSignal<RETURN>;\\n};\\n```\\n**References:** [LoaderSignal](#loadersignal)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.loader_2.md\"\n    },\n    {\n      \"name\": \"LoaderSignal\",\n      \"id\": \"loadersignal\",\n      \"hierarchy\": [\n        {\n          \"name\": \"LoaderSignal\",\n          \"id\": \"loadersignal\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type LoaderSignal<TYPE> = TYPE extends () => ValueOrPromise<infer VALIDATOR> ? ReadonlySignal<ValueOrPromise<VALIDATOR>> : ReadonlySignal<TYPE>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.loadersignal.md\"\n    },\n    {\n      \"name\": \"MenuData\",\n      \"id\": \"menudata\",\n      \"hierarchy\": [\n        {\n          \"name\": \"MenuData\",\n          \"id\": \"menudata\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type MenuData = [pathname: string, menuLoader: MenuModuleLoader];\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.menudata.md\"\n    },\n    {\n      \"name\": \"NavigationType\",\n      \"id\": \"navigationtype\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NavigationType\",\n          \"id\": \"navigationtype\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type NavigationType = 'initial' | 'form' | 'link' | 'popstate';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.navigationtype.md\"\n    },\n    {\n      \"name\": \"PageModule\",\n      \"id\": \"pagemodule\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PageModule\",\n          \"id\": \"pagemodule\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PageModule extends RouteModule \\n```\\n**Extends:** RouteModule\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[default](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nunknown\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[head?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nContentModuleHead\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[headings?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[ContentHeading](#contentheading)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[onStaticGenerate?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[StaticGenerateHandler](#staticgeneratehandler)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.pagemodule.md\"\n    },\n    {\n      \"name\": \"PathParams\",\n      \"id\": \"pathparams\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PathParams\",\n          \"id\": \"pathparams\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport declare type PathParams = Record<string, string>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.pathparams.md\"\n    },\n    {\n      \"name\": \"PreventNavigateCallback\",\n      \"id\": \"preventnavigatecallback\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PreventNavigateCallback\",\n          \"id\": \"preventnavigatecallback\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type PreventNavigateCallback = (url?: number | URL) => ValueOrPromise<boolean>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.preventnavigatecallback.md\"\n    },\n    {\n      \"name\": \"QWIK_CITY_SCROLLER\",\n      \"id\": \"qwik_city_scroller\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QWIK_CITY_SCROLLER\",\n          \"id\": \"qwik_city_scroller\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nQWIK_CITY_SCROLLER = \\\"_qCityScroller\\\"\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx\",\n      \"mdFile\": \"qwik-city.qwik_city_scroller.md\"\n    },\n    {\n      \"name\": \"QwikCityMockActionProp\",\n      \"id\": \"qwikcitymockactionprop\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityMockActionProp\",\n          \"id\": \"qwikcitymockactionprop\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityMockActionProp<T = any> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[action](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Action](#action)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\nThe action function to mock.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[handler](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nQRL&lt;(data: T) =&gt; ValueOrPromise&lt;RouteActionResolver&gt;&gt;\\n\\n\\n</td><td>\\n\\nThe QRL function that will be called when the action is submitted.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx\",\n      \"mdFile\": \"qwik-city.qwikcitymockactionprop.md\"\n    },\n    {\n      \"name\": \"QwikCityMockLoaderProp\",\n      \"id\": \"qwikcitymockloaderprop\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityMockLoaderProp\",\n          \"id\": \"qwikcitymockloaderprop\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityMockLoaderProp<T = any> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[data](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\nThe data to return when the loader is called.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[loader](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Loader](#loader_2)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\nThe loader function to mock.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx\",\n      \"mdFile\": \"qwik-city.qwikcitymockloaderprop.md\"\n    },\n    {\n      \"name\": \"QwikCityMockProps\",\n      \"id\": \"qwikcitymockprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityMockProps\",\n          \"id\": \"qwikcitymockprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityMockProps \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[actions?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nArray&lt;[QwikCityMockActionProp](#qwikcitymockactionprop)<!-- -->&lt;any&gt;&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_ Allow mocking actions defined with `routeAction$` function.\\n\\n```\\n[\\n  {\\n    action: useAddUser,\\n    handler: $(async (data) => {\\n      console.log('useAddUser action called with data:', data);\\n    }),\\n  },\\n];\\n```\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[goto?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[RouteNavigate](#routenavigate)\\n\\n\\n</td><td>\\n\\n_(Optional)_ Allow mocking the `goto` function returned by `useNavigate` hook.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[loaders?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nArray&lt;[QwikCityMockLoaderProp](#qwikcitymockloaderprop)<!-- -->&lt;any&gt;&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_ Allow mocking data for loaders defined with `routeLoader$` function.\\n\\n```\\n[\\n  {\\n    loader: useProductData,\\n    data: { product: { name: 'Test Product' } },\\n  },\\n];\\n```\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[params?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_ Allow mocking the route params returned by `useLocation` hook.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[url?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ Allow mocking the url returned by `useLocation` hook.\\n\\nDefault: `http://localhost/`\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx\",\n      \"mdFile\": \"qwik-city.qwikcitymockprops.md\"\n    },\n    {\n      \"name\": \"QwikCityMockProvider\",\n      \"id\": \"qwikcitymockprovider\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityMockProvider\",\n          \"id\": \"qwikcitymockprovider\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nQwikCityMockProvider: import(\\\"@builder.io/qwik\\\").Component<QwikCityMockProps>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx\",\n      \"mdFile\": \"qwik-city.qwikcitymockprovider.md\"\n    },\n    {\n      \"name\": \"QwikCityPlan\",\n      \"id\": \"qwikcityplan\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityPlan\",\n          \"id\": \"qwikcityplan\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityPlan \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[basePathname?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[cacheModules?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[menus?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[MenuData](#menudata)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[routes](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[RouteData](#routedata)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[serverPlugins?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nRouteModule\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[trailingSlash?](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.qwikcityplan.md\"\n    },\n    {\n      \"name\": \"QwikCityProps\",\n      \"id\": \"qwikcityprops\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityProps\",\n          \"id\": \"qwikcityprops\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityProps \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[viewTransition?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Enable the ViewTransition API\\n\\nDefault: `true`\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx\",\n      \"mdFile\": \"qwik-city.qwikcityprops.md\"\n    },\n    {\n      \"name\": \"QwikCityProvider\",\n      \"id\": \"qwikcityprovider\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityProvider\",\n          \"id\": \"qwikcityprovider\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nQwikCityProvider: import(\\\"@builder.io/qwik\\\").Component<QwikCityProps>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx\",\n      \"mdFile\": \"qwik-city.qwikcityprovider.md\"\n    },\n    {\n      \"name\": \"ResolvedDocumentHead\",\n      \"id\": \"resolveddocumenthead\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResolvedDocumentHead\",\n          \"id\": \"resolveddocumenthead\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ResolvedDocumentHead<FrontMatter extends Record<string, any> = Record<string, unknown>> = Required<DocumentHeadValue<FrontMatter>>;\\n```\\n**References:** [DocumentHeadValue](#documentheadvalue)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.resolveddocumenthead.md\"\n    },\n    {\n      \"name\": \"routeAction$\",\n      \"id\": \"routeaction_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"routeAction$\",\n          \"id\": \"routeaction_\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nrouteAction$: ActionConstructor\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.routeaction_.md\"\n    },\n    {\n      \"name\": \"routeActionQrl\",\n      \"id\": \"routeactionqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"routeActionQrl\",\n          \"id\": \"routeactionqrl\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nrouteActionQrl: ActionConstructorQRL\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.routeactionqrl.md\"\n    },\n    {\n      \"name\": \"RouteData\",\n      \"id\": \"routedata\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RouteData\",\n          \"id\": \"routedata\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type RouteData = [routeName: string, loaders: ModuleLoader[]] | [\\n    routeName: string,\\n    loaders: ModuleLoader[],\\n    originalPathname: string,\\n    routeBundleNames: string[]\\n];\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.routedata.md\"\n    },\n    {\n      \"name\": \"routeLoader$\",\n      \"id\": \"routeloader_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"routeLoader$\",\n          \"id\": \"routeloader_\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nrouteLoader$: LoaderConstructor\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.routeloader_.md\"\n    },\n    {\n      \"name\": \"routeLoaderQrl\",\n      \"id\": \"routeloaderqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"routeLoaderQrl\",\n          \"id\": \"routeloaderqrl\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nrouteLoaderQrl: LoaderConstructorQRL\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.routeloaderqrl.md\"\n    },\n    {\n      \"name\": \"RouteLocation\",\n      \"id\": \"routelocation\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RouteLocation\",\n          \"id\": \"routelocation\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RouteLocation \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[isNavigating](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[params](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nReadonly&lt;Record&lt;string, string&gt;&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[prevUrl](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nURL \\\\| undefined\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[url](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nURL\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.routelocation.md\"\n    },\n    {\n      \"name\": \"RouteNavigate\",\n      \"id\": \"routenavigate\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RouteNavigate\",\n          \"id\": \"routenavigate\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type RouteNavigate = QRL<(path?: string | number | URL, options?: {\\n    type?: Exclude<NavigationType, 'initial'>;\\n    forceReload?: boolean;\\n    replaceState?: boolean;\\n    scroll?: boolean;\\n} | boolean) => Promise<void>>;\\n```\\n**References:** [NavigationType](#navigationtype)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.routenavigate.md\"\n    },\n    {\n      \"name\": \"RouterOutlet\",\n      \"id\": \"routeroutlet\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RouterOutlet\",\n          \"id\": \"routeroutlet\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nRouterOutlet: import(\\\"@builder.io/qwik\\\").Component<unknown>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/router-outlet-component.tsx\",\n      \"mdFile\": \"qwik-city.routeroutlet.md\"\n    },\n    {\n      \"name\": \"server$\",\n      \"id\": \"server_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"server$\",\n          \"id\": \"server_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nserver$: <T extends ServerFunction>(qrl: T, options?: ServerConfig | undefined) => ServerQRL<T>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\noptions\\n\\n\\n</td><td>\\n\\nServerConfig \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[ServerQRL](#serverqrl)<!-- -->&lt;T&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.server_.md\"\n    },\n    {\n      \"name\": \"ServerFunction\",\n      \"id\": \"serverfunction\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerFunction\",\n          \"id\": \"serverfunction\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ServerFunction = {\\n    (this: RequestEventBase, ...args: any[]): any;\\n    options?: ServerConfig;\\n};\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.serverfunction.md\"\n    },\n    {\n      \"name\": \"serverQrl\",\n      \"id\": \"serverqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"serverQrl\",\n          \"id\": \"serverqrl\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"You can pass an AbortSignal as the first argument of a `server$` function and it will use it to abort the fetch when fired.\\n\\n\\n```typescript\\nexport type ServerQRL<T extends ServerFunction> = QRL<((abort: AbortSignal, ...args: Parameters<T>) => ReturnType<T>) | ((...args: Parameters<T>) => ReturnType<T>)>;\\n```\\n**References:** [ServerFunction](#serverfunction)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.serverqrl.md\"\n    },\n    {\n      \"name\": \"ServerQRL\",\n      \"id\": \"serverqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerQRL\",\n          \"id\": \"serverqrl\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"You can pass an AbortSignal as the first argument of a `server$` function and it will use it to abort the fetch when fired.\\n\\n\\n```typescript\\nexport type ServerQRL<T extends ServerFunction> = QRL<((abort: AbortSignal, ...args: Parameters<T>) => ReturnType<T>) | ((...args: Parameters<T>) => ReturnType<T>)>;\\n```\\n**References:** [ServerFunction](#serverfunction)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.serverqrl.md\"\n    },\n    {\n      \"name\": \"ServiceWorkerRegister\",\n      \"id\": \"serviceworkerregister\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServiceWorkerRegister\",\n          \"id\": \"serviceworkerregister\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Loads the service workers that are defined in the routes. Any file named `service-worker.*` (all JS extensions are allowed) will be picked up, bundled into a separate file, and registered as a service worker.\\n\\nQwik 1.14.0 and above now use `<link rel=\\\"modulepreload\\\">` by default. If you didn't add custom service-worker logic, you should remove your service-worker.ts file(s) for the `ServiceWorkerRegister` Component to actually unregister the service-worker.js and delete its related cache. Make sure to keep the `ServiceWorkerRegister` Component in your app (without any service-worker.ts file) as long as you want to unregister the service-worker.js for your users.\\n\\n\\n```typescript\\nServiceWorkerRegister: (props: {\\n    nonce?: string;\\n}) => JSXOutput\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nprops\\n\\n\\n</td><td>\\n\\n{ nonce?: string; }\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nJSXOutput\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/sw-component.tsx\",\n      \"mdFile\": \"qwik-city.serviceworkerregister.md\"\n    },\n    {\n      \"name\": \"StaticGenerate\",\n      \"id\": \"staticgenerate\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StaticGenerate\",\n          \"id\": \"staticgenerate\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface StaticGenerate \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[params?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[PathParams](#pathparams)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.staticgenerate.md\"\n    },\n    {\n      \"name\": \"StaticGenerateHandler\",\n      \"id\": \"staticgeneratehandler\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StaticGenerateHandler\",\n          \"id\": \"staticgeneratehandler\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type StaticGenerateHandler = ({ env, }: {\\n    env: EnvGetter;\\n}) => Promise<StaticGenerate> | StaticGenerate;\\n```\\n**References:** [StaticGenerate](#staticgenerate)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.staticgeneratehandler.md\"\n    },\n    {\n      \"name\": \"StrictUnion\",\n      \"id\": \"strictunion\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StrictUnion\",\n          \"id\": \"strictunion\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type StrictUnion<T> = Prettify<StrictUnionHelper<T, T>>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.strictunion.md\"\n    },\n    {\n      \"name\": \"TypedDataValidator\",\n      \"id\": \"typeddatavalidator\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TypedDataValidator\",\n          \"id\": \"typeddatavalidator\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type TypedDataValidator = ValibotDataValidator | ZodDataValidator;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.typeddatavalidator.md\"\n    },\n    {\n      \"name\": \"useContent\",\n      \"id\": \"usecontent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useContent\",\n          \"id\": \"usecontent\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nuseContent: () => import(\\\"./types\\\").ContentState\\n```\\n**Returns:**\\n\\nimport(\\\"./types\\\").ContentState\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts\",\n      \"mdFile\": \"qwik-city.usecontent.md\"\n    },\n    {\n      \"name\": \"useDocumentHead\",\n      \"id\": \"usedocumenthead\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useDocumentHead\",\n          \"id\": \"usedocumenthead\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Returns the document head for the current page. The generic type describes the front matter.\\n\\n\\n```typescript\\nuseDocumentHead: <FrontMatter extends Record<string, unknown> = Record<string, any>>() => Required<ResolvedDocumentHead<FrontMatter>>\\n```\\n**Returns:**\\n\\nRequired&lt;[ResolvedDocumentHead](#resolveddocumenthead)<!-- -->&lt;FrontMatter&gt;&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts\",\n      \"mdFile\": \"qwik-city.usedocumenthead.md\"\n    },\n    {\n      \"name\": \"useLocation\",\n      \"id\": \"uselocation\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useLocation\",\n          \"id\": \"uselocation\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nuseLocation: () => RouteLocation\\n```\\n**Returns:**\\n\\n[RouteLocation](#routelocation)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts\",\n      \"mdFile\": \"qwik-city.uselocation.md\"\n    },\n    {\n      \"name\": \"useNavigate\",\n      \"id\": \"usenavigate\",\n      \"hierarchy\": [\n        {\n          \"name\": \"useNavigate\",\n          \"id\": \"usenavigate\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nuseNavigate: () => RouteNavigate\\n```\\n**Returns:**\\n\\n[RouteNavigate](#routenavigate)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts\",\n      \"mdFile\": \"qwik-city.usenavigate.md\"\n    },\n    {\n      \"name\": \"usePreventNavigate$\",\n      \"id\": \"usepreventnavigate_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"usePreventNavigate$\",\n          \"id\": \"usepreventnavigate_\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Prevent navigation attempts. This hook registers a callback that will be called before SPA or browser navigation.\\n\\nReturn `true` to prevent navigation.\\n\\n\\\\#\\\\#\\\\#\\\\# SPA Navigation\\n\\nFor Single-Page-App (SPA) navigation (via `<Link />`<!-- -->, `const nav = useNavigate()`<!-- -->, and browser backwards/forwards inside SPA history), the callback will be provided with the target, either a URL or a number. It will only be a number if `nav(number)` was called to navigate forwards or backwards in SPA history.\\n\\nIf you return a Promise, the navigation will be blocked until the promise resolves.\\n\\nThis can be used to show a nice dialog to the user, and wait for the user to confirm, or to record the url, prevent the navigation, and navigate there later via `nav(url)`<!-- -->.\\n\\n\\\\#\\\\#\\\\#\\\\# Browser Navigation\\n\\nHowever, when the user navigates away by clicking on a regular `<a />`<!-- -->, reloading, or moving backwards/forwards outside SPA history, this callback will not be awaited. This is because the browser does not provide a way to asynchronously prevent these navigations.\\n\\nIn this case, returning returning `true` will tell the browser to show a confirmation dialog, which cannot be customized. You are also not able to show your own `window.confirm()` dialog during the callback, the browser won't allow it. If you return a Promise, it will be considered as `true`<!-- -->.\\n\\nWhen the callback is called from the browser, no url will be provided. Use this to know whether you can show a dialog or just return `true` to prevent the navigation.\\n\\n\\n```typescript\\nusePreventNavigate$: (qrl: PreventNavigateCallback) => void\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqrl\\n\\n\\n</td><td>\\n\\n[PreventNavigateCallback](#preventnavigatecallback)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts\",\n      \"mdFile\": \"qwik-city.usepreventnavigate_.md\"\n    },\n    {\n      \"name\": \"valibot$\",\n      \"id\": \"valibot_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"valibot$\",\n          \"id\": \"valibot_\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nvalibot$: ValibotConstructor\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.valibot_.md\"\n    },\n    {\n      \"name\": \"valibotQrl\",\n      \"id\": \"valibotqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"valibotQrl\",\n          \"id\": \"valibotqrl\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nvalibotQrl: ValibotConstructorQRL\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.valibotqrl.md\"\n    },\n    {\n      \"name\": \"validator$\",\n      \"id\": \"validator_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"validator$\",\n          \"id\": \"validator_\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nvalidator$: ValidatorConstructor\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.validator_.md\"\n    },\n    {\n      \"name\": \"ValidatorErrorKeyDotNotation\",\n      \"id\": \"validatorerrorkeydotnotation\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ValidatorErrorKeyDotNotation\",\n          \"id\": \"validatorerrorkeydotnotation\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ValidatorErrorKeyDotNotation<T, Prefix extends string = ''> = IsAny<T> extends true ? never : T extends object ? {\\n    [K in keyof T & string]: IsAny<T[K]> extends true ? never : T[K] extends (infer U)[] ? IsAny<U> extends true ? never : U extends object ? `${Prefix}${K}[]` | ValidatorErrorKeyDotNotation<U, `${Prefix}${K}[].`> : `${Prefix}${K}[]` : T[K] extends object ? ValidatorErrorKeyDotNotation<T[K], `${Prefix}${K}.`> : `${Prefix}${K}`;\\n}[keyof T & string] : never;\\n```\\n**References:** [ValidatorErrorKeyDotNotation](#validatorerrorkeydotnotation)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.validatorerrorkeydotnotation.md\"\n    },\n    {\n      \"name\": \"ValidatorErrorType\",\n      \"id\": \"validatorerrortype\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ValidatorErrorType\",\n          \"id\": \"validatorerrortype\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ValidatorErrorType<T, U = string> = {\\n    formErrors: U[];\\n    fieldErrors: Partial<{\\n        [K in ValidatorErrorKeyDotNotation<T>]: K extends `${infer _Prefix}[]${infer _Suffix}` ? U[] : U;\\n    }>;\\n};\\n```\\n**References:** [ValidatorErrorKeyDotNotation](#validatorerrorkeydotnotation)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.validatorerrortype.md\"\n    },\n    {\n      \"name\": \"validatorQrl\",\n      \"id\": \"validatorqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"validatorQrl\",\n          \"id\": \"validatorqrl\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nvalidatorQrl: ValidatorConstructorQRL\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.validatorqrl.md\"\n    },\n    {\n      \"name\": \"ValidatorReturn\",\n      \"id\": \"validatorreturn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ValidatorReturn\",\n          \"id\": \"validatorreturn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ValidatorReturn<T extends Record<string, any> = {}> = ValidatorReturnSuccess | ValidatorReturnFail<T>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.validatorreturn.md\"\n    },\n    {\n      \"name\": \"zod$\",\n      \"id\": \"zod_\",\n      \"hierarchy\": [\n        {\n          \"name\": \"zod$\",\n          \"id\": \"zod_\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nzod$: ZodConstructor\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.zod_.md\"\n    },\n    {\n      \"name\": \"ZodConstructor\",\n      \"id\": \"zodconstructor\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ZodConstructor\",\n          \"id\": \"zodconstructor\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ZodConstructor = {\\n    <T extends z.ZodRawShape>(schema: T): ZodDataValidator<z.ZodObject<T>>;\\n    <T extends z.ZodRawShape>(schema: (zod: typeof z.z, ev: RequestEvent) => T): ZodDataValidator<z.ZodObject<T>>;\\n    <T extends z.Schema>(schema: T): ZodDataValidator<T>;\\n    <T extends z.Schema>(schema: (zod: typeof z.z, ev: RequestEvent) => T): ZodDataValidator<T>;\\n};\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts\",\n      \"mdFile\": \"qwik-city.zodconstructor.md\"\n    },\n    {\n      \"name\": \"zodQrl\",\n      \"id\": \"zodqrl\",\n      \"hierarchy\": [\n        {\n          \"name\": \"zodQrl\",\n          \"id\": \"zodqrl\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nzodQrl: ZodConstructorQRL\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts\",\n      \"mdFile\": \"qwik-city.zodqrl.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city\n\n<h2 id=\"action\">Action</h2>\n\n```typescript\nexport type Action<\n  RETURN,\n  INPUT = Record<string, unknown>,\n  OPTIONAL extends boolean = true,\n> = {\n  (): ActionStore<RETURN, INPUT, OPTIONAL>;\n};\n```\n\n**References:** [ActionStore](#actionstore)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"actionconstructor\">ActionConstructor</h2>\n\n```typescript\nexport type ActionConstructor = {\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction,\n    ) => ValueOrPromise<OBJ>,\n    options: {\n      readonly id?: string;\n      readonly validation: [VALIDATOR, ...REST];\n    },\n  ): Action<\n    StrictUnion<\n      | OBJ\n      | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n      | FailReturn<FailOfRest<REST>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n  >(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction,\n    ) => ValueOrPromise<OBJ>,\n    options: {\n      readonly id?: string;\n      readonly validation: [VALIDATOR];\n    },\n  ): Action<\n    StrictUnion<\n      OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n  <\n    OBJ extends Record<string, any> | void | null,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: (\n      data: JSONObject,\n      event: RequestEventAction,\n    ) => ValueOrPromise<OBJ>,\n    options: {\n      readonly id?: string;\n      readonly validation: REST;\n    },\n  ): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction,\n    ) => ValueOrPromise<OBJ>,\n    options: VALIDATOR,\n    ...rest: REST\n  ): Action<\n    StrictUnion<\n      | OBJ\n      | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n      | FailReturn<FailOfRest<REST>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n  >(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction,\n    ) => ValueOrPromise<OBJ>,\n    options: VALIDATOR,\n  ): Action<\n    StrictUnion<\n      OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n  <\n    OBJ extends Record<string, any> | void | null,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: (\n      form: JSONObject,\n      event: RequestEventAction,\n    ) => ValueOrPromise<OBJ>,\n    ...rest: REST\n  ): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n  <OBJ>(\n    actionQrl: (\n      form: JSONObject,\n      event: RequestEventAction,\n    ) => ValueOrPromise<OBJ>,\n    options?: {\n      readonly id?: string;\n    },\n  ): Action<StrictUnion<OBJ>>;\n};\n```\n\n**References:** [TypedDataValidator](#typeddatavalidator), [DataValidator](#datavalidator), [GetValidatorOutputType](#getvalidatoroutputtype), [Action](#action), [StrictUnion](#strictunion), [FailReturn](#failreturn), [ValidatorErrorType](#validatorerrortype), [GetValidatorInputType](#getvalidatorinputtype), [FailOfRest](#failofrest), [JSONObject](#jsonobject)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"actionreturn\">ActionReturn</h2>\n\n```typescript\nexport type ActionReturn<RETURN> = {\n  readonly status?: number;\n  readonly value: RETURN;\n};\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"actionstore\">ActionStore</h2>\n\n```typescript\nexport type ActionStore<RETURN, INPUT, OPTIONAL extends boolean = true> = {\n  readonly actionPath: string;\n  readonly isRunning: boolean;\n  readonly status?: number;\n  readonly formData: FormData | undefined;\n  readonly value: RETURN | undefined;\n  readonly submit: QRL<\n    OPTIONAL extends true\n      ? (form?: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>>\n      : (form: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>>\n  >;\n  readonly submitted: boolean;\n};\n```\n\n**References:** [ActionReturn](#actionreturn)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"contentheading\">ContentHeading</h2>\n\n```typescript\nexport interface ContentHeading\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[id](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[level](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[text](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"contentmenu\">ContentMenu</h2>\n\n```typescript\nexport interface ContentMenu\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[href?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[items?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[ContentMenu](#contentmenu)[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[text](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"datavalidator\">DataValidator</h2>\n\n```typescript\nexport type DataValidator<T extends Record<string, any> = {}> = {\n  validate(ev: RequestEvent, data: unknown): Promise<ValidatorReturn<T>>;\n};\n```\n\n**References:** [ValidatorReturn](#validatorreturn)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"documenthead\">DocumentHead</h2>\n\n```typescript\nexport type DocumentHead =\n  | DocumentHeadValue\n  | ((props: DocumentHeadProps) => DocumentHeadValue);\n```\n\n**References:** [DocumentHeadValue](#documentheadvalue), [DocumentHeadProps](#documentheadprops)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"documentheadprops\">DocumentHeadProps</h2>\n\n```typescript\nexport interface DocumentHeadProps extends RouteLocation\n```\n\n**Extends:** [RouteLocation](#routelocation)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[head](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[ResolvedDocumentHead](#resolveddocumenthead)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[resolveValue](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nResolveSyncValue\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[withLocale](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n&lt;T&gt;(fn: () =&gt; T) =&gt; T\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"documentheadvalue\">DocumentHeadValue</h2>\n\n```typescript\nexport interface DocumentHeadValue<FrontMatter extends Record<string, any> = Record<string, unknown>>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[frontmatter?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nReadonly&lt;FrontMatter&gt;\n\n</td><td>\n\n_(Optional)_ Arbitrary object containing custom data. When the document head is created from markdown files, the frontmatter attributes that are not recognized as a well-known meta names (such as title, description, author, etc...), are stored in this property.\n\n</td></tr>\n<tr><td>\n\n[links?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nreadonly [DocumentLink](#documentlink)[]\n\n</td><td>\n\n_(Optional)_ Used to manually append `<link>` elements to the `<head>`.\n\n</td></tr>\n<tr><td>\n\n[meta?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nreadonly [DocumentMeta](#documentmeta)[]\n\n</td><td>\n\n_(Optional)_ Used to manually set meta tags in the head. Additionally, the `data` property could be used to set arbitrary data which the `<head>` component could later use to generate `<meta>` tags.\n\n</td></tr>\n<tr><td>\n\n[scripts?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nreadonly [DocumentScript](#documentscript)[]\n\n</td><td>\n\n_(Optional)_ Used to manually append `<script>` elements to the `<head>`.\n\n</td></tr>\n<tr><td>\n\n[styles?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nreadonly [DocumentStyle](#documentstyle)[]\n\n</td><td>\n\n_(Optional)_ Used to manually append `<style>` elements to the `<head>`.\n\n</td></tr>\n<tr><td>\n\n[title?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ Sets `document.title`.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"documentlink\">DocumentLink</h2>\n\n```typescript\nexport interface DocumentLink\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[as?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[crossorigin?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[disabled?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[href?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[hreflang?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[id?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[imagesizes?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[imagesrcset?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[integrity?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[key?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[media?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[prefetch?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[referrerpolicy?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[rel?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[sizes?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[title?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[type?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"documentmeta\">DocumentMeta</h2>\n\n```typescript\nexport interface DocumentMeta\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[content?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[httpEquiv?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[itemprop?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[key?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[media?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[name?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[property?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"documentscript\">DocumentScript</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nexport interface DocumentScript\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[key?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n**_(ALPHA)_** _(Optional)_\n\n</td></tr>\n<tr><td>\n\n[props?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nReadonly&lt;QwikIntrinsicElements['script']&gt;\n\n</td><td>\n\n**_(ALPHA)_** _(Optional)_\n\n</td></tr>\n<tr><td>\n\n[script?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n**_(ALPHA)_** _(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"documentstyle\">DocumentStyle</h2>\n\n```typescript\nexport interface DocumentStyle\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[key?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[props?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nReadonly&lt;QwikIntrinsicElements['style']&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[style](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"errorboundary\">ErrorBoundary</h2>\n\n```typescript\nErrorBoundary: import(\"@builder.io/qwik\").Component<ErrorBoundaryProps>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/error-boundary.tsx)\n\n<h2 id=\"failofrest\">FailOfRest</h2>\n\n```typescript\nexport type FailOfRest<REST extends readonly DataValidator[]> =\n  REST extends readonly DataValidator<infer ERROR>[] ? ERROR : never;\n```\n\n**References:** [DataValidator](#datavalidator)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"failreturn\">FailReturn</h2>\n\n```typescript\nexport type FailReturn<T> = T & Failed;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"form\">Form</h2>\n\n```typescript\nForm: <O, I>(\n  { action, spaReset, reloadDocument, onSubmit$, ...rest }: FormProps<O, I>,\n  key: string | null,\n) => import(\"@builder.io/qwik\").JSXOutput;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n\\{ action, spaReset, reloadDocument, onSubmit$, ...rest }\n\n</td><td>\n\n[FormProps](#formprops)&lt;O, I&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nkey\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nimport(\"@builder.io/qwik\").JSXOutput\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/form-component.tsx)\n\n<h2 id=\"formprops\">FormProps</h2>\n\n```typescript\nexport interface FormProps<O, I> extends Omit<QwikJSX.IntrinsicElements['form'], 'action' | 'method'>\n```\n\n**Extends:** Omit&lt;QwikJSX.IntrinsicElements['form'], 'action' \\| 'method'&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[action?](#)\n\n</td><td>\n\n</td><td>\n\n[ActionStore](#actionstore)&lt;O, I, true \\| false&gt;\n\n</td><td>\n\n_(Optional)_ Reference to the action returned by `action()`.\n\n</td></tr>\n<tr><td>\n\n[key?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| number \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[onSubmit$?](#)\n\n</td><td>\n\n</td><td>\n\nQRLEventHandlerMulti&lt;SubmitEvent, HTMLFormElement&gt; \\| undefined\n\n</td><td>\n\n_(Optional)_ Event handler executed right when the form is submitted.\n\n</td></tr>\n<tr><td>\n\n[onSubmitCompleted$?](#)\n\n</td><td>\n\n</td><td>\n\nQRLEventHandlerMulti&lt;CustomEvent&lt;[FormSubmitCompletedDetail](#formsubmitsuccessdetail)&lt;O&gt;&gt;, HTMLFormElement&gt; \\| undefined\n\n</td><td>\n\n_(Optional)_ Event handler executed right after the action is executed successfully and returns some data.\n\n</td></tr>\n<tr><td>\n\n[reloadDocument?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ When `true` the form submission will cause a full page reload, even if SPA mode is enabled and JS is available.\n\n</td></tr>\n<tr><td>\n\n[spaReset?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ When `true` all the form inputs will be reset in SPA mode, just like happens in a full page form submission.\n\nDefaults to `false`\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/form-component.tsx)\n\n<h2 id=\"formsubmitsuccessdetail\">FormSubmitSuccessDetail</h2>\n\n```typescript\nexport interface FormSubmitCompletedDetail<T>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[status](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[value](#)\n\n</td><td>\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/form-component.tsx)\n\n<h2 id=\"getvalidatorinputtype\">GetValidatorInputType</h2>\n\n```typescript\nexport type GetValidatorInputType<VALIDATOR extends TypedDataValidator> =\n  VALIDATOR extends ValibotDataValidator<infer TYPE>\n    ? v.InferInput<TYPE>\n    : VALIDATOR extends ZodDataValidator<infer TYPE>\n      ? z.input<TYPE>\n      : never;\n```\n\n**References:** [TypedDataValidator](#typeddatavalidator)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"getvalidatoroutputtype\">GetValidatorOutputType</h2>\n\n```typescript\nexport type GetValidatorOutputType<VALIDATOR extends TypedDataValidator> =\n  VALIDATOR extends ValibotDataValidator<infer TYPE>\n    ? v.InferOutput<TYPE>\n    : VALIDATOR extends ZodDataValidator<infer TYPE>\n      ? z.output<TYPE>\n      : never;\n```\n\n**References:** [TypedDataValidator](#typeddatavalidator)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"getvalidatortype\">GetValidatorType</h2>\n\n```typescript\nexport type GetValidatorType<VALIDATOR extends TypedDataValidator> =\n  GetValidatorOutputType<VALIDATOR>;\n```\n\n**References:** [TypedDataValidator](#typeddatavalidator), [GetValidatorOutputType](#getvalidatoroutputtype)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"globalaction_\">globalAction$</h2>\n\n```typescript\nglobalAction$: ActionConstructor;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"globalactionqrl\">globalActionQrl</h2>\n\n```typescript\nglobalActionQrl: ActionConstructorQRL;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"jsonobject\">JSONObject</h2>\n\n```typescript\nexport type JSONObject = {\n  [x: string]: JSONValue;\n};\n```\n\n**References:** [JSONValue](#jsonvalue)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"jsonvalue\">JSONValue</h2>\n\n```typescript\nexport type JSONValue =\n  | string\n  | number\n  | boolean\n  | {\n      [x: string]: JSONValue;\n    }\n  | Array<JSONValue>;\n```\n\n**References:** [JSONValue](#jsonvalue)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"link\">Link</h2>\n\n```typescript\nLink: import(\"@builder.io/qwik\").Component<LinkProps>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/link-component.tsx)\n\n<h2 id=\"linkprops\">LinkProps</h2>\n\n```typescript\nexport interface LinkProps extends AnchorAttributes\n```\n\n**Extends:** AnchorAttributes\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[prefetch?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| 'js'\n\n</td><td>\n\n_(Optional)_ \\*\\*Defaults to \\_true\\_.\\*\\*\n\nWhether Qwik should prefetch and cache the target page of this \\*\\*`Link`\\*\\*, this includes invoking any \\*\\*`routeLoader$`\\*\\*, \\*\\*`onGet`\\*\\*, etc.\n\nThis \\*\\*improves UX performance\\*\\* for client-side (\\*\\*SPA\\*\\*) navigations.\n\nPrefetching occurs when a the Link enters the viewport in production (\\*\\*`on:qvisible`\\*\\*), or with \\*\\*`mouseover`/`focus`\\*\\* during dev.\n\nPrefetching will not occur if the user has the \\*\\*data saver\\*\\* setting enabled.\n\nSetting this value to \\*\\*`\"js\"`\\*\\* will prefetch only javascript bundles required to render this page on the client, \\*\\*`false`\\*\\* will disable prefetching altogether.\n\n</td></tr>\n<tr><td>\n\n[reload?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[replaceState?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[scroll?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/link-component.tsx)\n\n<h2 id=\"loader_2\">Loader_2</h2>\n\n```typescript\nexport type Loader<RETURN> = {\n  (): LoaderSignal<RETURN>;\n};\n```\n\n**References:** [LoaderSignal](#loadersignal)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"loadersignal\">LoaderSignal</h2>\n\n```typescript\nexport type LoaderSignal<TYPE> = TYPE extends () => ValueOrPromise<\n  infer VALIDATOR\n>\n  ? ReadonlySignal<ValueOrPromise<VALIDATOR>>\n  : ReadonlySignal<TYPE>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"menudata\">MenuData</h2>\n\n```typescript\nexport type MenuData = [pathname: string, menuLoader: MenuModuleLoader];\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"navigationtype\">NavigationType</h2>\n\n```typescript\nexport type NavigationType = \"initial\" | \"form\" | \"link\" | \"popstate\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"pagemodule\">PageModule</h2>\n\n```typescript\nexport interface PageModule extends RouteModule\n```\n\n**Extends:** RouteModule\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[default](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nunknown\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[head?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nContentModuleHead\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[headings?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[ContentHeading](#contentheading)[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[onStaticGenerate?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[StaticGenerateHandler](#staticgeneratehandler)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"pathparams\">PathParams</h2>\n\n```typescript\nexport declare type PathParams = Record<string, string>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"preventnavigatecallback\">PreventNavigateCallback</h2>\n\n```typescript\nexport type PreventNavigateCallback = (\n  url?: number | URL,\n) => ValueOrPromise<boolean>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"qwik_city_scroller\">QWIK_CITY_SCROLLER</h2>\n\n```typescript\nQWIK_CITY_SCROLLER = \"_qCityScroller\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx)\n\n<h2 id=\"qwikcitymockactionprop\">QwikCityMockActionProp</h2>\n\n```typescript\nexport interface QwikCityMockActionProp<T = any>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[action](#)\n\n</td><td>\n\n</td><td>\n\n[Action](#action)&lt;T&gt;\n\n</td><td>\n\nThe action function to mock.\n\n</td></tr>\n<tr><td>\n\n[handler](#)\n\n</td><td>\n\n</td><td>\n\nQRL&lt;(data: T) =&gt; ValueOrPromise&lt;RouteActionResolver&gt;&gt;\n\n</td><td>\n\nThe QRL function that will be called when the action is submitted.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx)\n\n<h2 id=\"qwikcitymockloaderprop\">QwikCityMockLoaderProp</h2>\n\n```typescript\nexport interface QwikCityMockLoaderProp<T = any>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[data](#)\n\n</td><td>\n\n</td><td>\n\nT\n\n</td><td>\n\nThe data to return when the loader is called.\n\n</td></tr>\n<tr><td>\n\n[loader](#)\n\n</td><td>\n\n</td><td>\n\n[Loader](#loader_2)&lt;T&gt;\n\n</td><td>\n\nThe loader function to mock.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx)\n\n<h2 id=\"qwikcitymockprops\">QwikCityMockProps</h2>\n\n```typescript\nexport interface QwikCityMockProps\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[actions?](#)\n\n</td><td>\n\n</td><td>\n\nArray&lt;[QwikCityMockActionProp](#qwikcitymockactionprop)&lt;any&gt;&gt;\n\n</td><td>\n\n_(Optional)_ Allow mocking actions defined with `routeAction$` function.\n\n```\n[\n  {\n    action: useAddUser,\n    handler: $(async (data) => {\n      console.log('useAddUser action called with data:', data);\n    }),\n  },\n];\n```\n\n</td></tr>\n<tr><td>\n\n[goto?](#)\n\n</td><td>\n\n</td><td>\n\n[RouteNavigate](#routenavigate)\n\n</td><td>\n\n_(Optional)_ Allow mocking the `goto` function returned by `useNavigate` hook.\n\n</td></tr>\n<tr><td>\n\n[loaders?](#)\n\n</td><td>\n\n</td><td>\n\nArray&lt;[QwikCityMockLoaderProp](#qwikcitymockloaderprop)&lt;any&gt;&gt;\n\n</td><td>\n\n_(Optional)_ Allow mocking data for loaders defined with `routeLoader$` function.\n\n```\n[\n  {\n    loader: useProductData,\n    data: { product: { name: 'Test Product' } },\n  },\n];\n```\n\n</td></tr>\n<tr><td>\n\n[params?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n_(Optional)_ Allow mocking the route params returned by `useLocation` hook.\n\n</td></tr>\n<tr><td>\n\n[url?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ Allow mocking the url returned by `useLocation` hook.\n\nDefault: `http://localhost/`\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx)\n\n<h2 id=\"qwikcitymockprovider\">QwikCityMockProvider</h2>\n\n```typescript\nQwikCityMockProvider: import(\"@builder.io/qwik\").Component<QwikCityMockProps>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx)\n\n<h2 id=\"qwikcityplan\">QwikCityPlan</h2>\n\n```typescript\nexport interface QwikCityPlan\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[basePathname?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[cacheModules?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[menus?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[MenuData](#menudata)[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[routes](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[RouteData](#routedata)[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[serverPlugins?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nRouteModule[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[trailingSlash?](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"qwikcityprops\">QwikCityProps</h2>\n\n```typescript\nexport interface QwikCityProps\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[viewTransition?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Enable the ViewTransition API\n\nDefault: `true`\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx)\n\n<h2 id=\"qwikcityprovider\">QwikCityProvider</h2>\n\n```typescript\nQwikCityProvider: import(\"@builder.io/qwik\").Component<QwikCityProps>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/qwik-city-component.tsx)\n\n<h2 id=\"resolveddocumenthead\">ResolvedDocumentHead</h2>\n\n```typescript\nexport type ResolvedDocumentHead<\n  FrontMatter extends Record<string, any> = Record<string, unknown>,\n> = Required<DocumentHeadValue<FrontMatter>>;\n```\n\n**References:** [DocumentHeadValue](#documentheadvalue)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"routeaction_\">routeAction$</h2>\n\n```typescript\nrouteAction$: ActionConstructor;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"routeactionqrl\">routeActionQrl</h2>\n\n```typescript\nrouteActionQrl: ActionConstructorQRL;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"routedata\">RouteData</h2>\n\n```typescript\nexport type RouteData =\n  | [routeName: string, loaders: ModuleLoader[]]\n  | [\n      routeName: string,\n      loaders: ModuleLoader[],\n      originalPathname: string,\n      routeBundleNames: string[],\n    ];\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"routeloader_\">routeLoader$</h2>\n\n```typescript\nrouteLoader$: LoaderConstructor;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"routeloaderqrl\">routeLoaderQrl</h2>\n\n```typescript\nrouteLoaderQrl: LoaderConstructorQRL;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"routelocation\">RouteLocation</h2>\n\n```typescript\nexport interface RouteLocation\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[isNavigating](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[params](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nReadonly&lt;Record&lt;string, string&gt;&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[prevUrl](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nURL \\| undefined\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[url](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nURL\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"routenavigate\">RouteNavigate</h2>\n\n```typescript\nexport type RouteNavigate = QRL<\n  (\n    path?: string | number | URL,\n    options?:\n      | {\n          type?: Exclude<NavigationType, \"initial\">;\n          forceReload?: boolean;\n          replaceState?: boolean;\n          scroll?: boolean;\n        }\n      | boolean,\n  ) => Promise<void>\n>;\n```\n\n**References:** [NavigationType](#navigationtype)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"routeroutlet\">RouterOutlet</h2>\n\n```typescript\nRouterOutlet: import(\"@builder.io/qwik\").Component<unknown>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/router-outlet-component.tsx)\n\n<h2 id=\"server_\">server$</h2>\n\n```typescript\nserver$: <T extends ServerFunction>(\n  qrl: T,\n  options?: ServerConfig | undefined,\n) => ServerQRL<T>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\noptions\n\n</td><td>\n\nServerConfig \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[ServerQRL](#serverqrl)&lt;T&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"serverfunction\">ServerFunction</h2>\n\n```typescript\nexport type ServerFunction = {\n  (this: RequestEventBase, ...args: any[]): any;\n  options?: ServerConfig;\n};\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"serverqrl-function\">serverQrl</h2>\n\nYou can pass an AbortSignal as the first argument of a `server$` function and it will use it to abort the fetch when fired.\n\n```typescript\nexport type ServerQRL<T extends ServerFunction> = QRL<\n  | ((abort: AbortSignal, ...args: Parameters<T>) => ReturnType<T>)\n  | ((...args: Parameters<T>) => ReturnType<T>)\n>;\n```\n\n**References:** [ServerFunction](#serverfunction)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"serverqrl-type-alias\">ServerQRL</h2>\n\nYou can pass an AbortSignal as the first argument of a `server$` function and it will use it to abort the fetch when fired.\n\n```typescript\nexport type ServerQRL<T extends ServerFunction> = QRL<\n  | ((abort: AbortSignal, ...args: Parameters<T>) => ReturnType<T>)\n  | ((...args: Parameters<T>) => ReturnType<T>)\n>;\n```\n\n**References:** [ServerFunction](#serverfunction)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"serviceworkerregister\">ServiceWorkerRegister</h2>\n\nLoads the service workers that are defined in the routes. Any file named `service-worker.*` (all JS extensions are allowed) will be picked up, bundled into a separate file, and registered as a service worker.\n\nQwik 1.14.0 and above now use `<link rel=\"modulepreload\">` by default. If you didn't add custom service-worker logic, you should remove your service-worker.ts file(s) for the `ServiceWorkerRegister` Component to actually unregister the service-worker.js and delete its related cache. Make sure to keep the `ServiceWorkerRegister` Component in your app (without any service-worker.ts file) as long as you want to unregister the service-worker.js for your users.\n\n```typescript\nServiceWorkerRegister: (props: { nonce?: string }) => JSXOutput;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nprops\n\n</td><td>\n\n\\{ nonce?: string; }\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nJSXOutput\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/sw-component.tsx)\n\n<h2 id=\"staticgenerate\">StaticGenerate</h2>\n\n```typescript\nexport interface StaticGenerate\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[params?](#)\n\n</td><td>\n\n</td><td>\n\n[PathParams](#pathparams)[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"staticgeneratehandler\">StaticGenerateHandler</h2>\n\n```typescript\nexport type StaticGenerateHandler = ({\n  env,\n}: {\n  env: EnvGetter;\n}) => Promise<StaticGenerate> | StaticGenerate;\n```\n\n**References:** [StaticGenerate](#staticgenerate)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"strictunion\">StrictUnion</h2>\n\n```typescript\nexport type StrictUnion<T> = Prettify<StrictUnionHelper<T, T>>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"typeddatavalidator\">TypedDataValidator</h2>\n\n```typescript\nexport type TypedDataValidator = ValibotDataValidator | ZodDataValidator;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"usecontent\">useContent</h2>\n\n```typescript\nuseContent: () => import(\"./types\").ContentState;\n```\n\n**Returns:**\n\nimport(\"./types\").ContentState\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts)\n\n<h2 id=\"usedocumenthead\">useDocumentHead</h2>\n\nReturns the document head for the current page. The generic type describes the front matter.\n\n```typescript\nuseDocumentHead: <\n  FrontMatter extends Record<string, unknown> = Record<string, any>,\n>() => Required<ResolvedDocumentHead<FrontMatter>>;\n```\n\n**Returns:**\n\nRequired&lt;[ResolvedDocumentHead](#resolveddocumenthead)&lt;FrontMatter&gt;&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts)\n\n<h2 id=\"uselocation\">useLocation</h2>\n\n```typescript\nuseLocation: () => RouteLocation;\n```\n\n**Returns:**\n\n[RouteLocation](#routelocation)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts)\n\n<h2 id=\"usenavigate\">useNavigate</h2>\n\n```typescript\nuseNavigate: () => RouteNavigate;\n```\n\n**Returns:**\n\n[RouteNavigate](#routenavigate)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts)\n\n<h2 id=\"usepreventnavigate_\">usePreventNavigate$</h2>\n\nPrevent navigation attempts. This hook registers a callback that will be called before SPA or browser navigation.\n\nReturn `true` to prevent navigation.\n\n\\#### SPA Navigation\n\nFor Single-Page-App (SPA) navigation (via `<Link />`, `const nav = useNavigate()`, and browser backwards/forwards inside SPA history), the callback will be provided with the target, either a URL or a number. It will only be a number if `nav(number)` was called to navigate forwards or backwards in SPA history.\n\nIf you return a Promise, the navigation will be blocked until the promise resolves.\n\nThis can be used to show a nice dialog to the user, and wait for the user to confirm, or to record the url, prevent the navigation, and navigate there later via `nav(url)`.\n\n\\#### Browser Navigation\n\nHowever, when the user navigates away by clicking on a regular `<a />`, reloading, or moving backwards/forwards outside SPA history, this callback will not be awaited. This is because the browser does not provide a way to asynchronously prevent these navigations.\n\nIn this case, returning returning `true` will tell the browser to show a confirmation dialog, which cannot be customized. You are also not able to show your own `window.confirm()` dialog during the callback, the browser won't allow it. If you return a Promise, it will be considered as `true`.\n\nWhen the callback is called from the browser, no url will be provided. Use this to know whether you can show a dialog or just return `true` to prevent the navigation.\n\n```typescript\nusePreventNavigate$: (qrl: PreventNavigateCallback) => void\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqrl\n\n</td><td>\n\n[PreventNavigateCallback](#preventnavigatecallback)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/use-functions.ts)\n\n<h2 id=\"valibot_\">valibot$</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nvalibot$: ValibotConstructor;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"valibotqrl\">valibotQrl</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nvalibotQrl: ValibotConstructorQRL;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"validator_\">validator$</h2>\n\n```typescript\nvalidator$: ValidatorConstructor;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"validatorerrorkeydotnotation\">ValidatorErrorKeyDotNotation</h2>\n\n```typescript\nexport type ValidatorErrorKeyDotNotation<T, Prefix extends string = \"\"> =\n  IsAny<T> extends true\n    ? never\n    : T extends object\n      ? {\n          [K in keyof T & string]: IsAny<T[K]> extends true\n            ? never\n            : T[K] extends (infer U)[]\n              ? IsAny<U> extends true\n                ? never\n                : U extends object\n                  ?\n                      | `${Prefix}${K}[]`\n                      | ValidatorErrorKeyDotNotation<U, `${Prefix}${K}[].`>\n                  : `${Prefix}${K}[]`\n              : T[K] extends object\n                ? ValidatorErrorKeyDotNotation<T[K], `${Prefix}${K}.`>\n                : `${Prefix}${K}`;\n        }[keyof T & string]\n      : never;\n```\n\n**References:** [ValidatorErrorKeyDotNotation](#validatorerrorkeydotnotation)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"validatorerrortype\">ValidatorErrorType</h2>\n\n```typescript\nexport type ValidatorErrorType<T, U = string> = {\n  formErrors: U[];\n  fieldErrors: Partial<{\n    [K in ValidatorErrorKeyDotNotation<T>]: K extends `${infer _Prefix}[]${infer _Suffix}`\n      ? U[]\n      : U;\n  }>;\n};\n```\n\n**References:** [ValidatorErrorKeyDotNotation](#validatorerrorkeydotnotation)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"validatorqrl\">validatorQrl</h2>\n\n```typescript\nvalidatorQrl: ValidatorConstructorQRL;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"validatorreturn\">ValidatorReturn</h2>\n\n```typescript\nexport type ValidatorReturn<T extends Record<string, any> = {}> =\n  | ValidatorReturnSuccess\n  | ValidatorReturnFail<T>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"zod_\">zod$</h2>\n\n```typescript\nzod$: ZodConstructor;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n\n<h2 id=\"zodconstructor\">ZodConstructor</h2>\n\n```typescript\nexport type ZodConstructor = {\n  <T extends z.ZodRawShape>(schema: T): ZodDataValidator<z.ZodObject<T>>;\n  <T extends z.ZodRawShape>(\n    schema: (zod: typeof z.z, ev: RequestEvent) => T,\n  ): ZodDataValidator<z.ZodObject<T>>;\n  <T extends z.Schema>(schema: T): ZodDataValidator<T>;\n  <T extends z.Schema>(\n    schema: (zod: typeof z.z, ev: RequestEvent) => T,\n  ): ZodDataValidator<T>;\n};\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/types.ts)\n\n<h2 id=\"zodqrl\">zodQrl</h2>\n\n```typescript\nzodQrl: ZodConstructorQRL;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/runtime/src/server-functions.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-aws-lambda/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-aws-lambda\",\n  \"package\": \"@builder.io/qwik-city/middleware/aws-lambda\",\n  \"members\": [\n    {\n      \"name\": \"createQwikCity\",\n      \"id\": \"createqwikcity\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createQwikCity\",\n          \"id\": \"createqwikcity\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function createQwikCity(opts: AwsOpt): {\\n    fixPath: (pathT: string) => string;\\n    router: (req: import(\\\"http\\\").IncomingMessage | import(\\\"http2\\\").Http2ServerRequest, res: import(\\\"http\\\").ServerResponse<import(\\\"http\\\").IncomingMessage>, next: import(\\\"@builder.io/qwik-city/middleware/node\\\").NodeRequestNextFunction) => Promise<void>;\\n    staticFile: (req: import(\\\"http\\\").IncomingMessage | import(\\\"http2\\\").Http2ServerRequest, res: import(\\\"http\\\").ServerResponse<import(\\\"http\\\").IncomingMessage>, next: (e?: any) => void) => Promise<void>;\\n    notFound: (req: import(\\\"http\\\").IncomingMessage | import(\\\"http2\\\").Http2ServerRequest, res: import(\\\"http\\\").ServerResponse<import(\\\"http\\\").IncomingMessage>, next: (e: any) => void) => Promise<void>;\\n    handle: (req: any, res: any) => void;\\n};\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\nAwsOpt\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n{ fixPath: (pathT: string) =&gt; string; router: (req: import(\\\"http\\\").IncomingMessage \\\\| import(\\\"http2\\\").Http2ServerRequest, res: import(\\\"http\\\").ServerResponse&lt;import(\\\"http\\\").IncomingMessage&gt;, next: import(\\\"@builder.io/qwik-city/middleware/node\\\").NodeRequestNextFunction) =&gt; Promise&lt;void&gt;; staticFile: (req: import(\\\"http\\\").IncomingMessage \\\\| import(\\\"http2\\\").Http2ServerRequest, res: import(\\\"http\\\").ServerResponse&lt;import(\\\"http\\\").IncomingMessage&gt;, next: (e?: any) =&gt; void) =&gt; Promise&lt;void&gt;; notFound: (req: import(\\\"http\\\").IncomingMessage \\\\| import(\\\"http2\\\").Http2ServerRequest, res: import(\\\"http\\\").ServerResponse&lt;import(\\\"http\\\").IncomingMessage&gt;, next: (e: any) =&gt; void) =&gt; Promise&lt;void&gt;; handle: (req: any, res: any) =&gt; void; }\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/aws-lambda/index.ts\",\n      \"mdFile\": \"qwik-city.createqwikcity.md\"\n    },\n    {\n      \"name\": \"PlatformAwsLambda\",\n      \"id\": \"platformawslambda\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PlatformAwsLambda\",\n          \"id\": \"platformawslambda\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PlatformAwsLambda extends Object \\n```\\n**Extends:** Object\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/aws-lambda/index.ts\",\n      \"mdFile\": \"qwik-city.platformawslambda.md\"\n    },\n    {\n      \"name\": \"QwikCityAwsLambdaOptions\",\n      \"id\": \"qwikcityawslambdaoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityAwsLambdaOptions\",\n          \"id\": \"qwikcityawslambdaoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityAwsLambdaOptions extends ServerRenderOptions \\n```\\n**Extends:** ServerRenderOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/aws-lambda/index.ts\",\n      \"mdFile\": \"qwik-city.qwikcityawslambdaoptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-aws-lambda/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/aws-lambda API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/aws-lambda\n\n<h2 id=\"createqwikcity\">createQwikCity</h2>\n\n```typescript\nexport declare function createQwikCity(opts: AwsOpt): {\n  fixPath: (pathT: string) => string;\n  router: (\n    req: import(\"http\").IncomingMessage | import(\"http2\").Http2ServerRequest,\n    res: import(\"http\").ServerResponse<import(\"http\").IncomingMessage>,\n    next: import(\"@builder.io/qwik-city/middleware/node\").NodeRequestNextFunction,\n  ) => Promise<void>;\n  staticFile: (\n    req: import(\"http\").IncomingMessage | import(\"http2\").Http2ServerRequest,\n    res: import(\"http\").ServerResponse<import(\"http\").IncomingMessage>,\n    next: (e?: any) => void,\n  ) => Promise<void>;\n  notFound: (\n    req: import(\"http\").IncomingMessage | import(\"http2\").Http2ServerRequest,\n    res: import(\"http\").ServerResponse<import(\"http\").IncomingMessage>,\n    next: (e: any) => void,\n  ) => Promise<void>;\n  handle: (req: any, res: any) => void;\n};\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\nAwsOpt\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n\\{ fixPath: (pathT: string) =&gt; string; router: (req: import(\"http\").IncomingMessage \\| import(\"http2\").Http2ServerRequest, res: import(\"http\").ServerResponse&lt;import(\"http\").IncomingMessage&gt;, next: import(\"@builder.io/qwik-city/middleware/node\").NodeRequestNextFunction) =&gt; Promise&lt;void&gt;; staticFile: (req: import(\"http\").IncomingMessage \\| import(\"http2\").Http2ServerRequest, res: import(\"http\").ServerResponse&lt;import(\"http\").IncomingMessage&gt;, next: (e?: any) =&gt; void) =&gt; Promise&lt;void&gt;; notFound: (req: import(\"http\").IncomingMessage \\| import(\"http2\").Http2ServerRequest, res: import(\"http\").ServerResponse&lt;import(\"http\").IncomingMessage&gt;, next: (e: any) =&gt; void) =&gt; Promise&lt;void&gt;; handle: (req: any, res: any) =&gt; void; }\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/aws-lambda/index.ts)\n\n<h2 id=\"platformawslambda\">PlatformAwsLambda</h2>\n\n```typescript\nexport interface PlatformAwsLambda extends Object\n```\n\n**Extends:** Object\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/aws-lambda/index.ts)\n\n<h2 id=\"qwikcityawslambdaoptions\">QwikCityAwsLambdaOptions</h2>\n\n```typescript\nexport interface QwikCityAwsLambdaOptions extends ServerRenderOptions\n```\n\n**Extends:** ServerRenderOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/aws-lambda/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-azure-swa/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-azure-swa\",\n  \"package\": \"@builder.io/qwik-city/middleware/azure-swa\",\n  \"members\": [\n    {\n      \"name\": \"createQwikCity\",\n      \"id\": \"createqwikcity\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createQwikCity\",\n          \"id\": \"createqwikcity\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function createQwikCity(opts: QwikCityAzureOptions): AzureFunction;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[QwikCityAzureOptions](#qwikcityazureoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nAzureFunction\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/azure-swa/index.ts\",\n      \"mdFile\": \"qwik-city.createqwikcity.md\"\n    },\n    {\n      \"name\": \"PlatformAzure\",\n      \"id\": \"platformazure\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PlatformAzure\",\n          \"id\": \"platformazure\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PlatformAzure extends Partial<Context> \\n```\\n**Extends:** Partial&lt;Context&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/azure-swa/index.ts\",\n      \"mdFile\": \"qwik-city.platformazure.md\"\n    },\n    {\n      \"name\": \"QwikCityAzureOptions\",\n      \"id\": \"qwikcityazureoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityAzureOptions\",\n          \"id\": \"qwikcityazureoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityAzureOptions extends ServerRenderOptions \\n```\\n**Extends:** ServerRenderOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/azure-swa/index.ts\",\n      \"mdFile\": \"qwik-city.qwikcityazureoptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-azure-swa/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/azure-swa API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/azure-swa\n\n<h2 id=\"createqwikcity\">createQwikCity</h2>\n\n```typescript\nexport declare function createQwikCity(\n  opts: QwikCityAzureOptions,\n): AzureFunction;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[QwikCityAzureOptions](#qwikcityazureoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nAzureFunction\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/azure-swa/index.ts)\n\n<h2 id=\"platformazure\">PlatformAzure</h2>\n\n```typescript\nexport interface PlatformAzure extends Partial<Context>\n```\n\n**Extends:** Partial&lt;Context&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/azure-swa/index.ts)\n\n<h2 id=\"qwikcityazureoptions\">QwikCityAzureOptions</h2>\n\n```typescript\nexport interface QwikCityAzureOptions extends ServerRenderOptions\n```\n\n**Extends:** ServerRenderOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/azure-swa/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-cloudflare-pages/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-cloudflare-pages\",\n  \"package\": \"@builder.io/qwik-city/middleware/cloudflare-pages\",\n  \"members\": [\n    {\n      \"name\": \"createQwikCity\",\n      \"id\": \"createqwikcity\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createQwikCity\",\n          \"id\": \"createqwikcity\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function createQwikCity(opts: QwikCityCloudflarePagesOptions): (request: PlatformCloudflarePages['request'], env: PlatformCloudflarePages['env'] & {\\n    ASSETS: {\\n        fetch: (req: Request) => Response;\\n    };\\n}, ctx: PlatformCloudflarePages['ctx']) => Promise<Response>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[QwikCityCloudflarePagesOptions](#qwikcitycloudflarepagesoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n(request: [PlatformCloudflarePages](#platformcloudflarepages)<!-- -->\\\\['request'\\\\], env: [PlatformCloudflarePages](#platformcloudflarepages)<!-- -->\\\\['env'\\\\] &amp; { ASSETS: { fetch: (req: Request) =&gt; Response; }; }, ctx: [PlatformCloudflarePages](#platformcloudflarepages)<!-- -->\\\\['ctx'\\\\]) =&gt; Promise&lt;Response&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/cloudflare-pages/index.ts\",\n      \"mdFile\": \"qwik-city.createqwikcity.md\"\n    },\n    {\n      \"name\": \"PlatformCloudflarePages\",\n      \"id\": \"platformcloudflarepages\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PlatformCloudflarePages\",\n          \"id\": \"platformcloudflarepages\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PlatformCloudflarePages \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[ctx](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ waitUntil: (promise: Promise&lt;any&gt;) =&gt; void; }\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[env?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[request](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRequest\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/cloudflare-pages/index.ts\",\n      \"mdFile\": \"qwik-city.platformcloudflarepages.md\"\n    },\n    {\n      \"name\": \"QwikCityCloudflarePagesOptions\",\n      \"id\": \"qwikcitycloudflarepagesoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityCloudflarePagesOptions\",\n          \"id\": \"qwikcitycloudflarepagesoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityCloudflarePagesOptions extends ServerRenderOptions \\n```\\n**Extends:** ServerRenderOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/cloudflare-pages/index.ts\",\n      \"mdFile\": \"qwik-city.qwikcitycloudflarepagesoptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-cloudflare-pages/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/cloudflare-pages API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/cloudflare-pages\n\n<h2 id=\"createqwikcity\">createQwikCity</h2>\n\n```typescript\nexport declare function createQwikCity(opts: QwikCityCloudflarePagesOptions): (\n  request: PlatformCloudflarePages[\"request\"],\n  env: PlatformCloudflarePages[\"env\"] & {\n    ASSETS: {\n      fetch: (req: Request) => Response;\n    };\n  },\n  ctx: PlatformCloudflarePages[\"ctx\"],\n) => Promise<Response>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[QwikCityCloudflarePagesOptions](#qwikcitycloudflarepagesoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n(request: [PlatformCloudflarePages](#platformcloudflarepages)['request'], env: [PlatformCloudflarePages](#platformcloudflarepages)['env'] &amp; \\{ ASSETS: \\{ fetch: (req: Request) =&gt; Response; }; }, ctx: [PlatformCloudflarePages](#platformcloudflarepages)['ctx']) =&gt; Promise&lt;Response&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/cloudflare-pages/index.ts)\n\n<h2 id=\"platformcloudflarepages\">PlatformCloudflarePages</h2>\n\n```typescript\nexport interface PlatformCloudflarePages\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[ctx](#)\n\n</td><td>\n\n</td><td>\n\n\\{ waitUntil: (promise: Promise&lt;any&gt;) =&gt; void; }\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[env?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, any&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[request](#)\n\n</td><td>\n\n</td><td>\n\nRequest\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/cloudflare-pages/index.ts)\n\n<h2 id=\"qwikcitycloudflarepagesoptions\">QwikCityCloudflarePagesOptions</h2>\n\n```typescript\nexport interface QwikCityCloudflarePagesOptions extends ServerRenderOptions\n```\n\n**Extends:** ServerRenderOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/cloudflare-pages/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-firebase/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-firebase\",\n  \"package\": \"@builder.io/qwik-city/middleware/firebase\",\n  \"members\": [\n    {\n      \"name\": \"createQwikCity\",\n      \"id\": \"createqwikcity\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createQwikCity\",\n          \"id\": \"createqwikcity\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function createQwikCity(opts: QwikCityFirebaseOptions): (req: any, res: any) => Promise<void>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[QwikCityFirebaseOptions](#qwikcityfirebaseoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n(req: any, res: any) =&gt; Promise&lt;void&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/firebase/index.ts\",\n      \"mdFile\": \"qwik-city.createqwikcity.md\"\n    },\n    {\n      \"name\": \"PlatformFirebase\",\n      \"id\": \"platformfirebase\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PlatformFirebase\",\n          \"id\": \"platformfirebase\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PlatformFirebase extends Object \\n```\\n**Extends:** Object\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/firebase/index.ts\",\n      \"mdFile\": \"qwik-city.platformfirebase.md\"\n    },\n    {\n      \"name\": \"QwikCityFirebaseOptions\",\n      \"id\": \"qwikcityfirebaseoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityFirebaseOptions\",\n          \"id\": \"qwikcityfirebaseoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityFirebaseOptions extends ServerRenderOptions \\n```\\n**Extends:** ServerRenderOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/firebase/index.ts\",\n      \"mdFile\": \"qwik-city.qwikcityfirebaseoptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-firebase/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/firebase API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/firebase\n\n<h2 id=\"createqwikcity\">createQwikCity</h2>\n\n```typescript\nexport declare function createQwikCity(\n  opts: QwikCityFirebaseOptions,\n): (req: any, res: any) => Promise<void>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[QwikCityFirebaseOptions](#qwikcityfirebaseoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n(req: any, res: any) =&gt; Promise&lt;void&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/firebase/index.ts)\n\n<h2 id=\"platformfirebase\">PlatformFirebase</h2>\n\n```typescript\nexport interface PlatformFirebase extends Object\n```\n\n**Extends:** Object\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/firebase/index.ts)\n\n<h2 id=\"qwikcityfirebaseoptions\">QwikCityFirebaseOptions</h2>\n\n```typescript\nexport interface QwikCityFirebaseOptions extends ServerRenderOptions\n```\n\n**Extends:** ServerRenderOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/firebase/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-netlify-edge/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-netlify-edge\",\n  \"package\": \"@builder.io/qwik-city/middleware/netlify-edge\",\n  \"members\": [\n    {\n      \"name\": \"createQwikCity\",\n      \"id\": \"createqwikcity\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createQwikCity\",\n          \"id\": \"createqwikcity\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function createQwikCity(opts: QwikCityNetlifyOptions): (request: Request, context: Context) => Promise<Response>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[QwikCityNetlifyOptions](#qwikcitynetlifyoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n(request: Request, context: Context) =&gt; Promise&lt;Response&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/netlify-edge/index.ts\",\n      \"mdFile\": \"qwik-city.createqwikcity.md\"\n    },\n    {\n      \"name\": \"PlatformNetlify\",\n      \"id\": \"platformnetlify\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PlatformNetlify\",\n          \"id\": \"platformnetlify\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PlatformNetlify extends Partial<Omit<Context, 'next' | 'cookies'>> \\n```\\n**Extends:** Partial&lt;Omit&lt;Context, 'next' \\\\| 'cookies'&gt;&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/netlify-edge/index.ts\",\n      \"mdFile\": \"qwik-city.platformnetlify.md\"\n    },\n    {\n      \"name\": \"QwikCityNetlifyOptions\",\n      \"id\": \"qwikcitynetlifyoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityNetlifyOptions\",\n          \"id\": \"qwikcitynetlifyoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityNetlifyOptions extends ServerRenderOptions \\n```\\n**Extends:** ServerRenderOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/netlify-edge/index.ts\",\n      \"mdFile\": \"qwik-city.qwikcitynetlifyoptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-netlify-edge/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/netlify-edge API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/netlify-edge\n\n<h2 id=\"createqwikcity\">createQwikCity</h2>\n\n```typescript\nexport declare function createQwikCity(\n  opts: QwikCityNetlifyOptions,\n): (request: Request, context: Context) => Promise<Response>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[QwikCityNetlifyOptions](#qwikcitynetlifyoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n(request: Request, context: Context) =&gt; Promise&lt;Response&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/netlify-edge/index.ts)\n\n<h2 id=\"platformnetlify\">PlatformNetlify</h2>\n\n```typescript\nexport interface PlatformNetlify extends Partial<Omit<Context, 'next' | 'cookies'>>\n```\n\n**Extends:** Partial&lt;Omit&lt;Context, 'next' \\| 'cookies'&gt;&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/netlify-edge/index.ts)\n\n<h2 id=\"qwikcitynetlifyoptions\">QwikCityNetlifyOptions</h2>\n\n```typescript\nexport interface QwikCityNetlifyOptions extends ServerRenderOptions\n```\n\n**Extends:** ServerRenderOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/netlify-edge/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-node/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-node\",\n  \"package\": \"@builder.io/qwik-city/middleware/node\",\n  \"members\": [\n    {\n      \"name\": \"createQwikCity\",\n      \"id\": \"createqwikcity\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createQwikCity\",\n          \"id\": \"createqwikcity\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function createQwikCity(opts: QwikCityNodeRequestOptions): {\\n    router: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: NodeRequestNextFunction) => Promise<void>;\\n    notFound: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: (e: any) => void) => Promise<void>;\\n    staticFile: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: (e?: any) => void) => Promise<void>;\\n};\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[QwikCityNodeRequestOptions](#qwikcitynoderequestoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n{ router: (req: IncomingMessage \\\\| Http2ServerRequest, res: ServerResponse, next: [NodeRequestNextFunction](#noderequestnextfunction)<!-- -->) =&gt; Promise&lt;void&gt;; notFound: (req: IncomingMessage \\\\| Http2ServerRequest, res: ServerResponse, next: (e: any) =&gt; void) =&gt; Promise&lt;void&gt;; staticFile: (req: IncomingMessage \\\\| Http2ServerRequest, res: ServerResponse, next: (e?: any) =&gt; void) =&gt; Promise&lt;void&gt;; }\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts\",\n      \"mdFile\": \"qwik-city.createqwikcity.md\"\n    },\n    {\n      \"name\": \"NodeRequestNextFunction\",\n      \"id\": \"noderequestnextfunction\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NodeRequestNextFunction\",\n          \"id\": \"noderequestnextfunction\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface NodeRequestNextFunction \\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts\",\n      \"mdFile\": \"qwik-city.noderequestnextfunction.md\"\n    },\n    {\n      \"name\": \"PlatformNode\",\n      \"id\": \"platformnode\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PlatformNode\",\n          \"id\": \"platformnode\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PlatformNode \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[incomingMessage?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nIncomingMessage \\\\| Http2ServerRequest\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[node?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ssr?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\ntrue\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts\",\n      \"mdFile\": \"qwik-city.platformnode.md\"\n    },\n    {\n      \"name\": \"QwikCityNodeRequestOptions\",\n      \"id\": \"qwikcitynoderequestoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityNodeRequestOptions\",\n          \"id\": \"qwikcitynoderequestoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityNodeRequestOptions extends ServerRenderOptions \\n```\\n**Extends:** ServerRenderOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[getClientConn?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(req: IncomingMessage \\\\| Http2ServerRequest) =&gt; ClientConn\\n\\n\\n</td><td>\\n\\n_(Optional)_ Provide a function that returns a `ClientConn` for the given request.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getOrigin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(req: IncomingMessage \\\\| Http2ServerRequest) =&gt; string \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_ Provide a function that computes the origin of the server, used to resolve relative URLs and validate the request origin against CSRF attacks.\\n\\nWhen not specified, it defaults to the `ORIGIN` environment variable (if set).\\n\\nIf `ORIGIN` is not set, it's derived from the incoming request, which is not recommended for production use. You can specify the `PROTOCOL_HEADER`<!-- -->, `HOST_HEADER` to `X-Forwarded-Proto` and `X-Forwarded-Host` respectively to override the default behavior.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[origin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[static?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ root?: string; cacheControl?: string; }\\n\\n\\n</td><td>\\n\\n_(Optional)_ Options for serving static files\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts\",\n      \"mdFile\": \"qwik-city.qwikcitynoderequestoptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-node/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/node API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/node\n\n<h2 id=\"createqwikcity\">createQwikCity</h2>\n\n```typescript\nexport declare function createQwikCity(opts: QwikCityNodeRequestOptions): {\n  router: (\n    req: IncomingMessage | Http2ServerRequest,\n    res: ServerResponse,\n    next: NodeRequestNextFunction,\n  ) => Promise<void>;\n  notFound: (\n    req: IncomingMessage | Http2ServerRequest,\n    res: ServerResponse,\n    next: (e: any) => void,\n  ) => Promise<void>;\n  staticFile: (\n    req: IncomingMessage | Http2ServerRequest,\n    res: ServerResponse,\n    next: (e?: any) => void,\n  ) => Promise<void>;\n};\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[QwikCityNodeRequestOptions](#qwikcitynoderequestoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n\\{ router: (req: IncomingMessage \\| Http2ServerRequest, res: ServerResponse, next: [NodeRequestNextFunction](#noderequestnextfunction)) =&gt; Promise&lt;void&gt;; notFound: (req: IncomingMessage \\| Http2ServerRequest, res: ServerResponse, next: (e: any) =&gt; void) =&gt; Promise&lt;void&gt;; staticFile: (req: IncomingMessage \\| Http2ServerRequest, res: ServerResponse, next: (e?: any) =&gt; void) =&gt; Promise&lt;void&gt;; }\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts)\n\n<h2 id=\"noderequestnextfunction\">NodeRequestNextFunction</h2>\n\n```typescript\nexport interface NodeRequestNextFunction\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts)\n\n<h2 id=\"platformnode\">PlatformNode</h2>\n\n```typescript\nexport interface PlatformNode\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[incomingMessage?](#)\n\n</td><td>\n\n</td><td>\n\nIncomingMessage \\| Http2ServerRequest\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[node?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[ssr?](#)\n\n</td><td>\n\n</td><td>\n\ntrue\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts)\n\n<h2 id=\"qwikcitynoderequestoptions\">QwikCityNodeRequestOptions</h2>\n\n```typescript\nexport interface QwikCityNodeRequestOptions extends ServerRenderOptions\n```\n\n**Extends:** ServerRenderOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[getClientConn?](#)\n\n</td><td>\n\n</td><td>\n\n(req: IncomingMessage \\| Http2ServerRequest) =&gt; ClientConn\n\n</td><td>\n\n_(Optional)_ Provide a function that returns a `ClientConn` for the given request.\n\n</td></tr>\n<tr><td>\n\n[getOrigin?](#)\n\n</td><td>\n\n</td><td>\n\n(req: IncomingMessage \\| Http2ServerRequest) =&gt; string \\| null\n\n</td><td>\n\n_(Optional)_ Provide a function that computes the origin of the server, used to resolve relative URLs and validate the request origin against CSRF attacks.\n\nWhen not specified, it defaults to the `ORIGIN` environment variable (if set).\n\nIf `ORIGIN` is not set, it's derived from the incoming request, which is not recommended for production use. You can specify the `PROTOCOL_HEADER`, `HOST_HEADER` to `X-Forwarded-Proto` and `X-Forwarded-Host` respectively to override the default behavior.\n\n</td></tr>\n<tr><td>\n\n[origin?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[static?](#)\n\n</td><td>\n\n</td><td>\n\n\\{ root?: string; cacheControl?: string; }\n\n</td><td>\n\n_(Optional)_ Options for serving static files\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/node/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-request-handler/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-request-handler\",\n  \"package\": \"@builder.io/qwik-city/middleware/request-handler\",\n  \"members\": [\n    {\n      \"name\": \"AbortMessage\",\n      \"id\": \"abortmessage\",\n      \"hierarchy\": [\n        {\n          \"name\": \"AbortMessage\",\n          \"id\": \"abortmessage\"\n        }\n      ],\n      \"kind\": \"Class\",\n      \"content\": \"```typescript\\nexport declare class AbortMessage \\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/redirect-handler.ts\",\n      \"mdFile\": \"qwik-city.abortmessage.md\"\n    },\n    {\n      \"name\": \"append\",\n      \"id\": \"cookie-append\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie-append\"\n        },\n        {\n          \"name\": \"append\",\n          \"id\": \"cookie-append\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Appends a `Response` cookie header using the `Set-Cookie` header.\\n\\nThe difference between `set()` and `append()` is that if the specified header already exists, `set()` will overwrite the existing value with the new one, whereas `append()` will append the new value onto the end of the set of values.\\n\\n\\n```typescript\\nappend(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nname\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nvalue\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| Record&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\noptions\\n\\n\\n</td><td>\\n\\n[CookieOptions](#cookieoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"mdFile\": \"qwik-city.cookie.append.md\"\n    },\n    {\n      \"name\": \"CacheControl\",\n      \"id\": \"cachecontrol\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CacheControl\",\n          \"id\": \"cachecontrol\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type CacheControl = CacheControlOptions | number | 'day' | 'week' | 'month' | 'year' | 'no-cache' | 'immutable' | 'private';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.cachecontrol.md\"\n    },\n    {\n      \"name\": \"ClientConn\",\n      \"id\": \"clientconn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ClientConn\",\n          \"id\": \"clientconn\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ClientConn \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[country?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ip?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.clientconn.md\"\n    },\n    {\n      \"name\": \"Cookie\",\n      \"id\": \"cookie\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface Cookie \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nMethod\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[append(name, value, options)](#cookie-append)\\n\\n\\n</td><td>\\n\\nAppends a `Response` cookie header using the `Set-Cookie` header.\\n\\nThe difference between `set()` and `append()` is that if the specified header already exists, `set()` will overwrite the existing value with the new one, whereas `append()` will append the new value onto the end of the set of values.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[delete(name, options)](#cookie-delete)\\n\\n\\n</td><td>\\n\\nDeletes cookie value by name using the `Response` cookie header.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[get(name)](#cookie-get)\\n\\n\\n</td><td>\\n\\nGets a `Request` cookie header value by name.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getAll()](#cookie-getall)\\n\\n\\n</td><td>\\n\\nGets all `Request` cookie headers.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[has(name)](#cookie-has)\\n\\n\\n</td><td>\\n\\nChecks if the `Request` cookie header name exists.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[headers()](#cookie-headers)\\n\\n\\n</td><td>\\n\\nReturns an array of all the set `Response` `Set-Cookie` header values.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[set(name, value, options)](#cookie-set)\\n\\n\\n</td><td>\\n\\nSets a `Response` cookie header using the `Set-Cookie` header.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.cookie.md\"\n    },\n    {\n      \"name\": \"CookieOptions\",\n      \"id\": \"cookieoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CookieOptions\",\n          \"id\": \"cookieoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie\\n\\n\\n```typescript\\nexport interface CookieOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[domain?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines the host to which the cookie will be sent. If omitted, this attribute defaults to the host of the current document URL, not including subdomains.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[expires?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nDate \\\\| string\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. If both `expires` and `maxAge` are set, `maxAge` has precedence.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[httpOnly?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Forbids JavaScript from accessing the cookie, for example, through the `document.cookie` property.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[maxAge?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber \\\\| \\\\[number, 'seconds' \\\\| 'minutes' \\\\| 'hours' \\\\| 'days' \\\\| 'weeks'\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately. If both `expires` and `maxAge` are set, `maxAge` has precedence. You can also use the array syntax to set the max-age using minutes, hours, days or weeks. For example, `{ maxAge: [3, \\\"days\\\"] }` would set the cookie to expire in 3 days.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[path?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates the path that must exist in the requested URL for the browser to send the Cookie header.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sameSite?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'strict' \\\\| 'lax' \\\\| 'none' \\\\| 'Strict' \\\\| 'Lax' \\\\| 'None' \\\\| boolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Controls whether or not a cookie is sent with cross-site requests, providing some protection against cross-site request forgery attacks (CSRF).\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[secure?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Indicates that the cookie is sent to the server only when a request is made with the `https:` scheme (except on localhost)\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.cookieoptions.md\"\n    },\n    {\n      \"name\": \"CookieValue\",\n      \"id\": \"cookievalue\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CookieValue\",\n          \"id\": \"cookievalue\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface CookieValue \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[json](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n&lt;T = unknown&gt;() =&gt; T\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[number](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; number\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[value](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.cookievalue.md\"\n    },\n    {\n      \"name\": \"data\",\n      \"id\": \"servererror-data\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerError\",\n          \"id\": \"servererror-data\"\n        },\n        {\n          \"name\": \"data\",\n          \"id\": \"servererror-data\"\n        }\n      ],\n      \"kind\": \"Property\",\n      \"content\": \"```typescript\\ndata: T;\\n```\",\n      \"mdFile\": \"qwik-city.servererror.data.md\"\n    },\n    {\n      \"name\": \"DeferReturn\",\n      \"id\": \"deferreturn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DeferReturn\",\n          \"id\": \"deferreturn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type DeferReturn<T> = () => Promise<T>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.deferreturn.md\"\n    },\n    {\n      \"name\": \"delete\",\n      \"id\": \"cookie-delete\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie-delete\"\n        },\n        {\n          \"name\": \"delete\",\n          \"id\": \"cookie-delete\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Deletes cookie value by name using the `Response` cookie header.\\n\\n\\n```typescript\\ndelete(name: string, options?: Pick<CookieOptions, 'path' | 'domain' | 'sameSite'>): void;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nname\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\noptions\\n\\n\\n</td><td>\\n\\nPick&lt;[CookieOptions](#cookieoptions)<!-- -->, 'path' \\\\| 'domain' \\\\| 'sameSite'&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"mdFile\": \"qwik-city.cookie.delete.md\"\n    },\n    {\n      \"name\": \"EnvGetter\",\n      \"id\": \"envgetter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"EnvGetter\",\n          \"id\": \"envgetter\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface EnvGetter \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nMethod\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[get(key)](#)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.envgetter.md\"\n    },\n    {\n      \"name\": \"get\",\n      \"id\": \"cookie-get\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie-get\"\n        },\n        {\n          \"name\": \"get\",\n          \"id\": \"cookie-get\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Gets a `Request` cookie header value by name.\\n\\n\\n```typescript\\nget(name: string): CookieValue | null;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nname\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[CookieValue](#cookievalue) \\\\| null\",\n      \"mdFile\": \"qwik-city.cookie.get.md\"\n    },\n    {\n      \"name\": \"getAll\",\n      \"id\": \"cookie-getall\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie-getall\"\n        },\n        {\n          \"name\": \"getAll\",\n          \"id\": \"cookie-getall\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Gets all `Request` cookie headers.\\n\\n\\n```typescript\\ngetAll(): Record<string, CookieValue>;\\n```\\n**Returns:**\\n\\nRecord&lt;string, [CookieValue](#cookievalue)<!-- -->&gt;\",\n      \"mdFile\": \"qwik-city.cookie.getall.md\"\n    },\n    {\n      \"name\": \"getErrorHtml\",\n      \"id\": \"geterrorhtml\",\n      \"hierarchy\": [\n        {\n          \"name\": \"getErrorHtml\",\n          \"id\": \"geterrorhtml\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function getErrorHtml(status: number, e: any): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nstatus\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\ne\\n\\n\\n</td><td>\\n\\nany\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/error-handler.ts\",\n      \"mdFile\": \"qwik-city.geterrorhtml.md\"\n    },\n    {\n      \"name\": \"has\",\n      \"id\": \"cookie-has\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie-has\"\n        },\n        {\n          \"name\": \"has\",\n          \"id\": \"cookie-has\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Checks if the `Request` cookie header name exists.\\n\\n\\n```typescript\\nhas(name: string): boolean;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nname\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nboolean\",\n      \"mdFile\": \"qwik-city.cookie.has.md\"\n    },\n    {\n      \"name\": \"headers\",\n      \"id\": \"cookie-headers\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie-headers\"\n        },\n        {\n          \"name\": \"headers\",\n          \"id\": \"cookie-headers\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Returns an array of all the set `Response` `Set-Cookie` header values.\\n\\n\\n```typescript\\nheaders(): string[];\\n```\\n**Returns:**\\n\\nstring\\\\[\\\\]\",\n      \"mdFile\": \"qwik-city.cookie.headers.md\"\n    },\n    {\n      \"name\": \"mergeHeadersCookies\",\n      \"id\": \"mergeheaderscookies\",\n      \"hierarchy\": [\n        {\n          \"name\": \"mergeHeadersCookies\",\n          \"id\": \"mergeheaderscookies\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nmergeHeadersCookies: (headers: Headers, cookies: CookieInterface) => Headers\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nheaders\\n\\n\\n</td><td>\\n\\nHeaders\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\ncookies\\n\\n\\n</td><td>\\n\\n[CookieInterface](#cookie)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nHeaders\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/cookie.ts\",\n      \"mdFile\": \"qwik-city.mergeheaderscookies.md\"\n    },\n    {\n      \"name\": \"pathname\",\n      \"id\": \"rewritemessage-pathname\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RewriteMessage\",\n          \"id\": \"rewritemessage-pathname\"\n        },\n        {\n          \"name\": \"pathname\",\n          \"id\": \"rewritemessage-pathname\"\n        }\n      ],\n      \"kind\": \"Property\",\n      \"content\": \"```typescript\\nreadonly pathname: string;\\n```\",\n      \"mdFile\": \"qwik-city.rewritemessage.pathname.md\"\n    },\n    {\n      \"name\": \"RedirectMessage\",\n      \"id\": \"redirectmessage\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RedirectMessage\",\n          \"id\": \"redirectmessage\"\n        }\n      ],\n      \"kind\": \"Class\",\n      \"content\": \"```typescript\\nexport declare class RedirectMessage extends AbortMessage \\n```\\n**Extends:** [AbortMessage](#abortmessage)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/redirect-handler.ts\",\n      \"mdFile\": \"qwik-city.redirectmessage.md\"\n    },\n    {\n      \"name\": \"RequestEvent\",\n      \"id\": \"requestevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RequestEvent\",\n          \"id\": \"requestevent\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RequestEvent<PLATFORM = QwikCityPlatform> extends RequestEventCommon<PLATFORM> \\n```\\n**Extends:** [RequestEventCommon](#requesteventcommon)<!-- -->&lt;PLATFORM&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[exited](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\nTrue if the middleware chain has finished executing.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getWritableStream](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n() =&gt; WritableStream&lt;Uint8Array&gt;\\n\\n\\n</td><td>\\n\\nLow-level access to write to the HTTP response stream. Once `getWritableStream()` is called, the status and headers can no longer be modified and will be sent over the network.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[headersSent](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\nTrue if headers have been sent, preventing any more headers from being set.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[next](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n() =&gt; Promise&lt;void&gt;\\n\\n\\n</td><td>\\n\\nInvoke the next middleware function in the chain.\\n\\nNOTE: Ensure that the call to `next()` is `await`<!-- -->ed.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.requestevent.md\"\n    },\n    {\n      \"name\": \"RequestEventAction\",\n      \"id\": \"requesteventaction\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RequestEventAction\",\n          \"id\": \"requesteventaction\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RequestEventAction<PLATFORM = QwikCityPlatform> extends RequestEventCommon<PLATFORM> \\n```\\n**Extends:** [RequestEventCommon](#requesteventcommon)<!-- -->&lt;PLATFORM&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[fail](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n&lt;T extends Record&lt;string, any&gt;&gt;(status: number, returnData: T) =&gt; FailReturn&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.requesteventaction.md\"\n    },\n    {\n      \"name\": \"RequestEventBase\",\n      \"id\": \"requesteventbase\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RequestEventBase\",\n          \"id\": \"requesteventbase\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RequestEventBase<PLATFORM = QwikCityPlatform> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[basePathname](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nThe base pathname of the request, which can be configured at build time. Defaults to `/`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[cacheControl](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(cacheControl: [CacheControl](#cachecontrol)<!-- -->, target?: CacheControlTarget) =&gt; void\\n\\n\\n</td><td>\\n\\nConvenience method to set the Cache-Control header. Depending on your CDN, you may want to add another cacheControl with the second argument set to `CDN-Cache-Control` or any other value (we provide the most common values for auto-complete, but you can use any string you want).\\n\\nSee https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control and https://qwik.dev/docs/caching/\\\\#CDN-Cache-Controls for more information.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[clientConn](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[ClientConn](#clientconn)\\n\\n\\n</td><td>\\n\\nProvides information about the client connection, such as the IP address and the country the request originated from.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[cookie](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[Cookie](#cookie)\\n\\n\\n</td><td>\\n\\nHTTP request and response cookie. Use the `get()` method to retrieve a request cookie value. Use the `set()` method to set a response cookie value.\\n\\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[env](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[EnvGetter](#envgetter)\\n\\n\\n</td><td>\\n\\nPlatform provided environment variables.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[headers](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nHeaders\\n\\n\\n</td><td>\\n\\nHTTP response headers. Notice it will be empty until you first add a header. If you want to read the request headers, use `request.headers` instead.\\n\\nhttps://developer.mozilla.org/en-US/docs/Glossary/Response\\\\_header\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[method](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nHTTP request method.\\n\\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Methods\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[originalUrl](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nURL\\n\\n\\n</td><td>\\n\\nThe original HTTP request URL.\\n\\nThis property was introduced to support the rewrite feature.\\n\\nIf rewrite is called, the url property will be changed to the rewritten url. while originalUrl will stay the same(e.g the url inserted to the address bar).\\n\\nIf rewrite is never called as part of the request, the url property and the originalUrl are equal.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[params](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nReadonly&lt;Record&lt;string, string&gt;&gt;\\n\\n\\n</td><td>\\n\\nURL path params which have been parsed from the current url pathname segments. Use `query` to instead retrieve the query string search params.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[parseBody](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n() =&gt; Promise&lt;unknown&gt;\\n\\n\\n</td><td>\\n\\nThis method will check the request headers for a `Content-Type` header and parse the body accordingly. It supports `application/json`<!-- -->, `application/x-www-form-urlencoded`<!-- -->, and `multipart/form-data` content types.\\n\\nIf the `Content-Type` header is not set, it will return `null`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[pathname](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nURL pathname. Does not include the protocol, domain, query string (search params) or hash.\\n\\nhttps://developer.mozilla.org/en-US/docs/Web/API/URL/pathname\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[platform](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nPLATFORM\\n\\n\\n</td><td>\\n\\nPlatform specific data and functions\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[query](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nURLSearchParams\\n\\n\\n</td><td>\\n\\nURL Query Strings (URL Search Params). Use `params` to instead retrieve the route params found in the url pathname.\\n\\nhttps://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[request](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nRequest\\n\\n\\n</td><td>\\n\\nHTTP request information.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sharedMap](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nMap&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\nShared Map across all the request handlers. Every HTTP request will get a new instance of the shared map. The shared map is useful for sharing data between request handlers.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[signal](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nAbortSignal\\n\\n\\n</td><td>\\n\\nRequest's AbortSignal (same as `request.signal`<!-- -->). This signal indicates that the request has been aborted.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[url](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nURL\\n\\n\\n</td><td>\\n\\nHTTP request URL.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.requesteventbase.md\"\n    },\n    {\n      \"name\": \"RequestEventCommon\",\n      \"id\": \"requesteventcommon\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RequestEventCommon\",\n          \"id\": \"requesteventcommon\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RequestEventCommon<PLATFORM = QwikCityPlatform> extends RequestEventBase<PLATFORM> \\n```\\n**Extends:** [RequestEventBase](#requesteventbase)<!-- -->&lt;PLATFORM&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[error](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n&lt;T = any&gt;(statusCode: ErrorCodes, message: T) =&gt; [ServerError](#servererror)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\nWhen called, the response will immediately end with the given status code. This could be useful to end a response with `404`<!-- -->, and use the 404 handler in the routes directory. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status for which status code should be used.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[exit](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n() =&gt; [AbortMessage](#abortmessage)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[html](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(statusCode: StatusCodes, html: string) =&gt; [AbortMessage](#abortmessage)\\n\\n\\n</td><td>\\n\\nConvenience method to send an HTML body response. The response will be automatically set the `Content-Type` header to`text/html; charset=utf-8`<!-- -->. An `html()` response can only be called once.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[json](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(statusCode: StatusCodes, data: any) =&gt; [AbortMessage](#abortmessage)\\n\\n\\n</td><td>\\n\\nConvenience method to JSON stringify the data and send it in the response. The response will be automatically set the `Content-Type` header to `application/json; charset=utf-8`<!-- -->. A `json()` response can only be called once.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[locale](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(local?: string) =&gt; string\\n\\n\\n</td><td>\\n\\nWhich locale the content is in.\\n\\nThe locale value can be retrieved from selected methods using `getLocale()`<!-- -->:\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[redirect](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(statusCode: RedirectCode, url: string) =&gt; [RedirectMessage](#redirectmessage)\\n\\n\\n</td><td>\\n\\nURL to redirect to. When called, the response will immediately end with the correct redirect status and headers.\\n\\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rewrite](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(pathname: string) =&gt; [RewriteMessage](#rewritemessage)\\n\\n\\n</td><td>\\n\\nWhen called, qwik-city will execute the path's matching route flow.\\n\\nThe url in the browser will remain unchanged.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[send](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nSendMethod\\n\\n\\n</td><td>\\n\\nSend a body response. The `Content-Type` response header is not automatically set when using `send()` and must be set manually. A `send()` response can only be called once.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[status](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(statusCode?: StatusCodes) =&gt; number\\n\\n\\n</td><td>\\n\\nHTTP response status code. Sets the status code when called with an argument. Always returns the status code, so calling `status()` without an argument will can be used to return the current status code.\\n\\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Status\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[text](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n(statusCode: StatusCodes, text: string) =&gt; [AbortMessage](#abortmessage)\\n\\n\\n</td><td>\\n\\nConvenience method to send an text body response. The response will be automatically set the `Content-Type` header to`text/plain; charset=utf-8`<!-- -->. An `text()` response can only be called once.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.requesteventcommon.md\"\n    },\n    {\n      \"name\": \"RequestEventLoader\",\n      \"id\": \"requesteventloader\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RequestEventLoader\",\n          \"id\": \"requesteventloader\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RequestEventLoader<PLATFORM = QwikCityPlatform> extends RequestEventAction<PLATFORM> \\n```\\n**Extends:** [RequestEventAction](#requesteventaction)<!-- -->&lt;PLATFORM&gt;\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[defer](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n&lt;T&gt;(returnData: Promise&lt;T&gt; \\\\| (() =&gt; Promise&lt;T&gt;)) =&gt; [DeferReturn](#deferreturn)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[resolveValue](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[ResolveValue](#resolvevalue)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.requesteventloader.md\"\n    },\n    {\n      \"name\": \"requestHandler\",\n      \"id\": \"requesthandler\",\n      \"hierarchy\": [\n        {\n          \"name\": \"requestHandler\",\n          \"id\": \"requesthandler\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport type RequestHandler<PLATFORM = QwikCityPlatform> = (ev: RequestEvent<PLATFORM>) => Promise<void> | void;\\n```\\n**References:** [RequestEvent](#requestevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/request-handler.ts\",\n      \"mdFile\": \"qwik-city.requesthandler.md\"\n    },\n    {\n      \"name\": \"RequestHandler\",\n      \"id\": \"requesthandler\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RequestHandler\",\n          \"id\": \"requesthandler\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type RequestHandler<PLATFORM = QwikCityPlatform> = (ev: RequestEvent<PLATFORM>) => Promise<void> | void;\\n```\\n**References:** [RequestEvent](#requestevent)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.requesthandler.md\"\n    },\n    {\n      \"name\": \"ResolveSyncValue\",\n      \"id\": \"resolvesyncvalue\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResolveSyncValue\",\n          \"id\": \"resolvesyncvalue\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResolveSyncValue \\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.resolvesyncvalue.md\"\n    },\n    {\n      \"name\": \"ResolveValue\",\n      \"id\": \"resolvevalue\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResolveValue\",\n          \"id\": \"resolvevalue\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResolveValue \\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.resolvevalue.md\"\n    },\n    {\n      \"name\": \"RewriteMessage\",\n      \"id\": \"rewritemessage\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RewriteMessage\",\n          \"id\": \"rewritemessage\"\n        }\n      ],\n      \"kind\": \"Class\",\n      \"content\": \"```typescript\\nexport declare class RewriteMessage extends AbortMessage \\n```\\n**Extends:** [AbortMessage](#abortmessage)\\n\\n\\n<table><thead><tr><th>\\n\\nConstructor\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[(constructor)(pathname)](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nConstructs a new instance of the `RewriteMessage` class\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[pathname](#rewritemessage-pathname)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/rewrite-handler.ts\",\n      \"mdFile\": \"qwik-city.rewritemessage.md\"\n    },\n    {\n      \"name\": \"ServerError\",\n      \"id\": \"servererror\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerError\",\n          \"id\": \"servererror\"\n        }\n      ],\n      \"kind\": \"Class\",\n      \"content\": \"```typescript\\nexport declare class ServerError<T = any> extends Error \\n```\\n**Extends:** Error\\n\\n\\n<table><thead><tr><th>\\n\\nConstructor\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[(constructor)(status, data)](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nConstructs a new instance of the `ServerError` class\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[data](#servererror-data)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nT\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[status](#servererror-status)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/server-error.ts\",\n      \"mdFile\": \"qwik-city.servererror.md\"\n    },\n    {\n      \"name\": \"ServerRenderOptions\",\n      \"id\": \"serverrenderoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerRenderOptions\",\n          \"id\": \"serverrenderoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ServerRenderOptions extends RenderOptions \\n```\\n**Extends:** RenderOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[checkOrigin?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean \\\\| 'lax-proto'\\n\\n\\n</td><td>\\n\\n_(Optional)_ Protection against cross-site request forgery (CSRF) attacks.\\n\\nWhen `true`<!-- -->, for every incoming POST, PUT, PATCH, or DELETE form submissions, the request origin is checked to match the server's origin. `lax-proto` is for SSL-terminating proxies\\n\\nBe careful when disabling this option as it may lead to CSRF attacks.\\n\\nDefaults to `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[qwikCityPlan](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nQwikCityPlan\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[render](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRender\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.serverrenderoptions.md\"\n    },\n    {\n      \"name\": \"ServerRequestEvent\",\n      \"id\": \"serverrequestevent\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerRequestEvent\",\n          \"id\": \"serverrequestevent\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"Request event created by the server.\\n\\n\\n```typescript\\nexport interface ServerRequestEvent<T = unknown> \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[env](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[EnvGetter](#envgetter)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getClientConn](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; [ClientConn](#clientconn)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getWritableStream](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[ServerResponseHandler](#serverresponsehandler)<!-- -->&lt;T&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[locale](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mode](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[ServerRequestMode](#serverrequestmode)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[platform](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nQwikCityPlatform\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[request](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRequest\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[url](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nURL\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.serverrequestevent.md\"\n    },\n    {\n      \"name\": \"ServerRequestMode\",\n      \"id\": \"serverrequestmode\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerRequestMode\",\n          \"id\": \"serverrequestmode\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ServerRequestMode = 'dev' | 'static' | 'server';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.serverrequestmode.md\"\n    },\n    {\n      \"name\": \"ServerResponseHandler\",\n      \"id\": \"serverresponsehandler\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerResponseHandler\",\n          \"id\": \"serverresponsehandler\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type ServerResponseHandler<T = any> = (status: number, headers: Headers, cookies: Cookie, resolve: (response: T) => void, requestEv: RequestEventInternal) => WritableStream<Uint8Array>;\\n```\\n**References:** [Cookie](#cookie)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts\",\n      \"mdFile\": \"qwik-city.serverresponsehandler.md\"\n    },\n    {\n      \"name\": \"set\",\n      \"id\": \"cookie-set\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Cookie\",\n          \"id\": \"cookie-set\"\n        },\n        {\n          \"name\": \"set\",\n          \"id\": \"cookie-set\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Sets a `Response` cookie header using the `Set-Cookie` header.\\n\\n\\n```typescript\\nset(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nname\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nvalue\\n\\n\\n</td><td>\\n\\nstring \\\\| number \\\\| Record&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\noptions\\n\\n\\n</td><td>\\n\\n[CookieOptions](#cookieoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nvoid\",\n      \"mdFile\": \"qwik-city.cookie.set.md\"\n    },\n    {\n      \"name\": \"status\",\n      \"id\": \"servererror-status\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerError\",\n          \"id\": \"servererror-status\"\n        },\n        {\n          \"name\": \"status\",\n          \"id\": \"servererror-status\"\n        }\n      ],\n      \"kind\": \"Property\",\n      \"content\": \"```typescript\\nstatus: number;\\n```\",\n      \"mdFile\": \"qwik-city.servererror.status.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-request-handler/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/request-handler API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/request-handler\n\n<h2 id=\"abortmessage\">AbortMessage</h2>\n\n```typescript\nexport declare class AbortMessage\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/redirect-handler.ts)\n\n<h2 id=\"cookie-append\">append</h2>\n\nAppends a `Response` cookie header using the `Set-Cookie` header.\n\nThe difference between `set()` and `append()` is that if the specified header already exists, `set()` will overwrite the existing value with the new one, whereas `append()` will append the new value onto the end of the set of values.\n\n```typescript\nappend(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nname\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nvalue\n\n</td><td>\n\nstring \\| number \\| Record&lt;string, any&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\noptions\n\n</td><td>\n\n[CookieOptions](#cookieoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n<h2 id=\"cachecontrol\">CacheControl</h2>\n\n```typescript\nexport type CacheControl =\n  | CacheControlOptions\n  | number\n  | \"day\"\n  | \"week\"\n  | \"month\"\n  | \"year\"\n  | \"no-cache\"\n  | \"immutable\"\n  | \"private\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"clientconn\">ClientConn</h2>\n\n```typescript\nexport interface ClientConn\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[country?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[ip?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"cookie\">Cookie</h2>\n\n```typescript\nexport interface Cookie\n```\n\n<table><thead><tr><th>\n\nMethod\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[append(name, value, options)](#cookie-append)\n\n</td><td>\n\nAppends a `Response` cookie header using the `Set-Cookie` header.\n\nThe difference between `set()` and `append()` is that if the specified header already exists, `set()` will overwrite the existing value with the new one, whereas `append()` will append the new value onto the end of the set of values.\n\n</td></tr>\n<tr><td>\n\n[delete(name, options)](#cookie-delete)\n\n</td><td>\n\nDeletes cookie value by name using the `Response` cookie header.\n\n</td></tr>\n<tr><td>\n\n[get(name)](#cookie-get)\n\n</td><td>\n\nGets a `Request` cookie header value by name.\n\n</td></tr>\n<tr><td>\n\n[getAll()](#cookie-getall)\n\n</td><td>\n\nGets all `Request` cookie headers.\n\n</td></tr>\n<tr><td>\n\n[has(name)](#cookie-has)\n\n</td><td>\n\nChecks if the `Request` cookie header name exists.\n\n</td></tr>\n<tr><td>\n\n[headers()](#cookie-headers)\n\n</td><td>\n\nReturns an array of all the set `Response` `Set-Cookie` header values.\n\n</td></tr>\n<tr><td>\n\n[set(name, value, options)](#cookie-set)\n\n</td><td>\n\nSets a `Response` cookie header using the `Set-Cookie` header.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"cookieoptions\">CookieOptions</h2>\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie\n\n```typescript\nexport interface CookieOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[domain?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ Defines the host to which the cookie will be sent. If omitted, this attribute defaults to the host of the current document URL, not including subdomains.\n\n</td></tr>\n<tr><td>\n\n[expires?](#)\n\n</td><td>\n\n</td><td>\n\nDate \\| string\n\n</td><td>\n\n_(Optional)_ Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. If both `expires` and `maxAge` are set, `maxAge` has precedence.\n\n</td></tr>\n<tr><td>\n\n[httpOnly?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Forbids JavaScript from accessing the cookie, for example, through the `document.cookie` property.\n\n</td></tr>\n<tr><td>\n\n[maxAge?](#)\n\n</td><td>\n\n</td><td>\n\nnumber \\| [number, 'seconds' \\| 'minutes' \\| 'hours' \\| 'days' \\| 'weeks']\n\n</td><td>\n\n_(Optional)_ Indicates the number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately. If both `expires` and `maxAge` are set, `maxAge` has precedence. You can also use the array syntax to set the max-age using minutes, hours, days or weeks. For example, `{ maxAge: [3, \"days\"] }` would set the cookie to expire in 3 days.\n\n</td></tr>\n<tr><td>\n\n[path?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ Indicates the path that must exist in the requested URL for the browser to send the Cookie header.\n\n</td></tr>\n<tr><td>\n\n[sameSite?](#)\n\n</td><td>\n\n</td><td>\n\n'strict' \\| 'lax' \\| 'none' \\| 'Strict' \\| 'Lax' \\| 'None' \\| boolean\n\n</td><td>\n\n_(Optional)_ Controls whether or not a cookie is sent with cross-site requests, providing some protection against cross-site request forgery attacks (CSRF).\n\n</td></tr>\n<tr><td>\n\n[secure?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Indicates that the cookie is sent to the server only when a request is made with the `https:` scheme (except on localhost)\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"cookievalue\">CookieValue</h2>\n\n```typescript\nexport interface CookieValue\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[json](#)\n\n</td><td>\n\n</td><td>\n\n&lt;T = unknown&gt;() =&gt; T\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[number](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; number\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[value](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"servererror-data\">data</h2>\n\n```typescript\ndata: T;\n```\n\n<h2 id=\"deferreturn\">DeferReturn</h2>\n\n```typescript\nexport type DeferReturn<T> = () => Promise<T>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"cookie-delete\">delete</h2>\n\nDeletes cookie value by name using the `Response` cookie header.\n\n```typescript\ndelete(name: string, options?: Pick<CookieOptions, 'path' | 'domain' | 'sameSite'>): void;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nname\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\noptions\n\n</td><td>\n\nPick&lt;[CookieOptions](#cookieoptions), 'path' \\| 'domain' \\| 'sameSite'&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n<h2 id=\"envgetter\">EnvGetter</h2>\n\n```typescript\nexport interface EnvGetter\n```\n\n<table><thead><tr><th>\n\nMethod\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[get(key)](#)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"cookie-get\">get</h2>\n\nGets a `Request` cookie header value by name.\n\n```typescript\nget(name: string): CookieValue | null;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nname\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[CookieValue](#cookievalue) \\| null\n\n<h2 id=\"cookie-getall\">getAll</h2>\n\nGets all `Request` cookie headers.\n\n```typescript\ngetAll(): Record<string, CookieValue>;\n```\n\n**Returns:**\n\nRecord&lt;string, [CookieValue](#cookievalue)&gt;\n\n<h2 id=\"geterrorhtml\">getErrorHtml</h2>\n\n```typescript\nexport declare function getErrorHtml(status: number, e: any): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nstatus\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\ne\n\n</td><td>\n\nany\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/error-handler.ts)\n\n<h2 id=\"cookie-has\">has</h2>\n\nChecks if the `Request` cookie header name exists.\n\n```typescript\nhas(name: string): boolean;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nname\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nboolean\n\n<h2 id=\"cookie-headers\">headers</h2>\n\nReturns an array of all the set `Response` `Set-Cookie` header values.\n\n```typescript\nheaders(): string[];\n```\n\n**Returns:**\n\nstring[]\n\n<h2 id=\"mergeheaderscookies\">mergeHeadersCookies</h2>\n\n```typescript\nmergeHeadersCookies: (headers: Headers, cookies: CookieInterface) => Headers;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nheaders\n\n</td><td>\n\nHeaders\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\ncookies\n\n</td><td>\n\n[CookieInterface](#cookie)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nHeaders\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/cookie.ts)\n\n<h2 id=\"rewritemessage-pathname\">pathname</h2>\n\n```typescript\nreadonly pathname: string;\n```\n\n<h2 id=\"redirectmessage\">RedirectMessage</h2>\n\n```typescript\nexport declare class RedirectMessage extends AbortMessage\n```\n\n**Extends:** [AbortMessage](#abortmessage)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/redirect-handler.ts)\n\n<h2 id=\"requestevent\">RequestEvent</h2>\n\n```typescript\nexport interface RequestEvent<PLATFORM = QwikCityPlatform> extends RequestEventCommon<PLATFORM>\n```\n\n**Extends:** [RequestEventCommon](#requesteventcommon)&lt;PLATFORM&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[exited](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\nTrue if the middleware chain has finished executing.\n\n</td></tr>\n<tr><td>\n\n[getWritableStream](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n() =&gt; WritableStream&lt;Uint8Array&gt;\n\n</td><td>\n\nLow-level access to write to the HTTP response stream. Once `getWritableStream()` is called, the status and headers can no longer be modified and will be sent over the network.\n\n</td></tr>\n<tr><td>\n\n[headersSent](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nboolean\n\n</td><td>\n\nTrue if headers have been sent, preventing any more headers from being set.\n\n</td></tr>\n<tr><td>\n\n[next](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n() =&gt; Promise&lt;void&gt;\n\n</td><td>\n\nInvoke the next middleware function in the chain.\n\nNOTE: Ensure that the call to `next()` is `await`ed.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"requesteventaction\">RequestEventAction</h2>\n\n```typescript\nexport interface RequestEventAction<PLATFORM = QwikCityPlatform> extends RequestEventCommon<PLATFORM>\n```\n\n**Extends:** [RequestEventCommon](#requesteventcommon)&lt;PLATFORM&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[fail](#)\n\n</td><td>\n\n</td><td>\n\n&lt;T extends Record&lt;string, any&gt;&gt;(status: number, returnData: T) =&gt; FailReturn&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"requesteventbase\">RequestEventBase</h2>\n\n```typescript\nexport interface RequestEventBase<PLATFORM = QwikCityPlatform>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[basePathname](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\nThe base pathname of the request, which can be configured at build time. Defaults to `/`.\n\n</td></tr>\n<tr><td>\n\n[cacheControl](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(cacheControl: [CacheControl](#cachecontrol), target?: CacheControlTarget) =&gt; void\n\n</td><td>\n\nConvenience method to set the Cache-Control header. Depending on your CDN, you may want to add another cacheControl with the second argument set to `CDN-Cache-Control` or any other value (we provide the most common values for auto-complete, but you can use any string you want).\n\nSee https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control and https://qwik.dev/docs/caching/\\#CDN-Cache-Controls for more information.\n\n</td></tr>\n<tr><td>\n\n[clientConn](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[ClientConn](#clientconn)\n\n</td><td>\n\nProvides information about the client connection, such as the IP address and the country the request originated from.\n\n</td></tr>\n<tr><td>\n\n[cookie](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[Cookie](#cookie)\n\n</td><td>\n\nHTTP request and response cookie. Use the `get()` method to retrieve a request cookie value. Use the `set()` method to set a response cookie value.\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies\n\n</td></tr>\n<tr><td>\n\n[env](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[EnvGetter](#envgetter)\n\n</td><td>\n\nPlatform provided environment variables.\n\n</td></tr>\n<tr><td>\n\n[headers](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nHeaders\n\n</td><td>\n\nHTTP response headers. Notice it will be empty until you first add a header. If you want to read the request headers, use `request.headers` instead.\n\nhttps://developer.mozilla.org/en-US/docs/Glossary/Response\\_header\n\n</td></tr>\n<tr><td>\n\n[method](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\nHTTP request method.\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Methods\n\n</td></tr>\n<tr><td>\n\n[originalUrl](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nURL\n\n</td><td>\n\nThe original HTTP request URL.\n\nThis property was introduced to support the rewrite feature.\n\nIf rewrite is called, the url property will be changed to the rewritten url. while originalUrl will stay the same(e.g the url inserted to the address bar).\n\nIf rewrite is never called as part of the request, the url property and the originalUrl are equal.\n\n</td></tr>\n<tr><td>\n\n[params](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nReadonly&lt;Record&lt;string, string&gt;&gt;\n\n</td><td>\n\nURL path params which have been parsed from the current url pathname segments. Use `query` to instead retrieve the query string search params.\n\n</td></tr>\n<tr><td>\n\n[parseBody](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n() =&gt; Promise&lt;unknown&gt;\n\n</td><td>\n\nThis method will check the request headers for a `Content-Type` header and parse the body accordingly. It supports `application/json`, `application/x-www-form-urlencoded`, and `multipart/form-data` content types.\n\nIf the `Content-Type` header is not set, it will return `null`.\n\n</td></tr>\n<tr><td>\n\n[pathname](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\nURL pathname. Does not include the protocol, domain, query string (search params) or hash.\n\nhttps://developer.mozilla.org/en-US/docs/Web/API/URL/pathname\n\n</td></tr>\n<tr><td>\n\n[platform](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nPLATFORM\n\n</td><td>\n\nPlatform specific data and functions\n\n</td></tr>\n<tr><td>\n\n[query](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nURLSearchParams\n\n</td><td>\n\nURL Query Strings (URL Search Params). Use `params` to instead retrieve the route params found in the url pathname.\n\nhttps://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n\n</td></tr>\n<tr><td>\n\n[request](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nRequest\n\n</td><td>\n\nHTTP request information.\n\n</td></tr>\n<tr><td>\n\n[sharedMap](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nMap&lt;string, any&gt;\n\n</td><td>\n\nShared Map across all the request handlers. Every HTTP request will get a new instance of the shared map. The shared map is useful for sharing data between request handlers.\n\n</td></tr>\n<tr><td>\n\n[signal](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nAbortSignal\n\n</td><td>\n\nRequest's AbortSignal (same as `request.signal`). This signal indicates that the request has been aborted.\n\n</td></tr>\n<tr><td>\n\n[url](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nURL\n\n</td><td>\n\nHTTP request URL.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"requesteventcommon\">RequestEventCommon</h2>\n\n```typescript\nexport interface RequestEventCommon<PLATFORM = QwikCityPlatform> extends RequestEventBase<PLATFORM>\n```\n\n**Extends:** [RequestEventBase](#requesteventbase)&lt;PLATFORM&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[error](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n&lt;T = any&gt;(statusCode: ErrorCodes, message: T) =&gt; [ServerError](#servererror)&lt;T&gt;\n\n</td><td>\n\nWhen called, the response will immediately end with the given status code. This could be useful to end a response with `404`, and use the 404 handler in the routes directory. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status for which status code should be used.\n\n</td></tr>\n<tr><td>\n\n[exit](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n() =&gt; [AbortMessage](#abortmessage)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[html](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(statusCode: StatusCodes, html: string) =&gt; [AbortMessage](#abortmessage)\n\n</td><td>\n\nConvenience method to send an HTML body response. The response will be automatically set the `Content-Type` header to`text/html; charset=utf-8`. An `html()` response can only be called once.\n\n</td></tr>\n<tr><td>\n\n[json](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(statusCode: StatusCodes, data: any) =&gt; [AbortMessage](#abortmessage)\n\n</td><td>\n\nConvenience method to JSON stringify the data and send it in the response. The response will be automatically set the `Content-Type` header to `application/json; charset=utf-8`. A `json()` response can only be called once.\n\n</td></tr>\n<tr><td>\n\n[locale](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(local?: string) =&gt; string\n\n</td><td>\n\nWhich locale the content is in.\n\nThe locale value can be retrieved from selected methods using `getLocale()`:\n\n</td></tr>\n<tr><td>\n\n[redirect](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(statusCode: RedirectCode, url: string) =&gt; [RedirectMessage](#redirectmessage)\n\n</td><td>\n\nURL to redirect to. When called, the response will immediately end with the correct redirect status and headers.\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections\n\n</td></tr>\n<tr><td>\n\n[rewrite](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(pathname: string) =&gt; [RewriteMessage](#rewritemessage)\n\n</td><td>\n\nWhen called, qwik-city will execute the path's matching route flow.\n\nThe url in the browser will remain unchanged.\n\n</td></tr>\n<tr><td>\n\n[send](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nSendMethod\n\n</td><td>\n\nSend a body response. The `Content-Type` response header is not automatically set when using `send()` and must be set manually. A `send()` response can only be called once.\n\n</td></tr>\n<tr><td>\n\n[status](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(statusCode?: StatusCodes) =&gt; number\n\n</td><td>\n\nHTTP response status code. Sets the status code when called with an argument. Always returns the status code, so calling `status()` without an argument will can be used to return the current status code.\n\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n\n</td></tr>\n<tr><td>\n\n[text](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n(statusCode: StatusCodes, text: string) =&gt; [AbortMessage](#abortmessage)\n\n</td><td>\n\nConvenience method to send an text body response. The response will be automatically set the `Content-Type` header to`text/plain; charset=utf-8`. An `text()` response can only be called once.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"requesteventloader\">RequestEventLoader</h2>\n\n```typescript\nexport interface RequestEventLoader<PLATFORM = QwikCityPlatform> extends RequestEventAction<PLATFORM>\n```\n\n**Extends:** [RequestEventAction](#requesteventaction)&lt;PLATFORM&gt;\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[defer](#)\n\n</td><td>\n\n</td><td>\n\n&lt;T&gt;(returnData: Promise&lt;T&gt; \\| (() =&gt; Promise&lt;T&gt;)) =&gt; [DeferReturn](#deferreturn)&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[resolveValue](#)\n\n</td><td>\n\n</td><td>\n\n[ResolveValue](#resolvevalue)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"requesthandler-function\">requestHandler</h2>\n\n```typescript\nexport type RequestHandler<PLATFORM = QwikCityPlatform> = (\n  ev: RequestEvent<PLATFORM>,\n) => Promise<void> | void;\n```\n\n**References:** [RequestEvent](#requestevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/request-handler.ts)\n\n<h2 id=\"requesthandler-type-alias\">RequestHandler</h2>\n\n```typescript\nexport type RequestHandler<PLATFORM = QwikCityPlatform> = (\n  ev: RequestEvent<PLATFORM>,\n) => Promise<void> | void;\n```\n\n**References:** [RequestEvent](#requestevent)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"resolvesyncvalue\">ResolveSyncValue</h2>\n\n```typescript\nexport interface ResolveSyncValue\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"resolvevalue\">ResolveValue</h2>\n\n```typescript\nexport interface ResolveValue\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"rewritemessage\">RewriteMessage</h2>\n\n```typescript\nexport declare class RewriteMessage extends AbortMessage\n```\n\n**Extends:** [AbortMessage](#abortmessage)\n\n<table><thead><tr><th>\n\nConstructor\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[(constructor)(pathname)](#)\n\n</td><td>\n\n</td><td>\n\nConstructs a new instance of the `RewriteMessage` class\n\n</td></tr>\n</tbody></table>\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[pathname](#rewritemessage-pathname)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/rewrite-handler.ts)\n\n<h2 id=\"servererror\">ServerError</h2>\n\n```typescript\nexport declare class ServerError<T = any> extends Error\n```\n\n**Extends:** Error\n\n<table><thead><tr><th>\n\nConstructor\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[(constructor)(status, data)](#)\n\n</td><td>\n\n</td><td>\n\nConstructs a new instance of the `ServerError` class\n\n</td></tr>\n</tbody></table>\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[data](#servererror-data)\n\n</td><td>\n\n</td><td>\n\nT\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[status](#servererror-status)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/server-error.ts)\n\n<h2 id=\"serverrenderoptions\">ServerRenderOptions</h2>\n\n```typescript\nexport interface ServerRenderOptions extends RenderOptions\n```\n\n**Extends:** RenderOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[checkOrigin?](#)\n\n</td><td>\n\n</td><td>\n\nboolean \\| 'lax-proto'\n\n</td><td>\n\n_(Optional)_ Protection against cross-site request forgery (CSRF) attacks.\n\nWhen `true`, for every incoming POST, PUT, PATCH, or DELETE form submissions, the request origin is checked to match the server's origin. `lax-proto` is for SSL-terminating proxies\n\nBe careful when disabling this option as it may lead to CSRF attacks.\n\nDefaults to `true`.\n\n</td></tr>\n<tr><td>\n\n[qwikCityPlan](#)\n\n</td><td>\n\n</td><td>\n\nQwikCityPlan\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[render](#)\n\n</td><td>\n\n</td><td>\n\nRender\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"serverrequestevent\">ServerRequestEvent</h2>\n\nRequest event created by the server.\n\n```typescript\nexport interface ServerRequestEvent<T = unknown>\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[env](#)\n\n</td><td>\n\n</td><td>\n\n[EnvGetter](#envgetter)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getClientConn](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; [ClientConn](#clientconn)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getWritableStream](#)\n\n</td><td>\n\n</td><td>\n\n[ServerResponseHandler](#serverresponsehandler)&lt;T&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[locale](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[mode](#)\n\n</td><td>\n\n</td><td>\n\n[ServerRequestMode](#serverrequestmode)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[platform](#)\n\n</td><td>\n\n</td><td>\n\nQwikCityPlatform\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[request](#)\n\n</td><td>\n\n</td><td>\n\nRequest\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[url](#)\n\n</td><td>\n\n</td><td>\n\nURL\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"serverrequestmode\">ServerRequestMode</h2>\n\n```typescript\nexport type ServerRequestMode = \"dev\" | \"static\" | \"server\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"serverresponsehandler\">ServerResponseHandler</h2>\n\n```typescript\nexport type ServerResponseHandler<T = any> = (\n  status: number,\n  headers: Headers,\n  cookies: Cookie,\n  resolve: (response: T) => void,\n  requestEv: RequestEventInternal,\n) => WritableStream<Uint8Array>;\n```\n\n**References:** [Cookie](#cookie)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/request-handler/types.ts)\n\n<h2 id=\"cookie-set\">set</h2>\n\nSets a `Response` cookie header using the `Set-Cookie` header.\n\n```typescript\nset(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nname\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nvalue\n\n</td><td>\n\nstring \\| number \\| Record&lt;string, any&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\noptions\n\n</td><td>\n\n[CookieOptions](#cookieoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nvoid\n\n<h2 id=\"servererror-status\">status</h2>\n\n```typescript\nstatus: number;\n```\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-vercel-edge/api.json",
    "content": "{\n  \"id\": \"qwik-city-middleware-vercel-edge\",\n  \"package\": \"@builder.io/qwik-city/middleware/vercel-edge\",\n  \"members\": [\n    {\n      \"name\": \"createQwikCity\",\n      \"id\": \"createqwikcity\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createQwikCity\",\n          \"id\": \"createqwikcity\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function createQwikCity(opts: QwikCityVercelEdgeOptions): (request: Request) => Promise<Response>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[QwikCityVercelEdgeOptions](#qwikcityverceledgeoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n(request: Request) =&gt; Promise&lt;Response&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/vercel-edge/index.ts\",\n      \"mdFile\": \"qwik-city.createqwikcity.md\"\n    },\n    {\n      \"name\": \"PlatformVercel\",\n      \"id\": \"platformvercel\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PlatformVercel\",\n          \"id\": \"platformvercel\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PlatformVercel \\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/vercel-edge/index.ts\",\n      \"mdFile\": \"qwik-city.platformvercel.md\"\n    },\n    {\n      \"name\": \"QwikCityVercelEdgeOptions\",\n      \"id\": \"qwikcityverceledgeoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikCityVercelEdgeOptions\",\n          \"id\": \"qwikcityverceledgeoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikCityVercelEdgeOptions extends ServerRenderOptions \\n```\\n**Extends:** ServerRenderOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/vercel-edge/index.ts\",\n      \"mdFile\": \"qwik-city.qwikcityverceledgeoptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-middleware-vercel-edge/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/middleware/vercel-edge API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/middleware/vercel-edge\n\n<h2 id=\"createqwikcity\">createQwikCity</h2>\n\n```typescript\nexport declare function createQwikCity(\n  opts: QwikCityVercelEdgeOptions,\n): (request: Request) => Promise<Response>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[QwikCityVercelEdgeOptions](#qwikcityverceledgeoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n(request: Request) =&gt; Promise&lt;Response&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/vercel-edge/index.ts)\n\n<h2 id=\"platformvercel\">PlatformVercel</h2>\n\n```typescript\nexport interface PlatformVercel\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/vercel-edge/index.ts)\n\n<h2 id=\"qwikcityverceledgeoptions\">QwikCityVercelEdgeOptions</h2>\n\n```typescript\nexport interface QwikCityVercelEdgeOptions extends ServerRenderOptions\n```\n\n**Extends:** ServerRenderOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/vercel-edge/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-static/api.json",
    "content": "{\n  \"id\": \"qwik-city-static\",\n  \"package\": \"@builder.io/qwik-city/static\",\n  \"members\": [\n    {\n      \"name\": \"generate\",\n      \"id\": \"generate\",\n      \"hierarchy\": [\n        {\n          \"name\": \"generate\",\n          \"id\": \"generate\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Use this function when SSG should be generated from another module, such as a Vite plugin. This function's should be passed the paths of the entry module and Qwik City Plan.\\n\\n\\n```typescript\\nexport declare function generate(opts: StaticGenerateOptions): Promise<StaticGenerateResult>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[StaticGenerateOptions](#staticgenerateoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nPromise&lt;[StaticGenerateResult](#staticgenerateresult)<!-- -->&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/index.ts\",\n      \"mdFile\": \"qwik-city.generate.md\"\n    },\n    {\n      \"name\": \"StaticGenerateOptions\",\n      \"id\": \"staticgenerateoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StaticGenerateOptions\",\n          \"id\": \"staticgenerateoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface StaticGenerateOptions extends StaticGenerateRenderOptions \\n```\\n**Extends:** [StaticGenerateRenderOptions](#staticgeneraterenderoptions)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[basePathname?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defaults to `/`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[qwikCityPlanModulePath](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nPath to the Qwik City Plan module exporting the default `@qwik-city-plan`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[renderModulePath](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nPath to the SSR module exporting the default render function. In most cases it'll be `./src/entry.ssr.tsx`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rootDir?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/types.ts\",\n      \"mdFile\": \"qwik-city.staticgenerateoptions.md\"\n    },\n    {\n      \"name\": \"StaticGenerateRenderOptions\",\n      \"id\": \"staticgeneraterenderoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StaticGenerateRenderOptions\",\n          \"id\": \"staticgeneraterenderoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface StaticGenerateRenderOptions extends RenderOptions \\n```\\n**Extends:** RenderOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[emit404Pages?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Set to `false` if the static build should not write custom or default `404.html` pages. Defaults to `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[emitData?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Set to `false` if the generated `q-data.json` data files should not be written to disk. Defaults to `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[emitHtml?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Set to `false` if the generated static HTML files should not be written to disk. Setting to `false` is useful if the SSG should only write the `q-data.json` files to disk. Defaults to `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[exclude?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines file system routes relative to the source `routes` directory that should not be static generated. Accepts wildcard behavior. This should not include the \\\"base\\\" pathname. `exclude` always takes priority over `include`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[include?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defines file system routes relative to the source `routes` directory that should be static generated. Accepts wildcard behavior. This should not include the \\\"base\\\" pathname. If not provided, all routes will be static generated. `exclude` always takes priority over `include`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[log?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'debug'\\n\\n\\n</td><td>\\n\\n_(Optional)_ Log level.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[maxTasksPerWorker?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ Maximum number of tasks to be running at one time per worker. Defaults to `20`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[maxWorkers?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ Maximum number of workers to use while generating the static pages. Defaults to the number of CPUs available.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[origin](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nThe URL `origin`<!-- -->, which is a combination of the scheme (protocol) and hostname (domain). For example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`<!-- -->. However, the `origin` does not include a `pathname`<!-- -->.\\n\\nThe `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate a complete URL rather than just the `pathname`<!-- -->. For example, in order to render a correct canonical tag URL or URLs within the `sitemap.xml`<!-- -->, the `origin` must be provided too.\\n\\nIf the site also starts with a pathname other than `/`<!-- -->, please use the `basePathname` option in the Qwik City config options.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[outDir](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nFile system directory where the static files should be written.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sitemapOutFile?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_ File system path to write the `sitemap.xml` to. Defaults to `sitemap.xml` and written to the root of the `outDir`<!-- -->. Setting to `null` will prevent the sitemap from being created.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/types.ts\",\n      \"mdFile\": \"qwik-city.staticgeneraterenderoptions.md\"\n    },\n    {\n      \"name\": \"StaticGenerateResult\",\n      \"id\": \"staticgenerateresult\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StaticGenerateResult\",\n          \"id\": \"staticgenerateresult\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface StaticGenerateResult \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[duration](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[errors](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rendered](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[staticPaths](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/types.ts\",\n      \"mdFile\": \"qwik-city.staticgenerateresult.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-static/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/static API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/static\n\n<h2 id=\"generate\">generate</h2>\n\nUse this function when SSG should be generated from another module, such as a Vite plugin. This function's should be passed the paths of the entry module and Qwik City Plan.\n\n```typescript\nexport declare function generate(\n  opts: StaticGenerateOptions,\n): Promise<StaticGenerateResult>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[StaticGenerateOptions](#staticgenerateoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;[StaticGenerateResult](#staticgenerateresult)&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/index.ts)\n\n<h2 id=\"staticgenerateoptions\">StaticGenerateOptions</h2>\n\n```typescript\nexport interface StaticGenerateOptions extends StaticGenerateRenderOptions\n```\n\n**Extends:** [StaticGenerateRenderOptions](#staticgeneraterenderoptions)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[basePathname?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ Defaults to `/`\n\n</td></tr>\n<tr><td>\n\n[qwikCityPlanModulePath](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\nPath to the Qwik City Plan module exporting the default `@qwik-city-plan`.\n\n</td></tr>\n<tr><td>\n\n[renderModulePath](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\nPath to the SSR module exporting the default render function. In most cases it'll be `./src/entry.ssr.tsx`.\n\n</td></tr>\n<tr><td>\n\n[rootDir?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/types.ts)\n\n<h2 id=\"staticgeneraterenderoptions\">StaticGenerateRenderOptions</h2>\n\n```typescript\nexport interface StaticGenerateRenderOptions extends RenderOptions\n```\n\n**Extends:** RenderOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[emit404Pages?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Set to `false` if the static build should not write custom or default `404.html` pages. Defaults to `true`.\n\n</td></tr>\n<tr><td>\n\n[emitData?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Set to `false` if the generated `q-data.json` data files should not be written to disk. Defaults to `true`.\n\n</td></tr>\n<tr><td>\n\n[emitHtml?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Set to `false` if the generated static HTML files should not be written to disk. Setting to `false` is useful if the SSG should only write the `q-data.json` files to disk. Defaults to `true`.\n\n</td></tr>\n<tr><td>\n\n[exclude?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Defines file system routes relative to the source `routes` directory that should not be static generated. Accepts wildcard behavior. This should not include the \"base\" pathname. `exclude` always takes priority over `include`.\n\n</td></tr>\n<tr><td>\n\n[include?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Defines file system routes relative to the source `routes` directory that should be static generated. Accepts wildcard behavior. This should not include the \"base\" pathname. If not provided, all routes will be static generated. `exclude` always takes priority over `include`.\n\n</td></tr>\n<tr><td>\n\n[log?](#)\n\n</td><td>\n\n</td><td>\n\n'debug'\n\n</td><td>\n\n_(Optional)_ Log level.\n\n</td></tr>\n<tr><td>\n\n[maxTasksPerWorker?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ Maximum number of tasks to be running at one time per worker. Defaults to `20`.\n\n</td></tr>\n<tr><td>\n\n[maxWorkers?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ Maximum number of workers to use while generating the static pages. Defaults to the number of CPUs available.\n\n</td></tr>\n<tr><td>\n\n[origin](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\nThe URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the `origin` does not include a `pathname`.\n\nThe `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate a complete URL rather than just the `pathname`. For example, in order to render a correct canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.\n\nIf the site also starts with a pathname other than `/`, please use the `basePathname` option in the Qwik City config options.\n\n</td></tr>\n<tr><td>\n\n[outDir](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\nFile system directory where the static files should be written.\n\n</td></tr>\n<tr><td>\n\n[sitemapOutFile?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n_(Optional)_ File system path to write the `sitemap.xml` to. Defaults to `sitemap.xml` and written to the root of the `outDir`. Setting to `null` will prevent the sitemap from being created.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/types.ts)\n\n<h2 id=\"staticgenerateresult\">StaticGenerateResult</h2>\n\n```typescript\nexport interface StaticGenerateResult\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[duration](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[errors](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[rendered](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[staticPaths](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/static/types.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-azure-swa/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-azure-swa\",\n  \"package\": \"@builder.io/qwik-city/vite/azure-swa\",\n  \"members\": [\n    {\n      \"name\": \"azureSwaAdapter\",\n      \"id\": \"azureswaadapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"azureSwaAdapter\",\n          \"id\": \"azureswaadapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function azureSwaAdapter(opts?: AzureSwaAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[AzureSwaAdapterOptions](#azureswaadapteroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/azure-swa/vite/index.ts\",\n      \"mdFile\": \"qwik-city.azureswaadapter.md\"\n    },\n    {\n      \"name\": \"AzureSwaAdapterOptions\",\n      \"id\": \"azureswaadapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"AzureSwaAdapterOptions\",\n          \"id\": \"azureswaadapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface AzureSwaAdapterOptions extends ServerAdapterOptions \\n```\\n**Extends:** ServerAdapterOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/azure-swa/vite/index.ts\",\n      \"mdFile\": \"qwik-city.azureswaadapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-azure-swa/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/azure-swa API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/azure-swa\n\n<h2 id=\"azureswaadapter\">azureSwaAdapter</h2>\n\n```typescript\nexport declare function azureSwaAdapter(opts?: AzureSwaAdapterOptions): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[AzureSwaAdapterOptions](#azureswaadapteroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/azure-swa/vite/index.ts)\n\n<h2 id=\"azureswaadapteroptions\">AzureSwaAdapterOptions</h2>\n\n```typescript\nexport interface AzureSwaAdapterOptions extends ServerAdapterOptions\n```\n\n**Extends:** ServerAdapterOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/azure-swa/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-bun-server/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-bun-server\",\n  \"package\": \"@builder.io/qwik-city/vite/bun-server\",\n  \"members\": [\n    {\n      \"name\": \"bunServerAdapter\",\n      \"id\": \"bunserveradapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"bunServerAdapter\",\n          \"id\": \"bunserveradapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nexport declare function bunServerAdapter(opts?: bunServerAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[bunServerAdapterOptions](#bunserveradapteroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/bun-server/vite/index.ts\",\n      \"mdFile\": \"qwik-city.bunserveradapter.md\"\n    },\n    {\n      \"name\": \"bunServerAdapterOptions\",\n      \"id\": \"bunserveradapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"bunServerAdapterOptions\",\n          \"id\": \"bunserveradapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nexport interface bunServerAdapterOptions extends ServerAdapterOptions \\n```\\n**Extends:** ServerAdapterOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[name?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** _(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/bun-server/vite/index.ts\",\n      \"mdFile\": \"qwik-city.bunserveradapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-bun-server/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/bun-server API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/bun-server\n\n<h2 id=\"bunserveradapter\">bunServerAdapter</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nexport declare function bunServerAdapter(opts?: bunServerAdapterOptions): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[bunServerAdapterOptions](#bunserveradapteroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/bun-server/vite/index.ts)\n\n<h2 id=\"bunserveradapteroptions\">bunServerAdapterOptions</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nexport interface bunServerAdapterOptions extends ServerAdapterOptions\n```\n\n**Extends:** ServerAdapterOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[name?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n**_(ALPHA)_** _(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/bun-server/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-cloud-run/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-cloud-run\",\n  \"package\": \"@builder.io/qwik-city/vite/cloud-run\",\n  \"members\": [\n    {\n      \"name\": \"cloudRunAdapter\",\n      \"id\": \"cloudrunadapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"cloudRunAdapter\",\n          \"id\": \"cloudrunadapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function cloudRunAdapter(opts?: CloudRunAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[CloudRunAdapterOptions](#cloudrunadapteroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloud-run/vite/index.ts\",\n      \"mdFile\": \"qwik-city.cloudrunadapter.md\"\n    },\n    {\n      \"name\": \"CloudRunAdapterOptions\",\n      \"id\": \"cloudrunadapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CloudRunAdapterOptions\",\n          \"id\": \"cloudrunadapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface CloudRunAdapterOptions extends ServerAdapterOptions \\n```\\n**Extends:** ServerAdapterOptions\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloud-run/vite/index.ts\",\n      \"mdFile\": \"qwik-city.cloudrunadapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-cloud-run/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/cloud-run API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/cloud-run\n\n<h2 id=\"cloudrunadapter\">cloudRunAdapter</h2>\n\n```typescript\nexport declare function cloudRunAdapter(opts?: CloudRunAdapterOptions): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[CloudRunAdapterOptions](#cloudrunadapteroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloud-run/vite/index.ts)\n\n<h2 id=\"cloudrunadapteroptions\">CloudRunAdapterOptions</h2>\n\n```typescript\nexport interface CloudRunAdapterOptions extends ServerAdapterOptions\n```\n\n**Extends:** ServerAdapterOptions\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloud-run/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-cloudflare-pages/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-cloudflare-pages\",\n  \"package\": \"@builder.io/qwik-city/vite/cloudflare-pages\",\n  \"members\": [\n    {\n      \"name\": \"cloudflarePagesAdapter\",\n      \"id\": \"cloudflarepagesadapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"cloudflarePagesAdapter\",\n          \"id\": \"cloudflarepagesadapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function cloudflarePagesAdapter(opts?: CloudflarePagesAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[CloudflarePagesAdapterOptions](#cloudflarepagesadapteroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloudflare-pages/vite/index.ts\",\n      \"mdFile\": \"qwik-city.cloudflarepagesadapter.md\"\n    },\n    {\n      \"name\": \"CloudflarePagesAdapterOptions\",\n      \"id\": \"cloudflarepagesadapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"CloudflarePagesAdapterOptions\",\n          \"id\": \"cloudflarepagesadapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface CloudflarePagesAdapterOptions extends ServerAdapterOptions \\n```\\n**Extends:** ServerAdapterOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[functionRoutes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Determines if the build should generate the function invocation routes `_routes.json` file.\\n\\nhttps://developers.cloudflare.com/pages/platform/functions/routing/\\\\#functions-invocation-routes\\n\\nDefaults to `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[staticPaths?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Manually add pathnames that should be treated as static paths and not SSR. For example, when these pathnames are requested, their response should come from a static file, rather than a server-side rendered response.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloudflare-pages/vite/index.ts\",\n      \"mdFile\": \"qwik-city.cloudflarepagesadapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-cloudflare-pages/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/cloudflare-pages API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/cloudflare-pages\n\n<h2 id=\"cloudflarepagesadapter\">cloudflarePagesAdapter</h2>\n\n```typescript\nexport declare function cloudflarePagesAdapter(\n  opts?: CloudflarePagesAdapterOptions,\n): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[CloudflarePagesAdapterOptions](#cloudflarepagesadapteroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloudflare-pages/vite/index.ts)\n\n<h2 id=\"cloudflarepagesadapteroptions\">CloudflarePagesAdapterOptions</h2>\n\n```typescript\nexport interface CloudflarePagesAdapterOptions extends ServerAdapterOptions\n```\n\n**Extends:** ServerAdapterOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[functionRoutes?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Determines if the build should generate the function invocation routes `_routes.json` file.\n\nhttps://developers.cloudflare.com/pages/platform/functions/routing/\\#functions-invocation-routes\n\nDefaults to `true`.\n\n</td></tr>\n<tr><td>\n\n[staticPaths?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Manually add pathnames that should be treated as static paths and not SSR. For example, when these pathnames are requested, their response should come from a static file, rather than a server-side rendered response.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/cloudflare-pages/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-netlify-edge/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-netlify-edge\",\n  \"package\": \"@builder.io/qwik-city/vite/netlify-edge\",\n  \"members\": [\n    {\n      \"name\": \"netlifyEdgeAdapter\",\n      \"id\": \"netlifyedgeadapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"netlifyEdgeAdapter\",\n          \"id\": \"netlifyedgeadapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function netlifyEdgeAdapter(opts?: NetlifyEdgeAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[NetlifyEdgeAdapterOptions](#netlifyedgeadapteroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/netlify-edge/vite/index.ts\",\n      \"mdFile\": \"qwik-city.netlifyedgeadapter.md\"\n    },\n    {\n      \"name\": \"NetlifyEdgeAdapterOptions\",\n      \"id\": \"netlifyedgeadapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NetlifyEdgeAdapterOptions\",\n          \"id\": \"netlifyedgeadapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface NetlifyEdgeAdapterOptions extends ServerAdapterOptions \\n```\\n**Extends:** ServerAdapterOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[excludedPath?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| string\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Manually add path pattern that should be excluded from the edge function routes that are created by the 'manifest.json' file.\\n\\nIf not specified, the following paths are excluded by default:\\n\\n- /build/\\\\* - /favicon.ico - /robots.txt - /mainifest.json - /\\\\~partytown/\\\\* - /service-worker.js - /sitemap.xml\\n\\nhttps://docs.netlify.com/edge-functions/declarations/\\\\#declare-edge-functions-in-netlify-toml\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[functionRoutes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Determines if the build should generate the edge functions declarations `manifest.json` file.\\n\\nhttps://docs.netlify.com/edge-functions/declarations/\\n\\nDefaults to `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[staticPaths?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Manually add pathnames that should be treated as static paths and not SSR. For example, when these pathnames are requested, their response should come from a static file, rather than a server-side rendered response.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/netlify-edge/vite/index.ts\",\n      \"mdFile\": \"qwik-city.netlifyedgeadapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-netlify-edge/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/netlify-edge API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/netlify-edge\n\n<h2 id=\"netlifyedgeadapter\">netlifyEdgeAdapter</h2>\n\n```typescript\nexport declare function netlifyEdgeAdapter(\n  opts?: NetlifyEdgeAdapterOptions,\n): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[NetlifyEdgeAdapterOptions](#netlifyedgeadapteroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/netlify-edge/vite/index.ts)\n\n<h2 id=\"netlifyedgeadapteroptions\">NetlifyEdgeAdapterOptions</h2>\n\n```typescript\nexport interface NetlifyEdgeAdapterOptions extends ServerAdapterOptions\n```\n\n**Extends:** ServerAdapterOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[excludedPath?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| string[]\n\n</td><td>\n\n_(Optional)_ Manually add path pattern that should be excluded from the edge function routes that are created by the 'manifest.json' file.\n\nIf not specified, the following paths are excluded by default:\n\n- /build/\\* - /favicon.ico - /robots.txt - /mainifest.json - /\\~partytown/\\* - /service-worker.js - /sitemap.xml\n\nhttps://docs.netlify.com/edge-functions/declarations/\\#declare-edge-functions-in-netlify-toml\n\n</td></tr>\n<tr><td>\n\n[functionRoutes?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Determines if the build should generate the edge functions declarations `manifest.json` file.\n\nhttps://docs.netlify.com/edge-functions/declarations/\n\nDefaults to `true`.\n\n</td></tr>\n<tr><td>\n\n[staticPaths?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Manually add pathnames that should be treated as static paths and not SSR. For example, when these pathnames are requested, their response should come from a static file, rather than a server-side rendered response.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/netlify-edge/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-node-server/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-node-server\",\n  \"package\": \"@builder.io/qwik-city/vite/node-server\",\n  \"members\": [\n    {\n      \"name\": \"nodeServerAdapter\",\n      \"id\": \"nodeserveradapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"nodeServerAdapter\",\n          \"id\": \"nodeserveradapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nexport declare function nodeServerAdapter(opts?: NodeServerAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[NodeServerAdapterOptions](#nodeserveradapteroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/node-server/vite/index.ts\",\n      \"mdFile\": \"qwik-city.nodeserveradapter.md\"\n    },\n    {\n      \"name\": \"NodeServerAdapterOptions\",\n      \"id\": \"nodeserveradapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"NodeServerAdapterOptions\",\n          \"id\": \"nodeserveradapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\n\\n\\n```typescript\\nexport interface NodeServerAdapterOptions extends ServerAdapterOptions \\n```\\n**Extends:** ServerAdapterOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[name?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** _(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/node-server/vite/index.ts\",\n      \"mdFile\": \"qwik-city.nodeserveradapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-node-server/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/node-server API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/node-server\n\n<h2 id=\"nodeserveradapter\">nodeServerAdapter</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nexport declare function nodeServerAdapter(opts?: NodeServerAdapterOptions): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[NodeServerAdapterOptions](#nodeserveradapteroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/node-server/vite/index.ts)\n\n<h2 id=\"nodeserveradapteroptions\">NodeServerAdapterOptions</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\n```typescript\nexport interface NodeServerAdapterOptions extends ServerAdapterOptions\n```\n\n**Extends:** ServerAdapterOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[name?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n**_(ALPHA)_** _(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/node-server/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-static/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-static\",\n  \"package\": \"@builder.io/qwik-city/vite/static\",\n  \"members\": [\n    {\n      \"name\": \"staticAdapter\",\n      \"id\": \"staticadapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"staticAdapter\",\n          \"id\": \"staticadapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function staticAdapter(opts: StaticGenerateAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[StaticGenerateAdapterOptions](#staticgenerateadapteroptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/static/vite/index.ts\",\n      \"mdFile\": \"qwik-city.staticadapter.md\"\n    },\n    {\n      \"name\": \"StaticGenerateAdapterOptions\",\n      \"id\": \"staticgenerateadapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StaticGenerateAdapterOptions\",\n          \"id\": \"staticgenerateadapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface StaticGenerateAdapterOptions extends Omit<StaticGenerateRenderOptions, 'outDir'> \\n```\\n**Extends:** Omit&lt;StaticGenerateRenderOptions, 'outDir'&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/static/vite/index.ts\",\n      \"mdFile\": \"qwik-city.staticgenerateadapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-static/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/static API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/static\n\n<h2 id=\"staticadapter\">staticAdapter</h2>\n\n```typescript\nexport declare function staticAdapter(opts: StaticGenerateAdapterOptions): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[StaticGenerateAdapterOptions](#staticgenerateadapteroptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/static/vite/index.ts)\n\n<h2 id=\"staticgenerateadapteroptions\">StaticGenerateAdapterOptions</h2>\n\n```typescript\nexport interface StaticGenerateAdapterOptions extends Omit<StaticGenerateRenderOptions, 'outDir'>\n```\n\n**Extends:** Omit&lt;StaticGenerateRenderOptions, 'outDir'&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/static/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-vercel/api.json",
    "content": "{\n  \"id\": \"qwik-city-vite-vercel\",\n  \"package\": \"@builder.io/qwik-city/vite/vercel\",\n  \"members\": [\n    {\n      \"name\": \"vercelEdgeAdapter\",\n      \"id\": \"verceledgeadapter\",\n      \"hierarchy\": [\n        {\n          \"name\": \"vercelEdgeAdapter\",\n          \"id\": \"verceledgeadapter\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function vercelEdgeAdapter(opts?: VercelEdgeAdapterOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[VercelEdgeAdapterOptions](#verceledgeadapteroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/vercel-edge/vite/index.ts\",\n      \"mdFile\": \"qwik-city.verceledgeadapter.md\"\n    },\n    {\n      \"name\": \"VercelEdgeAdapterOptions\",\n      \"id\": \"verceledgeadapteroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"VercelEdgeAdapterOptions\",\n          \"id\": \"verceledgeadapteroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface VercelEdgeAdapterOptions extends ServerAdapterOptions \\n```\\n**Extends:** ServerAdapterOptions\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[outputConfig?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Determines if the build should auto-generate the `.vercel/output/config.json` config.\\n\\nDefaults to `true`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[staticPaths?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Manually add pathnames that should be treated as static paths and not SSR. For example, when these pathnames are requested, their response should come from a static file, rather than a server-side rendered response.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[target?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'webworker' \\\\| 'node'\\n\\n\\n</td><td>\\n\\n_(Optional)_ Define the `target` property in the `ssr` object in the `vite.config.ts` file.\\n\\nDefaults to `webworker`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[vcConfigEntryPoint?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ The `entrypoint` property in the `.vc-config.json` file. Indicates the initial file where code will be executed for the Edge Function.\\n\\nDefaults to `entry.vercel-edge.js`<!-- -->.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[vcConfigEnvVarsInUse?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ The `envVarsInUse` property in the `.vc-config.json` file. List of environment variable names that will be available for the Edge Function to utilize.\\n\\nDefaults to `undefined`<!-- -->.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/vercel-edge/vite/index.ts\",\n      \"mdFile\": \"qwik-city.verceledgeadapteroptions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-city-vite-vercel/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik-city/vite/vercel API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik-city/vite/vercel\n\n<h2 id=\"verceledgeadapter\">vercelEdgeAdapter</h2>\n\n```typescript\nexport declare function vercelEdgeAdapter(opts?: VercelEdgeAdapterOptions): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[VercelEdgeAdapterOptions](#verceledgeadapteroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/vercel-edge/vite/index.ts)\n\n<h2 id=\"verceledgeadapteroptions\">VercelEdgeAdapterOptions</h2>\n\n```typescript\nexport interface VercelEdgeAdapterOptions extends ServerAdapterOptions\n```\n\n**Extends:** ServerAdapterOptions\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[outputConfig?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Determines if the build should auto-generate the `.vercel/output/config.json` config.\n\nDefaults to `true`.\n\n</td></tr>\n<tr><td>\n\n[staticPaths?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Manually add pathnames that should be treated as static paths and not SSR. For example, when these pathnames are requested, their response should come from a static file, rather than a server-side rendered response.\n\n</td></tr>\n<tr><td>\n\n[target?](#)\n\n</td><td>\n\n</td><td>\n\n'webworker' \\| 'node'\n\n</td><td>\n\n_(Optional)_ Define the `target` property in the `ssr` object in the `vite.config.ts` file.\n\nDefaults to `webworker`.\n\n</td></tr>\n<tr><td>\n\n[vcConfigEntryPoint?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ The `entrypoint` property in the `.vc-config.json` file. Indicates the initial file where code will be executed for the Edge Function.\n\nDefaults to `entry.vercel-edge.js`.\n\n</td></tr>\n<tr><td>\n\n[vcConfigEnvVarsInUse?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ The `envVarsInUse` property in the `.vc-config.json` file. List of environment variable names that will be available for the Edge Function to utilize.\n\nDefaults to `undefined`.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/adapters/vercel-edge/vite/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-optimizer/api.json",
    "content": "{\n  \"id\": \"qwik-optimizer\",\n  \"package\": \"@builder.io/qwik/optimizer\",\n  \"members\": [\n    {\n      \"name\": \"basename\",\n      \"id\": \"path-basename\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-basename\"\n        },\n        {\n          \"name\": \"basename\",\n          \"id\": \"path-basename\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nbasename(path: string, ext?: string): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npath\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\next\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.basename.md\"\n    },\n    {\n      \"name\": \"BundleGraphAdder\",\n      \"id\": \"bundlegraphadder\",\n      \"hierarchy\": [\n        {\n          \"name\": \"BundleGraphAdder\",\n          \"id\": \"bundlegraphadder\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"A function that returns a map of bundle names to their dependencies.\\n\\n\\n```typescript\\nexport type BundleGraphAdder = (manifest: QwikManifest) => Record<string, {\\n    imports?: string[];\\n    dynamicImports?: string[];\\n}>;\\n```\\n**References:** [QwikManifest](#qwikmanifest)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/bundle-graph.ts\",\n      \"mdFile\": \"qwik.bundlegraphadder.md\"\n    },\n    {\n      \"name\": \"ComponentEntryStrategy\",\n      \"id\": \"componententrystrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ComponentEntryStrategy\",\n          \"id\": \"componententrystrategy\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ComponentEntryStrategy \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[manual?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[type](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'component'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.componententrystrategy.md\"\n    },\n    {\n      \"name\": \"createOptimizer\",\n      \"id\": \"createoptimizer\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createOptimizer\",\n          \"id\": \"createoptimizer\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\ncreateOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\noptimizerOptions\\n\\n\\n</td><td>\\n\\n[OptimizerOptions](#optimizeroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nPromise&lt;[Optimizer](#optimizer)<!-- -->&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/optimizer.ts\",\n      \"mdFile\": \"qwik.createoptimizer.md\"\n    },\n    {\n      \"name\": \"Diagnostic\",\n      \"id\": \"diagnostic\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Diagnostic\",\n          \"id\": \"diagnostic\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface Diagnostic \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[category](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[DiagnosticCategory](#diagnosticcategory)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[code](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[file](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[highlights](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[SourceLocation](#sourcelocation)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[message](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[scope](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[suggestions](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\] \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.diagnostic.md\"\n    },\n    {\n      \"name\": \"DiagnosticCategory\",\n      \"id\": \"diagnosticcategory\",\n      \"hierarchy\": [\n        {\n          \"name\": \"DiagnosticCategory\",\n          \"id\": \"diagnosticcategory\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type DiagnosticCategory = 'error' | 'warning' | 'sourceError';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.diagnosticcategory.md\"\n    },\n    {\n      \"name\": \"dirname\",\n      \"id\": \"path-dirname\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-dirname\"\n        },\n        {\n          \"name\": \"dirname\",\n          \"id\": \"path-dirname\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\ndirname(path: string): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npath\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.dirname.md\"\n    },\n    {\n      \"name\": \"enableRequestRewrite\",\n      \"id\": \"experimentalfeatures-enablerequestrewrite\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ExperimentalFeatures\",\n          \"id\": \"experimentalfeatures-enablerequestrewrite\"\n        },\n        {\n          \"name\": \"enableRequestRewrite\",\n          \"id\": \"experimentalfeatures-enablerequestrewrite\"\n        }\n      ],\n      \"kind\": \"EnumMember\",\n      \"content\": \"\",\n      \"mdFile\": \"qwik.experimentalfeatures.enablerequestrewrite.md\"\n    },\n    {\n      \"name\": \"EntryStrategy\",\n      \"id\": \"entrystrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"EntryStrategy\",\n          \"id\": \"entrystrategy\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type EntryStrategy = InlineEntryStrategy | HoistEntryStrategy | SingleEntryStrategy | HookEntryStrategy | SegmentEntryStrategy | ComponentEntryStrategy | SmartEntryStrategy;\\n```\\n**References:** [InlineEntryStrategy](#inlineentrystrategy)<!-- -->, [SingleEntryStrategy](#singleentrystrategy)<!-- -->, [SegmentEntryStrategy](#segmententrystrategy)<!-- -->, [ComponentEntryStrategy](#componententrystrategy)<!-- -->, [SmartEntryStrategy](#smartentrystrategy)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.entrystrategy.md\"\n    },\n    {\n      \"name\": \"ExperimentalFeatures\",\n      \"id\": \"experimentalfeatures\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ExperimentalFeatures\",\n          \"id\": \"experimentalfeatures\"\n        }\n      ],\n      \"kind\": \"Enum\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\nUse `__EXPERIMENTAL__.x` to check if feature `x` is enabled. It will be replaced with `true` or `false` via an exact string replacement.\\n\\nAdd experimental features to this enum definition.\\n\\n\\n```typescript\\nexport declare enum ExperimentalFeatures \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nMember\\n\\n\\n</th><th>\\n\\nValue\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nenableRequestRewrite\\n\\n\\n</td><td>\\n\\n`\\\"enableRequestRewrite\\\"`\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** Enable request.rewrite()\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nnoSPA\\n\\n\\n</td><td>\\n\\n`\\\"noSPA\\\"`\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** Disable SPA navigation handler in Qwik City\\n\\n\\n</td></tr>\\n<tr><td>\\n\\npreventNavigate\\n\\n\\n</td><td>\\n\\n`\\\"preventNavigate\\\"`\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** Enable the usePreventNavigate hook\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nvalibot\\n\\n\\n</td><td>\\n\\n`\\\"valibot\\\"`\\n\\n\\n</td><td>\\n\\n**_(ALPHA)_** Enable the Valibot form validation\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/plugin.ts\",\n      \"mdFile\": \"qwik.experimentalfeatures.md\"\n    },\n    {\n      \"name\": \"extname\",\n      \"id\": \"path-extname\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-extname\"\n        },\n        {\n          \"name\": \"extname\",\n          \"id\": \"path-extname\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nextname(path: string): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npath\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.extname.md\"\n    },\n    {\n      \"name\": \"format\",\n      \"id\": \"path-format\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-format\"\n        },\n        {\n          \"name\": \"format\",\n          \"id\": \"path-format\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nformat(pathObject: {\\n        root: string;\\n        dir: string;\\n        base: string;\\n        ext: string;\\n        name: string;\\n    }): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npathObject\\n\\n\\n</td><td>\\n\\n{ root: string; dir: string; base: string; ext: string; name: string; }\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.format.md\"\n    },\n    {\n      \"name\": \"GlobalInjections\",\n      \"id\": \"globalinjections\",\n      \"hierarchy\": [\n        {\n          \"name\": \"GlobalInjections\",\n          \"id\": \"globalinjections\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface GlobalInjections \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[attributes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ \\\\[key: string\\\\]: string; }\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[location](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'head' \\\\| 'body'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[tag](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.globalinjections.md\"\n    },\n    {\n      \"name\": \"InlineEntryStrategy\",\n      \"id\": \"inlineentrystrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"InlineEntryStrategy\",\n          \"id\": \"inlineentrystrategy\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface InlineEntryStrategy \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[type](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'inline'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.inlineentrystrategy.md\"\n    },\n    {\n      \"name\": \"isAbsolute\",\n      \"id\": \"path-isabsolute\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-isabsolute\"\n        },\n        {\n          \"name\": \"isAbsolute\",\n          \"id\": \"path-isabsolute\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nisAbsolute(path: string): boolean;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npath\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nboolean\",\n      \"mdFile\": \"qwik.path.isabsolute.md\"\n    },\n    {\n      \"name\": \"join\",\n      \"id\": \"path-join\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-join\"\n        },\n        {\n          \"name\": \"join\",\n          \"id\": \"path-join\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\njoin(...paths: string[]): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npaths\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.join.md\"\n    },\n    {\n      \"name\": \"MinifyMode\",\n      \"id\": \"minifymode\",\n      \"hierarchy\": [\n        {\n          \"name\": \"MinifyMode\",\n          \"id\": \"minifymode\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type MinifyMode = 'simplify' | 'none';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.minifymode.md\"\n    },\n    {\n      \"name\": \"normalize\",\n      \"id\": \"path-normalize\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-normalize\"\n        },\n        {\n          \"name\": \"normalize\",\n          \"id\": \"path-normalize\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nnormalize(path: string): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npath\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.normalize.md\"\n    },\n    {\n      \"name\": \"noSPA\",\n      \"id\": \"experimentalfeatures-nospa\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ExperimentalFeatures\",\n          \"id\": \"experimentalfeatures-nospa\"\n        },\n        {\n          \"name\": \"noSPA\",\n          \"id\": \"experimentalfeatures-nospa\"\n        }\n      ],\n      \"kind\": \"EnumMember\",\n      \"content\": \"\",\n      \"mdFile\": \"qwik.experimentalfeatures.nospa.md\"\n    },\n    {\n      \"name\": \"Optimizer\",\n      \"id\": \"optimizer\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Optimizer\",\n          \"id\": \"optimizer\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface Optimizer \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[sys](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[OptimizerSystem](#optimizersystem)\\n\\n\\n</td><td>\\n\\nOptimizer system use. This can be updated with a custom file system.\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n\\n<table><thead><tr><th>\\n\\nMethod\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[transformFs(opts)](#optimizer-transformfs)\\n\\n\\n</td><td>\\n\\nTransforms the directory from the file system.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[transformFsSync(opts)](#optimizer-transformfssync)\\n\\n\\n</td><td>\\n\\nTransforms the directory from the file system.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[transformModules(opts)](#optimizer-transformmodules)\\n\\n\\n</td><td>\\n\\nTransforms the input code string, does not access the file system.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[transformModulesSync(opts)](#optimizer-transformmodulessync)\\n\\n\\n</td><td>\\n\\nTransforms the input code string, does not access the file system.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.optimizer.md\"\n    },\n    {\n      \"name\": \"OptimizerOptions\",\n      \"id\": \"optimizeroptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OptimizerOptions\",\n          \"id\": \"optimizeroptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface OptimizerOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[binding?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nany\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[inlineStylesUpToBytes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ Inline the global styles if they're smaller than this\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sourcemap?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Enable sourcemaps\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sys?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[OptimizerSystem](#optimizersystem)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.optimizeroptions.md\"\n    },\n    {\n      \"name\": \"OptimizerSystem\",\n      \"id\": \"optimizersystem\",\n      \"hierarchy\": [\n        {\n          \"name\": \"OptimizerSystem\",\n          \"id\": \"optimizersystem\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface OptimizerSystem \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[cwd](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; string\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[dynamicImport](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(path: string) =&gt; Promise&lt;any&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[env](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[SystemEnvironment](#systemenvironment)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getInputFiles?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(rootDir: string) =&gt; Promise&lt;[TransformModuleInput](#transformmoduleinput)<!-- -->\\\\[\\\\]&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[os](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[path](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Path](#path)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[strictDynamicImport](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(path: string) =&gt; Promise&lt;any&gt;\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.optimizersystem.md\"\n    },\n    {\n      \"name\": \"parse\",\n      \"id\": \"path-parse\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-parse\"\n        },\n        {\n          \"name\": \"parse\",\n          \"id\": \"path-parse\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nparse(path: string): {\\n        root: string;\\n        dir: string;\\n        base: string;\\n        ext: string;\\n        name: string;\\n    };\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npath\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n{ root: string; dir: string; base: string; ext: string; name: string; }\",\n      \"mdFile\": \"qwik.path.parse.md\"\n    },\n    {\n      \"name\": \"Path\",\n      \"id\": \"path\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface Path \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[delimiter](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[posix](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\n[Path](#path)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sep](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[win32](#)\\n\\n\\n</td><td>\\n\\n`readonly`\\n\\n\\n</td><td>\\n\\nnull\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n\\n<table><thead><tr><th>\\n\\nMethod\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[basename(path, ext)](#path-basename)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[dirname(path)](#path-dirname)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[extname(path)](#path-extname)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[format(pathObject)](#path-format)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[isAbsolute(path)](#path-isabsolute)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[join(paths)](#path-join)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[normalize(path)](#path-normalize)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[parse(path)](#path-parse)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[relative(from, to)](#path-relative)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[resolve(paths)](#path-resolve)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.path.md\"\n    },\n    {\n      \"name\": \"preventNavigate\",\n      \"id\": \"experimentalfeatures-preventnavigate\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ExperimentalFeatures\",\n          \"id\": \"experimentalfeatures-preventnavigate\"\n        },\n        {\n          \"name\": \"preventNavigate\",\n          \"id\": \"experimentalfeatures-preventnavigate\"\n        }\n      ],\n      \"kind\": \"EnumMember\",\n      \"content\": \"\",\n      \"mdFile\": \"qwik.experimentalfeatures.preventnavigate.md\"\n    },\n    {\n      \"name\": \"QwikAsset\",\n      \"id\": \"qwikasset\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikAsset\",\n          \"id\": \"qwikasset\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikAsset \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[name](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| undefined\\n\\n\\n</td><td>\\n\\nName of the asset\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[size](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\nSize of the asset\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.qwikasset.md\"\n    },\n    {\n      \"name\": \"QwikBuildMode\",\n      \"id\": \"qwikbuildmode\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikBuildMode\",\n          \"id\": \"qwikbuildmode\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type QwikBuildMode = 'production' | 'development';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/plugin.ts\",\n      \"mdFile\": \"qwik.qwikbuildmode.md\"\n    },\n    {\n      \"name\": \"QwikBuildTarget\",\n      \"id\": \"qwikbuildtarget\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikBuildTarget\",\n          \"id\": \"qwikbuildtarget\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type QwikBuildTarget = 'client' | 'ssr' | 'lib' | 'test';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/plugin.ts\",\n      \"mdFile\": \"qwik.qwikbuildtarget.md\"\n    },\n    {\n      \"name\": \"QwikBundle\",\n      \"id\": \"qwikbundle\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikBundle\",\n          \"id\": \"qwikbundle\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikBundle \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[dynamicImports?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Dynamic imports\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[imports?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Direct imports\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[interactivity?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ Interactivity score of the bundle\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[origins?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Source files of the bundle\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[size](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\nSize of the bundle\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[symbols?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Symbols in the bundle\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[total](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\nTotal size of this bundle's static import graph\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.qwikbundle.md\"\n    },\n    {\n      \"name\": \"QwikBundleGraph\",\n      \"id\": \"qwikbundlegraph\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikBundleGraph\",\n          \"id\": \"qwikbundlegraph\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Bundle graph.\\n\\nFormat: \\\\[ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, // Depends on 'bundle-c.js' 'bundle-c.js', \\\\]\\n\\n\\n```typescript\\nexport type QwikBundleGraph = Array<string | number>;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.qwikbundlegraph.md\"\n    },\n    {\n      \"name\": \"QwikManifest\",\n      \"id\": \"qwikmanifest\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikManifest\",\n          \"id\": \"qwikmanifest\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"The metadata of the build. One of its uses is storing where QRL symbols are located.\\n\\n\\n```typescript\\nexport interface QwikManifest \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[assets?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ \\\\[fileName: string\\\\]: [QwikAsset](#qwikasset)<!-- -->; }\\n\\n\\n</td><td>\\n\\n_(Optional)_ All assets. The key is the fileName relative to the rootDir\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[bundleGraph?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[QwikBundleGraph](#qwikbundlegraph)\\n\\n\\n</td><td>\\n\\n_(Optional)_ All bundles in a compact graph format with probabilities\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[bundleGraphAsset?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ The bundle graph fileName\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[bundles](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ \\\\[fileName: string\\\\]: [QwikBundle](#qwikbundle)<!-- -->; }\\n\\n\\n</td><td>\\n\\nAll code bundles, used to know the import graph. The key is the bundle fileName relative to \\\"build/\\\"\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[core?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ The Qwik core bundle fileName\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[injections?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[GlobalInjections](#globalinjections)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ CSS etc to inject in the document head\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[manifestHash](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nContent hash of the manifest, if this changes, the code changed\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mapping](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ \\\\[symbolName: string\\\\]: string; }\\n\\n\\n</td><td>\\n\\nWhere QRLs are located. The key is the symbol name, the value is the bundle fileName\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[options?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ target?: string; buildMode?: string; entryStrategy?: { type: [EntryStrategy](#entrystrategy)<!-- -->\\\\['type'\\\\]; }; }\\n\\n\\n</td><td>\\n\\n_(Optional)_ The options used to build the manifest\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[platform?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ \\\\[name: string\\\\]: string; }\\n\\n\\n</td><td>\\n\\n_(Optional)_ The platform used to build the manifest\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[preloader?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ The preloader bundle fileName\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[qwikLoader?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ The Qwik loader bundle fileName\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[symbols](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ \\\\[symbolName: string\\\\]: [QwikSymbol](#qwiksymbol)<!-- -->; }\\n\\n\\n</td><td>\\n\\nQRL symbols\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[version](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\nThe version of the manifest\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.qwikmanifest.md\"\n    },\n    {\n      \"name\": \"qwikRollup\",\n      \"id\": \"qwikrollup\",\n      \"hierarchy\": [\n        {\n          \"name\": \"qwikRollup\",\n          \"id\": \"qwikrollup\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function qwikRollup(qwikRollupOpts?: QwikRollupPluginOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqwikRollupOpts\\n\\n\\n</td><td>\\n\\n[QwikRollupPluginOptions](#qwikrolluppluginoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/rollup.ts\",\n      \"mdFile\": \"qwik.qwikrollup.md\"\n    },\n    {\n      \"name\": \"QwikRollupPluginOptions\",\n      \"id\": \"qwikrolluppluginoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikRollupPluginOptions\",\n          \"id\": \"qwikrolluppluginoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikRollupPluginOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[buildMode?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[QwikBuildMode](#qwikbuildmode)\\n\\n\\n</td><td>\\n\\n_(Optional)_ Build `production` or `development`<!-- -->.\\n\\nDefault `development`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[csr?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[debug?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Prints verbose Qwik plugin debug logs.\\n\\nDefault `false`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[entryStrategy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[EntryStrategy](#entrystrategy)\\n\\n\\n</td><td>\\n\\n_(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always `segment`<!-- -->.\\n\\nDefault `{ type: \\\"smart\\\" }`<!-- -->)\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[experimental?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(keyof typeof [ExperimentalFeatures](#experimentalfeatures)<!-- -->)\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_ Experimental features. These can come and go in patch releases, and their API is not guaranteed to be stable between releases.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[lint?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Run eslint on the source files for the ssr build or dev server. This can slow down startup on large projects. Defaults to `true`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[manifestInput?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[QwikManifest](#qwikmanifest)\\n\\n\\n</td><td>\\n\\n_(Optional)_ The SSR build requires the manifest generated during the client build. The `manifestInput` option can be used to manually provide a manifest.\\n\\nDefault `undefined`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[manifestOutput?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(manifest: [QwikManifest](#qwikmanifest)<!-- -->) =&gt; Promise&lt;void&gt; \\\\| void\\n\\n\\n</td><td>\\n\\n_(Optional)_ The client build will create a manifest and this hook is called with the generated build data.\\n\\nDefault `undefined`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[optimizerOptions?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[OptimizerOptions](#optimizeroptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rootDir?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ The root of the application, which is commonly the same directory as `package.json` and `rollup.config.js`<!-- -->.\\n\\nDefault `process.cwd()`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[srcDir?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ The source directory to find all the Qwik components. Since Qwik does not have a single input, the `srcDir` is used to recursively find Qwik files.\\n\\nDefault `src`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[srcInputs?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[TransformModuleInput](#transformmoduleinput)<!-- -->\\\\[\\\\] \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_ Alternative to `srcDir`<!-- -->, where `srcInputs` is able to provide the files manually. This option is useful for an environment without a file system, such as a webworker.\\n\\nDefault: `null`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[target?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[QwikBuildTarget](#qwikbuildtarget)\\n\\n\\n</td><td>\\n\\n_(Optional)_ Target `client` or `ssr`<!-- -->.\\n\\nDefault `client`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[transformedModuleOutput?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n((transformedModules: [TransformModule](#transformmodule)<!-- -->\\\\[\\\\]) =&gt; Promise&lt;void&gt; \\\\| void) \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling.\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/rollup.ts\",\n      \"mdFile\": \"qwik.qwikrolluppluginoptions.md\"\n    },\n    {\n      \"name\": \"QwikSymbol\",\n      \"id\": \"qwiksymbol\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikSymbol\",\n          \"id\": \"qwiksymbol\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikSymbol \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[canonicalFilename](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[captures](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ctxKind](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'function' \\\\| 'eventHandler'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ctxName](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[displayName](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[hash](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[loc](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n\\\\[number, number\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[origin](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[parent](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.qwiksymbol.md\"\n    },\n    {\n      \"name\": \"qwikVite\",\n      \"id\": \"qwikvite\",\n      \"hierarchy\": [\n        {\n          \"name\": \"qwikVite\",\n          \"id\": \"qwikvite\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"The types for Vite/Rollup don't allow us to be too specific about the return type. The correct return type is `[QwikVitePlugin, VitePlugin<never>]`<!-- -->, and if you search the plugin by name you'll get the `QwikVitePlugin`<!-- -->.\\n\\n\\n```typescript\\nexport declare function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nqwikViteOpts\\n\\n\\n</td><td>\\n\\n[QwikVitePluginOptions](#qwikvitepluginoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nany\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts\",\n      \"mdFile\": \"qwik.qwikvite.md\"\n    },\n    {\n      \"name\": \"QwikViteDevResponse\",\n      \"id\": \"qwikvitedevresponse\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikViteDevResponse\",\n          \"id\": \"qwikvitedevresponse\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikViteDevResponse \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[\\\\_qwikEnvData?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[\\\\_qwikRenderResolve?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; void\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts\",\n      \"mdFile\": \"qwik.qwikvitedevresponse.md\"\n    },\n    {\n      \"name\": \"QwikVitePlugin\",\n      \"id\": \"qwikviteplugin\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikVitePlugin\",\n          \"id\": \"qwikviteplugin\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"This is the type of the \\\"pre\\\" Qwik Vite plugin. `qwikVite` actually returns a tuple of two plugins, but after Vite flattens them, you can find the plugin by name.\\n\\n\\n```typescript\\nexport type QwikVitePlugin = P<QwikVitePluginApi> & {\\n    name: 'vite-plugin-qwik';\\n};\\n```\\n**References:** [QwikVitePluginApi](#qwikvitepluginapi)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts\",\n      \"mdFile\": \"qwik.qwikviteplugin.md\"\n    },\n    {\n      \"name\": \"QwikVitePluginApi\",\n      \"id\": \"qwikvitepluginapi\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikVitePluginApi\",\n          \"id\": \"qwikvitepluginapi\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface QwikVitePluginApi \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[getAssetsDir](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; string \\\\| undefined\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getClientOutDir](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; string \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getClientPublicOutDir](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; string \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getManifest](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; [QwikManifest](#qwikmanifest) \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getOptimizer](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; [Optimizer](#optimizer) \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getOptions](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; NormalizedQwikPluginOptions\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[getRootDir](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n() =&gt; string \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[registerBundleGraphAdder](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n(adder: [BundleGraphAdder](#bundlegraphadder)<!-- -->) =&gt; void\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts\",\n      \"mdFile\": \"qwik.qwikvitepluginapi.md\"\n    },\n    {\n      \"name\": \"QwikVitePluginOptions\",\n      \"id\": \"qwikvitepluginoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikVitePluginOptions\",\n          \"id\": \"qwikvitepluginoptions\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts\",\n      \"mdFile\": \"qwik.qwikvitepluginoptions.md\"\n    },\n    {\n      \"name\": \"relative\",\n      \"id\": \"path-relative\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-relative\"\n        },\n        {\n          \"name\": \"relative\",\n          \"id\": \"path-relative\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nrelative(from: string, to: string): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nfrom\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\nto\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.relative.md\"\n    },\n    {\n      \"name\": \"resolve\",\n      \"id\": \"path-resolve\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Path\",\n          \"id\": \"path-resolve\"\n        },\n        {\n          \"name\": \"resolve\",\n          \"id\": \"path-resolve\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"```typescript\\nresolve(...paths: string[]): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\npaths\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"mdFile\": \"qwik.path.resolve.md\"\n    },\n    {\n      \"name\": \"ResolvedManifest\",\n      \"id\": \"resolvedmanifest\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ResolvedManifest\",\n          \"id\": \"resolvedmanifest\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface ResolvedManifest \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[injections](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[GlobalInjections](#globalinjections)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[manifest](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[ServerQwikManifest](#serverqwikmanifest)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mapper](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[SymbolMapper](#symbolmapper)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.resolvedmanifest.md\"\n    },\n    {\n      \"name\": \"SegmentAnalysis\",\n      \"id\": \"segmentanalysis\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SegmentAnalysis\",\n          \"id\": \"segmentanalysis\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SegmentAnalysis \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[canonicalFilename](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[captures](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ctxKind](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'eventHandler' \\\\| 'function'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ctxName](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[displayName](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[entry](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[extension](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[hash](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[loc](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n\\\\[number, number\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[name](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[origin](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[parent](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.segmentanalysis.md\"\n    },\n    {\n      \"name\": \"SegmentEntryStrategy\",\n      \"id\": \"segmententrystrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SegmentEntryStrategy\",\n          \"id\": \"segmententrystrategy\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SegmentEntryStrategy \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[manual?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[type](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'segment'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.segmententrystrategy.md\"\n    },\n    {\n      \"name\": \"ServerQwikManifest\",\n      \"id\": \"serverqwikmanifest\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ServerQwikManifest\",\n          \"id\": \"serverqwikmanifest\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"The manifest values that are needed for SSR.\\n\\n\\n```typescript\\nexport type ServerQwikManifest = Pick<QwikManifest, 'manifestHash' | 'injections' | 'bundleGraph' | 'bundleGraphAsset' | 'mapping' | 'preloader' | 'core' | 'qwikLoader'>;\\n```\\n**References:** [QwikManifest](#qwikmanifest)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.serverqwikmanifest.md\"\n    },\n    {\n      \"name\": \"SingleEntryStrategy\",\n      \"id\": \"singleentrystrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SingleEntryStrategy\",\n          \"id\": \"singleentrystrategy\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SingleEntryStrategy \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[manual?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[type](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'single'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.singleentrystrategy.md\"\n    },\n    {\n      \"name\": \"SmartEntryStrategy\",\n      \"id\": \"smartentrystrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SmartEntryStrategy\",\n          \"id\": \"smartentrystrategy\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SmartEntryStrategy \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[manual?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[type](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'smart'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.smartentrystrategy.md\"\n    },\n    {\n      \"name\": \"SourceLocation\",\n      \"id\": \"sourcelocation\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SourceLocation\",\n          \"id\": \"sourcelocation\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SourceLocation \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[endCol](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[endLine](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[hi](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[lo](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[startCol](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[startLine](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.sourcelocation.md\"\n    },\n    {\n      \"name\": \"SourceMapsOption\",\n      \"id\": \"sourcemapsoption\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SourceMapsOption\",\n          \"id\": \"sourcemapsoption\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type SourceMapsOption = 'external' | 'inline' | undefined | null;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.sourcemapsoption.md\"\n    },\n    {\n      \"name\": \"symbolMapper\",\n      \"id\": \"symbolmapper\",\n      \"hierarchy\": [\n        {\n          \"name\": \"symbolMapper\",\n          \"id\": \"symbolmapper\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\nFor a given symbol (QRL such as `onKeydown$`<!-- -->) the server needs to know which bundle the symbol is in.\\n\\nNormally this is provided by Qwik's `q-manifest` . But `q-manifest` only exists after a full client build.\\n\\nThis would be a problem in dev mode. So in dev mode the symbol is mapped to the expected URL using the symbolMapper function below. For Vite the given path is fixed for a given symbol.\\n\\n\\n```typescript\\nsymbolMapper: ReturnType<typeof createSymbolMapper>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts\",\n      \"mdFile\": \"qwik.symbolmapper.md\"\n    },\n    {\n      \"name\": \"SymbolMapper\",\n      \"id\": \"symbolmapper\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SymbolMapper\",\n          \"id\": \"symbolmapper\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\\n> \\n\\nFor a given symbol (QRL such as `onKeydown$`<!-- -->) the server needs to know which bundle the symbol is in.\\n\\nNormally this is provided by Qwik's `q-manifest` . But `q-manifest` only exists after a full client build.\\n\\nThis would be a problem in dev mode. So in dev mode the symbol is mapped to the expected URL using the symbolMapper function below. For Vite the given path is fixed for a given symbol.\\n\\n\\n```typescript\\nsymbolMapper: ReturnType<typeof createSymbolMapper>\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.symbolmapper.md\"\n    },\n    {\n      \"name\": \"SymbolMapperFn\",\n      \"id\": \"symbolmapperfn\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SymbolMapperFn\",\n          \"id\": \"symbolmapperfn\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type SymbolMapperFn = (symbolName: string, mapper: SymbolMapper | undefined, parent?: string) => readonly [symbol: string, chunk: string] | undefined;\\n```\\n**References:** [SymbolMapper](#symbolmapper)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.symbolmapperfn.md\"\n    },\n    {\n      \"name\": \"SystemEnvironment\",\n      \"id\": \"systemenvironment\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SystemEnvironment\",\n          \"id\": \"systemenvironment\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown';\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.systemenvironment.md\"\n    },\n    {\n      \"name\": \"transformFs\",\n      \"id\": \"optimizer-transformfs\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Optimizer\",\n          \"id\": \"optimizer-transformfs\"\n        },\n        {\n          \"name\": \"transformFs\",\n          \"id\": \"optimizer-transformfs\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Transforms the directory from the file system.\\n\\n\\n```typescript\\ntransformFs(opts: TransformFsOptions): Promise<TransformOutput>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[TransformFsOptions](#transformfsoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nPromise&lt;[TransformOutput](#transformoutput)<!-- -->&gt;\",\n      \"mdFile\": \"qwik.optimizer.transformfs.md\"\n    },\n    {\n      \"name\": \"TransformFsOptions\",\n      \"id\": \"transformfsoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TransformFsOptions\",\n          \"id\": \"transformfsoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TransformFsOptions extends TransformOptions \\n```\\n**Extends:** [TransformOptions](#transformoptions)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[vendorRoots](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.transformfsoptions.md\"\n    },\n    {\n      \"name\": \"transformFsSync\",\n      \"id\": \"optimizer-transformfssync\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Optimizer\",\n          \"id\": \"optimizer-transformfssync\"\n        },\n        {\n          \"name\": \"transformFsSync\",\n          \"id\": \"optimizer-transformfssync\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Transforms the directory from the file system.\\n\\n\\n```typescript\\ntransformFsSync(opts: TransformFsOptions): TransformOutput;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[TransformFsOptions](#transformfsoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[TransformOutput](#transformoutput)\",\n      \"mdFile\": \"qwik.optimizer.transformfssync.md\"\n    },\n    {\n      \"name\": \"TransformModule\",\n      \"id\": \"transformmodule\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TransformModule\",\n          \"id\": \"transformmodule\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TransformModule \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[code](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[isEntry](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[map](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[origPath](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[path](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[segment](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[SegmentAnalysis](#segmentanalysis) \\\\| null\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.transformmodule.md\"\n    },\n    {\n      \"name\": \"TransformModuleInput\",\n      \"id\": \"transformmoduleinput\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TransformModuleInput\",\n          \"id\": \"transformmoduleinput\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TransformModuleInput \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[code](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[devPath?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[path](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.transformmoduleinput.md\"\n    },\n    {\n      \"name\": \"transformModules\",\n      \"id\": \"optimizer-transformmodules\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Optimizer\",\n          \"id\": \"optimizer-transformmodules\"\n        },\n        {\n          \"name\": \"transformModules\",\n          \"id\": \"optimizer-transformmodules\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Transforms the input code string, does not access the file system.\\n\\n\\n```typescript\\ntransformModules(opts: TransformModulesOptions): Promise<TransformOutput>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[TransformModulesOptions](#transformmodulesoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nPromise&lt;[TransformOutput](#transformoutput)<!-- -->&gt;\",\n      \"mdFile\": \"qwik.optimizer.transformmodules.md\"\n    },\n    {\n      \"name\": \"TransformModulesOptions\",\n      \"id\": \"transformmodulesoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TransformModulesOptions\",\n          \"id\": \"transformmodulesoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TransformModulesOptions extends TransformOptions \\n```\\n**Extends:** [TransformOptions](#transformoptions)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[input](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[TransformModuleInput](#transformmoduleinput)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.transformmodulesoptions.md\"\n    },\n    {\n      \"name\": \"transformModulesSync\",\n      \"id\": \"optimizer-transformmodulessync\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Optimizer\",\n          \"id\": \"optimizer-transformmodulessync\"\n        },\n        {\n          \"name\": \"transformModulesSync\",\n          \"id\": \"optimizer-transformmodulessync\"\n        }\n      ],\n      \"kind\": \"MethodSignature\",\n      \"content\": \"Transforms the input code string, does not access the file system.\\n\\n\\n```typescript\\ntransformModulesSync(opts: TransformModulesOptions): TransformOutput;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n[TransformModulesOptions](#transformmodulesoptions)\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\n[TransformOutput](#transformoutput)\",\n      \"mdFile\": \"qwik.optimizer.transformmodulessync.md\"\n    },\n    {\n      \"name\": \"TransformOptions\",\n      \"id\": \"transformoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TransformOptions\",\n          \"id\": \"transformoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TransformOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[entryStrategy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[EntryStrategy](#entrystrategy)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[explicitExtensions?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[isServer?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[minify?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[MinifyMode](#minifymode)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[mode?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nEmitMode\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[preserveFilenames?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[regCtxName?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[rootDir?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[scope?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[sourceMaps?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[srcDir](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stripCtxName?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stripEventHandlers?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[stripExports?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[transpileJsx?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[transpileTs?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.transformoptions.md\"\n    },\n    {\n      \"name\": \"TransformOutput\",\n      \"id\": \"transformoutput\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TransformOutput\",\n          \"id\": \"transformoutput\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface TransformOutput \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[diagnostics](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[Diagnostic](#diagnostic)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[isJsx](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[isTypeScript](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[modules](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[TransformModule](#transformmodule)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.transformoutput.md\"\n    },\n    {\n      \"name\": \"TranspileOption\",\n      \"id\": \"transpileoption\",\n      \"hierarchy\": [\n        {\n          \"name\": \"TranspileOption\",\n          \"id\": \"transpileoption\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type TranspileOption = boolean | undefined | null;\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts\",\n      \"mdFile\": \"qwik.transpileoption.md\"\n    },\n    {\n      \"name\": \"valibot\",\n      \"id\": \"experimentalfeatures-valibot\",\n      \"hierarchy\": [\n        {\n          \"name\": \"ExperimentalFeatures\",\n          \"id\": \"experimentalfeatures-valibot\"\n        },\n        {\n          \"name\": \"valibot\",\n          \"id\": \"experimentalfeatures-valibot\"\n        }\n      ],\n      \"kind\": \"EnumMember\",\n      \"content\": \"\",\n      \"mdFile\": \"qwik.experimentalfeatures.valibot.md\"\n    },\n    {\n      \"name\": \"versions\",\n      \"id\": \"versions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"versions\",\n          \"id\": \"versions\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nversions: {\\n    qwik: string;\\n}\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/versions.ts\",\n      \"mdFile\": \"qwik.versions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-optimizer/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik/optimizer API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik/optimizer\n\n<h2 id=\"path-basename\">basename</h2>\n\n```typescript\nbasename(path: string, ext?: string): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npath\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\next\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"bundlegraphadder\">BundleGraphAdder</h2>\n\nA function that returns a map of bundle names to their dependencies.\n\n```typescript\nexport type BundleGraphAdder = (manifest: QwikManifest) => Record<\n  string,\n  {\n    imports?: string[];\n    dynamicImports?: string[];\n  }\n>;\n```\n\n**References:** [QwikManifest](#qwikmanifest)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/bundle-graph.ts)\n\n<h2 id=\"componententrystrategy\">ComponentEntryStrategy</h2>\n\n```typescript\nexport interface ComponentEntryStrategy\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[manual?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[type](#)\n\n</td><td>\n\n</td><td>\n\n'component'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"createoptimizer\">createOptimizer</h2>\n\n```typescript\ncreateOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\noptimizerOptions\n\n</td><td>\n\n[OptimizerOptions](#optimizeroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;[Optimizer](#optimizer)&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/optimizer.ts)\n\n<h2 id=\"diagnostic\">Diagnostic</h2>\n\n```typescript\nexport interface Diagnostic\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[category](#)\n\n</td><td>\n\n</td><td>\n\n[DiagnosticCategory](#diagnosticcategory)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[code](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[file](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[highlights](#)\n\n</td><td>\n\n</td><td>\n\n[SourceLocation](#sourcelocation)[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[message](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[scope](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[suggestions](#)\n\n</td><td>\n\n</td><td>\n\nstring[] \\| null\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"diagnosticcategory\">DiagnosticCategory</h2>\n\n```typescript\nexport type DiagnosticCategory = \"error\" | \"warning\" | \"sourceError\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"path-dirname\">dirname</h2>\n\n```typescript\ndirname(path: string): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npath\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"experimentalfeatures-enablerequestrewrite\">enableRequestRewrite</h2>\n\n<h2 id=\"entrystrategy\">EntryStrategy</h2>\n\n```typescript\nexport type EntryStrategy =\n  | InlineEntryStrategy\n  | HoistEntryStrategy\n  | SingleEntryStrategy\n  | HookEntryStrategy\n  | SegmentEntryStrategy\n  | ComponentEntryStrategy\n  | SmartEntryStrategy;\n```\n\n**References:** [InlineEntryStrategy](#inlineentrystrategy), [SingleEntryStrategy](#singleentrystrategy), [SegmentEntryStrategy](#segmententrystrategy), [ComponentEntryStrategy](#componententrystrategy), [SmartEntryStrategy](#smartentrystrategy)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"experimentalfeatures\">ExperimentalFeatures</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nUse `__EXPERIMENTAL__.x` to check if feature `x` is enabled. It will be replaced with `true` or `false` via an exact string replacement.\n\nAdd experimental features to this enum definition.\n\n```typescript\nexport declare enum ExperimentalFeatures\n```\n\n<table><thead><tr><th>\n\nMember\n\n</th><th>\n\nValue\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nenableRequestRewrite\n\n</td><td>\n\n`\"enableRequestRewrite\"`\n\n</td><td>\n\n**_(ALPHA)_** Enable request.rewrite()\n\n</td></tr>\n<tr><td>\n\nnoSPA\n\n</td><td>\n\n`\"noSPA\"`\n\n</td><td>\n\n**_(ALPHA)_** Disable SPA navigation handler in Qwik City\n\n</td></tr>\n<tr><td>\n\npreventNavigate\n\n</td><td>\n\n`\"preventNavigate\"`\n\n</td><td>\n\n**_(ALPHA)_** Enable the usePreventNavigate hook\n\n</td></tr>\n<tr><td>\n\nvalibot\n\n</td><td>\n\n`\"valibot\"`\n\n</td><td>\n\n**_(ALPHA)_** Enable the Valibot form validation\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/plugin.ts)\n\n<h2 id=\"path-extname\">extname</h2>\n\n```typescript\nextname(path: string): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npath\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"path-format\">format</h2>\n\n```typescript\nformat(pathObject: {\n        root: string;\n        dir: string;\n        base: string;\n        ext: string;\n        name: string;\n    }): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npathObject\n\n</td><td>\n\n\\{ root: string; dir: string; base: string; ext: string; name: string; }\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"globalinjections\">GlobalInjections</h2>\n\n```typescript\nexport interface GlobalInjections\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[attributes?](#)\n\n</td><td>\n\n</td><td>\n\n\\{ [key: string]: string; }\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[location](#)\n\n</td><td>\n\n</td><td>\n\n'head' \\| 'body'\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[tag](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"inlineentrystrategy\">InlineEntryStrategy</h2>\n\n```typescript\nexport interface InlineEntryStrategy\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[type](#)\n\n</td><td>\n\n</td><td>\n\n'inline'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"path-isabsolute\">isAbsolute</h2>\n\n```typescript\nisAbsolute(path: string): boolean;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npath\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nboolean\n\n<h2 id=\"path-join\">join</h2>\n\n```typescript\njoin(...paths: string[]): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npaths\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"minifymode\">MinifyMode</h2>\n\n```typescript\nexport type MinifyMode = \"simplify\" | \"none\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"path-normalize\">normalize</h2>\n\n```typescript\nnormalize(path: string): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npath\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"experimentalfeatures-nospa\">noSPA</h2>\n\n<h2 id=\"optimizer\">Optimizer</h2>\n\n```typescript\nexport interface Optimizer\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[sys](#)\n\n</td><td>\n\n</td><td>\n\n[OptimizerSystem](#optimizersystem)\n\n</td><td>\n\nOptimizer system use. This can be updated with a custom file system.\n\n</td></tr>\n</tbody></table>\n\n<table><thead><tr><th>\n\nMethod\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[transformFs(opts)](#optimizer-transformfs)\n\n</td><td>\n\nTransforms the directory from the file system.\n\n</td></tr>\n<tr><td>\n\n[transformFsSync(opts)](#optimizer-transformfssync)\n\n</td><td>\n\nTransforms the directory from the file system.\n\n</td></tr>\n<tr><td>\n\n[transformModules(opts)](#optimizer-transformmodules)\n\n</td><td>\n\nTransforms the input code string, does not access the file system.\n\n</td></tr>\n<tr><td>\n\n[transformModulesSync(opts)](#optimizer-transformmodulessync)\n\n</td><td>\n\nTransforms the input code string, does not access the file system.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"optimizeroptions\">OptimizerOptions</h2>\n\n```typescript\nexport interface OptimizerOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[binding?](#)\n\n</td><td>\n\n</td><td>\n\nany\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[inlineStylesUpToBytes?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ Inline the global styles if they're smaller than this\n\n</td></tr>\n<tr><td>\n\n[sourcemap?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Enable sourcemaps\n\n</td></tr>\n<tr><td>\n\n[sys?](#)\n\n</td><td>\n\n</td><td>\n\n[OptimizerSystem](#optimizersystem)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"optimizersystem\">OptimizerSystem</h2>\n\n```typescript\nexport interface OptimizerSystem\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[cwd](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; string\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[dynamicImport](#)\n\n</td><td>\n\n</td><td>\n\n(path: string) =&gt; Promise&lt;any&gt;\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[env](#)\n\n</td><td>\n\n</td><td>\n\n[SystemEnvironment](#systemenvironment)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getInputFiles?](#)\n\n</td><td>\n\n</td><td>\n\n(rootDir: string) =&gt; Promise&lt;[TransformModuleInput](#transformmoduleinput)[]&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[os](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[path](#)\n\n</td><td>\n\n</td><td>\n\n[Path](#path)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[strictDynamicImport](#)\n\n</td><td>\n\n</td><td>\n\n(path: string) =&gt; Promise&lt;any&gt;\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"path-parse\">parse</h2>\n\n```typescript\nparse(path: string): {\n        root: string;\n        dir: string;\n        base: string;\n        ext: string;\n        name: string;\n    };\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npath\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n\\{ root: string; dir: string; base: string; ext: string; name: string; }\n\n<h2 id=\"path\">Path</h2>\n\n```typescript\nexport interface Path\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[delimiter](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[posix](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\n[Path](#path)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[sep](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[win32](#)\n\n</td><td>\n\n`readonly`\n\n</td><td>\n\nnull\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n<table><thead><tr><th>\n\nMethod\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[basename(path, ext)](#path-basename)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[dirname(path)](#path-dirname)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[extname(path)](#path-extname)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[format(pathObject)](#path-format)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[isAbsolute(path)](#path-isabsolute)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[join(paths)](#path-join)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[normalize(path)](#path-normalize)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[parse(path)](#path-parse)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[relative(from, to)](#path-relative)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[resolve(paths)](#path-resolve)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"experimentalfeatures-preventnavigate\">preventNavigate</h2>\n\n<h2 id=\"qwikasset\">QwikAsset</h2>\n\n```typescript\nexport interface QwikAsset\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[name](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| undefined\n\n</td><td>\n\nName of the asset\n\n</td></tr>\n<tr><td>\n\n[size](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\nSize of the asset\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"qwikbuildmode\">QwikBuildMode</h2>\n\n```typescript\nexport type QwikBuildMode = \"production\" | \"development\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/plugin.ts)\n\n<h2 id=\"qwikbuildtarget\">QwikBuildTarget</h2>\n\n```typescript\nexport type QwikBuildTarget = \"client\" | \"ssr\" | \"lib\" | \"test\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/plugin.ts)\n\n<h2 id=\"qwikbundle\">QwikBundle</h2>\n\n```typescript\nexport interface QwikBundle\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[dynamicImports?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Dynamic imports\n\n</td></tr>\n<tr><td>\n\n[imports?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Direct imports\n\n</td></tr>\n<tr><td>\n\n[interactivity?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ Interactivity score of the bundle\n\n</td></tr>\n<tr><td>\n\n[origins?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Source files of the bundle\n\n</td></tr>\n<tr><td>\n\n[size](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\nSize of the bundle\n\n</td></tr>\n<tr><td>\n\n[symbols?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_ Symbols in the bundle\n\n</td></tr>\n<tr><td>\n\n[total](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\nTotal size of this bundle's static import graph\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"qwikbundlegraph\">QwikBundleGraph</h2>\n\nBundle graph.\n\nFormat: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, // Depends on 'bundle-c.js' 'bundle-c.js', ]\n\n```typescript\nexport type QwikBundleGraph = Array<string | number>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"qwikmanifest\">QwikManifest</h2>\n\nThe metadata of the build. One of its uses is storing where QRL symbols are located.\n\n```typescript\nexport interface QwikManifest\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[assets?](#)\n\n</td><td>\n\n</td><td>\n\n\\{ [fileName: string]: [QwikAsset](#qwikasset); }\n\n</td><td>\n\n_(Optional)_ All assets. The key is the fileName relative to the rootDir\n\n</td></tr>\n<tr><td>\n\n[bundleGraph?](#)\n\n</td><td>\n\n</td><td>\n\n[QwikBundleGraph](#qwikbundlegraph)\n\n</td><td>\n\n_(Optional)_ All bundles in a compact graph format with probabilities\n\n</td></tr>\n<tr><td>\n\n[bundleGraphAsset?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ The bundle graph fileName\n\n</td></tr>\n<tr><td>\n\n[bundles](#)\n\n</td><td>\n\n</td><td>\n\n\\{ [fileName: string]: [QwikBundle](#qwikbundle); }\n\n</td><td>\n\nAll code bundles, used to know the import graph. The key is the bundle fileName relative to \"build/\"\n\n</td></tr>\n<tr><td>\n\n[core?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ The Qwik core bundle fileName\n\n</td></tr>\n<tr><td>\n\n[injections?](#)\n\n</td><td>\n\n</td><td>\n\n[GlobalInjections](#globalinjections)[]\n\n</td><td>\n\n_(Optional)_ CSS etc to inject in the document head\n\n</td></tr>\n<tr><td>\n\n[manifestHash](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\nContent hash of the manifest, if this changes, the code changed\n\n</td></tr>\n<tr><td>\n\n[mapping](#)\n\n</td><td>\n\n</td><td>\n\n\\{ [symbolName: string]: string; }\n\n</td><td>\n\nWhere QRLs are located. The key is the symbol name, the value is the bundle fileName\n\n</td></tr>\n<tr><td>\n\n[options?](#)\n\n</td><td>\n\n</td><td>\n\n\\{ target?: string; buildMode?: string; entryStrategy?: \\{ type: [EntryStrategy](#entrystrategy)['type']; }; }\n\n</td><td>\n\n_(Optional)_ The options used to build the manifest\n\n</td></tr>\n<tr><td>\n\n[platform?](#)\n\n</td><td>\n\n</td><td>\n\n\\{ [name: string]: string; }\n\n</td><td>\n\n_(Optional)_ The platform used to build the manifest\n\n</td></tr>\n<tr><td>\n\n[preloader?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ The preloader bundle fileName\n\n</td></tr>\n<tr><td>\n\n[qwikLoader?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ The Qwik loader bundle fileName\n\n</td></tr>\n<tr><td>\n\n[symbols](#)\n\n</td><td>\n\n</td><td>\n\n\\{ [symbolName: string]: [QwikSymbol](#qwiksymbol); }\n\n</td><td>\n\nQRL symbols\n\n</td></tr>\n<tr><td>\n\n[version](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\nThe version of the manifest\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"qwikrollup\">qwikRollup</h2>\n\n```typescript\nexport declare function qwikRollup(\n  qwikRollupOpts?: QwikRollupPluginOptions,\n): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqwikRollupOpts\n\n</td><td>\n\n[QwikRollupPluginOptions](#qwikrolluppluginoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/rollup.ts)\n\n<h2 id=\"qwikrolluppluginoptions\">QwikRollupPluginOptions</h2>\n\n```typescript\nexport interface QwikRollupPluginOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[buildMode?](#)\n\n</td><td>\n\n</td><td>\n\n[QwikBuildMode](#qwikbuildmode)\n\n</td><td>\n\n_(Optional)_ Build `production` or `development`.\n\nDefault `development`\n\n</td></tr>\n<tr><td>\n\n[csr?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[debug?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Prints verbose Qwik plugin debug logs.\n\nDefault `false`\n\n</td></tr>\n<tr><td>\n\n[entryStrategy?](#)\n\n</td><td>\n\n</td><td>\n\n[EntryStrategy](#entrystrategy)\n\n</td><td>\n\n_(Optional)_ The Qwik entry strategy to use while building for production. During development the type is always `segment`.\n\nDefault `{ type: \"smart\" }`)\n\n</td></tr>\n<tr><td>\n\n[experimental?](#)\n\n</td><td>\n\n</td><td>\n\n(keyof typeof [ExperimentalFeatures](#experimentalfeatures))[]\n\n</td><td>\n\n_(Optional)_ Experimental features. These can come and go in patch releases, and their API is not guaranteed to be stable between releases.\n\n</td></tr>\n<tr><td>\n\n[lint?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Run eslint on the source files for the ssr build or dev server. This can slow down startup on large projects. Defaults to `true`\n\n</td></tr>\n<tr><td>\n\n[manifestInput?](#)\n\n</td><td>\n\n</td><td>\n\n[QwikManifest](#qwikmanifest)\n\n</td><td>\n\n_(Optional)_ The SSR build requires the manifest generated during the client build. The `manifestInput` option can be used to manually provide a manifest.\n\nDefault `undefined`\n\n</td></tr>\n<tr><td>\n\n[manifestOutput?](#)\n\n</td><td>\n\n</td><td>\n\n(manifest: [QwikManifest](#qwikmanifest)) =&gt; Promise&lt;void&gt; \\| void\n\n</td><td>\n\n_(Optional)_ The client build will create a manifest and this hook is called with the generated build data.\n\nDefault `undefined`\n\n</td></tr>\n<tr><td>\n\n[optimizerOptions?](#)\n\n</td><td>\n\n</td><td>\n\n[OptimizerOptions](#optimizeroptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[rootDir?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ The root of the application, which is commonly the same directory as `package.json` and `rollup.config.js`.\n\nDefault `process.cwd()`\n\n</td></tr>\n<tr><td>\n\n[srcDir?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ The source directory to find all the Qwik components. Since Qwik does not have a single input, the `srcDir` is used to recursively find Qwik files.\n\nDefault `src`\n\n</td></tr>\n<tr><td>\n\n[srcInputs?](#)\n\n</td><td>\n\n</td><td>\n\n[TransformModuleInput](#transformmoduleinput)[] \\| null\n\n</td><td>\n\n_(Optional)_ Alternative to `srcDir`, where `srcInputs` is able to provide the files manually. This option is useful for an environment without a file system, such as a webworker.\n\nDefault: `null`\n\n</td></tr>\n<tr><td>\n\n[target?](#)\n\n</td><td>\n\n</td><td>\n\n[QwikBuildTarget](#qwikbuildtarget)\n\n</td><td>\n\n_(Optional)_ Target `client` or `ssr`.\n\nDefault `client`\n\n</td></tr>\n<tr><td>\n\n[transformedModuleOutput?](#)\n\n</td><td>\n\n</td><td>\n\n((transformedModules: [TransformModule](#transformmodule)[]) =&gt; Promise&lt;void&gt; \\| void) \\| null\n\n</td><td>\n\n_(Optional)_ Hook that's called after the build and provides all of the transformed modules that were used before bundling.\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/rollup.ts)\n\n<h2 id=\"qwiksymbol\">QwikSymbol</h2>\n\n```typescript\nexport interface QwikSymbol\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[canonicalFilename](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[captures](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[ctxKind](#)\n\n</td><td>\n\n</td><td>\n\n'function' \\| 'eventHandler'\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[ctxName](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[displayName](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[hash](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[loc](#)\n\n</td><td>\n\n</td><td>\n\n[number, number]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[origin](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[parent](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"qwikvite\">qwikVite</h2>\n\nThe types for Vite/Rollup don't allow us to be too specific about the return type. The correct return type is `[QwikVitePlugin, VitePlugin<never>]`, and if you search the plugin by name you'll get the `QwikVitePlugin`.\n\n```typescript\nexport declare function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nqwikViteOpts\n\n</td><td>\n\n[QwikVitePluginOptions](#qwikvitepluginoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nany\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts)\n\n<h2 id=\"qwikvitedevresponse\">QwikViteDevResponse</h2>\n\n```typescript\nexport interface QwikViteDevResponse\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[\\_qwikEnvData?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, any&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[\\_qwikRenderResolve?](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; void\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts)\n\n<h2 id=\"qwikviteplugin\">QwikVitePlugin</h2>\n\nThis is the type of the \"pre\" Qwik Vite plugin. `qwikVite` actually returns a tuple of two plugins, but after Vite flattens them, you can find the plugin by name.\n\n```typescript\nexport type QwikVitePlugin = P<QwikVitePluginApi> & {\n  name: \"vite-plugin-qwik\";\n};\n```\n\n**References:** [QwikVitePluginApi](#qwikvitepluginapi)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts)\n\n<h2 id=\"qwikvitepluginapi\">QwikVitePluginApi</h2>\n\n```typescript\nexport interface QwikVitePluginApi\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[getAssetsDir](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; string \\| undefined\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getClientOutDir](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; string \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getClientPublicOutDir](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; string \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getManifest](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; [QwikManifest](#qwikmanifest) \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getOptimizer](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; [Optimizer](#optimizer) \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getOptions](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; NormalizedQwikPluginOptions\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[getRootDir](#)\n\n</td><td>\n\n</td><td>\n\n() =&gt; string \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[registerBundleGraphAdder](#)\n\n</td><td>\n\n</td><td>\n\n(adder: [BundleGraphAdder](#bundlegraphadder)) =&gt; void\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts)\n\n<h2 id=\"qwikvitepluginoptions\">QwikVitePluginOptions</h2>\n\n```typescript\nexport type QwikVitePluginOptions =\n  | QwikVitePluginCSROptions\n  | QwikVitePluginSSROptions;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite.ts)\n\n<h2 id=\"path-relative\">relative</h2>\n\n```typescript\nrelative(from: string, to: string): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nfrom\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\nto\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"path-resolve\">resolve</h2>\n\n```typescript\nresolve(...paths: string[]): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\npaths\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n<h2 id=\"resolvedmanifest\">ResolvedManifest</h2>\n\n```typescript\nexport interface ResolvedManifest\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[injections](#)\n\n</td><td>\n\n</td><td>\n\n[GlobalInjections](#globalinjections)[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[manifest](#)\n\n</td><td>\n\n</td><td>\n\n[ServerQwikManifest](#serverqwikmanifest)\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[mapper](#)\n\n</td><td>\n\n</td><td>\n\n[SymbolMapper](#symbolmapper)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"segmentanalysis\">SegmentAnalysis</h2>\n\n```typescript\nexport interface SegmentAnalysis\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[canonicalFilename](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[captures](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[ctxKind](#)\n\n</td><td>\n\n</td><td>\n\n'eventHandler' \\| 'function'\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[ctxName](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[displayName](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[entry](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[extension](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[hash](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[loc](#)\n\n</td><td>\n\n</td><td>\n\n[number, number]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[name](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[origin](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[parent](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"segmententrystrategy\">SegmentEntryStrategy</h2>\n\n```typescript\nexport interface SegmentEntryStrategy\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[manual?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[type](#)\n\n</td><td>\n\n</td><td>\n\n'segment'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"serverqwikmanifest\">ServerQwikManifest</h2>\n\nThe manifest values that are needed for SSR.\n\n```typescript\nexport type ServerQwikManifest = Pick<\n  QwikManifest,\n  | \"manifestHash\"\n  | \"injections\"\n  | \"bundleGraph\"\n  | \"bundleGraphAsset\"\n  | \"mapping\"\n  | \"preloader\"\n  | \"core\"\n  | \"qwikLoader\"\n>;\n```\n\n**References:** [QwikManifest](#qwikmanifest)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"singleentrystrategy\">SingleEntryStrategy</h2>\n\n```typescript\nexport interface SingleEntryStrategy\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[manual?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[type](#)\n\n</td><td>\n\n</td><td>\n\n'single'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"smartentrystrategy\">SmartEntryStrategy</h2>\n\n```typescript\nexport interface SmartEntryStrategy\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[manual?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[type](#)\n\n</td><td>\n\n</td><td>\n\n'smart'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"sourcelocation\">SourceLocation</h2>\n\n```typescript\nexport interface SourceLocation\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[endCol](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[endLine](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[hi](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[lo](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[startCol](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[startLine](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"sourcemapsoption\">SourceMapsOption</h2>\n\n```typescript\nexport type SourceMapsOption = \"external\" | \"inline\" | undefined | null;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"symbolmapper-variable\">symbolMapper</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nFor a given symbol (QRL such as `onKeydown$`) the server needs to know which bundle the symbol is in.\n\nNormally this is provided by Qwik's `q-manifest` . But `q-manifest` only exists after a full client build.\n\nThis would be a problem in dev mode. So in dev mode the symbol is mapped to the expected URL using the symbolMapper function below. For Vite the given path is fixed for a given symbol.\n\n```typescript\nsymbolMapper: ReturnType<typeof createSymbolMapper>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts)\n\n<h2 id=\"symbolmapper-type-alias\">SymbolMapper</h2>\n\n> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n\nFor a given symbol (QRL such as `onKeydown$`) the server needs to know which bundle the symbol is in.\n\nNormally this is provided by Qwik's `q-manifest` . But `q-manifest` only exists after a full client build.\n\nThis would be a problem in dev mode. So in dev mode the symbol is mapped to the expected URL using the symbolMapper function below. For Vite the given path is fixed for a given symbol.\n\n```typescript\nsymbolMapper: ReturnType<typeof createSymbolMapper>;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"symbolmapperfn\">SymbolMapperFn</h2>\n\n```typescript\nexport type SymbolMapperFn = (\n  symbolName: string,\n  mapper: SymbolMapper | undefined,\n  parent?: string,\n) => readonly [symbol: string, chunk: string] | undefined;\n```\n\n**References:** [SymbolMapper](#symbolmapper)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"systemenvironment\">SystemEnvironment</h2>\n\n```typescript\nexport type SystemEnvironment =\n  | \"node\"\n  | \"deno\"\n  | \"bun\"\n  | \"webworker\"\n  | \"browsermain\"\n  | \"unknown\";\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"optimizer-transformfs\">transformFs</h2>\n\nTransforms the directory from the file system.\n\n```typescript\ntransformFs(opts: TransformFsOptions): Promise<TransformOutput>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[TransformFsOptions](#transformfsoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;[TransformOutput](#transformoutput)&gt;\n\n<h2 id=\"transformfsoptions\">TransformFsOptions</h2>\n\n```typescript\nexport interface TransformFsOptions extends TransformOptions\n```\n\n**Extends:** [TransformOptions](#transformoptions)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[vendorRoots](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"optimizer-transformfssync\">transformFsSync</h2>\n\nTransforms the directory from the file system.\n\n```typescript\ntransformFsSync(opts: TransformFsOptions): TransformOutput;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[TransformFsOptions](#transformfsoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[TransformOutput](#transformoutput)\n\n<h2 id=\"transformmodule\">TransformModule</h2>\n\n```typescript\nexport interface TransformModule\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[code](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[isEntry](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[map](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[origPath](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| null\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[path](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[segment](#)\n\n</td><td>\n\n</td><td>\n\n[SegmentAnalysis](#segmentanalysis) \\| null\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"transformmoduleinput\">TransformModuleInput</h2>\n\n```typescript\nexport interface TransformModuleInput\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[code](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[devPath?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[path](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"optimizer-transformmodules\">transformModules</h2>\n\nTransforms the input code string, does not access the file system.\n\n```typescript\ntransformModules(opts: TransformModulesOptions): Promise<TransformOutput>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[TransformModulesOptions](#transformmodulesoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;[TransformOutput](#transformoutput)&gt;\n\n<h2 id=\"transformmodulesoptions\">TransformModulesOptions</h2>\n\n```typescript\nexport interface TransformModulesOptions extends TransformOptions\n```\n\n**Extends:** [TransformOptions](#transformoptions)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[input](#)\n\n</td><td>\n\n</td><td>\n\n[TransformModuleInput](#transformmoduleinput)[]\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"optimizer-transformmodulessync\">transformModulesSync</h2>\n\nTransforms the input code string, does not access the file system.\n\n```typescript\ntransformModulesSync(opts: TransformModulesOptions): TransformOutput;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n[TransformModulesOptions](#transformmodulesoptions)\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\n[TransformOutput](#transformoutput)\n\n<h2 id=\"transformoptions\">TransformOptions</h2>\n\n```typescript\nexport interface TransformOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[entryStrategy?](#)\n\n</td><td>\n\n</td><td>\n\n[EntryStrategy](#entrystrategy)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[explicitExtensions?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[isServer?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[minify?](#)\n\n</td><td>\n\n</td><td>\n\n[MinifyMode](#minifymode)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[mode?](#)\n\n</td><td>\n\n</td><td>\n\nEmitMode\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[preserveFilenames?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[regCtxName?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[rootDir?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[scope?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[sourceMaps?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[srcDir](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[stripCtxName?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stripEventHandlers?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[stripExports?](#)\n\n</td><td>\n\n</td><td>\n\nstring[]\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[transpileJsx?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[transpileTs?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"transformoutput\">TransformOutput</h2>\n\n```typescript\nexport interface TransformOutput\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[diagnostics](#)\n\n</td><td>\n\n</td><td>\n\n[Diagnostic](#diagnostic)[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[isJsx](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[isTypeScript](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[modules](#)\n\n</td><td>\n\n</td><td>\n\n[TransformModule](#transformmodule)[]\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"transpileoption\">TranspileOption</h2>\n\n```typescript\nexport type TranspileOption = boolean | undefined | null;\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts)\n\n<h2 id=\"experimentalfeatures-valibot\">valibot</h2>\n\n<h2 id=\"versions\">versions</h2>\n\n```typescript\nversions: {\n  qwik: string;\n}\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/versions.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-server/api.json",
    "content": "{\n  \"id\": \"qwik-server\",\n  \"package\": \"@builder.io/qwik/server\",\n  \"members\": [\n    {\n      \"name\": \"getQwikLoaderScript\",\n      \"id\": \"getqwikloaderscript\",\n      \"hierarchy\": [\n        {\n          \"name\": \"getQwikLoaderScript\",\n          \"id\": \"getqwikloaderscript\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Provides the `qwikloader.js` file as a string. Useful for tooling to inline the qwikloader script into HTML.\\n\\n\\n```typescript\\nexport declare function getQwikLoaderScript(opts?: {\\n    debug?: boolean;\\n}): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n{ debug?: boolean; }\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/scripts.ts\",\n      \"mdFile\": \"qwik.getqwikloaderscript.md\"\n    },\n    {\n      \"name\": \"getQwikPrefetchWorkerScript\",\n      \"id\": \"getqwikprefetchworkerscript\",\n      \"hierarchy\": [\n        {\n          \"name\": \"getQwikPrefetchWorkerScript\",\n          \"id\": \"getqwikprefetchworkerscript\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Provides the `qwik-prefetch-service-worker.js` file as a string. Useful for tooling to inline the qwik-prefetch-service-worker script into HTML.\\n\\n\\n```typescript\\nexport declare function getQwikPrefetchWorkerScript(opts?: {\\n    debug?: boolean;\\n}): string;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nopts\\n\\n\\n</td><td>\\n\\n{ debug?: boolean; }\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nstring\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/scripts.ts\",\n      \"mdFile\": \"qwik.getqwikprefetchworkerscript.md\"\n    },\n    {\n      \"name\": \"InOrderAuto\",\n      \"id\": \"inorderauto\",\n      \"hierarchy\": [\n        {\n          \"name\": \"InOrderAuto\",\n          \"id\": \"inorderauto\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface InOrderAuto \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[maximunChunk?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[maximunInitialChunk?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[strategy](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'auto'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.inorderauto.md\"\n    },\n    {\n      \"name\": \"InOrderDisabled\",\n      \"id\": \"inorderdisabled\",\n      \"hierarchy\": [\n        {\n          \"name\": \"InOrderDisabled\",\n          \"id\": \"inorderdisabled\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface InOrderDisabled \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[strategy](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'disabled'\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.inorderdisabled.md\"\n    },\n    {\n      \"name\": \"InOrderStreaming\",\n      \"id\": \"inorderstreaming\",\n      \"hierarchy\": [\n        {\n          \"name\": \"InOrderStreaming\",\n          \"id\": \"inorderstreaming\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;\\n```\\n**References:** [InOrderAuto](#inorderauto)<!-- -->, [InOrderDisabled](#inorderdisabled)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.inorderstreaming.md\"\n    },\n    {\n      \"name\": \"PrefetchImplementation\",\n      \"id\": \"prefetchimplementation\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PrefetchImplementation\",\n          \"id\": \"prefetchimplementation\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"> Warning: This API is now obsolete.\\n> \\n> Use `preloader` instead\\n> \\n\\n\\n```typescript\\nexport interface PrefetchImplementation \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[linkFetchPriority?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'auto' \\\\| 'low' \\\\| 'high' \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[linkInsert?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'js-append' \\\\| 'html-append' \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[linkRel?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'prefetch' \\\\| 'preload' \\\\| 'modulepreload' \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[prefetchEvent?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'always' \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[workerFetchInsert?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n'always' \\\\| 'no-link-support' \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.prefetchimplementation.md\"\n    },\n    {\n      \"name\": \"PrefetchResource\",\n      \"id\": \"prefetchresource\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PrefetchResource\",\n          \"id\": \"prefetchresource\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PrefetchResource \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[imports](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[PrefetchResource](#prefetchresource)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[url](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.prefetchresource.md\"\n    },\n    {\n      \"name\": \"PrefetchStrategy\",\n      \"id\": \"prefetchstrategy\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PrefetchStrategy\",\n          \"id\": \"prefetchstrategy\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PrefetchStrategy \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[implementation?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[PrefetchImplementation](#prefetchimplementation)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[symbolsToPrefetch?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[SymbolsToPrefetch](#symbolstoprefetch)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.prefetchstrategy.md\"\n    },\n    {\n      \"name\": \"PreloaderOptions\",\n      \"id\": \"preloaderoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"PreloaderOptions\",\n          \"id\": \"preloaderoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface PreloaderOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[debug?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Log preloader debug information to the console.\\n\\nDefaults to `false`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[maxIdlePreloads?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ Maximum number of simultaneous preload links that the preloader will maintain. If you set this higher, the browser will have all JS files in memory sooner, but it will contend with other resource downloads. Furthermore, if a bundle suddenly becomes more likely, it will have to wait longer to be preloaded.\\n\\nBundles that reach 100% probability (static imports of other bundles) will always be preloaded immediately, no limit.\\n\\nDefaults to `25`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[preloadProbability?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ssrPreloadProbability?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ The minimum probability for a bundle to be added as a preload link during SSR.\\n\\nDefaults to `0.7` (70% probability)\\n\\nThis makes sure that the most likely bundles are preloaded ahead of time.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[ssrPreloads?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n_(Optional)_ Maximum number of preload links to add during SSR. These instruct the browser to preload likely bundles before the preloader script is active. This most likely includes the core and the preloader script itself. Setting this to 0 will disable all preload links.\\n\\nPreload links can delay LCP, which is a Core Web Vital, but it can increase TTI, which is not a Core Web Vital but more noticeable to the user.\\n\\nDefaults to `5`\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.preloaderoptions.md\"\n    },\n    {\n      \"name\": \"QwikLoaderOptions\",\n      \"id\": \"qwikloaderoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"QwikLoaderOptions\",\n          \"id\": \"qwikloaderoptions\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type QwikLoaderOptions = 'module' | 'inline' | 'never' | {\\n    include?: 'always' | 'never' | 'auto';\\n    position?: 'top' | 'bottom';\\n};\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.qwikloaderoptions.md\"\n    },\n    {\n      \"name\": \"Render\",\n      \"id\": \"render\",\n      \"hierarchy\": [\n        {\n          \"name\": \"Render\",\n          \"id\": \"render\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type Render = RenderToString | RenderToStream;\\n```\\n**References:** [RenderToString](#rendertostring)<!-- -->, [RenderToStream](#rendertostream)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.render.md\"\n    },\n    {\n      \"name\": \"RenderOptions\",\n      \"id\": \"renderoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderOptions\",\n          \"id\": \"renderoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderOptions extends SerializeDocumentOptions \\n```\\n**Extends:** [SerializeDocumentOptions](#serializedocumentoptions)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[base?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| ((options: [RenderOptions](#renderoptions)<!-- -->) =&gt; string)\\n\\n\\n</td><td>\\n\\n_(Optional)_ Specifies the root of the JS files of the client build. Setting a base, will cause the render of the `q:base` attribute in the `q:container` element.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[containerAttributes?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, string&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[containerTagName?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n_(Optional)_ When set, the app is serialized into a fragment. And the returned html is not a complete document. Defaults to `html`\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[locale?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring \\\\| ((options: [RenderOptions](#renderoptions)<!-- -->) =&gt; string)\\n\\n\\n</td><td>\\n\\n_(Optional)_ Language to use when rendering the document.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[prefetchStrategy?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[PrefetchStrategy](#prefetchstrategy) \\\\| null\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[preloader?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[PreloaderOptions](#preloaderoptions) \\\\| false\\n\\n\\n</td><td>\\n\\n_(Optional)_ Specifies how preloading is handled. This ensures that code is instantly available when needed.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[qwikLoader?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[QwikLoaderOptions](#qwikloaderoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_ Specifies how the Qwik Loader is included in the document. This enables interactivity and lazy loading.\\n\\n`module`<!-- -->: Use a `<script>` tag to load the Qwik Loader. Subsequent page loads will have the script cached and instantly running.\\n\\n`inline`<!-- -->: This embeds the Qwik Loader script directly in the document. This adds about 3kB before compression, which typically is reduced to about 1.6kB with gzip.\\n\\n`never`<!-- -->: Do not include the Qwik Loader script. This is mostly useful when embedding multiple containers on the same page.\\n\\nDefaults to `module`<!-- -->.\\n\\nNote that the Qwik Loader is absolutely required for Qwik to work. There must be an instance of it loaded for any interactivity to happen.\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[qwikPrefetchServiceWorker?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nQwikPrefetchServiceWorkerOptions\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[serverData?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nRecord&lt;string, any&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[snapshot?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_ Defaults to `true`\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.renderoptions.md\"\n    },\n    {\n      \"name\": \"RenderResult\",\n      \"id\": \"renderresult\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderResult\",\n          \"id\": \"renderresult\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderResult \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[isStatic](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[manifest?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nServerQwikManifest\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[prefetchResources](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[PrefetchResource](#prefetchresource)<!-- -->\\\\[\\\\]\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[snapshotResult](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nSnapshotResult \\\\| undefined\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.renderresult.md\"\n    },\n    {\n      \"name\": \"renderToStream\",\n      \"id\": \"rendertostream\",\n      \"hierarchy\": [\n        {\n          \"name\": \"renderToStream\",\n          \"id\": \"rendertostream\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport type RenderToStream = (opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;\\n```\\n**References:** [RenderToStreamOptions](#rendertostreamoptions)<!-- -->, [RenderToStreamResult](#rendertostreamresult)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/render.ts\",\n      \"mdFile\": \"qwik.rendertostream.md\"\n    },\n    {\n      \"name\": \"RenderToStream\",\n      \"id\": \"rendertostream\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderToStream\",\n          \"id\": \"rendertostream\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type RenderToStream = (opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;\\n```\\n**References:** [RenderToStreamOptions](#rendertostreamoptions)<!-- -->, [RenderToStreamResult](#rendertostreamresult)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.rendertostream.md\"\n    },\n    {\n      \"name\": \"RenderToStreamOptions\",\n      \"id\": \"rendertostreamoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderToStreamOptions\",\n          \"id\": \"rendertostreamoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderToStreamOptions extends RenderOptions \\n```\\n**Extends:** [RenderOptions](#renderoptions)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[stream](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nStreamWriter\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[streaming?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[StreamingOptions](#streamingoptions)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.rendertostreamoptions.md\"\n    },\n    {\n      \"name\": \"RenderToStreamResult\",\n      \"id\": \"rendertostreamresult\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderToStreamResult\",\n          \"id\": \"rendertostreamresult\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderToStreamResult extends RenderResult \\n```\\n**Extends:** [RenderResult](#renderresult)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[flushes](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[size](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nnumber\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[timing](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ firstFlush: number; render: number; snapshot: number; }\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.rendertostreamresult.md\"\n    },\n    {\n      \"name\": \"renderToString\",\n      \"id\": \"rendertostring\",\n      \"hierarchy\": [\n        {\n          \"name\": \"renderToString\",\n          \"id\": \"rendertostring\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport type RenderToString = (opts: RenderToStringOptions) => Promise<RenderToStringResult>;\\n```\\n**References:** [RenderToStringOptions](#rendertostringoptions)<!-- -->, [RenderToStringResult](#rendertostringresult)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/render.ts\",\n      \"mdFile\": \"qwik.rendertostring.md\"\n    },\n    {\n      \"name\": \"RenderToString\",\n      \"id\": \"rendertostring\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderToString\",\n          \"id\": \"rendertostring\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"```typescript\\nexport type RenderToString = (opts: RenderToStringOptions) => Promise<RenderToStringResult>;\\n```\\n**References:** [RenderToStringOptions](#rendertostringoptions)<!-- -->, [RenderToStringResult](#rendertostringresult)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.rendertostring.md\"\n    },\n    {\n      \"name\": \"RenderToStringOptions\",\n      \"id\": \"rendertostringoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderToStringOptions\",\n          \"id\": \"rendertostringoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderToStringOptions extends RenderOptions \\n```\\n**Extends:** [RenderOptions](#renderoptions)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.rendertostringoptions.md\"\n    },\n    {\n      \"name\": \"RenderToStringResult\",\n      \"id\": \"rendertostringresult\",\n      \"hierarchy\": [\n        {\n          \"name\": \"RenderToStringResult\",\n          \"id\": \"rendertostringresult\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface RenderToStringResult extends RenderResult \\n```\\n**Extends:** [RenderResult](#renderresult)\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[html](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nstring\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[timing](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n{ render: number; snapshot: number; }\\n\\n\\n</td><td>\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.rendertostringresult.md\"\n    },\n    {\n      \"name\": \"resolveManifest\",\n      \"id\": \"resolvemanifest\",\n      \"hierarchy\": [\n        {\n          \"name\": \"resolveManifest\",\n          \"id\": \"resolvemanifest\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"Merges a given manifest with the built manifest and provides mappings for symbols.\\n\\n\\n```typescript\\nexport declare function resolveManifest(manifest?: Partial<QwikManifest | ResolvedManifest> | undefined): ResolvedManifest | undefined;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nmanifest\\n\\n\\n</td><td>\\n\\nPartial&lt;QwikManifest \\\\| ResolvedManifest&gt; \\\\| undefined\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nResolvedManifest \\\\| undefined\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/render.ts\",\n      \"mdFile\": \"qwik.resolvemanifest.md\"\n    },\n    {\n      \"name\": \"SerializeDocumentOptions\",\n      \"id\": \"serializedocumentoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SerializeDocumentOptions\",\n          \"id\": \"serializedocumentoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface SerializeDocumentOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[debug?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nboolean\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[manifest?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nPartial&lt;QwikManifest \\\\| ResolvedManifest&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n<tr><td>\\n\\n[symbolMapper?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\nSymbolMapperFn\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.serializedocumentoptions.md\"\n    },\n    {\n      \"name\": \"setServerPlatform\",\n      \"id\": \"setserverplatform\",\n      \"hierarchy\": [\n        {\n          \"name\": \"setServerPlatform\",\n          \"id\": \"setserverplatform\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"```typescript\\nexport declare function setServerPlatform(manifest?: Partial<QwikManifest | ResolvedManifest>): Promise<void>;\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\nmanifest\\n\\n\\n</td><td>\\n\\nPartial&lt;QwikManifest \\\\| ResolvedManifest&gt;\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nPromise&lt;void&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/index.ts\",\n      \"mdFile\": \"qwik.setserverplatform.md\"\n    },\n    {\n      \"name\": \"StreamingOptions\",\n      \"id\": \"streamingoptions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"StreamingOptions\",\n          \"id\": \"streamingoptions\"\n        }\n      ],\n      \"kind\": \"Interface\",\n      \"content\": \"```typescript\\nexport interface StreamingOptions \\n```\\n\\n\\n<table><thead><tr><th>\\n\\nProperty\\n\\n\\n</th><th>\\n\\nModifiers\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n[inOrder?](#)\\n\\n\\n</td><td>\\n\\n\\n</td><td>\\n\\n[InOrderStreaming](#inorderstreaming)\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.streamingoptions.md\"\n    },\n    {\n      \"name\": \"SymbolsToPrefetch\",\n      \"id\": \"symbolstoprefetch\",\n      \"hierarchy\": [\n        {\n          \"name\": \"SymbolsToPrefetch\",\n          \"id\": \"symbolstoprefetch\"\n        }\n      ],\n      \"kind\": \"TypeAlias\",\n      \"content\": \"Auto: Prefetch all possible QRLs used by the document. Default\\n\\n\\n```typescript\\nexport type SymbolsToPrefetch = 'auto' | ((opts: {\\n    manifest: ServerQwikManifest;\\n}) => PrefetchResource[]);\\n```\\n**References:** [PrefetchResource](#prefetchresource)\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts\",\n      \"mdFile\": \"qwik.symbolstoprefetch.md\"\n    },\n    {\n      \"name\": \"versions\",\n      \"id\": \"versions\",\n      \"hierarchy\": [\n        {\n          \"name\": \"versions\",\n          \"id\": \"versions\"\n        }\n      ],\n      \"kind\": \"Variable\",\n      \"content\": \"```typescript\\nversions: {\\n    readonly qwik: string;\\n    readonly qwikDom: string;\\n}\\n```\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/utils.ts\",\n      \"mdFile\": \"qwik.versions.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-server/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik/server API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik/server\n\n<h2 id=\"getqwikloaderscript\">getQwikLoaderScript</h2>\n\nProvides the `qwikloader.js` file as a string. Useful for tooling to inline the qwikloader script into HTML.\n\n```typescript\nexport declare function getQwikLoaderScript(opts?: { debug?: boolean }): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n\\{ debug?: boolean; }\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/scripts.ts)\n\n<h2 id=\"getqwikprefetchworkerscript\">getQwikPrefetchWorkerScript</h2>\n\nProvides the `qwik-prefetch-service-worker.js` file as a string. Useful for tooling to inline the qwik-prefetch-service-worker script into HTML.\n\n```typescript\nexport declare function getQwikPrefetchWorkerScript(opts?: {\n  debug?: boolean;\n}): string;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n</td><td>\n\n\\{ debug?: boolean; }\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nstring\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/scripts.ts)\n\n<h2 id=\"inorderauto\">InOrderAuto</h2>\n\n```typescript\nexport interface InOrderAuto\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[maximunChunk?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[maximunInitialChunk?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[strategy](#)\n\n</td><td>\n\n</td><td>\n\n'auto'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"inorderdisabled\">InOrderDisabled</h2>\n\n```typescript\nexport interface InOrderDisabled\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[strategy](#)\n\n</td><td>\n\n</td><td>\n\n'disabled'\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"inorderstreaming\">InOrderStreaming</h2>\n\n```typescript\nexport type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;\n```\n\n**References:** [InOrderAuto](#inorderauto), [InOrderDisabled](#inorderdisabled)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"prefetchimplementation\">PrefetchImplementation</h2>\n\n> Warning: This API is now obsolete.\n>\n> Use `preloader` instead\n\n```typescript\nexport interface PrefetchImplementation\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[linkFetchPriority?](#)\n\n</td><td>\n\n</td><td>\n\n'auto' \\| 'low' \\| 'high' \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[linkInsert?](#)\n\n</td><td>\n\n</td><td>\n\n'js-append' \\| 'html-append' \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[linkRel?](#)\n\n</td><td>\n\n</td><td>\n\n'prefetch' \\| 'preload' \\| 'modulepreload' \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[prefetchEvent?](#)\n\n</td><td>\n\n</td><td>\n\n'always' \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[workerFetchInsert?](#)\n\n</td><td>\n\n</td><td>\n\n'always' \\| 'no-link-support' \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"prefetchresource\">PrefetchResource</h2>\n\n```typescript\nexport interface PrefetchResource\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[imports](#)\n\n</td><td>\n\n</td><td>\n\n[PrefetchResource](#prefetchresource)[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[url](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"prefetchstrategy\">PrefetchStrategy</h2>\n\n```typescript\nexport interface PrefetchStrategy\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[implementation?](#)\n\n</td><td>\n\n</td><td>\n\n[PrefetchImplementation](#prefetchimplementation)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[symbolsToPrefetch?](#)\n\n</td><td>\n\n</td><td>\n\n[SymbolsToPrefetch](#symbolstoprefetch)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"preloaderoptions\">PreloaderOptions</h2>\n\n```typescript\nexport interface PreloaderOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[debug?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Log preloader debug information to the console.\n\nDefaults to `false`\n\n</td></tr>\n<tr><td>\n\n[maxIdlePreloads?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ Maximum number of simultaneous preload links that the preloader will maintain. If you set this higher, the browser will have all JS files in memory sooner, but it will contend with other resource downloads. Furthermore, if a bundle suddenly becomes more likely, it will have to wait longer to be preloaded.\n\nBundles that reach 100% probability (static imports of other bundles) will always be preloaded immediately, no limit.\n\nDefaults to `25`\n\n</td></tr>\n<tr><td>\n\n[preloadProbability?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[ssrPreloadProbability?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ The minimum probability for a bundle to be added as a preload link during SSR.\n\nDefaults to `0.7` (70% probability)\n\nThis makes sure that the most likely bundles are preloaded ahead of time.\n\n</td></tr>\n<tr><td>\n\n[ssrPreloads?](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n_(Optional)_ Maximum number of preload links to add during SSR. These instruct the browser to preload likely bundles before the preloader script is active. This most likely includes the core and the preloader script itself. Setting this to 0 will disable all preload links.\n\nPreload links can delay LCP, which is a Core Web Vital, but it can increase TTI, which is not a Core Web Vital but more noticeable to the user.\n\nDefaults to `5`\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"qwikloaderoptions\">QwikLoaderOptions</h2>\n\n```typescript\nexport type QwikLoaderOptions =\n  | \"module\"\n  | \"inline\"\n  | \"never\"\n  | {\n      include?: \"always\" | \"never\" | \"auto\";\n      position?: \"top\" | \"bottom\";\n    };\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"render\">Render</h2>\n\n```typescript\nexport type Render = RenderToString | RenderToStream;\n```\n\n**References:** [RenderToString](#rendertostring), [RenderToStream](#rendertostream)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"renderoptions\">RenderOptions</h2>\n\n```typescript\nexport interface RenderOptions extends SerializeDocumentOptions\n```\n\n**Extends:** [SerializeDocumentOptions](#serializedocumentoptions)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[base?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| ((options: [RenderOptions](#renderoptions)) =&gt; string)\n\n</td><td>\n\n_(Optional)_ Specifies the root of the JS files of the client build. Setting a base, will cause the render of the `q:base` attribute in the `q:container` element.\n\n</td></tr>\n<tr><td>\n\n[containerAttributes?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[containerTagName?](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n_(Optional)_ When set, the app is serialized into a fragment. And the returned html is not a complete document. Defaults to `html`\n\n</td></tr>\n<tr><td>\n\n[locale?](#)\n\n</td><td>\n\n</td><td>\n\nstring \\| ((options: [RenderOptions](#renderoptions)) =&gt; string)\n\n</td><td>\n\n_(Optional)_ Language to use when rendering the document.\n\n</td></tr>\n<tr><td>\n\n[prefetchStrategy?](#)\n\n</td><td>\n\n</td><td>\n\n[PrefetchStrategy](#prefetchstrategy) \\| null\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[preloader?](#)\n\n</td><td>\n\n</td><td>\n\n[PreloaderOptions](#preloaderoptions) \\| false\n\n</td><td>\n\n_(Optional)_ Specifies how preloading is handled. This ensures that code is instantly available when needed.\n\n</td></tr>\n<tr><td>\n\n[qwikLoader?](#)\n\n</td><td>\n\n</td><td>\n\n[QwikLoaderOptions](#qwikloaderoptions)\n\n</td><td>\n\n_(Optional)_ Specifies how the Qwik Loader is included in the document. This enables interactivity and lazy loading.\n\n`module`: Use a `<script>` tag to load the Qwik Loader. Subsequent page loads will have the script cached and instantly running.\n\n`inline`: This embeds the Qwik Loader script directly in the document. This adds about 3kB before compression, which typically is reduced to about 1.6kB with gzip.\n\n`never`: Do not include the Qwik Loader script. This is mostly useful when embedding multiple containers on the same page.\n\nDefaults to `module`.\n\nNote that the Qwik Loader is absolutely required for Qwik to work. There must be an instance of it loaded for any interactivity to happen.\n\n</td></tr>\n<tr><td>\n\n[qwikPrefetchServiceWorker?](#)\n\n</td><td>\n\n</td><td>\n\nQwikPrefetchServiceWorkerOptions\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[serverData?](#)\n\n</td><td>\n\n</td><td>\n\nRecord&lt;string, any&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[snapshot?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_ Defaults to `true`\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"renderresult\">RenderResult</h2>\n\n```typescript\nexport interface RenderResult\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[isStatic](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[manifest?](#)\n\n</td><td>\n\n</td><td>\n\nServerQwikManifest\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[prefetchResources](#)\n\n</td><td>\n\n</td><td>\n\n[PrefetchResource](#prefetchresource)[]\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[snapshotResult](#)\n\n</td><td>\n\n</td><td>\n\nSnapshotResult \\| undefined\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"rendertostream-function\">renderToStream</h2>\n\n```typescript\nexport type RenderToStream = (\n  opts: RenderToStreamOptions,\n) => Promise<RenderToStreamResult>;\n```\n\n**References:** [RenderToStreamOptions](#rendertostreamoptions), [RenderToStreamResult](#rendertostreamresult)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/render.ts)\n\n<h2 id=\"rendertostream-type-alias\">RenderToStream</h2>\n\n```typescript\nexport type RenderToStream = (\n  opts: RenderToStreamOptions,\n) => Promise<RenderToStreamResult>;\n```\n\n**References:** [RenderToStreamOptions](#rendertostreamoptions), [RenderToStreamResult](#rendertostreamresult)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"rendertostreamoptions\">RenderToStreamOptions</h2>\n\n```typescript\nexport interface RenderToStreamOptions extends RenderOptions\n```\n\n**Extends:** [RenderOptions](#renderoptions)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[stream](#)\n\n</td><td>\n\n</td><td>\n\nStreamWriter\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[streaming?](#)\n\n</td><td>\n\n</td><td>\n\n[StreamingOptions](#streamingoptions)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"rendertostreamresult\">RenderToStreamResult</h2>\n\n```typescript\nexport interface RenderToStreamResult extends RenderResult\n```\n\n**Extends:** [RenderResult](#renderresult)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[flushes](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[size](#)\n\n</td><td>\n\n</td><td>\n\nnumber\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[timing](#)\n\n</td><td>\n\n</td><td>\n\n\\{ firstFlush: number; render: number; snapshot: number; }\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"rendertostring-function\">renderToString</h2>\n\n```typescript\nexport type RenderToString = (\n  opts: RenderToStringOptions,\n) => Promise<RenderToStringResult>;\n```\n\n**References:** [RenderToStringOptions](#rendertostringoptions), [RenderToStringResult](#rendertostringresult)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/render.ts)\n\n<h2 id=\"rendertostring-type-alias\">RenderToString</h2>\n\n```typescript\nexport type RenderToString = (\n  opts: RenderToStringOptions,\n) => Promise<RenderToStringResult>;\n```\n\n**References:** [RenderToStringOptions](#rendertostringoptions), [RenderToStringResult](#rendertostringresult)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"rendertostringoptions\">RenderToStringOptions</h2>\n\n```typescript\nexport interface RenderToStringOptions extends RenderOptions\n```\n\n**Extends:** [RenderOptions](#renderoptions)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"rendertostringresult\">RenderToStringResult</h2>\n\n```typescript\nexport interface RenderToStringResult extends RenderResult\n```\n\n**Extends:** [RenderResult](#renderresult)\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[html](#)\n\n</td><td>\n\n</td><td>\n\nstring\n\n</td><td>\n\n</td></tr>\n<tr><td>\n\n[timing](#)\n\n</td><td>\n\n</td><td>\n\n\\{ render: number; snapshot: number; }\n\n</td><td>\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"resolvemanifest\">resolveManifest</h2>\n\nMerges a given manifest with the built manifest and provides mappings for symbols.\n\n```typescript\nexport declare function resolveManifest(\n  manifest?: Partial<QwikManifest | ResolvedManifest> | undefined,\n): ResolvedManifest | undefined;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nmanifest\n\n</td><td>\n\nPartial&lt;QwikManifest \\| ResolvedManifest&gt; \\| undefined\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nResolvedManifest \\| undefined\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/render.ts)\n\n<h2 id=\"serializedocumentoptions\">SerializeDocumentOptions</h2>\n\n```typescript\nexport interface SerializeDocumentOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[debug?](#)\n\n</td><td>\n\n</td><td>\n\nboolean\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[manifest?](#)\n\n</td><td>\n\n</td><td>\n\nPartial&lt;QwikManifest \\| ResolvedManifest&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n<tr><td>\n\n[symbolMapper?](#)\n\n</td><td>\n\n</td><td>\n\nSymbolMapperFn\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"setserverplatform\">setServerPlatform</h2>\n\n```typescript\nexport declare function setServerPlatform(\n  manifest?: Partial<QwikManifest | ResolvedManifest>,\n): Promise<void>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\nmanifest\n\n</td><td>\n\nPartial&lt;QwikManifest \\| ResolvedManifest&gt;\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;void&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/index.ts)\n\n<h2 id=\"streamingoptions\">StreamingOptions</h2>\n\n```typescript\nexport interface StreamingOptions\n```\n\n<table><thead><tr><th>\n\nProperty\n\n</th><th>\n\nModifiers\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[inOrder?](#)\n\n</td><td>\n\n</td><td>\n\n[InOrderStreaming](#inorderstreaming)\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"symbolstoprefetch\">SymbolsToPrefetch</h2>\n\nAuto: Prefetch all possible QRLs used by the document. Default\n\n```typescript\nexport type SymbolsToPrefetch =\n  | \"auto\"\n  | ((opts: { manifest: ServerQwikManifest }) => PrefetchResource[]);\n```\n\n**References:** [PrefetchResource](#prefetchresource)\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)\n\n<h2 id=\"versions\">versions</h2>\n\n```typescript\nversions: {\n    readonly qwik: string;\n    readonly qwikDom: string;\n}\n```\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/utils.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-testing/api.json",
    "content": "{\n  \"id\": \"qwik-testing\",\n  \"package\": \"@builder.io/qwik/testing\",\n  \"members\": [\n    {\n      \"name\": \"createDOM\",\n      \"id\": \"createdom\",\n      \"hierarchy\": [\n        {\n          \"name\": \"createDOM\",\n          \"id\": \"createdom\"\n        }\n      ],\n      \"kind\": \"Function\",\n      \"content\": \"CreatePlatform and CreateDocument\\n\\n\\n```typescript\\ncreateDOM: ({ html }?: {\\n    html?: string;\\n}) => Promise<{\\n    render: (jsxElement: JSXOutput) => Promise<import(\\\"@builder.io/qwik\\\").RenderResult>;\\n    screen: HTMLElement;\\n    userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<void>;\\n}>\\n```\\n\\n\\n<table><thead><tr><th>\\n\\nParameter\\n\\n\\n</th><th>\\n\\nType\\n\\n\\n</th><th>\\n\\nDescription\\n\\n\\n</th></tr></thead>\\n<tbody><tr><td>\\n\\n{ html }\\n\\n\\n</td><td>\\n\\n{ html?: string; }\\n\\n\\n</td><td>\\n\\n_(Optional)_\\n\\n\\n</td></tr>\\n</tbody></table>\\n\\n**Returns:**\\n\\nPromise&lt;{ render: (jsxElement: JSXOutput) =&gt; Promise&lt;import(\\\"@builder.io/qwik\\\").RenderResult&gt;; screen: HTMLElement; userEvent: (queryOrElement: string \\\\| Element \\\\| keyof HTMLElementTagNameMap \\\\| null, eventNameCamel: string \\\\| keyof WindowEventMap, eventPayload?: any) =&gt; Promise&lt;void&gt;; }&gt;\",\n      \"editUrl\": \"https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/testing/library.ts\",\n      \"mdFile\": \"qwik.createdom.md\"\n    }\n  ]\n}"
  },
  {
    "path": "packages/docs/src/routes/api/qwik-testing/index.mdx",
    "content": "---\ntitle: \\@builder.io/qwik/testing API Reference\n---\n\n# [API](/api) &rsaquo; @builder.io/qwik/testing\n\n<h2 id=\"createdom\">createDOM</h2>\n\nCreatePlatform and CreateDocument\n\n```typescript\ncreateDOM: ({ html }?: { html?: string }) =>\n  Promise<{\n    render: (\n      jsxElement: JSXOutput,\n    ) => Promise<import(\"@builder.io/qwik\").RenderResult>;\n    screen: HTMLElement;\n    userEvent: (\n      queryOrElement: string | Element | keyof HTMLElementTagNameMap | null,\n      eventNameCamel: string | keyof WindowEventMap,\n      eventPayload?: any,\n    ) => Promise<void>;\n  }>;\n```\n\n<table><thead><tr><th>\n\nParameter\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead>\n<tbody><tr><td>\n\n\\{ html }\n\n</td><td>\n\n\\{ html?: string; }\n\n</td><td>\n\n_(Optional)_\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;\\{ render: (jsxElement: JSXOutput) =&gt; Promise&lt;import(\"@builder.io/qwik\").RenderResult&gt;; screen: HTMLElement; userEvent: (queryOrElement: string \\| Element \\| keyof HTMLElementTagNameMap \\| null, eventNameCamel: string \\| keyof WindowEventMap, eventPayload?: any) =&gt; Promise&lt;void&gt;; }&gt;\n\n[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/testing/library.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/community/groups/index.mdx",
    "content": "---\ntitle: Groups | Qwik Community\ncontributors:\n  - shairez\n  - jmoont\n  - mhevery\n  - jakovljevic-mladen\n  - manucorporat\n  - cunzaizhuyi\n  - the-r3aper7\n  - ayoub9494\n  - mrhoodz\n  - Marcoo09\n  - apherio\n  - salamaashoush\n  - adamdbradley\nupdated_at: '2023-10-15T10:09:17Z'\ncreated_at: '2023-02-03T20:09:34Z'\n---\nimport ImgDiscord from '~/media/ecosystem/discord.svg?jsx';\nimport ImgQwikNewsletter from '~/media/ecosystem/qwik-newsletter.svg?jsx';\n\n\n# Qwik Community\n\nWe are lucky to have such a welcoming and beginner friendly community\nthat love to help each other learn and grow.\n\nPlease read our [community values](/community/values), join our community groups\nand spread your love for innovation!\n\n> Want to start a local Qwik community?\n> [Please apply here for the Qwik Community Leaders program](https://forms.gle/S1rxiKiVdhZqkk8RA)\n\n### 🌏 Global Communities\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://qwik.dev/chat\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/discord.svg\" width={84} height={84} /></p>\n    <h3>Official Qwik Community on Builder.io's Discord server</h3>\n  </a>\n</div>\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://www.facebook.com/groups/qwikdevs\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/facebook.svg\" width={56} height={56} /></p>\n    <h3>Qwik Developers Facebook Group</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://www.linkedin.com/groups/12677766/\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/linkedin.svg\" width={56} height={56} /></p>\n    <h3>Qwik Developers Linkedin Group</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://t.me/qwikdevs\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/telegram.svg\" width={56} height={56} /></p>\n    <h3>Qwik Developers Channel on Telegram</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://www.reddit.com/r/qwik/\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/reddit.svg\" width={56} height={56} /></p>\n    <h3>Qwik on Reddit</h3>\n  </a>\n</div>\n\n### Communities By Country\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://www.meetup.com/qwik-london/\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/qwik-london.svg\" width={56} height={56} /></p>\n    <h3>Qwik London Meetup Group</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://www.facebook.com/groups/836365297555873\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/qwik-taiwan.svg\" width={56} height={56} /></p>\n    <h3>Qwik Taiwan  Facebook Group</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://www.linkedin.com/groups/14153723/\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/qwik-france.svg\" width={56} height={56} /></p>\n    <h3>Qwik France Linkedin Group</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://www.facebook.com/groups/qwikisrael\">\n    <p class=\"icon\" align=\"center\"><img src=\"/ecosystem/qwik-israel.svg\" width={56} height={56} /></p>\n    <h3>Qwik Israel Facebook Group</h3>\n  </a>\n</div>\n\n### Newsletters\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://qwiknewsletter.com\">\n    <p class=\"icon\" align=\"center\"><ImgQwikNewsletter/></p>\n    <h3>Qwikly Newsletter - Weekly news about Qwik</h3>\n  </a>\n</div>\n"
  },
  {
    "path": "packages/docs/src/routes/community/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from '@builder.io/qwik';\nimport { SideBar } from '../../components/sidebar/sidebar';\nimport { Footer } from '../../components/footer/footer';\nimport { Header } from '../../components/header/header';\nimport { OnThisPage } from '../../components/on-this-page/on-this-page';\nimport { ContentNav } from '../../components/content-nav/content-nav';\nimport styles from '../docs/docs.css?inline';\n\nexport { useMarkdownItems } from '../../components/sidebar/sidebar';\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  return (\n    <div class=\"docs fixed-header\">\n      <Header />\n      <div class=\"flex gap-12 xl:gap-20 items-stretch content-container\">\n        <SideBar />\n        <main class=\"contents\">\n          <div class=\"docs-container\">\n            <article>\n              <Slot />\n            </article>\n            <ContentNav />\n            <Footer />\n          </div>\n          <OnThisPage />\n        </main>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/community/menu.md",
    "content": "# Community\n\n## Community\n\n- [Groups](groups/index.mdx)\n- [Projects](projects/index.mdx)\n- [Values](values/index.mdx)\n"
  },
  {
    "path": "packages/docs/src/routes/community/projects/index.mdx",
    "content": "---\ntitle: Projects | Qwik Community\ncontributors:\n  - shairez\n  - cunzaizhuyi\n  - the-r3aper7\n  - manucorporat\n  - fabian-hiller\n  - xinnks\n  - mrhoodz\n  - meeroslav\n  - adamdbradley\nupdated_at: '2023-08-24T16:15:35Z'\ncreated_at: '2023-02-03T20:09:34Z'\n---\n\n# Community Projects\n\n### Components libraries\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://github.com/qwikifiers/qwik-ui\">\n    <p class=\"icon\" align=\"center\"><img src=\"https://raw.githubusercontent.com/qwikifiers/qwik-ui/main/apps/website/public/images/qwik-ui.png\" width=\"256px\"/></p>\n    <h3>Qwik UI - The first Qwik ui components library</h3>\n  </a>\n</div>\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://papanasi.js.org/\">\n    <p class=\"icon\" align=\"center\"><img src=\"https://raw.githubusercontent.com/CKGrafico/papanasi/main/docs/resources/logo-text.svg\" width=\"172px\"/></p>\n    <h3>Papanasi - a universal UI library based on Mitosis</h3>\n  </a>\n</div>\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://github.com/juergenie/ionic-qwik/\">\n    <p class=\"icon\" align=\"center\"><img src=\"https://raw.githubusercontent.com/juergenie/ionic-qwik/main/logo.svg\" width=\"172px\"/></p>\n    <h3>Ionic-qwik - The cross-platform web-components `@ionic/core`'s wrapper for qwik.</h3>\n  </a>\n</div>\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://github.com/qwikifiers/qwik-storefront-ui\">\n    <p class=\"icon\" align=\"center\"><img src=\"https://raw.githubusercontent.com/QwikDev/qwik/main/packages/docs/public/ecosystem/qwik-storefront-ui.png\" width=\"256px\"/></p>\n    <h3>UI library that helps developers create storefronts</h3>\n  </a>\n</div>\n\n### Form libraries\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://modularforms.dev/\">\n    <p class=\"icon\" align=\"center\"><img src=\"https://raw.githubusercontent.com/fabian-hiller/modular-forms/main/website/public/android-icon-512x512.png\" width=\"128px\"/></p>\n    <h3>Modular Forms - The modular and type-safe form library for Qwik</h3>\n  </a>\n</div>\n\n### Integrations\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://github.com/qwikifiers/qwik-nx\">\n    <p class=\"icon\" align=\"center\"><img src=\"https://raw.githubusercontent.com/qwikifiers/qwik-nx/main/assets/qwik-nx.png\" width=\"256px\"/></p>\n    <h3>Qwik Nx - A plugin for nx (the monorepo management tool)</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://github.com/wmertens/styled-vanilla-extract\">\n    <p class=\"icon\">⚡️+💅</p>\n    <h3>Qwik + Vanilla Extract</h3>\n  </a>\n</div>\n\n### IDE Extensions\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://github.com/qwikverse/vscode-qwik-snippets\">\n    <p class=\"icon\" align=\"center\"><img src=\"https://raw.githubusercontent.com/qwikverse/vscode-qwik-snippets/main/assets/qwik-snippets.png\" width=\"128px\"/></p>\n    <h3>Qwik VSCode snippets</h3>\n  </a>\n</div>\n\n### Example apps\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"https://github.com/xinnks/turqw-newsletter\">\n    <p class=\"icon\">📰</p>\n    <h3>Newsletter manager made with Qwik and Turso</h3>\n  </a>\n</div>\n\nIf you have more projects to add, please [edit this page](https://github.com/QwikDev/qwik/edit/main/packages/docs/src/routes/community/projects/index.mdx)\n"
  },
  {
    "path": "packages/docs/src/routes/community/values/index.mdx",
    "content": "---\ntitle: Values | Qwik Community\ncontributors:\n  - shairez\n  - cunzaizhuyi\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-02-03T20:09:34Z'\n---\n\n## Qwik Community Values:\n\n---\n\n#### ✅ All questions are good questions.\n\nThere is no such thing as _\" that's a noob question\"_ in our community.\nWe value our community members for their patience, helpfulness and welcoming attitude towards newcomers that make everyone feel at home.\nSo always feel comfortable asking any question that comes to mind about anything Qwik or JS related.\n\n---\n\n#### ✅ Be respectful and inclusive\n\nWe are a global community where members join from different cultures and backgrounds and have different styles of communication.\nBecause of that we'd like to ask you to mind how you phrase your questions / answers / discussion points.\nAs text has no tone, it's important to be extra mindful on how we communicate and appreciate each other's attempt to help.  \nIt's totally OK not to agree with others as long as we respect each other at the same time.\n\n**Always think**: \"How would I like to be treated?\"\" and treat others the same way.\n\n---\n\n#### ✅ Support and encourage each other\n\nWe like to praise members in our community for their efforts.\nIf you see anyone sharing a Qwik related project, blog post, video, or any \"win\"…\ngive them a 👏 or 🚀 or any other emoji or kind words that will brighten their day.\nIf you see someone struggling, give them words of encouragement and if possible,\nhelp them out. Remember - teaching is the best way to learn, plus, it's good karma 😉\n\n---\n\n#### ✅ Follow the boy/girl scout rule:\n\n_\"Always leave the place better than you found it.\"_\n\nIf you see anything that could be better - please open up a PR or an issue or reach out to us.\n\n**For example:** think something in the docs doesn't make sense?\nplease don't close the page, but instead - click the \"Edit this page\" link and try to improve it.\nYou'll be doing a huge favor for the rest of us, so thank you!\n\n---\n\n#### ✅ Respect other solutions\n\nWe are all in this JavaScript game together and there's a lot to learn from each other.\nWithout other frameworks / solutions innovation would have stopped and we couldn't be where we are today.\n\nThat's why we embrace the entire JS ecosystem and welcome collaboration with all the other frameworks and libraries.\nThat's also why we believe that Qwik members should feel free to share their love for other solutions without the fear of being criticized for their choices.\nOur community is a safe environment for ALL developers.\n\n---\n\n#### ✅ Keep it fun\n\nWe like to keep things light and fun, so you might see silly emojis, contests,\ncommit messages etc. Feel free to join the silliness! 🤪😊\n"
  },
  {
    "path": "packages/docs/src/routes/demo/.prettierrc.json",
    "content": "{\n  \"trailingComma\": \"es5\",\n  \"tabWidth\": 2,\n  \"semi\": true,\n  \"singleQuote\": true,\n  \"printWidth\": 79,\n  \"useTabs\": false\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/api/add/index.tsx",
    "content": "import type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ query, json }) => {\n  const a = Number.parseFloat(query.get('a') || '0');\n  const b = Number.parseFloat(query.get('b') || '0');\n  const delayMs = Number.parseInt(query.get('delay') || '0');\n  await delay(delayMs);\n  json(200, a + b);\n};\n\nconst delay = (ms: number) => new Promise((res) => setTimeout(res, ms));\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/child/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Parent Text</p>\n      <Child />\n    </>\n  );\n});\n\nconst Child = component$(() => {\n  return <p>Child Text</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/inline-child/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\n// Inline component: declared using a standard function.\nexport const MyButton = (props: { text: string }) => {\n  return <button>{props.text}</button>;\n};\n\n// Component: declared using `component$()`.\nexport default component$(() => {\n  return (\n    <p>\n      Some text:\n      <MyButton text=\"Click me\" />\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/lazy/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const Child = component$(() => {\n  return <p>child</p>;\n});\n\nexport const Parent = component$(() => {\n  return (\n    <section>\n      <Child />\n    </section>\n  );\n});\n\nexport default Parent;\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/primitive-props/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\nimport type { Signal } from '@builder.io/qwik';\n\ninterface ItemProps {\n  name?: string;\n  quantity?: number;\n  description?: string;\n  price?: Signal<number>;\n}\n\nexport const Item = component$<ItemProps>((props) => {\n  const localQuantity = useSignal(props.quantity);\n\n  return (\n    <ul>\n      <li>name: {props.name}</li>\n      <li>quantity: {localQuantity}</li>\n      <li>description: {props.description}</li>\n      <li>price: {props.price}</li>\n    </ul>\n  );\n});\n\nexport default component$(() => {\n  const price = useSignal(9.99);\n\n  return (\n    <>\n      <h1>Props</h1>\n      <Item name=\"hammer\" price={price} quantity={5} />\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/props/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ninterface ItemProps {\n  name?: string;\n  quantity?: number;\n  description?: string;\n  price?: number;\n}\n\nexport const Item = component$<ItemProps>((props) => {\n  return (\n    <ul>\n      <li>name: {props.name}</li>\n      <li>quantity: {props.quantity}</li>\n      <li>description: {props.description}</li>\n      <li>price: {props.price}</li>\n    </ul>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Props</h1>\n      <Item name=\"hammer\" price={9.99} />\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/ref/index.tsx",
    "content": "import { component$, useVisibleTask$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const width = useSignal(0);\n  const height = useSignal(0);\n  const outputRef = useSignal<Element>();\n\n  useVisibleTask$(() => {\n    if (outputRef.value) {\n      const rect = outputRef.value.getBoundingClientRect();\n      width.value = Math.round(rect.width);\n      height.value = Math.round(rect.height);\n    }\n  });\n\n  return (\n    <section>\n      <article\n        ref={outputRef}\n        style={{ border: '1px solid red', width: '100px' }}\n      >\n        Change text value here to stretch the box.\n      </article>\n      <p>\n        The above red box is {height.value} pixels high and {width.value}{' '}\n        pixels wide.\n      </p>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/reference-props/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ninterface ItemProps {\n  details: {\n    name?: string;\n    quantity?: number;\n    description?: string;\n    price?: number;\n  };\n}\n\nexport const Item = component$((props: ItemProps) => {\n  props.details.price = 4.99;\n\n  return (\n    <ul>\n      <li>name: {props.details.name}</li>\n      <li>quantity: {props.details.quantity}</li>\n      <li>description: {props.details.description}</li>\n      <li>price: {props.details.price}</li>\n    </ul>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Item\n      details={{ name: 'hammer', quantity: 5, description: '', price: 9.99 }}\n    />\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/relativeUrl/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation();\n  const relativeUrl = '/mock';\n  const absoluteUrl = loc.url.origin + relativeUrl;\n\n  return (\n    <section>\n      <div>Relative URL: {relativeUrl}</div>\n      <div>Absolute URL: {absoluteUrl}</div>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/simple/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <div>Hello World!</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/component/useId/index.tsx",
    "content": "import {\n  component$,\n  useId,\n  useSignal,\n  useVisibleTask$,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const elemIdSignal = useSignal<string | null>(null);\n  const id = useId();\n  const elemId = `${id}-example`;\n  console.log('server-side id:', elemId);\n\n  useVisibleTask$(() => {\n    const elem = document.getElementById(elemId);\n    elemIdSignal.value = elem?.getAttribute('id') || null;\n    console.log('client-side id:', elemIdSignal.value);\n  });\n\n  return (\n    <section>\n      <div id={elemId}>\n        Both server-side and client-side console should match this id:\n        <br />\n        <b>{elemIdSignal.value || null}</b>\n      </div>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/context/minimal/index.tsx",
    "content": "import { type Signal, component$, useSignal } from '@builder.io/qwik';\nimport {\n  useContext,\n  useContextProvider,\n  createContextId,\n} from '@builder.io/qwik';\n\nexport const ThemeContext = createContextId<Signal<string>>(\n  'docs.theme-context'\n);\n\nexport default component$(() => {\n  const theme = useSignal('dark');\n  useContextProvider(ThemeContext, theme);\n  return (\n    <>\n      <button\n        onClick$={() =>\n          (theme.value = theme.value == 'dark' ? 'light' : 'dark')\n        }\n      >\n        Flip\n      </button>\n      <Child />\n    </>\n  );\n});\n\nconst Child = component$(() => {\n  const theme = useContext(ThemeContext);\n  return <div>Theme is {theme.value}</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/algolia-search/index.tsx",
    "content": "import { $, component$, useSignal, useStylesScoped$ } from '@builder.io/qwik';\n\ntype AlgoliaResult = {\n  hits: {\n    type: string;\n    anchor?: string;\n    content?: string;\n    url: string;\n  }[];\n};\n\nexport default component$(() => {\n  useStylesScoped$(`\n\t\t.search {\n\t\t\tfont-size: 100%;\n\t\t\twidth: calc(100% - 38px);\n\t\t\tborder-radius: 0.5rem;\n\t\t\tborder: 1px black solid;\n\t\t\tpadding: 1rem;\n\t\t\tcolor: black;\n\t\t\toutline: none;\n\t\t}\n\n\t\t.search-button {\n\t\t\tborder: none;\n\t\t\tpadding: 6px 0px;\n\t\t\tcursor: pointer;\n\t\t\tbackground-color: transparent;\n\t\t\tposition: absolute;\n      right: 2.4rem;\n      padding: 0.85rem 0.5rem 0.4rem 0.5rem;\n\t\t\toutline: none;\n\t\t}\n\n\t\t.list {\n      display: flex;\n      flex-direction: column;\n      align-items: center;\n    }\n\n    .list li {\n      counter-increment: cardCount;\n      display: flex;\n      color: white;\n      margin-top: 1rem;\n      margin-bottom: 1rem;\n      max-width: 500px;\n    }\n\n    .list li::before {\n      content: counter(cardCount, decimal-leading-zero);\n      background: white;\n      color: var(--cardColor);\n      font-size: 2em;\n      font-weight: 700;\n      transform: translateY(calc(-1 * 1rem));\n      margin-right: calc(-1 * 1rem);\n      z-index: 1;\n      display: flex;\n      align-items: center;\n      padding-inline: 0.5em;\n      border: 1px solid black;\n    }\n\n    .list li .content {\n      background-color: var(--cardColor);\n      display: grid;\n      padding: 0.5em calc(1em + 1.5rem) 0.5em calc(1em + 1rem);\n      grid-template-areas:\n        \"icon title\"\n        \"icon text\";\n      gap: 0.25em;\n      clip-path: polygon(\n        0 0,\n        calc(100% - 1.5rem) 0,\n        100% 50%,\n        calc(100% - 1.5rem) 100%,\n        calc(100% - 1.5rem) calc(100% + 1rem),\n        0 calc(100% + 1rem)\n      );\n    }\n\n    .list li .content .title {\n      grid-area: title;\n      font-size: 1.25em;\n    }\n\n    .list li .content .text {\n      grid-area: text;\n      color: black;\n    }    \n\t`);\n  const termSignal = useSignal('');\n  const hitsSig = useSignal<AlgoliaResult['hits']>([]);\n\n  const onSearch = $(async (query: string) => {\n    const algoliaURL = new URL(\n      `/1/indexes/${import.meta.env.VITE_ALGOLIA_INDEX}/query`,\n      `https://${import.meta.env.VITE_ALGOLIA_APP_ID}-dsn.algolia.net`\n    );\n    const response = await fetch(algoliaURL, {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'X-Algolia-Application-Id': import.meta.env.VITE_ALGOLIA_APP_ID!,\n        'X-Algolia-API-Key': import.meta.env.VITE_ALGOLIA_SEARCH_KEY!,\n      },\n      body: JSON.stringify({ query }),\n    });\n    const algoliaResult: AlgoliaResult = await response.json();\n    hitsSig.value = algoliaResult.hits;\n  });\n\n  return (\n    <div>\n      <div style=\"margin: 1rem;\">\n        <div style=\"position: relative;\">\n          <input\n            class=\"search\"\n            placeholder=\"Algolia search: type here and press enter\"\n            bind:value={termSignal}\n            onKeyDown$={(e) => {\n              if (e.key === 'Enter') {\n                onSearch(termSignal.value);\n              }\n            }}\n          />\n          <button\n            type=\"submit\"\n            class=\"search-button\"\n            onClick$={() => onSearch(termSignal.value)}\n          >\n            <svg\n              xmlns=\"http://www.w3.org/2000/svg\"\n              width=\"32\"\n              height=\"32\"\n              viewBox=\"0 0 24 24\"\n            >\n              <path\n                fill=\"currentColor\"\n                d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\"\n              />\n            </svg>\n          </button>\n        </div>\n      </div>\n      <div class=\"list\">\n        {hitsSig.value.map(({ anchor, content, url }, key) => (\n          <li\n            key={key}\n            style={`--cardColor:${key % 2 === 0 ? '#19b6f6' : '#ac7ef4'}`}\n          >\n            <div class=\"content\">\n              <div class=\"title\">\n                {(anchor || content || url || '').substring(0, 30)}\n              </div>\n              <a class=\"text\" href={url}>\n                Documentation link\n              </a>\n            </div>\n          </li>\n        ))}\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/combine-request-handlers/index.tsx",
    "content": "import type { RequestHandler } from '@builder.io/qwik-city';\n\n/**\n * Combines multiple request handlers into a single request handler.\n *\n * The handlers will be called in order:\n *\n * 1. Handler1 before next()\n * 2. Handler2 before next()\n * 3. Handler3 before next()\n * 4. Next()\n * 5. Handler3 after next()\n * 6. Handler2 after next()\n * 7. Handler1 after next()\n *\n * @public\n */\n\nexport const combineRequestHandlers =\n  (...handlers: RequestHandler[]): RequestHandler =>\n  async (originalContext) => {\n    let lastNext = originalContext.next;\n    for (let i = handlers.length - 1; i >= 0; i--) {\n      const currentHandler = handlers[i];\n      const nextInChain = lastNext;\n      lastNext = async () => {\n        await currentHandler({ ...originalContext, next: nextInChain });\n      };\n    }\n\n    await lastNext();\n  };\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/debouncer/index.tsx",
    "content": "import {\n  $,\n  useSignal,\n  component$,\n  type QRL,\n  useStylesScoped$,\n} from '@builder.io/qwik';\n\nexport const useDebouncer = (fn: QRL<(args: any) => void>, delay: number) => {\n  const timeoutId = useSignal<number>();\n\n  return $((args: any) => {\n    clearTimeout(timeoutId.value);\n    timeoutId.value = Number(setTimeout(() => fn(args), delay));\n  });\n};\n\nexport default component$(() => {\n  useStylesScoped$(`\n    input {\n      margin: 0px;\n      padding: 8px;\n      font-size: 20px;\n    }\n\n    label {\n      font-weight: bold;\n      font-size: 20px;\n      color: #1dacf2;\n    }\n\n    span {\n      color: #888;\n    }\n  `);\n\n  const debouncedValue = useSignal('');\n\n  const debounce = useDebouncer(\n    $((value: string) => {\n      debouncedValue.value = value;\n    }),\n    1000\n  );\n\n  return (\n    <>\n      <input\n        placeholder=\"Type something\"\n        onInput$={(_, target) => {\n          debounce(target.value);\n        }}\n      />\n      <br />\n      <br />\n      <label>Debounced Value</label>\n      {debouncedValue.value ? (\n        debouncedValue.value\n      ) : (\n        <span>Waiting for input to debounce.</span>\n      )}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/detect-img-tag-onload/index.tsx",
    "content": "import { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const imgRef = useSignal<HTMLImageElement>();\n  useVisibleTask$(() => {\n    imgRef.value!.decode().then(() => {\n      alert('loaded and ready!');\n    });\n  });\n\n  return (\n    <section>\n      <img ref={imgRef} src=\"/logos/qwik-logo.svg\" height={200} width={200} />\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/drag&drop/advanced/index.tsx",
    "content": "import { component$, sync$, useSignal, $ } from '@builder.io/qwik';\n\ntype Item = {\n  id: number;\n  content: string;\n};\n\nexport default component$(() => {\n  const items1 = useSignal<Item[]>([\n    { id: 1, content: '📱 Phone' },\n    { id: 2, content: '💻 Laptop' },\n    { id: 3, content: '🎧 Headphones' },\n  ]);\n\n  const items2 = useSignal<Item[]>([\n    { id: 4, content: '⌚️ Watch' },\n    { id: 5, content: '🖱 Mouse' },\n    { id: 6, content: '⌨️ Keyboard' },\n  ]);\n\n  return (\n    <div class=\"flex min-h-screen justify-center gap-8 bg-gray-50 p-8\">\n      <div\n        data-dropzone\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        })}\n        onDragLeave$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.removeAttribute('data-over');\n        })}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text/plain');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((e, currentTarget) => {\n            const draggedElementId = currentTarget.dataset.droppedId;\n            const isDropZone = currentTarget.hasAttribute('data-dropzone');\n\n            if (draggedElementId) {\n              const itemId = parseInt(draggedElementId);\n              const item = items2.value.find((i) => i.id === itemId);\n\n              if (item && isDropZone) {\n                items2.value = items2.value.filter((i) => i.id !== itemId);\n                items1.value = [...items1.value, item];\n              } else {\n                const newItems = [...items1.value];\n                const targetId = parseInt(\n                  (e.target as HTMLDivElement).dataset.id || '0'\n                );\n                if (targetId === 0) {\n                  return;\n                }\n\n                const targetIndex = items1.value.findIndex(\n                  (i) => i.id === targetId\n                );\n                const draggedIndex = items1.value.findIndex(\n                  (i) => i.id === itemId\n                );\n\n                if (draggedIndex !== -1) {\n                  // Sorting in the same container\n                  swapElements(newItems, draggedIndex, targetIndex);\n                  items1.value = newItems;\n                } else {\n                  // Sorting between containers\n                  if (!item) {\n                    return;\n                  }\n                  items2.value = items2.value.filter((i) => i.id !== itemId);\n                  insertElement(newItems, targetIndex, item);\n                  items1.value = newItems;\n                }\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 1</h3>\n        {items1.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n\n      <div\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        data-dropzone\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={(_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        }}\n        onDragLeave$={[\n          sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n            currentTarget.removeAttribute('data-over');\n          }),\n        ]}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text/plain');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((e, currentTarget) => {\n            const draggedElementId = currentTarget.dataset.droppedId;\n            const isDropZone = currentTarget.hasAttribute('data-dropzone');\n\n            if (draggedElementId) {\n              const itemId = parseInt(draggedElementId);\n              const item = items1.value.find((i) => i.id === itemId);\n\n              if (isDropZone && item) {\n                items1.value = items1.value.filter((i) => i.id !== itemId);\n                items2.value = [...items2.value, item];\n              } else {\n                const targetId = parseInt(\n                  (e.target as HTMLDivElement).dataset.id || '0'\n                );\n                if (targetId === 0) {\n                  return;\n                }\n                const newItems = [...items2.value];\n                const draggedIndex = items2.value.findIndex(\n                  (i) => i.id === itemId\n                );\n                const targetIndex = items2.value.findIndex(\n                  (i) => i.id === targetId\n                );\n                if (draggedIndex !== -1) {\n                  // Sorting in the same container\n                  swapElements(newItems, targetIndex, draggedIndex);\n                  items2.value = newItems;\n                } else {\n                  // Sorting between containers\n                  if (!item) {\n                    return;\n                  }\n                  items1.value = items1.value.filter((i) => i.id !== itemId);\n                  insertElement(newItems, targetIndex, item);\n                  items2.value = newItems;\n                }\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 2</h3>\n        {items2.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n});\n\nfunction swapElements(arr: Item[], index1: number, index2: number) {\n  arr[index1] = arr.splice(index2, 1, arr[index1])[0];\n\n  return arr;\n}\n\nfunction insertElement(arr: Item[], index: number, item: Item) {\n  arr.splice(index, 0, item);\n  return arr;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/drag&drop/basic/index.tsx",
    "content": "import { component$, sync$, useSignal, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const items1 = useSignal([\n    { id: 1, content: '📱 Phone' },\n    { id: 2, content: '💻 Laptop' },\n    { id: 3, content: '🎧 Headphones' },\n  ]);\n\n  const items2 = useSignal([\n    { id: 4, content: '⌚️ Watch' },\n    { id: 5, content: '🖱 Mouse' },\n    { id: 6, content: '⌨️ Keyboard' },\n  ]);\n\n  return (\n    <div class=\"flex min-h-screen justify-center gap-8 bg-gray-50 p-8\">\n      <div\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        })}\n        onDragLeave$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.removeAttribute('data-over');\n        })}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((_, currentTarget) => {\n            const id = currentTarget.dataset.droppedId;\n            if (id) {\n              const itemId = parseInt(id);\n              const item = [...items2.value].find((i) => i.id === itemId);\n              if (item) {\n                items2.value = items2.value.filter((i) => i.id !== itemId);\n                items1.value = [...items1.value, item];\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 1</h3>\n        {items1.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer?.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n\n      <div\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        })}\n        onDragLeave$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.removeAttribute('data-over');\n        })}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((_, currentTarget) => {\n            const id = currentTarget.dataset.droppedId;\n            if (id) {\n              const itemId = parseInt(id);\n              const item = [...items1.value].find((i) => i.id === itemId);\n              if (item) {\n                items1.value = items1.value.filter((i) => i.id !== itemId);\n                items2.value = [...items2.value, item];\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 2</h3>\n        {items2.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer?.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/glob-import/examples/example1.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <p>\n      Hi 👋, I'm a component defined in <em>/examples/example1.tsx</em>\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/glob-import/examples/example2.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <p>\n      Hey 👋, I'm a component defined in <em>/examples/example2.tsx</em>\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/glob-import/examples/example3.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <p>\n      Hello 👋, I'm a component defined in <em>/examples/example3.tsx</em>\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/glob-import/index.tsx",
    "content": "import {\n  type Component,\n  component$,\n  useSignal,\n  useTask$,\n} from '@builder.io/qwik';\n\nconst metaGlobComponents: Record<string, any> = import.meta.glob(\n  '/src/routes/demo/cookbook/glob-import/examples/*',\n  { import: 'default' }\n);\n\nexport default component$(() => {\n  return (\n    <div>\n      <MetaGlobExample name=\"example1\" />\n      <MetaGlobExample name=\"example2\" />\n      <MetaGlobExample name=\"example3\" />\n    </div>\n  );\n});\n\nexport const MetaGlobExample = component$<{ name: string }>(({ name }) => {\n  const MetaGlobComponent = useSignal<Component<any>>();\n  const componentPath = `/src/routes/demo/cookbook/glob-import/examples/${name}.tsx`;\n\n  useTask$(async () => {\n    await metaGlobComponents[componentPath]();\n  });\n\n  return <>{MetaGlobComponent.value && <MetaGlobComponent.value />}</>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/leaflet-map/index.tsx",
    "content": "import {\n  component$,\n  noSerialize,\n  useSignal,\n  useStyles$,\n  useVisibleTask$,\n  type Signal,\n} from '@builder.io/qwik';\nimport * as L from 'leaflet';\nimport leafletStyles from 'leaflet/dist/leaflet.css?inline';\n\nexport default component$(() => {\n  useStyles$(\n    leafletStyles +\n      `\n    .marker-label {\n      color: red;\n      font-weight: 700;\n    }\n  `\n  );\n\n  const markers: Record<string, MarkersProps[]> = {\n    FDA: [\n      {\n        name: \"Terzo d'Aquileia\",\n        label: 'TRZ',\n        lat: '45.770946',\n        lon: '13.31338',\n      },\n      {\n        name: 'Musi',\n        label: 'MUS',\n        lat: '46.312663',\n        lon: '13.274682',\n      },\n    ],\n    FVG: [\n      {\n        name: 'Borgo Grotta Gigante',\n        label: 'BGG',\n        lat: '45.709385',\n        lon: '13.764681',\n      },\n      {\n        name: 'Muggia',\n        label: 'MGG',\n        lat: '45.610495',\n        lon: '13.752682',\n      },\n    ],\n  };\n\n  const groupSig = useSignal('FDA');\n  const currentLocation = useSignal<LocationsProps>({\n    name: 'Udine',\n    point: [46.06600881056668, 13.237724558490601],\n    zoom: 10,\n    marker: true,\n  });\n\n  return (\n    <>\n      Change markers:{'  '}\n      <select name=\"group\" class=\"leaflet-ctrl\" bind:value={groupSig}>\n        <option value=\"FDA\">FDA</option>\n        <option value=\"FVG\">FVG</option>\n      </select>\n      <LeafletMap\n        location={currentLocation}\n        markers={markers[groupSig.value]}\n        group={groupSig}\n      ></LeafletMap>\n    </>\n  );\n});\n\n// The properties (props) used in the `LeafletMap` component and other related components are defined as follows:\n\nexport interface MapProps {\n  location: Signal<LocationsProps>;\n  markers?: MarkersProps[];\n  group?: Signal<string>;\n}\n\nexport interface LocationsProps {\n  name: string;\n  point: [number, number];\n  zoom: number;\n  marker: boolean;\n}\n\nexport interface MarkersProps {\n  name: string;\n  label: string;\n  lat: string;\n  lon: string;\n}\n\n/*\nThe `LeafletMap` component leverages the Leaflet library to render an interactive map. \nThis component can be configured with various properties (props) to set the central location, add markers, and draw boundaries.\nIn the `LeafletMap` component, both the location and the group signal are tracked.\nThis ensures that when the signal changes, the server function is called, and the map is updated with the new data.\n*/\n\nexport const LeafletMap = component$<MapProps>(\n  ({ location, markers, group }) => {\n    const mapContainerSig = useSignal<L.Map>();\n\n    useVisibleTask$(async ({ track }) => {\n      track(location);\n      group && track(group);\n\n      if (mapContainerSig.value) {\n        mapContainerSig.value.remove();\n      }\n\n      // center location\n      const { value: locationData } = location;\n      const centerPosition = locationData.point;\n\n      // layers\n      const markersLayer = new L.LayerGroup();\n      const bordersLayer = new L.LayerGroup();\n\n      // map\n      const map = L.map('map', {\n        layers: [markersLayer, bordersLayer],\n      }).setView(centerPosition, locationData.zoom || 14);\n      L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n        maxZoom: 19,\n        attribution:\n          '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n      }).addTo(map);\n\n      // center position marker\n\n      const qwikMarker = L.divIcon({\n        html: ` \n          <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30.12\" height=\"32\" viewBox=\"0 0 256 272\">\n            <path fill=\"#18B6F6\"\n              d=\"m224.803 271.548l-48.76-48.483l-.744.107v-.532L71.606 120.252l25.55-24.667l-15.01-86.12l-71.222 88.247c-12.136 12.226-14.372 32.109-5.642 46.781l44.5 73.788c6.813 11.376 19.163 18.18 32.47 18.074l22.038-.213z\" />\n            <path fill=\"#AC7EF4\"\n              d=\"m251.414 96.01l-9.795-18.075l-5.11-9.25l-2.023-3.615l-.212.213l-26.829-46.463C200.738 7.125 188.176-.105 174.55 0l-23.527.639l-70.158.213c-13.307.106-25.444 7.123-32.151 18.5l-42.69 84.632L82.353 9.25l100.073 109.937l-17.779 17.968l10.646 86.015l.107-.213v.213h-.213l.213.212l8.304 8.081l40.348 39.445c1.704 1.595 4.472-.318 3.3-2.339l-24.911-49.014l43.436-80.273l1.383-1.595c.533-.638 1.065-1.276 1.491-1.914c8.517-11.589 9.688-27.112 2.662-39.764\" />\n            <path fill=\"#FFF\" d=\"M182.746 118.763L82.353 9.358l14.266 85.695l-25.55 24.773L175.08 223.065l-9.368-85.696z\" />\n          </svg>\n        `,\n        className: '',\n        iconSize: [24, 40],\n      });\n\n      locationData.marker &&\n        L.marker(centerPosition, { icon: qwikMarker })\n          .bindPopup(`Udine`)\n          .addTo(map);\n\n      // add markers to map\n      const markersList = await markers;\n      markersList &&\n        markersList.map((m) => {\n          const myIcon = L.divIcon({\n            className: 'marker-point',\n            html: `<div class=\"marker-label\" title=\"${m.name}\" >${m.label}</div>`,\n          });\n          L.marker([+m.lat, +m.lon], { icon: myIcon }).addTo(markersLayer);\n        });\n\n      mapContainerSig.value = noSerialize(map);\n    });\n\n    return <div id=\"map\" style={{ height: '25rem' }}></div>;\n  }\n);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/mediaController/index.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useStylesScoped$,\n  useVisibleTask$,\n} from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nconst AUDIO_SRC =\n  'https://cdn.builder.io/o/assets%2F5b8073f890b043be81574f96cfd1250b%2Fafe011812da146a5b2263196cb25f263?alt=media&token=c017cd87-0598-4af2-8afd-e9b5a3fba078&apiKey=5b8073f890b043be81574f96cfd1250b';\nconst VIDEO_SRC =\n  'https://cdn.builder.io/o/assets%2F5b8073f890b043be81574f96cfd1250b%2F8b210c56974440649a0a78d4a3a0ddc5%2Fcompressed?apiKey=5b8073f890b043be81574f96cfd1250b&token=8b210c56974440649a0a78d4a3a0ddc5&alt=media&optimized=true';\n\nexport default component$(() => {\n  const audioElementSignal = useSignal<HTMLAudioElement | undefined>();\n  const audioPlayButtonSignal = useSignal<HTMLButtonElement | undefined>();\n  const audioIsPlayingSignal = useSignal(false);\n  const videoElementSignal = useSignal<HTMLAudioElement | undefined>();\n  const videoPlayButtonSignal = useSignal<HTMLButtonElement | undefined>();\n  const videoIsPlayingSignal = useSignal(false);\n  const playsInlineSignal = useSignal(true);\n  const location = useLocation();\n\n  const videoPoster =\n    location.url.origin + '/sample-media/qwik-koi-poster.jpg';\n\n  useStylesScoped$(`\n        segment {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          text-align: center;\n          width: 100%;\n          padding: 20px;\n          color: #1dacf2\n        }\n        .content {\n          width: 60%;\n          min-width: 250px;\n        }   \n        button {\n          padding: 20px;\n          font-weight: bold;\n          font-size: 1.2em;\n          width: 100%;\n          background: #1dacf2;\n          color: white;\n        }\n        .checkbox-container {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n        .checkbox {\n          width: 20px;\n          height: 20px;\n          margin-right: 8px;\n        }\n        .video-container {\n          position: relative;\n          width: 100%;\n          height: 0;\n          padding-bottom: calc(56.25% + 1px);\n        }\n        video {\n          position: absolute;\n          top: 0;\n          left: 0;\n          width: 100%;\n          height: 100%;\n          box-sizing: border-box;\n          border: 1px solid gray;\n        }\n        `);\n\n  useVisibleTask$(({ track }) => {\n    track(() => audioPlayButtonSignal.value);\n    track(() => audioElementSignal.value);\n\n    const play = () =>\n      audioIsPlayingSignal.value\n        ? audioElementSignal.value?.pause()\n        : audioElementSignal.value?.play();\n\n    audioPlayButtonSignal.value?.removeEventListener('click', play);\n    audioPlayButtonSignal.value?.addEventListener('click', play);\n\n    return () =>\n      audioPlayButtonSignal.value?.removeEventListener('click', play);\n  });\n\n  useVisibleTask$(({ track }) => {\n    track(() => videoPlayButtonSignal.value);\n    track(() => videoElementSignal.value);\n\n    const play = () =>\n      videoIsPlayingSignal.value\n        ? videoElementSignal.value?.pause()\n        : videoElementSignal.value?.play();\n\n    videoPlayButtonSignal.value?.addEventListener('click', play);\n    return () =>\n      videoPlayButtonSignal.value?.removeEventListener('click', play);\n  });\n\n  return (\n    <segment>\n      <div class=\"content\">\n        <h1>Media Controller</h1>\n        <h3>\n          <i>with iOS Support</i>\n        </h3>\n        <br />\n        <div class=\"video-container\">\n          <video\n            ref={videoElementSignal}\n            src={VIDEO_SRC}\n            poster={videoPoster}\n            playsInline={playsInlineSignal.value}\n            onPlay$={() => (videoIsPlayingSignal.value = true)}\n            onPause$={() => (videoIsPlayingSignal.value = false)}\n            onEnded$={() => (videoIsPlayingSignal.value = false)}\n          />\n        </div>\n        <audio\n          ref={audioElementSignal}\n          src={AUDIO_SRC}\n          onPlay$={() => (audioIsPlayingSignal.value = true)}\n          onPause$={() => (audioIsPlayingSignal.value = false)}\n          onEnded$={() => (audioIsPlayingSignal.value = false)}\n        />\n        <br />\n        <div class=\"checkbox-container\">\n          <input\n            type=\"checkbox\"\n            id=\"playsInlineCheckbox\"\n            class=\"checkbox\"\n            checked={playsInlineSignal.value}\n            onchange$={() => {\n              videoElementSignal.value?.pause();\n              playsInlineSignal.value = !playsInlineSignal.value;\n            }}\n          />\n          <label for=\"playsInlineCheckbox\">playsInline (iOS)</label>\n        </div>\n\n        <br />\n        <button ref={videoPlayButtonSignal}>\n          {videoIsPlayingSignal.value ? 'Pause' : 'Play'} Video\n        </button>\n        <br />\n        <br />\n        <button ref={audioPlayButtonSignal}>\n          {audioIsPlayingSignal.value ? 'Pause' : 'Play'} Audio\n        </button>\n      </div>\n    </segment>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/nav-link/example/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { NavLink } from '..';\n\nexport default component$(() => {\n  return (\n    <>\n      Links\n      <div>\n        <NavLink href=\"/docs\" activeClass=\"text-green-600\">\n          /docs\n        </NavLink>\n      </div>\n      <div>\n        <NavLink\n          href=\"/demo/cookbook/nav-link/example/\"\n          activeClass=\"text-green-600\"\n        >\n          /demo/cookbook/nav-link/example/\n        </NavLink>\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/nav-link/index.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\nimport { Link, useLocation, type LinkProps } from '@builder.io/qwik-city';\n\ntype NavLinkProps = LinkProps & { activeClass?: string };\n\nexport const NavLink = component$(\n  ({ activeClass, ...props }: NavLinkProps) => {\n    const location = useLocation();\n    const toPathname = props.href ?? '';\n    const locationPathname = location.url.pathname;\n\n    const startSlashPosition =\n      toPathname !== '/' && toPathname.startsWith('/')\n        ? toPathname.length - 1\n        : toPathname.length;\n    const endSlashPosition =\n      toPathname !== '/' && toPathname.endsWith('/')\n        ? toPathname.length - 1\n        : toPathname.length;\n    const isActive =\n      locationPathname === toPathname ||\n      (locationPathname.endsWith(toPathname) &&\n        (locationPathname.charAt(endSlashPosition) === '/' ||\n          locationPathname.charAt(startSlashPosition) === '/'));\n\n    return (\n      <Link\n        {...props}\n        class={`${props.class || ''} ${isActive ? activeClass : ''}`}\n      >\n        <Slot />\n      </Link>\n    );\n  }\n);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/portal/index.tsx",
    "content": "import {\n  $,\n  component$,\n  useContext,\n  useStylesScoped$,\n  useTask$,\n} from '@builder.io/qwik';\nimport { PortalCloseAPIContextId, PortalAPI } from './portal-provider';\nimport PopupExampleCSS from './popup-example.css?inline';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  // Retrieve the portal API\n  const portal = useContext(PortalAPI);\n  // This function is used to open the modal.\n  // Portals can be named and each portal can have multiple items rendered into it.\n  const openModal = $(() => portal('modal', <PopupExample name=\"World\" />));\n\n  // Conditionally open the <Portal/> on the server to demonstrate SSR of portals.\n  const location = useLocation();\n  useTask$(() => {\n    location.url.searchParams.get('modal') && openModal();\n  });\n  return (\n    <>\n      <div>\n        [ <a href=\"?modal=true\">render portal as part of SSR</a> |{' '}\n        <a href=\"?\">render portal as part of client interaction</a> ]\n      </div>\n      <button onClick$={openModal}>Show Modal</button>\n    </>\n  );\n});\n\n// This component is shown as a modal.\nexport const PopupExample = component$<{ name: string }>(({ name }) => {\n  useStylesScoped$(PopupExampleCSS);\n  // To close a portal retrieve the close API.\n  const portalClose = useContext(PortalCloseAPIContextId);\n  return (\n    <div class=\"popup-example\">\n      <h1>MODAL</h1>\n      <p>Hello {name}!</p>\n      <button onClick$={() => portalClose()}>X</button>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/portal/layout.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\nimport { Portal, PortalProvider } from './portal-provider';\n\nexport default component$(() => {\n  // 1. Wrap a root component with a <PortalProvider> to enable portal API.\n  //    The <PortalProvider> component will provide a context API to\n  //    allow other components to create portals.\n  // 2. Add <Portal/> to where you want the portals to be rendered.\n  //    (<Portal/>s have names and so you can have multiple <Portal/> locations.)\n  return (\n    <PortalProvider>\n      <Slot />\n      <Portal name=\"modal\" />\n    </PortalProvider>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/portal/popup-example.css",
    "content": ".popup-example {\n  border: 1x solid black;\n  border-radius: 5px;\n  background-color: white;\n  padding: 20px;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/portal/portal-provider.css",
    "content": ".modal {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 1000;\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n  outline: 0;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background-color: rgba(0, 0, 0, 0.5);\n  -webkit-tap-highlight-color: transparent;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/portal/portal-provider.tsx",
    "content": "import {\n  $,\n  Slot,\n  component$,\n  createContextId,\n  useContext,\n  useContextProvider,\n  useSignal,\n  useStylesScoped$,\n  type ContextId,\n  type QRL,\n  type Signal,\n  type JSXOutput,\n} from '@builder.io/qwik';\nimport CSS from './portal-provider.css?inline';\n\n// Define public API for opening up Portals\nexport const PortalAPI = createContextId<\n  /**\n   * Add JSX to a portal.\n   * @param name portal name.\n   * @param jsx to add.\n   * @param contexts to add to the portal.\n   * @returns A function used for closing the portal.\n   */\n  QRL<\n    (name: string, jsx: JSXOutput, contexts?: ContextPair<any>[]) => () => void\n  >\n>('PortalProviderAPI');\n\nexport type ContextPair<T> = { id: ContextId<T>; value: T };\n\n// Define public API for closing Portals\nexport const PortalCloseAPIContextId =\n  createContextId<QRL<() => void>>('PortalCloseAPI');\n\n// internal context for managing portals\nconst PortalsContextId = createContextId<Signal<Portal[]>>('Portals');\n\ninterface Portal {\n  name: string;\n  jsx: JSXOutput;\n  close: QRL<() => void>;\n  contexts: Array<ContextPair<any>>;\n}\n\nexport const PortalProvider = component$(() => {\n  const portals = useSignal<Portal[]>([]);\n  useContextProvider(PortalsContextId, portals);\n\n  // Provide the public API for the PopupManager for other components.\n  useContextProvider(\n    PortalAPI,\n    $((name: string, jsx: JSXOutput, contexts?: ContextPair<any>[]) => {\n      const portal: Portal = {\n        name,\n        jsx,\n        close: null!,\n        contexts: [...(contexts || [])],\n      };\n      portal.close = $(() => {\n        portals.value = portals.value.filter((p) => p !== portal);\n      });\n      portal.contexts.push({\n        id: PortalCloseAPIContextId,\n        value: portal.close,\n      });\n      portals.value = [...portals.value, portal];\n      return portal.close;\n    })\n  );\n  return <Slot />;\n});\n\n/**\n * IMPORTANT: In order for the <Portal> to correctly render in SSR, it needs\n * to be rendered AFTER the call to open portal. (Setting content to portal\n * AFTER the portal is rendered can't be done in SSR, because it is not possible\n * to return back to the <Portal/> after it has been streamed to the client.)\n */\nexport const Portal = component$<{ name: string }>(({ name }) => {\n  const portals = useContext(PortalsContextId);\n  useStylesScoped$(CSS);\n  const myPortals = portals.value.filter((portal) => portal.name === name);\n  return (\n    <>\n      {myPortals.map((portal, key) => (\n        <div key={key} data-portal={name}>\n          <WrapJsxInContext jsx={portal.jsx} contexts={portal.contexts} />\n        </div>\n      ))}\n    </>\n  );\n});\n\nexport const WrapJsxInContext = component$<{\n  jsx: JSXOutput;\n  contexts: Array<ContextPair<any>>;\n}>(({ jsx, contexts }) => {\n  contexts.forEach(({ id, value }) => {\n    useContextProvider(id, value);\n  });\n  return (\n    <>\n      {/* Workaround: https://github.com/QwikDev/qwik/issues/4966 */}\n      {/* {jsx} */}\n      {[jsx].map((jsx) => jsx)}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/re-exporting-loaders/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Form } from '@builder.io/qwik-city';\nimport { useCommonRouteAction, useCommonRouteLoader } from './shared/loaders';\n\n// As mentioned, here we are re-exporting them\nexport { useCommonRouteAction, useCommonRouteLoader };\n\nexport default component$(() => {\n  const commonRouteAction = useCommonRouteAction();\n  const commonRouteLoader = useCommonRouteLoader();\n\n  return (\n    <div class=\"flex justify-around text-xl\">\n      <Form action={commonRouteAction}>\n        <div class=\"mb-2\">CommonRouteAction</div>\n        <div class=\"mb-4\">response:</div>\n        <div class=\"text-lg font-bold mb-4\">\n          {commonRouteAction.value?.data.join(' ') || ''}\n        </div>\n        <button type=\"submit\">Submit</button>\n      </Form>\n      <div>\n        <div class=\"mb-2\">CommonRouteLoader</div>\n        <div class=\"mb-4\">response:</div>\n        <div class=\"text-lg font-bold mb-4\">\n          {commonRouteLoader.value.join(' ')}\n        </div>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/re-exporting-loaders/shared/loaders.ts",
    "content": "import { routeAction$, routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useCommonRouteAction = routeAction$(async () => {\n  // ...\n  return { success: true, data: ['Qwik', 'Partytown'] };\n});\n\nexport const useCommonRouteLoader = routeLoader$(async () => {\n  // ...\n  return ['Mitosis', 'Builder.io'];\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/re-exporting-loaders/third-party/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { ThirdPartyPaymentComponent } from './third-party-library';\n\n// As mentioned, here we are re-exporting the third-party loader\nexport { useThirdPartyPaymentLoader } from './third-party-library';\n\nexport default component$(() => {\n  return (\n    <section>\n      <ThirdPartyPaymentComponent />\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/re-exporting-loaders/third-party/third-party-library.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useThirdPartyPaymentLoader = routeLoader$(() => {\n  return { name: 'John Doe' };\n});\n\nexport const ThirdPartyPaymentComponent = component$(() => {\n  const thirdPartyPaymentLoader = useThirdPartyPaymentLoader();\n  return (\n    <div\n      class={[\n        'w-96 h-56 m-auto rounded-xl relative text-white font-bold shadow-2xl',\n        'transition-transform transform hover:scale-110 bg-gray-600',\n      ]}\n    >\n      <div class=\"w-full px-8 absolute top-8\">\n        <div class=\"flex justify-between\">\n          <div class=\"\">\n            <p>Name</p>\n            <p class=\"tracking-widest\">{thirdPartyPaymentLoader.value.name}</p>\n          </div>\n          <img class=\"w-12 h-12\" src=\"/logos/qwik-logo.svg\" />\n        </div>\n        <div class=\"pt-1\">\n          <p class=\"font-medium\">Card Number</p>\n          <p class=\"tracking-wider\">4642 3489 9867 7632</p>\n        </div>\n        <div class=\"pt-6 pr-6\">\n          <div class=\"flex justify-between text-xs\">\n            <div>\n              <p class=\"font-medium\">Valid</p>\n              <p class=\"tracking-wider\">11/15</p>\n            </div>\n            <div>\n              <p class=\"font-medium\">Expiry</p>\n              <p class=\"tracking-wider\">03/25</p>\n            </div>\n            <div>\n              <p class=\"font-medium\">CVV</p>\n              <p class=\"tracking-wider\">···</p>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/streaming-deferred-loaders/index.tsx",
    "content": "import { Resource, component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useMyData = routeLoader$(() => {\n  return async () => {\n    await delay(4_000);\n    return 'MyData ' + Math.random();\n  };\n});\n\nconst delay = (timeout: number) => {\n  return new Promise((res) => setTimeout(res, timeout));\n};\n\nexport default component$(() => {\n  const myData = useMyData();\n  return (\n    <>\n      <div>BEFORE</div>\n      <Resource\n        value={myData}\n        onResolved={(data) => <div>DATA: {data}</div>}\n      />\n      <div>AFTER</div>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/cookbook/sync-event/index.tsx",
    "content": "import { component$, useSignal, sync$, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const shouldPreventDefault = useSignal(true);\n  return (\n    <div>\n      <div>Sync Event:</div>\n      <input\n        type=\"checkbox\"\n        checked={shouldPreventDefault.value}\n        onChange$={(e, target) =>\n          (shouldPreventDefault.value = target.checked)\n        }\n      />{' '}\n      Should Prevent Default\n      <hr />\n      <a\n        href=\"https://google.com\"\n        target=\"_blank\"\n        data-should-prevent-default={shouldPreventDefault.value}\n        onClick$={[\n          sync$((e: MouseEvent, target: HTMLAnchorElement) => {\n            if (target.hasAttribute('data-should-prevent-default')) {\n              e.preventDefault();\n            }\n          }),\n          $(() => {\n            console.log(\n              shouldPreventDefault.value ? 'Prevented' : 'Not Prevented'\n            );\n          }),\n        ]}\n      >\n        open Google\n      </a>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/demo-reset.css",
    "content": "demo {\n  display: block;\n  padding: 0.75em;\n}\n\ndemo h1 {\n  font-size: xx-large;\n  font-weight: bolder;\n}\n\ndemo button,\ndemo button[type='submit'] {\n  display: inline-block;\n  border: 1px solid #ccc;\n  padding: 0.5rem 1rem;\n  font-size: 1rem;\n  font-weight: 400;\n  line-height: 1.5;\n  text-align: center;\n  text-decoration: none;\n  white-space: nowrap;\n  cursor: pointer;\n  user-select: none;\n  background-color: #f7f7f7;\n  color: #333;\n  border-radius: 0.25rem;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n}\n\ndemo input,\ndemo textarea {\n  box-sizing: border-box;\n  display: inline-block;\n  padding: 1px 2px;\n  margin: 0 4px;\n  font-size: 16px;\n  line-height: 1.5;\n  color: #333;\n  background-color: #fff;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n  outline: none;\n}\n\ndemo label {\n  display: block;\n  font-weight: bold;\n}\n\ndemo a {\n  color: #0070c9;\n  background-color: transparent;\n  text-decoration: underline;\n  cursor: pointer;\n}\n\ndemo a:hover {\n  color: #003a6d;\n  background-color: transparent;\n  text-decoration: underline;\n  cursor: pointer;\n}\n\ndemo a:active {\n  color: #e60000;\n  background-color: transparent;\n  text-decoration: underline;\n}\n\ndemo ul {\n  margin-top: 0.5em;\n  margin-bottom: 0.5em;\n  margin-left: 0;\n  margin-right: 0;\n}\n\ndemo li {\n  margin-top: 0.5em;\n  margin-bottom: 0.5em;\n  padding-left: 0;\n  list-style-type: disc;\n  margin-left: 1em;\n}\n\n#console.console {\n  background-color: #333;\n  border-radius: 8px 8px 0 8px;\n  padding: 1em;\n  margin: 0;\n  position: absolute;\n  bottom: 0;\n  right: 0;\n  font-size: x-small;\n  overflow: scroll;\n  max-height: 85vh;\n  max-width: 75vw;\n}\n\n#console > ul {\n  color: #fff;\n  margin: 0;\n  padding: 0;\n}\n\n#console > h1 {\n  font-size: 15px;\n  margin: 0;\n  padding: 0;\n}\n\n#console > li {\n}\n\n#console span {\n  white-space: break-spaces;\n  padding-right: 1em;\n}\n\n#console li.debug {\n  color: #87ceeb; /* or any other light blue color */\n}\n\n#console li.error {\n  color: #ff0000; /* or any other bold red color */\n}\n\n#console li.info {\n  color: #00ff7f; /* or any other cool green color */\n}\n\n#console li.log {\n  color: #a9a9a9; /* or any other neutral grey color */\n}\n\n#console li.warn {\n  color: #ffff00; /* or any other bright yellow color */\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/custom-event/index.tsx",
    "content": "import { component$, type QRL, Slot, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <Button onTripleClick$={() => alert('TRIPLE CLICKED!')}>\n      Triple Click me!\n    </Button>\n  );\n});\n\ntype ButtonProps = {\n  onTripleClick$: QRL<() => void>;\n};\n\nexport const Button = component$<ButtonProps>(({ onTripleClick$ }) => {\n  const state = useStore({\n    clicks: 0,\n    lastClickTime: 0,\n  });\n  return (\n    <button\n      onClick$={() => {\n        // triple click logic\n        const now = Date.now();\n        const timeBetweenClicks = now - state.lastClickTime;\n        state.lastClickTime = now;\n        if (timeBetweenClicks > 500) {\n          state.clicks = 0;\n        }\n        state.clicks++;\n        if (state.clicks === 3) {\n          // handle custom event\n          onTripleClick$();\n          state.clicks = 0;\n        }\n      }}\n    >\n      <Slot />\n    </button>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/extracted-handler/index.tsx",
    "content": "import { component$, useSignal, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  const increment = $(() => count.value++);\n  return (\n    <>\n      <button onClick$={increment}>Increment</button>\n      <p>Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/global-events/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const scroll = useSignal(0);\n  const mouse = useSignal({ x: 0, y: 0 });\n  return (\n    <div\n      style={{ height: '200vh' }}\n      window:onScroll$={() => (scroll.value = window.scrollY)}\n      document:onMouseMove$={(e) => (mouse.value = { x: e.x, y: e.y })}\n    >\n      <div style={{ position: 'sticky', top: 0 }}>\n        scroll: {scroll.value} mouseMove: {mouse.value.x}, {mouse.value.y}\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/mouse-position/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const position = useSignal<{ x: number; y: number }>();\n  return (\n    <div\n      onClick$={(event) => (position.value = { x: event.x, y: event.y })}\n      style=\"height: 100vh\"\n    >\n      <p>\n        Clicked at: ({position.value?.x}, {position.value?.y})\n      </p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/preventdefault/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <a\n      href=\"/docs\"\n      preventdefault:click // This will prevent the default behavior of the \"click\" event.\n      onClick$={() => {\n        // event.PreventDefault() will not work here, because handler is dispatched asynchronously.\n        alert('Do something else to simulate navigation...');\n      }}\n    >\n      Go to docs page\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/synchronous/index.tsx",
    "content": "import { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const draggableRef = useSignal<HTMLElement>();\n  const dragStatus = useSignal('');\n\n  useVisibleTask$(({ cleanup }) => {\n    if (draggableRef.value) {\n      // Use the DOM API to add an event listener.\n      const dragstart = () => (dragStatus.value = 'dragstart');\n      const dragend = () => (dragStatus.value = 'dragend');\n\n      draggableRef.value!.addEventListener('dragstart', dragstart);\n      draggableRef.value!.addEventListener('dragend', dragend);\n      cleanup(() => {\n        draggableRef.value!.removeEventListener('dragstart', dragstart);\n        draggableRef.value!.removeEventListener('dragend', dragend);\n      });\n    }\n  });\n\n  return (\n    <div>\n      <div draggable ref={draggableRef}>\n        Drag me!\n      </div>\n      <p>{dragStatus.value}</p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/target/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const currentElm = useSignal<HTMLElement|null>(null);\n  const targetElm = useSignal<HTMLElement|null>(null);\n\n  return (\n    <section onClick$={(event, currentTarget) => {\n      currentElm.value = currentTarget;\n      targetElm.value = event.target as HTMLElement;\n    }}>\n      Click on any text <code>target</code> and <code>currentElm</code> of the event.\n      <hr/>\n      <p>Hello <b>World</b>!</p>\n      <hr/>\n      <ul>\n        <li>currentElm: {currentElm.value?.tagName}</li>\n        <li>target: {targetElm.value?.tagName}</li>\n      </ul>\n    </section>\n  );\n});"
  },
  {
    "path": "packages/docs/src/routes/demo/events/use-on/index.tsx",
    "content": "import { $, component$, useOnDocument, useStore } from '@builder.io/qwik';\n\n// Assume reusable use method that does not have access to JSX\n// but needs to register event handlers.\nfunction useMousePosition() {\n  const position = useStore({ x: 0, y: 0 });\n  useOnDocument(\n    'mousemove',\n    $((event) => {\n      const { x, y } = event as MouseEvent;\n      position.x = x;\n      position.y = y;\n    })\n  );\n  return position;\n}\n\nexport default component$(() => {\n  const pos = useMousePosition();\n  return (\n    <div>\n      MousePosition: ({pos.x}, {pos.y})\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/events/use-on/use-on-window/index.tsx",
    "content": "import { $, component$, useOnWindow, useSignal } from '@builder.io/qwik';\n\n// Custom hook to manage the dropdown state. Listens to click events on the window.\n// If the clicked element is not the dropdown toggle button, it closes the dropdown.\nfunction useCloseDropdown() {\n  // Signal to manage the open/close state of the dropdown\n  const isOpen = useSignal(false);\n  // Signal to hold a reference to the dropdown toggle button\n  const dropdownToggleBtn = useSignal<HTMLElement | null>(null);\n\n  // Event listener function for window clicks\n  const closeDropdown = $((event: Event): void => {\n    // If the clicked element is not contained within the dropdown toggle button, close the dropdown\n    if (\n      dropdownToggleBtn.value &&\n      !dropdownToggleBtn.value.contains(event.target as Node)\n    ) {\n      isOpen.value = false;\n    }\n  });\n  // Attach the window click event listener\n  useOnWindow('click', closeDropdown);\n\n  return {\n    isOpen,\n    dropdownToggleBtn,\n  };\n}\n\nexport default component$(() => {\n  // Use the custom hook in the component\n  const { isOpen, dropdownToggleBtn } = useCloseDropdown();\n\n  // Function to set the reference of the dropdown toggle button\n  const setDropdownToggleBtnRef = (item: Element): void => {\n    dropdownToggleBtn.value = item as HTMLElement;\n  };\n\n  return (\n    <div>\n      <button\n        ref={setDropdownToggleBtnRef}\n        onClick$={() => (isOpen.value = true)}\n      >\n        Click me!\n      </button>\n      {isOpen.value && (\n        <>\n          <div>\n            <i>The dropdown is open!</i>\n          </div>\n          <div style={{ margin: '1.5rem', marginLeft: '1.5rem' }}>\n            <b>CLICK OUTSIDE</b>\n          </div>\n        </>\n      )}\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/getting-started/01-route/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <section class=\"section bright\">A Joke!</section>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/getting-started/02-loading-data/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport default component$(() => {\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/getting-started/03-posting-data/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { routeLoader$, Form, routeAction$ } from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">\n          👍\n        </button>\n        <button name=\"vote\" value=\"down\">\n          👎\n        </button>\n      </Form>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/getting-started/04-state/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\nimport { routeLoader$, Form, routeAction$ } from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  const isFavoriteSignal = useSignal(false);\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">\n          👍\n        </button>\n        <button name=\"vote\" value=\"down\">\n          👎\n        </button>\n      </Form>\n      <button\n        onClick$={() => (isFavoriteSignal.value = !isFavoriteSignal.value)}\n      >\n        {isFavoriteSignal.value ? '❤️' : '🤍'}\n      </button>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/getting-started/05-tasks/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport {\n  routeLoader$,\n  Form,\n  routeAction$,\n  server$,\n} from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  const isFavoriteSignal = useSignal(false);\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n  useTask$(({ track }) => {\n    track(() => isFavoriteSignal.value);\n    console.log('FAVORITE (isomorphic)', isFavoriteSignal.value);\n    server$(() => {\n      console.log('FAVORITE (server)', isFavoriteSignal.value);\n    })();\n  });\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">\n          👍\n        </button>\n        <button name=\"vote\" value=\"down\">\n          👎\n        </button>\n      </Form>\n      <button\n        onClick$={() => (isFavoriteSignal.value = !isFavoriteSignal.value)}\n      >\n        {isFavoriteSignal.value ? '❤️' : '🤍'}\n      </button>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/getting-started/06-styling/index.css",
    "content": "p {\n  font-weight: bold;\n}\n\nform {\n  float: right;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/getting-started/06-styling/index.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useStylesScoped$,\n  useTask$,\n} from '@builder.io/qwik';\nimport {\n  routeLoader$,\n  Form,\n  routeAction$,\n  server$,\n} from '@builder.io/qwik-city';\nimport styles from './index.css?inline';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  useStylesScoped$(styles);\n  const isFavoriteSignal = useSignal(false);\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n  useTask$(({ track }) => {\n    track(() => isFavoriteSignal.value);\n    console.log('FAVORITE (isomorphic)', isFavoriteSignal.value);\n    server$(() => {\n      console.log('FAVORITE (server)', isFavoriteSignal.value);\n    })();\n  });\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">\n          👍\n        </button>\n        <button name=\"vote\" value=\"down\">\n          👎\n        </button>\n      </Form>\n      <button\n        onClick$={() => (isFavoriteSignal.value = !isFavoriteSignal.value)}\n      >\n        {isFavoriteSignal.value ? '❤️' : '🤍'}\n      </button>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/integration/img/qwik-image/index.tsx",
    "content": "import { $, component$ } from '@builder.io/qwik';\nimport {\n  Image,\n  type ImageTransformerProps,\n  useImageProvider,\n} from 'qwik-image';\n\nexport default component$(() => {\n  const imageTransformer$ = $(\n    ({ src, width, height }: ImageTransformerProps): string => {\n      // Here you can set your favorite image loaders service\n      return `https://cdn.builder.io/api/v1/${src}?height=${height}&width=${width}&format=webp&fit=fill`;\n    }\n  );\n\n  // Global Provider (required)\n  useImageProvider({\n    // You can set this prop to overwrite default values [3840, 1920, 1280, 960, 640]\n    resolutions: [640],\n    imageTransformer$,\n  });\n\n  return (\n    <Image\n      layout=\"constrained\"\n      objectFit=\"fill\"\n      width={400}\n      height={500}\n      alt=\"Tropical paradise\"\n      placeholder=\"#e6e6e6\"\n      src={\n        'image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fe5113e1c02db40e5bac75146fa46386f'\n      }\n    />\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/integration/img/unpic/simple/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Image } from '@unpic/qwik';\n\nexport default component$(() => {\n  return (\n    <Image\n      src=\"https://cdn.shopify.com/static/sample-images/bath_grande_crop_center.jpeg\"\n      layout=\"constrained\"\n      width={800}\n      height={600}\n      alt=\"A lovely bath\"\n    />\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/integration/modular-forms/index.tsx",
    "content": "// @ts-nocheck\n\nimport { $, component$, type QRL } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport type { InitialValues, SubmitHandler } from '@modular-forms/qwik';\nimport { formAction$, useForm, valiForm$ } from '@modular-forms/qwik';\nimport * as v from 'valibot';\n\nconst LoginSchema = v.object({\n  email: v.pipe(\n    v.string(),\n    v.nonEmpty('Please enter your email.'),\n    v.email('The email address is badly formatted.')\n  ),\n  password: v.pipe(\n    v.string(),\n    v.nonEmpty('Please enter your password.'),\n    v.minLength(8, 'Your password must have 8 characters or more.')\n  ),\n});\n\ntype LoginForm = v.InferInput<typeof LoginSchema>;\n\nexport const useFormLoader = routeLoader$<InitialValues<LoginForm>>(() => ({\n  email: '',\n  password: '',\n}));\n\nexport const useFormAction = formAction$<LoginForm>((values) => {\n  // Runs on server\n}, valiForm$(LoginSchema));\n\nexport default component$(() => {\n  const [loginForm, { Form, Field }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n    action: useFormAction(),\n    validate: valiForm$(LoginSchema),\n  });\n\n  const handleSubmit: QRL<SubmitHandler<LoginForm>> = $((values, event) => {\n    // Runs on client\n    console.log(values);\n  });\n\n  return (\n    <Form onSubmit$={handleSubmit}>\n      <Field name=\"email\">\n        {(field, props) => (\n          <div>\n            <input {...props} type=\"email\" value={field.value} />\n            {field.error && <div>{field.error}</div>}\n          </div>\n        )}\n      </Field>\n      <Field name=\"password\">\n        {(field, props) => (\n          <div>\n            <input {...props} type=\"password\" value={field.value} />\n            {field.error && <div>{field.error}</div>}\n          </div>\n        )}\n      </Field>\n      <button type=\"submit\">Login</button>\n    </Form>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/layout.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport { useStyles$ } from '@builder.io/qwik';\nimport STYLES from './demo-reset.css?inline';\n\nexport default component$(() => {\n  useStyles$(STYLES);\n  return (\n    <demo>\n      <Slot />\n      <ul id=\"console\" />\n      <script dangerouslySetInnerHTML={`(${logQSymbols.toString()})()`} />\n    </demo>\n  );\n});\n\nfunction logQSymbols() {\n  if (location.search.indexOf('console') == -1) {\n    return;\n  }\n  const consoleUl = document.getElementById('console')!;\n  consoleUl.className = 'console';\n  consoleUl.innerHTML = '<h1>Console</h1>';\n  // eslint-disable-next-line no-constant-binary-expression\n  false &&\n    document.addEventListener('qsymbol', (e) => {\n      const detail = (e as any as { detail: { symbol: string } }).detail;\n      const symbol = detail.symbol;\n      if (symbol.startsWith('RouterOutlet')) {\n        return;\n      }\n      console.info('QSymbol', symbol);\n    });\n  for (const name of ['debug', 'error', 'info', 'log', 'warn'] as const) {\n    const delegate = console[name];\n    console[name] = function (...args: any[]) {\n      const li = document.createElement('li');\n      li.className = name;\n      consoleUl.appendChild(li);\n      for (let i = 0; i < args.length; i++) {\n        let arg = args[i];\n        let style = '';\n        if (typeof arg === 'string' && arg.indexOf('%c') == 0) {\n          arg = arg.substring(2);\n          style = args[++i];\n        }\n        const span = document.createElement('span');\n        span.textContent = arg;\n        span.className = name;\n        span.setAttribute('style', style);\n        li.appendChild(span);\n        consoleUl.scroll(0, Number.MAX_SAFE_INTEGER);\n      }\n      return delegate.apply(console, args);\n    };\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/basePathname/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ basePathname, json }) => {\n  json(200, { basePathname });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/cacheControl/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({\n  cacheControl,\n  headers,\n  json,\n}) => {\n  cacheControl({ maxAge: 42, public: true });\n  const obj: Record<string, string> = {};\n  headers.forEach((value, key) => (obj[key] = value));\n  json(200, obj);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/component/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ redirect }) => {\n  if (!isLoggedIn()) {\n    throw redirect(308, '/login');\n  }\n};\n\nexport default component$(() => {\n  return <div>You are logged in.</div>;\n});\n\nfunction isLoggedIn() {\n  return true; // Mock login as true\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/cookie/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ cookie, json }) => {\n  let count = cookie.get('Qwik.demo.count')?.number() || 0;\n  count++;\n  cookie.set('Qwik.demo.count', count);\n  json(200, { count });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/env/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ env, json }) => {\n  json(200, {\n    USER: env.get('USER'),\n    MODE_ENV: env.get('MODE_ENV'),\n    PATH: env.get('PATH'),\n    SHELL: env.get('SHELL'),\n  });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/error/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ error }) => {\n  throw error(500, 'ERROR: Demonstration of an error response.');\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/exit/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ exit }) => {\n  throw exit();\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/getWritableStream/index.tsx",
    "content": "import type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async (requestEvent) => {\n  const writableStream = requestEvent.getWritableStream();\n  const writer = writableStream.getWriter();\n  const encoder = new TextEncoder();\n\n  writer.write(encoder.encode('Hello World\\n'));\n  await wait(100);\n  writer.write(encoder.encode('After 100ms\\n'));\n  await wait(100);\n  writer.write(encoder.encode('After 200ms\\n'));\n  await wait(100);\n  writer.write(encoder.encode('END'));\n  writer.close();\n};\n\nconst wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/headerSent/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ headersSent, json }) => {\n  if (!headersSent) {\n    json(200, { response: 'default response' });\n  }\n};\n\nexport const onRequest: RequestHandler = async ({ status }) => {\n  status(200);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/headers/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ headers, json }) => {\n  headers.set('X-SRF-TOKEN', Math.random().toString(36).replace('0.', ''));\n  const obj: Record<string, string> = {};\n  headers.forEach((value, key) => (obj[key] = value));\n  json(200, obj);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/html/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ html }) => {\n  html(\n    200,\n    ` \n      <html>\n        <body>\n          <h1>HTML response</h1>\n        </body>\n      </html>`\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/json/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ json }) => {\n  json(200, { hello: 'world' });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/layout.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ next }) => {\n  try {\n    await next();\n  } catch (error: any) {\n    if (error?.message === 'ERROR: Demonstration of an error response.') {\n      throw error;\n    } else if (\n      error &&\n      typeof error === 'object' &&\n      'message' in error &&\n      typeof error.message === 'string'\n    ) {\n      // ignore this error\n      return;\n    }\n    throw error;\n  }\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/locale/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ locale, request }) => {\n  const acceptLanguage = request.headers.get('accept-language');\n  const [languages] = acceptLanguage?.split(';') || ['?', '?'];\n  const [preferredLanguage] = languages.split(',');\n  locale(preferredLanguage);\n};\n\nexport const onGet: RequestHandler = async ({ locale, json }) => {\n  json(200, { locale: locale() });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/method/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ method, json }) => {\n  json(200, { method });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/next/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\n// Generic function `onRequest` is executed first\nexport const onRequest: RequestHandler = async ({ next, sharedMap, json }) => {\n  const log: string[] = [];\n  sharedMap.set('log', log);\n\n  log.push('onRequest start');\n  await next(); // Execute next middleware function (onGet)\n  log.push('onRequest end');\n\n  json(200, log);\n};\n\n// Specific functions such as `onGet` are executed next\nexport const onGet: RequestHandler = async ({ next, sharedMap }) => {\n  const log = sharedMap.get('log') as string[];\n\n  log.push('onGET start');\n  // execute next middleware function\n  // (in our case, there are no more middleware functions nor components.)\n  await next();\n  log.push('onGET end');\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/params/[myId]/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ params, json }) => {\n  json(200, { params });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/parseBody/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ html }) => {\n  html(\n    200,\n    `\n      <form id=\"myForm\" method=\"POST\">\n        <input type=\"text\" name=\"project\" value=\"Qwik\"/>\n        <input type=\"text\" name=\"url\" value=\"http://qwik.dev\"/>\n      </form>\n      <script>myForm.submit()</script>`\n  );\n};\n\nexport const onPost: RequestHandler = async ({ parseBody, json }) => {\n  json(200, { body: await parseBody() });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/platform/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ platform, json }) => {\n  json(200, Object.keys(platform));\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/proxy/index.tsx",
    "content": "import type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ send, url }) => {\n  const response = await fetch(\n    new URL('/demo/qwikcity/middleware/json/', url)\n  );\n  send(response.status, await response.text());\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/query/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ query, json }) => {\n  const obj: Record<string, string> = {};\n  query.forEach((v, k) => (obj[k] = v));\n  json(200, obj);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/redirect/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ redirect, url }) => {\n  throw redirect(\n    308,\n    new URL('/demo/qwikcity/middleware/status/', url).toString()\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/request/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ json, request }) => {\n  const obj: Record<string, string> = {};\n  request.headers.forEach((v, k) => (obj[k] = v));\n  json(200, { headers: obj });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/send/index.tsx",
    "content": "import type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async (requestEvent) => {\n  const response = new Response('Hello World', {\n    status: 200,\n    headers: {\n      'Content-Type': 'text/plain',\n    },\n  });\n  requestEvent.send(response);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/sharedMap/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport {\n  routeLoader$,\n  type RequestHandler,\n  type Cookie,\n} from '@builder.io/qwik-city';\n\ninterface User {\n  username: string;\n  email: string;\n}\n\nexport const onRequest: RequestHandler = async ({\n  sharedMap,\n  cookie,\n  send,\n}) => {\n  const user = loadUserFromCookie(cookie);\n  if (user) {\n    sharedMap.set('user', user);\n  } else {\n    throw send(401, 'NOT_AUTHORIZED');\n  }\n};\n\nfunction loadUserFromCookie(cookie: Cookie): User | null {\n  // this is where you would check cookie for user.\n  if (cookie) {\n    // just return mock user for this demo.\n    return {\n      username: `Mock User`,\n      email: `mock@users.com`,\n    };\n  } else {\n    return null;\n  }\n}\n\nexport const useUser = routeLoader$(({ sharedMap }) => {\n  return sharedMap.get('user') as User;\n});\n\nexport default component$(() => {\n  const log = useUser();\n  return (\n    <div>\n      {log.value.username} ({log.value.email})\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/status/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ status, getWritableStream }) => {\n  status(200);\n  const stream = getWritableStream();\n  const writer = stream.getWriter();\n  writer.write(new TextEncoder().encode('Hello World!'));\n  writer.close();\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/text/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ text }) => {\n  text(200, 'Text based response.');\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/throw/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ next, sharedMap, json }) => {\n  const log: string[] = [];\n  sharedMap.set('log', log);\n\n  log.push('onRequest');\n  if (isLoggedIn()) {\n    // normal behavior call next middleware\n    await next();\n  } else {\n    // If not logged in throw to prevent implicit call to the next middleware.\n    throw json(404, log);\n  }\n};\n\nexport const onGet: RequestHandler = async ({ sharedMap }) => {\n  const log = sharedMap.get('log') as string[];\n  log.push('onGET');\n};\n\nfunction isLoggedIn() {\n  return false; // always return false as mock example\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/qwikcity/middleware/url/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ url, json }) => {\n  json(200, { url: url.toString() });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/children/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\nimport { QFrame } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const count = useSignal(0);\n  return (\n    <QFrame>\n      <button\n        onClick$={() => {\n          console.log('click', count.value);\n          count.value++;\n        }}\n      >\n        +1\n      </button>\n      Count: {count}\n    </QFrame>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/children/react.tsx",
    "content": "/** @jsxImportSource react */\n\nimport { type ReactNode } from 'react';\nimport { qwikify$ } from '@builder.io/qwik-react';\n\nfunction Frame({ children }: { children?: ReactNode[] }) {\n  console.log('React <Zippy/> Render');\n  return (\n    <div\n      style={{\n        display: 'inline-block',\n        border: '1px solid black',\n        borderRadius: '10px',\n        padding: '5px',\n      }}\n    >\n      {children}\n    </div>\n  );\n}\n\nexport const QFrame = qwikify$(Frame);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-simple/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { QCounter } from './react';\n\nexport default component$(() => {\n  return (\n    <main>\n      <QCounter />\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-simple/react.tsx",
    "content": "/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { useState } from 'react';\n\n// Create React component standard way\nfunction Counter() {\n  const [count, setCount] = useState(0);\n  return (\n    <button className=\"react\" onClick={() => setCount(count + 1)}>\n      Count: {count}\n    </button>\n  );\n}\n\n// Convert React component to Qwik component\nexport const QCounter = qwikify$(Counter);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-simple-hover/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { QCounter } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  return (\n    <main>\n      <QCounter />\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-simple-hover/react.tsx",
    "content": "/** @jsxImportSource react */\n\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { useState } from 'react';\n\n// Create React component standard way\nfunction Counter() {\n  // Print to console to show when the component is rendered.\n  console.log('React <Counter/> Render');\n  const [count, setCount] = useState(0);\n  return (\n    <button className=\"react\" onClick={() => setCount(count + 1)}>\n      Count: {count}\n    </button>\n  );\n}\n\n// Specify eagerness to hydrate component on hover event.\nexport const QCounter = qwikify$(Counter, { eagerness: 'hover' });\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-two-islands/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\nimport { QButton, QDisplay } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const count = useSignal(0);\n  return (\n    <main>\n      <QButton\n        onClick$={() => {\n          console.log('click', count.value);\n          count.value++;\n        }}\n      />\n      <QDisplay count={count.value}></QDisplay>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-two-islands/react.tsx",
    "content": "/** @jsxImportSource react */\n\nimport { qwikify$ } from '@builder.io/qwik-react';\n\nfunction Button({ onClick }: { onClick: () => void }) {\n  console.log('React <Button/> Render');\n  return <button onClick={onClick}>+1</button>;\n}\n\nfunction Display({ count }: { count: number }) {\n  console.log('React <Display count=' + count + '/> Render');\n  return <p className=\"react\">Count: {count}</p>;\n}\n\nexport const QButton = qwikify$(Button, { eagerness: 'hover' });\nexport const QDisplay = qwikify$(Display);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-two-islands-host/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\nimport { QButton, QDisplay } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const count = useSignal(0);\n  return (\n    <main>\n      <QButton\n        host:onClick$={() => {\n          console.log('click', count.value);\n          count.value++;\n        }}\n      >\n        +1\n      </QButton>\n      <QDisplay count={count.value}></QDisplay>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/counter-two-islands-host/react.tsx",
    "content": "/** @jsxImportSource react */\n\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { type ReactNode } from 'react';\n\nfunction Button({ children }: { children?: ReactNode[] }) {\n  console.log('React <Button/> Render');\n  return <button>{children}</button>;\n}\n\nfunction Display({ count }: { count: number }) {\n  console.log('React <Display count=' + count + '/> Render');\n  return <div className=\"react\">Count: {count}</div>;\n}\n\nexport const QButton = qwikify$(Button);\nexport const QDisplay = qwikify$(Display);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/hello-world/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { QGreetings } from './react';\n\nexport default component$(() => {\n  return (\n    <main>\n      <p>Hello from Qwik</p>\n      <QGreetings />\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/hello-world/react.tsx",
    "content": "/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\n\n// Create React component standard way\nfunction Greetings() {\n  return <p>Hello from React</p>;\n}\n\n// Convert React component to Qwik component\nexport const QGreetings = qwikify$(Greetings);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/mui/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\nimport { Example } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const selected = useSignal(0);\n  return (\n    <Example\n      selected={selected.value}\n      onSelected$={(v) => (selected.value = v)}\n    >\n      Selected tab: {selected.value}\n    </Example>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/mui/react.tsx",
    "content": "/** @jsxImportSource react */\n\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport Box from '@mui/material/Box';\nimport { type ReactNode } from 'react';\n\nexport const Example = qwikify$(\n  function Example({\n    selected,\n    onSelected,\n    children,\n  }: {\n    selected: number;\n    onSelected: (v: number) => any;\n    children?: ReactNode[];\n  }) {\n    console.log('React <Example/> Render');\n    return (\n      <>\n        <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n          <Tabs\n            value={selected}\n            onChange={(e, v) => onSelected(v)}\n            aria-label=\"basic tabs example\"\n          >\n            <Tab label=\"Item One\" />\n            <Tab label=\"Item Two\" />\n            <Tab label=\"Item Three\" />\n          </Tabs>\n          {children}\n        </Box>\n      </>\n    );\n  },\n  { eagerness: 'hover' }\n);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/slider/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { MUISlider } from './react';\n\nexport default component$(() => {\n  return (\n    <>\n      <MUISlider></MUISlider>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/react/slider/react.tsx",
    "content": "/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { Slider } from '@mui/material';\nexport const MUISlider = qwikify$<typeof Slider>(\n  Slider\n  //  Uncomment next line to make component interactive in browser\n  // { eagerness: 'hover' }\n);\n"
  },
  {
    "path": "packages/docs/src/routes/demo/resumability/component.css",
    "content": ".group {\n  display: inline-flex;\n  flex-direction: row;\n  align-items: center;\n  margin: 0;\n  padding: 0;\n}\n\n.thread {\n  border: 1px dashed #ccc;\n  margin-bottom: 5px;\n  border-radius: 5px;\n}\n\n.box,\n.legend-box {\n  margin: 5px;\n}\n\n.html {\n  width: 100px;\n  background-color: rgb(183, 218, 244);\n}\n\n.js,\n.js-chunk {\n  width: 250px;\n  background-color: rgb(160, 220, 172);\n}\n\n.execution {\n  width: 500px;\n  background-color: rgb(250, 183, 184);\n}\n\n.reconciliation {\n  width: 250px;\n  background-color: rgb(219, 207, 204);\n}\n\n.js-chunk {\n  width: 15px;\n  margin: 0;\n  margin-right: 2px;\n}\n\n.thread-label {\n  float: right;\n}\n\n.legend-box {\n  width: 30px !important;\n  height: 30px !important;\n}\n\n.legend > .group {\n  margin-right: 30px;\n}\nh1.label {\n  font-size: larger;\n  margin-top: 20px;\n}\n\n.legend {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  margin: 0;\n  padding: 0;\n}\n\n.box,\n.legend-box {\n  min-width: 5px;\n  height: 50px;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/resumability/component.tsx",
    "content": "import {\n  type PropsOf,\n  component$,\n  useStylesScoped$,\n  Slot,\n} from '@builder.io/qwik';\nimport CSS from './component.css?inline';\nimport { type HoverEvent } from './index';\n\nexport const UnderstandingResumability = component$(() => {\n  useStylesScoped$(CSS);\n  return (\n    <div class=\"demo\">\n      <div class=\"hydration\">\n        <div class=\"strategy\">Hydration</div>\n\n        <div class=\"thread\">\n          <div class=\"thread-label\">(main)</div>\n          <div class=\"group\">\n            <div\n              class=\"html box\"\n              onHover$={(e: HoverEvent) =>\n                e.detail(\n                  <Callout target={e.target as HTMLElement}>\n                    <p>\n                      Server side rendered HTML to show application instantly\n                    </p>\n                    <ul>\n                      <li>HTML from CDN (or SSG)</li>\n                    </ul>\n                  </Callout>\n                )\n              }\n            />\n            <div\n              class=\"js box\"\n              onHover$={(e: HoverEvent) =>\n                e.detail(\n                  <Callout target={e.target as HTMLElement}>\n                    <p>HTML triggers downloading of application JavaScript.</p>\n                    <ul>\n                      <li>\n                        Duplication: JS contains all string which are in HTML.\n                      </li>\n                      <li>\n                        Any user interactions are lost (unless some form of\n                        event replay system exist.)\n                      </li>\n                    </ul>\n                  </Callout>\n                )\n              }\n            />\n            <div\n              class=\"execution box\"\n              onHover$={(e: HoverEvent) =>\n                e.detail(\n                  <Callout target={e.target as HTMLElement}>\n                    <p>\n                      The application must be executed for the framework to\n                      collect listeners, components, and state.\n                    </p>\n                    <ul>\n                      <li>\n                        This is a recursive process which starts with root\n                        component.\n                      </li>\n                      <li>\n                        The code is executed in slow interpretive mode (no\n                        JIT.)\n                      </li>\n                    </ul>\n                  </Callout>\n                )\n              }\n            />\n            <div\n              class=\"reconciliation box\"\n              onHover$={(e: HoverEvent) =>\n                e.detail(\n                  <Callout target={e.target as HTMLElement}>\n                    <p>\n                      Events are attached to make the application interactive.\n                    </p>\n                  </Callout>\n                )\n              }\n            />\n            <div\n              onHover$={(e: HoverEvent) =>\n                e.detail(\n                  <Callout target={e.target as HTMLElement}>\n                    <p>Application can now be interacted with.</p>\n                  </Callout>\n                )\n              }\n            >\n              <ReadyIcon />\n            </div>\n          </div>\n        </div>\n      </div>\n      <div class=\"space\"></div>\n      <div class=\"resumability\">\n        <div class=\"strategy\">Resumability</div>\n        <div class=\"thread\">\n          <div class=\"thread-label\">(main)</div>\n          <div class=\"group\">\n            <div\n              class=\"html box\"\n              onHover$={(e: HoverEvent) =>\n                e.detail(\n                  <Callout target={e.target as HTMLElement}>\n                    <p>\n                      Server side rendered HTML to show application instantly\n                    </p>\n                    <ul>\n                      <li>HTML from CDN (or SSG)</li>\n                      <li>Contains QwikLoader global listener (1kb / ~1ms)</li>\n                    </ul>\n                  </Callout>\n                )\n              }\n            ></div>\n            <div\n              onHover$={(e: HoverEvent) =>\n                e.detail(\n                  <Callout target={e.target as HTMLElement}>\n                    <p>Application can now be interacted with.</p>\n                    <ul>\n                      <li>Notice that JS is downloaded in parallel.</li>\n                      <li>\n                        In an unlikely event that user interacts before JS is\n                        downloaded there may be small delay. (But always less\n                        than hydration cost.)\n                      </li>\n                    </ul>\n                  </Callout>\n                )\n              }\n            >\n              <ReadyIcon />\n            </div>\n          </div>\n        </div>\n        <div class=\"thread\">\n          <div class=\"thread-label\">(worker)</div>\n          <div\n            class=\"group\"\n            style={{ 'margin-left': '120px' }}\n            onHover$={(e: HoverEvent) =>\n              e.detail(\n                <Callout target={e.target as HTMLElement}>\n                  <p>JavaScript downloaded in parallel.</p>\n                  <ul>\n                    <li>\n                      JS is eagerly downloaded in service worker off the main\n                      thread into browser cache. Once downloaded the\n                      application interactivity does not depend on network.\n                    </li>\n                    <li>\n                      JS is not brought to main thread until user interaction.\n                      This keeps main thread free for other tasks.\n                    </li>\n                    <li>\n                      JS is split into many smaller chunks, this allows the\n                      service worker to prioritize the order of chunk download\n                      in case user interacts before all JS is downloaded.\n                    </li>\n                    <li>\n                      Related code is automatically grouped into chunks so that\n                      each chunk only has what is needed to process user\n                      interaction.\n                    </li>\n                  </ul>\n                </Callout>\n              )\n            }\n          >\n            <div class=\"js-chunk box\"></div>\n            <div class=\"js-chunk box\"></div>\n            <div class=\"js-chunk box\"></div>\n            <div class=\"js-chunk box\"></div>\n            <div class=\"js-chunk box\"></div>\n          </div>\n        </div>\n      </div>\n      <h1 class=\"label\">Legend</h1>\n      <div class=\"legend\">\n        <div class=\"group\">\n          <div class=\"html legend-box\" />\n          <div class=\"label\">HTML</div>\n        </div>\n        <div class=\"group\">\n          <div class=\"js legend-box\" />\n          <div class=\"label\">JS download</div>\n        </div>\n        <div class=\"group\">\n          <div class=\"execution legend-box\" />\n          <div class=\"label\">JS execution</div>\n        </div>\n        <div class=\"group\">\n          <div class=\"reconciliation legend-box\" />\n          <div class=\"label\">DOM Listeners</div>\n        </div>\n        <div class=\"group\">\n          <div class=\"legend-box\">\n            <ReadyIcon />\n          </div>\n          <div class=\"label\">Ready</div>\n        </div>\n      </div>\n    </div>\n  );\n});\n\nexport function ReadyIcon(props: PropsOf<'svg'>, key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"3em\"\n      height=\"3em\"\n      viewBox=\"0 0 48 48\"\n      {...props}\n      key={key}\n    >\n      <g\n        fill=\"green\"\n        stroke=\"currentColor\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        stroke-width=\"2\"\n      >\n        <path d=\"M24 4v8\"></path>\n        <path\n          d=\"m22 22l20 4l-6 4l6 6l-6 6l-6-6l-4 6l-4-20Z\"\n          clip-rule=\"evenodd\"\n        ></path>\n        <path d=\"m38.142 9.858l-5.657 5.657M9.858 38.142l5.657-5.657M4 24h8M9.858 9.858l5.657 5.657\"></path>\n      </g>\n    </svg>\n  );\n}\n\nexport const Callout = component$<{ target: HTMLElement }>(({ target }) => {\n  const rect = target.getBoundingClientRect();\n  const x = rect.left + rect.width / 2;\n  const y = rect.top + rect.height;\n  return (\n    <div\n      style={{\n        position: 'absolute',\n        top: y + 'px',\n        left: x + 'px',\n        border: '1px solid black',\n        backgroundColor: 'white',\n        color: 'black',\n        padding: '.5em',\n      }}\n    >\n      <Slot />\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/resumability/index.tsx",
    "content": "import {\n  Slot,\n  component$,\n  noSerialize,\n  useContext,\n  useStore,\n  type NoSerialize,\n  type JSXOutput,\n} from '@builder.io/qwik';\nimport {\n  Portal,\n  PortalAPI,\n  PortalProvider,\n} from '../cookbook/portal/portal-provider';\nimport { UnderstandingResumability } from './component';\n\nexport default component$(() => {\n  return (\n    <>\n      <PortalProvider>\n        <HoverProvider>\n          <UnderstandingResumability />\n        </HoverProvider>\n        <Portal name=\"popup\" />\n      </PortalProvider>\n    </>\n  );\n});\n\nexport const HoverProvider = component$(() => {\n  const portal = useContext(PortalAPI);\n  const state = useStore({\n    x: 0,\n    y: 0,\n    currentTarget: null as null | HTMLElement,\n    close: null as null | NoSerialize<() => void>,\n  });\n  return (\n    <div\n      document:onMouseEnter$={(e) => {\n        const target = e.target;\n        if (isHTMLElement(target)) {\n          if (state.currentTarget?.contains(target) || isPortal(target)) {\n            return;\n          }\n          target.dispatchEvent(\n            new CustomEvent('hover', {\n              bubbles: true,\n              detail: async (jsx: JSXOutput) => {\n                if (state.close) {\n                  return;\n                }\n                state.currentTarget = e.target as HTMLElement;\n                state.close = noSerialize(await portal('popup', jsx));\n              },\n            })\n          );\n        }\n      }}\n      document:onMouseLeave$={(e) => {\n        const target = e.target;\n        if (isHTMLElement(target) && state.currentTarget && state.close) {\n          if (!state.currentTarget.contains(target) || isPortal(target)) {\n            return;\n          }\n          state.currentTarget = null;\n          state.close();\n          state.close = null;\n        }\n      }}\n    >\n      <Slot />\n    </div>\n  );\n});\n\nfunction isHTMLElement(node: any): node is HTMLElement {\n  if (node instanceof HTMLElement) {\n    return node.nodeType == Node.ELEMENT_NODE;\n  }\n  return false;\n}\n\nfunction isPortal(element: HTMLElement) {\n  return element.closest('[data-portal]') != null;\n}\n\nexport type HoverEvent = CustomEvent<(jsx: JSXOutput) => void>;\n"
  },
  {
    "path": "packages/docs/src/routes/demo/slot/advanced/index.tsx",
    "content": "import { Slot, component$, useSignal } from '@builder.io/qwik';\n\nexport const Collapsible = component$(() => {\n  const isOpen = useSignal(true);\n\n  return (\n    <div>\n      <h1 onClick$={() => (isOpen.value = !isOpen.value)}>\n        {isOpen.value ? '▼' : '▶︎'}\n        <Slot name=\"title\" />\n      </h1>\n      {isOpen.value && <Slot />}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  const title = useSignal('Qwik');\n  const description = useSignal(\n    'A resumable framework for building instant web applications'\n  );\n  return (\n    <>\n      <label>Title</label>\n      <input bind:value={title} type=\"text\" />\n      <label>Description</label>\n      <textarea bind:value={description} cols={50} />\n      <hr />\n      <Collapsible>\n        <span q:slot=\"title\">{title}</span>\n        {description}\n      </Collapsible>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/slot/basic/index.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\n\nconst Button = component$(() => {\n  return (\n    <button>\n      Content: <Slot />\n    </button>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Button>\n      This goes inside {'<Button>'} component marked by{`<Slot>`}\n    </Button>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/slot/named/index.css",
    "content": "section > h2 {\n  display: inline-block;\n  border: 1px solid #ccc;\n  border-bottom: none;\n  border-radius: 10px 10px 0 0;\n  font-weight: bold;\n  padding: 10px;\n  padding-bottom: 5px;\n}\n\nsection > div {\n  border: 1px solid #ccc;\n  padding: 10px;\n}\n\nsection > div > div:last-child {\n  display: flex;\n  justify-content: center;\n  font-size: xx-small;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/slot/named/index.tsx",
    "content": "import { Slot, component$, useStylesScoped$ } from '@builder.io/qwik';\nimport CSS from './index.css?inline';\n\nconst Tab = component$(() => {\n  useStylesScoped$(CSS);\n  return (\n    <section>\n      <h2>\n        <Slot name=\"title\" />\n      </h2>\n      <div>\n        <Slot /> {/* default slot */}\n        <div>\n          <Slot name=\"footer\" />\n        </div>\n      </div>\n    </section>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Tab>\n      <div q:slot=\"title\">Qwik</div>\n      <div>A resumable framework for building instant web applications</div>\n      <span q:slot=\"footer\">made with ❤️ by </span>\n      <a q:slot=\"footer\" href=\"https://builder.io\">\n        builder.io\n      </a>\n    </Tab>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/slot/unprojected/index.tsx",
    "content": "import { Slot, component$, useSignal } from '@builder.io/qwik';\n\nconst Accordion = component$(() => {\n  const isOpen = useSignal(false);\n  return (\n    <div>\n      <h1 onClick$={() => (isOpen.value = !isOpen.value)}>\n        {isOpen.value ? '▼' : '▶︎'}\n      </h1>\n      {isOpen.value && <Slot />}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Accordion>\n      I am pre-rendered on the Server and hidden until needed.\n    </Accordion>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/computed/index.tsx",
    "content": "import { component$, useComputed$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const name = useSignal('Qwik');\n  const capitalizedName = useComputed$(() => {\n    // it will automatically reexecute when name.value changes\n    return name.value.toUpperCase();\n  });\n\n  return (\n    <>\n      <input type=\"text\" bind:value={name} />\n      <p>Name: {name.value}</p>\n      <p>Capitalized name: {capitalizedName.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/counter/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <>\n      <p>Count: {count.value}</p>\n      <button onClick$={() => count.value++}>Increment</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/counter-signal/.prettierrc.json",
    "content": "{\n  \"trailingComma\": \"es5\",\n  \"tabWidth\": 2,\n  \"semi\": true,\n  \"singleQuote\": true,\n  \"printWidth\": 60,\n  \"useTabs\": false\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/counter-signal/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <button onClick$={() => count.value++}>\n      Increment {count.value}\n    </button>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/counter-store/index.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const state = useStore({ count: 0, name: 'Qwik' });\n\n  return (\n    <>\n      <button onClick$={() => state.count++}>Increment</button>\n      <p>Count: {state.count}</p>\n      <input\n        value={state.name}\n        onInput$={(_, el) => (state.name = el.value)}\n      />\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/counter-store-deep/index.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({\n    nested: {\n      fields: { are: 'also tracked' },\n    },\n    list: ['Item 1'],\n  });\n\n  return (\n    <>\n      <p>{store.nested.fields.are}</p>\n      <button\n        onClick$={() => {\n          // Even though we are mutating a nested object, this will trigger a re-render\n          store.nested.fields.are = 'tracked';\n        }}\n      >\n        Clicking me works because store is deep watched\n      </button>\n      <br />\n      <button\n        onClick$={() => {\n          // Because store is deep watched, this will trigger a re-render\n          store.list.push(`Item ${store.list.length + 1}`);\n        }}\n      >\n        Add to list\n      </button>\n      <ul>\n        {store.list.map((item, key) => (\n          <li key={key}>{item}</li>\n        ))}\n      </ul>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/counter-store-no-track/index.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({\n    nested: { fields: { are: 'not tracked' } },\n  });\n\n  return (\n    <>\n      <p>{store.nested.fields.are}</p>\n      <button onClick$={() => (store.nested.fields.are = 'tracked')}>\n        Clicking me does not work\n      </button>\n      <br />\n      <button onClick$={() => (store.nested = { fields: { are: 'tracked' } })}>\n        Click me works\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/no-serialize/index.tsx",
    "content": "import {\n  component$,\n  useStore,\n  useSignal,\n  noSerialize,\n  useVisibleTask$,\n  type NoSerialize,\n} from '@builder.io/qwik';\nimport type Monaco from './monaco';\nimport { monacoEditor } from './monaco';\n\nexport default component$(() => {\n  const editorRef = useSignal<HTMLElement>();\n  const store = useStore<{ monacoInstance: NoSerialize<Monaco> }>({\n    monacoInstance: undefined,\n  });\n\n  useVisibleTask$(() => {\n    const editor = monacoEditor.create(editorRef.value!, {\n      value: 'Hello, world!',\n    });\n    // Monaco is not serializable, so we can't serialize it as part of SSR\n    // We can however instantiate it on the client after the component is visible\n    store.monacoInstance = noSerialize(editor);\n  });\n  return <div ref={editorRef}>loading...</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/no-serialize/monaco.tsx",
    "content": "export default class Monaco {}\nexport const monacoEditor = {\n  create(element: HTMLElement, { value }: { value: string }): any {\n    setTimeout(() => {\n      element.textContent = value;\n    }, 1000);\n    return new Monaco();\n  },\n};\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/passing-context/index.tsx",
    "content": "import {\n  component$,\n  createContextId,\n  useContext,\n  useContextProvider,\n  useStore,\n} from '@builder.io/qwik';\n\n// Declare a context ID\nexport const CTX = createContextId<{ count: number }>('stuff');\n\nexport default component$(() => {\n  const userData = useStore({ count: 0 });\n\n  // Provide the store to the context under the context ID\n  useContextProvider(CTX, userData);\n\n  return <Child />;\n});\n\nexport const Child = component$(() => {\n  const userData = useContext(CTX);\n  return (\n    <>\n      <button onClick$={() => userData.count++}>Increment</button>\n      <p>Count: {userData.count}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/passing-props/index.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const userData = useStore({ count: 0 });\n  return <Child userData={userData} />;\n});\n\ninterface ChildProps {\n  userData: { count: number };\n}\nexport const Child = component$<ChildProps>(({ userData }) => {\n  return (\n    <>\n      <button onClick$={() => userData.count++}>Increment</button>\n      <p>Count: {userData.count}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/resource/index.tsx",
    "content": "import {\n  component$,\n  Resource,\n  useResource$,\n  useSignal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const postId = useSignal('23');\n\n  const postTitle = useResource$<string>(async ({ track, cleanup }) => {\n    // It will run first on mount (server), then re-run whenever postId changes (client)\n    // this means this code will run on the server and the browser\n    const controller = new AbortController();\n    track(() => postId.value);\n    cleanup(() => controller.abort());\n\n    try {\n      const response = await fetch(\n        `https://jsonplaceholder.typicode.com/posts/${postId.value}`,\n        { signal: controller.signal }\n      );\n      const data = await response.json();\n      return data.title as string;\n    } catch (e) {\n      // For demo purposes only, we recommend not to use try/catch inside useResource$\n      // and instead use the `onRejected` handler on the `<Resource />` component\n      return `invalid post '${postId.value}'`;\n    }\n  });\n\n  return (\n    <>\n      <input type=\"number\" bind:value={postId} max={100} min={0} />\n      <h1>Post#{postId}:</h1>\n      <Resource\n        value={postTitle}\n        onPending={() => <p>Loading...</p>}\n        onResolved={(title) => <h2>{title}</h2>}\n      />\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/resource-agify/index.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useResource$,\n  Resource,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const name = useSignal<string>();\n\n  const ageResource = useResource$<{\n    name: string;\n    age: number;\n    count: number;\n  }>(async ({ track, cleanup }) => {\n    track(() => name.value);\n    const abortController = new AbortController();\n    cleanup(() => abortController.abort('cleanup'));\n    const res = await fetch(`https://api.agify.io?name=${name.value}`, {\n      signal: abortController.signal,\n    });\n    return res.json();\n  });\n\n  return (\n    <section>\n      <div>\n        <label>\n          Enter your name, and I'll guess your age!\n          <input onInput$={(ev, el) => (name.value = el.value)} />\n        </label>\n      </div>\n      <Resource\n        value={ageResource}\n        onPending={() => <p>Loading...</p>}\n        onRejected={() => <p>Failed to person data</p>}\n        onResolved={(ageGuess) => {\n          return (\n            <p>\n              {name.value && (\n                <>\n                  {ageGuess.name} {ageGuess.age} years\n                </>\n              )}\n            </p>\n          );\n        }}\n      />\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/state/resource-joke/index.tsx",
    "content": "import {\n  component$,\n  useResource$,\n  Resource,\n  useSignal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const query = useSignal('busy');\n  const jokes = useResource$<{ value: string }[]>(\n    async ({ track, cleanup }) => {\n      track(() => query.value);\n      // A good practice is to use `AbortController` to abort the fetching of data if\n      // new request comes in. We create a new `AbortController` and register a `cleanup`\n      // function which is called when this function re-runs.\n      const controller = new AbortController();\n      cleanup(() => controller.abort());\n\n      if (query.value.length < 3) {\n        return [];\n      }\n\n      const url = new URL('https://api.chucknorris.io/jokes/search');\n      url.searchParams.set('query', query.value);\n\n      const resp = await fetch(url, { signal: controller.signal });\n      const json = (await resp.json()) as { result: { value: string }[] };\n\n      return json.result;\n    }\n  );\n\n  return (\n    <>\n      <label>\n        Query: <input bind:value={query} />\n      </label>\n      <button>search</button>\n      <Resource\n        value={jokes}\n        onPending={() => <>loading...</>}\n        onResolved={(jokes) => (\n          <ul>\n            {jokes.map((joke, i) => (\n              <li key={i}>{joke.value}</li>\n            ))}\n          </ul>\n        )}\n      />\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tasks/cleanup/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const text = useSignal('');\n  const debounceText = useSignal('');\n\n  useTask$(({ track, cleanup }) => {\n    const value = track(() => text.value);\n    const id = setTimeout(() => (debounceText.value = value), 500);\n    cleanup(() => clearTimeout(id));\n  });\n\n  return (\n    <section>\n      <label>\n        Enter text: <input bind:value={text} />\n      </label>\n      <p>Debounced text: {debounceText}</p>\n    </section>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tasks/track/index.tsx",
    "content": "import { component$, useSignal, useTask$, isServer } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const text = useSignal('Initial text');\n  const delayText = useSignal('');\n\n  useTask$(({ track }) => {\n    track(() => text.value);\n    const value = text.value;\n    const update = () => (delayText.value = value);\n    isServer\n      ? update() // don't delay on server render value as part of SSR\n      : delay(500).then(update); // Delay in browser\n  });\n\n  return (\n    <section>\n      <label>\n        Enter text: <input bind:value={text} />\n      </label>\n      <p>Delayed text: {delayText}</p>\n    </section>\n  );\n});\n\nconst delay = (time: number) => new Promise((res) => setTimeout(res, time));\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tasks/track-fn/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const isUppercase = useSignal(false);\n  const text = useSignal('');\n  const delayText = useSignal('');\n\n  useTask$(({ track }) => {\n    const value = track(() =>\n      isUppercase.value ? text.value.toUpperCase() : text.value.toLowerCase()\n    );\n    const update = () => (delayText.value = value);\n    isServer\n      ? update() // don't delay on server render value as part of SSR\n      : delay(500).then(update); // Delay in browser\n  });\n\n  return (\n    <section>\n      <label>\n        Enter text: <input bind:value={text} />\n      </label>\n      <label>\n        Is uppercase? <input type=\"checkbox\" bind:checked={isUppercase} />\n      </label>\n      <p>Delay text: {delayText}</p>\n    </section>\n  );\n});\n\nfunction delay(time: number) {\n  return new Promise((resolve) => setTimeout(resolve, time));\n}\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tasks/track-server-guard/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const text = useSignal('Initial text');\n  const isBold = useSignal(false);\n\n  useTask$(({ track }) => {\n    track(() => text.value);\n    if (isServer) {\n      return; // Server guard\n    }\n    isBold.value = true;\n    delay(1000).then(() => (isBold.value = false));\n  });\n\n  return (\n    <section>\n      <label>\n        Enter text: <input bind:value={text} />\n      </label>\n      <p style={{ fontWeight: isBold.value ? 'bold' : 'normal' }}>\n        Text: {text}\n      </p>\n    </section>\n  );\n});\n\nconst delay = (time: number) => new Promise((res) => setTimeout(res, time));\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tasks/use-task/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const fibonacci = useSignal<number[]>();\n\n  useTask$(async () => {\n    const size = 40;\n    const array = [];\n    array.push(0, 1);\n    for (let i = array.length; i < size; i++) {\n      array.push(array[i - 1] + array[i - 2]);\n      await delay(100);\n    }\n    fibonacci.value = array;\n  });\n\n  return <p>{fibonacci.value?.join(', ')}</p>;\n});\n\nconst delay = (time: number) => new Promise((res) => setTimeout(res, time));\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tasks/use-visible-task/index.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useVisibleTask$,\n  type Signal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const isClockRunning = useSignal(false);\n\n  return (\n    <>\n      <div style=\"position: sticky; top:0\">\n        Scroll to see clock. (Currently clock is\n        {isClockRunning.value ? ' running' : ' not running'}.)\n      </div>\n      <div style=\"height: 200vh\" />\n      <Clock isRunning={isClockRunning} />\n    </>\n  );\n});\n\nconst Clock = component$<{ isRunning: Signal<boolean> }>(({ isRunning }) => {\n  const time = useSignal('paused');\n  useVisibleTask$(({ cleanup }) => {\n    isRunning.value = true;\n    const update = () => (time.value = new Date().toLocaleTimeString());\n    const id = setInterval(update, 1000);\n    cleanup(() => clearInterval(id));\n  });\n  return <div>{time}</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tasks/use-visible-task-eager/index.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useVisibleTask$,\n  type Signal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const isClockRunning = useSignal(false);\n\n  return (\n    <>\n      <div style=\"position: sticky; top:0\">\n        Scroll to see clock. (Currently clock is\n        {isClockRunning.value ? ' running' : ' not running'}.)\n      </div>\n      <div style=\"height: 200vh\" />\n      <Clock isRunning={isClockRunning} />\n    </>\n  );\n});\n\nconst Clock = component$<{ isRunning: Signal<boolean> }>(({ isRunning }) => {\n  const time = useSignal('paused');\n  useVisibleTask$(\n    ({ cleanup }) => {\n      isRunning.value = true;\n      const update = () => (time.value = new Date().toLocaleTimeString());\n      const id = setInterval(update, 1000);\n      cleanup(() => clearInterval(id));\n    },\n    { strategy: 'document-ready' }\n  );\n  return <div>{time}</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/demo/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2020\",\n    \"lib\": [\"es2020\", \"DOM\", \"WebWorker\", \"DOM.Iterable\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"outDir\": \"tmp\",\n    \"noEmit\": true,\n    \"types\": [\"node\", \"vite/client\"],\n    \"paths\": {\n      \"~/*\": [\"./src/*\"]\n    }\n  },\n  \"files\": [\"**/*.jsx\"],\n  \"include\": [\".\"]\n}\n"
  },
  {
    "path": "packages/docs/src/routes/devtools/json/index.tsx",
    "content": "import type { RequestHandler } from '@builder.io/qwik-city';\nimport { devtoolsJsonSRC } from '@builder.io/qwik-labs';\n\nexport const onGet: RequestHandler = async ({ send, headers, cacheControl }) => {\n  headers.set('Content-Type', 'application/javascript');\n  headers.set('Access-Control-Allow-Origin', '*');\n  cacheControl('no-cache');\n  send(200, devtoolsJsonSRC);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/containers/index.mdx",
    "content": "---\ntitle: Containers | Advanced\ncontributors:\n  - the-r3aper7\n  - RATIU5\n  - adamdbradley\n  - manucorporat\n  - cunzaizhuyi\n  - Craiqser\n  - mhevery\n  - bab2683\n  - mrhoodz\nupdated_at: '2023-08-23T23:06:41Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Containers\n\nEvery Qwik application is contained inside a element, usually the `<html>` element. This element becomes the container for the application. The container is the root element for the application and all components, state and events are contained within.\n\n```html\n<html\n  q:container=\"paused\"\n  q:version=\"1.9.0\"\n  q:render=\"ssr\"\n  q:base=\"/build/\"\n  q:manifest-hash=\"ggb7b3\"\n  q:instance=\"b0yf84vwuup\"\n>\n  ...\n</html>\n```\n\n## Container Attributes\n\nSince containers are implicitly rendered by the Qwik runtime, it's not possible to define custom HTML attributes using JSX, however, the SSR render APIs, like `renderToString` and `renderToStream`, provide the `containerAttributes` option to define custom attributes:\n\n```tsx\nrenderToStream(<Root />, {\n  containerAttributes: {\n    lang: 'en',\n  },\n});\n```\n\nThe code above will render the following HTML:\n\n```html\n<html lang=\"en\" q:container=\"paused\" q:version=\"1.9.0\" q:base=\"/build/\">\n  ...\n</html>\n```\n\nIn the example above, the `lang` attribute is added to the `<html>` container element.\n\n> Note that this attribute will not be reactive, if the app needs to change this value dynamically, it will need to do through manual DOM manipulation.\n\nAlong with the custom attributes, Qwik will automatically render the `q:container`, `q:version`, `q:render` and `q:base` attributes.\n\n- `q:container` - The container state. This attribute is used by the Qwik runtime to determine if the container is in a paused state or not. The value of this attribute is either `paused` or `resumed`.\n\n- `q:version` - The version of the Qwik runtime.\n\n- `q:render` - Indicated how the container was rendered. The value of this attribute is either `ssr`, `ssr-dev`, `dom` or `dom-dev`.\n\n## Properties\n\nSince the runtime ensures isolation across containers, several containers can coexist within the same document, a container can even contain another nested container, this property allows containers to break up an application into smaller parts.\n\n- **resumed**: Each container can be resumed independently from all other components on the page. Independent resumability further reduces the amount of state which resume deserializes.\n- **updated**: Each container can be updated/replaced at any point using `innerHTML`. This allows a portion of the page to update without forcing a full re-fetch of a complete HTML document without downloading or executing JavaScript.\n- **compiled**: Each container can be compiled and deployed separately from other containers. Separate compilation is especially useful for large-scale applications and large-scale teams working on the applications.\n- **versioned**: Each container can run a different version of the Qwik framework. Allowing for the composability of the website from many small containers.\n\nContainers can be nested in a tree and can communicate and share data. The inter-component communication requires that the components have well-defined boundaries, which we call container protocols.\n\n```html\n<html q:container=\"paused\" q:version=\"1.9.0\" q:base=\"/build/\">\n  <head>\n    <title>My Qwik Application</title>\n  </head>\n  <body>\n    <header q:container=\"resumed\" q:version=\"1.8.0\" q:base=\"https://server.a/build\">\n      <div>\n        <h1>This is a header form a container</h1>\n      </div>\n    </header>\n\n    <footer q:container=\"paused\" q:version=\"0.13.0\" q:base=\"https://footer.server.b/\">\n      <div>\n        <h1>This is a footer</h1>\n      </div>\n    </footer>\n  </body>\n</html>\n```\n\n## Containers vs. Components\n\nContainers sound very similar to components; what are the differences? You can think of a container as a more restricted component. However, components can do a few things which containers can't.\n\n- Containers can only have read-only properties passed into them. This restriction is because container inputs may need to be serialized for SSR requests.\n- Containers don't understand [content projection](../../components/slots/index.mdx).\n- Containers can't modify the state which has been passed into them.\n\nComponents have restrictions:\n\n- Components must be compiled together and, as a result, share the same bundle artifacts and same Qwik version.\n- On pause, all of the components in the container are serialized together (and then they are resumed together).\n\n## What do containers solve?\n\nContainers allow multiple independent Qwik applications to run on the page and behave as a single application to the user. There are two most common use cases:\n\n1. Routing\n2. Micro-frontend architecture\n\n### Routing\n\nA typical site is composed of two logical parts:\n\n1. The navigation that tends to stay constant across many pages.\n2. The outlet, which is the part of the page that changes based on which route the user navigated to.\n\nWe can model the two parts as two navigation and outlet containers. When the user first navigates to a route, the server responds with HTML, that contains containers for both the navigation and the outlet. Once the user navigates to the second route, there are three ways to solve the navigation:\n\n1. The simplistic approach is to make a full round trip and download an entirely new page. The main downside is that the application loses all of its states on the client.\n2. The classical approach is to treat any further navigation in JavaScript. We replace the current outlet component with the new outlet component and let the new component render. The disadvantage is that we need to download and execute the JavaScript.\n3. The Qwik approach treats the navigation and the outlet as two different containers. The first navigation downloads HTML representing the full page (with both containers). The subsequent navigation fetches the HTML only for the outlet container. This approach is the best of both worlds. The navigation is fast (no JavaScript download or execution), and the application keeps its state in the parent container.\n\n### Micro-frontend\n\nWhen an application gets very large, it becomes impractical to think of it as a single application. A better mental model is that many applications work together to give the user the impression of a single application.\n\nFor large apps, the teams also become large. Large teams usually have different goals and, as a result, different release schedules.\n\nContainers allow a large team to break up the application into many smaller parts and treat each part as a unit with a separate deployment, testing, and version upgrade schedule.\n\nTeams break up the application into containers and clearly define protocols between the containers. As long as the protocols are satisfied, each team can deploy the two containers independently.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/custom-build-dir/index.mdx",
    "content": "---\ntitle: Custom Build Output Directory | Advanced\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - the-r3aper7\n  - mhevery\n  - mrhoodz\n  - thejackshelton\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Custom Build Output Directory\n\nBy default, the build output directory for Qwik is the `dist` folder in the root folder of the project.\n\nIn certain cases, we may need to make the build output directory different from the default package.\n\n## Wrong Way\n\nUsually with Vite.js we do it like this:\n\n```ts title=\"vite.config.ts\"\nimport { defineConfig } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport { qwikCity } from '@builder.io/qwik-city/vite';\nimport { resolve } from 'node:path';\n/* VITE_IMPORTS */\n\nexport default defineConfig(() => {\n  const pagesDir = resolve('pages');\n\n  return {\n    /* VITE_CONFIG */\n    build: {\n      outDir: '../resources/', // This will be overrided to `dist` by qwikVite() setting\n    },\n    plugins: [\n      qwikCity({\n        pagesDir,\n        layouts: {\n          default: resolve('src', 'layouts', 'default', 'default.tsx'),\n        },\n      }),\n      qwikVite(/* VITE_QWIK */),\n      /* VITE_PLUGINS */\n    ],\n  };\n});\n```\n\nHowever, it will be overridden by the settings of QwikVite() so nothing happens and the build output directory is still in the `dist` folder\n\n## The Right Way\n\nSo instead of changing the settings in Vite.js directly, we just need to change the settings in QwikVite() like this:\n\n```ts title=\"vite.config.ts\"\nimport { defineConfig } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport { qwikCity } from '@builder.io/qwik-city/vite';\nimport tsconfigPaths from 'vite-tsconfig-paths';\n\nexport default defineConfig(() => {\n  return {\n    ssr: { target: 'webworker', noExternal: true },\n    plugins: [\n      qwikCity(),\n      qwikVite({\n        client: {\n          outDir: 'resources/', // This is the right setting\n        },\n      }),\n      tsconfigPaths({ root: '.' }),\n    ],\n  };\n});\n```\n\nSo that the output build directory becomes `resources`, please rename this folder name as needed.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/dollar/index.mdx",
    "content": "---\ntitle: The $ dollar sign | Advanced\ncontributors:\n  - the-r3aper7\n  - manucorporat\n  - adamdbradley\n  - saikatdas0790\n  - anthonycaron\n  - ubmit\n  - literalpie\n  - forresst\n  - mhevery\n  - AnthonyPAlicea\n  - zanettin\n  - mrhoodz\n  - thejackshelton\n  - hamatoyogi\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# The dollar `$` sign\n\nQwik splits up your application into many small pieces we call symbols. A component can be broken up into many symbols, so a symbol is smaller than a component. The splitting up is performed by the [Qwik Optimizer](../optimizer/index.mdx).\n\nThe `$` suffix is used to signal both the optimizer and the developer when this transformation occurs. As a developer, you need to understand that special rules apply whenever you see `$` (not all valid JavaScript is a valid Qwik Optimizer transform.)\n\n## Compiler-time implications\n\nThe [optimizer](../optimizer/index.mdx) runs as a Vite plugin during bundling. The purpose of the Optimizer is to break up the application into many small lazy-loadable chunks. The Optimizer moves expressions (usually functions) into new files and leaves behind a reference pointing to where the expression was moved from.\n\nThe `$` tells the optimizer which functions to extract into a separate file and which ones to leave untouched. The optimizer does not keep an internal list of magic functions, instead, it solely relies on the `$` suffix to know which functions to transform. The system is extendable and developers can create their own `$` functions, such as `myCustomFunction$()`.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  console.log('render');\n  return <button onClick$={() => console.log('hello')}>Hello Qwik</button>;\n});\n```\n\nThe component above is split into multiple chunks thanks to the `$` syntax:\n\n```js title=\"app.js\"\nimport { componentQrl, qrl } from '@builder.io/qwik';\n\nconst App = /*#__PURE__*/ componentQrl(\n  qrl(() => import('./app_component_akbu84a8zes.js'), 'App_component_AkbU84a8zes')\n);\n\nexport { App };\n```\n\n```js title=\"app_component_akbu84a8zes.js\"\nimport { jsx as _jsx } from '@builder.io/qwik/jsx-runtime';\nimport { qrl } from '@builder.io/qwik';\nexport const App_component_AkbU84a8zes = () => {\n  console.log('render');\n  return /*#__PURE__*/ _jsx('button', {\n    onClick$: qrl(\n      () => import('./app_component_button_onclick_01pegc10cpw'),\n      'App_component_button_onClick_01pEgC10cpw'\n    ),\n    children: 'Hello Qwik',\n  });\n};\n```\n\n```js title=\"app_component_button_onclick_01pegc10cpw.js\"\nexport const App_component_button_onClick_01pEgC10cpw = () => console.log('hello');\n```\n\n## Rules\n\nThe Optimizer uses `$` as a signal to extract the code. The developer needs to understand that the extraction comes with constraints and therefore special rules apply whenever the `$` is present. (Not all valid JavaScript code is valid code for the Optimizer.)\n\n> The worst kind of code magic is the kind that's invisible to the developer.\n\n### Allowed expressions\n\nThe first argument of any function that ends with `$` has certain restrictions:\n\n#### Literals without local identifiers\n\n\n```tsx\nconst bar = 'bar';\nconst foo = 'foo';\n\n// Invalid expressions\nfoo$({ value: bar }); // it contains a local identifier \"bar\"\nfoo$(`Hello, ${bar}`); // it contains a local identifier \"bar\"\nfoo$(count + 1); // it contains a local identifier \"count\"\nfoo$(foo); // foo is not exported, so it's not importable\n\n// Valid expressions\nfoo$(`Hello, bar`); // string literal without local identifiers\nfoo$({ value: 'stuff' }); // object literal without local identifiers\nfoo$(1 + 3); // expression without local identifiers\n```\n\n\n#### Importable identifiers\n\n\n```tsx\n// Invalid\nconst foo = 'foo';\nfoo$(foo); // foo is not exported, so it's not importable\n\n// Valid\nexport const bar = 'bar';\nfoo$(bar);\n\n// Valid\nimport { bar } from './bar';\nfoo$(bar);\n```\n\n#### Closures\n\nFor closures, the rules are a bit relaxed, and local identifiers can be referenced and captured.\n\n> **RULE**: If a function lexically captures a variable (or parameter), that variable must be:\n>\n> 1. a `const` and\n> 2. the value must be serializable.\n\n##### Captured variables must be declared as a `const`.\n\n**Invalid**\n\n```tsx\ncomponent$(() => {\n  let foo = 'value'; // variable is not a const\n  return <div onClick$={() => console.log(foo)}/>\n});\n```\n\n**Valid**\n\n```tsx\ncomponent$(() => {\n  const foo = 'value';\n  return <div onClick$={() => console.log(foo)}/>\n});\n```\n\n##### Local captured variables must be serializable\n\n```tsx\n// Invalid\ncomponent$(() => {\n  const foo = new MyCustomClass(12); // MyCustomClass is not serializable\n  return <div onClick$={() => console.log(foo)}/>\n});\n\n// Valid\ncomponent$(() => {\n  const foo = { data: 12 };\n  return <div onClick$={() => console.log(foo)}/>\n});\n```\n\n##### Module-declared variables can be importable\n\nIf a function that is being extracted by the Optimizer refers to a top-level symbol, that symbol must either be imported or exported.\n\n```tsx\n// Invalid\nconst foo = new MyCustomClass(12);\ncomponent$(() => {\n  // Foo is declared at the module level, but it's not exported\n  console.log(foo);\n});\n\n// Valid\nexport const foo = new MyCustomClass(12);\ncomponent$(() => {\n  console.log(foo);\n});\n\n// Valid\nimport { foo } from './foo';\ncomponent$(() => {\n  console.log(foo);\n});\n```\n\n## Deep dive\n\nLet's look at the hypothetical problem of acting on a scroll event. You may be tempted to write the code like so:\n\n```tsx\nfunction onScroll(fn: () => void) {\n  document.addEventListener('scroll', fn);\n}\nonScroll(() => alert('scroll'));\n```\n\nThe problem with this approach is that the event handler is eagerly loaded, even if the scroll event never triggers. What is needed is a way to refer to code in a lazy loadable way.\n\nThe developer could write:\n\n```tsx\nexport scrollHandler = () => alert('scroll');\n\nonScroll(() => (await import('./some-chunk')).scrollHandler());\n```\n\nThis works but is a lot of work. The developer is responsible for putting the code in a different file and hard coding the chunk name. Instead, we use the Optimizer to perform the work for us automatically. But we need a way to tell the Optimizer that we want to perform such a refactoring. We use `$()` as a marker function for this purpose.\n\n```tsx\nfunction onScroll(fnQrl: QRL<() => void>) {\n  document.addEventListener('scroll', async () => {\n    const fn = await fnQrl.resolve();\n    fn();\n  });\n}\n\nonScroll($(() => alert('scroll')));\n```\n\nThe Optimizer will generate:\n\n```tsx\nonScroll(qrl('./chunk-a.js', 'onScroll_1'));\n```\n\n```tsx title=\"chunk-a.js\"\nexport const onScroll_1 = () => alert('scroll');\n```\n\n1. All that the developer had to do was to wrap the function in the `$()` to signal to the Optimizer that the function should be moved to a new file and therefore be lazy-loaded.\n2. The `onScroll` function had to be implemented slightly differently as it needs to take into account the fact that the `QRL` of the function needs to be loaded before it can be used. In practice using `QRL.resolve()` is rare in Qwik applications as the Qwik framework provides higher-level APIs that rarely expect the developer to work with `QRL.resolve()` directly.\n\nHowever, wrapping code in `$()` is a bit inconvenient. For this reason, one can use `implicit$FirstArg()` to automatically perform the wrapping and type matching of the function taking the `QRL`. The function passed into `implicit$FirstArg()` should have a suffix of `Qrl`, and the result of that function should be set to a value with a suffix of `$`;\n\n```tsx\nconst onScroll$ = implicit$FirstArg(onScrollQrl);\n\nonScroll$(() => alert('scroll'));\n```\n\nNow the developer has an easy syntax for expressing that a particular function should be lazy-loaded.\n\n## Symbol extraction\n\nAssume that you have this code:\n\n```tsx\nexport const MyComp = component$(() => {\n  /* my component definition */\n});\n```\n\nThe Optimizer breaks the code up into two files:\n\nThe original file:\n\n```tsx\nconst MyComp = component(qrl('./chunk-a.js', 'MyComp_onMount'));\n```\n\nand a chunk\n\n```tsx title=\"chunk-a.js\"\nexport const MyComp_onMount = () => {\n  /* my component definition */\n};\n```\n\nThe result of Optimizer is that the `MyComp`'s `onMount` method was extracted into a new file. There are a few benefits to doing this:\n\n- A Parent component can refer to `MyComp` without pulling in `MyComp` implementation details.\n- The application now has more entry points, giving the bundler more ways to chunk up the codebase.\n\n## Capturing the lexical scope\n\nThe Optimizer extracts expressions (usually functions) into new files and leaves behind a `QRL` pointing to the lazy-loaded location.\n\nLet's look at a simple case:\n\n```tsx\nexport const Greeter = component$(() => {\n  return <div>Hello World!</div>;\n});\n```\n\nthis will result in:\n\n```tsx\nconst Greeter = component(qrl('./chunk-a.js', 'Greeter_onMount'));\n```\n\n```tsx title=\"chunk-a.js\"\nconst Greeter_onMount = () => {\n  return qrl('./chunk-b.js', 'Greeter_onRender');\n};\n```\n\n```tsx title=\"chunk-b.js\"\nconst Greeter_onRender = () => <span>Hello World!</span>;\n```\n\nThe above is for simple cases where the extracted function closure does not capture any variables. Let's look at a more complicated case where the extracted function closure lexically captures variables.\n\n```tsx\nexport const Greeter = component$((props: { name: string }) => {\n  const salutation = 'Hello';\n\n  return (\n    <div>\n      {salutation} {props.name}!\n    </div>\n  );\n});\n```\n\nThe naive way to extract functions will not work.\n\n```tsx\nconst Greeter = component(qrl('./chunk-a.js', 'Greeter_onMount'));\n```\n\n```tsx title=\"chunk-a.js\"\nconst Greeter_onMount = (props) => {\n  const salutation = 'Hello';\n  return qrl('./chunk-b.js', 'Greeter_onRender');\n};\n```\n\n```tsx title=\"chunk-b.js\"\nconst Greeter_onRender = () => (\n  <div>\n    {salutation} {props.name}!\n  </div>\n);\n```\n\nThe issue can be seen in `chunk-b.js`. The extracted function refers to `salutation` and `props`, which are no longer in the lexical scope of the function. For this reason, the generated code must be slightly different.\n\n```tsx title=\"chunk-a.js\"\nconst Greeter_onMount = (props) => {\n  const salutation = 'Hello';\n  return qrl('./chunk-b.js', 'Greeter_onRender', [salutation, props]);\n};\n```\n\n```tsx title=\"chunk-b.js\"\nconst Greeter_onRender = () => {\n  const [salutation, props] = useLexicalScope();\n\n  return (\n    <div>\n      {salutation} {props.name}!\n    </div>\n  );\n};\n```\n\nNotice two changes:\n\n1. The `QRL` in `Greeter_onMount` now stores the `salutation` and `props`. This performs the role of capturing the constants inside closures.\n2. The generated closure `Greeter_onRender` now has a preamble which restores the `salutation` and `props` (`const [salutation, props] = useLexicalScope()`.)\n\nThe ability for the Optimizer (and Qwik runtime) to capture lexically scoped constants significantly improves which functions can be extracted into lazy-loaded resources. It is a powerful tool for breaking up complex applications into smaller lazy-loadable chunks.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/eslint/index.mdx",
    "content": "---\ncontributors:\n  - zanettin\n  - hbendev\n  - manucorporat\n  - gioboa\n  - maiieul\nupdated_at: '2023-11-22T07:02:07Z'\ncreated_at: '2023-05-20T00:04:28Z'\n---\n\n[//]: <> (--------------------------------------)\n[//]: <> (......THIS FILE IS AUTOGENERATED......)\n[//]: <> (--------------------------------------)\n[//]: <> ( to update run: pnpm eslint.update    )\n[//]: <> ( after changing the rule metadata on  )\n[//]: <> ( packages/eslint-plugin-qwik/index.ts )\n[//]: <> (--------------------------------------)\n\nimport './styles.css';\n\n\n<div>\n<h1 id=\"smth\">ESLint-Rules</h1>\n<p>Qwik comes with its own set of ESLint rules to help developers write better code.</p>\n\n<div class=\"ruleset-legend panel\">\n  <div class=\"panel-border\">\n    <span class=\"icon icon-inactive\">✅</span>\n    <b>Warn</b> in 'recommended' ruleset\n  </div>\n  <div class=\"panel-border\">\n    <span class=\"icon\">✅</span>\n    <b>Error</b> in 'recommended' ruleset\n  </div>\n  <div class=\"panel-border\">\n    <span class=\"icon icon-inactive\">🔔</span>\n    <b>Warn</b> in 'strict' ruleset\n  </div>\n  <div class=\"list-none my-6 px-6\">\n    <span class=\"icon\">🔔</span>\n    <b>Error</b> in 'strict' ruleset\n  </div>\n</div>\n\n<h2>Possible Problems</h2>\n<p>These rules are available.</p>\n<div class=\"my-6\">\n\n    <a href=\"#use-method-usage\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>use-method-usage</code>\n        <span class=\"rule-description\">Detect invalid use of use hooks.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#valid-lexical-scope\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>valid-lexical-scope</code>\n        <span class=\"rule-description\">Used the tsc typechecker to detect the capture of unserializable data in dollar ($) scopes.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#loader-location\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>loader-location</code>\n        <span class=\"rule-description\">Detect declaration location of loader$.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': true,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#no-react-props\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>no-react-props</code>\n        <span class=\"rule-description\">Disallow usage of React-specific `className`/`htmlFor` props.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#prefer-classlist\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>prefer-classlist</code>\n        <span class=\"rule-description\">Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': true,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#jsx-no-script-url\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>jsx-no-script-url</code>\n        <span class=\"rule-description\">Disallow javascript: URLs.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': true,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#jsx-key\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>jsx-key</code>\n        <span class=\"rule-description\">Disallow missing `key` props in iterators/collection literals</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': true,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#unused-server\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>unused-server</code>\n        <span class=\"rule-description\">Detect unused server$() functions.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#jsx-img\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>jsx-img</code>\n        <span class=\"rule-description\">For performance reasons, always provide width and height attributes for &lt;img&gt; elements, it will help to prevent layout shifts.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': true,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#jsx-a\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>jsx-a</code>\n        <span class=\"rule-description\">For a perfect SEO score, always provide href attribute for &lt;a&gt; elements.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': true,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n\n    <a href=\"#no-use-visible-task\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>no-use-visible-task</code>\n        <span class=\"rule-description\">Detect useVisibleTask$() functions.</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': false,\n            'icon icon-inactive': true,\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': true,\n            'icon icon-inactive': false,\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  \n</div>\n<h2>Details</h2>\n<div class=\"my-6\">\n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"use-method-usage\">use-method-usage</h3>\n      <span>Detect invalid use of use hooks.</span>\n  \n<h4>useWrongFunction</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {2} /component$/#a\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n});\n```\n</div>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {2} /component$/#a\nexport const useCounter = () => {\n  const count = useSignal(0);\n  return count;\n};\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {2} /component$/#a\nexport const Counter = (() => {\n  const count = useSignal(0);\n});\n```\n<p class=\"code-description\">`use*` methods can only be used in `component$` functions or inside `use*` hooks (e.g. `useCounter`).</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/useMethodUsage.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"valid-lexical-scope\">valid-lexical-scope</h3>\n      <span>Used the tsc typechecker to detect the capture of unserializable data in dollar ($) scopes.</span>\n  \n<h4>referencesOutside</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {1,4} /print/#a /$((msg: string)/#b)\nimport { component$, useTask$, $ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const print = $((msg: string) => {\n    console.log(msg);\n  });\n\n  useTask$(() => {\n    print(\"Hello World\");\n  });\n\n  return <h1>Hello</h1>;\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {1,4} /print/#a /(msg: string)/#b)\nimport { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const print = (msg: string) => {\n    console.log(msg);\n  };\n\n  useTask$(() => {\n    print(\"Hello World\");\n  });\n\n  return <h1>Hello</h1>;\n});\n```\n<p class=\"code-description\">Since Expressions are not serializable, they must be wrapped with `$( ... )` so that the optimizer can split the code into small chunks.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/validLexicalScope.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>invalidJsxDollar</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {1} /click/#a\nimport { component$, $ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const click = $(() => console.log());\n  return (\n    <button onClick$={click}>log it</button>\n  );\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {1} /click/#a\nimport { component$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const click = () => console.log();\n  return (\n    <button onClick$={click}>log it</button>\n  );\n});\n```\n<p class=\"code-description\">Event handler must be wrapped with `${ ... }`.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/validLexicalScope.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>mutableIdentifier</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {4} /person/#a\nimport { component$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const person = { name: 'Bob' };\n\n  return (\n    <button onClick$={() => {\n      person.name = 'Alice';\n    }}>\n      {person.name}\n    </button>\n  );\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {4} /personName/#a\nimport { component$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  let personName = 'Bob';\n\n  return (\n    <button onClick$={() => {\n      personName = 'Alice';\n    }}>\n      {personName}\n    </button>\n  );\n});\n```\n<p class=\"code-description\">Simple values are not allowed to be mutated. Use an Object instead and edit one of its property.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/validLexicalScope.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"loader-location\">loader-location</h3>\n      <span>Detect declaration location of loader$.</span>\n  \n<h4>invalidLoaderLocation</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {3} /routeLoader$/#a title=\"src/routes/product/[productId]/index.tsx\"\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {3} /routeLoader$/#a title=\"src/components/product/product.tsx\"\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n```\n<p class=\"code-description\">This is not a valid location for a route loader. It only can be used inside the `src/routes` folder, in a `layout.tsx` or `index.tsx` file.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>missingExport</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {3} /export/#a\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {3}\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nconst useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n```\n<p class=\"code-description\">The route loader function must be exported.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>wrongName</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {3} /use/#a\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {3} /get/#a\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const getProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n```\n<p class=\"code-description\">The route loader function name must start with `use`.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>recommendedValue</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {3} /=>/#a\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {9} /fetcher/#a\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nasync function fetcher() {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n}\n\nexport const useProductDetails = routeLoader$(fetcher);\n```\n<p class=\"code-description\">It is recommended to inline the arrow function. This will help the optimizer make sure that no server code is leaked to the client build.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/loaderLocation.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"no-react-props\">no-react-props</h3>\n      <span>Disallow usage of React-specific `className`/`htmlFor` props.</span>\n  \n<h4>prefer</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx /class/#a /for/#b\n<MyReactComponent class=\"foo\" for=\"#password\" />;\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx /className/#a /htmlFor/#b\n<MyReactComponent className=\"foo\" htmlFor=\"#password\" />;\n```\n<p class=\"code-description\">Prefer `class` and `for` props over `className` and `htmlFor`.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/noReactProps.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"prefer-classlist\">prefer-classlist</h3>\n      <span>Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.</span>\n  \n<h4>preferClasslist</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {7-10,15,16} /class/#a\nimport { component$ } from '@builder.io/qwik';\nimport styles from './MyComponent.module.css';\n \nexport default component$((props) => {\n  // Array syntax example\n  return <div class={[\n    styles.container, \n    'p-8', \n    props.isHighAttention ? 'text-green-500' : 'text-slate-500',\n    { active: true}\n  ]}>Hello world</div>;\n \n  // Object syntax example\n  return <div class={{  \n    'text-green-500': props.isHighAttention,\n    'p-4': true\n  }}>Hello world</div>;\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {2,7-13} /classnames/#a\nimport { component$ } from '@builder.io/qwik';\nimport classnames from 'classnames';\nimport styles from './MyComponent.module.css';\n \nexport default component$((props) => {\n  return <div class={classnames(\n    styles.container, \n    'p-8', \n    {\n      'text-green-500' : props.isHighAttention,\n      'text-slate-500' : !props.isHighAttention,\n    },\n    { active: true}\n  )}>Hello world</div>;\n});\n```\n<p class=\"code-description\">The class prop should be used instead of any 3rd party lib to efficiently set classes based on an object.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/preferClasslist.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"jsx-no-script-url\">jsx-no-script-url</h3>\n      <span>Disallow javascript: URLs.</span>\n  \n<h4>noJSURL</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx\n<button onClick$={() => alert('open the door please')>ring</button>\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx /javascript:/#a\n<button onClick$=\"javascript:alert('open the door please')\">ring</button>\n```\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxNoScriptUrl.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"jsx-key\">jsx-key</h3>\n      <span>Disallow missing `key` props in iterators/collection literals</span>\n  \n<h4>missingIterKey</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {13} /key=/#a\nimport { component$ } from '@builder.io/qwik';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    <ul>\n      {Object.keys(person).map((color) => (\n        <li key={`person-${key}`}>{person[key]}</li>\n      )}\n    </ul>\n  );\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {13}\nimport { component$ } from '@builder.io/qwik';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    <ul>\n      {Object.keys(person).map((color) => (\n        <li>{person[key]}</li>\n      )}\n    </ul>\n  );\n});\n```\n<p class=\"code-description\">Missing `key` prop for element in iterator.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>missingIterKeyUsePrag</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {14} /Fragment/#a\nimport { component$ } from '@builder.io/qwik';\nimport Card from './Card';\nimport Summary from './Summary';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    {Object.keys(person).map((color) => (\n      <Fragment key={`person-${key}`}>\n        <Card value={person[key]} />\n        <Summary value={person[key]} />\n      </Fragment>\n    )}\n  );\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {14}\nimport { component$ } from '@builder.io/qwik';\nimport Card from './Card';\nimport Summary from './Summary';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    {Object.keys(person).map((color) => (\n      < key={`person-${key}`}>\n        <Card value={person[key]} />\n        <Summary value={person[key]} />\n      </>\n    )}\n  );\n});\n```\n<p class=\"code-description\">Missing `key` prop for element in iterator. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use `<Fragment>` instead</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>missingArrayKey</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {9} /key=/#a\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    <ul>\n      {colors.map((color) => (\n        <li key={`color-${color}`}>{color}</li>\n      )}\n    </ul>\n  );\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {9}\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    <ul>\n      {colors.map((color) => (\n        <li>{color}</li>\n      )}\n    </ul>\n  );\n});\n```\n<p class=\"code-description\">Missing `key` prop for element in array. The key prop allows for improved rendering performance.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>missingArrayKeyUsePrag</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {8,11} /Fragment/#a\nimport { component$, Fragment } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    {colors.map((color) => (\n      <Fragment key={`color-${color}`}>\n        <h2>{color}</h2>\n        <p>The color \"${color}\" is a great color.</p>\n      </Fragment>\n    )}\n  );\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {8,11}\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    {colors.map((color) => (\n      < key={`color-${color}`}>\n        <h2>{color}</h2>\n        <p>The color \"${color}\" is a great color.</p>\n      </>\n    )}\n  );\n});\n```\n<p class=\"code-description\">Missing `key` prop for element in array. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use `<Fragment>` instead</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>nonUniqueKeys</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {9} /key=/#a\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    <ul>\n      {colors.map((color) => (\n        <li key={`color-${color}`}>{color}</li>\n      )}\n    </ul>\n  );\n});\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {9} /key=/#a /not-a-good-idea/#b\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    <ul>\n      {colors.map((color) => (\n        <li key=\"not-a-good-idea\">{color}</li>\n      )}\n    </ul>\n  );\n});\n```\n<p class=\"code-description\">The `key` prop must be unique.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxKey.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"unused-server\">unused-server</h3>\n      <span>Detect unused server$() functions.</span>\n  \n<h4>unusedServer</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx {4,12} /serverGreeter/#a\nimport { $, component$ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\n \nconst serverGreeter = server$((firstName: string, lastName: string) => {\n  const greeting = `Hello ${firstName} ${lastName}`;\n  return greeting;\n});\n \nexport default component$(() => (\n    <button\n      onClick$={$(async () => {\n        const greeting = await serverGreeter('John', 'Doe');\n        alert(greeting);\n      })}\n    >\n      greet\n    </button>\n  );\n);\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx {4,12} /serverGreeter/#a\nimport { component$ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\n \nconst serverGreeter = server$((firstName: string, lastName: string) => {\n  const greeting = `Hello ${firstName} ${lastName}`;\n  return greeting;\n});\n \nexport default component$(() => (\n    <button\n      onClick$={async () => {\n        const greeting = 'not using the server$ function';\n        alert(greeting);\n      }}\n    >\n      greet\n    </button>\n  );\n);\n```\n<p class=\"code-description\">A `server$` function is declared, but never used.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/unusedServer.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"jsx-img\">jsx-img</h3>\n      <span>For performance reasons, always provide width and height attributes for &lt;img&gt; elements, it will help to prevent layout shifts.</span>\n  \n<h4>noLocalSrc</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx\nimport Image from '~/media/image.png';\n<Image />\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx\n<img src=\"/image.png\">\n```\n<p class=\"code-description\">Serving images from public are not optimized, nor cached. Import images using ESM instead.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxImg.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n<h4>noWidthHeight</h4>\n<p>Examples of <b>correct</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge good\">✓</span>\n```tsx /width/#a /height/#b\n<img width=\"200\" height=\"600\" src=\"/static/images/portrait-01.webp\">\n```\n</div>\n<p>Examples of <b>incorrect</b> code for this rule:</p>\n<div class=\"code-wrapper\">\n<span class=\"badge bad\">✕</span>\n```tsx\n<img src=\"/static/images/portrait-01.webp\">\n```\n<p class=\"code-description\">For performance reasons, always provide width and height attributes for `<img>` elements, it will help to prevent layout shifts.</p>\n</div>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxImg.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"jsx-a\">jsx-a</h3>\n      <span>For a perfect SEO score, always provide href attribute for &lt;a&gt; elements.</span>\n  \n<h4>noHref</h4>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/jsxA.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n\n    <div class=\"rule-wrapper\">\n      <h3 id=\"no-use-visible-task\">no-use-visible-task</h3>\n      <span>Detect useVisibleTask$() functions.</span>\n  \n<h4>noUseVisibleTask</h4>\n<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/noUseVisibleTask.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>\n\n    </div>\n  \n</div>\n</div>"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/eslint/styles.css",
    "content": "@reference \"tailwindcss\";\n\n.docs .panel {\n  @apply rounded-md;\n  @apply mt-4;\n  @apply bg-slate-50;\n  @apply border;\n  @apply border-slate-100;\n  text-decoration: none;\n}\n\n[data-theme='dark'] .docs .panel {\n  background: #373737;\n  border-color: #575757;\n  color: var(--color-text);\n}\n\n.docs .ruleset-legend {\n  @apply grid;\n  @apply grid-cols-1;\n  @apply text-sm;\n}\n.docs .ruleset-legend > div {\n  @apply list-none;\n  @apply my-3;\n  @apply px-6;\n}\n@media screen and (min-width: 768px) {\n  .docs .ruleset-legend {\n    @apply grid-cols-4;\n  }\n  .docs .ruleset-legend > div {\n    @apply list-none;\n    @apply my-6;\n    @apply px-6;\n  }\n  .docs .ruleset-legend > div.panel-border {\n    @apply border-r;\n    @apply border-slate-200;\n  }\n}\n\n.icon {\n  @apply mb-2;\n  @apply block;\n}\n.icon.icon-inactive {\n  opacity: 0.5;\n}\n\n.docs .panel p {\n  margin: 0 !important;\n}\n\n[data-theme='dark'] .docs .panel .panel-border {\n  border-color: #575757;\n}\n\n.docs .rule-wrapper {\n  @apply mb-14;\n  @apply pb-14;\n  @apply border-b;\n}\n.docs .rule-wrapper:last-child {\n  @apply border-b-0;\n}\n\n[data-theme='dark'] .docs .rule-wrapper {\n  border-color: #575757;\n}\n\n.docs .rule-description {\n  @apply text-xs;\n  @apply block;\n  @apply mt-2;\n  @apply max-w-[90%];\n  @apply leading-5;\n}\n\n.docs .code-wrapper {\n  @apply relative;\n}\n\n.docs .badge {\n  @apply absolute;\n  @apply flex;\n  @apply rounded-full;\n  @apply text-lg;\n  @apply text-white;\n  @apply top-0;\n  @apply right-0;\n  @apply items-center;\n  @apply justify-center;\n  transform: translate(50%, -50%);\n  height: 40px;\n  width: 40px;\n}\n\n.docs .badge.good {\n  @apply text-green-500;\n  @apply bg-green-200;\n}\n[data-theme='dark'] .docs .badge.good {\n  @apply bg-green-900;\n}\n\n.docs .badge.bad {\n  @apply text-red-500;\n  @apply bg-red-200;\n}\n[data-theme='dark'] .docs .badge.bad {\n  @apply bg-red-900;\n}\n\n.docs .code-description {\n  @apply text-sm;\n  @apply px-4;\n  @apply mt-2;\n  @apply mb-10;\n}\n\n.docs .edit-examples-wrapper {\n  text-align: right;\n}\n\n.docs .edit-examples-wrapper .edit-btn {\n  @apply bg-slate-50;\n  @apply border;\n  @apply border-slate-200;\n  @apply text-black;\n  @apply no-underline;\n  @apply px-2;\n  @apply py-1;\n  @apply rounded-md;\n  @apply inline-block;\n  @apply text-sm;\n}\n[data-theme='dark'] .docs .edit-examples-wrapper .edit-btn {\n  background: #373737;\n  border-color: #575757;\n  color: var(--color-text);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/library/index.mdx",
    "content": "---\ntitle: Component library | Advanced\ncontributors:\n  - manucorporat\n  - mrhoodz\n  - thejackshelton\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-04-26T16:12:18Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Library\n\nQwik uses the [library mode of Vite](https://vitejs.dev/guide/build.html#library-mode) to create component libraries.\n\nIn order to create a component library for Qwik, you need to make sure of specific rules, this is because the Qwik Optimizer needs to recognize your library as a Qwik library.\n\nThe easiest way to create a new component library is to use the build-in `library` starter:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm create qwik library my-library\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm create qwik library my-library\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn create qwik library my-library\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun create qwik library my-library\n```\n</span>\n</PackageManagerTabs>\n\nThis will create a new folder called `my-library` with the following structure:\n\n```bash {2,11,14}\n├── README.md\n├── package.json\n├── src\n│   ├── components\n│   │   ├── counter\n│   │   │   └── counter.tsx\n│   │   └── logo\n│   │       └── logo.tsx\n│   ├── entry.dev.tsx\n│   ├── entry.ssr.tsx\n│   ├── index.ts\n│   └── root.tsx\n├── tsconfig.json\n└── vite.config.ts\n```\n\nThe most important files of a library are a properly configured `package.json` and `vite.config.ts`.\n\n## package.json\n\n```json\n{\n  \"name\": \"my-qwik-library-name\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Create a reusable Qwik component library\",\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"types\": \"./lib-types/index.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./lib/index.qwik.mjs\",\n      \"require\": \"./lib/index.qwik.cjs\",\n      \"types\": \"./lib-types/index.d.ts\"\n    }\n  },\n  \"files\": [\n    \"lib\",\n    \"lib-types\"\n  ],\n  \"type\": \"module\",\n}\n```\n\nNotice the `qwik` field, this is the entry point for the Qwik Optimizer, it will use this file to generate the `index.qwik.mjs` file.\n\n> The file must be called with the `.qwik.mjs` extension, otherwise the Qwik Optimizer will not recognize it.\n\n## vite.config.ts\n\n```ts {8-12}\nimport { defineConfig } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\n\nexport default defineConfig(() => {\n  return {\n    build: {\n      target: 'es2020',\n      lib: {\n        entry: './src/index.ts',\n        formats: ['es', 'cjs'],\n        fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n    },\n    plugins: [qwikVite()],\n  };\n});\n```\n\nCompared to a normal Vite configuration, libraries will use [the `lib` mode of Vite](https://vitejs.dev/guide/build.html#library-mode), which requires you to properly configure `build.lib`.\n\n## `src/index.ts`\n\nThis is the entry point of your library, it will export all the components, and functions that you want to expose to the world.\n\n```ts\n// As an example, we will export the Logo and Counter components\nexport { Logo } from './components/logo/logo';\nexport { Counter } from './components/counter/counter';\n```\n\n## Libraries are also Apps\n\nThe library starter is also a standalone Qwik app (without routing, nor Qwik City), this is the reason why you will find `entry.dev.tsx`, `entry.ssr.tsx` and `root.tsx` files.\n\nDo not worry about them, they won't be part of the final library, but they are useful during development and testing, so you can test your components in a real Qwik app.\n\n## Build and publish\n\nIn order to publish your library, you have to first build it in `lib` mode and then publish to npm.\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n\nThis will create a `lib` folder with the following structure. Then you can publish it to npm.\n\n```shell\nnpm publish\n```\n\n> Notice that before first publishing, you might want to update the `package.json` fields, like `name`, `version`, `description`, etc.\n\n> For any other subsequent publish, you will need to update the `version` field.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/modules-prefetching/index.mdx",
    "content": "---\ntitle: Prefetching | Advanced\ncontributors:\n  - adamdbradley\n  - RATIU5\n  - manucorporat\n  - literalpie\n  - saikatdas0790\n  - the-r3aper7\n  - mhevery\n  - mrhoodz\n  - thejackshelton\n  - maiieul\n  - jemsco\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Prefetching Modules\n\nQwik prefetches modules ahead of time. This page describes the **low-level** features of Qwik's prefetching. \n\nPrefetching modules allows applications to start downloading necessary code in the background before users actually need it. The ideal solution is to prefetch only the smallest amount of relevant code that is highly likely to be executed from a user's interaction, while also avoiding any JavaScript that _will not_ be used.\n\nQwik applications excel at downloading and executing a minimal amount of JavaScript, optimizing resource use and performance. By understanding how individual components are used or not used, Qwik can effectively decide which bundles should be prefetched. This targeted approach ensures that only necessary code is loaded.\n\nRemember, the key difference between [resumability and hydration](../../concepts/resumable/index.mdx), is that resumability enables Qwik applications to avoid executing JavaScript just to restore the event listeners, component tree, and application state. By fundamentally breaking apart a component's event listeners, render function, and state, the amount of code to prefetch is significantly smaller compared to traditional approaches.\n\n## Collecting Used Symbols\n\nWhen Qwik renders an app, it's able to collect which \"symbols\" were used during the render. A symbol includes various parts of a component, which are extracted by the [optimizer](../optimizer/index.mdx) to break apart the application. Individual event listeners, component state, and the component renderer itself are examples of different symbols that could be extracted.\n\nFor example, consider a product page that is mostly static except for one \"Add to cart\" button. When the button is clicked, the user should immediately get feedback to show the product added to the cart. In this example, the Qwik optimizer would be able to understand that the only symbol a user could interact with is the \"Add to cart\" button click event listener.\n\nFor our \"Add to cart\" example, the optimizer collects the symbols only for the click event listener and the renderer for the add to cart widget. There is no need to download, hydrate, and re-render any other parts of the application that aren't relevant.  This demonstrates Qwik's capability to determine which interactions are possible and to prefetch only the necessary code for the event listener.  In contrast, traditional approaches require the entire application or route, including framework code, to be prefetched just to add the click event listener.\n\n## Preloader\n\nThe preloader is the part of Qwik that decides which JavaScript, if any, Qwik should prefetch in the background. By default, Qwik will prefetch any event handlers on the page, as well as their dependencies.\n\nThis is done probabilistically based on various metrics, including the real-use metrics collected from [Insights](/docs/labs/insights/)\n\nTo give an example, suppose we have two event handlers, one an `onClick` handler and the other a `beforePrint` handler. The click handler is much more likely to be used than the print handler, so Qwik will prefetch the click handler with a higher probability. Furthermore if both handlers are importing the Qwik core bundle, that core bundle is more important than either of the event handlers, and will be prefetched first.\n\nDuring execution, new segments of code are imported and they each impact the probability of the segments to be loaded.\n\n### Implementation\n\nThe prefetching is done by adding `<link rel=\"modulepreload\">` elements to the document. SSR will determine the most likely bundles and add some `<link>` elements to the HTML.\n\nThen, a script is addded that loads the preloader as well as the module graph, and it is passed all the bundles discovered during the SSR render.\n\nThe preloader will then add the remaining `<link>` elements to the document head, keeping only a few active at a time so that high priority bundles can be added at any time.\n\nMost browsers support `rel=\"modulepreload\"`, but for older browsers, Qwik will fall back to `rel=\"preload\"` attribute.\n\n\n## Frequently Asked Prefetching Questions\n\n**QUESTION**: _Is lazy loading on user events slow because the user must wait for the code to download?_\n\nYes, that would create a noticeable delay, especially on slow networks. This is why code prefetching is an important part of Qwik applications.\n\nPrefetching code ensures that all of the necessary code for running the application is fetched immediately on navigating to the page. This way, when the user performs an action, the code for that action comes from the prefetch cache rather than the network. The result is that the code execution is instant.\n\n**QUESTION**: _Doesn't code prefetch result in the same behavior as existing frameworks that download and execute all of the code eagerly?_\n\nNo, for several reasons:\n\n- Existing frameworks must download and execute all of the code ([hydration](../../concepts/resumable/index.mdx)) before the application can be interactive. Typically the download of the code is a smaller time cost than the execution of the code.\n- Qwik code prefetch only downloads but does not execute the code. Therefore even if Qwik prefetches the same amount of code as the existing frameworks, the result is significant time cost savings.\n- Qwik only prefetches the code which is needed for the current page. Qwik avoids downloading code associated with components that are static.  In scenarios where more code needs prefetching, Qwik still only reaches the volume that existing frameworks consider their best case. In most cases, Qwik prefetches a small fraction of code compared to the existing frameworks.\n- Prefetching of code can happen on other threads than the main thread. Many browsers can even pre-parse the AST of the code off the main thread.\n- If the user interaction happens before the prefetch is completed, the browser will automatically prioritize the interaction chunk before the remaining prefetch chunks.\n- Qwik can break up the application into many small chunks, and these chunks can be downloaded in the order of probability that the user will interact with them. Existing frameworks have trouble breaking up applications into small chunks, and there is no easy way to prioritize the chunk download order because hydration requires a single \"main\" entry point to the application.\n\n**QUESTION**: _Who is responsible for knowing what code to prefetch?_\n\nQwik automatically generates the prefetch instructions as part of the SSR rendering. By executing the application, Qwik has runtime knowledge of which components are visible, which events the users can trigger and what code will need to be downloaded. The result is that the prefetch is an ideal set of files for this page. No action on the developers' part is required.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/optimizer/index.mdx",
    "content": "---\ntitle: Optimizer Rules | Advanced\ncontributors:\n  - the-r3aper7\n  - manucorporat\n  - adamdbradley\n  - mhevery\n  - mrhoodz\n  - thejackshelton\n  - wtlin1228\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Optimizer\n\nQwik's philosophy is to delay loading code for as long as possible. To do that, Qwik relies on an Optimizer to re-arrange the code for lazy loading. The Optimizer is a code level transformation that runs as part of the rollup.\n\n> The Optimizer is written in Rust (and available as WASM) for instant performance.\n\nThe Optimizer looks for `$` and applies a transformation that extracts the expression following the `$` and turns it into a lazy-loadable and importable symbol.\n\nLet's start by looking at a simple `Counter` example:\n\n```tsx\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n\n  return <button onClick$={() => count.value++}>{count.value}</button>;\n});\n```\n\nThe above code represents what a developer would write to describe the component. Below are the transformations that the Optimizer applies to the code to make the code lazy-loadable.\n\n```tsx\nconst Counter = component(qrl('./chunk-a.js', 'Counter_onMount'));\n```\n\n```tsx title=\"chunk-a.js\"\nexport const Counter_onMount = () => {\n  const count = useSignal(0);\n  return <button onClick$={qrl('./chunk-b.js', 'Counter_onClick', [count])}>{count.value}</button>;\n};\n```\n\n```tsx title=\"chunk-b.js\"\nconst Counter_onClick = () => {\n  const [count] = useLexicalScope();\n  return count.value++;\n};\n```\n\nNotice that every occurrence of `$` results in a new lazy loadable symbol.\n\n## Serialization\n\nSee [serialization](../../concepts/resumable/index.mdx#serialization) for a discussion of what is serializable.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/qrl/index.mdx",
    "content": "---\ntitle: QRL | Advanced\ncontributors:\n  - ahhshm\n  - manucorporat\n  - adamdbradley\n  - literalpie\n  - the-r3aper7\n  - mhevery\n  - wtlin1228\n  - bebraw\n  - mrhoodz\nupdated_at: '2023-10-12T18:28:54Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# QRL\n\nQRL (Qwik URL) is a particular form of URL that Qwik uses to lazy load content.\n\nQRLs:\n\n- are specially formatted URLs that are left as attributes in the HTML to tell Qwik where the handlers for the code should be loaded from.\n- point to a JavaScript chunk to be lazy-loaded.\n- Contain a symbol name which needs to be retrieved from the chunk.\n- May contain lexically scoped object references. (Captured variables from closures.)\n- If relative, use `q:base` for resolution.\n\n## QRL Encoding\n\n```\n./path/to/chunk.js#SymbolName\n```\n\nIn its simplest form, the QRL contains a URL (such as `./path/to/chunk.js`) that the browser can use to lazy-load a resource, and a `SymbolName` to retrieve from the lazy-loaded chunk.\n\nQwik uses `q:base` to resolve a QRL into an absolute URL if the URL is relative. (If no `q:base` attribute is present, then `document.baseURI` is used as a base.)\n\n## Encoding lexically scoped captured variables\n\nQRLs can also restore lexically scoped variables. In that case, the variables are encoded in the QRL at the end in the form of an array of indexes into the `q:obj` attribute.\n\n```\n./path/to/chunk.js#SymbolName[0,1]\n```\n\nThe array is used by `useLexicalScope()` to restore the variables.\n\n### Example\n\nLet's look at an example of how all of the pieces of the QRL tie together.\n\nThe developer writes code for a simple component.\n\n```tsx\nexport const Counter = component$((props: { step: number }) => {\n  const count = useSignal(0);\n\n  return <button onClick$={() => (count.value += props.step || 1)}>{count.value}</button>;\n});\n```\n\nThe optimizer breaks above code into pieces like so:\n\n```tsx\nconst Counter = component(qrl('./chunk-a.js', 'Counter_onMount'));\n```\n\n```tsx title=\"chunk-a.js\"\nexport const Counter_onMount = (props) => {\n  const count = useSignal(0);\n  return qrl('./chunk-b.js', 'Counter_onRender', [count, props]);\n};\n```\n\n```tsx title=\"chunk-b.js\"\nconst Counter_onRender = () => {\n  const [count, props] = useLexicalScope();\n  return (\n    <button onClick$={qrl('./chunk-c.js', 'Counter_onClick', [count, props])}>{count.value}</button>\n  );\n};\n```\n\n```tsx title=\"chunk-c.js\"\nconst Counter_onClick = () => {\n  const [count, props] = useLexicalScope();\n  return (count.value += props.step || 1);\n};\n```\n\n### Rendered HTML\n\nAfter the above code gets executed, it produces this HTML.\n\nAssume: `http://localhost/index.html`\n\n```html\n<html>\n  <body q:base=\"/build/\">\n    <button q:obj=\"456, 123\" on:click=\"./chunk-c.js#Counter_onClick[0,1]\">0</button>\n    <script>\n      /*Qwikloader script*/\n    </script>\n    <script type=\"qwik/json\">\n      {...json...}\n    </script>\n  </body>\n</html>\n```\n\nThe main thing to note is the `on:click` attribute. This attribute gets read by the Qwikloader when the user clicks on the button.\n\n1. HTML is loaded in the browser, and Qwikloader registers a global `click` listener. No other JavaScript is loaded/executed at this point.\n2. User clicks on the `<button>`. This fires a `click` event which bubbles up and is handled by the Qwikloader.\n3. Qwikloader retraces the event bubble path and looks for `on:click` attribute, which it finds on `<button>`.\n4. Qwikloader now tries to load the corresponding chunk. To do that, the Qwikloader needs to resolve the relative path of `./chunk-c.js`. It uses these values to build an absolute path starting at `<button>` and walking towards the document.\n   - `on:click=\"./chunk-c.js#Counter_onClick[0,1]\"`\n   - `<body q:base=\"/build/\">`\n   - `document.baseURI = \"http://localhost/index.html\"`\n   - The resulting absolute URL is `http://localhost/build/chunk-c.js` which Qwikloader fetches.\n5. Qwikloader now retrieves the `Counter_onClick` reference from `http://localhost/build/chunk-c.js` and invokes it.\n   ```tsx\n   const Counter_onClick = () => {\n     const [count, props] = useLexicalScope();\n     return (count.value += props.step || 1);\n   };\n   ```\n6. At this point, the execution is handed off from Qwikloader to the lazy-loaded chunk. This is done so that the Qwikloader can be as small as possible as it is inlined into the HTML.\n7. `useLexicalScope` is imported from `@builder.io/qwik` and is responsible for retrieving the `count` and `props`.\n   `const [count, props] = useLexicalScope();`\n8. Parse the `<script type=\"qwik/json\">{...json...}</script>` JSON and distribute the deserialized objects per `q:obj` attribute. In our case\n   - `<div q:id=\"123\" q:obj=\"456\" q:host>` gets object with id `123`. This will be the `count` created in the `Counter_onMount` function.\n   - `<button q:obj=\"456, 123\"` gets `count` as well as a reference to the `<div q:id=\"457\">`\n9. Once the `qwik/json` is deserialized, `useLexicalScope` can use the QRL's `[0,1]` array to look into `q:obj=\"456, 123\"` to retrieve object with id `456` and `123`, which are props of `<div q:id=\"123\" q:obj=\"456\" q:host>` as well as `store` from `Counter_onMount` function.\n\n> **NOTE:** For performance reasons the `q:obj` and `<script type=\"qwik/json\">` are only updated when the application is deserialized into HTML. When the application is running, these attributes may have stale values.\n\n## Why not just dynamic `import()`?\n\nBrowsers already have dynamic import mechanisms available from `import()`. Why not use that instead of inventing a new QRL format?\n\nThere are several reasons:\n\n1. For Qwik to work, the QRLs need to be serialized into HTML. This is problematic for dynamic `import()` because there is no easy way to retrieve the relative URL from the `import('./some-path.js')` so that it can be placed in the HTML.\n2. Dynamic imports deal with chunks, but they have no mechanism to refer to a specific symbol in the chunk.\n3. Dynamic imports have relative paths to the file which imported it. This is a problem because when the relative path is placed in HTML, it loses the context which defines relative to what. When the framework reads the path from HTML and tries to import it as `import(element.getAttribute('on:click'))`, the framework will become the context for relative path resolution. This is wrong as the original context before serialization to the HTML was different.\n4. QRLs encode information about the lexically scoped variables that were captured in the closure and need to be restored.\n5. Dynamic import requires that the developer writes `import('./file-a.js')`, which means the developer is in charge of deciding where the lazy-loaded boundaries are. This limits the ability of the tooling to move code around in an automated way.\n\nBecause of the above differences, Qwik introduces QRLs as a mechanism for lazy loading closures into a Qwik application.\n\n## See Also\n\n- [`qrl`: API used to create QRLs.](https://qwik.dev/api/qwik/#qrl)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/qwikloader/index.mdx",
    "content": "---\ntitle: Qwikloader | Advanced\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - literalpie\n  - mhevery\n  - mrhoodz\n  - thejackshelton\n  - wtlin1228\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Qwikloader\n\nQwik is designed for fine-grained lazy loading of your application. To achieve lazy-loading, Qwik requires a tiny piece of JavaScript to load at the beginning that knows how to download the rest of the application on an as-needed basis. We refer to that JavaScript as Qwikloader.\n\nQwikloader is:\n\n- Small: about 1 kb minified.\n- Fast: it executes in less than 5ms even on mobile devices. (Initial cost, not per event cost.)\n\nHow it is delivered:\n\n- Because of its size, we recommend delivering Qwikloader in an inlined `<script>` tag. This way, the browser does not have to pay the cost of creating another connection to the server.\n\nQwikloader's Purpose:\n\n- Register global browser events.\n- If an event occurs, search the DOM for the corresponding event attribute pointing to the QRL that should be lazy-loaded.\n- Lazy-load the event handler and execute it.\n\n## How does it work\n\nBelow you can find simple HTML with Qwikloader and a button with associated behavior.\n\n```html\n<html>\n  <body q:base=\"/build/\">\n    <button on:click=\"./myHandler.js#clickHandler\">push me</button>\n    <script>\n      /* Qwikloader */\n    </script>\n  </body>\n</html>\n```\n\n1. The browser downloads the HTML and executes the inlined Qwikloader script. The Qwikloader sets up global listeners for all browser events.\n2. The user clicks on the `<button>`. The browser generates a `click` event that bubbles up the DOM until the Qwikloader's global listener intercepts it.\n3. The Qwikloader retraces the event path and searches for `on:click` attribute on the elements.\n4. The Qwikloader uses the `on:click` and `q:base` attributes along with the `document.baseURI` to build a full URL for fetching the lazy-loaded handler. Assuming the original page was served up from `http://localhost/` the fetch URL becomes `http://localhost/build/myHandler.js`.\n5. Qwikloader retrieves the `clickHandler` symbol, exported from `http://localhost/build/myHandler.js` and invokes it.\n\n## Events and the Qwikloader\n\nThe registration of the listener creates two problems in the context of SSR/SSG that Qwik needs to solve. (For context, remember that Qwik is resumable, that is, it can continue executing the application from where the server paused without being forced to download and execute code eagerly.)\n\n1. **listener location**: Qwik needs to know where the events are in the HTML which came from the SSR/SSG.\n2. **listener code**: Qwik needs to know what code should run if the event is triggered.\n\nWithout the above information, Qwik would be forced to download the component template and execute it so that the listener location and closure can be recovered. This process is known as hydration, and Qwik explicitly tries to avoid hydration.\n\nQwik serializes the event listeners into the DOM in the form of [QRLs](../qrl/index.mdx). For example:\n\n```html\n<div>\n  <button on:click=\"./chunk-a.js#Counter_button_onClick[0]\">0</button>\n</div>\n```\n\nThe critical thing to notice is that Qwik generated an `on:click` attribute, containing the value `./chunk-a.js#Counter_button_onClick[0]`. In the above example the `on:click` attribute solves the listener location problem, and the attribute value solves the listener code problem. By serializing the listeners into the HTML Qwik applications do not need to perform hydration on startup.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/advanced/vite/index.mdx",
    "content": "---\ntitle: Vite | Advanced\ncontributors:\n  - zanettin\n  - manucorporat\n  - cunzaizhuyi\n  - cayter\n  - the-r3aper7\n  - ilteoood\n  - mhevery\n  - jessezhang91\n  - mrhoodz\n  - adamdbradley\n  - s-voloshynenko\nupdated_at: '2024-05-31T15:31:17Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Vite\n\nQwik leverages [Vite](https://vitejs.dev/) to provide a fast development experience. Vite is a build tool that serves your code via native ES Modules during development.\nThis means that it doesn't need to bundle your code or transpile it to work in the browser. It also comes with lightning fast hot module replacement (HMR) that updates your browser instantly when you make changes to your code.\n\n## Configuration\n\nAfter scaffolding a new Qwik project, you'll find a `vite.config.js` file in the root of your project. This is where you can configure Vite.\n\n## Vite Plugins\n\nQwik comes with two plugins that make it easy to use Vite with Qwik and Qwik City.\n\n```ts title=\"vite.config.ts\"\nimport { defineConfig } from 'vite';\nimport { qwikCity } from '@builder.io/qwik-city/vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport tsconfigPaths from 'vite-tsconfig-paths';\n\nexport default defineConfig(() => {\n  return {\n    plugins: [qwikCity(), qwikVite(), tsconfigPaths({ root: '.' })],\n  };\n});\n```\n\n### `qwikVite()`\n\nTo modify the configuration, you can pass an object to the `qwikVite` function. Possible options are:\n\n#### `debug`\n\n```js\n/**\n * Prints verbose Qwik plugin debug logs and shows chunk file names ouput in preview/production environments.\n * Default `false`\n */\ndebug?: boolean;\n```\n\n#### `entryStrategy`\n\n```js\n/**\n * The Qwik entry strategy to use while bundling for production.\n * During development the type is always `hook`.\n * Default `{ type: \"smart\" }`)\n */\nentryStrategy?: EntryStrategy;\n```\n\n#### `srcDir`\n\n```js\n/**\n * The source directory to find all the Qwik components. Since Qwik\n * does not have a single input, the `srcDir` is use to recursively\n * find Qwik files.\n * Default `src`\n */\nsrcDir?: string;\n```\n\n#### `tsconfigFileNames`\n\n```js\n/**\n * List of tsconfig.json files to use for ESLint warnings during development.\n * Default `['tsconfig.json']`\n */\ntsconfigFileNames?: string[];\n```\n\n#### `vendorRoots`\n\n```js\n/**\n * List of directories to recursively search for Qwik components or Vendors.\n * Default `[]`\n */\nvendorRoots?: string[];\n```\n\n#### `client`\n\n```js\nclient?: {\n    /**\n     * The entry point for the client builds. Typically this would be\n     * the application's main component.\n     * Default `src/components/app/app.tsx`\n     */\n    input?: string[] | string;\n    /**\n     * Entry input for client-side only development with hot-module reloading.\n     * This is for Vite development only and does not use SSR.\n     * Default `src/entry.dev.tsx`\n     */\n    devInput?: string;\n    /**\n     * Output directory for the client build.\n     * Default `dist`\n     */\n    outDir?: string;\n    /**\n     * The client build will create a manifest and this hook\n     * is called with the generated build data.\n     * Default `undefined`\n     */\n    manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;\n};\n```\n\n#### `ssr`\n\n```js\nssr?: {\n    /**\n     * The entry point for the SSR renderer. This file should export\n     * a `render()` function. This entry point and `render()` export\n     * function is also used for Vite's SSR development and Node.js\n     * debug mode.\n     * Default `src/entry.ssr.tsx`\n     */\n    input?: string;\n    /**\n     * Output directory for the server build.\n     * Default `dist`\n     */\n    outDir?: string;\n    /**\n     * The SSR build requires the manifest generated during the client build.\n     * By default, this plugin will wire the client manifest to the ssr build.\n     * However, the `manifestInput` option can be used to manually provide a manifest.\n     * Default `undefined`\n     */\n    manifestInput?: QwikManifest;\n};\n```\n\n#### `optimizerOptions`\n\n```js\n/**\n * Options for the Qwik optimizer.\n * Default `undefined`\n */\noptimizerOptions?: OptimizerOptions;\n```\n\n#### `transformedModuleOutput`\n\n```js\n/**\n * Hook that's called after the build and provides all of the transformed\n * modules that were used before bundling.\n */\ntransformedModuleOutput?:\n    | ((transformedModules: TransformModule[]) => Promise<void> | void)\n    | null;\n```\n\n#### `devTools`\n\n```js\ndevTools?: {\n    /**\n     * Validates image sizes for CLS issues during development.\n     * In case of issues, provides you with a correct image size resolutions.\n     * If set to `false`, image dev tool will be disabled.\n     */\n    imageDevTools?: boolean | true;\n    /**\n     * Press-hold the defined keys to enable qwik dev inspector.\n     * By default the behavior is activated by pressing the left or right `Alt` key.\n     * If set to `false`, qwik dev inspector will be disabled.\n     * Valid values are `KeyboardEvent.code` values.\n     * Please note that the 'Left' and 'Right' suffixes are ignored.\n     */\n    clickToSource?: string[] | false;\n};\n```\n\n### `qwikCity()`\n\nTo modify the configuration, you can pass an object to the `qwikCity` function. Possible options are:\n\n#### `routesDir`\n\n```js\n/**\n * Directory of the `routes`. Defaults to `src/routes`.\n */\nroutesDir?: string;\n```\n\n#### `serverPluginsDir`\n\n```js\n/**\n * Directory of the `server plugins`. Defaults to `src/server-plugins`.\n */\nserverPluginsDir?: string;\n```\n\n#### `basePathname`\n\n```js\n/**\n * The base pathname is used to create absolute URL paths up to\n * the `hostname`, and must always start and end with a\n * `/`.  Defaults to `/`.\n */\nbasePathname?: string;\n```\n\n#### `trailingSlash`\n\n```js\n/**\n * Ensure a trailing slash ends page urls. Defaults to `true`.\n * (Note: Previous versions defaulted to `false`).\n */\ntrailingSlash?: boolean;\n```\n\n#### `mdxPlugins`\n\n```js\n/**\n * Enable or disable MDX plugins included by default in qwik-city.\n */\nmdxPlugins?: MdxPlugins;\n```\n\n#### `mdx`\n\n```js\n/**\n* MDX Options https://mdxjs.com/\n*/\nmdx?: any;\n```\n\n#### `platform`\n\n```js\n/**\n* The platform object which can be used to mock the Cloudflare bindings.\n*/\nplatform?: Record<string, unknown>;\n```\n\n## Troubleshooting\n\nBefore creating an issue on the Qwik repository please check the `Troubleshooting` section of the [Vite documentation](https://vitejs.dev/guide/troubleshooting.html) and make sure you're using the recommended version.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/concepts/progressive/index.mdx",
    "content": "---\ntitle: Progressive | Concepts\ncontributors:\n  - adamdbradley\n  - RATIU5\n  - manucorporat\n  - fleish80\n  - msssk\n  - mhevery\n  - mrhoodz\n  - thejackshelton\n  - moinulmoin\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Progressive\n\nProgressive is about downloading code according to the application's needs, without eagerly downloading the entire code base.\n\nThis connects  to the [core principle](../../concepts/think-qwik/index.mdx) of Qwik which focuses on delaying **the loading** and execution of JavaScript for as long as possible. Qwik needs to break up the application into many lazy loadable chunks to achieve that.\n\n## Current state-of-the-art\n\n[Existing frameworks suffer from two problems](https://www.builder.io/blog/dont-blame-the-developer-for-what-the-frameworks-did):\n\n- Lazy loading boundaries are completely delegated to the developer\n- Frameworks can only lazy load components that are not in the current render tree.\n\nThe problem is that the frameworks need to reconcile their internal state with the DOM. And this means that at least once in the application [hydration](../../concepts/resumable/#resumable-vs-hydration) occurs. Frameworks are required to be able to do a full render to rebuild the framework's internal state. After the first render, the frameworks can be more surgical about their updates, but the damage has been done, the code has been downloaded. So, two issues now arise:\n\n- Frameworks need to download and execute components to rebuild the render tree on startup. (See [hydration is pure overhead](https://www.builder.io/blog/hydration-is-pure-overhead)) This forces eager download and execution of all components in the render tree.\n- The event handlers come with the components even though they are not needed at the time of rendering. The inclusion of event handlers forces the download of unnecessary code.\n\n## Solution\n\nQwik's architecture takes full advantage of modern tooling to automate the problem of entry point generation. Developers can write components normally, while the Qwik optimizer will split the components into chunks and download them when needed.\n\nIn addition, the framework runtime does not need to download code that is not required for interactivity, even if the component is part of the render tree.\n\n### Optimizer\n\n[Optimizer](../../advanced/optimizer/index.mdx) is a code transformation that extracts functions into top-level importable symbols, which allows the Qwik runtime to lazy-load the JavaScript on an as-needed basis.\n\nThe Optimizer and Qwik runtime work together to achieve the desired result of fine-grained lazy loading.\n\nWithout the Optimizer, either:\n\n- The code would have to be broken up by the developer into importable parts. This would be unnatural to write an application, making for a bad DX.\n- The application would have to load a lot of unnecessary code as there would be no lazy-loaded boundaries.\n\nQwik runtime must understand the Optimizer output. What needs to be understood here is that by breaking up the component into lazy-loadable chunks, the lazy loading requirement introduces asynchronous code into the framework. The framework has to be written differently to take asynchronicity into account. Existing frameworks assume that all code is available synchronously. This assumption prevents an easy insertion of lazy-loading into existing frameworks. (For example, when a new component is created, the framework assumes that its initialization code can be invoked in a synchronous fashion. If this is the first time component is referenced, then its code needs to be lazy-loaded, and therefore the framework must take that into account).\n\n### Lazy-loading\n\nLazy-loading is asynchronous. Qwik is an asynchronous framework. Qwik understands that at any time, it may not have a reference to a callback, and therefore, it may need to lazy-load it. (In contrast, most existing frameworks assume that all of the code is available synchronously, making lazy-loading non-trivial).\n\nIn Qwik everything is lazy-loadable:\n\n- Component on render - initialization block and render block\n- Component tasks - side-effects, only downloaded if inputs change\n- Listeners - only downloaded on interaction\n- Styles - only downloaded if the server did not already provide them\n\nLazy-loading is a core property of the framework and not an afterthought.\n\n### Optimizer and `$`\n\nTake a look at this example again:\n\n```tsx\n// the `$` suffix for `component` indicates that the component should be\n// lazy-loaded.\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n\n  // the `$` suffix for `onClick` indicates that the implementation for\n  // the handler should be lazy-loaded.\n  return <button onClick$={() => count.value++}>{count.value}</button>;\n});\n```\n\nNotice the presence of `$` in the code. `$` is a marker that tells the Optimizer that the function\nfollowing it should be lazy-loaded. The `$` is a single character that hints to the Optimizer and the developer to let them know\nthat asynchronous lazy-loading occurs here.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/concepts/reactivity/index.mdx",
    "content": "---\ntitle: Reactivity | Concepts\ncontributors:\n  - wmertens\n  - bado22\n  - RATIU5\n  - manucorporat\n  - adamdbradley\n  - fleish80\n  - saikatdas0790\n  - dario-piotrowicz\n  - the-r3aper7\n  - AnthonyPAlicea\n  - mhevery\n  - wtlin1228\n  - mrhoodz\n  - thejackshelton\n  - aivarsliepa\n  - zanettin\nupdated_at: '2023-09-05T18:38:51Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Reactivity\n\nReactivity allows Qwik to track which components are subscribed to which state. This information enables Qwik to invalidate only the relevant component on state change, which minimizes the number of components that need to be re-rendered.\n\nWithout fine-grained reactivity, a state change would require re-rendering from the root component, which would force the whole component tree to be eagerly downloaded.\n\nIt's important to notice that Qwik does not do change detection like Angular. Instead, Qwik relies on signals to surgically update the component templates when the relevant state changes, without having to dirty-check the whole state.\n\n## Proxy\n\nReactivity requires that the framework keeps track of the relationship between the state of the application and the components. The framework must render the whole application at least once to build the reactivity graph. The build of this reactivity graph initially happens on the server and is serialized to HTML so that the browser can use the information without being forced to do a single pass through all components to rebuild the graph. (Qwik does not need to do hydration to register events or build up the reactivity graph).\n\nReactivity can be done in a few ways:\n\n1. Using explicit registration of listeners using `.subscribe()` (for example, RxJS)\n2. Using implicit registration using a compiler (for example, Svelte)\n3. Using implicit registration using proxies.\n\nQwik uses proxies for a few reasons:\n\n1. Using explicit registration such as `.subscribe()` would require the system to serialize all of the subscribed listeners to avoid hydration. Serializing subscribed closures would not be possible, as all the subscribe functions would have to be lazy-loaded and asynchronous (too expensive).\n2. Using the compiler to create graphs implicitly would work, but only for components. Intra component communications would still require `.subscribe()` methods and hence suffer the issues described above.\n\nBecause of the above constraints, Qwik uses proxies to keep track of the reactivity graph.\n\n- Use [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) to create a store proxy.\n- The proxy notices the reads and creates subscriptions that are serializable.\n- The proxy notices the writes and uses the subscription information to invalidate the relevant components.\n\n## Counter Example\n\n```tsx\nexport const Counter = component$(() => {\n  const store = useStore({ count: 0 });\n\n  return <button onClick$={() => store.count++}>{store.count}</button>;\n});\n```\n\n1. The server performs an initial render of the component. The server rendering includes creating the proxy represented by `store`.\n2. The initial render invokes the OnRender method, which has a reference to the `store` proxy. The rendering puts the proxy in \"learn\" mode. During the build-up of JSX, the proxy observes a read of the `count` property. Because the proxy is in \"learn\" mode, it records that the text node inside `Counter` has a subscription on the `store.count`.\n3. The server serializes the state of the application into HTML. This includes the `store` as well as subscription information which says that the text node inside `Counter` is subscribed to `store.count`.\n4. In the browser, the user clicks the button. Because the click event handler closed over `store`, Qwik restores the store proxy. The proxy contains the application state (the count) and the subscription, which associates the text node inside `Counter` with `state.count`.\n5. The event handler increments the `store.count`. Because the `store` is a proxy, it notices the write and uses the subscription information to create a signal operation to update the text node inside `Counter`.\n6. After `requestAnimationFrame`, the signal value is reflected in the DOM by updating the text node's value to that of the signal.\n\n## Unsubscribe example\n\n```tsx\nexport const ComplexCounter = component$(() => {\n  const store = useStore({ count: 0, visible: true });\n\n  return (\n    <>\n      <button onClick$={() => (store.visible = !store.visible)}>\n        {store.visible ? 'hide' : 'show'}\n      </button>\n      <button onClick$={() => store.count++}>increment</button>\n      {store.visible ? <p>{store.count}</p> : null}\n    </>\n  );\n});\n```\n\nThis example is a more complicated counter.\n\n- It contains the `increment` button, which always increments `store.count`.\n- It contains a `show`/`hide` button which determines if the count is shown.\n\n1. On the initial render, the count is visible. Therefore the server creates a subscription that records that `ComplexCounter` needs to get re-rendered if either `store.count` or `store.visible` changes.\n2. If the user clicks on `hide`, the `ComplexCounter` rerenders. The re-rendering clears all of the subscriptions and records new ones. This time the JSX does not read `store.count`. Therefore, only `store.visible` gets added to the list of subscriptions.\n3. User clicking on `increment` will update `store.count`, but doing so will not cause the component to re-render. This is correct because the counter is not visible, so re-rendering would be a no-op.\n4. If the user clicks `show`, the component will re-render and this time the JSX will read both `store.visible` as well as `store.count`. The subscription list is once again updated.\n5. Now, clicking on `increment` updates the `store.count`. Because the count is visible, the `ComplexCounter` is subscribed to `store.count`.\n\nNotice how the set of subscriptions automatically updates as the component renders different branches of its JSX. The advantage of the proxy is that the subscriptions update automatically as the applications execute, and the system can always compute the smallest set of invalidated components.\n\n## Deep objects\n\nSo far, the examples show the store (`useStore()`) was a simple object with primitive values.\n\n```tsx\nexport const MyComp = component$(() => {\n  const store = useStore({\n    person: { first: null, last: null },\n    location: null\n  });\n\n  store.location = {street: 'main st'};\n\n  return (\n    <section>\n      <p>{store.person.last}, {store.person.first}</p>\n      <p>{store.location.street}</p>\n    </section>\n  );\n})\n```\n\nIn the above examples, Qwik will automatically wrap child objects `person` and `location` into a proxy and correctly create subscriptions on all deep properties.\n\nThe wrapping behavior described above has one surprising side-effect. Writing and reading from a proxy auto wraps the object, which means that the identity of the object changes. This should normally not be an issue, but it is something that the developer should keep in mind.\n\n```tsx\nexport const MyComp = component$(() => {\n  const store = useStore({ person: null });\n  const person = { first: 'John', last: 'Smith' };\n  store.person = person; // store.person auto wraps object into proxy\n\n  if (store.person !== person) {\n    // The consequence of auto wrapping is that the object identity changes.\n    console.log('store auto-wrapped person into a proxy');\n  }\n});\n```\n\n## Out-of-order rendering\n\nQwik components are rendered out of order. A component can be rendered without forcing a parent component to be rendered first or a child components to be rendered as a consequence of the component render. This is an important property of Qwik because it allows Qwik applications to only re-render components which have been invalidated due to a state change rather than re-rendering the whole component tree on a state change.\n\nWhen components are rendered, they need to have access to their props. Parent components create props. The props must be [serializable](../resumable/index.mdx#serialization) for the component to render independently from the parent.\n\n## Invalidating child components\n\nWhen re-rendering a component, the child component's props either stay the same or are updated. A child component only invalidates if its props change.\n\n```tsx\nexport const Child = component$((props: { count: number }) => {\n  return <span>{props.count}</span>;\n});\n\nexport const MyApp = component$(() => {\n  const store = useStore({ a: 0, b: 0, c: 0 });\n\n  return (\n    <>\n      <button onClick$={() => store.a++}>a++</button>\n      <button onClick$={() => store.b++}>b++</button>\n      <button onClick$={() => store.c++}>c++</button>\n      {JSON.stringify(store)}\n\n      <Child count={store.a} />\n      <Child count={store.b} />\n    </>\n  );\n});\n```\n\nIn the above example, there are two `<Child/>` components.\n\n- Every time a button is clicked, one of the three counters is incremented. A change of counter state will cause the `MyApp` component to re-render on each click.\n- If `store.c` has been incremented, none of the child components get re-rendered. (And therefore, their code does not get lazy-loaded)\n- If `store.a` has been incremented, then only `<Child count={store.a}/>` will re-render.\n- If `store.b` has been incremented, then only `<Child count={store.b}/>` will re-render.\n\nNotice that the child components only re-render when their props change. This is an important property of Qwik applications as it significantly limits the amount of re-rendering the application must do on some state change. While less re-rendering has performance benefits, the real benefit is that large portions of the applications do not get downloaded if they don't need to be re-rendered.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/concepts/resumable/index.mdx",
    "content": "---\ntitle: Resumable | Concepts\ncontributors:\n  - voluntadpear\n  - RATIU5\n  - adamdbradley\n  - manucorporat\n  - Craiqser\n  - ahashem95\n  - mhevery\n  - aboudard\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-09-26T14:47:51Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Resumable vs. Hydration\n\nA key concept of Qwik applications is that they are resumable from a server-side-rendered state. The best way to explain resumability is to understand how the current generation of frameworks are replayable (hydration).\n\nWhen an SSR/SSG application boots up on a client, it requires that the framework on the client restores three pieces of information:\n\n1. Listeners - locate event listeners and install them on the DOM nodes to make the application interactive.\n2. Component tree - build up an internal data structure representing the application component tree.\n3. Application state - restore any data that was fetched or saved in a `store` on the server.\n\nCollectively, this is known as hydration. All current generations of frameworks require this step to make the application interactive.\n\n[Hydration is expensive](https://www.builder.io/blog/hydration-is-pure-overhead) for two reasons:\n\n1. The frameworks have to download all of the component code associated with the current page.\n2. The frameworks have to execute the templates associated with the components on the page to rebuild the listener location and the internal component tree.\n\n<img src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F04681212764f4025b2b5f5c6a258ad6e?format=webp&width=945\" \n     alt=\"Resumable vs Hydration\" \n     style=\"width: 100%;aspect-ratio: 2.216;\"/>\n\nQwik is different because it does not require hydration to resume an application on the client. Not requiring hydration is what makes the Qwik application startup instantaneous.\n\nAll other frameworks' hydration **replays** all the application logic on the client. Qwik instead pauses execution on the server, and resumes execution on the client.\n\n## Introducing Resumability\n\nResumability is about pausing execution on the server and resuming execution on the client without having to replay and download all of the application logic.\n\nA good mental model is that Qwik applications at any point of their lifecycle can be serialized and moved to a different VM instance (server to browser). There, the application simply resumes where the serialization stopped. No hydration is required. Hence, Qwik applications don't hydrate; they resume.\n\nIn order to achieve this, Qwik needs to solve the 3 problems (listeners, component tree, application state) in a way that is compatible with a no-code startup.\n\n### Listeners\n\nDOM without event listeners is just a static page; it is not an application. Today's standard for all sites is quite a high level of interactivity, so even the most static-looking sites are full of event listeners. These include menus, hovers, expanding details, or even full-on interactive apps.\n\nExisting frameworks solve the event listener by downloading the components and executing their templates to collect event listeners that are then attached to the DOM. The current approach has these issues:\n\n1. Requires the template code to be eagerly downloaded.\n2. Requires template code to be eagerly executed.\n3. Requires the event handler code to be downloaded eagerly (to be attached).\n\nThe above approach does not scale. As the application becomes more complicated, the amount of code needed to download eagerly and execute grows proportionally with the size of the application. This negatively impacts the application startup performance and hence the user experience.\nIn other frameworks, lazy-loading chunks of the application becomes a development task in itself that consumes time and effort. In Qwik, lazy-loading is a natural consequence of the resumable architecture.\n\nQwik solves the above issue by serializing the event listeners into DOM like so:\n\n```html\n<button on:click=\"./chunk.js#handler_symbol\">click me</button>\n```\n\nQwik still needs to collect the listener information, but this step is done as part of the SSR/SSG. The results of SSR/SSG are then serialized into HTML so that the browser does not need to do anything to resume the execution. Notice that the `on:click` attribute contains all of the information to resume the application without doing anything eagerly.\n\n1. [Qwikloader](https://qwik.dev/docs/advanced/qwikloader/) sets up a single global listener instead of many individual listeners per DOM element. This step can be done with no application code present.\n2. The HTML contains a URL to the chunk and symbol name. The attribute tells Qwikloader which code chunk to download and which symbol to retrieve from the chunk and then to be executed.\n3. Finally, to make all of the above possible, Qwik's event processing implementation understands asynchronicity which allows it to lazy load closures automatically.\n\n### Component Trees\n\nFrameworks work with component trees. To that end, frameworks need a complete understanding of the component trees to know which components need to be rerendered and when. If you look into the existing framework SSR/SSG output, the component boundary information has been destroyed. There is no way of knowing where component boundaries are by looking at the resulting HTML. To recreate this information, frameworks re-execute the component templates and memoize the component boundary location. Re-execution is what hydration is. Hydration is expensive as it requires both the download of component templates and their execution.\n\nQwik collects [component boundary information](https://qwik.dev/docs/cheat/serialization/) as part of the SSR/SSG and then serializes that information into HTML. The result is that Qwik can:\n\n1. Rebuild the component hierarchy information without the component code actually being present. The component code can remain lazy.\n2. Qwik can do this lazily only for the components which need to be re-rendered rather than all upfront.\n3. Qwik collects relationship information between stores and components. This creates a subscription model that informs Qwik which components need to be re-rendered as a result of state change. The subscription information also gets serialized into HTML.\n\n### Application State\n\nExisting frameworks usually have a way of serializing the application state into HTML so that the state can be restored as part of hydration. In this way, they are very similar to Qwik. However, Qwik has state management more tightly integrated into the lifecycle of the components. In practice, this means that component can be delay-loaded independently from the state of the component. This is not easily achievable in existing frameworks because component props are usually created by the parent component. This creates a chain reaction. In order to restore component X, its parents need to be restored as well. Qwik allows any component to be resumed without the parent component code being present.\n\n#### Serialization\n\nThe simplest way to think about serialization is through `JSON.stringify`. However, JSON has several limitations. Qwik can overcome some limitations, but some can't be overcome, and they place limitations on what the developer can do. Understanding these limitations is important when building Qwik applications.\n\nLimitations of JSON which Qwik solves:\n\n- JSON produces a DAG. DAG stands for Directed Acyclic Graph, which means that the object which is being serialized can't have circular references. This is a big limitation because the application state is often circular. Qwik ensures that when the graph of objects gets serialized, the circular references get properly saved and then restored.\n- JSON can't serialize some object types. For example, DOM references, or Dates. Qwik's serialization format ensures that such objects can correctly be serialized and restored. Here is a list of types that can be serialized with Qwik:\n  - DOM references\n  - Promises (See [resources](../../components/resource/))\n  - Function closures (if wrapped in QRL)\n  - Dates\n  - `URL` objects\n  - `Map` and `Set` instances.\n\nLimitations of JSON that Qwik does not solve:\n\n- Serialization of classes (`instanceof` and prototype)\n  - Although some built-in classes, such as [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL), [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) are supported.\n- Serialization of Streams.\n\nFor cases where serialization is not possible, code should run [on client only](https://qwik.dev/docs/core/lifecycle/#serverbrowser-only-task).\n\n### Writing applications with serializability in mind\n\nThe resumability capability of the framework must extend to resumability of the application as well. This means that the framework must provide mechanisms for the developer to express *components* and *entities* of the application in a way which can be serialized and then resumed (without re-bootstrapping). This necessitates that the application is written with resumability constraints in mind. It is simply not possible for developers to continue to write applications in a heap-centric way and expect that a better framework can somehow make up for this sub-optimal approach.\n\nDevelopers must write their applications in a DOM-centric way. This will require a change of behavior and retooling of web developers' skills. Frameworks need to provide guidance and APIs to make it easy for developers to write the applications in this way.\n\n### Other benefits of resumability\n\nThe most obvious benefit of using resumability is for server-side-rendering. However, there are secondary benefits:\n\n- Serializing existing PWA apps so that users don't lose context when they return to the application\n- Improved rendering performance because only changed components need to be re-rendered\n- Fine-grained lazy-loading\n- Decreased memory pressure, especially on mobile devices\n- Progressive interactivity of existing static websites\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/concepts/think-qwik/index.mdx",
    "content": "---\ntitle: Think Qwik | Concepts\ncontributors:\n  - manucorporat\n  - hayley\n  - adamdbradley\n  - literalpie\n  - mhevery\n  - mrhoodz\n  - moinulmoin\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-06-19T21:03:04Z'\n---\n\n# Think Qwik\n\nQwik is very similar to other web frameworks at a high level. Qwik is a framework that renders a tree of components resulting in an interactive application.\n\nThe unique part of Qwik is not in what it does but in how it achieves its goals. Qwik's goal is to have instant-on applications, even on mobile devices. Qwik achieves this through two main strategies:\n\n1. Delay execution and download of JavaScript for as long as possible.\n2. Serialize the execution state of the application and the framework on the server and resume it on the client.\n\nThe goal of Qwik is having only to download and execute the bare minimum of the application.\n\n## Delay Execution\n\n> Delay execution of JavaScript as much as possible.\n\nQwik applications startup fast because there is a minimal amount of JavaScript code to execute. (At its simplest, a Qwik application only needs about 1KB of JavaScript to become interactive.)\n\nBy aggressively delaying the application download and execution, Qwik can provide near-instant startup performance. No current generation of web frameworks can match this implementation.\n\nQwik is fast not because it uses clever algorithms but because it is designed in a way where most of the JavaScript never needs to be downloaded or executed. Its speed comes from not doing things (such as hydration) that other frameworks have to do.\n\n## Resumability & Serialization\n\nResumability is discussed in detail [here](../resumable/index.mdx). Resumability allows Qwik applications to continue execution where the server left off. All frameworks need to keep track of internal data structures about the application's state. The current generation of frameworks does not preserve this information when transitioning from the server to the browser. As a result, the framework's data structures need to be rebuilt in the browser, duplicating the work that was done on the server. The rebuilding of data structures and attaching of listeners is called hydration.\n\nQwik serializes listeners, internal data structures, and application state into the HTML during the server-browser handoff. Because all of the information is serialized in HTML, the client can just resume execution where the server left off.\n\n## What is the problem?\n\nModern websites require vast amounts of JavaScript to become interactive. Too much JavaScript manifests itself in two problems:\n\n1. **Network bandwidth**: A large amount of code is shipped to the client, which may take a long time on slow networks.\n2. **Startup time**: Once on the client, the code needs to be executed (as part of hydration) to get the site interactive.\n\nAs applications get more complex with a higher fidelity of interactivity, the amount of code being shipped has steadily increased over the years, with no sign of stopping. Simply put, websites are getting more complicated. An increase in site complexity, in turn, requires more code. All of this code negatively impacts site startup performance.\n\nTo make matters worse, JavaScript is single-threaded; therefore, complex sites can't take advantage of modern multi-core CPUs.\n\n### How did we get here?\n\nThe solution to the above problem is both obvious and hard: Ship less JavaScript.\n\nThe obvious part is that sites with less JavaScript will perform better.\n\nThe hard part is that our tools don't help us achieve this. Most of them solve problems in a way that makes shipping less JavaScript hard. These tools are designed to address specific issues without considering how much JavaScript they produce.\n\nDo you need to solve rendering, styling, animation, A/B testing, analytics, etc.? There is a tool for that. Just import or add a `<script>` tag, and these tools will solve your problems, but at the expense of making the initial bundle bigger.\n\nAs an industry, the implication of bundle size has often been overlooked. Each tool solves a specific problem individually, but size is not part of the equation. Size becomes a problem when all the tools are combined, and by that point, there is very little the developer can do about it.\n\n### What's the solution?\n\nQwik is designed from the ground up to address the size problem. Small bundle size is its initial goal, and all other design decisions are subservient to that goal.\n\nQwik is not about creating less JavaScript. Qwik is about not having to ship all of that JavaScript to the client at once on application startup. Qwik is what you end up with when you take the idea of \"delay loading of JavaScript\" to the extreme.\n\nYes, Qwik requires a different way of thinking and designing your application, but the result is near zero initial JavaScript with progressive JavaScript download based on user interactions.\n\n### Size should not be a developer problem\n\nToday, size is the developers' problem. If you follow best practices for each of the frameworks, tools, etc., you will have a large bundle size. It is at that time when developers start to mitigate the problem with some sort of lazy loading boundaries etc. (But as anyone who has done this will tell you: the options are limited.)\n\nIndustry best practices lead to large bundles, and the web is full of examples.\n\nThe mantra of Qwik is that bundle size should not be something that developers should think about. It should just naturally emerge as part of how the framework is designed.\n\nQwik is designed from the ground up to produce lots of lazy loadable boundaries. Tooling can break up your application into many lazy-loadable chunks, and the runtime can download them only when needed.\n\n### Why not fix existing frameworks/tools?\n\nIn short, the lazy loading philosophy must be done at a low level and can not be retroactively added to the existing frameworks/tools without changing them fundamentally. Such fundamental change would be incompatible with the framework/tools and their respective ecosystems, rendering them useless.\n\nWhen a framework makes certain assumptions, such as that all rendering is synchronous, adding asynchronous lazy loading becomes pretty close to impossible. Or, if a framework recovers the listener location from templates, then download and execution of those templates is a must before the site can be interactive. These are just some of the more obvious examples, but in practice, there is a long tail of endless reasons why the current mental model does not fit the requirements of resumability.\n\nThe above also means that it is not feasible for existing frameworks to add resumability as a feature. Existing frameworks will never be able to do what Qwik can (without breaking backward compatibility).\n\n### Why are we building Qwik?\n\nBecause we believe there is a better way to build sites. A way that does not involve massive amounts of JavaScript that must be downloaded eagerly on startup before your site becomes interactive. A way that allows the developer to think about adding features rather than how to break up the huge codebase into smaller chunks. A way to have instant-on sites for a better user experience. And all of that, in a way that is independent of the size of the application codebase.\n\n## Does page speed really matter?\n\nPut simply: slow sites deter visitors, costing businesses millions. Fast sites have better SEO, better UX, and are more profitable.\n\nSome examples from [web.dev](https://web.dev/tags/case-study/):\n\n|                                                                                                                                                                                                                                               |                                                                                                                                                        |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| **Every 100ms faster → 1% more conversions** <br /> For Mobify, every 100ms decrease in homepage load speed worked out to a 1.11% increase in session-based conversion, yielding an average annual revenue increase of nearly $380,000.       | **50% faster → 12% more sales** <br /> When AutoAnything reduced page load time by half, they saw a boost of 12% to 13% in sales.                      |\n| **20% faster → 10% more conversions** <br /> Retailer Furniture Village audited their site speed and developed a plan to address the problems they found, leading to a 20% reduction in page load time and a 10% increase in conversion rate. | **40% faster → 15% more sign-ups** <br /> Pinterest reduced perceived wait times by 40% and this increased search engine traffic and sign-ups by 15%.  |\n| **850ms faster → 7% more conversions** <br /> COOK reduced average page load time by 850 milliseconds which increased conversions by 7%, decreased bounce rates by 7%, and increased pages per session by 10%.                                | **1 seconds slowness → 10% less users** <br /> The BBC found they lost an additional 10% of users for every additional second their site took to load. |\n|                                                                                                                                                                                                                                               |                                                                                                                                                        |\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/context/index.mdx",
    "content": "---\ntitle: Context | Components\ncontributors:\n  - manucorporat\n  - RATIU5\n  - nnelgxorz\n  - adamdbradley\n  - the-r3aper7\n  - cunzaizhuyi\n  - forresst\n  - kerbelp\n  - shairez\n  - mhevery\n  - AnthonyPAlicea\n  - steve8708\n  - mrhoodz\n  - Jemsco\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\nimport CodeSandbox from '../../../../../components/code-sandbox/index.tsx';\n\n# Context\n\nQwik provides a context API, which solves the problem of props drilling and it is very similar to React's functional `useContext()`. In fact, Qwik's context API is the most efficient way to pass down data to different components, reducing overhead, generating less code, and allowing Qwik to more effectively [treeshake](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) unused data.\n\nQwik's context API is made of 3 methods, importable from `@builder.io/qwik`:\n\n- [`createContextId(contextName: string): ContextId`](#createcontextid)\n- [`useContextProvider(ctx: ContextId, value: VALUE): void`](#usecontextprovider)\n- [`useContext(ctx: ContextId): VALUE`](#usecontext)\n\n<CodeSandbox src=\"/src/routes/demo/context/minimal/index.tsx\" style={{ height: '6em' }}>\n```tsx /createContextId/#a /useContext/#b /useContextProvider/#c\nimport { type Signal, component$, useSignal } from '@builder.io/qwik';\nimport {\n  useContext,\n  useContextProvider,\n  createContextId,\n} from '@builder.io/qwik';\n\nexport const ThemeContext = createContextId<Signal<string>>(\n  'docs.theme-context'\n);\n\nexport default component$(() => {\n  const theme = useSignal('dark');\n  useContextProvider(ThemeContext, theme);\n  return (\n    <>\n      <button\n        onClick$={() =>\n          (theme.value = theme.value == 'dark' ? 'light' : 'dark')\n        }\n      >\n        Flip\n      </button>\n      <Child />\n    </>\n  );\n});\n\nconst Child = component$(() => {\n  const theme = useContext(ThemeContext);\n  return <div>Theme is {theme.value}</div>;\n});\n```\n</CodeSandbox>\n\n\nIn the above example, a `ContextId` named `docs.theme-context` is created and used to provide a `useSignal` to the `default` component. The `Child` component uses the `useContext` method to get the `useSignal` and render its value.\n\n## `createContextId()`\n\nThis method is used to create a new `ContextId`.\n\n```tsx\nexport interface GenericType {\n  ...\n}\n\nexport const QwikCityContext = createContextId<GenericType>(name: string): ContextId<GenericType>;\n```\n\n### Parameters\n\n- `name`: is a unique string given to `createContextId` as an identifier of the context. This will avoid conflicts when there are multiple contexts. It is advised to use a naming convention like `io.builder.qwik.city`.\n\n### Returns\n\nNotice that the value returned by `createContextId()` does not hold any state, it is an immutable ID object i.e. `{ id: 'io.builder.qwik.city' }`. It's only used to describe the name and type of the context, like an address or an identifier.  Since it doesn't hold any state, it can be initialized as a singleton and exported from a shared module.\n\n## `useContextProvider()`\n\nThis method is used to create a Context for a specific component and its descendants, using the `ContextId` as the key identifier of the context.\n\n```tsx {9, 10, 11} /QwikCityContext/#a /PlainArrayContext/#b /AppNameContext/#c title=\"src/components/Parent.tsx\"\nimport { component$, useStore, useContextProvider } from '@builder.io/qwik';\n\nexport const Parent = component$(() => {\n\n  const qwikCityObject = useStore<GenericType>({\n    ...\n  });\n\n  useContextProvider(QwikCityContext, qwikCityObject);\n  useContextProvider(PlainArrayContext, [1, 2, 3])\n  useContextProvider(AppNameContext, \"My Qwik App\")\n\n  return (\n    <Children />\n  );\n});\n```\n\n### Parameters\n\n- `ContextId`: A previously created Context must be supplied, serving as an identifier for the data being provided as the second parameter.\n\n- `data`: You can provide any data type, such as Qwik's ﻿useSignal, ﻿useStore, arrays, or objects.\n\n### Caveats\n\n- The provided value will not be globally available across the whole render tree, but only to descendant components in the tree.\n- If the context isn't used during Server-Side Rendering (SSR), it will not be serialized. If you need the context available on the client, even though it's not used during SSR, you should call `useContext()` in the parent component.  This will force it to be serialized.\n\n## `useContext()`\n\nThis method is used to get the value of `Context` which is **provided** by Parent Component.\n\n```tsx {4,5,6} /useContext/ /QwikCityContext/#a /PlainArrayContext/#b /AppNameContext/#c title=\"src/components/Children.tsx\"\nimport { component$, useContext } from '@builder.io/qwik';\n\nexport const Children = component$(() => {\n  const qwikCityObject = useContext(QwikCityContext);\n  const plainArray = useContext(PlainArrayContext);\n  const appName = useContext(AppNameContext);\n\n  return (\n    <div>Child components can use any of the provided values, such as {appName}</div>\n  );\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/events/index.mdx",
    "content": "---\ntitle: Events | Components\ncontributors:\n  - voluntadpear\n  - the-r3aper7\n  - RATIU5\n  - manucorporat\n  - nnelgxorz\n  - adamdbradley\n  - hamatoyogi\n  - fleish80\n  - cunzaizhuyi\n  - Pika-Pool\n  - mhevery\n  - AnthonyPAlicea\n  - amatiash\n  - harishkrishnan24\n  - fabian-hiller\n  - igorbabko\n  - mrhoodz\n  - julianobrasil\n  - maiieul\n  - Balastrong\n  - Jemsco\n  - shairez\nupdated_at: '2024-01-09T20:55:11Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\nimport CodeSandbox from '../../../../../components/code-sandbox/index.tsx';\n\n# Events\n\nFor a web application to be interactive, there needs to be a way to respond to user events. This is done by registering callback functions in the JSX template. Event handlers are registered using the `on{EventName}$` attribute. For example, the `onClick$` attribute is used to listen for `click` events.\n\n```tsx /onClick$/\n<button onClick$={() => alert('CLICKED!')}>click me!</button>\n```\n\n## Inline Handler\n\nIn the following example, the `onClick$` attribute of the `<button>` element is used to let Qwik know that a callback `() => store.count++` should be executed whenever the `click` event is fired by the `<button>`.\n\n<CodeSandbox src=\"/src/routes/demo/state/counter-signal/index.tsx\" style={{ height: '6em' }}>\n```tsx {7} /onClick$/\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <button onClick$={() => count.value++}>\n      Increment {count.value}\n    </button>\n  );\n});\n```\n</CodeSandbox>\n\nYou can also use `bind:propertyName` to conveniently have a [two-way binding](/docs/(qwik)/core/rendering/index.mdx#bind-attribute) between a signal and an input element.\n\nNotice that `onClick$` ends with [`$`](/docs/(qwik)/advanced/dollar/index.mdx). This is a hint to both the [Optimizer](/docs/(qwik)/advanced/optimizer/index.mdx) and the developer that a special transformation occurs at this location. The presence of the `$` suffix implies a lazy-loaded boundary here. The code associated with the `click` handler is not loaded into the JavaScript Virtual Machine (VM) until the user activates the click event. However, to avoid delays during the first interaction, it is eagerly loaded into the browser cache.\n\n> In real-world applications, the listener may refer to complex code. By creating a lazy-loaded boundary (with the `$`), Qwik can tree-shake all of the code behind the click listener and delay its loading until the user clicks the button.\n\n## Reusing Event Handlers\n\nTo reuse the same event handler for multiple elements or events, you have to wrap the event handler into the `$()` function exported by `@builder.io/qwik`. This transforms it into a [`QRL`](/docs/advanced/qrl/).\n\n<CodeSandbox src=\"/src/routes/demo/events/extracted-handler/index.tsx\" style={{ height: '6em' }}>\n```tsx {5} /increment/#a\nimport { component$, useSignal, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  const increment = $(() => count.value++);\n  return (\n    <>\n      <button onClick$={increment}>Increment</button>\n      <p>Count: {count.value}</p>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n\n> **Note:** If you extract the event handler, you must manually wrap it in the `$(...handler...)`. This ensures that it is lazily attached.\n\n## Multiple Event Handlers\n\nTo register multiple event handlers for the same event, you can pass an array of event handlers to the `on{EventName}$` attribute.\n\n```tsx /onClick$/\nimport { component$, useSignal, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  const print = $((ev) => console.log('CLICKED!', ev));\n  const increment = $(() => count.value++);\n\n  // The button when clicked will print \"CLICKED!\" to the console, increment the count and send an event to Google Analytics.\n  return (\n    <button\n      onClick$={[print, increment, $(() => {\n        ga.send('click', { label: 'increment' });\n      })]}\n    >\n      Count: {count.value}\n    </button>\n  );\n});\n```\n\n## Event Object\n\nThe first argument of the event handler is the `Event` object. This object contains information about the event that triggered the handler. For example, the `Event` object for a `click` event contains information about the mouse position and the element that was clicked. You can check out the [MDN docs to know more details about each DOM event](https://developer.mozilla.org/en-US/docs/Web/API/Event).\n\n<CodeSandbox src=\"/src/routes/demo/events/mouse-position/index.tsx\" style={{ height: '6em' }}>\n```tsx /event/\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const position = useSignal<{ x: number; y: number }>();\n  return (\n    <div\n      onClick$={(event) => (position.value = { x: event.x, y: event.y })}\n      style=\"height: 100vh\"\n    >\n      <p>\n        Clicked at: ({position.value?.x}, {position.value?.y})\n      </p>\n    </div>\n  );\n});\n```\n</CodeSandbox>\n\n## Asynchronous Events\n\nDue to Qwik's asynchronous nature, the execution of an event handler might be delayed if the implementation has not yet been loaded into the JavaScript VM. Consequently, the following APIs on an Event object will not work:\n\n- `event.preventDefault()`\n- `event.stopPropagation()`\n- `event.currentTarget`\n\n### preventDefault & stopPropagation\n\nBecause event handling is asynchronous, you can't use `event.preventDefault()` or `event.stopPropagation()`. To solve this, Qwik introduces a declarative way to prevent default through `preventdefault:{eventName}` and `stoppropagation:{eventName}` attributes.\n\n<CodeSandbox src=\"/src/routes/demo/events/preventdefault/index.tsx\" style={{ height: '6em' }}>\n```tsx {7}\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <a\n      href=\"/docs\"\n      preventdefault:click // This will prevent the default behavior of the \"click\" event.\n      stoppropagation:click // This will stop the propagation of the \"click\" event.\n      onClick$={() => {\n        // event.PreventDefault() will not work here, because handler is dispatched asynchronously.\n        alert('Do something else to simulate navigation...');\n      }}\n    >\n      Go to docs page\n    </a>\n  );\n});\n```\n</CodeSandbox>\n\n### Event Target\n\nBecause event handling is asynchronous, you can't use `event.currentTarget`. To solve this, Qwik handlers provide a `currentTarget` as a second argument.\n\n<CodeSandbox src=\"/src/routes/demo/events/target/index.tsx\" style={{ height: '10em' }}>\n```tsx /currentTarget/\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const currentElm = useSignal<HTMLElement|null>(null);\n  const targetElm = useSignal<HTMLElement|null>(null);\n\n  return (\n    <section onClick$={(event, currentTarget) => {\n      currentElm.value = currentTarget;\n      targetElm.value = event.target as HTMLElement;\n    }}>\n      Click on any text <code>target</code> and <code>currentElm</code> of the event.\n      <hr/>\n      <p>Hello <b>World</b>!</p>\n      <hr/>\n      <ul>\n        <li>currentElm: {currentElm.value?.tagName}</li>\n        <li>target: {targetElm.value?.tagName}</li>\n      </ul>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n> **Note:** `currentTarget` in the DOM points to the element that the event listener was attached to. In the example above it will always be the `<SECTION>` element.\n\n### Synchronous Event Handling\n\nIn some cases, it is necessary to handle an event traditionally, because some APIs need to be used synchronously. For example, `dragstart` event must be processed synchronously and therefore it can't be combined with Qwik's lazy code execution.\n\nTo do this, you can leverage a `useVisibleTask` to programmatically add an event listener using the DOM API directly.\n\n<CodeSandbox src=\"/src/routes/demo/events/synchronous/index.tsx\" style={{ height: '10em' }}>\n```tsx {7-20}\nimport { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const draggableRef = useSignal<HTMLElement>();\n  const dragStatus = useSignal('');\n\n  useVisibleTask$(({ cleanup }) => {\n    if (draggableRef.value) {\n      // Use the DOM API to add an event listener.\n      const dragstart = () => (dragStatus.value = 'dragstart');\n      const dragend = () => (dragStatus.value = 'dragend');\n\n      draggableRef.value!.addEventListener('dragstart', dragstart);\n      draggableRef.value!.addEventListener('dragend', dragend);\n      cleanup(() => {\n        draggableRef.value!.removeEventListener('dragstart', dragstart);\n        draggableRef.value!.removeEventListener('dragend', dragend);\n      });\n    }\n  });\n\n  return (\n    <div>\n      <div draggable ref={draggableRef}>\n        Drag me!\n      </div>\n      <p>{dragStatus.value}</p>\n    </div>\n  );\n});\n```\n</CodeSandbox>\n\n> **NOTE** Using `VisibleTask` to listen for events is an anti-pattern in Qwik because it causes eager execution of code in the browser defeating [resumability](/docs/(qwik)/concepts/resumable/index.mdx). Only use it when you have no other choice. You should use JSX to listen for events, for example: `<div onClick$={...}>`. Alternatively, if you need to listen to events programmatically, consider using the `useOn(...)` event methods.\n\n## Custom Event Props\n\nWhen creating your components, it is often useful to pass custom event props that resemble event handlers, even though they are just callbacks and not actual DOM events. Component boundaries in Qwik must be serializable for the optimizer to split them up into separate chunks. Functions are not serializable unless they are converted to a QRL.\n\nFor example, listening for triple click events, which html cannot do by default, would require creating an `onTripleClick$` custom event prop.\n<CodeSandbox src=\"/src/routes/demo/events/custom-event/index.tsx\" style={{ height: '10em' }}>\n```tsx\nimport { component$, Slot, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <Button onTripleClick$={() => alert('TRIPLE CLICKED!')}>\n      Triple Click me!\n    </Button>\n  );\n});\n\ntype ButtonProps = {\n  onTripleClick$: QRL<() => void>;\n};\n\nexport const Button = component$<ButtonProps>(({ onTripleClick$ }) => {\n  const state = useStore({\n    clicks: 0,\n    lastClickTime: 0,\n  });\n  return (\n    <button\n      onClick$={() => {\n        // triple click logic\n        const now = Date.now();\n        const timeBetweenClicks = now - state.lastClickTime;\n        state.lastClickTime = now;\n        if (timeBetweenClicks > 500) {\n          state.clicks = 0;\n        }\n        state.clicks++;\n        if (state.clicks === 3) {\n          // handle custom event\n          onTripleClick$();\n          state.clicks = 0;\n        }\n      }}\n    >\n      <Slot />\n    </button>\n  );\n});\n```\n</CodeSandbox>\n\n> Notice the use of the `QRL` type in `onTripleClick$: QRL<() => void>;`. It is like wrapping a function in `$()` but at the type level. If you had `const greet = $(() => \"hi 👋\");` and hovered over 'greet', you would see that 'greet' is of type `QRL<() => \"hi 👋\">`\n\n## Window and Document Events\n\nSo far, the discussion has focused on listening to events originating from elements. There are events such as `scroll` and `mousemove` that need to be listened to on the `window` or `document`. Qwik allows this by providing the `document:on` and `window:on` prefixes when listening for events.\n\nThe `window:on`/`document:` prefixes are used to register an event at the current DOM location of the component while allowing it to receive events from the `window`/`document`. There are two advantages to this:\n\n1. The events can be registered declaratively in your JSX.\n2. The events get automatically cleaned up when the component is destroyed (No explicit bookkeeping and cleanup is needed).\n\n## `useOn[window|document]` Hook\n\n- `useOn()`: listen to events on the current component's root element.\n- `useOnWindow()`: listen to events on the `window` object.\n- `useOnDocument()`: listen to events on the `document` object.\n\n`useOn[window|document]()` hook will add a DOM-based event listener at the component level programmatically. This is often useful when you want to create your own use hooks or if you don't know the event name at the time of compilation.\n\n<CodeSandbox src=\"/src/routes/demo/events/use-on/index.tsx\" style={{ height: '10em' }}>\n```tsx\nimport { $, component$, useOnDocument, useStore } from '@builder.io/qwik';\n\n// Assume reusable use method that does not have access to JSX\n// but needs to register event handlers.\nfunction useMousePosition() {\n  const position = useStore({ x: 0, y: 0 });\n  useOnDocument(\n    'mousemove',\n    $((event) => {\n      const { x, y } = event as MouseEvent;\n      position.x = x;\n      position.y = y;\n    })\n  );\n  return position;\n}\n\nexport default component$(() => {\n  const pos = useMousePosition();\n  return (\n    <div>\n      MousePosition: ({pos.x}, {pos.y})\n    </div>\n  );\n});\n```\n</CodeSandbox>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/overview/index.mdx",
    "content": "---\ntitle: Overview | Components\ncontributors:\n  - RATIU5\n  - leifermendez\n  - manucorporat\n  - adamdbradley\n  - cunzaizhuyi\n  - shairez\n  - the-r3aper7\n  - zanettin\n  - Craiqser\n  - steve8708\n  - mforncro\n  - georgeiliadis91\n  - leader22\n  - almilo\n  - estherbrunner\n  - kumarasinghe\n  - mhevery\n  - AnthonyPAlicea\n  - khalilou88\n  - n8sabes\n  - fabian-hiller\n  - gioboa\n  - mrhoodz\n  - eecopa\n  - drumnistnakano\n  - maiieul\n  - wmertens\n  - aendel\n  - jemsco\nupdated_at: '2023-12-14T18:38:38Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\nimport CodeSandbox from '../../../../../components/code-sandbox/index.tsx';\n\n# Components\n\nComponents are the basic building blocks of Qwik Applications. They are reusable pieces of code that can be used to build a UI.\n\nQwik components are unique in that:\n\n- Qwik components automatically get broken down into lazy-loaded chunks by the [Optimizer](../../advanced/optimizer/index.mdx).\n- They are [resumable](../../concepts/resumable/index.mdx) (a component can get created on a server and continue its execution on the client).\n- They are [reactive](../../concepts/reactivity/index.mdx) and render independently of other components on the page. See [rendering](../../components/rendering/index.mdx).\n\n## `component$()`\n\nA Qwik component is a function that returns JSX wrapped in a `component$` call.\n\n<CodeSandbox src=\"/src/routes/demo/component/simple/index.tsx\" style={{ height: '3em' }}>\n```tsx /component$/\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <div>Hello World!</div>;\n});\n```\n</CodeSandbox>\n\n> The `component$` function, marked by the trailing `$`, enables the Optimizer to split components into separate chunks.\nThis allows each chunk to be loaded independently as needed, rather than loading all components whenever the parent component is loaded.\n> Note: index.tsx, layout.tsx in routes folder, root.tsx and all entry files need **export default**. For other components you can use export const and export function.\n\n### Composing Components\n\nComponents can be composed together to create more complex components.\n\n\n<CodeSandbox src=\"/src/routes/demo/component/child/index.tsx\" style={{ height: '6em' }}>\n```tsx {7}\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Parent Text</p>\n      <Child />\n    </>\n  );\n});\n\nconst Child = component$(() => {\n  return <p>Child Text</p>;\n});\n```\n</CodeSandbox>\n\n> Notice that Qwik components are already lazy loaded thanks to the `$` sign. That means that you don't need to dynamically import the child component manually, Qwik will do it for you.\n\n### Dot Notation Components\n\nWhile you cannot directly attach properties to a component created with `component$` (e.g. `Scene.Title = Title`), you can achieve dot-notation by using ES module exports or barrel files.\n\n#### Using Barrel Files\n\nCreate an `index.ts` file in your component directory to group related components:\n\n```tsx\n// components/scene/index.ts\nexport { SceneComponent as Root } from './scene-root';\nexport { SceneTitle as Title } from './scene-title';\n```\n\nThen, you can import and use them with dot notation:\n\n```tsx\nimport * as Scene from './components/scene';\n\nexport default component$(() => {\n  return (\n    <Scene.Root>\n      <Scene.Title>ACT III Scene II</Scene.Title>\n    </Scene.Root>\n  );\n});\n```\n\n#### Exporting as Namespace\n\nYou can also export all sub-components from a directory as a single namespace:\n\n```tsx\n// components/ui/index.ts\nexport * as Select from './select';\nexport * as Accordion from './accordion';\n```\n\nAnd use it like so:\n\n```tsx\nimport { Select } from './components/ui';\n\nexport default component$(() => {\n  return (\n    <Select.Root>\n      <Select.Item>Option 1</Select.Item>\n    </Select.Root>\n  );\n});\n```\n\n### Counter Example\n\nA slightly more complex example of a counter.\n\n<CodeSandbox src=\"/src/routes/demo/state/counter/index.tsx\" style={{ height: '6em' }}>\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <>\n      <p>Count: {count.value}</p>\n      <button onClick$={() => count.value++}>Increment</button>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n## Props\n\nProps are used to pass data from the parent into the component. Data passed via props is accessible via the `props` argument to the `component$` function.\n\nProps are shallowly immutable, meaning primitive data types (strings, numbers, booleans) cannot be changed once passed. However, internal elements of reference types (objects, arrays, functions) can be changed despite the reference itself being immutable.\n\nTo change primitive props data in the parent component from the child component, use signals. When updating data locally within the child component a signal is not necessary, destructure the props and use the values to define new local variables.\n\nThe two examples below show a component `Item` that declares optional `name`, `quantity`, `description`, and `price` props.\n\nIn the first example, primitive data types are passed via props. The `price` prop is passed as a signal and can be changed from the parent component. `quantity` is passed as a number value that is used to define a new signal in `Item` that can be reactively updated locally. Alternatively, if quantity did not need to be reactive it could be defined as a normal variable instead of a signal.\n\n<CodeSandbox src=\"/src/routes/demo/component/primitive-props/index.tsx\" style={{ height: '10em' }}>\n```tsx {3-8, 27} /ItemProps/\nimport { component$, useSignal } from \"@builder.io/qwik\";\nimport type { Signal } from \"@builder.io/qwik\";\n\ninterface ItemProps {\n  name?: string;\n  quantity?: number;\n  description?: string;\n  price?: Signal<number>;\n}\n\nexport const Item = component$<ItemProps>((props) => {\n  const localQuantity = useSignal(props.quantity);\n\n  return (\n    <ul>\n      <li>name: {props.name}</li>\n      <li>quantity: {localQuantity}</li>\n      <li>description: {props.description}</li>\n      <li>price: {props.price}</li>\n    </ul>\n  );\n});\n\nexport default component$(() => {\n  const price = useSignal(9.99);\n\n  return (\n    <>\n      <h1>Props</h1>\n      <Item name=\"hammer\" price={price} quantity={5} />\n    </>\n  );\n});\n\n```\n</CodeSandbox>\n\nIn this second example, the props are passed as a single details object containing the data, instead of individual primitive values. This allows the data inside to be mutated without the use of signals. However, the details object storing the data is still immutable and cannot be changed once passed.\n\n<CodeSandbox src=\"/src/routes/demo/component/reference-props/index.tsx\" style={{ height: '10em' }}>\n```tsx {3-8, 27} /ItemProps/\nimport { component$ } from \"@builder.io/qwik\";\n\ninterface ItemProps {\n  details: {\n    name?: string;\n    quantity?: number;\n    description?: string;\n    price?: number;\n  };\n}\n\nexport const Item = component$((props: ItemProps) => {\n  props.details.price = 4.99;\n\n  return (\n    <ul>\n      <li>name: {props.details.name}</li>\n      <li>quantity: {props.details.quantity}</li>\n      <li>description: {props.details.description}</li>\n      <li>price: {props.details.price}</li>\n    </ul>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Item\n      details={{ name: \"hammer\", quantity: 5, description: \"\", price: 9.99 }}\n    />\n  );\n});\n\n```\n</CodeSandbox>\n\n> In the examples above, we are using `component$<ItemProps>` to provide an explicit type for the props. This is optional, but it allows the TypeScript compiler to check that the props are used correctly.\n\n### Default props\n\nYou can use the destructuring pattern with props to provide default values.\n\n```tsx\ninterface Props {\n  enabled?: boolean;\n  placeholder?: string;\n}\n\n// We can use JS's destructuring of props to provide a default value.\nexport default component$<Props>(({enabled = true, placeholder = ''}) => {\n  return (\n    <input disabled={!enabled} placeholder={placeholder} />\n  );\n});\n```\n\n## Rendering on Reactivity\n\nQwik components are reactive. This means that they automatically update on a state change. There are two kinds of updates:\n\n1. A state is bound to a DOM text or attribute. Such changes usually directly update the DOM and do not require component function re-execute.\n2. A state causes a structural change to the DOM (elements are created and or removed). Such changes require component function to re-execute.\n\nThe thing to keep in mind is that when state changes, your component function may execute zero or more times depending on what the state is bound to. For this reason, the function should be idempotent and you should not rely on the number of times it executes.\n\nA state change causes the component to get invalidated. When components get invalidated, they are added to the invalidation queue, which is flushed (rendered) on the next `requestAnimationFrame`. This acts as a form of coalescing for component rendering.\n\n## Getting hold of DOM element\n\nUse `ref` to get hold of a DOM element. Create a signal to store DOM element. Then pass the signal to the JSX `ref` property.\n\n> Getting a reference to DOM elements can be useful to calculate the element size (`getBoundingClientRect`), computed styles, initializing a WebGL canvas, or even wire-up some third-party library that interacts with DOM elements directly.\n\n<CodeSandbox src=\"/src/routes/demo/component/ref/index.tsx\" style={{ height: '10em' }}>\n```tsx /const outputRef = useSignal<Element>();/ /ref={outputRef}/\nimport { component$, useVisibleTask$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const width = useSignal(0);\n  const height = useSignal(0);\n  const outputRef = useSignal<Element>();\n\n  useVisibleTask$(() => {\n    if (outputRef.value) {\n      const rect = outputRef.value.getBoundingClientRect();\n      width.value = Math.round(rect.width);\n      height.value = Math.round(rect.height);\n    }\n  });\n\n  return (\n    <section>\n      <article\n        ref={outputRef}\n        style={{ border: '1px solid red', width: '100px' }}\n      >\n        Change text value here to stretch the box.\n      </article>\n      <p>\n        The above red box is {height.value} pixels high and {width.value}{' '}\n        pixels wide.\n      </p>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n## Accessing Elements by `id` Across Server and Client Environments\n\nIn server and client environments, elements must sometimes be accessed by their `id`. Use the `useId()` function to get a unique identifier for the current component that remains consistent across server-side rendering (SSR) and client-side operations. This is pivotal when server-rendered components need client-side scripting, such as:\n\n1. **Animation Engines**\n2. **Accessibility Enhancement**\n3. **Other Client-Side Libraries**\n\nIn a microfrontends setup, where multiple fragments run concurrently, `useId()` ensures unique and consistent IDs across execution environments, eliminating conflicts.\n\n<CodeSandbox src=\"/src/routes/demo/component/useId/index.tsx\" style={{ height: '10em' }}>\n```tsx /const outputRef = useSignal<Element>();/ /ref={outputRef}/\nimport {\n  component$,\n  useId,\n  useSignal,\n  useVisibleTask$,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const elemIdSignal = useSignal<string | null>(null);\n  const id = useId();\n  const elemId = `${id}-example`;\n  console.log('server-side id:', elemId);\n\n  useVisibleTask$(() => {\n    const elem = document.getElementById(elemId);\n    elemIdSignal.value = elem?.getAttribute('id') || null;\n    console.log('client-side id:', elemIdSignal.value);\n  });\n\n  return (\n    <section>\n      <div id={elemId}>\n        Both server-side and client-side console should match this id:\n        <br />\n        <b>{elemIdSignal.value || null}</b>\n      </div>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n## Lazy Loading\n\nThe component also serves an important role when breaking parent-child relationships for bundling purposes.\n\n```tsx\nexport const Child = () => <span>child</span>;\n\nconst Parent = () => (\n  <section>\n    <Child />\n  </section>\n);\n```\n\nIn the above example, referring to the `Parent` component implies a transitive reference to the `Child` component. When the bundler is creating a chunk, a reference to `Parent` necessitates bundling `Child` as well. (`Parent` internally refers to `Child`.) These transitive dependencies are a problem because it means that having a reference to the root component will transitively refer to the remainder of the application—something which Qwik tries to avoid explicitly.\n\nTo avoid the above problem we don't refer to components directly, instead, we refer to the lazy wrapper. This is created automatically by the `component$()` function.\n\n<CodeSandbox src=\"/src/routes/demo/component/lazy/index.tsx\" style={{ height: '4em' }} sandbox={false}>\n```tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport const Child = component$(() => {\n  return <p>child</p>;\n});\n\nexport const Parent = component$(() => {\n  return (\n    <section>\n      <Child />\n    </section>\n  );\n});\n\nexport default Parent;\n```\n</CodeSandbox>\n\nIn the above example the Optimizer transforms the above to:\n\n```tsx\nconst Child = componentQrl(qrl('./chunk-a', 'Child_onMount'));\nconst Parent = componentQrl(qrl('./chunk-b', 'Parent_onMount'));\nconst Parent_onMount = () => qrl('./chunk-c', 'Parent_onRender');\nconst Parent_onRender = () => (\n  <section>\n    <Child />\n  </section>\n);\n```\n\n> **NOTE**\n> For simplicity, not all of the transformations are shown; all resulting symbols are kept in the same file for succinctness.\n\nNotice that after the Optimizer transforms the code, the `Parent` no longer directly references `Child`. This is important because it allows the bundler (and tree shakers) to freely move the symbols into different chunks without pulling the rest of the application with it.\n\nSo what happens when the `Parent` component needs to render a `Child` component, but the `Child` component has not yet been downloaded? First, the `Parent` component renders its DOM like so.\n\n```html\n<main>\n  <section>\n    <!--qv--><!--/qv-->\n  </section>\n</main>\n```\n\nAs you can see in the above example, the `<!--qv-->` acts as a marker where the `Child` component will be inserted once it is lazy-loaded.\n\n## Inline Components\n\nIn addition to the standard `component$()` with all of it's lazy-loaded\nproperties, Qwik also supports lightweight (inline) components that act more\nlike components in traditional frameworks.\n\n<CodeSandbox src=\"/src/routes/demo/component/inline-child/index.tsx\" style={{height: '4em'}}>\n```tsx\nimport { component$ } from '@builder.io/qwik';\n\n// Inline component: declared using a standard function.\nexport const MyButton = (props: { text: string }) => {\n  return <button>{props.text}</button>;\n};\n\n// Component: declared using `component$()`.\nexport default component$(() => {\n  return (\n    <p>\n      Some text:\n      <MyButton text=\"Click me\" />\n    </p>\n  );\n});\n```\n</CodeSandbox>\n\nIn the above example, `MyButton` is an inline component.\nUnlike the standard `component$()`, inline components cannot be individually\nlazy-loaded; instead, they are bundled with their parent component. In this case:\n\n- `MyButton` will get bundled with the `default` component.\n- Whenever `default` is rendered, it will also guarantee that `MyButton` is\nrendered.\n\nYou can think of inline components as being inlined into the component where they are instantiated.\n\n### Limitations\nInline components come with some limitations that the standard `component$()`\ndoes not have. Inline components:\n- Cannot use `use*` methods such as `useSignal` or `useStore`.\n- Cannot project content with a `<Slot>`.\n\nAs the name implies, inline components are best used sparingly for\nlightweight pieces of markup since they offer the convenience of being\nbundled with the parent component.\n\n## Polymorphic components\n\nWhen you want to output a different type of element depending on props but default to a `<div>`, you can do it using something like this:\n\n```tsx\nconst Poly = component$(\n  <C extends string | FunctionComponent = 'div'>({\n    as,\n    ...props\n  }: { as?: C } & PropsOf<string extends C ? 'div' : C>) => {\n    const Cmp = as || 'div';\n    return (\n      <Cmp {...props}>\n        <Slot />\n      </Cmp>\n    );\n  }\n);\n\nexport const TestComponent = component$(() => {\n  // These all work with correct types\n  return (\n    <>\n      <Poly>Hello from a div</Poly>\n      <Poly as=\"a\" href=\"/blog\">\n        Blog\n      </Poly>\n      <Poly as=\"input\" onInput$={(ev, el) => console.log(el.value)} />\n      <Poly as={OtherComponent} someProp />\n    </>\n  );\n});\n```\n\nNote the `string extends C`, this is only true when TypeScript cannot infer the type from the `as` prop allowing you to specify the default type.\n\n## API Overview\n\n### State\n\n- [`useSignal(initialState)`](../state/index.mdx#usesignal) - creates a reactive value\n- [`useStore(initialStateObject)`](../state/index.mdx#usestore) - creates a reactive object that can be used to store state\n- [`createContextId(contextName)`](../context/index.mdx#createcontext) - creates a context reference\n- [`useContextProvider()`](../context/index.mdx#usecontextprovider) - provides a value to a given context\n- [`useContext()`](../context/index.mdx#usecontext) - reads the value of the current context\n\n### Styles\n\n- [`useStylesScoped$()`](../styles/index.mdx#usestylesscoped) - appends scoped styles to the component\n- [`useStyles$()`](../styles/index.mdx#usestyles) - appends unscoped styles to the component\n\n### Events\n\n- [`useOn()`](../events/index.mdx#useonwindowdocument-hook) - appends a listener to the current component programmatically\n- [`useOnWindow()`](../events/index.mdx#useonwindowdocument-hook) - appends a listener to the window object programmatically\n- [`useOnDocument()`](../events/index.mdx#useonwindowdocument-hook) - appends a listener to the document object programmatically\n\n### Tasks/Lifecycle\n\n- [`useTask$()`](../tasks/index.mdx#usetask) - defines a callback that will be called before render and/or when a watched store changes\n- [`useVisibleTask$()`](../tasks/index.mdx#usevisibletask) - defines a callback that will be called after rendering in the client only (browser)\n- [`useResource$()`](../state/index.mdx#useresource) - creates a resource to asynchronously load data\n\n### Other\n\n- [`$()`](../../advanced/qrl/index.mdx) - creates a QRL\n- [`noSerialize()`](/docs/core/state/#noserialize)\n- `useErrorBoundary()`\n- [`qwikVite()`](../../advanced/vite/index.mdx#qwikvite) - entry point for qwik with vite\n\n### Components\n\n- [`<Slot>`](../slots/index.mdx) - declares a content projection slot\n- `<SSRStreamBlock>` - declares a stream block\n- `<SSRStream>` - declares a stream\n- `<Fragment>` - declares a JSX fragment\n## See Also\n\n- [Inline components](../overview/index.mdx#inline-components)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/rendering/index.mdx",
    "content": "---\ntitle: Rendering | Components\ncontributors:\n  - the-r3aper7\n  - RATIU5\n  - manucorporat\n  - forresst\n  - adamdbradley\n  - zanettin\n  - cunzaizhuyi\n  - Pika-Pool\n  - Kesmek\n  - Craiqser\n  - AnthonyPAlicea\n  - mhevery\n  - igorbabko\n  - mrhoodz\n  - thejackshelton\n  - Balastrong\n  - aendel\n  - Jemsco\nupdated_at: '2023-09-19T17:37:26Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Rendering\n\nRendering is the process of updating the DOM based on changes in the state of the application and the component templates.\n\nQwik is unique because it knows how to render templates out-of-order asynchronously and in a fine-grained manner.\n\n\n## JSX\n\nJust like React, Qwik uses [JSX](https://facebook.github.io/jsx/) to express the component's template. Notice that JSX is only syntax, under the hood, React and Qwik are completely different. **JSX != VDOM**.\n\nQwik presents a few differences from other JSX frameworks:\n\n- Components are always declared with the `component$` function.\n- Components can use the `useSignal` hook to create reactive state.\n- Event handlers are declared with the `$` suffix.\n- For `<input>`, the `onChange` event is called `onInput$` in Qwik.\n- HTML attributes are preferred. `class` instead of `className`. `for` instead of `htmlFor`.\n\n```tsx /component$/#a /onClick$/#b /class/#c\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const MyComponent = component$((props) => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button\n        onClick$={() => {\n          count.value = count.value + props.step;\n        }}\n      >\n        Increment by {props.step}\n      </button>\n      <main\n        class={{\n          even: count.value % 2 === 0, // conditional class\n          odd: count.value % 2 === 1,\n        }}\n      >\n        <h1>Count: {count.value}</h1>\n      </main>\n    </>\n  );\n});\n```\n\n\n## Rendering Child Components\n\nQwik lazy loads components on an as-needed basis. To minimize the number of components to download, Qwik only descends into child components if the component's props have changed.\n\n```tsx {9} /Child/#a\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const Parent = component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <>\n      <button onClick$={() => (count.value += 1)}>Increment</button>\n      <Child name={'World_' + count.value} />\n    </>\n  );\n});\n\nexport const Child = component$((props: { name: string }) => {\n  return <p>Hello {props.name}</p>;\n});\n```\n\n> In the above example, the Parent component passes a changing `name` property to the Child component. The Child component will only re-render when the count signal changes.\n\n\n### Rendering a list of items\n\nIn many cases you'll want to render components by mapping an array in the render function with `items.map()`. It is required for every item of the list to have a unique `key` property passed to the first child of the mapping function. The `key` must be a string or number and must be unique within the list.\n\n```tsx {6} /data.map/ /key/#a\nimport { component$ } from '@builder.io/qwik';\n\nexport const Parent = component$(() => {\n  return (\n    <>\n      {data.map(({ message, uniqueKey }) => (\n        <div key={uniqueKey}>\n          <p>{message}</p>\n        </div>\n      ))}\n    </>\n  );\n});\n```\n\n> **Note:** it is not recommended to use the array's index as the key unless you can guarantee that the data for a given key will always be the same. It is always preferred to use some unique identifier from the data as the key.\n\n### Rendering Conditionally\n\nConditional rendering is done with the Javascipt [ternary operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) `?`, the `&&` operator, or just by using `if` statements.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const show = useSignal(false);\n  return (\n    <>\n      <button onClick$={() => show.value = !show.value}>Toggle</button>\n      {show.value ? <h1>Visible</h1> : <h1>Hidden</h1>}\n      {show.value && <div>Only show when it's visible</div>}\n    </>\n  );\n});\n```\n\n### `dangerouslySetInnerHTML`\n\nQwik offers an attribute on HTML Elements called `dangerouslySetInnerHTML` as a replacement for calling `innerHTML` on the DOM.\n\nDue to cross-site-scripting (XSS) possibilities when rendering untrustworthy content, you must use `dangerouslySetInnerHTML` as a reminder that this operation might be dangerous.\n\n```tsx\nconst htmlString = \"<strong>hello</strong>\";\n<div dangerouslySetInnerHTML={htmlString}></div>\n```\n\n### `bind` Attribute\n\nThe `bind` attribute is a convenient API for two-way data binding of an `<input>` value to a `Signal`.\n\nFor checkbox inputs, you can use `bind:checked`, which binds the `checked` boolean to the specified signal.\n\n```tsx /bind:value/ /bind:checked/ /firstName/#a /acceptConditions/#b\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const firstName = useSignal('');\n  const acceptConditions = useSignal(false);\n\n  return (\n    <form>\n      <input type=\"text\" bind:value={firstName} />\n      <input type=\"checkbox\" bind:checked={acceptConditions} />\n\n      <div>First name: {firstName.value}</div>\n    </form>\n  );\n})\n```\n\n> The API does not work with `useStore` since it does not return a signal. You can still use the manual approach, combining value and onInput$ as shown below.\n\nThe `bind:` is compiled away by the Qwik optimizer to a property set and an event handler, ie, it is just syntax sugar.\n\n```tsx /bind:value/ /bind:checked/ /firstName/#a /acceptConditions/#b\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  const firstName = useSignal('');\n  const acceptConditions = useSignal(false);\n\n  return (\n    <form>\n     {/* For number inputs, use `valueAsNumber` instead of `value` to get the numeric value directly */}\n      <input type=\"number\"\n        value={count.value}\n        onInput$={(_, el) => count.value = el.valueAsNumber }\n      />\n      <input type=\"text\"\n        value={firstName.value}\n        onInput$={(_, el) => firstName.value = el.value }\n      />\n      <input type=\"checkbox\"\n        checked={acceptConditions.value}\n        onChange$={(_, el) => acceptConditions.value = el.checked }\n      />\n      <div>First name: {firstName.value}</div>\n    </form>\n  );\n})\n```\n\n> This API ensures that the `value` of the input is always in sync with the value of the signal, no matter where the change comes from.\n\n\n## Async Rendering\n\nIt is important for the rendering pipeline to be able to lazy load child components. Since lazy loading is an asynchronous operation, rendering must also be asynchronous. In practice, this means that the `render()` function must return a promise.\n\nMost current-generation frameworks have a synchronous `render()` process. Synchronous rendering can't easily deal with asynchronous code loading, so synchronous rendering necessitates that all dependant components are eagerly present before rendering can commence.\n\n## Render Batching\n\nWhenever the state of the application changes, Qwik will schedule a render operation. The render operation will be scheduled to run after a macro-task (e.g. `setTimeout(0)`). This allows the application to batch multiple state changes into a single render operation.\n\nIn addition, because of the asynchronous nature of Qwik, all DOM writes are buffered and only flushed once all of the components have been downloaded and their JSX functions executed. The result is that the UI will update as an atomic operation, and the user will not see the intermediate steps, even if the application is slow to render.\n\nThe end goal is to enable performance and consistent rendering, even in the context of fast changing state and slow network.\n\n## Fine-grained Reactivity\n\nThanks to the fine-grained reactivity of Qwik, only the components that depend on the state will be updated. This is a big performance gain for two reasons:\n\n1. Less code to execute means application updates will render faster.\n2. Less code to execute means oftentimes the code does not have to be downloaded on application startup (or ever).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/slots/index.mdx",
    "content": "---\ntitle: Slots | Components\nkeywords: 'children, transclusion, content projection, parent'\ncontributors:\n  - RATIU5\n  - manucorporat\n  - forresst\n  - adamdbradley\n  - cunzaizhuyi\n  - zanettin\n  - lbensaad\n  - gabrielgrant\n  - mhevery\n  - jakovljevic-mladen\n  - mrhoodz\n  - Jemsco\nupdated_at: '2023-10-09T12:58:31Z'\ncreated_at: '2023-04-02T20:45:37Z'\n---\nimport CodeSandbox from '../../../../../components/code-sandbox/index.tsx';\n\n# Slots\n\nSlots allow a component to treat the JSX children of the component as a form of input and project these children into the component's DOM tree.\n\nThis concept has different names in different frameworks:\n\n- In Angular is called Content Projection\n- In React, it's the `children` of the props\n- In Web components it's [`<slot>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) as well\n\nThe main API to achieve this is the `<Slot>` component, exported in `@builder.io/qwik`:\n<CodeSandbox src=\"/src/routes/demo/slot/basic/index.tsx\" style={{ height: '6em' }}>\n```tsx {6} /Slot/\nimport { Slot, component$ } from '@builder.io/qwik';\n\nconst Button = component$(() => {\n  return (\n    <button>\n      Content: <Slot />\n    </button>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Button>\n      This goes inside {'<Button>'} component marked by{`<Slot>`}\n    </Button>\n  );\n});\n```\n</CodeSandbox>\n\nThe `<Slot>` component is a placeholder for the children of the component. The `<Slot>` component will be replaced by the children of the component during rendering.\n\n> **Note**: Slots in Qwik are declarative, allowing Qwik to render parents and children in isolation. Because slots are declarative, the children can NOT be read, or transformed by the components.\n>\n> Slots in Qwik act like designated placeholders for content, allowing components to stay independent and avoid unnecessary re-renders. This setup keeps things flexible and easy to manage, unlike the direct children approach where parent changes can lead to frequent and complex child updates. Slots help maintain a smooth and efficient component structure.\n>\n> In unique situations where some work needs to be done based on children, and the drawbacks of parents and children being lazy loaded together are understood, then an inline component is another choice.\n\n### Named Slots\n\nThe `Slot` component can be used multiple times in the same component, as long as it has a different `name` property:\n\n<CodeSandbox src=\"/src/routes/demo/slot/named/index.tsx\" style={{ height: '10em' }}>\n```tsx {9} /start/#a /title/#c /footer/#a /end/#c /q:slot/ /Slot/\nimport { Slot, component$, useStylesScoped$ } from '@builder.io/qwik';\nimport CSS from './index.css?inline';\n\nconst Tab = component$(() => {\n  useStylesScoped$(CSS);\n  return (\n    <section>\n      <h2>\n        <Slot name=\"title\" />\n      </h2>\n      <div>\n        <Slot /> {/* default slot */}\n        <div>\n          <Slot name=\"footer\" />\n        </div>\n      </div>\n    </section>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Tab>\n      <div q:slot=\"title\">Qwik</div>\n      <div>A resumable framework for building instant web applications</div>\n      <span q:slot=\"footer\">made with ❤️ by </span>\n      <a q:slot=\"footer\" href=\"https://builder.io\">\n        builder.io\n      </a>\n    </Tab>\n  );\n});\n```\n</CodeSandbox>\n\nNow, when consuming the `<Tab>` component, we can pass children and specify in which slot they should be placed, using the `q:slot` attribute:\n\nNotice that:\n\n- If `q:slot` is not specified or it's an empty string, the content will be projected into the default `<Slot>`, i.e. the `<Slot>` without a `name` property.\n- Multiple `q:slot=\"footer\"` attributes coalesce items together in the content projection.\n\n### Unprojected Content\n\nQwik keeps all content around, even if not projected. This is because the content could be projected in the future. When projected content does not match any `<Slot>` component, the content is moved into an inert `<q:template>` element.\n\n\n<CodeSandbox src=\"/src/routes/demo/slot/unprojected/index.tsx\" style={{ height: '7em' }}>\n```tsx\nimport { Slot, component$, useSignal } from '@builder.io/qwik';\n\nconst Accordion = component$(() => {\n  const isOpen = useSignal(false);\n  return (\n    <div>\n      <h1 onClick$={() => (isOpen.value = !isOpen.value)}>\n        {isOpen.value ? '▼' : '▶︎'}\n      </h1>\n      {isOpen.value && <Slot />}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Accordion>\n      I am pre-rendered on the Server and hidden until needed.\n    </Accordion>\n  );\n});\n```\n</CodeSandbox>\n\nResults in:\n\n```html\n<div>\n  <h1>▶︎</h1>\n</div>\n<q:template q:slot hidden aria-hidden=\"true\">\n  I am pre-rendered on the Server and hidden until needed.\n</q:template>\n```\n\nNotice that the un-projected content is moved into an inert `<q:template>`. This is done in case the `Accordion` component re-renders in the `<Slot>`. In this case, we avoid having to re-render the parent component just to generate the projected content. By persisting the un-projected content when the parent is initially rendered, the rendering of the two components can stay independent.\n\n### Invalid Projection\n\nThe `q:slot` attribute must be a direct child of a component.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport const Project = component$(() => { ... })\n\nexport const MyApp = component$(() => {\n  return (\n    <Project>\n      <span q:slot=\"title\">ok, direct child of Project</span>\n      <div>\n        <span q:slot=\"title\">Error, not a direct child of Project</span>\n      </div>\n    </Project>\n  );\n});\n```\n\n\n## Advanced Example\n\nAn example of a collapsible component that conditionally projects editable content.\n\n<CodeSandbox src=\"/src/routes/demo/slot/advanced/index.tsx\" style={{ height: '15em' }}>\n```tsx\nimport { Slot, component$, useSignal } from '@builder.io/qwik';\n\nexport const Collapsible = component$(() => {\n  const isOpen = useSignal(true);\n\n  return (\n    <div>\n      <h1 onClick$={() => (isOpen.value = !isOpen.value)}>\n        {isOpen.value ? '▼' : '▶︎'}\n        <Slot name=\"title\" />\n      </h1>\n      {isOpen.value && <Slot />}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  const title = useSignal('Qwik');\n  const description = useSignal(\n    'A resumable framework for building instant web applications'\n  );\n  return (\n    <>\n      <label>Title</label>\n      <input bind:value={title} type=\"text\" />\n      <label>Description</label>\n      <textarea bind:value={description} cols={50} />\n      <hr />\n      <Collapsible>\n        <span q:slot=\"title\">{title}</span>\n        {description}\n      </Collapsible>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\nThe `Collapsible` component will always display the title, but the body of the text will only display if `store.isOpen` is `true`.\n\nAdditionally, the `title` and `description` of the projected content are editable.\n\n- The parent component needs to be able to change content without forcing the `Collapsible` component to re-render.\n- The child component needs to change what is projected without having the parent component re-render. In our case, `Collapsible` should be able to show/hide the default `q:slot` without downloading and re-rendering the parent component.\n\nIn order for the two components to have an independent lifecycle, the projection needs to be declarative. In this way, either the parent or child can change what is projected or how it is projected without forcing the re-rendering of the other.\n\n\n### Projection vs `children`\n\nAll frameworks need a way for a component to wrap its complex content conditionally. This problem is solved in many different ways, but there are two predominant approaches:\n\n- **projection**: Projection is a declarative way of describing how the content gets from the parent template to where it needs to be projected.\n- **`children`**: `children` refers to vDOM approaches that treat content just like another input.\n\nThe two approaches can best be described as declarative vs imperative. They both come with their set of advantages and disadvantages.\n\nQwik uses the declarative projection approach because it needs to be able to render parent and child components independently from each other. In an imperative  approach, there are countless ways a child component can modify the `children`. If a child component relied on its `children`, it would be forced to re-render every time the parent component re-rendered to reapply the changes. This additional rendering contradicts Qwik's goal of having components render in isolation.\n\n> **Note**: Make sure to use `<Slot />` within a `component$()` function to ensure it works correctly. `<Slot />` cannot operate in [inline components](/docs/core/overview/#inline-components) which are similar to normal functions `export const MyInlineComp = () => `.\n\n### Advanced: Slots and Context\n\nSlotted components have access to the [Context](../context/) of their parent component, even while they aren't being projected. Furthermore, if the parent is projecting the `<Slot />` inside another component, the slotted components will also have access to the Contexts of that deeper component.\n\nHowever, if a component hasn't been projected yet because the `<Slot />` are rendered conditionally, it's impossible to know about the deeper Context, and then the slotted component will only see the Context of the immediate parent.\n\nAs such, it's safest to avoid these situations; if you are providing Contexts, don't conditionally render your `<Slot />`.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/state/index.mdx",
    "content": "---\ntitle: State | Components\nkeywords: 'useState, state management, reactivity, reactive'\ncontributors:\n  - nnelgxorz\n  - the-r3aper7\n  - voluntadpear\n  - kawamataryo\n  - JaymanW\n  - RATIU5\n  - manucorporat\n  - literalpie\n  - fum4\n  - cunzaizhuyi\n  - zanettin\n  - ChristianAnagnostou\n  - shairez\n  - forresst\n  - almilo\n  - Craiqser\n  - XiaoChengyin\n  - gkatsanos\n  - adamdbradley\n  - mhevery\n  - wtlin1228\n  - AnthonyPAlicea\n  - sreeisalso\n  - wmertens\n  - nicvazquez\n  - mrhoodz\n  - eecopa\n  - fabian-hiller\n  - julianobrasil\n  - aivarsliepa\n  - Balastrong\n  - Jemsco\n  - shairez\n  - ianlet\nupdated_at: '2023-10-04T21:48:45Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\nimport CodeSandbox from '../../../../../components/code-sandbox/index.tsx';\n\n# State\n\nState management is an important part of any app. In Qwik, there are two types of state, reactive and static:\n\n1. Static state is anything that can be serialized: a string, number, object, array... anything.\n2. A reactive state on the other hand is created with `useSignal()` or `useStore()`.\n\nIt is important to notice that state in Qwik is not necessarily a local component state, but rather an app state that can be instantiated by any component.\n\n## `useSignal()`\n\nUse `useSignal()` to create a reactive signal (a form of state). The `useSignal()` takes an initial value and returns a reactive signal.\n\nThe reactive signal returned by `useSignal()` consists of an object with a single property `.value`. If you change the `value` property of the signal, any component that depends on it will be updated automatically.\n\n<CodeSandbox src=\"/src/routes/demo/state/counter-signal/index.tsx\" style={{ height: '6em' }}>\n```tsx {4} /count/\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <button onClick$={() => count.value++}>\n      Increment {count.value}\n    </button>\n  );\n});\n```\n</CodeSandbox>\n\nThis example above shows how `useSignal()` can be used in a counter component to keep track of the count. Modifying the `count.value` property will cause the component to be updated automatically. For instance, when the property is changed in the button click handler as in the example above.\n\n> **NOTE** If you just need to read the signal's value, don't pass the entire signal as a prop, instead pass only its value:\n\n⛔ **Avoid:**\n\n```tsx\nconst isClosedSig = useSignal(false);\n\nreturn <Child isClosed={isClosedSig} />;\n```\n\n✅ **Instead do:**\n\n```tsx\nconst isClosedSig = useSignal(false);\n\nreturn <Child isClosed={isClosedSig.value} />;\n```\n\n\n## `useStore()`\n\nWorks very similarly to `useSignal()`, but it takes an object as its initial value and the reactivity extends to nested objects and arrays by default. One can think of a store as a multiple-value signal or an object made of several signals.\n\nUse `useStore(initialStateObject)` hook to create a reactive object. It takes an initial object (or a factory function) and returns a reactive object.\n\n<CodeSandbox src=\"/src/routes/demo/state/counter-store/index.tsx\" style={{ height: '6em' }} >\n```tsx {4} /state/ /count/#a\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const state = useStore({ count: 0, name: 'Qwik' });\n\n  return (\n    <>\n      <button onClick$={() => state.count++}>Increment</button>\n      <p>Count: {state.count}</p>\n      <input\n        value={state.name}\n        onInput$={(_, el) => (state.name = el.value)}\n      />\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n> **NOTE** For reactivity to work as expected, make sure to keep a reference to the reactive object and not only to its properties. e.g. doing `let { count } = useStore({ count: 0 })` and then mutating `count` won't trigger updates of components that depend on the property.\n\nBecause [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) tracks deep reactivity, that means that Arrays and Objects inside the store will also be reactive.\n\n<CodeSandbox src=\"/src/routes/demo/state/counter-store-deep/index.tsx\" style={{ height: '10em' }}>\n```tsx\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({\n    nested: {\n      fields: { are: 'also tracked' },\n    },\n    list: ['Item 1'],\n  });\n\n  return (\n    <>\n      <p>{store.nested.fields.are}</p>\n      <button\n        onClick$={() => {\n          // Even though we are mutating a nested object, this will trigger a re-render\n          store.nested.fields.are = 'tracked';\n        }}\n      >\n        Clicking me works because store is deep watched\n      </button>\n      <br />\n      <button\n        onClick$={() => {\n          // Because store is deep watched, this will trigger a re-render\n          store.list.push(`Item ${store.list.length + 1}`);\n        }}\n      >\n        Add to list\n      </button>\n      <ul>\n        {store.list.map((item, key) => (\n          <li key={key}>{item}</li>\n        ))}\n      </ul>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\nNotice that for `useStore()` to track all nested properties, it needs to allocate a lot of Proxy objects. This can be a performance issue if you have a lot of nested properties. In that case, you can use the `deep: false` option to only track the top-level properties.\n\n```tsx\nconst shallowStore = useStore(\n  {\n    nested: {\n      fields: { are: 'also tracked' }\n    },\n    list: ['Item 1'],\n  },\n  { deep: false }\n);\n```\n> **Handling Dynamic Object Mutations**\n>\n> When dynamically manipulating object properties, such as deleting them while they are being rendered somewhere in the app, you may encounter issues.  This could happen if the component renders values dependent on an object's property that is currently being removed.  To prevent this situation, use optional chaining when accessing properties.  For example, if attempting to remove a property:\n> ```tsx\n> delete store.propertyName;\n> ```\n> Be sure to access this property cautiously in the component by using optional chaining ( ?. ):\n> ```tsx\n> const propertyValue = store.propertyName?.value;\n> ```\n### Methods\n\nTo provide methods on the store, you must make them into QRLs and refer to the store with `this`, like so:\n\n```tsx\nimport { component$, useStore, $, type QRL } from \"@builder.io/qwik\";\n\ntype CountStore = { count: number; increment: QRL<(this: CountStore) => void> };\n\nexport default component$(() => {\n  const state = useStore<CountStore>({\n    count: 0,\n    increment: $(function (this: CountStore) {\n      this.count++;\n    }),\n  });\n\n  return (\n    <>\n      <button onClick$={() => state.increment()}>Increment</button>\n      <p>Count: {state.count}</p>\n    </>\n  );\n});\n```\n\n> Do you know why you should use a regular `function(){}` instead of an arrow function in `useStore()`? This is because [arrow functions don't have their own bindings to `this`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) in JavaScript. This means that if you try to access `this` using an arrow function, `this.count` could point to another object's `count` 😱.\n\n## Computed state\n\nIn Qwik, there are two ways to create computed values, each with a different use case (in order of preference):\n\n1. `useComputed$()`: `useComputed$()` is the preferred way of creating computed values. Use it when the computed value can be derived synchronously purely from the source state (current application state). For example, creating a lowercase version of a string or combining first and last names into a full name.\n\n2. [`useResource$()`](/docs/(qwik)/core/state/index.mdx#useresource): `useResource$()` is used when the computed value is asynchronous or the state comes from outside of the application. For example, fetching the current weather (external state) based on a current location (application internal state).\n\n\nIn addition to the two ways of creating computed values described above, there is also a lower-level ([`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask)). This way does not produce a new signal, but rather modifies the existing state or produces a side effect.\n\n### `useComputed$()`\n\nUse `useComputed$` to memoize a value derived synchronously from other state.\n\nIt is similar to `memo` in other frameworks, since it will only recompute the value when one of the input signals changes.\n\n<CodeSandbox src=\"/src/routes/demo/state/computed/index.tsx\" style={{ height: '8em' }}>\n```tsx {5} /useComputed$/\nimport { component$, useComputed$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const name = useSignal('Qwik');\n  const capitalizedName = useComputed$(() => {\n    // it will automatically reexecute when name.value changes\n    return name.value.toUpperCase();\n  });\n\n  return (\n    <>\n      <input type=\"text\" bind:value={name} />\n      <p>Name: {name.value}</p>\n      <p>Capitalized name: {capitalizedName.value}</p>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n> **NOTE** Because `useComputed$()` is synchronous it is not necessary to explicitly track the input signals.\n\n### `useResource$()`\n\nUse `useResource$()` to create a computed value that is derived asynchronously. It's the asynchronous version of `useComputed$()`, which includes the `state` of the resource (loading, resolved, rejected) on top of the value.\n\nA common use of `useResource$()` is to fetch data from an external API within the component, which can occur either on the server or the client.\n\nThe `useResource$` hook is meant to be used with `<Resource />`. The `<Resource />` component is a convenient way to render different UI based on the state of the resource.\n\n<CodeSandbox src=\"/src/routes/demo/state/resource/index.tsx\" style={{ height: '8em' }}>\n```tsx {11} /useResource$/\nimport {\n  component$,\n  Resource,\n  useResource$,\n  useSignal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const postId = useSignal('23');\n\n  const postTitle = useResource$<string>(async ({ track }) => {\n    // it will run first on mount (server), then re-run whenever postId changes (client)\n    // this means this code will run on the server and the browser\n    track(() => postId.value);\n\n    const response = await fetch(\n      `https://jsonplaceholder.typicode.com/posts/${postId.value}`\n    );\n    const data = await response.json();\n    return data.title as string;\n  });\n\n  return (\n    <>\n      <input type=\"number\" bind:value={postId} max={100} min={0} />\n      <h1>Post#{postId}:</h1>\n      <Resource\n        value={postTitle}\n        onPending={() => <p>Loading...</p>}\n        onResolved={(title) => <h2>{title}</h2>}\n      />\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n\n\n> **Note:** The important thing to understand about `useResource$` is that it executes on the initial component render (just like `useTask$`). Often times it is desirable to start fetching the data on the server as part of the initial HTTP request before the component is rendered. Fetching data as part of Server-Side Rendering (SSR) is a common and preferred method of data loading, typically handled by the [`routeLoader$`](/docs/(qwikcity)/route-loader/index.mdx) API. `useResource$` is more of a low-level API that is useful when you want to fetch data in the browser.\n>\n>\n> In many ways `useResource$` is similar to `useTask$`. The big differences are:\n>\n> - `useResource$` allows you to return a \"value\".\n> - `useResource$` does not block rendering while the resource is being resolved.\n>\n> See [`routeLoader$`](/docs/(qwikcity)/route-loader/index.mdx) for fetching data early as part of initial HTTP request.\n\n> **NOTE**: During SSR the `<Resource>` component will pause rendering until the resource is resolved. This way the SSR will not render with the loading indicator.\n\n#### Advanced example\n\nA more complete example of fetching data with `AbortController`, `track` and `cleanup`. This example will fetch a list of jokes based on the query typed by the user,\nautomatically reacting to changes in the query, including aborting requests that are currently pending.\n\n<CodeSandbox src=\"/src/routes/demo/state/resource-joke/index.tsx\" style={{ height: '40em' }}>\n```tsx {11} /useResource$/\nimport {\n  component$,\n  useResource$,\n  Resource,\n  useSignal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const query = useSignal('busy');\n  const jokes = useResource$<{ value: string }[]>(\n    async ({ track, cleanup }) => {\n      track(() => query.value);\n      // A good practice is to use `AbortController` to abort the fetching of data if\n      // new request comes in. We create a new `AbortController` and register a `cleanup`\n      // function which is called when this function re-runs.\n      const controller = new AbortController();\n      cleanup(() => controller.abort());\n\n      if (query.value.length < 3) {\n        return [];\n      }\n\n      const url = new URL('https://api.chucknorris.io/jokes/search');\n      url.searchParams.set('query', query.value);\n\n      const resp = await fetch(url, { signal: controller.signal });\n      const json = (await resp.json()) as { result: { value: string }[] };\n\n      return json.result;\n    }\n  );\n\n  return (\n    <>\n      <label>\n        Query: <input bind:value={query} />\n      </label>\n      <button>search</button>\n      <Resource\n        value={jokes}\n        onPending={() => <>loading...</>}\n        onResolved={(jokes) => (\n          <ul>\n            {jokes.map((joke, i) => (\n              <li key={i}>{joke.value}</li>\n            ))}\n          </ul>\n        )}\n      />\n    </>\n  );\n});\n```\n</CodeSandbox>\n\nAs we see in the example above, `useResource$()` returns a `ResourceReturn<T>` object that works like a reactive promise, containing the data and the resource state.\n\nThe state `resource.loading` can be one of the following:\n\n- `false` - the data is not yet available.\n- `true` - the data is available. (Either resolved or rejected.)\n\nThe callback passed to [`useResource$()`](/docs/(qwik)/core/state/index.mdx#useresource) runs right after the [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) callbacks complete. Please refer to the [Lifecycle](../tasks/index.mdx#lifecycle) section for more details.\n\n#### `<Resource />`\n\n`<Resource />` is a component meant to be used with the `useResource$()` that renders different content depending on if the resource is pending, resolved, or rejected.\n\n```tsx\n<Resource\n  value={weatherResource}\n  onPending={() => <div>Loading...</div>}\n  onRejected={() => <div>Failed to load weather</div>}\n  onResolved={(weather) => {\n    return <div>Temperature: {weather.temp}</div>;\n  }}\n/>\n```\n\nIt is worth noting that `<Resource />` is not required when using `useResource$()`. It is just a convenient way to render the resource state.\n\n\nThis example shows how `useResource$` is used to perform a fetch call to the [agify.io](https://agify.io/) API. This will guess a person's age based on the name typed by the user, and will update whenever the user types in the name input.\n\n<CodeSandbox src=\"/src/routes/demo/state/resource-agify/index.tsx\" style={{ height: '8em' }}>\n```tsx {11} /useResource$/\nimport {\n  component$,\n  useSignal,\n  useResource$,\n  Resource,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const name = useSignal<string>();\n\n  const ageResource = useResource$<{\n    name: string;\n    age: number;\n    count: number;\n  }>(async ({ track, cleanup }) => {\n    track(() => name.value);\n    const abortController = new AbortController();\n    cleanup(() => abortController.abort('cleanup'));\n    const res = await fetch(`https://api.agify.io?name=${name.value}`, {\n      signal: abortController.signal,\n    });\n    return res.json();\n  });\n\n  return (\n    <section>\n      <div>\n        <label>\n          Enter your name, and I'll guess your age!\n          <input onInput$={(ev, el) => (name.value = el.value)} />\n        </label>\n      </div>\n      <Resource\n        value={ageResource}\n        onPending={() => <p>Loading...</p>}\n        onRejected={() => <p>Failed to person data</p>}\n        onResolved={(ageGuess) => {\n          return (\n            <p>\n              {name.value && (\n                <>\n                  {ageGuess.name} {ageGuess.age} years\n                </>\n              )}\n            </p>\n          );\n        }}\n      />\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n## Passing state\n\nOne of the nice features of Qwik is that the state can be passed to other components. Writing to the store will then only re-render the components which read from the store only.\n\nThere are two ways to pass state to other components:\n\n1. pass state to child component explicitly using props,\n2. or pass state implicitly through context.\n\n### Using props\n\nThe simplest way to pass the state to other components is to pass it through props.\n\n<CodeSandbox src=\"/src/routes/demo/state/passing-props/index.tsx\" style={{ height: '6em' }}>\n```tsx {9} /userData=/\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const userData = useStore({ count: 0 });\n  return <Child userData={userData} />;\n});\n\ninterface ChildProps {\n  userData: { count: number };\n}\nexport const Child = component$<ChildProps>(({ userData }) => {\n  return (\n    <>\n      <button onClick$={() => userData.count++}>Increment</button>\n      <p>Count: {userData.count}</p>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n### Using context\n\nThe context API is a way to pass state to components without having to pass it through props (i.e.: avoids prop drilling issues). Automatically, all the descendant components in the tree can access a reference to the state with read/write access to it.\n\nCheck the [context API](../context/index.mdx) for more information.\n\n<CodeSandbox src=\"/src/routes/demo/state/passing-context/index.tsx\" style={{ height: '6em' }}>\n```tsx /userData/ /export const CTX = createContextId<{ count: number }>('stuff');/ /useContextProvider(CTX, userData);/ /const userData = useContext(CTX);/\nimport {\n  component$,\n  createContextId,\n  useContext,\n  useContextProvider,\n  useStore,\n} from '@builder.io/qwik';\n\n// Declare a context ID\nexport const CTX = createContextId<{ count: number }>('stuff');\n\nexport default component$(() => {\n  const userData = useStore({ count: 0 });\n\n  // Provide the store to the context under the context ID\n  useContextProvider(CTX, userData);\n\n  return <Child />;\n});\n\nexport const Child = component$(() => {\n  const userData = useContext(CTX);\n  return (\n    <>\n      <button onClick$={() => userData.count++}>Increment</button>\n      <p>Count: {userData.count}</p>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n## `noSerialize()`\n\nQwik ensures that all application state is always serializable. This is important to ensure that Qwik applications have a [resumability](/docs/(qwik)/concepts/resumable/index.mdx) property.\n\nSometimes, it's necessary to store data that can't be serialized; `noSerialize()` instructs Qwik not to attempt serializing the marked value.\nFor example, a reference to a third-party library such as [Monaco editor](https://microsoft.github.io/monaco-editor/) will always need `noSerialize()`, as it is not serializable.\n\nIf a value is marked as non-serializable, then that value will not survive serialization events, such as resuming the application on the client from SSR. In this situation, the value will be set to `undefined` and it is up to the developer to re-initialize the value on the client.\n\n<CodeSandbox src=\"/src/routes/demo/state/no-serialize/index.tsx\" style={{ height: '8em' }}>\n```tsx /noSerialize/\nimport {\n  component$,\n  useStore,\n  useSignal,\n  noSerialize,\n  useVisibleTask$,\n  type NoSerialize,\n} from '@builder.io/qwik';\nimport type Monaco from './monaco';\nimport { monacoEditor } from './monaco';\n\nexport default component$(() => {\n  const editorRef = useSignal<HTMLElement>();\n  const store = useStore<{ monacoInstance: NoSerialize<Monaco> }>({\n    monacoInstance: undefined,\n  });\n\n  useVisibleTask$(() => {\n    const editor = monacoEditor.create(editorRef.value!, {\n      value: 'Hello, world!',\n    });\n    // Monaco is not serializable, so we can't serialize it as part of SSR\n    // We can however instantiate it on the client after the component is visible\n    store.monacoInstance = noSerialize(editor);\n  });\n  return <div ref={editorRef}>loading...</div>;\n});\n```\n</CodeSandbox>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/styles/index.mdx",
    "content": "---\ntitle: Styles | Components\ncontributors:\n  - manucorporat\n  - zanettin\n  - cunzaizhuyi\n  - manuelsanchez2\n  - literalpie\n  - forresst\n  - DustinJSilk\n  - saikatdas0790\n  - LiKang6688\n  - Craiqser\n  - adamdbradley\n  - the-r3aper7\n  - mhevery\n  - igorbabko\n  - mrhoodz\n  - tanftw\nupdated_at: '2023-09-19T17:37:26Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Styles\n\nQwik does not enforce a specific styling approach, you can style your Qwik app using any method you prefer, such as CSS, CSS-in-JS, CSS modules...\n\n## CSS Modules\n\nQwik supports [CSS Modules](https://github.com/css-modules/css-modules) out of the box thanks to [Vite](https://vitejs.dev/guide/features.html#css-modules).\n\nTo use CSS modules, simply create a `.module.css` file. For example, `MyComponent.module.css` and import it in your component.\n\n```css /container/#a title=\"src/components/MyComponent/MyComponent.module.css\"\n.container {\n  background-color: red;\n}\n```\n\nThen, import the CSS module in your component.\n\n```tsx {2} /styles/ /container/#a title=\"src/components/MyComponent/MyComponent.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport styles from './MyComponent.module.css';\n\nexport default component$(() => {\n  return <div class={styles.container}>Hello world</div>;\n});\n```\n\nRemember that Qwik uses `class` instead of `className` for CSS classes.\n\nQwik also accepts arrays, objects, or a combination of them to assign multiple classes:\n```tsx title=\"src/components/MyComponent/MyComponent.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport styles from './MyComponent.module.css';\n\nexport default component$((props) => {\n  // Array syntax example\n  return <div class={[\n    styles.container, \n    'p-8', \n    props.isHighAttention ? 'text-green-500' : 'text-slate-500',\n    { active: true}\n  ]}>Hello world</div>;\n\n  // Object syntax example\n  return <div class={{  \n    'text-green-500': props.isHighAttention,\n    'p-4': true\n  }}>Hello world</div>;\n});\n```\n\n## Global Styles\n\nMany apps use a global stylesheet for browser resets and defining global styles. This is a good practice, but it is not recommended to use it for styling your components. Qwik is optimized to let the browser download the styles that are needed for the current view. If you use a global stylesheet, all of the styles will be downloaded on the first load, even if they are not needed for the current view.\n\n```tsx\nimport './global.css';\n```\n\n> Automatically, Qwik will try to inline this file in production mode if the amount of CSS is less than 10KB. If the file is larger than 10KB, it will be loaded as a separate file.\n\n## CSS-in-JS\n\nQwik has first-class CSS-in-JS support using [styled-vanilla-extract](https://github.com/wmertens/styled-vanilla-extract), which provides an extremely efficient css-in-js solution without any runtime!\n\n```tsx title=\"style.css.ts\"\nimport { style } from 'styled-vanilla-extract/qwik';\n\nexport const blueClass = style({\n  display: 'block',\n  width: '100%',\n  height: '500px',\n  background: 'blue',\n});\n```\n\n```tsx title=\"component.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { blueClass } from './styles.css';\n\nexport const Cmp = component$(() => {\n  return <div class={blueClass} />;\n});\n```\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add styled-vanilla-extract\n```\n</span>\n</PackageManagerTabs>\n\nPlease refer to the [docs of our official integration](/docs/integrations/styled-vanilla-extract/index.mdx) for more information.\n\n> **How about emotion or other CSS-in-JS libs?** While extremely popular, emotion and other CSS-in-JS libs are not the best choice for Qwik. [They are not optimized for runtime performance and they don't have a good SSR streaming support](https://dev.to/srmagura/why-were-breaking-up-wiht-css-in-js-4g9b), leading to a degraded server and client performance.\n\n## Styled-components\n\nThe styled-components library is a popular tool in React-land for writing CSS-in-JS. Thanks to the same [styled-vanilla-extract](https://github.com/wmertens/styled-vanilla-extract) plugin, you can write your styles with styled-components syntax in Qwik with zero-runtime cost!\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add styled-vanilla-extract\n```\n</span>\n</PackageManagerTabs>\n\nLike this:\n\n```tsx title=\"styles.css.ts\"\nimport { styled } from 'styled-vanilla-extract/qwik';\n\nexport const BlueBox = styled.div`\n  display: block;\n  width: 100%;\n  height: 500px;\n  background: blue;\n`;\n```\n\n```tsx title=\"component.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { BlueBox } from './styles.css';\n\nexport const Cmp = component$(() => {\n  return <BlueBox />;\n});\n```\n\n## Scoped CSS\n\nTo use scoped CSS, you can use the `useStylesScoped$()` hook exported from `@builder.io/qwik`.\n> `useStylesScoped$()` uses emojis to set a unique name on the selector. This is added by Qwik to avoid CSS name / selector clashes, and to ensure that the styles are correctly scoped as expected..\n\n\n\n\n\n```tsx {4-8} title=\"src/components/MyComponent/MyComponent.tsx\"\nimport { component$, useStylesScoped$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  useStylesScoped$(`\n    .container {\n      background-color: red;\n    }\n  `);\n  return <div class=\"container\">Hello world</div>;\n});\n```\n\nYou can also import an external CSS file. For that you need to add the `?inline` query parameter to the import of the CSS file, and pass the default export of the CSS file to the `useStyleScoped$()` hook.\n\n```css title=\"src/components/MyComponent/MyComponent.css\"\n.container {\n  background-color: red;\n}\n```\n\n```tsx {3,6} title=\"src/components/MyComponent/MyComponent.tsx\"\nimport { component$, useStylesScoped$ } from '@builder.io/qwik';\n\nimport styles from './MyComponent.css?inline';\n\nexport default component$(() => {\n  useStylesScoped$(styles);\n  return <div class=\"container\">Hello world</div>;\n});\n```\n\n\n### `:global()` selector\n\nUsing `useStylesScoped$` will scope all child selectors in a ruleset to the component. If you need to style child components rendered through a `<Slot />`, you will need to break out of the scoped styles using the `:global()` selector.\n\n```tsx\nimport { useStylesScoped$, component$ } from '@builder.io/qwik';\n\nexport const List = component$(() => {\n  useStylesScoped$(`\n    .list {\n      display: flex;\n\n      > :global(*nth-child(3)) {\n        width: 100%\n      }\n    }\n  `);\n\n  return (\n    <div class=\"list\">\n      <Slot />\n    </div>;\n  );\n});\n```\n\nThis will render a css selector of `.list.⭐️8vzca0-0 > *:nth-child(3)`, allowing you to target child components. This could be considered the equivalent of using `::ng-deep` in Angular.\n\n> Beware that this may have unintended effects that cascade down your component tree.\n\n\n## `useStyles$()`\n\nA lazy-loadable reference to component's styles.\n\nComponent styles allow Qwik to lazy load the style information for the component only when needed, which avoids double loading during SSR hydration.\n\n```tsx\nimport { useStyles$, component$ } from '@builder.io/qwik';\nimport styles from './code-block.css?inline';\n\nexport const CmpStyles = component$(() => {\n  useStyles$(styles);\n  return <span class=\"my-text\">Some text</span>;\n});\n```\n\n```css\n// code-block.css\n.my-text {\n  color: red;\n}\n```\n\n> Notice that in order to import CSS as a string in Vite, you need to add the `?inline` query parameter to the import, like this: `import styles from './code-block.css?inline';`\n\n`useStyles$` uses lazy loading strings that won't dynamically update. If you'd like to evaluate some JS, use a `style` tag instead\n\n```tsx\nexport const CmpStyles = component$(() => {\n  const primaryColor = \"red\";\n\n  // ❌ Does not work\n  useStyles$(`\n    .my-text {\n      --primary-color: ${primaryColor};\n    }\n  `);\n\n  // ✅ Adding in the style attribute works\n  return (\n    <span \n      style={{ \"--primary-color\": primaryColor }} \n      class=\"my-text\"\n    >\n      Some text\n    </span>\n  );\n});\n```\n\n\n## CSS Preprocessors\n\nThanks to [Vite](https://vitejs.dev/guide/features.html#css-pre-processors), Qwik supports CSS preprocessors like Sass, Less, Stylus, and PostCSS.\n\nThere is no need to install Qwik-specific plugins for them, but the corresponding pre-processor itself must be installed:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\n# .scss and .sass\npnpm add -D sass\n\n# .less\npnpm add -D less\n\n# .styl and .stylus\npnpm add -D stylus\n```\n</span>\n<span q:slot=\"npm\">\n```shell\n# .scss and .sass\nnpm add -D sass\n\n# .less\nnpm add -D less\n\n# .styl and .stylus\nnpm add -D stylus\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\n# .scss and .sass\nyarn add -D sass\n\n# .less\nyarn add -D less\n\n# .styl and .stylus\nyarn add -D stylus\n```\n</span>\n<span q:slot=\"bun\">\n```shell\n# .scss and .sass\nbun add -D sass\n\n# .less\nbun add -D less\n\n# .styl and .stylus\nbun add -D stylus\n```\n</span>\n</PackageManagerTabs>\n\nCheck [Vite's docs](https://vitejs.dev/guide/features.html#css-pre-processors) for more information.\n\n## Tailwind\n\nTo use Tailwind in your app, you can add it to your app with our built-in integration:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add tailwind\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add tailwind\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add tailwind\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add tailwind\n```\n</span>\n</PackageManagerTabs>\n\nCheck out [the integration docs](/docs/integrations/tailwind/index.mdx) for more information.\n\n## PostCSS\n\nIt is also possible to use PostCSS in your app with our built-in integration:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add postcss\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add postcss\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add postcss\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add postcss\n```\n</span>\n</PackageManagerTabs>\n\nImportant: Since we are using vite, the configuration should look as follows to work:\n\n```shell\n// Configuration with vite\nmodule.exports = {\n  plugins: {\n    autoprefixer: {},\n    \"postcss-preset-env\": {\n      stage: 3,\n      features: {\n        \"nesting-rules\": true,\n      },\n    },\n  },\n}\n```\n\nNow you will be able to use CSS with nesting-rules like the following ones:\n\n```css\nbody {\n  & .box {\n    background: red;\n\n    &:hover {\n      background: yellow;\n    }\n  }\n}\n```\n\nCheck out [the integration docs](/docs/integrations/postcss/index.mdx) for more information.\n\n## Why not inline styles using the `<style>` tag?\n\nA naive way to ensure that a component has the correct styles loaded is to inline the style information into a component like so.\n\n```tsx\nexport const MyComponent = () => {\n  return (\n    <>\n      <style>.my-class { color: red; }</style>\n      My Component\n    </>\n  );\n}\n```\n\nThe problem with this approach is that we will load styles twice.\n\n1. The styles are inserted into the HTML as part of the SSR.\n2. Then when the component is invalidated and needs to be re-rendered, the styles are loaded again because they are inlined.\n\nWhat is needed is to load the styles independently from the component. This is what [`useStyles$()`](/docs/(qwik)/core/styles/index.mdx#usestyles) is for. There are two scenarios:\n\n1. The component is rendered on the server and the styles are inserted into `<head>` as part of the SSR.\n   - Adding a new instance of a component to the application does not require that we load the styles as they are already included as part of SSR.\n2. The component is rendered on the client for the first time. In that case, the new component does not have styles in the `<head>` as the component was not part of SSR.\n   - Adding a new component that was not part of SSR requires that styles are loaded and inserted into `<head>`.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/core/tasks/index.mdx",
    "content": "---\ntitle: Tasks and Lifecycle | Components\ncontributors:\n  - mhevery\n  - manucorporat\n  - wtlin1228\n  - AnthonyPAlicea\n  - the-r3aper7\n  - sreeisalso\n  - brunocrosier\n  - harishkrishnan24\n  - gioboa\n  - bodhicodes\n  - zanettin\n  - blackpr\n  - mrhoodz\n  - ehrencrona\n  - julianobrasil\n  - adamdbradley\n  - aendel\n  - jemsco\nupdated_at: '2023-10-18T07:33:22Z'\ncreated_at: '2023-03-31T02:40:50Z'\n---\n\nimport CodeSandbox from '../../../../../components/code-sandbox/index.tsx';\n\n\n# Tasks\n\nTasks are meant for running asynchronous operations as part of component initialization or change of component state.\n\n> **Note**: Tasks are similar to `useEffect()` in React, but there are enough differences that we did not want to call them the same so as not to bring preexisting expectations about how they work. The main differences are:\n>\n> - Tasks are asynchronous.\n> - Task run on server and browser.\n> - Tasks run before rendering and can block rendering.\n\n`useTask$()` should be your default go-to API for running either synchronous or asynchronous work as part of component initialization or state change. It is only when you can't achieve what you need with `useTask$()` that you should consider using `useVisibleTask$()` or `useResource$()`.\n\nThe basic use case for `useTask$()` is to perform work on component initialization. `useTask$()` has these properties:\n- It can run on either the server or in the browser.\n- It runs before rendering and blocks rendering.\n- If multiple tasks are running then they are run sequentially in the order they were registered. An asynchronous task will block the next task from running until it completes.\n\nTasks can also be used to perform work when a component state changes. In this case, the task will rerun every time the tracked state changes. See: [`track()`](#track).\n\nSometimes a task needs to run only on the browser and after rendering, in that case, you should use [`useVisibleTask$()`](#usevisibletask).\n\n> **Note**: If you need to fetch data asynchronously and not block rendering, you should use [`useResource$()`](/docs/core/state/#useresource).  [`useResource$()`](/docs/core/state/#useresource) does not block rendering while the resource is being resolved.\n\n## Lifecycle\nResumability is \"Lazy execution\", it's the ability to build the \"framework state\" (component boundaries, etc) on the server, and have it exist on the client without re-executing the framework again.\n\nThe application environment—whether client-side or server-side—is determined by user interactions. In server-side rendering, the application initially renders on the server.\nWhen the user interacts with the application, it resumes on the client-side, continuing from the state left by the server. This approach ensures efficient and responsive user experiences by leveraging both environments based on interaction.\n\n> **Note**: For systems that use hydration, the execution of the application happens twice. Once on a server (SSR/SSG) and once on the browser (hydration). This is why many frameworks have \"effects\" which only execute on the browser. That means that the code that runs on the server is different than the code that runs on the browser. Qwik execution is unified, meaning if the code has already been executed on the server, it does not re-execute it on the browser.\n\n**In Qwik, there are only 3 lifecycle stages:**\n\n- `Task` - run before rendering and when tracked state changes. `Tasks` run sequentially, and block rendering.\n- `Render` - runs after `TASK` and before `VisibleTask`\n- `VisibleTask` - runs after `Render` and when the component becomes visible\n\n```bash /useTask$/#d /RENDER/#b /useVisibleTask$/#c\n      useTask$ -------> RENDER ---> useVisibleTask$\n                            |\n| --- SERVER or BROWSER --- | ----- BROWSER ----- |\n                            |\n                       pause|resume\n```\n\n**SERVER**: Usually **the life of a component starts on the server** (during SSR or SSG), in that case, the `useTask$` and `RENDER` will run in the server, and then the `VisibleTask` will run in the browser, after the component is visible.\n\n> **Notice** that because the component was mounted in the server, **only useVisibleTask$() runs in the browser**. This is because the browser continues the same lifecycle, that was paused in the server right after the render and resumed in the browser.\n\n**BROWSER**: When a component is first mounted or rendered in the browser, for example when a user navigates to a new page in a Single Page Application (SPA) or when a \"modal\" component initially appears on the page, the lifecycle will proceed as follows:\n\n```bash\n  useTask$ --> RENDER --> useVisibleTask$\n\n| -------------- BROWSER --------------- |\n```\n\n> **Notice** that the lifecycle is exactly the same, but this time all the hooks run in the browser, and not in the server.\n\n## `useTask$()`\n\n- **When:** BEFORE component's first render, and when tracked state changes\n- **Times:** at least once\n- **Platform:** server and browser\n\n`useTask$()` registers a hook to be executed upon component creation, it will run at least once either in the server or in the browser, depending on where the component is initially rendered.\n\nAdditionally, this task can be reactive and will re-execute when **tracked** [state](/docs/(qwik)/core/state/index.mdx) changes.\n\n**Notice that any subsequent re-execution of the task will always happen in the browser**, because reactivity is a browser-only thing.\n\n```bash\n                      (state change) -> (re-execute)\n                                  ^            |\n                                  |            v\n useTask$(track) -> RENDER ->  CLICK  -> useTask$(track)\n                        |\n  | ----- SERVER ------ | ----------- BROWSER ----------- |\n                        |\n                   pause|resume\n```\n\n> If `useTask$()` does not track any state, it will run **exactly once**, either in the server **or** in the browser (**not both**), depending where the component is initially rendered. Effectively behaving like an \"on-mount\" hook.\n\n`useTask$()` will block the rendering of the component until after its async callback resolves, in other words, tasks execute sequentially even if they are asynchronous. (Only one task executes at a time).\n\nTake a look at the simplest use case of the task to run some asynchronous work on component initialization:\n\n<CodeSandbox src=\"/src/routes/demo/tasks/use-task/index.tsx\" style={{ height: '6em' }}>\n```tsx\nimport { component$, useSignal, useTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const fibonacci = useSignal<number[]>();\n\n  useTask$(async () => {\n    const size = 40;\n    const array = [];\n    array.push(0, 1);\n    for (let i = array.length; i < size; i++) {\n      array.push(array[i - 1] + array[i - 2]);\n      await delay(100);\n    }\n    fibonacci.value = array;\n  });\n\n  return <p>{fibonacci.value?.join(', ')}</p>;\n});\n\nconst delay = (time: number) => new Promise((res) => setTimeout(res, time));\n```\n</CodeSandbox>\n\n> In this example\n>\n> - The `useTask$()` computes the fibonacci number one entry per 100 ms. So 40 entries take 4 seconds to render.\n>   - The `useTask$()` executes on the server as part of the SSR (the result may be cached in CDN.)\n>   - Because the `useTask$()` blocks rendering, the rendered HTML page takes 4 seconds to render.\n> - Because this task has no `track()` it will never rerun, making it effectively an initialization code.\n>   - Because this component only renders on the server, the `useTask$()` will never be downloaded or run on the browser.\n\n> Notice that `useTask$()` runs on the server **BEFORE** the actual rendering. Therefore if you need to do DOM manipulation, use [`useVisibleTask$()`](#usevisibletask) instead, which runs on the browser after rendering.\n\nUse `useTask$()` when you need to:\n- Run async tasks before rendering\n- Run code only once before the component is first rendered\n- Programmatically run side-effect code when state changes\n\n> Note, if you're thinking about loading data using `fetch()` inside of `useTask$`, consider using [`useResource$()`](/docs/core/state/#useresource) instead. This API is more efficient in terms of leveraging SSR streaming and parallel data fetching.\n\n### On mount\n\nIn Qwik, there isn't a specific \"mount\" step like in some other frameworks. Instead, components just start up directly where they're needed, either on a web server or in your browser. \nThis is without the inner track function, which is used to monitor specific pieces of data.\n\n`useTask$` runs always at least once when the component is first mounted.\n\n```tsx {5-8}\nimport { component$, useTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n\n  useTask$(async () => {\n    // A task without `track` any state effectively behaves like a `on mount` hook.\n    console.log('Runs once when the component mounts in the server OR client.');\n  });\n\n  return <div>Hello</div>;\n});\n```\n\nOne unique aspect of Qwik, is that components are mounted only **once** across the server and client. This is a property of resumability. What this means is that if `useTask$` is executed during Server-Side Rendering (SSR), it will not run again in the browser because Qwik does not perform hydration.\n\n### `track()`\n\nThere are times when it is desirable to re-run a task when a component state changes. This is done by using the `track()` function. The `track()` function allows you to set up a dependency on a component's state when initially rendered on the server, and then re-execute the task when the state changes in the browser.\n\nTrack accepts signals, stores and functions. It returns the value of the signal, the store itself, or the function call result.\n\nWhen you pass a store, the track will be called when the store gets or removes properties as well as mutations of properties.\nNote that deep store updates don't mutate the store itself, so `store[item].count++` will not trigger an update. Instead, you should individually track each `store[item]` (which are also automatically created stores).\n\nDuring SSR, each component will wait until all tasks are completed before outputting the HTML for that component. So a task can be called multiple times during SSR if the tracked state changes due to other tasks.\n\n> **Note**: If all you want to do is compute a new state from an existing state synchronously, you should use [`useComputed$()`](/docs/core/state/#usecomputed) instead.\n\n<CodeSandbox src=\"/src/routes/demo/tasks/track/index.tsx\" style={{ height: '6em' }} >\n```tsx\nimport { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const text = useSignal('Initial text');\n  const delayText = useSignal('');\n\n  useTask$(({ track }) => {\n    // Passing a signal directly is more efficient than using a function.\n    const newText = track(text);\n    const update = () => (delayText.value = newText);\n    isServer\n      ? update() // don't delay on server render value as part of SSR\n      : delay(500).then(update); // Delay in browser\n  });\n\n  return (\n    <section>\n      <label>\n        Enter text: <input bind:value={text} />\n      </label>\n      <p>Delayed text: {delayText}</p>\n    </section>\n  );\n});\n\nconst delay = (time: number) => new Promise((res) => setTimeout(res, time));\n```\n</CodeSandbox>\n\n> On the server:\n>\n> - The `useTask$()` runs on the server and the `track()` function sets up a subscription on the `text` signal.\n> - The page is rendered.\n>\n> On the browser:\n> - The `useTask$()` does not have to run or be downloaded eagerly because Qwik knows that the task is subscribed to the `text` signal from the server execution.\n> - When the user types in the input box, the `text` signal changes. Qwik knows that the `useTask$()` is subscribed to the `text` signal and it is at this time that the `useTask$()` closure is brought into the JavaScript VM to be executed.\n>\n> The `useTask$()`\n>\n> - The `useTask$()` blocks rendering until it completes. If you don't want to block rendering, make sure that the task is resolved, and run the delay work on a separate unconnected promise. In this example, we don't await `delay()` because it would block rendering.\n\n> Sometimes it is required to only run code either in the server or in the client. This can be achieved by using the `isServer` and `isBrowser` booleans exported from `@builder.io/qwik` as shown above.\n\n\n### `track()` as a function\n\nIn the above example, `track()` was used to track a specific signal. However, `track()` can also be used as a function to track multiple signals at once.\n\n<CodeSandbox src=\"/src/routes/demo/tasks/track-fn/index.tsx\" style={{ height: '6em' }} >\n```tsx\nimport { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const isUppercase = useSignal(false);\n  const text = useSignal('');\n  const delayText = useSignal('');\n\n  useTask$(({ track }) => {\n    const value = track(() =>\n      isUppercase.value ? text.value.toUpperCase() : text.value.toLowerCase()\n    );\n    const update = () => (delayText.value = value);\n    isServer\n      ? update() // don't delay on server render value as part of SSR\n      : delay(500).then(update); // Delay in browser\n  });\n\n  return (\n    <section>\n      <label>\n        Enter text: <input bind:value={text} />\n      </label>\n      <label>\n        Is uppercase? <input type=\"checkbox\" bind:checked={isUppercase} />\n      </label>\n      <p>Delay text: {delayText}</p>\n    </section>\n  );\n});\n\nfunction delay(time: number) {\n  return new Promise((resolve) => setTimeout(resolve, time));\n}\n```\n</CodeSandbox>\n\n> In this example, the `track()` takes a function that not only reads the signal but also transforms its value to uppercase/lowercase. The `track()` subscribes to multiple signals and computes their value.\n\n### `cleanup()`\n\nSometimes when running a task, cleanup work needs to be performed. When a new task is triggered, the previous task's `cleanup()` callback is invoked. This callback is also invoked when the component is removed from the DOM.\n\n> - The `cleanup()` function is not invoked when the task is completed. It is only invoked when a new task is triggered or when the component is removed.\n> - The `cleanup()` function is invoked on the server after the applications are serialized into HTML.\n> - The `cleanup()` function is not transferable from server to browser. Cleanup is meant to release resources on the VM where it is running. It is not meant to be transferred to the browser.\n\nThis example shows how to implement a debounce feature using the `cleanup()` function.\n\n<CodeSandbox src=\"/src/routes/demo/tasks/cleanup/index.tsx\" style={{ height: '6em' }} >\n```tsx\nimport { component$, useSignal, useTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const text = useSignal('');\n  const debounceText = useSignal('');\n\n  useTask$(({ track, cleanup }) => {\n    const value = track(() => text.value);\n    const id = setTimeout(() => (debounceText.value = value), 500);\n    cleanup(() => clearTimeout(id));\n  });\n\n  return (\n    <section>\n      <label>\n        Enter text: <input bind:value={text} />\n      </label>\n      <p>Debounced text: {debounceText}</p>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n## `useVisibleTask$()`\n\nSometimes a task needs to run only on the browser and after rendering, in that case, you should use `useVisibleTask$()`. The `useVisibleTask$()` is similar to `useTask$()` but it only runs on the browser and after initial rendering. `useVisibleTask$()` registers a hook to be executed when the component becomes visible in the viewport, it will run at least once in the browser, and it can be reactive and re-execute when some **tracked** [state](/docs/(qwik)/core/state/index.mdx) changes.\n\n`useVisibleTask$()` has these properties:\n\n- runs on the client only.\n- eagerly executes code on the client when the component becomes visible.\n- runs after initial rendering.\n- does not block rendering.\n\n> **Caution**: The `useVisibleTask$()` should be used as a last resort, because it eagerly executes code on the client. Qwik, through [resumability](), goes out of its way to delay the execution of code on the client, and `useVisibleTask$()` is an escape hatch that should be used with caution. See [Best Practices](/docs/(qwikcity)/guides/best-practices/index.mdx#dont-register-events-eagerly-with-usevisibletask) for more details.\n> If you need to run a task on a client consider `useTask$()` with a server guard.\n>\n> <CodeSandbox src=\"/src/routes/demo/tasks/track-server-guard/index.tsx\" style={{ height: '6em' }}>\n> ```tsx\n> import { component$, useSignal, useTask$ } from '@builder.io/qwik';\n> import { isServer } from '@builder.io/qwik';\n>\n> export default component$(() => {\n>   const text = useSignal('Initial text');\n>   const isBold = useSignal(false);\n>\n>   useTask$(({ track }) => {\n>     track(() => text.value);\n>     if (isServer) {\n>       return; // Server guard\n>     }\n>     isBold.value = true;\n>     delay(1000).then(() => (isBold.value = false));\n>   });\n>\n>   return (\n>     <section>\n>       <label>\n>         Enter text: <input bind:value={text} />\n>       </label>\n>       <p style={{ fontWeight: isBold.value ? 'bold' : 'normal' }}>\n>         Text: {text}\n>       </p>\n>     </section>\n>   );\n> });\n>\n> const delay = (time: number) => new Promise((res) => setTimeout(res, time));\n> ```\n> </CodeSandbox>\n>\n> In the above example, the `useTask$()` is guarded by `isServer`. The `track()` function is placed before the guard, which\n> allows the server to set up the subscription without executing any code on the server. The client\n> then executes the `useTask$()` once the `text` signal changes.\n\nThis example shows how to use `useVisibleTask$()` to initialize a clock on the browser only when the clock component becomes visible.\n\n<CodeSandbox src=\"/src/routes/demo/tasks/use-visible-task/index.tsx\" style={{ height: '6em' }} >\n```tsx\nimport {\n  component$,\n  useSignal,\n  useVisibleTask$,\n  type Signal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const isClockRunning = useSignal(false);\n\n  return (\n    <>\n      <div style=\"position: sticky; top:0\">\n        Scroll to see clock. (Currently clock is\n        {isClockRunning.value ? ' running' : ' not running'}.)\n      </div>\n      <div style=\"height: 200vh\" />\n      <Clock isRunning={isClockRunning} />\n    </>\n  );\n});\n\nconst Clock = component$<{ isRunning: Signal<boolean> }>(({ isRunning }) => {\n  const time = useSignal('paused');\n  useVisibleTask$(({ cleanup }) => {\n    isRunning.value = true;\n    const update = () => (time.value = new Date().toLocaleTimeString());\n    const id = setInterval(update, 1000);\n    cleanup(() => clearInterval(id));\n  });\n  return <div>{time}</div>;\n});\n```\n</CodeSandbox>\n\n> Notice how the clock's `useVisibleTask$()` does not run until the `<Clock>` component becomes visible. The default behavior of `useVisibleTask$()` is to run the task when the component becomes visible.  This behavior is implemented through [intersection observers](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).\n\n> **Note**: \n> The [intersection observers](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) will not run on components that are not considered visible such as `<audio />`.\n\n### Option `eagerness`\n\nAt times it is desirable to run `useVisibleTask$()` eagerly as soon as the application is loaded in the browser. In that case, the `useVisibleTask$()` needs to run in eager mode. This is done by using the `{ strategy: 'document-ready' }`.\n\n<CodeSandbox src=\"/src/routes/demo/tasks/use-visible-task-eager/index.tsx\" style={{ height: '6em' }}>\n```tsx\nimport {\n  component$,\n  useSignal,\n  useVisibleTask$,\n  type Signal,\n} from '@builder.io/qwik';\n\nexport default component$(() => {\n  const isClockRunning = useSignal(false);\n\n  return (\n    <>\n      <div style=\"position: sticky; top:0\">\n        Scroll to see clock. (Currently clock is\n        {isClockRunning.value ? ' running' : ' not running'}.)\n      </div>\n      <div style=\"height: 200vh\" />\n      <Clock isRunning={isClockRunning} />\n    </>\n  );\n});\n\nconst Clock = component$<{ isRunning: Signal<boolean> }>(({ isRunning }) => {\n  const time = useSignal('paused');\n  useVisibleTask$(\n    ({ cleanup }) => {\n      isRunning.value = true;\n      const update = () => (time.value = new Date().toLocaleTimeString());\n      const id = setInterval(update, 1000);\n      cleanup(() => clearInterval(id));\n    },\n    { strategy: 'document-ready' }\n  );\n  return <div>{time}</div>;\n});\n```\n</CodeSandbox>\n\n> In this example, the clock starts running immediately on the browser regardless of whether it is visible or not.\n\n### Advanced: Time of running, and managing visibility with CSS\n\nInternally, `useVisibleTask$` is implemented by adding an attribute to the first rendered component (either the returned component or in the case of a Fragment, its first child).  With the standard `eagerness`, this means that if the first rendered component is hidden, the task will not run.\n\nThis means that you can use CSS to influence when the task runs. For example, if the task should only run on a mobile device, you can return a `<div class=\"md:invisible\" />` (in the case of Tailwind CSS).\n\nThis also means you cannot unhide a component using a visible task; for that you can return a Fragment:\n\n```tsx\nreturn (<>\n  <div />\n  <MyHiddenComponent hidden={!showSignal.value} />\n</>)\n```\n\n## Use Hook Rules\n\nWhen using lifecycle hooks, you must adhere to the following rules:\n\n- They can only be called at the root level of `component$` (not inside conditional blocks)\n- They can only be called at the root of another `use*` method, allowing for composition.\n\n```tsx\nuseHook(); // <-- ❌ does not work\n\nexport default component$(() => {\n  useCustomHook(); // <-- ✅ does work\n  if (condition) {\n    useHook(); // <-- ❌ does not work\n  }\n  useTask$(() => {\n    useNavigate(); // <-- ❌ does not work\n  });\n  const myQrl = $(() => useHook()); // <-- ❌ does not work\n  return <button onClick$={() => useHook()}></button>; // <-- ❌ does not work\n});\n\nfunction useCustomHook() {\n  useHook(); // <-- ✅ does work\n  if (condition) {\n    useHook(); // <-- ❌ does not work\n  }\n}\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/deprecated-features/index.mdx",
    "content": "---\ntitle: Deprecated Features | Guides\ncontributors:\n  - nsdonato\n  - mrhoodz\n  - manucorporat\n  - patrickjs\n  - gioboa\nupdated_at: '2024-04-21T00:20:00Z'\ncreated_at: '2023-06-14T10:39:06Z'\n---\n\n# Deprecated features\n\nThese features were deprecated in the preparation of Qwik for its stable release.\n\nIf you happened to come across one of them and don't know what its replacement is, we quickly mention them in this table with the link to their new documentation ✨.\n\n## Qwik\n\n### Deprecated functions and their replacements\n\n----\n\n| Deprecated   | Replacements     |\n| :-------- | :-------\n| `useWatch$` | [useTask$](https://qwik.dev/docs/core/tasks/#usetask) |\n| `useMount$` | [useTask$](https://qwik.dev/docs/core/tasks/#usetask) |\n| `useServerMount` | [useTask$](https://qwik.dev/docs/core/tasks/#usetask) + [isServer](https://qwik.dev/docs/guides/qwik-nutshell/#isbrowser-&-isserver-conditionals)\n| `useClientMount` | [useTask$](https://qwik.dev/docs/core/tasks/#usetask) + [isBrowser](https://qwik.dev/docs/guides/qwik-nutshell/#isbrowser-&-isserver-conditionals)\n| `useClientEffect` - `useClientEffectQrl` | [useVisibleTask$](https://qwik.dev/docs/core/tasks/#usevisibletask) |\n| `useBrowserVisibleTask` - `useBrowserVisibleTaskQrl` | [useVisibleTask$](https://qwik.dev/docs/core/tasks/#usevisibletask) |\n| `useEnvData` | [useServerData](https://qwik.dev/api/qwik/#useserverdata) |\n| `useRef` | [useSignal](https://qwik.dev/docs/core/state/#usesignal) |\n| `createContext` | [createContextId](https://qwik.dev/docs/core/context/#createcontextid) |\n\n## Qwik City\n\n### Deprecated functions and their replacements\n----\n\n| Deprecated   | Replacements\n| :-------- | :-------\n| `useEndpoint ` | [routeLoader$](https://qwik.dev/docs/route-loader/#routeloader)\n| `loader$` - `loaderQrl` | [routeLoader$](https://qwik.dev/docs/route-loader/#routeloader)\n| `action$` - `actionQrl`  | [routeAction$](https://qwik.dev/docs/action/#routeaction)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/faq/index.mdx",
    "content": "---\ntitle: Frequently Asked Questions | Introduction\ncontributors:\n  - tidiview\n  - adamdbradley\n  - manucorporat\n  - hamatoyogi\n  - fabien0102\n  - the-r3aper7\n  - ryankshaw\n  - McMillanThomas\n  - ahhshm\n  - jangerhofer\n  - mrcaidev\n  - literalpie\n  - zanettin\n  - forresst\n  - dzearing\n  - fum4\n  - colynyu\n  - eltociear\n  - tihuan\n  - ptu14\n  - reemardelarosa\n  - ETN-Tech\n  - spicyzboss\n  - mhevery\n  - wtlin1228\n  - ilteoood\n  - pipisso\n  - ThatJSGuy\n  - mrhoodz\n  - moinulmoin\n  - brkyurun\n  - PatrickJS\n  - maiieul\nupdated_at: '2023-09-15T18:58:36Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# FAQ\n\n## Is _@QwikDev_ a sentient AI?\n\nYes, and I am very funny too! [follow me](https://twitter.com/QwikDev)\n\n## Why is it called Qwik?\n\nOriginally it was called _qoot_, but we thought it would be too hard to search for. One community member, [@PatrickJS\\_\\_](https://twitter.com/PatrickJS__), came up with _Qwik_ and after an internal poll at [builder.io](https://www.builder.io/), we changed it!\n\n## How is Qwik different from other frameworks?\n\nQwik is the first framework that has a DX (developer experience) similar to _React_, _Vue_, or _Svelte_ when authoring components. It delivers **Live HTML** that is instantly interactive, Qwik achieves this property by completely removing the need for hydration. Now, Qwik applications immediately execute the event handlers on user interaction, without having to bootstrap all the app states. This technique is called [Resumability](../concepts/resumable/index.mdx).\n\nThe outcome is that developers write extremely performant applications by default, without even worrying about it. Applications built with Qwik are fast regardless of the number of components or complexity, they are O(1) (constant time) in terms of JS payload.\n\n## Why another framework?\n\nThe short answer is that Qwik solves a problem that other frameworks can't solve. Qwik has instant-on startup performance no matter how complex the application is. Qwik apps deliver the same amount of initial JS regardless of the amount of components. [Qwik is the first open-source O(1) framework](https://www.builder.io/blog/our-current-frameworks-are-on-we-need-o1).\n\n## What is Qwik City?\n\n[Qwik City](../../(qwikcity)/qwikcity/index.mdx) is just an extra set of APIs on top of Qwik. Think of it like _Qwik_ as the core, and _City_ as the extra APIs (routing, data loading, endpoints, etc.). We call it a meta-framework for Qwik. Qwik City is to Qwik, what Next.js is to React, what Nuxt is to Vue, or SvelteKit to Svelte.\n\n## Is Qwik hard to learn?\n\nQwik is designed with React (and other JSX based frameworks) in mind, ensuring it is [effortless to learn](/docs/(qwikcity)/guides/react-cheat-sheet/index.mdx) and promotes rapid productivity. Developing components is pretty much the same as React, and routing is inspired by Nextjs and others.\n\nHowever, there are fundamentally [new concepts](../concepts/think-qwik/index.mdx) to learn, such as [Resumability](../concepts/resumable/index.mdx) and fine-grained reactivity, but we think the learning curve is not steep.\n\nWe also have an interactive [tutorial](../../tutorial/welcome/overview/) to get you started.\n\n## What are all those `$` signs?\n\nYou might have noticed there are more [`$`](../advanced/dollar/index.mdx) signs than usual in Qwik apps, such as: [`component$()`](/docs/(qwik)/core/overview/index.mdx#component), [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask), and `<div onClick$={() => console.log('click')} />`. It serves as a marker for a lazy-load boundary. Qwik breaks your application into small chunks; these pieces are smaller than the component itself. For event handlers, hooks, etc. The `$` signals to both the [optimizer](../advanced/optimizer/index.mdx) and the developer when it's happening.\n\n**Example:**\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  console.log('render');\n  return <button onClick$={() => console.log('hello')}>Hello Qwik</button>;\n});\n```\n\nThanks to the `$` syntax, the component above is split into:\n\n```js title=\"app.js\"\nimport { componentQrl, qrl } from '@builder.io/qwik';\n\nconst App = /*#__PURE__*/ componentQrl(\n  qrl(() => import('./app_component_akbu84a8zes.js'), 'App_component_AkbU84a8zes')\n);\n\nexport { App };\n```\n\n```js title=\"app_component_akbu84a8zes.js\"\nimport { jsx as _jsx } from '@builder.io/qwik/jsx-runtime';\nimport { qrl } from '@builder.io/qwik';\nexport const App_component_AkbU84a8zes = () => {\n  console.log('render');\n  return /*#__PURE__*/ _jsx('p', {\n    onClick$: qrl(\n      () => import('./app_component_p_onclick_01pegc10cpw'),\n      'App_component_p_onClick_01pEgC10cpw'\n    ),\n    children: 'Hello Qwik',\n  });\n};\n```\n\n```js title=\"app_component_p_onclick_01pegc10cpw.js\"\nexport const App_component_p_onClick_01pEgC10cpw = () => console.log('hello');\n```\n\n> Note: The `$` is not related to `jQuery`, Svelte or any other framework.\n\n## Isn't requesting JS on user interaction slow?\n\nOnly if you _download_ it on user interaction. Instead, Qwik _prefetches_ the current page's JS modules in a background thread through the [service workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) and _retrieves_ those modules from the browser's [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) when the user interacts with the application.\n\nThis strategy is called [Speculative Module Fetching](../../(qwikcity)/advanced/speculative-module-fetching/index.mdx), and it is enabled by Resumability. Hydration frameworks must eagerly download and execute the code on page load to retrieve the event handlers, and therefore can't take advantage of speculative module fetching.\n\n## How does Qwik know what to prefetch, and in which order?\n\nIn production, Qwik uses a lot of information generated during SSR (Server-Side Rendering) to start pre-populating the cache as soon as possible, with only the bits of interactivity available on the current page. This way, when the user clicks or interacts, the JS is already in the cache.\n\nIn addition, [Qwik insights](../../labs/insights/index.mdx) can be used to prioritize the important parts of interactivity before the less important parts.\n\nFor example, the \"*Buy Now*\" button is more important than the \"*Add to Cart*\" button, so Qwik will prefetch the \"*Buy Now*\" button first, and then the \"*Add to Cart*\" button.\n\n## Are Qwik apps slow on slow networks?\n\nQuite the opposite.\n\nQwik does not need to prefetch everything to start running, while other frameworks do need to download the whole critical path to become interactive because of [hydration](https://www.builder.io/blog/hydration-is-pure-overhead).\n\nIn fact, thanks to Qwik's ability to [reduce network waterfalls](../../(qwikcity)/advanced/speculative-module-fetching/index.mdx#reducing-network-waterfalls), it is likely that the requested modules have already been downloaded and stored in the browser's cache at the time of interaction. And even if they haven't yet been cached, Qwik can [avoid duplicating the requests](../../(qwikcity)/advanced/speculative-module-fetching/index.mdx#avoiding-duplicate-requests) and can instead keep fetching the modules that are being requested to start executing them as soon as possible. \n\nAs a result, Qwik apps get to be responsive much faster, especially on slow networks.\n\n## Does Qwik generate too many small files?\n\nIn dev mode, Qwik generates a lot of small files because it uses the Dev [Vite.js](https://vitejs.dev/) server, but in production mode, Qwik bundles files more efficiently.\n\n## Why does Qwik use JSX? Is it React under the hood?\n\nNope, React is not used at all. Qwik uses JSX as the template syntax.\n\nNotice that JSX is not React. In fact, JSX is only syntax without semantics. We chose JSX for several reasons:\n\n- **Familiar syntax:** It does not reinvent the wheel but leverages existing JS for loops, conditions, etc. [JSX spec is a surprisingly short read](https://facebook.github.io/jsx/)\n- **Ecosystem**: Well supported by IDEs, linters, security auditing tools, debugging tools, and highlighters.\n- **Similar to HTML**: JSX is visually and conceptually similar to HTML, a tree. Other template systems like _html templates_ (lit-html) are not trees but arrays of tokens, making it harder to build on top and transform.\n- **Popular**: By any margin, JSX is the most widely used template syntax in the world.\n\n## Does Qwik use a vDOM (Virtual DOM)?\n\nQwik uses vDOM only sometimes, and other times it does what SolidJS does (direct DOM update.)\n\nThe way to think about it is as follows:\n\nIf the change in state does not have a structural change then Qwik will most likely not use vDOM. For example: \n```ts title=\"No DOM structure change, only update value\"\nexport const NoStructuralChange = component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <>\n    {/* This will not cause vDOM to activate. (No DOM structure change, only update text value) */}\n     <div>Count: {count.value}</div>\n     <button onClick$={() => count.value++}>+1</button>\n    </>\n  );\n});\n```\n\nWhen there is a structural change, Qwik utilizes the virtual DOM (vDOM). In the following example, the DOM structure needs to be updated (replace `<h1>` with `<button>`), so vDOM will be used for rendering:\n```ts title=\"DOM structure change\"\nexport const StructuralChange = component$(() => {\n  const isLoggedIn = useSignal(false);\n  return (\n    <div>\n      {isLoggedIn.value ? <h1>you are logged in!</h1> : <button>Log in</button>}\n    </div>\n  )\n});\n\n```\n\nThe important thing to understand is that vDOM doesn't cause performance issues in Qwik. In React, however, invalidating a root component results in vDOM for the whole tree getting created. In Qwik, the decision is made on a per-component basis.  And only for components that have structural change AND are changing their structure. If a component is structural (vDOM) but no change in structure is detected, then Qwik skips the component. You can think of it as auto-memoization of all components, this means that vDOM is only employed when the view is changing structurally. This is rare because in most cases the view only changes its values. \n\n> In short, Qwik uses vDOM, but significantly less than React in comparable situations.\n\n### Why use a vDOM despite its negative reputation?\n\nThe question of whether or not to use a vDOM can be seen as a spectrum:\n- On one extreme is React which uses vDOM for everything all the time. (Good argument can be made that [vDOM is slow](https://svelte.dev/blog/virtual-dom-is-pure-overhead).)\n- On the other extreme is SolidJS which does not use vDOM at all. (Resulting in a very impressive performance.)\n\nQwik on the other hand uses a vDOM sparingly for two reasons:\n1. Because non-vDOM solution would require executing code at least once on startup to learn about the component structure. (Something which Qwik explicitly avoids.)\n2. Because vDOM has attractive DX properties, especially when you need dynamic components. \n\nFor example:\n\n```ts title=\"Dynamic components\"\nconst DynamicList = [ CompA, CompB, ...];\nexport const DynamicExample = component$(() => {\n  const idx = Math.floor(Math.random() * DynamicList.length);\n  const Component = DynamicList[idx];\n  {/* Dynamically chose which component to render */}\n  return <Component/>; \n})\n```\nThe above code `<Component/>` is super easy to understand. We are dynamically choosing a component to place there. But in [Solid](https://www.solidjs.com/docs/latest/api#dynamic), [Svelte](https://svelte.dev/tutorial/svelte-component), [Vue](https://v2.vuejs.org/v2/guide/components-dynamic-async.html), and [Angular](https://angular.io/api/common/NgTemplateOutlet), this gets complex (see links).\n\nWe have the best of both worlds by using a vDOM sparingly. During creation, we employ SSR, and most client updates are non-structural. When structural updates are necessary, they are localized to the specific component without affecting its children, thus containing any potential slowdown caused by vDOM.\n\n\n## Is there a Router for Qwik?\n\nYes! [Qwik City](../../(qwikcity)/qwikcity/index.mdx) includes a directory-based router, inspired by Next.js and others.\n\n## Do I need a server to deploy Qwik apps?\n\nYou can easily deploy a Qwik app in any [serverless environment thanks to our adapters](/docs/deployments/index.mdx). We also support a [vanilla-node adapter](/docs/deployments/node/index.mdx) for Node.js-based servers, such as Express.\n\nIf there is no need for SSR, you can deploy your Qwik app as a static site thanks to our [SSG (Static Site Generation) adapter](/docs/(qwikcity)/guides/static-site-generation/index.mdx).\n\n## Which is faster: SPAs (Single-Page Application) or MPAs (Multi-Page Application)?\n\nIt depends. For SPAs, most of the cost is paid upfront by downloading everything at the beginning of the session. So when a user interacts with the app, the cost is minimal.\n\nMPAs are extremely fast to load as they don't need to download as much JS as their SPA counterparts. However, when the user navigates, it usually requires a full page reload. A full-page reload is typically super fast because browsers are extremely fast at downloading and parsing HTML. But, since sometimes, it's ideal to keep state between navigation, the MPA approach is not ideal for every project. In this case, SPA does that very well.\n\nQwik is a unique framework that is both an MPA and an SPA at the same time.\n\n## Can Qwik do SPA?\n\nOf course! [Qwik City](/docs/(qwikcity)/qwikcity/index.mdx) includes the `<Link>` component which triggers an SPA navigation.\nWith Qwik, developers don't need to choose between an SPA or an MPA, every app is both at the same time.\n\nMPA vs SPA is no longer an architectural decision taken at the beginning of the project, but a decision made for every link.\n\n## Can Qwik do Static Site Generation (SSG)?\n\nYes! It's part of all Qwik City starters. Learn how to do [Static Site Generation here](/docs/(qwikcity)/guides/static-site-generation/index.mdx).\n\n## Can't I create an MPA or SPA with other frameworks?\n\nNot quite, other frameworks suggest removing all the `<Scripts>` at the root to generate an MPA, effectively removing all the interactivity along with the SPA navigation.\n\nAnd if scripts are _not_ removed, then each full-page reload becomes very expensive, because every page reload means that the framework needs to hydrate the entire page. Qwik, however, does not have a [hydration cost](https://www.builder.io/blog/hydration-is-pure-overhead) for each page load.\n\n## Will migrating to Qwik require a lot of effort?\n\nIt depends. If you are coming from React, porting your components to Qwik should be straight forward. But on top of that, thanks to [`Qwik React`](/docs/integrations/react/index.mdx), you can use all of the React ecosystem, so you can use any of your React components, and any React library in a Qwik app.\n\n## Can I enjoy the rich React ecosystem?\n\nYes! Qwik can run React components natively, [check out the docs](/docs/integrations/react/index.mdx).\n\nYou will be amazed!\n\n## Does Qwik do partial hydration?\n\nNo. Partial hydration (or island architecture), popularized by [Astro](https://astro.build/), is about breaking the app into islands of interactivity to avoid [full-page hydration](https://www.builder.io/blog/hydration-is-pure-overhead), where all existing components in the page need to be downloaded and executed.\n\nFor this to work, developers need to manually define the islands, and then manually describe in which situations they should be hydrated. The islands also cannot communicate with each other.\n\nInstead, Qwik components do not hydrate at all. Qwik achieves this through a powerful serialization system that serializes only the necessary state in the reactivity graph. This way, the app can resume without eagerly running any JS.\n\nWe think resumability scales without the negative trade-offs of partial hydration.\n\n## Which browsers are supported?\n\nQwik uses Vite under the hood so you shouldn't need to worry about whether the browser supports it if you're targeting modern web users.<br/>\nHere is the [Vite browser compatibility](https://vite.dev/guide/build.html#browser-compatibility).\n\n## In which languages is Qwik written?\n\nMost of Qwik is written in [TypeScript](https://www.typescriptlang.org/), a superset of JavaScript that adds optional static typing and other features. However, the Qwik compiler (or optimizer) is written in Rust, a language that is very fast and memory efficient.\n\n## Does Qwik have a community?\n\nYes! there is a growing community of Qwik developers at [Discord](https://qwik.dev/chat) and [GitHub](https://github.com/QwikDev/qwik). They are making amazing contributions to the framework, building sites at scale, and helping each other. [Join us](https://qwik.dev/chat).\n\n## Is Qwik an \"Alex Russell Approved\" framework?\n\nYes! Alex Russell ([@slightlylate](https://twitter.com/slightlylate)), known for his contributions to PWAs, W3C TAG, WC, TC39 & ES6, Chrome Frame, Dojo, and more, is often highly critical of JavaScript frameworks. Nonetheless, [he approves of Qwik](https://infrequently.org/2023/02/the-market-for-lemons/#fn-alex-approved-1).\n\n## Is Qwik production ready?\n\nYes! Qwik is already at version 1.1. Qwik has been in development for 3 years now. We are confident that Qwik is ready for production, and there are no expected breaking changes.\n\n[Builder.io](https://www.builder.io/) and a lot of teams are already using Qwik in production, so you will not be alone.\n\n## Is it true that Qwik serializes too much data in the HTML?\n\nFalse. Qwik serializes only the data that is needed for the current page. If a page has 1000 components but only one is interactive the amount of data serialized is proportional to the amount of interactivity, not the amount of components.\n\n## Who builds Qwik?\n\nAn amazing team of contributors around the world living in [Discord](https://qwik.dev/chat), and a few full time developers at [Builder.io](https://www.builder.io/): [Misko](https://twitter.com/mhevery), [Adam](https://twitter.com/adamdbradley) and [Manu Almeida](https://twitter.com/manucorporat).\n\n## Is Qwik open source?\n\nYes, [MIT](https://github.com/QwikDev/qwik/blob/main/LICENSE) and [dependency-free](https://github.com/QwikDev/qwik/blob/main/packages/qwik/package.json), installing Qwik will not bloat your node_modules nor your lawyers.\n\n## Does Qwik have any downsides?\n\nYes. Every framework, possessing its own strengths and weaknesses, involves a trade off.\n\n1. As a relatively new JS framework, Qwik's community and ecosystem are still under development and while growing rapidly, you might not find ALL the possible community projects, patterns, and best practices you're used to from more popular frameworks yet.\n2. Qwik can load JS apps of any scale - instantly, so its main advantage over current technologies is on initial page load and time to interactive. If your use case is a single page app and you don't mind the time it takes your app to load, adopting Qwik at this stage might not offer you immediate benefits.\n\nWe are constantly working on improving the developer experience and capabilities to make Qwik more delightful to use for any use case, so stay tuned.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/getting-started/index.mdx",
    "content": "---\ntitle: Getting Started | Introduction\ncontributors:\n  - manucorporat\n  - jesperp\n  - adamdbradley\n  - steve8708\n  - cunzaizhuyi\n  - mousaAM\n  - zanettin\n  - Craiqser\n  - MyltsinVV\n  - literalpie\n  - colynyu\n  - the-r3aper7\n  - ahmadalfy\n  - renomureza\n  - mhevery\n  - AnthonyPAlicea\n  - kapunahelewong\n  - kushalmahajan\n  - sreeisalso\n  - dustinsgoodman\n  - nsdonato\n  - seqshem\n  - ryo-manba\n  - EamonHeffernan\n  - DKozachenko\n  - mrhoodz\n  - moinulmoin\n  - lanc3lo1\n  - johnrackles\n  - kushalvmahajan\n  - daniela-bonvini\n  - jemsco\n  - maiieul\nupdated_at: '2024-15-30T18:34:34Z'\ncreated_at: '2023-04-02T16:36:48Z'\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Getting Started Qwikly\n\nQwik is a new kind of framework that is [resumable](../concepts/resumable/index.mdx) (no eager JS execution and no hydration), built for the edge and [familiar to React developers](/docs/integrations/react/index.mdx).\n\nTo play with it right away, check out Qwik’s in-browser playgrounds:\n\n- [StackBlitz Qwik](https://qwik.new) (Full Qwik + Qwikcity integration)\n- [Examples playground](/examples/reactivity/counter/) (Qwik only, no routing)\n\n## Prerequisites\n\nTo get started with Qwik locally, you need the following:\n\n- [Node.js v18.17](https://nodejs.org/en/download/) or higher\n- Your favorite IDE ([vscode](https://code.visualstudio.com/) recommended)\n- Optionally, read [think qwik](../concepts/think-qwik/index.mdx)\n\n## Create an app using the CLI\n\nFirst, use the Qwik CLI to generate a blank starter application, to quickly familiarize yourself with it.  The same command can be used to create projects for either Qwik or Qwik city.\n\nRun the Qwik CLI in your shell. Qwik supports pnpm, npm, yarn and bun. Choose the package manager you prefer and run one of the following commands:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm create qwik@latest\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm create qwik@latest\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn create qwik\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun create qwik@latest\n```\n</span>\n</PackageManagerTabs>\n\nThe CLI guides you through an interactive menu to set the project-name, select one of the starters, and ask if you want to install the dependencies.  To find out more about the files generated, refer to the [Project Structure](/docs/project-structure/) documentation.\n\nStart the development server:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run start\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run start\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run start\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run start\n```\n</span>\n</PackageManagerTabs>\n\n## Qwik Joke App\n\nThe Qwik Hello World tutorial guides you through building a joke app with Qwik while covering the most important Qwik concepts. The app displays a random joke from https://icanhazdadjoke.com and features a button to get a new joke on click.\n\n\n### 1. Create A Route\n\nStart by serving a page at a particular route. This basic app serves a random dad joke application on the `/joke/` route. This tutorial relies on Qwikcity, Qwik's meta-framework, which uses [directory-based](/docs/routing/) routing. To get started:\n\n1. In your project, create a new `joke` directory in `routes` containing an `index.tsx` file.\n2. Each route's `index.tsx` file must have an `export default component$(...)` so that Qwikcity knows what content to serve. Paste the following content to `src/routes/joke/index.tsx`:\n\n<CodeSandbox src=\"/src/routes/demo/getting-started/01-route/index.tsx\" style={{ height: '6em' }}>\n```tsx {3-5} title=\"src/routes/joke/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <section class=\"section bright\">A Joke!</section>;\n});\n```\n</CodeSandbox>\n\n3. Navigate to `localhost:5173/joke/` to see your new page working.\n\n> NOTE:\n>\n> - Your `joke` route default component is surrounded by an existing layout. See [Layout](/docs/layout/) for more details on what layouts are and how to work with them.\n> - index.tsx, layout.tsx in routes folder, root.tsx and all entry files need **export default**. For other components you can use export const and export function\n> - For more details about how to author components, see the [Component API](/docs/(qwik)/core/overview/index.mdx) section.\n\n### 2. Loading Data\n\nUse the external JSON API at https://icanhazdadjoke.com to load random jokes. You can use [route loaders](/docs/route-loader/) to load this data into the server and render it in the component.\n\n1. Open `src/routes/joke/index.tsx` and add this code:\n\n<CodeSandbox src=\"/src/routes/demo/getting-started/02-loading-data/index.tsx\" style={{ height: '6em' }}>\n```tsx /routeLoader$/ /useDadJoke/#a title=\"src/routes/joke/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport default component$(() => {\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n2. Now on `http://localhost:5173/joke/`, the browser displays a random joke.\n\nCode explanation:\n\n- The function passed to `routeLoader$` is invoked on the server eagerly before any component is rendered and is responsible for loading data.\n- The `routeLoader$` returns a use-hook, `useDadJoke()`, that can be used in the component to retrieve the server data.\n\n> **NOTE**\n>\n> - The `routeLoader$` is invoked eagerly on the server before any component is rendered, even if its use-hook is not invoked in any component.\n> - The `routeLoader$` return type is inferred in the component without the need for any additional type information.\n\n\n### 3. Posting Data to the Server\n\nPreviously, the component `routeLoader$` was used to send data from the server to the client. To post (send) data from the client back to the server, use [`routeAction$`](/docs/action/).\n\nNOTE: `routeAction$` is the preferred way to send data to the server because it uses the browser native form API, which works even if JavaScript is disabled.\n\nTo declare an action, add this code:\n\n```tsx /routeAction\\$/ title=\"src/routes/joke/index.tsx\"\nimport { routeLoader$, Form, routeAction$ } from '@builder.io/qwik-city';\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  // Leave it as an exercise for the reader to implement this.\n  console.log('VOTE', props);\n});\n```\n\n2. Update the `export default` component to use the `useJokeVoteAction` hook with `<Form>`.\n\n```tsx {3,7-11} /favoriteJokeAction/ title=\"src/routes/joke/index.tsx\"\nexport default component$(() => {\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">👍</button>\n        <button name=\"vote\" value=\"down\">👎</button>\n      </Form>\n    </section>\n  );\n});\n```\n\n3. Now the buttons display on `http://localhost:5173/joke/`, and their values will log to the console when they are clicked.\n\nCode explanation:\n\n- `routeAction$` receives the data.\n  - The function passed to `routeAction$` is invoked on the server whenever the form is posted.\n  - The `routeAction$` returns a use-hook, `useJokeVoteAction`, that you can use in the component to post the form data.\n- `Form` is a convenience component that wraps the browser's native `<form>` element.\n\nThings to note:\n\n- For validation, see [zod validation](/docs/action/#validation-and-type-safety).\n- The `routeAction$` works even if JavaScript is disabled.\n- If JavaScript is enabled, the `Form` component will prevent the browser from posting the form and instead post the data using JavaScript and emulate the browser's native form behavior without a full refresh.\n\nFor reference, the complete code snippet for this section is as follows:\n\n<CodeSandbox src=\"/src/routes/demo/getting-started/03-posting-data/index.tsx\" style={{ height: '8em' }}>\n```tsx {21,25-29} /favoriteJokeAction/ title=\"src/routes/joke/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$, Form, routeAction$ } from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">\n          👍\n        </button>\n        <button name=\"vote\" value=\"down\">\n          👎\n        </button>\n      </Form>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n### 4. Modifying State\n\nKeeping track of the state and updating the UI is core to what applications do. Qwik provides a `useSignal` hook to keep track of the application's state. To learn more, see [state management](/docs/core/state/).\n\nTo declare state:\n\n1. Import `useSignal` from `qwik`.\n   ```tsx /useSignal/\n   import { component$, useSignal } from \"@builder.io/qwik\";\n   ```\n2. Declare the component's state using `useSignal()`.\n   ```tsx /useSignal/\n   const isFavoriteSignal = useSignal(false);\n   ```\n3. After the closing `Form` tag, add a button to the component to modify the state.\n   ```tsx /isFavoriteSignal/\n   <button\n    onClick$={() => {\n      isFavoriteSignal.value = !isFavoriteSignal.value;\n    }}>\n     {isFavoriteSignal.value ? '❤️' : '🤍'}\n   </button>\n   ```\n\nNOTE: Clicking on the button updates the state, which in turn updates the UI.\n\nFor reference, the complete code snippet for this section is as follows:\n\n<CodeSandbox src=\"/src/routes/demo/getting-started/04-state/index.tsx\" style={{ height: '10em' }} maxHeight={500}>\n```tsx /isFavoriteSignal/ title=\"src/routes/joke/index.tsx\"\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { routeLoader$, Form, routeAction$ } from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  const isFavoriteSignal = useSignal(false);\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">\n          👍\n        </button>\n        <button name=\"vote\" value=\"down\">\n          👎\n        </button>\n      </Form>\n      <button\n        onClick$={() => (isFavoriteSignal.value = !isFavoriteSignal.value)}\n      >\n        {isFavoriteSignal.value ? '❤️' : '🤍'}\n      </button>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n### 5. Tasks and Invoking Server Code\n\nIn Qwik, a [task](/docs/core/tasks/#usetask) is work that needs to happen when a state changes. (This is similar to an \"effect\" in other frameworks.) In this example, we use the task to invoke code on the server.\n\n1. Import `useTask$` from `qwik` and `server$` from `qwik-city`.\n   ```tsx /useTask\\$/ /server\\$/\n   import { component$, useSignal, useTask$ } from \"@builder.io/qwik\";\n   import {\n     routeLoader$,\n     Form,\n     routeAction$,\n     server$,\n   } from '@builder.io/qwik-city';\n   ```\n\n2. Create a new task that tracks the `isFavoriteSignal` state:\n   ```tsx /useTask\\$/\n   useTask$(({ track }) => {});\n   ```\n3. Add a `track` call to re-execute the task on `isFavoriteSignal` state change:\n   ```tsx /track/\n   useTask$(({ track }) => {\n     track(() => isFavoriteSignal.value);\n   });\n   ```\n4. Add the work that you want to execute on state change:\n   ```tsx {3}\n   useTask$(({ track }) => {\n     track(() => isFavoriteSignal.value);\n     console.log('FAVORITE (isomorphic)', isFavoriteSignal.value);\n   });\n   ```\n5. If you want to have work happen on the server only, wrap it in `server$()`\n   ```tsx /server\\$/ {4-6}\n   useTask$(({ track }) => {\n     track(() => isFavoriteSignal.value);\n     console.log('FAVORITE (isomorphic)', isFavoriteSignal.value);\n     server$(() => {\n       console.log('FAVORITE (server)', isFavoriteSignal.value);\n     })();\n   });\n   ```\n\nNOTE:\n\n- The body of `useTask$` is executed on both the server and the client (isomorphic).\n- On SSR, the server prints `FAVORITE (isomorphic) false` and `FAVORITE (server) false`.\n- When the user interacts with favorite, the client prints `FAVORITE (isomorphic) true` and the server prints `FAVORITE (server) true`.\n\nFor reference, the complete code snippet for this section is as follows:\n\n<CodeSandbox src=\"/src/routes/demo/getting-started/05-tasks/index.tsx\" style={{ height: '10em' }} maxHeight={500}>\n```tsx {28-34} title=\"src/routes/joke/index.tsx\"\nimport { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport {\n  routeLoader$,\n  Form,\n  routeAction$,\n  server$,\n} from '@builder.io/qwik-city';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  const isFavoriteSignal = useSignal(false);\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n  useTask$(({ track }) => {\n    track(() => isFavoriteSignal.value);\n    console.log('FAVORITE (isomorphic)', isFavoriteSignal.value);\n    server$(() => {\n      console.log('FAVORITE (server)', isFavoriteSignal.value);\n    })();\n  });\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">\n          👍\n        </button>\n        <button name=\"vote\" value=\"down\">\n          👎\n        </button>\n      </Form>\n      <button\n        onClick$={() => (isFavoriteSignal.value = !isFavoriteSignal.value)}\n      >\n        {isFavoriteSignal.value ? '❤️' : '🤍'}\n      </button>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n### 6. Styling\n\nStyling is an important part of any application. Qwik provides a way to associate and scope styles with your component.\n\nTo add styles:\n\n1. Create a new file `src/routes/joke/index.css`:\n\n   ```css\n   p {\n     font-weight: bold;\n   }\n\n   form {\n     float: right;\n   }\n   ```\n\n2. import the styles in `src/routes/joke/index.tsx`:\n    ```tsx\n    import styles from \"./index.css?inline\";\n    ```\n3. Import `useStylesScoped$` from `qwik`.\n   ```tsx /useStylesScoped$/\n   import { component$, useSignal, useStylesScoped$, useTask$ } from \"@builder.io/qwik\";\n4. Tell the component to load the styles:\n   ```tsx\n   useStylesScoped$(styles);\n   ```\n\nCode explanation:\n\n- The `?inline` query parameter tells Vite to inline the styles into the component.\n- The `useStylesScoped$` call tells Qwik to associate the styles with the component only (scoping).\n- Styles are only loaded if they are not already inlined as part of SSR and only for the first component.\n\nFor reference, the complete code snippet for this section is as follows:\n\n<CodeSandbox maxHeight={500} src=\"/src/routes/demo/getting-started/06-styling/index.tsx\" style={{ height: '10em' }}>\n```tsx /useStylesScoped\\$/#a /styles/#b title=\"src/routes/joke/index.tsx\"\nimport {\n  component$,\n  useSignal,\n  useStylesScoped$,\n  useTask$,\n} from '@builder.io/qwik';\nimport {\n  routeLoader$,\n  Form,\n  routeAction$,\n  server$,\n} from '@builder.io/qwik-city';\nimport styles from './index.css?inline';\n\nexport const useDadJoke = routeLoader$(async () => {\n  const response = await fetch('https://icanhazdadjoke.com/', {\n    headers: { Accept: 'application/json' },\n  });\n  return (await response.json()) as {\n    id: string;\n    status: number;\n    joke: string;\n  };\n});\n\nexport const useJokeVoteAction = routeAction$((props) => {\n  console.log('VOTE', props);\n});\n\nexport default component$(() => {\n  useStylesScoped$(styles);\n  const isFavoriteSignal = useSignal(false);\n  // Calling our `useDadJoke` hook, will return a reactive signal to the loaded data.\n  const dadJokeSignal = useDadJoke();\n  const favoriteJokeAction = useJokeVoteAction();\n  useTask$(({ track }) => {\n    track(() => isFavoriteSignal.value);\n    console.log('FAVORITE (isomorphic)', isFavoriteSignal.value);\n    server$(() => {\n      console.log('FAVORITE (server)', isFavoriteSignal.value);\n    })();\n  });\n  return (\n    <section class=\"section bright\">\n      <p>{dadJokeSignal.value.joke}</p>\n      <Form action={favoriteJokeAction}>\n        <input type=\"hidden\" name=\"jokeID\" value={dadJokeSignal.value.id} />\n        <button name=\"vote\" value=\"up\">👍</button>\n        <button name=\"vote\" value=\"down\">👎</button>\n      </Form>\n      <button\n        onClick$={() => (isFavoriteSignal.value = !isFavoriteSignal.value)}\n      >\n        {isFavoriteSignal.value ? '❤️' : '🤍'}\n      </button>\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n### 7. Preview\n\nUp until now, you've been using the dev server to make your application.\n\nThis is great to see your changes in real time, but it doesn't work the same way as in production:\n\n- Each file is loaded individually, which may cause waterfalls in the network tab.\n- There is no speculative loading of bundles, so there may be a delay on the first interaction.\n\nTo make sure everything is ready for production and eliminate these issues, you can run your app in preview:\n\n1. Run `preview` command to create a production build and run it.\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run preview\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run preview\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run preview\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run preview\n```\n</span>\n</PackageManagerTabs>\n\nNOTE:\n\n- Your application should now have a production build running on localhost:4173.\n- If you interact with the application now, the network tab of the dev tools should show that the bundles have been [preloaded](/docs/advanced/speculative-module-fetching/).\n\n## Review\n\nCongratulations, you've learned a lot about Qwik!\nFor more on just how much you can achieve with Qwik, check out the dedicated docs on each of the topics touched on in this tutorial:\n\n- [Project structure](/docs/(qwikcity)/project-structure/index.mdx)\n- [Directory-based routing](/docs/(qwikcity)/routing/index.mdx#directory-based-routing)\n- [Component](/docs/(qwik)/core/overview/index.mdx)\n- [Route loaders](/docs/(qwikcity)/route-loader/index.mdx)\n- [Form actions](/docs/(qwikcity)/action/index.mdx) && [zod validation](/docs/(qwikcity)/action/index.mdx#validation-and-type-safety)\n- [State management](/docs/(qwik)/core/state/index.mdx)\n- [Tasks](/docs/(qwik)/core/tasks/index.mdx#use-usetask-when-you-need-to)\n- [Preloading](/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwik)/index.mdx",
    "content": "---\ntitle: Overview | Introduction\ncontributors:\n  - adamdbradley\n  - steve8708\n  - manucorporat\n  - gabrielgrant\n  - zanettin\n  - mhevery\n  - the-r3aper7\n  - EdinK1\n  - mrhoodz\n  - moinulmoin\n  - LoganAffleck\n  - erikras\n  - ahevery\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\nimport ImgSeeMoreMedia from '~/media/icons/see_more_media.svg?jsx';\nimport ImgShowcase from '~/media/icons/showcase.svg?jsx';\nimport ImgQwikcityAndRouting from '~/media/icons/qwikCity_and_routing.svg?jsx';\nimport ImgCommunityChat from '~/media/icons/community_chat.svg?jsx';\nimport ImgCoursesBook from '~/media/icons/courses_book.svg?jsx';\nimport ImgApiServer from '~/media/icons/api_server.svg?jsx';\nimport ImgWhyQwikLogo from '~/media/icons/why_qwik_logo.svg?jsx';\nimport ImgGettingStartedRocket from '~/media/icons/getting_started_rocket.svg?jsx';\n\n# Welcome to Qwik\n\nQwik is a new kind of web framework that can deliver instant loading web applications at any size or complexity. Your sites and apps can boot with about 1kb of JS (regardless of application complexity), and achieve consistent performance at scale.\n\n## Getting Started with Qwik\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"/docs/getting-started/\">\n    <ImgGettingStartedRocket class=\"intro-icon\" style=\"margin-bottom:-7px\"/>\n    <h3>Getting Started</h3>\n  </a>\n  <a class=\"card card-center\" href=\"/docs/concepts/think-qwik/\">\n    <ImgWhyQwikLogo class=\"intro-icon\" />\n    <h3>Why Qwik?</h3>\n  </a>\n  <a class=\"card card-center\" href=\"/api/\">\n    <ImgApiServer class=\"intro-icon\" style=\"margin-bottom:15px\"/>\n    <h3>API</h3>\n  </a>\n  <a class=\"card card-center\" href=\"/ecosystem/#courses\">\n    <ImgCoursesBook class=\"intro-icon\" style=\"margin-bottom:15px\"/>\n    <h3>Courses</h3>\n  </a>\n  <a class=\"card card-center\" href=\"https://qwik.dev/chat\">\n     <ImgCommunityChat class=\"intro-icon\" />\n    <h3>Community</h3>\n  </a>\n  <a class=\"card card-center\" href=\"/docs/qwikcity/\">\n    <ImgQwikcityAndRouting class=\"intro-icon\" />\n    <h3>Qwik City & Routing</h3>\n  </a>\n</div>\n\n## Explore More\n\n<div class=\"card-grid\">\n  <a class=\"card card-center\" href=\"/media/\">\n    <ImgSeeMoreMedia class=\"intro-icon\" />\n    <h3>See more presentations, videos, and podcasts</h3>\n  </a>\n  <a class=\"card card-center\" href=\"/showcase/\">\n    <ImgShowcase class=\"intro-icon\" />\n    <h3>Check out websites built with Qwik</h3>\n  </a>\n</div>\n\n## Why Qwik?\n\n<div class=\"card-grid\">\n  <div class=\"card\">\n    <h3>General-purpose</h3>\n    <p>Qwik can be used to build any type of website or application.</p>\n  </div>\n  <div class=\"card\">\n    <h3>Instant Interactivity</h3>\n    <p>Qwik apps work instantly without any delay because they don't need hydration, regardless of their size or complexity.</p>\n  </div>\n  <div class=\"card\">\n    <h3>JS Streaming</h3>\n    <p>Qwik delivers sub-second full page loads, even on mobile, by serving pure HTML and executing JavaScript when your users opt-in.</p>\n  </div>\n</div>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/action/index.mdx",
    "content": "---\ntitle: RouteAction$ | QwikCity\ndescription: Learn about actions in QwikCity, allowing form submissions, and performing side effects such as writing to a database or sending an email.\ncontributors:\n  - manucorporat\n  - cunzaizhuyi\n  - forresst\n  - keuller\n  - hamatoyogi\n  - AnthonyPAlicea\n  - the-r3aper7\n  - thejackshelton\n  - adnanebrahimi\n  - mhevery\n  - ulic75\n  - CoralWombat\n  - tzdesign\n  - igorbabko\n  - gioboa\n  - mrhoodz\n  - VinuB-Dev\n  - aivarsliepa\n  - wtlin1228\n  - adamdbradley\n  - gioboa\n  - jemsco\n  - tzdesign\n  - shairez\nupdated_at: '2023-12-15T11:00:00Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# `routeAction$()`\n\n`routeAction$()` is used to define functions called actions that execute exclusively on the server, and only when explicitly called. Actions can have side effects such as writing to a database or sending an email, that cannot happen during client-side rendering. This makes them ideal for handling form submissions, performing operations with side effects, and then returning data back to the client/browser where it can be used to update the UI.\n\nActions can be declared using `routeAction$()` or `globalAction$()` exported from `@builder.io/qwik-city`.\n\n```tsx {4,16} /useAddUser/ /firstName/#a /lastName/#b /email/#c title=\"src/routes/layout.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$, Form } from '@builder.io/qwik-city';\n\nexport const useAddUser = routeAction$(async (data, requestEvent) => {\n  // This will only run on the server when the user submits the form (or when the action is called programmatically)\n  const userID = await db.users.add({\n    firstName: data.firstName,\n    lastName: data.lastName,\n  });\n  return {\n    success: true,\n    userID,\n  };\n});\n\nexport default component$(() => {\n  const action = useAddUser();\n\n  return (\n    <>\n      <Form action={action}>\n        <input name=\"firstName\" />\n        <input name=\"lastName\" />\n        <button type=\"submit\">Add user</button>\n      </Form>\n      {action.value?.success && (\n        // When the action is done successfully, the `action.value` property will contain the return value of the action\n        <p>User {action.value.userID} added successfully</p>\n      )}\n    </>\n  );\n});\n```\n\n> Since actions are not executed during rendering, they can have side effects such as writing to a database, or sending an email. An action only runs when called explicitly.\n\n\n## Using actions with `<Form/>`\n\nThe best way to call an action is using the `<Form/>` component exported in `@builder.io/qwik-city`.\n\n```tsx title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$, Form } from '@builder.io/qwik-city';\n\nexport const useAddUser = routeAction$(async (user) => {\n  const userID = await db.users.add(user);\n  return {\n    success: true,\n    userID,\n  };\n});\n\nexport default component$(() => {\n  const action = useAddUser();\n  return (\n    <Form action={action}>\n      <input name=\"name\" />\n      <button type=\"submit\">Add user</button>\n      {action.value?.success && <p>User added successfully</p>}\n    </Form>\n  );\n});\n```\n\nUnder the hood, the `<Form/>` component uses a native HTML `<form>` element, so it will work without JavaScript.\n\nWhen JS is enabled, the `<Form/>` component will intercept the form submission and trigger the action in SPA mode. Allowing for a full SPA experience.\n\n> This is to clarify that the server re-renders the whole page and re-executes everything, so if you have any [routeLoader$](/docs/route-loader/) they will be executed too.\n\n[Complex forms](/docs/advanced/complex-forms) can be created using dot notation.\n\n## Using actions programmatically\n\nActions can also be triggered programmatically using the `action.submit()` method (i.e. you don't need a `<Form/>` component). However, you can trigger the action from a button click or any other event, just like you would do with a function.\n\n```tsx {18} title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$ } from '@builder.io/qwik-city';\n\nexport const useAddUser = routeAction$(async (user) => {\n  const userID = await db.users.add(user);\n  return {\n    success: true,\n    userID,\n  };\n});\n\nexport default component$(() => {\n  const action = useAddUser();\n  return (\n    <section>\n      <button\n        onClick$={async () => {\n          const { value } = await action.submit({ name: 'John' });\n          console.log(value);\n        }}\n      >\n        Add user\n      </button>\n      {action.value?.success && <p>User added successfully</p>}\n    </section>\n  );\n});\n```\n\nIn the example above, the `addUser` action is triggered when the user clicks the button. The `action.submit()` method returns a `Promise` that resolves when the action is done.\n\n### Uploading files\n\nWhen using `<Form>` with a file input, the submission will be sent as a `multipart/form-data` request.\n\nBut when using actions programmatically, you can still upload files by passing a `File` object to the `action.submit()` method by creating a `FormData` object and appending the file to it.\n\n```tsx title=\"src/routes/index.tsx\"\n\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$ } from '@builder.io/qwik-city';\n\nexport const useUploadFile = routeAction$(async ({file}) => {\n  // save the file somewhere...\n  return {\n    success: true,\n  };\n});\n\nexport default component$(() => {\n  const action = useUploadFile();\n  const fileUploadRef = useSignal<HTMLInputElement | undefined>();\n  return (\n    <section>\n      <input type=\"file\" ref={fileUploadRef}/>\n      <button\n        onClick$={async () => {\n          \n          const file = fileUploadRef.value?.files?.[0];\n\n          if (file){\n            const formData = new FormData();\n            formData.append('file', file);\n            const { value } = await action.submit(formData);\n            console.log(value);\n          }\n        }}\n      >\n        Upload file\n      </button>\n      \n    </section>\n  );\n});\n\n```\n\n\n\n## Actions with Event Handlers\n\nThe `onSubmitCompleted$` event handler can be used after an action is successfully executed and returns some data. This is useful for performing tasks, such as resetting UI elements or updating the application state, once an action has been completed.\n\nHere's an example of the `onSubmitCompleted$` handler used to edit an item in a EditForm component of a todo app.\n\n```tsx title=\"src/components/EditForm.tsx\"\nimport { component$, type Signal, useSignal } from '@builder.io/qwik';\nimport { Form } from '@builder.io/qwik-city';\nimport { type ListItem, useEditFromListAction } from '../../routes/index';\n\nexport interface EditFormProps {\n  item: listItem;\n  editingIdSignal: Signal<string>;\n}\n\nconst EditForm = component$(\n  ({ item, editingIdSignal }: EditFormProps) => {\n    const editAction = useEditFromListAction();\n\n    return (\n      <div>\n        <Form\n          action={editAction}\n          onSubmitCompleted$={() => {\n            editingIdSignal.value = '';\n          }}\n          spaReset\n        >\n          <input\n            type=\"text\"\n            value={item.text}\n            name=\"text\"\n            id={`edit-${item.id}`}\n          />\n          {/* Sends item.id with form data on submission. */}\n          <input type=\"hidden\" name=\"id\" value={item.id} />\n          <button type=\"submit\">\n            Submit\n          </button>\n        </Form>\n\n        <div>\n          <button onClick$={() => (editingIdSignal.value = '')}>\n            Cancel\n          </button>\n        </div>\n      </div>\n    );\n  }\n);\n\nexport default EditForm;\n```\n\nIn this example, `onSubmitCompleted$` is used to reset the editingIdSignal value to an empty string once the form submission is completed successfully. This allows the application to update its state and return to the default view.\n\n## Validation and type safety\n\nQwik comes with built-in support for [Zod](https://zod.dev/), a TypeScript-first schema validation that can be used directly with actions, using the `zod$()` function.\n\nActions + [Zod](https://zod.dev/) allows to create type safe forms, where the data is validated server side before the action is executed.\n\n```tsx {16-20} /firstName/#a /lastName/#b title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$, zod$, z, Form } from '@builder.io/qwik-city';\n\nexport const useAddUser = routeAction$(\n  async (user) => {\n    // The \"user\" is strongly typed: { firstName: string, lastName: string }\n    const userID = await db.users.add({\n      firstName: user.firstName,\n      lastName: user.lastName,\n    });\n    return {\n      success: true,\n      userID,\n    };\n  },\n  // Zod schema is used to validate that the FormData includes \"firstName\" and \"lastName\"\n  zod$({\n    firstName: z.string(),\n    lastName: z.string(),\n  })\n);\n\nexport default component$(() => {\n  const action = useAddUser();\n  return (\n    <>\n      <Form action={action}>\n        <input name=\"firstName\" />\n        <input name=\"lastName\" />\n\n        {action.value?.failed && <p>{action.value.fieldErrors?.firstName}</p>}\n        <button type=\"submit\">Add user</button>\n      </Form>\n      {action.value?.success && (\n        <p>User {action.value.userID} added successfully</p>\n      )}\n    </>\n  );\n});\n```\n\nWhen submitting data to a `routeAction()`, the data is validated against the Zod schema. If the data is invalid, the action will put the validation error in the `routeAction.value` property.\n\nPlease refer to the [Zod documentation](https://zod.dev/) for more information on how to use Zod schemas.\n\n### Advanced event based validation\n\nThe constructor of ```zod$``` can also take a function, as the first argument is zod itself, so you can use this directly to build the schema.\nThe second parameter is the RequestEvent to construct an event-based zod schema.\nEspecially in combination with ```refine``` and ```superRefine``` in zod, the only limit is your imagination.\n\n\n```tsx {5-5} /ev/#a  title=\"Advanced event based validation\"\nexport const useAddUser = routeAction$(\n  async (user) => {\n    // The \"user\" is still strongly typed, but firstname\n    // is now optional: { firstName?: string | undefined, lastName: string }\n    const userID = await db.users.add({\n      firstName: user.firstName,\n      lastName: user.lastName,\n    });\n    return {\n      success: true,\n      userID,\n    };\n  },\n  // Zod schema is used to validate that the FormData includes \"firstName\" and \"lastName\"\n  zod$((z, ev) => {\n    // The first name is optional if the url contains the query parameter \"firstname=optional\"\n    const firstName =\n      ev.url.searchParams.get(\"firstname\") === \"optional\"\n        ? z.string().optional()\n        : z.string().nonempty();\n\n    return z.object({\n      firstName,\n      lastName: z.string(),\n    });\n  })\n);\n```\n\n## HTTP request and response\n\n`routeAction$` and `globalAction$` have access to the `RequestEvent` object which includes information about the current HTTP request and response.\n\nThis allows actions to access the request headers, cookies, url and environment variables within the `routeAction$` function.\n\n```tsx /requestEvent/ title=\"src/routes/product/[user]/index.tsx\"\nimport { routeAction$ } from '@builder.io/qwik-city';\n\n// The second argument of the action is the `RequestEvent` object\nexport const useProductRecommendations = routeAction$(\n  async (_data, requestEvent) => {\n    console.log('Request headers:', requestEvent.request.headers);\n    console.log('Request cookies:', requestEvent.cookie);\n    console.log('Request url:', requestEvent.url);\n    console.log('Request params:', requestEvent.params);\n    console.log('MY_ENV_VAR:', requestEvent.env.get('MY_ENV_VAR'));\n  }\n);\n\n```\n\n## Action Failures\n\nIn order to return non-success values, the action must use the `fail()` method.\n\n```tsx /fail/\nimport { routeAction$, zod$, z } from '@builder.io/qwik-city';\n\nexport const useAddUser = routeAction$(\n  async (user, { fail }) => {\n    // `user` is typed { name: string }\n    const userID = await db.users.add(user);\n    if (!userID) {\n      return fail(500, {\n        message: 'User could not be added',\n      });\n    }\n    return {\n      userID,\n    };\n  },\n  zod$({\n    name: z.string(),\n  })\n);\n```\n\nFailures are stored in the `action.value` property, just like the success value. However, the `action.value.failed` property is set to `true` when the action fails. Futhermore, failure messages can be found in the `fieldErrors` object according to properties defined in your Zod schema.\n\nThe `fieldErrors` become a dot notation object. See [Complex forms](/docs/advanced/complex-forms) for more information.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Form } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const action = useAddUser();\n  return (\n    <Form action={action}>\n      <input name=\"name\" />\n      <button type=\"submit\">Add user</button>\n      {action.value?.failed && <p>{action.value.fieldErrors.name}</p>}\n      {action.value?.userID && <p>User added successfully</p>}\n    </Form>\n  );\n});\n```\n\nThanks to Typescript type discrimination, you can use the `action.value.failed` property to discriminate between success and failure.\n\n## Previous form state\n\nWhen an action is triggered, the previous state is stored in the `action.formData` property. This is useful to display a loading state while the action is running.\n\n```tsx {12} /action.formData/\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$, Form, zod$, z } from '@builder.io/qwik-city';\n\nexport const useAddUser = routeAction$(async (user) => {\n  // handle action...\n});\n\nexport default component$(() => {\n  const action = useAddUser();\n  return (\n    <Form action={action}>\n      <input name=\"name\" value={action.formData?.get('name')} />\n      <button type=\"submit\">Add user</button>\n    </Form>\n  );\n});\n```\n\nThe `action.formData` is especially useful for retaining user-filled form data even after a page refresh. This enables a seamless SPA experience, even with JS disabled.\n\n## Route vs Global actions\n\nActions can be declared using the `routeAction$()` or `globalAction$()` exported from `@builder.io/qwik-city`, the only difference between the two is that `routeAction$()` is scoped to a route, while `globalAction$()` is globally available across the whole app.\n\nIt's recommended to start with `routeAction$()`. Use `globalAction$()` only when sharing an action across multiple routes, or if you wish to use the action in a component that is not a route.\n\n### `routeAction$()`\n\n`routeAction$()` can only be declared inside the `src/routes` folder, in a `layout.tsx` or `index.tsx` file, and they MUST be exported, just like a `routeLoader$()`. Since `routeAction$()`s are only accessible within the route it's declared, they are recommended when the action needs to access some user data, or it's a protected route. Think about it like a \"private\" action.\n\n> If you want to manage common reusable routeAction$() it is essential that this function is re-exported from within 'layout.tsx' or 'index.tsx file of the existing route otherwise it will not run or throw exception. For more information [check this section](/docs/(qwikcity)/re-exporting-loaders/index.mdx).\n\n```tsx title=\"src/routes/form/index.tsx\"\nimport { routeAction$ } from '@builder.io/qwik-city';\n\nexport const useChangePassword = routeAction$((data) => {\n  // ...\n});\n```\n\n### `globalAction$()`\n\n`globalAction$()` can be declared anywhere in the `src` folder. Since `globalAction$()` are globally available, they are recommended when the action needs to be shared across multiple routes, or when the action doesn't need to access any user data. For example, a `useLogin` action that logs in a user. Think about it like a \"public\" action.\n\n```tsx title=\"src/components/login/login.tsx\"\nimport { globalAction$ } from '@builder.io/qwik-city';\n\nexport const useLogin = globalAction$((data) => {\n  // ...\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/complex-forms/index.mdx",
    "content": "---\ntitle: Complex Forms | Advanced\ndescription: Learn how to create complex forms with arrays and objects.\ncontributors:\n  - ulic75\n  - hamatoyogi\n  - aendel\n  - tzdesign\nupdated_at: '2023-08-21T21:04:20Z'\ncreated_at: '2023-08-21T21:04:20Z'\n---\n\n# Complex Forms\n\n## What are Complex Forms?\n\nComplex forms would typically contain data in a structure that is more than just simple key/value pairs. For example, a list of people who each have their own email, phone and street address. This would essentially be an array of objects.\n\n## Input naming\n\n### Objects\n\nNested items can be created by separating the items with `.` (dot) in the name. For example, `person.name` would be converted to `{ person: { name: 'sam' } }`.\n\n### Arrays\n\nArrays, either top-level or nested are created by specifying the zero-based index in the name.  For example `person.pets.0` would be converted to `{ person: { pets: [ 'cat' ] } }`.\n\n### Example\n\nThe key to creating a complex form is in the naming of the inputs. Below would be an example of the list described above:\n```html\n<form>\n  <input name=\"person.0.name\" value=\"Sam\">\n  <input name=\"person.0.email\" value=\"sam@complexform.com\">\n  <input name=\"person.0.pets.0\" value=\"cat\">\n  <input name=\"person.0.pets.1\" value=\"dog\">\n  <input name=\"person.0.address.street\" value=\"1234 Example Ave.\">\n  <input name=\"person.0.address.city\" value=\"Qwik\">\n  <input name=\"person.0.address.state\" value=\"IA\">\n  <input name=\"person.0.address.zip\" value=\"00000\">\n  <input name=\"person.0.pets.0\" value=\"beaver\">\n\n  <input name=\"person.1.name\" value=\"Bonnie\">\n  <input name=\"person.1.email\" value=\"bonnie@hishai.net\">\n  <input name=\"person.1.address.street\" value=\"768 Resolution Way\">\n  <input name=\"person.1.address.city\" value=\"Jaffa\">\n  <input name=\"person.1.address.state\" value=\"IL\">\n  <input name=\"person.1.address.zip\" value=\"01948\">\n</form>\n```\n\n#### Output object\n\nAfter submitting the form the data would be parsed in an object like this:\n```json\n{\n  \"person\": [\n    {\n      \"name\": \"Sam\",\n      \"email\": \"sam@complexform.com\",\n      \"address\": {\n        \"street\": \"1234 Example Ave.\",\n        \"city\": \"Qwik\",\n        \"state\": \"IA\",\n        \"zip\": \"00000\"\n      },\n      \"pets\": [\"beaver\"]\n    },\n    {\n      \"name\": \"Bonnie\",\n      \"email\": \"bonnie@hishai.net\",\n      \"address\": {\n        \"street\": \"768 Resolution Way\",\n        \"city\": \"Jaffa\",\n        \"state\": \"IL\",\n        \"zip\": \"01948\"\n      }\n    }\n  ]\n}\n```\n\n## Using with Actions\n\nComplex forms can be validated using zod$ with routeAction$ and globalAction$. Continuing with the previous examples it would look like this:\n\n```tsx\nexport const action = routeAction$(\n  async (person) => {\n    return { success: true, person, };\n  },\n  // Zod schema is used to validate the FormData\n  zod$({\n    person: z.array(\n      z.object({\n        name: z.string(),\n        email: z.string().email(),\n        address: z.object({\n          street: z.string(),\n          city: z.string(),\n          state: z.string(),\n          zip: z.coerce.number()\n        }),\n        pets: z.array(z.string())\n      })\n    ),\n  })\n);\n```\n\n### Field errors also in dot notation (almost)\n\nIf you use dot notation, the error messages are also returned in dot notation in the `fieldErrors` property. This has the advantage that the input name and fieldError key match.\n\nFor the this action:\n```tsx\nexport const addPersonAction = routeAction$(\n  async person => {\n    return { success: true, person };\n  },\n  // Zod schema is used to validate the FormData\n  zod$({\n    person: z.object({\n      name: z.string(),\n      email: z.string().email(),\n      address: z.object({\n        street: z.string(),\n        city: z.string(),\n        state: z.string(),\n        zip: z.coerce.number(),\n      }),\n      pets: z.array(z.string()),\n    }),\n  })\n);\n```\n\nYou would get this kind of `fieldErrors` if all are wrong:\n\n```ts\n{\n  \"person.name\": \"Invalid string\",\n  \"person.email\": \"Invalid email\",\n  \"person.address.street\": \"Invalid string\",\n  \"person.address.city\": \"Invalid string\",\n  \"person.address.state\": \"Invalid string\",\n  \"person.address.zip\": \"Invalid number\",\n  \"person.pets[]\": [\"Required\"]\n}\n```\n\nIf you make person an array, the error messages will switch to a slightly different notation as:\n\n```ts\n{\n  \"person[].name\": [\"Invalid string\"],\n  \"person[].email\": [\"Invalid email\"],\n  \"person[].address.street\": [\"Invalid string\"],\n  \"person[].address.city\": [\"Invalid string\"],\n  \"person[].address.state\": [\"Invalid string\"],\n  \"person[].address.zip\": [\"Invalid number\"],\n  \"person[].pets[]\": [\"Required\"]\n}\n```\n\n> If you completely forget to assign a value to an array type, lets say you completely forget person in the form.\n> The error is then in `fieldErrors[\"person[]\"]`.\n\nThis way you can easily match the error messages to the input names like this:\n\n```tsx\nexport const useAddPersonAction = routeAction$(\n  async person => {\n    console.log(person);\n    return { success: true, person };\n  },\n  zod$({\n    person: z.object({\n      name: z.string().min(2),\n      email: z.string().email(),\n      address: z.object({\n        street: z.string().min(2),\n        city: z.string().min(2),\n        state: z.string().min(2),\n        zip: z.coerce.number(),\n      }),\n      pets: z.array(z.string().min(2)),\n    }),\n  })\n);\n\nexport default component$(() => {\n  const testAction = useAddPersonAction();\n\n  const renderError = (errorMessage: string | undefined) => {\n    if (!errorMessage) return null;\n    return <p class=\"error\">{errorMessage}</p>;\n  };\n\n  return (\n    <Form action={testAction}>\n      <input type=\"email\" name=\"person.email\" placeholder=\"Email\" />\n      {renderError(testAction.value?.fieldErrors?.[\"person.email\"])}\n      <input type=\"text\" name=\"person.name\" placeholder=\"Name\" />\n      {renderError(testAction.value?.fieldErrors?.[\"person.name\"])}\n      <input type=\"text\" name=\"person.address.street\" placeholder=\"Street\" />\n      {renderError(testAction.value?.fieldErrors?.[\"person.address.street\"])}\n      <input type=\"text\" name=\"person.address.city\" placeholder=\"City\" />\n      {renderError(testAction.value?.fieldErrors?.[\"person.address.city\"])}\n      <input type=\"text\" name=\"person.address.state\" placeholder=\"State\" />\n      {renderError(testAction.value?.fieldErrors?.[\"person.address.state\"])}\n      <input type=\"text\" name=\"person.address.zip\" placeholder=\"Zip\" />\n      {renderError(testAction.value?.fieldErrors?.[\"person.address.zip\"])}\n      <input type=\"text\" name=\"person.pets.0\" placeholder=\"Pet 1\" />\n      {renderError(testAction.value?.fieldErrors?.[\"person.pets[]\"]?.[0])}\n      <button>Send</button>\n    </Form>\n  );\n});\n```\nFor this example the `fieldErrors` look like this:\n\n```json\n{\n  \"person.name\": \"String must contain at least 2 character(s)\",\n  \"person.email\": \"Invalid email\",\n  \"person.address.street\": \"String must contain at least 2 character(s)\",\n  \"person.address.city\": \"String must contain at least 2 character(s)\",\n  \"person.address.state\": \"String must contain at least 2 character(s)\",\n  \"person.pets[]\": [\n    \"String must contain at least 2 character(s)\"\n  ]\n}\n```\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/content-security-policy/index.mdx",
    "content": "---\ntitle: Content Security Policy | Advanced\ndescription: Learn how to create a content security policy (CSP) to keep your Qwik app safe.\ncontributors:\n  - tzdesign\n  - jordanw66\n  - mrhoodz\n  - the-zimmermann\n  - hamatoyogi\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-06-15T11:45:23Z'\n---\n\n# Content Security Policy\n\n## What is CSP?\n\n[Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft, to site defacement, to malware distribution.\n\n## Steps to integrate\n\nThese steps only work for SSR approach. If you are using the Server Side Generation approach, you don't have an up and running server, so this code will not run during the page request.\n\n### Add a route plugin\n\nTo add the middleware plugin to your application, simply add a file named ```plugin@your-plugin-name.ts``` to the routes folder. \nThis file will be loaded with every request, allowing you to add headers, modify the response, and more.\n\n```bash  {3} /plugin@csp\\.ts/ title=\"Add the plugin\"\nsrc/\n└── routes/\n    ├── plugin@csp.ts         # The plugin which runs on every request (route middleware)\n    ├── contact/\n    │   └── index.mdx         # https://example.com/contact\n    ├── about/\n    │   └── index.md          # https://example.com/about\n    ├── index.mdx             # https://example.com/\n    │\n    └── layout.tsx            # This layout is used for all pages\n```\n\n#### Example\n\n> This template provides very permissive backward-compatible defaults. \n> It is highly recommended that you customize it to better suit your specific use case.\n> As this is an advanced topic, you should take a closer look at [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) or [web.dev](https://web.dev/csp/) to get a better understanding of CSP.\n> Please note that in dev mode the Vite scripts have no nonce and will report. For this reason, the example will not add csp in dev mode.\n\n```typescript title=\"src/routes/plugin@csp.ts\"\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\nimport { isDev } from \"@builder.io/qwik\";\n\nexport const onRequest: RequestHandler = event => {\n  if (isDev) return; // Will not return CSP headers in dev mode\n  const nonce = Date.now().toString(36); // Your custom nonce logic here\n  event.sharedMap.set(\"@nonce\", nonce);\n  const csp = [\n    `default-src 'self' 'unsafe-inline'`,\n    `font-src 'self'`,\n    `img-src 'self' 'unsafe-inline' data:`,\n    `script-src 'self' 'unsafe-inline' https: 'nonce-${nonce}' 'strict-dynamic'`,\n    `style-src 'self' 'unsafe-inline'`,\n    `frame-src 'self' 'nonce-${nonce}'`,\n    `object-src 'none'`,\n    `base-uri 'self'`,\n  ];\n\n  event.headers.set(\"Content-Security-Policy\", csp.join(\"; \"));\n};\n```\n\n### Custom scripts\n\nIf you have custom script tags that you need to add the nonce to, you can use the `useServerData` hook to get the nonce from the server and add it to your script tags.\n\n```tsx {2,5} /nonce/ title=\"src/components/some-component.tsx\"\nexport default component$(() => {\n  const nonce = useServerData<string | undefined>(\"nonce\");\n  return (\n    <div>\n      <script nonce={nonce}>alert(\"Hello world\")</script>\n    </div>\n  );\n});\n```\n\n\n## Validate your CSP\n\nThere is a great tool to validate your CSP: [https://csp-evaluator.withgoogle.com/](https://csp-evaluator.withgoogle.com/)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/menu/index.mdx",
    "content": "---\ntitle: Menu | Advanced\ndescription: How to use menus to define site navigation.\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - the-r3aper7\n  - Oyemade\n  - mhevery\n  - nnelgxorz\n  - jakovljevic-mladen\n  - cunzaizhuyi\n  - AnthonyPAlicea\n  - mrhoodz\n  - hamatoyogi\n  - dejurin\n  - gioboa\n  - jemsco\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Menu\n\nMenus allow you to describe the site navigation structure in a simple declarative way. Menus come in two steps:\n\n1. Defining a `menu.md` file that contains the menu structure for the directory it's in.\n2. Using the [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) function to retrieve the menu structure in a template for rendering. [Read more here](/docs/(qwikcity)/api/index.mdx#usecontent)\n\n## File Structure\n\nFirst layout files as follows:\n\n```bash\nsrc/\n└── routes/\n    └── some/\n        ├── menu.md\n        ├── layout.tsx\n        └── path/\n            └── index.tsx  # https://example.com/some/path\n```\n\nNavigating to `https://example.com/some/path` activates:\n\n- `src/routes/some/path/index.tsx`: This component will be used for rendering the page content.\n- `src/routes/some/layout.tsx`: This layout will be used to provide content around the `src/routes/some/path/index.tsx`. Internally the layout can use `src/routes/some/menu.md` to render the menus.\n- `src/routes/some/menu.md`: This file will be used to declare the menu structure which will be rendered by `src/routes/some/layout.tsx`.\n\n## Declaring Menu Structure\n\nUse `menu.md` to declare the menu structure.\n\n- Use the headings (`#`, `##`, etc..) to define menu depth\n- Use the bulleted list (`-`) to define menu items.\n\n```markdown title=\"src/route/some/menu.md\"\n# Docs\n\n## Getting Started\n\n- [Introduction](introduction/index.md)\n\n## Components\n\n- [Basics](/docs/(qwik)/core/basics/index.mdx)\n```\n\n## Retrieving Menu Structure\n\nAt runtime, any component can retrieve the menu with [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) hook. The type returned is `ContentMenu`.\n\nThe example above will return:\n\n```javascript\n{\n  text: \"Docs\",\n  items: [\n    {\n      text: \"Getting Started\",\n      items: [\n        {\n          text: \"Introduction\",\n          href: \"/docs/introduction\"\n        }\n      ],\n    },\n    {\n      text: \"Components\",\n      items: [\n        {\n          text: \"Basics\",\n          href: \"/docs/(qwik)/core/basics\"\n        }\n      ],\n    },\n  ],\n}\n```\n\n## Using `ContentMenu` in a layout\n\nWhile [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) can be invoked from any component that is part of the current route, it is typically used in a layout component (or a component used by layout) to render the menu. An example usage is shown here:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation, useContent } from '@builder.io/qwik-city';\nexport default component$(() => {\n  const { menu } = useContent();\n  const { url } = useLocation();\n\n  return (\n    <nav class=\"menu\">\n      {menu\n        ? menu.items?.map((item, index) => (\n            <div key={index}>\n              <h5>{item.text}</h5>\n              <ul>\n                {item.items?.map((item, subIndex) => (\n                  <li key={`item-${index}-${subIndex}`}>\n                    <a\n                      href={item.href}\n                      class={{\n                        'is-active': url.pathname === item.href,\n                      }}\n                    >\n                      {item.text}\n                    </a>\n                  </li>\n                ))}\n              </ul>\n            </div>\n          ))\n        : null}\n    </nav>\n  );\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/plugins/index.mdx",
    "content": "---\ntitle: Qwik Plugins | Qwik City\ndescription: Learn about advanced routing in Qwik City, including 404 page handling, grouped layouts, named layouts, nested layouts, and plugin.ts files.\ncontributors:\n  - patrickjs\nupdated_at: '2024-05-05T16:20:00Z'\ncreated_at: '2024-05-05T16:20:00Z'\n---\n\n# Qwik Plugins\nQwik plugins, named as `plugin.ts` or `plugin@<name>.ts`, handle incoming requests prior to root layout execution and are located in the `src/routes` directory. Request handlers like `onRequest`, `onGet`, `onPost` in these plugins are called before `server$` functions. For multiple plugins, `plugin.ts` handlers execute first, followed by `plugin@<name>.ts` handlers in alphabetical order. Middleware functions should be defined in `plugin.ts` to ensure execution for all requests.\n\n### The order of execution of `plugin.ts` files\n\n If `plugin.ts` file exists and if it has exported request handlers, then they are executed first.\n\nThen exported request handlers from `plugin@<name>.ts` files are executed in alphabetical order of the file names. For example, `onGet` from `plugin@auth.ts` is executed before `onGet` from `plugin@security.ts` because `auth` is alphabetically before `security`.\n\nFinally, if a `server$` function exists, it's executed last.\n\n## Middleware and `server$`\n\nWhen using `server$`, it's important to understand how [middleware functions](/docs/middleware/#middleware-function) are executed. Middleware functions defined in `layout` files do not run for `server$` requests. This can lead to confusion, especially when developers expect certain middleware to be executed for both page requests and `server$` requests.\n\nTo ensure that a middleware function runs for both types of requests, it should be defined in the `plugin.ts` file. This ensures that the middleware is executed consistently for all incoming requests, regardless of whether they are normal page requests or `server$` requests.\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/request-handling/index.mdx",
    "content": "---\ntitle: Request Handling | Advanced\ndescription: How to handle requests in Qwik City, including REST endpoints, and middlewares.\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - tzdesign\n  - mrhoodz\n  - hamatoyogi\n  - jemsco\nupdated_at: '2023-07-01T18:35:24Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Request Handling\n\nEach `layout.ts` and `index.ts` file inside the `src/routes` directory has the ability to access the current HTTP request, response, and URL. This allows you to retrieve and modify data, and even respond with custom content.\n\nQwik City implements a middleware system based on the hierarchy of the `src/routes` directory. The middleware system is used to handle HTTP requests and responses and is available to pages, layouts, and [endpoints](/docs/(qwikcity)/endpoints/index.mdx).\n\nEach route can add HTTP request and response handlers, allowing developers to retrieve and modify data. The handlers can also be used by [endpoints](/docs/(qwikcity)/endpoints/index.mdx), which only respond with data rather than a page's HTML.\n\nThis feature enables you to handle any request event, have side effects on the request pipeline, just before you render the component and respond with custom content. It is available to pages, layouts and endpoint routes, but not on regular components.\n\n## Request and Response Handlers\n\nOn pages, layouts, and [endpoints](/docs/(qwikcity)/endpoints/index.mdx), we can access request data by implementing request handler functions such as `onGet`, `onPost`, `onPut`, etc. These functions are executed according to the [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) used for this route.\n\nAdditionally, an `onRequest` function can be used to handle any request method, rather than a specific one, in the form of a [middleware](/docs/(qwikcity)/middleware/index.mdx). For example, if both `onGet` and `onRequest` is provided, for a `GET` request, the `onGet` will be called. However, in this scenario, if a `POST` request method came in, then the `onRequest` handler would be called since an `onPost` was not provided.\nThe `onRequest` is available as a catch-all to any request methods that do not have a specific method.\n\n```tsx\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler<ProductData> = async ({ params }) => {\n  // put your DB access here (hard coding data for simplicity)\n  return {\n    skuId: params.skuId,\n    price: 123.45,\n    description: `Description for ${params.skuId}`,\n  };\n};\n```\n\n## Request Event\n\nThe request handler functions receive a `RequestEvent` argument which has the following properties:\n\n| Field      | Description                                                                   |\n| ---------- | ----------------------------------------------------------------------------- |\n| `request`  | The request object                                                            |\n| `response` | The response object, which can be used to set response `headers` and `status` |\n| `url`      | URL which includes `pathname`, `hostname`, etc.                               |\n| `next`     | Next middleware function                                                      |\n| `abort`    | Request abort function                                                        |\n| `params`   | Custom user params found within the URL                                       |\n| `cookie`   | Get and set cookies.                                                          |\n| `platform` | Platform data object (useful for Cloudflare, Netlify, etc)                    |\n\n### Cookie\n\n```tsx\ninterface Cookie {\n  get: (key: string) => CookieValue | null;\n  set: (key: string, value: string | number | Record<string, any>, options?: CookieOptions) => void;\n  delete: (key: string) => void;\n  has: (key: string) => boolean;\n}\n```\n\n**get**\nTakes a string with the cookie name and returns the `CookieValue`, if present and null if not.\n\n```tsx\ninterface CookieValue {\n  value: string;\n  json: <T = unknown>() => T;\n  number: () => number;\n}\n```\n\nA cookie value is a simple record with three fields:\n\n1. `value`: Contains the cookie value as a string\n2. `json()`: Runs `JSON.parse()` on the value and returns the result\n3. `number()`: Runs `Number()` on the value and returns the result\n\n**getAll**\nReturns an object with all cookies, if any. _This is sometimes required if the names of cookies are unknown and must be parsed through._\n\n**set**\nTakes a key and value and creates a header that will be appended to the response. Value can be a `string | number | Record<string, any>`\n\nAs a third argument, you can optionally provide a `CookieOptions` record for setting additional fields.\n\n```tsx\nexport interface CookieOptions {\n  domain?: string;\n  expires?: Date | string;\n  httpOnly?: boolean;\n  maxAge?: number | [number, 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks'];\n  path?: string;\n  sameSite?: 'lax' | 'none' | 'strict';\n  secure?: boolean;\n}\n```\n\nFor more information on these attributes and their values, please refer to [the MDN article on the Set-Cookie header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes).\n\n**delete**\nAppends a header with the provided key to the cookie. The new header will have an expired date in the `expires` field, telling the browsers to remove it.\n\n```tsx\ncookie.delete('my-cookie');\n// equivalent to\ncookie.set('my-cookie', 'deleted', new Date(0));\n// or\ncookie.set('my-cookie', '');\n```\n\nOptionally, you can set the path, sameSite and/or domain when deleting the cookie. If your cookie was created with a path/domain, you must set these fields for the deletion to take effect.\n\n```tsx\ncookie.delete('my-cookie', { domain: 'https://qwik.dev', path: '/docs/' });\n```\n\n**has**\nA convenience method which returns true or false based on the presence of the provided key in cookie.\n\n```tsx\ncookie.has('my-cookie');\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/routing/index.mdx",
    "content": "---\ntitle: Advanced Routing | Qwik City\ndescription: Learn about advanced routing in Qwik City, including 404 page handling, grouped layouts, named layouts, nested layouts, and plugin.ts files.\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - cunzaizhuyi\n  - the-r3aper7\n  - mhevery\n  - jakovljevic-mladen\n  - vfshera\n  - thejackshelton\n  - wtlin1228\n  - hamatoyogi\n  - jemsco\n  - patrickjs\nupdated_at: '2023-10-05T21:23:14Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Advanced Routing\n\n## 404 Page Handling\n\nIt's possible for any user to visit a URL that doesn't exist on your site. For example, if a user visits `https://example.com/does-not-exist`, then the server should respond with a [404 HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404), and the page should have at least some sort of explanation, rather than just a blank page.\n\nFor any given route, Qwik City can choose how to best handle the 404 response for the user, whether it's with the default 404 page, a custom 404 page, or a dynamically generated 404 page.\n\n### Default 404 Page\n\nRather than showing a blank page, by default Qwik City provides a generic 404 page for any route that isn't handled. The default 404 page is rendered as a fallback when a custom 404 page was not found. We recommend providing a custom 404 page for a better user experience. Including the common header and navigation in a custom 404 page would help the user find the page they're looking for.\n\n### Custom 404 Page\n\nInstead of showing the generic (boring) 404 response, it's possible to provide a custom 404 page using the same familiar layouts as the rest of your site.\n\nTo create a custom 404 page, add a `404.tsx` file to the root `src/routes` directory.\n\n```bash\nsrc/\n└── routes/\n    ├── 404.tsx            # Custom 404\n    ├── layout.tsx         # Default layout\n    └── index.tsx          # https://example.com/\n```\n\nIn the example above, the `404.tsx` page will also use the `layout.tsx` layout, since it is a sibling of the layout in the same directory.\n\nAdditionally, using Qwik City's directory-based routing allows for custom 404 pages to be created at different paths. For example, if `src/routes/account/404.tsx` was also added to the structure, then the custom account 404 page would only be applied to the `/account/*` routes, while all other 404s would use the root `404.tsx` page.\n\n> Note: During development and in preview mode, the custom 404 pages will not be rendered, but instead the default Qwik City 404 page will show. However, when building the app for production, the custom 404 page will be statically generated as a static `404.html` file.\n\n```bash\nsrc/\n└── routes/\n    ├── account/\n    │   └── 404.tsx        # Custom Account 404\n    │   └── index.tsx      # https://example.com/account/\n    ├── 404.tsx            # Custom 404\n    ├── layout.tsx         # Default layout\n    └── index.tsx          # https://example.com/\n```\n\nIt's worth noting that custom 404 pages are statically generated at build time, resulting in a static 404.html file, rather than individually server-side rendered pages. This strategy reduces the load on your HTTP server, avoiding server-side rendering of 404 pages, and thus preserving resources.\n\n### Dynamic 404 Page\n\nWhen rendering a page, the default is to always respond with a [200 HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200), which tells the browser all is good and the route exists. However, it's also possible to handle rendering the page, but manually setting the response status code to something other than 200, such as 404.\n\nFor example, let's say we have a product page with a URL such as `https://example.com/product/abc`. The product page would be handled using `src/routes/product/[id]/index.tsx` directory-based route, and `[id]` is a dynamic param in the URL.\n\nIn this example, `id` is used as a key to load the product data from the database. When the product data is found, great, we'll correctly render data. However, if the product data is not found in the database, we can still handle rendering the page, but instead respond with a 404 HTTP status code.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useProductLoader = routeLoader$(async ({ params, status }) => {\n  // Example database call using the id param\n  // The database could return null if the product is not found\n  const data = await productDatabase.get(params.id);\n\n  if (!data) {\n    // Product data was not found\n    // Set the status code to 404\n    status(404);\n  }\n\n  // return the data (which may be null)\n  return data;\n});\n\nexport default component$(() => {\n  // get the product data from the loader\n  const product = useProductLoader();\n\n  if (!product.value) {\n    // no product data found\n    // so render our own custom product 404\n    return <p>Sorry, looks like we don't have this product.</p>;\n  }\n\n  // product data was found, so let's render it\n  return (\n    <div>\n      <h1>{product.value.name}</h1>\n      <p>{product.value.price}</p>\n      <p>{product.value.description}</p>\n    </div>\n  );\n});\n```\n\n## Grouped Layouts\n\nCommon purpose routes are often placed into directories so they can share layouts, and so related source files are logically grouped next to each other. However, it may be desirable that the directory, which was used to group similar files and share layouts, is excluded from the public-facing URL. This is where \"grouped\" layouts come in (also referred to as a \"pathless\" layout route).\n\nBy surrounding any directory name with parentheses, such as `(name)`, then the directory name itself will not be included in the URL pathname.\n\nFor example, let's say an app placed all _account_ routes together in a directory.  `/account/` could be dropped from the URL for cleaner, shorter URLs. In the example below, notice that the paths are within the `src/routes/(account)/` directory, but the URL paths exclude `(account)/`.\n\n```bash\nsrc/\n└── routes/\n    └── (account)/             # Notice the parentheses\n        ├── layout.tsx         # Shared account layout\n        └── profile/\n            └── index.tsx      # https://example.com/profile\n        └── settings/\n            └── index.tsx      # https://example.com/settings\n```\n\n## Named Layout\n\nAt times related routes need to have drastically different layouts from their siblings. It is possible to define multiple layouts for different sibling routes by using a single default layout and any number of named layouts. The child route can then request a specific named-layout.\n\nQwik City defines the convention that layouts are within `src/routes` and the filename starts with `layout`. That's why the default layout is named `layout.tsx`. A named layout also starts with `layout` followed by a dash `-` and a unique name, such as `layout-narrow.tsx`.\n\nTo reference a named layout, the route's `index.tsx` file must be suffixed with `@<name>`. For example, `index@narrow.tsx` would use the `layout-narrow.tsx` layout.\n\n```bash\nsrc/\n└── routes/\n    ├── contact/\n    │   └── index@narrow.tsx      # https://example.com/contact (Layout: layout-narrow.tsx)\n    ├── layout.tsx                # Default layout\n    ├── layout-narrow.tsx         # Named layout\n    └── index.tsx                 # https://example.com/ (Layout: layout.tsx)\n```\n\n- `https://example.com/`\n  ```\n  ┌──────────────────────────────────────────────────┐\n  │       src/routes/layout.tsx                      │\n  │  ┌────────────────────────────────────────────┐  │\n  │  │    src/routes/index.tsx                    │  │\n  │  │                                            │  │\n  │  └────────────────────────────────────────────┘  │\n  │                                                  │\n  └──────────────────────────────────────────────────┘\n  ```\n- `https://example.com/contact`\n  ```\n  ┌──────────────────────────────────────────────────┐\n  │       src/routes/layout-narrow.tsx               │\n  │  ┌────────────────────────────────────────────┐  │\n  │  │    src/routes/contact/index@narrow.tsx     │  │\n  │  │                                            │  │\n  │  └────────────────────────────────────────────┘  │\n  │                                                  │\n  └──────────────────────────────────────────────────┘\n  ```\n\n## Nested Layout\n\nMost times it is desirable to nest layouts within each other. A page's content can be nested in numerous wrapping layouts, which is determined by the directory structure.\n\n```bash\nsrc/\n└── routes/\n    ├── layout.tsx           # Parent layout\n    └── about/\n        ├── layout.tsx       # Child layout\n        └── index.tsx        # https://example.com/about\n```\n\nIn the above example, there are two layouts that apply themselves around the `/about` page component.\n\n1. `src/routes/layout.tsx`\n2. `src/routes/about/layout.tsx`\n\nIn this case, the layouts will be nested within each other on the page.\n\n```\n┌────────────────────────────────────────────────┐\n│       src/routes/layout.tsx                    │\n│  ┌──────────────────────────────────────────┐  │\n│  │    src/routes/about/layout.tsx           │  │\n│  │  ┌────────────────────────────────────┐  │  │\n│  │  │ src/routes/about/index.tsx         │  │  │\n│  │  │                                    │  │  │\n│  │  └────────────────────────────────────┘  │  │\n│  │                                          │  │\n│  └──────────────────────────────────────────┘  │\n│                                                │\n└────────────────────────────────────────────────┘\n```\n\n```tsx title=\"src/routes/layout.tsx\"\nimport { component$, Slot } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      <Slot /> {/* <== Child layout/route inserted here */}\n    </main>\n  );\n});\n```\n\n```tsx title=\"src/routes/about/layout.tsx\"\nimport { component$, Slot } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <section>\n      <Slot /> {/* <== Child layout/route inserted here */}\n    </section>\n  );\n});\n```\n\n```tsx title=\"src/routes/about/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>About</h1>;\n});\n```\n\nThe above example would render the html:\n\n```html\n<main>\n  <section>\n    <h1>About</h1>\n  </section>\n</main>\n```\n\n## Plugin with `plugin@` -> `plugin@<name>.ts`\n\n`plugin.ts` and `plugin@<name>.ts` files can be created in the root of the `src/routes` directory to handle any incoming request before even the root layout executes.\n\nYou can have multiple `plugin.ts` files, each with a different name. For example, `plugin@auth.ts` and `plugin@security.ts`. The `@<name>` is optional and it's only used for developers to help identify the plugin.\n\nRequests handlers like `onRequest`, `onGet`, `onPost`, etc. are called before `server$` functions are executed.\n\n### The order of execution of `plugin.ts` files\n\n If `plugin.ts` file exists and if it has exported request handlers, then they are executed first.\n\nThen exported request handlers from `plugin@<name>.ts` files are executed in alphabetical order of the file names. For example, `onGet` from `plugin@auth.ts` is executed before `onGet` from `plugin@security.ts` because `auth` is alphabetically before `security`.\n\nFinally, if a `server$` function exists, it's executed last.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/sitemaps/index.mdx",
    "content": "---\ntitle: Generating Sitemaps | Advanced\ndescription: Learn how to generate a sitemap for your site in Qwik City.\ncontributors:\n  - adamdbradley\n  - hbendev\n  - mrhoodz\n  - thejackshelton\n  - hamatoyogi\n  - devweb13\nupdated_at: '2023-07-07T09:31:48Z'\ncreated_at: '2023-04-24T19:40:27Z'\n---\n\n# Generating Sitemaps\n\n## Generating Sitemaps in SSG\n\nBy default, when Static Site Generated (SSG) pages are built, a [sitemap](https://en.wikipedia.org/wiki/Sitemaps) is generated for the site. The `sitemap.xml` is automatically generated based on the pages that were built. This means that if you have a page that is not built, it will not be included in the sitemap.\n\n### Configuration\n\nThe sitemap can be configured using the adapter's vite config file. The example below is configuring the Cloudflare adapter. The default sitemap file path is `sitemap.xml`, but you can use the `sitemapOutFile` option to change the file path. \n\n```ts\n  plugins: [\n    cloudflarePagesAdapter({\n      ssg: {\n        include: ['/*'],\n        origin: 'https://qwik.dev',\n        sitemapOutFile: 'sitemap.xml',\n      },\n    }),\n  ]\n```\n\nThe `include` option is used to specify which pages should be built, which also adds them to the sitemap. Any pages added to the `exclude` option will also exclude them from the sitemap. \n\nThe `origin` option is used to specify the origin of the site and is used to generate the absolute URLs for the sitemap.\n\n### robots.txt\n\nDepending on your site setup, you'll probably want to add a [robots.txt](https://en.wikipedia.org/wiki/Robots.txt) file to your site. This can be done by adding a `robots.txt` file to the `public` directory. Any file in the `public` directory is treated as a static file and deploy alongside the build. The following is an example of a `public/robots.txt` file:\n\n```bash\nUser-agent: *\nAllow: /\n\nSitemap: https://<YOUR_HOSTNAME>/sitemap.xml\n```\n\nNote the added `Sitemap` directive to the `robots.txt` file which tells search engines where to find the sitemap for your site. Be sure to replace `<YOUR_HOSTNAME>` with the hostname of your site.\n\n## Generating Dynamic Sitemaps in SSR\n\nIn addition to generating sitemaps for Static Site Generation (SSG), you can also generate sitemaps dynamically with Server-Side Rendering (SSR). This is useful if your site has content that is not known at build time or is frequently updated.\n\nTo generate a dynamic sitemap in SSR, you can create a route that serves a `dynamic-sitemap.xml` file based on your site’s routes and other dynamic content. Below is an example of how to set this up.\n\n### Create a Sitemap Function\n\nFirst, create a function that generates the sitemap XML based on the routes you want to include. You can create this function in a file such as `src/routes/dynamic-sitemap.xml/create-sitemap.ts`:\n\n```typescript\n// src/routes/dynamic-sitemap.xml/create-sitemap.ts\n\nexport interface SitemapEntry {\n  loc: string;\n  priority: number;\n}\n\nexport function createSitemap(entries: SitemapEntry[]) {\n  const baseUrl = \"https://<YOUR_HOSTNAME>\";\n\n  return `\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n${entries.map(\n  (entry) => `\n    <url>\n        <loc>${baseUrl}${entry.loc.startsWith(\"/\") ? \"\" : \"/\"}${entry.loc}</loc>\n        <priority>${entry.priority}</priority>\n    </url>`,\n)}\n</urlset>`.trim();\n}\n```\n\n### Set Up a Route for the Dynamic Sitemap\n\nNext, set up a route that will use the sitemap function to generate the sitemap dynamically. Create a file like src/routes/dynamic-sitemap.xml/index.tsx:\n\n```tsx\n// src/routes/dynamic-sitemap.xml/index.tsx\n\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\nimport { routes } from \"@qwik-city-plan\";\nimport { createSitemap } from \"./create-sitemap\";\n\nexport const onGet: RequestHandler = (ev) => {\n  const siteRoutes = routes\n    .map(([route]) => route as string)\n    .filter(route => route !== \"/\");  // Exclude the '/' route\n\n  const sitemap = createSitemap([\n    { loc: \"/\", priority: 1 },  // Manually include the root route\n    ...siteRoutes.map((route) => ({\n      loc: route,\n      priority: 0.9,  // Default priority, adjust as needed\n    })),\n  ]);\n\n  const response = new Response(sitemap, {\n    status: 200,\n    headers: { \"Content-Type\": \"text/xml\" },\n  });\n\n  ev.send(response);\n};\n```\n\nThis route dynamically creates the sitemap XML based on the routes in your Qwik City application.\n\n### robots.txt\n\nTo ensure that search engines know where to find your dynamic sitemap, you should also add or update your robots.txt file. Add the following line to your robots.txt file, which is typically located in your public directory:\n\n\n```bash\nUser-agent: *\nAllow: /\n\n# Uncomment the following line and replace <unindexedFolder> with the actual folder name you want to disallow\n# Disallow: /<unindexedFolder>/\n\nSitemap: https://<YOUR_HOSTNAME>/dynamic-sitemap.xml\n```\n\nBe sure to replace `<YOUR_HOSTNAME>` with your actual site URL.\n\nThis setup will dynamically generate and serve a dynamic.sitemap.xml whenever it is requested, keeping it up to date with the latest routes and changes to your site.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx",
    "content": "---\ntitle: Speculative Module Fetching | Advanced\ndescription: Learn how Qwik handles loading bundles in the background and filling the cache with Speculative Module Fetching.\ncontributors:\n  - ulic75\n  - mhevery\n  - adamdbradley\n  - hamatoyogi\n  - manucorporat\n  - mrhoodz\n  - thejackshelton\n  - zanettin\n  - wtlin1228\n  - aendel\n  - jemsco\n  - wmertens\nupdated_at: '2025-03-25T12:00:00Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Speculative Module Fetching\n\nQwik is able to load a page and become interactive extremely fast due to its ability to startup _without_ JavaScript. In addition to this, Speculative Module Fetching is a powerful feature that allows Qwik to pre-populate the browser's cache in a background thread.\n\nQwik's goal is to optimize loading by caching only the necessary parts of the application based on potential user interactions. It avoids loading unnecessary bundles by understanding which interactions are not possible.\n\n### Pre-populating the Cache\n\nEach page load will pre-populate the cache with bundles that _could_ be executed on the page by the user at that moment. For example, let's say that the page has a click listener on a button. When the page loads, the Qwik's first job is to ensure the code for that click listener is already in the [browser's cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache). When the user clicks the button, Qwik makes a request to the event listener's function and any code dependencies to execute that function. This might include importing other modules.\n\nThe initial page load prepares the cache for the next probable interaction and also downloads other necessary code incrementally. When a follow-up interaction happens, such as opening a modal or menu, Qwik will ask the browser to preload the code for that interaction. Pre-populating the cache happens continuously as users interact with the application.\n\n### Reducing Network Waterfalls\n\nA network waterfall occurs when multiple requests are made sequentially, one after another. This sequential process can degrade performance significantly since the time to download all necessary modules is extended, compared to a scenario where all modules begin downloading at the same time in parallel.\n\nBelow is an example with three modules: A, B and C. Module A imports B, and B imports C. The HTML document is what starts the waterfall by first requesting Module A.\n\n```ts\nimport './b.js';\nconsole.log('Module A');\n```\n\n```ts\nimport './c.js';\nconsole.log('Module B');\n```\n\n```ts\nconsole.log('Module C');\n```\n\n```html\n<script type=\"module\" src=\"./a.js\"></script>\n```\n\nIn this example, when Module `A` is first requested, the browser has no idea that it should also start requesting Module `B` and `C`. It doesn't even know it needs to start requesting Module `B`, until AFTER Module `A` has finished downloading. It's a common problem in that the browser doesn't know ahead of time what it should start to request, until after each module has finished downloading.\n\nHowever, Qwik knows the module graph and controls QRL segment loading, we do know all of the modules which _will_ be requested next. So when Qwik sees that it will require a module, it will tell the browser to preload it and all of its dependencies.\n\n### Details\n\nThe Qwik build process generates a `q-manifest.json` file. The `q-manifest.json` includes a detailed module graph of how bundles are associated and which symbols are within each bundle.\n\nThis is then further used to generate the `build/q-bundle-graph-xyz.json` file, which is a compact representation of the module graph, including probabilities of which bundlers are more likely to be requested next given a certain bundle has loaded, and is loaded by Qwik to preload QRL segment loading.\n\nQwik-City also injects all routes with their dependencies into this bundlegraph file.\n\nWhen a container resumes, it will fetch the bundlegraph file (probably from the cache) and use it to prefetch modules needed for event handlers and routes.\n\nStatic imports are preloaded with high priority, and dynamic imports are preloaded with low priority. The browser will decide when to download the modules.\n\nThe preloading happens with the `_preload` function, which is an internal Qwik API. It works by traversing the bundlegraph and adding `<link rel=\"modulepreload\">` tags for each bundle that is likely to be requested next.\n\n## During Development\n\nSpeculative module fetching only really works in preview or on a production build. In development, we don't have the bundle graph available, so we can't prevent waterfalls from happening. However, we do ask the browser to preload the bundles that are most likely to be requested after SSR.\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/advanced/static-assets/index.mdx",
    "content": "---\ntitle: Static Assets | Advanced\ndescription: How to serve static assets in your Qwik app.\ncontributors:\n  - manucorporat\n  - Oyemade\n  - mhevery\n  - adamdbradley\n  - the-r3aper7\n  - mrhoodz\n  - thejackshelton\n  - hamatoyogi\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Static Assets\n\nUse the `/public` folder to store all static assets such as images, fonts, etc.\n\nAll static assets are served from your server's root (`/` as in `https://example.com/`) folder and superimposed under your routes (routes have priority).\n\n```bash\npublic/\n├── favicon.ico           # https://example.com/favicon.ico\n└── images/\n    └── logo.png          # https://example.com/images/logo.png\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/api/index.mdx",
    "content": "---\ntitle: API Reference | Qwik City\ndescription: Qwik City API reference.\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - the-r3aper7\n  - nnelgxorz\n  - cunzaizhuyi\n  - jakovljevic-mladen\n  - barbosajlm\n  - Eucer\n  - eltociear\n  - literalpie\n  - Mhmdrza\n  - ulic75\n  - mhevery\n  - jordanw66\n  - igorbabko\n  - mrhoodz\n  - VinuB-Dev\n  - billykwok\n  - julianobrasil\n  - hamatoyogi\n  - srapport\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# API reference\n\n## `useContent()`\n\nThe [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) function retrieves the nearest content information for the current route. The returned object includes:\n\n```ts\nheadings: ContentHeading[] | undefined;\nmenu: ContentMenu | undefined;\n```\n\nThe `headings` array includes data about a markdown file's `<h1>` to `<h6>` [html heading elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements).\n\nMenus are contextual data declared with `menu.md` files. See [menus file definition](/docs/(qwikcity)/advanced/menu/index.mdx) for more information on the file format and location.\n\n## `useDocumentHead()`\n\nUse the `useDocumentHead()` function to read the document [head metadata](/docs/(qwikcity)/pages/index.mdx#head-export).\n\n`useDocumentHead()` retrieves a readonly `DocumentHead` object that includes:\n\n```ts\nexport interface DocumentHead {\n  /**\n   * Represents the `<title>` element of the document.\n   */\n  readonly title?: string;\n  /**\n   * Used to manually set meta tags in the head. Additionally, the `data`\n   * property could be used to set arbitrary data which the `<head>` component\n   * could later use to generate `<meta>` tags.\n   */\n  readonly meta?: readonly DocumentMeta[];\n  /**\n   * Used to manually append `<link>` elements to the `<head>`.\n   */\n  readonly links?: readonly DocumentLink[];\n  /**\n   * Used to manually append `<style>` elements to the `<head>`.\n   */\n  readonly styles?: readonly DocumentStyle[];\n  /**\n   * Arbitrary object containing custom data. When the document head is created from\n   * markdown files, the frontmatter attributes that are not recognized as a well-known\n   * meta names (such as title, description, author, etc...), are stored in this property.\n   */\n  readonly frontmatter?: Readonly<Record<string, any>>;\n}\n```\n\nAll starters include a `<RouterHead>` component that is responsible for generating the `<head>` element of the document. It uses the `useDocumentHead()` function to retrieve the current head metadata and render the appropriate `<meta>`, `<link>`, `<style>` and `<title>` elements.\n\n```tsx title=\"src/components/router-head/router-head.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { useDocumentHead } from '@builder.io/qwik-city';\n\n/**\n * The RouterHead component is placed inside of the document `<head>` element.\n */\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n\n      {head.meta.map((m) => (\n        <meta {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link {...l} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style {...s.props} dangerouslySetInnerHTML={s.style} />\n      ))}\n    </>\n  );\n});\n```\n\n## `useLocation()`\n\nUse the [`useLocation()`](/docs/(qwikcity)/api/index.mdx#uselocation) function to retrieve a `RouteLocation` object for the current location.\n\nThe `useLocation()` function provides the current URL and params. It also determines if the app is currently navigating, which is useful for showing a loading indicator.\n\n```tsx\nexport interface RouteLocation {\n  /**\n   * Route params extracted from the URL.\n   */\n  readonly params: Record<string, string>;\n  /**\n   * The current URL.\n   */\n  readonly url: URL;\n  /**\n   * True if the app is currently navigating.\n   */\n  readonly isNavigating: boolean;\n}\n```\n\nThe return value of [`useLocation()`](/docs/(qwikcity)/api/index.mdx#uselocation) is similar to `document.location`, but it is safe to use on the server where there is no global `location` object, and it's reactive so it can be tracked.\n\n### Path Route Parameters\n\n`useLocation()` encodes the [Route Parameters](/docs/(qwikcity)/routing/index.mdx) as params.\n\nAssume you have:\n\n- File: `src/routes/sku/[skuId]/index.tsx`\n- User navigates to: `https://example.com/sku/1234`\n- Then the `skuId` can be retrieved through `useLocation().params.skuId`\n\n```tsx /useLocation/ title=\"src/routes/sku/[skuId]/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation();\n\n  return (\n    <>\n      <h1>SKU</h1>\n      {loc.isNavigating && <p>Loading...</p>}\n      <p>pathname: {loc.url.pathname}</p>\n      <p>skuId: {loc.params.skuId}</p>\n    </>\n  );\n});\n```\n\nThe above code would generate:\n\n```html\n<h1>SKU</h1>\n<p>pathname: /sku/1234/</p>\n<p>skuId: 1234</p>\n```\n\n### `useLocation` in `root.tsx` is not supported\n\nTo access the current url from `root.tsx` use this pattern:\n```ts\nconst serverDataUrl = useServerData<string>('url');\nconst url = new URL(serverDataUrl || 'https://unknown');\n```\n\n> Notice that `useLocation` is a read-only API, you should never attempt to mutate the values of the `loc` object returned. Instead look into the `useNavigate()` API.\n\n## `useNavigate()`\n\nThe `useNavigate()` hook returns a function that programmatically navigates to the next page without requiring a user click or causing a full-page reload. This function can be called with a string argument to \"push\" a new path, or without arguments to cause an SPA refresh of the page. This is the API used by the `<Link>` component internally to support SPA navigation.\n\n```tsx {12,21} /useNavigate/\nimport { component$ } from '@builder.io/qwik';\nimport { useNavigate } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const nav = useNavigate();\n\n  return (\n    <>\n      <button\n        onClick$={async () => {\n          // SPA navigate to /dashboard\n          await nav('/dashboard');\n        }}\n      >\n        Go to dashboard\n      </button>\n\n      <button\n        onClick$={async() => {\n          // refresh page: call without arguments\n          await nav();\n        }}\n      >\n        Refresh page\n      </button>\n    </>\n  );\n});\n```\n\nThis component has a button that when clicked, will navigate to `/dashboard` without causing a page reload.\n\n> Notice that for SEO, and accessibility it's better to use the `<Link>` component instead of `useNavigate()` programmatically to navigate to a new page after some user interaction.\n\n### Going back\n\nTo programmatically navigate back to the previous page, use the useNavigate and useLocation hooks.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useNavigate, useLocation } from '@builder.io/qwik-city';\n\nexport const BackButton = component$(() => {\n  const nav = useNavigate();\n  const loc = useLocation();\n\n  return (\n    <button onClick$={() => loc.prevUrl ? window.history.back() : nav('/')}>\n      Go Back\n    </button>\n  );\n});\n\n```\n\nThe fallback in the nav function ensures that if the previous URL (loc.prevUrl) is not available, the user is redirected to a default path (eg. the root path /). This is useful in scenarios where the navigation history might not include a previous URL, such as when the user directly lands on a specific page without navigating from another page within the app.\n\n> Notice that the **loc.prevUrl** is only available when the user navigates to a page using the [`useNavigate()`](#usenavigate) or [`<Link>`](/docs/cookbook/nav-link). It is not available when the user navigates to a page using [`the anchor element`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a).\n\n\n## `routeLoader$()`\n\nThe `routeLoader$()` function is used to declare a new Server Loader in the given page/middleware or layout. Qwik City will execute all the declared loaders for the given route match. Qwik Components can later reference the loaders by importing them and calling the returned custom hook function in order to retrieve the data.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useGetTime = routeLoader$(async () => {\n  return { time: new Date() }\n});\nexport default component$(() => {\n  const signal = useGetTime(); // Signal<{time: Date}>\n  console.log('Date': signal.value.time);\n  return (\n    <div>{signal.value.time.toISOString()}</div>\n  )\n});\n```\n\nPlease refer to the [Route Loader](/docs/(qwikcity)/route-loader/index.mdx) section for more information.\n\n## `routeAction$()`\n\nThe `routeAction$()` function is used to declare a new Server Action in the given page/middleware or layout. Qwik City will execute only the invoked action after some user interaction (such as a button click or a form submission).\n\nPlease refer to the [Server Actions](/docs/(qwikcity)/action/index.mdx) section for more information.\n\n## List all routes with qwikCityPlan.routes\n\nThe `qwikCityPlan.routes` property is used to retrieve the route list of your application.\n\n```tsx\nimport qwikCityPlan from '@qwik-city-plan';\n\nconst routes = qwikCityPlan.routes;\nfor (const route of routes) {\n\t// your logic here\n}\n```\n\n## `<QwikCityProvider>`\n\nThe `QwikCityProvider` component initializes Qwik City in the existing document, providing the necessary context for Qwik City to work, such as [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) and `useLocation()`.\n\nThis component is usually located at the very root of your application. In most of the starters, you will find it in the `src/root.tsx` file:\n\n```tsx title=\"src/root.tsx\"\nexport default component$(() => {\n  /**\n   * The root of a QwikCity site always start with the <QwikCityProvider> component,\n   * immediately followed by the document's <head> and <body>.\n   *\n   * Don't remove the `<head>` and `<body>` elements.\n   */\n\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charSet=\"utf-8\" />\n        <link rel=\"manifest\" href=\"/manifest.json\" />\n        <RouterHead />\n      </head>\n      <body lang=\"en\">\n        <RouterOutlet />\n      </body>\n    </QwikCityProvider>\n  );\n});\n```\n\n> `QwikCityProvider` does not render any DOM element, not even the matched route. It merely initializes Qwik City core logic so it should not be used more than once in the same app.\n\n\n## `<QwikCityMockProvider>`\n\nThe `QwikCityMockProvider` component initializes a Qwik City context for testing. It provides the necessary context for Qwik City code to work in tests, such as [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent). Vice versa for `useNavigate()`, `<Link>`, `useLocation()` and so on.\nIt is recommended that you use this in your test files.\n\n> `QwikCityMockProvider` does not render any DOM elements, meaning it won't be visible in snapshots\n\nIf you are looking for a general example on how to integrate vitest into your Qwik look checkout the [vitest integration documentation](/docs/integrations/vitest/index.mdx)\n\n```tsx title=\"src/components/card.spec.tsx\"\nimport { createDOM } from '@builder.io/qwik/testing';\nimport { QwikCityMockProvider } from '@builder.io/qwik-city';\nimport { test, expect } from 'vitest';\n\n// Component with two props. Uses <Link> internally. Omitted for brevity\nimport { Card } from './card';\n\nconst cases = [\n  {text: 'qwik', link:'https://qwik.dev/docs/api'}, \n  {text: 'vitest', link: 'https://vitest.dev'}\n];\n\ntest.each(cases)('should render card with %s %s', async ({text, link}) => {\n  const { screen, render } = await createDOM();\n  await render(\n    <QwikCityMockProvider>\n      <Card text={text} link={link} />\n    </QwikCityMockProvider>,\n  );\n  expect(screen.innerHTML).toMatchSnapshot();\n});\n```\n\n> A `goto` prop can be passed to customize the `navigate` behavior during tests\n\n```tsx title=\"src/components/button.spec.tsx\"\nimport { $ } from '@builder.io/qwik';\nimport { createDOM } from '@builder.io/qwik/testing';\nimport { test, expect, vi } from 'vitest';\n\n// Component with one prop. Uses useNavigate internally. Omitted for brevity\nimport { Button } from '../button';\n\nconst goto = vi.fn(async (path, options) => {\n  console.log(`Navigating to ${path} with ${options}`);\n});\n\ntest('should render the button and navigate', async () => {\n  const { screen, render, userEvent } = await createDOM();\n  const goto$ = $(goto);\n  await render(\n    <QwikCityMockProvider goto={goto$}>\n      <Button id=\"button\" />\n    </QwikCityMockProvider>,\n  );\n  expect(screen.innerHTML).toMatchSnapshot();\n  await userEvent('#button', 'click');\n  expect(goto).toHaveBeenCalled();\n});\n```\n\n> If you are using `routeLoader$`s in a Qwik Component that you want to test, you can provide a `loaders` prop to mock the data returned by the loaders\n\n```ts title=\"src/loaders/product.loader.ts\"\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useProductData = routeLoader$(async () => {\n  const res = await fetch('https://.../product');\n  const product = (await res.json()) as Product;\n  return product;\n});\n```\n\n```tsx title=\"src/components/product.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\nimport { useProductData } from '../loaders/product.loader';\n\nexport const Footer = component$(() => {\n  const signal = useProductData();\n  return <footer>Product name: {signal.value.product.name}</footer>;\n});\n```\n\n```tsx title=\"src/components/product.spec.tsx\"\nimport { createDOM } from '@builder.io/qwik/testing';\nimport { test, expect } from 'vitest';\n\nimport { Footer } from './product';\nimport { useProductData } from '../loaders/product.loader';\n\ntest('should render footer with product name', async () => {\n  const { screen, render } = await createDOM();\n  const loadersMock = [\n    {\n      loader: useProductData,\n      data: { product: { name: 'Test Product' } },\n    },\n  ];\n  await render(\n    <QwikCityMockProvider loaders={loadersMock}>\n      <Footer />\n    </QwikCityMockProvider>,\n  );\n  expect(screen.innerHTML).toMatchSnapshot();\n});\n```\n\n> The same approach can be used to mock `routeAction$`s by providing an `actions` prop to the `QwikCityMockProvider`\n\n```tsx title=\"src/components/user-form.spec.tsx\"\nimport { $ } from '@builder.io/qwik';\nimport { createDOM } from '@builder.io/qwik/testing';\nimport { test, expect } from 'vitest';\n\nimport { UserForm } from './user-form';\nimport { useAddUser } from '../loaders/add-user.action';\n\ntest('should call addUser action with correct data', async () => {\n  const { screen, render } = await createDOM();\n  const actionsMock = [\n    {\n      action: useAddUser,\n      handler: $(async (data) => {\n        console.log('useAddUser action called with data:', data);\n      }),\n    },\n  ];\n  await render(\n    <QwikCityMockProvider actions={actionsMock}>\n      <UserForm />\n    </QwikCityMockProvider>,\n  );\n  expect(screen.innerHTML).toMatchSnapshot();\n});\n```\n\n## `<RouterOutlet>`\n\nThe `RouterOutlet` component is responsible for rendering the matched route at a given moment, it internally uses the [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) to render the current page, as well as all of the nested layouts.\n\nThis component is usually located as a child of `<body>`, in most of the starters you will find it in the `src/root.tsx` file (refer to the example in `QwikCityProvider`).\n\n## `<Form>`\n\nThe `Form` component is a wrapper around the native `<form>` element, and it's designed to work side by side with [Server Actions](/docs/(qwikcity)/action/index.mdx#using-actions-with-form).\n\nSince this component uses the native `<form>` element, it will work with any browser with and without JavaScript enabled. In addition, it enhances the native `<form>` element by capturing the `submit` event and preventing the default behavior, so it will behave like an SPA (Single Page Application) instead of a full page reload.\n\n```tsx title=\"src/routes/login/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { Form, routeAction$ } from '@builder.io/qwik-city';\n\n// this action will be called when the form is submitted\nexport const useLoginAction = routeAction$((data, { cookies, redirect }) => {\n  if (validate(data.username, data.password)) {\n    cookies.set('auth', getAuthToken(data.username));\n    throw redirect(302, '/dashboard');\n  }\n});\n\nexport default component$(() => {\n  const login = useLoginAction();\n\n  return (\n    <Form action={login}>\n      <input type=\"text\" name=\"username\" />\n      <input type=\"password\" name=\"password\" />\n      <button type=\"submit\">Login</button>\n    </Form>\n  );\n});\n```\n\n## `<Link>`\n\nThe `Link` component works like the `<a>` anchor element, but instead of causing a full page to reload, it will navigate as a SPA (Single Page Navigation). This is useful if you need to navigate without losing your current state.\n\n> Notice that full-page reloads in Qwik are extremely cheap. Other frameworks abuse SPA links because a full-page reload requires JS to hydrate and re-execute everything. This is not the case for Qwik. Through investigation of internal testing, using `<a>` usually leads to the most snappy interactions.\n\nUnder the hood, the `<Link>` component uses the [`useNavigate()`](/docs/(qwikcity)/api/index.mdx#usenavigate) API and prevents the default behavior of the native `<a>`:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useNavigate } from '@builder.io/qwik-city';\n\nexport const Link = component$<LinkProps>((props) => {\n  const nav = useNavigate();\n\n  return (\n    <a\n      preventdefault:click\n      onClick$={() => {\n        nav(props.href);\n      }}\n      {...props}\n    >\n      <Slot />\n    </a>\n  );\n});\n```\n\n### Usage\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return (\n    <div>\n      <a href=\"/docs\" class=\"my-link\">\n        full-page reload\n      </a>\n      <Link href=\"/docs\" class=\"my-link\">\n        spa navigation\n      </Link>\n    </div>\n  );\n});\n```\n\n### Prefetch\n\nWhether Qwik should prefetch and cache the target page of this `Link`, this includes invoking any `routeLoader$`, `onGet`, etc.\n\nThis **improves UX performance** for client-side (**SPA**) navigations.\n\nPrefetching occurs when a the Link enters the viewport in production (`on:qvisible`), or with `mouseover`/`focus` during dev.\n\nPrefetching will not occur if the user has the **data saver** setting enabled.\n\nSetting this value to `\"js\"` will prefetch only javascript bundles required to render this page on the client, `false` will disable prefetching altogether.\n\n> Warning: if you have a menu with many links, all of them will be loaded immediately when you enter the production page, which may result with too many requests\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return (\n    <div>\n      <Link href=\"/a\" prefetch={false}>\n        page will not be prefetched\n      </Link>\n      <Link href=\"/b\" prefetch=\"js\">\n        page js will be prefetched\n      </Link>\n      <Link href=\"/c\">\n        page content & js will be prefetched\n      </Link>\n    </div>\n  );\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/caching/index.mdx",
    "content": "---\ntitle: Caching | Qwik City\ndescription: Learn how to handle caching in your Qwik City app to keep your site as fast as possible.\ncontributors:\n  - steve8708\n  - harishkrishnan24\n  - maiieul\n  - igorbabko\n  - mrhoodz\n  - mhevery\n  - chsanch\n  - hamatoyogi\n  - Jemsco\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-05-24T03:52:24Z'\n---\n\n# Caching Responses\n\nCaching responses is critical for keeping your site as fast as possible, both for [pages](/docs/(qwikcity)/pages/index.mdx) as well as [middleware](/docs/(qwikcity)/middleware/index.mdx).\n\nA option is to use [stale-while-revalidate](https://web.dev/stale-while-revalidate/) caching for all responses. Note that this means that users will see a cached response even if the server is updated, and only when the user refreshes will they see the updated content.\n\nFor instance, we can add an `onGet` export to our root [layout](/docs/(qwikcity)/layout/index.mdx) (`src/routes/layout.tsx`) like so, to apply good caching defaults site-wide:\n\n```tsx title=\"src/routes/layout.tsx\"\nimport { component$, Slot } from \"@builder.io/qwik\";\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onGet: RequestHandler = async ({ cacheControl }) => {\n  cacheControl({\n    // Always serve a cached response by default, up to a week stale\n    staleWhileRevalidate: 60 * 60 * 24 * 7,\n    // Max once every 5 seconds, revalidate on the server to get a fresh version of this page\n    maxAge: 5,\n  });\n};\n\nexport default component$(() => {\n  return (\n    <main class=\"mx-auto max-w-[2200px] relative\">\n      <Slot />\n    </main>\n  );\n});\n```\n\nWith the above setup, you will not only have better performance (pages are always served instantly from cache), but you can also have significantly decreased hosting costs, as our server or edge functions only need to run at most once every 5 seconds per page.\n\n## `cacheControl`\n\nAny method that takes a [request event](https://qwik.dev/docs/advanced/request-handling/#request-event) can call `request.cacheControl` to set the cache control headers for the response:\n\n```tsx title=\"src/routes/layout.tsx\"\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onGet: RequestHandler = async ({ cacheControl }) => {\n  cacheControl({\n    public: true,\n    maxAge: 5,\n    sMaxAge: 10,\n    staleWhileRevalidate: 60 * 60 * 24 * 365,\n  });\n};\n```\n\nIf you have default caching set at the root, but want to disable caching for a specific page, you can override this setting using nested layouts.  The below example overrides caching for dashboard pages.\n\n```tsx title=\"src/routes/dashboard/layout.tsx\"\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\n// Override caching for /dashboard pages to not cache as they are unique per visitor\nexport const onGet: RequestHandler = async ({ cacheControl }) => {\n  cacheControl({\n    public: false,\n    maxAge: 0,\n    sMaxAge: 0,\n    staleWhileRevalidate: 0,\n  });\n};\n\n```\n\nYou can see the full [API reference](https://qwik.dev/api/qwik-city-middleware-request-handler/) of options you can pass to `request.cacheControl`.\n\n## When not to cache\n\nCaching is generally beneficial, but not right for every page all the time. If your site has URLs that will show different content to different people — for example, pages exclusive to logged-in users or pages that show content based on a user's location — you should avoid using cache-control headers to cache these pages. Instead, render the content of these pages on the server side on a per-visitor basis.\n\nFor high traffic pages that look the same to everyone, such as a homepage, caching is great for enhancing performance and reducing cost. For pages specifically for logged in users that may have less traffic, it may advisable to disable caching.\n\nYou can conditionally change cache behaviors with any logic you like:\n\n```tsx title=\"src/routes/layout.tsx\"\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onGet: RequestHandler = async ({ cacheControl, url }) => {\n  // Only our homepage is public and should be CDN cached. Other pages are unique per visitor\n  if (url.pathname === '/') {\n    cacheControl({\n      public: true,\n      maxAge: 5,\n      staleWhileRevalidate: 60 * 60 * 24 * 365,\n    });\n  }\n};\n```\n\n## CDN Cache Controls\n\nFor even more control on your caching strategy, your CDN might have another layer of cache control headers.\n\nThe `cacheControl` convenience method can receive a second argument (set to `\"Cache-Control\"` by default). You can pass in any string value specific to your CDN such as \"CDN-Cache-Control\", \"Cloudflare-CDN-Cache-Control\", \"Vercel-CDN-Cache-Control\", etc.\n\n```tsx\ncacheControl({\n  maxAge: 5,\n  staleWhileRevalidate: 60 * 60 * 24 * 365,\n}, \"CDN-Cache-Control\");\n```\n\n### Missing Controls\n\nSome CDNs (such as Vercel Edge) may strip some of your \"Cache-Control\" headers.\n\n[On Vercel's documentation:](https://vercel.com/docs/edge-network/caching#cdn-cache-control)\n> If you set Cache-Control without a CDN-Cache-Control, the Vercel Edge Network strips s-maxage and stale-while-revalidate from the response before sending it to the browser. To determine if the response was served from the cache, check the [x-vercel-cache](https://vercel.com/docs/edge-network/caching#x-vercel-cache) header in the response.\n\nIf your CDN, such as Vercel Edge, automatically removes certain cache control headers and you wish to implement caching strategies like \"stale-while-revalidate\" or \"s-maxage\" in the browser, you can specify an additional cacheControl:\n\n```tsx title=\"src/routes/layout.tsx\"\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onGet: RequestHandler = async ({ cacheControl }) => {\n    // If you want the browser to use \"stale-while-revalidate\" or \"s-maxage\" Cache Control headers, you have to add the second cacheControl with \"CDN-Cache-Control\" or \"Vercel-CDN-Cache-Control\" on Vercel Edge \n    cacheControl({\n      staleWhileRevalidate: 60 * 60 * 24 * 365,\n      maxAge: 5,\n    });\n    cacheControl({\n      maxAge: 5,\n      staleWhileRevalidate: 60 * 60 * 24 * 365,\n    }, \"CDN-Cache-Control\");\n};\n```\n\n### Caching bundles and assets\n\nSee [Cache Headers](/docs/deployments/#cache-headers) for more information.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/endpoints/index.mdx",
    "content": "---\ntitle: Endpoints | Qwik City\ndescription: Endpoints are middleware functions used to control and return data in various formats like RESTful API, GraphQL API, JSON, XML, reverse proxy, or other API types.\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - CoralWombat\n  - hamatoyogi\n  - igorbabko\n  - mrhoodz\n  - EamonHeffernan\n  - kumarasinghe\n  - electather\n  - wtlin1228\n  - PatrickJS\n  - the-r3aper7\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\n\n\n# Endpoints\n\n\nA [middleware function](/docs/middleware) that returns a response is called an endpoint. Endpoints are useful for returning data such as  RESTful API, GraphQL API, JSON, XML, reverse proxy or any other type of API where you need to control all aspects of the HTTP response. Returning a response (using `json` for example) will stop the execution of subsequent middleware functions past this point in the middleware chain. \n\nAll endpoints receive a [`RequestEvent`](/docs/middleware/#requestevent) API for controlling the response of the endpoint. \n\n\nFor example, when navigating to `/greet/` URL this endpoint will return `{\"hello\":\"world\"}`.\n\nFile: `src/routes/greet/index.tsx`\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/json/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ json }) => {\n  json(200, { hello: 'world' });\n};\n```\n</CodeSandbox>\n\n> Sending a response is what differentiates an endpoint from a middleware. Sending a response (using `json()` for example) will therefore implicitly halt the middleware chain.\n\n\n\n## Create a reverse proxy using a fetch\n\nA reverse proxy can be created by using the `fetch()` method to request another server. Then use the `send()` method to send the response back to the client.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/proxy/index.tsx\">\n```tsx\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ send, url }) => {\n  const response = await fetch(\n    new URL('/demo/qwikcity/middleware/json/', url)\n  );\n  send(response.status, await response.text());\n};\n```\n</CodeSandbox>\n\n## Create a stream response manually\n\nEndpoints can manually write to the HTTP response stream, using the `getWritableStream()` method. This can be useful for creating a streaming endpoint, such as a server-sent events endpoint.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/getWritableStream/index.tsx\">\n```tsx\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async (requestEvent) => {\n  const writableStream = requestEvent.getWritableStream();\n  const writer = writableStream.getWriter();\n  const encoder = new TextEncoder();\n\n  writer.write(encoder.encode('Hello World\\n'));\n  await wait(100);\n  writer.write(encoder.encode('After 100ms\\n'));\n  await wait(100);\n  writer.write(encoder.encode('After 200ms\\n'));\n  await wait(100);\n  writer.write(encoder.encode('END'));\n  writer.close();\n};\n\nconst wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n```\n</CodeSandbox>\n\n## Endpoint vs `server$`\n\nEndpoints are low level APIs that give developers full control over the HTTP response. They are only recommended when you need to create an API to be consumed by an external entity such as a mobile app or a third-party service.\n\nThe [`server$`](/docs/(qwikcity)/server$/index.mdx) functions are usually a better option when you need to run some code on the server and return a response back to the app. The `server$` is strongly typed and provides a more convenient API for returning data.\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/error-handling/index.mdx",
    "content": "---\ntitle: Error handling | Qwik City\ncontributors:\n  - DustinJSilk\nupdated_at: '2025-01-11T18:00:00Z'\ncreated_at: '2025-01-11T18:00:00Z'\n---\n\n# Error handling\n\nWhen an error is thrown in a loader or `server$` function, a 500 error is returned to the client along with the error. This is useful during development but isn't always desirable for production systems. Qwik provides the tools necessary to customise how errors are handled.\n\nThrowing a `ServerError` instance allows you to return custom errors to the browser with a different status code and serialised data.\n\n> Loaders also provide a helper function on the event object to easily create new ServerErrors.\n\n```tsx\n// Throw ServerErrors from a routerLoader$\nconst useProduct = routeLoader$(async (ev) => {\n  const product = await fetch('api/product/1')\n\n  if (!product) {\n    // Throw a 404 with a custom payload\n    throw new ServerError(404, 'Product not found')\n\n    // Or use the existing helper function\n    throw ev.error(404, 'Product not found')\n  }\n\n  return product\n})\n\n// Throw ServerErrors from a server$\nconst getPrices = server$(() => {\n  if (!isAuthenticated()) {\n    throw new ServerError(401, { code: 401 })\n  }\n\n  return fetch('api/product/1/prices')\n})\n\nexport default component$(() => {\n  const product = useProduct()\n\n  useVisibleTask(() => {\n    getPrices()\n      .then()\n      .catch(err => {\n        // The payload from a ServerError is deserialised as the error caught in the client\n        if (err.code === 401) {\n          // Navigate to login page\n        }\n\n        // Show generic error\n      })\n  })\n\n  return <div>Product page</div>\n})\n```\n\n## Error interceptor\n\nIntercepting errors with middleware has a few usecases: you might want to hide error details in production systems, add structured error logging, or map the error status codes from RPC API calls to HTTP status codes. This is all achieveable with middleware in a `plugin` file.\n\n```tsx\n// src/routes/plugin@errors.ts\nimport { type RequestHandler } from '@builder.io/qwik-city'\nimport { RedirectMessage, ServerError } from '@builder.io/qwik-city/middleware/request-handler'\nimport { isDev } from '@builder.io/qwik/build'\n\nexport const onRequest: RequestHandler = async ({ next }) => {\n  try {\n    return await next();\n  } catch (err) {\n    // Pass through 3xx redirects\n    if (err instanceof RedirectMessage) {\n      throw err\n    }\n\n    // Pass through ServerErrors\n    if (err instanceof ServerError) {\n      throw err\n    }\n\n    // Log unknown errors\n    console.error('unknown error', err)\n\n    if (isDev) {\n      throw err\n    } else {\n      throw new ServerError(500, 'Internal server error');\n    }\n  }\n};\n\n\n\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/best-practices/index.mdx",
    "content": "---\ntitle: Best Practices | Guides\ndescription: Learn the best practices for Qwik, a guide for understanding how to use Qwik to its full potential.\ncontributors:\n  - mhevery\n  - the-r3aper7\n  - manucorporat\n  - jakovljevic-mladen\n  - kerbelp\n  - wfairclough\n  - cunzaizhuyi\n  - reemardelarosa\n  - un33k\n  - egmaleta\n  - mugan86\n  - octoper\n  - mrhoodz\n  - VinuB-Dev\n  - anartzdev\n  - adamdbradley\n  - hamatoyogi\n  - maiieul\nupdated_at: '2024-04-02T18:38:38Z'\ncreated_at: '2023-03-30T17:37:51Z'\n---\n\n# Best Practices\n\n## Inline operations in templates\n\nQwik optimizer can better optimize the reactivity of the application if the operations are inlined in the template.\n\n```tsx title=\"Suboptimal implementation\"\n// Don't do this!\nexport default component$(() => {\n  const signal = useSignal(0);\n  const isBiggerThanZero = signal.value > 0 ? 'Bigger than zero' : 'Smaller than zero';\n  return (\n    <div>\n      <button onClick$={() => signal.value++}>+</button>\n      <button onClick$={() => signal.value--}>-</button>\n      <div>{isBiggerThanZero} - Current value: { signal.value }</div>\n    </div>\n  );\n});\n```\n\nThe above implementation will cause the whole template to be re-rendered when the signal changes. This is because the `isBiggerThanZero` is not inlined in the template.\n\n```tsx title=\"Optimal Implementation\"\nexport default component$(() => {\n  const signal = useSignal(0);\n  return (\n    <div>\n      <button onClick$={() => signal.value++}>+</button>\n      <button onClick$={() => signal.value--}>-</button>\n        <div>\n          {signal.value > 0 ? 'Bigger than zero' : 'Smaller than zero'} - Current\n          value: {signal.value}\n        </div>\n    </div>\n  );\n});\n```\n\n\n## Moving signal reads to `useTask$` or `useComputed$`\n\nThis is similar to the tip above.\n\nEvery time Qwik \"reads\" a signal/store value\nthe function that the \"read\" is happening at, will re-run again\non every change to that signal.\n\nThat’s why it’s better to \"read\" values (and track them)\ninside of `useTask$` or `useComputed$` functions instead of inside component functions,\nwhenever possible.\n\nBecause otherwise, your component function will re-run\non each change.\n\n\n```tsx title=\"Suboptimal implementation\"\n// Don't do this!\nexport default component$(() => {\n  const count = useSignal(1);\n  const doubleCount = count.value*2;\n  return (\n    <div>{doubleCount}</div>\n  );\n});\n```\n\nThe above implementation will cause the whole template to be re-rendered when the signal changes. \n\nBelow, only the `useComputed$` function will re-run on any `count.value` change:\n\n```tsx title=\"Optimal Implementation\"\nexport default component$(() => {\n  const count = useSignal(1);\n  const dobuleCount = useComputed$(() => count.value*2);\n  return (\n    <div>{doubleCount.value}</div>\n  );\n});\n```\n\n## Use `useVisibleTask$()` as a last resort\n\nAlthough convenient, `useVisibleTask$()` runs code eagerly and blocks the main thread, preventing user interaction until the task is finished. You can think of it as an escape hatch.\n\nWhen in doubt, instead of \"useVisibleTask$()\" use:\n- `useTask$()` -> perform code execution in SSR mode.\n- `useOn()` -> listen to events on the root element of `the current component`.\n- `useOnWindow()` -> listen to events on the `window` object.\n- `useOnDocument()` -> listen to events on the `document` object.\n\nSometimes though, it is the only way to achieve the result.\n\nIn that case, you can add `// eslint-disable-next-line qwik/no-use-visible-task` to the line before \"useVisibleTask$\" to remove the warning.\n\n### Register DOM events with `useOn()`, `useOnWindow()`, or `useOnDocument()`\n\nQwik allows to register event listeners in a declarative way, using the `useOn()` or using JSX.\n\nWhen using `useVisibleTask$()` to programmatically register events, we are downloading and executing JavaScript eagerly, even if the event is not triggered.\n\n```tsx title=\"Suboptimal implementation\"\n// Don't do this!\nuseVisibleTask$(({ cleanup }) => {\n  const listener = (event) => {\n    const mouseEvent = event as MouseEvent;\n    console.log(mouseEvent.x, mouseEvent.y);\n  };\n  document.addEventListener('mousemove', listener);\n\n  cleanup(() => {\n    document.removeEventListener('mousemove', listener);\n  });\n});\n```\n\nThe above implementation causes more JavaScript to load eagerly, rather than responding precisely to user events. Increased upfront JavaScript loading results in slower app performance. See [below](#delaying-core-execution) for more details.\n\nInstead, use the `useOnDocument()` hook to register events on the `document` object, this way Qwik will not execute any JS until the event is triggered.\n\n```tsx title=\"Optimal Implementation\"\nuseOnDocument(\n  'mousemove',\n  $((event) => {\n    const mouseEvent = event as MouseEvent;\n    console.log(mouseEvent.x, mouseEvent.y);\n    // No manual clean up required!\n  })\n);\n```\n\n## Avoid accessing the location from the `window` object\n\nDon't access `window.location` directly, use `useLocation()` hook instead.\n\n```tsx title=\"Suboptimal implementation\"\n// Don't do this!\nuseVisibleTask$(()=> {\n    if (window.location.href).includes('foo') {\n        //... do the thing\n    }\n})\n// or\nuseTask$(() => {\n  if (isBrowser) {\n        if (window.location.href).includes('foo') {\n        //... do the thing\n    }\n  }\n})\n```\n\nMany actions related to location information can be executed during the initial server-side render, resulting in pure HTML without any JavaScript overhead.\n\nForcing this logic to run on the client side introduces increased upfront JavaScript and leads to eager loading.\n\n```tsx title=\"Optimal Implementation\"\n// Do this!\nconst location = useLocation();\n\nif (location.url.href.includes('foo')) {\n  // Do the thing\n}\n```\n\n### Exception\n\nWhen using SSG for purely static files, it's inevitable to rely on the server without current location information during the build time.\n\nHowever, exercise caution! If the required information (such as query parameters) isn't needed until a user event occurs, incorporate the check within your event handling code.\n\nThis approach helps to prevent eager loading of JavaScript and improves performance.\n\n> See: [useLocation() Docs](/docs/(qwikcity)/api/index.mdx#uselocation)\n\n\n## Delaying Core Execution\nAt load time we want to execute as little as possible to free main thread for other priority. With Qwik you can even delay the framework execution (called \"core\"), but there are some rules to follow.\n\nSome things to keep in mind before checking the rules : \n- Delaying core execution usually comes at the price of devX, this is an advance performance trick.\n- Like other chunks, core will be preloaded so the app doesn't have to load it at execution time.\n\n### useVisibleTask$\n\n`useVisibleTask$` will **always** execute core before its callback is called.\n\n```jsx\n// Requires core when component is visible in the viewport\nuseVisibleTask$(() => {\n  console.log('Hello core');\n});\n\n// Requires core on requestIdleCallback\nuseVisibleTask$(\n  () => console.log('Hello core'),\n  { strategy: 'document-idle' }\n);\n```\n\nIn **some** cases you can replace `useVisibleTask$` with either `useOn` or `useTask$`\n\n#### useOn\n\nReplace `useVisibleTask$` with `useOn('qvisible')` / `useOn('qidle')` if\n\n- You only need to trigger a callback once\n- The code must run on the client\n\n`useOn`, `useOnDocument` & `useOnWindow` execute core if they use a variable from the component scope :\n\n```jsx title=\"Comparing core execution\"\nimport { libId } from 'library';\nconst globalId = 'global-id';\nconst Component = component$(() => {\n  const ref = useSignal();\n  const id = useId();\n\n  // Executes core at load time\n  useOnDocument('qidle', $(() => console.log(ref)));\n  // Executes core at load time\n  useOnDocument('qidle', $(() => console.log(id)));\n  // Does not execute core at load time\n  useOnDocument('qidle', $(() => console.log(globalId)));\n  // Does not execute core at load time\n  useOnDocument('qidle', $(() => console.log(libId)));\n  // Does not execute core at load time\n  useOnDocument('qidle', $(() => console.log('id')));\n\n  return (\n    <p ref={ref}></p>\n    <p id={id}></p>\n    <p id={globalId}></p>\n    <p id={libId}></p>\n    <p id=\"id\"></p>\n  )\n})\n```\n\n#### useTask$\n\nReplace `useVisibleTask$` with `useTask$` if\n\n- You need to listen on state changes\n- The code can execute on the server\n\n```jsx\nconst Component = component$(() => {\n  const search = useSignal();\n  // Does not execute until `search` changes\n  useTask$(({ track }) => {\n    track(search);\n    console.log(search.value);\n  });\n  return <input bind:value={search} type=\"search\" />;\n});\n```\n\n#### useOn + useTask$\n\nA classic usecase of `useVisibleTask$` is to start listening on browser specific event:\n\n```jsx\nconst isMobile = useSignal(false);\nuseVisibleTask$(({ cleanup }) => {\n  const query = window.matchMedia('(max-width: 400px)');\n  const handler = (event) => {\n    isMobile.value = event.matches;\n  };\n  query.addEventListener('change', handler);\n  cleanup(() => query.removeEventListener('change', handler));\n});\n```\n\nIn this case we actually need core when the handler is triggered. Here is how to delay core execution :\n\n```jsx\nconst isMobile = useSignal(false);\n// On idle, start listening on the event\nuseOnDocument(\n  'qidle',\n  sync$(() => {\n    const query = window.matchMedia('(max-width: 400px)');\n    const handler = (event) => {\n      // Forward the event to the document\n      const copy = new event.constructor('media-query:(max-width: 400px)', event);\n      document.dispatchEvent(copy);\n    };\n    // Store mediaQuery & handler to cleanup later\n    document['cleanup:media-query:(max-width: 400px)'] = () => {\n      query.removeEventListener('change', handler)\n    };\n    query.addEventListener('change', handler);\n  })\n);\n\n// useOnDocument execute core when it actually needs it\nuseOnDocument(\n  'media-query:(max-width: 400px)',\n  $((event) => {\n    isMobile.value = event.matches;\n  })\n);\n\n// useTask$ is used to cleanup event listeners\nuseTask$(({ cleanup }) => {\n  cleanup(() => {\n    if (!document['cleanup:media-query:(max-width: 400px)']) return;\n    document['cleanup:media-query:(max-width: 400px)']();\n    delete document['cleanup:media-query:(max-width: 400px)'];\n  });\n});\n```\n\nAs we can see, this is a LOT of work, and it's not a great dev experience ! But if you're building a library or just trying to go as lean as possible, this is possible."
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/bundle/index.mdx",
    "content": "---\ntitle: Bundle Optimization | Guides\ndescription: Learn about bundle optimization in Qwik, a JavaScript framework for building web applications. This guide explains how to optimize your code by co-locating symbols and chunks, and provides examples of how to create and use symbols in your source code. Follow along with the code snippets and try them out in the included CodeSandbox demo.\ncontributors:\n  - mhevery\n  - the-r3aper7\n  - mrhoodz\n  - Craiqser\n  - literalpie\n  - antoinepairet\n  - hamatoyogi\nupdated_at: '2023-09-30T00:45:24Z'\ncreated_at: '2023-05-26T19:39:35Z'\n---\n\nimport CodeSandbox from '../../../../../components/code-sandbox/index.tsx';\n\n\n# Bundle Optimization\n\nBundle Optimization refers to the process of deciding which symbol goes to which bundle so that the application can co-locate the code that is used together.  Having the symbols co-located can make the application load faster.\n\n## Symbols vs Chunks\n\nSymbols are individual lazy-loadable pieces in Qwik. A symbol is created whenever you use the `__$(__)` in your source code.  \n\nFor example, the code below creates two symbols from `component$` and `onClick$`.\n\n<CodeSandbox src=\"/src/routes/demo/state/counter-signal/index.tsx\" style={{ height: '6em' }}>\n```tsx /component$/ /onClick$/\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <button onClick$={() => count.value++}>\n      Increment {count.value}\n    </button>\n  );\n});\n```\n</CodeSandbox>\n\nThe optimizer rewrites the above code to something like this:\n\nFile: `chunk-1.js`\n```tsx\nexport default componentQRL(qrl('./chunk-1.js', 's_ABC123'));\n\nexport const s_ABC123 = () => {\n  const count = useSignal(0);\n\n  return (\n    <button onClickQRL={qrl('/.chunk-1.js', 's_XYZ342')}>\n      Increment {count.value}\n    </button>\n  );\n};\n\nexport const s_XYZ432 = () => {\n  const [count] = useLexicalScope();\n  return count.value++;\n}\n```\n\nIn the above example, all of the symbols (`sABC123` and `s_XYZ432`) are co-located in the same chunk (`./chunk-1.js`). \n\nChunks are JavaScript bundles that can contain one or more symbols. \n\n## Optimal Symbol Distribution\n\nYou can think of bundle optimization as a slider that allows us to optimize the symbol delivery.\n- On one end of the slider, we have a single chunk that contains all of the symbols. This is equivalent to the application without any sort of lazy loading. (This is how most applications are written today.)\n- On the other extreme of the slider, we have a separate chunk for each symbol. This is how Qwik applications behave during development. Each symbol is in its own chunk.\n\nThe problem with a single chunk is:\n- It will contain many symbols which are not needed by the client. (Wasted bandwidth.)\n- The client can't run any symbols until the whole chunk is loaded.\n\nThe problem with a separate chunk for each symbol is:\n- The client will have to make many requests to load all of the chunks, often leading to undesirable waterfall requests.\n\nThe optimal solution is somewhere in the middle. We want to have a small number of chunks, but we also want to have the symbols that are used together to be co-located in the same chunk. Having a small number of chunks allows us to prioritize the order in which chunks load but at the same time amortize the cost of making HTTP requests. Having symbols co-located allows us to minimize the waterfall.\n\nThe good news is that with Qwik you are in full control of which symbol goes into which chunk. Normally breaking up your application for lazy loading requires the developer to write dynamic imports and re-factor the code. In Qwik, all `$()` are potential lazy load locations, all that is needed is to inform the bundler how to distribute the symbols.\n\n## `qwikVite()` Plugin\n\n`qwikVite()` plugin inside your `vite.config.ts` controls the symbol distribution. Normally the `entryStrategy` is set to `smart` which allows the Qwik to make heuristic guesses as to how the symbols should be lazy loaded. But it is possible to override the heuristic by providing `manual` configuration like this in `vite.config.ts` file:\n\n```typescript\nexport default defineConfig(() => {\n  const routesDir = resolve('src', 'routes');\n  return {\n    // ...\n    qwikVite({\n      entryStrategy: {\n        type: 'smart',\n        manual: {\n          ...bundle('bundleA', [\n              's_I5CyQjO9FjQ',\n              's_NsnidK2eXPg',\n              's_kDw0latGeM0',\n          ]),\n          ...bundle('bundleB', [\n              's_vXb90XKAnjE',\n              's_hYpp40gCb60',\n          ]),\n          ...bundle('bundleC', [\n              's_AqHBIVNKf34',\n              's_oEksvFPgMEM',\n              's_eePwnt3YTI8',\n          ]),\n        },\n      },\n    }),\n  };\n});\n\nfunction bundle(bundleName: string, symbols: string[]) {\n  return symbols.reduce((obj, key) => {\n    // Sometimes symbols are prefixed with `s_`, remove it.\n    obj[key.replace('s_', '')] = obj[key] = bundleName;\n    return obj;\n  }, {} as Record<string, string>);\n}\n```\n\nSo the question becomes how do you get the symbol names such as `s_I5CyQjO9FjQ`? See the next section Runtime Analytics.\n\n## Runtime analytics\n\nThe fundamental problem to solve is that determining the optimal bundles is not statically possible. The ideal bundles will depend on the user's behavior. Only after observing users' behavior can we determine which symbols are used together.\n\nTo collect symbol usage from a running application:\n\n1. Insert this code into your app:\n    ```html\n    <script>\n      window.symbols = [];\n      document.addEventListener('qsymbol', (e) => window.symbols.push(e.detail.symbol));\n    </script>\n    ```\n2. Perform some set of operations mimicking user behavior.\n3. Open the console and type `symbols` to see the list of symbols used. Use that information to update the `vite.config.ts` file.\n\n\n> **NOTE:** We are looking into creating better ways of collecting this information in the future. (See [Insights](/docs/labs/insights/index.mdx).)\n\n> **NOTE:** Symbols hashes are designed to be stable even across many compilations. However, if the code undergoes complex refactoring it is possible for the hash to change. This will not break the application, but it may cause the symbol to be moved to a different sub-optimal chunk until runtime analytics can be collected again. \n\n\n## Service worker\n\nQwik apps employ a service worker to ensure that bundles are prefetched into the browser's cache and that any user interaction would result in a cache hit, hence no delay in interaction.\n\nSee [Speculative Module Fetching](/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx).\n\n> Notice that Service Worker feature is available only in secure contexts (HTTPS), in some or all supporting browsers. See the [`serviceWorker` property API specs](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/serviceWorker).\n\n## Events\n\nAll information regarding when the symbols are loaded can be observed by listening to the following custom events:\n\n### `qprefetch` custom event details.\n\n`qprefetch` event is fired when a new code path is exposed to the user by rendering a new application view. (For example, rendering a new modal dialog will have a new button. We would like to ensure that the new button code is prefetched so that if the user interacts with the button there will be no delay.)\nUsually, a service worker listens to the `qprefetch` event and loads the symbol into the cache. The service worker has a map of symbols to bundles, and it uses this information to determine which bundles to prefetch based on a symbol.\n\n```typescript\nexport interface QPrefetchDetail {\n  /// A list of symbols to prefetch.\n  symbols: string[];\n}\n```\n\n### `qsymbol` custom event details.\n\n`qsymbol` event is fired every time Qwik needs to resolve a symbol. Listening to this event can give you insight into when different symbols are loaded by your application. The information can then be used to better optimize your bundles by putting symbols that are needed together in the same bundle.\n\n```typescript\nexport interface QSymbolDetail {\n  /// Optional DOM event which triggered the symbol resolution.\n  element?: Element;\n  /// Request time when the symbol was resolved.\n  reqTime: number;\n  /// Symbol being resolved.\n  symbol: string;\n}\n```\n\n## Waterfall \n\nThe service worker attempts to minimize the waterfall by prefetching the bundles. To be able to do that the service worker has a `manifest` of symbols and chunks. The `manifest` represents a full graph of all of the symbols and their corresponding chunks. It also knows the import graph, so if a symbol is prefetched, the service worker will also prefetch all other symbols which are needed as part of the import graph.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/capacitor/index.mdx",
    "content": "---\ntitle: Qwik Hybrid Native App Overview | Guides\ndescription: Learn to build hybrid native apps with Qwik.\nkeywords: 'Capacitor, native, mobile'\ncontributors:\n  - srapport\nupdated_at: '2024-12-30T03:28:00Z'\ncreated_at: '2024-12-28T09:56:54Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Qwik for iOS and Android\n\n## Modernizing Mobile Development with a Hybrid Approach\n\nTraditionally, building native mobile applications meant managing two separate codebases: **Swift/Objective-C** for iOS and **Kotlin/Java** for Android. While this approach offers deep integration with each platform, it comes with significant drawbacks, including **increased development time**, **higher costs**, and **doubled maintenance efforts** for every feature or bug fix.\n\nThis new hybrid approach combines **[Qwik's](https://qwik.dev/) performance-optimized framework** with **[Capacitor's](https://capacitorjs.com/) native runtime** and **[Capawesome's](https://capawesome.io/) rich plugin ecosystem**, enabling developers to build high-performance mobile applications from a **single TypeScript codebase**. This architecture bridges the gap between web and native development, allowing:\n\n- Single codebase for iOS and Android\n- Reduced development and maintenance costs\n- Streamlined update process\n- Broad device compatibility\n- Access to native device features\n- Minimal code duplication\n\n## How It Works\n\nThe architecture combines three complementary technologies—**Qwik**, **Capacitor**, and a robust **plugin ecosystem**—to create a streamlined, high-performance hybrid mobile development platform. This approach prioritizes **speed**, **native integration**, and **efficient resource usage**, ensuring a smooth experience for both developers and end-users.\n\n### **1. Qwik Static Site Generation (SSG)**\n\nAt the core of this stack, your application is built as a **Qwik Static Site**. Qwik's **[Static Site Generation (SSG)](https://qwik.dev/docs/guides/static-site-generation/)** approach ensures that most of the application is pre-rendered at build time, resulting in **lightweight assets** that are optimized for mobile devices.\n\n**Why Static for Capacitor?**\n- **On-Device Hosting:** The static assets are served directly from the device's file system, eliminating the need for a remote server.  \n- **Offline Availability:** Since the assets are bundled within the app, no network connection is required to load the initial UI.  \n- **Faster Startup Times:** Pre-rendered assets minimize processing overhead, allowing the app to launch quickly.  \n- **Improved Stability:** Reduced reliance on external servers leads to fewer points of failure.  \n\n**Key Benefits of Qwik SSG:**\n- **Resumable Rendering:** Qwik's architecture allows code to execute only where and when it’s needed.  \n- **Minimal Resource Usage:** Efficient rendering keeps CPU and memory usage low.  \n- **Scalable Design:** Performance remains consistent across devices with varying capabilities.\n\nTogether, Qwik SSG and Capacitor enable an architecture where your app's web content behaves like native assets, loaded directly from the device with no dependency on external servers.\n\n### **2. Capacitor Integration**\n\nCapacitor acts as the bridge between your Qwik-generated static assets and native mobile APIs. It wraps your app in a native runtime, making it possible to access native device capabilities directly from your TypeScript code.\n\n**Why Capacitor is Essential:**\n- **Seamless Web-to-Native Bridge:** Native APIs (e.g., camera, storage, geolocation) are exposed to your Qwik app through JavaScript-friendly plugins.  \n- **Local Asset Hosting:** Your app is served from local files, avoiding the latency and reliability issues of remote servers.  \n- **Unified Build Workflow:** The same codebase is built for both iOS and Android, reducing duplication and maintenance overhead.  \n- **Modern Tooling:** Capacitor integrates smoothly with build tools like Vite and development environments like VSCode.\n\n**Key Benefits of Capacitor:**\n- **Simplified Build Process:** Fewer steps and tools are required to compile and deploy native apps.  \n- **Effortless Platform Management:** Easily add and manage platform-specific dependencies with Capacitor CLI.  \n- **Native Runtime Stability:** Ensures that native code executes predictably across different devices.\n\nBy using Capacitor, your static Qwik app becomes a self-contained mobile app that can interact with device hardware and APIs as if it were built natively. Please refer to the official [Capacitor documentation](https://capacitorjs.com/docs) for more information on how to use Capacitor.\n\n### **3. Accessing Native Features**\n\nCapacitor enables your Qwik app to interact with native device features through an extensive ecosystem of **plugins**. These plugins act as modular bridges that translate JavaScript API calls into native commands, allowing seamless access to hardware and platform-specific functionality like the camera, GPS, or file system.\n\n#### **Capacitor Plugins:**  \n- Developed and maintained by the Capacitor core team.  \n- Provide robust APIs for essential device features, such as the camera, geolocation, file system, and push notifications.  \n- Frequently updated to ensure compatibility with the latest iOS and Android versions.  \n- Supported by comprehensive documentation and examples, making them easy to implement and maintain.\n\nCapacitor Plugins can be found [here](https://capacitorjs.com/docs/plugins).\n\n#### **Capawesome Plugins:**  \n\nCapawesome expands Capacitor’s functionality with a collection of plugins designed to address advanced and specialized use cases not always covered by Capacitor's core plugin set. Two notable examples demonstrate its unique value:\n\n- **Live Updates:** Enables over-the-air updates for the app's web layer, allowing developers to deliver bug fixes, improvements, and new features without requiring users to download a new version from the app store. This reduces release cycle friction and ensures users always have the latest experience.\n\n- **Bluetooth Low Energy (BLE):** Offers reliable APIs for communicating with Bluetooth Low Energy peripherals, supporting secure and efficient interactions with devices such as fitness trackers, medical sensors, and smart IoT equipment.\n\nCapawesome plugins are built with a **TypeScript-first philosophy**, ensuring strong type safety, modern development standards, and seamless integration with development tools and workflows. This focus results in plugins that are easier to maintain, debug, and scale across projects.\n\nMany more Capawesome Plugins can be found [here](https://capawesome.io/plugins/).\n\n#### **Cordova Plugins:**  \n- Provide access to a large library of plugins from the Cordova ecosystem, offering compatibility with legacy hybrid solutions.  \n- Ideal for leveraging specialized or less commonly used native features not yet supported by Capacitor or Capawesome.  \n- Capacitor’s compatibility layer ensures smooth integration, but long-term support may vary based on the plugin.\n\nCordova Plugins can be found [here](https://cordova.apache.org/plugins/).\n\n## **Prerequisites and Initial Setup**\n\n### **Required Tools**\n- **Node.js** (18.x or later)  \n- **npm** or **pnpm**  \n- **iOS Requirements:**  \n   - macOS computer  \n   - Xcode (latest version)\n   - CocoaPods  \n- **Android Requirements:**  \n   - Android Studio  \n   - Android SDK  \n   - Gradle  \n\nPlease refer to each platform's official documentation for installation instructions and application build process.\n\n### **Environment Setup**\n\n1. **Create a Qwik Project**  \n   Start by creating a new Qwik project using the CLI:  \n   ```bash\n   pnpm create qwik@latest\n   ```\n\n2. **Add the Static Adapter**  \n   To prepare your Qwik app for static site generation (SSG), install the **static adapter**:  \n   ```bash\n   pnpm run qwik add static\n   ```\n   This step ensures your app generates pre-rendered static files suitable for Capacitor.\n\n3. **Add Capacitor to Your Qwik Project**  \n   Install Capacitor dependencies and initialize Capacitor:  \n   ```bash\n   pnpm i @capacitor/cli @capacitor/core\n   npx cap init\n   ```\n\n4. **Configure Capacitor**  \n   Your `capacitor.config.ts` file should looks something like this:  \n   ```typescript\n    import type { CapacitorConfig } from '@capacitor/cli';\n\n    const config: CapacitorConfig = {\n      appId: 'com.example.app',\n      appName: 'my-qwik-empty-starter',\n      webDir: 'dist',\n      server: {\n        iosScheme: 'capacitor',\n        androidScheme: 'https'\n      }\n    };\n\n    export default config;\n   ```\n\n5. **Install Platform-Specific Dependencies**  \n   Add support for iOS and Android platforms:  \n   ```bash\n   pnpm i @capacitor/ios @capacitor/android\n   ```\n\n6. **Initialize Native Platforms**  \n   Create the native project files:  \n   ```bash\n   npx cap add ios\n   npx cap add android\n   ```\n\n## Development Workflow\n\n### Building and Running\n\nIn this section, we’ll walk through the process of creating a **production-ready build** of your Qwik application, syncing it with native platforms using **Capacitor**, and deploying it to an **iOS simulator** or **Android emulator**. This workflow ensures that your app is packaged with optimized static assets, making it ready for testing and deployment on mobile devices. Whether you're verifying functionality, refining the user experience, or preparing for final distribution, running the app in a native simulator or emulator is an essential step in validating its performance and behavior across platforms.\n\n1. Create a production build of your Qwik app:\n```bash\npnpm run build\n```\n\n2. Sync web assets to native platforms:\n```bash\nnpx cap sync\n```\n\n3. Run the app in simulator/emulator:\n```bash\nnpx cap run ios     # Runs the app in an iOS simulator\nnpx cap run android # Runs the app in an Android emulator\n```\n\nAlternatively you can open native IDEs:\n```bash\nnpx cap open ios     # Opens Xcode\nnpx cap open android # Opens Android Studio\n```\n\n## **How to Use Native Functionality with Plugins**\n\nThe **Device Plugin** is a straightforward example of how to integrate native functionality into your Qwik app using Capacitor. This plugin allows you to access key device-specific information, such as the model, operating system, and OS version. This data can be valuable for debugging, adapting your app's behavior based on the device's capabilities, or collecting insights for analytics. Importantly, the Device plugin works seamlessly in both iOS simulators and Android emulators, making it an ideal choice for testing native integration without requiring additional configuration.\n### Install the Device Plugin\n\n1. Add the Device plugin to your project:\n\n```bash\npnpm i @capacitor/device\n```\n\n2. Add the plugin to your `capacitor.config.ts` file:\n\n```TypeScript\nplugins: {\n  Device: {\n    // No configuration required\n  },\n},\n```\n\n3. Update your Qwik component `index.tsx` to use the Device plugin:\n\n```tsx\nimport { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik';\nimport { Device } from '@capacitor/device';\n\nexport const DeviceInfoComponent = component$(() => {\n  const deviceInfo = useSignal<string | null>(null);\n\n  useVisibleTask$(async () => {\n    const info = await Device.getInfo();\n    deviceInfo.value = `Model: ${info.model}, OS: ${info.operatingSystem}, Version: ${info.osVersion}`;\n  });\n\n  return (\n    <div style={{ paddingTop: \"40px\" }}>\n      <h2>Device Information</h2>\n      {deviceInfo.value ? (\n        <p>{deviceInfo.value}</p>\n      ) : (\n        <p>Loading device information...</p>\n      )}\n    </div>\n  );\n});\n```\n\n4. Update the native platforms:\n\nYou will need to update the native platforms to ensure that the plugin is properly integrated into your app. This step ensures that the native code is available for the Qwik app.\n\n***NOTE:** As of the time of writing this guide, a bug exists in XCode that requires you to delete the iOS app before redeploying.*\n\n```bash\nnpx cap sync\nnpx cap run ios     # Runs the app in an iOS simulator\nnpx cap run android # Runs the app in an Android emulator\n```\n\n\n## 📚 **Over-the-Air Updates with Capawesome**\n\nThis is a highly simplified example of how to self-host a live update from your local system. To implement a robust OTA update system please follow the guides provided at Capawesome.\n\n1. Install the Live Update plugin:\n\n```bash\npnpm i @capawesome/capacitor-live-update\n```\n\n2. Update your `capacitor.config.ts` file to enable live reload:\n\n```typescript\n  plugins: {\n    ...\n    LiveUpdate: {\n      appId: \"YOUR_APP_ID\",\n      // publicKey:\n      //   \"-----BEGIN PUBLIC KEY-----\\nYOUR_PUBLIC_KEY\\n-----END PUBLIC KEY-----\",\n    },\n  },\n```\n\n3. Update your `index.tsx` as follows and be sure to set `YOUR_IP`. When the user clicks the button, it will update the app.\n\n```tsx\nimport {\n  $,\n  component$,\n  useComputed$,\n  useSignal,\n  useVisibleTask$,\n} from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\nimport { LiveUpdate } from \"@capawesome/capacitor-live-update\";\n\nconst VERSION = \"1.0.0\";\nconst OTA_SERVER_URL = \"http://YOUR_IP:8000\";\nconst wait = () => new Promise((resolve) => setTimeout(resolve, 1000));\n\nexport default component$(() => {\n  const version = useSignal<string>(VERSION);\n  const updateStatus = useSignal<string | null>(null);\n  const otaUrl = useComputed$(() => `${OTA_SERVER_URL}/${version.value}.zip`);\n\n  const handleUpdate = $(async () => {\n    try {\n      updateStatus.value = `Checking for existing bundle...`;\n      console.log(updateStatus.value);\n      await wait();\n\n      const { bundleIds } = await LiveUpdate.getBundles();\n      const bundleExists = bundleIds.includes(version.value);\n\n      if (bundleExists) {\n        updateStatus.value = `Bundle ${version.value} already exists. Switching to it...`;\n        console.log(updateStatus.value);\n        await wait();\n\n        await LiveUpdate.setNextBundle({ bundleId: version.value });\n        await LiveUpdate.reload();\n\n        updateStatus.value = `Switched to existing bundle ${version.value}!`;\n        console.log(updateStatus.value);\n        await wait();\n      } else {\n        updateStatus.value = `Downloading update from ${otaUrl.value}...`;\n        console.log(updateStatus.value);\n        await wait();\n\n        await LiveUpdate.downloadBundle({\n          url: otaUrl.value,\n          bundleId: version.value,\n        });\n\n        updateStatus.value = \"Applying update...\";\n        console.log(updateStatus.value);\n        await wait();\n\n        await LiveUpdate.setNextBundle({ bundleId: version.value });\n        await LiveUpdate.reload();\n\n        updateStatus.value = \"Update applied successfully!\";\n        console.log(updateStatus.value);\n        await wait();\n      }\n    } catch (error) {\n      updateStatus.value = `Update to ${otaUrl.value} failed. Error: ${\n        error instanceof Error ? error.message : \"Unknown error\"\n      }`;\n      console.error(updateStatus.value);\n      await wait();\n    }\n  });\n\n  useVisibleTask$(async () => {\n    try {\n      updateStatus.value = \"App ready\";\n      console.log(updateStatus.value);\n      await wait();\n\n      LiveUpdate.ready();\n    } catch (error) {\n      (updateStatus.value = \"Error notifying app readiness:\"), error;\n      console.error(updateStatus.value);\n      await wait();\n    }\n  });\n\n  return (\n    <div style={{ padding: \"40px\" }}>\n      <h2>OTA Update</h2>\n      <h3>Current Version: {VERSION}</h3>\n      <p>Enter the version you want to update to and click the button below.</p>\n\n      <div style={{ marginBottom: \"20px\" }}>\n        <label>\n          Version:\n          <input\n            value={version.value}\n            onInput$={(event) =>\n              (version.value = (event.target as HTMLInputElement).value)\n            }\n            style={{\n              marginLeft: \"10px\",\n              padding: \"8px\",\n              fontSize: \"14px\",\n              borderRadius: \"5px\",\n              border: \"1px solid #ccc\",\n            }}\n          />\n        </label>\n      </div>\n\n      <button\n        onClick$={handleUpdate}\n        style={{\n          marginTop: \"10px\",\n          padding: \"10px 20px\",\n          fontSize: \"14px\",\n          cursor: \"pointer\",\n          borderRadius: \"5px\",\n          border: \"none\",\n          backgroundColor: \"#0078D4\",\n          color: \"#fff\",\n        }}\n      >\n        Update Now\n      </button>\n\n      {updateStatus.value && (\n        <p style={{ marginTop: \"20px\" }}>{updateStatus.value}</p>\n      )}\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Dynamic OTA Update with Capawesome\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Qwik app with OTA updates.\",\n    },\n  ],\n};\n```\n\n4. Build the initial app and deploy it to your device.\n\nBuild and deploy the app to your device.\n\n```bash\npnpm run build\nnpx cap sync\nnpx cap run ios     # Runs the app in an iOS simulator\nnpx cap run android # Runs the app in an Android emulator\n```\n\n5. Build OTA update bundles.\n\nUpdate the version number in the `index.tsx` file and zip it with the same version number (i.e. `1.0.1.zip`). You can build multiple versions and switch between them.\n\n```bash\nmkdir -p ota_bundles # Only required the first time\npnpm run build\nzip -r ota_bundles/VERSION.zip dist/*\n```\n\n6. Start a simple OTA Bundle Server to host your compressed bundles.\n\n```bash\nnpx serve ota_bundles -l 8000\n```\n\n7. Test Over-the-Air Updates from the OTA Bundle Server.\n\nOnce the app is updated, the new version will be used across app launches. You can repeat step 5 to create a new bundles.\n\n\n#### **Capawesome Cloud**\n\nIf you are using [Capawesome Cloud](https://capawesome.io/cloud/), you can use the Live Update plugin to update your app without having to build and host a new version of the app. This is a great option for production environments.\n\n### Live Development\n\nLive development is a critical part of building modern hybrid mobile applications, allowing developers to make changes to their code and see the results in real-time on a connected device or simulator. With Capacitor’s live reload feature, you can bridge the gap between rapid web development workflows and native mobile deployment. Instead of waiting through lengthy build and redeployment cycles, live development enables instant feedback, making it easier to fine-tune UI elements, test native functionality, and troubleshoot platform-specific behaviors. This approach reduces development friction, accelerates iteration, and fosters a smoother experience when building, testing, and refining Qwik-powered mobile apps.\n\n1. Update `vite.config.ts` to enable access to the dev server from the local network:\n```typescript\n server: {\n  ...\n  host: true, // Enables access from the local network\n }\n ```\n\n2. Update `capacitor.config.ts` to enable live reload from the dev server's network accessible IP address:\n```typescript\nconst config: CapacitorConfig = {\n  ...\n  server: {\n    url: 'http://YOUR_IP:5172',\n    cleartext: true\n  }\n};\n```\n\n3. Run the app in simulator/emulator:\n```bash\nnpx cap run ios\nnpx cap run android\n```\n\n4. Start Qwik's dev server:\n```bash\npnpm run dev\n```\n\n**NOTE:** After you run the dev server, you will need to restart the native IDEs to see the changes.\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/debugging/index.mdx",
    "content": "---\ntitle: Debugging | Introduction\ndescription: Learn a few debugging tips to streamline your journey with Qwik.\ncontributors:\n  - gioboa\n  - KyeongJooni\nupdated_at: '2025-12-13T00:00:00Z'\ncreated_at: '2025-08-08T00:00:00Z'\n---\n# Debugging\n\n## ✨ Save yourself a bit of time with 'click to source'\n\nDuring development, you can quickly access the source code of any element on a webpage by holding Option (⌥) or Alt key,\nclick on whatever you're curious about, and Qwik will immediately open your source code right on top of that element.\nSeriously, any component, link, header - you name it, you can peek at its code.\n\nQwik tries to guess what code editor you like to use.\nIf it guesses wrong, no biggie! Just give Qwik a hint by setting the `LAUNCH_EDITOR` environment variable.\nFor example, if you're on a Mac and use VS Code, you'd type `export LAUNCH_EDITOR=code` in your terminal.\n\nUnder the hood [launch-editor library](https://github.com/yyx990803/launch-editor/tree/master) is used, here are the [supported editors](https://github.com/yyx990803/launch-editor/tree/master?tab=readme-ov-file#supported-editors)\n\n## Finding leftover `console.log` statements\n\nWhen working on larger codebases, you might occasionally leave `console.log` statements in your code unintentionally. These can clutter your terminal output, and it's often difficult to identify which file and line number produced each log message.\n\n### Using ESLint rules (recommended)\n\nThe recommended approach is to configure ESLint to prevent `console.log` statements from being committed:\n\n```js\n// eslint.config.js\nexport default [\n  {\n    rules: {\n      'no-console': ['error', { allow: ['warn', 'error'] }],\n    },\n  },\n];\n```\n\nThis will catch `console.log` statements during development, preventing them from being committed.\n\n### Using IDE search\n\nMost IDEs provide powerful search functionality to find all occurrences of `console.log` across your codebase:\n- **VS Code**: Press `Ctrl+Shift+F` (or `Cmd+Shift+F` on Mac) and search for `console\\.log`\n- **Enable regex mode** to match only exact `console.log` calls and not `console.error` or `console.warn`\n\nThis approach is simple but requires manual review of each occurrence to determine if it's intentional or leftover debug code.\n\n### Using stack traces (temporary debugging)\n\nIf you need to identify existing leftover console.logs in a codebase that's already cluttered, you can temporarily override `console.log` to include stack traces.\n\n#### In client-side components\n\nYou can override `console.log` in your component code:\n\n```tsx\n// root.tsx or layout.tsx\nexport default component$(() => {\n  // Override console.log to include stack traces\n  useVisibleTask$(() => {\n    const originalLog = console.log;\n    console.log = (...args: any[]) => {\n      const stack = new Error()\n        .stack?.split('\\n')\n        .filter((i) => !/^.*(\\.vite|\\.main\\.jsx|node_modules).*/.test(i));\n      originalLog(stack, ...args);\n    };\n  });\n\n  return (\n    // your component JSX\n  );\n});\n```\n\n#### In server-side entry files\n\nFor entry files like `entry.express.tsx`, `entry.dev.tsx`, or `entry.preview.tsx`, you can override `console.log` at the module level:\n\n```tsx\n// entry.express.tsx or entry.dev.tsx or entry.preview.tsx\n\n// Override console.log at the top level\nconst originalLog = console.log;\nconsole.log = (...args: any[]) => {\n  const stack = new Error()\n    .stack?.split('\\n')\n    .filter((i) => !/^.*(node_modules|internal).*/.test(i));\n  originalLog(stack, ...args);\n};\n\n// Rest of your entry file code...\n```\n\n> **Note:** Remember to remove these overrides after debugging. The filter regex should be adjusted based on your specific build setup.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/deploy/index.mdx",
    "content": "---\ncontributors:\n  - manucorporat\n  - mhevery\n  - adamdbradley\nupdated_at: '2023-04-20T23:06:55Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/env-variables/index.mdx",
    "content": "---\ntitle: Environment variables | Qwik City\ndescription: Qwik apps can read environment variables in two main ways build-time variables and server-side variables.\ncontributors:\n  - manucorporat\n  - the-r3aper7\n  - mrhoodz\n  - wtlin1228\n  - RumNCodeDev\n  - Jemsco\nupdated_at: '2024-05-07T00:00:01Z'\ncreated_at: '2023-04-16T21:57:42Z'\n---\n\n# Environment Variables\n\nEnvironment variables are a way to store configuration values or sensitive data that should not be included directly in your application code. These variables are typically used for things like API keys, database connection strings, or other environment-specific settings.\n\n## Types of Environment Variables\n### Build-time\n  - Environment variables which are prepended with  `PUBLIC_` and are available both on the `client` and the `server`.\n### Server-side\n  - Environment Variables that are only accessible on the `server`.\n\n\n\n> **IMPORTANT! DO NOT** use `build-time` environment variables, (ie. variables that start with `PUBLIC_`) to store any sensitive information, such as API keys, secrets, passwords, etc. These variables are accessible in the browser **ONLY PUBLIC DATA**.\n\n\n```ini title=\".env.local\"\n# This will only be available when run on the server\nAPI_KEY=secretApiKeyHere\n# This will be available everywhere\nPUBLIC_API_URL=https://api.example.com\n```\n\n\n## Default Environment Variables\nQwikCity includes a few environment variables out of the box\n - `BASE_URL`: `string` -  Returns the base url for the page,\n - `MODE`: `string` -  Returns the rendering mode,\n - `DEV`: `boolean` -  Returns if you are in development mode,\n - `PROD`: `boolean` -  Returns if you are in production mode,\n - `SSR`: `boolean` -  Returns whether if this was rendered with ssr or not\n\n\nThe preferred method for accessing environment variables in QwikCity is via `import.meta.env.*` (client side) or through the Request object when run server side.\n> `process.env` is a Node.js only API, and should be avoided at all costs.\n\n## Build-time variables\n\nBuild-time variables are powered by [Vite](https://vitejs.dev/guide/env-and-mode.html). They are defined in `.env` files and are available **in the browser and in the server-side code**.\n\n\n\nNotice that build-time variables should be considered as **public**, since they will be hardcoded in the browser build, which can be easily read by anyone.\n\nBuild-time variables are prefixed by default with `PUBLIC_` and can be accessed with with `import.meta.env.PUBLIC_*`.\n\n### Defining Variables\n\n```ini title=\".env.local\" /PUBLIC_API_URL/#a\nPUBLIC_API_URL=https://api.example.com\n```\n\n### Usage\n\n```tsx {4} /PUBLIC_API_URL/#a title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  // `import.meta.env.PUBLIC_*` variables can be read anywhere, including browser\n  return <div>PUBLIC_API_URL: {import.meta.env.PUBLIC_API_URL}</div>\n})\n```\n\n> `import.meta.env.PUBLIC_*` variables can be read anywhere, but do not put any sensitive information in them, since they will be visible to the client.\n\n## Server-side Variables\n\nServer-side variables are fundamentally runtime variables that are only available in the server-side code.\n\nThey are not known at build-time and are not available in the browser, so they can be considered as **private**.\n\nDuring production, **setting server-side variables is very platform specific**. Most of the platforms allow you to set environment variables from their dashboard, or CLI. Please, refer to your platform (cloudflare, vercel, netlify) documentation for more information.\n\n> **Special Considerations for Docker and Fastify**:\n> - **Docker:** While Docker allows the inclusion of environment variables directly in the Dockerfile, this method can expose sensitive data.  A more secure practice is to manage these variables at runtime using Docker Compose. For example:\n> ```ini title=\"docker-compose.yml\"\n> version: '3.8'\n> services:\n>  your-service:\n>    image: your-image-name\n>    environment:\n>      - FOO=BAR\n> ```\n>\n> - **Fastify within Docker:** Environment variables placed in `.env` or `.env.local` files may not be automatically recognized in production environments when using Fastify.  For these settings to take effect it may be necessary to explicitly load them within your Fastify application or pass them through Docker's environment management system (Docker Compose) as shown above\n\n### Defining Variables\n\n```ini title=\".env.local\"\nDB_PRIVATE_KEY=123456789\n```\n\n> Make sure you never commit `.env.local` files to git.\n\n\n### Usage Examples\n\nServer-side variables can only be accessed in server-only APIs that expose the `RequestEvent` object, such as `routeLoader$()`, `routeAction$()`, `server$()` and endpoint handlers such as `onGet`, `onPost`, `onRequest` etc.\n\n```tsx /DB_PRIVATE_KEY/ title=\"src/routes/index.tsx\"\nimport {\n  routeLoader$,\n  routeAction$,\n  server$,\n  type RequestEvent,\n} from '@builder.io/qwik-city';\n\nexport const onGet = (requestEvent: RequestEvent) => {\n  console.log(requestEvent.env.get('DB_PRIVATE_KEY'));\n};\n\nexport const onPost = (requestEvent: RequestEvent) => {\n  console.log(requestEvent.env.get('DB_PRIVATE_KEY'));\n};\n\nexport const useAction = routeAction$(async (_, requestEvent) => {\n  console.log(requestEvent.env.get('DB_PRIVATE_KEY'));\n});\n\nexport const useLoader = routeLoader$(async (requestEvent) => {\n  console.log(requestEvent.env.get('DB_PRIVATE_KEY'));\n});\n\nexport const serverFunction = server$(function () {\n  // `this` is the `RequestEvent` object\n  console.log(this.env.get('DB_PRIVATE_KEY'));\n});\n```\n\n\n\n### Usage in serverfull architecture (Example:Express)\n\nFor accessing the .env variables in serverfull architecture you need to use singleton design pattern, initialize the db in a plugin, and access it with getDB wherever it is needed.\n\n```typescript title=\"src/util/db.ts\"\nlet _db!: AppDatabase;\n\nexport function getDB() {\n  // eslint-disable-next-line\n  if (!_db) {\n    throw new Error('DB not set');\n  }\n  return _db;\n}\n\nexport async function initializeDbIfNeeded(factory: () => Promise<AppDatabase>) {\n  // eslint-disable-next-line\n  if (!_db) {\n    _db = await factory();\n  }\n}\n```\n\n```typescript title=\"src/routes/plugin@db.ts\"\nexport const onRequest: RequestHandler = async ({ env }) => {\n  const url = env.get('PRIVATE_LIBSQL_DB_URL')!;\n  const authToken = env.get('PRIVATE_LIBSQL_DB_API_TOKEN')!;\n  await initializeDbIfNeeded(initLibSql(url, authToken));\n};\n```\n\n### Managing Environment Variables Throughout the Application Lifecycle\n\nIn modern applications, environment variables play a crucial role in managing application settings and configurations across various environments without hardcoding sensitive data into the source code.\n\nQwik City adaptors use the following:\n- Azure, Cloud Run, Netlify Edge, Node Server, use ORIGIN or URL\n- Cloudflare Pages uses CF_PAGES_URL or ORIGIN\n- Vercel uses VERCEL_URL\n\n> Note:\n> This is not a comprehensive guide on environment variables, nor does it cover all of the 3rd-Party hosting scenarios. It is meant to give insight that can be applied across various environments. \n> \n> See this video for a detailed explanation:\n> https://youtu.be/NPf39RWc8LM\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/mdx/index.mdx",
    "content": "---\ntitle: Markdown and MDX | Guides\ndescription: Learn how to use Markdown and MDX in Qwik City.\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - Oyemade\n  - mhevery\n  - nnelgxorz\n  - cunzaizhuyi\n  - the-r3aper7\n  - zanettin\n  - ihaback\n  - YannickFricke\n  - mrhoodz\n  - erikras\n  - hamatoyogi\nupdated_at: '2023-10-17T20:22:18Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# MDX\n\nAn alternative way to author content is using `.mdx` files ([Markdown JSX](https://mdxjs.com/)). These files are authored as Markdown, but they are compiled down to Qwik components. In addition to Markdown syntax, `.mdx` files can also refer to other components.\n\nLet's assume you have your routes set up like this:\n\n```bash\nsrc/\n└── routes/\n    └── some/\n        └── path/\n            └── index.mdx    # https://example.com/some/path\n```\n\n```markdown title=\"src/routes/some/path/index.mdx\"\n---\ntitle: Hello World Title\n---\n\nThis is a simple hello world component.\n\n```\n\nThe above component will be rendered at `https://example.com/some/path`.\n\n## Importing other components.\n\n[MDX](https://mdxjs.com/) is a creative opportunity for you to come up with new content quickly (\"Qwikly\" 🙂) and if you need more interaction on your page you can seamlessly integrate your Qwik components like so:\n\n```bash\nsrc/\n├── components/\n|   └── counter\n│       └──  counter.tsx\n└── routes/\n    └── some/\n        └── path/\n            └── index.mdx    # https://example.com/some/path\n```\n\n```markdown title=\"src/routes/some/path/index.mdx\"\n---\ntitle: Hello World Title\n---\nimport { Counter } from \"../../../components/counter/counter\";\n\nThis is a simple hello world component.\n\n<Counter />\n\n```\n\n```tsx title=\"src/components/counter/counter.tsx\"\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <button class=\"counter\" type=\"button\" onClick$={() => count.value++}>\n      Increment {count.value}\n    </button>\n  );\n});\n```\n\n**Note**: A key difference between Qwik City and many current meta-frameworks is directory-based routing. Every route needs to be defined as `a-directory/index.(tsx,ts,js,jsx,md,mdx)`.\n\nIn other meta-frameworks you're used to `about.mdx` will render a route `http://example.com/about`. However, this will not work in Qwik City. You must rename the file to `about/index.mdx` for Qwik City to know to render it.\n\n## Disabling default MDX plugins included.\n\nQwik City includes 3 plugins by default.\n\n- [remarkGfm](https://github.com/remarkjs/remark-gfm): [GFM](https://github.github.com/gfm/) support (autolink literals, footnotes, strikethrough, tables, tasklists).\n- [rehypeSyntaxHighlight](https://github.com/wooorm/refractor): Lightweight, robust, elegant virtual syntax highlighting using Prism.\n- [rehypeAutolinkHeadings](https://github.com/rehypejs/rehype-autolink-headings): Plugin to add links to headings in HTML.\n\nThese plugins can be disabled independently in the following way:\n\n```tsx title=\"vite.config.js\"\nimport { defineConfig } from 'vite';\nimport { qwikCity } from '@builder.io/qwik-city/vite';\n// See below\nimport rehypeAutolinkHeadings from 'rehype-autolink-headings';\nexport default defineConfig(() => {\n  return {\n    plugins: [\n      qwikCity({\n        mdxPlugins: {\n          remarkGfm: false,\n          rehypeSyntaxHighlight: false,\n          rehypeAutolinkHeadings: false,\n        },\n        mdx: {\n          rehypePlugins: [\n            // Plugins can now be added manually to use a different configuration\n            [rehypeAutolinkHeadings, { behavior: 'wrap' }],\n          ],\n        },\n      }),\n      /* the rest of the configuration */\n    ],\n  };\n});\n```\n\n## Open Graph Properties\n\nYou can use `og` or `opengraph` property to define [Open Graph protocol](https://ogp.me/) metadata.\n\n```yaml\ntitle: My Title\ndescription: My Description\nog:\n  - title: My Custom Title\n    description: true\n  - image: https://example.com/rock.jpg\n    image:alt: A shiny red apple with a bite taken out\n  - image: https://example.com/rock2.jpg\n```\n\nSetting `og:title` or `og:description` to `true` will check and use outside `title` and `description` property instead. Thus, you can avoid writing a same title and description twice.\n\nThe above example will generate the following HTML code.\n\n```html\n<title>My Title</title>\n<meta name=\"description\" content=\"My Description\" />\n\n<meta property=\"og:title\" content=\"My Custom Title\" />\n<meta property=\"og:description\" content=\"My Description\" />\n\n<meta property=\"og:image\" content=\"https://example.com/rock.jpg\" />\n<meta property=\"og:image:alt\" content=\"A shiny red apple with a bite taken out\" />\n\n<meta property=\"og:image\" content=\"https://example.com/rock2.jpg\" />\n```\n\n## Reading frontmatter data\nFrontmatter keys are accessible by leveraging the `useDocumentHead()` hook.\n\n```markdown title=\"src/routes/some/path/index.mdx\"\n---\ntitle: Hello World Title\ntags:\n  - super\n  - exiting\n  - docs\n---\nimport { Tags } from \"../../../components/tags/tags\";\n\nThis is a simple hello world component.\n\n<Tags />\n```\n\n```tsx title=\"src/components/tags/tags.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { useDocumentHead } from '@builder.io/qwik-city';\n\nexport const Tags = component$(() => {\n  const { frontmatter } = useDocumentHead();\n  \n  if (frontmatter.tags.length === 0) {\n    return null;\n  }\n  \n  return (\n    <ul>\n      {frontmatter.tags.map((tag: string) => (\n        <li key={`tag-${tag}`}>{tag}</li>\n      ))}\n    </ul>\n  );\n});\n```\n\n## `useContent()`\n\nThe [`useContent()`](/docs/(qwikcity)/api/index.mdx#usecontent) function retrieves the nearest content information for the current route. The returned object includes:\n\n```ts\nheadings: ContentHeading[] | undefined;\nmenu: ContentMenu | undefined;\n```\n\nThe `headings` array includes data about a markdown file's `<h1>` to `<h6>` [html heading elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements).\n\nMenus are contextual data declared with `menu.md` files. See [menus file definition](/docs/(qwikcity)/advanced/menu/index.mdx) for more information on the file format and location.\n\n# Dynamic Page Navigation with MDX\n\nWhen working with documentation or content-heavy pages in Qwik City, you often need to generate a table of contents or sidebar navigation based on the page's content. Qwik City provides a built-in solution for this through the `useContent()` hook, which can automatically extract headings from your MDX files.\n\n## Using `useContent()` for Page Navigation\n\nThe `useContent()` hook allows you to access metadata about your current MDX page, including all its headings. This is particularly useful for:\n\n- Creating a table of contents for long articles\n- Building dynamic sidebar navigation\n- Implementing \"jump to section\" functionality\n- Generating progress indicators for article sections\n\nHere's a complete example of how to create a dynamic table of contents:\n\n```tsx\nimport { component$, useContent } from '@builder.io/qwik';\n\nexport const TableOfContents = component$(() => {\n  const content = useContent();\n\n  return (\n    <nav class=\"toc\">\n      <h4>On this page</h4>\n      <ul>\n        {content.headings?.map((heading) => (\n          <li \n            key={heading.id}\n            style={{ \n              // Indent based on heading level\n              marginLeft: `${(heading.level - 1) * 12}px` \n            }}\n          >\n            <a href={`#${heading.id}`}>{heading.text}</a>\n          </li>\n        ))}\n      </ul>\n    </nav>\n  );\n});\n```\n\n## Understanding the Headings Data\n\nThe `headings` property from `useContent()` provides an array of heading objects with the following information:\n\n- `id`: The auto-generated ID for the heading (used for anchor links)\n- `text`: The actual text content of the heading\n- `level`: The heading level (1 for h1, 2 for h2, etc.)\n\nThis only works with `.mdx` files - headings in `.tsx` files are not detected.\n\n## Common Use Cases\n\n### Progressive Disclosure Navigation\n\nYou can create a collapsible navigation that shows the current section and its sub-sections:\n\n```tsx\nexport const ProgressiveNav = component$(() => {\n  const content = useContent();\n  const currentSection = useSignal<string | null>(null);\n\n  return (\n    <nav>\n      {content.headings?.map((heading) => {\n        if (heading.level === 2) { // Only show h2 as main sections\n          const subHeadings = content.headings.filter(h => \n            h.level === 3 && \n            h.id.startsWith(heading.id.split('-')[0])\n          );\n          \n          return (\n            <div key={heading.id}>\n              <a \n                href={`#${heading.id}`}\n                onClick$={() => currentSection.value = heading.id}\n              >\n                {heading.text}\n              </a>\n              {currentSection.value === heading.id && (\n                <ul>\n                  {subHeadings.map(sub => (\n                    <li key={sub.id}>\n                      <a href={`#${sub.id}`}>{sub.text}</a>\n                    </li>\n                  ))}\n                </ul>\n              )}\n            </div>\n          );\n        }\n      })}\n    </nav>\n  );\n});\n```\n\n### Reading Progress Indicator\n\nYou can combine heading information with scroll position to create a reading progress indicator:\n\n```tsx\nexport const ReadingProgress = component$(() => {\n  const content = useContent();\n  const activeSection = useSignal('');\n\n  useOnWindow('scroll', $(() => {\n    const headingElements = content.headings?.map(h => \n      document.getElementById(h.id)\n    ).filter(Boolean) || [];\n\n    const currentHeading = headingElements.find(el => {\n      const rect = el!.getBoundingClientRect();\n      return rect.top > 0 && rect.top < window.innerHeight / 2;\n    });\n\n    if (currentHeading) {\n      activeSection.value = currentHeading.id;\n    }\n  }));\n\n  return (\n    <nav>\n      {content.headings?.map(heading => (\n        <a\n          key={heading.id}\n          href={`#${heading.id}`}\n          class={{\n            active: activeSection.value === heading.id\n          }}\n        >\n          {heading.text}\n        </a>\n      ))}\n    </nav>\n  );\n});\n```\n\n## Tips and Best Practices\n\n1. **Consistent Heading Structure**: Maintain a logical heading hierarchy in your MDX files to ensure the navigation makes sense.\n\n2. **Performance**: The `useContent()` hook is optimized and won't cause unnecessary re-renders, so you can safely use it in navigation components.\n\n3. **Styling**: Consider using the heading level information to create visual hierarchy in your navigation:\n   ```css\n   .toc a {\n     /* Base styles */\n   }\n   \n   /* Style based on heading level */\n   [data-level=\"1\"] { font-size: 1.2em; font-weight: bold; }\n   [data-level=\"2\"] { font-size: 1.1em; }\n   [data-level=\"3\"] { font-size: 1em; }\n   ```\n\n4. **Accessibility**: Always ensure your dynamic navigation includes proper ARIA labels and keyboard navigation support.\n\n## Notes and Limitations\n\n- This functionality only works with `.mdx` files, not with `.tsx` or other file types\n- Headings must have unique content to generate unique IDs\n- The heading data is available only on the client-side after hydration\n- Consider using `useVisibleTask$` if you need to interact with the heading elements in the DOM"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/qwik-nutshell/index.mdx",
    "content": "---\ntitle: Qwik in a nutshell | Introduction\ndescription: Learn the general concepts of Qwik in this short introduction guide.\ncontributors:\n  - manucorporat\n  - AnthonyPAlicea\n  - the-r3aper7\n  - igorbabko\n  - mrhoodz\n  - hbendev\n  - willnguyen1312\n  - julianobrasil\n  - devagja\n  - vanvuongngo\n  - iancharlesdouglas\n  - adamdbradley\n  - hamatoyogi\n  - aendel\n  - maiieul\n  - patrickjs\nupdated_at: '2024-05-13T16:00:00Z'\ncreated_at: '2023-03-30T19:49:50Z'\n---\n# Qwik in a nutshell\n\n## Components\n\nQwik components are very similar to React components. They are functions that return JSX. However, `component$(...)` needs to be used, event handlers must have the `$` suffix, state is created using `useSignal()`, `class` is used instead of `className` and some other differences.\n\n\n```tsx title=\"src/components/my-other-component/index.tsx\"\nimport { component$, Slot } from '@builder.io/qwik';\nimport type { ClassList } from '@builder.io/qwik'\n\nexport const MyOtherComponent = component$((props: { class?: ClassList }) => { // ✅\n  return <div class={class}><Slot /></div>;\n});\n```\n\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\n\n// Other components can be imported and used in JSX.\nimport { MyOtherComponent } from './my-other-component';\n\ninterface MyComponentProps {\n  step: number;\n}\n\n// Components are always declared with the `component$` function.\nexport const MyComponent = component$((props: MyComponentProps) => {\n  // Components use the `useSignal` hook to create reactive state.\n  const count = useSignal(0); // { value: 0 }\n  return (\n    <>\n      <button\n        onClick$={() => {\n          // Event handlers have the `$` suffix.\n          count.value = count.value + props.step;\n        }}\n      >\n        Increment by {props.step}\n      </button>\n      <main\n        class={{\n          even: count.value % 2 === 0,\n          odd: count.value % 2 === 1,\n        }}\n      >\n        <h1>Count: {count.value}</h1>\n        <MyOtherComponent class=\"correct-way\"> {/* ✅ */}\n          {count.value > 10 && <p>Count is greater than 10</p>}\n          {count.value > 10 ? <p>Count is greater than 10</p> : <p>Count is less than 10</p>}\n        </MyOtherComponent>\n      </main>\n    </>\n  );\n});\n```\n\n### Rendering a list of items\n\nLike in React, you can render a list of items using the `map` function, however every item in the list must have a unique `key` property. The `key` must be a string, or number and must be unique within the list.\n\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { US_PRESIDENTS } from './presidents';\n\nexport const PresidentsList = component$(() => {\n  return (\n    <ul>\n      {US_PRESIDENTS.map((president) => (\n        <li key={president.number}>\n          <h2>{president.name}</h2>\n          <p>{president.description}</p>\n        </li>\n      ))}\n    </ul>\n  );\n});\n```\n\n### Reusing event handlers\n\nEvent handlers can be reused across JSX nodes. This is done by creating a handler using the `$(...handler...)`.\n\n```tsx\nimport { $, component$, useSignal } from '@builder.io/qwik';\n\ninterface MyComponentProps {\n  step: number;\n}\n\n// Components are always declared with the `component$` function.\nexport const MyComponent = component$(() => {\n  const count = useSignal(0);\n\n  // Notice the `$(...)` around the event handler function.\n  const inputHandler = $((event, elem) => {\n    console.log(event.type, elem.value);\n  });\n\n  return (\n    <>\n      <input name=\"name\" onInput$={inputHandler} />\n      <input\n        name=\"password\"\n        onInput$={inputHandler}\n      />\n    </>\n  );\n});\n```\n\n### Content projection\n\nContent projection is done by the `<Slot/>` component, which is exported from `@builder.io/qwik`. Slots can be named, and can be projected into using the `q:slot` attribute.\n\n```tsx\n// File: src/components/Button/Button.tsx\nimport { component$, Slot } from '@builder.io/qwik';\nimport styles from './Button.module.css';\n\nexport const Button = component$(() => {\n  return (\n    <button class={styles.button}>\n      <div class={styles.start}>\n        <Slot name=\"start\" />\n      </div>\n      <Slot />\n      <div class={styles.end}>\n        <Slot name=\"end\" />\n      </div>\n    </button>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <Button>\n      <span q:slot=\"start\">📩</span>\n      Hello world\n      <span q:slot=\"end\">🟩</span>\n    </Button>\n  );\n});\n```\n\n### Rules of use hooks\n\nMethods that start with `use` are special in Qwik, such as `useSignal()`, `useStore()`, `useOn()`, `useTask$()`, `useLocation()` and so on. Very similar to React hooks.\n\n- They can only be called within a component$.\n- They can only be called from the top level of a component$, not inside a conditional, or a loop.\n\n## Styling\n\nQwik supports out of the box, CSS modules, or even Tailwind, global CSS imports and lazy loading scoped CSS using `useStylesScoped$()`. CSS Modules are the recommended way to style Qwik components.\n\n### CSS Modules\n\nTo use CSS modules, simply create a `.module.css` file. For example, `src/components/MyComponent/MyComponent.module.css`.\n\n```css title=\"src/components/MyComponent/MyComponent.module.css\"\n.container {\n  background-color: red;\n}\n```\n\nThen, import the CSS module in your component.\n\n```tsx title=\"src/components/MyComponent/MyComponent.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport styles from './MyComponent.module.css';\n\nexport default component$(() => {\n  return <div class={styles.container}>Hello world</div>;\n});\n```\n\nRemember that Qwik uses `class` instead of `className` for CSS classes.\n\n## $(...) rules\n\nThe `$(...)` function and any function that end with `$` are special in Qwik, such as: `$()`, `useTask$()`, `useVisibleTask$()`... The `$` at the end represents a lazy loading boundary. There are some rules that apply to the first argument of any `$` function. It is NOT related to jQuery at all.\n\n- The first argument must be an imported variable.\n- The first argument must be a declared variable at the top level of the same module.\n- The first argument must be an expression any variables.\n- If the first argument is a function, it can only capture variables that are declared at the top level of the same module or which value is serializable. Serializable values include: `string`, `number`, `boolean`, `null`, `undefined`, `Array`, `Object`, `Date`, `RegExp`, `Map`, `Set`, `BigInt`, `Promise`, `Error`, `JSX nodes`, `Signal`, `Store` and even HTMLElements.\n\n```tsx\n// Valid examples of `$` functions.\nimport { $, component$, useSignal } from '@builder.io/qwik';\nimport { importedFunction } from './my-other-module';\n\nexport function exportedFunction() {\n  console.log('exported function');\n}\n\nexport default component$(() => {\n  // The first argument is a function.\n  const valid1 = $((event, elem) => {\n    console.log(event.type, elem.value);\n  });\n\n  // The first argument is an imported identifier.\n  const valid2 = $(importedFunction);\n\n  // The first argument is an identifier declared at the top level of the same module.\n  const valid3 = $(exportedFunction);\n\n  // The first argument is an expression without local variables.\n  const valid4 = $([1, 2, { a: 'hello' }]);\n\n  // The first argument is a function that captures a local variable.\n  const localVariable = 1;\n  const valid5 = $((event) => {\n    console.log('local variable', localVariable);\n  });\n});\n```\n\nHere are some examples of invalid `$` functions.\n\n```tsx\n// Invalid examples of `$` functions.\nimport { $, component$, useSignal } from '@builder.io/qwik';\nimport { importedVariable } from './my-other-module';\n\nexport default component$(() => {\n  const unserializable = new CustomClass();\n  const localVariable = 1;\n\n  // The first argument is a local variable.\n  const invalid1 = $(localVariable);\n\n  // The first argument is a function that captures an unserializable local variable.\n  const invalid2 = $((event) => {\n    console.log('custom class', unserializable);\n  });\n\n  // The first argument is an expression that uses a local variable.\n  const invalid3 = $(localVariable + 1);\n\n  // The first argument is an expression that uses an imported variable.\n  const invalid4 = $(importedVariable + 'hello');\n});\n```\n\n## Reactive state\n\n### `useSignal(initialValue?)`\n\n`useSignal()` is the main way to create reactive state. Signals can be shared across components, and any component or task that reads the signal (executing: `signal.value`) will be rendered when the signal changes.\n\n```ts\n// Typescript definition for `Signal<T>` and `useSignal<T>`\n\nexport interface Signal<T> {\n  value: T;\n}\n\nexport const useSignal: <T>(value?: T | (() => T)): Signal<T>;\n```\n\n`useSignal(initialValue?)` takes an optional initial value and returns a `Signal<T>` object. The `Signal<T>` object has a `value` property that can be read and written to. When a component or task accesses the `value` property, it automatically creates a subscription, so when the `value` is changed, every component, task or another computed signals that read the `value` will be re-evaluated.\n\n### `useStore(initialValue?)`\n\n`useStore(initialValue?)` is similar to `useSignal` except that it creates a reactive javascript object, making every property of the object reactive, just like the `value` of a signal. Under the hood, `useStore` is implemented using a `Proxy` object that intercepts all property access, making the property reactive.\n\n```ts\n// Typescript definition `useStore<T>`\n\n// The `Reactive<T>` is a reactive version of the `T` type, every property of `T` behaves like a `Signal<T>`.\nexport interface Reactive<T extends Record<string, any>> extends T {}\n\nexport interface StoreOptions {\n  // If `deep` is true, then nested property of the store will be wrapped in a `Signal<T>`.\n  deep?: boolean;\n}\nexport const useStore: <T>(value?: T | (() => T), options?: StoreOptions): Reactive<T>;\n```\n\nIn practice, `useSignal` and `useStore` are very similar -- `useSignal(0) === useStore({ value: 0 })` -- but `useSignal` is preferable most of the time.  Some use cases for `useStore` are:\n\n- When you need reactivity in an array.\n- When you want a reactive object that you can easily add properties to.\n\n```tsx\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const Counter = component$(() => {\n  // The `useStore` hook is used to create a reactive store.\n  const todoList = useStore(\n    {\n      array: [],\n    },\n    { deep: true }\n  );\n\n  // todoList.array is a reactive array, so we can push to it and the component will re-render.\n\n  return (\n    <>\n      <h1>Todo List</h1>\n      <ul>\n        {todoList.array.map((todo) => (\n          <li key={todo.id}>\n            <input\n              type=\"checkbox\"\n              checked={todo.completed}\n              onInput$={() => {\n                // todoList is a reactive store\n                // because we used `deep: true`, the `todo` object is also reactive.\n                // so we can change the `completed` property and the component will re-render.\n                todo.completed = !todo.completed;\n              }}\n            />\n            {todo.text}\n          </li>\n        ))}\n      </ul>\n    </>\n  );\n});\n```\n\n### `useTask$(() => { ... })`\n\n`useTask$` is used to create an async task. Tasks are useful to implement side effects, running heavy computation and async code as part of the rendering lifecycle. `useTask$` tasks are executed before the first render, and subsequently whenever a tracked signal or store changes, the task is re-executed.\n\n```tsx\nimport { component$, useSignal, useTask$ } from '@builder.io/qwik';\n\nexport const Counter = component$(() => {\n  const page = useSignal(0);\n  const listOfUsers = useSignal([]);\n\n  // The `useTask$` hook is used to create a task.\n  useTask$(() => {\n    // The task is executed before the first render.\n    console.log('Task executed before first render');\n  });\n\n  // You can create multiple tasks, and they can be async.\n  useTask$(async (taskContext) => {\n    // Since we want to re-run the task whenever the `page` changes,\n    // we need to track it.\n    taskContext.track(() => page.value);\n    console.log('Task executed before the first render AND when page changes');\n    console.log('Current page:', page.value);\n\n    // Tasks can run async code, such as fetching data.\n    const res = await fetch(`https://api.randomuser.me/?page=${page.value}`);\n    const json = await res.json();\n\n    // Assigning to a signal will trigger a re-render.\n    listOfUsers.value = json.results;\n  });\n\n  return (\n    <>\n      <h1>Page {page.value}</h1>\n      <ul>\n        {listOfUsers.value.map((user) => (\n          <li key={user.login.uuid}>\n            {user.name.first} {user.name.last}\n          </li>\n        ))}\n      </ul>\n      <button onClick$={() => page.value++}>Next Page</button>\n    </>\n  );\n});\n```\n\n`useTask$()` will run in the server during SSR, and in the browser if the component is first mounted on the client. Because of that, it's not a good idea to access DOM APIs in a task, since they will not be available on the server. Instead, you should use event handlers or `useVisibleTask$()` to run a task only on the client/browser.\n\n### `useVisibleTask$(() => { ... })`\n\n`useVisibleTask$` is used to create a task that happens right AFTER the component is first mounted in the DOM. It's similar to `useTask$` except that it only runs on the client, and it's executed after the first render. Because it's executed after the render, it's ok to inspect the DOM, or use browser APIs.\n\n```tsx\nimport { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik';\n\nexport const Clock = component$(() => {\n  const time = useSignal(0);\n\n  // The `useVisibleTask$` hook is used to create a task that runs eagerly on the client.\n  useVisibleTask$((taskContext) => {\n    // Since this VisibleTask is not tracking any signals, it will only run once.\n\n    const interval = setInterval(() => {\n      time.value = new Date();\n    }, 1000);\n\n    // The `cleanup` function is called when the component is unmounted, or when the task is re-run.\n    taskContext.cleanup(() => clearInterval(interval));\n  });\n\n  return (\n    <>\n      <h1>Clock</h1>\n      <h1>Seconds passed: {time.value}</h1>\n    </>\n  );\n});\n```\n\nSince Qwik does NOT execute any Javascript on the browser before user interaction, `useVisibleTask$()` is the only API that will run eagerly on the client, which is why it's a good place to do things like:\n\n- Access DOM APIs\n- Initialize browser-only libraries\n- Run analytics code\n- Start an animation, or a timer.\n\nNote that `useVisibleTask$()` should not be used to fetch data, because it will not run on the server. Instead, you should use `useTask$()` to fetch data, and then use `useVisibleTask$()` to do things like start an animation. Abusing `useVisibleTask$()` can lead to poor performance.\n\n## Routing\n\nQwik comes with a file-based router, which is similar to Next.js, but with a few differences. The router is based on the file-system, specifically in `src/routes/`. Creating a new `index.tsx` file in a folder under `src/routes/` will create a new route. For example, `src/routes/home/index.tsx` will create a route at `/home/`.\n\n```tsx title=\"src/routes/home/index.tsx\"\n\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>Home</h1>;\n});\n```\n\nIt is very important to export the component as the default export, otherwise the router will not be able to find it.\n\n### Route Parameters\n\nYou can create dynamic routes by adding a folder with `[param]` in the route path. For example, `src/routes/user/[id]/index.tsx` will create a route at `/user/:id/`. In order to access the route parameter, you can use the `useLocation` hook exported from `@builder.io/qwik-city`.\n\n```tsx title=\"src/routes/user/[userID]/index.tsx\"\n\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation();\n  return (\n    <main>\n      {loc.isNavigating && <p>Loading...</p>}\n      <h1>User: {loc.params.userID}</h1>\n      <p>Current URL: {loc.url.href}</p>\n    </main>\n  );\n});\n```\n\n`useLocation()` returns a reactive `RouteLocation` object, meaning that it will re-render whenever the route changes. The `RouteLocation` object has the following properties:\n\n```tsx\n/**\n * The current route location returned by `useLocation()`.\n */\nexport interface RouteLocation {\n  readonly params: Readonly<Record<string, string>>;\n  readonly url: URL;\n  readonly isNavigating: boolean;\n}\n```\n\n### Linking to other routes\n\nTo link to other routes, you can use the `Link` component exported from `@builder.io/qwik-city`. The `Link` component takes all the properties of the `<a>` HTMLAnchorElement. The only difference is that it will use the Qwik router to SPA navigate to the route instead of doing a full page navigation.\n\n```tsx title=\"src/routes/index.tsx\"\n\nimport { component$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Home</h1>\n      <Link href=\"/about/\">SPA navigate to /about/</Link>\n      <a href=\"/about/\">Full page navigate to /about/</a>\n    </>\n  );\n});\n```\n\n## Fetching / loading data\n\nThe recommended way to load data from the server is to use the `routeLoader$()` function exported from `@builder.io/qwik-city`. The `routeLoader$()` function is used to create a data loader that will be executed on the server before the route is rendered. The return of `routeLoader$()` must be exported as a named export from the route file, ie, it can only be used in a `index.tsx`, inside of `src/routes/`.\n\n```tsx title=\"src/routes/user/[userID]/index.tsx\"\n\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\n// The `routeLoader$()` function is used to create a data loader that will be executed on the server before the route is rendered.\n// The return of `routeLoader$()` is a custom use hook, which can be used to access the data returned from `routeLoader$()`.\nexport const useUserData = routeLoader$(async (requestContext) => {\n  const user = await db.table('users').get(requestContext.params.userID);\n  return {\n    name: user.name,\n    email: user.email,\n  };\n});\n\nexport default component$(() => {\n  // The `useUserData` hook will return a `Signal` containing the data returned from `routeLoader$()`, which will re-render the component, whenever the navigation changes, and the routeLoader$() is re-run.\n  const userData = useUserData();\n  return (\n    <main>\n      <h1>User data</h1>\n      <p>User name: {userData.value.name}</p>\n      <p>User email: {userData.value.email}</p>\n    </main>\n  );\n});\n\n// Exported `head` function is used to set the document head for the route.\nexport const head: DocumentHead = ({resolveValue}) => {\n  // It can use the `resolveValue()` method to resolve the value from `routeLoader$()`.\n  const user = resolveValue(useUserData);\n  return {\n    title: `User: \"${user.name}\"`,\n    meta: [\n      {\n        name: 'description',\n        content: 'User page',\n      },\n    ],\n  };\n};\n```\n\nThe `routeLoader$()` function takes a function that returns a promise. The promise is resolved on the server, and the resolved value is passed to the `useCustomLoader$()` hook. The `useCustomLoader$()` hook is a custom hook that is created by the `routeLoader$()` function. The `useCustomLoader$()` hook returns a `Signal` that contains the resolved value of the promise returned from the `routeLoader$()` function. The `useCustomLoader$()` hook will re-render the component whenever the route changes, and the `routeLoader$()` function is re-run.\n\n## Handle form submissions\n\nQwik provides the `routeAction$()` API exported from `@builder.io/qwik-city` to handle form requests on the server. `routeAction$()` is only executed on the server when the form is submitted.\n\n```tsx title=\"src/routes/user/[userID]/index.tsx\"\n\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$, Form, zod$, z } from '@builder.io/qwik-city';\n\n// The `routeAction$()` function is used to create a data loader that will be executed on the server when the form is submitted.\n// The return of `routeAction$()` is a custom use hook, which can be used to access the data returned from `routeAction$()`.\nexport const useUserUpdate = routeAction$(async (data, requestContext) => {\n  const user = await db.table('users').get(requestContext.params.userID);\n  user.name = data.name;\n  user.email = data.email;\n  await db.table('users').put(user);\n  return {\n    user,\n  };\n}, zod$({\n  name: z.string(),\n  email: z.string(),\n}));\n\nexport default component$(() => {\n  // The `useUserUpdate` hook will return an `ActionStore<T>` containing the `value` returned from `routeAction$()`, and some other properties, such as `submit()`, which is used to submit the form programmatically, and `isRunning`. All of these properties are reactive, and will re-render the component whenever they change.\n  const userData = useUserUpdate();\n  // userData.value is the value returned from `routeAction$()`, which is `undefined` before the form is submitted.\n  // userData.formData is the form data that was submitted, it is `undefined` before the form is submitted.\n  // userData.isRunning is a boolean that is true when the form is being submitted.\n  // userData.submit() is a function that can be used to submit the form programmatically.\n  // userData.actionPath is the path to the action, which is used to submit the form.\n  return (\n    <main>\n      <h1>User data</h1>\n      <Form action={userData}>\n        <div>\n          <label>User name: <input name=\"name\" defaultValue={userData.formData?.get('name')} /></label>\n        </div>\n        <div>\n          <label>User email: <input name=\"email\" defaultValue={userData.formData?.get('email')} /></label>\n        </div>\n        <button type=\"submit\">Update</button>\n      </Form>\n    </main>\n  );\n});\n```\n\nThe `routeAction$()` is used on pair with the `Form` component exported from `@builder.io/qwik-city`. The `Form` component is a wrapper around the native HTML `<form>` element. The `Form` component takes an `ActionStore<T>` as the `action` property. The `ActionStore<T>` is the return value of the `routeAction$()` function.\n\n\n## Run code only in the browser\n\nSince Qwik executes the same code on the server and in the browser, you cannot use `window` or other browser APIs in your code, because they don't exist when the code is executed on the server.\n\nIf you want to access browser APIs, such as `window`, `document`, `localStorage`, `sessionStorage`, `webgl` etc, you need to check if the code is running in the browser before accessing the browser APIs.\n\n```tsx\nimport { component$, useTask$, useVisibleTask$, useSignal } from '@builder.io/qwik';\nimport { isBrowser } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const ref = useSignal<Element>();\n\n  // useVisibleTask$ will only run in the browser\n  useVisibleTask$(() => {\n    // No need to check for `isBrowser` before accessing the DOM, because useVisibleTask$ will only run in the browser\n    ref.value?.focus();\n    document.title = 'Hello world';\n  });\n\n  // useTask might run on the server, so you need to check for `isBrowser` before accessing the DOM\n  useTask$(() => {\n    if (isBrowser) {\n      // This code will only run in the browser only when the component is first rendered there\n      ref.value?.focus();\n      document.title = 'Hello world';\n    }\n  });\n\n  return (\n    <button\n      ref={ref}\n      onClick$={() => {\n        // All event handlers are only executed in the browser, so it's safe to access the DOM\n        ref.value?.focus();\n        document.title = 'Hello world';\n      }}\n    >\n      Click me\n    </button>\n  );\n});\n```\n\n### `useVisibleTask$(() => { ... })`\n\nThis API will declare a VisibleTask that is ensured to run only on the client/browser. It will never run on the server.\n\n### JSX event handlers\n\nJSX handlers such as `onClick$` and `onInput$` are only executed on the client. This is because they are DOM events, since there is no DOM on the server, they will not be executed on the server.\n\n## Run code only on the server\n\nSometimes you need to run code only on the server, such as fetching data or accessing a database. To solve this problem, Qwik provides a few APIs to run code only on the server.\n\n```tsx\nimport { component$, useTask$ } from '@builder.io/qwik';\nimport { server$, routeLoader$ } from '@builder.io/qwik/qwik-city';\nimport { isServer } from '@builder.io/qwik';\n\n\nexport const useGetProducts = routeLoader$((requestEvent) => {\n  // This code will only run on the server\n  const db = await openDB(requestEvent.env.get('DB_PRIVATE_KEY'));\n  const product = await db.table('products').select();\n  return product;\n})\n\nconst encryptOnServer = server$(function(message: string) {\n  // `this` is the `requestEvent\n  const secretKey = this.env.get('SECRET_KEY');\n  const encryptedMessage = encrypt(message, secretKey);\n  return encryptedMessage;\n});\n\nexport default component$(() => {\n  useTask$(() => {\n    if (isServer) {\n      // This code will only run on the server only when the component is first rendered in the server\n    }\n  });\n\n  return (\n    <>\n      <button\n        onClick$={server$(() => {\n          // This code will only run on the server when the button is clicked\n        })}\n      >\n        Click me\n      </button>\n\n      <button\n        onClick$={() => {\n          // This code will call the server function, and wait for the result\n          const encrypted = await encryptOnServer('Hello world');\n          console.log(encrypted);\n        }}\n      >\n        Click me\n      </button>\n    </>\n  );\n});\n```\n\n### `routeAction$()`\n\nThe `routeAction$()` is a special component that is only executed on the server. It's used to handle form submissions, and other actions. For example, you can use it to add a user to a database, and then redirect to the user profile page.\n\n### `routeLoader$()`\n\nThe `routeLoader$()` is a special component that is only executed on the server. It's used to fetch data, and then render the page. For example, you can use it to fetch data from an API, and then render the page with the data.\n\n### `server$((...args) => { ... })`\n\nThe `server$()` is a special way to declare functions that only run on the server. If called from the client, they will behave like an RPC call, and will be executed on the server. They can take any serializable arguments, and return any serializable value.\n\n### `isServer` & `isBrowser` conditionals\n\nInstead of `if(typeof window !== 'undefined')`, it is recommended to use the `isServer` and `isBrowser` boolean helpers exported from `@builder.io/qwik` to ensure your code only runs in the browser. They contain slightly more robust checks to better detect the browser environment.\n\nHere is the source code for reference:\n\n```tsx\nexport const isBrowser: boolean = /*#__PURE__*/ (() =>\n  typeof window !== 'undefined' &&\n  typeof HTMLElement !== 'undefined' &&\n  !!window.document &&\n  String(HTMLElement).includes('[native code]'))();\n\nexport const isServer: boolean = !isBrowser;\n```\n\nHere is how you import these for reference:\n\n```tsx\nimport {isServer, isBrowser} from '@builder.io/qwik';\n\n// inside component$\n\nuseTask$(({ track }) => {\n  track(() => interactionSig.value) <-- tracks on the client when a signal has changed.\n\n  // server code\n\n  if (isServer) return;\n\n  // client code here\n});\n\n//\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/react-cheat-sheet/index.mdx",
    "content": "---\ntitle: Qwik for React developers\ndescription: Learn the difference between React and Qwik in this handy cheat sheet.\n\ncontributors:\n  - the-r3aper7\n  - ChibiBlasphem\n  - zahash\n  - manucorporat\n  - kerbelp\n  - shairez\n  - pnilssson\n  - jweb89\n  - avivr\n  - adamdbradley\n  - AnthonyPAlicea\n  - mhevery\n  - nsdonato\n  - igorbabko\n  - jnsmtnr\n  - rjsdnql123\n  - hamatoyogi\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-07T21:32:40Z'\n---\n\n# React Vs Qwik\n\nSeveral examples comparing React and Qwik.\n\n## Hello world component\n\n### ⚛️ From React\n\n```tsx\nexport const HelloWorld = () => {\n  return <div>Hello world</div>;\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const HelloWorld = component$(() => {\n  return <div>Hello world</div>;\n});\n```\n\n<details>\n  <summary style={{color: \"#17ADF5\"}}>What is component$ and $?</summary>\n  <p><span style={{color: \"#A273F2\"}}>component$</span> is used to declare a <a href=\"https://qwik.dev/docs/core/overview/#component\">Qwik component.</a></p>\n  <p><a href=\"https://qwik.dev/docs/advanced/dollar/#the-dollar--sign\">The dollar sign</a> <span style={{color: \"#A273F2\"}}>$</span> is used to signal both the optimizer and the developer when Qwik splits up your application into many small pieces we call symbols.</p>\n</details>\n\n## Button with a click handler\n\n### ⚛️ From React\n\n```tsx\nexport const Button = () => {\n  return <button onClick={() => console.log('click')}>Click me</button>;\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const Button = component$(() => {\n  return <button onClick$={() => console.log('click')}>Click me</button>;\n});\n```\n\n<details>\n  <summary style={{color: \"#17ADF5\"}}>Remember $?</summary>\n  <p>Event handlers in qwik behave in the same way as in other frameworks, you just have to keep in mind that their content will be loaded in a lazy way thanks to the dollar suffix.</p>\n  <p>Attention ⚠️: JSX <a href=\"https://qwik.dev/docs/core/events/#inline-handler\">handlers</a> such as onClick$ and onInput$ are only executed on the client. This is because they are DOM events, since there is no DOM on the server, they will not be executed on the server.</p>\n</details>\n\n## Declare local state\n\n### ⚛️ From React\n\n```tsx\nexport function UseStateExample() {\n  const [value, setValue] = useState(0);\n  return <div>Value is: {value}</div>;\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const LocalStateExample = component$(() => {\n  const count = useSignal(0);\n  return <div>Value is: {count.value}</div>;\n});\n```\n\n<details>\n  <summary style={{color: \"#17ADF5\"}}>What if I have a more complex state?</summary>\n  <p><a href=\"https://qwik.dev/docs/core/state/#usestore\">useStore()</a> Works very similarly to useSignal(), but it takes an object as its initial value and the reactivity extends to nested objects and arrays by default. One can think of a store as a multiple-value signal or an object made of several signals.</p>\n</details>\n\n## Create a counter component\n\n### ⚛️ From React\n\n```tsx\nexport function Counter() {\n  const [count, setCount] = useState(0);\n  return (\n    <>\n      <p>Value is: {count}</p>\n      <button onClick={() => setCount(count + 1)}>Increment</button>\n    </>\n  );\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <p>Value is: {count.value}</p>\n      <button onClick$={() => count.value++}>Increment</button>\n    </>\n  );\n});\n```\n\n## Using Props\n\n### ⚛️ From React\n\n```tsx\nexport const Parent = (() => {\n  const [ count, setCount ] = useState<number>(0);\n\n  const increment = (() => {\n    setCount((prev) => prev + 1)\n  })\n  return <Child count={count} increment={increment} />;\n})\n\ninterface ChildProps {\n  count: number;\n  increment: () => void;\n}\n\nexport const Child = ((props: ChildProps) => {\n  return (\n    <>\n      <button onClick={props.increment}>Increment</button>\n      <p>Count: {props.count}</p>\n    </>\n  );\n})\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const Parent = component$(() => {\n  const userData = useStore({ count: 0 });\n  return <Child userData={userData} />;\n});\n\ninterface ChildProps {\n  userData: { count: number };\n}\n\nexport const Child = component$<ChildProps>(({ userData }) => {\n  return (\n    <>\n      <button onClick$={() => userData.count++}>Increment</button>\n      <p>Count: {userData.count}</p>\n    </>\n  );\n});\n```\n\n<details>\n  <summary style={{color: \"#17ADF5\"}}>Wait, I don't need to pass the handler as a prop?</summary>\n  <p>The reactive signal returned by <a href=\"https://qwik.dev/docs/core/state/#usesignal\">useSignal()</a> consists of an object with a single property .value. If you change the value property of the signal, any component that depends on it will be updated automatically.</p>\n</details>\n\n## Create a clock that increments every second\n\n### ⚛️ From React\n\n```tsx\nexport function Clock() {\n  const [seconds, setSeconds] = useState(0);\n  useEffect(() => {\n    const interval = setInterval(() => {\n      setSeconds(seconds + 1);\n    }, 1000);\n    return () => clearInterval(interval);\n  });\n  return <p>Seconds: {seconds}</p>;\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const Clock = component$(() => {\n  const seconds = useSignal(0);\n  useVisibleTask$(({ cleanup }) => {\n    const interval = setInterval(() => {\n      seconds.value++;\n    }, 1000);\n    cleanup(() => clearInterval(interval));\n  });\n\n  return <p>Seconds: {seconds.value}</p>;\n});\n```\n\n## Perform a fetch request every time the state changes\n\n### ⚛️ From React\n\n```tsx\nexport function Fetch() {\n  const [url, setUrl] = useState('https://api.github.com/repos/QwikDev/qwik');\n  const [responseJson, setResponseJson] = useState(undefined);\n\n  useEffect(() => {\n    fetch(url)\n      .then((res) => res.json())\n      .then((json) => setResponseJson(json));\n  }, [url]);\n\n  return (\n    <>\n      <p>{responseJson?.name} has {responseJson?.stargazers_count} ✨'s</p>\n      <input name=\"url\" value={url} onChange={(e) => setUrl(e.target.value)} />\n    </>\n  );\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const Fetch = component$(() => {\n  const url = useSignal('https://api.github.com/repos/QwikDev/qwik');\n  const responseJson = useSignal(undefined);\n\n  useTask$(async ({ track }) => {\n    track(() => url.value);\n    const res = await fetch(url.value);\n    const json = await res.json();\n    responseJson.value = json;\n  });\n\n  return (\n    <>\n      <p>{responseJson.value?.name} has {responseJson.value?.stargazers_count} ✨'s</p>\n      <input name=\"url\" bind:value={url} />\n    </>\n  );\n});\n```\n\n<details>\n  <summary style={{color: \"#17ADF5\"}}>What is useTask$ and bind?</summary>\n  <p><a href=\"https://qwik.dev/docs/core/tasks/#usetask\">useTask$()</a> registers a hook to be executed upon component creation, it will run at least once either in the server or in the browser, depending on where the component is initially rendered.</p>\n  <p><a href=\"https://qwik.dev/docs/core/rendering/#bind-attribute\">bind attribute</a> is a convenient API to two-way data bind the value of an `input` to a Signal.</p>\n</details>\n\n## Declare some context and consume it\n\n### ⚛️ From React\n\n```tsx\nexport const MyContext = createContext({ message: 'some example value' });\n\nexport default function Parent() {\n  return (\n    <MyContext.Provider value={{ message: 'updated example value' }}>\n      <Child />\n    </MyContext.Provider>\n  );\n}\n\nexport const Child = () => {\n  const value = useContext(MyContext);\n  return <p>{value.message}</p>;\n};\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const MyContext = createContextId('my-context');\n\nexport const Parent = component$(() => {\n  const message = useSignal('some example value');\n  useContextProvider(MyContext, message);\n  return (\n    <>\n      <Child />\n    </>\n  );\n});\n\nexport const Child = component$(() => {\n  const message = useContext(MyContext);\n  return <p>{message.value}</p>;\n});\n```\n\n<details>\n  <summary style={{color: \"#17ADF5\"}}>How can I avoid prop drilling?</summary>\n  <p>You simply need to create a <a href=\"https://qwik.dev/docs/core/context/#context\">context</a>.</p>\n  <p>Just create the context in the component where you need to store the information and then, in its descendants, get the information through the corresponding ContextId.</p>\n</details>\n\n## Create a debounced input\n\n### ⚛️ From React\n\n```tsx\nexport const DebouncedInput = () => {\n  const [value, setValue] = useState('');\n  const [debouncedValue, setDebouncedValue] = useState(value);\n\n  useEffect(() => {\n    const debounced = setTimeout(() => setDebouncedValue(value), 1000);\n    return () => clearTimeout(debounced);\n  }, [value]);\n\n  return (\n    <>\n      <input\n        value={value}\n        onChange={(ev) => setValue((ev.target as HTMLInputElement).value)}\n      />\n      <p>{debouncedValue}</p>\n    </>\n  );\n};\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const DebouncedInput = component$(() => {\n  const inputText = useSignal('');\n  const debouncedValue = useSignal('');\n\n  useTask$(({ track, cleanup }) => {\n    track(() => inputText.value);\n\n    const debounced = setTimeout(() => {\n      debouncedValue.value = inputText.value;\n    }, 1000);\n    cleanup(() => clearTimeout(debounced));\n  });\n\n  return (\n    <>\n      <input bind:value={inputText} />\n      <p>{debouncedValue.value}</p>\n    </>\n  );\n});\n```\n\n## Change background color randomly every button click\n\n### ⚛️ From React\n\n```tsx\nexport function DynamicBackground() {\n  const [red, setRed] = useState(0);\n  const [green, setGreen] = useState(0);\n  const [blue, setBlue] = useState(0);\n  return (\n    <div\n      style={{\n        background: `rgb(${red}, ${green}, ${blue})`,\n      }}\n    >\n      <button\n        onClick={() => {\n          setRed(Math.random() * 256);\n          setGreen(Math.random() * 256);\n          setBlue(Math.random() * 256);\n        }}\n      >\n        Change background\n      </button>\n    </div>\n  );\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const DynamicBackground = component$(() => {\n  const red = useSignal(0);\n  const green = useSignal(0);\n  const blue = useSignal(0);\n\n  return (\n    <div\n      style={{\n        background: `rgb(${red.value}, ${green.value}, ${blue.value})`,\n      }}\n    >\n      <button\n        onClick$={() => {\n          red.value = Math.random() * 256;\n          green.value = Math.random() * 256;\n          blue.value = Math.random() * 256;\n        }}\n      >\n        Change background\n      </button>\n    </div>\n  );\n});\n```\n\n## Create a component that renders a list of the presidents\n\n### ⚛️ From React\n\n```tsx\nexport function Presidents() {\n  const presidents = [\n    { name: 'George Washington', years: '1789-1797' },\n    { name: 'John Adams', years: '1797-1801' },\n    { name: 'Thomas Jefferson', years: '1801-1809' },\n    { name: 'James Madison', years: '1809-1817' },\n    { name: 'James Monroe', years: '1817-1825' },\n    { name: 'John Quincy Adams', years: '1825-1829' },\n    { name: 'Andrew Jackson', years: '1829-1837' },\n    { name: 'Martin Van Buren', years: '1837-1841' },\n    { name: 'William Henry Harrison', years: '1841-1841' },\n    { name: 'John Tyler', years: '1841-1845' },\n    { name: 'James K. Polk', years: '1845-1849' },\n    { name: 'Zachary Taylor', years: '1849-1850' },\n    { name: 'Millard Fillmore', years: '1850-1853' },\n    { name: 'Franklin Pierce', years: '1853-1857' },\n    { name: 'James Buchanan', years: '1857-1861' },\n    { name: 'Abraham Lincoln', years: '1861-1865' },\n    { name: 'Andrew Johnson', years: '1865-1869' },\n    { name: 'Ulysses S. Grant', years: '1869-1877' },\n    { name: 'Rutherford B. Hayes', years: '1877-1881' },\n    { name: 'James A. Garfield', years: '1881-1881' },\n    { name: 'Chester A. Arthur', years: '1881-1885' },\n    { name: 'Grover Cleveland', years: '1885-1889' },\n  ];\n  return (\n    <ul>\n      {presidents.map((president) => (\n        <li key={president.name + president.years}>\n          {president.name} ({president.years})\n        </li>\n      ))}\n    </ul>\n  );\n}\n```\n\n### ⚡️ To Qwik\n\n```tsx\nexport const Presidents = component$(() => {\n  const presidents = [\n    { name: 'George Washington', years: '1789-1797' },\n    { name: 'John Adams', years: '1797-1801' },\n    { name: 'Thomas Jefferson', years: '1801-1809' },\n    { name: 'James Madison', years: '1809-1817' },\n    { name: 'James Monroe', years: '1817-1825' },\n    { name: 'John Quincy Adams', years: '1825-1829' },\n    { name: 'Andrew Jackson', years: '1829-1837' },\n    { name: 'Martin Van Buren', years: '1837-1841' },\n    { name: 'William Henry Harrison', years: '1841-1841' },\n    { name: 'John Tyler', years: '1841-1845' },\n    { name: 'James K. Polk', years: '1845-1849' },\n    { name: 'Zachary Taylor', years: '1849-1850' },\n    { name: 'Millard Fillmore', years: '1850-1853' },\n    { name: 'Franklin Pierce', years: '1853-1857' },\n    { name: 'James Buchanan', years: '1857-1861' },\n    { name: 'Abraham Lincoln', years: '1861-1865' },\n    { name: 'Andrew Johnson', years: '1865-1869' },\n    { name: 'Ulysses S. Grant', years: '1869-1877' },\n    { name: 'Rutherford B. Hayes', years: '1877-1881' },\n    { name: 'James A. Garfield', years: '1881-1881' },\n    { name: 'Chester A. Arthur', years: '1881-1885' },\n    { name: 'Grover Cleveland', years: '1885-1889' },\n  ];\n  return (\n    <ul>\n      {presidents.map((president) => (\n        <li key={president.name + president.years}>\n          {president.name} ({president.years})\n        </li>\n      ))}\n    </ul>\n  );\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/redirects/index.mdx",
    "content": "---\ntitle: Redirects | Guides\ndescription: Learn how to use redirects in Qwik City.\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - mrhoodz\n  - hamatoyogi\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Redirects\n\nSometimes you want to redirect a user from the current page to another page.\n\nLet's say a user tries to go to a dashboard page but has not logged in yet. We want them to be redirected to a login page so they can be authenticated.\n\n```tsx title=\"src/routes/dashboard.tsx\"\nimport type { RequestEvent } from '@builder.io/qwik-city';\nimport { checkAuthorization } from '../auth'; // Your authorization code\nimport type { DashboardData } from '../types'; // Your types\n\nexport const onGet = async ({ cookie, redirect }: RequestEvent) => {\n  const isAuthorized = checkAuthorization(cookie.get('cookie'));\n\n  if (!isAuthorized) {\n    // User is not authorized!\n    // throw the redirect response to\n    // relocate the user to the log-in page\n    throw redirect(302, '/login');\n  } else {\n    // ...\n  }\n};\n```\n\nThe `redirect()` function, which was destructured in the RequestHandler function arguments, takes a redirect status code and URL.\n\n```tsx\nthrow redirect(302, '/login');\n```\n\n[Common redirect status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages):\n\n- `301`: Moved Permanently. This and all future requests should be directed to the given URI.\n- `302`: Found. This response code means that the URI of requested resource has been changed temporarily. Further changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.\n- `307`: Temporary Redirect. The server sends this response to direct the client to get the requested resource at another URI with the same method that was used in the prior request. This has the same semantics as the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n- `308`: Permanent Redirect. This means that the resource is now permanently located at another URI, specified by the `Location` HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n\nIf you do not provide a status code, Qwik City will default to a `302` Found status.\n\nRead more about redirect status codes [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages).\n\n## Managing multiple redirects\n\nIn some cases, you may need to manage multiple redirects based on different conditions. For example, you might want to redirect users from old URLs to new URLs after a site restructure. Additionally, you may want editors in a CMS to manage these redirects as well. Here's one of the ways you can handle multiple redirects in Qwik:\n\n```tsx title=\"src/routes/layout.tsx\"\nimport { type RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onGet: RequestHandler = async ({ url, redirect }) => {\n  // qwik city request caching ...\n\n  // example external data source\n  async function fetchRules(): Promise<\n    { source: string; destination: string; permanent: boolean }[]\n  > {\n    // Fetch data from a CMS or API, and add more rules as needed.\n    // Filter and map your data to make it easier to handle, as simulated here:\n    return [\n      { source: \"/old-path\", destination: \"/new-path\", permanent: true },\n      {\n        source: \"/another-old-path\",\n        destination: \"/another-new-path\",\n        permanent: false,\n      },\n    ];\n  }\n\n  const redirectRules = await fetchRules();\n  const redirectUrl = redirectRules.find((rule) => {\n    if (url.pathname.endsWith(\"/\")) {\n      return rule.source + \"/\" === url.pathname;\n    }\n\n    return rule.source === url.pathname;\n  });\n\n  if (redirectUrl) {\n    throw redirect(redirectUrl.permanent ? 308 : 307, redirectUrl.destination);\n  }\n};\n```\n\n> Note: This code does not include caching mechanisms. Fetching redirect rules from an external source on every request can lead to performance issues. It's recommended to implement caching to improve efficiency.\n\nThe above example demonstrates:\n\n- Layouts: Grabbing data inside a [root layout's onGet handler](https://qwik.dev/docs/routing/#middleware-layouts).\n- URL Matching: When a user requests a URL, the handler checks if it matches any source in the redirect rules.\n- Redirect Execution: If a match is found, it redirects the user to the corresponding destination URL.\n- HTTP Status Codes: Uses status code [308](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308) for permanent redirects and [307](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307) for temporary ones.\n- Content Management Integration: Enables content editors to control redirects through external data sources like a CMS or API.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/rewrites/index.mdx",
    "content": "---\ntitle: Rewrites | Guides\ndescription: Learn how to use rewrites in Qwik City.\ncontributors:\n  - omerman\nupdated_at: '2025-05-04T19:43:33Z'\ncreated_at: '2025-05-04T23:45:13Z'\n---\n\n# Rewrites\n\nSometimes you want to redirect a user from the current page to another page,\nbut you want to keep the current URL in the browser history.\n\nLet's say a user tries to access an article which is indexed by its name,\ne.g `/articles/qwik-is-very-quick`.\nbut in our code, we access it by its id, on our directory structure.\n\n```\nsrc/routes/articles/\n├── [id]\n├─── index.tsx\n```\n\n\n```tsx title=\"src/routes/plugin@article-rewrite.tsx\"\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onRequest: RequestHandler = async ({ url, rewrite }) => {\n  const pattern = /^\\/articles\\/(.*)$/;\n  // Detects /articles/<article-name>, returns null if url does not match the pattern.\n  const match = url.pathname.match(pattern);\n  if (match) {\n    const articleName = match[1];\n    const { id } = await db.getArticleByName(articleName);\n    throw rewrite(`/articles/${id}`);\n  }\n};\n```\n\nThe `rewrite()` function, which was destructured in the RequestHandler function arguments, is invoked with a pathname string.\n\n```tsx\nthrow rewrite(`/articles/777/`);\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/serialization/index.mdx",
    "content": "---\ntitle: Serialization and Serialization Boundaries | Guides\ndescription: Learn about serialization and serialization boundaries in Qwik, the process of converting data into a format that can be stored or transmitted.\ncontributors:\n  - fabien0102\n  - wuweiweiwu\n  - manucorporat\n  - adamdbradley\n  - voluntadpear\n  - mrhoodz\n  - hamatoyogi\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-30T17:37:51Z'\n---\n\n# `$` Boundaries\n\n## Rules\n\n- Only serializable data can cross a `$` boundary.\n\n## Serialization Boundary\n\nA serialization boundary occurs whenever you cross a lexical scope of a function that is converted into lazy loadable form. It is always denoted by `$(...)` (or `____$(...)`) See example:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\n\nexport const topLevel = Promise.resolve('nonserializable data');\n\nexport class MyCustomClass {\n  val: string;\n\n  constructor(val: string) {\n    this.val = val;\n  }\n}\n\nexport const Greeter = component$(() => {\n  // BEGIN component serialization boundary\n\n  // Referring to top level symbols that are exported is always allowed.\n  console.log(topLevel); // OK\n\n  const captureSerializable = 'serializable data';\n  const capturePromise = Promise.resolve('Qwik serializes promises');\n  // Instances of custom classes are not serializable.\n  const captureNonSerializable = new MyCustomClass('non serializable');\n\n  return (\n    <button\n      onClick$={() => {\n        // BEGIN onClick serialization boundary\n\n        // Referring to top level symbols that are exported is always allowed,\n        // even if the value is non-serializable.\n        console.log(topLevel); // OK\n\n        // Capturing a non-top-level variable is allowed only if:\n        // - declared as `const`\n        // - is serializable (runtime error)\n        console.log(captureSerializable); // OK\n        console.log(capturePromise); // OK\n\n        // Referring to captureNonSerializable will pass static analysis but\n        // will fail at runtime because Qwik does not know how to serialize it.\n        console.log(captureNonSerializable); // RUNTIME ERROR\n\n        // END onClick serialization boundary\n      }}\n    >\n      click\n    </button>\n  );\n  // END component serialization boundary\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/guides/static-site-generation/index.mdx",
    "content": "---\ntitle: Static Site Generation (SSG) Overview | Guides\ndescription: Learn how static site generation (SSG) works in Qwik City.\ncontributors:\n  - adamdbradley\n  - AnthonyPAlicea\n  - mhevery\n  - ibousfiha\n  - Kocal\n  - eric-burel\n  - julianobrasil\n  - mrhoodz\n  - hamatoyogi\nupdated_at: '2023-10-04T10:27:27Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Static Site Generation (SSG) Overview\n\nStatic Site Generation, or commonly referred to as \"SSG\", is the process of pre-rendering site webpages into static HTML files. The benefit is that when a visitor requests the webpage, the response is a pre-generated HTML file (a static file), and doesn't require the webpage's HTML to \"rebuild\" on the visitor's browser, or dynamically created by your server (more on this later).\n\nAdditionally, due to Qwik's underlying architecture, page performance also benefits by not requiring a Javascript \"hydration\" step, which can significantly lower performance and slow down user interactivity. By pre-rendering static `index.html` files with SSG, and combined with Qwik's [resumability](../../../(qwik)/concepts/resumable/index.mdx), static site generation offers many performance benefits over legacy solutions.\n\n## SSG vs. Server-Side Rendered (SSR)\n\nQwik City is capable of taking a Qwik application, no matter if it's a \"webapp\" or \"website\", and generate static HTML. Once it's generated as HTML, Qwik is fundamentally able to skip rebuilding the app by using [resumability](../../../(qwik)/concepts/resumable/index.mdx), since the app was already generated as HTML. Both Static Site Generation (SSG) and Server-Side Rendering (SSR) use the same process to generate the HTML. The main difference between the SSG and SSR however, is \"when\" the HTML is generated.\n\nIn a traditional setup, SSG pre-renders each webpage at build-time, while SSR render's each webpage on-demand for each HTTP request. SSG only needs to generate the HTML one time per build, which is great for webpages where multiple visitors should see the same content. In contrast, SSR is great when the webpage may be different for each visitor, and would need to render custom HTML for each individual HTTP request.\n\nFor example, SSG is ideal for a blog or docs site, where all the content should be the same for multiple visitors. While SSR may work fine for a blog, it may be an unnecessary strain for your HTTP servers to render the blog content for every visitor, even though they'd all end up seeing the same HTML.\n\nHowever, an account dashboard would commonly have different content for each signed-in user. In this setup, each user should get their own rendered HTML with their account information, rather than everyone seeing the exact same content. This is where SSR would be preferred.\n\nIdeally, the more you can do with static site generation the better, since that'll have less costs to your servers and faster response times.\n\nWith Qwik City however, the decision to use SSG or SSR, does not have to be one or the other decision. Instead, your own implementation can choose to have some route paths use SSG, while some other pages use SSR. It's entirely up to you and your requirements.\n\n## Static Site Generation Config\n\nStatic site generation is created from the built in adapter, to create an adapter run:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add static\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add static\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add static\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add static\n```\n</span>\n</PackageManagerTabs>\n\nSelect `Adapter: Static site (.html files)`. Done!\n\n### Changes\n\nRunning the above command will make the following changes to your project:\n\n- A `build.server` script will be automatically added to your `package.json` file.\n- A `adapters/static/vite.config.ts` file will be created.\n\nYour build files will be generated into the `dist` folder.\n\nYou can build your static site using:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build.server\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build.server\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build.server\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build.server\n```\n</span>\n</PackageManagerTabs>\n\n### SSG Config\n\nThe `adapters/static/vite.config.ts` file also includes the SSG config, which would be custom for each implementation.\n\n#### `origin`\n\nThe URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the `origin` does _not_ include a `pathname`.\n\nThe `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate a complete URL rather than just the `pathname`. For example, in order to render a correct canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.\n\nIf the site also starts with a pathname other than `/`, please use the `base` option in the Vite config options (the `basePathname` option in the Qwik City config options is deprecated).\n\n#### `outDir`\n\nThe `outDir` is a file system output directory where the static files should be written. In the example above, it's using Node's [fileURLToPath](https://nodejs.org/api/url.html#urlfileurltopathurl) to create an absolute file system path to write the static HTML files to.\n\n### Javascript Runtimes\n\nFor a Javascript project, it's quite common for the build's runtime to be built on top of [Node.js](https://nodejs.org/en/docs/). However, the core of Qwik City static site generation isn't tied to using only Node.js, which is why the `qwikCityGenerate()` function is imported from `@builder.io/qwik-city/static/node`. By scoping the generate function to a specific runtime, such as Node.js, this gives Qwik City the flexibility to also generate SSG from other runtimes in the future, such as [Deno](https://deno.land/) or [Bun](https://bun.sh/).\n\n## Dynamic SSG Routes\n\nSo far, we've only discussed how to generate static HTML files for a single route path. However, in most cases, you'll want to generate HTML files for multiple route paths that has dynamic params. For example, a product site may have a route path for each product, such as `/product/:id`. In this case, you'll want to generate HTML files for each product page, which would require generating HTML files for each product ID.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation, type StaticGenerateHandler } from '@builder.io/qwik-city';\nimport { loadProductIds } from './load-product-ids';\n\nexport default component$(() => {\n  const { params } = useLocation();\n\n  return <p>Example: {params.id}</p>;\n});\n\nexport const onStaticGenerate: StaticGenerateHandler = async ({ env }) => {\n  // example of loading params for this use case\n  // every implementation will be different\n  const ids = await loadProductIds({\n    apiKey: env.get('API_KEY'),\n  });\n\n  return {\n    params: ids.map((id) => {\n      return { id };\n    }),\n  };\n};\n```\n\nIn the above example, the `onStaticGenerate()` function is loading the product IDs from a `loadProductIds()` function by requesting an API behind an API key retrieved from an environment variable.\nThis function would be custom for each implementation, but the general idea is that you'll need to load the data for each product ID, and then generate HTML files for each product ID.\n\nThe `onStaticGenerate` function should be exported from the top-level of the module, and should return an object with a `params` property. The `params` property should be an array of objects, where each object is a set of params for the route path. For example, if the route path is `/product/:id`, then the `params` array should be an array of objects with an `id` property.\n\nThe directory structure for this example would be:\n\n```bash\nsrc/\n└── routes/\n    └── product/\n        └── [id]/\n            └── index.tsx\n```\n\nNotice that the `index.tsx` file is inside a directory named `[id]`. This is a special directory name that tells Qwik City to generate HTML files for each `id` param. The `index.tsx` file is the default file that Qwik City will use when generating HTML files for a route path.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/html-attributes/index.mdx",
    "content": "---\ntitle: HTML attributes | QwikCity\ndescription: Learn how to add attributes to the html tag, in order to add \"lang\" or other custom attributes.\ncontributors:\n  - bab2683\n  - hamatoyogi\nupdated_at: '2023-08-23T23:06:42Z'\ncreated_at: '2023-08-23T23:06:42Z'\n---\n\n# HTML attributes\n\nOccasionally, it is necessary to add attributes to a website to enable specific functionalities, such as controlling the application's theme, determining text direction with the `﻿dir` attribute, or setting the page language with the `﻿lang` attribute. Typically, adding these attributes to the HTML tag is practical since it generally serves as the application's container.\n\nTo apply these attributes in Qwik city, add them to `containerAttributes` in the `src/entry.ssr.tsx` file:\n\n```tsx\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    manifest,\n    ...opts,\n    // Use container attributes to set attributes on the html tag.\n    containerAttributes: {\n      lang: \"en-us\",\n      ...opts.containerAttributes,\n    },\n  });\n}\n```\n\nIn addition, the `opts.serverData` object and nested objects allow you to access information about the request, including ﻿`request headers`, `url`, `route params`, and more. Leveraging this information enables you to do the following:\n\n```tsx\nexport default function (opts: RenderToStreamOptions) {\n  // With this route structure src/routes/[locale]/post/[id]/index.tsx\n  const isRTL = opts.serverData?.qwikcity.params.locale === 'ar';\n\n  return renderToStream(<Root />, {\n    manifest,\n    ...opts,\n    containerAttributes: {\n      dir: isRTL ? 'rtl' : 'ltr'\n      ...opts.containerAttributes,\n    },\n  });\n}\n```\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/layout/index.mdx",
    "content": "---\ntitle: Layout & Middleware | Guides\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - Oyemade\n  - mhevery\n  - nnelgxorz\n  - the-r3aper7\n  - mrhoodz\n  - aendel\n  - jemsco\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Nested Layouts\n\nLayouts provide **nested UI and request handling (middleware)** to a set of routes:\n\n- **Shared request handling**: Accomplished by adding an `onRequest` method.\n- **Shared UI**: Accomplished by `export default` a Qwik component.\n\n## Example\n\nNow, combine all the previously discussed concepts to build a full app.\n\nIn the proposed example, you will notice a site with 2 pages: `https://example.com` and `https://example.com/about`. The goal is to add a common header and footer to all the pages, the only difference between the pages is the content in the middle.\n\n```\n┌───────────────────────────────────────────────────┐\n│ Header                                            │\n├─────────┬─────────────────────────────────────────┤\n│ Menu    │ <ROUTE_SPECIFIC_CONTENT>                │\n│ - home  │                                         │\n│ - about │                                         │\n│         │                                         │\n├─────────┴─────────────────────────────────────────┤\n│ Footer                                            │\n└───────────────────────────────────────────────────┘\n```\n\nFirst, create three components: `<Header>`, `<Footer>`, and `<Menu>`.\n\n> The developer could copy-paste these components manually into each page component, but that is repetitive and error-prone. **Instead, use layouts to automatically reuse common parts.**\n\n### Routes directory\n\n```bash\nsrc/\n├── components/\n│   ├── header.tsx         # Header component implementation\n│   ├── footer.tsx         # Footer component implementation\n│   └── menu.tsx           # Menu component implementation\n└── routes/\n    ├── layout.tsx         # Layout implementation using: <Header>, <Footer>, and <Menu>\n    ├── about/\n    │   └── index.tsx      # https://example.com/about\n    └── index.tsx          # https://example.com\n```\n\n### `src/routes/layout.tsx`\n\nIt will be used for all routes under the `src/routes` directory. It will render the `Header`, `Menu`, and `Footer` components, and also render the nested routes under the `Slot` component.\n\n```tsx title=\"src/routes/layout.tsx\"\nimport { component$, Slot } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <Header />\n      <Menu />\n      <Slot /> {/* <== This is where the route will be inserted */}\n      <Footer />\n    </>\n  );\n});\n```\n\n### `src/routes/index.tsx`\n\nThis is the main route for the site. It will be rendered within the `Slot` component in the `src/routes/layout.tsx` file. Even though the `Header`, `Menu`, or `Footer` components are not referenced, it will still be rendered with them.\n\n```tsx title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <>Home</>;\n});\n```\n\n### `src/routes/about/index.tsx`\n\nSimilar to the `src/routes/index.tsx` file, the `about` route will also be rendered within the `Slot` component in the `src/routes/layout.tsx` file. Even though the `Header`, `Menu`, or `Footer` components are not referenced, it will still be rendered with them.\n\n```tsx title=\"src/routes/about/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <>About</>;\n});\n```\n\nWhen you run the app, Qwik will render the `About` nested inside the `RootLayout`\n\n```tsx\n<RootLayout>\n  <AboutPage />\n</RootLayout>\n```\n\n[Here](https://qwik.dev/docs/advanced/routing/#named-layout) you can read more about advanced routing scenarios like named layout.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/middleware/index.mdx",
    "content": "---\ntitle: Middleware | Guides\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - CoralWombat\n  - EamonHeffernan\n  - lollyxsrinand\n  - gparlakov\n  - mrhoodz\n  - harishkrishnan24\n  - jemsco\nupdated_at: '2023-09-18T19:04:44Z'\ncreated_at: '2023-06-13T06:46:09Z'\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\n\n\n# Middleware\n\nQwik City comes with server middleware that allows you to centralize and chain logic such as authentication, security, caching, redirects, and logging. Middleware can also be used to define endpoints. Endpoints are useful for returning data such as  RESTful API, or GraphQL API.\n\nMiddleware consists of a set of functions that are called in a specific order defined by the route. A middleware which returns a response is called an [endpoint](/docs/endpoints/).\n\n## Middleware Function\n\nMiddleware is defined by exporting a function called `onRequest` (or `onGet`, `onPost`, `onPut`, `onPatch`, and `onDelete`) in the `layout.tsx` or `index.tsx` file inside of `src/routes` folder. \n\nThis example shows a simple `onRequest` middleware function that logs all requests. \n\nFile: `src/routes/layout.tsx`\n```typescript\nimport type { RequestHandler } from '@builder.io/qwik-city';\n \nexport const onRequest: RequestHandler = async ({next, url}) => {\n  console.log('Before request', url);\n  await next();\n  console.log('After request', url);\n};\n```\nIf you want to intercept a specific HTTP method you can use one of these variations. If you use both `onRequest` and `onGet` for example then both will execute but `onRequest` will execute before `onGet` in the chain.\n```typescript\n// Called only with a specific HTTP method\nexport const onGet: RequestHandler = async (requestEvent) => { ... }\nexport const onPost: RequestHandler = async (requestEvent) => { ... }\nexport const onPut: RequestHandler = async (requestEvent) => { ... }\nexport const onPatch: RequestHandler = async (requestEvent) => { ... }\nexport const onDelete: RequestHandler = async (requestEvent) => { ... }\n```\n\nEach middleware function is passed a [`RequestEvent`](#requestevent) object which allows the middleware to control the response.\n\n\n## Order of Invocation\n\nThe order of the middleware function chain is determined by their location. Starting from the topmost `layout.tsx` and ending at the `index.tsx` for a given route. (Same resolution logic as the order of layout and route component as defined by the route path.)\n\nFor example, if the request is `/api/greet/` in the following folder structure, the invocation order is as follows:\n\n```bash\nsrc/\n└── routes/\n    ├── layout.tsx            # Invocation order: 1 (first)\n    └── api/\n        ├── layout.tsx        # Invocation order: 2   \n        └── greet/\n            └── index.ts      # Invocation order: 3 (last)\n```\n\nQwik City looks into each file in order and checks to see if it has `onRequest` (or `onGet`, `onPost`, `onPut`, `onPatch`, and `onDelete`) exported functions. If found the function gets added into the middleware execution chain in that order. \n\n`routeLoader$` and `routeAction$` are also part of the middleware. They execute after the `on*` functions and before the default exported component.\n\n## Component as an HTML Endpoint\n\nYou can think of component rendering as an implicit HTML endpoint. Therefore if `index.tsx` has a default export component, then the component implicitly becomes an endpoint in the middleware chain. Because component rendering is part of the middleware chain this allows you to intercept component rendering, for example as part of authentication, logging or other cross-cutting concerns. \n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/component/index.tsx\">\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ redirect }) => {\n  if (!isLoggedIn()) {\n    throw redirect(308, '/login');\n  }\n};\n\nexport default component$(() => {\n  return <div>You are logged in.</div>;\n});\n\nfunction isLoggedIn() {\n  return true; // Mock login as true\n}\n```\n</CodeSandbox>\n\n\n## `RequestEvent`\n\nAll middleware functions are passed a `RequestEvent` object which can be used to control the flow of HTTP response. For example, you can read/write cookies, headers, redirect, produce responses and exit the middleware chain early. Middleware functions are executed in the order as described above, from the topmost `layout.tsx` to the last `index.tsx`. \n\n\n### `next()`\n\nUse the `next()` function to execute the next middleware function in the chain. This is the default behavior when a middleware function returns normally, without an explicit call to `next()`. One can use the `next()` function to achieve a wrapping behavior around the next middleware function.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/next/index.tsx\">\n```tsx /next()/\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\n// Generic function `onRequest` is executed first\nexport const onRequest: RequestHandler = async ({ next, sharedMap, json }) => {\n  const log: string[] = [];\n  sharedMap.set('log', log);\n\n  log.push('onRequest start');\n  await next(); // Execute next middleware function (onGet)\n  log.push('onRequest end');\n\n  json(200, log);\n};\n\n// Specific functions such as `onGet` are executed next\nexport const onGet: RequestHandler = async ({ next, sharedMap }) => {\n  const log = sharedMap.get('log') as string[];\n\n  log.push('onGET start');\n  // execute next middleware function\n  // (in our case, there are no more middleware functions nor components.)\n  await next();\n  log.push('onGET end');\n};\n```\n</CodeSandbox>\n\nIn general, a normal (non-exception) return of a function will execute the next function in the chain. However, throwing an error from the function will stop the execution chain. This is typically used for authentication or authorization and returning a `401` or `403` HTTP status code. Because the `next()` is implicit, it is necessary to `throw` an error to prevent calling the next middleware function in the chain.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/throw/index.tsx\">\n```tsx /next()/\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ next, sharedMap, json }) => {\n  const log: string[] = [];\n  sharedMap.set('log', log);\n\n  log.push('onRequest');\n  if (isLoggedIn()) {\n    // normal behavior call next middleware\n    await next();\n  } else {\n    // If not logged in throw to prevent implicit call to the next middleware.\n    throw json(404, log);\n  }\n};\n\nexport const onGet: RequestHandler = async ({ sharedMap }) => {\n  const log = sharedMap.get('log') as string[];\n  log.push('onGET');\n};\n\nfunction isLoggedIn() {\n  return false; // always return false as mock example\n}\n```\n</CodeSandbox>\n\n### `sharedMap`\n\nUse `sharedMap` as a way to share data between middleware functions. The `sharedMap` is scoped to HTTP request. A common use case is to use `sharedMap` to store user details so that it can be used by other middleware functions, `routeLoader$()` or components.\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/sharedMap/index.tsx\">\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport {\n  routeLoader$,\n  type RequestHandler,\n  type Cookie,\n} from '@builder.io/qwik-city';\n\ninterface User {\n  username: string;\n  email: string;\n}\n\nexport const onRequest: RequestHandler = async ({\n  sharedMap,\n  cookie,\n  send,\n}) => {\n  const user = loadUserFromCookie(cookie);\n  if (user) {\n    sharedMap.set('user', user);\n  } else {\n    throw send(401, 'NOT_AUTHORIZED');\n  }\n};\n\nfunction loadUserFromCookie(cookie: Cookie): User | null {\n  // this is where you would check cookie for user.\n  if (cookie) {\n    // just return mock user for this demo.\n    return {\n      username: `Mock User`,\n      email: `mock@users.com`,\n    };\n  } else {\n    return null;\n  }\n}\n\nexport const useUser = routeLoader$(({ sharedMap }) => {\n  return sharedMap.get('user') as User;\n});\n\nexport default component$(() => {\n  const log = useUser();\n  return (\n    <div>\n      {log.value.username} ({log.value.email})\n    </div>\n  );\n});\n```\n</CodeSandbox>\n\n### `headers`\n\nUse `headers` to set response headers associated with the current request.\n(For reading request headers see [`request.headers`](#request).) Middleware can manually add response headers to the response, using the `headers` property.\n\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/headers/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ headers, json }) => {\n  headers.set('X-SRF-TOKEN', Math.random().toString(36).replace('0.', ''));\n  const obj: Record<string, string> = {};\n  headers.forEach((value, key) => (obj[key] = value));\n  json(200, obj);\n};\n```\n</CodeSandbox>\n\n### `cookie`\n\nUse `cookie` to set and retrieve cookie information for a request. Middleware can manually read and set cookies, using the `cookie` function. This might be useful for setting a session cookie, such as a JWT token, or a cookie to track a user.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/cookie/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ cookie, json }) => {\n  let count = cookie.get('Qwik.demo.count')?.number() || 0;\n  count++;\n  cookie.set('Qwik.demo.count', count);\n  json(200, { count });\n};\n```\n</CodeSandbox>\n\n### `method`\n\nReturns current HTTP request method: `GET`, `POST`, `PATCH`, `PUT`, `DELETE`.\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/method/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ method, json }) => {\n  json(200, { method });\n};\n```\n</CodeSandbox>\n\n### `url`\n\n\nReturns current HTTP request URL. (Use `useLocation()` if you need the current URL in a component. The `url` is meant for middleware functions.)\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/url/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ url, json }) => {\n  json(200, { url: url.toString() });\n};\n```\n</CodeSandbox>\n\n\n### `basePathname`\n\n\nReturns the current base pathname URL of where the application is mounted. Typically this is `/` but it can be different if the application is mounted in a sub-path. See vite `qwikCity({root: '/my-sub-path-location'})`.\n\n\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/basePathname/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ basePathname, json }) => {\n  json(200, { basePathname });\n};\n```\n</CodeSandbox>\n\n\n### `params`\n\nRetrieve the \"params\" of the URL. For example `params.myId` will allow you to retrieve the `myId` from this route definition `/base/[myId]/something`.\n\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/params/[myId]/index.tsx\" url=\"/src/routes/demo/qwikcity/middleware/params/some-id/\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ params, json }) => {\n  json(200, { params });\n};\n```\n</CodeSandbox>\n\n### `query`\n\nUse `query` to retrieve the URL query parameters. (This is a shorthand for `url.searchParams`.) It is provided for the middleware functions, and components should use `useLocation()` API.\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/query/index.tsx\" url=\"/src/routes/demo/qwikcity/middleware/query/?someKey=someValue\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ query, json }) => {\n  const obj: Record<string, string> = {};\n  query.forEach((v, k) => (obj[k] = v));\n  json(200, obj);\n};\n```\n</CodeSandbox>\n\n### `parseBody()`\n\nUse `parseBody()` to parse form data submitted to the URL.\n\nThis method will check the request headers for a `Content-Type` header and parse the body accordingly. It supports `application/json`, `application/x-www-form-urlencoded`, and `multipart/form-data` content types.\n\nIf the `Content-Type` header is not set, it will return `null`.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/parseBody/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ html }) => {\n  html(\n    200,\n    `\n      <form id=\"myForm\" method=\"POST\">\n        <input type=\"text\" name=\"project\" value=\"Qwik\"/>\n        <input type=\"text\" name=\"url\" value=\"http://qwik.dev\"/>\n      </form>\n      <script>myForm.submit()</script>`\n  );\n};\n\nexport const onPost: RequestHandler = async ({ parseBody, json }) => {\n  json(200, { body: await parseBody() });\n};\n```\n</CodeSandbox>\n\n### `cacheControl`\n\nConvenience API for setting the cache header.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/cacheControl/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({\n  cacheControl,\n  headers,\n  json,\n}) => {\n  cacheControl({ maxAge: 42, public: true });\n  const obj: Record<string, string> = {};\n  headers.forEach((value, key) => (obj[key] = value));\n  json(200, obj);\n};\n```\n</CodeSandbox>\n\n### `platform`\n\nDeployment platform (Azure, Bun, Cloudflare, Deno, Google Cloud Run, Netlify, Node.js, Vercel, etc...) specific API.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/platform/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ platform, json }) => {\n  json(200, Object.keys(platform));\n};\n```\n</CodeSandbox>\n\n\n### `locale()`\n\nSet or retrieve the current locale.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/locale/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = async ({ locale, request }) => {\n  const acceptLanguage = request.headers.get('accept-language');\n  const [languages] = acceptLanguage?.split(';') || ['?', '?'];\n  const [preferredLanguage] = languages.split(',');\n  locale(preferredLanguage);\n};\n\nexport const onGet: RequestHandler = async ({ locale, json }) => {\n  json(200, { locale: locale() });\n};\n```\n</CodeSandbox>\n\n### `status()`\n\nSet the status of the response independently of writing the response, useful for streaming. Endpoints can manually change the HTTP status code of the response, using the `status()` method.\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/status/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ status, getWritableStream }) => {\n  status(200);\n  const stream = getWritableStream();\n  const writer = stream.getWriter();\n  writer.write(new TextEncoder().encode('Hello World!'));\n  writer.close();\n};\n```\n</CodeSandbox>\n\n\n### `redirect()` \n\nRedirect to a new URL. Notice the importance of throwing to prevent other middleware functions from running. The `redirect()` method will automatically set the `Location` header to the redirect URL.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/redirect/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ redirect, url }) => {\n  throw redirect(\n    308,\n    new URL('/demo/qwikcity/middleware/status/', url).toString()\n  );\n};\n```\n</CodeSandbox>\n\n### `error()`\n\nSet an error response.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/error/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ error }) => {\n  throw error(500, 'ERROR: Demonstration of an error response.');\n};\n```\n</CodeSandbox>\n\n\n### `text()`\n\nSend a text-based response. Creating a text endpoint is as simple as calling the `text(status, string)` method. The `text()` method will automatically set the `Content-Type` header to `text/plain; charset=utf-8`.\n\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/text/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ text }) => {\n  text(200, 'Text based response.');\n};\n```\n</CodeSandbox>\n\n\n\n### `html()`\n\nSend an HTML response.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/html/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ html }) => {\n  html(\n    200,\n    ` \n      <html>\n        <body>\n          <h1>HTML response</h1>\n        </body>\n      </html>`\n  );\n};\n```\n</CodeSandbox>\n\n\n\n### `json()`\n\nCreating a JSON endpoint is as simple as calling the `json(status, object)` method. The `json()` method will automatically set the `Content-Type` header to `application/json; charset=utf-8` and JSON stringify the data.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/json/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ json }) => {\n  json(200, { hello: 'world' });\n};\n```\n</CodeSandbox>\n\n### `send()`\n\nCreating a raw endpoint is as simple as calling the `send(Response)` method. The `send()` method takes a standard `Response` object, which can be created using the `Response` constructor.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/send/index.tsx\">\n```tsx\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({send}) => {\n  const response = new Response('Hello World', {\n    status: 200,\n    headers: {\n      'Content-Type': 'text/plain',\n    },\n  });\n  send(response);\n};\n```\n</CodeSandbox>\n\n### `exit()`\n\nThrow to stop the execution of the middleware functions.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/exit/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ exit }) => {\n  throw exit();\n};\n```\n</CodeSandbox>\n\n### `env`\n\nRetrieve environmental property in a platform-independent way.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/env/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ env, json }) => {\n  json(200, {\n    USER: env.get('USER'),\n    MODE_ENV: env.get('MODE_ENV'),\n    PATH: env.get('PATH'),\n    SHELL: env.get('SHELL'),\n  });\n};\n```\n</CodeSandbox>\n\n### `getWritableStream()`\n\n\nSet stream response.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/getWritableStream/index.tsx\">\n```tsx\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async (requestEvent) => {\n  requestEvent.headers.set('content-type','text/event-stream')  \n  const writableStream = requestEvent.getWritableStream();\n  const writer = writableStream.getWriter();\n  const encoder = new TextEncoder();\n\n  writer.write(encoder.encode('Hello World\\n'));\n  await wait(100);\n  writer.write(encoder.encode('After 100ms\\n'));\n  await wait(100);\n  writer.write(encoder.encode('After 200ms\\n'));\n  await wait(100);\n  writer.write(encoder.encode('END'));\n  writer.close();\n};\n\nconst wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n```\n</CodeSandbox>\n\n\n### `headerSent`\n\n\nCheck to see if the header has been set.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/headerSent/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ headersSent, json }) => {\n  if (!headersSent) {\n    json(200, { response: 'default response' });\n  }\n};\n\nexport const onRequest: RequestHandler = async ({ status }) => {\n  status(200);\n};\n```\n</CodeSandbox>\n\n\n\n### `request`\n\nGet the HTTP request object. Useful for getting hold of the request data such as the headers.\n\n<CodeSandbox src=\"/src/routes/demo/qwikcity/middleware/request/index.tsx\">\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = async ({ json, request }) => {\n  const obj: Record<string, string> = {};\n  request.headers.forEach((v, k) => (obj[k] = v));\n  json(200, { headers: obj });\n};\n```\n</CodeSandbox>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/pages/index.mdx",
    "content": "---\ntitle: Pages | Qwik City\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - Oyemade\n  - the-r3aper7\n  - mhevery\n  - nnelgxorz\n  - igorbabko\n  - solamichealolawale\n  - mrhoodz\n  - VinuB-Dev\n  - nhayhoc\n  - gioboa\n  - jemsco\nupdated_at: '2024-03-27T18:37:26Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Pages\n\nPages are created by adding a new `index.tsx` file in the `src/routes` directory. Pages export a `default` Qwik component, which will be rendered as the content of the page.\n\n```tsx title=\"src/routes/some/path/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\n// Notice the default export\nexport default component$(() => {\n  return <h1>Hello World!</h1>;\n});\n```\n\n> The only difference between a page and an endpoint is that an endpoint only exports an `onRequest`, `onGet`, `onPost`, `onPut`, `onDelete`, `onPatch`, or `onHead` function, which will be used to handle the incoming request.\n\n\n## `head` export\n\nEvery page can export a `head` property (or function) that returns a `DocumentHead` object. The `DocumentHead` object is used to resolve the title of the page, as well as the meta, links and styles.\n\nThis API allows you to set the title of the page, as well as the meta, open graph, twitter tags and links. This is useful for SEO and social sharing.\n\n```tsx {8} /head/ title=\"src/routes/about/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport type { DocumentHead } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return <h1>About page</h1>;\n});\n\nexport const head: DocumentHead = {\n  // This will be used to resolve the <title> of the page\n  title: 'About page',\n  meta: [\n    {\n      name: 'description',\n      content: 'This is the about page',\n    },\n    // Open graph\n    {\n      property: 'og:title',\n      content: 'About page',\n    },\n    {\n      property: 'og:description',\n      content: 'This is the about page',\n    },\n  ],\n  links: [\n    {\n      rel: 'canonical',\n      href: 'https://example.com/about',\n    },\n  ],\n};\n```\n\nThe example above sets the title, as well as some [Open Graph](https://ogp.me/) meta and the [canonical link](https://developers.google.com/search/docs/crawling-indexing/canonicalization).\n\n> HTML places the `<head>` tag as the first element within `<html>` (at the very top of the HTML content). The `<head>` section is not something that your route component renders directly because it would break the HTML streaming.\n\nLook into `useDocumentHead()` to read and consume the `DocumentHead` object from within your component.\n\n### Dynamic Head\n\nYou can also export a function that returns a `DocumentHead` object, allowing you to programmatically set the `<title>`, `<meta>` or `<link>` tags.\n\nThis allows you to configure the `<head>`, including the title, meta or links using data from `routeLoader$()` or `routeAction$()`.\n\nWe can use the `resolveValue` method to get the value of a `routeLoader$()` or `routeAction$()` within the `head` function.\n\n```tsx title=\"src/routes/jokes/[jokeId]/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport type { DocumentHead } from '@builder.io/qwik-city';\n\nexport const useJoke = routeLoader$(async (requestEvent) => {\n  // Fetch a joke from a public API\n  const jokeId = requestEvent.params.jokeId;\n  const response = await fetch(`https://api.chucknorris.io/jokes/${jokeId}`);\n  const joke = await response.json();\n  return joke;\n});\n\n// Now we can export a function that returns a DocumentHead object\nexport const head: DocumentHead = ({resolveValue, params}) => {\n  const joke = resolveValue(useJoke);\n  return {\n    title: `Joke \"${joke.title}\"`,\n    meta: [\n      {\n        name: 'description',\n        content: joke.text,\n      },\n      {\n        name: 'id',\n        content: params.jokeId,\n      },\n    ],\n  };\n};\n```\n\n### Nested Layouts and Head\n\nIn an advanced case, a [layout](/docs/(qwikcity)/layout/index.mdx) may want to modify the document title of an already resolved document head. In the example below, the page component returns the title of `Foo`. The containing layout component can read the value of the page's document head and modify it. In this example, the layout component is adding `MyCompany - ` to the title, so that when rendered, the title will be `MyCompany - Foo`. Every layout in the stack has the opportunity to return a new value.\n\n```bash\n──src/\n  └─routes/\n    ├─index.tsx\n    └─layout.tsx\n```\n\n```tsx title=\"src/routes/index.tsx\"\nexport const head: DocumentHead = {\n  title: `Foo`,\n};\n```\n\n```tsx title=\"src/routes/layout.tsx\"\nexport const head: DocumentHead = ({ head }) => {\n  return {\n    title: `MyCompany - ${head.title}`,\n  };\n};\n```\n\n### Google Structured Data\n\nThis example integrates [Google Structured Data](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data)\nwhich helps by providing explicit clues about the meaning of a page to Google.\nIf you want to embed custom JavaScript code, it would be ideal to do it lazily with [Partytown](https://partytown.qwik.dev/).\nSometimes, however, you are forced to load them immediately. The following example illustrates this.\n\n```tsx {8} /head/ title=\"src/routes/about/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport type { DocumentHead } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return <h1>About page</h1>;\n});\n\nexport const head: DocumentHead = {\n  scripts: [\n    {\n      props: {\n        type: \"application/ld+json\",\n      },\n      script: JSON.stringify({\n        \"@context\": \"https://schema.org\",\n        \"@type\": \"ItemList\",\n      }),\n    },\n  ],\n};\n```\nThe example above sets some [Structured Data Markup](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data?hl=en).\n\n> **Note**: You need to change `router-head` component to render `head.scripts`.\n\n```tsx {8} /head/ title=\"src\\components\\router-head\\router-head.tsx\"\nimport { component$ } from \"@builder.io/qwik\";\nimport { useDocumentHead, useLocation } from \"@builder.io/qwik-city\";\n\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      {/* add this  */}\n      {head.scripts.map((s) => (\n        <script key={s.key} {...s.props} dangerouslySetInnerHTML={s.script} />\n      ))}\n    </>\n  );\n});\n\n```\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/project-structure/index.mdx",
    "content": "---\ntitle: Project Structure | Qwik City\ncontributors:\n  - manucorporat\n  - steve8708\n  - mhevery\n  - dapids\n  - thejackshelton\n  - mrhoodz\n  - whale2002\n  - adamdbradley\n  - jemsco\nupdated_at: '2023-09-21T06:23:47Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n\n# Project Structure\n\nA typical Qwik project looks like this:\n\n```bash\nqwik-app-demo\n├── README.md\n├── package.json\n├── public\n│   └── favicon.svg\n├── src\n│   ├── components\n│   │   └── router-head\n│   │       └── router-head.tsx\n│   ├── entry.ssr.tsx\n│   ├── global.css\n│   ├── root.tsx\n│   └── routes\n│       ├── flower\n│       │   ├── flower.css\n│       │   └── index.tsx\n│       ├── index.tsx\n│       └── layout.tsx\n├── tsconfig.json\n└── vite.config.ts\n```\n\n## Project files\n\n### `src/routes/`\n\nThe `src/routes/` directory is a special directory where Qwik City will look for your pages. Folders and files inside this directory have a special meaning and they will be mapped to the URL of your app.\n\n- `src/routes/index.tsx` is the homepage of your app.\n- `src/routes/layout.tsx` is the root layout of your app, all pages will be rendered inside this layout.\n\n> Refer to the [Routing](/docs/routing) section for more information.\n\n### `src/components/`\n\nThe directory named `src/components/` follows a standard convention. It's present in all Qwik starters and you can rename it if you prefer. The `src/components/` directory is where to put your components (i.e. reusable pieces of code that can be used in multiple places). These components are not routes or layouts, but they can be referenced from within your route or layout code.\n\n\nFor example, a `Button` component should be inside `src/components/button/button.tsx`.\n\n### `public/`\n\nThe `public/` directory contains static assets such as images, fonts, and icons. When you build your app, these files will be copied to the `dist/` directory and served at the root.\n\nRefer to [Vite configuration for more information](https://vitejs.dev/guide/build.html#public-base-path).\n\n### `src/entry.ssr.tsx`\n\nThe SSR entry point is the common entry point in all cases where the application is rendered outside of the browser.\n\n- Server (express, cloudflare...)\n- `start` command\n- `preview` command\n- `build` command\n\n### `src/root.tsx`\n\nThe `src/root.tsx` file is the root of the application tree.  It is the entry point and is the first component that will be rendered.\n\n### `src/global.css`\n\nThe `src/global.css` file is a global CSS file, if you need to define some CSS that is used in multiple places in your app, you can define it here.\n\nThe root component (`src/root.tsx`) imports this file by default.\n\n### `tsconfig.json`\n\nThe `tsconfig.json` file contains the TypeScript compiler configuration. It's standard for any TypeScript project.\n\n### `vite.config.ts`\n\nQwik uses Vite to build the project. The `vite.config.ts` file contains the Vite configuration. It's standard for any Vite project. Please refer to the [Vite documentation](https://vitejs.dev/config/) for more information.\n\n## Utilities\n\nQwik has a utility command called `new` that allows developers to easily create new components and routes.\n\nLet's say you wanted to create a new component called `Button`, you would run the command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik new Button\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik new Button\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik new Button\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik new Button\n```\n</span>\n</PackageManagerTabs>\n\nMaybe you want to create a new route for the /contact page. To do that, you could use the command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik new /contact\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik new /contact\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik new /contact\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik new /contact\n```\n</span>\n</PackageManagerTabs>\n\nThe following commands are consistent with Qwik's directory file structure, allowing you to scaffold components more quickly.\n\nIf we compare our `qwik-app-demo` from the top of the page, the additional changes would look like this:\n\n```bash\nqwik-app-demo\n├── README.md\n├── package.json\n├── public\n│   └── favicon.svg\n├── src\n│   ├── components\n│   │   └── router-head\n│   │       └── router-head.tsx\n│   │       Button\n│   │       └── button.tsx\n│   ├── entry.ssr.tsx\n│   ├── global.css\n│   ├── root.tsx\n│   └── routes\n│       ├── flower\n│       │   ├── flower.css\n│       │   └── index.tsx\n│       ├── contact\n│       │   └── index.tsx\n│       ├── index.tsx\n│       ├── layout.tsx\n│       └── service-worker.ts\n├── tsconfig.json\n└── vite.config.ts\n```\n\nIf you prefer to generate the `Button` component with the `Button/index.tsx` naming convention, you could use the command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik new --barrel Button\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik new --barrel Button\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik new --barrel Button\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik new --barrel Button\n```\n</span>\n</PackageManagerTabs>\n\nIn that case, the `src/components` folder would look like this:\n```bash\nsrc\n│   ├── components\n│   │   └── router-head\n│   │       └── router-head.tsx\n│   │       Button\n│   │       └── index.tsx\n```\n\n> This feature was added in Qwik v1.2, and those using an older version will not see this functionality.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/qwikcity/index.mdx",
    "content": "---\ntitle: Overview | Qwik City\ncontributors:\n  - manucorporat\n  - strogonoff\n  - youngboy\n  - farukEncoded\n  - brunocrosier\n  - forresst\n  - mhevery\n  - adamdbradley\n  - wtlin1228\n  - hamatoyogi\n  - ownchoice\n  - corydeppen\n  - mrhoodz\n  - shairez\n  - debugmodedotnet\nupdated_at: '2023-09-15T18:19:48Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\nimport ImgRoutingFiles from '~/media/docs/qwikcity/routing-files.png?jsx';\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Qwik City\n\nWhile Qwik focuses on the Component API, Qwik City provides APIs that support components with common server-focused features, including the following:\n- [routing](/docs/routing/): Define your application routes with directory based routing. (Supports both MPA and SPA routing models.)\n- [pages](/docs/pages): Render application pages, the main feature of an application.\n- [layouts](/docs/layout/): Define common shared page layouts to be reused across pages.\n- [loaders](/docs/route-loader/): Fetch data on the server to be used by the component.\n- [actions](/docs/action/): Provide a way for the component to request the server to perform an action.\n- [validators](/docs/validator/): Provide a way for validating actions and loaders.\n- [endpoints](/docs/endpoints/): A way to define data endpoints for your RESTful API, GraphQL API, JSON, XML or reverse proxy.\n- [middleware](/docs/middleware/): A centralized way to perform cross-cutting concerns such as authentication, security, caching, redirects, and logging.\n- [server$](/docs/server$/): A simple way to execute logic on the server.\n- [cache](/docs/caching/): Control caching of your content.\n- [env variables](/docs/guides/env-variables/): API to manage reading environment variables, commonly used for keys, in a platform independent way.\n- Supports both Server Side Rendering (SSR) for fully dynamic sites as well as Static Site Generation (SSG) to be hosted on static web servers and CDNs.\n- [`vite`](/docs/(qwik)/advanced/vite/index.mdx#qwikcity) - entry point  & configuration for Qwik City.\n\n> Qwik¹ City²\n>\n> [**Qwik¹**](/docs/(qwik)/index.mdx): Core framework, stable, primitives, component model.\n>\n> [**City²**](/docs/(qwikcity)/routing/index.mdx): Opinionated file-based router, middleware, endpoints, and data fetching and update.\n\nQwik City is a **meta-framework** for Qwik. Qwik City is to Qwik, what [Next.js](https://nextjs.org/) is to React, [Nuxt](https://nuxt.com/) is to Vue, [SvelteKit](https://kit.svelte.dev/) to Svelte, and [Analog](https://analogjs.org/) is to Angular.\n\n**Qwik** (core) and **Qwik City** (routing) solve problems at two layers of abstraction. **Qwik**, focuses on component and state management primitives, while **Qwik City** brings an **opinionated and performant way to build sites at scale**. We don't want to lock the ecosystem into a single correct way of building sites; in fact, we encourage the community to build alternative solutions on top of **Qwik**.\n\n> While Qwik City is full of useful functionality, thanks to Qwik's resumability and JavaScript streaming, there is no additional cost to the end user from Qwik City. (zero JavaScript).\n\nUse Qwik City to build an e-commerce website, blog site, or any other website that needs routing, layouts, or data retrieval/updates. Qwik City is built on Qwik, and therefore Qwik City sites are resumable and only download the minimal amount of JavaScript with fine-grained lazy loading.\n\n## Getting Started with Qwik City\n\nVisit [Create an app using the CLI](/docs/getting-started/#create-an-app-using-the-cli) to see how to create a new Qwik City starter project. It is as simple as:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm create qwik@latest\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm create qwik@latest\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn create qwik\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun create qwik@latest\n```\n</span>\n</PackageManagerTabs>\n\n## High Level API Overview\n\nThis table shows which file (`index.tsx` vs `layout.tsx`) the respective feature should be implemented in.\n\n<ImgRoutingFiles />\n\n## Partytown\n\nQwik City also comes pre-integrated with [Partytown](https://partytown.qwik.dev) allowing you to execute your third-party code off the main thread.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/qwikcity-deprecated-features/index.mdx",
    "content": "---\ntitle: Deprecated Features | Qwik City\ncontributors:\n  - nsdonato\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-06-14T10:39:06Z'\n---\n\n# Deprecated Features for Qwik City\n\nThese features were deprecated in the preparation of Qwik for its stable release.\n\nIf you happened to come across one of them and don't know what its replacement is, we quickly mention them in this table with the link to their new documentation ✨.\n\n#### Deprecated functions and their replacements\n----\n\n| Deprecated   | Replacements\n| :-------- | :-------\n| `useEndpoint ` | [routeLoader$](https://qwik.dev/docs/route-loader/#routeloader)\n| `loader$` - `loaderQrl` | [routeLoader$](https://qwik.dev/docs/route-loader/#routeloader)\n| `action$` - `actionQrl`  | [routeLoader$](https://qwik.dev/docs/route-loader/#routeloader)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/re-exporting-loaders/index.mdx",
    "content": "---\ntitle: Cookbook | Re-exporting loaders\ncontributors:\n  - gioboa\n  - aendel\n  - extrordinaire\nupdated_at: '2023-12-15T11:00:00Z'\ncreated_at: '2023-12-15T11:00:00Z'\n---\n\nimport CodeSandbox, {CodeFile} from '../../../../components/code-sandbox/index.tsx';\n\n# Re-exporting loaders\n\n`routeAction$` and `routeLoader$` are typically declared in route boundary files such as layout.tsx, index.tsx and plugin.tsx inside the routesDir directory\n[here is docs](https://qwik.dev/docs/route-loader/).\n\nSometimes you would like to declare them outside of the route boundaries.\nThis may be useful when you want to create reusable logic or a library.\nIn such a case, it is essential that this function is re-exported from within the router boundary otherwise it will not run or throw exception.\n\n## Solution\n\nYou can define `routeAction$` and `routeLoader$` in your custom path and re-export them in your layout.tsx, index.tsx and plugin.tsx files.\n\n### Reusable logic example\n\nLet's imagine we have a `routeLoader$` that checks whether our user is logged in or not.\nIt wouldn't make sense to copy and paste the same code into many parts of our code to make it work.\nAs per good practices, the ideal method is to centralize the logic.\nHere in this example we declare `routeAction$` and `routeLoader$` in a centralized file so we can then reuse it in our files.\n\nExample with `./shared/loaders.ts`\n<CodeFile src=\"/src/routes/demo/cookbook/re-exporting-loaders/shared/loaders.ts\" >\n```tsx\nimport { routeAction$, routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useCommonRouteAction = routeAction$(async () => {\n  // ...\n  return { success: true, data: ['Qwik', 'Partytown'] };\n});\n\nexport const useCommonRouteLoader = routeLoader$(async () => {\n  // ...\n  return ['Mitosis', 'Builder.io'];\n});\n```\n</CodeFile>\n\nNow you can use your common `routeAction$` and `routeLoader$` in paths like this one `./src/routes/index.tsx`.\n\n<CodeFile src=\"/src/routes/demo/cookbook/re-exporting-loaders/\" >\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Form } from '@builder.io/qwik-city';\nimport { useCommonRouteAction, useCommonRouteLoader } from './shared/loaders';\n\n// As mentioned, here we are re-exporting them\nexport { useCommonRouteAction, useCommonRouteLoader };\n\nexport default component$(() => {\n  const commonRouteAction = useCommonRouteAction();\n  const commonRouteLoader = useCommonRouteLoader();\n\n  return (\n    <div class=\"flex justify-around text-xl\">\n      <Form action={commonRouteAction}>\n        <div class=\"mb-2\">CommonRouteAction</div>\n        <div class=\"mb-4\">response:</div>\n        <div class=\"text-lg font-bold mb-4\">\n          {commonRouteAction.value?.data.join(' ') || ''}\n        </div>\n        <button type=\"submit\">Submit</button>\n      </Form>\n      <div>\n        <div class=\"mb-2\">CommonRouteLoader</div>\n        <div class=\"mb-4\">response:</div>\n        <div class=\"text-lg font-bold mb-4\">{commonRouteLoader.value.join(' ')}</div>\n      </div>\n    </div>\n  );\n});\n```\n</CodeFile>\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/re-exporting-loaders/\"  style={{ height: '15em' }} />\n\n### Preventing issues with <u>indirect</u> `routeLoader$` usage (Third-Party Libraries Example)\n\nIt may happen that we need to integrate third-party libraries over which we have no control over how it works.\nLet's think for example about integrating a payment method into our application.\nWe are provided with a component to integrate into the page, but we have no control over what happens under the hood of this component.\n\nIf these third-party components rely on `routeLoader$` or `routeAction$` functions, we must manually re-export and register those inside \na component that exists within the route boundary. This is necessary so the Qwik optimizer can detect and include them during the build.\n\n> **Note:** Starting in Qwik v2.0, manual registration will no longer be needed. However, until then, the optimizer may **miss** \n> `routeLoader$` functions if they’re used inside components that are **conditionally rendered** (e.g., toggled with a signal).\n>\n> If you don’t manually register the loader in these cases, you may encounter undefined behavior. <u>Avoid skipping this step</u>.\n\n\n#### Here is our code:\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/re-exporting-loaders/third-party/index.tsx\"  style={{ height: '20em' }}>\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { ThirdPartyPaymentComponent, useThirdPartyPaymentLoader } from './third-party-library';\n\n// As mentioned, here we are re-exporting the third-party loader\nexport { useThirdPartyPaymentLoader } from './third-party-library';\n\nexport default component$(() => {\n  \n  // Manually register the loader so the optimizer sees it\n  useThirdPartyPaymentLoader()\n\n  return (\n    <section>\n      <ThirdPartyPaymentComponent />\n    </section>\n  );\n});\n```\n</CodeSandbox>\n\n#### Here is the library code:\n\n<CodeFile src=\"/src/routes/demo/cookbook/re-exporting-loaders/third-party/third-party-library.tsx\" >\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useThirdPartyPaymentLoader = routeLoader$(() => {\n  return { name: 'John Doe' };\n});\n\nexport const ThirdPartyPaymentComponent = component$(() => {\n  const thirdPartyPaymentLoader = useThirdPartyPaymentLoader();\n  return (\n    <div\n      class={[\n        'w-96 h-56 m-auto rounded-xl relative text-white font-bold shadow-2xl',\n        'transition-transform transform hover:scale-110 bg-gray-600',\n      ]}\n    >\n      <div class=\"w-full px-8 absolute top-8\">\n        <div class=\"flex justify-between\">\n          <div class=\"\">\n            <p>Name</p>\n            <p class=\"tracking-widest\">{thirdPartyPaymentLoader.value.name}</p>\n          </div>\n          <img class=\"w-12 h-12\" src=\"/logos/qwik-logo.svg\" />\n        </div>\n        <div class=\"pt-1\">\n          <p class=\"font-medium\">Card Number</p>\n          <p class=\"tracking-wider\">4642 3489 9867 7632</p>\n        </div>\n        <div class=\"pt-6 pr-6\">\n          <div class=\"flex justify-between text-xs\">\n            <div>\n              <p class=\"font-medium\">Valid</p>\n              <p class=\"tracking-wider\">11/15</p>\n            </div>\n            <div>\n              <p class=\"font-medium\">Expiry</p>\n              <p class=\"tracking-wider\">03/25</p>\n            </div>\n            <div>\n              <p class=\"font-medium\">CVV</p>\n              <p class=\"tracking-wider\">···</p>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n});\n```\n</CodeFile>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/route-loader/index.mdx",
    "content": "---\ntitle: RouteLoader$ | Qwik City\ncontributors:\n  - manucorporat\n  - mhevery\n  - wtlin1228\n  - AnthonyPAlicea\n  - the-r3aper7\n  - hamatoyogi\n  - steve8708\n  - iamyuu\n  - n8sabes\n  - mrhoodz\n  - mjschwanitz\n  - adamdbradley\n  - gioboa\nupdated_at: '2023-12-15T11:00:00Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# `routeLoader$()`\n\nRoute Loaders load data in the server so it becomes available to use inside Qwik Components. They trigger when SPA/MPA navigation happens so they can be invoked by Qwik Components during rendering.\n\nPlease note that route loaders should be exported only from `layout.tsx` or `index.tsx` files. But they can be declared in any valid way ES modules allow. To reuse a route loader across multiple `layout.tsx` or `index.tsx` files, define it in a separate file, export it, then import it in `layout.tsx` or `index.tsx` files and [`re-export`](/docs/(qwikcity)/re-exporting-loaders/index.mdx) it as a named export.\n\n> If you want to manage common reusable routeLoader$s it is essential that this function is re-exported from within 'layout.tsx' or 'index.tsx file of the existing route otherwise it will not run or throw exception. For more information [check this section](/docs/(qwikcity)/re-exporting-loaders/index.mdx).\n\n```tsx /routeLoader$/ /useProductData/#a title=\"src/routes/product/[productId]/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  // This code runs only on the server, after every navigation\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as Product;\n});\n\nexport default component$(() => {\n  // In order to access the `routeLoader$` data within a Qwik Component, you need to call the hook.\n  const signal = useProductDetails(); // Readonly<Signal<Product>>\n  return <p>Product name: {signal.value.product.name}</p>;\n});\n```\n\nRoute Loaders are perfect to fetch data from a database or an API. For example you can use them to fetch data from a CMS, a weather API, or a list of users from your database.\n\n> You should not use a `routeLoader$` to create a REST API, for that you’d be better off using an [Endpoint](/docs/endpoints/), which allows you to have tight control over the response headers and body.\n\n## Multiple `routeLoader$`s\n\nMultiple `routeLoader$`s are allowed across the whole application, and they can be used in any Qwik Component. **You can even declare multiple `routeLoader$`s in the same file**.\n\n\n```tsx title=\"src/routes/layout.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { Footer } from '../components/footer.tsx';\n\nexport const useProductData = routeLoader$(async () => {\n  const res = await fetch('https://.../product');\n  const product = (await res.json()) as Product;\n  return product;\n});\n\nexport default component$(() => {\n  const signal = useProductData();\n  return (\n    <main>\n      <Slot />\n      <Footer />\n    </main>\n  );\n});\n```\n\n```tsx title=\"src/components/footer.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\n// Import the loader from the layout\nimport { useProductData } from '../routes/layout.tsx';\n\nexport const Footer = component$(() => {\n  // Consume the loader data\n  const signal = useProductData();\n  return <footer>Product name: {signal.value.product.name}</footer>;\n});\n```\n\nThe above example shows using `useProductData()` in two different components across different files. This is intentional behavior.\n\n```tsx title=\"src/routes/admin/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useLoginStatus = routeLoader$(async ({ cookie }) => {\n  return {\n    isUserLoggedIn: checkCookie(cookie),\n  };\n});\n\nexport const useCurrentUser = routeLoader$(async ({ cookie }) => {\n  return {\n    user: currentUserFromCookie(cookie),\n  };\n});\n\nexport default component$(() => {\n  const loginStatus = useLoginStatus();\n  const currentUser = useCurrentUser();\n  return (\n    <section>\n      <h1>Admin</h1>\n      {loginStatus.value.isUserLoggedIn ? (\n        <p>Welcome {currentUser.value.user.name}</p>\n      ) : (\n        <p>You are not logged in</p>\n      )}\n    </section>\n  );\n});\n```\n\nThe above example shows two `routeLoader$`s being used in the same file. A generic `useLoginStatus` loader is used to check if the user is logged in, and a more specific `useCurrentUser` loader is used to retrieve the user data.\n\n## RequestEvent\n\nJust like [middleware](/docs/middleware/) or [endpoint](/docs/endpoints/) `onRequest` and `onGet`, `routeLoader$`s have access to the [`RequestEvent`](/docs/middleware#requestevent) API which includes information about the current HTTP request.\n\nThis information comes in handy when the loader needs to conditionally return data based on the request, or it needs to override the response status, headers, or body manually.\n\n```tsx /requestEvent/ title=\"src/routes/product/[user]/index.tsx\"\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useProductRecommendations = routeLoader$(async (requestEvent) => {\n  console.log('Request headers:', requestEvent.request.headers);\n  console.log('Request cookies:', requestEvent.cookie);\n  console.log('Request url:', requestEvent.url);\n  console.log('Request method:', requestEvent.method);\n  console.log('Request params:', requestEvent.params);\n\n  // Use request details to fetch personalized data\n  const res = fetch(`https://.../recommendations?user=${requestEvent.params.user}`);\n  const recommendedProducts = (await res.json()) as Product[];\n\n  return recommendedProducts;\n});\n```\n\n## Access the `routeLoader$` data within another `routeLoader$`\n\nYou can access the data from one `routeLoader$` inside another `routeLoader$` using the `requestEvent.resolveValue` method.\n\n```tsx /requestEvent/ title=\"src/routes/product/[productId]/index.tsx\"\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product;\n});\n\nexport const useProductRecommendations = routeLoader$(async (requestEvent) => {\n  // Resolve the product details from the other loader\n  const product = await requestEvent.resolveValue(useProductDetails);\n\n  // Use the product details to fetch personalized data\n  const res = fetch(`https://.../recommendations?product=${product.id}`);\n  const recommendedProducts = (await res.json()) as Product[];\n\n  return recommendedProducts;\n});\n```\n\n> The same API can be used to access the data from a `routeAction$` or a `globalAction$`.\n\n## Failed values with `routeLoader$`\n\n`routeLoader$`s can use the `fail` method to return a failed value, which is a special value that indicates that the loader didn't succeed loading the expected data.\n\nIn addition, the `fail` function allows `routeLoader$` to override the HTTP status code, for example retuning 404.\n\nThis is useful when the loader needs to return an \"error\" value that is not `undefined`, but it also needs to indicate that the data failed to load.\n\n```tsx /requestEvent.fail/ /errorMessage/#a title=\"src/routes/product/[productId]/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const product = await db.from('products').filter('id', 'eq', requestEvent.params.productId);\n  if (!product) {\n    // Return a failed value to indicate that product was not found\n    return requestEvent.fail(404, {\n      errorMessage: 'Product not found'\n    });\n  }\n  return {\n    productName: product.name\n  };\n});\n\nexport default component$(() => {\n  const product = useProductDetails();\n\n  if (product.value.errorMessage) {\n    // Render UI for failed value\n    return <div>{product.value.errorMessage}</div>;\n  }\n  return <div>Product name: {product.value.productName}</div>;\n});\n```\n\n## Handling Relative URLs in Loaders\n\nIn the server-side execution environment, it's crucial to convert relative URLs to absolute URLs for proper functionality. This can be achieved by prefixing the relative URL with the `origin` from the `useLocation()` function.\n\n```tsx /location.url.origin + relativeUrl/ title=\"Make Absolute URL\"\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const location = useLocation();\n  const relativeUrl = '/mock-data';\n  const absoluteUrl = location.url.origin + relativeUrl;\n\n  return (\n    <section>\n      <div>Relative URL: {relativeUrl}</div>\n      <div>Absolute URL: {absoluteUrl}</div>\n    </section>\n  );\n});\n```\n\n## Performance considerations\n\nRoute Loaders are executed on the server, after every navigation. This means that they are executed every time a user navigates to a page in an SPA or MPA, and they are executed even if the user is navigating to the same page.\n\nLoaders execute after the Qwik Middleware handlers (`onRequest`, `onGet`, `onPost`, etc), and before the Qwik Components are rendered. This allows the loaders to start fetching data as soon as possible, reducing latency.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/routing/index.mdx",
    "content": "---\ntitle: Routing | Qwik City\ndescription: Learn about routing in Qwik City which is like other file-system based such as Next.js, SvelteKit, SolidStart or Remix.\ncontributors:\n  - manucorporat\n  - nnelgxorz\n  - the-r3aper7\n  - Oyemade\n  - mhevery\n  - adamdbradley\n  - wtlin1228\n  - AnthonyPAlicea\n  - hamatoyogi\n  - jakovljevic-mladen\n  - claudioshiver\n  - maiieul\n  - igorbabko\n  - jordanw66\n  - mrhoodz\n  - chsanch\n  - RumNCodeDev\n  - wmertens\nupdated_at: '2024-09-05T10:32:00Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n# Routing\n\nRouting in Qwik City is file-system based like [Next.js](https://nextjs.org/docs/routing/introduction), [SvelteKit](https://kit.svelte.dev/docs/routing), [SolidStart](https://start.solidjs.com/core-concepts/routing) or [Remix](https://remix.run/docs/en/main/guides/routing). Files and directories in the `src/routes` have a role in the routing of your application.\n\n- **📂 Directories:** Define the URL segments to match by the router.\n- **📄 `index.tsx/mdx` files:** Define a [page](/docs/pages/).\n- **📄 `index.ts` file:** Define an [endpoint](/docs/endpoints/).\n- **🖼️ `layout.tsx` files:** Define nested [layout](/docs/layout/) and/or a [middleware](/docs/middleware/).\n\n<video autoplay playsinline muted loop>\n <source src=\"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fabf8f471ba884b938d0863d85ed4c50f%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=abf8f471ba884b938d0863d85ed4c50f&alt=media&optimized=true\"/>\n</video>\n\n\n## Directory-based routing\n\nOnly the directory names are used to match the incoming requests to pages/endpoint/middleware.\n\nFor example, if you have a file at `src/routes/some/path/index.tsx`, it will be mapped to the URL path `https://example.com/some/path`.\n\n```bash title=\"Directory layout\"\nsrc/\n└── routes/\n    ├── contact/\n    │   └── index.mdx         # https://example.com/contact\n    ├── about/\n    │   └── index.md          # https://example.com/about\n    ├── docs/\n    │   └── [id]/\n    │       └── index.ts      # https://example.com/docs/1234\n    │                         # https://example.com/docs/anything\n    ├── [...catchall]/\n    │   └── index.tsx         # https://example.com/anything/else/that/didnt/match\n    │\n    └── layout.tsx            # This layout is used for all pages\n```\n\n- **`[id]`** is a directory that represents a dynamic route segment, in this example `id` is the string parameter accessible by `useLocation().params.id`.\n- **`[...catchall]`** is a directory that represents a dynamic catch-all route, in this example `catchall` is the string parameter accessible by `useLocation().params.catchall`.\n- **`index.tsx|mdx` files** are the pages/endpoints/middleware.\n- **`layout.tsx` files** are the layouts.\n\n### Dynamic route segments\n\nSpecial named directories with square brackets, such as `[paramName]` and `[...catchAll]` can be used to match route segments which are dynamic:\n\n```bash title=\"Directory layout\"\nsrc/routes/blog/index.tsx → /blog\nsrc/routes/user/[username]/index.tsx → /user/:username (/user/foo)\nsrc/routes/post/[...all]/index.tsx → /post/* (/post/2020/id/title)\n```\n\n```bash title=\"Directory layout\"\nsrc/\n└── routes/\n    ├── blog/\n    │   └── index.tsx         # https://example.com/blog\n    ├── post/\n    │   └── [...all]/\n    │       └── index.tsx     # https://example.com/post/2020/id/title\n    └── user/\n        └── [username]/\n            └── index.tsx     # https://example.com/user/foo\n```\n\n> The folder `[username]` can be any of the thousands of users that you have in your database. It would be impractical to create a route for each user. Instead, you need to define a Route Parameter (a part of the URL) that will be used to extract the `[username]`.\n\n```tsx title=\"src/routes/user/[username]/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const loc = useLocation();\n  return <div>Hello {loc.params.username}!</div>;\n});\n```\n\n## `index` files\n\nInside the `src/routes` directory, all files named `index` are considered pages/endpoint/middleware, Qwik supports the following extensions: `.ts`, `.tsx`, `.md` and `.mdx`.\n\nPages/endpoint/middleware are the leaf nodes of the routing tree, i.e., **the modules that will handle the request and return an HTTP response**.\n\n### Page `index.tsx`\n\nWhen an `index.tsx` or `index.ts` file exports a Qwik component as the default export, Qwik City will render the component and return an HTML response as a webpage.\n\n```tsx title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <h1>Hello World</h1>;\n});\n```\n\n### Endpoint `index.ts`\n\nAn `index.ts` file can access the HTTP request directly and return a raw HTTP response without involving any Qwik Component. This is done by exporting any of the following methods: `onRequest`, `onGet`, `onPost`, `onPut` or `onDelete` depending on how you want to handle a specific HTTP request.\n\n```tsx title=\"src/routes/index.ts\"\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onGet: RequestHandler = ({ json }) => {\n  json(200, { message: 'Hello World' });\n};\n```\n\n> Notice that in the last example, there is no default export. This is because you are not rendering a Qwik component, but rather you are handling the request directly and returning a JSON response. This is useful for implementing RESTful APIs or any other type of HTTP endpoint.\n\n### Page + Endpoint\n\nIn Qwik City there is no clear separation between pages and endpoints. An `index.tsx` file handles both and exports a Qwik component or an `onRequest` method. However, it's possible to combine both approaches. For example, you can export an `onRequest` method that will handle the request, and then render a Qwik component.\n\n```tsx title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport const onRequest: RequestHandler = ({ headers, query, json }) => {\n  headers.set('Cache-Control', 'private');\n  if (query.get('format') === 'json') {\n    json(200, { message: 'Hello World' });\n  }\n};\n\nexport default component$(() => {\n  return <h1>Hello World</h1>;\n});\n```\n\n> In this example, a request handle will always set the `Cache-Control` header to `private` and the page will be rendered as an HTML page, but if the request contains a `format=json` query param, the endpoint will return a JSON response instead.\n\n## `layout.tsx` files\n\nLayout modules are very similar to `index` files. Both can handle requests and render Qwik components. However, layouts are designed to work like middleware, allowing to **share UI and request handling (middleware)** to a set of routes.\n\nUsually, different pages need some common request handling and share some UI. For example, picture a dashboard site where all the pages are under the `/admin/*` directory:\n\n- **Shared request handling:** The request cookies need to be validated before even rendering the page, otherwise, render a blank 401 page.\n- **Shared UI:** All pages share a common header showing the user's name and profile picture.\n\nInstead of repeating the same code in each route, use layouts to automatically reuse common parts. Layouts also support adding middleware to the route.\n\nTake this `src/routes` directory as an example:\n\n```bash title=\"Directory layout\"\nsrc/\n└── routes/\n    ├── admin/\n    │   ├── layout.tsx  <-- This layout is used for all pages under /admin/*\n    │   └── index.tsx\n    ├── layout.tsx      <-- This layout is used for all pages\n    └── index.tsx\n```\n\n### Middleware Layouts\n\nLayouts can implement request handling using any of the following methods: `onRequest`, `onGet`, `onPost`, `onPut` or `onDelete`. This means they can be used to implement middleware.  For example, they can be used to validate the request cookies before rendering the page.\n\nFor the route `https://example.com/admin`, the `onRequest` methods will be executed in the following order:\n\n1. `src/routes/layout.tsx`'s `onRequest`\n2. `src/routes/admin/layout.tsx`'s `onRequest`\n3. `src/routes/admin/index.tsx`'s `onRequest`\n4. `src/routes/admin/index.tsx`'s component\n\nAn `onRequest` handler in `src/routes/index.tsx` doesn't get executed.\n\n### Full Execution order\n\n```bash\n1 --> [entry.express.ts or entry.preview.ts]\n2 --> [plugin@some-name.ts] #Alphabetical order\n3 --> [server$]\n4 --> [entry.ssr.ts]\n5 --> [root.tsx]\n6 --> [layout.tsx onRequest  ->  onGet/onHttpVerb]\n7 --> [globalLoaders]\n8 --> [routeLoaders]\n9 --> [jsx/components on a route]\n```\n\n### Nested Layouts\n\nLayouts also **provide a way to add common UI to the rendered page**. For example, if you want to add a common header to all of the routes, add a Header component to the root layout.\n\nFor the given example, the Qwik components will be rendered in the following order:\n\n1. `src/routes/layout.tsx`'s component\n2. `src/routes/admin/layout.tsx`'s component\n3. `src/routes/admin/index.tsx`'s component\n\n```tsx\n<RootLayout>\n  <AdminLayout>\n    <AdminPage />\n  </AdminLayout>\n</RootLayout>\n```\n\n## SPA Navigation\n\nWith Qwik, the distinction between MPA and SPA disappears; every app can be both at the same time.\nThe choice is no longer an architectural design determined at the beginning of the project,\ninstead, this decision can be made for every link.\n\nQwik provides a `<Link>` component and `useNavigate()` hook.\nThese can be used to initiate an SPA refresh or navigation between pages.\n\nThe `Link` component is the recommended way to navigate as it uses the HTML `<a>` tag,\n  which is the most accessible way to move between pages.\nHowever, if you need to navigate programmatically, you can use the `useNavigate()` hook.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Link, useNavigate } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  const nav = useNavigate();\n  return (\n    <div>\n      <Link href=\"/about\">About (preferred)</Link>\n      <button onClick$={() => nav('/about')}>About</button>\n    </div>\n  );\n});\n```\n\n> The `Link` component uses the `useNavigate()` hook [internally](https://github.com/QwikDev/qwik/blob/e452582f4728cbcb7bf85d03293e757302286683/packages/qwik-city/runtime/src/link-component.tsx#L33).\n\n### Preventing navigation\n\nWe have an experimental API to prevent navigation while your app's state is unsaved. See the [usePreventNavigate](/docs/labs/usePreventNavigate) documentation for more information.\n\n### `<Link reload>`\n\nThe `Link` component with the `reload` prop can be used together to refresh the current page.\nYou can also call the `nav()` function from the `useNavigate()` hook, without arguments.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Link, routeLoader$, useNavigate } from '@builder.io/qwik-city';\n\nexport const useServerTime = routeLoader$(() => {\n  // This will re-execute in the server when the page refreshes.\n  return Date.now();\n});\n\nexport default component$(() => {\n  const nav = useNavigate();\n  const serverTime = useServerTime();\n\n  return (\n    <div>\n      <Link reload>Refresh (better accessibility)</Link>\n      <button onClick$={() => nav()}>Refresh</button>\n      <p>Server time: {serverTime.value}</p>\n    </div>\n  );\n});\n```\n\n> When the page refreshes, all the matching `routeLoader$` and server handlers (`onRequest`) will re-execute in the server and the UI will re-render accordingly.\n\n> While refreshing the page, the `isNavigating` boolean from `useLocation()` will be `true` until the page is fully rendered.\n\n### `<Link prefetch>`\n\nBy default, a `Link` component will start prefetching the next page as soon as the user hovers over the corresponding link in the UI. So if the application is done prefetching when the user clicks on the link, the next page will appear instantly. Although Qwik applications already excel at lazy loading javascript, this behavior can come in handy for content-heavy pages or SSR pages that need to wait for database or API calls.\n\nIf this is not your desired behavior, you can set the `prefetch` prop to false.\n```tsx\n <Link prefetch={false} href=\"/about\">About</Link>\n```\n\n### Scroll Restoration\n\nQwik provides best-in-class scroll restoration for SPA's that closely mimics the native browser experience.\nYour users should receive the exact same experience they've come to expect natively from an MPA,\nexcept with all the added benefits of an SPA.\n\nAfter you use one of the above methods to navigate, the user is automatically upgraded to an SPA.\nThis means that the current page, and the page they came from, now have an `SPA` context associated with them.\n\nIf a user then clicks a regular `<a>` tag, they will perform a regular navigation. This new page will have no SPA context,\nand is effectively downgraded back to an MPA. You can swap between these as necessary,\nand the user's experience will seamlessly switch between MPA and SPA as if it were all the same.\n\nWhen a user re-visits the SPA-enabled history entries, such as with a refresh, back/forward button, browser session restarts, etc.,\nQwik will automatically restore their scroll position and bootstrap itself back into the SPA context as needed.\n\n> The script required to provide this robust experience never loads, nor is it ever even sent to the user's browser,\n> unless the history entry has had an SPA context. Pure MPA pages never load this script. This is the magic of Qwik.\n\n> Scroll restoration in Qwik always occurs synchronously with render. When combined with Qwik's resumable and\n> first-class SSR/MPA nature, the user should never experience scroll flashing.\n\nQwik's scroll restoration is entirely `history` based. This is different from many other frameworks\nwhich rely on things like `sessionStorage`.\n\nQwik's ability to remember and restore scroll positions is extremely robust\nand will survive everything from browser session restarts to users clearing their browser data,\nwhich is not the case for many other frameworks.\n\n> **Notes on using `pushState()` and `replaceState()` during SPA:**\n>\n> On a page with an SPA context, Qwik will patch the `pushState()` and `replaceState()` functions on the global `history`.\n> This is to ensure that any custom states you add as a developer, also receive the SPA context.\n>\n> While these are patched, states you `push` or `replace` should always be an actual `Object` type.\n> This is because Qwik needs to be able to automatically append the SPA context to the state as a property.\n>\n> If you provide a value that is not an object, Qwik will create a new object for state and add your provided\n> value to a new key: `{ _data: <your_value> }`\n>\n> Qwik will also warn you in the browser's console in `dev` mode when this occurs.\n\n\n## Request Event\n\nEach request handler, such as `onRequest`, `onGet`, `onPost`, etc., are passed in a `RequestEvent` object as the first argument to the handler. The `RequestEvent` object contains utility functions and properties to get and set values to the server's request and response. This object contains the following properties:\n\n- `basePathname`: The base pathname of the request, which can be configured at build time. Defaults to `/`.\n- `cacheControl`: Convenience function to set the [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) response header.\n- `cookie`: HTTP request and response [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies). Use the `get()` method to retrieve a request cookie value. Use the `set()` method to set a response cookie value.\n- `env`: Platform provided environment variables.\n- `error`: When called, the response will immediately end with the given status code. This could be useful to end a response with `404`, and use the 404 handler in the routes directory. See [Status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for which status code should be used.\n- `getWritableStream`: Low-level access to write to the HTTP response stream. Once `getWritableStream()` is called, the status and headers can no longer be modified and will be sent over the network.\n- `headers`: HTTP [response headers](https://developer.mozilla.org/en-US/docs/Glossary/Response_header).\n- `html`: Convenience method to send an HTML body response. The response will be automatically set the `Content-Type` header to`text/html; charset=utf-8`. An `html()` response can only be called once.\n- `json`: Convenience method to JSON stringify the data and send it in the response. The response will be automatically set the `Content-Type` header to`application/json; charset=utf-8`. A `json()` response can only be called once.\n- `locale`: Which locale the content is in. The locale value can be retrieved from selected methods using `getLocale()`.\n- `method`: HTTP request [method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) value.\n- `next`: Call the next request handler. This is useful for middleware.\n- `params`: URL path params which have been parsed from the current url pathname segments. Use `query` to instead retrieve the query string search params.\n- `parseBody`: This method will check the request headers for a `Content-Type` header and parse the body accordingly. It supports `application/json`, `application/x-www-form-urlencoded`, and `multipart/form-data` content types. If the `Content-Type` header is not set, it will return `null`.\n- `pathname`: URL pathname value. Does not include the protocol, domain, query string (search params) or hash.\n- `platform`: Platform specific data and functions.\n- `query`: URL query string [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) value. Use `params` to instead retrieve the route params found in the url pathname.\n- `redirect`: URL to redirect to. When called, the response will immediately end with the correct redirect status and headers. See [Redirects](https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections) for which status code should be used.\n- `request`: HTTP [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request).\n- `send`: Send a body response. The `Content-Type` response header is not automatically set when using `send()` and must be set manually. A `send()` response can only be called once.\n- `sharedMap`: Shared Map across all the request handlers. Every HTTP request will get a new instance of the shared map. The shared map is useful for sharing data between request handlers.\n- `status`: HTTP response [status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). Sets the status code when called with an argument. Always returns the status code, so calling `status()` without an argument can be used to return the current status code.\n- `text`: Convenience method to send a text body response. The response will be automatically set the `Content-Type` header to`text/plain; charset=utf-8`. A `text()` response can only be called once.\n- `url`: HTTP request [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL).\n\n## Rewrite Routes\n\nYou can rewrite your pathnames in order to reuse one single page component with its own middlewares and layouts for multiple pages.\nThis could be useful for SEO purposes or to translate your pages in different languages.\n\n> **Translate localized urls with prefix:**\n>\n> For localization purposes you may want to translate your routes from `/products` to `/it/prodotti`\n> or to `/fr/produits` and `/products/product-name` to `/it/prodotti/nome-prodotto` or `/fr/produits/nom-du-produit`\n> without having multiple routes files for each locale but reusing the same page component, layouts, middlewares and so on.\n>\n> The parameters name will not be changed so if the route file is `/products/[slug]/index.tsx` and the url is `/products/product-name`,\n> `/it/prodotti/nome-prodotto` or `/fr/produits/nom-du-produit` you will receive the same path parameter `slug` with\n> the values `product-name`, `nome-prodotto` or `nom-du-produit`.\n\n> **Rewrite urls without prefix:**\n>\n> It's rare but you may want to have aliases for the same path.\n> For example you may want both `/docs` and `/documents` to be rendered from the same page component or\n> you may want to translate `/products` to `/prodotti` without adding the `/it` prefix.\n\nIn each folder within the routes directory where there are instances of the paths keys in the pathname, the route node will be duplicated, and all occurrences of paths keys will be replaced with their corresponding paths values.\nAll path parameters will preserve the same name. If there is a prefix it will be added at the beginning of the rewritten pathname.\n\nYou can set the rewrite rules as follows in your `vite.config.ts`:\n\n```tsx\nimport { defineConfig } from 'vite';\nimport { qwikCity } from '@builder.io/qwik-city/vite';\n\nexport default defineConfig(async () => {\n  return {\n    plugins: [\n      qwikCity({\n        rewriteRoutes: [\n            {\n              paths: {\n                  'docs': 'documentation'\n              },\n            },\n            {\n              prefix: 'it',\n              paths: {\n                'docs': 'documentazione',\n                'getting-started': 'per-iniziare',\n                'products': 'prodotti',\n              },\n            },\n          ],\n      }),\n    ],\n  };\n});\n```\n\n## Advanced routing\n\nQwik City also supports:\n\n- [Route Parameters](/docs/(qwikcity)/advanced/routing/index.mdx)\n- [Nested layouts](/docs/(qwikcity)/advanced/routing/index.mdx#nested-layout)\n- [Menus](/docs/(qwikcity)/advanced/menu/index.mdx)\n- [Request Handling](/docs/(qwikcity)/advanced/request-handling/index.mdx)\n\n## Typesafe Routing\n- [Typed Routes](/docs/labs/typed-routes/index.mdx#-typed-routes)\n- [Declarative Routing](/docs/labs/typed-routes/index.mdx#declarative-routing)\n\nThese are discussed later.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/server$/index.mdx",
    "content": "---\ntitle: server$ | Qwik City\ncontributors:\n  - mhevery\n  - manucorporat\n  - AnthonyPAlicea\n  - the-r3aper7\n  - igorbabko\n  - RaeesBhatti\n  - mrhoodz\n  - DanielAdolfsson\n  - mjschwanitz\n  - wtlin1228\n  - adamdbradley\n  - jemsco\n  - patrickjs\nupdated_at: '2024-05-11T17:00:00Z'\ncreated_at: '2023-03-29T02:35:29Z'\n---\n\n# `server$()`\n\n`server$()` allows you to define functions that execute exclusively on the server, making it ideal for server-only operations and database access. It functions as an RPC (Remote Procedure Call) mechanism between the client and server. This is similar to a traditional HTTP endpoint, but strongly typed with TypeScript and easier to maintain.\n\n> `server$` can accept any number of arguments and return any value that can be serialized by Qwik. This includes primitives, objects, arrays, bigint, JSX nodes, and even Promises, just to name a few.\n\n\n`AbortSignal` is optional, and allows you to cancel a long running request by terminating the connection.  \nYour new function will have the following signature:  \n`([AbortSignal, ...yourOtherArgs]): Promise<T>`  \n> Please note that depending on your server runtime, the function on the server may not terminate immediately. It depends on how client disconnections are handled by the runtime.\n\n```tsx\nimport { component$, useSignal, $ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\n\n// By wrapping a function with `server$()` we mark it to always\n// execute on the server. This is a form of RPC mechanism.\nexport const serverGreeter = server$(\n  function (firstName: string, lastName: string) {\n    const greeting = `Hello ${firstName} ${lastName}`;\n    console.log('Prints in the server', greeting);\n    return greeting;\n  }\n);\n\nexport default component$(() => {\n  const firstName = useSignal('');\n  const lastName = useSignal('');\n\n  return (\n    <section>\n      <label>First name: <input bind:value={firstName} /></label>\n      <label>Last name: <input bind:value={lastName} /></label>\n\n      <button\n        onClick$={\n          $(async () => {\n            const greeting = await serverGreeter(firstName.value, lastName.value);\n            alert(greeting);\n          })\n        }\n      >\n        greet\n      </button>\n    </section>\n  );\n});\n```\n\n## Accessing Request Information with `RequestEvent`\n\nWhen using `server$`, you have access to the `RequestEvent` object through `this`. This object provides useful information about the HTTP request, including environment variables, cookies, URL, and headers. Here's how you can use it:\n\n### Environment Variables\n\nYou can access environment variables using `this.env.get()`.\n\n```tsx\nexport const getEnvVariable = server$(\n  function () {\n    const dbKey = this.env.get('DB_KEY');\n    console.log('Database Key:', dbKey);\n    return dbKey;\n  }\n);\n```\n\n### Cookies\n\nYou can read cookies using `this.cookie.get()` and `this.cookie.set()`.\n\n> When using `handleCookies` (in our example below) if it's used within a `useTask$` function that runs during the initial request, setting cookies won’t work as expected. This is because, during server-side rendering (SSR), the response is streamed, and HTTP requires all headers to be set before sending the first response. However, if handleCookies is used in useVisibleTask$, this issue doesn’t occur. If you need to set cookies for the initial document request you can use `plugin@<name>.ts` or Middleware.\n\n```tsx\nexport const handleCookies = server$(\n  function () {\n    const userSession = this.cookie.get('user-session')?.value;\n    if (!userSession) {\n      this.cookie.set('user-session', 'new-session-id', { path: '/', httpOnly: true });\n    }\n    return userSession;\n  }\n);\n```\n\n### URL\n\nYou can access the request URL and its components using `this.url`.\n\n```tsx\nexport const getRequestUrl = server$(\n  function () {\n    const requestUrl = this.url;\n    console.log('Request URL:', requestUrl);\n    return requestUrl;\n  }\n);\n```\n\n### Headers\n\nYou can read headers using `this.headers.get()`.\n\n```tsx\nexport const getHeaders = server$(\n  function () {\n    const userAgent = this.headers.get('User-Agent');\n    console.log('User-Agent:', userAgent);\n    return userAgent;\n  }\n);\n```\n\n### Using Multiple RequestEvent Information\n\nHere's an example that combines environment variables, cookies, URL, and headers in a single function.\n\n```tsx\nexport const handleRequest = server$(\n  function () {\n    // Access environment variable\n    const dbKey = this.env.get('DB_KEY');\n\n    // Access cookies\n    const userSession = this.cookie.get('user-session')?.value;\n    if (!userSession) {\n      this.cookie.set('user-session', 'new-session-id', { path: '/', httpOnly: true });\n    }\n\n    // Access request URL\n    const requestUrl = this.url;\n\n    // Access headers\n    const userAgent = this.headers.get('User-Agent');\n\n    console.log('Environment Variable:', dbKey);\n    console.log('User Session:', userSession);\n    console.log('Request URL:', requestUrl);\n    console.log('User-Agent:', userAgent);\n\n    return {\n      dbKey,\n      userSession,\n      requestUrl,\n      userAgent\n    };\n  }\n);\n```\n\n## Streaming Responses\n\n`server$` can return a stream of data by using an async generator function, which is useful for streaming data from the server to the client.\n\nTerminating the generator on the client side (e.g., by calling `.return()` on the generator or by breaking out from your async for-of loop) will terminate the connection. Similar to `AbortSignal`, how the generator terminates on the server side depends on the server runtime and how client disconnects are handled.\n\n```tsx\nimport { component$, useSignal, $ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\n\nexport const streamFromServer = server$(\n  // Async Generator Function\n  async function* () {\n    // Creation of an array with 10 undefined values\n    const iterationRange = Array(10).fill().entries(); \n  \n    for (const [value] of iterationRange) {\n      // Yield returns the array value during each iteration\n      yield value;\n  \n      // Waiting for 1 second before the next iteration\n      // This simulates a delay in the execution\n      await new Promise((resolve) => setTimeout(resolve, 1000));\n    }\n  }\n);\n\n\nexport default component$(() => {\n  const message = useSignal('');\n  return (\n    <div>\n      <button\n        onClick$={\n          $(async () => {\n            // call the async stream function and wait for the response\n            const response = await streamFromServer(); \n            // use a for-await-of loop to asynchronously iterate over the response\n            for await (const value of response) {\n              // add each value from the response to the message value\n              message.value += ` ${value}`;\n            }\n            // do anything else\n          })\n        }\n      >\n        start\n      </button>\n      <div>{message.value}</div>\n    </div>\n  );\n});\n```\n\nThis API is actually used to implement QwikGPT streaming responses in our docs site.\n\n\n## How does `server$()` work?\n\n`server$()` wraps a function and returns an async proxy to the function. On the server, the proxy function directly calls the wrapped function, and a HTTP endpoint is automatically created by the `server$()` function.\n\nOn the client, the proxy function invokes the wrapped function via an HTTP request, using `fetch()`.\n\n> Note: The `server$()` function must ensure that the server and client have the same version of the code executing. If there is a version skew the behavior is undefined and may result in an error. If version skew is a common problem then a more formal RPC mechanism should be used such as a tRPC or other library.\n\n> **Important Gotcha**\n> When defining and calling `server$()` inside an `onClick$`, be aware that this can lead to potential errors. To avoid them, make sure the handlers have `$` wrapped around them.  \n> Don't do this  \n> `onClick$={() => server$(() => // some server code!)}`  \n> Do this  \n> `onClick$={$(() => server$(() => // some server code!))}`\n\n## Middleware and `server$`\n\nWhen using `server$`, it's important to understand how [middleware functions](/docs/middleware/#middleware-function) are executed. Middleware functions defined in `layout` files do not run for `server$` requests. This can lead to confusion, especially when developers expect certain middleware to be executed for both page requests and `server$` requests.\n\nTo ensure that a middleware function runs for both types of requests, it should be defined in the `plugin.ts` file. This ensures that the middleware is executed consistently for all incoming requests, regardless of whether they are normal page requests or `server$` requests.\n\nBy [defining middleware in the `plugin.ts`](/docs/advanced/plugins) file, developers can maintain a centralized location for shared middleware logic, ensuring consistency and reducing potential errors or oversights.\n\n\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/troubleshooting/index.mdx",
    "content": "---\ncontributors:\n  - mhevery\n  - adamdbradley\nupdated_at: '2023-04-20T23:06:55Z'\ncreated_at: '2023-03-20T23:45:13Z'\n---\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/(qwikcity)/validator/index.mdx",
    "content": "---\ntitle: Validators | QwikCity\ncontributors:\n  - wtlin1228\n  - harishkrishnan24\nupdated_at: '2023-09-15T18:19:48Z'\ncreated_at: '2023-09-15T18:19:48Z'\n---\n\n# Data Validators\n\nData validators in QwikCity are essential for validating request events and data for actions and loaders. These validations occur on the server-side before the execution of the associated action or loader. Similar to the `zod$()` function, Qwik provides a dedicated `validator$()` function for this purpose.\n\n```tsx {12-22} /validator$/#a\nimport {\n  type RequestEvent,\n  type RequestEventAction,\n  routeAction$,\n  validator$,\n} from \"@builder.io/qwik-city\";\n\nexport const useAction = routeAction$(\n  async (data, requestEvent: RequestEventAction) => {\n    return { foo: \"bar\" };\n  },\n  validator$(async (ev: RequestEvent, data) => {\n    if (ev.query.get(\"secret\") === \"123\") {\n      return { success: true };\n    }\n    return {\n      success: false,\n      error: {\n        message: \"secret is not correct\",\n      },\n    };\n  }),\n);\n```\n\nWhen submitting a request to a `routeAction()`, the request event and data undergo validation against the defined validator. If the validation fails, the action will place the validation error in the `routeAction.value` property.\n\n```tsx\nexport default component$(() => {\n  const action = useAction();\n\n  // action value is undefined before submitting\n  if (action.value) {\n    if (action.value.failed) {\n      // action failed if query string has no secret\n      action.value satisfies { failed: true; message: string };\n    } else {\n      action.value satisfies { searchResult: string };\n    }\n  }\n\n  return (\n    <button onClick$={() => action.submit({ search: \"foo\" })}>Submit</button>\n  );\n});\n```\n\n## Multiple validators\n\nActions and loaders can have multiple validators, which are executed in reverse order. In the following example, validators execute in the order `validator3` -> `validator2` -> `validator1`.\n\n```tsx {9-11}\nconst validator1 = validator$(/*...*/)\nconst validator2 = validator$(/*...*/)\nconst validator3 = validator$(/*...*/)\n\nexport const useAction = routeAction$(\n  async (data, requestEvent: RequestEventAction) => {\n    return { foo: \"bar\" };\n  },\n  validator1,\n  validator2,\n  validator3, // will be executed first\n);\n```\n\nIf `validator3` has a `data` property in its success return object, this data will be passed to the next validator, `validator2`. If you don't want to override the original submitted data, avoid putting the `data` property in the success return object.\n\n```tsx /message: \"hi, I am validator3\"/#a /message: \"hi, I am validator2\"/#b /message: \"hi, I am validator1\"/#c\nexport const useAction = routeAction$(\n  async (data, requestEvent: RequestEventAction) => {\n    console.log(data); // { message: \"hi, I am validator1\" }\n    return { foo: \"bar\" };\n  },\n  // validator1\n  validator$((ev, data) => {\n    console.log(data); // { message: \"hi, I am validator2\" }\n    return {\n      success: true,\n      data: {\n        message: \"hi, I am validator1\",\n      },\n    };\n  }),\n  // validator2\n  validator$((ev, data) => {\n    console.log(data); // { message: \"hi, I am validator3\" }\n    return {\n      success: true,\n      data: {\n        message: \"hi, I am validator2\",\n      },\n    };\n  }),\n  // validator3\n  validator$((ev, data) => {\n    console.log(data); // Your submitted data\n    return {\n      success: true,\n      data: {\n        message: \"hi, I am validator3\",\n      },\n    };\n  }),\n);\n```\n\n## Return object\n\nData validators expect specific properties in their return objects.\n\n### Successful validation\n\nThe `success` property must be true for a successful validation.\n\n```ts\ninterface Success {\n  success: true;\n  data?: any;\n}\n```\n\n### Failed validation\n\n```ts\ninterface Fail {\n  success: false;\n  error: Record<string, any>;\n  status?: number;\n}\n```\n\nValidator behaves like using the `fail()` method in the action or loader when it returns a failed object.\n\n```tsx /status/#a /errorObject/#b\nconst status = 500;\nconst errorObject = { message: \"123\" };\n\nexport const useAction = routeAction$(\n  async (_, { fail }) => {\n    return fail(status, errorObject);\n  },\n  validator$(async () => {\n    return {\n      success: false,\n      status,\n      errorObject,\n    };\n  }),\n);\n```\n\n## Use `validator$()` with `zod$()` together in actions\n\nFor actions, the typed data validator `zod$()` should be the second argument of `routeAction$`, followed by other data validators `validator$()`s.\n\n```tsx {5-7}\nexport const useAction = routeAction$(\n  async (data, requestEvent: RequestEventAction) => {\n    return { foo: \"bar\" };\n  },\n  zod$(/*...*/),\n  validator$(/*...*/),\n  validator$(/*...*/),\n);\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/algolia-search/index.mdx",
    "content": "---\ntitle: Cookbook | Algolia Search\ncontributors:\n  - gioboa\nupdated_at: '2024-01-09T11:00:00Z'\ncreated_at: '2024-01-09T11:00:00Z'\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\n\n# Algolia Search\n\nAlgolia is a search platform that provides a set of features and APIs that make it easy to implement powerful search experiences for users.\nIn fact, out of the box it offers tools and infrastructure to integrate fast and relevant search functionality into our applications.\nThanks to the [Algolia](https://www.algolia.com/) APIs it is very simple to integrate it into your Qwik application.\n\n## Solution\n\nTo start using it you need to create a personal Algolia account and retrieve your API keys, which will be used to interact with Algolia.\n- **Index Name**: An index is where the data used by Algolia is stored. It's the equivalent of a table in a database but optimized for search and discovery operations.\n- **Application ID**: This is your unique application identifier. It's used to identify you when using Algolia's API.\n- **Search-Only API Key**: This is the public API key to use in your frontend code. This key is only usable for search queries and sending data to the Insights API.\n\nSo once you have this information you can define your environment variables by creating or editing the `.env` or `.env.local` file at the root of your project.\n\n```bash title=\".env\"\nVITE_ALGOLIA_INDEX=\nVITE_ALGOLIA_APP_ID=\nVITE_ALGOLIA_SEARCH_KEY=\n```\n\nBelow you can find a working example of a first usable implementation.\nThen obviously you can customize and create your graphical interface.\nMany times it makes sense to have a modal where you show the search and the results, such as the search you find in this Qwik documentation.\nYou can check what Algolia returns via the [official documentation](https://www.algolia.com/doc/).\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/algolia-search/\"  style={{ height: '20em' }}>\n```tsx\nimport { $, component$, useSignal, useStylesScoped$ } from '@builder.io/qwik';\n\ntype AlgoliaResult = {\n  hits: {\n    type: string;\n    anchor?: string;\n    content?: string;\n    url: string;\n  }[];\n};\n\nexport default component$(() => {\n  useStylesScoped$(`\n    .search {\n      font-size: 100%;\n      width: calc(100% - 38px);\n      border-radius: 0.5rem;\n      border: 1px black solid;\n      padding: 1rem;\n      color: black;\n      outline: none;\n    }\n\n    .search-button {\n      border: none;\n      padding: 6px 0px;\n      cursor: pointer;\n      background-color: transparent;\n      position: absolute;\n      right: 2.4rem;\n      padding: 0.85rem 0.5rem 0.4rem 0.5rem;\n      outline: none;\n    }\n\n    .list {\n      display: flex;\n      flex-direction: column;\n      align-items: center;\n    }\n\n    .list li {\n      counter-increment: cardCount;\n      display: flex;\n      color: white;\n      margin-top: 1rem;\n      margin-bottom: 1rem;\n      max-width: 500px;\n    }\n\n    .list li::before {\n      content: counter(cardCount, decimal-leading-zero);\n      background: white;\n      color: var(--cardColor);\n      font-size: 2em;\n      font-weight: 700;\n      transform: translateY(calc(-1 * 1rem));\n      margin-right: calc(-1 * 1rem);\n      z-index: 1;\n      display: flex;\n      align-items: center;\n      padding-inline: 0.5em;\n      border: 1px solid black;\n    }\n\n    .list li .content {\n      background-color: var(--cardColor);\n      display: grid;\n      padding: 0.5em calc(1em + 1.5rem) 0.5em calc(1em + 1rem);\n      grid-template-areas:\n        \"icon title\"\n        \"icon text\";\n      gap: 0.25em;\n      clip-path: polygon(\n        0 0,\n        calc(100% - 1.5rem) 0,\n        100% 50%,\n        calc(100% - 1.5rem) 100%,\n        calc(100% - 1.5rem) calc(100% + 1rem),\n        0 calc(100% + 1rem)\n      );\n    }\n\n    .list li .content .title {\n      grid-area: title;\n      font-size: 1.25em;\n    }\n\n    .list li .content .text {\n      grid-area: text;\n      color: black;\n    }\n  `);\n  const termSignal = useSignal('');\n  const hitsSig = useSignal<AlgoliaResult['hits']>([]);\n\n  const onSearch = $(async (query: string) => {\n    const algoliaURL = new URL(\n      `/1/indexes/${import.meta.env.VITE_ALGOLIA_INDEX}/query`,\n      `https://${import.meta.env.VITE_ALGOLIA_APP_ID}-dsn.algolia.net`\n    );\n    const response = await fetch(algoliaURL, {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'X-Algolia-Application-Id': import.meta.env.VITE_ALGOLIA_APP_ID!,\n        'X-Algolia-API-Key': import.meta.env.VITE_ALGOLIA_SEARCH_KEY!,\n      },\n      body: JSON.stringify({ query }),\n    });\n    const algoliaResult: AlgoliaResult = await response.json();\n    hitsSig.value = algoliaResult.hits;\n  });\n\n  return (\n    <div>\n      <div style=\"margin: 1rem;\">\n        <div style=\"position: relative;\">\n          <input\n            class=\"search\"\n            placeholder=\"Algolia search: type here and press enter\"\n            bind:value={termSignal}\n            onKeyDown$={(e) => {\n              if (e.key === 'Enter') {\n                onSearch(termSignal.value);\n              }\n            }}\n          />\n          <button\n            type=\"submit\"\n            class=\"search-button\"\n            onClick$={() => onSearch(termSignal.value)}\n          >\n            <svg\n              xmlns=\"http://www.w3.org/2000/svg\"\n              width=\"32\"\n              height=\"32\"\n              viewBox=\"0 0 24 24\"\n            >\n              <path\n                fill=\"currentColor\"\n                d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\"\n              />\n            </svg>\n          </button>\n        </div>\n      </div>\n      <div class=\"list\">\n        {hitsSig.value.map(({ anchor, content, url }, key) => (\n          <li\n            key={key}\n            style={`--cardColor:${key % 2 === 0 ? '#19b6f6' : '#ac7ef4'}`}\n          >\n            <div class=\"content\">\n              <div class=\"title\">\n                {(anchor || content || url || '').substring(0, 30)}\n              </div>\n              <a class=\"text\" href={url}>\n                Documentation link\n              </a>\n            </div>\n          </li>\n        ))}\n      </div>\n    </div>\n  );\n});\n```\n</CodeSandbox>\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/combine-request-handlers/index.mdx",
    "content": "---\ntitle: Cookbook | Combine Request Handlers\ncontributors:\n  - gioboa\n  - erikras\nupdated_at: '2024-01-18T11:00:00Z'\ncreated_at: '2024-01-18T11:00:00Z'\n---\n\nimport {CodeFile} from '../../../../components/code-sandbox/index.tsx';\n\n# Combine Request Handlers\n\n## Problem\n\nIn a Qwik application we often have several request handlers to perform [middleware functions](https://qwik.dev/docs/middleware/).\nIn fact, according to the principle of [single responsibility](https://en.wikipedia.org/wiki/Single_responsibility_principle) middleware functions are developed to perform only one task (e.g. to create a database connection).\nWith these premises, it can be complex to combine multiple request handlers while maintaining the order in which they are called.\nFor example, you have one request handler to connect to a database, and another to load the current user record, the latter depends on the former, so they must be called in order.\n\n## Solution\n\nIf you want to chain multiple request handlers together you can use this utility function.\n\n<CodeFile src=\"/src/routes/demo/cookbook/combine-request-handlers/index.tsx\">\n```tsx\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\n/**\n * Combines multiple request handlers into a single request handler.\n *\n * The handlers will be called in order:\n *\n * 1. Handler1 before next()\n * 2. Handler2 before next()\n * 3. Handler3 before next()\n * 4. Next()\n * 5. Handler3 after next()\n * 6. Handler2 after next()\n * 7. Handler1 after next()\n *\n * @public\n */\n\nexport const combineRequestHandlers = (...handlers: RequestHandler[]): RequestHandler =>\n  async (originalContext) => {\n    let lastNext = originalContext.next;\n    for (let i = handlers.length - 1; i >= 0; i--) {\n      const currentHandler = handlers[i];\n      const nextInChain = lastNext;\n      lastNext = async () => {\n        await currentHandler({ ...originalContext, next: nextInChain });\n      };\n    }\n\n    await lastNext();\n  };\n```\n</CodeFile>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/debouncer/index.mdx",
    "content": "---\ntitle: Cookbook | Debouncer\ncontributors:\n  - n8sabes\n  - KenAKAFrosty\n  - shairez\nupdated_at: '2024-03-07T01:00:00Z'\ncreated_at: '2024-02-07T01:00:00Z'\n---\n\nimport CodeSandbox, { CodeFile } from '../../../../components/code-sandbox/index.tsx';\n\n# What is a debouncer and why it's important\n\nA debouncer is a programming pattern used to ensure that time-consuming tasks do not fire too frequently, thereby preventing performance issues or the overwhelming of servers with requests. This is particularly useful in scenarios such as search inputs where you may not want to trigger a search request with every keystroke, but rather after the user has paused typing. \n\nBy implementing a debouncer, you can enhance both user experience and application efficiency. This is achieved by delaying a function's execution until a specified amount of time has elapsed since its last invocation.\n\n\n## When to use debouncers\n\nDebouncers are best used in situations where you want to limit the frequency of function calls. Common use cases include:\n\n- User input validation: Delaying validation until the user stops typing to avoid unnecessary processing for every keystroke.\n- Search functionality: Waiting until a user finishes typing a search query to begin the search process, reducing the number of search requests sent to the server.\n- Window resizing: Limiting the number of recalculations or adjustments when the browser window is resized.\n\n## How to implement a debouncer in Qwik\n\nThe Qwik framework provides unique capabilities for managing state and effects in a way that is both serializable and efficient. Implementing a debouncer in Qwik involves using Qwik's primitives, such as `useSignal` for state management and `$` for marking functions that can capture state without breaking serialization. Below is a simple debouncer pattern. It behaves similarly to closure-based debouncers that execute a function when the timeout is reached.\n\n<CodeFile src=\"/src/routes/demo/cookbook/mediaController/index.tsx\">\n```tsx\nexport const useDebouncer = <A extends unknown[], R>(\n  fn: QRL<(...args: A) => R>,\n  delay: number,\n): QRL<(...args: A) => void> => {\n  const timeoutId = useSignal<number>();\n\n  return $((...args: A): void => {\n    window.clearTimeout(timeoutId.value);\n    timeoutId.value = window.setTimeout((): void => {\n      void fn(...args);\n    }, delay);\n  });\n};\n```\n</CodeFile>\n\nThis debouncer takes a function and a delay as arguments. It utilizes `useSignal` to track the `timeoutID`, ensuring compatibility with Qwik's resumability model and its use of [QRL's](https://qwik.dev/docs/advanced/qrl/). The returned function, when called, clears any existing timeout and sets a new one to invoke the provided function after the specified delay.\n\n## How to use the debouncer\n\nThe example below demonstrates using the debouncer in a component to efficiently manage user input. By debouncing the input, the application updates the state only after the user has stopped typing for 1-second, optimizing performance for operations such as API calls or data filtering.\n\n<CodeFile src=\"/src/routes/demo/cookbook/mediaController/index.tsx\">\n```tsx\nimport { $, useSignal, component$, type QRL } from \"@builder.io/qwik\";\nimport { useDebouncer } from \"~/utils/debouncer\";\n\nexport default component$(() => {\n  const debouncedValue = useSignal(\"\");\n\n  const debounce = useDebouncer(\n    $((value: string) => {\n      debouncedValue.value = value;\n    }),\n    1000\n  );\n\n  return (\n    <>\n      <input\n        onInput$={(_, target) => {\n          debounce(target.value);\n        }}\n      />\n      <p>{debouncedValue.value}</p>\n    </>\n  );\n});\n```\n</CodeFile>\n\n## Live Demo\n\nIn the live demo below, `useDebouncer` is used to update the `debouncedValue` signal after a 1-second delay has elapsed since the last keystroke.\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/debouncer/\"  style={{ height: '250px' }}>\n</CodeSandbox>\n\n## Bonus: `useDebouncer$`\n\nTo save our developers the extra \"wrapping with a $()\" action.\n\nWe can leverage Qwik's `implicit$FirstArg` function to create a `useDebouncer$` function that automatically wraps the provided function with `$()`.\n\nThis is how Qwik actually implements all of its built-in $ hooks.\n\n```tsx\nexport const useDebouncerQrl = <A extends unknown[], R>(\n  fn: QRL<(...args: A) => R>,\n  delay: number,\n): QRL<(...args: A) => void> => {\n  const timeoutId = useSignal<number>();\n\n  return $((...args: A): void => {\n    window.clearTimeout(timeoutId.value);\n    timeoutId.value = window.setTimeout((): void => {\n      void fn(...args);\n    }, delay);\n  });\n};\n\nexport const useDebouncer$ = implicit$FirstArg(useDebouncerQrl);\n```\n\nAnd now we could do:\n\n```tsx\nconst debounce = useDebouncer$(\n  (value: string) => {\n    debouncedValue.value = value;\n  },\n  1000\n);\n```\n\nPretty great, huh? :)\n\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/detect-img-tag-onload/index.mdx",
    "content": "---\ntitle: Cookbook | Detect img tag onLoad\ncontributors:\n - gioboa\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\n\n\n# Detect img tag onLoad even if it's cached\n\nWhen using the onLoad$ property on an \\<img\\> tag in a Qwik component, you might encounter an issue where the onLoad$ event doesn't fire when the image is already cached in the browser.<br/>\nIn that case the onLoad$ logic is not being triggered.<br/>\nThis behavior is observed during normal navigation, but not when browser caching is disabled, indicating the cache's impact on the event.<br/>\nThe key point here is to [get hold of a DOM element](https://qwik.dev/docs/core/overview/#getting-hold-of-dom-element) to detect onLoad correctly.\n\n### Basic example\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/detect-img-tag-onload\" style={{ height: '20em' }}>\n```tsx\nimport { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const imgRef = useSignal<HTMLImageElement>();\n  useVisibleTask$(() => {\n    imgRef.value!.decode().then(() => {\n      alert('loaded and ready!');\n    });\n  });\n\n  return (\n    <section>\n      <img\n        ref={imgRef}\n        src=\"/logos/qwik-logo.svg\"\n        height={200}\n        width={200}\n      />\n    </section>\n  );\n});\n```\n</CodeSandbox>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/drag&drop/index.mdx",
    "content": "---\ntitle: Cookbook | Drag & Drop\ncontributors:\n - byte-barista\n---\n\nimport CodeSandbox, {CodeFile} from '../../../../components/code-sandbox/index.tsx';\n\n\n# Drag & Drop\n\nBuilding drag-and-drop functionality is a pretty common task in web development. With Qwik, you can easily implement drag-and-drop functionality by using the `onDragStart$`, `onDragOver$`, `onDragLeave$`, and `onDrop$` APIs. You need to have in mind that Qwik processes events asynchronously. This means that some APIs such as `event.preventDefault()`, `e.dataTransfer.getData()` or `e.dataTransfer.setData()` do not work as expected.\n\nTo work around this limitations, Qwik provides a [sync$()](/docs/cookbook/sync-events) API which allows you to process events synchronously. For preventing the default behavior, \nyou can use the `preventdefault:dragover` and `preventdefault:drop` attributes.\n\n\n### Basic example\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/drag&drop/basic\" style={{ height: '30em' }}>\n</CodeSandbox>\n\n\n<CodeFile src=\"/src/routes/demo/cookbook/drag&drop/basic\">\n```tsx\nimport { component$, useSignal, sync$, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const items1 = useSignal([\n    { id: 1, content: '📱 Phone' },\n    { id: 2, content: '💻 Laptop' },\n    { id: 3, content: '🎧 Headphones' },\n  ]);\n\n  const items2 = useSignal([\n    { id: 4, content: '⌚️ Watch' },\n    { id: 5, content: '🖱 Mouse' },\n    { id: 6, content: '⌨️ Keyboard' },\n  ]);\n\n  return (\n    <div class=\"flex min-h-screen justify-center gap-8 bg-gray-50 p-8\">\n      <div\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        })}\n        onDragLeave$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.removeAttribute('data-over');\n        })}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((_, currentTarget) => {\n            const id = currentTarget.dataset.droppedId;\n            if (id) {\n              const itemId = parseInt(id);\n              const item = [...items2.value].find((i) => i.id === itemId);\n              if (item) {\n                items2.value = items2.value.filter((i) => i.id !== itemId);\n                items1.value = [...items1.value, item];\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 1</h3>\n        {items1.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer?.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n\n      <div\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        })}\n        onDragLeave$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.removeAttribute('data-over');\n        })}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((_, currentTarget) => {\n            const id = currentTarget.dataset.droppedId;\n            if (id) {\n              const itemId = parseInt(id);\n              const item = [...items1.value].find((i) => i.id === itemId);\n              if (item) {\n                items1.value = items1.value.filter((i) => i.id !== itemId);\n                items2.value = [...items2.value, item];\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 2</h3>\n        {items2.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer?.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n});\n```\n</CodeFile>\n\n\n### Advanced example with sorting\n\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/drag&drop/advanced\" style={{ height: '30em' }}>\n</CodeSandbox>\n\n\n<CodeFile src=\"/src/routes/demo/cookbook/drag&drop/advanced\">\n```tsx\nimport { component$, sync$, useSignal, $ } from '@builder.io/qwik';\n\ntype Item = {\n  id: number;\n  content: string;\n};\n\nexport default component$(() => {\n  const items1 = useSignal<Item[]>([\n    { id: 1, content: '📱 Phone' },\n    { id: 2, content: '💻 Laptop' },\n    { id: 3, content: '🎧 Headphones' },\n  ]);\n\n  const items2 = useSignal<Item[]>([\n    { id: 4, content: '⌚️ Watch' },\n    { id: 5, content: '🖱 Mouse' },\n    { id: 6, content: '⌨️ Keyboard' },\n  ]);\n\n  return (\n    <div class=\"flex min-h-screen justify-center gap-8 bg-gray-50 p-8\">\n      <div\n        data-dropzone\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        })}\n        onDragLeave$={sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.removeAttribute('data-over');\n        })}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text/plain');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((e, currentTarget) => {\n            const draggedElementId = currentTarget.dataset.droppedId;\n            const isDropZone = currentTarget.hasAttribute('data-dropzone');\n\n            if (draggedElementId) {\n              const itemId = parseInt(draggedElementId);\n              const item = items2.value.find((i) => i.id === itemId);\n\n              if (item && isDropZone) {\n                items2.value = items2.value.filter((i) => i.id !== itemId);\n                items1.value = [...items1.value, item];\n              } else {\n                const newItems = [...items1.value];\n                const targetId = parseInt(\n                  (e.target as HTMLDivElement).dataset.id || '0'\n                );\n                if (targetId === 0) return;\n\n                const targetIndex = items1.value.findIndex(\n                  (i) => i.id === targetId\n                );\n                const draggedIndex = items1.value.findIndex(\n                  (i) => i.id === itemId\n                );\n\n                if (draggedIndex !== -1) {\n                  // Sorting in the same container\n                  swapElements(newItems, draggedIndex, targetIndex);\n                  items1.value = newItems;\n                } else {\n                  // Sorting between containers\n                  if (!item) return;\n                  items2.value = items2.value.filter((i) => i.id !== itemId);\n                  insertElement(newItems, targetIndex, item);\n                  items1.value = newItems;\n                }\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 1</h3>\n        {items1.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n\n      <div\n        class=\"h-[25em] w-80 rounded-xl border-2 border-dashed border-gray-300 bg-white p-6 shadow-xs transition-all duration-300 hover:border-gray-400 [&[data-over]]:border-blue-300 [&[data-over]]:bg-blue-50\"\n        data-dropzone\n        preventdefault:dragover\n        preventdefault:drop\n        onDragOver$={(_: DragEvent, currentTarget: HTMLDivElement) => {\n          currentTarget.setAttribute('data-over', 'true');\n        }}\n        onDragLeave$={[\n          sync$((_: DragEvent, currentTarget: HTMLDivElement) => {\n            currentTarget.removeAttribute('data-over');\n          }),\n        ]}\n        onDrop$={[\n          sync$((e: DragEvent, currentTarget: HTMLDivElement) => {\n            const id = e.dataTransfer?.getData('text/plain');\n            currentTarget.dataset.droppedId = id;\n            currentTarget.removeAttribute('data-over');\n          }),\n          $((e, currentTarget) => {\n            const draggedElementId = currentTarget.dataset.droppedId;\n            const isDropZone = currentTarget.hasAttribute('data-dropzone');\n\n            if (draggedElementId) {\n              const itemId = parseInt(draggedElementId);\n              const item = items1.value.find((i) => i.id === itemId);\n\n              if (isDropZone && item) {\n                items1.value = items1.value.filter((i) => i.id !== itemId);\n                items2.value = [...items2.value, item];\n              } else {\n                const targetId = parseInt(\n                  (e.target as HTMLDivElement).dataset.id || '0'\n                );\n                if (targetId === 0) return;\n                const newItems = [...items2.value];\n                const draggedIndex = items2.value.findIndex(\n                  (i) => i.id === itemId\n                );\n                const targetIndex = items2.value.findIndex(\n                  (i) => i.id === targetId\n                );\n                if (draggedIndex !== -1) {\n                  // Sorting in the same container\n                  swapElements(newItems, targetIndex, draggedIndex);\n                  items2.value = newItems;\n                } else {\n                  // Sorting between containers\n                  if (!item) return;\n                  items1.value = items1.value.filter((i) => i.id !== itemId);\n                  insertElement(newItems, targetIndex, item);\n                  items2.value = newItems;\n                }\n              }\n            }\n          }),\n        ]}\n      >\n        <h3 class=\"mb-4 text-lg font-semibold text-gray-700\">Container 2</h3>\n        {items2.value.map((item) => (\n          <div\n            key={item.id}\n            data-id={item.id}\n            class=\"min-h-[62px] mb-3 cursor-move select-none rounded-lg border border-gray-200 bg-white p-4 transition-all duration-200 hover:-translate-y-1 hover:shadow-md active:scale-95\"\n            draggable\n            onDragStart$={sync$(\n              (e: DragEvent, currentTarget: HTMLDivElement) => {\n                const itemId = currentTarget.getAttribute('data-id');\n                if (e.dataTransfer && itemId) {\n                  e.dataTransfer.setData('text/plain', itemId);\n                }\n              }\n            )}\n          >\n            <span class=\"text-lg text-gray-700\">{item.content}</span>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n});\n\nfunction swapElements(arr: Item[], index1: number, index2: number) {\n  arr[index1] = arr.splice(index2, 1, arr[index1])[0];\n\n  return arr;\n}\n\nfunction insertElement(arr: Item[], index: number, item: Item) {\n  arr.splice(index, 0, item);\n  return arr;\n}\n\n```\n</CodeFile>\n\n\n\n\nYou can find more information about drag-and-drop in the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API)."
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/fonts/index.mdx",
    "content": "---\ntitle: Cookbook | Font optimization\ncontributors:\n  - thejackshelton\nupdated_at: '2023-12-28T16:33:00Z'\ncreated_at: '2023-12-28T16:33:00Z'\n---\n\n# Fonts\n\nA memorable typeface can be a great way to make your site stand out. However, it's important to be mindful of the performance implications of using custom fonts.\n\nUnlike system fonts, that come pre-installed on a user's machine, custom fonts need to be downloaded.\n\n## FOIT vs. FOUT\n\nWhen a user visits a website, the browser will request the font files from the server. The browser will then use the font files to render the text on the page.\n\nThere are two main strategies:\n\n- Delay text display until the web font is downloaded (**FOIT** - Flash Of Invisible Text).\n- Use a locally installed \"fallback\" font until the web font is ready (**FOUT** - Flash Of Unstyled Text).\n\nBoth methods have drawbacks. FOIT withholds text from the user, while FOUT can cause a disruptive visual experiences. Both cause CLS issues. As long as web fonts need to be downloaded, these issues persist.\n\n### Font Display\n\nLuckily, we can make use of the [font-display](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display) property to control how the browser handles font loading. This allows us to strike a balance between the two strategies.\n\n> We suggest playing around with the different loading strategies, as well as how the font display timeline works. \n\nThe two most common values for the `font-display` property are `swap` and `fallback`.\n\n## Google Fonts\n\nGoogle Fonts is a popular open source library, offering over 1500 font families. \n\nWhile they are easy to use, they involve downloading a CSS file and fonts from different domains, causing a noticeable delay and switch in font loading despite using `swap`. \n\nHere's what happens: \n\n1. The browser spots the `<link href=\"https://fonts.googleapis.com/css2\">` tag, which prompts it to request a CSS file. \n2. After analyzing the file, it realizes a web font from https://fonts.gstatic.com is needed, leading to another request.\n\nTo mitigate this, we can **self host** our fonts.\n\n## Self Hosting\n\nRather than using a third-party provider like Google Fonts, we can self-host our fonts. This means we download the font files and serve them from our own domain.\n\nSome benefits include:\n\n- Improved performance \n- More privacy as Google tracks font usage.\n- Self-hosted fonts load offline, useful for PWA's or low connectivity situations.\n\n### Fontsource\n\nSelf-hosting with fontsource is as easy as an npm install. It includes all of the google fonts, as well as [other open source fonts](https://github.com/fontsource/font-files/tree/main/fonts/other), without the hassle of managing the files yourself.\n\nThey also have a [Qwik City guide](https://fontsource.org/docs/guides/qwik), on how to add fontsource to your project.\n\n### Manual\n\nSometimes we want to self host a font that is not included in Google fonts, or fontsource.\n\nIf we have a `ttf` or `otf` file, we want to convert it to a `woff` or `woff2` file. To do that, we can use Fontsquirrel's [Webfont Generator Tool](https://www.fontsquirrel.com/tools/webfont-generator).\n\nNext we need to create an `@font-face` rule in our CSS. We want to create a new rule for each font weight and style we want to use.\n\n```css\n@font-face {\n  font-display: swap;\n  font-family: \"Peace Sans\";\n  font-style: normal;\n  font-weight: 400;\n  src: url(\"../assets/fonts/peace-sans.woff2\") format(\"woff2\");\n}\n```\n\nThe above is an example of an `@font-face` rule for the font \"Peace Sans\" with a font weight of 400, with a relative URL to our font file. We can then use the font in our CSS like so:\n\n```css\nbody {\n  font-family: 'Peace Sans', sans-serif;\n}\n```\n\n#### Manually self-hosting Google Fonts\n\nThe [Google Webfonts Helper](https://gwfh.mranftl.com/fonts) is a tool that allows you to download the optimized google fonts.\n\nUnfortunately, this does not include variable fonts. To get around this, you can use the Google Fonts API, and then download the optimized variable font file in Chrome's `network` tab.\n\n### Reducing font size\n\nIf we are not using certain glyphs, we can reduce the font size by using the `unicode-range` property. [Glyphhanger](https://www.npmjs.com/package/glyphhanger) is a tool that allows us to grab a specific subset of a font.\n\n> A common scenario, would be using only the latin subset of a font. This can reduce our font file size.\n\n## Fallback fonts\n\nIf you recall an earlier section, we mentioned that we can get CLS issues when our custom fonts load in.\n\nRecently, there has been an effort of \"font matching\", or adjusting typography properties to reduce the CLS impact of custom fonts. Let's take a look at how we can do that.\n\n### Fallback Font Generator\n\n[This tool](https://screenspan.net/fallback) generates a system fallback with special properties. Here's an over-exaggerated [demo](https://screenspan.net/prototypes/fallback-font/) of how it works\n\nYou can use the `size-adjust`, `ascent-override`, and `descent-override` properties to adjust the system fallback font to match the custom font.\n\n### Fontaine\n\n[Fontaine](https://github.com/unjs/fontaine) will automatically adjust the above properties to avoid CLS issues. They provide a vite plugin that you can add in your vite config.\n\n## System Fonts\n\nThe most performant option is system fonts. This is because the user already has the font installed on their machine, and the browser can render the text immediately.\n\nSystem fonts often are often called *\"font stacks\"*, which are a collection of system fonts that are similar enough to each other. If the first font is not available, the browser can use the next one in the stack.\n\nTailwind CSS also provides [utility classes](https://tailwindcss.com/docs/font-family) for common system fonts. [Modern Font Stacks](https://github.com/system-fonts/modern-font-stacks) is an example tool you can use to test out different font stacks, including a [Tailwind CSS plugin](https://github.com/BorisAnthony/mfs-tailwind) from a community member.\n\n## Font UX\n\n### Do not use the `ch` unit for body max-width\n\nIt's recommended to have a max-width of `75ch` or 75 characters so that the user does not have to move their head to read the text, as well as it's easier to follow.\n\nHowever, if we are using a custom font, we should be mindful of the `ch` unit. This is because the `ch` unit is based on the width of the `0` character, which can vary between fonts.\n\nThis can cause some very peculiar layout shifts. We want to set a max-width using `px` or `rem`.\n\n### Use `rem` with the `font-size` property.\n\nDifferent units each have their own [accessibility concerns](https://www.joshwcomeau.com/css/surprising-truth-about-pixels-and-accessibility/). We want to use `rem` with the `font-size` property, as it is based on the root font size. Otherwise, the user's chosen font size will not be respected.\n\n### Line height recommendations\n\nThe browser's default line height is not preferable for reading. With body fonts, we want to have a line height around 1.5. For headings, we want to have a line height around 1.2.\n\n\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/glob-import/index.mdx",
    "content": "---\ntitle: Cookbook | Glob Import with import.meta.glob\ncontributors:\n  - maiieul\n  - gioboa\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\n\n# Glob Import & Dynamic Import\n\nAs you probably know, Qwik takes care of lazy-loading for you in order to make your app performant and scalable by default.\n\nAs a consequence of this automatic optimization, you don't need to and shouldn't use vite's [dynamic imports](https://vitejs.dev/guide/features#dynamic-import) feature as it conflicts with the [optimizer](<../../(qwik)/advanced/optimizer/index.mdx>).\n\nBut there are still some cases where you may need to import a lot of files from a directory and you may not want to type out all the file paths. For that kind of situation, you can use [`import.meta.glob`](https://vitejs.dev/guide/features#glob-import).\n\n## import.meta.glob\n\nThe goal of using `import.meta.glob` is to allow you to create a wrapper component to which you can pass a name prop to chose which component you want to import:\n\n```tsx\n<MetaGlobComponent name=\"file-name\" />\n<MetaGlobComponent name=\"another-file-name\" />\n<MetaGlobComponent name=\"etc.\" />\n```\n\nAs written in the Vite documentation, `import.meta.glob` comes with a few features that allow you to specify how to import your files.\n\nBy default you can simply use pattern matching to specify which files should be imported from which folder:\n\n```tsx\nconst metaGlobComponents: Record<string, any> = await import.meta.glob('/src/components/*');\n```\n\nBut you can also pass in additional options like [`import`](https://vitejs.dev/guide/features#named-imports), [`query`](https://vite.dev/guide/features.html#custom-queries):\n\n```tsx\nconst metaGlobComponents: Record<string, any> = await import.meta.glob('/src/components/*', {\n  import: 'default',\n  query: '?raw',\n});\n```\n\n## How to\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/glob-import/\">\n```tsx\nimport {\n  type Component,\n  component$,\n  useSignal,\n  useTask$,\n} from '@builder.io/qwik';\n\nconst metaGlobComponents: Record<string, any> = await import.meta.glob(\n  '/src/examples/*',\n  { import: 'default' }\n);\n\nexport default component$(() => {\n  return (\n    <div>\n      <MetaGlobExample name=\"example1\" />\n      <MetaGlobExample name=\"example2\" />\n      <MetaGlobExample name=\"example3\" />\n    </div>\n  );\n});\n\nexport const MetaGlobExample = component$<{ name: string }>(({ name }) => {\n  const MetaGlobComponent = useSignal<Component<any>>();\n  const componentPath = `/src/examples/${name}.tsx`;\n\n  useTask$(async () => {\n    MetaGlobComponent.value = await metaGlobComponents[componentPath]();\n  });\n\n  return <>{MetaGlobComponent.value && <MetaGlobComponent.value />}</>;\n});\n```\n</CodeSandbox>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/index.mdx",
    "content": "---\ntitle: Cookbook | Overview\ncontributors:\n  - mhevery\n  - fabiobiondi\n  - n8sabes\n  - Craiqser\n  - Inaam-Ur-Rehman\n  - maiieul\n  - Adbib\n  - gioboa\n  - aendel\n  - shairez\n---\n\n# Cookbook\n\nA cookbook contains a collection of useful patterns for solving common problems in front-end development.\n\nExamples:\n\n- [Algolia search](./algolia-search/)\n- [Combine Request Handlers](./combine-request-handlers/)\n- [Debouncer](./debouncer/)\n- [Deploy with Node using Docker](./node-docker-deploy/)\n- [Font optimization](./fonts/)\n- [Glob Import with import.meta.glob](./glob-import/)\n- [Media Controller with iOS Support](./mediaController/)\n- [NavLink](./nav-link/)\n- [Portals](./portals/)\n- [Streaming/deferred loaders](./streaming-deferred-loaders)\n- [Synchronous Events with State](./sync-events/)\n- [Theme Management](./theme-management/)\n- [Drag & Drop](./drag&drop/)\n- [View Transition](./view-transition/)\n- [Detect img tag onLoad](./detect-img-tag-onload/)"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/mediaController/index.mdx",
    "content": "---\ntitle: Cookbook | Media Controller with iOS Support\ncontributors:\n  - n8sabes\n  - fabian-hiller\n  - igorbabko\nupdated_at: '2023-10-03T18:53:59Z'\ncreated_at: '2023-08-31T22:41:52Z'\n---\n\nimport CodeSandbox, {CodeFile} from '../../../../components/code-sandbox/index.tsx';\n\n# Media Controller\n\nDeveloping for a diverse range of browsers and devices often introduces unique challenges. One of the most notable challenges is ensuring consistent media playback, particularly on Apple's iOS devices.\n\n## iOS Media Playback Restrictions Explained\n\nApple's iOS has established specific rules for audio and video playback to enhance user experience and manage data consumption:\n\n1. **User Experience**: iOS prohibits media from auto-playing to prevent unexpected disturbances. This design choice ensures users aren't unexpectedly disrupted by sudden audio, especially in quiet settings.\n2. **Data Efficiency**: Given that streaming media can be data-intensive, iOS requires users to manually initiate media playback. This design is especially beneficial for users on limited or metered data plans.\n\n## Deciphering the iOS Playback Challenge\n\nAt the heart of the iOS challenge is the system's insistence on user-initiated media playback. For instance, starting a video must result directly from a user action, like a tap. However, asynchronous event handlers, such as `onClick$` (QRL), can create a disconnect between the user's action and the playback command. This often results in iOS blocking playback on the first tap, requiring a second, non-intuitive tap.\n\n## The `playsinline` Attribute\n\nOn iOS devices, especially iPhones, videos automatically play in fullscreen mode unless the `playsinline` attribute is present on the `<video>` tag. This attribute ensures that videos play within their designated container, providing a consistent experience across different devices and platforms. While primarily intended for iOS, including `playsinline` is harmless on other platforms and ensures broader compatibility.\n\n## Crafting a Universal Playback Solution\n\nTo achieve consistent media playback across various browsers and devices, a holistic approach is essential. This guide presents a solution that addresses the nuances of different platforms. To ensure immediate playback upon user interaction, the `.play()` method should be invoked synchronously. This can be accomplished by directly attaching the `click` handler within the `useVisibleTask$` function.\n\nBelow, you'll find a prototype of an audio and video controller, tailored to provide a consistent user experience across multiple platforms.\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/mediaController/\"  style={{ height: '700px' }}>\n</CodeSandbox>\n\nUniversal media controller code compatible with iOS devices looks like this:\n\n<CodeFile src=\"/src/routes/demo/cookbook/mediaController/index.tsx\">\n```tsx\nimport {\n  component$,\n  useSignal,\n  useStylesScoped$,\n  useVisibleTask$,\n} from '@builder.io/qwik';\nimport { useLocation } from '@builder.io/qwik-city';\n\nconst AUDIO_SRC =\n  'https://cdn.builder.io/o/assets%2F5b8073f890b043be81574f96cfd1250b%2Fafe011812da146a5b2263196cb25f263?alt=media&token=c017cd87-0598-4af2-8afd-e9b5a3fba078&apiKey=5b8073f890b043be81574f96cfd1250b';\nconst VIDEO_SRC =\n  'https://cdn.builder.io/o/assets%2F5b8073f890b043be81574f96cfd1250b%2F8b210c56974440649a0a78d4a3a0ddc5%2Fcompressed?apiKey=5b8073f890b043be81574f96cfd1250b&token=8b210c56974440649a0a78d4a3a0ddc5&alt=media&optimized=true';\n\nexport default component$(() => {\n  const audioElementSignal = useSignal<HTMLAudioElement | undefined>();\n  const audioPlayButtonSignal = useSignal<HTMLButtonElement | undefined>();\n  const audioIsPlayingSignal = useSignal(false);\n  const videoElementSignal = useSignal<HTMLAudioElement | undefined>();\n  const videoPlayButtonSignal = useSignal<HTMLButtonElement | undefined>();\n  const videoIsPlayingSignal = useSignal(false);\n  const playsInlineSignal = useSignal(true);\n  const location = useLocation();\n\n  const videoPoster =\n    location.url.origin + '/sample-media/qwik-koi-poster.jpg';\n\n  useStylesScoped$(`\n        segment {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          text-align: center;\n          width: 100%;\n          padding: 20px;\n          color: #1dacf2\n        }\n        .content {\n          width: 60%;\n          min-width: 250px;\n        }\n        button {\n          padding: 20px;\n          font-weight: bold;\n          font-size: 1.2em;\n          width: 100%;\n          background: #1dacf2;\n          color: white;\n        }\n        .checkbox-container {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n        .checkbox {\n          width: 20px;\n          height: 20px;\n          margin-right: 8px;\n        }\n        .video-container {\n          position: relative;\n          width: 100%;\n          height: 0;\n          padding-bottom: calc(56.25% + 1px);\n        }\n        video {\n          position: absolute;\n          top: 0;\n          left: 0;\n          width: 100%;\n          height: 100%;\n          box-sizing: border-box;\n          border: 1px solid gray;\n        }\n        `);\n\n  useVisibleTask$(({ track }) => {\n    track(() => audioPlayButtonSignal.value);\n    track(() => audioElementSignal.value);\n\n    const play = () =>\n      audioIsPlayingSignal.value\n        ? audioElementSignal.value?.pause()\n        : audioElementSignal.value?.play();\n\n    audioPlayButtonSignal.value?.removeEventListener('click', play);\n    audioPlayButtonSignal.value?.addEventListener('click', play);\n\n    return () =>\n      audioPlayButtonSignal.value?.removeEventListener('click', play);\n  });\n\n  useVisibleTask$(({ track }) => {\n    track(() => videoPlayButtonSignal.value);\n    track(() => videoElementSignal.value);\n\n    const play = () =>\n      videoIsPlayingSignal.value\n        ? videoElementSignal.value?.pause()\n        : videoElementSignal.value?.play();\n\n    videoPlayButtonSignal.value?.addEventListener('click', play);\n    return () =>\n      videoPlayButtonSignal.value?.removeEventListener('click', play);\n  });\n\n  return (\n    <segment>\n      <div class=\"content\">\n        <h1>Media Controller</h1>\n        <h3>\n          <i>with iOS Support</i>\n        </h3>\n        <br />\n        <div class=\"video-container\">\n          <video\n            ref={videoElementSignal}\n            src={VIDEO_SRC}\n            poster={videoPoster}\n            playsInline={playsInlineSignal.value}\n            onPlay$={() => (videoIsPlayingSignal.value = true)}\n            onPause$={() => (videoIsPlayingSignal.value = false)}\n            onEnded$={() => (videoIsPlayingSignal.value = false)}\n          />\n        </div>\n        <audio\n          ref={audioElementSignal}\n          src={AUDIO_SRC}\n          onPlay$={() => (audioIsPlayingSignal.value = true)}\n          onPause$={() => (audioIsPlayingSignal.value = false)}\n          onEnded$={() => (audioIsPlayingSignal.value = false)}\n        />\n        <br />\n        <div class=\"checkbox-container\">\n          <input\n            type=\"checkbox\"\n            id=\"playsInlineCheckbox\"\n            class=\"checkbox\"\n            checked={playsInlineSignal.value}\n            onchange$={() => {\n              videoElementSignal.value?.pause();\n              playsInlineSignal.value = !playsInlineSignal.value;\n            }}\n          />\n          <label for=\"playsInlineCheckbox\">playsInline (iOS)</label>\n        </div>\n\n        <br />\n        <button ref={videoPlayButtonSignal}>\n          {videoIsPlayingSignal.value ? 'Pause' : 'Play'} Video\n        </button>\n        <br />\n        <br />\n        <button ref={audioPlayButtonSignal}>\n          {audioIsPlayingSignal.value ? 'Pause' : 'Play'} Audio\n        </button>\n      </div>\n    </segment>\n  );\n});\n```\n</CodeFile>\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/nav-link/index.mdx",
    "content": "---\ntitle: Cookbook | Navbar link\ncontributors:\n  - Adbib\n---\n\nimport CodeSandbox, { CodeFile } from '../../../../components/code-sandbox/index.tsx';\n\n# NavLink Component\n\nIf you want to add `active` state to your links you can use this solution.\nThe NavLink component enhances Qwik `<Link>` component by adding:\n\n- **Active Status**: Apply a class when the link href matches the current URL pathname.\n\nThis allows styling the active state for navigation.\n\n## How it Works \n\nUnder the hood, NavLink uses the `useLocation` hook to get navigation status.\nIt checks if the link href matches the current URL pathname to set activeClass. \nThis allows NavLink to know the active state automatically based on navigation.\n\n<CodeFile src=\"/src/routes/demo/cookbook/nav-link/index.tsx\">\n```tsx\nimport { Slot, component$ } from '@builder.io/qwik';\nimport { Link, useLocation, type LinkProps } from '@builder.io/qwik-city';\n\ntype NavLinkProps = LinkProps & { activeClass?: string };\n\nexport const NavLink = component$(\n  ({ activeClass, ...props }: NavLinkProps) => {\n    const location = useLocation();\n    const toPathname = props.href ?? '';\n    const locationPathname = location.url.pathname;\n\n    const startSlashPosition =\n      toPathname !== '/' && toPathname.startsWith('/')\n        ? toPathname.length - 1\n        : toPathname.length;\n    const endSlashPosition =\n      toPathname !== '/' && toPathname.endsWith('/')\n        ? toPathname.length - 1\n        : toPathname.length;\n    const isActive =\n      locationPathname === toPathname ||\n      (locationPathname.endsWith(toPathname) &&\n        (locationPathname.charAt(endSlashPosition) === '/' ||\n          locationPathname.charAt(startSlashPosition) === '/'));\n\n    return (\n      <Link\n        {...props}\n        class={[props.class, isActive && activeClass ? activeClass : \"\"]}\n        \n      >\n        <Slot />\n      </Link>\n    );\n  }\n);\n```\n</CodeFile>\n\n\n## Usage\n\nYou can use NavLink with the addition of `activeClass` props:\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/nav-link/example/index.tsx\" style={{ height: '10em' }}>\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { NavLink } from '..';\n\nexport default component$(() => {\n  return (\n    <>\n      Links\n      <div>\n        <NavLink href=\"/docs\" activeClass=\"text-green-600\">\n          /docs\n        </NavLink>\n      </div>\n      <div>\n        <NavLink\n          href=\"/demo/cookbook/nav-link/example/\"\n          activeClass=\"text-green-600\"\n        >\n          /demo/cookbook/nav-link/example/\n        </NavLink>\n      </div>\n    </>\n  );\n});\n```\n</CodeSandbox>\n\n## Tailwind \nIf you are using Tailwind CSS make sure to edit your tailwind config file, and add `important=true` to your export, then add `!` before the CSS classes you're using `activeClass=\"!text-green-600\"` to make them important when the link is active.\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/node-docker-deploy/index.mdx",
    "content": "---\ntitle: Cookbook | Deploy with Node using Docker\ncontributors:\n  - nelsonprsousa\n  - aendel\nupdated_at: '2023-12-28T16:00:00Z'\ncreated_at: '2023-12-28T16:00:00Z'\n---\n\n# Deploy with Node using Docker\n\nThis Dockerfile is used to build a Docker image for our Qwik Node.js application. You can edit it accordingly to use pnpm, npm, yarn or bun, by replacing yarn commands and `yarn.lock` file.\n\nWe are using the official Node.js Alpine image with Node version set to 18.18.2 (a long term support version). You are free to choose some other version based on your needs.\n\nWe then proceed to install dependencies, utilizing Docker caching mechanism by leveraging bind mounts for `package.json` and `yarn.lock` to avoid unnecessary reinstallation of dependencies.\n\nOnce the dependencies are installed, we proceed to build, setting the NODE_ENV and ORIGIN environment variables.\n\nWe finally specify the default command to run our Qwik application with `yarn serve`, exposing the port 3000: Please note that port number should match the one you chose on your entry adapter (e.g.: `src/entry.express.tsx`).\n\n ```docker\n ARG NODE_VERSION=18.18.2\n\n################################################################################\n# Use node image for base image for all stages.\nFROM node:${NODE_VERSION}-alpine as base\n\n# Set working directory for all build stages.\nWORKDIR /usr/src/app\n\n################################################################################\n# Create a stage for installing production dependencies.\nFROM base as deps\n\n# Download dependencies as a separate step to take advantage of Docker's caching.\n# Leverage a cache mount to /root/.yarn to speed up subsequent builds.\n# Leverage bind mounts to package.json and yarn.lock to avoid having to copy them\n# into this layer.\nRUN --mount=type=bind,source=package.json,target=package.json \\\n    --mount=type=bind,source=yarn.lock,target=yarn.lock \\\n    --mount=type=cache,target=/root/.yarn \\\n    yarn install --frozen-lockfile\n\n################################################################################\n# Create a stage for building the application.\nFROM deps as build\n\n# Copy the rest of the source files into the image.\nCOPY . .\n\n# Run the build script.\nRUN yarn run build\n\n################################################################################\n# Create a new stage to run the application with minimal runtime dependencies\n# where the necessary files are copied from the build stage.\nFROM base as final\n\n# Use production node environment by default.\nENV NODE_ENV production\n\n# Pay attention to set the correct origin and port for the application.\n# This is used by the application to determine the origin of requests.\n# If you don't set this, the application will default to http://localhost:3000\n# If you set a wrong origin, the application may not work correctly, for example routeAction$ will not work\nENV ORIGIN https://example.com\n\n# Run the application as a non-root user.\nUSER node\n\n# Copy package.json so that package manager commands can be used.\nCOPY package.json .\n\n# Copy the production dependencies from the deps stage and also\n# the built application from the build stage into the image.\nCOPY --from=deps /usr/src/app/node_modules ./node_modules\nCOPY --from=build /usr/src/app/dist ./dist\nCOPY --from=build /usr/src/app/server ./server\n\n# Expose the port that the application listens on.\nEXPOSE 3000\n\n# Run the application.\nCMD yarn serve\n ```\n\n You can now build your docker image:\n\n ```shell\n docker build -t your-image .\n ```\n\nAnd start a Docker container:\n\n ```shell\ndocker run -dp 127.0.0.1:3000:3000 your-image\n ```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/portals/index.mdx",
    "content": "---\ntitle: Cookbook | Portals\ncontributors:\n  - mhevery\n  - thejackshelton\n  - fabian-hiller\n  - igorbabko\n  - aendel\nupdated_at: '2023-10-03T18:53:59Z'\ncreated_at: '2023-08-21T21:16:38Z'\n---\n\nimport CodeSandbox, {CodeFile} from '../../../../components/code-sandbox/index.tsx';\n\n# Portals\n\nIn front-end development, sometimes we need to display a component (like a modal or tooltip) in a different place from where it was triggered. The issue is that the UI element needs to be rendered in a different part of the DOM tree, and the component that triggers the element needs to have a way to affect the location of rendering.\n\nIn other frameworks, this is often solved by a dedicated API such as [`createPortal()`](https://react.dev/reference/react-dom/createPortal). However such APIs don't work well with server-side rendering and so an alternative approach is needed.\n\nLuckily, there is native behavior that handles this for us, called the [top layer](https://developer.chrome.com/blog/what-is-the-top-layer). It is supported in all major browsers.\n\n## Qwik UI\n\nThe Qwik UI team has done an awesome job of filling in the gaps, and allowing us to use this behavior in production across all browsers.\n\n### Modals\n\nWe use modals when we do not want the user to interact with the rest of the page. The rest of the content is inert, or unable to be interacted with.\n\n[Qwik UI's modal component](https://qwikui.com/docs/headless/modal/) uses the dialog element's [showModal](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal) method, which is well-supported in browsers and automatically handles placing UI outside of the HTML Document.\n\nIt also includes behavior such as focus and scroll locking, alert dialogs, automatic entry and exit animation support, and backdrop animations.\n\n### Popovers\n\nIf the UI element can interact with the rest of the page, then it is not modal.\n\nSome examples of non-modal components are:\n- Popovers\n- Overlays\n- Toasts\n- Tooltips\n- Dropdown menus\n- Selects\n- Comboboxes\n\n[MDN's popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) replaces the need for portals in non-modal components. Support is also in every major browser.\n\nQwik UI has taken it upon themselves by providing a polyfill with feature parity to the native spec. You can use the Popover API's behavior in production today with [Qwik UI's Popover](https://qwikui.com/docs/headless/popover/) component.\n\nIn the case of components like a select or combobox, Qwik UI also provides the ability to opt-in to \"floating\" behavior. For example, when a listbox anchors to an input element. You can do so by adding `floating={true}` to your Popover component. This will execute a bit of extra javascript needed for floating behavior.\n\nIt is intentionally opt-in, at some point the CSS Anchor API will provide a native solution, and so there should be an easy migration path when that receives more general support.\n\n> Because these solutions are built on top of the native specs, that also means there's less javascript we need to prefetch, and therefore less work that needs to be done!\n\nBoth Qwik UI's popover and modal components can be used regardless of meta-framework or microfrontend, as long as there is support for Qwik.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/streaming-deferred-loaders/index.mdx",
    "content": "---\ntitle: Cookbook | Streaming/deferred loaders\ncontributors:\n  - gioboa\nupdated_at: '2024-02-23T01:00:00Z'\ncreated_at: '2024-02-23T01:00:00Z'\n---\n\nimport CodeSandbox, { CodeFile } from '../../../../components/code-sandbox/index.tsx';\n\n# Streaming/deferred loaders\n\nWhen you use `routeLoader$` the default behavior is to wait for it to complete before rendering our component(s).\nHowever, there is a way to render the DOM up to the point where `routeLoader$` is used and wait for it to complete.\nBy returning an asynchronous function from our `routeLoader$` we can stream/defer the rendering to provide immediate visual feedback. \n\n<CodeFile src=\"/src/routes/demo/cookbook/streaming-deferred-loaders/index.tsx\" >\n```tsx\nimport { Resource, component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useMyData = routeLoader$(async () => {\n  return async () => {\n    await delay(4_000);\n    return 'MyData ' + Math.random();\n  };\n});\n\nconst delay = (timeout: number) => {\n  return new Promise((res) => setTimeout(res, timeout));\n};\n\nexport default component$(() => {\n  const myData = useMyData();\n  return (\n    <>\n      <div>BEFORE</div>\n      <Resource\n        value={myData}\n        onResolved={(data) => <div>DATA: {data}</div>}\n      />\n      <div>AFTER</div>\n    </>\n  );\n});\n```\n</CodeFile>\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/streaming-deferred-loaders/\" />\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/sync-events/index.mdx",
    "content": "---\ntitle: Cookbook | Synchronous Events with State\ncontributors:\n  - mhevery\n  - RumNCodeDev\n---\n\nimport CodeSandbox, {CodeFile} from '../../../../components/code-sandbox/index.tsx';\n\n\n# `sync$()` Synchronous Events (BETA)\n\nQwik processes events asynchronously. This means that some APIs such as `event.preventDefault()` and `event.stopPropagation()` do not work as expected. To work around this limitation, Qwik provides a `sync$()` API which allows you to process events synchronously. But `sync$()` comes with a few caveats:\n1. `sync$()` can't close over any state.\n2. `sync$()` can't call other functions which are declared in scope or imported.\n3. `sync$()` is serialized into HTML and therefore we should be conscious of the size of the function.\n\nA typical way to deal with these limitations is to split the event handling into two parts:\n1. `sync$()` which is called synchronously and can call methods such as `event.preventDefault()` and `event.stopPropagation()`.\n2. `$()` which is called asynchronously and can close over the state and call other functions, and has no restriction on the size.\n\nBecause `sync$()` can't access the state what is the best strategy to deal with it? The answer is to use element attributes to pass state into the `sync$()` function.\n> **NOTE:** If you only need to prevent the default behavior, you can simply use the standard [`preventDefault:{eventName}`](/docs/core/events/#prevent-default) syntax. This is strictly for when you need to chain events together synchronously\n\n## Example: `sync$()` with state\n\nIn this example, we have a behavior where we want to prevent the default behavior of the link based on some state. We do this by breaking the code into three parts:\n1. `sync$()`: a synchronous portion that is kept to the minimum,\n2. `$()`: an asynchronous portion that can be arbitrarily large, and can close over state,\n3. `data-should-prevent-default`: an attribute on the element that is used to pass state into the `sync$()` function.\n\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/sync-event/\"  style={{ height: '15em' }}>\n</CodeSandbox>\n\n\n<CodeFile src=\"/src/routes/demo/cookbook/sync-event/index.tsx\">\n```tsx\nimport { component$, useSignal, sync$, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const shouldPreventDefault = useSignal(true);\n  return (\n    <div>\n      <div>Sync Event:</div>\n      <input\n        type=\"checkbox\"\n        checked={shouldPreventDefault.value}\n        onChange$={(e, target) =>\n          (shouldPreventDefault.value = target.checked)\n        }\n      />{' '}\n      Should Prevent Default\n      <hr />\n      <a\n        href=\"https://google.com\"\n        target=\"_blank\"\n        data-should-prevent-default={shouldPreventDefault.value}\n        onClick$={[\n          sync$((e: MouseEvent, target: HTMLAnchorElement) => {\n            if (target.hasAttribute('data-should-prevent-default')) {\n              e.preventDefault();\n            }\n          }),\n          $(() => {\n            console.log(\n              shouldPreventDefault.value ? 'Prevented' : 'Not Prevented'\n            );\n          }),\n        ]}\n      >\n        open Google\n      </a>\n    </div>\n  );\n});\n```\n</CodeFile>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/theme-management/index.mdx",
    "content": "---\ntitle: Cookbook | Dark and Light Theme\ncontributors:\n  - Inaam-Ur-Rehman\n  - gioboa\n  - aendel\n  - chindris-mihai-alexandru\n  - forresst\nupdated_at: '2026-02-05T00:00:00Z'\ncreated_at: '2023-10-10T16:59:26Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Theme management\n\nIn modern websites, dark and light theme support creates a better user experience. Users can change the theme according to their preferences or system settings.\n\nThis guide covers theme management with Tailwind CSS, including solutions for Static Site Generation (SSG) and Content Security Policy (CSP) considerations.\n\n## Setup Tailwind CSS\n\nFirst, install Tailwind CSS in your Qwik project:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add tailwind\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add tailwind\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add tailwind\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add tailwind\n```\n</span>\n</PackageManagerTabs>\n\nEnable dark mode in your `global.css`:\n\n```css\n@import \"tailwindcss\";\n\n/* Add the line below to enable dark mode */\n@custom-variant dark (&:where(.dark, .dark *));\n```\n\n## Basic Implementation\n\n### Step 1: Add the theme initialization script\n\nAdd this script to the `<head>` in your `root.tsx` file. This script runs before the page renders, preventing a flash of the wrong theme:\n\n```tsx\n// In root.tsx, inside the <head> tag\n<script\n  dangerouslySetInnerHTML={`\n    (function() {\n      function setTheme(theme) {\n        document.documentElement.classList.remove('light', 'dark');\n        document.documentElement.classList.add(theme);\n        localStorage.setItem('theme', theme);\n      }\n      const stored = localStorage.getItem('theme');\n      if (stored) {\n        setTheme(stored);\n      } else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {\n        setTheme('dark');\n      } else {\n        setTheme('light');\n      }\n    })();\n  `}\n/>\n```\n\n### Step 2: Create the theme toggle component\n\n```tsx\nimport { component$ } from \"@builder.io/qwik\";\n\nexport const ThemeToggle = component$(() => {\n  return (\n    <button\n      type=\"button\"\n      aria-label=\"Toggle dark mode\"\n      onClick$={() => {\n        const isDark = document.documentElement.classList.contains('dark');\n        const newTheme = isDark ? 'light' : 'dark';\n        document.documentElement.classList.remove('light', 'dark');\n        document.documentElement.classList.add(newTheme);\n        localStorage.setItem(\"theme\", newTheme);\n      }}\n      class=\"p-2 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700\"\n    >\n      {/* Sun icon for dark mode, Moon icon for light mode */}\n      <svg class=\"w-5 h-5 hidden dark:block\" fill=\"currentColor\" viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n        <path d=\"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z\" />\n      </svg>\n      <svg class=\"w-5 h-5 block dark:hidden\" fill=\"currentColor\" viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n        <path d=\"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z\" />\n      </svg>\n    </button>\n  );\n});\n```\n\n## SSG (Static Site Generation) Considerations\n\nWhen using Static Site Generation with adapters like Cloudflare Pages, Netlify, or the static adapter, your pages are pre-rendered at build time. This means:\n\n1. **No server-side request handling** - The `plugin@csp.ts` middleware won't run for static pages\n2. **Theme must be set before first paint** - To avoid the \"flash of wrong theme\" problem\n\n### Why the inline script approach works for SSG\n\nThe inline script in `<head>` executes synchronously before the browser renders any content. This is critical for SSG because:\n\n- `useVisibleTask$` runs **after** the component mounts (too late - causes flicker)\n- `useTask$` runs on the server during SSR, but for SSG the HTML is already static\n- The inline script runs immediately when the HTML is parsed, before any rendering\n\n## Content Security Policy (CSP) Considerations\n\nThe inline script approach using `dangerouslySetInnerHTML` requires CSP configuration. You have two options:\n\n### Option 1: Allow unsafe-inline (simpler, less secure)\n\nFor static sites deployed to platforms like Cloudflare Pages, add a `_headers` file in your `public/` folder:\n\n```\n/*\n  Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; frame-ancestors 'none'; object-src 'none'\n```\n\n> **Security note:** Using `'unsafe-inline'` reduces CSP's protection against XSS attacks. CSP is often the last line of defense, and using `'unsafe-inline'` explicitly disables this protection for scripts. For production sites with sensitive data, consider Option 3 (script hashes) instead. You can consider this option if you are building a low-risk static site with no user input such as a portfolio or a blog and you prefer convenience over security.\n\n### Option 2: Use nonces (SSR only)\n\nFor SSR applications, you can use nonces as described in the [CSP documentation](/docs/advanced/content-security-policy/). Note that nonces **do not work with SSG** because the nonce must be generated per-request.\n\n### Option 3: Use script hashes (advanced)\n\nYou can calculate a SHA-256 hash of your inline script and add it to CSP:\n\n```\nscript-src 'self' 'sha256-YOUR_SCRIPT_HASH_HERE'\n```\n\nGenerate the hash using:\n```shell\necho -n 'your inline script content' | openssl dgst -sha256 -binary | openssl base64\n```\n\n## Troubleshooting\n\n### Theme flickers on page load\n\nIf you see a flash of the wrong theme:\n1. Ensure the inline script is in `<head>`, not `<body>`\n2. Check that the script runs synchronously (no `async` or `defer`)\n3. Verify the script is setting the class on `document.documentElement`\n\n### Toggle button shows wrong state initially\n\nThe basic implementation uses CSS classes (`dark:hidden` and `dark:block`) to show the correct icon based on the theme. This approach avoids the need to sync state with JavaScript. If you need to conditionally render based on theme value (e.g., showing different content), you can use `useVisibleTask$` with `{ strategy: 'document-ready' }` to read the current theme after hydration.\n\n### CSP errors in console\n\nCheck your browser's console for CSP violation messages. You'll need to either:\n- Add `'unsafe-inline'` to `script-src` \n- Calculate and add the script's hash\n- Use nonces (SSR only)\n\n## Related\n\n- [Content Security Policy](/docs/advanced/content-security-policy/) - For SSR applications using nonces\n- [Static Site Generation](/docs/guides/static-site-generation/) - SSG configuration\n- [useVisibleTask$](/docs/components/tasks/#usevisibletask) - Client-side tasks\n"
  },
  {
    "path": "packages/docs/src/routes/docs/cookbook/view-transition/index.mdx",
    "content": "---\ntitle: Cookbook | View Transition API\ncontributors:\n  - GrandSchtroumpf\n---\n\n# View Transition API\nBy default Qwik will start a view transition when SPA navigation. We can run animation either with CSS or WAAPI.\n\n## CSS\n```tsx\nexport default component$(({ list }) => {\n  return (\n    <ul>\n      {list.map((item) => (\n        // Create a name per item\n        <li key={item.id} class=\"item\" style={{viewTransitionName: `_${item.id}_`}}>...</li>\n      ))}\n    </ul>\n  )\n})\n```\n\n```css\n.item {\n  /* Alias to target all .item with a view-transition-name */\n  view-transition-class: animated-item;\n}\n/* Animate when item didn't exist in the previous page */\n::view-transition-new(.animated-item):only-child {\n  animation: fade-in 200ms;\n}\n/* Animate when item doesn't exist in the next page */\n::view-transition-old(.animated-item):only-child {\n  animation: fade-out 200ms;\n}\n```\n\nIn version 1, Qwik overrides the user agent default `view-transition-name: root` on `:root` and sets `view-transition-name: none`.\n\nIf you want to animate the whole page during SPA navigation, you need to explicitly give the `<html>` element a view transition name.\n\n```css\n/* global.css */\nhtml.transition {\n  view-transition-name: root;\n}\n```\n\nThen add the `transition` class to the `<html>` element, so the browser can use `root` as the view transition name for the whole page.\n\n```typescript\n/* entry.ssr.tsx */\ncontainerAttributes: {\n  class: \"transition\",\n}\n```\n\nAlternatively, you can also override the default rule globally by using `! important`\n\n```css\n:root {\n  view-transition-name: root !important;\n}\n```\n\nSometime we need to have some specific logic before the animation start. In this case you can listen to the `qviewTransition` event.\n\nFor example if you want to only animate visible element:\n```tsx\nexport default component$(() => {\n  // In this case we need the callback to be sync, else the transition might have already happened\n  useOnDocument('qviewTransition', sync$((event: CustomEvent<ViewTransition>) => {\n    const transition = event.detail;\n    const items = document.querySelectorAll('.item');\n    for (const item of items) {\n      if (!item.checkVisibility()) continue;\n      item.dataset.hasViewTransition = true;\n    }\n  }))\n  return (\n    <ul>\n      {list.map((item) => (\n        // Create a name per item\n        <li key={item.id} class=\"item\" style={{viewTransitionName: `_${item.id}_`}}>...</li>\n      ))}\n    </ul>\n  )\n})\n```\n\n```css\n.item[data-has-view-transition=\"true\"] {\n  view-transition-class: animated-item;\n}\n::view-transition-new(.animated-item):only-child {\n  animation: fade-in 200ms;\n}\n::view-transition-old(.animated-item):only-child {\n  animation: fade-out 200ms;\n}\n```\n\n> **Note**: `ViewTransition` interface is available with Typescript >5.6.\n\n## WAAPI\nWith Web Animation API you can get more precise, but for that we need to wait for the ::view-transition pseudo-element to exist in the DOM. To achieve that you can wait the `transition.ready` promise.\n\nIn this example we add some delay for each item :\n```tsx\nexport default component$(() => {\n  // Remove default style on the pseudo-element.\n  useStyles$(`\n    li {\n      view-transition-class: items;\n    }\n    ::view-transition-old(.items) {\n      animation: none;\n    }\n  `);\n  useOnDocument('qviewTransition', $(async (event: CustomEvent<ViewTransition>) => {\n    // Get visible item's viewTransitionName (should happen before transition is ready)\n    const items = document.querySelectorAll<HTMLElement>('.item');\n    const names = Array.from(items)\n      .filter((item) => item.checkVisibility())\n      .map((item) => item.style.viewTransitionName);\n\n    // Wait for ::view-transition pseudo-element to exist\n    const transition = event.detail;\n    await transition.ready; \n\n    // Animate each leaving item\n    for (let i = 0; i < names.length; i++) {\n      // Note: we animate the <html> element\n      document.documentElement.animate({\n        opacity: 0,\n        transform: 'scale(0.9)'\n      }, {\n        // Target the pseudo-element inside the <html> element\n        pseudoElement: `::view-transition-old(${names[i]})`,\n        duration: 200,\n        fill: \"forwards\",\n        delay: i * 50, // Add delay for each pseudo-element\n      })\n    }\n  }))\n  return (\n    <ul>\n      {list.map((item) => (\n        // Create a name per item\n        <li key={item.id} class=\"item\" style={{viewTransitionName: `_${item.id}_`}}>...</li>\n      ))}\n    </ul>\n  )\n})\n```\n\n> **Note**: For it to work correctly, we need to **remove the default view transition** animation else it happens on top of the `.animate()`. I'm using `view-transition-class` which is only working with Chrome right now.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/aws-lambda/index.mdx",
    "content": "---\ntitle: AWS Lambda | Deployments\ncontributors:\n  - leifermendez\n  - WilliamEspegren\nupdated_at: '2023-09-11T11:03:36Z'\ncreated_at: '2023-06-30T06:00:35Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# AWS Adapter\n\nQwik City AWS Adapter allows you to connect Qwik City to [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html?icmpid=docs_lambda_hel).\n\n## Installation\n\nTo integrate the `aws-lambda` adapter, use the `add` command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add aws-lambda\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add aws-lambda\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add aws-lambda\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add aws-lambda\n```\n</span>\n</PackageManagerTabs>\n\nThe adapter will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:\n\n```shell\n└── adapters/\n    └── aws-lambda\n        └── vite.config.ts\n└── src/\n    └── entry_aws-lambda.tsx\n```\n\nAdditionally, within the `package.json`, the `build.server` and `serverless:preview` scripts will be updated.\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n## Deploy to AWS\n\nBefore deployment, you need to set up your [AWS Credentials](https://www.serverless.com/framework/docs/providers/aws/guide/credentials). Under the hood, \nthe adapter uses [serverless](https://www.serverless.com/).\n\n```shell\nserverless deploy\n```\nDone!\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/azion/index.mdx",
    "content": "---\ntitle: Azion Web Platform | Deployments\ncontributors:\n  - egermano\nupdated_at: '2025-06-17T11:37:18Z'\ncreated_at: '2025-06-17T11:37:18Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Azion Web Platform\n\n[Azion](https://azion.com) is a web platform that allows you to deploy your Qwik applications globally. It provides a fast and secure way to serve your applications with low latency.\n\n## Installation\n\nCurrently, Azion only supports SSG Qwik applications. To deploy your Qwik application to Azion, you need to use the `static-site` adapter.\n\nTo integrate the `static-site` adapter, use the `add` command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add static\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add static\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add static\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add static\n```\n</span>\n</PackageManagerTabs>\n\nAbove command will create a directory at project root named `adapters/static/vite.config.ts` with the below code.\n\n```ts title=\"adapters/static/vite.config.ts\"\nimport { staticAdapter } from \"@builder.io/qwik-city/adapters/static/vite\";\nimport { extendConfig } from '@builder.io/qwik-city/vite';\nimport baseConfig from '../../vite.config';\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['@qwik-city-plan'],\n      },\n    },\n    plugins: [\n      staticAdapter({\n        origin: 'https://yoursite.qwik.dev',\n      }),\n    ],\n  };\n});\n```\n\n> Remember to change the `origin` in this file to your domain.\n\nNow, you can generate static site while using `Qwik`'s rich ecosystem, file based routing and many more.\n\n## Deploy to Azion\n\nTo deploy your Qwik application to Azion, you need to install the Azion CLI. You can install it by following this [guide](https://www.azion.com/en/documentation/products/azion-cli/overview/#installing-azion-cli).\n\nOnce you have the Azion CLI installed, you can deploy your application by following these steps:\n\n1. Link your application. This will create a new project in Azion and link it to your local application.\n\n```shell\nazion link\n```\n\nConfirm the linking of the project to Azion:\n\n```shell\n? Do you want to link /[your-application-folder] to Azion? (y/N)\n```\n\nEnter the desired name for your **application**:\n\n```shell\n? (Hit enter to accept the suggested name in parenthesis) Your application's name:  (nimble-tyrion)\n```\n\nChoose a **preset**, `Qwik` is the option you are looking for:\n\n```shell\n? Choose a preset:  [Use arrows to move, type to filter]\n  ...\n> Qwik\n  ...\n```\n\nNow, the application will be linked to Azion. Different processes occur based on the selected preset, so you need to answer the interactions that are presented.\n\n2. Deploy your application. This will build your application and deploy it to Azion.\n\n```shell\nazion deploy\n```\n\n3. Wait while the project is built and deployed to the Azion Web Platform.\n\n> Once the deployment is triggered, Azion will open the browser and take you to a page on the Azion Console where the deployment logs and process can be monitored. If it doesn't open automatically, just click on the provided link.\nAfter the deployment is complete, you'll receive a domain to access your Qwik project on the Azion Platform.\n\nWait a few minutes for propagation to take place, and then access your application using the provided domain, which should be similar to `https://xxxxxxx.map.azionedge.net`.\n\nFor more information about the Azion Platform, check the [Azion documentation](https://www.azion.com/en/documentation/).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/azure-swa/index.mdx",
    "content": "---\ntitle: Azure Static Web Apps | Deployments\ncontributors:\n  - derkoe\n  - manucorporat\n  - reemardelarosa\n  - mhevery\n  - WilliamEspegren\n  - mrhoodz\n  - adamdbradley\nupdated_at: '2023-09-11T11:03:36Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Azure Static Web Apps Middleware\n\nQwik City Azure Static Web Apps middleware allows you to connect Qwik City to [Azure Static Web Apps](https://learn.microsoft.com/azure/static-web-apps/).\n\n## Installation\n\nTo integrate the `azure-swa` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add azure-swa\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add azure-swa\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add azure-swa\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add azure-swa\n```\n</span>\n</PackageManagerTabs>\n\nThe adapter will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:\n\n```shell\n└── adapters/\n    └── azure-swa/\n        └── vite.config.ts\n└── src/\n    └── entry.azure-swa.tsx\n```\n\nAdditionally, within the `package.json`, the `build.server` and `deploy` scripts will be updated.\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n## Deploy to Azure\n\nAfter installing the integration the project is ready to be deployed to Azure Static Web Apps.\n\nThere are three ways to deploy:\n\n1. Deploy with [Static Web Apps CLI](https://azure.github.io/static-web-apps-cli/)\n\n   You can deploy your application from your local environment with:\n\n   <PackageManagerTabs>\n   <span q:slot=\"pnpm\">\n   ```shell\n   pnpm dlx swa deploy\n   ```\n   </span>\n   <span q:slot=\"npm\">\n   ```shell\n   npx swa deploy\n   ```\n   </span>\n   <span q:slot=\"yarn\">\n   ```shell\n   yarn dlx swa deploy\n   ```\n   </span>\n   <span q:slot=\"bun\">\n   ```shell\n   bunx swa deploy\n   ```\n   </span>\n   </PackageManagerTabs>\n\n   This will start a wizard which will guide you through login and deployment to Azure.\n\n2. Deploy from GitHub\n\n   You can deploy your application via GitHub. Create a Git repository, commit all your code and then publish your branch to GitHub.\n\n   Create an Azure Static Webapp via the Azure Portal and choose the GitHub repository in the deployment details. When prompted for the build details choose \"Custom\" and set the following values:\n\n   - App location: \".\"\n   - Api location: \"./azure-functions\"\n   - Output location: \"./dist\"\n\n   This setup will establish a GitHub workflow in your repository. With this workflow, your application will automatically deploy whenever changes are pushed or merged into the main branch.\n\n   The resulting workflow file has to be adapted by adding the following to the \"Repository/Build Configurations\" block:\n\n   ```text /skip_api_build/#b /true/#c\n   skip_api_build: true\n   ```\n\n   Checkout [Azure Static Web Apps quickstart](https://learn.microsoft.com/azure/static-web-apps/get-started-portal?pivots=github) for more information.\n\n3. Deploy from any CI system\n\n   You can deploy to Azure Static Web Apps using any CI system. Set your Azure SWA deployment token as the `SWA_CLI_DEPLOYMENT_TOKEN` environment variable. Once that's done, you can run the following command in your pipeline:\n\n   ```shell\n   swa deploy ./dist --api-location ./azure-functions --env production\n   ```\n\nNotice, that you will need an [Azure account](https://signup.azure.com/) in order to complete this step!\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/bun/index.mdx",
    "content": "---\ntitle: Bun Middleware | Deployments\ncontributors:\n  - EamonHeffernan\nupdated_at: '2023-09-18T19:13:28Z'\ncreated_at: '2023-09-18T19:04:44Z'\n---\n\n# Bun Middleware\n\nQwik City Bun middleware allows you to hook up Qwik City to a Bun server which uses the Bun Http API.\n\n## Installation\n\nTo install `bun` on Linux, OSX or WSL run the following command in your terminal\n\n```shell\ncurl -fsSL https://bun.sh/install | bash \n```\n\nFor other platforms or if you run into issues with installation, up to date `bun` installation instructions can be found [on the bun website](https://bun.sh/docs/installation).\n\nTo integrate the `bun` adapter, use the `add` command:\n\n- For the [integrated HTTP server](https://bun.sh/docs/api/http):\n\n```shell\nbun run qwik add bun\n```\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `bun run build.server` and `bun run build.client`:\n\n```shell\nbun run build\n```\n\n## Serve\n\nTo start the Bun server after a build:\n\n```shell\nbun run serve\n```\n\n## Production deploy\n\nSince you are choosing Bun, here you are in your own, after running `bun run build`:\n\n- The `dist` folder will be created including all the static files.\n- The `server` folder will be created including all bun server files.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/cloudflare-pages/index.mdx",
    "content": "---\ntitle: Cloudflare Pages Adapter and Middleware | Deployments\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - OzzieOrca\n  - himorishige\n  - reemardelarosa\n  - mhevery\n  - igorbabko\n  - mrhoodz\n  - dario-piotrowicz\n  - matthewlal\n  - shairez\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Cloudflare Pages Adapter\n\nQwik City Cloudflare Pages adapter allows you to connect Qwik City to [Cloudflare Pages](https://pages.cloudflare.com/).\n\n## Installation\n\nTo integrate the `cloudflare-pages` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add cloudflare-pages\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add cloudflare-pages\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add cloudflare-pages\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add cloudflare-pages\n```\n</span>\n</PackageManagerTabs>\n\nThe adapter will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:\n\n```shell\n└── adapters/\n    └── cloudflare-pages/\n        └── vite.config.ts\n└── src/\n    └── entry.cloudflare-pages.tsx\n```\n\nAdditionally, within the `package.json`, the `build.server` and `deploy` scripts will be updated.\n\nTake note of your nodejs version in your local environment by running the `node -v` command:\n```shell\nnode -v\nv20.11.1\n```\n\nWhen using \n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm create qwik@latest\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm create qwik@latest\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn create qwik\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun create qwik@latest\n```\n</span>\n</PackageManagerTabs>\n\nto setup your Qwik app it will likely use a different nodejs version than what Cloudflare Pages uses by default (v16.20.2).\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n[Read the full guide here](https://github.com/QwikDev/qwik/tree/main/starters/adapters/cloudflare-pages/README.md)\n\n## Deploy to Cloudflare Pages\n\nAfter installing the integration the project is ready to be deployed to Cloudflare Pages.\n\nIf the nodejs version is different in your environment than Cloudflare Pages (v16.20.2) you'll need to add a `NODE_VERSION` environment variable and set the value to the version that you got from running the `node -v` command in your environment:\n\n```shell\nnode -v\nv20.11.1\n```\n\nTo do this in Cloudflare go to **Workers & Pages > YOUR_PROJECT > Settings > Environment variables > Production (and Preview) > Add variables > Save **\n\nPlease refer to the [Cloudflare Pages docs](https://developers.cloudflare.com/pages/framework-guides/deploy-a-qwik-site/) for more information on how to deploy your site.\n\nNote that you will need a [Cloudflare account](https://dash.cloudflare.com/sign-up?lang=en-US) in order to complete this step.\n\n## Static Site Generation (SSG)\n\nThe Cloudflare Pages adapter also supports Static Site Generation (SSG) by using the `ssg` property. \nThis allows you to generate static HTML files for your application at build time, instead of rendering them at runtime.\n\n```ts title=\"adapters/cloudflare-pages/vite.config.ts\"\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['src/entry.cloudflare-pages.tsx', '@qwik-city-plan'],\n      }\n    },\n    plugins: [\n      cloudflarePagesAdapter(\n       // 👇 THIS IS WHAT YOU NEED TO ADD 👇\n       {\n         ssg: {\n           include: ['/*'],\n           exclude: ['/shop/*'],\n           origin: 'https://example.com',\n       },\n      }),\n    ],\n  };\n});\n\n```\n\n\n#### `include`\n\nThe `include` array is used to specify which paths should be statically generated. It accepts wildcard behavior. \n\n#### `exclude`\n\nThe `exclude` array defines routes that should not be static generated and accepts wildcard behavior. \n`exclude` always take priority over include.\n\n#### `origin`\n\nThe URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the `origin` does _not_ include a `pathname`.\n\nThe `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate a complete URL rather than just the `pathname`. \nFor example, in order to render a correct canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.\n\nThis is important because if you don't set it, cloudflare will use the specific deployment url instead.\n\n\n\n\n## Advanced\n\n### Cloudflare Pages Entry Middleware\n\nWhen the `cloudflare-pages` adapter is added, a new entry file will be created at `src/entry.cloudflare-pages.tsx`. Below is an example of using the built-in middleware within the entry file.\n\n```tsx title=\"src/entry.cloudflare-pages.tsx\"\nimport {\n  createQwikCity,\n  type PlatformCloudflarePages,\n} from '@builder.io/qwik-city/middleware/cloudflare-pages';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\nconst fetch = createQwikCity({ render, qwikCityPlan });\n\nexport { fetch };\n```\n\nThe compiled middleware will be built in the `server/` directory. Such directory also contains a `_worker.js` file which implements the application's request handling as per the [Cloudflare Pages Advanced Mode](https://developers.cloudflare.com/pages/platform/functions/advanced-mode/#advanced-mode).\nThe file simply re-exports the produced `fetch` handler as shown below.\n\n```tsx title=\"/dist/_worker.js\"\nimport { fetch } from \"../server/entry.cloudflare-pages\";\nexport default { fetch };\n```\n\n- [Cloudflare Pages Middleware Source](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/src/middleware/cloudflare-pages/index.ts)\n- [Cloudflare Pages Advanced Mode](https://developers.cloudflare.com/pages/platform/functions/advanced-mode/)\n- [Function Invocation Route Config](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes)\n\n### Cloudflare Pages Function Invocation Routes\n\nCloudflare Page's [function-invocation-routes config](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes) can be used to include, or exclude, certain paths to be used by the worker functions. Having a `_routes.json` file gives developers more granular control over when your Function is invoked.\n\nThis is useful to determine if a page response should be Server-Side Rendered (SSR) or if the response should use a static-site generated (SSG) `index.html` file instead.\n\nBy default, the Cloudflare Pages adapter _does not_ include a `public/_routes.json` config, but rather it is auto-generated from the build by the Cloudflare adapter. An example of an auto-generated `dist/_routes.json` would be:\n\n```json\n{\n  \"include\": [\"/*\"],\n  \"exclude\": [\n    \"/_headers\",\n    \"/_redirects\",\n    \"/build/*\",\n    \"/favicon.ico\",\n    \"/manifest.json\",\n    \"/service-worker.js\",\n    \"/about\"\n  ],\n  \"version\": 1\n}\n```\n\nIn the above example, it's saying _all_ pages should be SSR'd. However, the root static files such as `/favicon.ico` and any static assets in `/build/*` should be excluded from the Functions, and instead treated as a static file.\n\nIn most cases the generated `dist/_routes.json` file is ideal. However, if you need more granular control over each path, you can instead provide your own `public/_routes.json` file. When the project provides its own `public/_routes.json` file, then the Cloudflare adapter will not auto-generate the routes config and instead use the committed one within the `public` directory.\n\n### Context\n\nYou may access Cloudflare Page's environment variables in the endpoint method's `platform` param:\n\n```ts\nexport const onRequest = async ({ platform }) => {\n  const secret = platform.env['SUPER_SECRET_TOKEN'];\n};\n```\n\nAdditionally, you may import the `RequestHandler` and `PlatformCloudflarePages` types to have type completions in your editor.\n\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\nimport { type PlatformCloudflarePages } from '@builder.io/qwik-city/middleware/cloudflare-pages';\n\nexport const onGet: RequestHandler<PlatformCloudflarePages> = ({ platform }) => {\n  //...\n};\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/cloudflare-workers/index.mdx",
    "content": "---\ntitle: Cloudflare Workers Adapter and Middleware | Deployments\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Cloudflare Workers Adapter\n\nQwik City Cloudflare Workers adapter allows you to connect Qwik City to [Cloudflare Workers](https://workers.cloudflare.com/).\n\n## Installation\n\nTo integrate the `cloudflare-workers` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add cloudflare-workers\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add cloudflare-workers\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add cloudflare-workers\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add cloudflare-workers\n```\n</span>\n</PackageManagerTabs>\n\nThe adapter will add a new `vite.config.ts` within the `adapters/` directory, a new entry file, and a `wrangler.jsonc` configuration file:\n\n```shell\n└── adapters/\n    └── cloudflare-workers/\n        └── vite.config.ts\n└── src/\n    └── entry.cloudflare-pages.tsx\n└── wrangler.jsonc\n└── worker-configuration.d.ts\n```\n\nAdditionally, within the `package.json`, the following scripts will be added:\n\n- `\"cf-typegen\": \"wrangler types\"` - Generate TypeScript types for your Worker bindings\n- `\"serve\": \"wrangler dev\"` - Start a local development server\n- `\"deploy\": \"wrangler deploy\"` - Deploy your Worker to Cloudflare\n\n## Configuration\n\n### TypeScript Configuration\n\nAdd the Cloudflare Workers types to your `tsconfig.json`:\n\n```json title=\"tsconfig.json\"\n{\n  \"compilerOptions\": {\n    \"types\": [\n      \"@cloudflare/workers-types/2023-07-01\",\n      \"node\"\n    ]\n  }\n}\n```\n\nThis enables TypeScript autocompletion for Cloudflare Workers APIs and bindings.\n\n### Vite Configuration\n\nTo enable local development with access to your Worker's bindings (KV, R2, D1, etc.), update your `vite.config.ts`:\n\n```ts title=\"vite.config.ts\"\nimport { defineConfig, type UserConfig } from \"vite\";\nimport { qwikVite } from \"@builder.io/qwik/optimizer\";\nimport { qwikCity } from \"@builder.io/qwik-city/vite\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\n\nlet platform = {};\n\nif (process.env.NODE_ENV === 'development') {\n  const { getPlatformProxy } = await import('wrangler');\n  platform = await getPlatformProxy();\n}\n\nexport default defineConfig(({ command, mode }): UserConfig => {\n  return {\n    plugins: [\n      qwikCity({\n        platform\n      }), \n// the rest of your code\n```\n\nThe `getPlatformProxy` function provides access to your Worker's bindings during local development, allowing you to test KV, R2, D1, and other Cloudflare resources locally.\n\n### Wrangler Configuration\n\nThe `wrangler.jsonc` file contains your Worker's configuration. Make sure to update the `name` field to match your project:\n\n```jsonc title=\"wrangler.jsonc\"\n{\n  \"name\": \"my-qwik-app\", // 👈 Change this to your Worker's name\n  \"main\": \"./dist/_worker.js\",\n  \"compatibility_date\": \"2025-12-28\",\n  // ... rest of configuration\n}\n```\n\nAfter adding any bindings (KV, R2, D1, etc.) to `wrangler.jsonc`, regenerate the TypeScript types:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run cf-typegen\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run cf-typegen\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run cf-typegen\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run cf-typegen\n```\n</span>\n</PackageManagerTabs>\n\nThis will update the `worker-configuration.d.ts` file with proper types for your bindings.\n\n## Local Development\n\nTo start a local development server with your Worker:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run serve\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run serve\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run serve\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run serve\n```\n</span>\n</PackageManagerTabs>\n\nThis will start Wrangler's development server, typically at `http://localhost:8787/`.\n\n## Production Build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n[Read the full guide here](https://github.com/QwikDev/qwik/tree/main/starters/adapters/cloudflare-workers/README.md)\n\n## Deploy to Cloudflare Workers\n\nAfter installing the integration the project is ready to be deployed to Cloudflare Workers.\n\nIf the nodejs version is different in your environment than Cloudflare Workers (v16.20.2) you'll need to add a `NODE_VERSION` environment variable and set the value to the version that you got from running the `node -v` command in your environment:\n\nThen deploy your Worker:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run deploy\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run deploy\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run deploy\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run deploy\n```\n</span>\n</PackageManagerTabs>\n\nYour Worker will be deployed to `https://your-worker-name.your-subdomain.workers.dev`.\n\nNote that you will need a [Cloudflare account](https://dash.cloudflare.com/sign-up) in order to complete this step.\n\n## Environment Variables\n\nCloudflare Workers support two types of environment variables:\n\n### Build-Time Variables\n\nBuild-time variables are set in the Cloudflare Dashboard and are available during the build process. These are useful for configuration that doesn't change between deployments.\n\nTo set build-time variables:\n1. Go to **Workers & Pages** in your Cloudflare Dashboard\n2. Select your Worker\n3. Go to **Settings > Build**\n4. Add your variables under **Variables and secrets** (not to be confused by Variables and secrets thats right under domains section)\n\n### Runtime Variables\n\nRuntime variables are defined in your `wrangler.jsonc` file using the `vars` property:\n\n```jsonc title=\"wrangler.jsonc\"\n{\n  \"name\": \"my-qwik-app\",\n  \"vars\": {\n    \"MY_VARIABLE\": \"production_value\",\n    \"API_URL\": \"https://api.example.com\"\n  }\n}\n```\n\n\n## Custom Domains\n\nYou can attach custom domains to your Worker for production use:\n\n1. Go to **Workers & Pages** in your Cloudflare Dashboard\n2. Select your Worker\n3. Go to **Settings > Triggers > Custom Domains**\n4. Click **Add Custom Domain**\n5. Enter your domain name (e.g., `app.example.com`)\n6. Follow the instructions to update your DNS settings\n\n\nFor more details, see the [Cloudflare Custom Domains documentation](https://developers.cloudflare.com/workers/configuration/routing/custom-domains/).\n\n\n\n\n\n\n## Advanced\n\n### Cloudflare Workers Entry Middleware\n\nWhen the `cloudflare-workers` adapter is added, a new entry file will be created at `src/entry.cloudflare-pages.tsx`. Below is an example of using the built-in middleware within the entry file.\n\n```tsx title=\"src/entry.cloudflare-pages.tsx\"\nimport {\n  createQwikCity,\n  type PlatformCloudflarePages as PlatformCloudflareWorkers,\n} from '@builder.io/qwik-city/middleware/cloudflare-pages';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\nconst fetch = createQwikCity({ render, qwikCityPlan });\n\nexport { fetch };\n```\n\nThe compiled middleware will be built in the `server/` directory. The build process also creates a `_worker.js` file in the `dist/` directory, which is the entry point for your Cloudflare Worker.\n\n```tsx title=\"/dist/_worker.js\"\nimport { fetch } from \"../server/entry.cloudflare-pages\";\nexport default { fetch };\n```\n\nThis file exports the `fetch` handler that Cloudflare Workers uses to handle incoming requests.\n\n### Bindings\n\nCloudflare Workers can access various Cloudflare resources through bindings. These are configured in your `wrangler.jsonc` file:\n\n#### KV Namespace\n\n```jsonc title=\"wrangler.jsonc\"\n{\n  \"kv_namespaces\": [\n    {\n      \"binding\": \"MY_KV\",\n      \"id\": \"your-kv-namespace-id\"\n    }\n  ]\n}\n```\n\nAccess in your code:\n\n```ts\nexport const onGet = async ({ platform }) => {\n  const value = await platform.env.MY_KV.get('key');\n};\n```\n\n#### R2 Bucket\n\n```jsonc title=\"wrangler.jsonc\"\n{\n  \"r2_buckets\": [\n    {\n      \"binding\": \"MY_BUCKET\",\n      \"bucket_name\": \"my-bucket\"\n    }\n  ]\n}\n```\n\n#### D1 Database\n\n```jsonc title=\"wrangler.jsonc\"\n{\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"my-database\",\n      \"database_id\": \"your-database-id\"\n    }\n  ]\n}\n```\n\nAfter adding any bindings, remember to regenerate types:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run cf-typegen\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run cf-typegen\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run cf-typegen\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run cf-typegen\n```\n</span>\n</PackageManagerTabs>\n\nFor more information on bindings, see the [Cloudflare Workers Bindings documentation](https://developers.cloudflare.com/workers/runtime-apis/bindings/).\n\n### Context and Platform Access\n\nYou can access Cloudflare Worker's environment variables, bindings, and context in your endpoint methods through the `platform` parameter:\n\n```ts\nexport const onRequest = async ({ platform }) => {\n  // Access environment variables\n  const secret = platform.env['SUPER_SECRET_TOKEN'];\n  \n  // Access KV namespace\n  const value = await platform.env.MY_KV.get('key');\n  \n  // Access D1 databases\n  const result = await platform.env.DB.prepare('SELECT * FROM users').all();\n};\n```\n\nFor better type safety, import the `RequestHandler` and `PlatformCloudflareWorkers` types:\n\n```tsx\nimport { type RequestHandler } from '@builder.io/qwik-city';\nimport { type PlatformCloudflarePages as PlatformCloudflareWorkers } from '@builder.io/qwik-city/middleware/cloudflare-pages';\n\nexport const onGet: RequestHandler<PlatformCloudflareWorkers> = async ({ platform }) => {\n  // TypeScript will provide autocompletion for platform.env\n  //...\n};\n```\n\nThe `platform` object provides access to:\n- `platform.env` - Environment variables, secrets, and bindings (KV, R2, D1, etc.)\n- Request context and metadata\n\nFor more information, see the [Cloudflare Workers Runtime APIs documentation](https://developers.cloudflare.com/workers/runtime-apis/).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/delete-layout.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport { ContentNav } from '../../../components/content-nav/content-nav';\nimport { Footer } from '../../../components/footer/footer';\nimport { Header } from '../../../components/header/header';\nimport { OnThisPage } from '../../../components/on-this-page/on-this-page';\nimport { SideBar } from '../../../components/sidebar/sidebar';\n\nexport default component$(() => {\n  return (\n    <div class=\"docs fixed-header\">\n      <Header />\n      <SideBar allOpen={true} />\n      <main\n        class={{\n          'no-right-menu': true,\n        }}\n      >\n        <div class=\"docs-container\">\n          <article>\n            <Slot />\n          </article>\n          <ContentNav />\n          <Footer />\n        </div>\n        <OnThisPage />\n      </main>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/deno/index.mdx",
    "content": "---\ntitle: Deno Middleware | Deployments\ncontributors:\n  - adamdbradley\n  - mrhoodz\n  - gioboa\nupdated_at: '2023-02-24T09:43:33Z'\ncreated_at: '2023-04-28T16:43:21Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Deno Middleware\n\nQwik City Deno middleware allows you to hook up Qwik City to a Deno server which uses the standard Request/Response that's well supported by Deno. Some Deno server implementations include:\n\n- [Deno's integrated HTTP server](https://docs.deno.com/runtime/tutorials/http_server)\n- [Oak](https://oakserver.github.io/oak/)\n\n## Installation\n\nTo integrate the `deno` adapter, use the `add` command:\n\n- For the [integrated HTTP server](https://docs.deno.com/runtime/tutorials/http_server):\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add deno\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add deno\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add deno\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add deno\n```\n</span>\n</PackageManagerTabs>\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n## Serve\n\nTo start the Deno server after a build:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run serve\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run serve\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run serve\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run serve\n```\n</span>\n</PackageManagerTabs>\n\n## Production deploy\n\nSince you are choosing Deno, here you are in your own, after running the `build` command:\n\n- The `dist` folder will be created including all the static files.\n- The `server` folder will be created including all node server files.\n\n> By default, `SSG` mode is activated. If you want to change this behavior, you can edit the `vite.config.ts` file inside the `adapters/deno` folder. In this file you can configure the behavior of the `SSG` or remove the SSG part to switch to a complete `SSR`.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/firebase/index.mdx",
    "content": "---\ntitle: Firebase | Deployments\ncontributors:\n  - leifermendez\n  - mhevery\nupdated_at: '2023-08-23T19:46:10Z'\ncreated_at: '2023-08-23T19:46:10Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Firebase Adapter\n\nQwik City Firebase Adapter allows you to connect Qwik City to [Firebase](https://firebase.google.com/docs/hosting).\n\n## Installation\n\nTo integrate the `firebase` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add firebase\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add firebase\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add firebase\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add firebase\n```\n</span>\n</PackageManagerTabs>\n\nThe adapter will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:\n\n```shell\n└── adapters/\n    └── firebase\n        └── vite.config.ts\n└── src/\n    └── entry-firebase.tsx\n```\n\nAdditionally, within the `package.json`, the `build.server` and `serve` scripts will be updated.\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n## Deploy to Firebase\n\nBefore deploy you need to setup your Firebase Credentials and add a Firebase project to the repository using these commands.\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\nfirebase login\nfirebase use --add\npnpm run deploy\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nfirebase login\nfirebase use --add\nnpm run deploy\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nfirebase login\nfirebase use --add\nyarn run deploy\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nfirebase login\nfirebase use --add\nbun run deploy\n```\n</span>\n</PackageManagerTabs>\n\nDone!\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/gcp-cloud-run/index.mdx",
    "content": "---\ntitle: Cloud Run Middleware | Deployments\ncontributors:\n  - DustinJSilk\n  - reemardelarosa\n  - mhevery\n  - WilliamEspegren\n  - gioboa\n  - igorbabko\n  - mrhoodz\n  - adamdbradley\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Google Cloud Run Middleware\n\nQwik City Cloud Run middleware allows you to run a Qwik City app on [Google Cloud Run](https://cloud.google.com/run)\n\n## Installation\n\nTo integrate the `Cloud Run` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add cloud-run\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add cloud-run\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add cloud-run\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add cloud-run\n```\n</span>\n</PackageManagerTabs>\n\n## Production deploy\n\nTo deploy your app, you need to:\n\n1. Have a [Google Cloud](https://cloud.google.com/) account\n\n2. Install the `gcloud` CLI\n\n   If you don't have gcloud, follow [Google Cloud's official documentation](https://cloud.google.com/sdk/docs/install).\n\n3. Authenticate with the `gcloud` CLI\n\n   To authenticate the `gcloud` CLI, run this command:\n\n   ```shell\n   gcloud auth login\n   ```\n\n   Grant the SDK access to the account you created in step 1.\n\n4. Change the name of the deploy script\n\n   Update the name of your Cloud Run app in the deploy script in your package.json.\n\n   ```json\n   \"deploy\": \"gcloud run deploy my-cloud-run-app --source .\"\n   ```\n\n5. Run deploy script\n\n   Deploy to Google Cloud Run with:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run deploy\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run deploy\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run deploy\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run deploy\n```\n</span>\n</PackageManagerTabs>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/github-pages/index.mdx",
    "content": "---\ntitle: GitHub Pages\ncontributors:\n  - gioboa\nupdated_at: '2025-08-29T00:00:00Z'\ncreated_at: '2025-08-29T00:00:00Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# GitHub Pages With Static Site Adapter\n\nQwik's Static Site adapter helps to generate static html files which can be easily deployed to GitHub Pages.\n\n## Installation\n\nTo integrate the `static-site` adapter, use the `add` command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add static\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add static\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add static\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add static\n```\n</span>\n</PackageManagerTabs>\n\nAbove command will create a directory at project root named `adapters/static/vite.config.ts` with the below code.\n\n```ts title=\"adapters/static/vite.config.ts\"\nimport { staticAdapter } from \"@builder.io/qwik-city/adapters/static/vite\";\nimport { extendConfig } from '@builder.io/qwik-city/vite';\nimport baseConfig from '../../vite.config';\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['@qwik-city-plan'],\n      },\n    },\n    plugins: [\n      staticAdapter({\n        origin: 'https://yoursite.qwik.dev',\n      }),\n    ],\n  };\n});\n```\n\n> Remember to change the `origin` in this file to your domain.\n\nIn the main `vite.config.ts` you should add the base property and set the value with the name of your repository.\n\n```ts\nexport default defineConfig(({ command, mode }): UserConfig => {\n  return {\n    base: '/github-repository-name/',\n    [...]\n  }\n});\n```\n\n## Automated Deployment to GitHub Pages with GitHub Actions\n\nGitHub Actions enables automated deployment of your site to GitHub Pages upon code changes.<br/>\nTo enable this feature, configure your repository settings as follows:\n- Navigate to GitHub Pages Settings: Access your repository's GitHub Pages settings by visiting the /settings/pages path within your repository.<br/>\nFor example: https://github.com/your-github-username/github-repository/settings/pages.\n- Configure Deployment Source: Under the \"Source\" section, select \"GitHub Actions\" as the deployment source.<br/>\nThis instructs GitHub Pages to use a GitHub Actions workflow for deployments.\n\n## Add The GitHub Action \n\nHere's an example:\n\n```yml\n# FILE: .github/workflows/deploy.yml\n# ==========================================\n\nname: Deploy to GitHub Pages\n\non:\n  push:\n    branches: 'main'\n\njobs:\n  build_site:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v5\n\n      - name: Install pnpm\n        uses: pnpm/action-setup@v4\n        with:\n          version: 10.15.0\n\n      - name: Install Node.js\n        uses: actions/setup-node@v5\n        with:\n          node-version: 24.7.0\n          cache: 'pnpm'\n\n      - run: corepack enable\n\n      - name: Install dependencies\n        run: pnpm install --frozen-lockfile\n\n      - name: build\n        run: |\n          pnpm run build\n\n      - name: Upload Artifacts\n        uses: actions/upload-pages-artifact@v3\n        with:\n          path: 'dist/github-repository-name/'\n\n  deploy:\n    needs: build_site\n    runs-on: ubuntu-latest\n\n    permissions:\n      pages: write\n      id-token: write\n\n    environment:\n      name: github-pages\n      url: ${{ steps.deployment.outputs.page_url }}\n\n    steps:\n      - name: Deploy\n        id: deployment\n        uses: actions/deploy-pages@v4\n```\n\nThis GitHub Actions workflow automates the process of building and deploying a website to GitHub Pages.<br/>\nIt triggers upon pushes to the main branch, ensuring the site is updated with the latest changes.<br/>\nThe workflow first builds the website using pnpm, then uploads the generated files as an artifact.<br/>\nFinally, it deploys the artifact to GitHub Pages, making the site live."
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/index.mdx",
    "content": "---\ntitle: Deployments | Guides\ncontributors:\n  - adamdbradley\n  - samijaber\n  - reemardelarosa\n  - mhevery\n  - igorbabko\n  - mrhoodz\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Deployments\n\nWhen it's time to deploy your application, Qwik comes with ready-to-use integration that make this so easy!\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add\n```\n</span>\n</PackageManagerTabs>\n\n## Adapters and Middleware\n\nQwik City middleware is a glue code that connects server rendering framework (such as Cloudflare, Netlify, Vercel, Express etc.) with the Qwik City meta-framework.\n\n## Production build\n\nWhen a new integration is added to the project, a `build.server` script is added to the `package.json` file. This script is used to build the project for production.\n\nThe only thing you need to do is to run the following command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n> Under the hood, the `build` script will execute, `build.server` and `build.client` scripts.\n\n## Advanced\n\nThe `requestHandler()` utility is what each of the above middleware bundles uses in order to translate their request/response to a standard format for Qwik City to use. This function can be used to provide middleware for specific server frameworks.\n\nIf there's middleware missing and you'd like it added, take a look at how the `requestHandler()` utility is used to handle requests for each of the middleware source-code above. Better yet, we'd love to have your middleware contributions! [PR's are welcome](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/middleware)!\n\n## Add A New Deployment\n\nThanks for your interest in adding a deployment integration to Qwik! We're more than happy to help you get started. Before we get too far, if there's already a deployment for what you're looking for, we'd [love to have you contribute to it](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/adapters). If the deployment is not already available, let's add it!\n\nTo start it's probably best to copy an existing adapters and middleware and modify it to fit your needs. A deployment is made up of a few different parts:\n\n### Add An Adapter\n\nAn adapter is the term used to summarize the Vite config that needed for the special build configuration. Each server, whether it's a cloud-service or a custom server, has its own unique build configuration for a specific output the server uses. For example, [Cloudflare](/docs/deployments/cloudflare-pages/index.mdx), [Netlify](/docs/deployments/netlify-edge/index.mdx) and [Node.js Server](/docs/deployments/node/index.mdx) each have their own build configurations.\n\nThe adapter is really a Vite config, that's extending the base config. The base config is the same for all adapters, and the adapter config is the unique part for each server.\n\n- [Adapters Source](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/adapters)\n\n### Add Middleware\n\nMiddleware is the glue code that connects the server rendering framework (such as Cloudflare, Netlify, Vercel, Express etc.) with the Qwik City meta-framework. Each middleware is responsible for handling the request and response from the server and translating it to a standard format for Qwik City to use. \n\nLuckily Qwik City uses the standardized [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) interfaces, so the middleware is usually pretty minimal.\n\nFor middleware, you'll notice that each one calls the common `@builder.io/qwik-city/middleware/request-handler` package. The job of each middleware is to translate the request and response to the standardized format that Qwik City request handler package uses.\n\n- [Middleware Source](https://github.com/QwikDev/qwik/tree/main/packages/qwik-city/middleware)\n\n### Add To The Starter CLI\n\nThe next step is to add the new adapter to the Starter CLI. For this step it's probably best to ping the core team on [Discord](https://qwik.dev/chat) to help you get started. The CLI is a great place to add the new adapter, because it's a great way to test the new adapter and make sure it's working as expected.\n\n## Cache Headers\n\nTo assure proper caching of your built files, you need to serve them with the correct cache headers.\n\nBy default, files are generated under `dist/build` and `dist/assets`, and they get a content hash in the filename. This means that the name is unique for the contents of those files, and they can be cached indefinitely.\n\nTherefore, we recommend that you serve these files with the following header:\n\n```\nCache-Control: public, max-age=31536000, immutable\n```\n\nThe various deployment platforms have different ways of configuring this, and the starters should have the correct configuration already set (you can `npx qwik add` again to update the configuration). However, there is no one-size-fits-all solution, so verify that caching is working as expected.\n\nTo verify proper caching, you can visit your site and open the developer tools to inspect the network requests. When you reload the page, you should see that all requests for assets are coming from the browser cache and are not contacting the server. Even a `304 Not Modified` response is not good enough, because it means that the browser is still unsure that the content is cached.\n\n ⚠️ **Note**: If your app uses [`compiled-i18n`](https://github.com/wmertens/compiled-i18n) or [`qwik-speak`](https://github.com/robisim74/qwik-speak), then translated bundles (`build/[locale]/*.js`) can retain identical filenames between builds even when translations change. Consider how long you want to cache these files for so users get the latest translations.\n\n## Origin\n\nWe recommend setting the `ORIGIN` environment variable to the origin of your site (e.g. `https://example.com/`). This is used to resolve relative URLs and to validate the request origin when performing CSRF checks.\n\nHowever, if the origin of your application is not static because you're hosting multiple sites, the Node.js based middleware provides a `getOrigin()` callback option to reliably reconstruct the origin (scheme + host + optional port).\n\n\n### Examples\n\n1) Simple static origin from environment (recommended for production if you know the origin):\n\n```ts\n// Provide ORIGIN=https://example.com in your environment\ncreateQwikCity({\n  origin: process.env.ORIGIN,\n});\n```\n\n2) Compute origin using forwarded headers (common when behind proxies). Use the headers your proxy provides, e.g. `X-Forwarded-Proto` and `X-Forwarded-Host`:\n\n```ts\ncreateQwikCity({\n  getOrigin(req) {\n    const proto = req.headers['x-forwarded-proto'] as string | undefined;\n    const host = req.headers['x-forwarded-host'] as string | undefined || (req.headers.host as string | undefined);\n    if (!host) return null;\n    return `${proto ?? 'https'}://${host}`;\n  }\n});\n```\n\n3) Example: Cloud Run adapter (reconstructs the origin from forwarded headers)\n\n```ts\n// starters/adapters/cloud-run entry (illustrative)\ncreateQwikCity({\n  getOrigin(req) {\n    // Cloud Run sets X-Forwarded-Proto and Host headers\n    const proto = req.headers['x-forwarded-proto'] as string | undefined;\n    const host = (req.headers['host'] || req.headers['x-forwarded-host']) as string | undefined;\n    if (!host) return null;\n    return `${proto ?? 'https'}://${host}`;\n  }\n});\n```\n\n### Notes and best practices\n\n- Prefer a static `ORIGIN` environment variable for production whenever possible. It is the most reliable and secure option.\n- When relying on forwarded headers, ensure your proxy/ALB sets them and consider locking the trusted proxy list so attackers cannot spoof them.\n- Return `null` from `getOrigin` when the origin cannot be determined; the middleware will fall back to deriving it from the request.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/netlify-edge/index.mdx",
    "content": "---\ntitle: Netlify Edge Adapter and Middleware | Deployments\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - reemardelarosa\n  - mhevery\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Netlify Edge Adapter\n\nQwik City Netlify Edge adapter allows you to connect Qwik City to [Netlify Edge Functions](https://docs.netlify.com/edge-functions/overview/).\n\n## Installation\n\nTo integrate the `netlify-edge` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add netlify-edge\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add netlify-edge\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add netlify-edge\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add netlify-edge\n```\n</span>\n</PackageManagerTabs>\n\n> It will automatically install the required dependencies, including the [Netlify CLI](https://cli.netlify.com/).\n\nThe adapter will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:\n\n```shell\n└── adapters/\n    └── netlify-edge/\n        └── vite.config.ts\n└── src/\n    └── entry.netlify-edge.tsx\n```\n\nAdditionally, within the `package.json`, the `build.server` and `deploy` scripts will be updated.\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n[Read the full guide here](https://github.com/QwikDev/qwik/blob/main/starters/adapters/netlify-edge/README.md)\n\n## Dev deploy\n\nTo deploy the application for development:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run deploy\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run deploy\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run deploy\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run deploy\n```\n</span>\n</PackageManagerTabs>\n\nNotice that you might need a [Netlify account](https://docs.netlify.com/get-started/) in order to complete this step!\n\n## Production deploy\n\nAfter installing the integration the project is ready to be deployed to Netlify. However, you will need to create a git repository and push the code to it.\n\nPlease refer to the Netlify docs for more information on how to deploy your site: [Netlify docs](https://docs.netlify.com/site-deploys/create-deploys/)\n\n## Advanced\n\n### Netlify Edge Entry Middleware\n\nWhen the `netlify-edge` adapter is added, a new entry file will be created at `src/entry.netlify-edge.tsx`. Below is an example of using the built-in middleware within the entry file.\n\n```tsx title=\"src/entry.netlify-edge.tsx\"\nimport { createQwikCity } from '@builder.io/qwik-city/middleware/netlify-edge';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\nexport default createQwikCity({ render, qwikCityPlan });\n```\n\nThe compiled middleware will be built in the `.netlify/edge-functions` directory.\n\n### Netlify Edge Functions Declarations\n\n[Netlify Edge Functions declarations](https://docs.netlify.com/edge-functions/declarations/) can be configured to run on specific URL patterns. Each edge function declaration associates one site path pattern with one function to execute on requests that match the path. A single request can execute a chain of edge functions from a series of declarations. A single edge function can be associated with multiple paths across various declarations.\n\nThis is useful to determine if a page response should be Server-Side Rendered (SSR) or if the response should use a static-site generated (SSG) `index.html` file instead.\n\nBy default, the Netlify Edge adapter will generate a `.netlify/edge-middleware/manifest.json` file, which is used by the Netlify deployment to determine which paths should, and should not, use edge functions.\n\nTo override the generated manifest, you can [add a declaration](https://docs.netlify.com/edge-functions/declarations/#add-a-declaration) to the `netlify.toml` using the `[[edge_functions]]` config. For example:\n\n```toml title=\"netlify.toml\"\n[[edge_functions]]\n  path = \"/admin\"\n  function = \"auth\"\n```\n\n### Netlify Request Context\n\n[Netlify context](https://docs.netlify.com/edge-functions/api/#netlify-specific-context-object) is available in endpoint method's `platform` param:\n\n```ts\nexport const onRequest = async ({ platform }) => {\n  platform.log('requested ip:', platform.ip);\n};\n```\n\n### Environment variables\n\n```ts\nexport const onRequest = async ({ env }) => {\n  platform.log('netlify serverless env read from Netlify UI or CLI', env.get('API_KEY'));\n};\n```\n\n- [Netlify Environment Variables](https://docs.netlify.com/environment-variables/overview/#environment-variable-options)\n- [Netlify Edge Middleware Source](https://github.com/QwikDev/qwik/blob/main/packages/qwik-city/src/middleware/netlify-edge/index.ts)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/node/index.mdx",
    "content": "---\ntitle: Node Middleware | Deployments\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mousaAM\n  - reemardelarosa\n  - mhevery\n  - Craiqser\n  - mrhoodz\nupdated_at: '2023-10-11T13:38:53Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Node Middleware\n\nQwik City Node middleware allows you to connect Qwik City to a Node.js server which uses the common middleware functionality. Some Node servers include:\n\n- [Express](https://expressjs.com/)\n- [Fastify](https://fastify.dev/)\n- [Connect](https://www.npmjs.com/package/connect)\n- [Polka](https://www.npmjs.com/package/polka)\n\n## Installation\n\nTo integrate the `node` adapter, use the `add` command:\n\n- For [Express](https://expressjs.com/):\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add express\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add express\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add express\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add express\n```\n</span>\n</PackageManagerTabs>\n\n- For [Fastify](https://fastify.dev/)\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add fastify\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add fastify\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add fastify\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add fastify\n```\n</span>\n</PackageManagerTabs>\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n## Dev serve\n\nTo deploy the application for development:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run serve\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run serve\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run serve\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run serve\n```\n</span>\n</PackageManagerTabs>\n\n## Production deploy\n\nSince you are choosing Node, here you are in your own, after running the `build` command:\n\n- The `dist` folder will be created including all the static files.\n- The `server` folder will be created including all node server files.\n\nIn order to deploy the server, you need to run the `server/entry.[server].js` file in the server of your choice, where `[server]` can be [express](https://expressjs.com/) or [fastify](https://fastify.dev/).\n\nIt's **very important to correctly configure the `ORIGIN` env variable**, which is used to check against [CSRF attacks](https://owasp.org/www-community/attacks/csrf). The origin must match the origin of the client application.\n\n> For example, if you plan to deploy your application to `https://example.com/app`, then you need to set the `ORIGIN` environment variable to `https://example.com`.\n>\n> ```shell\n> ORIGIN=https://example.com node server/entry.express\n> ```\n\nYou can check [how to deploy with Docker here](/docs/cookbook/node-docker-deploy/index.mdx).\n\n### CSRF Protection\n\nBy default, all Qwik City applications are protected against [CSRF attacks](https://owasp.org/www-community/attacks/csrf) for all POST, PATCH, DELETE form submits.\n\nThis protection is enabled by default and it's the reason why you need to set the `ORIGIN` environment variable when deploying your application for production.\n\nIf you want to disable CSRF protection, you can set `checkOrigin: false` in the `createQwikCity()` options in `src/entry.preview.tsx` or `src/entry.[server].tsx`:\n\n```tsx {6} /checkOrigin/ title=\"entry.preview.tsx\"\n// ...\nconst { router, notFound, staticFile } = createQwikCity({\n  render,\n  qwikCityPlan,\n  manifest,\n  checkOrigin: false,\n});\n// ...\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/self-hosting/index.mdx",
    "content": "---\ntitle: Self-Hosting\ncontributors:\n  - iitzIrFan\nupdated_at: '2024-03-24T19:30:00Z'\ncreated_at: '2024-03-24T19:30:00Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Self-Hosting Qwik Applications\n\nThis guide provides comprehensive instructions for self-hosting your Qwik application on your own infrastructure, whether it's a VPS, bare metal server, or container platform.\n\n## Prerequisites\n\n- Node.js >= 16.8.0 (18.x LTS or later recommended)\n- A web server like Nginx, Apache, or similar for production deployments\n- (Optional) Docker for containerized deployments\n- (Optional) PM2 or similar for process management\n\n## Build Options\n\nQwik provides several adapters suited for self-hosting scenarios. Choose the one that best fits your infrastructure:\n\n### Fastify (Node.js)\n\nFastify offers better performance than Express and is another good option for self-hosting:\n\n```shell\nnpx qwik add fastify\n```\n\n### Static Site\n\nFor simple applications without dynamic server functionality:\n\n```shell\nnpx qwik add static\n```\n\nWhen using the static adapter, make sure to update your `adapters/static/vite.config.ts` file with your actual domain:\n\n```ts\nstaticAdapter({\n  origin: 'https://your-actual-domain.com',\n})\n```\n\n## Building for Production\n\nAfter adding the appropriate adapter, build your application. This will create a `dist/` directory with all the necessary files for deployment:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\nThe build process will generate:\n\n- `dist/` directory containing:\n  - **Vite-generated files**:\n    - `dist/build/` – JavaScript and CSS bundles (code-split and optimized)\n    - `dist/assets/` – Fonts, images, and static assets processed by Vite\n  - **Non-Vite files (copied as-is)**:\n    - Everything from the `public/` folder (e.g., favicon, robots.txt, etc.)\n  - **Static site generation output** (if SSG is used):\n    - Pre-rendered `.html` pages\n    - Route-specific `q-data.json` files\n  - **Manifest files**:\n    - `manifest.json` – For PWA support\n    - `q-manifest.json` – Used during development, **can be omitted from production**\n\n- `server/` directory:\n  - Contains server entrypoints like `entry.fastify.js` or `entry.express.js` depending on the adapter used.\n\n## Deployment Methods\n\n### Method 1: Node.js Server Deployment\n\nFor Express or Fastify adapters, the build process generates a server entry file at `server/entry.express.js` or `server/entry.fastify.js`.\n\n1. Transfer these files to your production server:\n   - `dist/` (client assets)\n   - `server/` (server code)\n   - `package.json` (for dependencies)\n\n2. Install production dependencies on the server:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install --prod\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install --omit=dev\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn install --production\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install --production\n```\n</span>\n</PackageManagerTabs>\n\n3. Set the required environment variables:\n\n```shell\n# Important: This is required for CSRF protection\nexport ORIGIN=https://your-domain.com\n\n# Set production mode\nexport NODE_ENV=production\n\n# Optional: Define a custom port (default is 3000)\nexport PORT=3000\n```\n\n4. Run the server:\n\n```shell\n# For Express\nnode server/entry.express.js\n\n# For Fastify\nnode server/entry.fastify.js\n```\n\n5. For production use, use a process manager like PM2:\n\n```shell\nnpm install -g pm2\n\n# For Express\npm2 start server/entry.express.js --name qwik-app\n\n# For Fastify\npm2 start server/entry.fastify.js --name qwik-app\n```\n\n### Using systemd\n\nCreate a systemd service file:\n\n```ini\n[Unit]\nDescription=Qwik Application\nAfter=network.target\n\n[Service]\nType=simple\nUser=qwikuser\nWorkingDirectory=/path/to/your/app\nExecStart=/usr/bin/node server/entry.express.js\nRestart=always\nEnvironment=NODE_ENV=production\n\n[Install]\nWantedBy=multi-user.target\n```\n\nEnable and start the service:\n```shell\nsudo systemctl enable qwik-app\nsudo systemctl start qwik-app\n```\n\n### Method 2: Docker Deployment\n\nUsing Docker is recommended for containerized deployments. Create a `Dockerfile` in your project root:\n\n```Dockerfile\nARG NODE_VERSION=18.18.2\n\n################################################################################\n# Use node image for base image for all stages.\nFROM node:${NODE_VERSION}-alpine as base\n\n# Set working directory for all build stages.\nWORKDIR /usr/src/app\n\n################################################################################\n# Create a stage for installing production dependencies.\nFROM base as deps\n\n# Download dependencies as a separate step to take advantage of Docker's caching.\n# Leverage a cache mount to /root/.yarn to speed up subsequent builds.\nRUN --mount=type=bind,source=package.json,target=package.json \\\n    --mount=type=bind,source=yarn.lock,target=yarn.lock \\\n    --mount=type=cache,target=/root/.yarn \\\n    yarn install --frozen-lockfile\n\n################################################################################\n# Create a stage for building the application.\nFROM deps as build\n\n# Copy the rest of the source files into the image.\nCOPY . .\n\n# Run the build script.\nRUN yarn run build\n\n################################################################################\n# Create a new stage to run the application with minimal runtime dependencies\nFROM base as final\n\n# Use production node environment by default.\nENV NODE_ENV production\n\n# IMPORTANT: Set your actual domain for CSRF protection\nENV ORIGIN https://your-domain.com\n\n# Run the application as a non-root user.\nUSER node\n\n# Copy package.json so that package manager commands can be used.\nCOPY package.json .\n\n# Copy the production dependencies from the deps stage and also\n# the built application from the build stage into the image.\nCOPY --from=deps /usr/src/app/node_modules ./node_modules\nCOPY --from=build /usr/src/app/dist ./dist\nCOPY --from=build /usr/src/app/server ./server\n\n# Expose the port that the application listens on.\nEXPOSE 3000\n\n# Run the application.\nCMD yarn serve\n```\n\nBuild and run your Docker container:\n\n```shell\n# Build the image\ndocker build -t qwik-app .\n\n# Run the container\ndocker run -p 3000:3000 -e ORIGIN=https://your-domain.com qwik-app\n```\n\n### Method 3: Static Site Deployment\n\nIf using the static adapter, copy the contents of the `dist` directory to your web server's document root:\n\n```shell\n# Example using rsync\nrsync -avz dist/ user@your-server:/path/to/webroot/\n```\n\n## Web Server Configuration\n\n## Web Server Configurations\n\n### 1. Nginx for Node.js Applications\n\nFor Node.js deployments using Express or Fastify, use this Nginx configuration as a reverse proxy:\n\n```nginx\n# HTTP to HTTPS redirect\nserver {\n    listen 80;\n    server_name your-domain.com;\n    return 301 https://$host$request_uri;\n}\n\n# Main server block\nserver {\n    listen 443 ssl http2;\n    server_name your-domain.com;\n\n    # SSL configuration\n    ssl_certificate /path/to/cert.pem;\n    ssl_certificate_key /path/to/key.pem;\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_prefer_server_ciphers on;\n    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;\n    ssl_session_timeout 1d;\n    ssl_session_cache shared:SSL:10m;\n\n    # Proxy to Node.js server\n    location / {\n        proxy_pass http://localhost:3000;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection 'upgrade';\n        proxy_set_header Host $host;\n        proxy_cache_bypass $http_upgrade;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n\n    # Static assets handling (build and assets directories)\n    location ~ ^/(build|assets)/ {\n        root /path/to/your/app/dist;\n        expires 1y;\n        add_header Cache-Control \"public, max-age=31536000, immutable\";\n        access_log off;\n    }\n    \n    # Security headers\n    add_header X-Content-Type-Options \"nosniff\" always;\n    add_header X-Frame-Options \"SAMEORIGIN\" always;\n    add_header X-XSS-Protection \"1; mode=block\" always;\n}\n```\n\n### 2. Nginx for Static Sites\n\nFor static site deployments, use this Nginx configuration:\n\n```nginx\n# HTTP to HTTPS redirect\nserver {\n    listen 80;\n    server_name your-domain.com;\n    return 301 https://$host$request_uri;\n}\n\n# Main server block\nserver {\n    listen 443 ssl http2;\n    server_name your-domain.com;\n\n    # SSL configuration\n    ssl_certificate /path/to/cert.pem;\n    ssl_certificate_key /path/to/key.pem;\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_prefer_server_ciphers on;\n    \n    # Document root\n    root /path/to/your/app/dist;\n    index index.html;\n    \n    # Security headers\n    add_header X-Content-Type-Options \"nosniff\" always;\n    add_header X-Frame-Options \"SAMEORIGIN\" always;\n    add_header X-XSS-Protection \"1; mode=block\" always;\n    \n    # Main location block\n    location / {\n        try_files $uri $uri/ /index.html;\n    }\n    \n    # Cache settings for static assets (build and assets directories)\n    location ~ ^/(build|assets)/ {\n        expires 1y;\n        add_header Cache-Control \"public, max-age=31536000, immutable\";\n        access_log off;\n        try_files $uri =404;\n        gzip_static on;\n        brotli_static on;\n    }\n    \n    # Route loader data caching\n    location ~ /[^/]+/q-data\\.json$ {\n        expires 30s;\n        add_header Cache-Control \"public, must-revalidate\";\n        try_files $uri =404;\n    }\n    \n    # Security: Deny access to hidden files\n    location ~ /\\. {\n        deny all;\n        access_log off;\n        log_not_found off;\n    }\n    \n    # Security: Deny access to .git directory\n    location ^~ /.git/ {\n        deny all;\n        access_log off;\n        log_not_found off;\n    }\n}\n```\n\n### 3. Apache Configuration\n\nFor Apache with mod_proxy enabled, use this configuration:\n\n```apache\n# HTTP to HTTPS redirect\n<VirtualHost *:80>\n    ServerName your-domain.com\n    RewriteEngine On\n    RewriteCond %{HTTPS} off\n    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n</VirtualHost>\n\n# Main server block\n<VirtualHost *:443>\n    ServerName your-domain.com\n    \n    # SSL Configuration\n    SSLEngine on\n    SSLCertificateFile /path/to/cert.pem\n    SSLCertificateKeyFile /path/to/key.pem\n    \n    # Proxy to Node.js server\n    ProxyPreserveHost On\n    ProxyPass / http://localhost:3000/\n    ProxyPassReverse / http://localhost:3000/\n    \n    # Serve static assets directly (build and assets directories)\n    <Directory /path/to/your/app/dist/build>\n        Options Indexes FollowSymLinks\n        AllowOverride All\n        Require all granted\n        \n        <IfModule mod_expires.c>\n            ExpiresActive On\n            ExpiresDefault \"access plus 1 year\"\n            Header append Cache-Control \"public, immutable\"\n        </IfModule>\n    </Directory>\n    \n    # Alias for both build and assets directories\n    AliasMatch ^/(build|assets)/(.*)$ /path/to/your/app/dist/$1/$2\n    \n    # Security headers\n    Header always set X-Content-Type-Options \"nosniff\"\n    Header always set X-Frame-Options \"SAMEORIGIN\"\n    Header always set X-XSS-Protection \"1; mode=block\"\n    \n    # SPA fallback\n    <IfModule mod_rewrite.c>\n        RewriteEngine On\n        RewriteBase /\n        RewriteRule ^index\\.html$ - [L]\n        RewriteCond %{REQUEST_FILENAME} !-f\n        RewriteCond %{REQUEST_FILENAME} !-d\n        RewriteRule . /index.html [L]\n    </IfModule>\n</VirtualHost>\n```\n\n## Security Best Practices\n\n### CSRF Protection\n\nQwik City applications are protected against CSRF (Cross-Site Request Forgery) attacks by default for all state-mutating HTTP methods (POST, PATCH, DELETE). This protection is crucial for preventing unauthorized actions on behalf of authenticated users.\n\n#### How It Works\n\n1. **Default Protection**: Enabled by default for all non-idempotent requests\n2. **Origin Checking**: Validates the `Origin` and `Referer` headers against the `ORIGIN` environment variable\n3. **Configuration**: Controlled via the `checkOrigin` option in `createQwikCity`\n\n#### Configuration Options\n\n##### 1. Basic Configuration (Recommended)\n\n```tsx\n// src/entry.express.tsx or src/entry.fastify.tsx\nconst { router, notFound } = createQwikCity({\n  render,\n  qwikCityPlan,\n  manifest,\n  // CSRF protection is enabled by default when ORIGIN is set\n  checkOrigin: true\n});\n```\n\n##### 2. SSL Offload Proxy Setup\n\nWhen behind a reverse proxy (Nginx, CloudFront, etc.), use `'lax-proto'` to handle `X-Forwarded-Proto` headers:\n\n```tsx\nconst { router, notFound } = createQwikCity({\n  render,\n  qwikCityPlan,\n  manifest,\n  checkOrigin: 'lax-proto' // Required for proper proxy support\n});\n```\n\n##### 3. Disabling CSRF (Not Recommended)\n\n```tsx\nconst { router, notFound } = createQwikCity({\n  render,\n  qwikCityPlan,\n  manifest,\n  checkOrigin: false // Disables CSRF protection (not recommended for production)\n});\n```\n\n### Essential Security Headers\n\nConfigure these security headers in your web server:\n\n```nginx\n# Nginx example\nadd_header X-Content-Type-Options    \"nosniff\" always;\nadd_header X-Frame-Options          \"SAMEORIGIN\" always;\nadd_header X-XSS-Protection         \"1; mode=block\" always;\nadd_header Referrer-Policy          \"strict-origin-when-cross-origin\" always;\nadd_header Content-Security-Policy  \"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;\" always;\n```\n\n### Additional Security Measures\n\n1. **User Privileges**\n   - Run Node.js as a non-root user\n   - Use process managers like PM2 with `--user` flag\n\n2. **Network Security**\n   - Configure firewalls to expose only necessary ports (typically 80, 443)\n   - Use fail2ban to protect against brute force attacks\n   - Implement rate limiting for API endpoints\n\n3. **Dependencies**\n   - Regularly update all dependencies\n   - Use `npm audit` or `yarn audit` to identify vulnerabilities\n   - Consider using Dependabot or similar tools\n\n4. **HTTPS**\n   - Enforce HTTPS with HSTS header\n   - Use modern TLS configurations (TLS 1.2/1.3)\n   - Implement certificate auto-renewal (e.g., Certbot for Let's Encrypt)\n\n5. **Application Hardening**\n   - Set appropriate file permissions\n   - Disable directory listing\n   - Protect sensitive files (e.g., `.env`, `.git`)\n   - Implement proper CORS policies\n\n6. **Monitoring & Logging**\n   - Monitor for suspicious activities\n   - Implement centralized logging\n   - Set up alerts for security events\n\n## Monitoring and Logging\n\n### Application Monitoring\n\n#### 1. Process Management with PM2\n\n```bash\n# Install PM2 globally\nnpm install -g pm2\n\n# Start application\npm2 start dist/server/entry.express.js --name qwik-app\n\n# Monitor application\npm2 monit\n\n# View logs\npm2 logs qwik-app\n\n# Set up PM2 to start on system boot\npm2 startup\npm2 save\n\n# Set up PM2 dashboard (optional)\nnpm install -g pm2-web\npm2-web --config pm2-webrc.json\n```\n\n#### 2. Web Server Logs\n\n**Nginx**\n```bash\n# Access logs\n/var/log/nginx/access.log\n/var/log/nginx/error.log\n\n# Enable JSON logging format in nginx.conf\nlog_format json_combined escape=json\n  '{\"timestamp\":\"$time_iso8601\",'\n  '\"remote_addr\":\"$remote_addr\",'\n  '\"remote_user\":\"$remote_user\",'\n  '\"request\":\"$request\",'\n  '\"status\":\"$status\",'\n  '\"body_bytes_sent\":\"$body_bytes_sent\",'\n  '\"http_referer\":\"$http_referer\",'\n  '\"http_user_agent\":\"$http_user_agent\"}';\n```\n\n### Performance Monitoring\n\n#### 1. System-Level Monitoring\n\n```bash\n# Basic system monitoring\ntop\nhtop\nnmon\n\n# Network monitoring\niftop\niotop\n\n# Disk I/O\niostat -x 1\n```\n\n#### 2. Application Performance Monitoring (APM)\n\n**Using Prometheus + Grafana**\n\n1. Set up Prometheus to collect metrics\n2. Configure Grafana for visualization\n3. Monitor key metrics:\n   - Request rates\n   - Error rates\n   - Response times\n   - Resource utilization\n\n**Alternative APM Solutions**\n- [New Relic](https://newrelic.com/)\n- [Datadog](https://www.datadoghq.com/)\n- [Sentry](https://sentry.io/)\n- [Elastic APM](https://www.elastic.co/observability/application-performance-monitoring)\n\n## Performance Optimization\n\n### Network Optimization\n\n1. **HTTP/2 and HTTP/3**\n   - Enable HTTP/2 in Nginx/Apache\n   - Consider HTTP/3 for modern browsers\n   - Configure proper keep-alive settings\n\n2. **CDN Integration**\n   - Use Cloudflare, CloudFront, or similar\n   - Configure edge caching rules\n   - Enable automatic image optimization\n\n3. **Compression**\n   - Enable Brotli compression\n   - Pre-compress static assets\n   - Configure proper cache headers\n\n### Asset Optimization\n\n1. **Caching Strategy**\n   ```nginx\n   # Immutable assets (hashed filenames)\n   location ~* \\.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|eot)$ {\n       expires 1y;\n       add_header Cache-Control \"public, max-age=31536000, immutable\";\n       access_log off;\n   }\n   ```\n\n2. **Lazy Loading**\n   - Use Qwik's built-in lazy loading\n   - Split large components\n   - Implement route-based code splitting\n\n3. **Image Optimization**\n   - Use modern formats (WebP/AVIF)\n   - Implement responsive images\n   - Lazy load below-the-fold images\n\n### Server-Side Optimization\n\n1. **Node.js Tuning**\n   - Set appropriate `NODE_ENV=production`\n   - Tune V8 garbage collection\n   - Use worker threads for CPU-intensive tasks\n\n2. **Database Optimization**\n   - Implement connection pooling\n   - Add appropriate indexes\n   - Use query optimization techniques\n\n3. **Caching Layer**\n   - Implement Redis/Memcached\n   - Cache API responses\n   - Use stale-while-revalidate patterns\n\n### Asset Compression\n\nEnable efficient compression for static assets:\n\n1. Pre-compress static files during build:\n```shell\n# Install compression tools\nnpm install -g brotli-cli gzip-cli\n\n# Compress build assets in parallel with maximum compression\nfind dist/build dist/assets -type f -regex '.*\\.\\(js\\|css\\|html\\|json\\)$' -print0 | xargs -0 gzip -9 -k &\nfind dist/build dist/assets -type f -regex '.*\\.\\(js\\|css\\|html\\|json\\)$' -print0 | xargs -0 brotli -15 -k &\nwait\n```\n\n2. Configure Nginx to serve pre-compressed files:\n```nginx\nlocation ~ ^/(build|assets)/ {\n    root /path/to/your/app/dist;\n    expires 1y;\n    add_header Cache-Control \"public, max-age=31536000, immutable, no-transform\" always;\n    access_log off;\n    # Enable pre-compressed file serving\n    gzip_static on;\n    brotli_static on;\n    try_files $uri =404;\n}\n```\n\n## Scaling Considerations\n\nFor high-traffic applications:\n\n1. Set up load balancing with multiple Node.js instances\n2. Use container orchestration (Kubernetes, Docker Swarm)\n3. Consider a microservices architecture for larger applications\n4. Implement Redis or similar for session management across instances\n5. Use a serverless approach for predictable scaling\n\n## Troubleshooting Common Issues\n\n1. **404 Not Found**: \n   - Check your Nginx/Apache configuration paths\n   - Verify that URL rewriting is properly configured\n   - **Check file permissions**: Ensure the web server user has read access to all files and execute permission on all parent directories\n     ```shell\n     # Check permissions for a specific file\n     sudo -u nginx ls -ld /path/to/static/file\n     \n     # Check directory permissions (go up the path to find where access is denied)\n     sudo -u nginx ls -ld /path/to/static/\n     sudo -u nginx ls -ld /path/to/\n     sudo -u nginx ls -ld /path/\n     \n     # NixOS-specific: Web server users typically don't have access to /home by default\n     # You may need to adjust the permissions or move the files to /var/www or similar\n     ```\n\n2. **503 Service Unavailable**: \n   - Verify the Node process is running (`pm2 list` or `ps aux | grep node`)\n   - Check server logs for memory issues or crashes\n\n3. **CSRF Errors**: \n   - Ensure the `ORIGIN` environment variable is correctly set\n   - Check that form submissions include the correct CSRF token\n\n4. **Performance Issues**: \n   - Enable compression in your web server\n   - Check for memory leaks using Node.js profiling\n   - Verify that static assets are served with proper cache headers\n\n5. **Missing Assets**:\n   - Ensure your build process is complete\n   - Check that the `/build/` and `/assets/` directories are correctly exposed"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/static/index.mdx",
    "content": "---\ntitle: Static Site\ncontributors:\n  - the-r3aper7\n  - aendel\nupdated_at: '2023-10-11T15:09:55Z'\ncreated_at: '2023-10-11T15:09:55Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Static Site Adapter\n\nQwik's Static Site adapter helps to generate static html files which can be easily deployed to any cloud providers.\n\n## Installation\n\nTo integrate the `static-site` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add static\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add static\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add static\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add static\n```\n</span>\n</PackageManagerTabs>\n\nAbove command will create a directory at project root named `adapters/static/vite.config.ts` with the below code.\n\n```ts title=\"adapters/static/vite.config.ts\"\nimport { staticAdapter } from \"@builder.io/qwik-city/adapters/static/vite\";\nimport { extendConfig } from '@builder.io/qwik-city/vite';\nimport baseConfig from '../../vite.config';\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['@qwik-city-plan'],\n      },\n    },\n    plugins: [\n      staticAdapter({\n        origin: 'https://yoursite.qwik.dev',\n      }),\n    ],\n  };\n});\n```\n\n> Remember to change the `origin` in this file to your domain.\n\nNow, you can generate static site while using `Qwik`'s rich ecosystem, file based routing and many more.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/deployments/vercel-edge/index.mdx",
    "content": "---\ntitle: Vercel Edge Adapter and Middleware | Deployments\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - hamatoyogi\n  - reemardelarosa\n  - mhevery\n  - gioboa\n  - mrhoodz\nupdated_at: '2023-08-23T18:52:18Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Vercel Edge Adapter\n\nQwik City Vercel Edge adapter allows you to connect Qwik City to [Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions).\n\n## Installation\n\nTo integrate the `vercel-edge` adapter, use the `add` command:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add vercel-edge\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add vercel-edge\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add vercel-edge\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add vercel-edge\n```\n</span>\n</PackageManagerTabs>\n\n> It will automatically install the required dependencies, including the [Vercel CLI](https://vercel.com/docs/cli).\n\nThe adapter will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:\n\n```shell\n└── adapters/\n    └── vercel-edge/\n        └── vite.config.ts\n└── src/\n    └── entry.vercel-edge.tsx\n```\n\nAdditionally, within the `package.json`, the `build.server` and `deploy` scripts will be updated.\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `build.server` and `build.client`:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n[Read the full guide here](https://github.com/QwikDev/qwik/blob/main/starters/adapters/vercel-edge/README.md)\n\n## Dev deploy\n\nTo deploy the application for development:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run deploy\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run deploy\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run deploy\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run deploy\n```\n</span>\n</PackageManagerTabs>\n\nNotice that you might need a [Vercel account](https://vercel.com/docs/concepts/get-started) in order to complete this step!\n\n## Production deploy\n\nAfter installing the integration the project is ready to be deployed to Vercel. However, you will need to create a git repository and push the code to it.\n\nPlease refer to the Vercel docs for more information on how to deploy your site: [Vercel docs](https://vercel.com/docs/concepts/deployments/overview)\n\n### Environment variables\n\nYou can access environment variables from Vercel like this `process.env['MY_ENV_VAR']`\n\n## Advanced\n\n### Vercel Edge Entry Middleware\n\nWhen the `vercel-edge` adapter is added, a new entry file will be created at `src/entry.vercel-edge.tsx`. Below is an example of using the built-in middleware within the entry file.\n\n```tsx title=\"src/entry.vercel-edge.tsx\"\nimport { createQwikCity } from '@builder.io/qwik-city/middleware/vercel-edge';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\nexport default createQwikCity({ render, qwikCityPlan });\n```\n\nThe compiled middleware will be built in the `.vercel/output` directory.\n\n### Vercel Edge Functions\n\n[Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) are deployed globally by default on Vercel's Edge Network and enable you to move server-side logic to the Edge, close to your visitor's origin.\n\nEdge Functions use the Vercel Edge Runtime, which is built on the same high-performance V8 JavaScript and WebAssembly engine that is used by the Chrome browser. By taking advantage of this small runtime, Edge Functions can have faster cold boots and higher scalability than Serverless Functions.\n\nEdge Functions run after the cache, and can both cache and return responses.\n\n### Drizzle with Vercel Edge Functions\n\nRunning Postgres on edge requires edge-compatible drivers since Postgres relies on Node.js APIs. \nWhen no adapter is used, the below errors might appear during the deployment process:\n```tsx \n└── The Edge Function \"_qwik-city\" is referencing unsupported modules\n└── Cannot bundle Node.js built-in \"node:events\" imported from \"node_modules\\postgres\\cf\\polyfills.js\"\n```\nLuckily, drizzle has a [section](https://orm.drizzle.team/learn/tutorials/drizzle-with-vercel-edge-functions#edge-compatible-driver) that can be followed to implement the right adapter of choice.\n\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/docs.css",
    "content": "@reference \"tailwindcss\";\n\n.docs .content-container {\n  @apply px-8 lg:pl-0 xl:pr-0;\n  @apply mx-auto min-h-[100vh];\n  max-width: min(var(--container-max-width), 100vw);\n}\n\n.docs .docs-container {\n  @apply pt-8 lg:pt-5;\n  @apply min-w-48;\n\n  /* @screen lg { */\n  /* approx 85ch, but since the contents use font-sizes in absolute values,\n       we need to use an absolute value here too */\n  /* max-width: 850px; */\n  /* }  */\n  @apply lg:max-w-[850px];\n}\n\n.docs article a {\n  color: var(--interactive-text-color);\n  text-decoration: underline;\n}\n\n.docs article blockquote {\n  background: var(--blockquote-bg-color);\n  padding: 20px 13px 20px 10px;\n  border-left: 10px solid #ac7ef4;\n  margin: 30px 0;\n}\n\n.docs article blockquote p:first-child {\n  margin-top: 0;\n}\n\n.docs article blockquote p:last-child {\n  margin-bottom: 0;\n}\n\n.docs article a:hover {\n  text-decoration: none;\n}\n\n.docs article .card-grid {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 25px;\n  margin: 30px 0;\n}\n\n.docs article .card {\n  background: var(--bg-secondary-color);\n  border-radius: 10px;\n  min-width: 230px;\n  padding: 25px;\n  flex: 1;\n  color: inherit;\n  text-decoration: none;\n}\n\n.docs article a.card:hover {\n  outline: 2px solid var(--interactive-text-color);\n}\n\n.docs article .card-center {\n  text-align: center;\n}\n\n.docs article .card h3 {\n  margin-top: 10px;\n  margin-bottom: 0;\n  font-weight: 500;\n  font-size: 22px;\n}\n\n.docs article .card p {\n  font-size: 14px;\n}\n\n.docs article .card .icon {\n  font-size: 70px;\n  margin: 0;\n  line-height: 1;\n}\n\n.docs article .card .intro-icon {\n  position: relative;\n  margin: auto;\n}\n\n.docs article h1 {\n  @apply mb-7;\n  @apply relative;\n\n  line-height: 1.2;\n  font-size: 55px;\n  font-weight: 800;\n  scroll-margin-top: var(--scroll-margin-top);\n}\n\n.docs article h2,\n.docs article h3,\n.docs article h4,\n.docs article h5,\n.docs article h6 {\n  @apply text-xl font-semibold;\n  @apply relative;\n  margin-top: 1.2em;\n  scroll-margin-top: var(--scroll-margin-top);\n\n  margin-bottom: max(0.7em, 18px);\n}\n\n.docs article h2 {\n  line-height: 1.2;\n  font-size: 42px;\n  font-weight: 800;\n  scroll-margin-top: var(--scroll-margin-top);\n  margin-top: 45px;\n}\n\n.docs article h3 {\n  font-size: 1.8rem;\n}\n\n.docs h2 a,\n.docs h3 a,\n.docs h4 a,\n.docs h5 a,\n.docs h6 a {\n  position: absolute;\n  width: 100%;\n  height: 1em;\n}\n\n.icon-link {\n  display: none;\n}\n\n.icon-link::after {\n  position: absolute;\n  content: '#';\n  left: -1em;\n}\n\nh2 a:hover .icon,\nh3 a:hover .icon,\nh4 a:hover .icon,\nh5 a:hover .icon,\nh6 a:hover .icon {\n  display: inline;\n}\n\n.docs article p {\n  margin-top: 1.6rem;\n  margin-bottom: 0.9rem;\n  font-size: 16px;\n  font-weight: 400;\n  line-height: 1.7;\n  color: var(--secondary-text-color);\n}\n\n.docs article ul,\n.docs article ol {\n  @apply my-4;\n  @apply ml-10;\n  line-height: 1.7;\n  list-style: disc;\n\n  font-size: 16px;\n  font-weight: 400;\n  color: var(--secondary-text-color);\n}\n\n.docs article ol {\n  list-style: decimal;\n}\n\n.docs article li {\n  @apply my-1;\n  @apply pl-2;\n}\n\n.docs article li::marker,\n.docs article li::-webkit-details-marker {\n  color: var(--interactive-text-color);\n  font-weight: 800;\n}\n\n.highlighted-word {\n  background: #4199d3;\n  color: #111 !important;\n}\n\n.highlighted {\n  background-color: #7b8d9f33 !important;\n}\n\n.shiki-title {\n  background: #4199d3;\n  color: #111;\n  display: block;\n  padding: 0.5rem;\n  border-radius: 8px 8px 0px 0px;\n}\n\npre {\n  border-radius: 8px;\n}\n\n.docs article pre {\n  padding: 18px 15px;\n  overflow: auto;\n}\n\n:root {\n  --code-line-height: 24px;\n}\n\n.docs article pre code {\n  display: grid;\n  counter-reset: line;\n  background-color: transparent;\n  border: none;\n  user-select: auto;\n  line-height: 1.28;\n}\n\n.docs article code {\n  background-color: var(--code-bg-color);\n  padding: 2px 4px;\n  border-radius: 3px;\n  font-size: 0.9em;\n  border-bottom: 2px solid var(--code-border-color);\n  user-select: all;\n}\n\n@media (max-width: 640px) {\n  .docs article code {\n    word-break: break-all;\n  }\n  .docs article h1 {\n    font-size: 40px;\n  }\n  .docs article h2 {\n    font-size: 30px;\n  }\n}\n\n.docs article table {\n  @apply my-5;\n}\n\n.docs article th,\n.docs article td {\n  padding: 6px;\n  vertical-align: top;\n}\n\n.docs article th:first-child,\n.docs article td:first-child {\n  padding-left: 0;\n}\n\n.docs article th:last-child,\n.docs article td:last-child {\n  padding-right: 0;\n}\n\n.docs article img {\n  border-radius: 5px;\n  overflow: hidden;\n}\n\n.docs-long-list {\n  display: flex;\n  flex-wrap: wrap;\n  & ul {\n    display: contents;\n    & li {\n      list-style-type: none;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/astro/index.mdx",
    "content": "---\ntitle: Astro | Integrations\ndescription: Learn how to use Qwik inside an Astro project.\nkeywords: 'astro'\ncontributors:\n  - thejackshelton\n  - hamatoyogi\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Astro\n\n[Astro](https://astro.build/) is a flexible meta-framework that accommodates a wide range of tools and integrations, enabling you to leverage numerous ecosystems.\n\nIt also allows you to write components using your favorite UI framework (or no framework at all) and renders your pages to static HTML at build time, or dynamically on the server using Server-Side Rendering (SSR). \n\nThis results in a fast, SEO-friendly output that can be deployed to any static hosting environment or server.\n\n> For more details on the integration and to view the source code, check out the [QwikDev Astro Integration on GitHub](https://github.com/QwikDev/astro).\n\n## Astro instead of Qwik City\n\nWhen integrating Astro with Qwik, it's important to note that Qwik City APIs are not compatible with Astro. \n\nAstro is a meta-framework that provides its own set of APIs and features for handling these concerns. \nThese include but are not limited to:\n- routing \n- pages\n- layouts\n- data fetching\n\n> When using Qwik with Astro, use Astro's APIs instead of Qwik City's. This ensures your Qwik components work correctly in Astro. See the [Astro documentation](https://docs.astro.build) for more details.\n\n## @qwikdev/astro 💜\n\nThis integration leverages the power of JavaScript Streaming inside of Astro, using Qwik components.\n\n## Installation\n\n### The `@qwikdev/astro` CLI 🦾\n\nTo start a new Qwik Astro project, you can run the following command:\n\n  <PackageManagerTabs>\n  <span q:slot=\"pnpm\">\n  ```shell\n  pnpm create @qwikdev/astro\n  ```\n  </span>\n  <span q:slot=\"npm\">\n  ```shell\n  npm create @qwikdev/astro\n  ```\n  </span>\n  <span q:slot=\"yarn\">\n  ```shell\n  yarn create @qwikdev/astro\n  ```\n  </span>\n  <span q:slot=\"bun\">\n  ```shell\n  bun create @qwikdev/astro\n  ```\n  </span>\n  </PackageManagerTabs>\n\n  For more advanced CLI configuration options, see the [@qwikdev/astro CLI documentation](https://github.com/QwikDev/astro/blob/main/libs/create-qwikdev-astro/README.md).\n\n\n### Existing projects\n\nAstro comes with a command-line tool for incorporating built-in integrations: `astro add`. This command will:\n\n1. Optionally install all required dependencies and peer dependencies\n2. Optionally modify your `astro.config.*` file to apply the integration\n\nTo install `@qwikdev/astro`, run the following from your project directory and follow the prompts:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm dlx astro add @qwikdev/astro\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpx astro add @qwikdev/astro\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn dlx astro add @qwikdev/astro\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbunx astro add @qwikdev/astro\n```\n</span>\n</PackageManagerTabs>\n\n### Setting up the TypeScript Config\n\nWhen using Astro's integration CLI or manually adding the integration, Qwik needs the following in `tsconfig.json` for typescript to recognize Qwik's JSX types.\n\n```ts\n\"compilerOptions\": {\n  \"jsx\": \"react-jsx\",\n  \"jsxImportSource\": \"@builder.io/qwik\"\n}\n```\n\nIf you face any issues, please [post them on Github](https://github.com/QwikDev/astro/issues) and attempt the manual installation below.\n\n### Manual Installation\n\nFirst, install the `@qwikdev/astro` integration like so:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install @qwikdev/astro\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install @qwikdev/astro\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add @qwikdev/astro\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install @qwikdev/astro\n```\n</span>\n</PackageManagerTabs>\n\nTypically, package managers install peer dependencies. However, if you get a `Cannot find package '@builder.io/qwik'` warning when starting Astro, install Qwik.\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install @builder.io/qwik\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install @builder.io/qwik\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add @builder.io/qwik\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install @builder.io/qwik\n```\n</span>\n</PackageManagerTabs>\n\nNow, add the integration to your `astro.config.*` file using the `integrations` property:\n\n```diff lang=\"js\" \"qwikdev()\"\n  // astro.config.mjs\n  import { defineConfig } from 'astro/config';\n+ import qwikdev from '@qwikdev/astro';\n\n  export default defineConfig({\n    // ...\n    integrations: [qwikdev()],\n    //             ^^^^^\n  });\n```\n\n### Learn More\n\nFor more documentation on using Qwik and Astro, the [integration README](https://github.com/QwikDev/astro) is a great place to start.\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/authjs/index.mdx",
    "content": "---\ntitle: Auth.js | Integrations\nkeywords: 'authentication, auth, oauth'\ncontributors:\n  - the-r3aper7\n  - ulic75\n  - jakovljevic-mladen\n  - ayoub9494\n  - igorbabko\n  - yaikohi\n  - mrhoodz\n  - VinuB-Dev\n  - hugomonte\n  - VarPDev\n  - cwoolum\nupdated_at: '2023-10-15T10:10:17Z'\ncreated_at: '2023-04-24T10:35:21Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Auth.js\n\n[Auth.js](https://authjs.dev/) is a well-known library for authentication used by various JS frameworks. With Auth.js, we benefit from reduced complexity. We also have access to a range of authentication providers, such as GitHub, Google, Facebook, among others. Moreover, it can be integrated into multiple frameworks including Qwik.\n\nAuth.js offers several features that enhance simplicity, productivity, flexibility, and provider diversity. Here are the main features of Auth.js:\n\n- **Providers**: Auth.js supports multiple providers, simplifying the authentication process in our applications (e.g., Github, Google, Facebook, Twitter). It also offers Single Sign-On (SSO) services as well as traditional authentication.\n- **Management**: Auth.js greatly assists us in concentrating on our business logic. It manages tokens, stores them, and refreshes them automatically.\n- **Configuration**: Configuring Auth.js is straightforward. It offers easy installation, error handling, custom forms for login and registration, and effortless integration with providers.\n- **Integrations**: Auth.js seamlessly integrates with JS frameworks, aided by its comprehensive documentation that provides a clear guide to follow.\n- **Security**: While Auth.js is developer-friendly, it's essential to recognize the underlying complexity that ensures a high level of security for our data.\n\nBe aware that the Auth.js library is still in a pre-1.0 stage and could have bugs.\n\n## Installation\n\nYou can add Auth.js easily by using the following Qwik starter script:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add auth\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add auth\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add auth\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add auth\n```\n</span>\n</PackageManagerTabs>\n\nThis command will add a new package:\n\n- `@auth/qwik`\n\nand create a new file named `plugin@auth.ts` with an example configuration.\n\n> **Note on Manual Deployments with Node**\n\n> When deploying applications manually using Node.js, particularly with frameworks like Express, the server or Node process does not inherently know if it's being served under HTTP or HTTPS. \n> Unlike hosting services like Vercel, Netlify, or Cloudflare, where the ﻿ORIGIN configuration is automatically managed, manual setups require explicit specification. To ensure that your Node.js application recognizes the correct protocol and host it is being served under, set the following **environment variables**:\n\n>\t-\t﻿ORIGIN: Set this to the URL of your application. For example:\n>\tORIGIN=https://your-app-name.example.com\n>\t- PROTOCOL_HEADER: This is used to indicate the original protocol requested by the client. Commonly, this is specified in proxy configurations. Set this variable to:\n>\tPROTOCOL_HEADER=X-Forwarded-Proto\n>\t- HOST_HEADER: This header helps identify the original host requested by the client. It is particularly necessary when your Node environment is behind a proxy or load balancer. Set this variable to:\n>\tHOST_HEADER=X-Forwarded-Host\n\n### Migrating from `@builder.io/qwik-auth`\n\nWhen migrating from `@builder.io/qwik-auth` to `@auth/qwik`, there are a couple changes that need to be made.\n\n1. The routes provided by the auth library are no longer prefixed with `/api`. If your are using previous guidance for protected routes or calling the auth routes directly, please be sure to update accordingly.\n\n    ```diff\n    export const onRequest: RequestHandler = (event) => {\n      const session: Session | null = event.sharedMap.get('session');\n      if (!session || new Date(session.expires) < new Date()) {\n    -    throw event.redirect(302, `/api/auth/signin?redirectTo=${event.url.pathname}`);\n    +    throw event.redirect(302, `/auth/signin?callbackUrl=${event.url.pathname}`);\n      }\n    };\n    ```\n\n2. The setup function and and methods exported by it have changed in `plugin@auth.ts`. Be sure to update the imports for the `useAuthSession`, `useAuthSignin`, and `useAuthSignout` methods anywhere you use them in your app.\n\n    ```diff\n    import Auth0Provider from \"@auth/core/providers/auth0\";\n    -import { serverAuth$ } from \"@builder.io/qwik-auth\";\n    +import { QwikAuth$ } from \"@auth/qwik\";\n\n    -export const { onRequest, useAuthSession, useAuthSignin, useAuthSignout } =\n    -  serverAuth$(({ env }) => ({\n    +export const { onRequest, useSession, useSignIn, useSignOut } = \n    +  QwikAuth$(({ env }) => ({\n   ```\n3. Update your `vite.config.ts` to include `\"@auth/qwik\"` to avoid potentials import issues\n```diff \n   export default defineConfig(({ command, mode }): UserConfig => {\n  return {\n    plugins: [qwikCity(), qwikVite(), tsconfigPaths({ root: '.' })],\n    // This tells Vite which dependencies to pre-build in dev mode.\n    optimizeDeps: {\n      include: [\"@auth/qwik\"],\n    },\n```\n\n\n## Qwik API\n\n### useSession\n\nA [routeLoader$](/docs/route-loader/) that returns a session object or an empty object if there is no session. The contents of the session object that is returned are configurable with the session callback. Session data can also be retrieved using the [session](#session) REST API.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useSession } from '~/routes/plugin@auth';\n\nexport default component$(() => {\n  const session = useSession();\n  return <p>{session.value?.user?.email}</p>;\n});\n\n```\n\n### useSignIn\n\nA [routeAction$](/docs/action/) used to initiate a signin flow or send the user to the signin page listing all possible providers. The CSRF token is handled internally when signing in using `useSignIn`.\n\n#### Parameters\n\n* `providerId`: An optional string parameter with the name of the provider. When supplied will initiate the Authorization Request to your Identity Provider. When omitted will redirect to the built-in/unbranded sign-in page.\n* `options`: An optional object of options.\n  * `redirectTo`: An optional string specifying to which URL the user will be redirected after signing in. Defaults to the page URL the sign-in is initiated from.\n* `authorizationParams`: An optional object of additional parameters sent to the /authorize endpoint. See the Authorization Request OIDC spec for some ideas.\n\n> **NOTE:** You can also set the `authorizationParams` through the provider.authorizationParams configuration\n\nExample using `useSignIn` with the [&lt;Form&gt;](/docs/action/#using-actions-with-form) component and optional `providerId` and `options.redirectTo`:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Form } from '@builder.io/qwik-city';\nimport { useSignIn } from '~/routes/plugin@auth';\n\nexport default component$(() => {\n  const signIn = useSignIn();\n  return (\n    <Form action={signIn}>\n      <input type=\"hidden\" name=\"providerId\" value=\"github\" />\n      <input type=\"hidden\" name=\"options.redirectTo\" value=\"http://qwik-auth-example.com/dashboard\" />\n      <button>Sign In</button>\n    </Form>\n  );\n});\n```\n\nExample using `useSignIn` programmatically with optional `providerId` and `options.redirectTo`:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useSignIn } from '~/routes/plugin@auth';\n\nexport default component$(() => {\n  const signIn = useSignIn();\n  return (\n    <button onClick$={() => signIn.submit({ providerId: 'github', options: { redirectTo: 'http://qwik-auth-example.com/dashboard' } })}>Sign In</button>\n  );\n});\n```\n\n### useSignOut\n\nA [routeAction$](/docs/action/) used to initiate a signout flow. The user session will be invalidated/removed from the cookie/database, depending on the flow you chose to store sessions.\n\n#### Parameters\n\n* `redirectTo`: An optional string specifying to which URL the user will be redirected after signing out. Defaults to the page URL the sign-in is initiated from.\n\nThe 'redirectTo' must be considered valid by the redirect callback handler. By default, it requires the URL to be an absolute URL at the same host name, or you can also supply a relative URL starting with a slash. If it does not match it will redirect to the homepage. You can define your own redirect callback to allow other URLs.\n\nExample using `useSignOut` with the [&lt;Form&gt;](/docs/action/#using-actions-with-form) component and optional `redirectTo`:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { Form } from '@builder.io/qwik-city';\nimport { useSignOut } from '~/routes/plugin@auth';\n\nexport default component$(() => {\n  const signOut = useSignOut();\n  return (\n    <Form action={signOut}>\n      <input type=\"hidden\" name=\"redirectTo\" value=\"/signedout\" />\n      <button>Sign Out</button>\n    </Form>\n  );\n});\n```\n\nExample using `useSignOut` programmatically with optional `redirectTo`:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { useSignOut } from '~/routes/plugin@auth';\n\nexport default component$(() => {\n  const signOut = useSignOut();\n  return <button onClick$={() => signOut.submit({ redirectTo: '/signedout' })}>Sign Out</button>;\n});\n```\n\n## REST API\n\nAll the same REST APIs as provided by Auth.js are available.\n\n### signin\n\n**GET /auth/signin**\n\nDisplays the built-in/unbranded sign-in page.\n\n**POST /auth/signin/:provider**\n\nStarts a provider-specific sign-in flow. In the case of an OAuth provider, calling this endpoint will initiate the Authorization Request to your Identity Provider.  This endpoint is also used by the [useSignIn](#useSignIn) action internally.\n\n### callback\n\n**GET/POST /auth/callback/:provider**\n\n### signout\n\n**GET /auth/signout**\n\nDisplays the built-in/unbranded sign out page.\n\n**POST /auth/signout**\n\nHandles signing the user out - this is a POST submission to prevent malicious links from triggering signing a user out without their consent. The user session will be invalidated/removed from the cookie/database, depending on the flow you chose to store sessions. This endpoint is also used by the [useSignOut](#useSignOut) method internally.\n\n### session\n\n**GET /auth/session**\n\nReturns client-safe session object - or an empty object if there is no session. The contents of the session object that is returned are configurable with the session callback. Session data can also be retrieved using the [useSession](#useSession) routerLoader.\n\n### csrf\n\n**GET /auth/csrf**\n\nReturns object containing CSRF token. In NextAuth.js, CSRF protection is present on all authentication routes. It uses the \"double submit cookie method\", which uses a signed HttpOnly, host-only cookie. The CSRF token returned by this endpoint must be passed as form variable named csrfToken in all POST submissions to any API endpoint.\n\n### providers\n\n**GET /auth/providers**\n\nReturns a list of configured OAuth services and details (e.g. sign in and callback URLs) for each service. It is useful to dynamically generate custom sign up pages and to check what callback URLs are configured for each OAuth provider that is configured.\n\n## Examples\n\n### GitHub\n\n1. Follow the [GitHub OAuth Guide](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) to get your `GitHub Client ID`, `GitHub Client Secrets` and generate `AUTH_SECRET` using `openssl rand -base64 32` or [Secret Generator](https://generate-secret.vercel.app/32).\n2. Since the default `plugin@auth.ts` uses GitHub as an example, we don't need to change anything there. However a provider other than GitHub could be used or additional provides could be added. Auth.js also supports many [additional options](https://next-auth.js.org/configuration/options#options) that can be set in this file.\n\n```ts title=\"src/routes/plugin@auth.ts\"\nimport { QwikAuth$ } from \"@auth/qwik\";\nimport GitHub from \"@auth/qwik/providers/github\";\n\nexport const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(\n  () => ({\n    providers: [GitHub],\n  }),\n);\n```\n\n> *IMPORTANT*: Make sure to keep the `onRequest` export as it is used to handle the OAuth flow redirects. Once the user finished OAuth flow, GitHub (or any other provider) will redirect the user back to the application to `/auth/callback/github` (or `/auth/callback/[otherProvider]`). The `onRequest` middleware function will handle requests to this endpoint and finish the OAuth flow.\n\n3. Create or edit the `.env.local` file at the root of your project to store secrets\n\n```bash title=\".env.local\"\nAUTH_GITHUB_ID=\nAUTH_GITHUB_SECRET=\nAUTH_SECRET=\n```\n\n> *IMPORTANT*: Please read the Qwik documentation about [Environment Variables](/docs/guides/env-variables/) to ensure you are using them safely. Many provider secrets should be kept secure and not exposed to the client/browser.\n\n4. The application is now ready to implement authentication using Auth.js.\n5. Enjoy!\n\n### Credentials\n\n> Warning: This functionality is discourage by Auth.js.\n>\n> https://next-auth.js.org/providers/credentials\n>\n> - The functionality provided for credentials based authentication is intentionally limited to discourage use of passwords due to the inherent security risks associated with them and the additional complexity associated with supporting usernames and passwords.\n\n1. Since the default `plugin@auth.ts` uses GitHub as an example, we need to replace it with Credentials.\n\n```ts title=\"src/routes/plugin@auth.ts\"\nimport { QwikAuth$ } from \"@auth/qwik\";\nimport Credentials from \"@auth/qwik/providers/credentials\";\n\nexport const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(\n  () => ({\n    providers: [\n      Credentials({\n        async authorize(credentials, req) {\n          // Add logic here to look up the user from the credentials supplied\n          const user = {\n            id: 1,\n            name: \"Mike\",\n            email: \"mike@example.com\",\n          };\n\n          return user;\n        },\n      }),\n    ],\n  }),\n);\n```\n\n2. Create or edit the `.env.local` file at the root of your project to store secrets\n\n```bash title=\".env.local\"\nAUTH_SECRET=\n```\n\n> *IMPORTANT*: Please read the Qwik documentation about [Environment Variables](/docs/guides/env-variables/) to ensure you are using them safely. Many provider secrets should be kept secure and not exposed to the client/browser.\n\n3. The application is now ready to implement authentication using Auth.js.\n4. Enjoy!\n\n### Route Protection\n\nSession data can be accessed via the route `event.sharedMap`.  So a route can be protected and redirect using something like this located in a `layout.tsx` or page `index.tsx`:\n\n```tsx\nexport const onRequest: RequestHandler = (event) => {\n  const session: Session | null = event.sharedMap.get('session');\n  if (!session || new Date(session.expires) < new Date()) {\n    throw event.redirect(302, `/auth/signin?callbackUrl=${event.url.pathname}`);\n  }\n};\n```\n\n> Note: If placed in a layout.tsx ensure that the redirect destination does not share the same layout.tsx or a redirection loop could occur.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/bootstrap/index.mdx",
    "content": "---\ntitle: Bootstrap | Integrations\nkeywords: 'bootstrap, spinners, alerts, buttons'\ncontributors:\n  - mugan86\n  - mhevery\n  - aendel\n  - jemsco\nupdated_at: '2023-09-26T19:56:54Z'\ncreated_at: '2023-09-26T19:56:54Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Bootstrap\n\nBootstrap is a robust, expandable, and feature-rich frontend toolkit that includes HTML, CSS, and JavaScript. You can build and customize using Sass, benefit from a predefined grid system and components, and enhance your projects with powerful JavaScript plugins.\n\nMore information at [https://getbootstrap.com/](https://getbootstrap.com/)\n\n## Usage\n\nYou can add Bootstrap easily by using the following Qwik starter script:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add bootstrap\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add bootstrap\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add bootstrap\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add bootstrap\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command updates your app with the necessary dependencies.\n\n- `bootstrap@5`\n- `@types/bootstrap@5`\n\nIt also adds new files inside to your project folder:\n\n- `src/models/bootstrap.ts`: Model to define Bootstrap components info to use in props.\n- `src/constants/data.ts`: Constant values information that we will use in the example to be created with this integration.\n- `src/components/bootstrap/button.tsx`: Button component feature with Bootstrap.\n- `src/components/bootstrap/alert.tsx`: Alert component feature with Bootstrap.\n- `src/components/bootstrap/spinner.tsx`: Spinner component feature with Bootstrap.\n- `src/components/bootstrap/index.ts`: Entry point where we will add the components of the elements that will be used, for easier and cleaner access to them.\n- `src/components/bootstrap/navbar.tsx`: Navbar component functionality with Bootstrap to demonstrate how to add and use JavaScript functionalities without encountering the 'document is not defined' error due to improper import declaration in the Qwik lifecycle.\n- `src/routes/bootstrap/layout.tsx`: Layout where we add Bootstrap styling configuration to ensure styles are applied to all routes nested within the main Bootstrap route.\n- `src/routes/bootstrap/index.tsx`: Bootstrap components option home page.\n- `src/routes/bootstrap/buttons/index.tsx`: Example to consume Button component with demo data.\n- `src/routes/bootstrap/alerts/index.tsx`: Example to consume Alert component with demo data.\n- `src/routes/bootstrap/spinners/index.tsx`: Example to consume Spinner component with demo data.\n\n## After integrating Bootstrap\n\nAfter integrating Bootstrap, you can access the ﻿/bootstrap/ route where you will find all the examples available for this integration.\n\n## Interesting info about Bootstrap\n\n### Official\n\n- `Examples`: Examples that we can use as inspiration and learn how to create interesting websites using Bootstrap. [Reference](https://getbootstrap.com/docs/5.3/examples/).\n- `Docs`: All necessary info to work with Bootstrap. [Reference](https://getbootstrap.com/docs/5.3/getting-started/introduction/)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/builderio/index.mdx",
    "content": "---\ntitle: Builder.io | Integrations\nkeywords: 'visual cms, headless cms, builder.io'\ncontributors:\n  - manucorporat\n  - mhevery\n  - Benny-Nottonson\n  - mrhoodz\n  - steve8708\n  - aendel\nupdated_at: '2023-09-28T17:30:02Z'\ncreated_at: '2023-05-02T09:18:30Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Builder.io\n\n[Builder.io](https://builder.io/) is a Visual Headless CMS. Think about it as a drag-and-drop CMS that integrates into your existing Qwik codebase, allowing you and your team to edit content without having to write code.\n\n## Setup\n\nYou can add builder.io easily by using the following `add` script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add builder.io\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add builder.io\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add builder.io\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add builder.io\n```\n</span>\n</PackageManagerTabs>\n\nAfter running the command, `@builder.io/sdk-qwik` will be installed, and a new sample component and catchall route will be created in `src/components` and `src/routes` respectively.\n\nCreate a free [Builder.io account](https://builder.io/signup) (only takes a couple minutes), and paste your [public API key](https://www.builder.io/c/docs/using-your-api-key) into `.env`\n\n```diff\n- BUILDER_PUBLIC_API_KEY=YOUR_API_KEY\n+ BUILDER_PUBLIC_API_KEY=abc123\n```\n\nThen run the development server:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run dev\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run dev\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run dev\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run dev\n```\n</span>\n</PackageManagerTabs>\n\nNow, go set your [preview URL](https://www.builder.io/c/docs/guides/preview-url) to `http://localhost:5173/`\n\n1. Go to [https://builder.io/models](https://builder.io/models)\n2. Choose the `page` model\n3. Set the preview URL to `http://localhost:5173/` and click `save` in the top right\n\nNow, let's create a page in Builder.io and see it live in Qwik!\n\n1. Go to [https://builder.io/content](https://builder.io/content)\n2. Click `+ New` and choose `Page`\n3. Give it a name and click `Create`\n\nNow, try out the visual editor! You can find a custom Qwik components\nin the `Custom Components` section of the insert tab.\n\nYou may also limit visual editing to only your custom components with [components-only mode](https://www.builder.io/c/docs/guides/components-only-mode).\n\n## Register your components\n\nOne of the killer features of a Visual Headless CMS, is that you can [expose your components](https://www.builder.io/c/docs/custom-components-setup) to the CMS, ie, your Qwik components can be used as blocks in Builder.io.\n\n```tsx\nimport { MyFunComponent } from './fun/fun';\n\nexport const CUSTOM_COMPONENTS: RegisteredComponent[] = [\n  {\n    component: MyFunComponent,\n    name: 'MyFunComponent',\n    inputs: [\n      {\n        name: 'text',\n        type: 'string',\n        defaultValue: 'Hello world',\n      },\n    ],\n  },\n];\n\nexport default component$(() => {\n  const content = useBuilderContent();\n  return (\n    <RenderContent\n      customComponents={CUSTOM_COMPONENTS}\n    />\n  );\n});\n```\n\n## Next Steps\n\nSee our full integration guides [here](https://www.builder.io/c/docs/developers)\n\nAlso, when you push your integration to production, go back and update your preview URL to your production URL so now anyone on your team can visually create content in your Qwik app!\n\nAlso, to integrate structured data, see [this guide](https://www.builder.io/c/docs/integrate-cms-data)\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/cypress/index.mdx",
    "content": "---\ntitle: Cypress | Integrations\nkeywords: 'e2e, testing'\ncontributors:\n  - shairez\n  - Benny-Nottonson\n  - mrhoodz\nupdated_at: '2023-07-18T17:46:28Z'\ncreated_at: '2023-04-28T06:05:17Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Cypress \n\nWith [Cypress](https://www.cypress.io), you can easily create tests for your modern web applications, debug them visually, and automatically run them in your continuous integration builds.\n\n\n## Component testing\n\nCypress enables you to test your Qwik components \nin isolation with the help of the [cypress-ct-qwik](https://github.com/qwikifiers/cypress-qwik) community plugin.\n\n\n\n\n## Usage\n\nYou can add Cypress easily by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add cypress\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add cypress\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add cypress\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add cypress\n```\n</span>\n</PackageManagerTabs>\n\nThis command adds `cypress` and `cypress-ct-qwik` to your dependencies, appends testing commands to your `package.json` \nscripts section and creates the configuration files needed to run component testing with Cypress.\n\n\nFor further reference, please check the [Cypress documentation](https://docs.cypress.io/guides/overview/why-cypress) and the [cypress-qwik documentation](https://github.com/qwikifiers/cypress-qwik).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/delete-layout.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport { ContentNav } from '../../../components/content-nav/content-nav';\nimport { Footer } from '../../../components/footer/footer';\nimport { Header } from '../../../components/header/header';\nimport { SideBar } from '../../../components/sidebar/sidebar';\n\nexport default component$(() => {\n  return (\n    <div class=\"docs fixed-header\">\n      <Header />\n      <SideBar allOpen={true} />\n      <main\n        class={{\n          'no-right-menu': true,\n        }}\n      >\n        <div class=\"docs-container\">\n          <article>\n            <Slot />\n          </article>\n          <ContentNav />\n          <Footer />\n        </div>\n      </main>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/drizzle/index.mdx",
    "content": "---\ntitle: Drizzle | Integrations\nkeywords: 'Drizzle, orm, database, data, postgres'\ncontributors:\n  - LazyClicks\nupdated_at: '2024-02-27T18:53:23Z'\ncreated_at: '2024-03-05T23:00:50Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Drizzle\n\n[Drizzle ORM](https://orm.drizzle.team/) is a headless TypeScript ORM with a head 🐲\n\nUsing Drizzle you can define & manage database schemas in TypeScript, access your data in a SQL-like or relational way, and take advantage of opt in tools to push your developer experience through the roof 🤯\n\nWhile also being usable in serverless environments\n\nDrizzle can be used in Qwik with `routeLoader$`, `routeAction$` and `server$` functions. These are Qwik APIs to allow code to execute only on the server-side.\n\nThe easiest way to add Drizzle to Qwik is using the Qwik CLI command. This will install the required dependencies and create a `db` folder with the drizzle schema.\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add drizzle\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add drizzle\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add drizzle\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add drizzle\n```\n</span>\n</PackageManagerTabs>\n\n> Drizzle is an ORM that embraces SQL. Unlike other ORMs, it doesn't deviate from SQL, eliminating the double learning curve of SQL and the framework's API. If you know SQL, you can easily use Drizzle to its full potential.\n\n\n## Listing all the users\n\nWe will use `routeLoader$` to query all users in the DB, using `db.query.users.findMany()`, and returning the result.\n\n```tsx {7} /Drizzle/ title=\"src/routes/users/index.tsx\"\nimport { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport Database from \"better-sqlite3\";\nimport { schema } from \"../../../drizzle/schema\";\n\nexport const useGetUsers = routeLoader$(async () => {\n  const sqlite = new Database(\"./drizzle/db/db.sqlite\");\n  const db = drizzle(sqlite, { schema });\n  const users = await db.query.users.findMany();\n  return users;\n});\n\nexport default component$(() => {\n  const users = useGetUsers();\n  return (\n    <section>\n      <h1>User's directory</h1>\n      <ul>\n        {users.value.map((user) => (\n          <li key={user.id}>\n            <a href={`/users/${user.id}`}>\n              {user.name} ({user.email})\n            </a>\n          </li>\n        ))}\n      </ul>\n    </section>\n  );\n});\n\n```\n\n## Show user detail\n\nWe will use `routeLoader$` to query specific users based on the `userId` URL param, using `db.query.users.findFirst({ where: (users, { eq }) => eq(users.id, userId), })`, and returning the result.\n\n```tsx {8} /Drizzle/ title=\"src/routes/users/[userId]/index.tsx\"\nimport { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport Database from \"better-sqlite3\";\nimport { schema } from \"../../../../drizzle/schema\";\n\nexport const useGetUser = routeLoader$(async (requestEvent) => {\n  const userId = parseInt(requestEvent.params[\"userId\"], 10);\n  const sqlite = new Database(\"./drizzle/db/db.sqlite\");\n  const db = drizzle(sqlite, { schema });\n  const user = await db.query.users.findFirst({\n    where: (users, { eq }) => eq(users.id, userId),\n  });\n  if (!user) {\n    // Set the status to 404 if the user is not found\n    requestEvent.status(404);\n  }\n  return user;\n});\n\nexport default component$(() => {\n  const user = useGetUser();\n  return (\n    <section>\n      <h1>User detail</h1>\n      {user.value ? (\n        <>\n          <p>Name: {user.value.name}</p>\n          <p>Email: {user.value.email}</p>\n        </>\n      ) : (\n        <p>User not found</p>\n      )}\n    </section>\n  );\n});\n\n```\n\n## Adding a user\n\nWe will use `routeAction$` and `Form` to create a progressive form to add a new user to the DB. We will use `db.insert(schema.users).values(data)` to create the user.\n\n```tsx {7-9} /Drizzle/ title=\"src/routes/create/index.tsx\"\nimport { component$ } from \"@builder.io/qwik\";\nimport { routeAction$, zod$, z, Form } from \"@builder.io/qwik-city\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport Database from \"better-sqlite3\";\nimport { schema } from \"../../../drizzle/schema\";\nexport const useCreateUser = routeAction$(\n  async (data) => {\n    const sqlite = new Database(\"./drizzle/db/db.sqlite\");\n    const db = drizzle(sqlite, { schema });\n    const user = await db.insert(schema.users).values(data);\n    return user;\n  },\n  zod$({\n    name: z.string(),\n    email: z.string().email(),\n  }),\n);\n\nexport default component$(() => {\n  const createUserAction = useCreateUser();\n  return (\n    <section>\n      <h1>Create User</h1>\n      <Form action={createUserAction}>\n        <label>\n          Name\n          <input name=\"name\" value={createUserAction.formData?.get(\"name\")} />\n        </label>\n        <label>\n          Email\n          <input name=\"email\" value={createUserAction.formData?.get(\"email\")} />\n        </label>\n        <button type=\"submit\">Create</button>\n      </Form>\n      {createUserAction.value && (\n        <div>\n          <h2>User created successfully!</h2>\n        </div>\n      )}\n    </section>\n  );\n});\n\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/i18n/index.mdx",
    "content": "---\ntitle: Internationalization | Integrations\ncontributors:\n  - mhevery\n  - manucorporat\n  - gioboa\n  - tzdesign\n  - Benny-Nottonson\n  - mrhoodz\n  - wmertens\nupdated_at: '2025-11-23T00:00:00Z'\ncreated_at: '2023-04-19T22:13:46Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Internationalization\n\nInternationalization is a complex problem. Qwik does not solve the internationalization problem directly instead it only provides low-level APIs to allow other libraries to solve it.\n\n## Runtime vs compile time translation\n\nAt a high level there are two ways in which the translation problem can be solved:\n\n- Runtime: load a translation map and look up the translations at runtime.\n- Compile time: Have a compile step inline the translations into the output string.\n\nBoth of the above approaches have trade-offs that one should take into consideration.\n\nThe advantages of runtime approaches are:\n\n- Simplicity. Does not require an additional build step.\n\nDisadvantages of the runtime approach are:\n\n- Each string is present in triplicate:\n  1. Once as the original string in the code.\n  2. Once as a key in a translation map.\n  3. Once as a translated value in the translation map.\n- The tools currently lack the capability to break up the translation map. The whole translation map must be loaded eagerly on application startup. This is a less than ideal situation because it works against Qwik's effort to break up and lazy load your codebase. Additionally, because translation maps are not broken up, the browser will download unnecessary translations. For example, translations for static components that will never re-render on the client.\n- There is a runtime cost to translation lookups.\n\nThe advantages of compile-time approaches are:\n\n- Qwik's lazy loading of code now extends to the lazy loading of translation strings. (No unnecessary translation text is loaded)\n- No runtime translation map means strings are not in triplicate.\n\nDisadvantages of compile time approaches are:\n\n- Extra build step.\n- Changing languages requires a page reload.\n\n## Recommendation\n\nWith the above in mind, Qwik recommends that you use a tool that best fits your constraints. To help you make a decision there are three different considerations: Browser, Server, and Development.\n\n### Browser\n\nQwik's goal is to deliver the best possible user experience. It achieves this by deferring the loading of code to later so that the initial startup performance is not overwhelmed. Because the runtime approach requires eager loading of all translations, we don't recommend this approach. We think that the compile-time approach is best for the browser.\n\n### Server\n\nThe server does not have the constraint of lazy loading. For this reason, the server can use either the runtime or compiled approach. The disadvantage of compile time approach on the server is that we need to have a separate deployment for each translation. This complicates the deployment process as well as puts greater demand on the number of servers. For this reason, we think the runtime approach is preferable on the server.\n\n### Development\n\nDuring development, fewer build steps will result in a faster turnaround. For this reason, runtime translation should result in a simpler development workflow.\n\n### Our Recommendation\n\nOur recommendation is to use a tool that would provide a runtime approach on the server, and runtime or compile time on the client depending on whether we are in development or production. This way it is possible to prove the best user experience and development experience, and use the least server resources.\n\n## Internationalization Libraries\n\n### Paraglide JS\n\n[Paraglide JS](https://inlang.com/m/gerre34r/library-inlang-paraglideJs) is a compile-time translation library that generates type-safe translation functions from standard message format messages.\n\n#### Advantages\n- **Tiny Runtime Overhead**: Translations are compiled to trivial functions.\n- **Framework Agnostic**: Can be used with various frameworks, even within the same project.\n- **Type-Safe Translations**: Generates type-safe functions for translations, reducing runtime errors\n- **Lazy Loading**: Only the translations used by the application are bundled, optimizing bundle size.\n- **Standard Message Format**: Supports complex message formatting using the widely adopted ICU message format.\n- **Developed ecosystem**: Part of the inlang ecosystem, which provides additional tools and integrations for managing translations.\n#### Disadvantages\n- **Ships all languages**: The translations for all languages are included in the single build output, which may increase the overall bundle size.\n- **No runtime features**: Lacks the possibility to add messages at runtime.\n\n#### Installation\nThe easiest way to add Paraglide JS to Qwik is by following the [official guide for Vite](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/vite).\n\nFor further features like language switching and automatic translations, check the [documentation](https://inlang.com/m/gerre34r/library-inlang-paraglideJs).\n\n#### Usage\nUse the generated functions in your code:\n\n```tsx\nimport * as m from './src/paraglide/messages'\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <p>{m.hello({name: 'World'})}</p>\n})\n```\n\n### compiled-i18n\n\n[compiled-i18n](https://github.com/wmertens/compiled-i18n) is inspired by the $localize system from Angular. It only requires a plugin to be added to the Vite configuration.\n\nIt supports both runtime and compile-time translations.\n\n#### Advantages\n- **Zero Runtime Overhead (Compile-time mode)**: Translations are inlined at build time, resulting in no runtime cost for lookups.\n- **Simplicity**: Minimal setup. Simple template string function API.\n- **Framework Agnostic**: Can be used with various frameworks, even within the same project.\n- **Flexible Approach**: Supports both runtime and compile-time modes, allowing developers to choose based on their needs.\n- **Per-locale builds**: Compile-time mode inlines translations, eliminating runtime lookups. Server code includes all languages, simplifying deployment.\n- **Automatic extraction**: Automatically adds new keys to translation files during build, and warns about missing and/or unused translations.\n\n#### Disadvantages\n- **Per-locale builds**: Compile-time mode requires separate builds for each locale, complicating deployment.\n\n#### Installation\nRun `npx qwik add compiled-i18n` to add compiled-i18n to your Qwik app.\n\nSee the [Qwik-specific instructions](https://github.com/wmertens/compiled-i18n/blob/main/docs/qwik.md) for more details.\n\nAutomatic translation is supported via [deepl-localize](https://github.com/tzdesign/deepl-localize).\n\nFor further explanation of the API and features like pluralization, check the [documentation](https://github.com/wmertens/compiled-i18n/blob/main/Readme.md).\n\n#### Usage\nUse the template string function anywhere in your code:\n\n```tsx\nimport {_} from 'compiled-i18n'\n\nconsole.log(_`Logenv ${process.env.NODE_ENV}`)\n\nexport const Count = ({count}) => (\n\t<div title={_`countTitle`}>{_`${count} items`}</div>\n)\n```\n\n### qwik-speak\n\n[qwik-speak](https://github.com/robisim74/qwik-speak) library to translate texts, dates and numbers in Qwik apps.\n\n#### Advantages\n- **Runtime Flexibility**: Allows dynamic language switching without page reloads, improving user experience.\n- **Qwik-Optimized**: Deep integration with Qwik's reactivity system and serialization.\n- **Rich Features**: Supports advanced formatting including dates, numbers, Pluralization, and ICU message format.\n\n#### Disadvantages\n- **Runtime Overhead**: Requires loading translation maps at runtime, which can increase bundle size and initial load time.\n- **Limited Compiler Benefits**: Doesn't provide the same compile-time optimizations and tree-shaking as pure compile-time solutions.\n\n#### Installation\n\nThe easiest way to add qwik-speak to Qwik is following the official [guide](https://github.com/robisim74/qwik-speak/blob/main/docs/quick-start.md).\n\n#### Usage\n\n```tsx\nimport { component$, useStore } from '@builder.io/qwik';\nimport { Speak, useSpeakContext } from 'qwik-speak';\n\nexport default component$(() => {\n  const speak = useSpeakContext();\n  const state = useStore({ count: 0 });\n\n  return (\n    <Speak>\n      <div>\n        <h1>{speak.t('helloWorld')}</h1>\n        <p>{speak.t('itemCount', { count: state.count })}</p>\n        <button onClick$={() => state.count++}>\n          {speak.t('increment')}\n        </button>\n      </div>\n    </Speak>\n  );\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/icons/index.mdx",
    "content": "---\ntitle: Icons | Integrations\nkeywords: >-\n  icons, icones, iconify, iconoir, bootstrap, heroicons, tabler, lucide, mono,\n  simple, octicons, ionicons\ncontributors:\n  - manucorporat\n  - Benny-Nottonson\n  - mrhoodz\n  - aendel\nupdated_at: '2023-07-18T17:47:48Z'\ncreated_at: '2023-04-25T11:05:50Z'\n---\n\nimport image from './icones.png';\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Icons\n\nIcons are an important part of any application. There are already more than 180.000 icons you can add to your Qwik app.\n\n## `qwikest/icons`\n\nThis package allows for a streamlined way to add icons to your Qwik app from a variety of icon sets.\n\n- `Bs`: Bootstrap Icons\n- `Go`: Octicons by GitHub\n- `Hi`: Heroicons by Tailwind\n- `In`: Iconoir\n- `Io`: Ionicons by Ionic\n- `Lu`: Lucide [superset of feather icons]\n- `Mo`: Mono Icons\n- `Si`: Simple Icons [icons for popular brands]\n- `Tb`: Tabler Icons\n\nSimply install the package with your package manager of choice:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install @qwikest/icons\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install @qwikest/icons\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add @qwikest/icons\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install @qwikest/icons\n```\n</span>\n</PackageManagerTabs>\n\n### Usage\n\n```tsx\nimport { LuRocket } from \"@qwikest/icons/lucide\";\n\nexport const MyComponent = component$(() => {\n  // Icon size and color are inherited by default ⬇️\n  return (\n    <div style={{ color: \"red\", fontSize: \"40px\" }}>\n      <LuRocket />\n    </div>\n  );\n});\n```\n\nPlease refer to the [official docs for more details](https://github.com/qwikest/icons).\n\n\n## `icones.js.org`\n\n[icones.js.org](https://icones.js.org/) is a collection of icon collections. More than 180.000 public domain icons are available, ready to be used in your Qwik app.\n\nIcones is powered by [iconify](https://iconify.design/) which allows to easy add icons from Material Design, Phosphor, Remix, Carbon, Bootstrap, Tabler, Feather, Fluent, IconPark, Octicons and many other icon sets. Twitter Emoji, Fluent Emoji, EmojiOne, Noto Emoji... to any Qwik app.\n\n<img src={image}/>\n\nClick the `Qwik` button to copy the icon code to your clipboard, then paste it into your project.\n\n```tsx\nimport type { PropsOf } from '@builder.io/qwik'\n\nexport function OcticonAlertFill12(props: PropsOf<'svg'>, key: string) {\n  return (\n    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 12 12\" {...props} key={key}><path fill=\"#888888\" d=\"M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2a1 1 0 0 0 0 2Z\"></path></svg>\n  )\n}\nexport default OcticonAlertFill12\n```\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/image-optimization/index.mdx",
    "content": "---\ntitle: Image Optimization | Integrations\nkeywords: >-\n  third party image optimization, image optimization, image optimization tools,\n  image optimization services, image optimization service, image optimization\n  tool, image optimization api, image optimization software\ncontributors:\n  - mhevery\n  - gioboa\n  - fabiobiondi\n  - adamdbradley\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\n  - avanderpluijm\n  - fabian-hiller\n  - manucorporat\n  - aendel\n  - maiieul\nupdated_at: '2024-10-03T18:53:23Z'\ncreated_at: '2023-04-19T22:13:46Z'\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Image Optimization\n\nImage optimization is the process of reducing the number of bytes that represent an image. The smaller the image size, the faster it will load on a page. The smaller the image size, the less bandwidth it consumes. The less bandwidth it consumes, the better the experience for your users especially on mobile networks.\n\n\n## Responsive Images\n\nQwik supports responsive images.\n\nThis is a built-in feature that relies on the [`vite-imagetools`](https://www.npmjs.com/package/vite-imagetools) module, so no additional packages or components need to be installed.\n\n\n\n#### How it works\n\n* Import any image from the `src` folder\n* The image is converted in several webp images, one for each breakpoint (200px, 400px, 600px, 800px, 1200px)\n* The image is processed and optimized to reduce its size\n* An `<img>` element is rendered, using the `srcset` attribute to set the image source for several resolutions\n* Now the browser will load the most suitable image for the resolution in use\n\n#### Key Points\nThe community and the Qwik team love this API for a number of reasons:\n\n\n* Zero runtime, zero JS\n* Zero props by default, simple API\n* Zero 404, strongly typed API\n* Zero layout reflows (Automatic width/height)\n* Hashed images, immutable cached\n* Automatic `.webp` / `.avif` format optimization\n* Automated `srcSet` generation\n* Extendable (use any `<img>` attribute)\n* Loading lazy and async decoding by default\n* Lightweight, a single `<img>` node in the HTML\n\n\n#### Usage\n\nAdd the `?jsx` suffix **at the end** of the import\n\n```tsx\nimport Image from '[IMAGE_PATH]?w=24&h=24&jsx';\n```\n\n> ⚠️ Make sure to put the `jsx` query parameter at the end of the import path, otherwise typescript might complain.\n\nUse the image in the template as a component:\n\n```tsx\n<Image />\n````\n\n#### Result\n\nThis script will generate the following `<img>` element with the following optimizations:\n\n- Quality = 75\n- Format = .webp\n\n```tsx\n<img\n\n  decoding=\"async\"\n  loading=\"lazy\"\n  srcset=\"\n    /@imagetools/141464b77ebd76570693f2e1a6b0364f4b4feea7 200w,\n    /@imagetools/e70ec011d10add2ba28f9c6973b7dc0f11894307 400w,\n    /@imagetools/1f0dd65f511ffd34415a391bf350e7934ce496a1 600w,\n    /@imagetools/493154354e7e89c3f639c751e934d1be4fc05827 800w,\n    /@imagetools/324867f8f1af03474a17a9d19035e28a4c241aa1 1200w\"\n  width=\"1200\"\n  height=\"1200\"\n>\n```\n\n> - `decoding=\"async\"`: indicates that the image will not block the rendering of the page while the image is being decoded. For further reference, please check the [MDN web docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding).\n> - `loading=\"lazy\"`: allows the browser to delay the loading of an image until it is visible in the viewport, which helps improve [page loading performance](https://web.dev/browser-level-image-lazy-loading/)\n> - `srcset`: this attribute allows to choose the most appropriate image based on the device's screen size and resolution\n> - `width` and `height`: setting `width` and `height` attributes prevents layout reflow, which hurts the [CLS](https://web.dev/cls/) score\n\n> **Note:** You can also change the default behavior by manually setting the value of these properties:\n> * ```<Image decoding=\"sync\" loading=\"eager\" />```\n\nThanks to `srcset` attribute the browser will load the most suitable image for the device's resolution:\n\n<img width=\"100%\" src=\"/docs/integrations/image-optimization/image-network.png\"/>\n\n> The original source size was 1.5Mb but its size is now just few kilobytes\n\n#### Example\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport Image from '~/media/your_image.png?jsx';\n\nexport default component$(() => {\n  return (\n    <div>\n      <Image />\n    </div>\n  );\n});\n```\n#### Customize image format\nImages are automatically converted to `.webp` format, but you can also specify the format manually:\nAvailable formats:\n\n<div class=\"docs-long-list\">\n- `heic`\n- `heif`\n- `avif`\n- `jpeg`\n- `jpg`\n- `jpe`\n- `tile`\n- `dz`\n- `png`\n- `raw`\n- `tiff`\n- `tif`\n- `webp`\n- `gif`\n- `jp2`\n- `jpx`\n- `j2k`\n- `j2c`\n- `jxl`\n</div>\n\nSupported file formats to be converted are:\n<div class=\"docs-long-list\">\n- `jpg`\n- `jpeg`\n- `png`\n- `webp`\n- `gif`\n- `tiff`\n- `avif`\n</div>\n\nIn the below example, a `jpg` image is converted to a `png` format:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport Image from '~/media/your_image.jpg?format=png&jsx';\n\nexport default component$(() => {\n  return (\n    <div>\n      <Image />\n    </div>\n  );\n});\n```\n\n#### Customize image quality\nAs noted above, the default quality is set to 75, but you can also specify the quality manually.\n\nQuality parameter is an integer between 1 and 100.\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport Image from '~/media/your_image.png?quality=100&jsx';\n\nexport default component$(() => {\n  return (\n    <div>\n      <Image />\n    </div>\n  );\n});\n\n```\n\n#### Customize image `width`  and `height`\n\nYou may need to set a custom `width` to the image:\n\n```tsx\n<Image style={{ width: '300px'}} />\n```\n\nbut in that case you need to manually specify the `height` as well to avoid it being stretched:\n\n\n```tsx\n<Image style={{ width: '300px', height: '200px'}} />\n```\n\nBelow you can see a simple trick to avoid having to manually set the `height`, while also maintaining the aspect ratio:\n\n> **TIP:** you should always specify `width` and `height` values to prevent layout reflow\n\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport Image from '~/media/emote.png?jsx';\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Image Example</h1>\n      <div class=\"image-wrapper\" >\n        <Image />\n      </div>\n    </>\n  );\n});\n```\n\n```css\n.image-wrapper {\n  width: 300px; /* Set the desired width of the wrapper */\n  position: relative; /* Required for absolute positioning */\n}\n\n.image-wrapper img {\n  width: 100%; /* Make the image fill the width of its container */\n  height: auto; /* Let the browser calculate the height to maintain aspect ratio */\n  display: block; /* Remove any extra white space below the image */\n}\n```\n\n#### Image Optimization for SVGs\n<abbr title=\"Scalable Vector Graphics\">SVGs</abbr> can be added directly to your JSX code, but you can also use the image optimization approach to optimize them:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport SvgImage from '~/media/your_image.svg?jsx';\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Image Example</h1>\n      <div class=\"image-wrapper\" >\n        <SvgImage />\n      </div>\n    </>\n  );\n});\n```\n## `@unpic/qwik`\n\n- Site with detailed instructions on usage: [@unpic/qwik](https://unpic.pics/img/qwik/)\n- Installation: add `@unpic/qwik` dependency\n\nUnpic is a third-party image optimization library that works with existing image optimization CDNs. It provides an `Image` component that can be used to optimize images.\n\n<CodeSandbox src=\"/src/routes/demo/integration/img/unpic/simple/index.tsx\" style={{ height: '40em' }}>\n```tsx {6} /Slot/\nimport { component$ } from '@builder.io/qwik';\nimport { Image } from '@unpic/qwik';\n\nexport default component$(() => {\n  return (\n    <Image\n      src=\"https://cdn.shopify.com/static/sample-images/bath_grande_crop_center.jpeg\"\n      layout=\"constrained\"\n      width={800}\n      height={600}\n      alt=\"A lovely bath\"\n    />\n  );\n});\n```\n</CodeSandbox>\n\n> **Note:** qwik-image and unpic are not a CDN and does not host your images. They work with existing image optimization CDNs. We suggest using some of the popular CDNs:\n> - Cloudinary\n> - Cloudflare\n> - Bunny.net\n> - Vercel / Next.js\n> - Imgix, including Unsplash, DatoCMS, Sanity and Prismic\n> - Shopify\n> - Kontent.ai\n> - Builder.io\n> - Contentful\n> - Storyblok\n> - WordPress.com and Jetpack Site Accelerator\n\n## `qwik-image`\n\nPerformant images with automatic optimization.\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install qwik-image\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install qwik-image\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add qwik-image\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install qwik-image\n```\n</span>\n</PackageManagerTabs>\n\n> This is a pluggable component so devs could connect different image loaders to it (like builder.io or other CDNs)\n\n<CodeSandbox src=\"/src/routes/demo/integration/img/qwik-image/index.tsx\" style={{ height: '40em' }}>\n```tsx\nimport { $, component$ } from '@builder.io/qwik';\nimport {\n  Image,\n  type ImageTransformerProps,\n  useImageProvider,\n} from 'qwik-image';\n\nexport default component$(() => {\n  const imageTransformer$ = $(\n    ({ src, width, height }: ImageTransformerProps): string => {\n      // Here you can set your favorite image loaders service\n      return `https://cdn.builder.io/api/v1/${src}?height=${height}&width=${width}&format=webp&fit=fill`;\n    }\n  );\n\n  // Global Provider (required)\n  useImageProvider({\n    // You can set this prop to overwrite default values [3840, 1920, 1280, 960, 640]\n    resolutions: [640],\n    imageTransformer$,\n  });\n\n  return (\n    <Image\n      layout=\"constrained\"\n      objectFit=\"fill\"\n      width={400}\n      height={500}\n      alt=\"Tropical paradise\"\n      placeholder=\"#e6e6e6\"\n      src={\n        'image/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fe5113e1c02db40e5bac75146fa46386f'\n      }\n    />\n  );\n});\n```\n</CodeSandbox>\n\nHere is the Github repository with detailed instructions on usage and customizations: [qwikifiers/qwik-image](https://github.com/qwikifiers/qwik-image)\n\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/index.mdx",
    "content": "---\ntitle: Qwik City Integrations | Guides\ncontributors:\n  - manucorporat\n  - zanettin\n  - ahashem95\n  - reemardelarosa\n  - the-r3aper7\n  - mhevery\n  - shairez\n  - adamdbradley\n  - mugan86\n  - igorbabko\n  - mrhoodz\n  - ulic75\n  - hamatoyogi\n  - jemsco\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\nimport { IntegrationsList } from './integrations-list';\n\n# Integrations\n\nQwik CLI comes with integrations to make it easy to connect to your tooling and services.\n\nOnce you create a Qwik City application, run the following command to add new integrations:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add\n```\n</span>\n</PackageManagerTabs>\n\nThis command will prompt you to select the integration you want to add. Once selected, the integration will be added to your application and you can start using it.\n\n> **For Monorepos:** you can add integrations to a specific package by running the command with the `--projectDir=some/subDir` param.\n\n### List of possible integrations\n\n<IntegrationsList />\n\n## Adding A New Integration\n\nThanks for your interest in adding an integration to Qwik! We're more than happy to help you get started. First, if you're looking to add a server deployment, please checkout the [Server Deployments](/docs/deployments/index.mdx#add-a-new-deployment) docs. If you'd like to add a Qwik library, please see the [Library](/docs/(qwik)/advanced/library/index.mdx) docs. If you'd like to add a new tooling or service integration, please read on.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/integrations-list.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Link, useContent } from '@builder.io/qwik-city';\n\nexport const IntegrationsList = component$(() => {\n  const { menu } = useContent();\n\n  const integrations = menu?.items?.find((item) => item.text === 'Integrations')?.items;\n\n  return (\n    <ul>\n      {integrations?.map((integration) => {\n        return (\n          <li key={integration.text}>\n            <Link href={integration.href}>{integration.text}</Link>\n          </li>\n        );\n      })}\n    </ul>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/leaflet-map/index.mdx",
    "content": "---\ntitle: LeafletJS Map | Integrations\nkeywords: 'map, interactive maps'\ncontributors:\n  - mugan86\n  - igorbabko\n  - anartzdev\n  - gimonaa\n  - gioboa\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-09-13T18:55:37Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\n\n# LeafletJS Map\n\nLeaflet is the leading open-source JavaScript library for mobile-friendly interactive maps. \nWeighing just about 42 KB of JS, it has all the mapping features most developers ever need.\n\nLeaflet is designed with simplicity, performance and usability in mind. \nIt works efficiently across all major desktop and mobile platforms, can be extended with lots of plugins, has a beautiful, easy to use and well-documented API and a simple, readable source code that is a joy to contribute to. [LeafletJS Map Website](https://leafletjs.com/)\n\n## Usage\n\nYou can add LeafletJS Map easily by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add leaflet-map\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add leaflet-map\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add leaflet-map\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add leaflet-map\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command updates your app with the necessary dependencies.\n\n- `leaflet@1.9.4`\n- `@types/leaflet@1.9.4`\n\nIt also adds new files to your project folder:\n\n- `src/helpers/boundary-box.tsx`: Check map area boundaries function.\n- `src/models/location.ts`: Model to define locations info elements to use in props.\n- `src/models/map.ts`: Model to define map info to use in props.\n- `src/components/leaflet-map/index.tsx`: Leaflet map simple map features component.\n- `src/routes/basic-map/index.tsx`: Example to consume Leaflet Map component with demo data\n\n## Example\n\nThe main component configures the map, including the initial position and the group of markers to load.\nThis setup allows you to create a dynamic and interactive map that can be easily configured and extended with different locations and markers.\n\n### Here is an example:\n\n<CodeSandbox src=\"/src/routes/demo/cookbook/leaflet-map/index.tsx\"  style={{ height: '30em' }}>\n```tsx\nimport {\n  component$,\n  noSerialize,\n  useSignal,\n  useStyles$,\n  useVisibleTask$,\n  type Signal,\n} from '@builder.io/qwik';\nimport * as L from 'leaflet';\nimport leafletStyles from 'leaflet/dist/leaflet.css?inline';\n\n// Sample data json and geojson\n\nexport const fvg: any = {\n  type: 'FeatureCollection',\n  name: 'FVG_line_0_001',\n  crs: { type: 'name', properties: { name: 'urn:ogc:def:crs:OGC:1.3:CRS84' } },\n  features: [\n    {\n      type: 'Feature',\n      properties: { ID_OGG: '08020060000', NAME: 'GEOJSON NAME' },\n      geometry: {\n        type: 'MultiLineString',\n        coordinates: [\n          [\n            [12.4188, 46.3528],\n            [12.4178, 46.3547],\n            [12.4284, 46.3517],\n            [12.4425, 46.3599],\n            [12.4488, 46.3605],\n            [12.4554, 46.3652],\n            [12.4552, 46.3672],\n            [12.4513, 46.3706],\n          ],\n        ],\n      },\n    },\n  ],\n};\n\nconst markers: Record<string, MarkersProps[]> = {\n  FDA: [\n    {\n      name: \"Terzo d'Aquileia\",\n      label: 'TRZ',\n      lat: '45.770946',\n      lon: '13.31338',\n    },\n    {\n      name: 'Musi',\n      label: 'MUS',\n      lat: '46.312663',\n      lon: '13.274682',\n    },\n  ],\n  FVG: [\n    {\n      name: 'Borgo Grotta Gigante',\n      label: 'BGG',\n      lat: '45.709385',\n      lon: '13.764681',\n    },\n    {\n      name: 'Muggia',\n      label: 'MGG',\n      lat: '45.610495',\n      lon: '13.752682',\n    },\n  ],\n};\n\nexport default component$(() => {\n  useStyles$(\n    leafletStyles +\n      `\n    .marker-label {\n      color: red;\n      font-weight: 700;\n    }\n  `\n  );\n\n  const groupSig = useSignal('FDA');\n  const currentLocation = useSignal<LocationsProps>({\n    name: 'Udine',\n    point: [46.06600881056668, 13.237724558490601],\n    zoom: 10,\n    marker: true,\n  });\n\n  return (\n    <>\n      Change markers:{'  '}\n      <select name=\"group\" class=\"leaflet-ctrl\" bind:value={groupSig}>\n        <option value=\"FDA\">FDA</option>\n        <option value=\"FVG\">FVG</option>\n      </select>\n      <LeafletMap\n        location={currentLocation}\n        markers={markers[groupSig.value]}\n        group={groupSig}\n      ></LeafletMap>\n    </>\n  );\n});\n\n// The properties (props) used in the `LeafletMap` component and other related components are defined as follows:\n\nexport interface MapProps {\n  location: Signal<LocationsProps>;\n  markers?: MarkersProps[];\n  group?: Signal<string>;\n}\n\nexport interface LocationsProps {\n  name: string;\n  point: [number, number];\n  zoom: number;\n  marker: boolean;\n}\n\nexport interface MarkersProps {\n  name: string;\n  label: string;\n  lat: string;\n  lon: string;\n}\n\n/*\nThe `LeafletMap` component leverages the Leaflet library to render an interactive map. \nThis component can be configured with various properties (props) to set the central location, add markers, and draw boundaries.\nIn the `LeafletMap` component, both the location and the group signal are tracked.\nThis ensures that when the signal changes, the server function is called, and the map is updated with the new data.\n*/\n\nexport const LeafletMap = component$<MapProps>(\n  ({ location, markers, group }) => {\n    const mapContainerSig = useSignal<L.Map>();\n\n    useVisibleTask$(async ({ track }) => {\n      track(location);\n      group && track(group);\n\n      if (mapContainerSig.value) {\n        mapContainerSig.value.remove();\n      }\n\n      // center location\n      const { value: locationData } = location;\n      const centerPosition = locationData.point;\n\n      // layers\n      const markersLayer = new L.LayerGroup();\n      const bordersLayer = new L.LayerGroup();\n\n      // map\n      const map = L.map('map', {\n        layers: [markersLayer, bordersLayer],\n      }).setView(centerPosition, locationData.zoom || 14);\n      L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n        maxZoom: 19,\n        attribution:\n          '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n      }).addTo(map);\n\n      // center position marker\n\n      const qwikMarker = L.divIcon({\n        html: ` \n          <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30.12\" height=\"32\" viewBox=\"0 0 256 272\">\n            <path fill=\"#18B6F6\"\n              d=\"m224.803 271.548l-48.76-48.483l-.744.107v-.532L71.606 120.252l25.55-24.667l-15.01-86.12l-71.222 88.247c-12.136 12.226-14.372 32.109-5.642 46.781l44.5 73.788c6.813 11.376 19.163 18.18 32.47 18.074l22.038-.213z\" />\n            <path fill=\"#AC7EF4\"\n              d=\"m251.414 96.01l-9.795-18.075l-5.11-9.25l-2.023-3.615l-.212.213l-26.829-46.463C200.738 7.125 188.176-.105 174.55 0l-23.527.639l-70.158.213c-13.307.106-25.444 7.123-32.151 18.5l-42.69 84.632L82.353 9.25l100.073 109.937l-17.779 17.968l10.646 86.015l.107-.213v.213h-.213l.213.212l8.304 8.081l40.348 39.445c1.704 1.595 4.472-.318 3.3-2.339l-24.911-49.014l43.436-80.273l1.383-1.595c.533-.638 1.065-1.276 1.491-1.914c8.517-11.589 9.688-27.112 2.662-39.764\" />\n            <path fill=\"#FFF\" d=\"M182.746 118.763L82.353 9.358l14.266 85.695l-25.55 24.773L175.08 223.065l-9.368-85.696z\" />\n          </svg>\n        `,\n        className: '',\n        iconSize: [24, 40],\n      });\n\n      locationData.marker &&\n        L.marker(centerPosition, { icon: qwikMarker })\n          .bindPopup(`Udine`)\n          .addTo(map);\n\n      // add boundaries to map\n      L.geoJSON(fvg, { style: { color: '#005DA4' } }).addTo(bordersLayer);\n\n      // add markers to map\n      const markersList = await markers;\n      markersList &&\n        markersList.map((m) => {\n          const myIcon = L.divIcon({\n            className: 'marker-point',\n            html: `<div class=\"marker-label\" title=\"${m.name}\" >${m.label}</div>`,\n          });\n          L.marker([+m.lat, +m.lon], { icon: myIcon }).addTo(markersLayer);\n        });\n\n      mapContainerSig.value = noSerialize(map);\n    });\n\n    return <div id=\"map\" style={{ height: '25rem' }}></div>;\n  }\n);\n```\n</CodeSandbox>\n\n## Interesting info about LeafletJS Map:\n\n### Official\n\n- `Tutorials`: Examples step by step to reference to create new features using Documentation. [Reference](https://leafletjs.com/examples.html).\n- `Docs`: All necessary info to work with LeafletJS. [Reference](https://leafletjs.com/reference.html)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/modular-forms/index.mdx",
    "content": "---\ntitle: Modular Forms | Integrations\nkeywords: 'form, library, validation, type-safe'\ncontributors:\n  - fabian-hiller\n  - igorbabko\n  - RaeesBhatti\n  - uceumice\n  - Benny-Nottonson\n  - mrhoodz\n  - extrordinaire\nupdated_at: '2025-06-21T22:03:36.397Z'\ncreated_at: '2023-04-28T22:00:03Z'\n---\n\nimport CodeSandbox from '../../../../components/code-sandbox/index.tsx';\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Modular Forms\n\n[Modular Forms](https://modularforms.dev/) is a type-safe form library built natively on Qwik. The headless design gives you full control over the visual appearance of your form. The library takes care of state management and input validation.\n\nTo get started, install the `@modular-forms/qwik` package:\n\n>⚠️ Warning:  \n>Make sure to install @modular-forms/qwik as a devDependency, since it only runs at build/SSR time.\n>Putting it in your regular dependencies will trigger Vite plugin errors.\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm add -D @modular-forms/qwik\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install -D @modular-forms/qwik\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add -D @modular-forms/qwik\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install -D @modular-forms/qwik\n```\n</span>\n</PackageManagerTabs>\n\n## Define your form\n\nBefore you start creating a form, you define the structure and data types of the fields. Besides strings, Modular Forms can also handle booleans, numbers, files, dates, objects and arrays.\n\n```ts\ntype LoginForm = {\n  email: string;\n  password: string;\n};\n```\n\nSince Modular Forms supports [Valibot](https://valibot.dev/) and [Zod](https://zod.dev/) for input validation, you can optionally derive the type definition from a schema.\n\n```ts\nimport * as v from 'valibot';\n\nconst LoginSchema = v.object({\n  email: v.pipe(\n    v.string(),\n    v.nonEmpty('Please enter your email.'),\n    v.email('The email address is badly formatted.'),\n  ),\n  password: v.pipe(\n    v.string(),\n    v.nonEmpty('Please enter your password.'),\n    v.minLength(8, 'Your password must have 8 characters or more.'),\n  ),\n});\n\ntype LoginForm = v.InferInput<typeof LoginSchema>;\n```\n\nIf you're wondering why this guide favors Valibot over Zod, I recommend reading this [announcement post](https://www.builder.io/blog/introducing-valibot).\n\n## Set initial values\n\nAfter you have created the type definition, continue with the initial values of your form. To do this, create a [`routeLoader$`](../../route-loader/) and use as generic your previously created type.\n\n```ts\nexport const useFormLoader = routeLoader$<InitialValues<LoginForm>>(() => ({\n  email: '',\n  password: '',\n}));\n```\n\nInstead of empty strings, in `routeLoader$` you can also query and pass values from your database. Based on the passed object, the store of your form will be initialized to enable Qwik to reliably pre-render your website on the server. The initial values are also used later to check if the value of a field has changed after user input.\n\n## Create a form\n\nTo create a form, you use the [`useForm`](https://modularforms.dev/qwik/api/useForm) hook. It returns the store of your form and an object with a `Form`, `Field` and `FieldArray` component. As a parameter you pass an object to `useForm`, with the previously created loader.\n\n```ts\nexport default component$(() => {\n  const [loginForm, { Form, Field, FieldArray }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n  });\n});\n```\n\nYou can use the `loginForm` object to access the current state of your form. Furthermore, you can pass it to various methods provided by the library, such as [`reset`](https://modularforms.dev/qwik/api/reset) or [`setValue`](https://modularforms.dev/qwik/api/setValue), to make manual changes to the state.\n\nIn the JSX part of your component you continue with the [`Form`](https://modularforms.dev/qwik/api/Form) component. It encloses the fields of your form and through its properties you can define what happens when the form is submitted.\n\n```tsx\nexport default component$(() => {\n  const [loginForm, { Form, Field, FieldArray }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n  });\n\n  return <Form>…</Form>;\n});\n```\n\n## Add form fields\n\nNow you can proceed with the fields of your form. With the [`Field`](https://modularforms.dev/qwik/api/Field) and [`FieldArray`](https://modularforms.dev/qwik/api/FieldArray) component you register a field or field array. Both components are headless and provide you direct access to their current state. The second parameter of the render prop must be passed to an `<input />`, `<select />` or `<textarea />` element to connect it to your form.\n\n```tsx\n<Form>\n  <Field name=\"email\">\n    {(field, props) => (\n      <input {...props} type=\"email\" value={field.value} />\n    )}\n  </Field>\n  <Field name=\"password\">\n    {(field, props) => (\n      <input {...props} type=\"password\" value={field.value} />\n    )}\n  </Field>\n  <button type=\"submit\">Login</button>\n</Form>\n```\n\nThis API design results in a fully type-safe form. Furthermore, it gives you full control over the user interface. You can develop your own [`TextInput`](https://modularforms.dev/qwik/guides/input-components) component or connect a pre-built component library.\n\n## Input validation\n\nOne of the core functionalities of Modular Forms is input validation. You can use a Valibot or Zod schema for this or our internal validation functions. To keep this guide simple, we use the Valibot schema we created earlier and pass it to the `useForm` hook.\n\n> `valiForm$` is an adapter that converts Valibot's error messages to the format expected by Modular Forms. For Zod use `zodForm$` instead.\n\n```ts\nconst [loginForm, { Form, Field, FieldArray }] = useForm<LoginForm>({\n  loader: useFormLoader(),\n  validate: valiForm$(LoginSchema),\n});\n```\n\nNow you only need to display the error messages of your fields in case of an error.\n\n```tsx\n<Field name=\"email\">\n  {(field, props) => (\n    <div>\n      <input {...props} type=\"email\" value={field.value} />\n      {field.error && <div>{field.error}</div>}\n    </div>\n  )}\n</Field>\n```\n\n## Handle submission\n\nIn the last step you only have to access the values via a function when submitting the form to process and use them further. You can use [`formAction$`](https://modularforms.dev/qwik/api/formAction$) for this or the `onSubmit$` property of the `Form` component.\n\n```tsx\nexport const useFormAction = formAction$<LoginForm>((values) => {\n  // Runs on server\n}, valiForm$(LoginSchema));\n\nexport default component$(() => {\n  const [loginForm, { Form, Field }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n    action: useFormAction(),\n    validate: valiForm$(LoginSchema),\n  });\n\n  const handleSubmit = $<SubmitHandler<LoginForm>>((values, event) => {\n    // Runs on client\n  });\n\n  return (\n    <Form onSubmit$={handleSubmit}>\n      …\n    </Form>\n  );\n});\n```\n\n## Final form\n\nIf we now put all the building blocks together, we get a working login form. Below you can see the assembled code and try it out in the attached sandbox.\n\n<CodeSandbox src=\"/src/routes/demo/integration/modular-forms/index.tsx\">\n```tsx\n// @ts-nocheck\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { $, component$, type QRL } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport type { InitialValues, SubmitHandler } from '@modular-forms/qwik';\nimport { formAction$, useForm, valiForm$ } from '@modular-forms/qwik';\nimport * as v from 'valibot';\n\nconst LoginSchema = v.object({\n  email: v.pipe(\n    v.string(),\n    v.nonEmpty('Please enter your email.'),\n    v.email('The email address is badly formatted.'),\n  ),\n  password: v.pipe(\n    v.string(),\n    v.nonEmpty('Please enter your password.'),\n    v.minLength(8, 'Your password must have 8 characters or more.'),\n  ),\n});\n\ntype LoginForm = v.InferInput<typeof LoginSchema>;\n\nexport const useFormLoader = routeLoader$<InitialValues<LoginForm>>(() => ({\n  email: '',\n  password: '',\n}));\n\nexport const useFormAction = formAction$<LoginForm>((values) => {\n  // Runs on server\n}, valiForm$(LoginSchema));\n\nexport default component$(() => {\n  const [loginForm, { Form, Field }] = useForm<LoginForm>({\n    loader: useFormLoader(),\n    action: useFormAction(),\n    validate: valiForm$(LoginSchema),\n  });\n\n  const handleSubmit: QRL<SubmitHandler<LoginForm>> = $((values, event) => {\n    // Runs on client\n    console.log(values);\n  });\n\n  return (\n    <Form onSubmit$={handleSubmit}>\n      <Field name=\"email\">\n        {(field, props) => (\n          <div>\n            <input {...props} type=\"email\" value={field.value} />\n            {field.error && <div>{field.error}</div>}\n          </div>\n        )}\n      </Field>\n      <Field name=\"password\">\n        {(field, props) => (\n          <div>\n            <input {...props} type=\"password\" value={field.value} />\n            {field.error && <div>{field.error}</div>}\n          </div>\n        )}\n      </Field>\n      <button type=\"submit\">Login</button>\n    </Form>\n  );\n});\n```\n</CodeSandbox>\n\n## Dealing With Props\n\nSometimes, you may need to initialize or update the state of your form from the parent component via props. In such cases, you can use the setValue function, as illustrated in the example below:\n\n```tsx\nimport { setValue, useForm } from \"@modular-forms/qwik\";\n\nexport interface FormProps {\n login?: LoginForm\n}\n\nexport default component$<FormProps>((props) => {\n  const [loginForm, { Form, Field }] = useForm<LoginForm>({\n   // rest of the code...\n  });\n\n useTask$(({ track }) => {\n     const login = track(() => props.login);\n    if (!login) return;\n    for (const [key,value] of Object.entries(login)) {\n      setValue(loginForm, key, value);\n    }\n  });\n\n  // rest of the code...\n});\n```\nBy tracking props.login with useTask$, the form fields are dynamically updated whenever the parent provides new values.\n\n## Summary\n\nYou have learned the basics of Modular Forms and are ready to create your first simple form. For more info and details you can find more guides and the API reference on our website: [modularforms.dev](https://modularforms.dev/)\n\n> Do you like Modular Forms so far? It would be a great honor for us to get a star from you on [GitHub](https://github.com/fabian-hiller/modular-forms)!\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/nx/index.mdx",
    "content": "---\ntitle: Nx Monorepos | Integrations\nkeywords: 'monorepo, nx, enterprise'\ncontributors:\n  - shairez\n  - Benny-Nottonson\n  - mrhoodz\n  - meeroslav\nupdated_at: '2023-07-18T17:48:46Z'\ncreated_at: '2023-04-29T15:28:06Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Nx and enterprise scale monorepos\n\n[Nx](https://nx.dev/) is a robust and extensible development platform designed to simplify the management \nof large-scale monorepos containing multiple applications and libraries by offering powerful tools for code generation, \nbuild orchestration, dependency management, and code sharing.\n\nQwik integrates with nx beautifully by using the [qwik-nx](https://github.com/qwikifiers/qwik-nx) plugin.\n\n\n## Main features\n\n* Generate a new Nx workspace using a \"Qwik\" preset\n* Generate Qwik applications and libraries.\n* Generate Qwik components and routes.\n* Generate Storybook, React Qwikify, Cloudflare configuration and much more\n* Run executors that are built specifically for building Qwik applications.\n\n\n## Usage\n\nYou can generate a new workspace by running:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm dlx create-nx-workspace@latest org-workspace --preset=qwik-nx\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpx create-nx-workspace@latest org-workspace --preset=qwik-nx\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn dlx create-nx-workspace@latest org-workspace --preset=qwik-nx\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbunx create-nx-workspace@latest org-workspace --preset=qwik-nx\n```\n</span>\n</PackageManagerTabs>\n\nOr add a new Qwik application to an existing workspace by running:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install qwik-nx\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install qwik-nx\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add qwik-nx\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install qwik-nx\n```\n</span>\n</PackageManagerTabs>\n\nand then\n\n```shell\nnx generate qwik-nx:app\n```\n\nFor further reference, please check the [qwik-nx documentation](https://github.com/qwikifiers/qwik-nx).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/og-img/index.mdx",
    "content": "---\ntitle: OG Image (og-img) | Integrations\nkeywords: 'open-graph, image, satori, resvg'\ncontributors:\n  - fabian-hiller\n  - aendel\nupdated_at: '2024-01-10T21:56:50Z'\ncreated_at: '2024-01-10T21:56:50Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# OG Image (og-img)\n\nWith [`og-img`](https://github.com/fabian-hiller/og-img) you can easily add dynamic Open Graph images to your Qwik website. These are displayed, for example, when your website is shared on social media or via messenger services.\n\n> `og-img` is a framework agnostic package for generating Open Graph images using [Satori](https://github.com/vercel/satori) and [resvg](https://github.com/RazrFalcon/resvg).\n\nTo get started, install the `og-img` package:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install og-img\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install og-img\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add og-img\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install og-img\n```\n</span>\n</PackageManagerTabs>\n\n## How it works\n\nTo generate an image, all you need to do is return an `ImageResponse` via a server endpoint. To create one, add a new route to your Qwik website and export a function called `onGet` in the index file. To easily define the content of your image, you can use the `html` tagged template literal.\n\n> To get proper syntax highlighting for the tagged template literal in Visual Studio Code, you can install the [lit-html](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) extension.\n\n```ts title=\"src/routes/og-image/index.ts\"\nimport type { RequestHandler } from '@builder.io/qwik-city';\nimport { fetchFont, ImageResponse, html } from 'og-img';\n\nexport const onGet: RequestHandler = async ({ send }) => {\n  send(\n    new ImageResponse(\n      // Use Tailwind CSS or style attribute\n      html`\n        <div tw=\"text-4xl text-green-700\" style=\"background-color: tan\">\n          Hello, world!\n        </div>\n      `,\n      {\n        width: 1200,\n        height: 600,\n        fonts: [\n          {\n            name: 'Roboto',\n            // Use `fs` (Node.js only) or `fetch` to read font file\n            data: await fetchFont(\n              'https://www.example.com/fonts/roboto-400.ttf'\n            ),\n            weight: 400,\n            style: 'normal',\n          },\n        ],\n      }\n    )\n  );\n};\n```\n\nThen all you need to do is point to this API endpoint with a meta tag in the head of your Qwik website to embed the Open Graph image.\n\n```html\n<head>\n  <title>Hello, world!</title>\n  <meta property=\"og:image\" content=\"https://www.example.com/og-image\" />\n</head>\n```\n\nYou can also generate the meta tag dynamically by export a `head` object in your routes.\n\n```tsx title=\"src/routes/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport type { DocumentHead } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return <h1>Hello, world!</h1>;\n});\n\nexport const head: DocumentHead = {\n  title: 'Hello, world!',\n  meta: [\n    {\n      property: 'og:image',\n      content: 'https://www.example.com/og-image',\n    },\n  ],\n};\n```\n\nYou can use URL parameters to dynamically change the content of your Open Graph image. Take a look at [Valibot's Open Graph image](https://valibot.dev/og-image/?title=Example%20Title&description=The%20content%20of%20this%20image%20was%20generated%20dynamically). You can find the source code [here](https://github.com/fabian-hiller/valibot/blob/main/website/src/routes/og-image/index.ts).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/orama/index.mdx",
    "content": "---\ntitle: Qwik City and Orama\nkeywords: 'orama, full-text search, search engine'\ncontributors:\n  - gioboa\nupdated_at: '2023-07-22T20:12:28Z'\ncreated_at: '2023-07-22T20:12:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Orama\n\n[Orama](https://oramasearch.com/) is a fast, batteries-included, full-text search engine entirely written in TypeScript, with zero dependencies.\n\nOrama could be used in Qwik on the client side or on the server side with `routeLoader$`, `routeAction$` and `server$` functions.\n\nThe easiest way to add Orama to Qwik is using the Qwik CLI command. This will install the required dependencies and create a new public route `/src/routes/orama` to showcase the Orama integration.\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add orama\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add orama\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add orama\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add orama\n```\n</span>\n</PackageManagerTabs>\n\n> Orama has been designed to work on any runtime and has no dependencies. A JavaScript runtime is the only requirement. \n\nFor further reference, please check the [Orama documentation](https://docs.oramasearch.com/).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/panda-css/index.mdx",
    "content": "---\ntitle: Panda CSS | Integrations\nkeywords: 'styles, styling'\ncontributors:\n  - anubra266\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-06-21T19:51:30Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Panda CSS\n\nPanda is a styling engine that generates styling primitives to author atomic CSS and recipes in a type-safe and readable manner.\n[Panda CSS Website](https://panda-css.com/)\n\n## Usage\n\nYou can add Panda easily by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add pandacss\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add pandacss\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add pandacss\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add pandacss\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command updates your app with the necessary dependencies.\n\nIt also adds new files to your project folder:\n\n- `postcss.config.js`\n- `panda.config.js`\n- `.vscode/settings.json`\n\nand modifies your `src/global.css` to include\n\n```css title=\"src/global.css\"\n\n# global.css file\n\n@layer reset, base, tokens, recipes, utilities;\n\n...stuff...\n\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/partytown/index.mdx",
    "content": "---\ntitle: Partytown | Integrations\nkeywords: 'third party scripts, google analytics, 3rd party, scripts, performance'\ncontributors:\n  - manucorporat\n  - leifermendez\n  - shairez\n  - pamenary\n  - reemardelarosa\n  - mhevery\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\n  - adamdbradley\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Partytown\n\nThird party scripts slow down your initial page load substantially by blocking the main thread.\n\nPartytown is a tool that allows you to defer third party scripts like Google Analytics, Facebook Pixel, etc off the main thread by using a web worker.\nFor more information about this tool visit the [Partytown docs](https://partytown.qwik.dev/).\n\n## Usage\n\nYou can add Partytown easily by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add partytown\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add partytown\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add partytown\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add partytown\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command updates your app and sets the correct configuration in `vite.config.ts`.\n\nIt also adds new files to your `components` folder.\n\n```tsx title=\"src/root.tsx\"\nimport { QwikPartytown } from './components/partytown/partytown';\n\nexport default component$(() => {\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charSet=\"utf-8\" />\n        <QwikPartytown forward={['gtag','dataLayer.push']} />\n        <script\n          async\n          type=\"text/partytown\"\n          src=\"https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX\"\n        />\n        <script\n          type=\"text/partytown\"\n          dangerouslySetInnerHTML={`\n            window.dataLayer = window.dataLayer || [];\n            window.gtag = function() {\n              dataLayer.push(arguments);\n            }\n            gtag('js', new Date());\n            gtag('config', 'G-XXXXXX');\n          `}\n        />\n      </head>\n      <body lang=\"en\"></body>\n    </QwikCityProvider>\n  );\n});\n```\n\n## Advanced\n\nTo further configure Partytown with more options, please visit the [Partytown Documentation](https://partytown.qwik.dev/configuration)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/playwright/index.mdx",
    "content": "---\ntitle: Playwright | Integrations\nkeywords: 'e2e, testing'\ncontributors:\n  - manucorporat\n  - zanettin\n  - mhevery\n  - Benny-Nottonson\n  - mrhoodz\n  - adamdbradley\nupdated_at: '2023-07-18T17:49:53Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Playwright\n\nPlaywright enables reliable end-to-end testing for modern web apps supporting all modern rendering engines and works cross-platform. [Playwright Website](https://playwright.dev/).\n\n## Usage\n\nYou can add Playwright easily by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add playwright\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add playwright\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add playwright\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add playwright\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command adds playwright to your dependencies, appends a `test.e2e` command in your `package.json` scripts section and creates a default configuration within the `playwright.config.ts` file on the application root level.\nIt also adds a new file within a newly created `tests` folder called `example.spec.ts` which contains some simple test cases.\n\nFor further reference, please check the [Playwright documentation](https://playwright.dev/docs/intro).\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/postcss/index.mdx",
    "content": "---\ntitle: PostCSS | Integrations\nkeywords: 'styles, styling'\ncontributors:\n  - manucorporat\n  - manuelsanchezweb\n  - manuelsanchez2\n  - the-r3aper7\n  - mhevery\n  - Benny-Nottonson\n  - mrhoodz\n  - adamdbradley\nupdated_at: '2023-07-18T17:50:05Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# PostCSS\n\n[PostCSS](https://postcss.org/) allows developers to write modern CSS while still maintaining backwards compatibility and improving performance. It parses CSS code and passes it through a series of plugins that can modify, optimize, and extend the CSS before outputting the final result.\n\n## Usage\n\nYou can add PostCSS to your project by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add postcss\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add postcss\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add postcss\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add postcss\n```\n</span>\n</PackageManagerTabs>\n\nThis will create a new `postcss.config.js` file at the root of the project with following dependencies and configuration.\n\n- [Autoprefixer](https://github.com/postcss/autoprefixer)\n- [PostCSS Preset Env](https://preset-env.cssdb.org/)\n\n```ts title=\"postcss.config.js\"\nexport default {\n  plugins: {\n    autoprefixer: {},\n    \"postcss-preset-env\": {\n      stage: 3,\n      features: {\n        \"nesting-rules\": true,\n      },\n    },\n  },\n};\n```\n\nIf you wish to add a new plugin like [CssNano](https://cssnano.co/) run the following command and update the `postcss.config.js`.\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install cssnano\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install cssnano\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add cssnano\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install cssnano\n```\n</span>\n</PackageManagerTabs>\n\n```ts title=\"postcss.config.js\"\nmodule.exports = {\n  plugins: {\n    /* previous plugin configuration */\n    \"cssnano\": {\n      preset: \"default\"\n    }\n  },\n}\n```\n\nFor further documentation, checkout [PostCSS Docs](https://postcss.org/docs/)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/prisma/index.mdx",
    "content": "---\ntitle: Prisma | Integrations\nkeywords: 'prisma, orm, database, data, storage, postgres, mongodb'\ncontributors:\n  - manucorporat\n  - ulic75\n  - igorbabko\n  - adcar\n  - ruheni\n  - Benny-Nottonson\n  - mrhoodz\n  - enesflow\n  - fabian-hiller\n  - aendel\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-25T11:05:50Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Prisma\n\n[Prisma](https://www.prisma.io/) allows interaction with [MongoDB](https://www.prisma.io/docs/concepts/database-connectors/mongodb) or [SQL databases](https://www.prisma.io/docs/concepts/database-connectors/postgresql) in a fully type-safe manner.\n\nWith Prisma you define your DB schema in `.prisma` files, and their CLI automatically generates the DB migrations as well as the Typescript types.\n\nPrisma can be used in Qwik with `routeLoader$`, `routeAction$` and `server$` functions. These are Qwik APIs to allow code to execute only on the server-side.\n\nThe easiest way to add Prisma to Qwik is using the Qwik CLI command. This will install the required dependencies and create a `prisma` folder with the Prisma schema and the migrations.\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add prisma\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add prisma\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add prisma\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add prisma\n```\n</span>\n</PackageManagerTabs>\n\n> Prisma makes it easy to use different databases such as Postgres, MySQL, SQLite and MongoDB.\n\n\n## Listing all the users\n\nWe will use `routeLoader$` to query all users in the DB, using `prisma.user.findMany()`, and returning the result.\n\n```tsx {7} /PrismaClient/ title=\"src/routes/users/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { PrismaClient } from '@prisma/client'\n\nexport const useGetUsers = routeLoader$(async () => {\n  const prisma = new PrismaClient();\n  // example read from SQLite\n  const users = await prisma.user.findMany()\n  return users;\n});\n\nexport default component$(() => {\n  const users = useGetUsers();\n  return (\n    <section>\n      <h1>User's directory</h1>\n      <ul>\n        {users.value.map(user => (\n          <li key={user.id}>\n            <a href={`/users/${user.id}`}>{user.name} ({user.email})</a>\n          </li>\n        ))}\n      </ul>\n    </section>\n  )\n});\n```\n\n## Show user detail\n\nWe will use `routeLoader$` to query specific users based on the `userId` URL param, using `prisma.user.findUnique()`, and returning the result.\n\n\n```tsx {8} /PrismaClient/ title=\"src/routes/users/[userId]/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { PrismaClient } from '@prisma/client'\n\nexport const useGetUser = routeLoader$(async ({params, status}) => {\n  const userId = parseInt(params['userId'], 10);\n  const prisma = new PrismaClient();\n  const user = await prisma.user.findUnique({where: {id: userId}});\n  if (!user) {\n    // Set the status to 404 if the user is not found\n    status(404);\n  }\n  return user;\n});\n\nexport default component$(() => {\n  const user = useGetUser();\n  return (\n    <section>\n      <h1>User detail</h1>\n      {user.value ? (\n        <>\n          <p>Name: {user.value.name}</p>\n          <p>Email: {user.value.email}</p>\n        </>\n      ) : (\n        <p>User not found</p>\n      )}\n    </section>\n  )\n});\n```\n\n## Adding a user\n\nWe will use `routeAction$` and `Form` to create a progressive form to add a new user to the DB. We will use `prisma.user.create()` to create the user.\n\n```tsx {7-9} /PrismaClient/ title=\"src/routes/create/index.tsx\"\nimport { component$ } from '@builder.io/qwik';\nimport { routeAction$, zod$, z, Form } from '@builder.io/qwik-city';\nimport { PrismaClient } from '@prisma/client'\n\nexport const useCreateUser = routeAction$(async (data) => {\n  const prisma = new PrismaClient();\n  const user = await prisma.user.create({\n    data,\n  });\n  return user;\n}, zod$({\n  name: z.string(),\n  email: z.string().email(),\n}));\n\nexport default component$(() => {\n  const createUserAction = useCreateUser();\n  return (\n    <section>\n      <h1>Create User</h1>\n      <Form action={createUserAction}>\n        <label>Name\n          <input name=\"name\" value={createUserAction.formData?.get('name')} />\n        </label>\n        <label>Email\n          <input name=\"email\" value={createUserAction.formData?.get('email')} />\n        </label>\n        <button type=\"submit\">Create</button>\n      </Form>\n      {createUserAction.value && (\n        <div>\n          <h2>User created successfully!</h2>\n        </div>\n      )}\n    </section>\n  )\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/react/index.mdx",
    "content": "---\ntitle: React | Integrations\ncontributors:\n  - manucorporat\n  - swwind\n  - reemardelarosa\n  - mhevery\n  - AnthonyPAlicea\n  - adamdbradley\n  - igorbabko\n  - abhi-works\n  - Benny-Nottonson\n  - mrhoodz\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport CodeSandbox, {CodeFile} from '../../../../components/code-sandbox/index.tsx';\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Qwik React ⚛️\n\nQwik React allows you to use [React](https://react.dev/) within [Qwik](https://qwik.dev/). The advantage of using Qwik React is that you can use existing React components and libraries within Qwik. This allows you to take advantage of the large ecosystem of React components and libraries such as [Material UI](https://mui.com/), [Threejs](https://github.com/pmndrs/react-three-fiber) and [React Spring](https://react-spring.io/). It is also a good way to get the benefits of Qwik without having to rewrite your React application.\n\n## Basic Usage\n\nThe basic usage of Qwik React is to take existing React components and wrap them in a `qwikify$` function. This function will create a Qwik component that can be used within Qwik and which will turn the React component into an island allowing you the freedom to fine-tune when the React component should hydrate.\n\nBasic usage\n```tsx\n// This pragma is required so that React JSX is used instead of Qwik JSX\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\n\n// An existing React component\nfunction Greetings() {\n  return <div>Hello from React</div>;\n}\n\n// Qwik component wrapping the React component\nexport const QGreetings = qwikify$(Greetings);\n```\n\n## 0. Installation\n\nBefore you can use Qwik React you need to configure the Qwik project to use Qwik React. The simplest way is to run the following command:\n\n> If you don't have a Qwik app yet, then you need to [create one first](/docs/(qwik)/getting-started/index.mdx), then, follow the instructions and run the command add React to your app.\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add react\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add react\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add react\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add react\n```\n</span>\n</PackageManagerTabs>\n\nThe above command will perform the following:\n\n1. Install the required dependencies in `package.json`:\n   ```json\n   {\n    ...,\n     \"dependencies\": {\n      ...,\n       \"@builder.io/qwik-react\": \"0.5.0\",\n       \"@types/react\": \"18.0.28\",\n       \"@types/react-dom\": \"18.0.11\",\n       \"react\": \"18.2.0\",\n       \"react-dom\": \"18.2.0\",\n     }\n   }\n   ```\n   > **Note**: This is not an emulation of React. We are using the actual React library.\n2. configure Vite to use the `@builder.io/qwik-react` plugin:\n   ```ts\n   // vite.config.ts\n   import { qwikReact } from '@builder.io/qwik-react/vite';\n\n   export default defineConfig(() => {\n      return {\n        ...,\n        plugins: [\n          ...,\n          // The important part\n          qwikReact()\n        ],\n      };\n   });\n   ```\n\n> **Note**: The `qwik add react` command will also configure a demo route showcasing the Qwik React integration. These are:\n> - `package.json` `dependencies`:\n>   - `@emotion/react 11.10.6`\n>   - `@emotion/styled 11.10.6`\n>   - `@mui/material 5.11.9`\n>   - `@mui/x-data-grid 5.17.24`\n> - `src/route`:\n>   - `/src/routes/react`: New public route showcasing react integration\n>   - `/src/integrations/react`: Here's where the react component lives\n>\n> We will ignore these in this guide and instead take you through the process from the beginning.\n\n\n## 1. Hello World\n\nLet's start with a simple example. We will create a simple React component and then wrap it in a Qwik component. We will then use the Qwik component in a Qwik route.\n\n<CodeSandbox src=\"/src/routes/demo/react/hello-world/\" tabs={[\"react.tsx\",\"index.tsx\"]} style={{ height: '6em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/hello-world/react.tsx\">\n```tsx /qwikify$/ /QGreetings/\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\n\n// Create React component standard way\nfunction Greetings() {\n  return <p>Hello from React</p>;\n}\n\n// Convert React component to Qwik component\nexport const QGreetings = qwikify$(Greetings);\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/hello-world/index.tsx\">\n```tsx /QGreetings/\nimport { component$ } from '@builder.io/qwik';\nimport { QGreetings } from './react';\n\nexport default component$(() => {\n  return (\n    <main>\n      <p>Hello from Qwik</p>\n      <QGreetings />\n    </main>\n  );\n});\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\nThe `@builder.io/qwik-react` package exports the `qwikify$()` function that lets you convert React components into Qwik components, that you can use across your application.\n\n> **Note:** You CAN NOT use React components in Qwik without converting them first, using `qwikify$()`. Even though [React and Qwik components look similar](/docs/(qwikcity)/guides/react-cheat-sheet/index.mdx), they are fundamentally very different.\n\nReact and Qwik components can not be mixed in the same file, if you check your project right after running the installation command, you will see a new folder `src/integrations/react/`, we recommend that you place your React components there.\n\n## 2. Hydrating react islands\n\nThe above example shows how to SSR static React content on the server. The benefit is that that component will never re-render in the browser and therefore its code never downloads to the client. But what if the component needs to be interactive, and therefore we need to download its behavior in the browser? Let's start with building a simple counter example in React.\n\n<CodeSandbox src=\"/src/routes/demo/react/counter-simple/\" tabs={[\"react.tsx\",\"index.tsx\"]} style={{ height: '6em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/counter-simple/react.tsx\">\n```tsx /qwikify$/ /QGreetings/\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { useState } from 'react';\n\n// Create React component standard way\nfunction Counter() {\n  const [count, setCount] = useState(0);\n  return (\n    <button className=\"react\" onClick={() => setCount(count + 1)}>\n      Count: {count}\n    </button>\n  );\n}\n\n// Convert React component to Qwik component\nexport const QCounter = qwikify$(Counter);\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/counter-simple/index.tsx\">\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { QCounter } from './react';\n\nexport default component$(() => {\n  return (\n    <main>\n      <QCounter />\n    </main>\n  );\n});\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\nNotice that clicking on the `Count` button does nothing. This is because the React has not been downloaded and therefore the component was not hydrated. We need to tell Qwik to download the React component and hydrate it, but we need to specify the condition under which we want to do that. Doing it eagerly would lose all of the benefits of turning the React application into islands. In this case, we want to download the component when the user hovers over the button, we do so by adding `{: eagerness: 'hover' }` to `qwikify$()`.\n\n<CodeSandbox src=\"/src/routes/demo/react/counter-simple-hover/\" console={true}\n             tabs={[\"react.tsx\",\"index.tsx\"]} style={{ height: '20em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/counter-simple-hover/react.tsx\">\n```tsx /qwikify$/ /{: eagerness: 'hover' }/\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { useState } from 'react';\n\n// Create React component standard way\nfunction Counter() {\n  // Print to console to show when the component is rendered.\n  console.log('React <Counter/> Render');\n  const [count, setCount] = useState(0);\n  return (\n    <button className=\"react\" onClick={() => setCount(count + 1)}>\n      Count: {count}\n    </button>\n  );\n}\n\n// Specify eagerness to hydrate component on hover event.\nexport const QCounter = qwikify$(Counter, { eagerness: 'hover' });\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/counter-simple-hover/index.tsx\">\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { QCounter } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  return (\n    <main>\n      <QCounter />\n    </main>\n  );\n});\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\nIn this example, we have brought up the console to show what is going on behind the scene. When you hover over the button, you will see that the React component is rendered. This is because we asked Qwik to hydrate the component on `hover`. Now that the component is hydrated you can interact with it and it will correctly update the count.\n\nBy giving the `eagerness` property to `qwikify$()`, we are allowing you to fine-tune the conditions under which the component is hydrated which will impact the startup performance of your application.\n\n\n## 3. Inter-island communication\n\nIn the previous example, we had a single island that we delay-hydrated. But once you have multiple islands, there will be a need to communicate between them. This example shows how to do inter-island communication with Qwik.\n\n\n<CodeSandbox src=\"/src/routes/demo/react/counter-two-islands/\" console={true}\n             tabs={[\"react.tsx\",\"index.tsx\"]} style={{ height: '20em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/counter-two-islands/react.tsx\">\n```tsx /qwikify$/ /{: eagerness: 'hover' }/\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\n\nfunction Button({ onClick }: { onClick: () => void }) {\n  console.log('React <Button/> Render');\n  return <button onClick={onClick}>+1</button>;\n}\n\nfunction Display({ count }: { count: number }) {\n  console.log('React <Display count=' + count + '/> Render');\n  return <p className=\"react\">Count: {count}</p>;\n}\n\nexport const QButton = qwikify$(Button, { eagerness: 'hover' });\nexport const QDisplay = qwikify$(Display);\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/counter-two-islands/index.tsx\">\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { QButton, QDisplay } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const count = useSignal(0);\n  return (\n    <main>\n      <QButton\n        onClick$={() => {\n          console.log('click', count.value);\n          count.value++;\n        }}\n      />\n      <QDisplay count={count.value}></QDisplay>\n    </main>\n  );\n});\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\nIn the above example, we have two islands, one for the button (`QButton`) and one for the display (`QDisplay`). The button island is hydrated on `hover` and the display island is not hydrated on any event.\n\nThe `react.tsx` file has:\n- `QButton` - a button that increments the count when clicked. This island is hydrated on `hover`.\n- `QDisplay` - a display that shows the current count. This island is not hydrated on any event but will be hydrated by Qwik when its props change.\n- Both of the React components have `console.log` to show when the component is hydrated or re-rendered.\n\nThe `index.tsx` file has:\n- `count` - a signal that is used to track the current count.\n- Instantiates the `QButton` islands. The `onClick$` handler increments the `count` signal. Notice that Qwik automatically converts the `onClick` to `onClick$` prop allowing lazy loading of the event handlers.\n- Instantiates the `QDisplay` islands. The `count` signal is passed as a prop to the island.\n\nWhen you hover over the button, you will see that the `QButton` island is hydrated. When you click the button, you will see that the `QDisplay` island is hydrated and the count is updated. (The double execution of `QDisplay` is due to initial hydration first, and then updating the count second.)\n\nNotice that Qwik React only needs to eagerly hydrate components that have interactivity. Components that are dynamic, but don't have interactivity (such as `QDisplay` in this example) do not need to be eagerly hydrated instead they hydrate automatically when their props change.\n\nAlso notice that `console.log('Qwik Render');` never executes in the browser.\n\n## 4. `host:` Listeners\n\nIn the previous example, we had two islands. The `QButton` had to be eagerly hydrated so that React can set up the `onClick` event handler. This is a bit wasteful because the `QButton` island will never need to be re-rendered as its output is static. Clicking on the `QButton` will not cause the `QButton` island to re-render. In such a case, we can ask Qwik to register the `click` listener instead of hydrating the whole component in React just to attach a listener. This is done by using the `host:` prefix in the event name.\n\n<CodeSandbox src=\"/src/routes/demo/react/counter-two-islands-host/\" console={true}\n             tabs={[\"index.tsx\",\"react.tsx\"]} style={{ height: '20em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/counter-two-islands-host/index.tsx\">\n```tsx /host:onClick$/\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { QButton, QDisplay } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const count = useSignal(0);\n  return (\n    <main>\n      <QButton\n        host:onClick$={() => {\n          console.log('click', count.value);\n          count.value++;\n        }}\n      >\n        +1\n      </QButton>\n      <QDisplay count={count.value}></QDisplay>\n    </main>\n  );\n});\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/counter-two-islands-host/react.tsx\">\n```tsx\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { type ReactNode } from 'react';\n\nfunction Button({ children }: { children?: ReactNode[] }) {\n  console.log('React <Button/> Render');\n  return <button>{children}</button>;\n}\n\nfunction Display({ count }: { count: number }) {\n  console.log('React <Display count=' + count + '/> Render');\n  return <div className=\"react\">Count: {count}</div>;\n}\n\nexport const QButton = qwikify$(Button);\nexport const QDisplay = qwikify$(Display);\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\nNow hovering over the button will not do anything (no React hydration). Clicking on the button will cause Qwik to handle the event and update the signal which will in turn cause the hydration of the `QDisplay` island. Notice that the `QButton` island is never hydrated. Therefore this change allowed us to have an island that renders server side only and never needs to be hydrated in the browser, saving our user time.\n\n\n## 5. Projecting `children`\n\nA common use case is to pass content children to components. This works with Qwik React as well. In the React component just declare `children` in your props and use them as expected (See `react.tsx`).\n\n<CodeSandbox src=\"/src/routes/demo/react/children/\" console={true}\n             tabs={[\"index.tsx\",\"react.tsx\"]} style={{ height: '20em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/children/index.tsx\">\n```tsx /host:onClick$/\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { QFrame } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const count = useSignal(0);\n  return (\n    <QFrame>\n      <button\n        onClick$={() => {\n          console.log('click', count.value);\n          count.value++;\n        }}\n      >\n        +1\n      </button>\n      Count: {count}\n    </QFrame>\n  );\n});\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/children/react.tsx\">\n```tsx\n/** @jsxImportSource react */\nimport { type ReactNode } from 'react';\nimport { qwikify$ } from '@builder.io/qwik-react';\n\nfunction Frame({ children }: { children?: ReactNode[] }) {\n  console.log('React <Zippy/> Render');\n  return (\n    <div\n      style={{\n        display: 'inline-block',\n        border: '1px solid black',\n        borderRadius: '10px',\n        padding: '5px',\n      }}\n    >\n      {children}\n    </div>\n  );\n}\n\nexport const QFrame = qwikify$(Frame);\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\nNotice that the `QFrame` island is never hydrated because it has no `eagerness` or any props which would trigger hydration. But also notice that the children do re-render when the signal changes and are correctly projected into the React `QFrame` island without the island being hydrated. This allows even more of the page to be rendered server-side and never rendered on the client.\n\n## 6. Using React libraries\n\nFinally, it is possible to use React libraries in your Qwik application. In this example [Material UI](https://mui.com/) and [Emotion](https://emotion.sh/docs/introduction) are used to render this React example.\n\n\n<CodeSandbox src=\"/src/routes/demo/react/mui/\"\n             tabs={[\"react.tsx\", \"index.tsx\"]} style={{ height: '8em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/mui/react.tsx\">\n```tsx /host:onClick$/\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport Box from '@mui/material/Box';\nimport { type ReactNode } from 'react';\n\nexport const Example = qwikify$(\n  function Example({\n    selected,\n    onSelected,\n    children,\n  }: {\n    selected: number;\n    onSelected: (v: number) => any;\n    children?: ReactNode[];\n  }) {\n    console.log('React <Example/> Render');\n    return (\n      <>\n        <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n          <Tabs\n            value={selected}\n            onChange={(e, v) => onSelected(v)}\n            aria-label=\"basic tabs example\"\n          >\n            <Tab label=\"Item One\" />\n            <Tab label=\"Item Two\" />\n            <Tab label=\"Item Three\" />\n          </Tabs>\n          {children}\n        </Box>\n      </>\n    );\n  },\n  { eagerness: 'hover' }\n);\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/mui/index.tsx\">\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { Example } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const selected = useSignal(0);\n  return (\n    <Example\n      selected={selected.value}\n      onSelected$={(v) => (selected.value = v)}\n    >\n      Selected tab: {selected.value}\n    </Example>\n  );\n});\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\nThe React example is hydrated on hover and works as you would expect.\n\n# Rules\n\nLet's look at this example to better understand the rules of Qwik React.\n\n```tsx title=\"src/integrations/react/mui.tsx\"\n/** @jsxImportSource react */\n\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { Alert, Button, Slider } from '@mui/material';\nimport { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid';\n\nexport const MUIButton = qwikify$(Button);\nexport const MUIAlert = qwikify$(Alert);\nexport const MUISlider = qwikify$(Slider, { eagerness: 'hover' });\n```\n\n> **Important:** You need to import `/** @jsxImportSource react */` at the top of your file, this is an instruction to the compiler to use React as the JSX factory.\n\nIn a nutshell, the rules are:\n\n1. Don't mix React and Qwik components in the same file.\n2. We recommend that you place all your react code inside the `src/integrations/react` folder.\n3. Add `/** @jsxImportSource react */` at the top of the files containing React code.\n4. Use `qwikify$()` to convert React components into Qwik components, that you can then import from Qwik modules.\n\nNow your Qwik can import `MUIButton` and use it as any other Qwik component:\n\n```tsx\nimport { component$ } from '@builder.io/qwik';\nimport { MUIAlert, MUIButton } from '~/integrations/react/mui';\n\nexport default component$(() => {\n  return (\n    <>\n      <MUIButton client:hover>Hello this is a button</MUIButton>\n\n      <MUIAlert severity=\"warning\">This is a warning from Qwik</MUIAlert>\n    </>\n  );\n});\n```\n\n## `qwikify$()`\n\nThe `qwikify$(ReactCmp, options?): QwikCmp` allows to implement partial hydration of React components. It works by wrapping the SSR and hydration logic of React into a Qwik component that can execute React's `renderToString()` during SSR and dynamically call `hydrateRoot()` when specified.\n\nNotice that by default no React code will run in the browser, meaning that React component will NOT be interactive by default, for example, in the following example, we _qwikify_ the [Slider](https://mui.com/material-ui/react-slider/) component from MUI, but it will not be interactive (it is missing an `eagerness` property to tell Qwik when the React component should be hydrated in the browser.)\n\n<CodeSandbox src=\"/src/routes/demo/react/slider/\" console={true}\n             tabs={[\"react.tsx\",\"index.tsx\"]} style={{ height: '20em' }}>\n<div  q:slot=\"0\">\n<CodeFile src=\"/src/routes/demo/react/slider/react.tsx\">\n```tsx /host:onClick$/\n/** @jsxImportSource react */\nimport { qwikify$ } from '@builder.io/qwik-react';\nimport { Slider } from '@mui/material';\nexport const MUISlider = qwikify$<typeof Slider>(\n  Slider\n  //  Uncomment next line to make component interactive in browser\n  // { eagerness: 'hover' }\n);\n```\n</CodeFile>\n</div>\n<div q:slot=\"1\">\n<CodeFile src=\"/src/routes/demo/react/children/index.tsx\">\n```tsx\nimport { component$, useSignal } from '@builder.io/qwik';\nimport { QFrame } from './react';\n\nexport default component$(() => {\n  console.log('Qwik Render');\n  const count = useSignal(0);\n  return (\n    <QFrame>\n      <button\n        onClick$={() => {\n          console.log('click', count.value);\n          count.value++;\n        }}\n      >\n        +1\n      </button>\n      Count: {count}\n    </QFrame>\n  );\n});\n```\n</CodeFile>\n</div>\n</CodeSandbox>\n\n## Limitations\n\n### Every qwikified react component is isolated\n\nEach instance of a qwikified react component becomes an independent React app. Fully isolated.\n\n```tsx\nexport const MUISlider = qwikify$(Slider);\n\n<MUISlider></MUISlider>\n<MUISlider></MUISlider>\n```\n\n- Each `MUISlider` is a fully isolated React application, with its own state, lifecycle, etc.\n- Styles will be duplicated\n- State will not be shared\n- [Context](https://react.dev/learn/passing-data-deeply-with-context) will not be inherited.\n- Islands will [hydrate](https://react.dev/reference/react-dom/client/hydrateRoot) independently\n\n### By default interactivity is disabled\n\nBy default, qwikified components will not be interactive, please look at the next section to learn how to enable interactivity.\n\n### Use `qwikify$()` as a migration strategy\n\nUsing React components in Qwik is a great way to migrate your application to Qwik, but it's not a silver bullet, you will need to rewrite your components to take advantage of Qwik's features.\n\nIt's also a great way to enjoy the React ecosystem, like [threejs](https://github.com/pmndrs/react-three-fiber) or [data-grid libs](https://mui.com/x/react-data-grid/).\n\n> Don't abuse `qwikify$()` to build your application, as overusing will cause performance gains to be lost.\n\n### Build wide islands, not leaf nodes\n\nFor example, if you need to use several MUI components, to build a list, don't qwikify each individual MUI component, instead, build the whole list as a single qwikified React component.\n\n#### GOOD: Wide island\n\nA single qwikified component, with all the MUI components inside. Styles will not be duplicated, and context and theming will work as expected.\n\n```tsx\nimport * as React from 'react';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport ListItemAvatar from '@mui/material/ListItemAvatar';\nimport Avatar from '@mui/material/Avatar';\nimport ImageIcon from '@mui/icons-material/Image';\nimport WorkIcon from '@mui/icons-material/Work';\nimport BeachAccessIcon from '@mui/icons-material/BeachAccess';\n\n// Qwikify the whole list\nexport const FolderList = qwikify$(() => {\n  return (\n    <List sx={{ width: '100%', maxWidth: 360, bgcolor: 'background.paper' }}>\n      <ListItem>\n        <ListItemAvatar>\n          <Avatar>\n            <ImageIcon />\n          </Avatar>\n        </ListItemAvatar>\n        <ListItemText primary=\"Photos\" secondary=\"Jan 9, 2014\" />\n      </ListItem>\n      <ListItem>\n        <ListItemAvatar>\n          <Avatar>\n            <WorkIcon />\n          </Avatar>\n        </ListItemAvatar>\n        <ListItemText primary=\"Work\" secondary=\"Jan 7, 2014\" />\n      </ListItem>\n      <ListItem>\n        <ListItemAvatar>\n          <Avatar>\n            <BeachAccessIcon />\n          </Avatar>\n        </ListItemAvatar>\n        <ListItemText primary=\"Vacation\" secondary=\"July 20, 2014\" />\n      </ListItem>\n    </List>\n  );\n});\n```\n\n#### BAD: Leaf nodes\n\nLeaf nodes are qwikified independently, effectively rendering dozens of nested react applications, each fully isolated from the others, and styles being duplicated.\n\n```tsx\nimport * as React from 'react';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport ListItemAvatar from '@mui/material/ListItemAvatar';\nimport Avatar from '@mui/material/Avatar';\nimport ImageIcon from '@mui/icons-material/Image';\nimport WorkIcon from '@mui/icons-material/Work';\nimport BeachAccessIcon from '@mui/icons-material/BeachAccess';\n\nexport const MUIList = qwikify$(List);\nexport const MUIListItem = qwikify$(ListItem);\nexport const MUIListItemText = qwikify$(ListItemText);\nexport const MUIListItemAvatar = qwikify$(ListItemAvatar);\nexport const MUIAvatar = qwikify$(Avatar);\nexport const MUIImageIcon = qwikify$(ImageIcon);\nexport const MUIWorkIcon = qwikify$(WorkIcon);\nexport const MUIBeachAccessIcon = qwikify$(BeachAccessIcon);\n```\n\n```tsx\n// Qwik component using dozens of nested React islands\n// Each MUI-* it's an independent React application\nexport const FolderList = component$(() => {\n  return (\n    <MUIList sx={{ width: '100%', maxWidth: 360, bgcolor: 'background.paper' }}>\n      <MUIListItem>\n        <MUIListItemAvatar>\n          <MUIAvatar>\n            <MUIImageIcon />\n          </MUIAvatar>\n        </MUIListItemAvatar>\n        <MUIListItemText primary=\"Photos\" secondary=\"Jan 9, 2014\" />\n      </MUIListItem>\n      <MUIListItem>\n        <MUIListItemAvatar>\n          <MUIAvatar>\n            <MUIWorkIcon />\n          </MUIAvatar>\n        </MUIListItemAvatar>\n        <MUIListItemText primary=\"Work\" secondary=\"Jan 7, 2014\" />\n      </MUIListItem>\n      <MUIListItem>\n        <MUIListItemAvatar>\n          <MUIAvatar>\n            <MUIBeachAccessIcon />\n          </MUIAvatar>\n        </MUIListItemAvatar>\n        <MUIListItemText primary=\"Vacation\" secondary=\"July 20, 2014\" />\n      </MUIListItem>\n    </MUIList>\n  );\n});\n```\n\n## Adding interactivity\n\nIn order to add interactivity, in React terminology we need to [hydrate](https://react.dev/reference/react-dom/hydrate), usually in React applications this hydration task happens unconditionally at load time, [adding a massive overhead](https://www.builder.io/blog/hydration-is-pure-overhead) and making sites slow.\n\nQwik allows you decide when to hydrate your components, by using the `client:` JSX properties, this technique is commonly called partial hydration, popularized by [Astro](https://astro.build/).\n\n```diff\nexport default component$(() => {\n  return (\n    <>\n-      <MUISlider></MUISlider>\n+      <MUISlider client:visible></MUISlider>\n    </>\n  );\n});\n```\n\nQwik comes with different strategies out of the box:\n\n### `client:load`\n\nThe component eagerly hydrates when the document loads.\n\n```tsx\n<MUISlider client:load></MUISlider>\n```\n\n**Use case:** Immediately-visible UI elements that need to be interactive as soon as possible.\n\n### `client:idle`\n\nThe component eagerly hydrates when the browser first becomes idle, ie, when everything important has already run before.\n\n```tsx\n<MUISlider client:idle></MUISlider>\n```\n\n**Use case:** Lower-priority UI elements that don’t need to be immediately interactive.\n\n### `client:visible`\n\nThe component eagerly hydrates when it becomes visible in the viewport.\n\n```tsx\n<MUISlider client:visible></MUISlider>\n```\n\n**Use case:** Low-priority UI elements that are either far down the page (“below the fold”) or so resource-intensive to load that you would prefer not to load them at all if the user never saw the element.\n\n### `client:hover`\n\nThe component eagerly hydrates when the mouse is over the component.\n\n```tsx\n<MUISlider client:hover></MUISlider>\n```\n\n**Use case:** Lowest-priority UI elements which interactivity is not crucial, and only needs to run in desktop.\n\n### `client:signal`\n\nThis is an advanced API that allows to hydrate the component whenever the passed signal becomes `true`.\n\n```tsx\nexport default component$(() => {\n  const hydrateReact = useSignal(false);\n  return (\n    <>\n      <button onClick$={() => (hydrateReact.value = true)}>Hydrate Slider when click</button>\n\n      <MUISlider client:signal={hydrateReact}></MUISlider>\n    </>\n  );\n});\n```\n\nThis effectively allows you to implement custom strategies for hydration.\n\n### `client:event`\n\nThe component eagerly hydrates when specified DOM events are dispatched.\n\n```tsx\n<MUISlider client:event=\"click\"></MUISlider>\n```\n\n### `client:only`\n\nWhen `true`, the component will not run in SSR, only in the browser.\n\n```tsx\n<MUISlider client:only></MUISlider>\n```\n\n## Listening to React events\n\nEvents in React are handled by passing a function as a property to the component, for example:\n\n```tsx\n// React code (won't work in Qwik)\n\nimport { Slider } from '@mui/material';\n\n<Slider onChange={() => console.log('value changed')}></Slider>;\n```\n\nThe `qwikify()` function will convert this into a Qwik component that will also expose the React events as Qwik [QRLs](/docs/(qwik)/advanced/qrl/index.mdx):\n\n```tsx\nimport { Slider } from '@mui/material';\nimport { qwikify$ } from '@builder.io/qwik-react';\nconst MUISlider = qwikify$(Slider);\n\n<MUISlider client:visible onChange$={() => console.log('value changed')} />;\n```\n\n> Notice that we use the `client:visible` property to eagerly hydrate the component, otherwise the component would not be interactive and the events would never be dispatched.\n\n## Host element\n\nWhen wrapping a React component with `qwikify$()`, under the hood, a new DOM element is created, such as:\n\n```html\n<qwik-react>\n  <button class=\"MUI-button\"></button>\n</qwik-react>\n```\n\n> Notice, that the tag name of the wrapper element is configurable via `tagName`: `qwikify$(ReactCmp, { tagName: 'my-react' })`.\n\n### Listen to DOM events without hydration\n\nThe host element is not part of React, meaning that hydration is not necessary to listen for events, in order to add custom attributes and events to the host element, you can use the `host:` prefix in the JSX properties, such as:\n\n```tsx\n<MUIButton\n  host:onClick$={() => {\n    console.log('click a react component without hydration!!');\n  }}\n/>\n```\n\nThis will effectively allow you to respond to a click in a [MUI button](https://mui.com/material-ui/react-button/) without downloading a single byte of React code.\n\n🧑‍💻Happy hacking!\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/storybook/index.mdx",
    "content": "---\ntitle: Storybook | Integrations\nkeywords: 'component testing, storybook, stories, components, qwik'\ncontributors:\n  - manucorporat\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\n  - thenhawke\nupdated_at: '2024-01-15T18:53:23Z'\ncreated_at: '2023-04-25T19:05:53Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Storybook\n\n[Storybook](https://storybook.js.org/) is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and documentation. It's open source and free.\n\nSince version 7.0, Storybook supports Vite natively, which means it has first-class support for Qwik too.\n\n## Usage\n\nYou can add Storybook to your existing app, or library use:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add storybook\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add storybook\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add storybook\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add storybook\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command installs the necessary dependencies and adds an example component and stories\n\nNow you can serve the Storybook dashboard:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run storybook\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run storybook\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run storybook\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run storybook\n```\n</span>\n</PackageManagerTabs>\n\n## Examples\n\n### Simple component\n\nThe following demonstrates a simple story that uses a qwik component:\n\n```tsx title=\"src/components/button.tsx\"\nimport { component$ } from \"@builder.io/qwik\";\n\nexport interface ButtonProps {\n  label: string;\n}\n\nexport const Button = component$<ButtonProps>(({label}) => {\n  return (\n    <button>\n      {label}\n    </button>\n  );\n});\n```\n\n```tsx title=\"src/components/button.stories.tsx\"\nimport type { Meta, StoryObj } from \"storybook-framework-qwik\";\nimport {Button, type ButtonProps} from \"./button\";\n\nconst meta: Meta<ButtonProps>  = {\n  component: Button,\n};\n\nexport default meta;\ntype Story = StoryObj<ButtonProps>; \n\nexport const Primary: Story = {\n  args: {\n    label: \"Hello World\", \n  }\n};\n```\n\n### Component That Uses QwikCity\n\nWhen using Qwikcity, you must pass a context to the story by using the [`<QwikCityMockProvider>`](https://qwik.dev/docs/api/#qwikcitymockprovider):\n\n```tsx title=\"src/components/with-link.tsx\"\nimport { component$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport const WithLink = component$(() => {\n  return (\n    <Link href=\"https://google.com\">Google Link</Link>\n  );\n});\n```\n\n```tsx title=\"src/components/with-link.stories.tsx\"\nimport type { Meta, StoryObj } from \"storybook-framework-qwik\";\nimport { QwikCityMockProvider } from \"@builder.io/qwik-city\";\n\nimport { WithLink } from \"./with-link\";\n\nconst meta: Meta = {\n  component: WithLink,\n};\n\ntype Story = StoryObj;\nexport default meta;\n\nexport const Primary: Story = {\n  render: () =>\n    <QwikCityMockProvider>\n      <WithLink />\n    </QwikCityMockProvider>\n};\n```\n\nFor more information please refer to the [storybook documentation.](https://storybook.js.org/docs)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/styled-vanilla-extract/index.mdx",
    "content": "---\ntitle: Styled Vanilla Extract | Integrations\nkeywords: 'styles, styling, css-in-js, vanilla-extract, styled-components'\ncontributors:\n  - manucorporat\n  - literalpie\n  - forresst\n  - reemardelarosa\n  - mhevery\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\n  - adamdbradley\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Styled Vanilla Extract\n\nStyled-vanilla-extract is a CSS framework built on top of [vanilla-extract](https://vanilla-extract.style/) that delivers a modern and performant CSS-in-JS with Zero-runtime.\n\nThis integration supports two ways of styling:\n\n- Using [Vanilla Extract](https://vanilla-extract.style/) directly.\n- [Styled-components](https://styled-components.com/) powered by Vanilla-extract\n\n## Usage\n\nYou can add `styled-vanilla-extract` easily by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add styled-vanilla-extract\n```\n</span>\n</PackageManagerTabs>\n\nAfter the installation a new route will be created in your project, showcasing the usage of the library in a new component.\n\n### The Vanilla Extract way\n\nPlease refer to the official docs for more information about [Vanilla Extract](https://vanilla-extract.style/documentation/getting-started).\n\n```tsx title=\"styles.css.ts\"\nimport { style } from 'styled-vanilla-extract/qwik';\n\nexport const blueClass = style({\n  display: 'block',\n  width: '100%',\n  height: '500px',\n  background: 'blue',\n});\n```\n\n```tsx title=\"component.tsx\"\nimport { blueClass } from './styles.css';\n\nexport const Cmp = component$(() => {\n  return <div class={blueClass} />;\n});\n```\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add styled-vanilla-extract\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add styled-vanilla-extract\n```\n</span>\n</PackageManagerTabs>\n\n> **How about emotion or other CSS-in-JS libs?** While extremely popular, emotion and other CSS-in-JS libs are not the best choice for Qwik. [They are not optimized for runtime performance and they don't have a good SSR streaming support](https://dev.to/srmagura/why-were-breaking-up-wiht-css-in-js-4g9b), leading to a degraded server and client performance.\n\n## Styled-components\n\nUsing the same integration, you have a styled-components powered by Vanilla Extract, use the exported `styled` function to create your components.\n\n```tsx title=\"styles.css.ts\"\nimport { styled } from 'styled-vanilla-extract/qwik';\n\nexport const BlueBox = styled.div`\n  display: block;\n  width: 100%;\n  height: 500px;\n  background: blue;\n`;\n```\n\n```tsx title=\"component.tsx\"\nimport { BlueBox } from './styles.css';\n\nexport const Cmp = component$(() => {\n  return <BlueBox />;\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/supabase/index.mdx",
    "content": "---\ntitle: Supabase | Integrations\nkeywords: 'supabase, db'\ncontributors:\n  - manucorporat\n  - hamatoyogi\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\n  - samijaber\n  - aendel\nupdated_at: '2023-10-03T18:53:23Z'\ncreated_at: '2023-04-25T11:05:50Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Supabase\n\nThe `Supabase` JS library plays nicely with the server-side APIs from Qwik such as `routeLoader$`, `routeAction$` or `server$`.\n\nFirst, install supabase in your Qwik project:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install @supabase/supabase-js supabase-auth-helpers-qwik\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install @supabase/supabase-js supabase-auth-helpers-qwik\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add @supabase/supabase-js supabase-auth-helpers-qwik\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install @supabase/supabase-js supabase-auth-helpers-qwik\n```\n</span>\n</PackageManagerTabs>\n\nThe second step would be to add the `PUBLIC_SUPABASE_URL` and `PUBLIC_SUPABASE_ANON_KEY` environment variables to `.env` file, the \"anon\" key is safe to be exposed in the client-side.\n\n```bash\nPUBLIC_SUPABASE_URL=https://xxxxxxx.supabase.co\nPUBLIC_SUPABASE_ANON_KEY=eyJhb.......\n```\n\nYou should be able to get these values from the Supabase dashboard, create a new `.env.local` file at the root of the project and paste them there.\n\n> Note: It's possible to use Supabase with Qwik completely client-side, however, you would lose some of the performance benefits that you can achieve with leveraging the server. For a working example and code head over to [this repository](https://github.com/hamatoyogi/qwik-supabase-example).\n\n## Server-side\n\nThe Supabase client can now be used server-side - in `routeLoader`s and `routeAction`s - by calling the `createServerClient` function.\n\n```tsx\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { createServerClient } from 'supabase-auth-helpers-qwik';\n\nexport const useDBTest = routeLoader$(async (requestEv) => {\n  const supabaseClient = createServerClient(\n    requestEv.env.get(\"PUBLIC_SUPABASE_URL\")!,\n    requestEv.env.get(\"PUBLIC_SUPABASE_ANON_KEY\")!,\n    requestEv\n  );\n  const { data } = await supabaseClient.from('test').select('*')\n  return { data };\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/tailwind/index.mdx",
    "content": "---\ntitle: Tailwind | Integrations\nkeywords: 'styles, styling'\ncontributors:\n  - manucorporat\n  - leifermendez\n  - reemardelarosa\n  - mhevery\n  - nickclark\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\n  - NickClark\n  - adamdbradley\n  - sreeisalso\n  - maiieul\nupdated_at: '2025-03-08T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Tailwind\n\nTailwind is a CSS framework that provides us with single-purpose utility classes which are\nopinionated for the most part, and which help us design our web pages from right inside our\nmarkup or `.js/.jsx/.ts/.tsx/.mdx` files. [Tailwindcss Website](https://tailwindcss.com/)\n\n> This page contains updated instructions for tailwind v4. If you need to use tailwind v3, you can find the relevant documentation [here](/docs/integrations/tailwind-v3).\n\n## Usage\n\nYou can add Tailwind v4 easily by using the following Qwik starter script:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add tailwind\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add tailwind\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add tailwind\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add tailwind\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command updates your app with the necessary dependencies,\nand modifies the following files\n\n```css title=\"src/global.css\"\n\n@import \"tailwindcss\";\n\n/* ... other css stuff ... */\n\n/* ... to customize tailwind follow guidelines at https://tailwindcss.com/docs/theme ... */\n\n/* Explicitly registering sources */\n/* @source \"../node_modules/@your/ui-lib\"; */\n\n/* Setting your base path */\n/* @import \"tailwindcss\" source(\"../src\"); */\n\n/* Disabling automatic detection of source file */\n/* @import \"tailwindcss\" source(none); */\n\n```\n\n```ts title=\"vite.config.ts\"\nimport { defineConfig , type UserConfig} from 'vite'\nimport tailwindcss from '@tailwindcss/vite'\n// … other imports ...\n\nexport default defineConfig(({ command, mode }): UserConfig => {\n  return {\n    plugins: [\n      tailwindcss(),\n      // ... other plugins ...\n      ]\n    // ... other stuff ...\n    }\n  }\n)\n```"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/tailwind-v3/index.mdx",
    "content": "---\ntitle: Tailwind | Integrations\nkeywords: 'styles, styling'\ncontributors:\n  - manucorporat\n  - leifermendez\n  - reemardelarosa\n  - mhevery\n  - nickclark\n  - igorbabko\n  - Benny-Nottonson\n  - mrhoodz\n  - NickClark\n  - adamdbradley\n  - sreeisalso\n  - maiieul\nupdated_at: '2025-03-08T18:53:23Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Tailwind\nTailwind is a CSS framework that provides us with single-purpose utility classes which are\nopinionated for the most part, and which help us design our web pages from right inside our\nmarkup or `.js/.jsx/.ts/.tsx/.mdx` files. [Tailwindcss Website](https://tailwindcss.com/)\n## Usage\nYou can add Tailwind easily by using the following Qwik starter script:\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add tailwind-v3\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add tailwind-v3\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add tailwind-v3\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add tailwind-v3\n```\n</span>\n</PackageManagerTabs>\n\nThe previous command updates your app with the necessary dependencies.\n\nIt also adds new files to your project folder:\n\n- `postcss.config.js`\n- `tailwind.config.js`\n- `.vscode/settings.json`\n\nand modifies your `src/global.css` to include\n\n```css title=\"src/global.css\"\n\n# global.css file\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n...stuff...\n```"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/tauri/index.mdx",
    "content": "---\ntitle: Tauri | Integrations\nkeywords: tauri\ncontributors:\n  - hamatoyogi\n  - Benny-Nottonson\n  - mrhoodz\nupdated_at: '2023-07-18T17:52:09Z'\ncreated_at: '2023-05-14T08:01:52Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Tauri\n\nTauri is a framework to build desktop applications with any frontend framework and a Rust core.\n\nLearn more on the [Tauri website](https://tauri.app/v1/guides/getting-started/setup/qwik/).\n\n## Adapter\nMake sure you use the [Static Adapter](https://qwik.dev/docs/deployments/static/).\n\nThen you can build your app with \n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run build\n```\n</span>\n</PackageManagerTabs>\n\n## Add Tauri\n\nTo install Tauri:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install @tauri-apps/cli\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install @tauri-apps/cli\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add @tauri-apps/cli\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install @tauri-apps/cli\n```\n</span>\n</PackageManagerTabs>\n\nIn your `package.json`, add this script:\n\n```json title=\"package.json\"\n\"scripts\": {\n  \"tauri\": \"tauri\"\n}\n```\n\nThen, to scaffold a minimal Rust project that is pre-configured to use Tauri, open a terminal and run the following command:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run tauri init\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run tauri init\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run tauri init\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run tauri init\n```\n</span>\n</PackageManagerTabs>\n\nThis command will walk you through a quick setup:\n1. *What is your app name?*\nThis will be the name of your final bundle and what the OS will call your app. You can use any name you want here.\n1. *What should the window title be?*\nThis will be the title of the default main window. You can use any title you want here.\n3. *Where are your web assets (HTML/CSS/JS) located relative to the `<current dir>/src-tauri/tauri.conf.json` file that will be created?*\nThis is the path that Tauri will load your frontend assets from when building for production.\nUse `../dist` for this value.\n4. *What is the URL of your dev server?*\nThis can be either a URL or a file path that Tauri will load during development.\nUse `http://localhost:5173` for this value.\n5. *What is your frontend dev command?*\nThis is the command used to start your frontend dev server.\nUse `dev` command **(make sure to adapt this to use the package manager of your choice)**.\n6. *What is your frontend build command?*\nThis is the command to build your frontend files.\nUse `build` command **(make sure to adapt this to use the package manager of your choice)**.\n\nThat's it! Finally you can run this command to start developing your app:\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run tauri dev\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run tauri dev\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run tauri dev\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run tauri dev\n```\n</span>\n</PackageManagerTabs>\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/turso/index.mdx",
    "content": "---\ntitle: Turso | Integrations\nkeywords: 'turso, libsql, database, edge, sqlite'\ncontributors:\n  - xinnks\n  - A2-NieR\nupdated_at: '2024-04-10T01:34:03Z'\ncreated_at: '2023-07-23T00:17:06Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Turso\n\n[Turso] is the edge database based on [libSQL] - the open-source\nopen-contribution fork of SQLite.\n\nIt enables you to place your data close to your users in over 35 locations\naround the world.\n\n## Usage\n\nYou can easily add Turso by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add turso\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add turso\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add turso\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add turso\n```\n</span>\n</PackageManagerTabs>\n\nThis command will add the necessary dependencies to use Turso.\n\nIt also adds new files inside your project folder:\n\n- `src/lib/turso.ts`\n\nand adds or modifies a `.env.local` file to include\n\n```txt title=\".env.local\"\nPRIVATE_TURSO_DATABASE_URL=\nPRIVATE_TURSO_AUTH_TOKEN=\n```\n\n## Using file databases\n\nFor local development and CI integration, it is ideal to use local database files.\n\nFirst, check if SQLite is installed in your machine by running `sqlite3\n--version`. If you get anything other than a version number (e.g `0-14 20:58:05\n554764a6e721fab307c63a4f98cd958c8428a5d9d8edfde951858d6fd02daapl`), visit [this\nlink for installation instructions].\n\nProceed to create an SQLite file database by running the following command.\n\n```sh\nsqlite3 foo.db\n```\n\nCreate your database schema.\n\n```sh\nsqlite> create table todo (id integer not null, task text, done int default 0);\n```\n\nSeed some data into your table.\n\n```sh\nsqlite> insert into todo(id, task) values(1, \"Go to the gym\");\nsqlite> insert into todo(id, task) values(2, \"Buy groceries\");\n```\n\nQuit the shell `.quit`\n\nThen, assign the database file path to the `PRIVATE_TURSO_DATABASE_URL` environment variable\ninside `.env.local`.\n\n```\nPRIVATE_TURSO_DATABASE_URL=file:foo.db\n```\n\n> ***Note***: A database token is not needed when working with file databases and `createClient` must be imported from `@libsql/client` since importing from `@libsql/client/web` [does not support local file URLs](https://docs.turso.tech/sdk/ts/reference#local-development).\n\n## Using a Turso database\n\nWhen you want to deploy your project to production, you can then [install the\nTurso CLI] to your machine and [create a Turso database].\n\nUse the Turso CLI's `db shell` command to issue queries to your database.\n\n```sh\nturso db shell <database-name>\n```\n\nCreate your database schema.\n\n```sh\n→  create table todo (id integer not null, task text, done int default 0);\n```\n\nSeed some data into your table.\n\n```sh\n→  insert into todo(id, task) values(1, \"Go to the gym\");\n→  insert into todo(id, task) values(2, \"Buy groceries\");\n```\n\nQuit the shell `.quit`\n\nUse the following instructions to obtain your Turso database credentials and\nassign them to the environment variables inside your deployment environment.\n\nStarting with the database url, run the following command.\n\n```sh\nturso db show <database-name> --url\n```\n\nCopy the resulting URL and assign it to the `PRIVATE_TURSO_DATABASE_URL` environment variable.\n\nAnd, for the database authentication token, run the command.\n\n```sh\nturso db tokens create <database-name>\n```\n\nCopy the resulting token and assign it to the `PRIVATE_TURSO_AUTH_TOKEN` environment\nvariable.\n\n## How to use Turso inside Qwik\n\nImport `tursoClient` inside your routes and initiate a database client instance\nwithin Qwik's server-side APIs that expose the `RequestEvent` object, such as\n`routeLoader$()`, `routeAction$()`, `server$()` and endpoint handlers such as\n`onGet`, `onPost`, `onRequest`.\n\n```ts\nimport { tursoClient } from \"~/utils/turso\";\n\nexport const useRouteLoader = routeLoader$(\n  async (requestEvent: RequestEventBase) => {\n    const client = tursoClient(requestEvent);\n\n    const items = await client.execute(\"select * from table\");\n\n    return {\n      items: items.rows,\n    };\n  }\n);\n```\n\nFor more information, please visit the [Turso docs].\n\n[Turso]: https://turso.tech\n[libSQL]: https://turso.tech/libsql\n[this link for installation instructions]: https://sqlite.org/download.html\n[install the Turso CLI]:\n    https://docs.turso.tech/reference/turso-cli#installation\n[create a Turso database]:\n    https://docs.turso.tech/quickstart\n[Turso docs]: https://docs.turso.tech\n"
  },
  {
    "path": "packages/docs/src/routes/docs/integrations/vitest/index.mdx",
    "content": "---\ntitle: Vitest | Integrations\nkeywords: 'testing, unit test, jest'\ncontributors:\n  - manucorporat\n  - reemardelarosa\n  - mhevery\n  - Benny-Nottonson\n  - mrhoodz\n  - adamdbradley\nupdated_at: '2023-07-18T17:51:35Z'\ncreated_at: '2023-04-06T21:28:28Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# Vitest\n\n[Vitest](https://vitest.dev/) is a blazing-fast unit test framework powered by Vite. Because Qwik City uses [Vite](https://vitejs.dev/) by default, Vitest is our defacto unit test framework.\n\n## Usage\n\nYou can add vitest easily by using the following Qwik starter script:\n\n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm run qwik add vitest\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm run qwik add vitest\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn run qwik add vitest\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun run qwik add vitest\n```\n</span>\n</PackageManagerTabs>\n\nAfter running the command, vitest will be installed and a new component will be added to your project. The component will be added to the `src/components/example` directory as well as a new unit test named `example.spec.tsx`.\nIf you are looking for an example for a Component with QwikCity checkout [QwikCityMockProvider](/docs/(qwikcity)/api/index.mdx#qwikcitymockprovider).\n\n```tsx title=\"example.spec.tsx\"\nimport { createDOM } from '@builder.io/qwik/testing';\nimport { test, expect } from 'vitest';\nimport { ExampleTest } from './example';\n\ntest(`[ExampleTest Component]: Should render ⭐`, async () => {\n  const { screen, render } = await createDOM();\n  await render(<ExampleTest flag={true} />);\n  expect(screen.outerHTML).toContain('⭐');\n  const div = screen.querySelector('.icon') as HTMLElement;\n  expect(div.outerHTML).toContain('⭐');\n});\n\ntest(`[ExampleTest Component]: Should render 💣`, async () => {\n  const { screen, render } = await createDOM();\n  await render(<ExampleTest flag={false} />);\n  expect(screen.outerHTML).toContain('💣');\n});\n\ntest(`[ExampleTest Component]: Click counter +1`, async () => {\n  const { screen, render, userEvent } = await createDOM();\n  await render(<ExampleTest flag={true} />);\n\n  expect(screen.outerHTML).toContain('Count:0');\n\n  const spanBefore = screen.querySelector('span') as HTMLDivElement;\n  await userEvent('.btn-counter', 'click');\n  expect(spanBefore.innerHTML).toEqual('Count:1');\n\n  const spanAfter = screen.querySelector('span') as HTMLDivElement;\n  await userEvent('button', 'click');\n  expect(spanAfter.innerHTML).toEqual('Count:2');\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/labs/devtools/index.mdx",
    "content": "---\ntitle: \"\\U0001F9EA Devtools\"\ncontributors:\n  - mhevery\nupdated_at: '2023-10-04T22:54:35Z'\ncreated_at: '2023-10-02T23:27:01Z'\n---\n\n# 🧪 Devtools\n\n**Stage:** `prototyping`\n\nThis will eventually become Devtools for your browser to better debug application. For now it is a collection of utilities to better understand the state of your application.\n\n## `qwik/json`\n\nQwik serializes the state of the application into `<script type=\"qwik/json\">` tag. This allows you to inspect the state of the application by looking at the DOM. Unfortunately the format is not very human readable. These steps describe how to parse the JSON into a more readable format.\n\n1. Open the browser's developer tools.\n2. In the `Console` run this JavaScript\n\n```javascript\nimport(\"https://qwik.dev/devtools/json/\");\n```\n\n3. The script will parse the `qwik/json` and will return a much more human readable format.\n\nMost of the resulting output should be self explanatory. But we provide few high level points here to get you oriented. (This is not meant to be a complete documentation of the output.)\n\n- `objs`: These are the objects in the system which have been serialized.\n- `ctx`: A set of `QContext` objects.\n- `refs`: A set of `QRef` objects.\n- `sub`: A set of `QSubscription` objects.\n- `QContext`: Represents a state which Qwik had to serialize for a given component. This includes `props` for the component as well as a set of `Task` objects which the component may need to execute.\n- `QRef`: If an element has a listener, then a `QRef` collects the listeners as well as any objects which the listener may have captured.\n\nThe way to think about Qwik serialization is that Qwik wants to serialize minimal amount of information. For this reason it only serializes objects which are reachable from either `QContext` or from `QRef`. This means that if you have an object which is not reachable from either of these two, then it will not be serialized. This is a good thing, because it means that Qwik will not serialize the entire application state, but only the state which is reachable from the component which is being rendered.\n\nThe flip side is that if you see an object being serialized and you think it should not be you can trace it backwards to see why it is being serialized. For this purpose all objects include a `__backRef` property which points to the object which is causing any object to be retained. By tracing the objects references back to their roots (which should be `QContext` or `QRef`) we can determine because of which one a particular object is being serialized. Similarly we can see if we can refactor our code to prevent serialization of said object.\n"
  },
  {
    "path": "packages/docs/src/routes/docs/labs/index.mdx",
    "content": "---\ntitle: \"\\U0001F9EA Qwik Labs | Overview\"\ncontributors:\n  - mhevery\n  - Craiqser\n  - mrhoodz\n  - thejackshelton\n  - wmertens\nupdated_at: '2024-09-17T00:00:00Z'\ncreated_at: '2023-06-22T22:13:24Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# 🧪 Qwik Labs Overview\n\nQwik Labs is an incubator for ideas not yet ready for production. It's a place where we can publish our \"work in progress\" so the community can try it out and provide feedback, without any guarantees that the feature is stable or will make it into production. \n\nGiven that these are ideas in their initial stages, chances are they will significantly change over their lifetime, so they should not be relied upon in production. \n\nUSE AT YOUR OWN RISK.\n\n> **DISCLAIMER:** Qwik Labs is a place to experiment, as such:\n> - We make no guarantees about the stability of the API: _we can break it at any point._\n> - It is not ready for production: _we want you to try it and give us feedback so that we can improve._\n> - No guarantees that the feature will ever make it to production: _it can be abandoned at any point._\n>\n> **Expect lots of breaking changes as the features are being developed!!!**\n\n## Stages\n\nEach Qwik Labs feature can roughly be thought of as going through these stages:\n1. `proposal`: An RFC proposal no code yet\n2. `prototyping`: An experimental stage where we explore the API, algorithm and approaches. Missing features, probably not in a usable state.\n3. `implementation`: We know what needs to be built and are going through the built out process.\n4. `alpha`: We think the project is ready to receive feedback from the community. Try it out and let us know what works and what does not.\n5. `beta`: We think the project is ready to graduate to the main repo and be used in production.\n\n## Installation\n\nThere are two ways experimental features are made available to the community:\n\n1. As an `experimental` flag.\n  Some features are distributed under an experimental flag. This means that the feature is already part of the main package but is not enabled by default. To enable the feature you need to set the corresponding flag in the `qwikVite` `experimental[]` array.\n\n2. As a separate node package.\n  Qwik labs are distributed as a separate node package. Because Qwik Labs is \"work in progress\" the node package is not published to NPM but instead as a github URL. The package is continually updated and so it will always contains the latest build. (You may read up on installing node packages [here](https://docs.npmjs.com/cli/v8/commands/npm-install).)\n\n  <PackageManagerTabs>\n  <span q:slot=\"pnpm\">\n  ```shell\n  pnpm install github:QwikDev/qwik-labs-build#main\n  ```\n  </span>\n  <span q:slot=\"npm\">\n  ```shell\n  npm install github:QwikDev/qwik-labs-build#main\n  ```\n  </span>\n  <span q:slot=\"yarn\">\n  ```shell\n  yarn add github:QwikDev/qwik-labs-build#main\n  ```\n  </span>\n  <span q:slot=\"bun\">\n  ```shell\n  bun install github:QwikDev/qwik-labs-build#main\n  ```\n  </span>\n  </PackageManagerTabs>\n\n  Or just add this to your `package.json`\n\n  ```javascript\n  {\n    ...\n    \"dependencies\": {\n      ...\n      \"@builder.io/qwik-labs\": \"github:QwikDev/qwik-labs-build#main\",\n    }\n  }\n  ```\n\n"
  },
  {
    "path": "packages/docs/src/routes/docs/labs/insights/index.mdx",
    "content": "---\ntitle: \"\\U0001F9EA Insights | Qwik Labs\"\ncontributors:\n  - mhevery\n  - gioboa\n  - mrhoodz\n  - thejackshelton\n  - maiieul\nupdated_at: '2025-09-29T22:12:12Z'\ncreated_at: '2023-06-22T22:13:24Z'\n---\n\n# 🧪 Insights \n**Stage:** `prototyping`\n\nInsights allow your application to collect real user usage information to optimize the creation of bundles. By observing real user behavior, the Qwik build system can then do a better job prefetching bundles for your application. There are two benefits of this:\n1. By noticing which symbols are used together, the bundler can colocate the symbols in the same bundle minimizing the waterfall that could occur if there are too many small files needing to be downloaded.\n2. By observing in which order the symbols are used, the prefetcher can then fetch bundles in priority order ensuring that the bundles that are used more often are loaded first.\n\n## Architecture\n\nThe optimization consists of these parts:\n- A `<Insights>` component which collects time based bundle execution data.\n- A `qwikInsights` Vite Plugin to apply the usage data during the build process.\n- A registered application inside the builder.io database.\n\n> Currently Insights info is hosted in the Builder database. This information is about the execution of symbols/chunks in the application.\n> The implementation of the service is open-source and you have the choice to use ours or host your own.\n\n## `<Insights>` component\n\nThe `<Insights>` component should be added to your `root.tsx` file.\n\n```typescript\n// ...\nimport { Insights } from '@builder.io/qwik-labs';\n\nexport default component$(() => {\n  // ...\n  return (\n    <QwikCityProvider>\n      <head>\n        // ...\n        <Insights\n          publicApiKey={import.meta.env.PUBLIC_QWIK_INSIGHTS_KEY}\n        />\n      </head>\n      <body lang=\"en\">\n        // ...\n      </body>\n    </QwikCityProvider>\n  );\n});\n```\n\nYou can get `PUBLIC_QWIK_INSIGHTS_KEY` by visiting [Qwik Insight](https://insights.qwik.dev/app/add/).\n\nThe `<Insights>` component collects this data:\n- Timing information of symbols.\n- The `pathname` part of the URL.\n- Random sessionID which identifies which symbol loads came from the same browser session.\n\n> The `<Insights>` component does not collect any user-identifiable information.\n\nThe data collected being based on the frequency bundles are being grouped together at the same time, it is **not** advised to share the same API key between your preview and production environments. During preview, developers might use the application in 3G throttling and click around, which can put unrelated bundles together. After that the import graph would be wrong, leading to over-preloading, and Insights would then base its future data collection based on those corrupted bundles. If that happened to you, we recommend creating a new API key for your production environment. In normal usage, you will release a new version of your application and there will be a long enough window for Insights to collect the data. In case you face over-preloading in your app, you can always re-create a new API key. Drop us a message in the [Qwik Discord server](https://qwik.dev/chat) if this becomes a recurrent issue for you.\n\n\n## Vite integration\n\nOnce the application is running for a while and it collects sufficient information on symbol usage, the stats can be used to improve the bundles of the future version of the application. This is done by connecting the vite build with Insights like so:\n\nfile: `vite.config.js`\n```typescript\n//..\nimport { defineConfig, loadEnv } from 'vite';\nimport { qwikInsights } from '@builder.io/qwik-labs/vite';\n\nexport default defineConfig(async () => {\n  return {\n    plugins: [\n      qwikInsights({\n        publicApiKey: loadEnv('', '.', '').PUBLIC_QWIK_INSIGHTS_KEY,\n      }),\n      //...\n    ],\n    // ...\n  };\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/labs/typed-routes/index.mdx",
    "content": "---\ntitle: \"\\U0001F9EA Typed Routes\"\ncontributors:\n  - mhevery\n  - RumNCodeDev\nupdated_at: '2023-06-23T23:07:42Z'\ncreated_at: '2023-06-23T23:07:42Z'\n---\n\nimport PackageManagerTabs from '~/components/package-manager-tabs/index.tsx';\n\n# 🧪 Typed Routes\n**Stage:** `prototyping`\n\nProvides type safe way of building URLs within the application.\n\n## Installation\n\n1. \n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm install github:QwikDev/qwik-labs-build#main\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpm install github:QwikDev/qwik-labs-build#main\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn add github:QwikDev/qwik-labs-build#main\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbun install github:QwikDev/qwik-labs-build#main\n```\n</span>\n</PackageManagerTabs>\n\n2. update `vite.config.ts`\n   ```typescript\n   // ...\n   import { qwikTypes } from '@builder.io/qwik-labs/vite';\n\n   export default defineConfig(() => {\n     return {\n       plugins: [\n        // ...\n        qwikTypes() // <== Add `qwikTypes()` to the list of plugins\n       ],\n       // ...\n     };\n   });\n   ```\n3. Run build so that it generates `~/routes.gen.d.ts` and `~/routes.config.tsx` files.\n3. To create a typesafe link:\n   ```typescript\n   import { AppLink } from '~/routes.config';\n\n   export default component$(() => {\n     // ...\n     return (\n       // ...\n       <AppLink route=\"/your/[appParam]/link/\" param:appParam={\"some-value\"}>\n         Link text\n       </AppLink>\n     );\n   });\n   ```\n\n\n# Declarative Routing\nThis is a package originally created by Jack Herrington aka *\"The Blue Collar Coder\"* for type safe routing inside NextJS applications and has been adapted for use inside QwikCity\n\n## Installation\n1. \n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm dlx declarative-routing init\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpx declarative-routing init\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn dlx declarative-routing init\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbunx declarative-routing init\n```\n</span>\n</PackageManagerTabs>\n\n## Setup\nThe initialization process will create some important files for you.\n\n### .src/declarativeRoutes\n- `makeRoute.ts` - Used for defining page routes\n- `index.ts` - Where all of your route files will be imported from.\n- `hooks.ts` - A file with two custom hooks `useParams` & `useSearchParams` used to access type safe route urls, params, and searchParams\n\n### Each of your route directories\n- routeInfo.ts - Where you name the route, and provide a `zod` schema for the `params` and `search` (search params)\n\n## Usage\n\n### Declare Route Details\n```typescript title=\"/src/routes/pokemon/[pokemonId]/routeInfo.ts\"\nimport * as z from \"zod\";\n\nexport const Route = {\n  name: \"PokemonDetail\",\n  params: z.object({\n    pokemonId: z.coerce.number(),\n  }),\n};\n```\n\n### Inside Component\nThere are a few different ways you can use Declarative Routes inside your component.\n\n1. Use *RouteName*.Link\n```typescript title=\"myComponent.tsx\"\nimport { PokemonDetail } from \"~/declarativeRoutes\";\n\nexport default component$(() => {\n  // ...\n  return (\n    // ...\n    <PokemonDetail.Link pokemonId={1}>Bulbasaur</PokemonDetail.Link>\n  );\n});\n```\n\n2. Use the standard Link and use the *RouteName* as a function to return the path\n```typescript title=\"myComponent.tsx\"\nimport { Link } from \"@builder.io/qwik-city\";\nimport { PokemonDetail } from \"~/declarativeRoutes\";\n\nexport default component$(() => {\n  // ...\n  return (\n    // ...\n    <Link href={PokemonDetail({ pokemonId: 1 })}>Bulbasaur</Link>\n  );\n});\n```\n3. Use *RouteName*.ParamsLink\n```typescript title=\"myComponent.tsx\"\nimport { PokemonDetail } from \"~/declarativeRoutes\";\n\nexport default component$(() => {\n  // ...\n  return (\n    // ...\n    <PokemonDetail.ParamsLink params={{ pokemonId: 1 }}>Bulbasaur</PokemonDetail.ParamsLink>\n  );\n});\n```\n4. Get the params from a *RouteName*\n\n```typescript title=\"myComponent.tsx\"\nimport { PokemonDetail } from \"~/declarativeRoutes\";\n\nexport default component$(() => {\n  // Typescript will know the correct params and their types\n  const { pokemonId } = useParams(PokemonDetail);\n  // ...\n  return (\n    // ...\n  );\n});\n```\n\n## Add or Change Routes\nIf you add a new route, or move an existing route, simply run \n\n<PackageManagerTabs>\n<span q:slot=\"pnpm\">\n```shell\npnpm dlx declarative-routing build\n```\n</span>\n<span q:slot=\"npm\">\n```shell\nnpx declarative-routing build\n```\n</span>\n<span q:slot=\"yarn\">\n```shell\nyarn dlx declarative-routing build\n```\n</span>\n<span q:slot=\"bun\">\n```shell\nbunx declarative-routing build\n```\n</span>\n</PackageManagerTabs>\n\nand this will rerun the process and update any changes needed\n\n## Links\n- [GitHub](https://github.com/ProNextJS/declarative-routing)\n- [QwikCity Setup Instructions](https://github.com/ProNextJS/declarative-routing/blob/main/docs/qwikcity.md)\n- [Example Repos](https://github.com/ProNextJS/declarative-routing/tree/main/examples/qwikcity)\n"
  },
  {
    "path": "packages/docs/src/routes/docs/labs/usePreventNavigate/index.mdx",
    "content": "---\ntitle: \"\\U0001F9EA usePreventNavigate | Qwik Labs\"\ndescription: Prevent navigation when your application has unsaved data.\ncontributors:\n  - wmertens\nupdated_at: '2024-09-17T00:00:00Z'\ncreated_at: '2024-09-17T00:00:00Z'\n---\n\nThis feature is **EXPERIMENTAL**. We invite you to try it out and provide feedback via the [RFC issue](https://github.com/QwikDev/qwik-evolution/issues/15).\n\nTo use it, you must add `experimental: ['preventNavigate']` to your `qwikVite` plugin options.\n\n# Preventing navigation\n\nIf the user can lose state by navigating away from the page, you can use `usePreventNavigate(callback)` to conditionally prevent the navigation.\n\nThe callback will be called with the URL that the user is trying to navigate to. If the callback returns `true`, the navigation will be prevented.\n\nYou can return a Promise, and qwik-city will wait until the promise resolves before navigating.\n\nHowever, in some cases the browser will navigate without calling qwik-city, such as when the user reloads the tab or navigates using `<a/>` instead of `<Link />`. When this happens, the answer must be synchronous, and user interaction is not allowed.\n\nYou can tell the difference between qwik-city and browser navigation by looking at the provided URL. If the URL is `undefined`, the browser is navigating away, and you must respond synchronously.\n\nExamples:\n\n- using a modal library:\n\n```tsx\nexport default component$(() => {\n  const okToNavigate = useSignal(true);\n  usePreventNavigate$((url) => {\n    if (!okToNavigate.value) {\n      // we we didn't get a url, the browser is navigating away\n      // and we must respond synchronously without dialogs\n      if (!url) return true;\n\n      // Here we assume that the confirmDialog function shows a modal and returns a promise for the result\n      return confirmDialog(\n        `Do you want to lose changes and go to ${url}?`\n      ).then(answer => !answer);\n      // or simply using the browser confirm dialog:\n      // return !confirm(`Do you want to lose changes and go to ${url}?`);\n    }\n  });\n\n  return (\n    <div>\n      <button onClick$={() => (okToNavigate.value = !okToNavigate.value)}>\n        toggle user state\n      </button>\n      application content\n    </div>\n  );\n});\n```\n\n- Using a separate modal:\n\n```tsx\nexport default component$(() => {\n  const okToNavigate = useSignal(true);\n  const navSig = useSignal<URL | number>();\n  const showConfirm = useSignal(false);\n  const nav = useNavigate();\n  usePreventNavigate$((url) => {\n    if (!okToNavigate.value) {\n      if (url) {\n        navSig.value = url;\n        showConfirm.value = true;\n      }\n      return true;\n    }\n  });\n\n  return (\n    <div>\n      <button onClick$={() => (okToNavigate.value = !okToNavigate.value)}>\n        toggle user state\n      </button>\n      application content\n      {showConfirm.value && (\n        <div>\n          <div>\n            Do you want to lose changes and go to {String(navSig.value)}?\n          </div>\n          <button\n            onClick$={() => {\n              showConfirm.value = false;\n              okToNavigate.value = true;\n              nav(navSig.value!);\n            }}\n          >\n            Yes\n          </button>\n          <button onClick$={() => (showConfirm.value = false)}>No</button>\n        </div>\n      )}\n    </div>\n  );\n});\n```\n"
  },
  {
    "path": "packages/docs/src/routes/docs/layout.tsx",
    "content": "import { component$, Slot, useContext, useStyles$ } from '@builder.io/qwik';\nimport { useContent, useLocation } from '@builder.io/qwik-city';\nimport { ContentNav } from '../../components/content-nav/content-nav';\nimport Contributors from '../../components/contributors';\nimport { Footer } from '../../components/footer/footer';\nimport { Header } from '../../components/header/header';\nimport { OnThisPage } from '../../components/on-this-page/on-this-page';\nimport { createBreadcrumbs, SideBar } from '../../components/sidebar/sidebar';\nimport { GlobalStore } from '../../context';\nimport styles from './docs.css?inline';\n\nexport { useMarkdownItems } from '../../components/sidebar/sidebar';\n\nexport default component$(() => {\n  useStyles$(styles);\n  const loc = useLocation();\n  // hide OnThisPage on docs overview page; only show on sub-pages\n  const hasOnThisPage = loc.url.pathname !== '/docs/';\n  const { menu } = useContent();\n  const globalStore = useContext(GlobalStore);\n  const { url } = useLocation();\n  const breadcrumbs = createBreadcrumbs(menu, url.pathname);\n\n  return (\n    <div class=\"docs fixed-header\">\n      <Header />\n      <nav class=\"breadcrumbs\">\n        <button\n          onClick$={() => (globalStore.sideMenuOpen = !globalStore.sideMenuOpen)}\n          type=\"button\"\n          title=\"Toggle left menu\"\n          aria-label=\"Toggle left menu\"\n        >\n          <span class=\"sr-only\">Navigation</span>\n          <svg width=\"24\" height=\"24\">\n            <path\n              d=\"M5 6h14M5 12h14M5 18h14\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              stroke-width=\"2\"\n              stroke-linecap=\"round\"\n            />\n          </svg>\n        </button>\n        {breadcrumbs.length > 0 ? (\n          <ol>\n            {breadcrumbs.map((b, key) => (\n              <li key={key}>{b.text}</li>\n            ))}\n          </ol>\n        ) : null}\n      </nav>\n      <div class=\"flex gap-12 xl:gap-20 items-stretch content-container\">\n        <SideBar />\n        <main class=\"contents\">\n          <div class=\"docs-container\">\n            <article>\n              <Slot />\n              <Contributors />\n            </article>\n            <ContentNav />\n            <Footer />\n          </div>\n          {hasOnThisPage && <OnThisPage />}\n        </main>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/docs/menu.md",
    "content": "# Qwik Guide\n\n## Introduction\n\n- [Overview](</docs/(qwik)/index.mdx>)\n- [Getting Started](</docs/(qwik)/getting-started/index.mdx>)\n- [Project structure](</docs/(qwikcity)/project-structure/index.mdx>)\n- [FAQ](</docs/(qwik)/faq/index.mdx>)\n\n## Components\n\n- [Overview](</docs/(qwik)/core/overview/index.mdx>)\n- [State](</docs/(qwik)/core/state/index.mdx>)\n- [Events](</docs/(qwik)/core/events/index.mdx>)\n- [Tasks & Lifecycle](</docs/(qwik)/core/tasks/index.mdx>)\n- [Context](</docs/(qwik)/core/context/index.mdx>)\n- [Slots](</docs/(qwik)/core/slots/index.mdx>)\n- [Rendering](</docs/(qwik)/core/rendering/index.mdx>)\n- [Styling](</docs/(qwik)/core/styles/index.mdx>)\n- [API Reference](/api/qwik/)\n\n## Qwik City\n\n- [Overview](</docs/(qwikcity)/qwikcity/index.mdx>)\n- [Routing](</docs/(qwikcity)/routing/index.mdx>)\n- [Pages](</docs/(qwikcity)/pages/index.mdx>)\n- [Layouts](</docs/(qwikcity)/layout/index.mdx>)\n- [Loaders](</docs/(qwikcity)/route-loader/index.mdx>)\n- [Actions](</docs/(qwikcity)/action/index.mdx>)\n- [Validators](</docs/(qwikcity)/validator/index.mdx>)\n- [Endpoints](</docs/(qwikcity)/endpoints/index.mdx>)\n- [Middleware](</docs/(qwikcity)/middleware/index.mdx>)\n- [server$](</docs/(qwikcity)/server$/index.mdx>)\n- [Error handling](</docs/(qwikcity)/error-handling/index.mdx>)\n- [Re-exporting loaders](</docs/(qwikcity)/re-exporting-loaders/index.mdx>)\n- [Caching](</docs/(qwikcity)/caching/index.mdx>)\n- [HTML attributes](</docs/(qwikcity)/html-attributes/index.mdx>)\n- [API reference](</docs/(qwikcity)/api/index.mdx>)\n\n## Cookbook\n\n- [Overview](/docs/cookbook/index.mdx)\n- [Algolia Search](/docs/cookbook/algolia-search/index.mdx)\n- [Combine Handlers](/docs/cookbook/combine-request-handlers/index.mdx)\n- [Debouncer](/docs/cookbook/debouncer/index.mdx)\n- [Fonts](/docs/cookbook/fonts/index.mdx)\n- [Glob Import](/docs/cookbook/glob-import/index.mdx)\n- [Media Controller](/docs/cookbook/mediaController/index.mdx)\n- [NavLink](/docs/cookbook/nav-link/index.mdx)\n- [Node Docker deploy](/docs/cookbook/node-docker-deploy/index.mdx)\n- [Portals](/docs/cookbook/portals/index.mdx)\n- [Streaming loaders](/docs/cookbook/streaming-deferred-loaders/index.mdx)\n- [Sync events w state](/docs/cookbook/sync-events/index.mdx)\n- [Theme Management](/docs/cookbook/theme-management/index.mdx)\n- [Drag & Drop](/docs/cookbook/drag&drop/index.mdx)\n- [View Transition](/docs/cookbook/view-transition/index.mdx)\n- [Detect img tag onLoad](/docs/cookbook/detect-img-tag-onload/index.mdx)\n\n## Integrations\n\n- [Overview](integrations/index.mdx)\n- [Astro](integrations/astro/index.mdx)\n- [Auth.js](integrations/authjs/index.mdx)\n- [Bootstrap](integrations/bootstrap/index.mdx)\n- [Builder.io](integrations/builderio/index.mdx)\n- [Cypress](integrations/cypress/index.mdx)\n- [Drizzle](integrations/drizzle/index.mdx)\n- [i18n](integrations/i18n/index.mdx)\n- [Icons](integrations/icons/index.mdx)\n- [Image Optimization](integrations/image-optimization/index.mdx)\n- [Leaflet Map](integrations/leaflet-map/index.mdx)\n- [Modular Forms](integrations/modular-forms/index.mdx)\n- [Nx Monorepos](integrations/nx/index.mdx)\n- [OG Image](integrations/og-img/index.mdx)\n- [Orama](integrations/orama/index.mdx)\n- [Panda CSS](integrations/panda-css/index.mdx)\n- [Partytown](integrations/partytown/index.mdx)\n- [Playwright](integrations/playwright/index.mdx)\n- [PostCSS](integrations/postcss/index.mdx)\n- [Prisma](integrations/prisma/index.mdx)\n- [React](integrations/react/index.mdx)\n- [Storybook](integrations/storybook/index.mdx)\n- [Styled Vanilla Extract](integrations/styled-vanilla-extract/index.mdx)\n- [Supabase](integrations/supabase/index.mdx)\n- [Tailwind](integrations/tailwind/index.mdx)\n- [Tauri](integrations/tauri/index.mdx)\n- [Turso](integrations/turso/index.mdx)\n- [Vitest](integrations/vitest/index.mdx)\n\n## Deployments\n\n- [Overview](deployments/index.mdx)\n- [Azure SWA](deployments/azure-swa/index.mdx)\n- [AWS](deployments/aws-lambda/index.mdx)\n- [Firebase](deployments/firebase/index.mdx)\n- [Google Cloud Run](deployments/gcp-cloud-run/index.mdx)\n- [Cloudflare Pages](deployments/cloudflare-pages/index.mdx)\n- [Cloudflare Workers](deployments/cloudflare-workers/index.mdx)\n- [Deno](deployments/deno/index.mdx)\n- [Bun](deployments/bun/index.mdx)\n- [Netlify Edge](deployments/netlify-edge/index.mdx)\n- [Node](deployments/node/index.mdx)\n- [Self-Hosting](deployments/self-hosting/index.mdx)\n- [Vercel Edge](deployments/vercel-edge/index.mdx)\n- [Static Site](deployments/static/index.mdx)\n- [GitHub Pages](deployments/github-pages/index.mdx)\n- [Azion](deployments/azion/index.mdx)\n\n## Guides\n\n- [Qwik in a nutshell](</docs/(qwikcity)/guides/qwik-nutshell/index.mdx>)\n- [Markdown & MDX](</docs/(qwikcity)/guides/mdx/index.mdx>)\n- [SSG](</docs/(qwikcity)/guides/static-site-generation/index.mdx>)\n- [Qwik Native Apps](</docs/(qwikcity)/guides/capacitor/index.mdx>)\n- [React Cheat Sheet](</docs/(qwikcity)/guides/react-cheat-sheet/index.mdx>)\n- [Debugging](</docs/(qwikcity)/guides/debugging/index.mdx>)\n- [Best Practices](</docs/(qwikcity)/guides/best-practices/index.mdx>)\n- [Bundle Optimization](</docs/(qwikcity)/guides/bundle/index.mdx>)\n- [Env variables](</docs/(qwikcity)/guides/env-variables/index.mdx>)\n\n## Concepts\n\n- [Think Qwik](</docs/(qwik)/concepts/think-qwik/index.mdx>)\n- [Resumable](</docs/(qwik)/concepts/resumable/index.mdx>)\n- [Progressive](</docs/(qwik)/concepts/progressive/index.mdx>)\n- [Reactivity](</docs/(qwik)/concepts/reactivity/index.mdx>)\n\n## Advanced\n\n- [The $ dollar sign](</docs/(qwik)/advanced/dollar/index.mdx>)\n- [Containers](</docs/(qwik)/advanced/containers/index.mdx>)\n- [QRL](</docs/(qwik)/advanced/qrl/index.mdx>)\n- [Library mode](</docs/(qwik)/advanced/library/index.mdx>)\n- [Qwikloader](</docs/(qwik)/advanced/qwikloader/index.mdx>)\n- [Optimizer](</docs/(qwik)/advanced/optimizer/index.mdx>)\n- [Modules Prefetching](</docs/(qwik)/advanced/modules-prefetching/index.mdx>)\n- [Build Directory](</docs/(qwik)/advanced/custom-build-dir/index.mdx>)\n- [Vite](</docs/(qwik)/advanced/vite/index.mdx>)\n- [Advanced Routing](</docs/(qwikcity)/advanced/routing/index.mdx>)\n- [Qwik Plugins](</docs/(qwikcity)/advanced/plugins/index.mdx>)\n- [Request Handling](</docs/(qwikcity)/advanced/request-handling/index.mdx>)\n- [Speculative Module Fetching](</docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx>)\n- [Menus](</docs/(qwikcity)/advanced/menu/index.mdx>)\n- [Static Assets](</docs/(qwikcity)/advanced/static-assets/index.mdx>)\n- [Sitemaps](</docs/(qwikcity)/advanced/sitemaps/index.mdx>)\n- [ESLint-Rules](</docs/(qwik)/advanced/eslint/index.mdx>)\n- [Content Security Policy](</docs/(qwikcity)/advanced/content-security-policy/index.mdx>)\n- [Complex Forms](</docs/(qwikcity)/advanced/complex-forms/index.mdx>)\n\n## Reference\n\n- [API Reference](/api/)\n- [Deprecated Features](</docs/(qwik)/deprecated-features/index.mdx>)\n\n## Qwik Labs 🧪\n\n- [Overview](/docs/labs/index.mdx)\n- [Insights](/docs/labs/insights/index.mdx)\n- [Typed Routes](/docs/labs/typed-routes/index.mdx)\n- [Devtools](/docs/labs/devtools/index.mdx)\n- [usePreventNavigate](/docs/labs/usePreventNavigate/index.mdx)\n\n## Community\n\n- [GitHub](https://github.com/QwikDev/qwik)\n- [@QwikDev](https://twitter.com/QwikDev)\n- [Discord](https://qwik.dev/chat)\n- [Community Projects](/community/projects/index.mdx)\n- [Values](/community/values/index.mdx)\n"
  },
  {
    "path": "packages/docs/src/routes/examples/[...id]/examples.css",
    "content": ".examples {\n  position: fixed;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n  display: flex;\n  flex-direction: column;\n  overflow: hidden;\n}\n\n.examples-menu-container {\n  display: grid;\n  grid-template-rows: 100%;\n  grid-template-columns: 100vw 100vw;\n  grid-template-areas: 'example-content-panel example-repl-panel';\n  height: 100%;\n  height: calc(100% - var(--header-height) - var(--panel-toggle-height));\n  transform: translate3d(0, 0, 0);\n  transition: transform 500ms;\n}\n\n.examples-panel-input {\n  transform: translate3d(-100vw, 0, 0);\n}\n\n.examples-panel-output {\n  transform: translate3d(-200vw, 0, 0);\n}\n\n.examples-panel-console {\n  transform: translate3d(-300vw, 0, 0);\n}\n\n.examples-repl {\n  grid-area: example-repl-panel;\n  border-color: var(--examples-main-border-color);\n  border-width: 1px;\n  border-top-style: solid;\n  border-top-left-radius: 5px;\n}\n\n.examples .repl {\n  display: grid;\n  grid-template-rows: auto;\n  grid-template-columns: 100vw 100vw 100vw;\n  grid-template-areas: 'repl-input-panel repl-output-panel repl-detail-panel';\n  height: 100%;\n  max-height: 100%;\n}\n\n@media (min-width: 768px) {\n  .examples-repl {\n    overflow: hidden;\n  }\n\n  .examples-menu-container {\n    grid-template-rows: auto;\n    grid-template-columns: minmax(240px, 20%) auto;\n    grid-template-areas: 'example-content-panel example-repl-panel';\n    transform: translate3d(0, 0, 0);\n    transition: none;\n  }\n\n  .examples .repl {\n    grid-template-rows: 1fr 1fr 1fr;\n    grid-template-columns: minmax(auto, 100%);\n    grid-template-areas:\n      'repl-input-panel'\n      'repl-output-panel'\n      'repl-detail-panel';\n  }\n}\n\n@media (min-width: 1200px) {\n  .examples .repl {\n    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);\n    grid-template-columns: minmax(300px, 1.2fr) minmax(0, 1fr);\n    grid-template-areas:\n      'repl-input-panel repl-input-panel'\n      'repl-output-panel repl-detail-panel';\n  }\n}\n\n.examples-menu {\n  grid-area: example-content-panel;\n  position: relative;\n  padding: 20px;\n  overflow-y: auto;\n}\n\n.examples-menu-section {\n  margin: 0 0 20px 0;\n}\n\n.examples-menu-section h2 {\n  font-weight: 700;\n  margin: 0 0 5px 0;\n  color: var(--examples-header-text-color);\n}\n\n.example-button {\n  display: flex;\n  padding: 10px;\n  margin-bottom: 10px;\n  color: var(--examples-header-text-color);\n  text-align: left;\n  border: 1px solid var(--examples-border-color);\n  border-radius: 4px;\n  width: 100%;\n  font-size: 12px;\n}\n\n.example-button-icon {\n  font-size: 30px;\n  width: 38px;\n}\n\n.example-button-content {\n  flex: 1;\n}\n\n.example-button.selected {\n  background: var(--examples-active-bg-color);\n}\n\n.example-button:hover {\n  background: var(--examples-hover-bg-color);\n}\n\n.example-button h3 {\n  font-weight: 700;\n}\n\n.example-button-new {\n  display: block;\n  padding: 10px;\n  margin-bottom: 10px;\n  color: var(--examples-header-text-color);\n  text-align: center;\n  border: 1px solid var(--examples-border-color);\n  border-radius: 5px;\n  width: 100%;\n  font-size: 14px;\n  margin-top: 40px;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/[...id]/index!.tsx",
    "content": "import { component$, useStyles$, useTask$, useStore, useVisibleTask$ } from '@builder.io/qwik';\nimport type { RequestHandler, PathParams, StaticGenerateHandler } from '@builder.io/qwik-city';\nimport { Repl } from '../../../repl/ui';\nimport styles from './examples.css?inline';\nimport { Header } from '../../../components/header/header';\nimport exampleSections, { type ExampleApp } from '@examples-data';\nimport type { ReplAppInput } from '../../../repl/types';\nimport { type DocumentHead, useLocation } from '@builder.io/qwik-city';\nimport { PanelToggle } from '../../../components/panel-toggle/panel-toggle';\nimport { isBrowser } from '@builder.io/qwik';\nimport { createPlaygroundShareUrl, parsePlaygroundShareUrl } from '../../../repl/ui/repl-share-url';\nimport { setReplCorsHeaders } from '~/utils/utils';\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  const panelStore = useStore(() => ({\n    active: 'Input',\n    list: PANELS,\n  }));\n\n  const loc = useLocation();\n  const store = useStore<ExamplesStore>(() => {\n    const app = getExampleApp(loc.params.id);\n    const initStore: ExamplesStore = {\n      appId: app ? app.id : '',\n      buildMode: 'development',\n      entryStrategy: 'segment',\n      files: app?.inputs || [],\n      version: '',\n      shareUrlTmr: undefined,\n    };\n    return initStore;\n  });\n\n  useTask$(({ track }) => {\n    const appId = track(() => store.appId);\n    const app = getExampleApp(appId);\n    if (isBrowser) {\n      const shareData = parsePlaygroundShareUrl(location.hash.slice(1));\n      if (shareData) {\n        store.version = shareData.version;\n        store.buildMode = shareData.buildMode;\n        store.entryStrategy = shareData.entryStrategy;\n        store.files = shareData.files;\n        document.title = `REPL Playground - Qwik`;\n        return;\n      }\n    }\n    store.files = app?.inputs || [];\n    if (typeof document !== 'undefined') {\n      document.title = `${app?.title} - Qwik`;\n    }\n  });\n\n  useVisibleTask$(() => {\n    const shareData = parsePlaygroundShareUrl(location.hash.slice(1));\n    if (shareData) {\n      store.version = shareData.version;\n      store.buildMode = shareData.buildMode;\n      store.entryStrategy = shareData.entryStrategy;\n      store.files = shareData.files;\n      document.title = `REPL Playground - Qwik`;\n      return;\n    }\n  });\n\n  useTask$(({ track }) => {\n    track(() => store.buildMode);\n    track(() => store.entryStrategy);\n    track(() => store.version);\n    track(() => store.files.forEach((f) => f.code));\n\n    if (isBrowser) {\n      if (store.version) {\n        clearTimeout(store.shareUrlTmr);\n\n        store.shareUrlTmr = setTimeout(() => {\n          const shareUrl = createPlaygroundShareUrl(store, location.pathname);\n          history.replaceState({}, '', shareUrl);\n        }, 1000);\n      }\n    }\n  });\n\n  return (\n    <div class=\"examples full-width fixed-header\">\n      <Header />\n\n      <div\n        class={{\n          'examples-menu-container': true,\n          'examples-panel-input': panelStore.active === 'Input',\n          'examples-panel-output': panelStore.active === 'Output',\n          'examples-panel-console': panelStore.active === 'Console',\n        }}\n      >\n        <div class=\"examples-menu\">\n          {exampleSections.map((s) => (\n            <article key={s.id} class=\"examples-menu-section\">\n              <h2>{s.title}</h2>\n\n              {s.apps.map((app) => (\n                <a\n                  key={app.id}\n                  href={`/examples/${app.id}/`}\n                  preventdefault:click\n                  onClick$={() => {\n                    store.appId = app.id;\n                    panelStore.active === 'Input';\n                    history.replaceState({}, '', `/examples/${app.id}/`);\n                  }}\n                  class={{\n                    'example-button': true,\n                    selected: store.appId === app.id,\n                  }}\n                >\n                  <div class=\"example-button-icon\">{app.icon}</div>\n                  <div class=\"example-button-content\">\n                    <h3>{app.title}</h3>\n                    <p>{app.description}</p>\n                  </div>\n                </a>\n              ))}\n            </article>\n          ))}\n          <a\n            href=\"https://github.com/QwikDev/qwik/tree/main/packages/docs/src/routes/examples/apps/\"\n            class=\"example-button-new\"\n            target=\"_blank\"\n          >\n            👏 Add new examples\n          </a>\n        </div>\n\n        <main class=\"examples-repl\">\n          <div class=\"repl\">\n            <Repl input={store} enableDownload={true} />\n          </div>\n        </main>\n      </div>\n      <PanelToggle panelStore={panelStore} />\n    </div>\n  );\n});\n\nexport const getExampleApp = (id: string): ExampleApp | undefined => {\n  if (id.endsWith('/')) {\n    id = id.slice(0, id.length - 1);\n  }\n  for (const exampleSection of exampleSections) {\n    for (const app of exampleSection.apps) {\n      if (app.id === id) {\n        return JSON.parse(JSON.stringify(app));\n      }\n    }\n  }\n};\n\nexport const head: DocumentHead = ({ params }) => {\n  const app = getExampleApp(params.id);\n  return {\n    title: app?.title || 'Example',\n  };\n};\n\nexport const PANELS: ActivePanel[] = ['Examples', 'Input', 'Output', 'Console'];\n\ninterface ExamplesStore extends ReplAppInput {\n  appId: string;\n  shareUrlTmr: any;\n}\n\ntype ActivePanel = 'Examples' | 'Input' | 'Output' | 'Console';\n\nexport const onGet: RequestHandler = ({ cacheControl, headers }) => {\n  cacheControl({\n    public: true,\n    maxAge: 3600,\n  });\n  setReplCorsHeaders(headers);\n};\n\nexport const onStaticGenerate: StaticGenerateHandler = () => {\n  return {\n    params: exampleSections.reduce((params, section) => {\n      section.apps.forEach((app) => {\n        params.push({\n          id: app.id,\n        });\n      });\n      return params;\n    }, [] as PathParams[]),\n  };\n};\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/README.md",
    "content": "# Qwik Examples\n\n## Contribute new examples\n\nThe current folder includes all the examples present in: http://qwik.dev/examples/introduction/hello-world\n\n### 1. Example category\n\nThe first level of folders are the categories. Feel free to add a new root-level folder to create a new category if your new example does not fit one of the existing ones.\n\n### 2. Create a new example folder\n\nThe easiest way to create a new example is copying the `hello-world` folder inside the `introduction` and renaming it with the name of your new app.\n\n```\ncp -r introduction/hello-world introduction/my-new-example\n```\n\n### 3. Add new example metadata\n\nOpen the `examples-menu.json` and add your new example in the right section:\n\n```diff\n[\n  {\n    \"id\": \"introduction\",\n    \"title\": \"Introduction\",\n    \"apps\": [\n      {\n        \"id\": \"hello-world\",\n        \"title\": \"Hello World\",\n        \"description\": \"The simplest Qwik app.\",\n        \"icon\": \"🌎\"\n      },\n+      {\n+        \"id\": \"my-new-example\",\n+        \"title\": \"New demo\",\n+        \"description\": \"Just some text.\",\n+        \"icon\": \"🙊\"\n+      }\n    ]\n  },\n```\n\n### 4. Run fmt\n\nAt the root of the qwik repo, run:\n\n```shell\nyarn\nyarn build\nyarn lint\n```\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/examples-data.ts",
    "content": "import type { ReplModuleInput } from '../../../repl/types';\n\nexport interface ExampleSection {\n  id: string;\n  title: string;\n  apps: ExampleApp[];\n}\n\nexport interface ExampleApp {\n  id: string;\n  title: string;\n  description: string;\n  icon: string;\n  inputs: ReplModuleInput[];\n}\n\n/**\n * Generated at build-time.\n *\n * See packages/docs/src/routes/examples/apps/examples-menu.json\n */\nconst exampleSections: ExampleSection[] = [];\nexport default exampleSections;\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/examples-menu.json",
    "content": "[\n  {\n    \"id\": \"introduction\",\n    \"title\": \"Introduction\",\n    \"apps\": [\n      {\n        \"id\": \"hello-world\",\n        \"title\": \"Hello World\",\n        \"description\": \"The simplest Qwik app.\",\n        \"icon\": \"🌎\"\n      },\n      {\n        \"id\": \"runtime-less\",\n        \"title\": \"Runtime-less\",\n        \"description\": \"An interactive app without runtime.\",\n        \"icon\": \"🪶\"\n      }\n    ]\n  },\n  {\n    \"id\": \"reactivity\",\n    \"title\": \"Reactivity\",\n    \"apps\": [\n      {\n        \"id\": \"task\",\n        \"title\": \"Simple useTask()\",\n        \"description\": \"Learn how to react to changes in variables.\",\n        \"icon\": \"👀\"\n      },\n      {\n        \"id\": \"counter\",\n        \"title\": \"Counter\",\n        \"description\": \"A simple standard counter example.\",\n        \"icon\": \"⏲\"\n      },\n      {\n        \"id\": \"auto-complete\",\n        \"title\": \"Auto-complete\",\n        \"description\": \"Auto-complete searching for Star Wars characters using the SWAPI API\",\n        \"icon\": \"🎬\"\n      }\n    ]\n  },\n  {\n    \"id\": \"visibility\",\n    \"title\": \"Visibility\",\n    \"apps\": [\n      {\n        \"id\": \"clock\",\n        \"title\": \"Below the fold Clock\",\n        \"description\": \"Component which requires lazy initialization when it comes into view.\",\n        \"icon\": \"⏰\"\n      }\n    ]\n  },\n  {\n    \"id\": \"partial\",\n    \"title\": \"Partial\",\n    \"apps\": [\n      {\n        \"id\": \"hackernews-index\",\n        \"title\": \"HackerNews\",\n        \"description\": \"HackerNews landing page.\",\n        \"icon\": \"📰\"\n      }\n    ]\n  }\n]\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/introduction/hello-world/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <p>Hello Qwik</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/introduction/hello-world/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/introduction/hello-world/root.tsx",
    "content": "import App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Hello Qwik</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/introduction/runtime-less/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  console.log('render <App>');\n  return (\n    <article id=\"container\">\n      <button\n        onClick$={() => {\n          // The click handler is completely stateless, and does not use any QWIK api.\n          // Meaning, the qwik runtime is NEVER downloaded, nor executed\n          console.log('click');\n          const div = document.querySelector('#container')! as HTMLElement;\n          if (div.style.background === 'yellow') {\n            div.style.background = 'red';\n          } else {\n            div.style.background = 'yellow';\n          }\n        }}\n      >\n        Action\n      </button>\n    </article>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/introduction/runtime-less/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/introduction/runtime-less/root.tsx",
    "content": "import App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Hello Qwik</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/partial/hackernews-index/app.tsx",
    "content": "import { component$, useTask$, useSignal, useStyles$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik';\nimport HackerNewsCSS from './hacker-news.css?inline';\n\nexport const HackerNews = component$(() => {\n  useStyles$(HackerNewsCSS);\n  const data = useSignal<IStory[]>();\n\n  useTask$(async () => {\n    if (isServer) {\n      const response = await fetch('https://node-hnapi.herokuapp.com/news?page=0');\n      data.value = await response.json();\n    }\n  });\n\n  return (\n    <div class=\"hacker-news\">\n      <Nav />\n      <Stories stories={data.value} />\n    </div>\n  );\n});\n\nexport const Nav = component$(() => {\n  return (\n    <nav>\n      <header class=\"header\">\n        <nav class=\"inner\">\n          <a href=\"/\">\n            <strong>HN</strong>\n          </a>\n          <a href=\"/?type=new\">\n            <strong>New</strong>\n          </a>\n          <a href=\"/?type=show\">\n            <strong>Show</strong>\n          </a>\n          <a href=\"/?type=ask\">\n            <strong>Ask</strong>\n          </a>\n          <a href=\"/?type=job\">\n            <strong>Jobs</strong>\n          </a>\n          <a class=\"github\" href=\"http://github.com/QwikDev/qwik\" target=\"_blank\" rel=\"noreferrer\">\n            Built with Qwik\n          </a>\n        </nav>\n      </header>\n    </nav>\n  );\n});\n\nexport const Stories = component$<{ stories?: IStory[] }>(({ stories }) => {\n  const page = 1;\n  const type = 'list';\n  return (\n    <main class=\"news-view\">\n      <section class=\"news-list-nav\">\n        {page > 1 ? (\n          <a class=\"page-link\" href={`/?type=${type}&page=${page - 1}`} aria-label=\"Previous Page\">\n            {'<'} prev\n          </a>\n        ) : (\n          <span class=\"page-link disabled\" aria-disabled=\"true\">\n            {'<'} prev\n          </span>\n        )}\n        <span>page {page}</span>\n        {stories && stories.length >= 29 ? (\n          <a class=\"page-link\" href={`/?type=${type}&page=${page + 1}`} aria-label=\"Next Page\">\n            more {'>'}\n          </a>\n        ) : (\n          <span class=\"page-link disabled\" aria-disabled=\"true\">\n            more {'>'}\n          </span>\n        )}\n      </section>\n      <article class=\"news-list\">\n        {stories && (\n          <ul>\n            {stories.map((story: IStory) => (\n              <StoryPreview story={story} />\n            ))}\n          </ul>\n        )}\n      </article>\n    </main>\n  );\n});\n\nexport const StoryPreview = component$<{ story: IStory }>((props) => {\n  return (\n    <li class=\"news-item\">\n      <span class=\"score\">{props.story.points}</span>\n      <span class=\"title\">\n        {props.story.url && !props.story.url.startsWith('item?id=') ? (\n          <>\n            <a href={props.story.url} target=\"_blank\" rel=\"noreferrer\">\n              {props.story.title}\n            </a>\n            <span class=\"host\"> ({props.story.domain})</span>\n          </>\n        ) : (\n          <a href={`/item/${props.story.id}`}>{props.story.title}</a>\n        )}\n      </span>\n      <br />\n      <span class=\"meta\">\n        {props.story.type !== 'job' ? (\n          <>\n            by <a href={`/users/${props.story.user}`}>{props.story.user}</a> {props.story.time_ago}{' '}\n            |{' '}\n            <a href={`/stories/${props.story.id}`}>\n              {props.story.comments_count ? `${props.story.comments_count} comments` : 'discuss'}\n            </a>\n          </>\n        ) : (\n          <a href={`/stories/${props.story.id}`}>{props.story.time_ago}</a>\n        )}\n      </span>\n      {props.story.type !== 'link' && (\n        <>\n          {' '}\n          <span class=\"label\">{props.story.type}</span>\n        </>\n      )}\n    </li>\n  );\n});\n\nexport interface IComment {\n  id: string;\n  user: string;\n  time_ago: string;\n  content: string;\n  comments: IComment[];\n}\n\nexport interface IStory {\n  id: string;\n  points: string;\n  url: string;\n  title: string;\n  domain: string;\n  type: string;\n  time_ago: string;\n  user: string;\n  comments_count: number;\n  comments: IComment[];\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/partial/hackernews-index/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/partial/hackernews-index/hacker-news.css",
    "content": ".hacker-news {\n  font-family:\n    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans',\n    'Droid Sans', 'Helvetica Neue', sans-serif;\n  font-size: 15px;\n  background-color: #f2f3f5;\n  margin: 0;\n  padding-top: 55px;\n  color: #34495e;\n  overflow-y: scroll;\n}\na {\n  color: #34495e;\n  text-decoration: none;\n}\n.header {\n  background-color: #335d92;\n  position: fixed;\n  z-index: 999;\n  height: 55px;\n  top: 0;\n  left: 0;\n  right: 0;\n}\n.header .inner {\n  max-width: 800px;\n  box-sizing: border-box;\n  margin: 0 auto;\n  padding: 15px 5px;\n}\n.header a {\n  color: rgba(255, 255, 255, 0.8);\n  line-height: 24px;\n  display: inline-block;\n  vertical-align: middle;\n  font-weight: 300;\n  letter-spacing: 0.075em;\n  margin-right: 1.8em;\n}\n.header a:hover {\n  color: #fff;\n}\n.header a.active {\n  color: #fff;\n  font-weight: 400;\n}\n.header a:nth-child(6) {\n  margin-right: 0;\n}\n.header .github {\n  color: #fff;\n  font-size: 0.9em;\n  margin: 0;\n  float: right;\n}\n.logo {\n  width: 24px;\n  margin-right: 10px;\n  display: inline-block;\n  vertical-align: middle;\n}\n.view {\n  max-width: 800px;\n  margin: 0 auto;\n  position: relative;\n}\n@media (max-width: 860px) {\n  .header .inner {\n    padding: 15px 30px;\n  }\n}\n@media (max-width: 600px) {\n  .header .inner {\n    padding: 15px;\n  }\n  .header a {\n    margin-right: 1em;\n  }\n  .header .github {\n    display: none;\n  }\n}\n.news-view {\n  padding-top: 45px;\n}\n.news-list,\n.news-list-nav {\n  background-color: #fff;\n  border-radius: 2px;\n}\n.news-list-nav {\n  padding: 15px 30px;\n  position: fixed;\n  text-align: center;\n  top: 55px;\n  left: 0;\n  right: 0;\n  z-index: 998;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.news-list-nav .page-link {\n  margin: 0 1em;\n}\n.news-list-nav .disabled {\n  color: #aaa;\n}\n.news-list {\n  position: absolute;\n  margin: 30px 0;\n  width: 100%;\n}\n.news-list ul {\n  list-style-type: none;\n  padding: 0;\n  margin: 0;\n}\n@media (max-width: 600px) {\n  .news-list {\n    margin: 10px 0;\n  }\n}\n.news-item {\n  background-color: #fff;\n  padding: 20px 30px 20px 80px;\n  border-bottom: 1px solid #eee;\n  position: relative;\n  line-height: 20px;\n}\n.news-item .score {\n  color: #335d92;\n  font-size: 1.1em;\n  font-weight: 700;\n  position: absolute;\n  top: 50%;\n  left: 0;\n  width: 80px;\n  text-align: center;\n  margin-top: -10px;\n}\n.news-item .host,\n.news-item .meta {\n  font-size: 0.85em;\n  color: #626262;\n}\n.news-item .host a,\n.news-item .meta a {\n  color: #626262;\n  text-decoration: underline;\n}\n.news-item .host a:hover,\n.news-item .meta a:hover {\n  color: #335d92;\n}\n.item-view-header {\n  background-color: #fff;\n  padding: 1.8em 2em 1em;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.item-view-header h1 {\n  display: inline;\n  font-size: 1.5em;\n  margin: 0;\n  margin-right: 0.5em;\n}\n.item-view-header .host,\n.item-view-header .meta,\n.item-view-header .meta a {\n  color: #626262;\n}\n.item-view-header .meta a {\n  text-decoration: underline;\n}\n.item-view-comments {\n  background-color: #fff;\n  margin-top: 10px;\n  padding: 0 2em 0.5em;\n}\n.item-view-comments-header {\n  margin: 0;\n  font-size: 1.1em;\n  padding: 1em 0;\n  position: relative;\n}\n.item-view-comments-header .spinner {\n  display: inline-block;\n  margin: -15px 0;\n}\n.comment-children {\n  list-style-type: none;\n  padding: 0;\n  margin: 0;\n}\n@media (max-width: 600px) {\n  .item-view-header h1 {\n    font-size: 1.25em;\n  }\n}\n.comment-children .comment-children {\n  margin-left: 1.5em;\n}\n.comment {\n  border-top: 1px solid #eee;\n  position: relative;\n}\n.comment .by,\n.comment .text,\n.comment .toggle {\n  font-size: 0.9em;\n  margin: 1em 0;\n}\n.comment .by {\n  color: #626262;\n}\n.comment .by a {\n  color: #626262;\n  text-decoration: underline;\n}\n.comment .text {\n  overflow-wrap: break-word;\n}\n.comment .text a:hover {\n  color: #335d92;\n}\n.comment .text pre {\n  white-space: pre-wrap;\n}\n.comment .toggle {\n  background-color: #fffbf2;\n  padding: 0.3em 0.5em;\n  border-radius: 4px;\n}\n.comment .toggle a {\n  color: #626262;\n  cursor: pointer;\n}\n.comment .toggle.open {\n  padding: 0;\n  background-color: transparent;\n  margin-bottom: -0.5em;\n}\n.user-view {\n  background-color: #fff;\n  box-sizing: border-box;\n  padding: 2em 3em;\n}\n.user-view h1 {\n  margin: 0;\n  font-size: 1.5em;\n}\n.user-view .meta {\n  list-style-type: none;\n  padding: 0;\n}\n.user-view .label {\n  display: inline-block;\n  min-width: 4em;\n}\n.user-view .about {\n  margin: 1em 0;\n}\n.user-view .links a {\n  text-decoration: underline;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/partial/hackernews-index/root.tsx",
    "content": "import { HackerNews } from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Hacker News</title>\n      </head>\n      <body>\n        <HackerNews />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/auto-complete/app.tsx",
    "content": "import { component$, useStore, useTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <article>\n      This example features an auto-complete component with a debounce of 150 ms.\n      <br />\n      <br />\n      Go ahead, search for Star Wars characters such as \"Luke Skywalker\", it uses the{' '}\n      <a href=\"https://swapi.py4e.com/\">Star Wars API</a>:\n      <br />\n      <br />\n      <AutoComplete></AutoComplete>\n    </article>\n  );\n});\n\ninterface IState {\n  searchInput: string;\n  searchResults: string[];\n  selectedValue: string;\n}\n\nexport const AutoComplete = component$(() => {\n  const state = useStore<IState>({\n    searchInput: '',\n    searchResults: [],\n    selectedValue: '',\n  });\n\n  useTask$(async ({ track }) => {\n    const searchInput = track(() => state.searchInput);\n\n    if (!searchInput) {\n      state.searchResults = [];\n      return;\n    }\n\n    const controller = new AbortController();\n    state.searchResults = await debouncedGetPeople(state.searchInput, controller);\n\n    return () => {\n      controller.abort();\n    };\n  });\n\n  return (\n    <div>\n      <input type=\"text\" onInput$={(ev, el) => (state.searchInput = el.value)} />\n      <SuggestionsListComponent state={state}></SuggestionsListComponent>\n    </div>\n  );\n});\n\nexport const SuggestionsListComponent = (props: { state: IState }) => {\n  const searchResults = props.state.searchResults;\n  return searchResults?.length ? (\n    <ul>\n      {searchResults.map((suggestion) => {\n        return <li onClick$={() => (props.state.selectedValue = suggestion)}>{suggestion}</li>;\n      })}\n    </ul>\n  ) : props.state.searchInput ? (\n    <p class=\"no-results\">\n      <em>No results</em>\n    </p>\n  ) : null;\n};\n\nconst getPeople = (searchInput: string, controller?: AbortController): Promise<string[]> =>\n  fetch(`https://swapi.py4e.com/api/people/?search=${searchInput}`, {\n    signal: controller?.signal,\n  })\n    .then((response) => {\n      return response.json();\n    })\n    .then((parsedResponse) => {\n      return parsedResponse.results.map((people: { name: string }) => people.name);\n    })\n    .catch((e) => console.error('fetch failed', e));\n\nfunction debounce<F extends (...args: any) => any>(fn: F, delay = 500) {\n  let timeoutId: ReturnType<typeof setTimeout>;\n\n  return (...args: Parameters<F>): Promise<ReturnType<F>> => {\n    return new Promise((resolve) => {\n      if (timeoutId) clearTimeout(timeoutId);\n      timeoutId = setTimeout(() => {\n        resolve(fn(...(args as any[])));\n      }, delay);\n    });\n  };\n}\n\nconst debouncedGetPeople = debounce(getPeople, 150);\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/auto-complete/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/auto-complete/root.tsx",
    "content": "import App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Auto-complete example using Qwik</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/counter/app.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <main>\n      <p>Count: {count.value}</p>\n      <p>\n        <button onClick$={() => count.value++}>Click</button>\n      </p>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/counter/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/counter/root.tsx",
    "content": "import App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Counter</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/task/app.tsx",
    "content": "import { component$, useTask$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  const debounced = useSignal(0);\n\n  useTask$(({ track }) => {\n    // track changes in count\n    const value = track(count);\n    console.log('count changed');\n\n    const timer = setTimeout(() => {\n      debounced.value = value;\n    }, 2000);\n    return () => {\n      clearTimeout(timer);\n    };\n  });\n\n  console.log('<App> renders');\n  return (\n    <div>\n      <Child count={count.value} debounced={debounced.value} />\n      <button id=\"add\" onClick$={() => count.value++}>\n        +\n      </button>\n    </div>\n  );\n});\n\nexport const Child = component$((props: { count: number; debounced: number }) => {\n  console.log('<Child> render');\n  return (\n    <div>\n      <div id=\"child\">{props.count}</div>\n      <GrandChild debounced={props.debounced} />\n    </div>\n  );\n});\n\nexport const GrandChild = component$((props: { debounced: number }) => {\n  console.log('<GrandChild> render');\n  return <div id=\"debounced\">Debounced: {props.debounced}</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/task/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/reactivity/task/root.tsx",
    "content": "import App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Hello Qwik</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/visibility/clock/app.tsx",
    "content": "import { component$, useStore, useStyles$, useVisibleTask$ } from '@builder.io/qwik';\nimport styles from './clock.css?inline';\n\nexport default component$(() => {\n  const items = new Array(60).fill(null).map((_, index) => 'item ' + index);\n\n  console.log('PARENT');\n  return (\n    <div>\n      <p onClick$={() => console.log('test')}>\n        This is an example of Lazy executing code on component when component becomes visible.\n      </p>\n\n      <p>\n        ⬇️ <strong>Scroll down</strong> until the clock is in view.\n      </p>\n\n      <ul>\n        {items.map((i) => (\n          <li>{i}</li>\n        ))}\n      </ul>\n\n      <Clock />\n    </div>\n  );\n});\n\nexport const Clock = component$(() => {\n  useStyles$(styles);\n\n  const store = useStore({\n    hour: 0,\n    minute: 0,\n    second: 0,\n  });\n\n  useVisibleTask$(() => {\n    const update = () => {\n      const now = new Date();\n      store.second = now.getSeconds() * (360 / 60);\n      store.minute = now.getMinutes() * (360 / 60);\n      store.hour = now.getHours() * (360 / 12);\n    };\n    update();\n    const tmrId = setInterval(update, 1000);\n    return () => clearInterval(tmrId);\n  });\n\n  console.log('Render Clock');\n  return (\n    <div class=\"clock\">\n      <div class=\"twelve\"></div>\n      <div class=\"three\"></div>\n      <div class=\"six\"></div>\n      <div class=\"nine\"></div>\n      <div class=\"hour\" style={{ transform: `rotate(${store.hour}deg)` }}></div>\n      <div class=\"minute\" style={{ transform: `rotate(${store.minute}deg)` }}></div>\n      <div class=\"second\" style={{ transform: `rotate(${store.second}deg)` }}></div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/visibility/clock/clock.css",
    "content": "/* Clock inspired by: https://paulund.co.uk/create-a-clock-in-css */\n\n.clock {\n  background: #fff;\n  border: 10px solid #7a7a7a;\n  border-radius: 50%;\n  box-sizing: border-box;\n  height: 300px;\n  margin: 0 auto;\n  position: relative;\n  width: 300px;\n}\n\n.twelve,\n.three,\n.six,\n.nine {\n  background: #333;\n  position: absolute;\n}\n\n.twelve,\n.six {\n  height: 10px;\n  width: 4px;\n}\n\n.three,\n.nine {\n  height: 4px;\n  width: 10px;\n}\n\n.twelve {\n  left: 50%;\n  top: -1px;\n}\n\n.three {\n  right: -1px;\n  top: 50%;\n}\n\n.six {\n  left: 50%;\n  bottom: -1px;\n}\n\n.nine {\n  left: -1px;\n  top: 50%;\n}\n\n.hour {\n  height: 60px;\n  width: 4px;\n  background: #333;\n  position: absolute;\n  left: 50%;\n  top: 80px;\n  animation: tick 43200s infinite linear;\n  -webkit-animation: tick 43200s infinite linear;\n}\n\n.minute {\n  height: 100px;\n  width: 4px;\n  background: #777;\n  position: absolute;\n  left: 50%;\n  top: 40px;\n  animation: tick 3600s infinite linear;\n  -webkit-animation: tick 3600s infinite linear;\n}\n\n.second {\n  height: 120px;\n  width: 3px;\n  background: #fc0505;\n  position: absolute;\n  left: 50%;\n  top: 20px;\n  animation: tick 60s infinite linear;\n  -webkit-animation: tick 60s infinite linear;\n}\n\n.hour,\n.minute,\n.second {\n  transform-origin: 2px 100%;\n  -webkit-transform-origin: 2px 100%;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/visibility/clock/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/examples/apps/visibility/clock/root.tsx",
    "content": "import App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Clock</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { type DocumentHead } from '@builder.io/qwik-city';\nimport { Footer } from '../components/footer/footer';\nimport { Header } from '../components/header/header';\n\n// Copy of the builder content, excluding assets which are still being served\nconst builderContent = `<!--cq--><div q:container=\"paused\" q:version=\"0.100.0\" q:render=\"ssr-dev\" q:base=\"/builder/\" class=\"qc📦\"><div builder-content-id=\"97a3ddc814674f85b6ef0d82dc2b6eb1\"><style>/*\n* Custom CSS styles\n*\n* Global by default, but use \\`&amp;\\` to scope to just this content, e.g.\n*\n*   &amp; .foo {\n*     color: 'red'\n*   }\n*/\n\nmain{\n    overflow-x: hidden!important;\n}\n\nheader{\n    -webkit-backdrop-filter: blur(23px) saturate(1) !important;\n    backdrop-filter: blur(23px) saturate(1) !important;\n}</style><!--qv q:id=0 q:key=Comp:--><style q:style=\"ia6tq1-1\" hidden=\"\">.catfy1{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;padding-left:0px;padding-top:0px;width:100vw;margin-left:calc(50% - 50vw)}.c3v64af{display:flex;flex-direction:row;position:absolute;flex-shrink:0;box-sizing:border-box;bottom:7px;z-index:5;width:100%;align-self:stretch;gap:25px;justify-content:center}.chye5ds{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;height:100%;width:300px;z-index:1;background:linear-gradient(90deg, #151934 0%, rgba(0,0,0,0) 100%);left:0px;cursor:pointer}.cglm7wr{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;height:100%;width:300px;z-index:1;right:0px;cursor:pointer}.cbmbzxo{display:flex;flex-direction:row;position:relative;flex-shrink:0;box-sizing:border-box;gap:40px;padding-left:0px;scroll-snap-type:x mandatory;justify-content:flex-start;scroll-behavior:smooth;overflow-y:visible;overflow-x:scroll;padding-top:90px;padding-bottom:90px;align-items:flex-start}.cv1pw7l{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;background-color:rgba(255, 255, 255, 0.17);width:35px;max-width:35px;border-radius:100%;height:35px;justify-content:center;align-items:center;border-style:solid;border-width:1px;border-color:rgba(255, 255, 255, 0.34);cursor:pointer}.cxiz55v{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:350px;width:19vw;border-radius:8px;border-style:solid;overflow:hidden;scroll-snap-align:center}.c38x0cp{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:350px;width:15vw;border-radius:8px;border-style:solid;overflow:hidden;scroll-snap-align:center}.clcdmxz{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;min-height:18px;min-width:10px;overflow:hidden;max-width:10px;margin-right:3px}.cm0gcj3{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;min-height:18px;min-width:10px;overflow:hidden;max-width:10px;margin-left:2px}.c9sroqn{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:auto;width:350px;scroll-snap-align:center;transform:scale(1) translateY(0);direction:ltr;align-self:center;cursor:pointer;pointer-events:auto}.ci29ryq{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;padding-left:5px;padding-top:5px;padding-bottom:5px;padding-right:5px;background:linear-gradient(0deg, rgba(24,182,246,1) 0%, rgba(172,127,244,1) 100%);border-radius:16px}.cpdwgtw{display:flex;flex-direction:row;position:relative;flex-shrink:0;box-sizing:border-box;gap:6px;margin-top:17px}.clabz1x{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:12px;line-height:normal;height:auto;font-family:\"Poppins\", sans-serif;color:rgba(255, 255, 255, 1);font-weight:600;font-size:1rem}.cajg5b6{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;min-height:190px;min-width:20px;border-style:none;border-width:1px;border-radius:11px;overflow:hidden}.crhhdt{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;min-height:20px;min-width:20px;overflow:hidden;max-width:30px;height:30px}.cif4mvp{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;line-height:normal;height:auto;color:rgba(255, 255, 255, 0.35);font-family:\"Poppins\", sans-serif;font-size:17px;font-weight:500;width:auto;align-self:center;margin-right:auto;margin-left:5px}.c43zgy5{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:auto;background:linear-gradient(315deg, rgba(172,126,244,0.5970763305322129) 0%, rgba(172,126,244,0) 90%);flex-grow:1}.cppa4w7{display:flex;flex-direction:row;position:absolute;flex-shrink:0;box-sizing:border-box;bottom:9px;z-index:5;width:100%;align-self:stretch;gap:25px;justify-content:center}.c8kb54b{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;height:100%;width:300px;z-index:4;left:0px;cursor:pointer}.c3bwmck{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;height:100%;width:300px;z-index:4;background:linear-gradient(90deg, rgba(0,0,0,0) 0%, #151934 100%);right:0px;cursor:pointer}.clwho8x{display:flex;flex-direction:row;position:relative;flex-shrink:0;box-sizing:border-box;gap:40px;padding-left:0px;scroll-snap-type:x mandatory;justify-content:flex-start;scroll-behavior:smooth;overflow-y:visible;overflow-x:scroll;padding-top:90px;padding-bottom:90px}.c3y3i5e{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:350px;width:18vw;border-radius:8px;border-style:solid;overflow:hidden;scroll-snap-align:center}.cy3wjif{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:auto;width:650px;scroll-snap-align:center;transform:scale(1) translateY(0);direction:ltr;align-self:center;pointer-events:auto;border-style:solid;cursor:pointer}.cxw2f6r{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;width:200px;align-self:center;height:200px;top:-54px}.c6307wf{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;min-height:400px;min-width:20px;border-style:solid;border-width:1px;border-radius:11px;overflow:hidden}.cxyrqhw{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:12px;line-height:normal;height:auto;font-family:\"Poppins\", sans-serif;color:rgba(255, 255, 255, 1);font-weight:600;font-size:1.25rem}.clzvnrc{display:flex;flex-direction:column;flex-shrink:0;box-sizing:border-box;margin-top:0px;width:100px;height:100px;transform:rotate(-90deg);margin-left:auto;margin-right:auto;z-index:5}.cy8hub5{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;margin-left:auto;width:auto;height:auto;line-height:normal;color:rgba(255, 255, 255, 1);z-index:6;top:36px;bottom:0px;margin-top:0px;margin-bottom:auto;margin-right:auto;align-self:center;flex-grow:0;font-family:\"Poppins\", sans-serif;font-size:20px;padding-left:3px}.cxdh6gf{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:80px;width:100%}.cgit9t0{display:flex}.civv4i9{display:flex;flex-direction:column;align-items:stretch;line-height:normal;width:calc(41.667% - 10px);margin-left:0px}.cbe2pk1{display:flex;flex-direction:column;align-items:stretch;line-height:normal;width:calc(58.333% - 10px);margin-left:20px}.cjjpbna{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:auto;align-self:center;height:auto;flex-grow:1;justify-content:flex-start;gap:20px}.cxmqbja{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;line-height:normal;height:auto;color:#18b6f6;font-size:40px;letter-spacing:normal;cursor:pointer}.cq489v6{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;align-items:center;opacity:1;width:auto;align-self:center}.c826kto{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;width:100%;min-height:20px;min-width:20px;overflow:hidden;max-width:500px;margin-right:auto;margin-bottom:20px}.c89a57i{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:auto;align-self:center;margin-right:auto;margin-top:0px}.cqwe493{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-bottom:0px;padding-left:0px;margin-left:auto;margin-right:auto}.ccj5ok3{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;line-height:normal;height:auto;font-family:\"Poppins\", sans-serif;color:rgba(255, 255, 255, 1);width:100%;max-width:500px;font-size:1.2rem;font-weight:400;margin-top:22px}.cimr38a{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:40px;appearance:none;padding-top:15px;padding-bottom:15px;padding-left:35px;padding-right:35px;background-color:#ac7ef4;color:white;border-radius:8px;text-align:center;cursor:pointer;width:auto;align-self:center;margin-right:auto;font-family:\"Poppins\", sans-serif;line-height:16px}.cbqfu4{display:flex;flex-direction:row;position:relative;flex-shrink:0;box-sizing:border-box;margin-left:0px;width:auto;background-color:#ac7ef4;border-radius:8px;justify-content:center;align-items:center;font-family:\"PT Mono\", monospace;padding-left:25px;padding-right:25px;flex-grow:0;height:auto;align-self:center;padding-top:14px;padding-bottom:14px;cursor:pointer;user-select:none}.c4vuk63{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-left:0;line-height:24px;height:auto;text-align:center;color:rgba(255, 255, 255, 1);font-family:\"Poppins\", sans-serif;font-size:16px;font-weight:500}.ctu4sjl{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100vw;margin-left:calc(50% - 50vw)}.crsftpb{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;padding-left:0px;padding-right:0px;padding-top:80px;padding-bottom:80px;min-height:100px;width:100vw;margin-left:calc(50% - 50vw);background-color:rgba(21, 25, 52, 1);overflow-x:hidden}.cbyhsc7{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%}.c5zm5x3{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;padding-left:20px;padding-right:20px;padding-top:80px;padding-bottom:80px;min-height:100px;background-color:rgba(151, 106, 226, 1);width:100vw;margin-left:calc(50% - 50vw);overflow-x:hidden}.ckuu05i{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;min-height:200px;justify-content:center;align-items:center;padding-top:103px;padding-bottom:158px;font-family:\"Poppins\", sans-serif;margin-left:calc(50% - 50vw);width:100vw;padding-left:20px;padding-right:20px;background-color:rgba(21, 25, 52, 1);margin-bottom:80px;overflow:hidden}.c4gtc7w{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;width:100%;z-index:5;height:auto;flex-grow:1;top:-394px;pointer-events:none}.cbi9n1m{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;width:auto;z-index:10;right:-414px;align-self:center;bottom:-141px;pointer-events:none}.cz2hbr1{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:80px;min-height:100px;width:100vw;margin-left:calc(50% - 50vw);background-color:rgba(21, 25, 52, 1)}.cru0mak{width:100%;align-self:stretch;flex-grow:1;box-sizing:border-box;max-width:1500px;display:flex;flex-direction:column;align-items:stretch;margin-left:auto;margin-right:auto}.c2w82zc{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;z-index:1;right:0px;left:-500px;pointer-events:none}.cjb0iko{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;padding-left:20px;padding-right:20px;padding-top:80px;padding-bottom:143px;min-height:100px;width:100vw;margin-left:calc(50% - 50vw);background-color:rgba(21, 25, 52, 1);overflow-x:hidden}.cc9njxf{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;z-index:1;right:0px;top:0;user-select:none;pointer-events:none}.cb4380l{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;padding-left:20px;padding-bottom:80px;width:100vw;margin-left:calc(50% - 50vw);background-color:rgba(21, 25, 52, 1);padding-top:80px;padding-right:20px;overflow:hidden;overflow-x:hidden}.cz5wnof{width:100%;align-self:stretch;flex-grow:1;box-sizing:border-box;max-width:1200px;display:flex;flex-direction:column;align-items:stretch;margin-left:auto;margin-right:auto}.cesokp7{display:flex;flex-direction:row;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;justify-content:center}.cb2hg7a{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;max-width:1500px;margin-left:auto;margin-right:auto}.cvpg2gy{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;appearance:none;padding-top:15px;padding-bottom:15px;padding-left:35px;padding-right:35px;background-color:rgba(0, 0, 0, 1);color:white;border-radius:8px;text-align:center;cursor:pointer;width:auto;align-self:center;margin-right:auto;font-family:\"Poppins\", sans-serif;margin-left:auto}.cw2t6dh{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;margin-top:20px;pointer-events:none}.cq5wyut{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:10px;line-height:normal;height:auto;text-align:center;font-family:\"Poppins\", sans-serif;font-size:12px;font-weight:400;letter-spacing:-0.03em;color:rgba(255, 255, 255, 1)}.ckd59h7{display:flex;flex-direction:row;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;width:100%;justify-content:center}.cil28rr{display:flex;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:50px;width:100%;padding-bottom:0px;justify-content:center;align-items:flex-start;max-width:1200px;padding-left:10vw;padding-right:10vw;margin-left:auto;margin-right:auto;gap:25px}.cc48rqn{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;width:100%;min-height:20px;min-width:20px;overflow:hidden;margin-bottom:-66px;max-width:1500px;margin-left:auto;margin-right:auto;z-index:5}.cutecbd{display:none;flex-direction:column;align-items:stretch;flex-shrink:0;position:relative;text-align:center;line-height:100px;height:auto;font-size:4rem;font-family:\"Poppins\", sans-serif;font-weight:800;margin-left:auto;margin-right:auto;color:rgba(255, 255, 255, 1);margin-top:-15px}.cpab73l{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100vw;margin-left:calc(50% - 50vw);z-index:6}.csx8e6u{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;appearance:none;padding-top:15px;padding-bottom:15px;padding-left:35px;padding-right:35px;background-color:#31adf6;color:white;border-radius:8px;text-align:center;cursor:pointer;width:auto;align-self:center;font-family:\"Poppins\", sans-serif}.chctn0k{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;width:100%;max-width:1500px;margin-right:-150px}.c8tohge{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;width:100%;max-width:1500px;margin-left:auto;margin-right:auto;z-index:2}.cq9msr8{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;align-items:center;padding-top:40px;padding-bottom:40px;margin-left:auto;margin-right:auto}.cwzwhir{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;line-height:2rem;height:auto;color:rgba(255, 255, 255, 1);font-family:\"Poppins\", sans-serif;font-size:1.2rem;text-align:center;width:100%;max-width:834px;margin-left:auto;margin-right:auto}.c291zym{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;line-height:normal;height:auto;text-align:center;color:rgba(255, 255, 255, 1);font-family:\"Poppins\", sans-serif;font-weight:600;font-size:4rem}.czfbrjk{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;width:100vw;margin-left:calc(50% - 50vw);z-index:2}.c22yjwp{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:40px;appearance:none;padding-top:15px;padding-bottom:15px;padding-left:35px;padding-right:35px;background-color:#ac7ff4;color:white;border-radius:8px;text-align:center;cursor:pointer;width:auto;align-self:center;font-family:\"Poppins\", sans-serif;line-height:14px}.cejtg8r{text-align:center;font-family:\"Poppins\", sans-serif;font-size:4rem;line-height:4rem;color:rgba(255, 255, 255, 1);font-weight:600}.caqnx8q{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;line-height:normal;height:auto;color:rgba(255, 255, 255, 1);font-family:\"Poppins\", sans-serif;font-weight:500;font-size:4rem;width:auto;align-self:center;margin-right:auto;text-align:center;margin-left:auto}.cpck7nd{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:-13px;line-height:normal;height:auto;color:rgba(255, 255, 255, 1);font-family:\"Poppins\", sans-serif;font-weight:700;font-size:4rem;width:auto;align-self:center;margin-right:auto;text-align:center;margin-left:auto}.cfsrkk{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;height:300px;padding-bottom:30px;justify-content:center;align-items:center;pointer-events:auto;width:270px;padding-left:23px;padding-right:23px}.c5ajw3g{display:flex;flex-direction:column;align-items:stretch;line-height:normal;width:calc(50% - 10px);margin-left:0px}.cvbh6ms{display:flex;flex-direction:column;align-items:stretch;line-height:normal;width:calc(50% - 10px);margin-left:20px}.c3zlzea{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;padding-left:5px;padding-top:5px;padding-bottom:5px;padding-right:5px;height:auto;flex-grow:0;background:linear-gradient(180deg, rgba(172,126,244,1) 0%, rgba(24,182,246,1) 100%);border-radius:100%}.c3r3fny{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;line-height:24px;height:auto;text-align:center;font-family:\"Poppins\", sans-serif;font-size:22px;letter-spacing:-0.03em;font-weight:500;color:rgba(255, 255, 255, 1)}.c29wu29{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;align-items:center;background-color:rgba(255, 255, 255, 1);padding-left:25px;align-self:stretch;padding-top:120px;padding-right:46px;padding-bottom:120px;height:auto;justify-content:center;border-radius:17px}.cn72jgl{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:auto;flex-grow:1;justify-content:center;margin-left:-150px;width:100%;align-self:center;align-items:flex-start}.cvsfwqr{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;width:100%;min-height:20px;min-width:20px;overflow:hidden;max-width:450px;margin-left:auto;margin-right:auto}.c9jm9xk{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:auto;flex-grow:1;justify-content:center}.c9cxwka{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;min-height:20px;min-width:20px;overflow:hidden;border-width:6px;border-radius:50%;border-style:none}.cpiyxct{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box}.cdzvxuk{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;width:100%;min-height:20px;min-width:20px;overflow:hidden;max-width:568px;border-radius:16px}.cebp9uz{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;line-height:normal;height:auto;color:rgba(255, 255, 255, 1);font-family:\"Poppins\", sans-serif;font-weight:500;font-size:4rem;width:auto;align-self:center;margin-right:auto}.cyg2lfn{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;line-height:2.2rem;height:auto;color:rgba(255, 255, 255, 1);font-family:\"Poppins\", sans-serif;font-size:1.2rem}.cp6yem6{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;align-items:flex-start}.cofhjo1{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;line-height:normal;height:auto;font-family:\"Poppins\", sans-serif;color:#151934;max-width:375px;margin-top:14px;font-size:1.2rem}.c4kg5g5{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;appearance:none;padding-top:15px;padding-bottom:15px;padding-left:35px;padding-right:35px;background-color:#18b6f6;color:white;border-radius:8px;text-align:center;cursor:pointer;width:auto;align-self:center;margin-right:auto;font-family:\"Poppins\", sans-serif}.c2uxpvp{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;line-height:3rem;height:auto;color:rgba(21, 25, 52, 0.41);font-family:\"Poppins\", sans-serif;font-weight:500;font-size:3em;width:auto;align-self:center;margin-right:auto}.cojle64{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;line-height:3rem;height:auto;color:#151934;font-family:\"Poppins\", sans-serif;font-weight:700;font-size:3em;width:auto;align-self:center;margin-right:auto}.c563s06{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;height:0px}.cjecm0y{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100vw;overflow-x:hidden;margin-left:calc(50% - 50vw);overflow-y:hidden}.ctw21he{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;padding-left:20px;padding-right:20px;padding-top:250px;padding-bottom:2px;min-height:600px;width:100vw;margin-left:calc(50% - 50vw);background-color:rgba(21, 25, 52, 1)}.c45w5f1{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;padding-left:20px;padding-right:20px;padding-top:112px;padding-bottom:200px;min-height:100px;width:100vw;margin-left:calc(50% - 50vw);font-weight:600;background-color:#151934}.crcj3rl{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-left:calc(50% - 50vw);width:100vw;padding-left:20px;padding-right:20px;min-height:300vh}.ch99mph{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;margin-top:0px;bottom:-155px;left:10vw;z-index:1;pointer-events:none}.coxpa3x{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;margin-top:0px;top:0;bottom:0px;right:0;z-index:1;pointer-events:none}.cgauwxb{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0px;height:auto;padding-bottom:86px;margin-bottom:auto;z-index:2}.ciyolil{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:0;padding-bottom:0px;z-index:2;pointer-events:auto;width:100vw;margin-left:calc(50% - 50vw);border-style:solid;border-color:rgba(229, 231, 235, 0.38);border-top-width:1px;border-bottom-width:1px;color:white}.c4vpawm{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;margin-top:20px;width:100vw;z-index:1;pointer-events:none}.cd7htz{display:flex;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;margin-top:20px;right:500px;top:-372px;width:auto;align-self:stretch;max-width:500px;height:auto;flex-grow:1;pointer-events:none}.cfs4wgq{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;width:100%;max-width:1500px;margin-left:auto;margin-right:auto;z-index:2}.cr2pr57{display:flex;flex-direction:column;align-items:stretch;flex-shrink:0;position:relative;text-align:center;line-height:90px;height:auto;font-size:5rem;letter-spacing:-0.03em;font-family:\"Poppins\", sans-serif;font-weight:600;max-width:620px;margin-left:auto;margin-right:auto;color:rgba(255, 255, 255, 1)}.cq8sxte{display:flex;flex-direction:column;align-items:stretch;flex-shrink:0;position:relative;margin-top:32px;text-align:center;line-height:36px;height:auto;font-size:24px;font-family:\"Poppins\", sans-serif;letter-spacing:-0.03em;max-width:400px;margin-left:auto;margin-right:auto;color:rgba(255, 255, 255, 1)}.cxej5b{display:flex;flex-direction:row;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:45px;padding-bottom:0px;margin-left:auto;margin-right:auto}.cmllev5{display:flex;flex-direction:column;align-items:stretch;flex-shrink:0;position:relative;text-align:center;line-height:100px;height:auto;font-size:4rem;letter-spacing:-0.03em;font-family:\"Poppins\", sans-serif;font-weight:400;margin-left:auto;margin-right:auto;color:rgba(255, 255, 255, 1)}.c5xp37i{display:flex;flex-direction:column;align-items:stretch;flex-shrink:0;position:relative;text-align:center;line-height:100px;height:auto;font-size:4rem;font-family:\"Poppins\", sans-serif;font-weight:800;margin-left:auto;margin-right:auto;color:rgba(255, 255, 255, 1);margin-top:-15px}.c49nxnj{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;margin-top:20px;z-index:2;margin-left:auto;margin-right:auto;width:100%;max-width:1200px}.ctgvkfs{display:flex;flex-direction:column;position:relative;flex-shrink:0;box-sizing:border-box;appearance:none;padding-top:14px;padding-bottom:14px;padding-left:25px;padding-right:25px;color:rgba(255, 255, 255, 1);border-radius:8px;text-align:center;cursor:pointer;width:auto;align-self:center;border-color:rgba(1, 185, 255, 1);margin-left:20px;font-family:\"Poppins\", sans-serif;font-size:16px;background-color:rgba(29, 32, 35, 1);font-weight:500;line-height:24px}.cn1brfp{display:none;flex-direction:column;position:absolute;flex-shrink:0;box-sizing:border-box;margin-left:auto;width:100%;min-height:20px;min-width:20px;overflow:hidden;max-width:200px;margin-right:auto;left:0px;right:0px;top:81px}@media (max-width: 991px){.c3v64af{bottom:7px}}@media (max-width: 991px){.chye5ds{width:150px;display:flex}}@media (max-width: 640px){.chye5ds{height:236px;width:50px;display:none}}@media (max-width: 991px){.cglm7wr{width:150px;display:flex}}@media (max-width: 640px){.cglm7wr{height:236px;width:50px;display:none}}@media (max-width: 640px){.cbmbzxo{gap:20px;padding-bottom:145px}}@media (max-width: 991px){.cxiz55v{display:flex;width:120px;height:280px}}@media (max-width: 640px){.cxiz55v{display:flex;height:220px;width:5px}}@media (max-width: 991px){.c38x0cp{width:75px;height:280px}}@media (max-width: 640px){.c38x0cp{width:7vw;height:220px}}@media (max-width: 991px){.clcdmxz{margin-right:2px}}@media (max-width: 991px){.cm0gcj3{margin-left:3px}}@media (max-width: 991px){.c9sroqn{width:333px;height:280px}}@media (max-width: 640px){.c9sroqn{width:300px;height:221px}}@media (max-width: 991px){.cajg5b6{min-height:183px}}@media (max-width: 640px){.cajg5b6{min-height:164px}}@media (max-width: 991px){.cppa4w7{bottom:7px}}@media (max-width: 991px){.c8kb54b{width:150px;display:flex}}@media (max-width: 640px){.c8kb54b{height:236px;width:50px;display:none}}@media (max-width: 991px){.c3bwmck{width:150px;display:flex}}@media (max-width: 640px){.c3bwmck{height:236px;width:50px;display:none}}@media (max-width: 991px){.clwho8x{padding-bottom:140px}}@media (max-width: 640px){.clwho8x{gap:20px}}@media (max-width: 991px){.c3y3i5e{display:flex;width:100px;height:280px}}@media (max-width: 640px){.c3y3i5e{display:flex;height:220px;width:5px}}@media (max-width: 991px){.cy3wjif{width:400px;height:280px}}@media (max-width: 640px){.cy3wjif{width:300px;height:221px}}@media (max-width: 991px){.cxw2f6r{transform:scale(.7);z-index:2;top:-66px}}@media (max-width: 991px){.c6307wf{min-height:200px}}@media (max-width: 640px){.cxdh6gf{margin-top:46px}}@media (max-width: 999px){.cgit9t0{flex-direction:column;align-items:stretch}}@media (max-width: 999px){.civv4i9{width:100%;margin-left:0}}@media (max-width: 999px){.cbe2pk1{width:100%;margin-left:0}}@media (max-width: 991px){.cjjpbna{justify-content:center;display:flex;flex-direction:row;flex-wrap:wrap;margin-bottom:53px;width:100%;max-width:450px}}@media (max-width: 640px){.cjjpbna{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;margin-bottom:60px;max-width:400px}}@media (max-width: 991px){.cxmqbja{font-size:1rem;border-width:2px;border-style:solid;padding-bottom:8px;padding-left:15px;padding-top:8px;padding-right:15px;border-radius:80px}}@media (max-width: 640px){.cxmqbja{font-size:.8rem}}@media (max-width: 991px){.cq489v6{width:100%;max-width:450px;margin-left:auto;margin-right:auto}}@media (max-width: 640px){.cq489v6{margin-left:auto;margin-right:auto;width:100%;max-width:350px}}@media (max-width: 991px){.ccj5ok3{font-size:1rem}}@media (max-width: 640px){.ccj5ok3{margin-top:20px;text-align:left}}@media (max-width: 991px){.cimr38a{line-height:16px}}@media (max-width: 640px){.cimr38a{margin-left:auto;margin-right:auto}}@media (max-width: 640px){.cbqfu4{width:100%;margin-bottom:20px}}@media (max-width: 991px){.crsftpb{padding-top:32px;padding-bottom:31px}}@media (max-width: 640px){.ckuu05i{padding-top:48px;padding-bottom:101px;margin-bottom:19px}}@media (max-width: 991px){.c4gtc7w{width:auto;align-self:center}}@media (max-width: 991px){.c2w82zc{right:600px;margin-right:auto;margin-left:auto}}@media (max-width: 991px){.cjb0iko{padding-top:0px}}@media (max-width: 640px){.cb4380l{padding-top:82px}}@media (max-width: 991px){.cb2hg7a{width:100%;max-width:600px;margin-left:auto;margin-right:auto}}@media (max-width: 991px){.cvpg2gy{line-height:14px}}@media (max-width: 640px){.cw2t6dh{margin-top:0px;bottom:-500px;left:-200px}}@media (max-width: 640px){.ckd59h7{margin-top:0px}}@media (max-width: 991px){.cil28rr{width:100%;padding-left:0;padding-right:0;margin-top:20px;gap:10px}}@media (max-width: 640px){.cil28rr{display:flex;flex-direction:row;justify-content:center;padding-bottom:0px;padding-left:0vw;padding-right:0vw;gap:16px}}@media (max-width: 991px){.cc48rqn{margin-bottom:-16px;display:none}}@media (max-width: 640px){.cc48rqn{display:none}}@media (max-width: 991px){.cutecbd{font-size:5rem;text-align:center;max-width:none;margin-left:auto;margin-right:auto;line-height:6rem;display:flex;margin-top:0px;z-index:5}}@media (max-width: 640px){.cutecbd{font-size:42px;line-height:normal;text-align:center;margin-top:0px;display:flex}}@media (max-width: 991px){.csx8e6u{margin-top:42px}}@media (max-width: 991px){.chctn0k{width:100%;max-width:450px;margin-left:auto;margin-right:auto}}@media (max-width: 640px){.chctn0k{max-width:350px}}@media (max-width: 991px){.c8tohge{width:100%;max-width:450px;margin-left:auto;margin-right:auto}}@media (max-width: 640px){.cq9msr8{padding-bottom:20px}}@media (max-width: 991px){.cwzwhir{font-size:1rem;line-height:2rem;margin-bottom:23px}}@media (max-width: 640px){.cwzwhir{line-height:1.5rem;font-size:.8rem}}@media (max-width: 991px){.c291zym{font-size:3rem}}@media (max-width: 640px){.c291zym{font-size:2rem}}@media (max-width: 991px){.c22yjwp{line-height:14px;z-index:5}}@media (max-width: 640px){.c22yjwp{z-index:5}}@media (max-width: 991px){.cejtg8r{font-size:2rem;max-width:640px;line-height:3rem}}@media (max-width: 640px){.cejtg8r{font-size:1.5rem;line-height:2rem;margin-bottom:0px;font-weight:600}}@media (max-width: 991px){.caqnx8q{font-size:2.5rem}}@media (max-width: 640px){.caqnx8q{font-size:1.5rem}}@media (max-width: 991px){.cpck7nd{font-size:3rem;margin-top:0px}}@media (max-width: 640px){.cpck7nd{font-size:2rem}}@media (max-width: 991px){.cfsrkk{margin-top:0px;width:200px}}@media (max-width: 640px){.cfsrkk{width:auto;height:auto;align-self:center;padding-left:0px;padding-right:0px}}@media (max-width: 999px){.c5ajw3g{width:100%;margin-left:0}}@media (max-width: 999px){.cvbh6ms{width:100%;margin-left:0}}@media (max-width: 991px){.c3zlzea{width:auto;align-self:center}}@media (max-width: 640px){.c3zlzea{width:auto;align-self:center}}@media (max-width: 991px){.c3r3fny{font-size:1rem;line-height:1rem}}@media (max-width: 640px){.c3r3fny{font-size:.9rem}}@media (max-width: 991px){.c29wu29{padding-top:71px;padding-bottom:71px}}@media (max-width: 640px){.c29wu29{padding-bottom:35px;padding-top:35px}}@media (max-width: 991px){.cn72jgl{margin-left:0px}}@media (max-width: 991px){.cvsfwqr{max-width:323px;margin-left:auto;margin-right:auto;margin-top:0px}}@media (max-width: 640px){.cvsfwqr{max-width:243px}}@media (max-width: 991px){.c9cxwka{border-width:4px;width:119px}}@media (max-width: 640px){.c9cxwka{border-width:2px;max-width:75px;width:250px;align-self:stretch}}@media (max-width: 991px){.cdzvxuk{margin-top:38px;border-style:solid;border-width:1px;border-color:rgba(255, 255, 255, 1);border-radius:17px}}@media (max-width: 991px){.cebp9uz{font-size:3rem;margin-left:auto;margin-right:auto;margin-top:29px}}@media (max-width: 640px){.cebp9uz{text-align:center;font-size:2rem}}@media (max-width: 991px){.cyg2lfn{text-align:left;margin-left:auto;margin-right:auto;font-size:1rem;margin-top:34px}}@media (max-width: 640px){.cyg2lfn{font-size:.8rem;line-height:1.7rem}}@media (max-width: 991px){.cofhjo1{font-size:1rem}}@media (max-width: 991px){.c2uxpvp{font-size:2.5rem}}@media (max-width: 640px){.c2uxpvp{font-size:2em}}@media (max-width: 991px){.cojle64{font-size:2.5rem}}@media (max-width: 640px){.cojle64{font-size:2em}}@media (max-width: 991px){.cjecm0y{width:100vw;margin-left:calc(50% - 50vw)}}@media (max-width: 640px){.cjecm0y{margin-left:auto;margin-right:auto;width:100vw}}@media (max-width: 640px){.ctw21he{padding-top:200px;padding-bottom:29px}}@media (max-width: 991px){.c45w5f1{padding-bottom:113px}}@media (max-width: 640px){.c45w5f1{padding-bottom:74px;padding-top:70px}}@media (max-width: 640px){.crcj3rl{min-height:200vh}}@media (max-width: 991px){.ch99mph{left:-200px}}@media (max-width: 991px){.coxpa3x{right:-200px}}@media (max-width: 640px){.coxpa3x{z-index:1}}@media (max-width: 991px){.cgauwxb{margin-top:20px}}@media (max-width: 640px){.cgauwxb{z-index:2;padding-bottom:47px}}@media (max-width: 991px){.ciyolil{margin-top:0px}}@media (max-width: 640px){.ciyolil{margin-top:0px;text-align:center}}@media (max-width: 991px){.c4vpawm{left:-300px}}@media (max-width: 991px){.cr2pr57{font-size:4rem;text-align:center;max-width:400px;margin-left:auto;margin-right:auto;line-height:5rem}}@media (max-width: 640px){.cr2pr57{font-size:3rem;line-height:1.3000000000000003em;text-align:center;max-width:300px}}@media (max-width: 991px){.cq8sxte{text-align:center;margin-left:auto;margin-right:auto}}@media (max-width: 640px){.cq8sxte{line-height:normal;font-size:18px;margin-top:20px;text-align:center;max-width:300px}}@media (max-width: 991px){.cxej5b{justify-content:flex-start;margin-left:auto;margin-right:auto}}@media (max-width: 640px){.cxej5b{display:flex;flex-direction:column;align-items:stretch;padding-bottom:0px;margin-top:20px}}@media (max-width: 991px){.cmllev5{font-size:3rem;text-align:center;max-width:400px;margin-left:auto;margin-right:auto}}@media (max-width: 640px){.cmllev5{font-size:2rem;line-height:normal;text-align:center}}@media (max-width: 991px){.c5xp37i{font-size:5rem;text-align:center;max-width:none;margin-left:auto;margin-right:auto;line-height:6rem}}@media (max-width: 640px){.c5xp37i{font-size:2rem;line-height:normal;text-align:center;margin-top:0px}}@media (max-width: 991px){.c49nxnj{width:100%;max-width:450px;margin-left:auto;margin-right:auto}}@media (max-width: 640px){.c49nxnj{max-width:350px}}@media (max-width: 640px){.ctgvkfs{margin-left:0px;width:100%}}@media (max-width: 991px){.cn1brfp{display:none}}@media (max-width: 640px){.cn1brfp{display:none}}</style><style q:style=\"4yaa8h-2\" hidden=\"\">/*\n* Custom CSS styles\n*\n* Global by default, but use \\`&\\` to scope to just this content, e.g.\n*\n*   & .foo {\n*     color: 'red'\n*   }\n*/\n\nmain{\n    overflow-x: hidden!important;\n}\n\nheader{\n    -webkit-backdrop-filter: blur(23px) saturate(1) !important;\n    backdrop-filter: blur(23px) saturate(1) !important;\n}</style><div class=\"c563s06 builder-block\"><div q:key=\"builder-444ffd3318904235b64affba7ee1190f\"><script>\n  (window.qwikevents||=[]).push('scroll', 'submit')\n</script>\n</div></div><div class=\"cjecm0y builder-block\"><div maxwidth=\"1200\" class=\"ctw21he\"><section class=\"cz5wnof\"><div scriptsclientonly=\"\" class=\"ch99mph\"><div q:key=\"builder-8b4507c0081441aa86d7c0dddb8772b5\"><svg width=\"1440\" height=\"821\" viewBox=\"0 0 1440 821\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"657.051\" cy=\"410.5\" rx=\"842.051\" ry=\"410.5\" fill=\"url(#paint0_radial_1855_2477)\" fill-opacity=\"0.6\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_1855_2477\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(657.051 410.5) rotate(90) scale(410.5 700.051)\">\n      <stop stop-color=\"#AC7FF4\"></stop>\n      <stop offset=\"1\" stop-color=\"#151934\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div scriptsclientonly=\"\" class=\"coxpa3x\"><div q:key=\"builder-362e6059cedd40d8a7bfca00f464529e\"><svg width=\"1440\" height=\"1141\" viewBox=\"0 0 1440 1141\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"774.844\" cy=\"479.424\" rx=\"1054.64\" ry=\"658\" transform=\"rotate(-4.48315 774.844 479.424)\" fill=\"url(#paint0_radial_1855_2450)\" fill-opacity=\"0.5\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_1855_2450\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(649.289 479.632) rotate(95) scale(758.222 1000)\">\n      <stop stop-color=\"#18B4F4\"></stop>\n      <stop offset=\"0.632219\" stop-color=\"#2E3772\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div class=\"cgauwxb\"><div block-id=\"builder-bff01348563843d1b4e93d3e4e3299d5\" class=\"cr2pr57\"><div class=\"builder-text\" q:key=\"builder-4216ac425422404394f99945ea2adc76\"><p>\n  Deliver <br><span style=\"color: rgb(25, 182, 246);\">instant apps</span><br> at scale\n</p>\n</div></div><div block-id=\"builder-1af9a17a6f9a4a60913e60d64d5272f6\" class=\"cq8sxte\"><div class=\"builder-text\" q:key=\"builder-4216ac425422404394f99945ea2adc76\"><p>Build instantly-interactive web apps without effort.</p></div></div><div class=\"cxej5b\"><div class=\"cpiyxct\"><div class=\"cn1brfp\"><img src=\"/builder/9eddd8d18a094765a5fa4d65264ac823.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:42.699999999999996%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div builder-content-id=\"b417246b77124735ade3a2694cb86bf9\" class=\"cpiyxct\"><!--qv q:id=1 q:key=Comp:--><div class=\"cbqfu4 builder-block\" on:click=\"high.js#ComponentB417246B77124735ADE3A2694CB86BF9_onClick_0[0 1]\" q:id=\"2\"><div block-id=\"builder-6ba0b27b334e422e9926639819973775\" class=\"c4vuk63\"><div class=\"builder-text\" q:key=\"builder-0e11431fa39d45e5a4a09e953116e3ad\"><p>npm create qwik@latest</p></div></div></div><!--/qv--></div></div><a href=\"/docs/\" target=\"_self\" class=\"ctgvkfs\">Explore the docs</a></div></div><div class=\"ciyolil\"><div q:key=\"builder-0781ab07e8454b149fb7ffbe83b5b2f0\"><div class=\"px-4 isolate\">\n  <div class=\"max-w-screen-xl mx-auto flex items-center py-4 md:justify-center justify-center flex-col md:flex-row gap-4 md:gap-8\">\n    <span style=\"opacity:0.9\" class=\"font-semibold text-[14px] md:text-base md:mt-1\">Special Sponsor</span><a href=\"https://builder.io/?__hstc=186550006.2092afd48b931c70eccb03c2532615fd.1744284300097.1744284300097.1744284300097.1&amp;__hssc=186550006.2.1744284300099&amp;__hsfp=1241582515\"><svg width=\"180\" height=\"40\" viewBox=\"0 0 312 67\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-label=\"Builder Logo\">\n        <g clip-path=\"url(#clip0_2_46)\">\n          <path d=\"M58.5952 18.8422C58.5983 21.6525 57.9717 24.4278 56.7617 26.964C55.5516 29.5002 53.7889 31.7328 51.6029 33.4978L1.32849 4.94869C1.13619 4.83906 0.957774 4.70667 0.797093 4.55439C0.54498 4.30715 0.344641 4.01213 0.207782 3.68656C0.070922 3.36099 0.000285894 3.01139 0 2.6582C0 1.9532 0.279931 1.27708 0.778211 0.77857C1.27649 0.28006 1.9523 0 2.65698 0L39.7617 0C44.7566 0 49.547 1.98516 53.079 5.51876C56.611 9.05236 58.5952 13.845 58.5952 18.8422Z\" fill=\"#18B4F4\"></path>\n          <path d=\"M58.5952 48.1533C58.5958 50.6281 58.1091 53.0787 57.1628 55.3653C56.2166 57.6518 54.8295 59.7295 53.0805 61.4797C51.3316 63.2298 49.2552 64.6181 46.97 65.5653C44.6847 66.5125 42.2353 67 39.7617 67H2.65697C2.13137 66.9943 1.61925 66.8329 1.1854 66.536C0.75156 66.2391 0.415485 65.8201 0.219699 65.3321C0.0239124 64.844 -0.0227877 64.3089 0.0855068 63.7943C0.193801 63.2797 0.452224 62.8088 0.82808 62.4412C0.977894 62.2907 1.14601 62.1598 1.32848 62.0513L21.1141 50.816L51.5985 33.5022C53.7842 35.2667 55.5471 37.4985 56.7579 40.0338C57.9686 42.5691 58.5964 45.3435 58.5952 48.1533Z\" fill=\"#FD6B3C\"></path>\n          <path d=\"M51.6029 33.4978L21.1141 50.816L1.32851 62.0513C1.13852 62.1568 0.962902 62.2864 0.805969 62.4367C8.35007 54.6957 12.5682 44.3093 12.5587 33.4978C12.5729 22.6849 8.35596 12.2959 0.810398 4.55438C0.971079 4.70667 1.14949 4.83905 1.34179 4.94868L51.6029 33.4978Z\" fill=\"#A97FF2\"></path>\n          <path d=\"M99.8005 24.5706C108.493 24.5706 113.404 31.5174 113.404 39.9306C113.404 48.3438 108.493 55.2374 99.8005 55.2374C95.2836 55.2374 91.8295 53.4299 89.9209 50.3641L89.1327 54.5463H83.6948V14.1771H90.4258V29.0852C92.0642 26.582 95.2836 24.5706 99.8005 24.5706ZM98.4454 49.3052C103.525 49.3052 106.686 45.185 106.686 39.9306C106.686 34.5655 103.525 30.4984 98.4454 30.4984C93.3662 30.4984 90.1999 34.5566 90.1999 39.9306C90.1999 45.1894 93.3086 49.3052 98.4454 49.3052Z\" fill=\"currentColor\"></path>\n          <path d=\"M137.056 42.4737V25.2529H143.773V42.1325C143.773 49.6641 140.333 55.2375 130.847 55.2375C121.362 55.2375 117.921 49.6464 117.921 42.1325V25.2529H124.639V42.4737C124.639 47.0458 126.782 49.3052 130.838 49.3052C134.895 49.3052 137.056 47.0458 137.056 42.4737Z\" fill=\"currentColor\"></path>\n          <path d=\"M149.149 16.215C149.127 15.6253 149.227 15.0373 149.443 14.488C149.659 13.9388 149.986 13.4404 150.404 13.0241C150.822 12.6078 151.322 12.2827 151.872 12.0694C152.422 11.8561 153.011 11.7592 153.6 11.7847C156.151 11.7847 157.988 13.6233 157.988 16.2372C157.988 18.8511 156.151 20.5656 153.6 20.5656C151.049 20.5656 149.149 18.7625 149.149 16.215Z\" fill=\"currentColor\"></path>\n          <path d=\"M268.997 16.215C268.974 15.6272 269.074 15.0411 269.288 14.4935C269.503 13.9458 269.828 13.4485 270.244 13.0325C270.66 12.6166 271.157 12.291 271.704 12.0763C272.252 11.8616 272.838 11.7623 273.425 11.7847C275.976 11.7847 277.814 13.6233 277.814 16.2372C277.814 18.8511 275.976 20.5656 273.425 20.5656C270.874 20.5656 268.997 18.7625 268.997 16.215Z\" fill=\"currentColor\"></path>\n          <path d=\"M256.071 50.466C256.048 49.878 256.146 49.2916 256.361 48.7436C256.575 48.1957 256.901 47.698 257.316 47.282C257.732 46.8659 258.23 46.5404 258.777 46.3259C259.325 46.1114 259.911 46.0126 260.499 46.0356C263.05 46.0356 264.887 47.8742 264.887 50.466C264.887 53.0577 263.05 54.7988 260.499 54.7988C257.948 54.7988 256.071 53.0178 256.071 50.466Z\" fill=\"currentColor\"></path>\n          <path d=\"M156.93 25.2485H150.212V54.5596H156.93V25.2485Z\" fill=\"currentColor\"></path>\n          <path d=\"M163.648 54.5596V14.1771H170.365V54.5685L163.648 54.5596Z\" fill=\"currentColor\"></path>\n          <path d=\"M198.082 14.1771H204.8V54.5685H199.375L198.587 50.3862C196.727 53.4387 193.273 55.2596 188.712 55.2596C180.072 55.2596 175.161 48.3128 175.161 39.9528C175.161 31.5927 180.072 24.5928 188.712 24.5928C193.282 24.5928 196.444 26.6219 198.082 29.1073V14.1771ZM190.111 30.5073C185.032 30.5073 181.87 34.5743 181.87 39.9395C181.87 45.1939 185.032 49.3141 190.111 49.3141C195.19 49.3141 198.352 45.1939 198.352 39.9395C198.361 34.5566 195.257 30.4984 190.12 30.4984L190.111 30.5073Z\" fill=\"currentColor\"></path>\n          <path d=\"M237.596 46.5407C235.51 51.7907 230.652 55.2375 224.275 55.2375C215.419 55.2375 209.662 48.6274 209.662 39.8731C209.662 31.3447 215.534 24.5707 224.227 24.5707C232.92 24.5707 238.623 31.1763 238.623 39.7623C238.651 40.4627 238.59 41.1639 238.442 41.849H216.26C216.765 46.4831 219.759 49.4736 224.444 49.4736C227.663 49.4736 230.316 47.892 231.556 44.9591L237.596 46.5407ZM216.371 36.8826H231.954C231.387 32.8155 228.567 30.0466 224.218 30.0466C219.869 30.0466 217.049 32.8731 216.371 36.8826Z\" fill=\"currentColor\"></path>\n          <path d=\"M259.162 31.2915C258.657 31.2213 258.148 31.1829 257.638 31.1763C252.896 31.1763 250.075 33.6617 250.075 39.3104V54.5596H243.357V25.2529H248.782L249.565 29.3155C250.637 27.4548 253.108 24.9694 258.205 24.9694C258.484 24.9694 259.162 25.027 259.162 25.027V31.2915Z\" fill=\"currentColor\"></path>\n          <path d=\"M276.777 25.2485H270.06V54.5596H276.777V25.2485Z\" fill=\"currentColor\"></path>\n          <path d=\"M281.573 39.9307C281.573 31.6858 287.445 24.5707 296.758 24.5707C306.071 24.5707 312 31.6858 312 39.9307C312 48.1755 306.133 55.2375 296.758 55.2375C287.383 55.2375 281.573 48.1755 281.573 39.9307ZM296.758 49.3053C301.673 49.3053 305.282 45.5793 305.282 39.9307C305.282 34.282 301.673 30.4985 296.758 30.4985C291.842 30.4985 288.282 34.2244 288.282 39.9307C288.282 45.6369 291.904 49.3053 296.758 49.3053Z\" fill=\"currentColor\"></path>\n        </g>\n        <defs>\n          <clipPath id=\"clip0_2_46\">\n            <rect width=\"312\" height=\"67\" fill=\"white\"></rect>\n          </clipPath>\n        </defs></svg></a><span style=\"opacity:0.9\" class=\"text-[14px] md:text-base font-semibold md:mt-1 max-md:text-center\">Ship twice as much, <br>twice as fast</span>\n  </div>\n</div>\n</div></div></section></div><div maxwidth=\"1500\" class=\"c45w5f1\"><section class=\"cru0mak\"><div scriptsclientonly=\"\" class=\"c4vpawm\"><div q:key=\"builder-bdb15202fe3a4c06ae60ce0455752b1d\"><svg width=\"1440\" height=\"1234\" viewBox=\"0 0 1440 1234\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"768\" cy=\"617\" rx=\"1118\" ry=\"617\" fill=\"url(#paint0_radial_2320_2533)\" fill-opacity=\"0.3\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_2320_2533\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(768 617) rotate(90) scale(400 800)\">\n      <stop stop-color=\"#AC7FF4\"></stop>\n      <stop offset=\"1\" stop-color=\"#151934\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div scriptsclientonly=\"\" class=\"cd7htz\"><div q:key=\"builder-25726cfbfdc4493fa152d24869578116\"><svg width=\"1252\" height=\"1756\" viewBox=\"0 0 1252 1756\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"1053.9\" cy=\"877.9\" rx=\"1054.64\" ry=\"876.144\" transform=\"rotate(-4.48315 1053.9 877.9)\" fill=\"url(#paint0_radial_2038_2502)\" fill-opacity=\"0.4\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_2038_2502\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(800 745.025) rotate(88.5492) scale(1009.34 1215.3)\">\n      <stop stop-color=\"#18B4F4\"></stop>\n      <stop offset=\"0.632219\" stop-color=\"#2E3772\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div class=\"cfs4wgq\"><div block-id=\"builder-a66d0e8e68d245b5b7390022779480ab\" class=\"cmllev5\"><div class=\"builder-text\" q:key=\"builder-3181a3f1a13a4bc386df302b2b9f1b3d\"><p>New Approach to </p></div></div><div block-id=\"builder-692201c7af614484a5da82391bfd2986\" class=\"c5xp37i\"><div class=\"builder-text\" q:key=\"builder-3181a3f1a13a4bc386df302b2b9f1b3d\"><p>Performance Optimization</p></div></div><div builder-content-id=\"3c0255d6d2d94e3390539dee6af8c7c0\" class=\"c49nxnj\"><!--qv q:id=3 q:key=Comp:--><style q:style=\"5yjx4z-1\" hidden=\"\">/*\n* Custom CSS styles\n*\n* Global by default, but use \\`&\\` to scope to just this content, e.g.\n*\n*   & .foo {\n*     color: 'red'\n*   }\n*/\n.feature-name >.builder-text{\n    transition: color .3s cubic-bezier(.37,.01,0,.98);\n}\n\n.feature-name >.builder-text:hover{\n    color: rgba(230, 230, 230, 1)\n}</style><div class=\"cxdh6gf builder-block\"><div class=\"cgit9t0 builder-columns\"><div class=\"civv4i9 builder-column\"><div class=\"cjjpbna\"><div block-id=\"builder-fe2cecd761254557b53b153193064f55\" style=\"color:rgba(24, 182, 246, 1);border-color:rgba(24, 182, 246, 1)\" class=\"cxmqbja feature-name\" on:click=\"high.js#Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0[0 1]\" q:id=\"4\"><div class=\"builder-text\" q:key=\"default\">Instant Loading</div></div><div block-id=\"builder-fe2cecd761254557b53b153193064f55\" style=\"color:rgba(230, 230, 230, 0.16);border-color:rgba(230, 230, 230, 0.16)\" class=\"cxmqbja feature-name\" on:click=\"high.js#Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0[0 1]\" q:id=\"5\"><div class=\"builder-text\" q:key=\"default\">Resumable</div></div><div block-id=\"builder-fe2cecd761254557b53b153193064f55\" style=\"color:rgba(230, 230, 230, 0.16);border-color:rgba(230, 230, 230, 0.16)\" class=\"cxmqbja feature-name\" on:click=\"high.js#Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0[0 1]\" q:id=\"6\"><div class=\"builder-text\" q:key=\"default\">Lazy Executing</div></div><div block-id=\"builder-fe2cecd761254557b53b153193064f55\" style=\"color:rgba(230, 230, 230, 0.16);border-color:rgba(230, 230, 230, 0.16)\" class=\"cxmqbja feature-name\" on:click=\"high.js#Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0[0 1]\" q:id=\"7\"><div class=\"builder-text\" q:key=\"default\">Reduced Rendering</div></div><div block-id=\"builder-fe2cecd761254557b53b153193064f55\" style=\"color:rgba(230, 230, 230, 0.16);border-color:rgba(230, 230, 230, 0.16)\" class=\"cxmqbja feature-name\" on:click=\"high.js#Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0[0 1]\" q:id=\"8\"><div class=\"builder-text\" q:key=\"default\">Perf that Scales</div></div><div block-id=\"builder-fe2cecd761254557b53b153193064f55\" style=\"color:rgba(230, 230, 230, 0.16);border-color:rgba(230, 230, 230, 0.16)\" class=\"cxmqbja feature-name\" on:click=\"high.js#Component3C0255D6D2D94E3390539DEE6AF8C7C0_onClick_0[0 1]\" q:id=\"9\"><div class=\"builder-text\" q:key=\"default\">Code Once</div></div></div></div><div class=\"cbe2pk1 builder-column\"><div class=\"cq489v6\"><div class=\"c826kto\"><picture><source type=\"image/webp\"><img src=\"/builder/fdc08238cb4d49d48d3a468308992e15\" style=\"object-fit:contain;object-position:left;position:absolute;height:100%;width:100%;top:0;left:0\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:55.00000000000001%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div class=\"c89a57i\"><div class=\"cqwe493\"><div block-id=\"builder-44477e90706141afb8d57da3a6cd8b95\" class=\"ccj5ok3\"><div class=\"builder-text\" q:key=\"builder-8fb3503ec1f94d04b75bc31489227f03\"><p>Because Qwik skips hydration, your applications are instantly interactive. This is accomplished by <a href=\"https://qwik.dev/docs/concepts/resumable/?__hstc=186550006.2092afd48b931c70eccb03c2532615fd.1744284300097.1744284300097.1744284300097.1&amp;__hssc=186550006.2.1744284300099&amp;__hsfp=1241582515\" rel=\"noopener noreferrer\" target=\"_blank\">resumability</a>.</p></div></div><a href=\"https://qwik.dev/docs/concepts/progressive/?__hstc=186550006.2092afd48b931c70eccb03c2532615fd.1744284300097.1744284300097.1744284300097.1&amp;__hssc=186550006.2.1744284300099&amp;__hsfp=1241582515\" target=\"_self\" class=\"cimr38a\">Learn More</a></div></div></div></div></div></div><!--/qv--></div></div></section></div><div style=\"\" maxwidth=\"1200\" lazyload=\"\" class=\"crcj3rl\"><!--cq--><div q:container=\"paused\" q:version=\"0.100.0\" q:render=\"ssr-dev\" q:base=\"/builder/\" class=\"qc📦\"><div builder-content-id=\"97a3ddc814674f85b6ef0d82dc2b6eb1\"><style>/*\n* Custom CSS styles\n*\n* Global by default, but use \\`&amp;\\` to scope to just this content, e.g.\n*\n*   &amp; .foo {\n*     color: 'red'\n*   }\n*/\n\nmain{\n    overflow-x: hidden!important;\n    margin-top: -80px!important;\n}\n\nheader{\n    -webkit-backdrop-filter: blur(23px) saturate(1) !important;\n    backdrop-filter: blur(23px) saturate(1) !important;\n}</style><!--qv q:id=0 q:key=97A3:--><div class=\"ctu4sjl builder-block\"><div scriptsclientonly=\"\" class=\"c4gtc7w\"><div q:key=\"builder-82e7036fb31244e39ce58e169146a8d5\"><svg width=\"1288\" height=\"1323\" viewBox=\"0 0 1288 1323\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"234.844\" cy=\"661.424\" rx=\"1054.64\" ry=\"658\" transform=\"rotate(-4.48315 234.844 661.424)\" fill=\"url(#paint0_radial_2320_2500)\" fill-opacity=\"0.5\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_2320_2500\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(209.289 561.632) rotate(88.0685) scale(758.222 1215)\">\n      <stop stop-color=\"#18B4F4\"></stop>\n      <stop offset=\"0.632219\" stop-color=\"#2E3772\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div scriptsclientonly=\"\" class=\"cbi9n1m\"><div q:key=\"builder-4544cf0d49964e50865cb58fb776805f\"><svg width=\"1110\" height=\"821\" viewBox=\"0 0 1110 821\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"642.051\" cy=\"410.5\" rx=\"842.051\" ry=\"410.5\" fill=\"url(#paint0_radial_2320_2530)\" fill-opacity=\"0.6\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_2320_2530\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(900.051 410.5) rotate(90) scale(410.5 842.051)\">\n      <stop stop-color=\"#AC7FF4\"></stop>\n      <stop offset=\"1\" stop-color=\"#151934\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div maxwidth=\"1200\" class=\"cz2hbr1\"><section class=\"cz5wnof\"><div class=\"cc48rqn\"><img src=\"/builder/adcbcab5d5cc432985fbec5bd5a7ddb5.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 998px) 96vw, 86vw\" alt=\"Showcase\" loading=\"lazy\"><div style=\"width:100%;padding-top:15.2%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-233139c2d27547b19f813a6b44b29137\" class=\"cutecbd\"><div class=\"builder-text\" q:key=\"builder-4ab0d8c35d61439393e84b4715dd00bf\"><p>Showcase</p></div></div><div builder-content-id=\"2cb3cabc3ee84f0e987eb4525859e0a8\" class=\"cpab73l\"><!--qv q:id=1 q:key=Comp:--><style q:style=\"niif3b-1\" hidden=\"\">.builder-heading-1{font-size:2em;margin:.67em 0}.builder-heading-2{font-size:1.5em;margin:.75em 0}.builder-heading-3{font-size:1.17em;margin:.83em 0}.builder-heading-4,.builder-paragraph{margin:1.12em 0}.builder-heading-5{font-size:.83em;margin:1.5em 0}.builder-heading-6{font-size:.75em;margin:1.67em 0}.builder-heading-1,.builder-heading-2,.builder-heading-3,.builder-heading-4,.builder-heading-5,.builder-heading-6{font-weight:bolder}\n\n.interactive-scroller::-webkit-scrollbar {\n    display: none;\n  }\n\n\n .interactive-scroller {\n    -ms-overflow-style: none; \n    scrollbar-width: none; \n  }\n\n.information:hover{\n  opacity: 1;\n}</style><div class=\"catfy1 builder-block\"><div class=\"cppa4w7\"><div class=\"cv1pw7l\" on:click=\"high.js#Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_2[0 1]\" q:id=\"2\"><div class=\"clcdmxz\"><img src=\"/builder/e4d535b208c844419f26d057e5490ab5.svg\" style=\"object-fit:contain;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:166.70000000000002%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div><div class=\"cv1pw7l\" on:click=\"high.js#Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_3[0 1]\" q:id=\"3\"><div class=\"cm0gcj3\"><img src=\"/builder/a4604a3d47ab49cf9e4fc3772c0b62cb.svg\" style=\"object-fit:contain;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:166.70000000000002%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div></div><div class=\"c8kb54b\" on:click=\"high.js#Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_2[0 1]\" q:id=\"4\"></div><div class=\"c3bwmck\" on:click=\"high.js#Component2CB3CABC3EE84F0E987EB4525859E0A8_onClick_3[0 1]\" q:id=\"5\"></div><div id=\"row1\" style=\"direction:ltr\" class=\"clwho8x interactive-scroller\"><div class=\"c3y3i5e\"></div><a href=\"https://velocity.builder.io/\" class=\"cy3wjif card\"><div class=\"cxw2f6r\"><div scriptsclientonly=\"\" style=\"stroke-dasharray:292, 1000\" class=\"clzvnrc\"><div q:key=\"builder-55465aface484326b81ac8985f83dc49\"><svg viewBox=\"0 0 120 120\">\n  <defs>\n    <linearGradient id=\"gradient\">\n      <stop id=\"stop1\" offset=\"0%\" stop-color=\"#18B6F6\"></stop>\n      <stop id=\"stop2\" offset=\"100%\" stop-color=\"#ac7ef4\"></stop>\n    </linearGradient>\n  </defs>\n\n  <circle id=\"circle\" r=\"51\" cx=\"60\" cy=\"60\" stroke-width=\"14\" stroke=\"url('#gradient')\" fill=\"black\" class=\"circle-2\" style=\"stroke-linecap: round\"></circle>\n</svg>\n</div></div><div block-id=\"builder-5386a2819ec045b3b16859b743d4e0e2\" class=\"cy8hub5\"><div class=\"builder-text\" q:key=\"builder-55465aface484326b81ac8985f83dc49\">94%</div></div></div><div class=\"c6307wf\"><picture><source type=\"image/webp\"><img src=\"/builder/aee5f202a90e4659bbc6374aed3ff138\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 48vw, (max-width: 998px) 66vw, 47vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:65%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-74208b0179934788841c25658732c9be\" class=\"cxyrqhw\"><div class=\"builder-text\" q:key=\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\">Builder Velocity</div></div></a><a href=\"https://reflect.app/home\" class=\"cy3wjif card\"><div class=\"cxw2f6r\"><div scriptsclientonly=\"\" style=\"stroke-dasharray:293, 1000\" class=\"clzvnrc\"><div q:key=\"builder-55465aface484326b81ac8985f83dc49\"><svg viewBox=\"0 0 120 120\">\n  <defs>\n    <linearGradient id=\"gradient\">\n      <stop id=\"stop1\" offset=\"0%\" stop-color=\"#18B6F6\"></stop>\n      <stop id=\"stop2\" offset=\"100%\" stop-color=\"#ac7ef4\"></stop>\n    </linearGradient>\n  </defs>\n\n  <circle id=\"circle\" r=\"51\" cx=\"60\" cy=\"60\" stroke-width=\"14\" stroke=\"url('#gradient')\" fill=\"black\" class=\"circle-2\" style=\"stroke-linecap: round\"></circle>\n</svg>\n</div></div><div block-id=\"builder-5386a2819ec045b3b16859b743d4e0e2\" class=\"cy8hub5\"><div class=\"builder-text\" q:key=\"builder-55465aface484326b81ac8985f83dc49\">98%</div></div></div><div class=\"c6307wf\"><picture><source type=\"image/webp\"><img src=\"/builder/ccfe1879407845b8906b870fc4ef607d\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 48vw, (max-width: 998px) 66vw, 47vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:65%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-74208b0179934788841c25658732c9be\" class=\"cxyrqhw\"><div class=\"builder-text\" q:key=\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\">Reflect.app</div></div></a><a href=\"https://www.builder.io\" class=\"cy3wjif card\"><div class=\"cxw2f6r\"><div scriptsclientonly=\"\" style=\"stroke-dasharray:284, 1000\" class=\"clzvnrc\"><div q:key=\"builder-55465aface484326b81ac8985f83dc49\"><svg viewBox=\"0 0 120 120\">\n  <defs>\n    <linearGradient id=\"gradient\">\n      <stop id=\"stop1\" offset=\"0%\" stop-color=\"#18B6F6\"></stop>\n      <stop id=\"stop2\" offset=\"100%\" stop-color=\"#ac7ef4\"></stop>\n    </linearGradient>\n  </defs>\n\n  <circle id=\"circle\" r=\"51\" cx=\"60\" cy=\"60\" stroke-width=\"14\" stroke=\"url('#gradient')\" fill=\"black\" class=\"circle-2\" style=\"stroke-linecap: round\"></circle>\n</svg>\n</div></div><div block-id=\"builder-5386a2819ec045b3b16859b743d4e0e2\" class=\"cy8hub5\"><div class=\"builder-text\" q:key=\"builder-55465aface484326b81ac8985f83dc49\">96%</div></div></div><div class=\"c6307wf\"><picture><source type=\"image/webp\"><img src=\"/builder/80ac5f7793b545499d3d8944ff7ff3f3\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 48vw, (max-width: 998px) 66vw, 47vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:65%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-74208b0179934788841c25658732c9be\" class=\"cxyrqhw\"><div class=\"builder-text\" q:key=\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\">Builder.io - Design to Code to Live</div></div></a><a href=\"https://www.burgersonfleek.ca/\" class=\"cy3wjif card\"><div class=\"cxw2f6r\"><div scriptsclientonly=\"\" style=\"stroke-dasharray:277, 1000\" class=\"clzvnrc\"><div q:key=\"builder-55465aface484326b81ac8985f83dc49\"><svg viewBox=\"0 0 120 120\">\n  <defs>\n    <linearGradient id=\"gradient\">\n      <stop id=\"stop1\" offset=\"0%\" stop-color=\"#18B6F6\"></stop>\n      <stop id=\"stop2\" offset=\"100%\" stop-color=\"#ac7ef4\"></stop>\n    </linearGradient>\n  </defs>\n\n  <circle id=\"circle\" r=\"51\" cx=\"60\" cy=\"60\" stroke-width=\"14\" stroke=\"url('#gradient')\" fill=\"black\" class=\"circle-2\" style=\"stroke-linecap: round\"></circle>\n</svg>\n</div></div><div block-id=\"builder-5386a2819ec045b3b16859b743d4e0e2\" class=\"cy8hub5\"><div class=\"builder-text\" q:key=\"builder-55465aface484326b81ac8985f83dc49\">95%</div></div></div><div class=\"c6307wf\"><picture><source type=\"image/webp\"><img src=\"/builder/42067d8b20a74503a497b72f53665b13\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 48vw, (max-width: 998px) 66vw, 47vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:65%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-74208b0179934788841c25658732c9be\" class=\"cxyrqhw\"><div class=\"builder-text\" q:key=\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\">Burgers on Fleek</div></div></a><a href=\"https://tatbiqit.com/\" class=\"cy3wjif card\"><div class=\"cxw2f6r\"><div scriptsclientonly=\"\" style=\"stroke-dasharray:290, 1000\" class=\"clzvnrc\"><div q:key=\"builder-55465aface484326b81ac8985f83dc49\"><svg viewBox=\"0 0 120 120\">\n  <defs>\n    <linearGradient id=\"gradient\">\n      <stop id=\"stop1\" offset=\"0%\" stop-color=\"#18B6F6\"></stop>\n      <stop id=\"stop2\" offset=\"100%\" stop-color=\"#ac7ef4\"></stop>\n    </linearGradient>\n  </defs>\n\n  <circle id=\"circle\" r=\"51\" cx=\"60\" cy=\"60\" stroke-width=\"14\" stroke=\"url('#gradient')\" fill=\"black\" class=\"circle-2\" style=\"stroke-linecap: round\"></circle>\n</svg>\n</div></div><div block-id=\"builder-5386a2819ec045b3b16859b743d4e0e2\" class=\"cy8hub5\"><div class=\"builder-text\" q:key=\"builder-55465aface484326b81ac8985f83dc49\">97%</div></div></div><div class=\"c6307wf\"><picture><source type=\"image/webp\"><img src=\"/builder/281010f5f1694d8bbf399c8ffe4a1d87\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 48vw, (max-width: 998px) 66vw, 47vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:65%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-74208b0179934788841c25658732c9be\" class=\"cxyrqhw\"><div class=\"builder-text\" q:key=\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\">TatbiqIT</div></div></a><a href=\"https://necatikcl.dev/\" class=\"cy3wjif card\"><div class=\"cxw2f6r\"><div scriptsclientonly=\"\" style=\"stroke-dasharray:298, 1000\" class=\"clzvnrc\"><div q:key=\"builder-55465aface484326b81ac8985f83dc49\"><svg viewBox=\"0 0 120 120\">\n  <defs>\n    <linearGradient id=\"gradient\">\n      <stop id=\"stop1\" offset=\"0%\" stop-color=\"#18B6F6\"></stop>\n      <stop id=\"stop2\" offset=\"100%\" stop-color=\"#ac7ef4\"></stop>\n    </linearGradient>\n  </defs>\n\n  <circle id=\"circle\" r=\"51\" cx=\"60\" cy=\"60\" stroke-width=\"14\" stroke=\"url('#gradient')\" fill=\"black\" class=\"circle-2\" style=\"stroke-linecap: round\"></circle>\n</svg>\n</div></div><div block-id=\"builder-5386a2819ec045b3b16859b743d4e0e2\" class=\"cy8hub5\"><div class=\"builder-text\" q:key=\"builder-55465aface484326b81ac8985f83dc49\">99%</div></div></div><div class=\"c6307wf\"><picture><source type=\"image/webp\"><img src=\"/builder/d1768a789936434a905973daf12768f6\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 48vw, (max-width: 998px) 66vw, 47vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:65%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-74208b0179934788841c25658732c9be\" class=\"cxyrqhw\"><div class=\"builder-text\" q:key=\"builder-b8d47faa4d7b4cdea07ef08d0e01bca7\">Necati Koçlu</div></div></a><div class=\"c38x0cp\"></div></div></div><!--/qv--></div><a href=\"https://qwik.dev/showcase/\" target=\"_self\" class=\"csx8e6u\">See more examples</a></section></div></div><div maxwidth=\"1500\" class=\"crsftpb builder-block\"><section class=\"cru0mak\"><div class=\"cesokp7\"><div class=\"chctn0k\"><div class=\"cgit9t0 builder-columns\"><div class=\"c5ajw3g builder-column\"><div class=\"c29wu29\"><div class=\"cpiyxct\"><div class=\"cp6yem6\"><div block-id=\"builder-6125bc186474434792cb619f3793f0e1\" class=\"c2uxpvp\"><div class=\"builder-text\" q:key=\"builder-51dbb1f45264436ebe237a6a0c4110e5\"><p>You know React? </p></div></div><div block-id=\"builder-ff7b052c254144e18d5d7903b288fea8\" class=\"cojle64\"><div class=\"builder-text\" q:key=\"builder-51dbb1f45264436ebe237a6a0c4110e5\"><p>You know Qwik.</p></div></div></div><div block-id=\"builder-b14fabbd2b6b48a8bbb4e29d3f2d76c1\" class=\"cofhjo1\"><div class=\"builder-text\" q:key=\"builder-51dbb1f45264436ebe237a6a0c4110e5\"><p>Developer experience is a core principle of Qwik. Built on top of JSX, functional components and reactivity, learning Qwik is a piece of cake.</p></div></div><a href=\"/examples/introduction/hello-world\" target=\"_self\" class=\"c4kg5g5\">View Examples</a></div></div></div><div class=\"cvbh6ms builder-column\"><div class=\"cn72jgl\"><div class=\"cdzvxuk\"><picture><source type=\"image/webp\"><img src=\"/builder/52a1f6b5be704dc9b5080d64acfb9ccf?width=568\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 55vw, (max-width: 998px) 49vw, 41vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:85.9%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div></div></div></div></div></section></div><div class=\"cbyhsc7 builder-block\"><div scriptsclientonly=\"\" class=\"c2w82zc\"><div q:key=\"builder-8c47d81d94da4c409f673edf2768969c\"><svg width=\"3000\" height=\"1036\" viewBox=\"0 0 1400 1036\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"1000.5\" cy=\"700.969\" rx=\"2000.5\" ry=\"700.969\" fill=\"url(#paint0_radial_2320_2531)\" fill-opacity=\"0.6\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_2320_2531\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(350.5 517.969) rotate(90) scale(517.969 1062.5)\">\n      <stop stop-color=\"#AC7FF4\"></stop>\n      <stop offset=\"1\" stop-color=\"#151934\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div maxwidth=\"1500\" class=\"cjb0iko\"><section class=\"cru0mak\"><div class=\"c8tohge\"><div class=\"cgit9t0 builder-columns\"><div class=\"c5ajw3g builder-column\"><div class=\"cvsfwqr\"><picture><source type=\"image/webp\"><img src=\"/builder/115b3b36cedd455196b06f5d33a57ac1?width=450\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 39vw, (max-width: 998px) 46vw, 33vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:106.69999999999999%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div><div class=\"cvbh6ms builder-column\"><div class=\"c9jm9xk\"><div block-id=\"builder-63e148ecb2ca4d43b907a98d107bbe10\" class=\"cebp9uz\"><div class=\"builder-text\" q:key=\"builder-01082f61e25a4f2f9be9a225fc176141\"><p>Batteries included</p></div></div><div block-id=\"builder-3dbce5a43eee4109861f738a700efa9f\" class=\"cyg2lfn\"><div class=\"builder-text\" q:key=\"builder-01082f61e25a4f2f9be9a225fc176141\"><p>⚡️ Instant development with Vite.</p><p>⚡ Testing by Vitest and playwright.</p><p>⚡ Large ecosystem of tools ready to use.</p><p>⚡ Built in extendable styling. Tailwind, Postcss, etc.</p><p>⚡ Debugging for SSR, browser, prerendering.</p><p>⚡ Ready for Vercel, Netlify, Deno, Cloudflare, Express...</p></div></div></div></div></div></div></section></div></div><div maxwidth=\"1500\" class=\"c5zm5x3 builder-block\"><section class=\"cru0mak\"><div class=\"cb2hg7a\"><div class=\"cq9msr8\"><div block-id=\"builder-537e4858244a4e84ad33d723f0cf9367\" class=\"caqnx8q\"><div class=\"builder-text\" q:key=\"builder-6e417a0c2b604e2cbcb22c006730e7cc\"><p>Get super powers with the</p></div></div><div block-id=\"builder-993ae0c8813649b7822a404dd2dd498f\" class=\"cpck7nd\"><div class=\"builder-text\" q:key=\"builder-6e417a0c2b604e2cbcb22c006730e7cc\"><p>Qwik Optimizer</p></div></div></div><div block-id=\"builder-bc532f64cc0343009d70ac0c92791d57\" class=\"cwzwhir\"><div class=\"builder-text\" q:key=\"builder-6e417a0c2b604e2cbcb22c006730e7cc\"><p>Qwik’s Optimizer can generate JavaScript based on real-user metrics to understand the optimal way to bundle commonly used modules.</p></div></div></div><a href=\"/examples/introduction/hello-world\" target=\"_self\" class=\"cvpg2gy\">Online Examples</a></section></div><div class=\"ctu4sjl builder-block\"><div scriptsclientonly=\"\" class=\"cc9njxf\"><div q:key=\"builder-3b6fdb5b305a4b0eab30ff1581817297\"><svg width=\"1031\" height=\"1323\" viewBox=\"0 0 1031 1323\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<ellipse cx=\"1052.84\" cy=\"661.424\" rx=\"1054.64\" ry=\"658\" transform=\"rotate(-4.48315 1052.84 661.424)\" fill=\"url(#paint0_radial_2038_2658)\" fill-opacity=\"0.5\"></ellipse>\n<defs>\n<radialGradient id=\"paint0_radial_2038_2658\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(1027.29 561.632) rotate(88.0685) scale(758.222 1215)\">\n<stop stop-color=\"#18B4F4\"></stop>\n<stop offset=\"0.632219\" stop-color=\"#2E3772\" stop-opacity=\"0\"></stop>\n</radialGradient>\n</defs>\n</svg>\n</div></div><div maxwidth=\"1200\" class=\"cb4380l\"><section class=\"cz5wnof\"><div block-id=\"builder-3cba0bae547749b0a2f1e8907e77cdc8\" class=\"c291zym\"><div class=\"builder-text\" q:key=\"builder-bb22be14ad914026a3022590af9e413a\"><p>Qwik <span style=\"color: rgb(172, 127, 244);\">media</span></p>\n</div></div><div builder-content-id=\"856b004403f841c789cf61f2a180c93f\" class=\"czfbrjk\"><!--qv q:id=6 q:key=Comp:--><style q:style=\"ppi5m6-1\" hidden=\"\">.builder-heading-1{font-size:2em;margin:.67em 0}.builder-heading-2{font-size:1.5em;margin:.75em 0}.builder-heading-3{font-size:1.17em;margin:.83em 0}.builder-heading-4,.builder-paragraph{margin:1.12em 0}.builder-heading-5{font-size:.83em;margin:1.5em 0}.builder-heading-6{font-size:.75em;margin:1.67em 0}.builder-heading-1,.builder-heading-2,.builder-heading-3,.builder-heading-4,.builder-heading-5,.builder-heading-6{font-weight:bolder}\n\n.interactive-scroller::-webkit-scrollbar {\n    display: none;\n  }\n\n\n .interactive-scroller {\n    -ms-overflow-style: none; \n    scrollbar-width: none; \n  }\n\n.information:hover{\n  opacity: 1;\n}</style><div class=\"catfy1 builder-block\"><div class=\"c3v64af\"><div class=\"cv1pw7l\" on:click=\"high.js#Component856B004403F841C789CF61F2A180C93F_onClick_2[0 1]\" q:id=\"7\"><div class=\"clcdmxz\"><img src=\"/builder/e4d535b208c844419f26d057e5490ab5.svg\" style=\"object-fit:contain;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:166.70000000000002%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div><div class=\"cv1pw7l\" on:click=\"high.js#Component856B004403F841C789CF61F2A180C93F_onClick_3[0 1]\" q:id=\"8\"><div class=\"cm0gcj3\"><img src=\"/builder/a4604a3d47ab49cf9e4fc3772c0b62cb.svg\" style=\"object-fit:contain;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:166.70000000000002%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div></div><div class=\"chye5ds\" on:click=\"high.js#Component856B004403F841C789CF61F2A180C93F_onClick_2[0 1]\" q:id=\"9\"></div><div class=\"cglm7wr\" on:click=\"high.js#Component856B004403F841C789CF61F2A180C93F_onClick_3[0 1]\" q:id=\"a\"></div><div id=\"row2\" style=\"direction:ltr\" class=\"cbmbzxo interactive-scroller\"><div class=\"cxiz55v\"></div><a href=\"https://www.youtube.com/watch?v=x2eF3YLiNhY&amp;ab_channel=Fireship\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/91320f7f7e764055b4f1722189241838\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Video</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Qwik First Look - Fireship Code Report</div></div></a><a href=\"https://www.youtube.com/watch?v=_PDpoJUacuc&amp;ab_channel=LearnWithJason\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/4b7b38f10af348c4b8b2809db664c11f\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Podcast</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Build Resumable Apps with Qwik</div></div></a><a href=\"https://qwikschool.com/\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/31df46c5b87744fd8a4347d3a17a47a6\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Course</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Qwik School by HiRez.io</div></div></a><a href=\"https://www.youtube.com/watch?v=Zddw6qy5pf0&amp;ab_channel=Devoxx\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/c32d1ef92781491a86dcdc8859b193d2\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Presentation</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Qwik: No hydration &amp; instant-on</div></div></a><a href=\"https://www.youtube.com/watch?v=W0xjcx4mrkE&amp;list=PL4cUxeGkcC9gOUlY-uCHurFIpqogsdOnw&amp;ab_channel=TheNetNinja\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/b6a806948cef4946aec55fa4fa9173cd\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Course</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Qwik Crash Course</div></div></a><a href=\"https://www.youtube.com/watch?v=z14c3u9q8rI&amp;ab_channel=Awesome\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/ba922b4f3134477580035b01dc804a26\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Video</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Qwik First Impressions</div></div></a><a href=\"https://www.youtube.com/watch?v=fa6-Mn0Eybg&amp;ab_channel=Theo-t3%E2%80%A4gg\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/329d8065fc13497e8588c3f03df1f49a\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Podcast</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Qwik Chat with Theo</div></div></a><a href=\"https://www.youtube.com/watch?v=0dC11DMR3fU&amp;t=154s&amp;ab_channel=WeAreDevelopers\" class=\"c9sroqn card\"><div class=\"ci29ryq\"><div class=\"cajg5b6\"><picture><source type=\"image/webp\"><img src=\"/builder/a27427ee8bac4f509053ca6de1a4553a\" style=\"object-fit:cover;object-position:top;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 46vw, (max-width: 998px) 42vw, 30vw\" role=\"presentation\" loading=\"lazy\"></picture><div class=\"c43zgy5\"></div></div></div><div class=\"cpdwgtw\"><div class=\"crhhdt\"><img src=\"/builder/e2c98593b27343b0bf7b1e436769b80d.svg\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 5vw, (max-width: 998px) 4vw, 3vw\" role=\"presentation\" loading=\"lazy\"><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div><div block-id=\"builder-fbd2b04538384fbd830f83e198c0cde8\" class=\"cif4mvp\"><div class=\"builder-text\" q:key=\"builder-b6abdb76b555490d81464c154a2d428a\">Presentation</div></div></div><div block-id=\"builder-73e7eef09de1471c89897b26d4edf1e1\" class=\"clabz1x\"><div class=\"builder-text\" q:key=\"builder-6524c56f898147e8a0c03e8c013be2cc\">Qwik @ WWC22</div></div></a><div class=\"c38x0cp\"></div></div></div><!--/qv--></div><a href=\"https://qwik.dev/ecosystem\" target=\"_self\" class=\"c22yjwp\">See All</a></section></div></div><div maxwidth=\"1200\" class=\"ckuu05i builder-block\"><section class=\"cz5wnof\"><div scriptsclientonly=\"\" class=\"cw2t6dh\"><div q:key=\"builder-6cbfd600558d4904ac818bd35d6e584b\"><svg width=\"1440\" height=\"929\" viewBox=\"0 0 1440 929\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n  <ellipse cx=\"720.844\" cy=\"661.424\" rx=\"1054.64\" ry=\"658\" transform=\"rotate(-4.48315 720.844 661.424)\" fill=\"url(#paint0_radial_2038_2499)\" fill-opacity=\"0.7\"></ellipse>\n  <defs>\n    <radialGradient id=\"paint0_radial_2038_2499\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(695.289 561.632) rotate(88.0685) scale(758.222 1000)\">\n      <stop stop-color=\"#18B4F4\"></stop>\n      <stop offset=\"0.632219\" stop-color=\"#2E3772\" stop-opacity=\"0\"></stop>\n    </radialGradient>\n  </defs>\n</svg>\n</div></div><div block-id=\"builder-6c55c8bb4b5144468852cbdcf338e332\" class=\"cq5wyut\"><div class=\"builder-text\" q:key=\"builder-6cbfd600558d4904ac818bd35d6e584b\"></div></div><div class=\"ckd59h7\"><div block-id=\"builder-95de78e2afc347e88be7f6f35858a6d3\" class=\"cejtg8r\"><div class=\"builder-text\" q:key=\"builder-2fdbfd160ed74cc19d3d8d28de6d8d24\"><p>Built by <span class=\"performance\">Performance</span> Nerds</p>\n</div></div></div><div class=\"cil28rr\"><div style=\"\" class=\"cfsrkk\"><div class=\"c3zlzea\"><div class=\"c9cxwka\"><picture><source type=\"image/webp\"><img src=\"/builder/67d3020da766431cb03fbe794e808be8\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 12vw, (max-width: 998px) 22vw, 16vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div><div block-id=\"builder-561a9c2173c0495cbcd6bf6ec514e2a3\" class=\"c3r3fny\"><div class=\"builder-text\" q:key=\"builder-70c78da0ee98429085c657af1ce9ac27\">Miško Hevery</div></div></div><div style=\"order:2\" class=\"cfsrkk\"><div class=\"c3zlzea\"><div class=\"c9cxwka\"><picture><source type=\"image/webp\"><img src=\"/builder/2e03c5254011431fb48466e2e1eb08a2\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 12vw, (max-width: 998px) 22vw, 16vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div><div block-id=\"builder-561a9c2173c0495cbcd6bf6ec514e2a3\" class=\"c3r3fny\"><div class=\"builder-text\" q:key=\"builder-70c78da0ee98429085c657af1ce9ac27\">Adam Bradley</div></div></div><div style=\"\" class=\"cfsrkk\"><div class=\"c3zlzea\"><div class=\"c9cxwka\"><picture><source type=\"image/webp\"><img src=\"/builder/bef8f28d07034b91a89f4518e06314da\" style=\"object-fit:cover;object-position:center;position:absolute;height:100%;width:100%;top:0;left:0\" sizes=\"(max-width: 638px) 12vw, (max-width: 998px) 22vw, 16vw\" role=\"presentation\" loading=\"lazy\"></picture><div style=\"width:100%;padding-top:100%;pointer-events:none;font-size:0\" class=\"builder-image-sizer\"></div></div></div><div block-id=\"builder-561a9c2173c0495cbcd6bf6ec514e2a3\" class=\"c3r3fny\"><div class=\"builder-text\" q:key=\"builder-70c78da0ee98429085c657af1ce9ac27\">Manu Almeida</div></div></div></div></section></div><!--/qv--></div><script type=\"qwik/json\">{\"refs\":{\"2\":\"b! 23\",\"3\":\"b! 23\",\"4\":\"b! 23\",\"5\":\"b! 23\",\"7\":\"p! 2z\",\"8\":\"p! 2z\",\"9\":\"p! 2z\",\"a\":\"p! 2z\"},\"ctx\":{\"1\":{\"h\":\"30 q!\",\"s\":\"b! 31\"},\"6\":{\"h\":\"32 r!\",\"s\":\"p! 33\"}},\"objs\":[{},{\"path\":\"t\",\"query\":\"0\"},{\"orange\":\"u\",\"pink\":\"v\",\"green\":\"w\",\"dirtyBlack\":\"x\",\"white\":\"y\",\"blue\":\"z\",\"lightBlue\":\"10\",\"yellow\":\"11\",\"black\":\"12\",\"purple\":\"13\"},{\"data\":\"2\"},{\"siteName\":\"17\",\"link\":\"18\",\"image\":\"19\",\"performanceScore\":\"1a\",\"strokeSize\":\"1b\"},{\"siteName\":\"1c\",\"link\":\"1d\",\"image\":\"1e\",\"performanceScore\":\"1f\",\"strokeSize\":\"1g\"},{\"siteName\":\"1h\",\"link\":\"1i\",\"image\":\"1j\",\"performanceScore\":\"1k\",\"strokeSize\":\"1l\"},{\"siteName\":\"1m\",\"link\":\"1n\",\"image\":\"1o\",\"performanceScore\":\"1p\",\"strokeSize\":\"1q\"},{\"siteName\":\"1r\",\"link\":\"1s\",\"image\":\"1t\",\"performanceScore\":\"1u\",\"strokeSize\":\"1v\"},{\"siteName\":\"1w\",\"link\":\"1x\",\"image\":\"1y\",\"performanceScore\":\"1z\",\"strokeSize\":\"20\"},[\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"],{\"deviceSize\":\"s\",\"location\":\"1\",\"themeColors2022\":\"3\",\"builder-content-id\":\"14\",\"builder-id\":\"15\",\"serverStateId\":\"16\",\"featuredSites\":\"a\",\"alignLeft\":\"21\",\"rowNumber\":\"22\"},{},{\"path\":\"t\",\"query\":\"c\"},{\"orange\":\"u\",\"pink\":\"v\",\"green\":\"w\",\"dirtyBlack\":\"x\",\"white\":\"y\",\"blue\":\"z\",\"lightBlue\":\"10\",\"yellow\":\"11\",\"black\":\"12\",\"purple\":\"13\"},{\"data\":\"e\"},{\"image\":\"26\",\"link\":\"27\",\"contentType\":\"28\",\"contentName\":\"29\"},{\"image\":\"2a\",\"link\":\"2b\",\"contentType\":\"2c\",\"contentName\":\"2d\"},{\"image\":\"2e\",\"link\":\"2f\",\"contentType\":\"2g\",\"contentName\":\"2h\"},{\"image\":\"2i\",\"link\":\"2j\",\"contentType\":\"2k\",\"contentName\":\"2l\"},{\"image\":\"2m\",\"link\":\"2n\",\"contentType\":\"2g\",\"contentName\":\"2o\"},{\"image\":\"2p\",\"link\":\"2q\",\"contentType\":\"28\",\"contentName\":\"2r\"},{\"image\":\"2s\",\"link\":\"2t\",\"contentType\":\"2c\",\"contentName\":\"2u\"},{\"image\":\"2v\",\"link\":\"2w\",\"contentType\":\"2k\",\"contentName\":\"2x\"},[\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\"],{\"deviceSize\":\"s\",\"location\":\"d\",\"themeColors2022\":\"f\",\"builder-content-id\":\"24\",\"builder-id\":\"25\",\"serverStateId\":\"16\",\"featuredContent\":\"o\",\"alignLeft\":\"21\",\"rowNumber\":\"2y\"},{\"builder-content-id\":\"14\",\"builder-id\":\"15\",\"serverStateId\":\"16\",\"featuredSites\":\"a\",\"alignLeft\":\"21\",\"rowNumber\":\"22\"},{\"builder-content-id\":\"24\",\"builder-id\":\"25\",\"serverStateId\":\"16\",\"featuredContent\":\"o\",\"alignLeft\":\"21\",\"rowNumber\":\"2y\"},\"large\",\"\",\"rgba(239, 108, 65, 1)\",\"rgba(238, 177, 202, 1)\",\"rgba(51, 181, 51, 1)\",\"rgba(29, 32, 35, 1)\",\"rgba(255, 255, 255, 1)\",\"rgba(0, 108, 233, 1)\",\"rgba(24, 182, 246, 1)\",\"rgba(247, 201, 46, 1)\",\"rgba(0, 0, 0, 1)\",\"rgba(172, 126, 244, 1)\",\"2cb3cabc3ee84f0e987eb4525859e0a8\",\"builder-wmfqlb\",\"cqar6r\",\"Builder Velocity\",\"https://velocity.builder.io/\",\"/builder/aee5f202a90e4659bbc6374aed3ff138\",94,292,\"Reflect.app\",\"https://reflect.app/home\",\"/builder/ccfe1879407845b8906b870fc4ef607d\",98,293,\"Builder.io - Design to Code to Live\",\"https://www.builder.io\",\"/builder/80ac5f7793b545499d3d8944ff7ff3f3\",96,284,\"Burgers on Fleek\",\"https://www.burgersonfleek.ca/\",\"/builder/42067d8b20a74503a497b72f53665b13\",95,277,\"TatbiqIT\",\"https://tatbiqit.com/\",\"/builder/281010f5f1694d8bbf399c8ffe4a1d87\",97,290,\"Necati Koçlu\",\"https://necatikcl.dev/\",\"/builder/d1768a789936434a905973daf12768f6\",99,298,false,1,{},\"856b004403f841c789cf61f2a180c93f\",\"builder-w9qiq1\",\"/builder/91320f7f7e764055b4f1722189241838\",\"https://www.youtube.com/watch?v=x2eF3YLiNhY&ab_channel=Fireship\",\"Video\",\"Qwik First Look - Fireship Code Report\",\"/builder/4b7b38f10af348c4b8b2809db664c11f\",\"https://www.youtube.com/watch?v=_PDpoJUacuc&ab_channel=LearnWithJason\",\"Podcast\",\"Build Resumable Apps with Qwik\",\"/builder/31df46c5b87744fd8a4347d3a17a47a6\",\"https://qwikschool.com/\",\"Course\",\"Qwik School by HiRez.io\",\"/builder/c32d1ef92781491a86dcdc8859b193d2\",\"https://www.youtube.com/watch?v=Zddw6qy5pf0&ab_channel=Devoxx\",\"Presentation\",\"Qwik: No hydration & instant-on\",\"/builder/b6a806948cef4946aec55fa4fa9173cd\",\"https://www.youtube.com/watch?v=W0xjcx4mrkE&list=PL4cUxeGkcC9gOUlY-uCHurFIpqogsdOnw&ab_channel=TheNetNinja\",\"Qwik Crash Course\",\"/builder/ba922b4f3134477580035b01dc804a26\",\"https://www.youtube.com/watch?v=z14c3u9q8rI&ab_channel=Awesome\",\"Qwik First Impressions\",\"/builder/329d8065fc13497e8588c3f03df1f49a\",\"https://www.youtube.com/watch?v=fa6-Mn0Eybg&ab_channel=Theo-t3%E2%80%A4gg\",\"Qwik Chat with Theo\",\"/builder/a27427ee8bac4f509053ca6de1a4553a\",\"https://www.youtube.com/watch?v=0dC11DMR3fU&t=154s&ab_channel=WeAreDevelopers\",\"Qwik @ WWC22\",2,{},\"\\\\u0002med.js#Component2CB3CABC3EE84F0E987EB4525859E0A8OnMount\",\"niif3b-1\",\"\\\\u0002med.js#Component856B004403F841C789CF61F2A180C93FOnMount\",\"ppi5m6-1\"],\"subs\":[[\"_1\"],[\"_1\"],[\"_1\"],[\"_1\"],[\"_1\",\"0 #1 link\",\"0 #1 strokeSize\",\"0 #1 performanceScore\",\"0 #1 image\",\"0 #1 siteName\"],[\"_1\",\"0 #1 link\",\"0 #1 strokeSize\",\"0 #1 performanceScore\",\"0 #1 image\",\"0 #1 siteName\"],[\"_1\",\"0 #1 link\",\"0 #1 strokeSize\",\"0 #1 performanceScore\",\"0 #1 image\",\"0 #1 siteName\"],[\"_1\",\"0 #1 link\",\"0 #1 strokeSize\",\"0 #1 performanceScore\",\"0 #1 image\",\"0 #1 siteName\"],[\"_1\",\"0 #1 link\",\"0 #1 strokeSize\",\"0 #1 performanceScore\",\"0 #1 image\",\"0 #1 siteName\"],[\"_1\",\"0 #1 link\",\"0 #1 strokeSize\",\"0 #1 performanceScore\",\"0 #1 image\",\"0 #1 siteName\"],[\"_1\",\"0 #1\"],[\"_1\",\"0 #1 rowNumber\",\"0 #1 alignLeft\",\"0 #1 featuredSites\"],[\"_1\"],[\"_1\"],[\"_1\"],[\"_1\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6 link\",\"0 #6 image\",\"0 #6 contentType\",\"0 #6 contentName\"],[\"_1\",\"0 #6\"],[\"_1\",\"0 #6 rowNumber\",\"0 #6 alignLeft\",\"0 #6 featuredContent\"],[\"_2\"],[\"_2\"]]}</script><script>window.qwikevents||=[];window.qwikevents.push(\"click\")</script></div><!--/cq--></div></div><!--/qv--></div><script type=\"qwik/json\">{\"refs\":{\"2\":\"0! e\",\"4\":\"a! 19\",\"5\":\"a! 1b\",\"6\":\"a! 1d\",\"7\":\"a! 1f\",\"8\":\"a! 1h\",\"9\":\"a! 1j\"},\"ctx\":{\"3\":{\"h\":\"1k b!\",\"s\":\"a! 1l\"}},\"objs\":[{\"builder-content-id\":\"c\",\"builder-id\":\"d\"},{},{\"path\":\"g\",\"query\":\"1\"},{\"image\":\"k\",\"featureLink\":\"l\",\"name\":\"m\",\"description\":\"n\"},{\"image\":\"o\",\"featureLink\":\"p\",\"name\":\"q\",\"description\":\"r\"},{\"image\":\"s\",\"featureLink\":\"t\",\"name\":\"u\",\"description\":\"v\"},{\"image\":\"w\",\"featureLink\":\"x\",\"name\":\"y\",\"description\":\"z\"},{\"image\":\"10\",\"featureLink\":\"11\",\"name\":\"12\",\"description\":\"13\"},{\"image\":\"14\",\"featureLink\":\"15\",\"name\":\"16\",\"description\":\"17\"},[\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"],{\"deviceSize\":\"f\",\"location\":\"2\",\"builder-content-id\":\"h\",\"builder-id\":\"i\",\"serverStateId\":\"j\",\"features\":\"9\",\"slide\":\"18\"},{\"builder-content-id\":\"h\",\"builder-id\":\"i\",\"serverStateId\":\"j\",\"features\":\"9\",\"slide\":\"18\"},\"b417246b77124735ade3a2694cb86bf9\",\"builder-o91pel\",{},\"large\",\"\",\"3c0255d6d2d94e3390539dee6af8c7c0\",\"builder-sjpqcv\",\"w8x6w6\",\"/builder/fdc08238cb4d49d48d3a468308992e15\",\"https://qwik.dev/docs/concepts/progressive/\",\"Instant Loading\",\"<p>Because Qwik skips hydration, your applications are instantly interactive. This is accomplished by <a href=\\\\\"https://qwik.dev/docs/concepts/resumable/\\\\\" rel=\\\\\"noopener noreferrer\\\\\" target=\\\\\"_blank\\\\\">resumability</a>.</p>\",\"/builder/eee9dff8ee0e4b4e9ad1a8825643030c\",\"https://qwik.dev/docs/concepts/resumable/\",\"Resumable\",\"<p>\\\\n  Qwik apps start on the server, serializing the state into HTML and resuming\\\\n  execution in the browser where the data is already present.\\\\n</p>\\\\n<br>\\\\n<p>\\\\n  JS is only downloaded and executed when needed for user interaction or\\\\n  rendering.\\\\n</p>\\\\n\",\"/builder/8f2ccdcaa669452c85c1b74d2c162a3d\",\"https://qwik.dev/docs/advanced/speculative-module-fetching/\",\"Lazy Executing\",\"<p>\\\\n  Qwik uses \\\\\"JavaScript Streaming\\\\\" to instantly load pages and prefetch required\\\\n  code in a separate thread, similar to video streaming's \\\\\"buffering\\\\\".\\\\n</p>\\\\n<br>\\\\n<p>\\\\n  The prefetched code only executes upon user action, called \\\\\"Lazy Execution\\\\\".\\\\n</p>\\\\n\",\"/builder/efcf8d0391fe4d8bb7e557e6d295a2b2\",\"https://qwik.dev/docs/concepts/reactivity/\",\"Reduced Rendering\",\"<p>\\\\n  Upon user interaction, Qwik is surgical about which components it rerenders.\\\\n  This is done through reactivity and allows Qwik to minimize the amount of\\\\n  rendering code downloaded and executed.\\\\n</p>\\\\n<p><br /></p>\\\\n<p>\\\\n  The reactivity graph is built on the server and restored on the client without\\\\n  needing the application code to be present and re-run.\\\\n</p>\\\\n\",\"/builder/644d27976d234ec9b453501c209bffa3\",\"https://www.builder.io/blog/our-current-frameworks-are-on-we-need-o1\",\"Perf that Scales\",\"<p>The amount of code downloaded to the client is proportional to the complexity of the user interaction, not the size of all components on the current route.</p><p><br></p><p>Your site stays performant even as the complexity of the application grows over time.</p>\",\"/builder/d805a18ff6d0410f92603fb691c87349\",\"https://www.builder.io/blog/wtf-is-code-extraction\",\"Code Once\",\"<p>Qwik has a single consistent mental model for both server and client code. The same component can begin its lifecycle on the server and process user events on the client.</p><p><br></p><p>Setup DOM listeners on server render, have them be ready on your client interaction.</p>\",0,{\"featuresItem\":\"3!\",\"item\":\"3!\",\"$index\":\"18\"},1,{\"featuresItem\":\"4!\",\"item\":\"4!\",\"$index\":\"1a\"},2,{\"featuresItem\":\"5!\",\"item\":\"5!\",\"$index\":\"1c\"},3,{\"featuresItem\":\"6!\",\"item\":\"6!\",\"$index\":\"1e\"},4,{\"featuresItem\":\"7!\",\"item\":\"7!\",\"$index\":\"1g\"},5,{\"featuresItem\":\"8!\",\"item\":\"8!\",\"$index\":\"1i\"},\"\\\\u0002med.js#Component3C0255D6D2D94E3390539DEE6AF8C7C0OnMount\",\"5yjx4z-1\"],\"subs\":[[\"_1\"],[\"_1\"],[\"_1\"],[\"_1\",\"0 #3 name\",\"0 #3 image\",\"0 #3 description\",\"0 #3 featureLink\"],[\"_1\",\"0 #3 name\"],[\"_1\",\"0 #3 name\"],[\"_1\",\"0 #3 name\"],[\"_1\",\"0 #3 name\"],[\"_1\",\"0 #3 name\"],[\"_1\",\"0 #3\"],[\"_1\",\"0 #3 features\",\"0 #3 slide\"],[\"_2\"]]}</script><script>window.qwikevents||=[];window.qwikevents.push(\"click\")</script></div><!--/cq-->`;\n\nexport default component$(() => {\n  return (\n    <>\n      <Header />\n      <main dangerouslySetInnerHTML={builderContent} />\n      <div class=\"px-4\">\n        <Footer />\n      </div>\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: 'Framework reimagined for the edge!',\n};\n"
  },
  {
    "path": "packages/docs/src/routes/layout.tsx",
    "content": "import { component$, Slot } from '@builder.io/qwik';\nimport type { RequestHandler } from '@builder.io/qwik-city';\n\nexport default component$(() => {\n  return <Slot />;\n});\n\nexport const onGet: RequestHandler = ({ cacheControl }) => {\n  // cache for pages using this layout\n  cacheControl({\n    public: true,\n    maxAge: 3600,\n  });\n};\n"
  },
  {
    "path": "packages/docs/src/routes/playground/app/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <p>Hello Qwik</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/playground/app/entry.server.tsx",
    "content": "import { renderToString, type RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/playground/app/root.tsx",
    "content": "import App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Hello Qwik</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/docs/src/routes/playground/index!.tsx",
    "content": "import { $, component$, useStyles$, useStore, useVisibleTask$, useTask$ } from '@builder.io/qwik';\nimport type { RequestHandler, DocumentHead } from '@builder.io/qwik-city';\nimport { Repl } from '../../repl/ui';\nimport { Header } from '../../components/header/header';\nimport styles from './playground.css?inline';\nimport playgroundApp from '@playground-data';\nimport type { ReplAppInput } from '../../repl/types';\nimport { createPlaygroundShareUrl, parsePlaygroundShareUrl } from '../../repl/ui/repl-share-url';\nimport { PanelToggle } from '../../components/panel-toggle/panel-toggle';\nimport { isBrowser } from '@builder.io/qwik';\nimport { setReplCorsHeaders } from '~/utils/utils';\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  const store = useStore<PlaygroundStore>(() => {\n    const initStore: PlaygroundStore = {\n      files: playgroundApp.inputs,\n      version: '',\n      buildMode: 'development',\n      entryStrategy: 'segment',\n      colResizeActive: false,\n      colLeft: 50,\n      shareUrlTmr: null,\n    };\n    return initStore;\n  });\n\n  const panelStore = useStore(() => ({\n    active: 'Input',\n    list: ['Input', 'Output', 'Console'],\n  }));\n\n  useVisibleTask$(() => {\n    // run once on the client\n    const shareData = parsePlaygroundShareUrl(location.hash.slice(1));\n    if (shareData) {\n      store.version = shareData.version;\n      store.buildMode = shareData.buildMode;\n      store.entryStrategy = shareData.entryStrategy;\n      store.files = shareData.files;\n    }\n  });\n\n  useTask$(({ track }) => {\n    track(() => store.buildMode);\n    track(() => store.entryStrategy);\n    track(() => store.version);\n    track(() => store.files.forEach((f) => f.code));\n\n    if (isBrowser) {\n      if (store.version) {\n        clearTimeout(store.shareUrlTmr);\n\n        store.shareUrlTmr = setTimeout(() => {\n          const shareUrl = createPlaygroundShareUrl(store);\n          history.replaceState({}, '', shareUrl);\n        }, 1000);\n      }\n    }\n  });\n\n  const pointerDown = $(() => {\n    store.colResizeActive = true;\n  });\n\n  const pointerMove = $((ev: PointerEvent) => {\n    if (store.colResizeActive) {\n      store.colLeft = (ev.clientX, ev.clientX / window.innerWidth) * 100;\n      store.colLeft = Math.max(25, store.colLeft);\n      store.colLeft = Math.min(75, store.colLeft);\n    }\n  });\n\n  const pointerUp = $(() => {\n    store.colResizeActive = false;\n  });\n\n  return (\n    <div\n      class={{\n        playground: true,\n        'full-width': true,\n        'fixed-header': true,\n        'repl-resize-active': store.colResizeActive,\n      }}\n    >\n      <Header />\n\n      <div\n        class={{\n          'repl-panel-output': panelStore.active === 'Output',\n          'repl-panel-console': panelStore.active === 'Console',\n          repl: true,\n        }}\n        style={{\n          gridTemplateColumns: `${store.colLeft}% ${100 - store.colLeft}%`,\n        }}\n      >\n        <Repl\n          input={store}\n          enableCopyToPlayground={false}\n          enableDownload={true}\n          enableInputDelete={true}\n        />\n      </div>\n\n      <div\n        class=\"repl-col-resize-bar\"\n        onPointerDown$={pointerDown}\n        onPointerMove$={pointerMove}\n        onPointerUp$={pointerUp}\n        onPointerOut$={pointerUp}\n        style={{\n          left: `calc(${store.colLeft}% - 6px)`,\n        }}\n      />\n      <PanelToggle panelStore={panelStore} />\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: 'Playground',\n};\n\nexport interface PlaygroundStore extends ReplAppInput {\n  colResizeActive: boolean;\n  colLeft: number;\n  shareUrlTmr: any;\n}\n\nexport const onGet: RequestHandler = ({ cacheControl, headers }) => {\n  cacheControl({\n    public: true,\n    maxAge: 3600,\n  });\n\n  setReplCorsHeaders(headers);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/playground/playground-data.ts",
    "content": "import type { ReplModuleInput } from '../../repl/types';\n\nexport interface PlaygroundApp {\n  inputs: ReplModuleInput[];\n}\n\n/**\n * Generated at build-time.\n *\n * /packages/docs/src/routes/playground/app\n */\nconst playgroundApp: PlaygroundApp = {} as any;\nexport default playgroundApp;\n"
  },
  {
    "path": "packages/docs/src/routes/playground/playground.css",
    "content": ".playground {\n  width: 100%;\n  height: cal(100vh - var(--header-height));\n  height: cal(100dvh - var(--header-height));\n\n  --playground-header-height: 0px;\n}\n\n.playground .repl {\n  display: grid;\n  grid-template-columns: 50% 50%;\n  grid-template-rows: 1fr 40%;\n  grid-template-areas:\n    'repl-input-panel repl-output-panel'\n    'repl-input-panel repl-detail-panel';\n  top: calc(var(--header-height) + var(--playground-header-height));\n  height: calc(100vh - var(--header-height) - var(--panel-toggle-height));\n  height: calc(100dvh - var(--header-height) - var(--panel-toggle-height));\n}\n\n.playground .repl-col-resize-bar {\n  position: absolute;\n  z-index: 20;\n  top: var(--playground-header-height);\n  left: calc(50% - 6px);\n  width: 12px;\n  height: calc(100vh - var(--header-height) - var(--playground-header-height));\n  cursor: ew-resize;\n  user-select: none;\n}\n\n.playground.repl-resize-active .repl-col-resize-bar {\n  width: 100%;\n  transform: translate(-50%, 0);\n  pointer-events: initial;\n}\n\n.playground.repl-resize-active {\n  pointer-events: none;\n  user-select: none;\n}\n\n.playground-header {\n  height: var(--playground-header-height);\n  background-color: #2a354d;\n}\n\n.playground-header select {\n  background-color: white;\n  color: black;\n  border-radius: 3px;\n  margin: 8px 0 0 12px;\n  font-size: 14px;\n}\n\n.playground .repl-input-panel {\n  border-right: 1px solid var(--repl-tab-bg-color);\n}\n\n@media (max-width: 768px) {\n  body {\n    overflow-x: hidden;\n  }\n  .playground .repl {\n    width: 300vw;\n    grid-template-rows: 100%;\n    grid-template-columns: 33.33% 33.33% 33.33% !important;\n    grid-template-areas: 'repl-input-panel repl-output-panel repl-detail-panel';\n    transition: transform 500ms;\n  }\n  .repl-panel-output {\n    transform: translateX(-33.33%);\n  }\n  .repl-panel-console {\n    transform: translateX(-66.66%);\n  }\n  .playground .repl-col-resize-bar {\n    display: none;\n  }\n}\n"
  },
  {
    "path": "packages/docs/src/routes/plugin@builder.io-redirect.ts",
    "content": "import type { RequestHandler } from '@builder.io/qwik-city/middleware/request-handler';\n\n/**\n * @file\n *\n *   Redirects requests from Builder.io to the qwik.dev domain.\n *\n *   This redirect has been placed here because of security vulnerabilities on the builder.io domain.\n *\n *   # Issue\n *\n *   - Because of Qwik REPL is is possible to write arbitrary code that runs on a builder.io subdomain\n *       with qwik.dev/repl\n *   - This opens vulnerabilities around XSS, cookie jacking, because builder.io uses cross-subdomain\n *       cookies\n *\n *   # Solution\n *\n *   - Move the qwik.dev/repl of the qwik.dev domain to the qwik.dev domain.\n *   - Place a 308 redirect here to ensure that all requests to the builder.io domain are redirected to\n *       the qwik.dev domain.\n */\n\nexport const onRequest: RequestHandler = ({ request, redirect }) => {\n  const url = new URL(request.url);\n  if (url.hostname === 'qwik.builder.io') {\n    // Redirect to the Builder.io plugin\n    url.hostname = 'qwik.dev';\n    const pathname = url.pathname;\n    if (pathname.startsWith('/repl/')) {\n      // Prevent anything from /repl/ from being redirected so that we don't accidentally serve a script tag.\n      url.pathname = '';\n    }\n    throw redirect(308, url.toString());\n  }\n};\n"
  },
  {
    "path": "packages/docs/src/routes/plugin@redirects.ts",
    "content": "import type { RequestEvent } from '@builder.io/qwik-city';\n\n// Keep in sync with `public/_redirects`\n\nexport const onGet = ({ url, redirect }: RequestEvent) => {\n  const { pathname } = url;\n  const tempRedirect = tempRedirects[pathname];\n  if (tempRedirect) {\n    throw redirect(307, tempRedirect);\n  }\n  const redirectUrl = redirects[pathname];\n  if (redirectUrl) {\n    throw redirect(308, redirectUrl);\n  }\n  const rewritePrefix = (path: string, replacement: string) => {\n    if (pathname.startsWith(path)) {\n      throw redirect(308, pathname.replace(path, replacement));\n    }\n  };\n  rewritePrefix('/docs/components/', '/docs/core/');\n  rewritePrefix('/deployments/', '/docs/deployments/');\n  rewritePrefix('/integrations/', '/docs/integrations/');\n  rewritePrefix('/qwikcity/', '/docs/');\n};\n\nconst tempRedirects: Record<string, string> = {\n  '/chat': ' https://discord.gg/TsNCMd6uGW',\n  '/chat/': ' https://discord.gg/TsNCMd6uGW',\n\n  '/examples ': '/examples/introduction/hello-world/',\n  '/examples/ ': '/examples/introduction/hello-world/',\n  '/guide ': '/docs/',\n  '/guide/ ': '/docs/',\n  '/tutorial ': '/tutorial/welcome/overview/',\n  '/tutorial/ ': '/tutorial/welcome/overview/',\n  '/tutorials ': '/tutorial/welcome/overview/',\n  '/tutorials/ ': '/tutorial/welcome/overview/',\n};\n\nconst redirects: Record<string, string> = {\n  '/tutorial/hooks/use-client-effect/': '/tutorial/hooks/use-visible-task/',\n\n  '/integrations/deployments/azure-swa/': '/deployments/azure-swa/',\n  '/integrations/deployments/cloudflare-pages/': '/deployments/cloudflare-pages/',\n  '/integrations/deployments/express/': '/deployments/express/',\n  '/integrations/deployments/netlify-edge/': '/deployments/netlify-edge/',\n  '/integrations/deployments/vercel-edge/': '/deployments/vercel-edge/',\n\n  '/qwikcity/advanced/prefetching/': '/docs/advanced/modules-prefetching/',\n  '/qwikcity/content/component/': '/docs/pages/',\n  '/qwikcity/content/head/': '/docs/pages/',\n  '/qwikcity/content/mdx/': '/docs/guides/mdx/',\n  '/qwikcity/content/menu/': '/docs/advanced/menu/',\n  '/qwikcity/data/endpoints/': '/docs/endpoints/',\n  '/qwikcity/data/modify/': '/docs/endpoints/',\n  '/qwikcity/data/overview/': '/docs/routing/',\n  '/qwikcity/data/redirects/': '/docs/guides/redirects/',\n  '/qwikcity/data/retrieve/': '/docs/routing/',\n  '/qwikcity/directory-layout/': '/docs/project-structure/',\n  '/qwikcity/layout/grouped/': '/docs/advanced/routing/',\n  '/qwikcity/layout/named/': '/docs/advanced/routing/',\n  '/qwikcity/layout/nested/': '/docs/advanced/routing/',\n  '/qwikcity/layout/overview/': '/docs/layout/',\n  '/qwikcity/loader/': '/docs/route-loader/',\n  '/qwikcity/middleware/azure-swa/': '/deployments/azure-swa/',\n  '/qwikcity/middleware/cloudflare-pages/': '/deployments/cloudflare-pages/',\n  '/qwikcity/middleware/express/': '/deployments/node/',\n  '/qwikcity/middleware/netlify-edge/': '/deployments/netlify-edge/',\n  '/qwikcity/middleware/node/': '/deployments/node/',\n  '/qwikcity/prefetching/overview/': '/docs/advanced/speculative-module-fetching/',\n  '/qwikcity/prefetching/parallelizing-network-requests/':\n    '/docs/advanced/speculative-module-fetching/',\n  '/qwikcity/prefetching/request-response-cache/': '/docs/advanced/speculative-module-fetching/',\n  '/qwikcity/prefetching/service-worker-prefetching/':\n    '/docs/advanced/speculative-module-fetching/',\n  '/qwikcity/routing/error-responses/': '/docs/advanced/routing/',\n  '/qwikcity/routing/overview/': '/docs/routing/',\n  '/qwikcity/routing/pathless/': '/docs/layout/grouped/',\n  '/qwikcity/routing/route-parameters/': '/docs/routing/',\n  '/qwikcity/static-assets/': '/docs/advanced/static-assets/',\n  '/qwikcity/static-site-generation/dynamic-routes/': '/docs/guides/static-site-generation/',\n  '/qwikcity/static-site-generation/overview/': '/docs/guides/static-site-generation/',\n  '/qwikcity/static-site-generation/static-site-config/': '/docs/guides/static-site-generation/',\n\n  '/docs/advanced/i18n/': '/docs/integrations/i18n/',\n  '/docs/cheat/best-practices/': '/docs/guides/best-practices/',\n  '/docs/cheat/qwik-react/': '/docs/integrations/react/',\n  '/docs/cheat/serialization/': '/docs/guides/serialization/',\n  '/docs/components/inline-components/': '/docs/core/overview/',\n  '/docs/components/lifecycle/': '/docs/core/tasks/',\n  '/docs/components/projection/': '/docs/core/slots/',\n  '/docs/components/resource/': '/docs/core/state/',\n  '/docs/cookbook/re-exporting-loaders/': '/docs/re-exporting-loaders/',\n  '/docs/env-variables/': '/docs/guides/env-variables/',\n  '/docs/overview': '/docs/',\n  '/docs/overview/': '/docs/',\n  '/docs/think-qwik/': '/docs/concepts/think-qwik/',\n};\n"
  },
  {
    "path": "packages/docs/src/routes/press/index.tsx",
    "content": "import { component$, $, useSignal } from '@builder.io/qwik';\nimport QwikLogo from '/public/logos/qwik.png?jsx';\nimport QwikLogouwu from '/public/logos/qwik-uwu.webp?jsx';\nimport QwikSocial from '/public/logos/social-card.png?jsx';\nimport QwikSocial2 from '/public/logos/social-card.jpg?jsx';\nimport { Header } from '~/components/header/header';\nimport { Footer } from '~/components/footer/footer';\nimport { Slot } from '@builder.io/qwik';\nconst DownloadButton = component$((props: { href: string | undefined }) => {\n  return (\n    <a\n      class=\"\n          flex justify-between items-center py-0 px-2 my-0 mx-4 h-8 font-medium text-center  border-2 border-solid cursor-pointer select-none border-sky-500     text-sky-500 w-fit self-center rounded-md \"\n      href={props.href ?? '/logos/qwik.png'}\n      download\n    >\n      <p class=\"hover:underline\"> Download</p>{' '}\n    </a>\n  );\n});\n\nexport default component$(() => {\n  const activeColor = useSignal<string>('');\n\n  const color = {\n    qwikBlue: '#009dfd',\n    qwikDarkBlue: '#006ce9',\n    qwikLightBlue: '#daf0ff',\n    qwikPurple: '#ac7ef4',\n    qwikDarkPurple: '#6000ff',\n    qwikDarkPurpleBg: '#151934',\n  } as const;\n\n  const copyToClipboard = $(async (text: string) => {\n    try {\n      if (!navigator.clipboard) {\n        activeColor.value = text;\n        return;\n      }\n      await navigator.clipboard.writeText(text);\n      activeColor.value = text;\n      const rs = setTimeout(() => {\n        const old = activeColor.value;\n        if (old === text) {\n          activeColor.value = '';\n        }\n      }, 1500);\n      return () => clearTimeout(rs);\n    } catch (err) {\n      console.error('Failed to copy: ', err);\n    }\n  });\n\n  const logos = [\n    {\n      title: 'Qwik Logo (png)',\n      alt: 'Qwik Logo in PNG format',\n      downloadHref: '/logos/qwik.png',\n      Logo: QwikLogo,\n    },\n    {\n      title: 'Qwik Logo (svg)',\n      alt: 'Qwik Logo in SVG format',\n      downloadHref: '/logos/qwik.svg',\n      Logo: 'img',\n      src: '/logos/qwik.svg',\n    },\n    {\n      title: 'Qwik Logo (uwu)',\n      alt: 'Qwik Logo in UWU format',\n      downloadHref: '/logos/qwik-uwu.webp',\n      Logo: QwikLogouwu,\n      className: 'h-auto w-auto object-contain',\n    },\n    {\n      title: 'Qwik social card Light',\n      alt: 'Qwik Social Card in Light theme',\n      downloadHref: '/logos/social-card.png',\n      Logo: QwikSocial,\n    },\n    {\n      title: 'Qwik social card Dark',\n      alt: 'Qwik Social Card in Dark theme',\n      downloadHref: '/logos/social-card.jpg',\n      Logo: QwikSocial2,\n    },\n  ];\n  const downloadAllAssets = $(() => {\n    const links = [\n      '/logos/qwik.png',\n      '/logos/qwik.svg',\n      '/logos/qwik-uwu.webp',\n      '/logos/social-card.png',\n      '/logos/social-card.jpg',\n    ];\n\n    links.forEach((link) => {\n      const anchor = document.createElement('a');\n      anchor.href = link;\n      anchor.download = link.split('/').pop() as string;\n      document.body.appendChild(anchor);\n      anchor.click();\n      document.body.removeChild(anchor);\n    });\n  });\n\n  const Logo = component$((props: { title: string; alt: string; downloadHref: string }) => {\n    return (\n      <div class=\"flex flex-col justify-between h-72 border border-gray-200 rounded-lg shadow-md hover:shadow-lg transition-shadow duration-300\">\n        <p class=\"text-2xl font-bold text-center py-4 \">{props.title}</p>\n        <div class=\"flex-grow flex items-center justify-center overflow-hidden px-2\">\n          <Slot name=\"logo\" />\n        </div>\n        <div class=\"flex justify-center mt-auto py-4\">\n          <DownloadButton href={props.downloadHref} />\n        </div>\n      </div>\n    );\n  });\n\n  const ColorButton = component$(\n    (props: { color: string; name: string; hexCode: string; text: string | undefined }) => {\n      return (\n        <button\n          onClick$={() => copyToClipboard(props.hexCode)}\n          style={`background-color:${props.color};`}\n          class=\"flex justify-center text-white items-center cursor-pointer h-12  \"\n        >\n          {activeColor.value === props.hexCode ? (\n            <p class={props.color === 'var(--qwik-light-blue)' ? 'text-black' : 'text-white'}>\n              Copied ✓\n            </p>\n          ) : (\n            <p class={props.color === 'var(--qwik-light-blue)' ? 'text-black' : ''}>\n              {props.name} {props.hexCode}\n            </p>\n          )}\n        </button>\n      );\n    }\n  );\n\n  const qwikColors = [\n    { color: 'var(--qwik-blue)', name: 'Qwik Blue', hexCode: color.qwikBlue },\n    { color: 'var(--qwik-dark-blue)', name: 'Qwik Dark Blue', hexCode: color.qwikDarkBlue },\n    { color: 'var(--qwik-light-blue)', name: 'Qwik Light Blue', hexCode: color.qwikLightBlue },\n    { color: 'var(--qwik-purple)', name: 'Qwik Purple', hexCode: color.qwikPurple },\n    { color: 'var(--qwik-dark-purple)', name: 'Qwik Dark Purple', hexCode: color.qwikDarkPurple },\n    {\n      color: 'var(--qwik-dark-purple-bg)',\n      name: 'Qwik Dark Purple Bg',\n      text: 'var(--qwik-light-blue)',\n      hexCode: color.qwikDarkPurpleBg,\n    },\n  ];\n\n  return (\n    <main>\n      <Header />\n      <div class=\"grid grid-cols-1 md:grid-cols-3 gap-5 p-2 px-10 py-10 md:px-32\">\n        {logos.map((item) => (\n          <Logo key={item.title} title={item.title} alt={item.alt} downloadHref={item.downloadHref}>\n            {item.Logo === 'img' ? (\n              <img q:slot=\"logo\" src={item.src} alt={item.alt} class=\"bg-cover\" />\n            ) : (\n              <item.Logo q:slot=\"logo\" alt={item.alt} class={item.className} />\n            )}\n          </Logo>\n        ))}\n        <div class=\"flex flex-col justify-between h-72 border border-gray-200 rounded-lg shadow-md hover:shadow-lg transition-shadow duration-300\">\n          <div class=\"flex-grow grid grid-rows-6 text-center overflow-hidden px-2 py-2\">\n            {qwikColors.map((colorItem) => (\n              <ColorButton\n                key={colorItem.name}\n                color={colorItem.color}\n                name={colorItem.name}\n                text={colorItem.text}\n                hexCode={colorItem.hexCode}\n              />\n            ))}\n          </div>\n        </div>\n      </div>\n      <div class=\"flex justify-center mt-1\">\n        <a\n          onClick$={downloadAllAssets}\n          class=\"flex justify-between items-center py-2 px-4 font-medium text-center border-2 border-solid cursor-pointer select-none border-sky-500 text-sky-500 rounded-md hover:bg-sky-500 hover:text-white transition-colors duration-300\"\n          download\n        >\n          Download All Logos\n        </a>\n      </div>\n      <Footer />\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/query/[id]/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n// import { routeLoader$, server$ } from '@builder.io/qwik-city';\n// import { createClient } from '@supabase/supabase-js';\n// import { normalizeLine, resolveContext } from '../../../components/qwik-gpt/search';\n\n// export const approveId = server$(async function (id: string, approved: boolean) {\n//   const supabase = createClient(this.env.get('SUPABASE_URL')!, this.env.get('SUPABASE_KEY')!);\n//   await supabase.from('search_queries').update({ approved }).filter('id', 'eq', id);\n// });\n\n// export const useQueryData = routeLoader$(async (ev) => {\n//   if (ev.query.get('token') !== ev.env.get('DEBUG_TOKEN')) {\n//     throw ev.redirect(308, '/');\n//   }\n//   const query_id = ev.params.id;\n//   const supabase = createClient(ev.env.get('SUPABASE_URL')!, ev.env.get('SUPABASE_KEY')!);\n//   const output = await supabase\n//     .from('search_queries')\n//     .select('query, embedding, results, output, model, approved')\n//     .filter('id', 'eq', query_id)\n//     .limit(1);\n\n//   if (!output.data || output.data.length !== 1) {\n//     return null;\n//   }\n//   const entry = output.data[0];\n\n//   const all_results = await supabase.rpc('match_docs_10', {\n//     query_text: normalizeLine(entry.query).replaceAll(' ', '|'),\n//     query_embedding: entry.embedding,\n//     match_count: 40,\n//     similarity_threshold: 0.6,\n//   });\n\n//   all_results.data.forEach((result: any) => {\n//     result.included = entry.results.some((r: any) => r.key === result.key);\n//   });\n\n//   const output2 = await supabase.rpc('match_output_9', {\n//     match_id: query_id,\n//   });\n//   return {\n//     id: query_id,\n//     query: entry.query,\n//     results: all_results,\n//     input: await resolveContext(entry.results),\n//     similar: output2.data,\n//     output: entry.output,\n//     model: entry.model,\n//     approved: entry.approved,\n//   };\n// });\n\nexport default component$(() => {\n  // const queryData = useQueryData().value;\n  const queryData = null;\n  if (queryData === null) {\n    return <div>Query not found</div>;\n  }\n\n  // return (\n  //   <div>\n  //     <h1 class=\"text-3xl\">Query: {queryData.query}</h1>\n  //     <h2 class=\"text-3xl\">Model: {queryData.model}</h2>\n  //     <div>\n  //       <div>Currently {queryData.approved ? 'APPROVED' : 'NOT APPROVED'}</div>\n  //       <div>\n  //         <button\n  //           class=\"block border p-5 \"\n  //           onClick$={async () => {\n  //             await approveId(queryData.id, !queryData.approved);\n  //             location.reload();\n  //           }}\n  //         >\n  //           {!queryData.approved ? 'SET APPROVED' : 'UNAPPROVE'}\n  //         </button>\n  //       </div>\n  //     </div>\n  //     <div class=\"flex\">\n  //       <div class=\"flex-1 w-0\">\n  //         <h2 class=\"text-3xl\">Input:</h2>\n  //         <pre class=\"text-xs overflow-x-scroll\">{queryData.input}</pre>\n  //       </div>\n  //       <div class=\"flex-1 w-0\">\n  //         <h2 class=\"text-3xl\">Output:</h2>\n  //         <pre class=\"text-xs overflow-x-scroll\">{queryData.output}</pre>\n  //       </div>\n  //     </div>\n\n  //     <h2 class=\"text-3xl\">Results</h2>\n  //     <table class=\"text-xs table-auto border-collapse border border-slate-500\">\n  //       <tbody>\n  //         {queryData.results.data.map((result: any, i: any) => (\n  //           <tr\n  //             key={i}\n  //             class={{\n  //               'border-spacing-5': true,\n  //               'bg-green-400': result.included,\n  //             }}\n  //           >\n  //             <td class=\"border border-slate-600\">{i}</td>\n  //             <td class=\"border border-slate-600\">{(result.similarity as number).toFixed(4)}</td>\n  //             <td class=\"border border-slate-600\">{(result.fts_rank as number).toFixed(4)}</td>\n  //             <td class=\"border border-slate-600\">\n  //               {result.file.replace('packages/docs/src/routes/', '')}:{result.line}\n  //             </td>\n  //             <td class=\"border border-slate-600\">{result.content}</td>\n  //           </tr>\n  //         ))}\n  //       </tbody>\n  //     </table>\n\n  //     <h2>Similar queries</h2>\n  //     <table class=\"text-xs table-auto border-collapse border border-slate-500\">\n  //       <tbody>\n  //         {queryData.similar.map((result: any, key: string) => (\n  //           <tr\n  //             key={key}\n  //             class={{\n  //               'border-spacing-5': true,\n  //               'bg-red-400': result.rate < 0,\n  //               'bg-green-400': result.rate > 0,\n  //             }}\n  //           >\n  //             <td class=\"border border-slate-600\">{result.id}</td>\n  //             <td class=\"border border-slate-600\">{result.query}</td>\n  //             <td class=\"border border-slate-600\">{result.message}</td>\n  //             <td class=\"border border-slate-600\">{result.rate}</td>\n  //           </tr>\n  //         ))}\n  //       </tbody>\n  //     </table>\n  //   </div>\n  // );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/query/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n// import { routeLoader$ } from '@builder.io/qwik-city';\n// import { createClient } from '@supabase/supabase-js';\n\n// export const useQueryData = routeLoader$(async (ev) => {\n//   const token = ev.query.get('token');\n//   if (token !== ev.env.get('DEBUG_TOKEN')) {\n//     throw ev.redirect(308, '/');\n//   }\n//   const supabase = createClient(ev.env.get('SUPABASE_URL')!, ev.env.get('SUPABASE_KEY')!);\n//   const output = await supabase.rpc('list_queries_2', {\n//     match_count: 100,\n//   });\n\n//   return {\n//     token,\n//     results: output,\n//   };\n// });\n\nexport default component$(() => {\n  // const queryData = useQueryData().value;\n  const queryData = null;\n  if (queryData === null) {\n    return <div>Query not found</div>;\n  }\n\n  // return (\n  //   <div>\n  //     <h2>Results</h2>\n  //     <table class=\"border border-slate-500\">\n  //       <tbody>\n  //         {queryData.results.data?.map((result: any, i: any) => (\n  //           <tr\n  //             key={i}\n  //             class={{\n  //               'bg-red-400': result.rate < 0,\n  //               'bg-green-400': result.rate > 0,\n  //               'bg-blue-400': result.approved > 0,\n  //             }}\n  //           >\n  //             <td class=\"border border-slate-500\">{i}</td>\n  //             <td class=\"border border-slate-500\">{result.query}</td>\n  //             <td class=\"border border-slate-500\">{result.created_at}</td>\n  //             <td class=\"border border-slate-500\">\n  //               <a href={`/query/${result.id}/?token=${queryData.token}`}>Open</a>\n  //             </td>\n  //           </tr>\n  //         ))}\n  //       </tbody>\n  //     </table>\n  //   </div>\n  // );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/repl/[catchAll]/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>REPL</h1>\n      <p>\n        Normally, you would see the REPL output here. You're seeing this content because something\n        went wrong.\n      </p>\n      <p>Please try reloading the page or checking your console for errors.</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/repl/repl-sw.js/entry.ts",
    "content": "import '../../../repl/repl-sw';\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/basic/index.mdx",
    "content": "---\ntitle: Basic Component | Tutorial\ncontributors:\n  - adamdbradley\n  - brunocrosier\n  - mhevery\n  - manucorporat\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nComponents are the building blocks of a Qwik application. Components are declared using [`component$()`](/docs/(qwik)/core/overview/index.mdx#component) and at a minimum need to return a JSX Element.\n\nCreate a component that returns `Hello World!`\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/basic/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <p>__put_something_here__</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/basic/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <div>Hello World!</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/binding/index.mdx",
    "content": "---\ntitle: Binding Expressions | Tutorial\ncontributors:\n  - adamdbradley\n  - mrhoodz\n  - neonpie\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nThe purpose of components is to merge data with the JSX template. You use the `{expression}` to inject data into a template. Expressions are placed either as a text node or attribute on an element.\n\n- Bind `data.name` to the `value` attribute of `<input/>`.\n- Bind `data.description` to the value of `<textarea/>`.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/binding/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  // @ts-ignore\n  const data = {\n    name: 'Qwik',\n    description: DESCRIPTION,\n  };\n\n  return (\n    <>\n      <input value=\"data.name should go here\" />\n      <br />\n      <textarea rows={10} cols={60} value=\"data.description should go here\"></textarea>\n    </>\n  );\n});\n\nexport const DESCRIPTION = `\nQwik is designed for the fastest possible page load time,\nby delivering pure HTML with near 0 JavaScript for your\npages to become interactive, regardless of how complex\nyour site or app is. It achieves this via resumability\nof code.`;\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/binding/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const data = {\n    name: 'Qwik',\n    description: DESCRIPTION,\n  };\n\n  return (\n    <>\n      <input value={data.name} />\n      <br />\n      <textarea rows={10} cols={60} value={data.description}></textarea>\n    </>\n  );\n});\n\nexport const DESCRIPTION = `\nQwik is designed for the fastest possible page load time,\nby delivering pure HTML with near 0 JavaScript for your\npages to become interactive, regardless of how complex\nyour site or app is. It achieves this via resumability\nof code.`;\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/composition/index.mdx",
    "content": "---\ntitle: Component Composition | Tutorial\ncontributors:\n  - adamdbradley\n  - neonpie\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nComponents are composed together to build applications.\n\nIn this example, the `<App />` and `<Greeter />` components are prepared for you. For this exercise, place the `<Greeter />` component inside the `<App />` (the default export) component to see its contents.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/composition/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      Insert Greeter component here. By composing components together large applications can be\n      written without putting all of the code into a single file/component.\n    </main>\n  );\n});\n\nexport const Greeter = component$(() => {\n  return <div>Hello World!</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/composition/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      <Greeter />\n    </main>\n  );\n});\n\nexport const Greeter = component$(() => {\n  return <div>Hello World!</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/lite/index.mdx",
    "content": "---\ntitle: Inline Component | Tutorial\ncontributors:\n  - adamdbradley\n  - the-r3aper7\n  - manucorporat\n  - steve8708\n  - mhevery\n  - zanettin\n  - fkruczek\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-02-11T08:04:18Z'\n---\n\nOne of Qwik's super powers lies in its lazy-loading features. Each component will generate a separate Symbol which is downloaded on demand. This allows you to build a large application with many components and only download the components that are needed for the current view.\n\nBut for some cases you may want to load a component together with the parent component. For example, if you have a `<Greeter>` component that is always used with the `<App>` component, you may want to load the `<Greeter>` component with the `<App>` component. This is called an [inline component](/docs/(qwik)/core/overview/index.mdx#inline-components).\n\nIn this example, the `<App>` and a `<Greeter>` components are prepared for you. The `<Greeter />` component is declared using the [`component$()`](/docs/(qwik)/core/overview/index.mdx#component) method and is a Qwik component. Remove the [`component$()`](/docs/(qwik)/core/overview/index.mdx#component) to convert `<Greeter>` to a [inline component](/docs/(qwik)/core/overview/index.mdx#inline-components).\n\nOpen the `Symbols` tab and notice that the `<Greeter />` component is no longer an independent export, but instead is bundled as part of the `<App>` component.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/lite/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      <Greeter />\n    </main>\n  );\n});\n\nexport const Greeter = component$(() => {\n  return <div>Hello World!</div>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/component/lite/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      <Greeter />\n    </main>\n  );\n});\n\nexport const Greeter = () => {\n  return <div>Hello World!</div>;\n};\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/composing/dollar/index.mdx",
    "content": "---\ntitle: Creating APIs with $ | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nA powerful feature of the Optimizer is that you can create your own APIs with a `$` suffix.\n\nImagine that we would like to have a delay method that lazy loads its callback. Normally we would have to write something like this:\n\n```tsx\nsetTimeout(() => {\n  // I am eagerly loaded, but it would be better if I was lazy-loaded.\n  ...\n}, timeout);\n```\n\nThe issue with the example above is that the callback has to be downloaded and created eagerly. This may be an issue if the closure is large or if the callback is never executed (or only executed later.)\n\nA better solution would be to have `delay$` method that can lazy-load the closure associated with the callback. Something like this.\n\n```tsx\ndelay$(() => {\n  // I am lazy-loaded only when I need to be executed.\n  ...\n}, 1000)\n```\n\nIn the above solution, the callback is only downloaded when `delay$` is ready to execute it.\n\n## Creating your APIs with `$` suffix\n\nQwik runtime works with `QRL`s. For this reason we define a method like so:\n\n```tsx\nexport function delayQrl<T>(fn: QRL<() => T>, delayInMs: number): Promise<T> {\n  return new Promise((res) => {\n    setTimeout(() => {\n      res(fn.invoke());\n    }, delayInMs);\n  });\n}\n```\n\nThis method knows how to take a `QRL` and execute it after a certain delay. The key part here is that the `QRL.invoke()` method is called when the delay is ready and is therefore lazy.\n\nThe next step is to convert the `delayQrl` method to a `delay$` alias. This is done with `implicit$FirstArg` like so:\n\n```tsx\nexport const delay$ = implicit$FirstArg(delayQrl);\n```\n\nHere are the types to make it clearer as to what is going on.\n\n```tsx\ndeclare function delayQrl<T>(fn: QRL<() => T>, delayInMs: number): Promise<T>;\ndeclare function delay$<T>(fn: () => T, delayInMs: number): Promise<T>;\n```\n\nThe above allows us to use `delay$` in an inlined fashion, but the Optimizer converts the `delay$` to `delayQrl` form.\n\n> **NOTE** the two methods must have the same prefix. So a general form is:\n\n```tsx\nexport const SOME_NAME_Qrl = ...;\nexport const SOME_NAME_$ = implicit$FirstArg(SOME_NAME_Qrl);\n```\n\n### Example\n\nIn our example we are executing `store.count++` and `store.delay++` together. Wrap the `store.delay` in `delay$()` call so that it updates with a one second delay.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/composing/dollar/problem/app.tsx",
    "content": "import { component$, type QRL, implicit$FirstArg, useStore } from '@builder.io/qwik';\n\nexport function delayQrl<T>(fn: QRL<() => T>, delayInMs: number): Promise<T> {\n  return new Promise((res) => {\n    setTimeout(() => {\n      res(fn());\n    }, delayInMs);\n  });\n}\n\nexport const delay$ = implicit$FirstArg(delayQrl);\n\nexport default component$(() => {\n  const store = useStore({ count: 0, delay: 0 });\n  return (\n    <>\n      Count: {store.count} <br />\n      Delay: {store.delay} <br />\n      <button\n        onClick$={async () => {\n          store.count++;\n          // This code should be delayed by 1000ms\n          store.delay++;\n        }}\n      >\n        +1\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/composing/dollar/solution/app.tsx",
    "content": "import { component$, type QRL, implicit$FirstArg, useStore } from '@builder.io/qwik';\n\nexport function delayQrl<T>(fn: QRL<() => T>, delayInMs: number): Promise<T> {\n  return new Promise((res) => {\n    setTimeout(() => {\n      res(fn());\n    }, delayInMs);\n  });\n}\n\nexport const delay$ = implicit$FirstArg(delayQrl);\n\nexport default component$(() => {\n  const store = useStore({ count: 0, delay: 0 });\n  return (\n    <>\n      Count: {store.count} <br />\n      Delay: {store.delay} <br />\n      <button\n        onClick$={async () => {\n          store.count++;\n          await delay$(() => store.delay++, 1000);\n        }}\n      >\n        +1\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/composing/use/index.mdx",
    "content": "---\ntitle: Composing use Hooks | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nHooks are a way to abstract common logic away from the components that use it. They are a way to share logic between components. While Qwik provides many hooks, there will always be one that is not provided out of the box. This tutorial will show you how to create your own hook.\n\nIn this example, the registering of `mousemove` events is something that could be shared between multiple components. Refactor the code by pulling out the code before JSX into its own `useMousePosition()` function.\n\nCongratulations, you have successfully created your own hook! You can now use it in any component that needs to listen to the mouse position.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/composing/use/problem/app.tsx",
    "content": "import { component$, useOnDocument, useStore, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const mousePosition = useStore({ x: 0, y: 0 });\n  useOnDocument(\n    'mousemove',\n    $((event: Event) => {\n      mousePosition.x = (event as MouseEvent).clientX;\n      mousePosition.y = (event as MouseEvent).clientY;\n    })\n  );\n  return (\n    <div>\n      (x: {mousePosition.x}, y: {mousePosition.y})\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/composing/use/solution/app.tsx",
    "content": "import { component$, useOnDocument, useStore, $ } from '@builder.io/qwik';\n\nexport function useMousePosition() {\n  const mousePosition = useStore({ x: 0, y: 0 });\n  useOnDocument(\n    'mousemove',\n    $((event: Event) => {\n      mousePosition.x = (event as MouseEvent).clientX;\n      mousePosition.y = (event as MouseEvent).clientY;\n    })\n  );\n  return mousePosition;\n}\n\nexport default component$(() => {\n  const mousePosition = useMousePosition();\n  return (\n    <div>\n      (x: {mousePosition.x}, y: {mousePosition.y})\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/context/basic/index.mdx",
    "content": "---\ntitle: Context | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - shairez\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nUse context to pass data to child components without explicitly passing it through components (known as prop drilling). Context is useful to share data that is needed in components throughout the application, such as styling information, application state, or the currently logged-in user.\n\nThe code to use a context is divided into three parts:\n\n- `createContextId()`: this creates a serializable ID for the context. Make sure that this ID is unique within your application.\n- `useContextProvider()`: In a parent component, call this method to publish the context value. All children (and grandchildren) that are descendants of this component will be able to retrieve the context.\n- [`useContext()`](/docs/(qwik)/core/context/index.mdx#usecontext) to retrieve the context and use it in any component.\n\nIn this example, we would like to pass the `TodosStore` to the `<Items>` component. Update the code to use [`useContext()`](/docs/(qwik)/core/context/index.mdx#usecontext) to retrieve the value.\n\nContexts typically are stores, and as such, they must be serializable.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/context/basic/problem/app.tsx",
    "content": "import { component$, createContextId, useContextProvider, useStore } from '@builder.io/qwik';\n\ninterface TodosStore {\n  items: string[];\n}\nexport const todosContext = createContextId<TodosStore>('Todos');\nexport default component$(() => {\n  useContextProvider(\n    todosContext,\n    useStore<TodosStore>({\n      items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n    })\n  );\n\n  return <Items />;\n});\n\nexport const Items = component$(() => {\n  // replace this with context retrieval.\n  const todos = { items: [] };\n  return (\n    <ul>\n      {todos.items.map((item) => (\n        <li>{item}</li>\n      ))}\n    </ul>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/context/basic/solution/app.tsx",
    "content": "import {\n  component$,\n  createContextId,\n  useContextProvider,\n  useContext,\n  useStore,\n} from '@builder.io/qwik';\n\ninterface TodosStore {\n  items: string[];\n}\nexport const todosContext = createContextId<TodosStore>('Todos');\nexport default component$(() => {\n  useContextProvider(\n    todosContext,\n    useStore<TodosStore>({\n      items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n    })\n  );\n\n  return <Items />;\n});\n\nexport const Items = component$(() => {\n  const todos = useContext(todosContext);\n  return (\n    <ul>\n      {todos.items.map((item) => (\n        <li>{item}</li>\n      ))}\n    </ul>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/basic/index.mdx",
    "content": "---\ntitle: Event Listeners | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - the-r3aper7\n  - mhevery\n  - mrhoodz\n  - neonpie\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nA key feature of any framework is making it easy to listen to user events.\n\nQwik can listen on a variety of events by placing an `on<Eventname>$` attribute on an element that subscribes to the corresponding browser event.\n\nYour task is to add a `click` event handler on the `<button>` element. Start by adding the `onClick$` property and bind it to a function that calls `alert('Hello World!')`.\n\n## Understanding the Runtime\n\nSo far this may look like a normal framework behavior, however Qwik does things very differently from other frameworks.\n\nEvery time you see a `$` you should be thinking, \"lazy-loading happens here\".\n\nAs you open the browser's developer tools, notice that no JavaScript is loaded until you click the button.\n\nIf JavaScript is required to subscribe to browser events, how does Qwik achieve this interaction without loading JavaScript?\n\nConsider the following simplified HTML of the application below.\n\n> **Tip:** Click on the **HTML** tab to see actual HTML produced by the server.\n\n```HTML\n<html>\n  <body>\n    <button on:click=\"chunk-abc.js#App_onClick\">\n      Click Me\n    </button>\n    <script id=\"Qwikloader\">....</script>\n  </body>\n</html>\n```\n\n1. APIs contain the `$` so the Qwik optimizer can transform your code for lazy-loading.\n\n- The `$` is a signal to the optimizer to extract the code for lazy-loading.\n- The `$` is a signal to you that lazy-loading \"magic\" happens at this point.\n- TypeScript rules ensure you don't skip any places where the `$` should appear.\n\n2. The optimizer looks for the `$` and extracts the function wrapped by `$` into a separate [lazy-loadable chunk](../../../docs/(qwik)/advanced/optimizer/index.mdx).\n3. As the server renders the page, the JSX is executed and notices that there is a click listener. The click listener is serialized into the `<button>` element as `on:click` attribute. Qwik then knows how to hook this event back up on the client.\n4. Qwikloader scripts get inlined into HTML. The Qwikloader script sets up a global listener for all events in the browser. Qwikloader is about 1kb and executes in about 1ms.\n5. When a user clicks on the button, the Qwikloader intercepts the event and looks for an element with `on:click` attribute.\n6. The `on:click` attribute contains:\n   - The URL to download the associated code.\n     - To avoid delays between click and execution, Qwik prefetches the code related to the given component.\n   - A symbol that is exported by the downloaded chunk that contains the function needs to execute.\n7. Once the code is downloaded the function is executed.\n\nThe above behavior is what gives Qwik applications their instant-on property (resumability) without eagerly downloading and executing code and performing hydration which is expensive.\n\n> **NOTE**\n> To avoid delays between user action and response, Qwik prefetches code in the background.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/basic/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <button>Click Me</button>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/basic/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <button onClick$={() => alert('Hello World!')}>Click Me</button>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/document/index.mdx",
    "content": "---\ntitle: Listening to document/window | Tutorial\ncontributors:\n  - adamdbradley\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nSo far you've interacted with events emitted from a DOM element such as a `<button>`, but what if you need to listen for global events?\n\nCommon global events include the `document`'s `mousemove` and the `window`'s `scroll` event.\n\nQwik has the `document:` and `window:` namespace prefixes which allow you to listen to global events.\n\nOpen the browser's console and move your mouse over the text in the sample. Notice how moving the mouse logs the mouse position to the console. This logging only happens while moving the mouse over the text because the event is wired on the `div`'s `onMouseMove` event. Attaching at this level stops event bubbling beyond the element's listener.\n\nHow would you adjust the code to log the mouse position at all times?\n\nChange to a global listener by adding the `document:` prefix to the `onMouseMove` declaration.\n\nWith this change, notice how moving the mouse anywhere on the application (even outside of the text) shows output in the console.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/document/problem/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ x: 0, y: 0 });\n  return (\n    <div\n      onMouseMove$={(event) => {\n        store.x = event.clientX;\n        store.y = event.clientY;\n        console.log(store);\n      }}\n    >\n      Your mouse location is ({store.x}, {store.y}).\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/document/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ x: 0, y: 0 });\n  return (\n    <div\n      document:onMouseMove$={(event) => {\n        store.x = event.x;\n        store.y = event.y;\n      }}\n    >\n      Your mouse location is ({store.x}, {store.y}).\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/preventdefault/index.mdx",
    "content": "---\ntitle: Event Prevent Default | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - neonpie\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nFor some events, browsers have default behavior. For example, when you click a link, the browser will usually navigate to the link's `href`. There are times when we would like to prevent that. For this reason the `Event` API contains the `preventDefault()` method.\n\nBrowser events are synchronous, but because Qwik is fine-grained the loadable Qwik execution model is asynchronous. This means that at the time the event is triggered, the event handler is not yet loaded. By the time the event handler is loaded the event has already been processed by the browser and calling `preventDefault()` will have no effect.\n\nTo solve this Qwik provides a declarative API to automatically call `preventDefault()` when the event is triggered. This is achieved by adding the `preventdefault:<event-name>` attribute to the element. This allows Qwikloader to synchronously call `preventDefault()` when the event is triggered.\n\n### Example\n\nClicking on the link will cause a navigation event. We wish to prevent this and call our callback instead. Add `preventdefault:click` to the `<a href>` to achieve this.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/preventdefault/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <a href=\"/\" onClick$={() => alert('do something else.')}>\n      click me!\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/preventdefault/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <a href=\"/\" preventdefault:click onClick$={() => alert('do something else.')}>\n      click me!\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/programmatic/index.mdx",
    "content": "---\ntitle: Programmatic Listeners | Tutorial\ncontributors:\n  - adamdbradley\n  - the-r3aper7\n  - manucorporat\n  - mhevery\n  - neonpie\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nThere are times when your app needs to add a conditional listener. Sometimes a listener name is unknown, or you need to use an imperative approach to set up a listener.\n\nQwik provides the following [functions](https://qwik.dev/docs/core/events/#useonwindowdocument-hook) to attach a listener:\n\n| Function          | Description                                               |\n| ----------------- | --------------------------------------------------------- |\n| `useOn()`         | Listen to events on the current component's root element. |\n| `useOnDocument()` | Listen to events on the `document` object.                |\n| `useOnWindow()`   | Listen to events on the `window` object.                  |\n\n> **Your task**: Set up a click listener on the component to call `alert('Hello world!')`.\n\n## Understanding the `$`\n\nThe `$` function signals Qwik to lazy load a reference. When setting up a listener with `useOn`, the second argument is a [Qwik URL](../../../docs/(qwik)/advanced/qrl/index.mdx).\n\nQwik URLs (QRL) are lazy-loadable references to your code. If `useOn` took a function directly rather than QRL, it would have to eagerly execute to allocate the listener closure. By using a QRL via the `$` function, Qwik can lazy load the closure only as `click` listener is triggered.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/programmatic/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  // hint: useOn('click', $(() => ...));\n\n  return <p>App Component. Click me.</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/programmatic/solution/app.tsx",
    "content": "import { component$, useOn, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  useOn(\n    'click',\n    $(() => alert('Hello World!'))\n  );\n\n  return <p>App Component. Click me.</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/synchronous-sync/index.mdx",
    "content": "---\ntitle: Synchronous Event Processing | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - kerbelp\n  - mhevery\n  - cunzaizhuyi\n  - spenserblack\n  - hamatoyogi\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nWhile not a common use case, you may occasionally need to process events synchronously.\n\nThe two most common use cases are to call `event.preventDefault()` or `event.stopPropagation()` on a DOM event. Those are handled by adding the `preventdefault:eventname` or `stoppropagation:eventname` in addition to your event handler.\n\n```tsx\n  <a href=\"/\" preventdefault:click onClick$={() => {\n    console.log('clicked');\n  }}>\n    link\n  </a>\n```\n\nWhen you have other use cases that require synchronous event processing, you can use either `sync$()` or `useVisibleTask$()`.\n1. preferred way: use `sync$()` to embed the code in the HTML. Fast, resumable, but with some restrictions (see below).\n2. eager registration: use `useVisibleTask$()` to register a handler. No restrictions, but it will not handle events until the visible task has executed, and it will cause of course run extra javaScript while the page is loading.\n\n```tsx\n  <a href=\"/\" \n    onClick$={sync$((event, target) => {\n      // Only prevent default if the ctrl key is pressed.\n      if (event.ctrlKey) {\n        event.preventDefault();\n      }\n    })}>\n    link\n  </a>\n```\n\n## `sync$()` Restrictions\n\nThe `sync$()` function is a resumable way to process events synchronously. However, it has some significant restrictions. The `sync$()` **can't close over anything**. The implications are that you can't:\n- access any state: The recommended way to get the state into function is to place on element attributes.\n- access any non-browser functions: No imports or closing over any variables or functions are allowed. \n- the function should be small as it will get inlined into the resulting HTML.\n\nFor this reason, we recommended breaking up the event handlers into two parts:\n1. **sync$()**: The part which must be synchronous. This part should be small and not close over anything.\n2. **$()**: The part which can be asynchronous. This part can be large and can close over anything including the state.\n\n```tsx\n  <a href=\"/\" \n    onClick$={[\n      sync$((event, target) => {\n        // This part is synchronous and can't close over anything.\n        if (event.ctrlKey) {\n          event.preventDefault();\n        }\n      }),\n      $(() => {\n        // This part can be asynchronous and can close over anything.\n        console.log('clicked');\n      })\n    ]}>\n    link\n  </a>\n```\n\nYou can also dispatch a custom event from the `sync$()` handler and handle it asynchronously:\n\n```tsx\n  <a href=\"/\" \n    onClick$={sync$((event, target) => {\n      if (event.ctrlKey) {\n        event.preventDefault();\n      }\n      // Dispatch a custom event to be handled asynchronously.\n      target.dispatchEvent(new CustomEvent('myclick', { bubbles: true }));\n    })}\n    onMyclick$={() => {\n      // This part can be asynchronous and can close over anything.\n      console.log('clicked');\n    }}>\n    link\n  </a>\n```\n\n **Your task:** Convert the `onClick$` from asynchronous event to synchronous event by using [`sync$`](/docs/(qwik)/core/tasks/index.mdx#usevisibletask).\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/synchronous-sync/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <a\n      href=\"/\"\n      onClick$={(event) => {\n        if (event.ctrlKey) {\n          event.preventDefault();\n        }\n        console.log('clicked');\n      }}\n    >\n      click me!\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/synchronous-sync/solution/app.tsx",
    "content": "import { component$, sync$, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <a\n      href=\"/\"\n      onClick$={[\n        sync$((event: MouseEvent): void => {\n          if (event.ctrlKey) {\n            event.preventDefault();\n          }\n        }),\n        $(() => {\n          console.log('clicked');\n        }),\n      ]}\n    >\n      click me!\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/synchronous-visible/index.mdx",
    "content": "---\ntitle: Synchronous Event Processing | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - kerbelp\n  - mhevery\n  - cunzaizhuyi\n  - spenserblack\n  - hamatoyogi\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nWhile not a common use case, you may occasionally need to process events synchronously.\n\nSince Qwik processes asynchronously by default, your code must be explicitly configured for synchronous calls. \n\nThere are two ways of processing events synchronously:\n1. preferred way: use `sync$()` to load code synchronously. Fast, resumable but with **significant restrictions** on event handler size. \n2. eager registration: use `useVisibleTask$()` to load code synchronously. No restrictions, but requires eager code execution, which goes against resumability.\n\nThis example shows how to eagerly execute code and set up a classical event handler with no restrictions but with the cost of eager execution.\n\n\n**Your task:** Convert the `onClick$` from asynchronous event to synchronous event by using [`useVisibleTask$`](/docs/(qwik)/core/tasks/index.mdx#usevisibletask) lifecycle and [normal event registration](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/synchronous-visible/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <a href=\"/\" onClick$={() => window.open('http://qwik.dev')}>\n      click me!\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/events/synchronous-visible/solution/app.tsx",
    "content": "import { component$, useVisibleTask$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const aHref = useSignal<Element>();\n  useVisibleTask$(({ cleanup }) => {\n    const handler = (event: Event) => {\n      event.preventDefault();\n      window.open('http://qwik.dev');\n    };\n    aHref.value!.addEventListener('click', handler);\n    cleanup(() => aHref.value!.removeEventListener('click', handler));\n  });\n\n  return (\n    <a href=\"/\" ref={aHref}>\n      click me!\n    </a>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-on/index.mdx",
    "content": "---\ntitle: useOn() / useOnDocument() / useOnWindow() | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nUse `useOn()` / `useOnDocument()` / `useOnWindow()` to programmatically set up listeners on host elements. This is useful when you are creating custom APIs and don't have access to place these events in the JSX or if the events are not known ahead of time, such as if they are created based on component props.\n\n### Example\n\nThe example on the right shows how to use `useOn()` method. Duplicate the code to explore how to use `useOnDocument()` / `useOnWindow()` and how they behave differently.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-on/problem/app.tsx",
    "content": "import { $, component$, useOn, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore(\n    {\n      element: { x: 0, y: 0 },\n      window: { x: 0, y: 0 },\n      document: { x: 0, y: 0 },\n    },\n    { deep: true }\n  );\n  useOn(\n    'mousemove',\n    $((event) => {\n      store.element.x = event.x;\n      store.element.y = event.y;\n    })\n  );\n  return (\n    <ul>\n      <li>\n        Element: ({store.element.x}, {store.element.y})\n      </li>\n      <li>\n        Document: ({store.document.x}, {store.document.y})\n      </li>\n      <li>\n        Window: ({store.window.x}, {store.window.y})\n      </li>\n    </ul>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-on/solution/app.tsx",
    "content": "import { component$, useOnDocument, $, useStore, useOn, useOnWindow } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore(\n    {\n      element: { x: 0, y: 0 },\n      window: { x: 0, y: 0 },\n      document: { x: 0, y: 0 },\n    },\n    { deep: true }\n  );\n  useOn(\n    'mousemove',\n    $((event) => {\n      store.element.x = event.x;\n      store.element.y = event.y;\n    })\n  );\n  useOnDocument(\n    'mousemove',\n    $((event) => {\n      store.document.x = event.x;\n      store.document.y = event.y;\n    })\n  );\n  useOnWindow(\n    'mousemove',\n    $((event) => {\n      store.window.x = event.x;\n      store.window.y = event.y;\n    })\n  );\n\n  return (\n    <ul>\n      <li>\n        Element: ({store.element.x}, {store.element.y})\n      </li>\n      <li>\n        Document: ({store.document.x}, {store.document.y})\n      </li>\n      <li>\n        Window: ({store.window.x}, {store.window.y})\n      </li>\n    </ul>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-task/index.mdx",
    "content": "---\ntitle: useTask$() | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mhevery\n  - zanettin\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-12-19T12:14:17Z'\n---\n\nUse [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) to execute a function before the initial render and whenever the tracking values change. The function executes before rendering, but it can't delay rendering, so if [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) is asynchronous, the rendering will happen before the [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) is fully executed.\n\n## Tracking store changes\n\nThe [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) hook receives a `track()` function used for setting up subscriptions that will automatically rerun the [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) hook. The set of `track()` properties resets on each [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) execution, therefore it is important to always use `track()` to set up subscriptions anew. Because of this it is possible for the [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) to subscribe to different properties over time.\n\n## Cleanup\n\nThe [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) hook can return a cleanup callback. This is useful for cleaning up any resources before new execution.\n\n### Example\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-task/problem/app.tsx",
    "content": "import { component$, useTask$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({\n    value: '',\n    debouncedValue: '',\n  });\n  useTask$(({ track, cleanup }) => {\n    // Use track to rerun this function when store's `value` property changes.\n\n    // Setup a timer to copy `value => debouncedValue` after half a second.\n\n    // Return cleanup function in case `value` property changes before time is up.\n    cleanup(() => {\n      // cleanup code\n    });\n  });\n  return (\n    <>\n      <input value={store.value} onInput$={(ev, el) => (store.value = el.value)} />\n      <br />\n      Current value: {store.value}\n      <br />\n      Debounced value: {store.debouncedValue}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-task/solution/app.tsx",
    "content": "import { component$, useTask$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({\n    value: '',\n    debouncedValue: '',\n  });\n  useTask$(({ track, cleanup }) => {\n    // rerun this function  when `value` property changes.\n    track(() => store.value);\n    // Set up timeout for debounced value.\n    const id = setTimeout(() => (store.debouncedValue = store.value), 500);\n    // return cleanup function in case `value` property changes before time is up.\n    cleanup(() => clearTimeout(id));\n  });\n  return (\n    <>\n      <input value={store.value} onInput$={(ev, el) => (store.value = el.value)} />\n      <br />\n      Current value: {store.value}\n      <br />\n      Debounced value: {store.debouncedValue}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-visible-task/index.mdx",
    "content": "---\ntitle: useVisibleTask$() | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - the-r3aper7\n  - felixsanz\n  - kerbelp\n  - mhevery\n  - cbazureau\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2023-03-05T19:28:01Z'\n---\n\nUse `useVisibleTask$()` to execute code after the component is resumed. This is useful for setting up timers or streams on the client when the application is resumed.\n\n## `track()` and `useVisibleTask$()`\n\n`useVisibleTask$()` receives a `track()` function just like `useTask$()`. Use the `track()` function to trigger the effect when the store is updated. See [reactivity](../../../tutorial/reactivity/explicit/index.mdx) for more information.\n\n## Component Life Cycle and SSR\n\nQwik is resumable. Resumability means that the application starts on the server and then is transferred to the client. On the client, the application continues execution from where it left off. A common use case is creating a component on the server, pausing, and then resuming on the client. To make the component fully functional, it may be necessary to execute code eagerly on the client to set up timers or streams.\n\n`useVisibleTask$()` is a client-only method. (There is no equivalent on the server.)\n\n> **NOTE** See [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) for behavior that needs to be executed on both client and server.\n\n## When is `useVisibleTask$()` executed?\n\nClient effect code is executed after the component is resumed. The `useVisibleTask$()` method takes an additional argument (`{strategy:'intersection-observer|document-ready|document-idle'}`) that controls when the effect is executed. There are three options:\n\n- `intersection-observer` (default): the task will first execute when the element is visible in the viewport, under the hood it uses the IntersectionObserver API.\n- `document-ready`: the task will first execute when the document is ready, under the hood it uses the document load event.\n- `document-idle`: the task will first execute when the document is idle, under the hood it uses the requestIdleCallback API.\n\n### Example\n\nThe example shows a clock component that is rendered below the fold. Use the `useVisibleTask$()` to make the clock update the current time every second to make it work on the client. We have provided the utility function `updateClock` to aid your implementation.\n\nKeep in mind that `useVisibleTask$()` should return a cleanup function that releases the `setInterval` timer so that the timer can be properly cleaned up when the component is unmounted/destroyed.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-visible-task/problem/app.tsx",
    "content": "import { component$, useStore, useStyles$, useVisibleTask$ } from '@builder.io/qwik';\nimport styles from './clock.css?inline';\n\ninterface ClockStore {\n  hour: number;\n  minute: number;\n  second: number;\n}\nexport const Clock = component$(() => {\n  useStyles$(styles);\n\n  const store = useStore<ClockStore>({\n    hour: 0,\n    minute: 0,\n    second: 0,\n  });\n\n  useVisibleTask$(() => {\n    // Put code here to periodically call updateClock().\n  });\n\n  return (\n    <div class=\"clock\">\n      <div class=\"twelve\"></div>\n      <div class=\"three\"></div>\n      <div class=\"six\"></div>\n      <div class=\"nine\"></div>\n      <div class=\"hour\" style={{ transform: `rotate(${store.hour}deg)` }}></div>\n      <div class=\"minute\" style={{ transform: `rotate(${store.minute}deg)` }}></div>\n      <div class=\"second\" style={{ transform: `rotate(${store.second}deg)` }}></div>\n    </div>\n  );\n});\n\nexport function updateClock(store: ClockStore) {\n  const now = new Date();\n  store.second = now.getSeconds() * (360 / 60);\n  store.minute = now.getMinutes() * (360 / 60);\n  store.hour = now.getHours() * (360 / 12);\n}\n\nexport default component$(() => {\n  return (\n    <main>\n      <p>This is an example of Lazy executing code on component when component becomes visible.</p>\n\n      <p style={{ height: '800px' }}>\n        ⬇️ <strong>Scroll down</strong> until the clock is in view.\n      </p>\n\n      <Clock />\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-visible-task/problem/clock.css",
    "content": "/* Clock inspired by: https://paulund.co.uk/create-a-clock-in-css */\n\n.clock {\n  background: #fff;\n  border: 10px solid #7a7a7a;\n  border-radius: 50%;\n  box-sizing: border-box;\n  height: 300px;\n  margin: 0 auto;\n  position: relative;\n  width: 300px;\n}\n\n.twelve,\n.three,\n.six,\n.nine {\n  background: #333;\n  position: absolute;\n}\n\n.twelve,\n.six {\n  height: 10px;\n  width: 4px;\n}\n\n.three,\n.nine {\n  height: 4px;\n  width: 10px;\n}\n\n.twelve {\n  left: 50%;\n  top: -1px;\n}\n\n.three {\n  right: -1px;\n  top: 50%;\n}\n\n.six {\n  left: 50%;\n  bottom: -1px;\n}\n\n.nine {\n  left: -1px;\n  top: 50%;\n}\n\n.hour {\n  height: 60px;\n  width: 4px;\n  background: #333;\n  position: absolute;\n  left: 50%;\n  top: 80px;\n  animation: tick 43200s infinite linear;\n  -webkit-animation: tick 43200s infinite linear;\n}\n\n.minute {\n  height: 100px;\n  width: 4px;\n  background: #777;\n  position: absolute;\n  left: 50%;\n  top: 40px;\n  animation: tick 3600s infinite linear;\n  -webkit-animation: tick 3600s infinite linear;\n}\n\n.second {\n  height: 120px;\n  width: 3px;\n  background: #fc0505;\n  position: absolute;\n  left: 50%;\n  top: 20px;\n  animation: tick 60s infinite linear;\n  -webkit-animation: tick 60s infinite linear;\n}\n\n.hour,\n.minute,\n.second {\n  transform-origin: 2px 100%;\n  -webkit-transform-origin: 2px 100%;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-visible-task/solution/app.tsx",
    "content": "import { component$, useStore, useStyles$, useVisibleTask$ } from '@builder.io/qwik';\nimport styles from './clock.css?inline';\n\ninterface ClockStore {\n  hour: number;\n  minute: number;\n  second: number;\n}\nexport const Clock = component$(() => {\n  useStyles$(styles);\n\n  const store = useStore<ClockStore>({\n    hour: 0,\n    minute: 0,\n    second: 0,\n  });\n\n  useVisibleTask$(() => {\n    const intervalId = setInterval(() => updateClock(store), 1000);\n    return () => clearInterval(intervalId);\n  });\n\n  return (\n    <div class=\"clock\">\n      <div class=\"twelve\"></div>\n      <div class=\"three\"></div>\n      <div class=\"six\"></div>\n      <div class=\"nine\"></div>\n      <div class=\"hour\" style={{ transform: `rotate(${store.hour}deg)` }}></div>\n      <div class=\"minute\" style={{ transform: `rotate(${store.minute}deg)` }}></div>\n      <div class=\"second\" style={{ transform: `rotate(${store.second}deg)` }}></div>\n    </div>\n  );\n});\n\nexport function updateClock(store: ClockStore) {\n  const now = new Date();\n  store.second = now.getSeconds() * (360 / 60);\n  store.minute = now.getMinutes() * (360 / 60);\n  store.hour = now.getHours() * (360 / 12);\n}\n\nexport default component$(() => {\n  return (\n    <main>\n      <p>This is an example of Lazy executing code on component when component becomes visible.</p>\n\n      <p style={{ height: '800px' }}>\n        ⬇️ <strong>Scroll down</strong> until the clock is in view.\n      </p>\n\n      <Clock />\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/hooks/use-visible-task/solution/clock.css",
    "content": "/* Clock inspired by: https://paulund.co.uk/create-a-clock-in-css */\n\n.clock {\n  background: #fff;\n  border: 10px solid #7a7a7a;\n  border-radius: 50%;\n  box-sizing: border-box;\n  height: 300px;\n  margin: 0 auto;\n  position: relative;\n  width: 300px;\n}\n\n.twelve,\n.three,\n.six,\n.nine {\n  background: #333;\n  position: absolute;\n}\n\n.twelve,\n.six {\n  height: 10px;\n  width: 4px;\n}\n\n.three,\n.nine {\n  height: 4px;\n  width: 10px;\n}\n\n.twelve {\n  left: 50%;\n  top: -1px;\n}\n\n.three {\n  right: -1px;\n  top: 50%;\n}\n\n.six {\n  left: 50%;\n  bottom: -1px;\n}\n\n.nine {\n  left: -1px;\n  top: 50%;\n}\n\n.hour {\n  height: 60px;\n  width: 4px;\n  background: #333;\n  position: absolute;\n  left: 50%;\n  top: 80px;\n  animation: tick 43200s infinite linear;\n  -webkit-animation: tick 43200s infinite linear;\n}\n\n.minute {\n  height: 100px;\n  width: 4px;\n  background: #777;\n  position: absolute;\n  left: 50%;\n  top: 40px;\n  animation: tick 3600s infinite linear;\n  -webkit-animation: tick 3600s infinite linear;\n}\n\n.second {\n  height: 120px;\n  width: 3px;\n  background: #fc0505;\n  position: absolute;\n  left: 50%;\n  top: 20px;\n  animation: tick 60s infinite linear;\n  -webkit-animation: tick 60s infinite linear;\n}\n\n.hour,\n.minute,\n.second {\n  transform-origin: 2px 100%;\n  -webkit-transform-origin: 2px 100%;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/component/index.mdx",
    "content": "---\ntitle: Components | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - AnthonyPAlicea\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nWelcome to the Qwik tutorial. This is a series of short tutorials that will help you get started with Qwik. The introduction is a set of problems that will teach you how to create a component, store data, attach listeners, and fetch data from the server. So let's get started.\n\n## Creating a component\n\nUse the editor on the right to create a UI that looks something like this:\n\n```\nGitHub organization: __________\n- Qwik\n- Partytown\n```\n\nThe HTML code for this component should be this:\n\n```HTML\n<main>\n  <p>\n    <label>\n      GitHub organization:\n      <input value=\"QwikDev\" />\n    </label>\n  </p>\n  <section>\n    <ul>\n      <li>\n        <a href=\"https://github.com/QwikDev/qwik\">Qwik</a>\n      </li>\n      <li>\n        <a href=\"https://github.com/BuilderIO/partytown\">Partytown</a>\n      </li>\n    </ul>\n  </section>\n</main>\n```\n\nYou can click the \"Show Me\" button in the bottom left to see the completed solution.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/component/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return <p>Hello World</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/component/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub organization:\n          <input value=\"QwikDev\" />\n        </label>\n      </p>\n      <section>\n        <ul>\n          <li>\n            <a href=\"https://github.com/QwikDev/qwik\">Qwik</a>\n          </li>\n          <li>\n            <a href=\"https://github.com/BuilderIO/partytown\">Partytown</a>\n          </li>\n        </ul>\n      </section>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/listeners/index.mdx",
    "content": "---\ntitle: Listeners | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - wmertens\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nIn this tutorial, we will add an event listener to the input. We will use the `keyup` event to listen to changes on the input. The goal is to update the `org` as the user types.\n\nUse the `onInput$` property on the `<input>` element to add an event listener.\n\nNotice that the assignment to the store (`github.org = ...`) automatically triggers the component re-rendering.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/listeners/problem/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const github = useStore({\n    org: 'QwikDev',\n    repos: ['qwik', 'partytown'] as string[] | null,\n  });\n\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} />\n        </label>\n      </p>\n      <section>\n        {github.repos ? (\n          <ul>\n            {github.repos.map((repo) => (\n              <li>\n                <a href={`https://github.com/${github.org}/${repo}`}>\n                  {github.org}/{repo}\n                </a>\n              </li>\n            ))}\n          </ul>\n        ) : (\n          'loading...'\n        )}\n      </section>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/listeners/solution/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const github = useStore({\n    org: 'QwikDev',\n    repos: ['qwik', 'partytown'] as string[] | null,\n  });\n\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} onInput$={(ev, el) => (github.org = el.value)} />\n        </label>\n      </p>\n      <section>\n        {github.repos ? (\n          <ul>\n            {github.repos.map((repo) => (\n              <li>\n                <a href={`https://github.com/${github.org}/${repo}`}>\n                  {github.org}/{repo}\n                </a>\n              </li>\n            ))}\n          </ul>\n        ) : (\n          'loading...'\n        )}\n      </section>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/resource/index.mdx",
    "content": "---\ntitle: Basics | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - saikatdas0790\n  - devagja\n  - avivr\n  - forresst\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nFor this tutorial, we would like to fetch the list of repositories for a given GitHub organization. To aid you, we have added the `getRepositories()` function to the bottom of the file. Your task is to use the `getRepositories()` function to fetch the list of repositories whenever the user updates the `org` input.\n\nQwik provides [`useResource$()`](/docs/(qwik)/core/state/index.mdx) and `<Resource>` to help you fetch and display data from the server. When fetching data the application can be in one of three states:\n\n- `pending`: the data is being fetched from the server => Render `loading...` indicator.\n- `resolved`: the data has successfully been fetched from the server => Render the data.\n- `rejected`: the data could not be fetched from the server due to an error => Render the error.\n\nUse [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function to set up how the data is fetched from the server. Use `<Resource>` to display the data.\n\n## Fetching data\n\nUse [`useResource$()`](/docs/(qwik)/core/state/index.mdx) to set up how the data is fetched from the server.\n\n```jsx\n  const reposResource = useResource$<string[]>(({ track, cleanup }) => {\n    // We need a way to re-run fetching data whenever the `github.org` changes.\n    // Use `track` to trigger re-running of this data fetching function.\n    track(() => github.org);\n\n    // A good practice is to use `AbortController` to abort the fetching of data if\n    // new request comes in. We create a new `AbortController` and register a `cleanup`\n    // function which is called when this function re-runs.\n    const controller = new AbortController();\n    cleanup(() => controller.abort());\n\n    // Fetch the data and return the promises.\n    return getRepositories(github.org, controller);\n  });\n```\n\nThe [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function returns a `ResourceReturn` object, which is a Promise-like object that can be serialized by Qwik. The [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function allows you to `track` store properties so that the [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function can be reactive on store changes. The `cleanup` function allows you to register code that needs to be run to release resources from the previous run. Finally, the [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function returns a promise that will resolve to the value.\n\n## Rendering data\n\nUse `<Resource>` to display the data of [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function. The `<Resource>` allows you to render different content depending if the resource is `pending`, `resolved` or `rejected`.\n\nOn the server the `<Resource>` does not render `loading` state, instead, it pauses rendering until the resource is resolved and will always render as either `resolved` or `rejected`. (On the client, the `<Resource>` renders all states including `pending`.)\n\n```jsx\n<Resource\n  value={resourceToRender}\n  onPending={() => <div>Loading...</div>}\n  onRejected={(reason) => <div>Error: {reason}</div>}\n  onResolved={(data) => <div>{data}</div>}\n/>\n```\n\n## SSR vs Client\n\nNotice that the same code can render on both server and client (with slightly different behavior, which skips the `pending` state rendering on the server.)\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/resource/problem/app.tsx",
    "content": "// @ts-ignore: Unused import\nimport { component$, useStore, Resource, useResource$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const github = useStore({\n    org: 'QwikDev',\n  });\n\n  // Use useResource$() to set up how the data is fetched from the server.\n  // See the example for Fetching Data in the text on the left.\n  // @ts-ignore: Unused declaration\n  const reposResource = useResource$<string[]>(({ track, cleanup }) => {\n    // We need a way to re-run fetching data whenever the `github.org` changes.\n    // Use `track` to trigger re-running of the this data fetching function.\n    track(() => github.org);\n\n    // A good practice is to use `AbortController` to abort the fetching of data if\n    // new request comes in. We create a new `AbortController` and register a `cleanup`\n    // function which is called when this function re-runs.\n    const controller = new AbortController();\n    cleanup(() => controller.abort());\n\n    // Fetch the data and return the promises.\n    return getRepositories(github.org, controller);\n  });\n\n  console.log('Render');\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} onInput$={(ev, el) => (github.org = el.value)} />\n        </label>\n      </p>\n      <section>\n        {/* Use <Resource> to display the data from the useResource$() function. */}\n        {/* To help, here's a callback function to display the data on resolved. */}\n        {/* (repos) => (\n            <ul>\n              {repos.map((repo) => (\n                <li>\n                  <a href={`https://github.com/${github.org}/${repo}`}>{repo}</a>\n                </li>\n              ))}\n            </ul>\n          ) */}\n      </section>\n    </main>\n  );\n});\n\nexport async function getRepositories(\n  username: string,\n  controller?: AbortController\n): Promise<string[]> {\n  console.log('FETCH', `https://api.github.com/users/${username}/repos`);\n  const resp = await fetch(`https://api.github.com/users/${username}/repos`, {\n    signal: controller?.signal,\n  });\n  console.log('FETCH resolved');\n  const json = await resp.json();\n  return Array.isArray(json)\n    ? json.map((repo: { name: string }) => repo.name)\n    : Promise.reject(json);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/resource/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore, Resource, useResource$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const github = useStore({\n    org: 'QwikDev',\n  });\n\n  const reposResource = useResource$<string[]>(({ track, cleanup }) => {\n    // We need a way to re-run fetching data whenever the `github.org` changes.\n    // Use `track` to trigger re-running of this data fetching function.\n    track(() => github.org);\n\n    // A good practice is to use `AbortController` to abort the fetching of data if\n    // new request comes in. We create a new `AbortController` and register a `cleanup`\n    // function which is called when this function re-runs.\n    const controller = new AbortController();\n    cleanup(() => controller.abort());\n\n    // Fetch the data and return the promises.\n    return getRepositories(github.org, controller);\n  });\n\n  console.log('Render');\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} onInput$={(ev, el) => (github.org = el.value)} />\n        </label>\n      </p>\n      <section>\n        <Resource\n          value={reposResource}\n          onPending={() => <>Loading...</>}\n          onRejected={(error) => <>Error: {error.message}</>}\n          onResolved={(repos) => (\n            <ul>\n              {repos.map((repo) => (\n                <li>\n                  <a href={`https://github.com/${github.org}/${repo}`}>{repo}</a>\n                </li>\n              ))}\n            </ul>\n          )}\n        />\n      </section>\n    </main>\n  );\n});\n\nexport async function getRepositories(\n  username: string,\n  controller?: AbortController\n): Promise<string[]> {\n  console.log('FETCH', `https://api.github.com/users/${username}/repos`);\n  const resp = await fetch(`https://api.github.com/users/${username}/repos`, {\n    signal: controller?.signal,\n  });\n  console.log('FETCH resolved');\n  const json = await resp.json();\n  return Array.isArray(json)\n    ? json.map((repo: { name: string }) => repo.name)\n    : Promise.reject(json);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/store/index.mdx",
    "content": "---\ntitle: useStore | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mhevery\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nUse [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) to store the state of the component. The store's purpose is to:\n\n1. store the state of the component\n2. present the state as a proxy that can observe read/writes to the store\n3. serialize the state of the store into JSON on application pause.\n4. observe which properties of the store are used in a component template and create subscriptions to the store. The subscriptions are then used to automatically update the component template if a store changes.\n\nStores are declared inside the component's function using the [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) function. Wrap the `github` assignment in the `useStore(...)` function call to create a store.\n\n> **NOTE**\n> In this example, the store never changes. Therefore there is no way to observe automatic template re-rendering. In the next example, we will add a listener to the `<input>` to demonstrate automatic template re-rendering.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/store/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  // `github` is just a constant object.\n  // Convert it to a Store that can be serialized to JSON on application pause.\n  const github = {\n    org: 'QwikDev',\n    repos: ['qwik', 'partytown'] as string[] | null,\n  };\n\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} />\n        </label>\n      </p>\n      <section>\n        {github.repos ? (\n          <ul>\n            {github.repos.map((repo) => (\n              <li>\n                <a href={`https://github.com/${github.org}/${repo}`}>\n                  {github.org}/{repo}\n                </a>\n              </li>\n            ))}\n          </ul>\n        ) : (\n          'loading...'\n        )}\n      </section>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/introduction/store/solution/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const github = useStore({\n    org: 'QwikDev',\n    repos: ['qwik', 'partytown'] as string[] | null,\n  });\n\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} />\n        </label>\n      </p>\n      <section>\n        {github.repos ? (\n          <ul>\n            {github.repos.map((repo) => (\n              <li>\n                <a href={`https://github.com/${github.org}/${repo}`}>\n                  {github.org}/{repo}\n                </a>\n              </li>\n            ))}\n          </ul>\n        ) : (\n          'loading...'\n        )}\n      </section>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/layout.tsx",
    "content": "import { component$, Slot, useStore, useStyles$, useTask$ } from '@builder.io/qwik';\nimport type { RequestHandler } from '@builder.io/qwik-city';\nimport { Link, useLocation } from '@builder.io/qwik-city';\nimport { Repl } from '../../repl/ui';\nimport styles from './tutorial.css?inline';\nimport { TutorialContentFooter } from './tutorial-content-footer';\nimport { TutorialContentHeader } from './tutorial-content-header';\nimport tutorialSections, { type TutorialApp } from '@tutorial-data';\nimport { PanelToggle } from '../../components/panel-toggle/panel-toggle';\nimport { Header } from '../../components/header/header';\nimport type { ReplAppInput, ReplModuleInput } from '../../repl/types';\nimport { EditIcon } from '../../components/svgs/edit-icon';\nimport { setReplCorsHeaders } from '~/utils/utils';\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  const { url } = useLocation();\n  const panelStore = useStore(() => ({\n    active: 'Tutorial',\n    list: PANELS,\n  }));\n\n  const store = useStore<TutorialStore>(() => {\n    const initStore: TutorialStore = {\n      appId: '',\n      app: { id: '', title: '', problemInputs: [], solutionInputs: [] },\n      prev: undefined,\n      next: undefined,\n      buildMode: 'development',\n      entryStrategy: 'segment',\n      files: [],\n      version: '',\n      isShowingSolution: false,\n    };\n    return initStore;\n  });\n\n  useTask$(({ track }) => {\n    track(() => url.pathname);\n\n    const p = url.pathname.split('/');\n    const appId = `${p[2]}/${p[3]}`;\n    const t = getTutorial(appId) ?? store;\n\n    store.files = ensureDefaultFiles(t.app.problemInputs);\n    store.app = t.app;\n    store.appId = t.app.id;\n    store.prev = t.prev;\n    store.next = t.next;\n    store.isShowingSolution = false;\n  });\n\n  return (\n    <div class=\"tutorial full-width fixed-header\">\n      <Header />\n      <main\n        class={{\n          'tutorial-panel-input': panelStore.active === 'Input',\n          'tutorial-panel-output': panelStore.active === 'Output',\n        }}\n      >\n        <article class=\"tutorial-content-panel\">\n          <TutorialContentHeader store={store} />\n\n          <div class=\"content-main\">\n            <div>\n              <Slot />\n              {store.next ? (\n                <p class=\"next-link\">\n                  <Link href={`/tutorial/${store.next.id}/`} class=\"next\">\n                    Next: {store.next.title}\n                  </Link>\n                </p>\n              ) : null}\n              <a\n                class=\"edit-tutorial\"\n                href={`https://github.com/QwikDev/qwik/edit/main/packages/docs/src/routes/tutorial/${store.appId}`}\n                target=\"_blank\"\n              >\n                <EditIcon width={16} height={16} />\n                <span>Edit Tutorial</span>\n              </a>\n            </div>\n          </div>\n\n          <TutorialContentFooter store={store} />\n        </article>\n        <div class=\"tutorial-repl-panel\">\n          <div class=\"repl\">\n            <Repl\n              input={store}\n              enableHtmlOutput={store.app.enableHtmlOutput}\n              enableClientOutput={store.app.enableClientOutput}\n              enableSsrOutput={store.app.enableSsrOutput}\n              enableCopyToPlayground={true}\n              enableDownload={true}\n              enableInputDelete={false}\n            />\n          </div>\n          <div class=\"tutorial-repl-footer\" />\n        </div>\n      </main>\n      <PanelToggle panelStore={panelStore} />\n    </div>\n  );\n});\n\nexport const getTutorial = (id: string) => {\n  const tutorials: TutorialApp[] = [];\n  tutorialSections.forEach((s) => tutorials.push(...s.apps));\n\n  for (let i = 0; i < tutorials.length; i++) {\n    if (tutorials[i].id === id) {\n      return {\n        app: JSON.parse(JSON.stringify(tutorials[i])) as TutorialApp,\n        prev: tutorials[i - 1],\n        next: tutorials[i + 1],\n      };\n    }\n  }\n\n  return null;\n};\n\nexport const ensureDefaultFiles = (appFiles: ReplModuleInput[]) => {\n  const files: ReplModuleInput[] = JSON.parse(JSON.stringify(appFiles));\n\n  const DEFAULT_ENTRY_SERVER = `\nimport { renderToString, RenderOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\nexport default function (opts: RenderOptions) {\n  return renderToString(<Root />, opts);\n}\n`;\n\n  const DEFAULT_ROOT = `\nimport App from './app';\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <title>Tutorial</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n`;\n\n  if (!files.some((i) => i.code === '/root.tsx')) {\n    files.push({ path: '/root.tsx', code: DEFAULT_ROOT, hidden: true });\n  }\n\n  if (!files.some((i) => i.code === '/entry.server.tsx')) {\n    files.push({ path: '/entry.server.tsx', code: DEFAULT_ENTRY_SERVER, hidden: true });\n  }\n\n  return files;\n};\n\nexport interface TutorialStore extends ReplAppInput {\n  appId: string;\n  app: TutorialApp;\n  prev: TutorialApp | undefined;\n  next: TutorialApp | undefined;\n  isShowingSolution: boolean;\n}\n\nexport const PANELS = ['Tutorial', 'Input', 'Output'];\nexport const onGet: RequestHandler = ({ cacheControl, headers }) => {\n  cacheControl({\n    public: true,\n    maxAge: 3600,\n  });\n  setReplCorsHeaders(headers);\n};\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/basic/index.mdx",
    "content": "---\ntitle: Projection | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - literalpie\n  - wtlin1228\n  - harishkrishnan24\n  - mrhoodz\nupdated_at: '2023-10-08T10:18:59Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nProjection is a way of passing content to a child component that in turn controls where the content is rendered. Projection is a collaboration between the parent and child component. The parent component decides what is the content that needs to be rendered, while the child component decides where and if the content should be rendered.\n\nIn our example, the content of the `<Panel>` element (inside the `<App>`) is the content that needs to be projected. The `<Panel>` component wraps the content in a `<div>` tag and should project it using the `<Slot>` element.\n\n## Why `<Slot>`?\n\nWhy is Qwik opting to use `<Slot>` rather than `children` property? The use of `<Slot>` is a strategic choice to enable the rendering of components out of order. (Meaning that a component should be capable of re-rendering even if the parent component is not yet resumed.) There are two issues with using `children` in Qwik.\n\n1. In order for Qwik to use the `children` property for projection, it would need to be serializable like all other values that get passed between components in Qwik.\n2. A child component could modify the contents of the `children` before inserting it into the render tree. This would prevent the parent component from rendering independently from the child. If a child were to modify the `children`, it would need to do so every time the parent component updates the value of `children`.\n\nFor Qwik, the `<Slot>` approach is preferable because it declaratively controls the content and location of the projection. This allows the parent component to change the projection content, without forcing the child component to re-render.\n\n### Example\n\nChange the `<Panel>` component to project the `<App>` content using the `<Slot>` element.\n\nNotice that both `<App>` and `<Panel>` are not re-rendered on button click. This is because the reactivity graph is built on the server and serialized into the HTML, so Qwik knows what to update without needing to download and re-render the templates of `<App>` and `<Panel>`.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/basic/problem/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ count: 0 });\n  console.log('Render: <App>');\n  return (\n    <Panel>\n      Count: {store.count}. <button onClick$={() => store.count++}>+1</button>\n    </Panel>\n  );\n});\n\nexport const Panel = component$(() => {\n  console.log('Render: <Panel>');\n  return (\n    <div style={{ border: '2px solid red;', padding: '1em' }}>\n      Currently the <code>&lt;Panel&gt;</code> component controls the content here. Replace this\n      text with <code>&lt;Slot&gt;</code> element to see the content projected from the{' '}\n      <code>&lt;App&gt;</code>.\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/basic/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, Slot, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ count: 0 });\n  console.log('Render: <App>');\n  return (\n    <Panel>\n      Count: {store.count}. <button onClick$={() => store.count++}>+1</button>\n    </Panel>\n  );\n});\n\nexport const Panel = component$(() => {\n  console.log('Render: <Panel>');\n  return (\n    <div style={{ border: '2px solid red;', padding: '1em' }}>\n      <Slot />\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/fallback/index.mdx",
    "content": "---\ntitle: Fallback Content | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - forresst\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nFallback content allows the child component to display fallback content in case the parent component did not provide content. The fallback content can be done with CSS, it is necessary to add a CSS selector (and the appropriate CSS) on the named Slot in case it is empty.\n\nNote that in the upcoming Qwik 2.0, a Slot can embed fallback content directly, without needing CSS.\n\n### Example\n\nIn this example, we show three cards, but some of them are not filled with content. Use the right CSS selector to specify the fallback content.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/fallback/problem/app.tsx",
    "content": "import { component$, Slot, useStyles$ } from '@builder.io/qwik';\n\nexport const Card = component$(() => {\n  useStyles$(CSS);\n  return (\n    <article class=\"card\">\n      <header class=\"title\">\n        <Slot name=\"title\"></Slot>\n      </header>\n      <section class=\"body\">\n        <Slot name=\"body\"></Slot>\n      </section>\n    </article>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      <Card>\n        <span q:slot=\"title\">Qwik</span>\n        <span q:slot=\"body\">Qwik is a resumable framework for building instant web apps.</span>\n      </Card>\n      <Card>\n        <span q:slot=\"title\">Partytown</span>\n      </Card>\n      <Card>\n        <span q:slot=\"body\">\n          Builder.io allows you to visually build on your tech stack Empower your entire team to\n          visually create and optimize high-speed experiences on your sites and apps. Provide\n          whole-team autonomy with a platform that is developer approved.\n        </span>\n      </Card>\n    </>\n  );\n});\n\nexport const CSS = `\n.card {\n  border-radius: 5px;\n  vertical-align: top;\n  display: inline-block;\n  border: 1px solid grey;\n  width: 200px;\n  margin: .5em;\n}\n\n.title {\n  background-color: lightgray;\n  padding: 0.5em;\n  border-bottom: 1px solid black;\n}\n\n/* Add the right CSS selector here to make a fallback for slot named \"title\" */\nq\\\\:title {\n  content: 'Fallback title';\n  color: red;\n}\n\n.body {\n  padding: 0.5em;\n}\n\n/* Add the right CSS selector here to make a fallback for slot named \"body\" */\nq\\\\:body {\n  content: 'Fallback body';\n  color: orange;\n}\n`;\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/fallback/solution/app.tsx",
    "content": "import { component$, Slot, useStyles$ } from '@builder.io/qwik';\n\nexport const Card = component$(() => {\n  useStyles$(CSS);\n  return (\n    <article class=\"card\">\n      <header class=\"title\">\n        <Slot name=\"title\"></Slot>\n      </header>\n      <section class=\"body\">\n        <Slot name=\"body\"></Slot>\n      </section>\n    </article>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      <Card>\n        <span q:slot=\"title\">Qwik</span>\n        <span q:slot=\"body\">Qwik is a resumable framework for building instant web apps.</span>\n      </Card>\n      <Card>\n        <span q:slot=\"title\">Partytown</span>\n      </Card>\n      <Card>\n        <span q:slot=\"body\">\n          Builder.io allows you to visually build on your tech stack Empower your entire team to\n          visually create and optimize high-speed experiences on your sites and apps. Provide\n          whole-team autonomy with a platform that is developer approved.\n        </span>\n      </Card>\n    </>\n  );\n});\n\nexport const CSS = `\n.card {\n  border-radius: 5px;\n  vertical-align: top;\n  display: inline-block;\n  border: 1px solid grey;\n  width: 200px;\n  margin: .5em;\n}\n\n.title {\n  background-color: lightgray;\n  padding: 0.5em;\n  border-bottom: 1px solid black;\n}\n\n/* Fallback for slot named \"title\" */\n.title:empty::before {\n  content: 'Fallback title';\n  color: red;\n}\n\n.body {\n  padding: 0.5em;\n}\n\n/* Fallback for slot named \"body\" */\n.body:empty::before {\n  content: 'Fallback body';\n  color: orange;\n}\n`;\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/slots/index.mdx",
    "content": "---\ntitle: Named Slots | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - KenAKAFrosty\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nIn simple cases, projection allows content from the parent component to be projected into the child component. In more complex cases there may be more than one content slot that needs to be projected. Having multiple content slots is achieved by naming them.\n\n### Example\n\nIn this example, we have created `<Collapsable>` component that toggles between open and closed states. Currently, when the `<Collapsable>` is closed it shows content that was implemented within `<Collapsable>`. Change that to an additional `<Slot>` to project the `q:slot=\"closed\"` content from the parent instead.\n\n## Unprojected Slots\n\nWe have added console statements to show when individual components re-render. Notice that the `<App>` component never re-renders on the client. Also notice that the `<Collapsable>` projects only one content at a time. This means that when `<App>` renders on the server it has to produce both default as well as `closed` content that Qwik must serialize. The benefit is that when `<Collapsable>` toggles between open and closed states, it does not need to re-render the `<App>` component to recover the content that was projected into it.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/slots/problem/app.tsx",
    "content": "import { component$, Slot, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  console.log('Render: <App>');\n  return (\n    <Collapsable>\n      <div q:slot=\"closed\">▶ (collapsed summary)</div>\n      <div q:slot=\"open\">\n        ▼<div> Content that should be displayed when the collapse component is open. </div>\n      </div>\n    </Collapsable>\n  );\n});\n\nexport const Collapsable = component$(() => {\n  console.log('Render: <Collapsable>');\n  const store = useStore({ open: true });\n  return (\n    <div onClick$={() => (store.open = !store.open)}>\n      {store.open ? <Slot name=\"open\" /> : `▶`}\n      {/* Instead, project content from the parent named \"closed\" here */}\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/projection/slots/solution/app.tsx",
    "content": "import { component$, Slot, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  console.log('Render: <App>');\n  return (\n    <Collapsable>\n      <div q:slot=\"closed\">▶ (collapsed summary)</div>\n      <div q:slot=\"open\">\n        ▼<div> Content that should be displayed when the collapse component is open. </div>\n      </div>\n    </Collapsable>\n  );\n});\n\nexport const Collapsable = component$(() => {\n  console.log('Render: <Collapsable>');\n  const store = useStore({ open: true });\n  return (\n    <div onClick$={() => (store.open = !store.open)}>\n      {store.open ? <Slot name=\"open\" /> : <Slot name=\"closed\" />}\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/props/basic/index.mdx",
    "content": "---\ntitle: Component Props | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nWeb applications are built up from components in the same way that general applications are built up from functions.\n\nComposing functions would not be very useful if you couldn't pass in parameters. In the same way that functions have parameters, components have \"props\". A component uses props to pass data to its children components.\n\n> **Your task**: Modify the code so that the parent `<App>` can pass `salutation=\"Hello\"` and `name=\"World\"` to the `<Greeter>`. Add properties to the `GreeterProps` interface and then add the necessary bindings.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/props/basic/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      <Greeter />\n    </main>\n  );\n});\n\ninterface GreeterProps {}\nexport const Greeter = component$((props: GreeterProps) => {\n  return <p>Bind props here</p>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/props/basic/solution/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <main>\n      <Greeter salutation=\"Hello\" name=\"World\" />\n    </main>\n  );\n});\n\ninterface GreeterProps {\n  salutation: string;\n  name: string;\n}\nexport const Greeter = component$((props: GreeterProps) => {\n  return (\n    <p>\n      {props.salutation} {props.name}!\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/props/closures/index.mdx",
    "content": "---\ntitle: Passing Closures | Tutorial\ncontributors:\n  - adamdbradley\n  - Nico385412\n  - the-r3aper7\n  - jmmon\n  - manucorporat\n  - mhevery\n  - Arthur-Fedotiev\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nProps must be serializable so that Qwik can resume and render each component independently from other components on the page. This poses a problem if we wish to pass a callback to a child component. Callbacks are functions and functions are not directly serializable, but they are serializable through the `$()` by converting them to QRLs first.\n\n## QRLs\n\nFunctions passing across serializable boundaries must be done through QRLs. QRLs are serialized forms of a function. (See [QRL](/docs/(qwik)/advanced/qrl/index.mdx) in the advanced section.)\n\nQwik has convenience APIs that end in `$` - these are equivalent to calling `$()` directly. These two lines are equivalent:\n\n- inline: `useTask$(() => {...}/>`\n- explicit: `const callbackQrl = $(() => {...}); useTaskQrl(callbackQrl)`\n\nMost of the time we use the first form as it allows us to inline our callbacks directly into the API. But at times it is necessary to use the second form so that we can separate where the function is declared from where it is used.\n\n## Declaring callback props\n\nA component can declare a callback in its props by:\n\n- Property that ends in `$` (as in `goodbye$`)\n- The type of the property is `QRL<T>` where `T` is the lazy reference type that the QRL points to (function signature).\n\n```tsx\ninterface MyComponentProps {\n  goodbye$: QRL<() => void>;\n  hello$: QRL<() => void>;\n}\n\nexport const MyComponent = component$((props: MyComponentProps) => { ... });\n```\n\nThis allows the user of `<MyComponent>` to use `goodbye$` form as shown here:\n\n```jsx\n<MyComponent goodbye$={goodbyeQrl} hello$={() => {...}} />\n```\n\n## Using callback props\n\nNotice that the `<MyComponent>` component receives a callback function.\n\nPassing the `props.goodbye$` as a reference to the `<button>`\n\n```jsx\n<button onClick$={props.goodbye$}>good bye</button>\n```\n\nCreating a new callback for `<button>` and internally invoking the callback QRL.\n\n```jsx\n<button\n  onClick$={async () => {\n    await props.hello$?.invoke('World');\n  }}\n>\n  hello\n</button>\n```\n\nThis form allows the `<button>` to invoke the callback with custom parameters. Notice that the invocation requires `async` and `await` as the QRLs are lazy-loaded.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/props/closures/problem/app.tsx",
    "content": "import { component$, $, type QRL } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const goodbye$ = $(() => alert('Good Bye!'));\n  return (\n    <main>\n      <MyComponent goodbye$={goodbye$} hello$={async (name) => alert('Hello ' + name)} />\n    </main>\n  );\n});\n\ninterface MyComponentProps {\n  goodbye$: QRL<() => void>;\n  hello$: QRL<(name: string) => void>;\n}\nexport const MyComponent = component$((props: MyComponentProps) => {\n  return (\n    <p>\n      <button onClick$={props.goodbye$}>good bye</button>\n      <button onClick$={async () => await props.hello$('World')}>hello</button>\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/props/closures/solution/app.tsx",
    "content": "import { component$, $, type QRL } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const goodbye$ = $(() => alert('Good Bye!'));\n  return (\n    <main>\n      <MyComponent goodbye$={goodbye$} hello$={async (name) => alert('Hello ' + name)} />\n    </main>\n  );\n});\n\ninterface MyComponentProps {\n  goodbye$: QRL<() => void>;\n  hello$: QRL<(name: string) => void>;\n}\nexport const MyComponent = component$((props: MyComponentProps) => {\n  return (\n    <p>\n      <button onClick$={props.goodbye$}>good bye</button>\n      <button onClick$={async () => await props.hello$('World')}>hello</button>\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/closures/index.mdx",
    "content": "---\ntitle: Lazy Loading Closures | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - wmertens\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nA closure can be converted into a lazy-loaded reference using the `$()` function. This generates a `QRL<Function>` type. A QRL is a lazy-loadable reference of the closure. In our case, we have extracted the closure associated with the `onInput` event into the component body. Because it is no longer inlined we need to change how the JSX refers to it from `onInput$` to `onInputQrl`.\n\nNotice that our closure closes over the `store` that is captured by the Optimizer and then restored as needed.\n\n### Example\n\nIn this example, we would like to demonstrate how easy it is to lazy-load behavior in Qwik. Let's lazy load the code that is executed when the `Enter` key is pressed. Wrap the code associated with `Enter` with `$()` to mark it for lazy loading. The resulting `QRL<()=>void>` can then be lazy-invoked with `.invoke()` and the result can be awaited with `await` keyword.\n\nLook at the `Symbols` tab to see how the code was broken up into pieces.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/closures/problem/app.tsx",
    "content": "import { component$, useStore, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ name: '' });\n  return (\n    <>\n      <label>\n        Enter your name followed by the enter key:{' '}\n        <input\n          onInput$={$(async (ev, input) => {\n            store.name = input.value;\n          })}\n          onChange$={$(async () => {\n            if (store.name) alert(store.name);\n          })}\n          value={store.name}\n        />\n      </label>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/closures/solution/app.tsx",
    "content": "// @ts-ignore: Unused import\nimport { component$, useStore, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ name: '' });\n  return (\n    <>\n      <label>\n        Enter your name followed by the enter key:{' '}\n        <input\n          onInput$={(event, input) => {\n            store.name = input.value;\n          }}\n          onChange$={() => {\n            if (store.name) alert(store.name);\n          }}\n          value={store.name}\n        />\n      </label>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/data/index.mdx",
    "content": "---\ntitle: Loading Data | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - felixsanz\n  - forresst\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nThe Optimizer can be used to lazy-load data, not just functions. The benefit of doing that is that lazy loading any part of your application becomes easy.\n\nUse the stand-alone `$()` function to mark the data that you wish to lazy load. The `$()` function returns a `QRL` that is a reference that can be serialized by Qwik and that can later be resolved into the original value.\n\n### Example\n\nLoad the data representing the message lazily as part of the click listener.\n\nFor this exercise imagine that we wish to lazy load the `'Hello World!'` string. Use the `$()` function to mark the string as lazy-loadable. Then use `await` to resolve the lazy-loadable value.\n\nGo to the `Symbols` tab and examine how the code was broken down into parts.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/data/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <button onClick$={async () => alert('Hello World!')}>click me</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/data/solution/app.tsx",
    "content": "import { component$, $ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <button onClick$={async () => alert(await $('Hello World!').resolve())}>click me</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/optimizer/index.mdx",
    "content": "---\ntitle: Optimizer | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mhevery\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nFor the application to be resumable it needs to have lots of entry points. For example, clicking on button `A` is a different entry point than clicking on button `B`. When we implement an application we don't usually think about entry points and so we typically end up with just one entry point or the `main()` function.\n\nThe Optimizer does its job by looking for functions that end in `$` character. For example, the Optimizer will transform a call to [`component$()`](/docs/(qwik)/core/overview/index.mdx#component) into an entry point. Notice that the name of the function doesn't matter only that it ends with the `$`.\n\nEvery time you see `$` you should think, there is a lazy-loaded boundary here. The implication is that the lazy-loaded content may require lazy-loading and hence can't be accessed synchronously.\n\nWhile the Optimizer can serialize any data that Qwik can serialize, it has special handling for closures. Closures are functions that are created inside of other functions and that may capture variables in the lexical scope. The ability to serialize closures is a key property that makes Qwik resumable. Without closure serialization, it would be difficult to have resumable applications.\n\n### Example\n\nIn this example notice that we have two lazy-loaded chunks because we have two `$` in our code.\n\nOpen the `Symbols` tab and notice how Optimizer turned the `onClick$` function into an entry point. Specifically, notice that the `onClick$` entry point does not import the `@builder.io/qwik` module.\n\nNow change the `onClick$` callback to `store.count++`.\n\nOpen the `Symbols` tab again and notice that this time the Optimizer imported `@builder.io/qwik` and inserted `useLexicalScope()` call to restore the captured state of the event handler. Restoring the captured state of the function is what makes Qwik resumable.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/optimizer/problem/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ count: 0 });\n  return (\n    <>\n      Count: {store.count} <button onClick$={() => console.log('+1')}>+1</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/qrl/optimizer/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ count: 0 });\n  return (\n    <>\n      Count: {store.count} <button onClick$={() => store.count++}>+1</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/explicit/index.mdx",
    "content": "---\ntitle: Explicit Reactivity | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - forresst\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nIn addition to implicit reactivity created by the templates, Qwik supports explicit execution of code when a property changes. This is achieved through the [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) hook. [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) hooks execute before the component renders and can be asynchronous. The hook can also have a clean-up function that is invoked on the next hook execution or when the component is removed.\n\nIn this example clicking on `+1` updates `count` immediately. What we would like is to update the `delay count` after a 2-second delay. If `count` is updated before the 2 seconds are up then the timer is restarted.\n\nNotice that the [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) callback receives a `track` function. Use the `track` function to tell Qwik which properties should trigger the task's watcher. The `track` function creates subscriptions in the store. On each invocation of [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) the subscriptions are cleared, so it is important to always set up a new set of subscriptions. This is useful if the set of subscriptions changes during the function's lifetime.\n\nThe [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) callback function can return a cleanup function. The clean-up function is invoked on the next [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) callback execution or when the component is removed. In our case, the cleanup function is used for returning code which clears the `setTimeout`.\n\nThe [`useTask$()`](/docs/(qwik)/core/tasks/index.mdx#usetask) callbacks execute before the component is rendered. This allows them to be used to compute values used in rendering. The function runs on both server and client. The server execution sets up subscriptions that are then serialized and available to the client. This saves the client from having to download all of the components and execute them at least once to recover the subscription information for the system.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/explicit/problem/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore, useTask$ } from '@builder.io/qwik';\n\ninterface AppStore {\n  count: number;\n  delayCount: number;\n}\nexport default component$(() => {\n  const store = useStore<AppStore>({\n    count: 0,\n    delayCount: 0,\n  });\n  console.log('Render: <App>');\n  useTask$(({ track, cleanup }) => {\n    // tracking `store.count`\n    // setup a timer to copy `count => delayCount` after 2 seconds.\n    cleanup(() => {\n      // cleanup code\n    });\n  });\n  return (\n    <>\n      <DisplayCount store={store} />\n      <DisplayDelayCount store={store} />\n      <button onClick$={() => store.count++}>+1</button>\n    </>\n  );\n});\n\nexport const DisplayCount = component$((props: { store: AppStore }) => {\n  console.log('Render: <DisplayA>');\n  return <>{props.store.count}</>;\n});\n\nexport const DisplayDelayCount = component$((props: { store: AppStore }) => {\n  console.log('Render: <DisplayB>');\n  return <>{props.store.delayCount}</>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/explicit/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore, useTask$ } from '@builder.io/qwik';\n\ninterface AppStore {\n  count: number;\n  delayCount: number;\n}\nexport default component$(() => {\n  const store = useStore({\n    count: 0,\n    delayCount: 0,\n  });\n  console.log('Render: <App>');\n  useTask$(({ track, cleanup }) => {\n    track(() => store.count);\n    const id = setTimeout(() => (store.delayCount = store.count), 2000);\n    cleanup(() => clearTimeout(id));\n  });\n  return (\n    <>\n      <DisplayCount store={store} />\n      <DisplayDelayCount store={store} />\n      <button onClick$={() => store.count++}>+1</button>\n    </>\n  );\n});\n\nexport const DisplayCount = component$((props: { store: AppStore }) => {\n  console.log('Render: <DisplayA>');\n  return <>{props.store.count}</>;\n});\n\nexport const DisplayDelayCount = component$((props: { store: AppStore }) => {\n  console.log('Render: <DisplayB>');\n  return <>{props.store.delayCount}</>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/resource/index.mdx",
    "content": "---\ntitle: useResource$() | Tutorial\ncontributors:\n  - adamdbradley\n  - muralikrishna8\n  - jmmon\n  - manucorporat\n  - mhevery\n  - bryanhannes\n  - devagja\n  - avivr\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nFor this tutorial, we would like to fetch the list of repositories for a given GitHub organization. To aid you, we have added the `getRepositories()` function to the bottom of the file. Your task is to use the `getRepositories()` function to fetch the list of repositories whenever the user updates the `org` input.\n\nQwik provides [`useResource$()`](/docs/(qwik)/core/state/index.mdx) and `<Resource>` to help you fetch and display data from the server. When fetching data the application can be in one of three states:\n\n- `pending`: the data is being fetched from the server => Render `loading...` indicator.\n- `resolved`: the data has successfully been fetched from the server => Render the data.\n- `rejected`: the data could not be fetched from the server due to an error => Render the error.\n\nUse [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function to set up how the data is fetched from the server. Use `<Resource>` to display the data.\n\n## Fetching data\n\nUse [`useResource$()`](/docs/(qwik)/core/state/index.mdx) to set up how the data is fetched from the server.\n\n```jsx\n  const reposResource = useResource$<string[]>(({ track, cleanup }) => {\n    // We need a way to re-run fetching data whenever the `github.org` changes.\n    // Use `track` to trigger re-running of this data fetching function.\n    track(() => github.org);\n\n    // A good practice is to use `AbortController` to abort the fetching of data if\n    // new request comes in. We create a new `AbortController` and register a `cleanup`\n    // function which is called when this function re-runs.\n    const controller = new AbortController();\n    cleanup(() => controller.abort());\n\n    // Fetch the data and return the promises.\n    return getRepositories(github.org, controller);\n  });\n```\n\nThe [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function returns a `ResourceReturn` object, which is a Promise-like object that can be serialized by Qwik. The [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function allows you to `track` store properties so that the [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function can be reactive on store changes. The `cleanup` function allows you to register a code that needs to be run to release resources from the previous run. Finally, the [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function returns a promise that will resolve to the value.\n\n## Rendering data\n\nUse `<Resource>` to display the data of the [`useResource$()`](/docs/(qwik)/core/state/index.mdx) function. The `<Resource>` allows you to render different content depending if the resource is `pending`, `resolved` or `rejected`.\n\nOn the server the `<Resource>` does not render `loading` state, instead, it pauses rendering until the resource is resolved and will always render as either `resolved` or `rejected`. (On the client, the `<Resource>` renders all states including `pending`.)\n\n```jsx\n<Resource\n  value={resourceToRender}\n  onPending={() => <div>Loading...</div>}\n  onRejected={(reason) => <div>Error: {reason}</div>}\n  onResolved={(data) => <div>{data}</div>}\n/>\n```\n\n## SSR vs Client\n\nNotice that the same code can render on both server and client (with slightly different behavior, which skips the `pending` state rendering on the server.)\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/resource/problem/app.tsx",
    "content": "// @ts-ignore: Unused import\nimport { component$, useStore, Resource, useResource$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const github = useStore({\n    org: 'QwikDev',\n  });\n\n  // Use useResource$() to set up how the data is fetched from the server.\n  // See the example for Fetching Data in the text on the left.\n  // @ts-ignore: Unused declaration\n  const reposResource = useResource$<string[]>(({ track, cleanup }) => {\n    // We need a way to re-run fetching data whenever the `github.org` changes.\n    // Use `track` to trigger re-running of the this data fetching function.\n    track(() => github.org);\n\n    // A good practice is to use `AbortController` to abort the fetching of data if\n    // new request comes in. We create a new `AbortController` and register a `cleanup`\n    // function which is called when this function re-runs.\n    const controller = new AbortController();\n    cleanup(() => controller.abort());\n\n    // Fetch the data and return the promises.\n    return getRepositories(github.org, controller);\n  });\n\n  console.log('Render');\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} onInput$={(ev, el) => (github.org = el.value)} />\n        </label>\n      </p>\n      <section>\n        {/* Use <Resource> to display the data from the useResource$() function. */}\n        {/* To help, here's a callback function to display the data on resolved. */}\n        {/* (repos) => (\n            <ul>\n              {repos.map((repo) => (\n                <li>\n                  <a href={`https://github.com/${github.org}/${repo}`}>{repo}</a>\n                </li>\n              ))}\n            </ul>\n          ) */}\n      </section>\n    </main>\n  );\n});\n\nexport async function getRepositories(\n  username: string,\n  controller?: AbortController\n): Promise<string[]> {\n  console.log('FETCH', `https://api.github.com/users/${username}/repos`);\n  const resp = await fetch(`https://api.github.com/users/${username}/repos`, {\n    signal: controller?.signal,\n  });\n  console.log('FETCH resolved');\n  const json = await resp.json();\n  return Array.isArray(json)\n    ? json.map((repo: { name: string }) => repo.name)\n    : Promise.reject(json);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/resource/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore, Resource, useResource$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const github = useStore({\n    org: 'QwikDev',\n  });\n\n  const reposResource = useResource$<string[]>(({ track, cleanup }) => {\n    // We need a way to re-run fetching data whenever the `github.org` changes.\n    // Use `track` to trigger re-running of this data fetching function.\n    track(() => github.org);\n\n    // A good practice is to use `AbortController` to abort the fetching of data if\n    // new request comes in. We create a new `AbortController` and register a `cleanup`\n    // function which is called when this function re-runs.\n    const controller = new AbortController();\n    cleanup(() => controller.abort());\n\n    // Fetch the data and return the promises.\n    return getRepositories(github.org, controller);\n  });\n\n  console.log('Render');\n  return (\n    <main>\n      <p>\n        <label>\n          GitHub username:\n          <input value={github.org} onInput$={(ev, el) => (github.org = el.value)} />\n        </label>\n      </p>\n      <section>\n        <Resource\n          value={reposResource}\n          onPending={() => <>Loading...</>}\n          onRejected={(error) => <>Error: {error.message}</>}\n          onResolved={(repos) => (\n            <ul>\n              {repos.map((repo) => (\n                <li>\n                  <a href={`https://github.com/${github.org}/${repo}`}>{repo}</a>\n                </li>\n              ))}\n            </ul>\n          )}\n        />\n      </section>\n    </main>\n  );\n});\n\nexport async function getRepositories(\n  username: string,\n  controller?: AbortController\n): Promise<string[]> {\n  console.log('FETCH', `https://api.github.com/users/${username}/repos`);\n  const resp = await fetch(`https://api.github.com/users/${username}/repos`, {\n    signal: controller?.signal,\n  });\n  console.log('FETCH resolved');\n  const json = await resp.json();\n  return Array.isArray(json)\n    ? json.map((repo: { name: string }) => repo.name)\n    : Promise.reject(json);\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/template/index.mdx",
    "content": "---\ntitle: Implicit Reactivity | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - wtlin1228\n  - mrhoodz\nupdated_at: '2023-09-05T19:45:19Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nThis example demonstrates how mutating stores automatically update its subscribers.\n\nDuring SSR rendering the server needs to render all of the components in the application. As it is rendering the components the bindings in those components perform reads on store properties. For example, when the text node in the `<DisplayA>` reads the `countA` property from the store, Qwik records that as a subscription. Qwik now knows that if `countA` changes then the text node in the `<DisplayA>` needs to be re-render. Executing the signal operations will automatically set up subscriptions on the store. Each time the signal operations executed the old subscriptions are thrown away and new subscriptions are created. This means that the text node can change the set of things it is listening to during its lifecycle.\n\nCurrently, the buttons don't do anything. Implement the buttons to increment the respective store properties.\n\nOnce you make the buttons work, notice that even though all state is stored in a single store, the updates are very focused. `a++` button will only cause the re-rendering of the text node inside `<DisplayA>` and `b++` button will only cause re-rendering of the text node inside `<DisplayB>`. The fine-grained re-rendering is an important property of Qwik. It is what allows Qwik applications to stay lean and not download too much code unnecessarily.\n\nSubscriptions are automatically created and released when the component is removed. There is no need to keep track of them or release them manually.\n\nQwik is a reactive system. All reactive systems require a single full execution of the application to create subscriptions. Qwik applications also require full execution to set up all subscriptions. However, Qwik applications perform the full execution on the server and transfer the subscription information to the client. In this way, the client knows which component or part of component needs to be re-rendered when without being forced to do one full rendering of the whole application. Doing so would force all components to be eagerly downloaded, and Qwik wants to avoid that.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/template/problem/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\ninterface AppStore {\n  countA: number;\n  countB: number;\n}\nexport default component$(() => {\n  const store = useStore<AppStore>({\n    countA: 0,\n    countB: 0,\n  });\n  console.log('Render: <App>');\n  return (\n    <>\n      <button onClick$={() => null}>a++</button>\n      <DisplayA store={store} />\n      <hr />\n      <button onClick$={() => null}>b++</button>\n      <DisplayB store={store} />\n    </>\n  );\n});\n\nexport const DisplayA = component$<{ store: AppStore }>((props) => {\n  console.log('Render: <DisplayA>');\n  return <>{props.store.countA}</>;\n});\n\nexport const DisplayB = component$<{ store: AppStore }>((props) => {\n  console.log('Render: <DisplayB>');\n  return <>{props.store.countB}</>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/reactivity/template/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\ninterface AppStore {\n  countA: number;\n  countB: number;\n}\nexport default component$(() => {\n  const store = useStore({\n    countA: 0,\n    countB: 0,\n  });\n  console.log('Render: <App>');\n  return (\n    <>\n      <button onClick$={() => store.countA++}>a++</button>\n      <DisplayA store={store} />\n      <hr />\n      <button onClick$={() => store.countB++}>b++</button>\n      <DisplayB store={store} />\n    </>\n  );\n});\n\nexport const DisplayA = component$<{ store: AppStore }>((props) => {\n  console.log('Render: <DisplayA>');\n  return <>{props.store.countA}</>;\n});\n\nexport const DisplayB = component$<{ store: AppStore }>((props) => {\n  console.log('Render: <DisplayB>');\n  return <>{props.store.countB}</>;\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/basic/index.mdx",
    "content": "---\ntitle: Storing State | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nApplications need to store state to be useful, otherwise they're just static pages.\n\nQwik tracks application state for two reasons:\n\n1. To serialize data when the application pauses on the server, and deserialize as the application resumes on the client.\n\n1. To create subscriptions on stores so that Qwik knows which components to re-render. If Qwik didn't track subscriptions, it would have to re-render the whole application - which would defeat the purpose of lazy-loading.\n\nThe component on the right doesn't work yet because `counter` is just a plain object with no subscriptions. As a result, Qwik doesn't know when `counter.count` changes, and therefore doesn't know to re-render the `<App>` component.\n\n> **Your task:** Wrap `counter` in [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) to enable dependency tracking and automatic re-rendering.\n\n## Serialization\n\nOpen the _HTML_ tab to see what information is serialized by the server. Look in the `<script type=\"qwik/json\">` block for serialization information and notice that:\n\n1. `{count: 0}` is in the serialized state.\n1. At the end of the serialized state are `subs` which contain `\"count\"`. These subscriptions tell Qwik which component to re-render as the state changes.\n\nQwik state is in no way tied to the component that created it. The state can be passed to any component in the application and Qwik creates the needed subscriptions and re-renders only the affected components.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/basic/problem/app.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const counter = { count: 0 };\n\n  return (\n    <>\n      <p>Count: {counter.count}</p>\n      <button onClick$={() => counter.count++}>+1</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/basic/solution/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const counter = useStore({ count: 0 });\n\n  return (\n    <>\n      <p>Count: {counter.count}</p>\n      <button onClick$={() => counter.count++}>+1</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/no-serialize/index.mdx",
    "content": "---\ntitle: Non-serializable Properties | Tutorial\ncontributors:\n  - jmmon\n  - adamdbradley\n  - manucorporat\n  - tidiview\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nStores must always be serializable, however sometimes you may want to persist a value on a store that can't be serialized. Values like these persist in the browser only when the application is resumed on the client.\n\nWhen the application is paused, non-serializable properties are discarded.\n\n> **Your task**: Add a cleanup function in `store.cleanup` so that the `stop` button can clear the interval with `clearInterval()`.\n> For that, add `noSerialize` import from '@builder.io/qwik' and use `noSerialize` function to wrap clearInterval function.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/no-serialize/problem/app.tsx",
    "content": "import { component$, type NoSerialize, useStore } from '@builder.io/qwik';\n\ninterface AppStore {\n  time: null | string;\n  cleanup: NoSerialize<() => void>;\n}\nexport default component$(() => {\n  const store = useStore<AppStore>({\n    time: null,\n    cleanup: undefined,\n  });\n  return (\n    <>\n      <p>Current Time: {store.time}</p>\n      <button\n        onClick$={() => {\n          // @ts-ignore\n          const id = setInterval(() => (store.time = new Date().toString()), 1000);\n          // assign a cleanup function to: store.cleanup\n        }}\n      >\n        start\n      </button>\n      <button\n        onClick$={() => {\n          store.cleanup && store.cleanup();\n          store.cleanup = undefined;\n        }}\n      >\n        stop\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/no-serialize/solution/app.tsx",
    "content": "import { component$, noSerialize, type NoSerialize, useStore } from '@builder.io/qwik';\n\ninterface AppStore {\n  time: null | string;\n  cleanup: NoSerialize<() => void>;\n}\nexport default component$(() => {\n  const store = useStore<AppStore>({\n    time: null,\n    cleanup: undefined,\n  });\n  return (\n    <>\n      <p>Current Time: {store.time}</p>\n      <button\n        onClick$={() => {\n          const id = setInterval(() => (store.time = new Date().toString()), 1000);\n          store.cleanup = noSerialize(() => clearInterval(id));\n        }}\n      >\n        start\n      </button>\n      <button\n        onClick$={() => {\n          store.cleanup && store.cleanup();\n          store.cleanup = undefined;\n        }}\n      >\n        stop\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/recursive/index.mdx",
    "content": "---\ntitle: Recursive Store | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mhevery\n  - corscheid\n  - fkruczek\n  - mrhoodz\n  - indicozy\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nThis example features a store that contains other objects rather than just primitives.\n\nBecause `useStore()` tracks deep reactivity by default, Arrays and Objects inside the store will also be reactive. \n\nFor [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) to track all nested properties, it needs to allocate a lot of [Proxy](/docs/(qwik)/concepts/reactivity/index.mdx#proxy) objects. This can be a performance issue if you have a lot of nested properties. \n\nIn that case, you can pass the additional argument: `{deep: false}` to `useStore` to only track the top-level properties.\n\n> **Your task:** Add `{deep: false}` as a second argument to the [`useStore()`](/docs/(qwik)/core/state/index.mdx#usestore) function and modify event handlers to assign new values to the top-level properties of the store.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/recursive/problem/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ counter: { count: 0 }, list: [0] });\n\n  return (\n    <>\n      <Display counter={store.counter} list={store.list} />\n      <button onClick$={() => store.counter.count++}>+1 Count</button>\n      <button onClick$={() => store.list.push(0)}>+1 List element</button>\n    </>\n  );\n});\n\ninterface DisplayProps {\n  counter: { count: number };\n  list: number[];\n}\nexport const Display = component$((props: DisplayProps) => {\n  return (\n    <p>\n      Count: {props.counter.count}, List length: {props.list.length}\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/recursive/solution/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({ counter: { count: 0 }, list: [0] }, { deep: false });\n\n  return (\n    <>\n      <Display counter={store.counter} list={store.list} />\n      <button onClick$={() => (store.counter = { count: ++store.counter.count })}>+1 Count</button>\n      <button onClick$={() => (store.list = [...store.list, 0])}>+1 List element</button>\n    </>\n  );\n});\n\ninterface DisplayProps {\n  counter: { count: number };\n  list: number[];\n}\nexport const Display = component$((props: DisplayProps) => {\n  return (\n    <p>\n      Count: {props.counter.count}, List length: {props.list.length}\n    </p>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/serialization/index.mdx",
    "content": "---\ntitle: Serialization Graph | Tutorial\ncontributors:\n  - adamdbradley\n  - the-r3aper7\n  - mhevery\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nStores are serializable as the application is paused on the server and resumed on the client.\n\nData in a store isn't required to be free of nested references. Qwik is perfectly happy serializing stores that feature data [cycles](https://wikipedia.org/wiki/Directed_acyclic_graph).\n\nStores can also include [Qwik URLs (QRLs)](../../../docs/(qwik)/advanced/qrl/index.mdx).\n\nThere is no limit to how many stores can be created per component, nor to where they are passed. While the best practice is to implement top-down data flows, Qwik doesn't require this design philosophy.\n\n> **Your task**: Insert a few items into `parent.children` to create a circular reference between the parent and child stores.\n\nThis example also shows how to attach and invoke closures to a store using `$` and `QRL`.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/serialization/problem/app.tsx",
    "content": "import { component$, useStore, type QRL, $ } from '@builder.io/qwik';\n\ninterface ParentStore {\n  name: string;\n  children: ChildStore[];\n  greetNames: QRL<(parent: ParentStore) => void>;\n}\ninterface ChildStore {\n  name: string;\n  parent: ParentStore;\n}\nexport default component$(() => {\n  const parent: ParentStore = {\n    name: 'Builder.io',\n    children: [],\n    greetNames: $((parent) => alert(parent.name)),\n  };\n  parent.children = [\n    // insert few items here\n  ];\n  const parentStore = useStore<ParentStore>(parent, { deep: true });\n  return (\n    <>\n      {parentStore.name}\n      <button onClick$={async () => await parentStore.greetNames(parent)}>alert</button>\n      <ul>\n        {parentStore.children.map((child) => (\n          <li>\n            {child.name} -&lt; {child.parent.name}\n          </li>\n        ))}\n      </ul>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/serialization/solution/app.tsx",
    "content": "import { component$, useStore, type QRL, $ } from '@builder.io/qwik';\n\ninterface ParentStore {\n  name: string;\n  children: ChildStore[];\n  greetNames: QRL<(parent: ParentStore) => void>;\n}\ninterface ChildStore {\n  name: string;\n  parent: ParentStore;\n}\nexport default component$(() => {\n  const parent: ParentStore = {\n    name: 'Builder.io',\n    children: [],\n    greetNames: $((parent) => alert(parent.name)),\n  };\n  parent.children = [\n    { name: 'Qwik', parent },\n    { name: 'Partytown', parent },\n  ];\n  const parentStore = useStore<ParentStore>(parent, { deep: true });\n  return (\n    <>\n      {parentStore.name}\n      <button onClick$={async () => await parentStore.greetNames(parent)}>alert</button>\n      <ul>\n        {parentStore.children.map((child) => (\n          <li>\n            {child.name} -&lt; {child.parent.name}\n          </li>\n        ))}\n      </ul>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/use-signal/index.mdx",
    "content": "---\ntitle: useSignal() Hook | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - neonpie\n  - GustavoMelloGit\n  - mrhoodz\n  - AnthonyPAlicea\n  - mhevery\n  - Bootstrap-Paradox\n  - itsthesteve\n  - zanettin\nupdated_at: '2023-06-26T13:18:25Z'\ncreated_at: '2022-11-20T08:50:32Z'\n---\n\nUse `useSignal()` to store any single value similar to `useStore()`. `useSignal` is heavily optimized when it comes to re-rendering components. It is able to skip re-renderings of parent components even when the signal itself is defined in the parent. `useSignal` works with all [primitive types](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) as well as with not nested / flat objects. If you need to store arrays or complex objects use [useStore](/docs/(qwik)/core/state/index.mdx#usestore) instead.\n\nSome examples would be:\n\n```tsx\nconst intStore = useSignal(0);\nconst stringStore = useSignal('foo');\nconst booleanStore = useSignal(true);\nconst objectStore = useSignal({fruit: 'apple', color: 'green'});\n\n// DON'T DO THIS!\nconst arrayStore = useSignal(['banana','oranges']);\nconst nestedObjectStore = useSignal({\n  fruits: {\n    banana: 10,\n    apple: 5\n  },\n  vegetables: {\n    tomato: 7,\n    broccoli: 14\n  }\n});\n```\n\nTo read or update the values you can simply access the `value` property:\n\n```\n<>\n  <button onClick$={() => intStore.value++}>Click me</button>\n  <p>{intStore.value}</p>\n</>\n```\n\nIt is also able to hold a reference of a DOM element created by the component.\n\nThere are two parts to retrieving a DOM element reference:\n\n1. `useSignal()` returns a store object that contains a `value` property which will eventually contain the reference.\n2. `ref={_ref_variable_}` is a prop binding that will set the `value` property of the `ref` object to the DOM element.\n\n### Example\n\nThe example on the right uses `useSignal()` to get a reference to the `aside` element. However, it is missing the `ref` prop binding. Add the `ref` prop binding to make the example work as expected.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/use-signal/problem/app.tsx",
    "content": "import { component$, useSignal, useVisibleTask$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({\n    width: 0,\n    height: 0,\n  });\n  const outputRef = useSignal<Element>();\n  useVisibleTask$(() => {\n    if (outputRef.value) {\n      const rect = outputRef.value.getBoundingClientRect();\n      store.width = Math.round(rect.width);\n      store.height = Math.round(rect.height);\n    }\n  });\n\n  return (\n    <main>\n      <aside style={{ border: '1px solid red', width: '100px' }}>\n        Change text value here to stretch the box.\n      </aside>\n      <p>\n        The above red box is {store.height} pixels high and {store.width} pixels wide.\n      </p>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/store/use-signal/solution/app.tsx",
    "content": "import { component$, useVisibleTask$, useSignal, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const store = useStore({\n    width: 0,\n    height: 0,\n  });\n  const outputRef = useSignal<Element>();\n  useVisibleTask$(() => {\n    if (outputRef.value) {\n      const rect = outputRef.value.getBoundingClientRect();\n      store.width = Math.round(rect.width);\n      store.height = Math.round(rect.height);\n    }\n  });\n\n  return (\n    <main>\n      <aside style={{ border: '1px solid red', width: '100px' }} ref={outputRef}>\n        Change text value here to stretch the box.\n      </aside>\n      <p>\n        The above red box is {store.height} pixels high and {store.width} pixels wide.\n      </p>\n    </main>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/style/scoped/index.mdx",
    "content": "---\ntitle: Scoped Styling | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mhevery\n  - mrhoodz\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nIn previous sections, we have discussed how styles can be loaded lazily as they are needed using [`useStyles$()`](/docs/(qwik)/core/styles/index.mdx#usestyles) hook. Browser styles are global and apply to all DOM elements, for this reason, Qwik also provides a way to load styles that are specific to a specific component. This is achieved by generating a unique class for each component and then inserting that unique class id into the stylesheet.\n\nUse `useStylesScoped$()` to load and scope the style to a specific component only.\n\n### Example\n\nIn this example, there are two components both of which have a class with the same name. Because of that, the two styles collide which results in undesirable behavior. Use the `useStylesScoped$()` hook to scope the styles to a specific component and fix the collision.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/style/scoped/problem/app.tsx",
    "content": "import { component$, useStyles$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <ComponentA />\n      <ComponentB />\n    </>\n  );\n});\n\nexport const ComponentA = component$(() => {\n  useStyles$(`\n    .component {\n      background-color: red;\n    }`);\n  return (\n    <div class=\"component\">\n      <div>A</div>\n    </div>\n  );\n});\n\nexport const ComponentB = component$(() => {\n  useStyles$(`\n    .component {\n      background-color: green;\n    }`);\n\n  return (\n    <div class=\"component\">\n      <div>B</div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/style/scoped/solution/app.tsx",
    "content": "import { component$, useStylesScoped$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <ComponentA />\n      <ComponentB />\n    </>\n  );\n});\n\nexport const ComponentA = component$(() => {\n  useStylesScoped$(`\n    .component {\n      background-color: red;\n    }`);\n  return (\n    <div class=\"component\">\n      <div>A</div>\n    </div>\n  );\n});\n\nexport const ComponentB = component$(() => {\n  useStylesScoped$(`\n    .component {\n      background-color: green;\n    }`);\n\n  return (\n    <div class=\"component\">\n      <div>B</div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/style/styles/index.mdx",
    "content": "---\ntitle: Styling | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mhevery\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nStyling is an important part of the design of a web application. Qwik is responsible for loading the style information when a component is mounted. Use [`useStyles$()`](/docs/(qwik)/core/styles/index.mdx#usestyles) to tell Qwik which style should be loaded.\n\n## Why not inline styles?\n\nA naive way to ensure that a component has the correct styles loaded is to inline the style information into a component like so.\n\n```tsx\nexport const MyComponent = () => {\n  return (\n    <>\n    <style>.my-class { color: red; }</style>\n      My Component\n    </>\n  );\n}\n```\n\nThe problem with this approach is that we will load styles twice.\n\n1. The styles are inserted into the HTML as part of the SSR.\n2. Then when the component is invalidated and needs to be re-rendered, the styles are loaded again because they are inlined.\n\nWhat is needed is to load the styles independently from the component. This is what [`useStyles$()`](/docs/(qwik)/core/styles/index.mdx#usestyles) is for. There are two scenarios:\n\n1. The component is rendered on the server and the styles are inserted into `<head>` as part of the SSR.\n   > Adding a new instance of a component to the application does not require that we load the styles as they are already included as part of SSR.\n2. The component is rendered on the client for the first time. In that case, the new component does not have styles in the `<head>` as the component was not part of SSR.\n   > Adding a new component that was not part of SSR requires that styles are loaded and inserted into `<head>`.\n\n### Example\n\nThis example contains two components:\n\n1. `<Sibling>`: The `<Sibling>` component is pre-rendered on the server. Because it is pre-rendered, it has styles in the `<head>` as it was part of SSR. Adding additional `<Sibling>` components does not require any styles to be loaded.\n2. `<Child>`: The `<Child>` component can be added by clicking the `toggle` button. Because it was not part of the SSR pre-rendered, it does not have styles in the `<head>`. Toggling `<Child>` requires that styles are loaded.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/style/styles/problem/app.tsx",
    "content": "import { component$, useStyles$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  useStyles$(AppCSS);\n  const store = useStore({ open: false, siblings: [0] }, { deep: true });\n\n  return (\n    <div class=\"parent\">\n      <button onClick$={() => (store.open = !store.open)}>toggle</button>\n      <button onClick$={() => store.siblings.push(0)}>addSibling</button>\n      {store.open ? <Child key=\"child\" /> : null}\n      {store.siblings.map(() => (\n        <Sibling />\n      ))}\n    </div>\n  );\n});\n\nexport const Child = component$(() => {\n  useStyles$(ChildCSS);\n  return (\n    <div class=\"child\">\n      <div>Child</div>\n    </div>\n  );\n});\n\nexport const Sibling = component$(() => {\n  useStyles$(SiblingCSS);\n\n  return (\n    <div class=\"sibling\">\n      <div>Sibling</div>\n    </div>\n  );\n});\n\n//TODO: These should be import as: import AppCSS from './app.css';\n// however the playground does not yet support such imports.\nexport const AppCSS = `\n.parent {\n  border: 1px solid black;\n  padding: 1em;\n}\n`;\nexport const ChildCSS = `\n.child {\n  margin-top: 1em;\n  border: 1px solid red;\n  padding: 1em;\n  display: block;\n}\n`;\nexport const SiblingCSS = `.sibling {\n  margin-top: 1em;\n  border: 1px solid green;\n  padding: 1em;\n  display: block;\n}\n`;\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/style/styles/solution/app.tsx",
    "content": "import { component$, useStyles$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  useStyles$(AppCSS);\n  const store = useStore({ open: false, siblings: [0] }, { deep: true });\n\n  return (\n    <div class=\"parent\">\n      <button onClick$={() => (store.open = !store.open)}>toggle</button>\n      <button onClick$={() => store.siblings.push(0)}>addSibling</button>\n      {store.open ? <Child key=\"child\" /> : null}\n      {store.siblings.map(() => (\n        <Sibling />\n      ))}\n    </div>\n  );\n});\n\nexport const Child = component$(() => {\n  useStyles$(ChildCSS);\n  return (\n    <div class=\"child\">\n      <div>Child</div>\n    </div>\n  );\n});\n\nexport const Sibling = component$(() => {\n  useStyles$(SiblingCSS);\n\n  return (\n    <div class=\"sibling\">\n      <div>Sibling</div>\n    </div>\n  );\n});\n\n//TODO: These should be import as: import AppCSS from './app.css';\n// however the playground does not yet support such imports.\nexport const AppCSS = `\n.parent {\n  border: 1px solid black;\n  padding: 1em;\n}\n`;\nexport const ChildCSS = `\n.child {\n  margin-top: 1em;\n  border: 1px solid red;\n  padding: 1em;\n  display: block;\n}\n`;\nexport const SiblingCSS = `.sibling {\n  margin-top: 1em;\n  border: 1px solid green;\n  padding: 1em;\n  display: block;\n}\n`;\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/tutorial-content-footer.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { ensureDefaultFiles, type TutorialStore } from './layout';\nimport { Link } from '@builder.io/qwik-city';\n\nexport const TutorialContentFooter = component$(({ store }: TutorialContentFooterProps) => {\n  return (\n    <div class=\"content-footer\">\n      <div>\n        {store.isShowingSolution ? (\n          <button\n            preventdefault:click\n            class=\"show-me\"\n            onClick$={() => {\n              store.files = ensureDefaultFiles(store.app.problemInputs);\n              store.isShowingSolution = false;\n            }}\n            type=\"button\"\n          >\n            Reset\n          </button>\n        ) : (\n          <button\n            preventdefault:click\n            class=\"show-me\"\n            onClick$={() => {\n              store.files = ensureDefaultFiles(store.app.solutionInputs);\n              store.isShowingSolution = true;\n            }}\n            type=\"button\"\n          >\n            Show Me\n          </button>\n        )}\n      </div>\n      <nav>\n        {store.prev ? (\n          <Link title={store.prev.title} href={`/tutorial/${store.prev.id}/`} class=\"nav-link prev\">\n            &lt; Previous\n          </Link>\n        ) : null}\n        {store.next ? (\n          <Link title={store.next.title} href={`/tutorial/${store.next.id}/`} class=\"nav-link next\">\n            Next &gt;\n          </Link>\n        ) : null}\n      </nav>\n    </div>\n  );\n});\n\ninterface TutorialContentFooterProps {\n  store: TutorialStore;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/tutorial-content-header.tsx",
    "content": "import tutorialSections from '@tutorial-data';\nimport { component$ } from '@builder.io/qwik';\nimport type { TutorialStore } from './layout';\nimport { useNavigate } from '@builder.io/qwik-city';\n\nexport const TutorialContentHeader = component$(({ store }: TutorialContentHeaderProps) => {\n  const nav = useNavigate();\n  return (\n    <div class=\"content-header\">\n      <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\">\n        <path\n          d=\"M5 6h14M5 12h14M5 18h14\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          stroke-width=\"2\"\n          stroke-linecap=\"round\"\n        />\n      </svg>\n\n      <select\n        onChange$={(_, elm: any) => {\n          if (location.pathname !== elm.value) {\n            nav(`/tutorial/${elm.value}/`);\n          }\n        }}\n      >\n        {(tutorialSections as Tutorial[]).map((s, key) => (\n          <optgroup key={key} label={s.title}>\n            {s.apps.map((t) => (\n              <option selected={t.id === store.appId} value={t.id} key={t.id}>\n                {t.title}\n              </option>\n            ))}\n          </optgroup>\n        ))}\n      </select>\n\n      <h1>{store.app.title}</h1>\n    </div>\n  );\n});\n\ninterface Tutorial {\n  title: string;\n  apps: { id: string; title: string }[];\n}\n\ninterface TutorialContentHeaderProps {\n  store: TutorialStore;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/tutorial-data.ts",
    "content": "import type { ReplModuleInput } from '../../repl/types';\n\nexport interface TutorialSection {\n  id: string;\n  title: string;\n  apps: TutorialApp[];\n}\n\nexport interface TutorialApp {\n  id: string;\n  title: string;\n  problemInputs: ReplModuleInput[];\n  solutionInputs: ReplModuleInput[];\n  enableHtmlOutput?: boolean;\n  enableClientOutput?: boolean;\n  enableSsrOutput?: boolean;\n}\n\n/** Generated at build-time. See /packages/docs/src/routes/tutorial/tutorial-menu.json */\nconst tutorialSections: TutorialSection[] = [];\nexport default tutorialSections;\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/tutorial-menu.json",
    "content": "[\n  {\n    \"id\": \"welcome\",\n    \"title\": \"Start here\",\n    \"apps\": [\n      {\n        \"id\": \"overview\",\n        \"title\": \"Qwik Tutorial Overview\",\n        \"enableHtmlOutput\": true,\n        \"enableClientOutput\": true,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"introduction\",\n    \"title\": \"Simple Application\",\n    \"apps\": [\n      {\n        \"id\": \"component\",\n        \"title\": \"Basic Component\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"store\",\n        \"title\": \"State management\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"listeners\",\n        \"title\": \"Event listeners\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"resource\",\n        \"title\": \"Fetching resource on state change\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"component\",\n    \"title\": \"Components\",\n    \"apps\": [\n      {\n        \"id\": \"basic\",\n        \"title\": \"Basic Component\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"binding\",\n        \"title\": \"Binding Expressions\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"composition\",\n        \"title\": \"Composing Components\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"lite\",\n        \"title\": \"Inline Components\",\n        \"enableHtmlOutput\": true,\n        \"enableClientOutput\": true,\n        \"enableSsrOutput\": true\n      }\n    ]\n  },\n  {\n    \"id\": \"events\",\n    \"title\": \"Events\",\n    \"apps\": [\n      {\n        \"id\": \"basic\",\n        \"title\": \"Listening on events\",\n        \"enableHtmlOutput\": true,\n        \"enableClientOutput\": true,\n        \"enableSsrOutput\": true\n      },\n      {\n        \"id\": \"document\",\n        \"title\": \"Listening on document/window\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"preventdefault\",\n        \"title\": \"Preventing default behavior\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"synchronous-sync\",\n        \"title\": \"Synchronous Events with sync()\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"synchronous-visible\",\n        \"title\": \"Synchronous Events with useVisibleTask$()\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"programmatic\",\n        \"title\": \"useOn() / useOnDocument() / useOnWindow() - Programmatic Listeners\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"store\",\n    \"title\": \"Stores\",\n    \"apps\": [\n      {\n        \"id\": \"basic\",\n        \"title\": \"Storing State\",\n        \"enableHtmlOutput\": true,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"use-signal\",\n        \"title\": \"useSignal()\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"recursive\",\n        \"title\": \"Recursive Store\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"serialization\",\n        \"title\": \"Serialization Graph\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"no-serialize\",\n        \"title\": \"Non-serializable Properties\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"props\",\n    \"title\": \"Component Props\",\n    \"apps\": [\n      {\n        \"id\": \"basic\",\n        \"title\": \"Passing Data to Components\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"closures\",\n        \"title\": \"Passing Closures\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"reactivity\",\n    \"title\": \"Reactivity\",\n    \"apps\": [\n      {\n        \"id\": \"template\",\n        \"title\": \"template - Implicit Reactivity\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"explicit\",\n        \"title\": \"useTask$() - Explicit Reactivity\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"resource\",\n        \"title\": \"useResource$() - Explicit Reactivity\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"context\",\n    \"title\": \"Context\",\n    \"apps\": [\n      {\n        \"id\": \"basic\",\n        \"title\": \"Using context\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"hooks\",\n    \"title\": \"Lifecycle Hooks\",\n    \"apps\": [\n      {\n        \"id\": \"use-task\",\n        \"title\": \"useTask$()\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"use-visible-task\",\n        \"title\": \"useVisibleTask$()\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"use-on\",\n        \"title\": \"useOn() / useOnDocument() / useOnWindow()\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"projection\",\n    \"title\": \"Projection\",\n    \"apps\": [\n      {\n        \"id\": \"basic\",\n        \"title\": \"Basic Projection\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"slots\",\n        \"title\": \"Named Slots\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"fallback\",\n        \"title\": \"Fallback content\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"style\",\n    \"title\": \"Styling\",\n    \"apps\": [\n      {\n        \"id\": \"styles\",\n        \"title\": \"useStyles() - Styles\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"scoped\",\n        \"title\": \"useStylesScoped() - Scoped styles\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"qrl\",\n    \"title\": \"$ and QRL\",\n    \"apps\": [\n      {\n        \"id\": \"optimizer\",\n        \"title\": \"Optimizer\",\n        \"enableHtmlOutput\": true,\n        \"enableClientOutput\": true,\n        \"enableSsrOutput\": true\n      },\n      {\n        \"id\": \"data\",\n        \"title\": \"Lazy Loading constants\",\n        \"enableHtmlOutput\": true,\n        \"enableClientOutput\": true,\n        \"enableSsrOutput\": true\n      },\n      {\n        \"id\": \"closures\",\n        \"title\": \"Lazy Loading closures\",\n        \"enableHtmlOutput\": true,\n        \"enableClientOutput\": true,\n        \"enableSsrOutput\": true\n      }\n    ]\n  },\n  {\n    \"id\": \"composing\",\n    \"title\": \"Composing new APIs\",\n    \"apps\": [\n      {\n        \"id\": \"dollar\",\n        \"title\": \"Creating APIs with $\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      },\n      {\n        \"id\": \"use\",\n        \"title\": \"Composing use Hooks\",\n        \"enableHtmlOutput\": false,\n        \"enableClientOutput\": false,\n        \"enableSsrOutput\": false\n      }\n    ]\n  },\n  {\n    \"id\": \"understanding\",\n    \"title\": \"Understanding Qwik difference\",\n    \"apps\": [\n      {\n        \"id\": \"treeshaking\",\n        \"title\": \"Tree-shaking static components\"\n      },\n      {\n        \"id\": \"capturing\",\n        \"title\": \"Capturing lexical scope\"\n      }\n    ]\n  }\n]\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/tutorial.css",
    "content": "@reference \"tailwindcss\";\n\n.tutorial {\n  width: 100%;\n  height: calc(100vh - var(--header-height));\n}\n\n.tutorial .repl {\n  display: grid;\n  grid-template-rows: 50% 50%;\n  grid-template-areas:\n    'repl-input-panel'\n    'repl-output-panel';\n  height: calc(100vh - var(--header-height) - calc(var(--repl-tab-height) - 14px));\n}\n\n.tutorial .repl .repl-detail-panel {\n  display: none;\n}\n\n.tutorial .repl-input-panel .repl-tab-button-close {\n  display: none;\n}\n\n.tutorial-repl-footer {\n  height: calc(var(--repl-tab-height) - 14px);\n  background: var(--repl-tab-bg-color);\n}\n\n.tutorial main {\n  display: grid;\n  grid-template-columns: minmax(450px, 45%) auto;\n  grid-template-areas: 'tutorial-content-panel tutorial-repl-panel';\n  grid-template-rows: 100%;\n  height: calc(100% - var(--panel-toggle-height));\n  transition: transform 500ms;\n}\n\n.tutorial-repl-panel {\n  grid-area: tutorial-repl-panel;\n}\n\n.tutorial-content-panel {\n  grid-area: tutorial-content-panel;\n  position: relative;\n\n  border-right: 1px solid var(--bg-secondary-color);\n  color: var(--secondary-text-color);\n\n  display: grid;\n  grid-template-rows: calc(var(--repl-tab-height) - 14px) 1fr calc(var(--repl-tab-height) - 14px);\n  grid-template-areas:\n    'content-header'\n    'content-main'\n    'content-footer';\n}\n\n@media (max-width: 768px) {\n  .tutorial main {\n    width: 300%;\n    grid-template-columns: 33.33% 66.66%;\n  }\n\n  .tutorial .tutorial-panel-input {\n    transform: translateX(-33.33%);\n  }\n\n  .tutorial .tutorial-panel-output {\n    transform: translateX(-66.66%);\n  }\n\n  .tutorial .repl {\n    grid-template-rows: 100%;\n    grid-template-columns: 50% 50%;\n    grid-template-areas: 'repl-input-panel repl-output-panel';\n  }\n}\n\n.content-header {\n  grid-area: content-header;\n  position: relative;\n  background-color: var(--repl-tab-bg-color);\n}\n\n.content-header svg {\n  position: absolute;\n  top: 11px;\n  left: 10px;\n}\n\n.content-header select {\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  opacity: 0.0001;\n  cursor: pointer;\n  -webkit-appearance: none;\n}\n\n.content-header h1 {\n  display: block;\n  font-size: 17px;\n  font-weight: bold;\n  padding: 8px 4px 6px 38px;\n}\n\n.content-footer {\n  grid-area: content-footer;\n  padding: 7px 15px;\n  display: grid;\n  grid-template-columns: auto auto;\n  background-color: var(--repl-tab-bg-color);\n}\n\n.content-footer nav {\n  text-align: right;\n}\n\n.next-link {\n  margin-top: 20px;\n}\n\n.nav-link,\n.show-me[type='button'] {\n  display: inline-block;\n  margin: 0 0 0 15px;\n  font-size: 14px;\n  padding: 3px 12px;\n  border-radius: 3px;\n  background-color: var(--tutorial-nav-button-bg-color);\n  color: var(--tutorial-nav-button-text-color);\n  border: 1px solid var(--tutorial-nav-button-text-color);\n}\n\n.nav-link:hover,\n.show-me[type='button']:hover {\n  background-color: var(--tutorial-nav-button-hover-bg-color);\n  color: var(--qwik-blue);\n}\n\n.show-me[type='button'] {\n  margin: 0;\n}\n\n.show-me:hover {\n  margin: 0;\n  background-color: white;\n  color: var(--interactive-text-color);\n}\n\n.content-main {\n  grid-area: content-main;\n  padding: 0 30px 25px 25px;\n  overflow-y: auto;\n}\n\n.content-main a {\n  color: var(--interactive-text-color);\n  text-decoration: underline;\n}\n\n.content-main a:hover {\n  text-decoration: none;\n}\n\n.content-main h1 {\n  @apply text-5xl font-bold;\n  @apply mb-6;\n  @apply relative;\n  color: var(--text-color);\n}\n\n.content-main h2,\n.content-main h3,\n.content-main h4,\n.content-main h5,\n.content-main h6 {\n  @apply text-xl font-semibold;\n  @apply mt-8;\n  @apply mb-4;\n  @apply relative;\n  scroll-margin-top: var(--scroll-margin-top);\n  color: var(--text-color);\n}\n\n.content-main h2 {\n  @apply text-3xl;\n}\n\n.content-main p {\n  @apply my-5;\n  font-size: 17px;\n}\n\n.content-main ul,\n.content-main ol {\n  @apply my-4;\n  @apply ml-8;\n  font-size: 17px;\n  line-height: 1.7;\n  list-style: disc;\n}\n\n.content-main ol {\n  list-style: decimal;\n}\n\n.content-main li {\n  @apply my-1;\n  @apply pl-2;\n}\n\n.content-main pre {\n  overflow: auto;\n  color: white;\n  background-color: rgb(1 31 51);\n  padding: 18px 15px;\n  border-radius: 8px;\n}\n\n.content-main pre code {\n  display: block;\n  max-width: 50px;\n  background-color: transparent;\n  line-height: 1.5;\n  border: none;\n}\n\n.content-main code {\n  background-color: var(--code-bg-color);\n  padding: 2px 4px;\n  border-radius: 3px;\n  font-size: 0.9em;\n}\n\n.content-main table {\n  @apply my-5;\n}\n\n.content-main th,\n.content-main td {\n  padding: 6px;\n  vertical-align: top;\n}\n\n.content-main th:first-child,\n.content-main td:first-child {\n  padding-left: 0;\n}\n\n.content-main th:last-child,\n.content-main td:last-child {\n  padding-right: 0;\n}\n\n.content-main img {\n  border-radius: 5px;\n  overflow: hidden;\n}\n\n.content-main p.edit-tutorial {\n  color: rgb(130, 130, 130);\n  font-size: 14px;\n}\n\n.edit-tutorial svg {\n  display: inline-block;\n  margin: 0 2px 5px 0;\n}\n\n.edit-tutorial a {\n  text-decoration: none;\n  color: inherit;\n  font-size: inherit;\n  padding: 0 5px;\n}\n\n.edit-tutorial a:hover {\n  text-decoration: underline;\n}\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/understanding/capturing/index.mdx",
    "content": "---\ntitle: Capturing the lexical scope | Tutorial\ncontributors:\n  - adamdbradley\n  - manucorporat\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nIn this example, we will explore how Qwik serializes component state. A naive approach would be for Qwik to simply save all of the state associated with the `useStore()`. Qwik is more intelligent about the approach and tries to tree shake the stores that are not needed by the client.\n\nThe example consists of:\n\n- `<App/>`: which creates a store.\n- The Store contains the `largeData` property. Assume that this is a large data set that is only needed on the server. An example of this is the HackerNews demo. The server must retrieve the news articles from the JSON API and then use that data to render them. The articles are read-only for the user and so the HTML response will never re-render on the client. For this reason, it would be preferable not to send the data to the client.\n- A button that updates unrelated data.\n\nLook into the HTML tab and notice that `largeData` was serialized into `<script type=\"qwik/json\">`. This is not ideal because we are sending data to the client which will never change and will never be used for re-rendering. Your goal in this exercise is to fix this.\n\n## Why is `largeData` serialized\n\nQwik's serialization process starts by using all of the listeners as serialization roots. In our case, the `onClick$` on `<button>` is used as a serialization root. Notice that the `onClick$` closure closes over `store`. The fact that `onClick$` closes over `store` gives Qwik no choice but to serialize the `store` and, with it, all of the child properties.\n\nTo fix this, change the `onClick$` closure from `store.counter.count++` to `counter.count++`. (We have already created a local reference for you for `counter`.) This change modifies what the `onClick$` closure captures. Capturing more specific references allows Qwik to remove the need to serialize the `largeData` property.\n\nOpen the HTML tab and notice that Qwik no longer serializes `largeData` in this example.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/understanding/capturing/problem/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\ninterface AppStore {\n  counter: { count: number };\n  largeData: any;\n}\nexport default component$(() => {\n  const store = useStore<AppStore>(\n    {\n      counter: { count: 1 },\n      largeData: { data: 'PRETEND THIS IS A LARGE DATASET' },\n    },\n    { deep: true }\n  );\n  console.log('Render: <App/>');\n  const counter = store.counter;\n  return (\n    <>\n      <code>&lt;App&gt;</code>\n      <code>largeData</code>: {JSON.stringify(store.largeData)}\n      <br />\n      Click <button onClick$={() => store.counter.count++}>+1</button>\n      <Child counter={counter} />\n    </>\n  );\n});\n\nexport const Child = component$((props: { counter: AppStore['counter'] }) => {\n  console.log('Render: <Child/>');\n  return (\n    <>\n      <code>&lt;Child&gt;</code> {props.counter.count}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/understanding/capturing/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\ninterface AppStore {\n  counter: { count: number };\n  largeData: any;\n}\nexport default component$(() => {\n  const store = useStore<AppStore>(\n    {\n      counter: { count: 1 },\n      largeData: { data: 'PRETEND THIS IS A LARGE DATASET' },\n    },\n    { deep: true }\n  );\n  console.log('Render: <App/>');\n  const counter = store.counter;\n  return (\n    <>\n      <code>&lt;App&gt;</code>\n      <code>largeData</code>: {JSON.stringify(store.largeData)}\n      <br />\n      Click <button onClick$={() => counter.count++}>+1</button>\n      <Child counter={counter} />\n    </>\n  );\n});\n\nexport const Child = component$((props: { counter: AppStore['counter'] }) => {\n  console.log('Render: <Child/>');\n  return (\n    <>\n      <code>&lt;Child&gt;</code> {props.counter.count}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/understanding/treeshaking/index.mdx",
    "content": "---\ntitle: Tree-shaking | Tutorial\ncontributors:\n  - manucorporat\n  - adamdbradley\n  - mrhoodz\n  - iancharlesdouglas\nupdated_at: '2023-06-25T19:43:33Z'\ncreated_at: '2022-08-02T12:07:45Z'\n---\n\nA key concept of Qwik is that Qwik only loads code for components in the client that need to be re-rendered. If a component is static (does not need to be re-rendered), Qwik will not load the component. This is a form of dynamic tree-shaking. Here the word dynamic is used to differentiate it from the classical static tree-shaking.\n\n## Static vs. Dynamic Tree-shaking\n\nStatic tree-shaking is how the bundler removes unreachable code. In the case of an application, all components are reachable. This is because the component is reachable on the initial render in SSR. Otherwise, the component would not be visible to the client. So a static tree-shaker can't remove any components from our initial application render tree.\n\nDynamic tree-shaking refers to the fact that after the initial render, the component is no longer reachable from operations the user can perform. The component is only reachable under initial SSR rendering but not from subsequent user interactions. This is why we use the term dynamic tree-shaking to differentiate it from the static tree-shaking that bundler will do.\n\nStatic tree-shaking has the disadvantage that it does not take the runtime context into account when deciding if a particular component is reachable. It must assume a worst-case scenario and therefore retain the component as it is reachable on the server during SSR.\n\n### Example\n\nInteract with the example by clicking on the `+1` button. A few things to notice:\n\n- The server must execute all components. So from the server point of view, all of the components are needed.\n- On the client hitting `+1` does not require loading the `<App>` because it does not need to re-render. Therefore `<App>` is never loaded on the client.\n\nNow edit `Child` and delete the binding to `{props.store.count}`. Notice that now the child is no longer rendered on the client, and its associated render code is never loaded.\n\nQwik determines which components are needed based on the runtime context of the application. Databinding determines whether the component is considered static or dynamic and, therefore, whether the component will be tree-shaken.\n\nIn practice, many components are static in the application, and they never need to be loaded from the client.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/understanding/treeshaking/problem/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\ninterface CountStore {\n  count: number;\n}\nexport default component$(() => {\n  const store = useStore<CountStore>({ count: 0 });\n  console.log('Render: <App/>');\n  return (\n    <>\n      <code>&lt;App&gt;</code>\n      This component is static! After initial rendering as part of SSR, it will never rerender on\n      the client. This means that it will also never load an the client. The component is\n      tree-shaken on the client.\n      <br />\n      Click <button onClick$={() => store.count++}>+1</button> to observe what code Qwik loads as a\n      result of modifying the application state.\n      <Child store={store} />\n    </>\n  );\n});\n\nexport const Child = component$((props: { store: CountStore }) => {\n  console.log('Render: <Child/>');\n  return (\n    <>\n      <code>&lt;Child&gt;</code>\n      This component is dynamic because it is bound to <code>props.store.count</code>\n      {props.store.count}\n      <GrandChild store={props.store} />\n    </>\n  );\n});\n\nexport const GrandChild = component$((props: { store: CountStore }) => {\n  console.log('Render: <GrandChild/>');\n  return (\n    <>\n      <code>&lt;GrandChild&gt;</code>\n      This component is also dynamic because it is bound to <code>props.store.count</code>\n      {props.store.count}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/understanding/treeshaking/solution/app.tsx",
    "content": "/* eslint-disable no-console */\nimport { component$, useStore } from '@builder.io/qwik';\n\ninterface CountStore {\n  count: number;\n}\nexport default component$(() => {\n  const store = useStore<CountStore>({ count: 0 });\n  console.log('Render: <App/>');\n  return (\n    <>\n      <code>&lt;App&gt;</code>\n      This component is static! After initial rendering as part of SSR, it will never rerender on\n      the client. This means that it will also never load an the client. The component is\n      tree-shaken on the client.\n      <br />\n      Click <button onClick$={() => store.count++}>+1</button> to observe what code Qwik loads as a\n      result of modifying the application state.\n      <Child store={store} />\n    </>\n  );\n});\n\nexport const Child = component$((props: { store: CountStore }) => {\n  console.log('Render: <Child/>');\n  return (\n    <>\n      <code>&lt;Child&gt;</code>\n      This component is dynamic because it is bound to <code>props.store.count</code>\n      {/* Commented out the binding to demonstrate the effect on code downloaded to the client! */}\n      {/* props.store.count */}\n      <GrandChild store={props.store} />\n    </>\n  );\n});\n\nexport const GrandChild = component$((props: { store: CountStore }) => {\n  console.log('Render: <GroundChild/>');\n  return (\n    <>\n      <code>&lt;GrandChild&lt;</code>\n      This component is also dynamic because it is bound to <code>props.store.count</code>\n      {props.store.count}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/welcome/overview/index.md",
    "content": "---\ntitle: Welcome to Qwik Tutorials\n---\n\n### Welcome to Qwik!\n\nQwik is a front-end framework for building [**resumable**](</docs/(qwik)/concepts/resumable/index.mdx>) applications that start-up **instantly** on the client. Qwik achieves this by focusing on its philosophy of **downloading and executing only the code that is strictly necessary** to perform the user-triggered action. Qwik is a fine-grained lazy-loading framework representing a fundamentally new approach to building web applications.\n\n### Qwik Tutorials\n\nWhat follows is a set of tutorials that will help you get started with Qwik. Each tutorial focuses on a single topic and contains a hands-on example that requires your participation to make it work.\n\nThe tutorials are broken up into these sections:\n\n- [Introduction](/tutorial/introduction/component/index.mdx): A fast-paced introduction to Qwik where we focus more on building a simple application with server-side pre-rendering and client-side interactivity. This tutorial is designed to give you a feel over how Qwik applications are built rather than focusing on details of individual APIs.\n- [Components](/tutorial/component/basic/index.mdx): All about declaring, binding, and composition of components.\n- [Events](/tutorial/events/basic/index.mdx): Declaring, binding, and triggering events.\n- [Stores](/tutorial/store/basic/index.mdx): Declaring stores, data-binding, reactivity, and serialization.\n- [Props](/tutorial/props/basic/index.mdx): A deep dive into declaring and working with props and components and serialization constraints.\n- [Reactivity](/tutorial/reactivity/template/index.mdx): A deep dive into how reactivity works and how it can be used to build a more complex application.\n- [Context](/tutorial/context/basic/index.mdx): Making data globally available to your application through context.\n- [Lifecycle Hooks](/tutorial/hooks/use-task/index.mdx): Component life-cycle hooks.\n- [Slots](/tutorial/projection/slots/index.mdx): A deep dive into how content projection works and how to use it in more complex scenarios.\n- [Styling](/tutorial/style/styles/index.mdx): Styling your application with CSS.\n- [Optimizer](/tutorial/qrl/optimizer/index.mdx): Understanding the Optimizer constraints.\n- [Composing new APIs](/tutorial/composing/dollar/index.mdx): Composing new `use___()` and `$` APIs for your application.\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/welcome/overview/problem/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Hello World!</h1>\n      I am a static component, there is no reason to ever download me to the client.\n      <br />\n      <button onClick$={() => alert('Hello')}>greet!</button>\n      <hr />\n      <Counter />\n    </>\n  );\n});\n\nexport const Counter = component$(() => {\n  const store = useStore({ count: 0 });\n  return (\n    <>\n      I am a dynamic component. Qwik will download me only when it is time to re-render me after the\n      user clicks on the <code>+1</code> button.\n      <br />\n      Current count: {store.count}\n      <br />\n      <button onClick$={() => store.count++}>+1</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/routes/tutorial/welcome/overview/solution/app.tsx",
    "content": "import { component$, useStore } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Hello World!</h1>\n      Look! I am a static component.\n      <br />\n      Qwik will never download me to the client. I am only rendered on the server.\n      <br />\n      <button onClick$={() => alert('Hello')}>greet!</button>\n      <hr />\n      <Counter />\n    </>\n  );\n});\n\nexport const Counter = component$(() => {\n  const store = useStore({ count: 0 });\n  return (\n    <>\n      I am a dynamic component. Qwik will download me only when it is time to re-render me after the\n      user clicks on the <code>+1</code> button.\n      <br />\n      Current count: {store.count}\n      <br />\n      <button onClick$={() => store.count++}>+1</button>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/docs/src/utils/utils.ts",
    "content": "// pascal to snake case\nexport const toSnakeCase = (str: string) =>\n  str\n    .split(/\\.?(?=[A-Z])/)\n    .join('-')\n    .toLowerCase();\n\nexport const setReplCorsHeaders = (headers: Headers) => {\n  // Needed for SharedArrayBuffer in the REPL\n  headers.set('Cross-Origin-Opener-Policy', 'same-origin');\n  headers.set('Cross-Origin-Embedder-Policy', 'require-corp');\n};\n"
  },
  {
    "path": "packages/docs/test-urls.js",
    "content": "// Test script to verify all edit URLs are working\nconst fs = require('fs');\nconst path = require('path');\nconst https = require('https');\n\n// Import the arrays from on-this-page.tsx (these are simplified copies for testing)\nconst QWIK_GROUP = [\n  'components',\n  'concepts',\n  'faq',\n  'getting-started',\n  'index',\n  'deprecated-features',\n];\n\nconst QWIK_ADVANCED_GROUP = [\n  'containers',\n  'custom-build-dir',\n  'dollar',\n  'eslint',\n  'library',\n  'optimizer',\n  'modules-prefetching',\n  'qrl',\n  'qwikloader',\n  'vite',\n];\n\nconst QWIKCITY_GROUP = [\n  'action',\n  'api',\n  'caching',\n  'endpoints',\n  'error-handling',\n  'html-attributes',\n  'layout',\n  'middleware',\n  'pages',\n  'project-structure',\n  'qwikcity',\n  're-exporting-loaders',\n  'route-loader',\n  'routing',\n  'server$',\n  'validator',\n];\n\nconst QWIKCITY_ADVANCED_GROUP = [\n  'complex-forms',\n  'content-security-policy',\n  'menu',\n  'plugins',\n  'request-handling',\n  'routing',\n  'sitemaps',\n  'speculative-module-fetching',\n  'static-assets',\n];\n\n// Function to transform URL path (simplified version of makeEditPageUrl)\nfunction makeEditPageUrl(url) {\n  const segments = url.split('/').filter((part) => part !== '');\n  if (segments[0] !== 'docs') {\n    return url;\n  }\n\n  let group = '';\n  if (segments.length === 1) {\n    // Handle root /docs path - it maps to the qwik overview page\n    return 'docs/(qwik)';\n  }\n\n  if (segments[1] === 'advanced') {\n    if (QWIK_ADVANCED_GROUP.includes(segments[2])) {\n      group = '(qwik)';\n    } else if (QWIKCITY_ADVANCED_GROUP.includes(segments[2])) {\n      group = '(qwikcity)';\n    }\n  } else if (QWIK_GROUP.includes(segments[1])) {\n    group = '(qwik)';\n  } else if (QWIKCITY_GROUP.includes(segments[1])) {\n    group = '(qwikcity)';\n  }\n\n  if (group) {\n    segments.splice(1, 0, group);\n  }\n\n  // Handle special cases for components and concepts which have a different structure\n  if (segments.includes('components') || segments.includes('concepts')) {\n    // Check if this is a subpage under components or concepts\n    const componentIndex = segments.indexOf('components');\n    const conceptIndex = segments.indexOf('concepts');\n    const index = componentIndex !== -1 ? componentIndex : conceptIndex;\n\n    // If there's a subpage (like components/overview or concepts/resumable)\n    if (index !== -1 && index + 1 >= segments.length) {\n      // These are directory paths without subpaths, map to their overview pages\n      if (componentIndex !== -1) {\n        return 'docs/(qwik)/core/overview';\n      } else if (conceptIndex !== -1) {\n        return 'docs/(qwik)/concepts/think-qwik';\n      }\n    }\n  }\n\n  return segments.join('/');\n}\n\n// Check if a URL exists\nfunction checkUrl(url) {\n  return new Promise((resolve) => {\n    const options = {\n      method: 'HEAD',\n      host: 'github.com',\n      path: url.replace('https://github.com', ''),\n      timeout: 5000,\n    };\n\n    const req = https.request(options, (res) => {\n      resolve({\n        url,\n        status: res.statusCode,\n        ok: res.statusCode < 400,\n      });\n    });\n\n    req.on('error', (err) => {\n      resolve({\n        url,\n        status: 0,\n        ok: false,\n        error: err.message,\n      });\n    });\n\n    req.on('timeout', () => {\n      req.destroy();\n      resolve({\n        url,\n        status: 0,\n        ok: false,\n        error: 'Timeout',\n      });\n    });\n\n    req.end();\n  });\n}\n\n// Generate paths for testing\nasync function testAllPaths() {\n  console.log('Testing URL paths for documentation pages...');\n\n  // Generate test paths\n  const testPaths = [];\n\n  // Test QWIK_GROUP paths\n  for (const path of QWIK_GROUP) {\n    if (path === 'index') {\n      // Special case for index\n      testPaths.push('/docs');\n    } else {\n      testPaths.push(`/docs/${path}`);\n    }\n  }\n\n  // Test QWIK_ADVANCED_GROUP paths\n  for (const path of QWIK_ADVANCED_GROUP) {\n    testPaths.push(`/docs/advanced/${path}`);\n  }\n\n  // Test QWIKCITY_GROUP paths\n  for (const path of QWIKCITY_GROUP) {\n    testPaths.push(`/docs/${path}`);\n  }\n\n  // Test QWIKCITY_ADVANCED_GROUP paths\n  for (const path of QWIKCITY_ADVANCED_GROUP) {\n    testPaths.push(`/docs/advanced/${path}`);\n  }\n\n  // Test each path\n  let failCount = 0;\n  let successCount = 0;\n  let failedPaths = [];\n\n  console.log(`Testing ${testPaths.length} URLs...`);\n\n  for (const testPath of testPaths) {\n    const editPath = makeEditPageUrl(testPath);\n    const editUrl = `https://github.com/QwikDev/qwik/blob/main/packages/docs/src/routes/${editPath}/index.mdx`;\n\n    try {\n      const result = await checkUrl(editUrl);\n      if (result.ok) {\n        console.log(`✅ ${editUrl}`);\n        successCount++;\n      } else {\n        console.error(`❌ ${editUrl} (Status: ${result.status})`);\n        failCount++;\n        failedPaths.push(testPath);\n      }\n    } catch (error) {\n      console.error(`❌ Error checking ${editUrl}: ${error.message}`);\n      failCount++;\n      failedPaths.push(testPath);\n    }\n  }\n\n  console.log(`\\nTest complete: ${successCount} successful, ${failCount} failed`);\n  if (failCount > 0) {\n    console.log('\\nFailed paths:');\n    failedPaths.forEach((path) => {\n      console.log(`- ${path}`);\n    });\n  }\n}\n\n// Run the tests\ntestAllPaths();\n"
  },
  {
    "path": "packages/docs/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"incremental\": true,\n    \"target\": \"es2022\",\n    \"module\": \"es2022\",\n    \"lib\": [\"es2021\", \"DOM\", \"webworker\", \"DOM.Iterable\"],\n    \"resolveJsonModule\": true,\n    \"jsx\": \"react-jsx\",\n    \"allowArbitraryExtensions\": true,\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"noEmit\": true,\n    \"strict\": true,\n    \"verbatimModuleSyntax\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"baseUrl\": \".\",\n    \"assumeChangesOnlyAffectDirectDependencies\": true,\n    \"noUnusedLocals\": true,\n    \"paths\": {\n      \"~/*\": [\"src/*\"],\n      \"@examples-data\": [\"src/routes/examples/apps/examples-data.ts\"],\n      \"@playground-data\": [\"src/routes/playground/playground-data.ts\"],\n      \"@tutorial-data\": [\"src/routes/tutorial/tutorial-data.ts\"]\n    },\n    \"types\": [\"node\", \"vite/client\", \"@builder.io/qwik\"],\n    \"esModuleInterop\": true,\n    \"sourceRoot\": \".\",\n    \"inlineSourceMap\": true,\n    \"inlineSources\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true\n  }\n}\n"
  },
  {
    "path": "packages/docs/vite.config-repl-sw.mts",
    "content": "import { defineConfig } from 'vite';\n\nexport default defineConfig({\n  build: {\n    sourcemap: true,\n    copyPublicDir: false,\n    emptyOutDir: false,\n    outDir: 'public/repl',\n    lib: {\n      entry: 'src/routes/repl/repl-sw.js/entry.ts',\n      formats: ['cjs'],\n      fileName: 'repl-sw',\n    },\n  },\n  clearScreen: false,\n});\n"
  },
  {
    "path": "packages/docs/vite.config.mts",
    "content": "import { qwikCity } from '@builder.io/qwik-city/vite';\nimport { qwikInsights } from '@builder.io/qwik-labs/vite';\nimport { qwikReact } from '@builder.io/qwik-react/vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport { partytownVite } from '@qwik.dev/partytown/utils';\nimport { transformerColorizedBrackets } from '@shikijs/colorized-brackets';\nimport shikiRehype from '@shikijs/rehype';\nimport darkPlus from '@shikijs/themes/dark-plus';\nimport { transformerMetaHighlight, transformerMetaWordHighlight } from '@shikijs/transformers';\nimport type { ShikiTransformer } from '@shikijs/types';\nimport tailwindcss from '@tailwindcss/vite';\nimport path, { resolve } from 'node:path';\nimport { defineConfig, loadEnv, type Plugin, type Rollup } from 'vite';\nimport { examplesData, playgroundData, rawSource, tutorialData } from './vite.repl-apps';\nimport { sourceResolver } from './vite.source-resolver';\nimport { compiledStringPlugin } from '../../scripts/compiled-string-plugin.js';\n\nconst PUBLIC_QWIK_INSIGHTS_KEY = loadEnv('', '.', 'PUBLIC').PUBLIC_QWIK_INSIGHTS_KEY;\nconst docsDir = new URL(import.meta.url).pathname;\n\n// https://github.com/vitejs/vite/issues/15012#issuecomment-1825035992\nconst muteWarningsPlugin = (warningsToIgnore: string[][]): Plugin => {\n  const mutedMessages = new Set();\n  return {\n    name: 'mute-warnings',\n    enforce: 'pre',\n    config: (userConfig) => {\n      const origOnLog = userConfig.build?.rollupOptions?.onLog;\n      return {\n        build: {\n          rollupOptions: {\n            onLog(type, warning, defaultHandler) {\n              if (type === 'warn') {\n                if (warning.code) {\n                  const muted = warningsToIgnore.find(\n                    ([code, message]) => code == warning.code && warning.message.includes(message)\n                  );\n\n                  if (muted) {\n                    mutedMessages.add(muted.join());\n                    return;\n                  }\n                }\n              }\n              origOnLog ? origOnLog(type, warning, defaultHandler) : defaultHandler(type, warning);\n            },\n          },\n        },\n      };\n    },\n    closeBundle() {\n      const diff = warningsToIgnore.filter((x) => !mutedMessages.has(x.join()));\n      if (diff.length > 0) {\n        this.warn('Some of your muted warnings never appeared during the build process:');\n        diff.forEach((m) => this.warn(`- ${m.join(': ')}`));\n      }\n    },\n  };\n};\n\nfunction transformerShowEmptyLines(): ShikiTransformer {\n  return {\n    line(node) {\n      if (node.children.length === 0) {\n        node.children = [{ type: 'text', value: ' ' }];\n        return node;\n      }\n    },\n  };\n}\n\nfunction transformerMetaShowTitle(): ShikiTransformer {\n  return {\n    root(node) {\n      const meta = this.options.meta?.__raw;\n      if (!meta) {\n        return;\n      }\n      const titleMatch = meta.match(/title=\"([^\"]*)\"/);\n      if (!titleMatch) {\n        return;\n      }\n      const title = titleMatch[1] ?? '';\n      if (title.length > 0) {\n        node.children.unshift({\n          type: 'element',\n          tagName: 'div',\n          properties: {\n            class: 'shiki-title',\n          },\n          children: [{ type: 'text', value: title }],\n        });\n      }\n      meta.replace(titleMatch[0], '');\n    },\n  };\n}\n\nfunction overrideManualChunksForRepl(): Plugin {\n  return {\n    name: 'override-manual-chunks-for-repl',\n    enforce: 'post',\n    config(userConfig) {\n      const prevOutput = userConfig.build?.rollupOptions?.output;\n      const prevManualChunks: Rollup.ManualChunksOption | undefined =\n        prevOutput && !Array.isArray(prevOutput)\n          ? (prevOutput as Rollup.OutputOptions).manualChunks\n          : undefined;\n\n      return {\n        build: {\n          rollupOptions: {\n            output: {\n              manualChunks: (id, meta) => {\n                const moduleInfo = meta.getModuleInfo(id);\n                if (moduleInfo) {\n                  // Prevent the similar optimizer plugin logic from running on the repl\n                  if (id.includes('repl') && (moduleInfo as any).meta?.qwikdeps?.length === 0) {\n                    return null;\n                  }\n                }\n\n                if (typeof prevManualChunks === 'function') {\n                  return prevManualChunks(id, meta);\n                }\n              },\n            },\n          },\n        },\n      };\n    },\n  };\n}\n\nexport default defineConfig(() => {\n  const routesDir = resolve('src', 'routes');\n  return {\n    preview: {\n      headers: {\n        'Cache-Control': 'public, max-age=600',\n      },\n    },\n    define: {\n      // The rolldown deps use this\n      'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),\n    },\n    resolve: {\n      alias: [\n        {\n          find: '~',\n          replacement: path.resolve(__dirname, 'src'),\n        },\n        {\n          // HACK: For some reason supabase imports node-fetch but only in CloudFlare build\n          // This hack is here to prevent the import from happening since we don't need to\n          // polyfill fetch in the edge.\n          find: '@supabase/node-fetch',\n          replacement: path.resolve(__dirname, 'src', 'empty.ts'),\n        },\n        {\n          find: '@docsearch/css',\n          replacement: path.resolve(__dirname, 'node_modules/@docsearch/css/dist/style.css'),\n        },\n      ],\n      // Make sure to get the browser version of @rolldown/browser\n      conditions: ['browser', 'worker', 'import', 'default'],\n    },\n    ssr: {\n      noExternal: [\n        '@mui/material',\n        '@mui/system',\n        '@emotion/react',\n        '@algolia/autocomplete-core/dist/esm/resolve',\n        '@algolia/autocomplete-core',\n        '@algolia/autocomplete-shared',\n        'algoliasearch/lite',\n        'algoliasearch',\n        '@algolia/autocomplete-core/dist/esm/reshape',\n        'algoliasearch/dist/algoliasearch-lite.esm.browser',\n      ],\n      resolve: {\n        conditions: ['import', 'worker', 'default'],\n      },\n    },\n\n    plugins: [\n      // some imported react code has sourcemap issues\n      muteWarningsPlugin([\n        ['SOURCEMAP_ERROR', \"Can't resolve original location of error\"],\n        ['MODULE_LEVEL_DIRECTIVE', 'use client'],\n      ]),\n      rawSource(),\n      compiledStringPlugin(),\n      qwikCity({\n        mdxPlugins: {\n          rehypeSyntaxHighlight: false,\n          remarkGfm: true,\n          rehypeAutolinkHeadings: true,\n        },\n        mdx: {\n          rehypePlugins: [\n            [\n              shikiRehype,\n              {\n                theme: darkPlus,\n                transformers: [\n                  transformerMetaHighlight(),\n                  transformerMetaWordHighlight(),\n                  transformerColorizedBrackets(),\n                  transformerShowEmptyLines(),\n                  transformerMetaShowTitle(),\n                ],\n              },\n            ],\n          ],\n        },\n      }),\n      qwikVite({ debug: false }),\n      partytownVite({\n        dest: resolve('dist', '~partytown'),\n      }),\n      examplesData(routesDir),\n      playgroundData(routesDir),\n      tutorialData(routesDir),\n      sourceResolver(docsDir),\n      qwikReact(),\n      qwikInsights({ publicApiKey: PUBLIC_QWIK_INSIGHTS_KEY }),\n      tailwindcss(),\n      overrideManualChunksForRepl(),\n    ],\n    optimizeDeps: {\n      include: ['@docsearch/css'],\n      exclude: [\n        // optimizing breaks the wasm import\n        '@rolldown/browser',\n      ],\n    },\n    build: {\n      sourcemap: true,\n      rollupOptions: {\n        output: {\n          assetFileNames: 'assets/[hash]-[name].[ext]',\n        },\n        external: ['@docsearch/css'],\n      },\n    },\n    worker: {\n      format: 'es' as const,\n    },\n    clearScreen: false,\n    server: {\n      port: 3000,\n      // Needed for the REPL SharedArrayBuffer\n      headers: {\n        'Cross-Origin-Opener-Policy': 'same-origin',\n        'Cross-Origin-Embedder-Policy': 'require-corp',\n      },\n    },\n  };\n});\n"
  },
  {
    "path": "packages/docs/vite.repl-apps.ts",
    "content": "import type { Plugin } from 'vite';\nimport type { TransformModuleInput } from '@builder.io/qwik/optimizer';\nimport { join, basename } from 'node:path';\nimport { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport type { ExampleSection } from './src/routes/examples/apps/examples-data';\nimport type { PlaygroundApp } from './src/routes/playground/playground-data';\nimport type { TutorialSection } from './src/routes/tutorial/tutorial-data';\nimport type { PluginContext } from 'rollup';\nimport type { ReplModuleInput } from './src/repl/types';\nimport MagicString from 'magic-string';\n\nexport function playgroundData(routesDir: string): Plugin {\n  const playgroundAppDir = join(routesDir, 'playground', 'app');\n\n  return {\n    name: 'playgroundData',\n\n    resolveId(id) {\n      if (id === '@playground-data') {\n        return id;\n      }\n    },\n\n    async load(id) {\n      if (basename(id) === '@playground-data') {\n        const playgroundApp: PlaygroundApp = {\n          inputs: readdirSync(playgroundAppDir).map((fileName) => {\n            const filePath = join(playgroundAppDir, fileName);\n            const input: TransformModuleInput = {\n              path: `/${fileName}`,\n              code: readFileSync(filePath, 'utf-8'),\n            };\n            return input;\n          }),\n        };\n        return `const playgroundApp = ${JSON.stringify(\n          playgroundApp\n        )};export default playgroundApp;`;\n      }\n      return null;\n    },\n  };\n}\n\nexport function examplesData(routesDir: string): Plugin {\n  const dir = join(routesDir, 'examples', 'apps');\n  const menuPath = join(dir, 'examples-menu.json');\n  const menuSrc = readFileSync(menuPath, 'utf-8');\n\n  const loadExamplesData = (ctx: PluginContext) => {\n    const sections: ExampleSection[] = [];\n    const dataSections: ExampleSection[] = JSON.parse(menuSrc);\n    ctx.addWatchFile(menuPath);\n\n    for (const dataSection of dataSections) {\n      const sectionDir = join(dir, dataSection.id);\n\n      if (!existsSync(sectionDir)) {\n        throw new Error(`Example section \"${sectionDir}\" doesn't exist`);\n      }\n\n      const s = statSync(sectionDir);\n      if (!s.isDirectory()) {\n        throw new Error(`Example section \"${sectionDir}\" is not a directory`);\n      }\n\n      const section: ExampleSection = {\n        ...dataSection,\n        apps: [],\n      };\n\n      for (const app of dataSection.apps) {\n        const appDir = join(sectionDir, app.id);\n        if (!existsSync(appDir)) {\n          throw new Error(`Example app \"${appDir}\" doesn't exist`);\n        }\n\n        const s = statSync(appDir);\n        if (!s.isDirectory()) {\n          throw new Error(`Example app \"${appDir}\" is not a directory`);\n        }\n\n        const inputs: ReplModuleInput[] = readdirSync(appDir)\n          .map((fileName) => {\n            const filePath = join(appDir, fileName);\n            const s = statSync(filePath);\n            if (s.isFile()) {\n              const input: ReplModuleInput = {\n                path: `/${fileName}`,\n                code: readFileSync(filePath, 'utf-8'),\n              };\n              ctx.addWatchFile(filePath);\n              return input;\n            } else {\n              return null;\n            }\n          })\n          .filter((i) => i !== null) as any;\n\n        if (inputs.length === 0) {\n          throw new Error(`Example \"${appDir}\" does not have any valid files.`);\n        }\n        if (!inputs.some((i) => i.path.endsWith('app.tsx'))) {\n          throw new Error(\n            `Example must have an \"app.tsx\" file, which wasn't found in \"${appDir}\".`\n          );\n        }\n\n        section.apps.push({\n          ...app,\n          id: `${section.id}/${app.id}`,\n          inputs,\n        });\n      }\n\n      if (section.apps.length > 0) {\n        sections.push(section);\n      } else {\n        throw new Error(`Example section \"${section.id}\" has no apps`);\n      }\n    }\n\n    return sections;\n  };\n\n  return {\n    name: 'examplesData',\n\n    resolveId(id) {\n      if (id === '@examples-data') {\n        return id;\n      }\n    },\n\n    async load(id) {\n      if (basename(id) === '@examples-data') {\n        const data = loadExamplesData(this as any);\n        return `const exampleSections = ${JSON.stringify(data)};export default exampleSections;`;\n      }\n      return null;\n    },\n  };\n}\n\nexport function tutorialData(routesDir: string): Plugin {\n  const dir = join(routesDir, 'tutorial');\n  const menuPath = join(dir, 'tutorial-menu.json');\n  const menuSrc = readFileSync(menuPath, 'utf-8');\n\n  const loadTutorialData = (ctx: PluginContext) => {\n    const sections: TutorialSection[] = [];\n    const dataSections: TutorialSection[] = JSON.parse(menuSrc);\n    ctx.addWatchFile(menuPath);\n\n    for (const dataSection of dataSections) {\n      const sectionDir = join(dir, dataSection.id);\n\n      if (!existsSync(sectionDir)) {\n        throw new Error(`Tutorial section \"${sectionDir}\" doesn't exist`);\n      }\n\n      const s = statSync(sectionDir);\n      if (!s.isDirectory()) {\n        throw new Error(`Tutorial section \"${sectionDir}\" is not a directory`);\n      }\n\n      const section: TutorialSection = {\n        ...dataSection,\n        apps: [],\n      };\n\n      for (const app of dataSection.apps) {\n        const appDir = join(sectionDir, app.id);\n        if (!existsSync(appDir)) {\n          throw new Error(`Tutorial app \"${appDir}\" doesn't exist`);\n        }\n\n        const s = statSync(appDir);\n        if (!s.isDirectory()) {\n          throw new Error(`Tutorial app \"${appDir}\" is not a directory`);\n        }\n\n        const readAppInputs = (appType: 'problem' | 'solution') => {\n          const appTypeDir = join(appDir, appType);\n\n          if (!existsSync(appTypeDir)) {\n            throw new Error(`Tutorial \"${appType}\" dir \"${appTypeDir}\" doesn't exist`);\n          }\n\n          const s = statSync(sectionDir);\n          if (!s.isDirectory()) {\n            throw new Error(`Tutorial \"${appType}\" dir \"${appTypeDir}\" is not a directory`);\n          }\n\n          const inputs: ReplModuleInput[] = readdirSync(appTypeDir)\n            .map((fileName) => {\n              const filePath = join(appTypeDir, fileName);\n              const s = statSync(filePath);\n              if (s.isFile()) {\n                const input: ReplModuleInput = {\n                  path: `/${fileName}`,\n                  code: readFileSync(filePath, 'utf-8'),\n                };\n                ctx.addWatchFile(filePath);\n                return input;\n              } else {\n                return null;\n              }\n            })\n            .filter((i) => i !== null) as any;\n\n          if (inputs.length === 0) {\n            throw new Error(\n              `Tutorial \"${appType}\" dir \"${appTypeDir}\" does not have any valid files.`\n            );\n          }\n          if (!inputs.some((i) => i.path.endsWith('app.tsx'))) {\n            throw new Error(\n              `Tutorials must have an \"app.tsx\" file, which wasn't found in \"${appType}\" dir \"${appTypeDir}\".`\n            );\n          }\n\n          return inputs;\n        };\n\n        section.apps.push({\n          ...app,\n          id: `${section.id}/${app.id}`,\n          problemInputs: readAppInputs('problem'),\n          solutionInputs: readAppInputs('solution'),\n        });\n      }\n\n      if (section.apps.length > 0) {\n        sections.push(section);\n      } else {\n        throw new Error(`Tutorial section \"${section.id}\" has no apps`);\n      }\n    }\n\n    return sections;\n  };\n\n  return {\n    name: 'tutorialData',\n\n    resolveId(id) {\n      if (id === '@tutorial-data') {\n        return id;\n      }\n    },\n\n    async load(id) {\n      if (basename(id) === '@tutorial-data') {\n        const data = loadTutorialData(this as any);\n        return `const tutorialSections = ${JSON.stringify(data)};export default tutorialSections;`;\n      }\n      return null;\n    },\n  };\n}\n\n// Workaround for https://github.com/vitejs/vite/issues/15753\n// A vite plugin that implements what `?raw&url` should do\n// Use `import url from 'file?raw-source'` to get the url for the raw file content\nexport function rawSource(): Plugin {\n  let base: string;\n  let isDev: boolean = false;\n  let doSourceMap: boolean = false;\n  const extToMime = {\n    mjs: 'application/javascript',\n    js: 'application/javascript',\n    css: 'text/css',\n    html: 'text/html',\n    json: 'application/json',\n    wasm: 'application/wasm',\n  };\n  return {\n    name: 'raw-source',\n\n    configResolved(config) {\n      base = config.base;\n      isDev = config.command === 'serve';\n      doSourceMap = !!config.build.sourcemap;\n    },\n\n    configureServer(server) {\n      // Vite still processes /@fs urls, so we need to run our own static server\n      server.middlewares.use((req, res, next) => {\n        if (req.url!.startsWith('/@raw-fs')) {\n          const filePath = req.url!.slice('/@raw-fs'.length).split('?')[0];\n          if (existsSync(filePath)) {\n            const ext = filePath.split('.').pop()! as keyof typeof extToMime;\n            const contentType = extToMime[ext] || 'application/octet-stream';\n            res.setHeader('Content-Type', contentType);\n            res.end(readFileSync(filePath));\n          } else {\n            res.statusCode = 404;\n            res.end('File not found');\n          }\n        } else {\n          next();\n        }\n      });\n    },\n\n    resolveId: {\n      order: 'pre',\n      async handler(id, importer) {\n        const match = /^(?<path>.*)\\?(|(?<before>.+)&)raw-source($|&(?<after>.*))/.exec(id);\n\n        if (match) {\n          const newQuery = [match.groups!.before, match.groups!.after].filter(Boolean).join('&');\n          const newId = `${match.groups!.path}${newQuery ? `?${newQuery}` : ''}`;\n          const resolved = await this.resolve(newId, importer, {\n            skipSelf: true,\n          });\n          if (!resolved) {\n            throw new Error(`Could not resolve \"${id}\" from \"${importer}\"`);\n          }\n          return `\\0raw-source:${resolved!.id.split('?')[0]}`;\n        }\n      },\n    },\n\n    load(id) {\n      if (id.startsWith('\\0raw-source:')) {\n        let path = id.slice('\\0raw-source:'.length);\n        if (path.startsWith('/@fs/')) {\n          path = path.slice('/@fs'.length);\n        }\n        if (path.startsWith('\\x00')) {\n          // let's just assume it's a path\n          path = path.slice(1);\n        }\n        if (isDev) {\n          const devUrl = `${base}@raw-fs${path}`;\n          return `export default \"${devUrl}\";`;\n        }\n        const fileContent = readFileSync(path);\n        const ref = this.emitFile({\n          type: 'asset',\n          name: basename(path),\n          source: fileContent,\n        });\n        return {\n          code: `export default \"@@RAW-URL_${ref}@@\";`,\n          map: { version: 3, sources: [path], mappings: '' },\n        };\n      }\n    },\n\n    renderChunk(code, chunk) {\n      // Copied from vite assets code and simplified\n      let s, match;\n      const regex = /@@RAW-URL_(.+)@@/g;\n      while ((match = regex.exec(code))) {\n        s ||= new MagicString(code);\n        const ref = match[1];\n        const fileName = this.getFileName(ref);\n        chunk.viteMetadata!.importedAssets.add(fileName);\n        s.overwrite(match.index, match.index + match[0].length, base + fileName);\n      }\n      return s\n        ? {\n            code: s ? s.toString() : code,\n            map: doSourceMap ? s.generateMap({ hires: true }) : null,\n          }\n        : null;\n    },\n  };\n}\n"
  },
  {
    "path": "packages/docs/vite.source-resolver.ts",
    "content": "import { dirname, join } from 'node:path';\nimport type { Plugin } from 'vite';\n\nconst SOURCE_PREFIX = 'source:';\nconst RESOLVED_SOURCE_PREFIX = '\\0source:';\n\nexport function sourceResolver(root: string): Plugin {\n  return {\n    name: 'source-code-loader',\n    resolveId(id, importer) {\n      if (importer && id.startsWith(SOURCE_PREFIX)) {\n        const [_, path] = id.split(SOURCE_PREFIX);\n        const base = id.startsWith('.') ? dirname(importer) : root;\n        return RESOLVED_SOURCE_PREFIX + join(base, path);\n      }\n    },\n    load(id) {\n      if (id.startsWith(RESOLVED_SOURCE_PREFIX)) {\n        const [_, path] = id.split(RESOLVED_SOURCE_PREFIX);\n        return `\n        const PATH = ${JSON.stringify(path.replace(root, ''))};\n        export default PATH;`;\n      }\n    },\n  };\n}\n"
  },
  {
    "path": "packages/docs/wrangler.jsonc",
    "content": "/**\n * For more details on how to configure Wrangler, refer to:\n * https://developers.cloudflare.com/workers/wrangler/configuration/\n */\n{\n  \"$schema\": \"node_modules/wrangler/config-schema.json\",\n  \"name\": \"qwik-docs\",\n  \"compatibility_date\": \"2025-09-27\",\n  \"assets\": {\n    // The path to the directory containing the `index.html` file to be served at `/`\n    \"directory\": \"/dist\",\n  },\n  \"observability\": {\n    \"enabled\": true,\n  },\n  /**\n   * Smart Placement\n   * Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement\n   */\n  // \"placement\": { \"mode\": \"smart\" }\n  /**\n   * Bindings\n   * Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including\n   * databases, object storage, AI inference, real-time communication and more.\n   * https://developers.cloudflare.com/workers/runtime-apis/bindings/\n   */\n  /**\n   * Environment Variables\n   * https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables\n   */\n  // \"vars\": { \"MY_VARIABLE\": \"production_value\" }\n  /**\n   * Note: Use secrets to store sensitive data.\n   * https://developers.cloudflare.com/workers/configuration/secrets/\n   */\n  /**\n   * Static Assets\n   * https://developers.cloudflare.com/workers/static-assets/binding/\n   */\n  // \"assets\": { \"directory\": \"./public/\", \"binding\": \"ASSETS\" }\n  /**\n   * Service Bindings (communicate between multiple Workers)\n   * https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings\n   */\n  // \"services\": [{ \"binding\": \"MY_SERVICE\", \"service\": \"my-service\" }]\n}\n"
  },
  {
    "path": "packages/docs/wrangler.toml",
    "content": "name = \"qwik-docs\"\ncompatibility_date = \"2024-05-13\"\ncompatibility_flags = [ \"nodejs_compat\" ]"
  },
  {
    "path": "packages/eslint-plugin-qwik/.npmignore",
    "content": "src\ntests\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/CHANGELOG.md",
    "content": "# eslint-plugin-qwik\n\n## 1.19.0\n\n## 1.18.0\n\n### Patch Changes\n\n- execute cleanup cb for all component tree while calling dispose.cleanup method returned by render fn (by [@sashkashishka](https://github.com/sashkashishka) in [#8164](https://github.com/QwikDev/qwik/pull/8164))\n\n## 1.17.2\n\n## 1.17.1\n\n## 1.17.0\n\n## 1.16.1\n\n## 1.16.0\n\n### Minor Changes\n\n- ✨ bump Vite to v7 (by [@gioboa](https://github.com/gioboa) in [#7762](https://github.com/QwikDev/qwik/pull/7762))\n\n## 1.15.0\n\n### Patch Changes\n\n- 🛠 update devDependencies and configurations (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7695](https://github.com/QwikDev/qwik/pull/7695))\n\n## 1.14.1\n\n## 1.14.0\n\n### Minor Changes\n\n- ✨ our eslint plugin now supports eslint 9 (by [@better-salmon](https://github.com/better-salmon) in [#7418](https://github.com/QwikDev/qwik/pull/7418))\n\n### Patch Changes\n\n- ✨ Improve types and README documentation with clear configuration examples for ESLint 9+ (flat config). Added `globalIgnores` for more clarity and `tseslint.config` for better type inference inside the `parserOptions` option. (by [@better-salmon](https://github.com/better-salmon) in [#7418](https://github.com/QwikDev/qwik/pull/7418))\n\n## 1.13.0\n\n### Minor Changes\n\n- let eslint-plugin-qwik support Eslint 9 and 8 simultaneously (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7072](https://github.com/QwikDev/qwik/pull/7072))\n\n### Patch Changes\n\n- Fix ESLint 9 compatibility, enhance typing and README. (by [@better-salmon](https://github.com/better-salmon) in [#7415](https://github.com/QwikDev/qwik/pull/7415))\n\n- 🐞🩹 Enhance lexical scope and skip variables declared by Qwik's internal hooks. (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7366](https://github.com/QwikDev/qwik/pull/7366))\n\n## 1.12.1\n\n## 1.12.0\n\n## 1.11.0\n\n## 1.10.0\n\n### Patch Changes\n\n- 🐞🩹 the @typescript-eslint/utils dependency is upgraded and made explicit in the package (by [@wmertens](https://github.com/wmertens) in [#7030](https://github.com/QwikDev/qwik/pull/7030))\n\n## 1.9.1\n\n## 1.9.0\n\n## 1.8.0\n\n## 1.7.3\n\n## 1.7.2\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/README.md",
    "content": "# eslint-plugin-qwik\n\nQwik comes with its own set of ESLint rules to help developers write better code.\n\n## Usage\n\nInstall the plugin:\n\n```bash\nnpm add -D eslint-plugin-qwik\npnpm add -D eslint-plugin-qwik\nyarn add -D eslint-plugin-qwik\n```\n\n> `eslint-plugin-qwik` uses the tsc typechecker to type information. You must include the `tsconfigRootDir` in the `parserOptions`.\n\n## Configurations\n\n### Flat config (recommended)\n\n```js\n// eslint.config.js\nimport js from '@eslint/js';\nimport globals from 'globals';\nimport tseslint from 'typescript-eslint';\nimport { globalIgnores } from 'eslint/config';\nimport { qwikEslint9Plugin } from 'eslint-plugin-qwik';\n\nexport const qwikConfig = tseslint.config(\n  globalIgnores(['node_modules/*', 'dist/*', 'server/*', 'tmp/*']),\n  js.configs.recommended,\n  tseslint.configs.recommended,\n  qwikEslint9Plugin.configs.recommended,\n  {\n    files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],\n    languageOptions: {\n      globals: {\n        ...globals.serviceworker,\n        ...globals.browser,\n        ...globals.node,\n      },\n      parserOptions: {\n        projectService: true,\n        tsconfigRootDir: import.meta.dirname,\n      },\n    },\n  }\n);\n```\n\n### Legacy config (`eslint < 9`)\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  env: {\n    browser: true,\n    es2021: true,\n    node: true,\n  },\n  extends: [\n    'eslint:recommended',\n    'plugin:@typescript-eslint/recommended',\n    'plugin:qwik/recommended',\n  ],\n  parser: '@typescript-eslint/parser',\n  parserOptions: {\n    tsconfigRootDir: __dirname,\n    project: ['./tsconfig.json'],\n    ecmaVersion: 2021,\n    sourceType: 'module',\n    ecmaFeatures: {\n      jsx: true,\n    },\n  },\n  plugins: ['@typescript-eslint'],\n};\n```\n\n> To ignore files, you must use the `.eslintignore` file.\n\n## List of supported rules\n\n- **Warn** in 'recommended' ruleset — ✔️\n- **Error** in 'recommended' ruleset — ✅\n- **Warn** in 'strict' ruleset — 🔒\n- **Error** in 'strict' ruleset — 🔐\n- **Typecheck** — 💭\n\n| Rule                                                                                     | Description                                                                                                                                                            | Ruleset  |\n| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| [`qwik/valid-lexical-scope`](https://qwik.dev/docs/advanced/eslint/#valid-lexical-scope) | Used the tsc typechecker to detect the capture of unserializable data in dollar `($)` scopes.                                                                          | ✅ 🔐 💭 |\n| [`qwik/use-method-usage`](https://qwik.dev/docs/advanced/eslint/#use-method-usage)       | Detect invalid use of use hook.                                                                                                                                        | ✅ 🔐    |\n| [`qwik/no-react-props`](https://qwik.dev/docs/advanced/eslint/#no-react-props)           | Disallow usage of React-specific `className/htmlFor` props.                                                                                                            | ✅ 🔐    |\n| [`qwik/loader-location`](https://qwik.dev/docs/advanced/eslint/#loader-location)         | Detect declaration location of `loader$`.                                                                                                                              | ✔️ 🔐    |\n| [`qwik/prefer-classlist`](https://qwik.dev/docs/advanced/eslint/#prefer-classlist)       | Enforce using the `classlist` prop over importing a `classnames` helper. The `classlist` prop accepts an object `{ [class: string]: boolean }` just like `classnames`. | ✔️ 🔐    |\n| [`qwik/jsx-no-script-url`](https://qwik.dev/docs/advanced/eslint/#jsx-no-script-url)     | Disallow javascript: URLs.                                                                                                                                             | ✔️ 🔐    |\n| [`qwik/jsx-key`](https://qwik.dev/docs/advanced/eslint/#jsx-key)                         | Disallow missing `key` props in iterators/collection literals.                                                                                                         | ✔️ 🔐    |\n| [`qwik/unused-server`](https://qwik.dev/docs/advanced/eslint/#unused-server)             | Detect unused `server$()` functions.                                                                                                                                   | ✅ 🔐    |\n| [`qwik/jsx-img`](https://qwik.dev/docs/advanced/eslint/#jsx-img)                         | For performance reasons, always provide width and height attributes for `<img>` elements, it will help to prevent layout shifts.                                       | ✔️ 🔐    |\n| [`qwik/jsx-a`](https://qwik.dev/docs/advanced/eslint/#jsx-a)                             | For a perfect SEO score, always provide href attribute for `<a>` elements.                                                                                             | ✔️ 🔐    |\n| [`qwik/no-use-visible-task`](https://qwik.dev/docs/advanced/eslint/#no-use-visible-task) | Detect `useVisibleTask$()` functions.                                                                                                                                  | ✔️ 🔒    |\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/examples.ts",
    "content": "/**\n * @file This file is used as examples in https://qwik.dev/docs/advanced/eslint/\n *\n *   Call `pnpm eslint.update` to update the examples in the docs.\n */\nimport { jsxImgExamples } from './src/jsxImg';\nimport { jsxKeyExamples } from './src/jsxKey';\nimport { jsxNoScriptUrlExamples } from './src/jsxNoScriptUrl';\nimport { loaderLocationExamples } from './src/loaderLocation';\nimport { noReactPropsExamples } from './src/noReactProps';\nimport { preferClasslistExamples } from './src/preferClasslist';\nimport { unusedServerExamples } from './src/unusedServer';\nimport { useMethodUsageExamples } from './src/useMethodUsage';\nimport { validLexicalScopeExamples } from './src/validLexicalScope';\n\nexport type QwikEslintExample = {\n  code: string;\n  codeTitle?: string;\n  codeHighlight?: string;\n  description?: string;\n};\n\nexport type QwikEslintExamples = Record<\n  string,\n  {\n    good: QwikEslintExample[];\n    bad: QwikEslintExample[];\n  }\n>;\n\nexport const examples = {\n  'use-method-usage': useMethodUsageExamples,\n  'valid-lexical-scope': validLexicalScopeExamples,\n  'loader-location': loaderLocationExamples,\n  'no-react-props': noReactPropsExamples,\n  'prefer-classlist': preferClasslistExamples,\n  'jsx-no-script-url': jsxNoScriptUrlExamples,\n  'jsx-key': jsxKeyExamples,\n  'unused-server': unusedServerExamples,\n  'jsx-img': jsxImgExamples,\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/index.ts",
    "content": "import type { TSESLint } from '@typescript-eslint/utils';\nimport { jsxAtag } from './src/jsxAtag';\nimport { jsxImg } from './src/jsxImg';\nimport { jsxKey } from './src/jsxKey';\nimport { jsxNoScriptUrl } from './src/jsxNoScriptUrl';\nimport { loaderLocation } from './src/loaderLocation';\nimport { noReactProps } from './src/noReactProps';\nimport { noUseVisibleTask } from './src/noUseVisibleTask';\nimport { preferClasslist } from './src/preferClasslist';\nimport { unusedServer } from './src/unusedServer';\nimport { useMethodUsage } from './src/useMethodUsage';\nimport { validLexicalScope } from './src/validLexicalScope';\nimport { noAsyncPreventDefault } from './src/noAsyncPreventDefault';\nimport pkg from './package.json';\n\ntype Rules = NonNullable<TSESLint.FlatConfig.Plugin['rules']>;\n\nconst rules = {\n  'valid-lexical-scope': validLexicalScope,\n  'use-method-usage': useMethodUsage,\n  'no-react-props': noReactProps,\n  'loader-location': loaderLocation,\n  'prefer-classlist': preferClasslist,\n  'jsx-no-script-url': jsxNoScriptUrl,\n  'jsx-key': jsxKey,\n  'unused-server': unusedServer,\n  'jsx-img': jsxImg,\n  'jsx-a': jsxAtag,\n  'no-use-visible-task': noUseVisibleTask,\n  'no-async-prevent-default': noAsyncPreventDefault,\n} satisfies Rules;\n\nconst recommendedRulesLevels = {\n  'qwik/valid-lexical-scope': 'error',\n  'qwik/use-method-usage': 'error',\n  'qwik/no-react-props': 'error',\n  'qwik/loader-location': 'warn',\n  'qwik/prefer-classlist': 'warn',\n  'qwik/jsx-no-script-url': 'warn',\n  'qwik/jsx-key': 'warn',\n  'qwik/unused-server': 'error',\n  'qwik/jsx-img': 'warn',\n  'qwik/jsx-a': 'warn',\n  'qwik/no-use-visible-task': 'warn',\n  'qwik/no-async-prevent-default': 'warn',\n} satisfies TSESLint.FlatConfig.Rules;\n\nconst strictRulesLevels = {\n  'qwik/valid-lexical-scope': 'error',\n  'qwik/use-method-usage': 'error',\n  'qwik/no-react-props': 'error',\n  'qwik/loader-location': 'error',\n  'qwik/prefer-classlist': 'error',\n  'qwik/jsx-no-script-url': 'error',\n  'qwik/jsx-key': 'error',\n  'qwik/unused-server': 'error',\n  'qwik/jsx-img': 'error',\n  'qwik/jsx-a': 'error',\n  'qwik/no-use-visible-task': 'warn',\n  'qwik/no-async-prevent-default': 'warn',\n} satisfies TSESLint.FlatConfig.Rules;\n\nconst configs = {\n  recommended: {\n    plugins: ['qwik'],\n    rules: recommendedRulesLevels,\n  },\n  strict: {\n    plugins: ['qwik'],\n    rules: strictRulesLevels,\n  },\n} satisfies Record<string, TSESLint.ClassicConfig.Config>;\n\nconst qwikEslint9Plugin = {\n  configs: {\n    get recommended() {\n      return recommendedConfig;\n    },\n    get strict() {\n      return strictConfig;\n    },\n  },\n  meta: {\n    name: pkg.name,\n    version: pkg.version,\n  },\n  rules,\n} as const;\n\nconst recommendedConfig = [\n  {\n    plugins: {\n      qwik: qwikEslint9Plugin,\n    },\n    rules: recommendedRulesLevels,\n  },\n] satisfies TSESLint.FlatConfig.ConfigArray;\n\nconst strictConfig = [\n  {\n    plugins: {\n      qwik: qwikEslint9Plugin,\n    },\n    rules: strictRulesLevels,\n  },\n] satisfies TSESLint.FlatConfig.ConfigArray;\n\nexport { configs, qwikEslint9Plugin, rules };\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/package.json",
    "content": "{\n  \"name\": \"eslint-plugin-qwik\",\n  \"description\": \"An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.\",\n  \"version\": \"1.19.0\",\n  \"author\": \"Builder Team\",\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"dependencies\": {\n    \"@typescript-eslint/utils\": \"^8.56.1\",\n    \"jsx-ast-utils\": \"^3.3.5\"\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@builder.io/qwik-city\": \"workspace:^\",\n    \"@types/estree\": \"1.0.8\",\n    \"@typescript-eslint/rule-tester\": \"8.56.1\",\n    \"redent\": \"4.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"files\": [\n    \"README.md\",\n    \"dist\"\n  ],\n  \"homepage\": \"https://github.com/QwikDev/qwik#readme\",\n  \"keywords\": [\n    \"builder.io\",\n    \"eslint\",\n    \"qwik\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"dist/index.js\",\n  \"peerDependencies\": {\n    \"eslint\": \"^8.57.0 || ^9.0.0 || ^10.0.0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/eslint-rules\"\n  },\n  \"scripts\": {\n    \"test\": \"cd ../..; ./node_modules/.bin/vitest packages/eslint-plugin-qwik/qwik.unit.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/qwik.unit.ts",
    "content": "import * as vitest from 'vitest';\nimport { RuleTester, type RuleTesterConfig } from '@typescript-eslint/rule-tester';\nimport { fileURLToPath } from 'node:url';\nimport { rules } from './index';\nimport { readdir, readFile, stat } from 'node:fs/promises';\nimport { join, dirname } from 'path';\n\n// https://typescript-eslint.io/packages/rule-tester/#vitest\nRuleTester.afterAll = vitest.afterAll;\nRuleTester.it = vitest.it;\nRuleTester.itOnly = vitest.it.only;\nRuleTester.describe = vitest.describe;\n\nconst testConfig = {\n  rules: {\n    'no-console': 'error',\n  },\n  languageOptions: {\n    parserOptions: {\n      sourceType: 'module',\n      ecmaFeatures: {\n        jsx: true,\n      },\n      ecmaVersion: 2024,\n      project: ['./tests/tsconfig.json'],\n      tsconfigRootDir: fileURLToPath(new URL('.', import.meta.url)),\n    },\n  },\n} as RuleTesterConfig;\n\nconst ruleTester = new RuleTester(testConfig);\ntype RuleTesterRule = Parameters<RuleTester['defineRule']>[1];\n\ninterface TestCase {\n  name: string;\n  filename: string;\n  code: string;\n}\ninterface InvalidTestCase extends TestCase {\n  errors: { messageId: string }[];\n}\n\nconst isRuleName = (ruleName: string): ruleName is keyof typeof rules =>\n  Object.prototype.hasOwnProperty.call(rules, ruleName);\n\nawait (async function setupEsLintRuleTesters() {\n  // list './test' directory content and set up one RuleTester per directory\n  let testDir = join(dirname(new URL(import.meta.url).pathname), './tests');\n  const isWindows = process.platform === 'win32';\n  if (isWindows && testDir.startsWith('\\\\')) {\n    // in Windows testDir starts with a \\ causing errors\n    testDir = testDir.substring(1);\n  }\n\n  const ruleNames = await readdir(testDir);\n  for (const ruleName of ruleNames) {\n    if (ruleName.endsWith('.json')) {\n      continue;\n    }\n    if (!isRuleName(ruleName)) {\n      throw new Error(\n        `Test directory has rule '${ruleName}' but related eslint rule is missing. Valid rules are: ${Object.keys(\n          rules\n        ).join(', ')}`\n      );\n    }\n    const rule = rules[ruleName] as RuleTesterRule;\n    const ruleDir = join(testDir, ruleName);\n    const valid: TestCase[] = [];\n    const invalid: InvalidTestCase[] = [];\n    const testCaseNames = await readdir(ruleDir);\n    for (const testCaseName of testCaseNames) {\n      let path = join(ruleDir, testCaseName);\n      while ((await stat(path)).isDirectory()) {\n        const files = await readdir(path);\n        if (files.length !== 1) {\n          throw new Error(`Test directory '${path}' must have exactly one file.`);\n        }\n        path = join(path, files[0]);\n      }\n      const code = String(await readFile(path, 'utf-8'));\n      const filename = path.replace(testDir, './tests');\n      if (testCaseName.startsWith('valid-')) {\n        valid.push({ name: testCaseName, filename, code });\n      } else if (testCaseName.startsWith('invalid-')) {\n        const EXPECT_ERROR_COMMENT = '// Expect error: ';\n        const errors = code\n          .split('\\n')\n          .map((line) => line.trim())\n          .filter((line) => line.startsWith(EXPECT_ERROR_COMMENT))\n          .map((line) => JSON.parse(line.substring(EXPECT_ERROR_COMMENT.length)));\n        if (!errors.length) {\n          throw new Error(\n            `Invalid test case '${filename}' does not have '${EXPECT_ERROR_COMMENT}' comment.`\n          );\n        }\n        invalid.push({ name: testCaseName, filename, code, errors });\n      } else {\n        throw new Error(`Unexpected file '${testCaseName}' in directory '${ruleDir}'`);\n      }\n    }\n    if (valid.length || invalid.length) {\n      await ruleTester.run(ruleName, rule, { valid, invalid });\n    }\n  }\n})();\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/jsxAtag.ts",
    "content": "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\n\nconst createRule = ESLintUtils.RuleCreator(() => 'https://qwik.dev/docs/advanced/dollar/');\n\nexport const jsxAtag = createRule({\n  defaultOptions: [],\n  name: 'jsx-a-tag',\n  meta: {\n    type: 'problem',\n    docs: {\n      description: 'For a perfect SEO score, always provide href attribute for <a> elements.',\n      recommended: 'warn',\n    },\n    fixable: 'code',\n    schema: [],\n    messages: {\n      noHref: 'For a perfect SEO score, always provide href attribute for <a> elements.',\n    },\n  },\n  create(context) {\n    return {\n      JSXElement(node: TSESTree.JSXElement) {\n        if (\n          node.openingElement.name.type === 'JSXIdentifier' &&\n          node.openingElement.name.name === 'a'\n        ) {\n          const hasSpread = node.openingElement.attributes.some(\n            (attr) => attr.type === 'JSXSpreadAttribute'\n          );\n\n          if (!hasSpread) {\n            const hasHref = node.openingElement.attributes.some(\n              (attr) =>\n                attr.type === 'JSXAttribute' &&\n                attr.name.type === 'JSXIdentifier' &&\n                attr.name.name === 'href'\n            );\n            if (!hasHref) {\n              context.report({\n                node: node as any,\n                messageId: 'noHref',\n              });\n            }\n          }\n        }\n      },\n    };\n  },\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/jsxImg.ts",
    "content": "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport { QwikEslintExamples } from '../examples';\n\nconst createRule = ESLintUtils.RuleCreator(\n  (name) => `https://qwik.dev/docs/advanced/eslint/#${name}`\n);\n\nexport const jsxImg = createRule({\n  defaultOptions: [],\n  name: 'jsx-img',\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'For performance reasons, always provide width and height attributes for <img> elements, it will help to prevent layout shifts.',\n      recommended: 'warn',\n    },\n    fixable: 'code',\n    schema: [],\n    messages: {\n      noLocalSrc: `Local images can be optimized by importing using ESM, like this:\n\n  import {{importName}} from '{{importSrc}}';\n  <{{importName}} />\n\nSee https://qwik.dev/docs/integrations/image-optimization/#responsive-images`,\n      noWidthHeight:\n        'Missing \"width\" or \"height\" attribute.\\nFor performance reasons, always provide width and height attributes for <img> elements, it will prevent layout shifts, boosting performance and UX.',\n    },\n  },\n  create(context) {\n    return {\n      JSXElement(node: TSESTree.JSXElement) {\n        if (\n          node.openingElement.name.type === 'JSXIdentifier' &&\n          node.openingElement.name.name === 'img'\n        ) {\n          const hasSpread = node.openingElement.attributes.some(\n            (attr) => attr.type === 'JSXSpreadAttribute'\n          );\n\n          if (!hasSpread) {\n            const src = node.openingElement.attributes.find(\n              (attr) =>\n                attr.type === 'JSXAttribute' &&\n                attr.name.type === 'JSXIdentifier' &&\n                attr.name.name === 'src'\n            ) as TSESTree.JSXAttribute | undefined;\n            if (src && src.value) {\n              const literal: TSESTree.Literal | undefined =\n                src.value.type === 'Literal'\n                  ? src.value\n                  : src.value.type === 'JSXExpressionContainer' &&\n                      src.value.expression.type === 'Literal'\n                    ? src.value.expression\n                    : undefined;\n              if (literal && typeof literal.value === 'string') {\n                const isLocal = literal.value.startsWith('/');\n                if (isLocal) {\n                  const importSrc = `~/media${literal.value}?jsx`;\n                  const importName = imgImportName(literal.value);\n                  context.report({\n                    node: src,\n                    messageId: 'noLocalSrc',\n                    data: {\n                      importSrc,\n                      importName,\n                    },\n                  });\n                  return;\n                }\n              }\n            }\n\n            const hasWidth = node.openingElement.attributes.some(\n              (attr) =>\n                attr.type === 'JSXAttribute' &&\n                attr.name.type === 'JSXIdentifier' &&\n                attr.name.name === 'width'\n            );\n            const hasHeight = node.openingElement.attributes.some(\n              (attr) =>\n                attr.type === 'JSXAttribute' &&\n                attr.name.type === 'JSXIdentifier' &&\n                attr.name.name === 'height'\n            );\n            if (!hasWidth || !hasHeight) {\n              context.report({\n                node: node as any,\n                messageId: 'noWidthHeight',\n              });\n            }\n          }\n        }\n      },\n    };\n  },\n});\n\nconst noLocalSrcGood = `\nimport Image from '~/media/image.png';\n<Image />`.trim();\n\nconst noLocalSrcBad = `\n<img src=\"/image.png\">`.trim();\n\nconst noWidthHeightGood = `\n<img width=\"200\" height=\"600\" src=\"/static/images/portrait-01.webp\">`.trim();\n\nconst noWidthHeightBad = `\n<img src=\"/static/images/portrait-01.webp\">`.trim();\nexport const jsxImgExamples: QwikEslintExamples = {\n  noWidthHeight: {\n    good: [\n      {\n        codeHighlight: '/width/#a /height/#b',\n        code: noWidthHeightGood,\n      },\n    ],\n    bad: [\n      {\n        code: noWidthHeightBad,\n        description:\n          'For performance reasons, always provide width and height attributes for `<img>` elements, it will help to prevent layout shifts.',\n      },\n    ],\n  },\n  noLocalSrc: {\n    good: [\n      {\n        code: noLocalSrcGood,\n      },\n    ],\n    bad: [\n      {\n        code: noLocalSrcBad,\n        description:\n          'Serving images from public are not optimized, nor cached. Import images using ESM instead.',\n      },\n    ],\n  },\n};\n\nfunction imgImportName(value: string) {\n  const dot = value.lastIndexOf('.');\n  const slash = value.lastIndexOf('/');\n  value = value.substring(slash + 1, dot);\n  return `Img${toPascalCase(value)}`;\n}\n\nfunction toPascalCase(string) {\n  return `${string}`\n    .toLowerCase()\n    .replace(new RegExp(/[-_]+/, 'g'), ' ')\n    .replace(new RegExp(/[^\\w\\s]/, 'g'), '')\n    .replace(new RegExp(/\\s+(.)(\\w*)/, 'g'), ($1, $2, $3) => `${$2.toUpperCase() + $3}`)\n    .replace(new RegExp(/\\w/), (s) => s.toUpperCase());\n}\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/jsxKey.ts",
    "content": "import jsxAstUtils from 'jsx-ast-utils';\nimport { QwikEslintExamples } from '../examples';\n\n// ------------------------------------------------------------------------------\n// Rule Definition\n// ------------------------------------------------------------------------------\n\nfunction isFunctionLikeExpression(node) {\n  return node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';\n}\n\nconst defaultOptions = {\n  checkFragmentShorthand: false,\n  checkKeyMustBeforeSpread: false,\n  warnOnDuplicates: false,\n};\n\nconst messages = {\n  missingIterKey: 'Missing \"key\" prop for element in iterator.',\n  missingIterKeyUsePrag:\n    'Missing \"key\" prop for element in iterator. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use <Fragment> instead',\n  missingArrayKey:\n    'Missing \"key\" prop for element in array. The key prop allows for improved rendering performance.',\n  missingArrayKeyUsePrag:\n    'Missing \"key\" prop for element in array. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use <Fragment> instead',\n  nonUniqueKeys: '`key` prop must be unique',\n};\n\nexport const jsxKey = {\n  meta: {\n    docs: {\n      description: 'Disallow missing `key` props in iterators/collection literals',\n      category: 'Possible Errors',\n      recommended: true,\n      url: 'https://qwik.dev/docs/advanced/eslint/#jsx-key',\n    },\n\n    messages,\n\n    schema: [\n      {\n        type: 'object',\n        properties: {\n          checkFragmentShorthand: {\n            type: 'boolean',\n            default: defaultOptions.checkFragmentShorthand,\n          },\n          checkKeyMustBeforeSpread: {\n            type: 'boolean',\n            default: defaultOptions.checkKeyMustBeforeSpread,\n          },\n          warnOnDuplicates: {\n            type: 'boolean',\n            default: defaultOptions.warnOnDuplicates,\n          },\n        },\n        additionalProperties: false,\n      },\n    ],\n  },\n\n  create(context) {\n    const sourceCode = context.sourceCode ?? context.getSourceCode();\n    const modifyJsxSource = sourceCode\n      .getAllComments()\n      .some((c) => c.value.includes('@jsxImportSource'));\n    if (modifyJsxSource) {\n      return {};\n    }\n    const options = Object.assign({}, defaultOptions, context.options[0]);\n    const checkFragmentShorthand = options.checkFragmentShorthand;\n    const checkKeyMustBeforeSpread = options.checkKeyMustBeforeSpread;\n    const warnOnDuplicates = options.warnOnDuplicates;\n\n    function checkIteratorElement(node) {\n      if (\n        node.type === 'JSXElement' &&\n        !jsxAstUtils.hasProp(node.openingElement.attributes, 'key')\n      ) {\n        context.report({\n          node,\n          messageId: 'missingIterKey',\n        });\n      } else if (checkFragmentShorthand && node.type === 'JSXFragment') {\n        context.report({\n          node,\n          messageId: 'missingIterKeyUsePrag',\n        });\n      }\n    }\n\n    function getReturnStatements(node, returnStatements: any[] = []) {\n      if (node.type === 'IfStatement') {\n        if (node.consequent) {\n          getReturnStatements(node.consequent, returnStatements);\n        }\n        if (node.alternate) {\n          getReturnStatements(node.alternate, returnStatements);\n        }\n      } else if (Array.isArray(node.body)) {\n        node.body.forEach((item) => {\n          if (item.type === 'IfStatement') {\n            getReturnStatements(item, returnStatements);\n          }\n\n          if (item.type === 'ReturnStatement') {\n            returnStatements.push(item);\n          }\n        });\n      }\n\n      return returnStatements;\n    }\n\n    function isKeyAfterSpread(attributes) {\n      let hasFoundSpread = false;\n      return attributes.some((attribute) => {\n        if (attribute.type === 'JSXSpreadAttribute') {\n          hasFoundSpread = true;\n          return false;\n        }\n        if (attribute.type !== 'JSXAttribute') {\n          return false;\n        }\n        return hasFoundSpread && jsxAstUtils.propName(attribute) === 'key';\n      });\n    }\n\n    /**\n     * Checks if the given node is a function expression or arrow function, and checks if there is a\n     * missing key prop in return statement's arguments\n     *\n     * @param {ASTNode} node\n     */\n    function checkFunctionsBlockStatement(node) {\n      if (isFunctionLikeExpression(node)) {\n        if (node.body.type === 'BlockStatement') {\n          getReturnStatements(node.body)\n            .filter((returnStatement) => returnStatement && returnStatement.argument)\n            .forEach((returnStatement) => {\n              checkIteratorElement(returnStatement.argument);\n            });\n        }\n      }\n    }\n\n    /**\n     * Checks if the given node is an arrow function that has an JSX Element or JSX Fragment in its\n     * body, and the JSX is missing a key prop\n     *\n     * @param {ASTNode} node\n     */\n    function checkArrowFunctionWithJSX(node) {\n      const isArrFn = node && node.type === 'ArrowFunctionExpression';\n      const shouldCheckNode = (n) => n && (n.type === 'JSXElement' || n.type === 'JSXFragment');\n      if (isArrFn && shouldCheckNode(node.body)) {\n        checkIteratorElement(node.body);\n      }\n      if (node.body.type === 'ConditionalExpression') {\n        if (shouldCheckNode(node.body.consequent)) {\n          checkIteratorElement(node.body.consequent);\n        }\n        if (shouldCheckNode(node.body.alternate)) {\n          checkIteratorElement(node.body.alternate);\n        }\n      } else if (node.body.type === 'LogicalExpression' && shouldCheckNode(node.body.right)) {\n        checkIteratorElement(node.body.right);\n      }\n    }\n\n    const childrenToArraySelector = `:matches(\n      CallExpression\n        [callee.object.object.name=Fragment]\n        [callee.object.property.name=Children]\n        [callee.property.name=toArray],\n      CallExpression\n        [callee.object.name=Children]\n        [callee.property.name=toArray]\n    )`.replace(/\\s/g, '');\n    let isWithinChildrenToArray = false;\n\n    const seen = new WeakSet();\n\n    return {\n      [childrenToArraySelector]() {\n        isWithinChildrenToArray = true;\n      },\n\n      [`${childrenToArraySelector}:exit`]() {\n        isWithinChildrenToArray = false;\n      },\n\n      'ArrayExpression, JSXElement > JSXElement'(node) {\n        if (isWithinChildrenToArray) {\n          return;\n        }\n\n        const jsx = (node.type === 'ArrayExpression' ? node.elements : node.parent.children).filter(\n          (x) => x && x.type === 'JSXElement'\n        );\n        if (jsx.length === 0) {\n          return;\n        }\n\n        const map = {};\n        jsx.forEach((element) => {\n          const attrs = element.openingElement.attributes;\n          const keys = attrs.filter((x) => x.name && x.name.name === 'key');\n\n          if (keys.length === 0) {\n            if (node.type === 'ArrayExpression') {\n              context.report({\n                node: element,\n                messageId: 'missingArrayKey',\n              });\n            }\n          }\n        });\n\n        if (warnOnDuplicates) {\n          Object.values(map)\n            .filter((v: any) => v.length > 1)\n            .forEach((v: any) => {\n              v.forEach((n) => {\n                if (!seen.has(n)) {\n                  seen.add(n);\n                  context.report({\n                    node: n,\n                    messageId: 'nonUniqueKeys',\n                  });\n                }\n              });\n            });\n        }\n      },\n\n      JSXFragment(node) {\n        if (!checkFragmentShorthand || isWithinChildrenToArray) {\n          return;\n        }\n\n        if (node.parent.type === 'ArrayExpression') {\n          context.report({\n            node,\n            messageId: 'missingArrayKeyUsePrag',\n          });\n        }\n      },\n\n      // Array.prototype.map\n\n      'CallExpression[callee.type=\"MemberExpression\"][callee.property.name=\"map\"],\\\n       CallExpression[callee.type=\"OptionalMemberExpression\"][callee.property.name=\"map\"],\\\n       OptionalCallExpression[callee.type=\"MemberExpression\"][callee.property.name=\"map\"],\\\n       OptionalCallExpression[callee.type=\"OptionalMemberExpression\"][callee.property.name=\"map\"]'(\n        node\n      ) {\n        if (isWithinChildrenToArray) {\n          return;\n        }\n\n        const fn = node.arguments.length > 0 && node.arguments[0];\n        if (!fn || !isFunctionLikeExpression(fn)) {\n          return;\n        }\n\n        checkArrowFunctionWithJSX(fn);\n\n        checkFunctionsBlockStatement(fn);\n      },\n\n      // Array.from\n      'CallExpression[callee.type=\"MemberExpression\"][callee.property.name=\"from\"]'(node) {\n        if (isWithinChildrenToArray) {\n          return;\n        }\n\n        const fn = node.arguments.length > 1 && node.arguments[1];\n        if (!isFunctionLikeExpression(fn)) {\n          return;\n        }\n\n        checkArrowFunctionWithJSX(fn);\n\n        checkFunctionsBlockStatement(fn);\n      },\n    };\n  },\n};\n\nconst missingIterKeyGood = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    <ul>\n      {Object.keys(person).map((color) => (\n        <li key={\\`person-\\${key}\\`}>{person[key]}</li>\n      ))}\n    </ul>\n  );\n});`.trim();\n\nconst missingIterKeyBad = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    <ul>\n      {Object.keys(person).map((color) => (\n        <li>{person[key]}</li>\n      ))}\n    </ul>\n  );\n});`.trim();\n\nconst missingIterKeyUsePragGood = `\nimport { component$ } from '@builder.io/qwik';\nimport Card from './Card';\nimport Summary from './Summary';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    {Object.keys(person).map((color) => (\n      <Fragment key={\\`person-\\${key}\\`}>\n        <Card value={person[key]} />\n        <Summary value={person[key]} />\n      </Fragment>\n    ))}\n  );\n});`.trim();\n\nconst missingIterKeyUsePragBad = `\nimport { component$ } from '@builder.io/qwik';\nimport Card from './Card';\nimport Summary from './Summary';\n\nexport const Person = component$(() => {\n  const person  = {\n    firstName: 'John',\n    lastName: 'Doe',\n    age: 32,\n  }\n\n  return (\n    {Object.keys(person).map((color) => (\n      < key={\\`person-\\${key}\\`}>\n        <Card value={person[key]} />\n        <Summary value={person[key]} />\n      </>\n    ))}\n  );\n});`.trim();\n\nconst missingArrayKeyGood = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    <ul>\n      {colors.map((color) => (\n        <li key={\\`color-\\${color}\\`}>{color}</li>\n      ))}\n    </ul>\n  );\n});`.trim();\n\nconst missingArrayKeyBad = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    <ul>\n      {colors.map((color) => (\n        <li>{color}</li>\n      ))}\n    </ul>\n  );\n});`.trim();\n\nconst missingArrayKeyUsePragGood = `\nimport { component$, Fragment } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    {colors.map((color) => (\n      <Fragment key={\\`color-\\${color}\\`}>\n        <h2>{color}</h2>\n        <p>The color \"\\${color}\" is a great color.</p>\n      </Fragment>\n    ))}\n  );\n});`.trim();\n\nconst missingArrayKeyUsePragBad = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    {colors.map((color) => (\n      < key={\\`color-\\${color}\\`}>\n        <h2>{color}</h2>\n        <p>The color \"\\${color}\" is a great color.</p>\n      </>\n    ))}\n  );\n});`.trim();\n\nconst nonUniqueKeysGood = missingArrayKeyGood;\n\nconst nonUniqueKeysBad = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const ColorList = component$(() => {\n  const colors = ['red', 'green', 'blue'];\n\n  return (\n    <ul>\n      {colors.map((color) => (\n        <li key=\"not-a-good-idea\">{color}</li>\n      ))}\n    </ul>\n  );\n});`.trim();\n\nexport const jsxKeyExamples: QwikEslintExamples = {\n  missingIterKey: {\n    good: [\n      {\n        codeHighlight: '{13} /key=/#a',\n        code: missingIterKeyGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{13}',\n        code: missingIterKeyBad,\n        description: 'Missing `key` prop for element in iterator.',\n      },\n    ],\n  },\n  missingIterKeyUsePrag: {\n    good: [\n      {\n        codeHighlight: '{14} /Fragment/#a',\n        code: missingIterKeyUsePragGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{14}',\n        code: missingIterKeyUsePragBad,\n        description:\n          'Missing `key` prop for element in iterator. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use `<Fragment>` instead',\n      },\n    ],\n  },\n  missingArrayKey: {\n    good: [\n      {\n        codeHighlight: '{9} /key=/#a',\n        code: missingArrayKeyGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{9}',\n        code: missingArrayKeyBad,\n        description:\n          'Missing `key` prop for element in array. The key prop allows for improved rendering performance.',\n      },\n    ],\n  },\n  missingArrayKeyUsePrag: {\n    good: [\n      {\n        codeHighlight: '{8,11} /Fragment/#a',\n        code: missingArrayKeyUsePragGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{8,11}',\n        code: missingArrayKeyUsePragBad,\n        description:\n          'Missing `key` prop for element in array. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use `<Fragment>` instead',\n      },\n    ],\n  },\n  nonUniqueKeys: {\n    good: [\n      {\n        codeHighlight: '{9} /key=/#a',\n        code: nonUniqueKeysGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{9} /key=/#a /not-a-good-idea/#b',\n        code: nonUniqueKeysBad,\n        description: 'The `key` prop must be unique.',\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/jsxNoScriptUrl.ts",
    "content": "import { ASTUtils } from '@typescript-eslint/utils';\nimport { QwikEslintExamples } from '../examples';\nconst { getStaticValue } = ASTUtils;\n\n// A javascript: URL can contain leading C0 control or \\u0020 SPACE,\n// and any newline or tab are filtered out as if they're not part of the URL.\n// https://url.spec.whatwg.org/#url-parsing\n// Tab or newline are defined as \\r\\n\\t:\n// https://infra.spec.whatwg.org/#ascii-tab-or-newline\n// A C0 control is a code point in the range \\u0000 NULL to \\u001F\n// INFORMATION SEPARATOR ONE, inclusive:\n// https://infra.spec.whatwg.org/#c0-control-or-space\nconst isJavaScriptProtocol =\n  /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i; // eslint-disable-line no-control-regex\n\n/**\n * This rule is adapted from eslint-plugin-react's jsx-no-script-url rule under the MIT license.\n * Thank you for your work!\n */\nexport const jsxNoScriptUrl = {\n  meta: {\n    type: 'problem',\n    docs: {\n      recommended: 'error',\n      description: 'Disallow javascript: URLs.',\n      url: 'https://qwik.dev/docs/advanced/eslint/#jsx-no-script-url',\n    },\n    schema: [],\n    messages: {\n      noJSURL: \"For security, don't use javascript: URLs. Use event handlers instead if you can.\",\n    },\n  },\n  create(context) {\n    const sourceCode = context.sourceCode ?? context.getSourceCode();\n    return {\n      JSXAttribute(node) {\n        if (node.name.type === 'JSXIdentifier' && node.value) {\n          const link = getStaticValue(\n            node.value.type === 'JSXExpressionContainer' ? node.value.expression : node.value,\n            sourceCode.getScope ? sourceCode.getScope(node) : context.getScope()\n          );\n          if (link && typeof link.value === 'string' && isJavaScriptProtocol.test(link.value)) {\n            context.report({\n              node: node.value,\n              messageId: 'noJSURL',\n            });\n          }\n        }\n      },\n    };\n  },\n};\n\nconst noJSURLGood = `\n<button onClick$={() => alert('open the door please')}>ring</button>`.trim();\n\nconst noJSURLBad = `\n<button onClick$=\"javascript:alert('open the door please')\">ring</button>`.trim();\n\nexport const jsxNoScriptUrlExamples: QwikEslintExamples = {\n  noJSURL: {\n    good: [\n      {\n        code: noJSURLGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '/javascript:/#a',\n        code: noJSURLBad,\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/loaderLocation.ts",
    "content": "import type { Rule } from 'eslint';\nimport { QwikEslintExamples } from '../examples';\n\nexport const ROUTE_FNS: Record<string, boolean> = {\n  loader$: true,\n  routeLoader$: true,\n  routeAction$: true,\n  routeHandler$: true,\n};\n\nexport const LINTER_FNS: Record<string, boolean> = {\n  ...ROUTE_FNS,\n  action$: true,\n  globalAction$: true,\n};\n\nexport const loaderLocation: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description: 'Detect declaration location of loader$.',\n      recommended: true,\n      url: 'https://qwik.dev/docs/advanced/eslint/#loader-location',\n    },\n    schema: [\n      {\n        type: 'object',\n        properties: {\n          routesDir: {\n            type: 'string',\n            default: 'src/routes',\n          },\n        },\n        additionalProperties: false,\n      },\n    ],\n    messages: {\n      invalidLoaderLocation: `'{{fnName}}() are typically declared in route boundary files such as layout.tsx, index.tsx and plugin.tsx inside the {{routesDir}} directory\n(docs: https://qwik.dev/docs/route-loader/).\n\nThis {{fnName}}() is declared outside of the route boundaries. This may be useful when you want to create reusable logic or a library. In such a case, it is essential that this function is re-exported from within the router boundary otherwise it will not run.\n(docs: https://qwik.dev/docs/re-exporting-loaders/).\n\nIf you understand this, you can disable this warning with:\n// eslint-disable-next-line qwik/loader-location\n`,\n      missingExport:\n        'The return of `{{fnName}}()` needs to be exported in the same module, like this\\n```\\nexport const {{id}} = {{fnName}}(() => { ... });\\n```',\n      wrongName:\n        'The named export of `{{fnName}}()` needs to follow the `use*` naming convention. It must start with `use`, like this:\\n```\\nexport const {{fixed}} = {{fnName}}(() => { ... });\\n```\\nInstead it was named:\\n```\\nexport const {{id}} = ...\\n```',\n      recommendedValue:\n        'For `{{fnName}}()` it is recommended to inline the arrow function. Instead of:\\n```\\nexport const {{id}} = {{fnName}}({{arg}});\\n```\\nDo this:\\n```\\nexport const {{id}} = {{fnName}}(() => { ...logic here... });\\n```\\nThis will help the optimizer make sure that no server code is leaked to the client build.',\n    },\n  },\n  create(context) {\n    const routesDir = context.options?.[0]?.routesDir ?? 'src/routes';\n    const path = normalizePath(context.filename ?? context.getFilename());\n    const isLayout = /\\/layout(|!|-.+)\\.(j|t)sx?$/.test(path);\n    const isIndex = /\\/index(|!|@.+)\\.(j|t)sx?$/.test(path);\n    const isPlugin = /\\/plugin(|@.+)\\.(j|t)sx?$/.test(path);\n    const isInsideRoutes = new RegExp(`/${routesDir}/`).test(path);\n\n    const canContainLoader = isInsideRoutes && (isIndex || isLayout || isPlugin);\n    return {\n      CallExpression(node) {\n        if (node.callee.type !== 'Identifier') {\n          return;\n        }\n        const fnName = node.callee.name;\n        if (!LINTER_FNS[fnName]) {\n          return;\n        }\n        if (!canContainLoader && ROUTE_FNS[fnName]) {\n          context.report({\n            node: node.callee,\n            messageId: 'invalidLoaderLocation',\n            data: {\n              routesDir,\n              fnName,\n              path,\n            },\n          });\n          return;\n        }\n        const variableDeclarator = node.parent;\n        if (variableDeclarator.type !== 'VariableDeclarator') {\n          context.report({\n            node: node.callee,\n            messageId: 'missingExport',\n            data: {\n              fnName,\n              id: 'useStuff',\n            },\n          });\n          return;\n        }\n        if (variableDeclarator.id.type !== 'Identifier') {\n          context.report({\n            node: node.callee,\n            messageId: 'missingExport',\n            data: {\n              fnName,\n              id: 'useStuff',\n            },\n          });\n          return;\n        }\n        if (!/^use/.test(variableDeclarator.id.name)) {\n          const fixed =\n            'use' +\n            variableDeclarator.id.name[0].toUpperCase() +\n            variableDeclarator.id.name.slice(1);\n          context.report({\n            node: variableDeclarator.id,\n            messageId: 'wrongName',\n            data: {\n              fnName,\n              id: variableDeclarator.id.name,\n              fixed,\n            },\n          });\n          return;\n        }\n        if (!isExported(variableDeclarator)) {\n          context.report({\n            node: variableDeclarator.id,\n            messageId: 'missingExport',\n            data: {\n              fnName,\n              id: variableDeclarator.id.name,\n            },\n          });\n          return;\n        }\n        if (node.arguments.length > 0 && node.arguments[0].type === 'Identifier') {\n          context.report({\n            node: node.arguments[0],\n            messageId: 'recommendedValue',\n            data: {\n              fnName,\n              id: variableDeclarator.id.name,\n              arg: node.arguments[0].name,\n            },\n          });\n          return;\n        }\n      },\n    };\n  },\n};\n\nexport function normalizePath(path: string) {\n  // MIT https://github.com/sindresorhus/slash/blob/main/license\n  // Convert Windows backslash paths to slash paths: foo\\\\bar ➔ foo/bar\n  const isExtendedLengthPath = /^\\\\\\\\\\?\\\\/.test(path);\n  const hasNonAscii = /[^\\u0000-\\u0080]+/.test(path); // eslint-disable-line no-control-regex\n\n  if (isExtendedLengthPath || hasNonAscii) {\n    return path;\n  }\n\n  path = path.replace(/\\\\/g, '/');\n  if (path.endsWith('/')) {\n    path = path.slice(0, path.length - 1);\n  }\n  return path;\n}\n\nconst invalidLoaderLocationGood = `\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(\\`https://.../products/\\${requestEvent.params.productId}\\`);\n  const product = await res.json();\n  return product as Product;\n});`.trim();\n\nconst invalidLoaderLocationBad = invalidLoaderLocationGood;\n\nconst missingExportGood = invalidLoaderLocationGood;\n\nconst missingExportBad = `\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nconst useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(\\`https://.../products/\\${requestEvent.params.productId}\\`);\n  const product = await res.json();\n  return product as Product;\n});`.trim();\n\nconst wrongNameGood = invalidLoaderLocationGood;\n\nconst wrongNameBad = `\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nexport const getProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(\\`https://.../products/\\${requestEvent.params.productId}\\`);\n  const product = await res.json();\n  return product as Product;\n});`.trim();\n\nconst recommendedValueGood = invalidLoaderLocationGood;\n\nconst recommendedValueBad = `\nimport { routeLoader$ } from '@builder.io/qwik-city';\n \nasync function fetcher() {\n  const res = await fetch(\\`https://.../products/\\${requestEvent.params.productId}\\`);\n  const product = await res.json();\n  return product as Product;\n}\n\nexport const useProductDetails = routeLoader$(fetcher);\n`.trim();\n\nexport const loaderLocationExamples: QwikEslintExamples = {\n  invalidLoaderLocation: {\n    good: [\n      {\n        codeTitle: 'src/routes/product/[productId]/index.tsx',\n        codeHighlight: '{3} /routeLoader$/#a',\n        code: invalidLoaderLocationGood,\n      },\n    ],\n    bad: [\n      {\n        codeTitle: 'src/components/product/product.tsx',\n        codeHighlight: '{3} /routeLoader$/#a',\n        code: invalidLoaderLocationBad,\n        description:\n          'This is not a valid location for a route loader. It only can be used inside the `src/routes` folder, in a `layout.tsx` or `index.tsx` file.',\n      },\n    ],\n  },\n  missingExport: {\n    good: [\n      {\n        codeHighlight: '{3} /export/#a',\n        code: missingExportGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{3}',\n        code: missingExportBad,\n        description: 'The route loader function must be exported.',\n      },\n    ],\n  },\n  wrongName: {\n    good: [\n      {\n        codeHighlight: '{3} /use/#a',\n        code: wrongNameGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{3} /get/#a',\n        code: wrongNameBad,\n        description: 'The route loader function name must start with `use`.',\n      },\n    ],\n  },\n  recommendedValue: {\n    good: [\n      {\n        codeHighlight: '{3} /=>/#a',\n        code: recommendedValueGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{9} /fetcher/#a',\n        code: recommendedValueBad,\n        description:\n          'It is recommended to inline the arrow function. This will help the optimizer make sure that no server code is leaked to the client build.',\n      },\n    ],\n  },\n};\nfunction isExported(variableDeclarator: Rule.Node): boolean {\n  if (variableDeclarator.parent.parent.type === 'ExportNamedDeclaration') {\n    return true;\n  }\n  if (variableDeclarator.type === 'VariableDeclarator') {\n    const id = variableDeclarator.id;\n    if ('name' in id) {\n      const name = id.name;\n      const body = getProgramBody(variableDeclarator);\n      for (let idx = 0; idx < body.length; idx++) {\n        const node = body[idx];\n        if (node.type == 'ExportNamedDeclaration') {\n          const specifiers = node.specifiers;\n          for (let specIdx = 0; specIdx < specifiers.length; specIdx++) {\n            const exportNode = specifiers[specIdx];\n            if (exportNode.type == 'ExportSpecifier') {\n              if (exportNode.exported.type == 'Identifier' && exportNode.exported.name === name) {\n                return true;\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  return false;\n}\n\nfunction getProgramBody(variableDeclarator) {\n  let program: Rule.Node = variableDeclarator;\n  while (program.type !== 'Program') {\n    program = program.parent;\n  }\n  const body = program.body;\n  return body;\n}\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/noAsyncPreventDefault.ts",
    "content": "import type { Rule } from 'eslint';\n\nexport const noAsyncPreventDefault: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description: 'Detect preventDefault in $(()=>{}) Async Functions.',\n      recommended: true,\n      url: 'https://qwik.dev/docs/components/events/#preventdefault--stoppropagation',\n    },\n    messages: {\n      noAsyncPreventDefault:\n        'This is an asynchronous function and does not support preventDefault. \\nUse preventDefault attributes instead',\n    },\n  },\n  create(context) {\n    return {\n      \"CallExpression[callee.property.name='preventDefault']\"(node) {\n        let parent = node.parent;\n        while (parent) {\n          if (\n            parent.type === 'CallExpression' &&\n            parent.callee &&\n            parent.callee.type === 'Identifier' &&\n            parent.callee.name === '$'\n          ) {\n            context.report({\n              node,\n              messageId: 'noAsyncPreventDefault',\n            });\n            break;\n          }\n          parent = parent.parent;\n        }\n      },\n    };\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/noReactProps.ts",
    "content": "import type { TSESLint } from '@typescript-eslint/utils';\nimport jsxAstUtils from 'jsx-ast-utils';\nimport { QwikEslintExamples } from '../examples';\n\nconst reactSpecificProps = [\n  { from: 'className', to: 'class' },\n  { from: 'htmlFor', to: 'for' },\n];\n\nconst domElementRegex = /^[a-z]/;\nexport const isDOMElementName = (name: string): boolean => domElementRegex.test(name);\n\nexport const noReactProps = {\n  meta: {\n    type: 'problem',\n    docs: {\n      recommended: 'warn',\n      description: 'Disallow usage of React-specific `className`/`htmlFor` props.',\n      url: 'https://qwik.dev/docs/advanced/eslint/#no-react-props',\n    },\n    fixable: 'code',\n    schema: [],\n    messages: {\n      prefer: 'Prefer the `{{ to }}` prop over the deprecated `{{ from }}` prop.',\n    },\n  },\n  create(context) {\n    const modifyJsxSource = context.sourceCode\n      .getAllComments()\n      .some((c) => c.value.includes('@jsxImportSource'));\n    if (modifyJsxSource) {\n      return {};\n    }\n    return {\n      JSXOpeningElement(node) {\n        for (const { from, to } of reactSpecificProps) {\n          const classNameAttribute = jsxAstUtils.getProp(node.attributes, from);\n          if (classNameAttribute) {\n            // only auto-fix if there is no class prop defined\n            const fix = !jsxAstUtils.hasProp(node.attributes, to, { ignoreCase: false })\n              ? (fixer: TSESLint.RuleFixer) => fixer.replaceText(classNameAttribute.name, to)\n              : undefined;\n\n            context.report({\n              node: classNameAttribute,\n              messageId: 'prefer',\n              data: { from, to },\n              fix,\n            });\n          }\n        }\n      },\n    };\n  },\n};\n\nconst preferGood = `\n<MyReactComponent class=\"foo\" for=\"#password\" />;`.trim();\n\nconst preferBad = `\n<MyReactComponent className=\"foo\" htmlFor=\"#password\" />;`.trim();\n\nexport const noReactPropsExamples: QwikEslintExamples = {\n  prefer: {\n    good: [\n      {\n        codeHighlight: '/class/#a /for/#b',\n        code: preferGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '/className/#a /htmlFor/#b',\n        code: preferBad,\n        description: 'Prefer `class` and `for` props over `className` and `htmlFor`.',\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/noUseVisibleTask.ts",
    "content": "import type { Rule } from 'eslint';\n\nexport const noUseVisibleTask: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description: 'Detect useVisibleTask$() functions.',\n      recommended: true,\n      url: 'https://qwik.dev/docs/guides/best-practices/#use-usevisibletask-as-a-last-resort',\n    },\n    messages: {\n      noUseVisibleTask: `useVisibleTask$() runs eagerly and blocks the main thread, preventing user interaction until the task is finished. Consider using useTask$(), useOn(), useOnDocument(), or useOnWindow() instead. If you have to use a useVisibleTask$(), you can disable the warning with a '// eslint-disable-next-line qwik/no-use-visible-task' comment.`,\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node) {\n        if (node.callee.type !== 'Identifier') {\n          return;\n        }\n        const fnName = node.callee.name;\n        if (fnName === 'useVisibleTask$') {\n          context.report({\n            node: node.callee,\n            messageId: 'noUseVisibleTask',\n          });\n        }\n      },\n    };\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/preferClasslist.ts",
    "content": "// From: https://github.com/solidjs-community/eslint-plugin-solid/blob/d8bf1d13889fbc5fa3e644bc3f932696c78cef9d/src/rules/prefer-classlist.ts\n\nimport type { TSESTree as T } from '@typescript-eslint/utils';\nimport jsxAstUtils from 'jsx-ast-utils';\nimport { QwikEslintExamples } from '../examples';\n\nexport const preferClasslist = {\n  meta: {\n    type: 'problem',\n    docs: {\n      recommended: false,\n      description:\n        'Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.',\n      url: 'https://qwik.dev/docs/advanced/eslint/#prefer-classlist',\n    },\n    fixable: 'code',\n    schema: [\n      {\n        type: 'object',\n        properties: {\n          classnames: {\n            type: 'array',\n\n            description: 'An array of names to treat as `classnames` functions',\n            default: ['cn', 'clsx', 'classnames'],\n            items: {\n              type: 'string',\n              minItems: 1,\n              uniqueItems: true,\n            },\n          },\n        },\n        additionalProperties: false,\n      },\n    ],\n    messages: {\n      preferClasslist:\n        'The classlist prop should be used instead of {{ classnames }} to efficiently set classes based on an object.',\n    },\n  },\n  create(context) {\n    const modifyJsxSource = context.sourceCode\n      .getAllComments()\n      .some((c) => c.value.includes('@jsxImportSource'));\n    if (modifyJsxSource) {\n      return {};\n    }\n    const classnames = context.options[0]?.classnames ?? ['cn', 'clsx', 'classnames'];\n    return {\n      JSXAttribute(node) {\n        if (\n          ['class', 'className'].indexOf(jsxAstUtils.propName(node)) === -1 ||\n          jsxAstUtils.hasProp(\n            (node.parent as T.JSXOpeningElement | undefined)?.attributes,\n            'classlist',\n            {\n              ignoreCase: false,\n            }\n          )\n        ) {\n          return;\n        }\n        if (node.value?.type === 'JSXExpressionContainer') {\n          const expr = node.value.expression;\n          if (\n            expr.type === 'CallExpression' &&\n            expr.callee.type === 'Identifier' &&\n            classnames.indexOf(expr.callee.name) !== -1 &&\n            expr.arguments.length === 1 &&\n            expr.arguments[0].type === 'ObjectExpression'\n          ) {\n            context.report({\n              node,\n              messageId: 'preferClasslist',\n              data: {\n                classnames: expr.callee.name,\n              },\n              fix: (fixer) => {\n                const attrRange = node.range;\n                const objectRange = expr.arguments[0].range;\n                return [\n                  fixer.replaceTextRange([attrRange[0], objectRange[0]], 'classlist={'),\n                  fixer.replaceTextRange([objectRange[1], attrRange[1]], '}'),\n                ];\n              },\n            });\n          }\n        }\n      },\n    };\n  },\n};\n\nconst preferClasslistGood = `\nimport { component$ } from '@builder.io/qwik';\nimport styles from './MyComponent.module.css';\n \nexport default component$((props) => {\n  // Array syntax example\n  return <div class={[\n    styles.container, \n    'p-8', \n    props.isHighAttention ? 'text-green-500' : 'text-slate-500',\n    { active: true}\n  ]}>Hello world</div>;\n \n  // Object syntax example\n  return <div class={{  \n    'text-green-500': props.isHighAttention,\n    'p-4': true\n  }}>Hello world</div>;\n});`.trim();\n\nconst preferClasslistBad = `\nimport { component$ } from '@builder.io/qwik';\nimport classnames from 'classnames';\nimport styles from './MyComponent.module.css';\n \nexport default component$((props) => {\n  return <div class={classnames(\n    styles.container, \n    'p-8', \n    {\n      'text-green-500' : props.isHighAttention,\n      'text-slate-500' : !props.isHighAttention,\n    },\n    { active: true}\n  )}>Hello world</div>;\n});`.trim();\n\nexport const preferClasslistExamples: QwikEslintExamples = {\n  preferClasslist: {\n    good: [\n      {\n        codeHighlight: '{7-10,15,16} /class/#a',\n        code: preferClasslistGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{2,7-13} /classnames/#a',\n        code: preferClasslistBad,\n        description:\n          'The class prop should be used instead of any 3rd party lib to efficiently set classes based on an object.',\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/unusedServer.ts",
    "content": "import type { Rule } from 'eslint';\nimport { QwikEslintExamples } from '../examples';\n\nexport const unusedServer: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description: 'Detect unused server$() functions.',\n      recommended: true,\n      url: 'https://qwik.dev/docs/advanced/eslint/#unused-server',\n    },\n    messages: {\n      unusedServer:\n        'Unused server$(). Seems like you are declaring a new server$ function, but you are never calling it. You might want to do:\\n\\n{{ suggestion }}',\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node) {\n        if (node.callee.type !== 'Identifier') {\n          return;\n        }\n        const fnName = node.callee.name;\n        if (fnName === 'server$') {\n          let unused = false;\n          if (node.parent.type === 'ExpressionStatement') {\n            unused = true;\n          } else if (node.parent.type === 'AwaitExpression') {\n            if (node.parent.parent.type === 'ExpressionStatement') {\n              unused = true;\n            }\n          }\n          if (unused) {\n            const suggestion = `const serverFn = server$(...);\\nawait serverFn(...);`;\n            context.report({\n              node: node.callee,\n              messageId: 'unusedServer',\n              data: { suggestion },\n            });\n          }\n        }\n      },\n    };\n  },\n};\n\nconst unusedServerGood = `\nimport { component$ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\n \nconst serverGreeter = server$((firstName: string, lastName: string) => {\n  const greeting = \\`Hello \\${firstName} \\${lastName}\\`;\n  return greeting;\n});\n \nexport default component$(() => (\n    <button\n      onClick$={async () => {\n        const greeting = await serverGreeter('John', 'Doe');\n        alert(greeting);\n      }}\n    >\n      greet\n    </button>\n  );\n);`.trim();\n\nconst unusedServerBad = `\nimport { component$ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\n \nconst serverGreeter = server$((firstName: string, lastName: string) => {\n  const greeting = \\`Hello \\${firstName} \\${lastName}\\`;\n  return greeting;\n});\n \nexport default component$(() => (\n    <button\n      onClick$={async () => {\n        const greeting = 'not using the server$ function';\n        alert(greeting);\n      }}\n    >\n      greet\n    </button>\n  );\n);`.trim();\n\nexport const unusedServerExamples: QwikEslintExamples = {\n  unusedServer: {\n    good: [\n      {\n        codeHighlight: '{4,12} /serverGreeter/#a',\n        code: unusedServerGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{4,12} /serverGreeter/#a',\n        code: unusedServerBad,\n        description: 'A `server$` function is declared, but never used.',\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/useMethodUsage.ts",
    "content": "import type { Rule } from 'eslint';\nimport type { CallExpression } from 'estree';\nimport type { QwikEslintExamples } from '../examples';\n\nexport const useMethodUsage: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description: 'Detect invalid use of use hooks.',\n      category: 'Variables',\n      recommended: true,\n      url: 'https://qwik.dev/docs/advanced/eslint/#use-method-usage',\n    },\n    messages: {\n      useWrongFunction: 'Calling use* methods in wrong function.',\n    },\n  },\n  create(context) {\n    const sourceCode = context.sourceCode ?? context.getSourceCode();\n    const modifyJsxSource = sourceCode\n      .getAllComments()\n      .some((c) => c.value.includes('@jsxImportSource'));\n    if (modifyJsxSource) {\n      return {};\n    }\n    return {\n      'CallExpression[callee.name=/^use[A-Z]/]'(node: CallExpression & Rule.NodeParentExtension) {\n        let parent = node as Rule.Node;\n        while ((parent = parent.parent)) {\n          const type = parent.type;\n          switch (type) {\n            case 'VariableDeclarator':\n            case 'VariableDeclaration':\n            case 'ExpressionStatement':\n            case 'MemberExpression':\n            case 'BinaryExpression':\n            case 'UnaryExpression':\n            case 'ReturnStatement':\n            case 'BlockStatement':\n            case 'ChainExpression':\n            case 'Property':\n            case 'ObjectExpression':\n            case 'CallExpression':\n            case 'TSAsExpression':\n              break;\n            case 'ArrowFunctionExpression':\n            case 'FunctionExpression':\n              if (parent.parent.type === 'VariableDeclarator') {\n                if (\n                  parent.parent.id?.type === 'Identifier' &&\n                  parent.parent.id.name.startsWith('use')\n                ) {\n                  return;\n                }\n              }\n              if (parent.parent.type === 'CallExpression') {\n                if (\n                  parent.parent.callee.type === 'Identifier' &&\n                  parent.parent.callee.name === 'component$'\n                ) {\n                  return;\n                }\n              }\n              context.report({\n                node,\n                messageId: 'useWrongFunction',\n              });\n              return;\n            case 'FunctionDeclaration':\n              if (!parent.id?.name.startsWith('use')) {\n                context.report({\n                  node,\n                  messageId: 'useWrongFunction',\n                });\n              }\n              return;\n            default:\n              context.report({\n                node,\n                messageId: 'useWrongFunction',\n              });\n              return;\n            // ERROR\n          }\n        }\n      },\n    };\n  },\n};\n\nconst useWrongFunctionGood = `\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n});\n`.trim();\n\nconst useWrongFunctionGood2 = `\nexport const useCounter = () => {\n  const count = useSignal(0);\n  return count;\n};\n`.trim();\n\nconst useWrongFunctionBad = `\nexport const Counter = (() => {\n  const count = useSignal(0);\n});\n`.trim();\n\nexport const useMethodUsageExamples: QwikEslintExamples = {\n  useWrongFunction: {\n    good: [\n      {\n        codeHighlight: '{2} /component$/#a',\n        code: useWrongFunctionGood,\n      },\n      {\n        codeHighlight: '{2} /component$/#a',\n        code: useWrongFunctionGood2,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{2} /component$/#a',\n        code: useWrongFunctionBad,\n        description:\n          '`use*` methods can only be used in `component$` functions or inside `use*` hooks (e.g. `useCounter`).',\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/src/validLexicalScope.ts",
    "content": "import * as ESLintUtils from '@typescript-eslint/utils/eslint-utils';\nimport ts from 'typescript';\nimport type { Identifier } from 'estree';\nimport redent from 'redent';\nimport type { RuleContext, Scope } from '@typescript-eslint/utils/dist/ts-eslint';\nimport { QwikEslintExamples } from '../examples';\n\nconst createRule = ESLintUtils.RuleCreator(\n  (name) => `https://qwik.dev/docs/advanced/eslint/#${name}`\n);\n\ninterface DetectorOptions {\n  allowAny: boolean;\n}\nexport const validLexicalScope = createRule({\n  name: 'valid-lexical-scope',\n  defaultOptions: [\n    {\n      allowAny: true,\n    },\n  ],\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Used the tsc typechecker to detect the capture of unserializable data in dollar ($) scopes.',\n      recommended: 'recommended',\n    },\n\n    schema: [\n      {\n        type: 'object',\n        properties: {\n          allowAny: {\n            type: 'boolean',\n          },\n        },\n        additionalProperties: false,\n        default: {\n          allowAny: true,\n        },\n      },\n    ],\n\n    messages: {\n      referencesOutside:\n        'When referencing \"{{varName}}\" inside a different scope ({{dollarName}}), Qwik needs to serialize the value, however {{reason}}.\\nCheck out https://qwik.dev/docs/advanced/dollar/ for more details.',\n      invalidJsxDollar:\n        'Using \"{{varName}}\" as an event handler, however functions are not serializable.\\nDid you mean to wrap it in `$()`?\\n\\n{{solution}}\\nCheck out https://qwik.dev/docs/advanced/dollar/ for more details.',\n      mutableIdentifier:\n        'Mutating let \"{{varName}}\" within the ({{dollarName}}) closure is not allowed, instead create an object/store/signal and mutate one of its properties.\\nCheck out https://qwik.dev/docs/advanced/dollar/ for more details.',\n    },\n  },\n  create(context) {\n    const allowAny = context.options[0]?.allowAny ?? true;\n    const opts: DetectorOptions = {\n      allowAny,\n    };\n    const scopeManager = context.sourceCode.scopeManager!;\n    const services = ESLintUtils.getParserServices(context);\n    const esTreeNodeToTSNodeMap = services.esTreeNodeToTSNodeMap;\n    const typeChecker = services.program.getTypeChecker();\n    const relevantScopes: Map<any, string> = new Map();\n    let exports: ts.Symbol[] = [];\n\n    function walkScope(scope: Scope.Scope) {\n      scope.references.forEach((ref) => {\n        const declaredVariable = ref.resolved;\n        const declaredScope = ref.resolved?.scope as Scope.Scope;\n        if (declaredVariable && declaredScope) {\n          const variableType = declaredVariable.defs.at(0)?.type;\n          if (variableType === 'Type') {\n            return;\n          }\n          if (variableType === 'ImportBinding') {\n            return;\n          }\n\n          if (isQwikHook(declaredVariable, context)) {\n            return;\n          }\n\n          let dollarScope: Scope.Scope | null = ref.from;\n          let dollarIdentifier: string | undefined;\n          while (dollarScope) {\n            dollarIdentifier = relevantScopes.get(dollarScope);\n            if (dollarIdentifier) {\n              break;\n            }\n            dollarScope = dollarScope.upper;\n          }\n          if (dollarScope && dollarIdentifier) {\n            // Variable used inside $\n            const scopeType = declaredScope.type;\n            if (scopeType === 'global') {\n              return;\n            }\n            if (scopeType === 'module') {\n              return;\n            }\n            const identifier = ref.identifier;\n            const tsNode = esTreeNodeToTSNodeMap.get(identifier);\n            let ownerDeclared: Scope.Scope | null = declaredScope;\n            while (ownerDeclared) {\n              if (relevantScopes.has(ownerDeclared)) {\n                break;\n              }\n              ownerDeclared = ownerDeclared.upper;\n            }\n\n            if (ownerDeclared !== dollarScope) {\n              if (identifier.parent && identifier.parent.type === 'AssignmentExpression') {\n                if (identifier.parent.left === identifier) {\n                  context.report({\n                    messageId: 'mutableIdentifier',\n                    node: ref.identifier,\n                    data: {\n                      varName: ref.identifier.name,\n                      dollarName: dollarIdentifier,\n                    },\n                  });\n                }\n              }\n\n              const reason = canCapture(context, typeChecker, tsNode, ref.identifier, opts);\n              if (reason) {\n                context.report({\n                  messageId: 'referencesOutside',\n                  node: ref.identifier,\n                  data: {\n                    varName: ref.identifier.name,\n                    dollarName: dollarIdentifier,\n                    reason: humanizeTypeReason(reason),\n                  },\n                });\n              }\n            }\n          }\n        }\n      });\n      scope.childScopes.forEach(walkScope);\n    }\n\n    return {\n      CallExpression(node) {\n        if (node.callee.type === 'Identifier') {\n          if (node.callee.name.endsWith('$')) {\n            const firstArg = node.arguments.at(0);\n            if (firstArg && firstArg.type === 'ArrowFunctionExpression') {\n              const scope = scopeManager.acquire(firstArg);\n              if (scope) {\n                relevantScopes.set(scope, node.callee.name);\n              }\n            }\n          }\n        }\n      },\n      JSXAttribute(node) {\n        const jsxName = node.name;\n        const name = jsxName.type === 'JSXIdentifier' ? jsxName.name : jsxName.name.name;\n\n        if (name.endsWith('$')) {\n          const firstArg = node.value;\n          if (firstArg && firstArg.type === 'JSXExpressionContainer') {\n            const scope = scopeManager.acquire(firstArg.expression);\n            if (scope) {\n              relevantScopes.set(scope, name);\n            } else if (firstArg.expression.type === 'Identifier') {\n              const tsNode = esTreeNodeToTSNodeMap.get(firstArg.expression);\n              const type = typeChecker.getTypeAtLocation(tsNode).getNonNullableType();\n\n              if (!isTypeQRL(type)) {\n                if (type.isUnionOrIntersection()) {\n                  if (\n                    !type.types.every((t) => {\n                      if (t.symbol) {\n                        return t.symbol.name === 'Component' || t.symbol.name === 'PropFnInterface';\n                      }\n                      return false;\n                    })\n                  ) {\n                    context.report({\n                      messageId: 'invalidJsxDollar',\n                      node: firstArg.expression,\n                      data: {\n                        varName: firstArg.expression.name,\n                        solution: `Fix the type of ${firstArg.expression.name} to be QRL`,\n                      },\n                    });\n                  }\n                } else {\n                  const symbolName = type.symbol?.name;\n                  if (symbolName === 'PropFnInterface') {\n                    return;\n                  }\n                  context.report({\n                    messageId: 'invalidJsxDollar',\n                    node: firstArg.expression,\n                    data: {\n                      varName: firstArg.expression.name,\n                      solution: `const ${firstArg.expression.name} = $(\\n${getContent(\n                        type.symbol,\n                        context.sourceCode.text\n                      )}\\n);\\n`,\n                    },\n                  });\n                }\n              }\n            }\n          }\n        }\n      },\n      Program(node) {\n        const module = esTreeNodeToTSNodeMap.get(node);\n        const moduleSymbol = typeChecker.getSymbolAtLocation(module);\n\n        /**\n         * Despite what the type signature says, {@link typeChecker.getSymbolAtLocation} can return\n         * undefined for empty modules. This happens, for example, when creating a brand new file.\n         */\n        if (moduleSymbol) {\n          exports = typeChecker.getExportsOfModule(moduleSymbol);\n        }\n      },\n      'Program:exit'() {\n        walkScope(scopeManager.globalScope! as any);\n      },\n    };\n  },\n});\n\nfunction canCapture(\n  context: RuleContext<any, any>,\n  checker: ts.TypeChecker,\n  node: ts.Node,\n  ident: Identifier,\n  opts: DetectorOptions\n) {\n  const type = checker.getTypeAtLocation(node);\n  const seen = new Set<any>();\n  return isTypeCapturable(context, checker, type, node, ident, opts, seen);\n}\n\ninterface TypeReason {\n  type: ts.Type;\n  typeStr: string;\n  location?: string;\n  reason: string;\n}\n\nfunction humanizeTypeReason(reason: TypeReason) {\n  let message = '';\n  if (reason.location) {\n    message += `\"${reason.location}\" `;\n  } else {\n    message += 'it ';\n  }\n  message += `${reason.reason}`;\n  return message;\n}\n\nfunction isTypeCapturable(\n  context: RuleContext<any, any>,\n  checker: ts.TypeChecker,\n  type: ts.Type,\n  tsnode: ts.Node,\n  ident: Identifier,\n  opts: DetectorOptions,\n  seen: Set<any>\n): TypeReason | undefined {\n  const result = _isTypeCapturable(context, checker, type, tsnode, opts, 0, seen);\n  if (result) {\n    const loc = result.location;\n    if (loc) {\n      result.location = `${ident.name}.${loc}`;\n    }\n    return result;\n  }\n  return result;\n}\nfunction _isTypeCapturable(\n  context: RuleContext<any, any>,\n  checker: ts.TypeChecker,\n  type: ts.Type,\n  node: ts.Node,\n  opts: DetectorOptions,\n  level: number,\n  seen: Set<any>\n): TypeReason | undefined {\n  // NoSerialize is ok\n  if (seen.has(type)) {\n    return;\n  }\n  seen.add(type);\n  if (type.getProperty('__no_serialize__') || type.getProperty('__qwik_serializable__')) {\n    return;\n  }\n  const isUnknown = type.flags & ts.TypeFlags.Unknown;\n  if (isUnknown) {\n    return {\n      type,\n      typeStr: checker.typeToString(type),\n      reason: 'is unknown, which could be serializable or not, please make the type more specific',\n    };\n  }\n  const isAny = type.flags & ts.TypeFlags.Any;\n  if (!opts.allowAny && isAny) {\n    return {\n      type,\n      typeStr: checker.typeToString(type),\n      reason: 'is any, which is not serializable',\n    };\n  }\n  const isSymbol = type.flags & ts.TypeFlags.ESSymbolLike;\n  if (isSymbol) {\n    return {\n      type,\n      typeStr: checker.typeToString(type),\n      reason: 'is Symbol, which is not serializable',\n    };\n  }\n  const isEnum = type.flags & ts.TypeFlags.Enum;\n  if (isEnum) {\n    return {\n      type,\n      typeStr: checker.typeToString(type),\n      reason: 'is an enum, use an string or a number instead',\n    };\n  }\n  if (isTypeQRL(type)) {\n    return;\n  }\n  if (type.symbol?.name === 'JSXNode') {\n    return;\n  }\n\n  const canBeCalled = type.getCallSignatures().length > 0;\n  if (canBeCalled) {\n    const symbolName = type.symbol.name;\n    if (\n      symbolName === 'PropFnInterface' ||\n      symbolName === 'RefFnInterface' ||\n      symbolName === 'bivarianceHack' ||\n      symbolName === 'FunctionComponent'\n    ) {\n      return;\n    }\n    let reason = 'is a function, which is not serializable';\n    if (level === 0 && ts.isIdentifier(node)) {\n      const solution = `const ${node.text} = $(\\n${getContent(\n        type.symbol,\n        context.sourceCode.text\n      )}\\n);`;\n      reason += `.\\nDid you mean to wrap it in \\`$()\\`?\\n\\n${solution}\\n`;\n    }\n\n    return {\n      type,\n      typeStr: checker.typeToString(type),\n      reason,\n    };\n  }\n\n  if (type.isUnion()) {\n    for (const subType of type.types) {\n      const result = _isTypeCapturable(context, checker, subType, node, opts, level + 1, seen);\n      if (result) {\n        return result;\n      }\n    }\n    return;\n  }\n  const isObject = (type.flags & ts.TypeFlags.Object) !== 0;\n  if (isObject) {\n    const arrayType = getElementTypeOfArrayType(type, checker);\n    if (arrayType) {\n      return _isTypeCapturable(context, checker, arrayType, node, opts, level + 1, seen);\n    }\n\n    const tupleTypes = getTypesOfTupleType(type, checker);\n    if (tupleTypes) {\n      for (const subType of tupleTypes) {\n        const result = _isTypeCapturable(context, checker, subType, node, opts, level + 1, seen);\n        if (result) {\n          return result;\n        }\n      }\n      return;\n    }\n\n    const symbolName = type.symbol.name;\n\n    // Element is ok\n    if (type.getProperty('nextElementSibling')) {\n      return;\n    }\n    // Document is ok\n    if (type.getProperty('activeElement')) {\n      return;\n    }\n    if (symbolName in ALLOWED_CLASSES) {\n      return;\n    }\n    if (type.isClass()) {\n      return {\n        type,\n        typeStr: checker.typeToString(type),\n        reason: `is an instance of the \"${type.symbol.name}\" class, which is not serializable. Use a simple object literal instead`,\n      };\n    }\n\n    const prototype = type.getProperty('prototype');\n    if (prototype) {\n      const type = checker.getTypeOfSymbolAtLocation(prototype, node);\n      if (type.isClass()) {\n        return {\n          type,\n          typeStr: checker.typeToString(type),\n          reason: 'is a class constructor, which is not serializable',\n        };\n      }\n    }\n\n    if (!symbolName.startsWith('__') && type.symbol.valueDeclaration) {\n      return {\n        type,\n        typeStr: checker.typeToString(type),\n        reason: `is an instance of the \"${type.symbol.name}\" class, which is not serializable`,\n      };\n    }\n\n    for (const symbol of type.getProperties()) {\n      const result = isSymbolCapturable(context, checker, symbol, node, opts, level + 1, seen);\n      if (result) {\n        const loc = result.location;\n        result.location = `${symbol.name}${loc ? `.${loc}` : ''}`;\n        return result;\n      }\n    }\n  }\n  return;\n}\n\nfunction isSymbolCapturable(\n  context: RuleContext<any, any>,\n  checker: ts.TypeChecker,\n  symbol: ts.Symbol,\n  node: ts.Node,\n  opts: DetectorOptions,\n  level: number,\n  seen: Set<any>\n) {\n  const type = checker.getTypeOfSymbolAtLocation(symbol, node);\n  return _isTypeCapturable(context, checker, type, node, opts, level, seen);\n}\n\nfunction getElementTypeOfArrayType(type: ts.Type, checker: ts.TypeChecker): ts.Type | undefined {\n  return (checker as any).getElementTypeOfArrayType(type);\n}\n\nfunction getTypesOfTupleType(\n  type: ts.Type,\n  checker: ts.TypeChecker\n): readonly ts.Type[] | undefined {\n  return (checker as any).isTupleType(type)\n    ? checker.getTypeArguments(type as ts.TupleType)\n    : undefined;\n}\n\nfunction isTypeQRL(type: ts.Type): boolean {\n  return (\n    !!(type.flags & ts.TypeFlags.Any) || !!type.getNonNullableType().getProperty('__brand__QRL__')\n  );\n}\n\nfunction getContent(symbol: ts.Symbol, sourceCode: string) {\n  if (symbol && symbol.declarations && symbol.declarations.length > 0) {\n    const decl = symbol.declarations[0];\n    // Remove empty lines\n    const text = sourceCode.slice(decl.pos, decl.end).replace(/^\\s*$/gm, '');\n    return redent(text, 2);\n  }\n  return '';\n}\n\nfunction isQwikHook(variable, context) {\n  const def = variable.defs[0];\n  if (!def || def.type !== 'Variable') {\n    return false;\n  }\n\n  const init = def.node.init;\n  if (\n    init?.type === 'CallExpression' &&\n    init.callee.type === 'Identifier' &&\n    /^use[A-Z]/.test(init.callee.name)\n  ) {\n    const hookName = init.callee.name;\n    const scope = context.sourceCode.getScope(def.node);\n    const ref = scope.references.find((r) => r.identifier.name === hookName);\n\n    return ref?.resolved && isFromQwikModule(ref.resolved, context);\n  }\n  return false;\n}\n\nfunction isFromQwikModule(resolvedVar) {\n  return resolvedVar.defs.some((def) => {\n    if (def.type !== 'ImportBinding') {\n      return false;\n    }\n    const importSource = def.parent.source.value;\n\n    return (\n      importSource.startsWith('@builder.io/qwik') ||\n      importSource.startsWith('@builder.io/qwik-city')\n    );\n  });\n}\n\nconst ALLOWED_CLASSES = {\n  Promise: true,\n  URL: true,\n  RegExp: true,\n  Date: true,\n  FormData: true,\n  URLSearchParams: true,\n  Error: true,\n  Set: true,\n  Map: true,\n  Uint8Array: true,\n};\n\nconst referencesOutsideGood = `\nimport { component$, useTask$, $ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const print = $((msg: string) => {\n    console.log(msg);\n  });\n\n  useTask$(() => {\n    print(\"Hello World\");\n  });\n\n  return <h1>Hello</h1>;\n});`.trim();\n\nconst referencesOutsideBad = `\nimport { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const print = (msg: string) => {\n    console.log(msg);\n  };\n\n  useTask$(() => {\n    print(\"Hello World\");\n  });\n\n  return <h1>Hello</h1>;\n});`.trim();\n\nconst invalidJsxDollarGood = `\nimport { component$, $ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const click = $(() => console.log());\n  return (\n    <button onClick$={click}>log it</button>\n  );\n});`.trim();\n\nconst invalidJsxDollarBad = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const click = () => console.log();\n  return (\n    <button onClick$={click}>log it</button>\n  );\n});`.trim();\n\nconst mutableIdentifierGood = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const person = { name: 'Bob' };\n\n  return (\n    <button onClick$={() => {\n      person.name = 'Alice';\n    }}>\n      {person.name}\n    </button>\n  );\n});`.trim();\n\nconst mutableIdentifierBad = `\nimport { component$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  let personName = 'Bob';\n\n  return (\n    <button onClick$={() => {\n      personName = 'Alice';\n    }}>\n      {personName}\n    </button>\n  );\n});`.trim();\n\nexport const validLexicalScopeExamples: QwikEslintExamples = {\n  referencesOutside: {\n    good: [\n      {\n        codeHighlight: `{1,4} /print/#a /$((msg: string)/#b)`,\n        code: referencesOutsideGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: `{1,4} /print/#a /(msg: string)/#b)`,\n        code: referencesOutsideBad,\n        description:\n          'Since Expressions are not serializable, they must be wrapped with `$( ... )` so that the optimizer can split the code into small chunks.',\n      },\n    ],\n  },\n  invalidJsxDollar: {\n    good: [\n      {\n        codeHighlight: '{1} /click/#a',\n        code: invalidJsxDollarGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{1} /click/#a',\n        code: invalidJsxDollarBad,\n        description: 'Event handler must be wrapped with `${ ... }`.',\n      },\n    ],\n  },\n  mutableIdentifier: {\n    good: [\n      {\n        codeHighlight: '{4} /person/#a',\n        code: mutableIdentifierGood,\n      },\n    ],\n    bad: [\n      {\n        codeHighlight: '{4} /personName/#a',\n        code: mutableIdentifierBad,\n        description:\n          'Simple values are not allowed to be mutated. Use an Object instead and edit one of its property.',\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/loader-location/invalid-loader-missing-export/src/routes/index.tsx",
    "content": "// Expect error: { \"messageId\": \"missingExport\" }\n\nimport { routeLoader$ } from '@builder.io/qwik-city';\n\nconst useFormLoader = routeLoader$(() => {\n  return null;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/loader-location/valid-loader/src/routes/index.tsx",
    "content": "import { routeLoader$ } from '@builder.io/qwik-city';\n\nexport const useProductDetails = routeLoader$(async (requestEvent) => {\n  const res = await fetch(`https://.../products/\\${requestEvent.params.productId}`);\n  const product = await res.json();\n  return product as {};\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/loader-location/valid-loader-export/src/routes/index.tsx",
    "content": "import { routeLoader$ } from '@builder.io/qwik-city';\nexport { useFormLoader };\nconst useFormLoader = routeLoader$(() => {\n  return null;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/no-async-prevent-default/invalid-prevent-default-arrow.tsx",
    "content": "// Expect error: { \"messageId\": \"noAsyncPreventDefault\" }\nimport { $ } from '@builder.io/qwik';\n\nexport const InvalidPreventDefaultArrow = () => {\n  const handleSubmit = $((event: SubmitEvent) => {\n    event.preventDefault();\n  });\n  return (\n    <form onSubmit$={handleSubmit}>\n      <button type=\"submit\">Hello World</button>\n    </form>\n  );\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/no-async-prevent-default/invalid-prevent-default.tsx",
    "content": "// Expect error: { \"messageId\": \"noAsyncPreventDefault\" }\nimport { $ } from '@builder.io/qwik';\n\nexport const NoAsyncPreventDefault = () => {\n  return (\n    <form\n      onSubmit$={$((event: SubmitEvent) => {\n        event.preventDefault();\n      })}\n    >\n      <button type=\"submit\">Hello World</button>\n    </form>\n  );\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/no-async-prevent-default/valid-prevent-default-arrow.tsx",
    "content": "import { sync$ } from '@builder.io/qwik';\n\nexport const ValidPreventDefaultTest = () => {\n  const handleSubmit = sync$((event: SubmitEvent) => {\n    event.preventDefault();\n  });\n  return (\n    <form onSubmit$={handleSubmit}>\n      <button type=\"submit\">Hello World</button>\n    </form>\n  );\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/no-async-prevent-default/valid-prevent-default.tsx",
    "content": "import { sync$ } from '@builder.io/qwik';\n\nexport const ValidPreventDefaultTest = () => {\n  return (\n    <form\n      onSubmit$={sync$((event: SubmitEvent) => {\n        event.preventDefault();\n      })}\n    >\n      <button type=\"submit\">Hello World</button>\n    </form>\n  );\n};\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/no-use-visible-task/invalid-no-comment.tsx",
    "content": "// Expect error: { \"messageId\": \"noUseVisibleTask\" }\n\nimport { component$, useVisibleTask$ } from '@builder.io/qwik';\nexport default component$(() => {\n  useVisibleTask$(() => {});\n  return <></>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"incremental\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2020\",\n    \"lib\": [\"es2020\", \"DOM\"],\n    \"resolveJsonModule\": true,\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"declaration\": true,\n    \"isolatedModules\": true,\n    \"strict\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"baseUrl\": \".\",\n    \"noUnusedLocals\": false,\n    \"esModuleInterop\": true,\n    \"sourceRoot\": \".\",\n    \"inlineSourceMap\": true,\n    \"inlineSources\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"noEmit\": true\n  },\n  \"include\": [\"**/*.tsx\", \"**/*.ts\"]\n}\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/invalid-outside-arrow-fn-inline-value.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\n\nexport const noUseSession = () => useContext(ID).value;\n\n// Expect error: { \"messageId\": \"useWrongFunction\" }\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/invalid-outside-arrow-fn-inline.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\n\nexport const noUseSession = () => useContext(ID);\n\n// Expect error: { \"messageId\": \"useWrongFunction\" }\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/invalid-outside-arrow-fn-return-value.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\n\nexport const noUseSession = () => {\n  return useContext(ID).value;\n};\n\n// Expect error: { \"messageId\": \"useWrongFunction\" }\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/invalid-outside-arrow-fn-return.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\n\nexport const noUseSession = () => {\n  return useContext(ID);\n};\n\n// Expect error: { \"messageId\": \"useWrongFunction\" }\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/invalid-outside-arrow-fn.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\n\nexport const noUseSession = () => {\n  useContext(ID);\n};\n\n// Expect error: { \"messageId\": \"useWrongFunction\" }\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/invalid-outside-function.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\n\nexport function noUseSession() {\n  useContext(ID);\n}\n\n// Expect error: { \"messageId\": \"useWrongFunction\" }\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/valid-exported-use-methods.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\nexport function useSession1() {\n  useContext(ID);\n}\nexport function useSession2() {\n  return useContext(ID);\n}\nexport function useSession3() {\n  return useContext(ID).value;\n}\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/valid-exported-use-methonds-can-call-other-use-methods.ts",
    "content": "import { ContextId, useContext } from '@builder.io/qwik';\nexport const ID: ContextId<{ value: any }> = null!;\nexport const useSession1 = () => {\n  useContext(ID);\n};\n\nexport const useSession2 = () => {\n  return useContext(ID);\n};\n\nexport const useSession3 = () => useContext(ID);\n\nexport const useSession4 = () => useContext(ID).value;\n\nexport const useSession5 = () => useContext(ID).value + 10;\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/use-method-usage/valid-inside-component.tsx",
    "content": "import { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik';\n\nexport const InsideTask = component$(() => {\n  const mySig = useSignal(0);\n  useTask$(async function initTask() {\n    if (isServer) {\n      await fetch('/url');\n    }\n  });\n\n  useTask$(({ track }) => {\n    track(() => mySig.value);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-class.tsx",
    "content": "// Expect error: { \"messageId\": \"referencesOutside\" }\nimport { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  class Stuff {}\n  const stuff = new Stuff();\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(stuff);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-enum.tsx",
    "content": "// Expect error: { \"messageId\": \"referencesOutside\" }\nimport { component$, useTask$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  enum Color {\n    Red,\n    Blue,\n    Green,\n  }\n  const color = useSignal({ color: Color.Red });\n  useTask$(() => {\n    color.value.color = Color.Blue;\n  });\n  return <></>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function-event.tsx",
    "content": "// Expect error: { \"messageId\": \"invalidJsxDollar\" }\nimport { component$, useTask$ } from '@builder.io/qwik';\nexport const HelloWorld = component$(() => {\n  // eslint-disable-next-line no-console\n  const click = () => console.log();\n  return <button onClick$={click}></button>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function.tsx",
    "content": "// Expect error: { \"messageId\": \"referencesOutside\" }\nimport { component$, useTask$ } from '@builder.io/qwik';\nexport const HelloWorld = component$(() => {\n  function getValue() {\n    if (Math.random() < 0.5) {\n      return 'string';\n    } else {\n      return () => {\n        // eslint-disable-next-line no-console\n        console.log();\n      };\n    }\n  }\n  const a = getValue();\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(a);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-mutable-assignment.tsx",
    "content": "// Expect error: { \"messageId\": \"mutableIdentifier\" }\nimport { component$ } from '@builder.io/qwik';\nexport const HelloWorld = component$(() => {\n  let click: string = '';\n  return (\n    <button\n      onClick$={() => {\n        click = '';\n      }}\n    ></button>\n  );\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-symbol.tsx",
    "content": "// Expect error: { \"messageId\": \"referencesOutside\" }\nimport { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const a = Symbol();\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(a);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-mutable.tsx",
    "content": "// Expect error: { \"messageId\": \"mutableIdentifier\" }\nimport { component$, $, useSignal } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  let startX: number | undefined = 0;\n  const divRef = useSignal<{ offsetLeft: number }>();\n\n  const handleMouseDown = $((e: MouseEvent) => {\n    // eslint-disable-next-line no-console\n    console.log('working');\n    startX = e.pageX - divRef.value!.offsetLeft;\n  });\n  return <div onMouseDown$={handleMouseDown}></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-props-nonserializable-tuple.tsx",
    "content": "// Expect error: { \"messageId\": \"referencesOutside\" }\nimport { component$ } from '@builder.io/qwik';\nexport interface Props {\n  nonserializableTuple: [string, number, boolean, Function];\n}\n\nexport const HelloWorld = component$((props: Props) => {\n  return <button onClick$={() => props.nonserializableTuple}></button>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-factory.tsx",
    "content": "// Expect error: { \"messageId\": \"referencesOutside\" }\nimport { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const getMethod = () => {\n    return () => {};\n  };\n  const useMethod = getMethod();\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(useMethod);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-inline.tsx",
    "content": "// Expect error: { \"messageId\": \"referencesOutside\" }\nimport { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  function useMethod() {\n    // eslint-disable-next-line no-console\n    console.log('stuff');\n  }\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(useMethod);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-capture-jsxoutput.tsx",
    "content": "import { component$, useTask$, JSXOutput, useStore } from '@builder.io/qwik';\n\ntype FooState = {\n  foo?: JSXOutput;\n};\n\nexport default component$(() => {\n  const state = useStore<FooState>({});\n  state.foo = <div>Foo</div>;\n\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(state.foo);\n  });\n  return <></>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-capture-signal.tsx",
    "content": "import { component$, useTask$, useSignal } from '@builder.io/qwik';\nenum Color {\n  Red,\n  Blue,\n  Green,\n}\n\nexport default component$(() => {\n  const color = useSignal<{ color: Color }>({ color: Color.Red });\n\n  useTask$(() => {\n    color.value.color = Color.Blue;\n  });\n  return <></>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-component-prop-function.tsx",
    "content": "import { component$, type QRL } from '@builder.io/qwik';\n\nexport default component$<{ onClick$: QRL<() => void> }>(({ onClick$ }) => {\n  return (\n    <button\n      onClick$={() => {\n        onClick$();\n      }}\n    />\n  );\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-component-props-click.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(({ onClick }: any) => {\n  return <button onClick$={onClick}></button>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-component-props-tuple.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport interface Props {\n  serializableTuple: [string, number, boolean];\n}\n\nexport const HelloWorld = component$((props: Props) => {\n  return <button onClick$={() => props.serializableTuple}></button>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-component-props.tsx",
    "content": "import { type QRL, component$ } from '@builder.io/qwik';\n\nexport interface Props {\n  method$: QRL<() => void>;\n  method1$: QRL<() => void>;\n  method2$: QRL<() => void> | null;\n  method3$: any;\n}\n\nexport const HelloWorld = component$<Props>(({ method$, method1$, method2$, method3$ }) => {\n  return (\n    <div\n      onKeydown$={method$}\n      onKeydown1$={method1$}\n      onKeydown2$={method2$}\n      onClick$={async () => {\n        await method$();\n      }}\n    ></div>\n  );\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-constant.tsx",
    "content": "import { component$, useTask$ } from '@builder.io/qwik';\nexport const HelloWorld = component$(() => {\n  async function getValue() {\n    return 'ffg';\n  }\n  const a = getValue();\n  return (\n    <div\n      onClick$={() => {\n        // eslint-disable-next-line no-console\n        console.log(a);\n      }}\n    ></div>\n  );\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-file-scope.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport const version = '0.13';\n\nexport default component$(() => {\n  return {\n    version,\n  };\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-no-serialize.tsx",
    "content": "export type NoSerialize<T> = (T & { __no_serialize__: true }) | undefined;\nimport { useTask$, component$, noSerialize } from '@builder.io/qwik';\nexport interface Value {\n  value: number;\n  fn: NoSerialize<() => void>;\n}\nexport function getFn(): NoSerialize<() => void> {\n  return noSerialize(() => {});\n}\nexport const HelloWorld = component$(() => {\n  const state: Value = { value: 12, fn: getFn() };\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(state.value);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-null-value.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\ninterface Value {\n  value: 12;\n}\ntype NullValue = Value | null;\n\nfunction useMethod(foo: string, bar: () => string) {\n  return foo + bar();\n}\n\nexport const HelloWorld = component$(() => {\n  const bar = () => 'bar';\n  const foo = 'bar';\n  const a: Value = { value: 12 };\n  const b: NullValue = null;\n  useMethod(foo, bar);\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-ssr-stream.tsx",
    "content": "import { component$, SSRStream } from '@builder.io/qwik';\nimport { Readable } from 'stream';\n\nexport const RemoteApp = component$(() => {\n  return (\n    <>\n      <SSRStream>\n        {async (stream) => {\n          const res = await fetch('path');\n          const reader = res.body as any as Readable;\n          reader.setEncoding('utf8');\n\n          // Readable streams emit 'data' events once a listener is added.\n          reader.on('data', (chunk) => {\n            chunk = String(chunk).replace('q:base=\"/build/\"', '!');\n            stream.write(chunk);\n          });\n\n          return new Promise((resolve) => {\n            reader.on('end', () => resolve());\n          });\n        }}\n      </SSRStream>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-doc.tsx",
    "content": "import { component$, useComputed$ } from '@builder.io/qwik';\nimport { useDocumentHead } from '@builder.io/qwik-city';\nimport { useLocation as exampleTest } from '@builder.io/qwik-city';\nconst loc = exampleTest();\n\nexport default component$(() => {\n  const head = useDocumentHead();\n  const authorId = useComputed$(() => {\n    return head.meta; // <--- EESLint was not happy here, but now it is\n  });\n  return (\n    <>\n      {authorId.value}\n      <p>pathname: {loc.url.pathname}</p>\n      <p>skuId: {loc.params.skuId}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-method-factory.tsx",
    "content": "import { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const getMethod = () => {\n    return Promise.resolve();\n  };\n  const useMethod = getMethod();\n  const obj = {\n    stuff: 12,\n    b: false,\n    n: null,\n    date: new Date(),\n    url: new URL('http://localhost:8080/'),\n    regex: new RegExp('dfdf'),\n    u: undefined,\n    manu: 'string',\n    complex: {\n      s: true,\n    },\n  };\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(useMethod, obj);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task-getter.tsx",
    "content": "import { component$, useTask$ } from '@builder.io/qwik';\nexport const HelloWorld = component$(() => {\n  function getValue(): number | string | null | undefined | { prop: string } {\n    return (window as any).aaa;\n  }\n  const a = getValue();\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(a);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task.tsx",
    "content": "import { component$, useTask$ } from '@builder.io/qwik';\n\nexport const HelloWorld = component$(() => {\n  const getMethod = () => {\n    return 'value';\n  };\n  const useMethod = getMethod();\n  useTask$(() => {\n    // eslint-disable-next-line no-console\n    console.log(useMethod);\n  });\n  return <div></div>;\n});\n"
  },
  {
    "path": "packages/insights/.gitignore",
    "content": "# Build\n/dist\n/lib\n/lib-types\n/server\n\n# Development\nnode_modules\n*.local\n\n# Cache\n.cache\n.mf\n.rollup.cache\ntsconfig.tsbuildinfo\ntmp\nq-insights.json\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\n# Editor\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\n# Yarn\n.yarn/*\n!.yarn/releases\n\n# Netlify\n.netlify\n.env.local\n\n# Panda CSS\nsrc/styled-system\n"
  },
  {
    "path": "packages/insights/.node-version",
    "content": "18"
  },
  {
    "path": "packages/insights/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "packages/insights/.prettierignore",
    "content": "**/*.log\n**/.DS_Store\n*.\n.vscode/settings.json\n.history\n.yarn\n.netlify\nbazel-*\nbazel-bin\nbazel-out\nbazel-qwik\nbazel-testlogs\ndist\ndist-dev\nlib\nlib-types\netc\nexternal\nnode_modules\ntemp\ntsc-out\ntsdoc-metadata.json\ntarget\noutput\nrollup.config.js\nbuild\n.cache\n.vscode\n.rollup.cache\ndist\ntsconfig.tsbuildinfo\nvite.config.ts\n*.spec.tsx\n*.spec.ts\n.netlify\npnpm-lock.yaml\npackage-lock.json\nyarn.lock\nserver\ndrizzle\n**/*.gen.d.ts\n\n# Panda CSS\nsrc/styled-system\n"
  },
  {
    "path": "packages/insights/.vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\"dbaeumer.vscode-eslint\", \"unifiedjs.vscode-mdx\"],\n  \"unwantedRecommendations\": []\n}\n"
  },
  {
    "path": "packages/insights/.vscode/launch.json",
    "content": "{\n  // Use IntelliSense to learn about possible attributes.\n  // Hover to view descriptions of existing attributes.\n  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"name\": \"dev.debug\",\n      \"request\": \"launch\",\n      \"skipFiles\": [\"<node_internals>/**\"],\n      \"cwd\": \"${workspaceFolder}\",\n      \"program\": \"${workspaceFolder}/node_modules/vite/bin/vite.js\",\n      \"args\": [\"--mode\", \"ssr\", \"--force\"]\n    }\n  ]\n}\n"
  },
  {
    "path": "packages/insights/.vscode/qwik-city.code-snippets",
    "content": "{\n  \"onRequest\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qonRequest\",\n    \"description\": \"onRequest function for a route index\",\n    \"body\": [\"export const onRequest: RequestHandler = (request) => {\", \"  $0\", \"};\"],\n  },\n  \"loader$\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qloader$\",\n    \"description\": \"loader$()\",\n    \"body\": [\"export const $1 = routeLoader$(() => {\", \"  $0\", \"});\"],\n  },\n  \"action$\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qaction$\",\n    \"description\": \"action$()\",\n    \"body\": [\"export const $1 = routeAction$((data) => {\", \"  $0\", \"});\"],\n  },\n  \"Full Page\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qpage\",\n    \"description\": \"Simple page component\",\n    \"body\": [\n      \"import { component$ } from '@builder.io/qwik';\",\n      \"\",\n      \"export default component$(() => {\",\n      \"  $0\",\n      \"});\",\n    ],\n  },\n}\n"
  },
  {
    "path": "packages/insights/.vscode/qwik.code-snippets",
    "content": "{\n  \"Qwik component (simple)\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qcomponent$\",\n    \"description\": \"Simple Qwik component\",\n    \"body\": [\n      \"export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {\",\n      \"  return <${2:div}>$4</$2>\",\n      \"});\",\n    ],\n  },\n  \"Qwik component (props)\": {\n    \"scope\": \"typescriptreact\",\n    \"prefix\": \"qcomponent$ + props\",\n    \"description\": \"Qwik component w/ props\",\n    \"body\": [\n      \"export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {\",\n      \"  $2\",\n      \"}\",\n      \"\",\n      \"export const $1 = component$<$1Props>((props) => {\",\n      \"  const ${2:count} = useSignal(0);\",\n      \"  return (\",\n      \"    <${3:div} on${4:Click}$={(ev) => {$5}}>\",\n      \"      $6\",\n      \"    </${3}>\",\n      \"  );\",\n      \"});\",\n    ],\n  },\n  \"Qwik signal\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseSignal\",\n    \"description\": \"useSignal() declaration\",\n    \"body\": [\"const ${1:foo} = useSignal($2);\", \"$0\"],\n  },\n  \"Qwik store\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseStore\",\n    \"description\": \"useStore() declaration\",\n    \"body\": [\"const ${1:state} = useStore({\", \"  $2\", \"});\", \"$0\"],\n  },\n  \"$ hook\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q$\",\n    \"description\": \"$() function hook\",\n    \"body\": [\"$(() => {\", \"  $0\", \"});\", \"\"],\n  },\n  \"useVisibleTask\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseVisibleTask\",\n    \"description\": \"useVisibleTask$() function hook\",\n    \"body\": [\"useVisibleTask$(({ track }) => {\", \"  $0\", \"});\", \"\"],\n  },\n  \"useTask\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseTask$\",\n    \"description\": \"useTask$() function hook\",\n    \"body\": [\"useTask$(({ track }) => {\", \"  track(() => $1);\", \"  $0\", \"});\", \"\"],\n  },\n  \"useResource\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseResource$\",\n    \"description\": \"useResource$() declaration\",\n    \"body\": [\"const $1 = useResource$(({ track, cleanup }) => {\", \"  $0\", \"});\", \"\"],\n  },\n}\n"
  },
  {
    "path": "packages/insights/README.md",
    "content": "# Qwik Insights\n\n## Local Development\n\nEnsure you have `.env.local` set up like so:\n\n```\nPRIVATE_LIBSQL_DB_URL=ws://127.0.0.1:8080\nPRIVATE_LIBSQL_DB_API_TOKEN=(none)\nPRIVATE_AUTH_BASE_API=/api/auth\n```\n\n```sh\nnpm run db.local\n```\n\nin another window\n\n```sh\nnpm run db.migrate\n```\n\n### Local Development with\n\nIf you would like to run the application with production database set up `.env.local` like so:\n\n```\nPRIVATE_LIBSQL_DB_URL=libsql://qwik-bundalyzer-mhevery.turso.io\nPRIVATE_LIBSQL_DB_API_TOKEN=<API_TOKEN>\nPRIVATE_AUTH_SECRET=<AUTH_SECRET>\nPRIVATE_AUTH_BASE_API=/api/auth\n```\n\nYou need two pieces of information:\n\n- `AUTH_SECRET`:\n  - run `turso auth login` to authenticate\n  - run `turso auth api-tokens mint insights-<you-username>` to get a new token\n- `API_TOKEN`: This is needed for using github as authentication. See: https://qwik.dev/docs/integrations/authjs/#github\n"
  },
  {
    "path": "packages/insights/adapters/netlify-edge/vite.config.ts",
    "content": "import { netlifyEdgeAdapter } from '@builder.io/qwik-city/adapters/netlify-edge/vite';\nimport { extendConfig } from '@builder.io/qwik-city/vite';\nimport baseConfig from '../../vite.config';\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: ['src/entry.netlify-edge.tsx', '@qwik-city-plan'],\n      },\n      outDir: '.netlify/edge-functions/entry.netlify-edge',\n    },\n    plugins: [netlifyEdgeAdapter()],\n  };\n});\n"
  },
  {
    "path": "packages/insights/drizzle/0000_blue_blindfold.sql",
    "content": "CREATE TABLE `applications` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`name` text NOT NULL,\n\t`description` text,\n\t`public_api_key` text NOT NULL\n);\n--> statement-breakpoint\nCREATE TABLE `symbols` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`public_api_key` text,\n\t`pathname` text NOT NULL,\n\t`interaction` integer NOT NULL,\n\t`symbol` text NOT NULL,\n\t`session_id` text NOT NULL,\n\t`prev_symbol` text,\n\t`time_delta_ms` integer NOT NULL,\n\tFOREIGN KEY (`public_api_key`) REFERENCES `applications`(`public_api_key`) ON UPDATE no action ON DELETE no action\n);\n--> statement-breakpoint\nCREATE UNIQUE INDEX `publicApiKeyIndex` ON `applications` (`public_api_key`);"
  },
  {
    "path": "packages/insights/drizzle/0001_sweet_virginia_dare.sql",
    "content": "ALTER TABLE symbols ADD `load_delay_ms` integer NOT NULL;"
  },
  {
    "path": "packages/insights/drizzle/0002_exotic_earthquake.sql",
    "content": "CREATE TABLE `errors` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`public_api_key` text,\n\t`session_id` text NOT NULL,\n\t`url` text NOT NULL,\n\t`source` text NOT NULL,\n\t`line` integer NOT NULL,\n\t`column` integer NOT NULL,\n\t`message` text NOT NULL,\n\t`error` text NOT NULL,\n\t`stack` text NOT NULL,\n\tFOREIGN KEY (`public_api_key`) REFERENCES `applications`(`public_api_key`) ON UPDATE no action ON DELETE no action\n);\n"
  },
  {
    "path": "packages/insights/drizzle/0003_late_titanium_man.sql",
    "content": "ALTER TABLE errors ADD `timestamp` integer NOT NULL;"
  },
  {
    "path": "packages/insights/drizzle/0004_secret_justice.sql",
    "content": "CREATE TABLE `symbolDetail` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`hash` text NOT NULL,\n\t`public_api_key` text,\n\t`full_name` text NOT NULL,\n\t`origin` text NOT NULL,\n\tFOREIGN KEY (`public_api_key`) REFERENCES `applications`(`public_api_key`) ON UPDATE no action ON DELETE no action\n);\n"
  },
  {
    "path": "packages/insights/drizzle/0005_cute_marvel_boy.sql",
    "content": "CREATE TABLE `edges` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`public_api_key` text,\n\t`manifest_hash` text NOT NULL,\n\t`from` text,\n\t`to` text NOT NULL,\n\t`interaction` integer NOT NULL,\n\t`delay_count_00` integer NOT NULL,\n\t`delay_count_01` integer NOT NULL,\n\t`delay_count_02` integer NOT NULL,\n\t`delay_count_03` integer NOT NULL,\n\t`delay_count_04` integer NOT NULL,\n\t`delay_count_05` integer NOT NULL,\n\t`delay_count_06` integer NOT NULL,\n\t`delay_count_07` integer NOT NULL,\n\t`delay_count_08` integer NOT NULL,\n\t`delay_count_09` integer NOT NULL,\n\t`delay_count_10` integer NOT NULL,\n\t`delay_count_11` integer NOT NULL,\n\t`delay_count_12` integer NOT NULL,\n\t`delay_count_13` integer NOT NULL,\n\t`delay_count_14` integer NOT NULL,\n\t`delay_count_15` integer NOT NULL,\n\t`delay_count_16` integer NOT NULL,\n\t`delay_count_17` integer NOT NULL,\n\t`delay_count_18` integer NOT NULL,\n\t`delay_count_19` integer NOT NULL,\n\t`delay_count_20` integer NOT NULL,\n\t`delay_count_21` integer NOT NULL,\n\t`delay_count_22` integer NOT NULL,\n\t`delay_count_23` integer NOT NULL,\n\t`delay_count_24` integer NOT NULL,\n\t`delay_count_25` integer NOT NULL,\n\t`delay_count_26` integer NOT NULL,\n\t`delay_count_27` integer NOT NULL,\n\t`delay_count_28` integer NOT NULL,\n\t`delay_count_29` integer NOT NULL,\n\t`delay_count_30` integer NOT NULL,\n\t`delay_count_31` integer NOT NULL,\n\t`delay_count_32` integer NOT NULL,\n\t`delay_count_33` integer NOT NULL,\n\t`delay_count_34` integer NOT NULL,\n\t`delay_count_35` integer NOT NULL,\n\t`delay_count_36` integer NOT NULL,\n\t`delay_count_37` integer NOT NULL,\n\t`delay_count_38` integer NOT NULL,\n\t`delay_count_39` integer NOT NULL,\n\t`delay_count_40` integer NOT NULL,\n\t`delay_count_41` integer NOT NULL,\n\t`delay_count_42` integer NOT NULL,\n\t`delay_count_43` integer NOT NULL,\n\t`delay_count_44` integer NOT NULL,\n\t`delay_count_45` integer NOT NULL,\n\t`delay_count_46` integer NOT NULL,\n\t`delay_count_47` integer NOT NULL,\n\t`delay_count_48` integer NOT NULL,\n\t`delay_count_49` integer NOT NULL,\n\t`latency_count_00` integer NOT NULL,\n\t`latency_count_01` integer NOT NULL,\n\t`latency_count_02` integer NOT NULL,\n\t`latency_count_03` integer NOT NULL,\n\t`latency_count_04` integer NOT NULL,\n\t`latency_count_05` integer NOT NULL,\n\t`latency_count_06` integer NOT NULL,\n\t`latency_count_07` integer NOT NULL,\n\t`latency_count_08` integer NOT NULL,\n\t`latency_count_09` integer NOT NULL,\n\t`latency_count_10` integer NOT NULL,\n\t`latency_count_11` integer NOT NULL,\n\t`latency_count_12` integer NOT NULL,\n\t`latency_count_13` integer NOT NULL,\n\t`latency_count_14` integer NOT NULL,\n\t`latency_count_15` integer NOT NULL,\n\t`latency_count_16` integer NOT NULL,\n\t`latency_count_17` integer NOT NULL,\n\t`latency_count_18` integer NOT NULL,\n\t`latency_count_19` integer NOT NULL,\n\t`latency_count_20` integer NOT NULL,\n\t`latency_count_21` integer NOT NULL,\n\t`latency_count_22` integer NOT NULL,\n\t`latency_count_23` integer NOT NULL,\n\t`latency_count_24` integer NOT NULL,\n\t`latency_count_25` integer NOT NULL,\n\t`latency_count_26` integer NOT NULL,\n\t`latency_count_27` integer NOT NULL,\n\t`latency_count_28` integer NOT NULL,\n\t`latency_count_29` integer NOT NULL,\n\t`latency_count_30` integer NOT NULL,\n\t`latency_count_31` integer NOT NULL,\n\t`latency_count_32` integer NOT NULL,\n\t`latency_count_33` integer NOT NULL,\n\t`latency_count_34` integer NOT NULL,\n\t`latency_count_35` integer NOT NULL,\n\t`latency_count_36` integer NOT NULL,\n\t`latency_count_37` integer NOT NULL,\n\t`latency_count_38` integer NOT NULL,\n\t`latency_count_39` integer NOT NULL,\n\t`latency_count_40` integer NOT NULL,\n\t`latency_count_41` integer NOT NULL,\n\t`latency_count_42` integer NOT NULL,\n\t`latency_count_43` integer NOT NULL,\n\t`latency_count_44` integer NOT NULL,\n\t`latency_count_45` integer NOT NULL,\n\t`latency_count_46` integer NOT NULL,\n\t`latency_count_47` integer NOT NULL,\n\t`latency_count_48` integer NOT NULL,\n\t`latency_count_49` integer NOT NULL,\n\tFOREIGN KEY (`public_api_key`) REFERENCES `applications`(`public_api_key`) ON UPDATE no action ON DELETE no action\n);\n--> statement-breakpoint\nCREATE UNIQUE INDEX `edgeIndex` ON `edges` (`public_api_key`,`manifest_hash`,`from`,`to`);"
  },
  {
    "path": "packages/insights/drizzle/0006_last_dakota_north.sql",
    "content": "CREATE TABLE `manifests` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`hash` text NOT NULL,\n\t`timestamp` integer NOT NULL\n);\n--> statement-breakpoint\nALTER TABLE symbolDetail ADD `manifest_hash` text REFERENCES manifests(hash);--> statement-breakpoint\nALTER TABLE symbolDetail ADD `lo` integer NOT NULL DEFAULT 0;--> statement-breakpoint\nALTER TABLE symbolDetail ADD `hi` integer NOT NULL DEFAULT 0;--> statement-breakpoint\nCREATE INDEX `edgeIndex_PublicApiKey` ON `edges` (`public_api_key`);--> statement-breakpoint\nCREATE INDEX `edgeIndex_PublicApiKey_manifestHash` ON `edges` (`public_api_key`,`manifest_hash`);"
  },
  {
    "path": "packages/insights/drizzle/0007_large_vengeance.sql",
    "content": "DROP INDEX IF EXISTS `edgeIndex_PublicApiKey`;--> statement-breakpoint\nDROP INDEX IF EXISTS `edgeIndex_PublicApiKey_manifestHash`;--> statement-breakpoint\nALTER TABLE errors ADD `manifest_hash` text REFERENCES manifests(hash);--> statement-breakpoint\nCREATE INDEX `edgeIndex_PublicApiKey` ON `edges` (`public_api_key`);--> statement-breakpoint\nCREATE INDEX `edgeIndex_PublicApiKey_manifestHash` ON `edges` (`public_api_key`,`manifest_hash`);"
  },
  {
    "path": "packages/insights/drizzle/0008_handy_baron_zemo.sql",
    "content": "ALTER TABLE manifests ADD `public_api_key` text REFERENCES applications(public_api_key);\n"
  },
  {
    "path": "packages/insights/drizzle/0009_flat_celestials.sql",
    "content": "CREATE UNIQUE INDEX `hashIndex` ON `manifests` (`hash`);"
  },
  {
    "path": "packages/insights/drizzle/0010_typical_lockheed.sql",
    "content": "DROP INDEX IF EXISTS `hashIndex`;--> statement-breakpoint\nCREATE UNIQUE INDEX `hashIndex` ON `manifests` (`hash`,`public_api_key`);"
  },
  {
    "path": "packages/insights/drizzle/0011_thin_captain_stacy.sql",
    "content": "CREATE TABLE `routes` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`public_api_key` text,\n\t`manifest_hash` text NOT NULL,\n\t`route` text NOT NULL,\n\t`symbol` text NOT NULL,\n\t`timeline_00` integer NOT NULL,\n\t`timeline_01` integer NOT NULL,\n\t`timeline_02` integer NOT NULL,\n\t`timeline_03` integer NOT NULL,\n\t`timeline_04` integer NOT NULL,\n\t`timeline_05` integer NOT NULL,\n\t`timeline_06` integer NOT NULL,\n\t`timeline_07` integer NOT NULL,\n\t`timeline_08` integer NOT NULL,\n\t`timeline_09` integer NOT NULL,\n\t`timeline_10` integer NOT NULL,\n\t`timeline_11` integer NOT NULL,\n\t`timeline_12` integer NOT NULL,\n\t`timeline_13` integer NOT NULL,\n\t`timeline_14` integer NOT NULL,\n\t`timeline_15` integer NOT NULL,\n\t`timeline_16` integer NOT NULL,\n\t`timeline_17` integer NOT NULL,\n\t`timeline_18` integer NOT NULL,\n\t`timeline_19` integer NOT NULL,\n\t`timeline_20` integer NOT NULL,\n\t`timeline_21` integer NOT NULL,\n\t`timeline_22` integer NOT NULL,\n\t`timeline_23` integer NOT NULL,\n\t`timeline_24` integer NOT NULL,\n\t`timeline_25` integer NOT NULL,\n\t`timeline_26` integer NOT NULL,\n\t`timeline_27` integer NOT NULL,\n\t`timeline_28` integer NOT NULL,\n\t`timeline_29` integer NOT NULL,\n\t`timeline_30` integer NOT NULL,\n\t`timeline_31` integer NOT NULL,\n\t`timeline_32` integer NOT NULL,\n\t`timeline_33` integer NOT NULL,\n\t`timeline_34` integer NOT NULL,\n\t`timeline_35` integer NOT NULL,\n\t`timeline_36` integer NOT NULL,\n\t`timeline_37` integer NOT NULL,\n\t`timeline_38` integer NOT NULL,\n\t`timeline_39` integer NOT NULL,\n\t`timeline_40` integer NOT NULL,\n\t`timeline_41` integer NOT NULL,\n\t`timeline_42` integer NOT NULL,\n\t`timeline_43` integer NOT NULL,\n\t`timeline_44` integer NOT NULL,\n\t`timeline_45` integer NOT NULL,\n\t`timeline_46` integer NOT NULL,\n\t`timeline_47` integer NOT NULL,\n\t`timeline_48` integer NOT NULL,\n\t`timeline_49` integer NOT NULL,\n\tFOREIGN KEY (`public_api_key`) REFERENCES `applications`(`public_api_key`) ON UPDATE no action ON DELETE no action\n);\n--> statement-breakpoint\nCREATE UNIQUE INDEX `routeIndex_Symbol` ON `routes` (`public_api_key`,`manifest_hash`,`route`,`symbol`);"
  },
  {
    "path": "packages/insights/drizzle/0012_omniscient_leader.sql",
    "content": "CREATE TABLE `symbolDetailTmp` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`hash` text NOT NULL,\n\t`public_api_key` text,\n\t`manifest_hash` text,\n\t`full_name` text NOT NULL,\n\t`origin` text NOT NULL,\n\t`lo` integer NOT NULL,\n\t`hi` integer NOT NULL,\n\tFOREIGN KEY (`public_api_key`) REFERENCES `applications`(`public_api_key`) ON UPDATE no action ON DELETE no action,\n\tFOREIGN KEY (`public_api_key`,`manifest_hash`) REFERENCES `manifests`(`public_api_key`,`hash`) ON UPDATE no action ON DELETE no action\n);--> statement-breakpoint\nINSERT INTO `symbolDetailTmp` (\n\t`hash`,\n\t`public_api_key`,\n\t`manifest_hash`,\n\t`full_name`,\n\t`origin`,\n\t`lo`,\n\t`hi`\n) SELECT \n\t`hash`,\n\t`public_api_key`,\n\t`manifest_hash`,\n\t`full_name`,\n\t`origin`,\n\t`lo`,\n\t`hi`\n FROM `symbolDetail`;--> statement-breakpoint\nDROP TABLE `symbolDetail`;--> statement-breakpoint\nALTER TABLE `symbolDetailTmp` RENAME TO `symbolDetail`;"
  },
  {
    "path": "packages/insights/drizzle/0013_brave_venus.sql",
    "content": "ALTER TABLE `errors` DROP COLUMN `session_id`;--> statement-breakpoint\nALTER TABLE `symbols` DROP COLUMN `session_id`;"
  },
  {
    "path": "packages/insights/drizzle/0014_needy_ben_grimm.sql",
    "content": "CREATE TABLE `userApplicationMap` (\n\t`application_id` integer,\n\t`user_id` integer,\n\tFOREIGN KEY (`application_id`) REFERENCES `applications`(`id`) ON UPDATE no action ON DELETE no action,\n\tFOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`) ON UPDATE no action ON DELETE no action\n);\n--> statement-breakpoint\nCREATE TABLE `users` (\n\t`user_id` integer PRIMARY KEY NOT NULL,\n\t`email` text NOT NULL,\n\t`created` integer NOT NULL,\n\t`super_user` integer NOT NULL\n);\n--> statement-breakpoint\nCREATE UNIQUE INDEX `userApplicationIndex` ON `userApplicationMap` (`application_id`,`user_id`);--> statement-breakpoint\nCREATE UNIQUE INDEX `emailIndex` ON `users` (`email`);"
  },
  {
    "path": "packages/insights/drizzle/0015_complete_wolf_cub.sql",
    "content": "ALTER TABLE applications ADD `url` text;"
  },
  {
    "path": "packages/insights/drizzle/0016_demonic_legion.sql",
    "content": "DROP INDEX IF EXISTS `edgeIndex_PublicApiKey_manifestHash`;--> statement-breakpoint\nDROP INDEX IF EXISTS `edgeIndex`;--> statement-breakpoint\nCREATE INDEX `idx_edge_publicApiKey_manifestHash` ON `edges` (`public_api_key`,`manifest_hash`);--> statement-breakpoint\nCREATE INDEX `idx_edge_apiKey_manifestHash_from_to` ON `edges` (`public_api_key`,`manifest_hash`,`from`,`to`);--> statement-breakpoint\nDROP INDEX IF EXISTS `hashIndex`;--> statement-breakpoint\nCREATE UNIQUE INDEX `idx_manifests_apiKey_hash` ON `manifests` (`hash`,`public_api_key`);--> statement-breakpoint\nCREATE INDEX `idx_manifests_public_apiKey` ON `manifests` (`public_api_key`);--> statement-breakpoint\nCREATE INDEX `idx_manifests_hash` ON `manifests` (`hash`);--> statement-breakpoint\nCREATE INDEX `idx_routes_publicApiKey_manifestHash` ON `routes` (`public_api_key`,`manifest_hash`);--> statement-breakpoint\nCREATE UNIQUE INDEX `idx_symbolDetail_apiKey_manifestHash` ON `symbolDetail` (`public_api_key`,`manifest_hash`);"
  },
  {
    "path": "packages/insights/drizzle/0017_pink_maestro.sql",
    "content": "CREATE INDEX `idx_manifests_apiKey_hash_2` ON `manifests` (`public_api_key`,`hash`);--> statement-breakpoint\nCREATE INDEX `idx_manifest_api_timestamp` ON `manifests` (`public_api_key`,`timestamp`);"
  },
  {
    "path": "packages/insights/drizzle/0018_heavy_toad.sql",
    "content": "CREATE INDEX `idx_apiKey_hash_from` ON `edges` (`public_api_key`,`from`,`manifest_hash`);--> statement-breakpoint\nCREATE INDEX `idx_hash_to` ON `edges` (`manifest_hash`,`to`);"
  },
  {
    "path": "packages/insights/drizzle/0019_known_satana.sql",
    "content": "CREATE INDEX `idx_edge_from_to` ON `edges` (`from`,`to`);"
  },
  {
    "path": "packages/insights/drizzle/meta/0000_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"15fea7b6-cecc-4cf7-9f8e-18393db5b9cc\",\n  \"prevId\": \"00000000-0000-0000-0000-000000000000\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0001_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"cb985a7f-25e8-41bc-9215-c28801dfe4e1\",\n  \"prevId\": \"15fea7b6-cecc-4cf7-9f8e-18393db5b9cc\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0002_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"6dc81006-f64d-4f8b-8d1a-0853e9e111f8\",\n  \"prevId\": \"cb985a7f-25e8-41bc-9215-c28801dfe4e1\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0003_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"3f1754dc-7635-4f8f-bfa7-c4c6e500959a\",\n  \"prevId\": \"6dc81006-f64d-4f8b-8d1a-0853e9e111f8\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0004_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"f04aa532-42ae-4d3b-8ced-cf4f10f5ad7c\",\n  \"prevId\": \"3f1754dc-7635-4f8f-bfa7-c4c6e500959a\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0005_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"b3c4d925-b6a6-4261-9f4c-592c882e7906\",\n  \"prevId\": \"f04aa532-42ae-4d3b-8ced-cf4f10f5ad7c\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0006_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": true\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"symbolDetail_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"9589ce3d-93dd-4032-84c2-97df67d0a1aa\",\n  \"prevId\": \"b3c4d925-b6a6-4261-9f4c-592c882e7906\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0007_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"symbolDetail_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"cadfa776-dd6c-4fe8-8911-e053998c9120\",\n  \"prevId\": \"9589ce3d-93dd-4032-84c2-97df67d0a1aa\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0008_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"symbolDetail_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"15c2f050-02c6-41cf-a51f-82a459534b91\",\n  \"prevId\": \"cadfa776-dd6c-4fe8-8911-e053998c9120\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0009_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"hashIndex\": {\n          \"name\": \"hashIndex\",\n          \"columns\": [\n            \"hash\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"symbolDetail_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"d69149dc-718b-42f9-8fb2-77585cd18325\",\n  \"prevId\": \"15c2f050-02c6-41cf-a51f-82a459534b91\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0010_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"hashIndex\": {\n          \"name\": \"hashIndex\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"symbolDetail_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"411eda3c-50ef-40b4-a6f8-902c0b06cffd\",\n  \"prevId\": \"d69149dc-718b-42f9-8fb2-77585cd18325\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0011_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"hashIndex\": {\n          \"name\": \"hashIndex\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"symbolDetail_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"d449626c-ce26-4a45-97e3-d9cefd38f5e8\",\n  \"prevId\": \"411eda3c-50ef-40b4-a6f8-902c0b06cffd\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0012_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"hashIndex\": {\n          \"name\": \"hashIndex\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"session_id\": {\n          \"name\": \"session_id\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"b433e33c-f6e2-4ade-b42c-b899ce0ab208\",\n  \"prevId\": \"d449626c-ce26-4a45-97e3-d9cefd38f5e8\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0013_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"hashIndex\": {\n          \"name\": \"hashIndex\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"a990fdef-a597-4283-bfd7-0487cacda31c\",\n  \"prevId\": \"b433e33c-f6e2-4ade-b42c-b899ce0ab208\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0014_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"hashIndex\": {\n          \"name\": \"hashIndex\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"userApplicationMap\": {\n      \"name\": \"userApplicationMap\",\n      \"columns\": {\n        \"application_id\": {\n          \"name\": \"application_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"userApplicationIndex\": {\n          \"name\": \"userApplicationIndex\",\n          \"columns\": [\n            \"application_id\",\n            \"user_id\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"userApplicationMap_application_id_applications_id_fk\": {\n          \"name\": \"userApplicationMap_application_id_applications_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"columnsFrom\": [\n            \"application_id\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"id\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"userApplicationMap_user_id_users_user_id_fk\": {\n          \"name\": \"userApplicationMap_user_id_users_user_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"columnsFrom\": [\n            \"user_id\"\n          ],\n          \"tableTo\": \"users\",\n          \"columnsTo\": [\n            \"user_id\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"users\": {\n      \"name\": \"users\",\n      \"columns\": {\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"email\": {\n          \"name\": \"email\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"created\": {\n          \"name\": \"created\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"super_user\": {\n          \"name\": \"super_user\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"emailIndex\": {\n          \"name\": \"emailIndex\",\n          \"columns\": [\n            \"email\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"46162af9-f64b-4d4e-8ac7-207a8c2b914c\",\n  \"prevId\": \"a990fdef-a597-4283-bfd7-0487cacda31c\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0015_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex_PublicApiKey_manifestHash\": {\n          \"name\": \"edgeIndex_PublicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"edgeIndex\": {\n          \"name\": \"edgeIndex\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"hashIndex\": {\n          \"name\": \"hashIndex\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"tableTo\": \"manifests\",\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"userApplicationMap\": {\n      \"name\": \"userApplicationMap\",\n      \"columns\": {\n        \"application_id\": {\n          \"name\": \"application_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"userApplicationIndex\": {\n          \"name\": \"userApplicationIndex\",\n          \"columns\": [\n            \"application_id\",\n            \"user_id\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"userApplicationMap_application_id_applications_id_fk\": {\n          \"name\": \"userApplicationMap_application_id_applications_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"columnsFrom\": [\n            \"application_id\"\n          ],\n          \"tableTo\": \"applications\",\n          \"columnsTo\": [\n            \"id\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        },\n        \"userApplicationMap_user_id_users_user_id_fk\": {\n          \"name\": \"userApplicationMap_user_id_users_user_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"columnsFrom\": [\n            \"user_id\"\n          ],\n          \"tableTo\": \"users\",\n          \"columnsTo\": [\n            \"user_id\"\n          ],\n          \"onUpdate\": \"no action\",\n          \"onDelete\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"users\": {\n      \"name\": \"users\",\n      \"columns\": {\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"email\": {\n          \"name\": \"email\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"created\": {\n          \"name\": \"created\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"super_user\": {\n          \"name\": \"super_user\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"emailIndex\": {\n          \"name\": \"emailIndex\",\n          \"columns\": [\n            \"email\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"enums\": {},\n  \"_meta\": {\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"id\": \"b0c05b58-a02f-4cf4-8373-0e6005058d79\",\n  \"prevId\": \"46162af9-f64b-4d4e-8ac7-207a8c2b914c\",\n  \"views\": {}\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0016_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"id\": \"bf22633f-3ea4-406f-a722-88dd315ecaa8\",\n  \"prevId\": \"b0c05b58-a02f-4cf4-8373-0e6005058d79\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_publicApiKey_manifestHash\": {\n          \"name\": \"idx_edge_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_apiKey_manifestHash_from_to\": {\n          \"name\": \"idx_edge_apiKey_manifestHash_from_to\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_manifests_apiKey_hash\": {\n          \"name\": \"idx_manifests_apiKey_hash\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        },\n        \"idx_manifests_public_apiKey\": {\n          \"name\": \"idx_manifests_public_apiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_hash\": {\n          \"name\": \"idx_manifests_hash\",\n          \"columns\": [\n            \"hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        },\n        \"idx_routes_publicApiKey_manifestHash\": {\n          \"name\": \"idx_routes_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_symbolDetail_apiKey_manifestHash\": {\n          \"name\": \"idx_symbolDetail_apiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"userApplicationMap\": {\n      \"name\": \"userApplicationMap\",\n      \"columns\": {\n        \"application_id\": {\n          \"name\": \"application_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"userApplicationIndex\": {\n          \"name\": \"userApplicationIndex\",\n          \"columns\": [\n            \"application_id\",\n            \"user_id\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"userApplicationMap_application_id_applications_id_fk\": {\n          \"name\": \"userApplicationMap_application_id_applications_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"application_id\"\n          ],\n          \"columnsTo\": [\n            \"id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"userApplicationMap_user_id_users_user_id_fk\": {\n          \"name\": \"userApplicationMap_user_id_users_user_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"users\",\n          \"columnsFrom\": [\n            \"user_id\"\n          ],\n          \"columnsTo\": [\n            \"user_id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"users\": {\n      \"name\": \"users\",\n      \"columns\": {\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"email\": {\n          \"name\": \"email\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"created\": {\n          \"name\": \"created\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"super_user\": {\n          \"name\": \"super_user\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"emailIndex\": {\n          \"name\": \"emailIndex\",\n          \"columns\": [\n            \"email\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"views\": {},\n  \"enums\": {},\n  \"_meta\": {\n    \"schemas\": {},\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"internal\": {\n    \"indexes\": {}\n  }\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0017_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"id\": \"24807f0f-b6e0-4ead-ba32-1305a0df0e69\",\n  \"prevId\": \"bf22633f-3ea4-406f-a722-88dd315ecaa8\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_publicApiKey_manifestHash\": {\n          \"name\": \"idx_edge_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_apiKey_manifestHash_from_to\": {\n          \"name\": \"idx_edge_apiKey_manifestHash_from_to\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_manifests_apiKey_hash\": {\n          \"name\": \"idx_manifests_apiKey_hash\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_apiKey_hash_2\": {\n          \"name\": \"idx_manifests_apiKey_hash_2\",\n          \"columns\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifest_api_timestamp\": {\n          \"name\": \"idx_manifest_api_timestamp\",\n          \"columns\": [\n            \"public_api_key\",\n            \"timestamp\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_public_apiKey\": {\n          \"name\": \"idx_manifests_public_apiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_hash\": {\n          \"name\": \"idx_manifests_hash\",\n          \"columns\": [\n            \"hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        },\n        \"idx_routes_publicApiKey_manifestHash\": {\n          \"name\": \"idx_routes_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_symbolDetail_apiKey_manifestHash\": {\n          \"name\": \"idx_symbolDetail_apiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"userApplicationMap\": {\n      \"name\": \"userApplicationMap\",\n      \"columns\": {\n        \"application_id\": {\n          \"name\": \"application_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"userApplicationIndex\": {\n          \"name\": \"userApplicationIndex\",\n          \"columns\": [\n            \"application_id\",\n            \"user_id\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"userApplicationMap_application_id_applications_id_fk\": {\n          \"name\": \"userApplicationMap_application_id_applications_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"application_id\"\n          ],\n          \"columnsTo\": [\n            \"id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"userApplicationMap_user_id_users_user_id_fk\": {\n          \"name\": \"userApplicationMap_user_id_users_user_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"users\",\n          \"columnsFrom\": [\n            \"user_id\"\n          ],\n          \"columnsTo\": [\n            \"user_id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"users\": {\n      \"name\": \"users\",\n      \"columns\": {\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"email\": {\n          \"name\": \"email\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"created\": {\n          \"name\": \"created\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"super_user\": {\n          \"name\": \"super_user\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"emailIndex\": {\n          \"name\": \"emailIndex\",\n          \"columns\": [\n            \"email\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"views\": {},\n  \"enums\": {},\n  \"_meta\": {\n    \"schemas\": {},\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"internal\": {\n    \"indexes\": {}\n  }\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0018_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"id\": \"994bada9-1eb3-409e-bfd8-8ffeac286096\",\n  \"prevId\": \"24807f0f-b6e0-4ead-ba32-1305a0df0e69\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_publicApiKey_manifestHash\": {\n          \"name\": \"idx_edge_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_apiKey_manifestHash_from_to\": {\n          \"name\": \"idx_edge_apiKey_manifestHash_from_to\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_apiKey_hash_from\": {\n          \"name\": \"idx_apiKey_hash_from\",\n          \"columns\": [\n            \"public_api_key\",\n            \"from\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_hash_to\": {\n          \"name\": \"idx_hash_to\",\n          \"columns\": [\n            \"manifest_hash\",\n            \"to\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_manifests_apiKey_hash\": {\n          \"name\": \"idx_manifests_apiKey_hash\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_apiKey_hash_2\": {\n          \"name\": \"idx_manifests_apiKey_hash_2\",\n          \"columns\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifest_api_timestamp\": {\n          \"name\": \"idx_manifest_api_timestamp\",\n          \"columns\": [\n            \"public_api_key\",\n            \"timestamp\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_public_apiKey\": {\n          \"name\": \"idx_manifests_public_apiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_hash\": {\n          \"name\": \"idx_manifests_hash\",\n          \"columns\": [\n            \"hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        },\n        \"idx_routes_publicApiKey_manifestHash\": {\n          \"name\": \"idx_routes_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_symbolDetail_apiKey_manifestHash\": {\n          \"name\": \"idx_symbolDetail_apiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"userApplicationMap\": {\n      \"name\": \"userApplicationMap\",\n      \"columns\": {\n        \"application_id\": {\n          \"name\": \"application_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"userApplicationIndex\": {\n          \"name\": \"userApplicationIndex\",\n          \"columns\": [\n            \"application_id\",\n            \"user_id\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"userApplicationMap_application_id_applications_id_fk\": {\n          \"name\": \"userApplicationMap_application_id_applications_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"application_id\"\n          ],\n          \"columnsTo\": [\n            \"id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"userApplicationMap_user_id_users_user_id_fk\": {\n          \"name\": \"userApplicationMap_user_id_users_user_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"users\",\n          \"columnsFrom\": [\n            \"user_id\"\n          ],\n          \"columnsTo\": [\n            \"user_id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"users\": {\n      \"name\": \"users\",\n      \"columns\": {\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"email\": {\n          \"name\": \"email\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"created\": {\n          \"name\": \"created\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"super_user\": {\n          \"name\": \"super_user\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"emailIndex\": {\n          \"name\": \"emailIndex\",\n          \"columns\": [\n            \"email\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"views\": {},\n  \"enums\": {},\n  \"_meta\": {\n    \"schemas\": {},\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"internal\": {\n    \"indexes\": {}\n  }\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/0019_snapshot.json",
    "content": "{\n  \"version\": \"6\",\n  \"dialect\": \"sqlite\",\n  \"id\": \"c7ff5c52-d899-4ec4-8572-a77cf72295c4\",\n  \"prevId\": \"994bada9-1eb3-409e-bfd8-8ffeac286096\",\n  \"tables\": {\n    \"applications\": {\n      \"name\": \"applications\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"name\": {\n          \"name\": \"name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"description\": {\n          \"name\": \"description\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"publicApiKeyIndex\": {\n          \"name\": \"publicApiKeyIndex\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"edges\": {\n      \"name\": \"edges\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"from\": {\n          \"name\": \"from\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"to\": {\n          \"name\": \"to\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_00\": {\n          \"name\": \"delay_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_01\": {\n          \"name\": \"delay_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_02\": {\n          \"name\": \"delay_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_03\": {\n          \"name\": \"delay_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_04\": {\n          \"name\": \"delay_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_05\": {\n          \"name\": \"delay_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_06\": {\n          \"name\": \"delay_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_07\": {\n          \"name\": \"delay_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_08\": {\n          \"name\": \"delay_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_09\": {\n          \"name\": \"delay_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_10\": {\n          \"name\": \"delay_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_11\": {\n          \"name\": \"delay_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_12\": {\n          \"name\": \"delay_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_13\": {\n          \"name\": \"delay_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_14\": {\n          \"name\": \"delay_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_15\": {\n          \"name\": \"delay_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_16\": {\n          \"name\": \"delay_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_17\": {\n          \"name\": \"delay_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_18\": {\n          \"name\": \"delay_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_19\": {\n          \"name\": \"delay_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_20\": {\n          \"name\": \"delay_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_21\": {\n          \"name\": \"delay_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_22\": {\n          \"name\": \"delay_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_23\": {\n          \"name\": \"delay_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_24\": {\n          \"name\": \"delay_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_25\": {\n          \"name\": \"delay_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_26\": {\n          \"name\": \"delay_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_27\": {\n          \"name\": \"delay_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_28\": {\n          \"name\": \"delay_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_29\": {\n          \"name\": \"delay_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_30\": {\n          \"name\": \"delay_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_31\": {\n          \"name\": \"delay_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_32\": {\n          \"name\": \"delay_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_33\": {\n          \"name\": \"delay_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_34\": {\n          \"name\": \"delay_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_35\": {\n          \"name\": \"delay_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_36\": {\n          \"name\": \"delay_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_37\": {\n          \"name\": \"delay_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_38\": {\n          \"name\": \"delay_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_39\": {\n          \"name\": \"delay_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_40\": {\n          \"name\": \"delay_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_41\": {\n          \"name\": \"delay_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_42\": {\n          \"name\": \"delay_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_43\": {\n          \"name\": \"delay_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_44\": {\n          \"name\": \"delay_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_45\": {\n          \"name\": \"delay_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_46\": {\n          \"name\": \"delay_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_47\": {\n          \"name\": \"delay_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_48\": {\n          \"name\": \"delay_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"delay_count_49\": {\n          \"name\": \"delay_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_00\": {\n          \"name\": \"latency_count_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_01\": {\n          \"name\": \"latency_count_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_02\": {\n          \"name\": \"latency_count_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_03\": {\n          \"name\": \"latency_count_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_04\": {\n          \"name\": \"latency_count_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_05\": {\n          \"name\": \"latency_count_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_06\": {\n          \"name\": \"latency_count_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_07\": {\n          \"name\": \"latency_count_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_08\": {\n          \"name\": \"latency_count_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_09\": {\n          \"name\": \"latency_count_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_10\": {\n          \"name\": \"latency_count_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_11\": {\n          \"name\": \"latency_count_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_12\": {\n          \"name\": \"latency_count_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_13\": {\n          \"name\": \"latency_count_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_14\": {\n          \"name\": \"latency_count_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_15\": {\n          \"name\": \"latency_count_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_16\": {\n          \"name\": \"latency_count_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_17\": {\n          \"name\": \"latency_count_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_18\": {\n          \"name\": \"latency_count_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_19\": {\n          \"name\": \"latency_count_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_20\": {\n          \"name\": \"latency_count_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_21\": {\n          \"name\": \"latency_count_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_22\": {\n          \"name\": \"latency_count_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_23\": {\n          \"name\": \"latency_count_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_24\": {\n          \"name\": \"latency_count_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_25\": {\n          \"name\": \"latency_count_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_26\": {\n          \"name\": \"latency_count_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_27\": {\n          \"name\": \"latency_count_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_28\": {\n          \"name\": \"latency_count_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_29\": {\n          \"name\": \"latency_count_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_30\": {\n          \"name\": \"latency_count_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_31\": {\n          \"name\": \"latency_count_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_32\": {\n          \"name\": \"latency_count_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_33\": {\n          \"name\": \"latency_count_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_34\": {\n          \"name\": \"latency_count_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_35\": {\n          \"name\": \"latency_count_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_36\": {\n          \"name\": \"latency_count_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_37\": {\n          \"name\": \"latency_count_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_38\": {\n          \"name\": \"latency_count_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_39\": {\n          \"name\": \"latency_count_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_40\": {\n          \"name\": \"latency_count_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_41\": {\n          \"name\": \"latency_count_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_42\": {\n          \"name\": \"latency_count_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_43\": {\n          \"name\": \"latency_count_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_44\": {\n          \"name\": \"latency_count_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_45\": {\n          \"name\": \"latency_count_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_46\": {\n          \"name\": \"latency_count_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_47\": {\n          \"name\": \"latency_count_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_48\": {\n          \"name\": \"latency_count_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"latency_count_49\": {\n          \"name\": \"latency_count_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"edgeIndex_PublicApiKey\": {\n          \"name\": \"edgeIndex_PublicApiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_publicApiKey_manifestHash\": {\n          \"name\": \"idx_edge_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_apiKey_manifestHash_from_to\": {\n          \"name\": \"idx_edge_apiKey_manifestHash_from_to\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_edge_from_to\": {\n          \"name\": \"idx_edge_from_to\",\n          \"columns\": [\n            \"from\",\n            \"to\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_apiKey_hash_from\": {\n          \"name\": \"idx_apiKey_hash_from\",\n          \"columns\": [\n            \"public_api_key\",\n            \"from\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_hash_to\": {\n          \"name\": \"idx_hash_to\",\n          \"columns\": [\n            \"manifest_hash\",\n            \"to\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"edges_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"edges_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"edges\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"errors\": {\n      \"name\": \"errors\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"url\": {\n          \"name\": \"url\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"source\": {\n          \"name\": \"source\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"line\": {\n          \"name\": \"line\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"column\": {\n          \"name\": \"column\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"message\": {\n          \"name\": \"message\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"error\": {\n          \"name\": \"error\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"stack\": {\n          \"name\": \"stack\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"errors_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"errors_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"errors_manifest_hash_manifests_hash_fk\": {\n          \"name\": \"errors_manifest_hash_manifests_hash_fk\",\n          \"tableFrom\": \"errors\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"manifests\": {\n      \"name\": \"manifests\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timestamp\": {\n          \"name\": \"timestamp\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_manifests_apiKey_hash\": {\n          \"name\": \"idx_manifests_apiKey_hash\",\n          \"columns\": [\n            \"hash\",\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_apiKey_hash_2\": {\n          \"name\": \"idx_manifests_apiKey_hash_2\",\n          \"columns\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifest_api_timestamp\": {\n          \"name\": \"idx_manifest_api_timestamp\",\n          \"columns\": [\n            \"public_api_key\",\n            \"timestamp\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_public_apiKey\": {\n          \"name\": \"idx_manifests_public_apiKey\",\n          \"columns\": [\n            \"public_api_key\"\n          ],\n          \"isUnique\": false\n        },\n        \"idx_manifests_hash\": {\n          \"name\": \"idx_manifests_hash\",\n          \"columns\": [\n            \"hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"manifests_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"manifests_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"manifests\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"routes\": {\n      \"name\": \"routes\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"route\": {\n          \"name\": \"route\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_00\": {\n          \"name\": \"timeline_00\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_01\": {\n          \"name\": \"timeline_01\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_02\": {\n          \"name\": \"timeline_02\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_03\": {\n          \"name\": \"timeline_03\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_04\": {\n          \"name\": \"timeline_04\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_05\": {\n          \"name\": \"timeline_05\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_06\": {\n          \"name\": \"timeline_06\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_07\": {\n          \"name\": \"timeline_07\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_08\": {\n          \"name\": \"timeline_08\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_09\": {\n          \"name\": \"timeline_09\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_10\": {\n          \"name\": \"timeline_10\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_11\": {\n          \"name\": \"timeline_11\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_12\": {\n          \"name\": \"timeline_12\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_13\": {\n          \"name\": \"timeline_13\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_14\": {\n          \"name\": \"timeline_14\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_15\": {\n          \"name\": \"timeline_15\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_16\": {\n          \"name\": \"timeline_16\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_17\": {\n          \"name\": \"timeline_17\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_18\": {\n          \"name\": \"timeline_18\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_19\": {\n          \"name\": \"timeline_19\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_20\": {\n          \"name\": \"timeline_20\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_21\": {\n          \"name\": \"timeline_21\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_22\": {\n          \"name\": \"timeline_22\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_23\": {\n          \"name\": \"timeline_23\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_24\": {\n          \"name\": \"timeline_24\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_25\": {\n          \"name\": \"timeline_25\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_26\": {\n          \"name\": \"timeline_26\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_27\": {\n          \"name\": \"timeline_27\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_28\": {\n          \"name\": \"timeline_28\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_29\": {\n          \"name\": \"timeline_29\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_30\": {\n          \"name\": \"timeline_30\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_31\": {\n          \"name\": \"timeline_31\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_32\": {\n          \"name\": \"timeline_32\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_33\": {\n          \"name\": \"timeline_33\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_34\": {\n          \"name\": \"timeline_34\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_35\": {\n          \"name\": \"timeline_35\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_36\": {\n          \"name\": \"timeline_36\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_37\": {\n          \"name\": \"timeline_37\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_38\": {\n          \"name\": \"timeline_38\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_39\": {\n          \"name\": \"timeline_39\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_40\": {\n          \"name\": \"timeline_40\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_41\": {\n          \"name\": \"timeline_41\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_42\": {\n          \"name\": \"timeline_42\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_43\": {\n          \"name\": \"timeline_43\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_44\": {\n          \"name\": \"timeline_44\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_45\": {\n          \"name\": \"timeline_45\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_46\": {\n          \"name\": \"timeline_46\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_47\": {\n          \"name\": \"timeline_47\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_48\": {\n          \"name\": \"timeline_48\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"timeline_49\": {\n          \"name\": \"timeline_49\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"routeIndex_Symbol\": {\n          \"name\": \"routeIndex_Symbol\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\",\n            \"route\",\n            \"symbol\"\n          ],\n          \"isUnique\": true\n        },\n        \"idx_routes_publicApiKey_manifestHash\": {\n          \"name\": \"idx_routes_publicApiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": false\n        }\n      },\n      \"foreignKeys\": {\n        \"routes_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"routes_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"routes\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbolDetail\": {\n      \"name\": \"symbolDetail\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hash\": {\n          \"name\": \"hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"manifest_hash\": {\n          \"name\": \"manifest_hash\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"full_name\": {\n          \"name\": \"full_name\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"origin\": {\n          \"name\": \"origin\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"lo\": {\n          \"name\": \"lo\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"hi\": {\n          \"name\": \"hi\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"idx_symbolDetail_apiKey_manifestHash\": {\n          \"name\": \"idx_symbolDetail_apiKey_manifestHash\",\n          \"columns\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"symbolDetail_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbolDetail_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\": {\n          \"name\": \"symbolDetail_public_api_key_manifest_hash_manifests_public_api_key_hash_fk\",\n          \"tableFrom\": \"symbolDetail\",\n          \"tableTo\": \"manifests\",\n          \"columnsFrom\": [\n            \"public_api_key\",\n            \"manifest_hash\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\",\n            \"hash\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"symbols\": {\n      \"name\": \"symbols\",\n      \"columns\": {\n        \"id\": {\n          \"name\": \"id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"public_api_key\": {\n          \"name\": \"public_api_key\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"pathname\": {\n          \"name\": \"pathname\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"interaction\": {\n          \"name\": \"interaction\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"symbol\": {\n          \"name\": \"symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"prev_symbol\": {\n          \"name\": \"prev_symbol\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"time_delta_ms\": {\n          \"name\": \"time_delta_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"load_delay_ms\": {\n          \"name\": \"load_delay_ms\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {},\n      \"foreignKeys\": {\n        \"symbols_public_api_key_applications_public_api_key_fk\": {\n          \"name\": \"symbols_public_api_key_applications_public_api_key_fk\",\n          \"tableFrom\": \"symbols\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"public_api_key\"\n          ],\n          \"columnsTo\": [\n            \"public_api_key\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"userApplicationMap\": {\n      \"name\": \"userApplicationMap\",\n      \"columns\": {\n        \"application_id\": {\n          \"name\": \"application_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        },\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": false,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"userApplicationIndex\": {\n          \"name\": \"userApplicationIndex\",\n          \"columns\": [\n            \"application_id\",\n            \"user_id\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {\n        \"userApplicationMap_application_id_applications_id_fk\": {\n          \"name\": \"userApplicationMap_application_id_applications_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"applications\",\n          \"columnsFrom\": [\n            \"application_id\"\n          ],\n          \"columnsTo\": [\n            \"id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        },\n        \"userApplicationMap_user_id_users_user_id_fk\": {\n          \"name\": \"userApplicationMap_user_id_users_user_id_fk\",\n          \"tableFrom\": \"userApplicationMap\",\n          \"tableTo\": \"users\",\n          \"columnsFrom\": [\n            \"user_id\"\n          ],\n          \"columnsTo\": [\n            \"user_id\"\n          ],\n          \"onDelete\": \"no action\",\n          \"onUpdate\": \"no action\"\n        }\n      },\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    },\n    \"users\": {\n      \"name\": \"users\",\n      \"columns\": {\n        \"user_id\": {\n          \"name\": \"user_id\",\n          \"type\": \"integer\",\n          \"primaryKey\": true,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"email\": {\n          \"name\": \"email\",\n          \"type\": \"text\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"created\": {\n          \"name\": \"created\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        },\n        \"super_user\": {\n          \"name\": \"super_user\",\n          \"type\": \"integer\",\n          \"primaryKey\": false,\n          \"notNull\": true,\n          \"autoincrement\": false\n        }\n      },\n      \"indexes\": {\n        \"emailIndex\": {\n          \"name\": \"emailIndex\",\n          \"columns\": [\n            \"email\"\n          ],\n          \"isUnique\": true\n        }\n      },\n      \"foreignKeys\": {},\n      \"compositePrimaryKeys\": {},\n      \"uniqueConstraints\": {},\n      \"checkConstraints\": {}\n    }\n  },\n  \"views\": {},\n  \"enums\": {},\n  \"_meta\": {\n    \"schemas\": {},\n    \"tables\": {},\n    \"columns\": {}\n  },\n  \"internal\": {\n    \"indexes\": {}\n  }\n}"
  },
  {
    "path": "packages/insights/drizzle/meta/_journal.json",
    "content": "{\n  \"version\": \"5\",\n  \"dialect\": \"sqlite\",\n  \"entries\": [\n    {\n      \"idx\": 0,\n      \"version\": \"5\",\n      \"when\": 1687211746816,\n      \"tag\": \"0000_blue_blindfold\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 1,\n      \"version\": \"5\",\n      \"when\": 1687215719797,\n      \"tag\": \"0001_sweet_virginia_dare\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 2,\n      \"version\": \"5\",\n      \"when\": 1687219203328,\n      \"tag\": \"0002_exotic_earthquake\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 3,\n      \"version\": \"5\",\n      \"when\": 1687219846067,\n      \"tag\": \"0003_late_titanium_man\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 4,\n      \"version\": \"5\",\n      \"when\": 1687857153437,\n      \"tag\": \"0004_secret_justice\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 5,\n      \"version\": \"5\",\n      \"when\": 1688767002080,\n      \"tag\": \"0005_cute_marvel_boy\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 6,\n      \"version\": \"5\",\n      \"when\": 1689091765732,\n      \"tag\": \"0006_last_dakota_north\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 7,\n      \"version\": \"5\",\n      \"when\": 1689101023895,\n      \"tag\": \"0007_large_vengeance\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 8,\n      \"version\": \"5\",\n      \"when\": 1689102074562,\n      \"tag\": \"0008_handy_baron_zemo\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 9,\n      \"version\": \"5\",\n      \"when\": 1689103584520,\n      \"tag\": \"0009_flat_celestials\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 10,\n      \"version\": \"5\",\n      \"when\": 1692021133396,\n      \"tag\": \"0010_typical_lockheed\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 11,\n      \"version\": \"5\",\n      \"when\": 1692475220822,\n      \"tag\": \"0011_thin_captain_stacy\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 12,\n      \"version\": \"5\",\n      \"when\": 1692906645372,\n      \"tag\": \"0012_omniscient_leader\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 13,\n      \"version\": \"5\",\n      \"when\": 1698882288491,\n      \"tag\": \"0013_brave_venus\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 14,\n      \"version\": \"5\",\n      \"when\": 1701463431394,\n      \"tag\": \"0014_needy_ben_grimm\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 15,\n      \"version\": \"5\",\n      \"when\": 1701478557950,\n      \"tag\": \"0015_complete_wolf_cub\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 16,\n      \"version\": \"6\",\n      \"when\": 1732499276499,\n      \"tag\": \"0016_demonic_legion\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 17,\n      \"version\": \"6\",\n      \"when\": 1732832624307,\n      \"tag\": \"0017_pink_maestro\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 18,\n      \"version\": \"6\",\n      \"when\": 1732833549246,\n      \"tag\": \"0018_heavy_toad\",\n      \"breakpoints\": true\n    },\n    {\n      \"idx\": 19,\n      \"version\": \"6\",\n      \"when\": 1733272274985,\n      \"tag\": \"0019_known_satana\",\n      \"breakpoints\": true\n    }\n  ]\n}"
  },
  {
    "path": "packages/insights/drizzle.config.ts",
    "content": "import { Config } from 'drizzle-kit';\nimport * as dotenv from 'dotenv';\ndotenv.config();\ndotenv.config({ path: '.env.local' });\n\nexport const PRIVATE_LIBSQL_DB_URL = process.env.PRIVATE_LIBSQL_DB_URL!;\nexport const PRIVATE_LIBSQL_DB_API_TOKEN = process.env.PRIVATE_LIBSQL_DB_API_TOKEN!;\nconst isLocalDB = PRIVATE_LIBSQL_DB_URL.startsWith('ws://');\n\nconst local: Config = {\n  schema: './src/db/schema.ts',\n  out: './drizzle',\n  dialect: 'sqlite',\n  dbCredentials: {\n    url: PRIVATE_LIBSQL_DB_URL,\n  },\n};\n\nconst prod: Config = {\n  schema: './src/db/schema.ts',\n  out: './drizzle',\n  dialect: 'turso',\n  dbCredentials: {\n    url: PRIVATE_LIBSQL_DB_URL,\n    authToken: PRIVATE_LIBSQL_DB_API_TOKEN,\n  },\n};\nconsole.log('Drizzle config:', isLocalDB ? 'local' : 'prod');\nexport default isLocalDB ? local : prod;\n"
  },
  {
    "path": "packages/insights/eslint.config.mjs",
    "content": "import globals from 'globals';\nimport js from '@eslint/js';\nimport tseslint from 'typescript-eslint';\nimport { qwikEslint9Plugin } from 'eslint-plugin-qwik';\nimport { globalIgnores } from 'eslint/config';\n\nconst ignores = [\n  '**/*.log',\n  '**/.DS_Store',\n  '**/*.',\n  '.vscode/settings.json',\n  '**/.history',\n  '**/.yarn',\n  '**/bazel-*',\n  '**/bazel-bin',\n  '**/bazel-out',\n  '**/bazel-qwik',\n  '**/bazel-testlogs',\n  '**/dist',\n  '**/dist-dev',\n  '**/lib',\n  '**/lib-types',\n  '**/etc',\n  '**/external',\n  '**/node_modules',\n  '**/temp',\n  '**/tsc-out',\n  '**/tsdoc-metadata.json',\n  '**/target',\n  '**/output',\n  '**/rollup.config.js',\n  '**/build',\n  '**/.cache',\n  '**/.vscode',\n  '**/.rollup.cache',\n  '**/dist',\n  '**/tsconfig.tsbuildinfo',\n  '**/vite.config.ts',\n  '**/*.spec.tsx',\n  '**/*.spec.ts',\n  '**/.netlify',\n  '**/pnpm-lock.yaml',\n  '**/package-lock.json',\n  '**/yarn.lock',\n  '**/server',\n  'src/styled-system',\n  '**/panda.config.ts',\n  '**/drizzle.config.ts',\n  'eslint.config.mjs',\n];\n\nexport default tseslint.config(\n  globalIgnores(ignores),\n  js.configs.recommended,\n  tseslint.configs.recommended,\n  qwikEslint9Plugin.configs.recommended,\n  {\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        ...globals.node,\n        ...globals.es2021,\n      },\n      parserOptions: {\n        projectService: true,\n        tsconfigRootDir: import.meta.dirname,\n        ecmaFeatures: {\n          jsx: true,\n        },\n      },\n    },\n  },\n  {\n    rules: {\n      '@typescript-eslint/no-explicit-any': 'off',\n      '@typescript-eslint/explicit-module-boundary-types': 'off',\n      '@typescript-eslint/no-inferrable-types': 'off',\n      '@typescript-eslint/no-non-null-assertion': 'off',\n      '@typescript-eslint/no-empty-interface': 'off',\n      '@typescript-eslint/no-namespace': 'off',\n      '@typescript-eslint/no-empty-function': 'off',\n      '@typescript-eslint/no-this-alias': 'off',\n      '@typescript-eslint/ban-types': 'off',\n      '@typescript-eslint/ban-ts-comment': 'off',\n      'prefer-spread': 'off',\n      'no-case-declarations': 'off',\n      'no-console': 'off',\n      '@typescript-eslint/consistent-type-imports': 'warn',\n      '@typescript-eslint/no-unnecessary-condition': 'warn',\n      '@typescript-eslint/no-unused-expressions': 'off',\n      '@typescript-eslint/no-empty-object-type': 'off',\n      '@typescript-eslint/no-unsafe-function-type': 'off',\n      '@typescript-eslint/no-unused-vars': 'off',\n      curly: 'error',\n    },\n  }\n);\n"
  },
  {
    "path": "packages/insights/package.json",
    "content": "{\n  \"name\": \"insights\",\n  \"description\": \"Qwik Insights dashboard\",\n  \"version\": \"0.1.0\",\n  \"dependencies\": {\n    \"@auth/qwik\": \"0.8.0\",\n    \"@libsql/client\": \"^0.15.10\",\n    \"@modular-forms/qwik\": \"^0.23.1\",\n    \"@typescript/analyze-trace\": \"^0.10.1\",\n    \"density-clustering\": \"^1.3.0\",\n    \"dotenv\": \"^16.5.0\",\n    \"drizzle-kit\": \"^0.31.4\",\n    \"drizzle-orm\": \"0.44.4\"\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@builder.io/qwik-city\": \"workspace:^\",\n    \"@builder.io/qwik-labs\": \"workspace:^\",\n    \"@eslint/js\": \"9.32.0\",\n    \"@netlify/edge-functions\": \"2.17.0\",\n    \"@tailwindcss/vite\": \"4.1.11\",\n    \"@types/density-clustering\": \"1.3.3\",\n    \"@types/node\": \"20.19.0\",\n    \"autoprefixer\": \"10.4.21\",\n    \"eslint\": \"9.32.0\",\n    \"eslint-plugin-qwik\": \"workspace:^\",\n    \"globals\": \"16.4.0\",\n    \"netlify-cli\": \"21.5.0\",\n    \"postcss\": \"8.5.6\",\n    \"prettier\": \"3.6.2\",\n    \"prettier-plugin-tailwindcss\": \"0.6.14\",\n    \"tailwindcss\": \"4.1.14\",\n    \"typescript\": \"5.4.5\",\n    \"typescript-eslint\": \"8.38.0\",\n    \"undici\": \"*\",\n    \"vite\": \"7.3.1\",\n    \"vite-tsconfig-paths\": \"5.1.4\",\n    \"vitest\": \"3.2.4\",\n    \"zod\": \"3.25.48\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"private\": true,\n  \"scripts\": {\n    \"build\": \"qwik build\",\n    \"build.client\": \"vite build\",\n    \"build.preview\": \"vite build --ssr src/entry.preview.tsx\",\n    \"build.server\": \"vite build -c adapters/netlify-edge/vite.config.ts\",\n    \"build.types\": \"tsc --incremental --noEmit\",\n    \"db.local\": \"turso dev --db-file ./tmp/local.db\",\n    \"db.migrate\": \"node scripts/db.migrate.cjs\",\n    \"db.migrate.generate\": \"./node_modules/.bin/drizzle-kit generate\",\n    \"db.migrate.up\": \"./node_modules/.bin/drizzle-kit up\",\n    \"db.studio\": \"./node_modules/.bin/drizzle-kit studio --verbose\",\n    \"deploy\": \"netlify deploy --build\",\n    \"dev\": \"vite --mode ssr\",\n    \"dev.debug\": \"node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"fmt\": \"prettier --write .\",\n    \"fmt.check\": \"prettier --check .\",\n    \"lint\": \"eslint \\\"src/**/*.ts*\\\"\",\n    \"lint.fix\": \"eslint --fix \\\"src/**/*.ts*\\\"\",\n    \"preview\": \"qwik build preview && vite preview --open\",\n    \"qManifest.post\": \"curl -X POST -H 'Content-Type: application/json' -d @./dist/q-manifest.json https://qwik-insights.builder.io/api/v1/221smyuj5gl/post/manifest/\",\n    \"qManifest.post.local\": \"curl -X POST -H 'Content-Type: application/json' -d @./dist/q-manifest.json http://localhost:5173/api/v1/221smyuj5gl/post/manifest/\",\n    \"qwik\": \"qwik\",\n    \"start\": \"vite --open --mode ssr\",\n    \"test.cluster\": \"node src/cluster.ts\",\n    \"test.unit\": \"vitest\",\n    \"test.watch\": \"vitest --watch\"\n  },\n  \"sideEffects\": false,\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "packages/insights/public/_headers",
    "content": "/build/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n/assets/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n"
  },
  {
    "path": "packages/insights/public/manifest.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/web-manifest-combined.json\",\n  \"name\": \"qwik-project-name\",\n  \"short_name\": \"Welcome to Qwik\",\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"background_color\": \"#fff\",\n  \"description\": \"A Qwik project app.\"\n}\n"
  },
  {
    "path": "packages/insights/public/robots.txt",
    "content": ""
  },
  {
    "path": "packages/insights/scripts/db.migrate.cjs",
    "content": "require('dotenv').config();\nrequire('dotenv').config({ path: '.env.local' });\n\nasync function migrateDB() {\n  const url = env('PRIVATE_LIBSQL_DB_URL');\n  const authToken = env('PRIVATE_LIBSQL_DB_API_TOKEN');\n  await migrateLibSql(url, authToken);\n}\n\nasync function migrateLibSql(url, authToken) {\n  const { createClient } = require('@libsql/client');\n  const { migrate } = require('drizzle-orm/libsql/migrator');\n  const { drizzle } = require('drizzle-orm/libsql');\n\n  const client = createClient({ url, authToken });\n  const db = drizzle(client);\n  console.log('Migrating DB...');\n  try {\n    await migrate(db, { migrationsFolder: './drizzle' });\n  } catch (e) {\n    console.error(e);\n  }\n  console.log('DB migrated');\n}\n\nfunction env(name) {\n  const value = globalThis[name] || process.env[name];\n  if (!value) throw new Error(`Missing env var: ${name}`);\n  return value;\n}\n\nmigrateDB().then(\n  (e) => {\n    process.exit(0);\n  },\n  (e) => {\n    console.error(e);\n    process.exit(1);\n  }\n);\n"
  },
  {
    "path": "packages/insights/src/components/app-card/index.tsx",
    "content": "import { AppLink } from '~/routes.config';\nimport { CopyIcon } from '../icons/copy';\nimport Gauge from '../gauge';\nimport { component$ } from '@builder.io/qwik';\n\ntype AppCardProps = {\n  mode: 'show' | 'create' | 'link';\n  title?: string;\n  publicApiKey?: string;\n  description?: string | null;\n};\n\nexport default component$<AppCardProps>(({ mode, title = '', publicApiKey = '__new__' }) => {\n  const link = mode === 'show' ? `/app/[publicApiKey]/` : `/app/add/`;\n  const label = mode === 'create' ? '+' : mode === 'link' ? '~' : title;\n  const gaugeColor = mode === 'show' ? 'default' : 'gray';\n\n  return (\n    <AppLink route={link} param:publicApiKey={publicApiKey}>\n      <div class=\"cursor-pointer rounded-lg bg-white p-6\">\n        <div class=\"flex items-center gap-4\">\n          <div class=\"min-w-[80px]\">\n            <Gauge radius={40} value={70} label={label} color={gaugeColor} />\n          </div>\n          <div>\n            {mode === 'show' ? (\n              <>\n                <div class=\"h6\">{title}</div>\n                <div class=\"flex gap-6 text-xs\">\n                  <span>Token: {publicApiKey}</span>\n                  <CopyIcon\n                    onClick$={() => {\n                      navigator.clipboard.writeText(publicApiKey);\n                    }}\n                  />\n                </div>\n              </>\n            ) : (\n              <div class=\"h6\">{title}</div>\n            )}\n          </div>\n        </div>\n      </div>\n    </AppLink>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/avatar/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ntype AvatarProps = {\n  src: string;\n  alt: string;\n  size?: 'small' | 'medium' | 'large';\n};\n\n/**\n * Todos:\n *\n * - Implement sizes\n * - Add a link to open the menu\n */\n\nexport default component$<AvatarProps>((props) => {\n  return (\n    <img\n      src={props.src}\n      alt={props.alt}\n      class=\"overflow-hidden rounded-full border border-slate-300 leading-[0px]\"\n      width=\"40\"\n      height=\"40\"\n    />\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/bundle/index.tsx",
    "content": "import { BundleIcon } from '../icons/bundle';\nimport { component$ } from '@builder.io/qwik';\n\nexport const BundleCmp = component$<{ name: string }>(({ name }) => {\n  return (\n    <code>\n      <BundleIcon />\n      <span class=\"ml-1\">{name}</span>\n    </code>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/button/index.tsx",
    "content": "import { type QwikIntrinsicElements, Slot, component$ } from '@builder.io/qwik';\n\ntype ButtonProps = QwikIntrinsicElements['button'] & {\n  theme?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'github';\n  size?: 'small' | 'medium' | 'large';\n  variant?: 'outlined' | 'contained';\n};\n\n/**\n * Todos:\n *\n * - Implement sizes\n * - Implement themes\n * - Implement variants\n */\n\nexport default component$<ButtonProps>((props) => {\n  return (\n    <button\n      {...props}\n      class={[\n        'button',\n        props.theme === 'primary' && 'border-slate-300 bg-white  text-black',\n        props.theme === 'github' && 'bg-black text-white',\n      ]}\n    >\n      <Slot />\n    </button>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/container/index.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\n\ntype LayoutProps = {\n  position?: 'left' | 'center';\n  width?: 'small' | 'medium' | 'full';\n};\n\nexport default component$<LayoutProps>(({ position = 'left', width = 'full' }) => {\n  return (\n    <div\n      class={[\n        'full-width',\n        position === 'center' && 'm-auto',\n        width === 'small' && 'max-w-[600px]',\n        width === 'medium' && 'max-w-[800px]',\n      ]}\n    >\n      <Slot />\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/gauge/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\n\ntype GaugeProps = {\n  value?: number;\n  label?: string;\n  radius?: number;\n  color?: 'default' | 'gray';\n};\n\nexport const getLabel = (title: string) => title.substring(0, 2).toUpperCase();\n\nexport default component$<GaugeProps>(\n  ({ value = 50, radius = 120, label = `${value}`, color = 'default' }) => {\n    const GRADIENT_ID = `svg-gauge-gradient-${Math.floor(Math.random() * 10000)}`;\n\n    const safeValue = value < 0 || value > 100 ? 50 : value;\n    const safeLabel = label.length > 2 ? getLabel(label) : label;\n    const progressBorderWidth = radius / 6;\n    const startColor = color === 'default' ? '#18B6F6' : '#BDBDBD';\n    const stopColor = color === 'default' ? '#AC7FF4' : '#BDBDBD';\n\n    return (\n      <div class=\"relative\" style={{ width: `${radius * 2}px`, height: `${radius * 2}px` }}>\n        <svg viewBox={`0 0 ${radius * 2} ${radius * 2}`}>\n          <defs>\n            <linearGradient id={GRADIENT_ID} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n              <stop offset=\"0%\" stop-color={startColor} />\n              <stop offset=\"1000%\" stop-color={stopColor} />\n            </linearGradient>\n          </defs>\n\n          <circle\n            r={radius - progressBorderWidth / 2}\n            cx={radius}\n            cy={radius}\n            stroke-width={progressBorderWidth}\n            style=\"fill: #000; stroke: #0000\"\n          ></circle>\n\n          <circle\n            r={radius - progressBorderWidth / 2}\n            cx={radius}\n            cy={radius}\n            stroke-width={progressBorderWidth}\n            style={`transform: rotate(-87.9537deg); stroke-dasharray: ${\n              (safeValue * 3.51 * radius) / 60\n            }, 351.858; fill:none; transform-origin:50% 50%; stroke-linecap:round; stroke:url(#${GRADIENT_ID})`}\n          ></circle>\n        </svg>\n        <span\n          class=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center text-white\"\n          style={{ fontSize: `${radius / 24}rem` }}\n        >\n          {safeLabel}\n        </span>\n      </div>\n    );\n  }\n);\n"
  },
  {
    "path": "packages/insights/src/components/header/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { Link } from '@builder.io/qwik-city';\nimport { useSession, useSignOut } from '~/routes/plugin@auth';\nimport Avatar from '../avatar';\nimport { QwikIcon } from '../icons/qwik';\n\nexport default component$(() => {\n  const signOutSig = useSignOut();\n  const userCtx = useSession();\n\n  return (\n    <header class=\"flex items-center gap-3 border border-b-slate-200 px-6 py-3\">\n      <Link href=\"/app/\">\n        <QwikIcon width=\"46\" height=\"50\" />\n      </Link>\n      <span class=\"font-thin\">Insights</span>\n\n      {userCtx.value?.user?.email && (\n        <div class=\"ml-auto flex items-center justify-center gap-8\">\n          <Link href=\"/\">Setting</Link>\n          <Link\n            class=\"cursor-pointer\"\n            onClick$={() => {\n              signOutSig.submit({ redirectTo: '/' });\n            }}\n          >\n            Logout\n          </Link>\n          <Avatar\n            src={userCtx.value.user.image ?? ''}\n            alt={userCtx.value.user.name ?? ''}\n            size=\"small\"\n          />\n        </div>\n      )}\n    </header>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/histogram/index.tsx",
    "content": "import { component$, useStore, useComputed$, type QwikMouseEvent } from '@builder.io/qwik';\nimport { vectorMax, type Bucket } from '~/stats/vector';\n\nconst height = 75;\n\n// color values are mapped to tailwind classes! make sure to update them as well in this file\nexport const latencyColors = ['green', 10, 'yellow', 50, 'red', Number.MAX_SAFE_INTEGER];\nexport const delayColors = ['gray', 250, 'lightgray', Number.MAX_SAFE_INTEGER];\nexport const grayColors = ['gray', Number.MAX_SAFE_INTEGER];\n\nexport default component$<{\n  name?: string;\n  vector: number[];\n  colors?: (string | number)[];\n  buckets: Bucket[];\n}>(({ name, vector, buckets, colors = grayColors }) => {\n  const callout = useStore({\n    show: false,\n    x: 0,\n    y: 0,\n    value: 0,\n    min: 0,\n    avg: 0,\n    max: 0,\n  });\n  const max = vectorMax(vector);\n  const barColors = useComputed$(() => {\n    const barColors = [];\n    let currentColor = colors[0] as string;\n    let colorIdx = 1;\n    for (let i = 0; i < buckets.length; i++) {\n      const bucket = buckets[i];\n      const color = colors[colorIdx];\n      if (typeof color === 'number') {\n        if (color < bucket.min) {\n          colorIdx++;\n          currentColor = colors[colorIdx] as string;\n          colorIdx++;\n        }\n      }\n      barColors.push(currentColor);\n    }\n    return barColors;\n  });\n  return (\n    // 18 = histogram info (callout) height below the chart on hover\n    <div class=\"inline-block\" style={{ height: height + 18 + 'px' }}>\n      {name && <h2>{name}</h2>}\n      <ol\n        class=\"flex order-last items-end justify-between w-[400px] box-content border-b border-b-slate-200\"\n        style={{ height: height + 'px' }}\n        onMouseEnter$={() => (callout.show = true)}\n        onMouseLeave$={() => (callout.show = false)}\n        onMouseMove$={(event: QwikMouseEvent<MouseEvent>) => {\n          callout.x = event.clientX;\n          callout.y = event.clientY;\n          const target = event.target as HTMLElement;\n          const targetData = target.closest('[data-histogram]') || target;\n          const data = targetData.getAttribute('data-histogram');\n          if (data) {\n            const [value, min, avg, max] = data.split(';');\n            callout.value = Number(value);\n            callout.min = Number(min);\n            callout.avg = Number(avg);\n            callout.max = Number(max);\n          }\n        }}\n      >\n        {vector.map((value, idx) => (\n          <li\n            class=\"flex items-end justify-between\"\n            key={idx}\n            style={{ height: height + 'px' }}\n            data-histogram={`${value};${buckets[idx].min};${buckets[idx].avg};${buckets[idx].max}`}\n          >\n            <div\n              class={[\n                'inline-block w-[7px] rounded-t-lg',\n                { 'bg-lime-500': barColors.value[idx] === 'green' },\n                { 'bg-yellow-500': barColors.value[idx] === 'yellow' },\n                { 'bg-red-500': barColors.value[idx] === 'red' },\n                { 'bg-slate-500': barColors.value[idx] === 'gray' },\n                { 'bg-slate-300': barColors.value[idx] === 'lightgray' },\n              ]}\n              style={{\n                height: (height * value) / max + 'px',\n              }}\n            >\n              {/* <code class={css({ display: 'inline-block', fontSize: 8 })}>{value}</code> */}\n            </div>\n          </li>\n        ))}\n      </ol>\n      <div\n        style={{\n          display: callout.show ? 'inline-block' : 'none',\n          top: callout.y + 4 + 'px',\n          left: callout.x + 4 + 'px',\n        }}\n      >\n        <code>{formatNumber(callout.value)} </code>\n        <code>{formatNumber(callout.avg)}</code>\n        <code>\n          [{formatNumber(callout.min)}, {formatNumber(callout.max)})\n        </code>\n      </div>\n    </div>\n  );\n});\n\nfunction formatNumber(number: number): string {\n  return Math.round(number).toLocaleString();\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/apps.tsx",
    "content": "import type { QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function AppsIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 16 16\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M1.5 3.25c0-.966.784-1.75 1.75-1.75h2.5c.966 0 1.75.784 1.75 1.75v2.5A1.75 1.75 0 0 1 5.75 7.5h-2.5A1.75 1.75 0 0 1 1.5 5.75Zm7 0c0-.966.784-1.75 1.75-1.75h2.5c.966 0 1.75.784 1.75 1.75v2.5a1.75 1.75 0 0 1-1.75 1.75h-2.5A1.75 1.75 0 0 1 8.5 5.75Zm-7 7c0-.966.784-1.75 1.75-1.75h2.5c.966 0 1.75.784 1.75 1.75v2.5a1.75 1.75 0 0 1-1.75 1.75h-2.5a1.75 1.75 0 0 1-1.75-1.75Zm7 0c0-.966.784-1.75 1.75-1.75h2.5c.966 0 1.75.784 1.75 1.75v2.5a1.75 1.75 0 0 1-1.75 1.75h-2.5a1.75 1.75 0 0 1-1.75-1.75ZM3.25 3a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h2.5A.25.25 0 0 0 6 5.75v-2.5A.25.25 0 0 0 5.75 3Zm7 0a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h2.5a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25Zm-7 7a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h2.5a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25Zm7 0a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h2.5a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25Z\"\n      ></path>\n    </svg>\n  );\n}\nexport default AppsIcon;\n"
  },
  {
    "path": "packages/insights/src/components/icons/bundle.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function BundleIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 36 36\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"black\"\n        d=\"m32.43 8.35l-13-6.21a1 1 0 0 0-.87 0l-15 7.24a1 1 0 0 0-.57.9v16.55a1 1 0 0 0 .6.92l13 6.19a1 1 0 0 0 .87 0l15-7.24a1 1 0 0 0 .57-.9V9.25a1 1 0 0 0-.6-.9ZM19 4.15l10.93 5.22l-5.05 2.44l-10.67-5.35Zm-2 11.49L6 10.41l5.9-2.85l10.7 5.35ZM5 12.13l11 5.27v14.06L5 26.2Zm13 19.32V17.36l13-6.29v14.1Z\"\n        class=\"clr-i-outline clr-i-outline-path-1\"\n      ></path>\n      <path fill=\"none\" d=\"M0 0h36v36H0z\"></path>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/close.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function CloseIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m-3.4 14L12 13.4L8.4 17L7 15.6l3.6-3.6L7 8.4L8.4 7l3.6 3.6L15.6 7L17 8.4L13.4 12l3.6 3.6l-1.4 1.4Z\"\n      ></path>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/copy.tsx",
    "content": "import { component$, useSignal, type QRL, useStylesScoped$ } from '@builder.io/qwik';\n\ninterface CopyIconProps {\n  class?: string;\n  onClick$: QRL<() => void>;\n}\n\nexport const CopyIcon = component$<CopyIconProps>(({ onClick$, ...props }) => {\n  useStylesScoped$(`\n    .wrapper {\n      display: flex;\n    }\n  `);\n  const copiedSig = useSignal(false);\n\n  return (\n    <span\n      class=\"wrapper\"\n      preventdefault:click\n      onClick$={() => {\n        onClick$();\n        copiedSig.value = true;\n        setTimeout(() => (copiedSig.value = false), 2000);\n      }}\n    >\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        width=\"1rem\"\n        height=\"1rem\"\n        viewBox=\"0 0 24 24\"\n        aria-hidden=\"true\"\n        preventdefault:click\n        {...props}\n      >\n        <path\n          fill=\"currentColor\"\n          d=\"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z\"\n        ></path>\n      </svg>\n      &nbsp;{copiedSig.value ? 'Copied' : 'Copy'}\n    </span>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/icons/dark-mode.tsx",
    "content": "import type { QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function DarkModeIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M12 21q-3.75 0-6.375-2.625T3 12q0-3.75 2.625-6.375T12 3q.35 0 .688.025t.662.075q-1.025.725-1.638 1.888T11.1 7.5q0 2.25 1.575 3.825T16.5 12.9q1.375 0 2.525-.613T20.9 10.65q.05.325.075.662T21 12q0 3.75-2.625 6.375T12 21Z\"\n      ></path>\n    </svg>\n  );\n}\nexport default DarkModeIcon;\n"
  },
  {
    "path": "packages/insights/src/components/icons/dashboard.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function DashboardIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <g\n        fill=\"none\"\n        stroke=\"black\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        stroke-width=\"1.5\"\n      >\n        <path d=\"M12 4v4M4 8l2.5 2.5m11 0L20 8M3 17h3m6 0l1-6m5 6h3M8.5 20.001H4A9.956 9.956 0 0 1 2 14C2 8.477 6.477 4 12 4s10 4.477 10 10c0 2.252-.744 4.33-2 6.001L15.5 20\"></path>\n        <path d=\"M12 23a3 3 0 1 0 0-6a3 3 0 0 0 0 6Z\"></path>\n      </g>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/disk.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function DiskIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h11.175q.4 0 .763.15t.637.425l2.85 2.85q.275.275.425.638t.15.762V19q0 .825-.588 1.413T19 21H5ZM19 7.85L16.15 5H5v14h14V7.85ZM12 18q1.25 0 2.125-.875T15 15q0-1.25-.875-2.125T12 12q-1.25 0-2.125.875T9 15q0 1.25.875 2.125T12 18Zm-5-8h7q.425 0 .713-.288T15 9V7q0-.425-.288-.713T14 6H7q-.425 0-.713.288T6 7v2q0 .425.288.713T7 10ZM5 7.85V19V5v2.85Z\"\n      ></path>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/edge.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function EdgeIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"none\"\n        stroke=\"black\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        stroke-width=\"2\"\n        d=\"M18 3a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3M3 18V6a3 3 0 1 1 6 0v12a3 3 0 0 1-6 0zm6-6h8m-3 3l3-3l-3-3\"\n      ></path>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/edit.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport const EditIcon = function MaterialSymbolsEditSquareOutlineRounded(\n  props: QwikIntrinsicElements['svg'],\n  key: string\n) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"black\"\n        d=\"M5 23.7q-.825 0-1.413-.587T3 21.7v-14q0-.825.588-1.413T5 5.7h8.925l-2 2H5v14h14v-6.95l2-2v8.95q0 .825-.588 1.413T19 23.7H5Zm7-9Zm4.175-8.425l1.425 1.4l-6.6 6.6V15.7h1.4l6.625-6.625l1.425 1.4l-6.625 6.625q-.275.275-.638.438t-.762.162H10q-.425 0-.713-.288T9 16.7v-2.425q0-.4.15-.763t.425-.637l6.6-6.6Zm4.275 4.2l-4.275-4.2l2.5-2.5q.6-.6 1.438-.6t1.412.6l1.4 1.425q.575.575.575 1.4T22.925 8l-2.475 2.475Z\"\n      ></path>\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/insights/src/components/icons/error.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport const ErrorIcon = function MaterialSymbolsChatErrorSharp(\n  props: QwikIntrinsicElements['svg'],\n  key: string\n) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"black\"\n        d=\"M2 22V2h20v16H6l-4 4Zm7.4-8l2.6-2.6l2.6 2.6l1.4-1.4l-2.6-2.6L16 7.4L14.6 6L12 8.6L9.4 6L8 7.4l2.6 2.6L8 12.6L9.4 14Z\"\n      ></path>\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/insights/src/components/icons/github.tsx",
    "content": "import type { QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function GithubIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 16 16\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38c0-.27.01-1.13.01-2.2c0-.75-.25-1.23-.54-1.48c1.78-.2 3.65-.88 3.65-3.95c0-.88-.31-1.59-.82-2.15c.08-.2.36-1.02-.08-2.12c0 0-.67-.22-2.2.82c-.64-.18-1.32-.27-2-.27c-.68 0-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82c-.44 1.1-.16 1.92-.08 2.12c-.51.56-.82 1.28-.82 2.15c0 3.06 1.86 3.75 3.64 3.95c-.23.2-.44.55-.51 1.07c-.46.21-1.61.55-2.33-.66c-.15-.24-.6-.83-1.23-.82c-.67.01-.27.38.01.53c.34.19.73.9.82 1.13c.16.45.68 1.31 2.69.94c0 .67.01 1.3.01 1.49c0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z\"\n      ></path>\n    </svg>\n  );\n}\nexport default GithubIcon;\n"
  },
  {
    "path": "packages/insights/src/components/icons/light-mode.tsx",
    "content": "import type { QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function LightModeIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M12 17q-2.075 0-3.538-1.463T7 12q0-2.075 1.463-3.538T12 7q2.075 0 3.538 1.463T17 12q0 2.075-1.463 3.538T12 17ZM1 13v-2h4v2H1Zm18 0v-2h4v2h-4Zm-8-8V1h2v4h-2Zm0 18v-4h2v4h-2ZM6.35 7.75L3.875 5.275l1.4-1.4L7.75 6.35l-1.4 1.4Zm12.375 12.375L16.25 17.65l1.4-1.4l2.475 2.475l-1.4 1.4ZM17.65 7.75l-1.4-1.4l2.475-2.475l1.4 1.4L17.65 7.75ZM5.275 20.125l-1.4-1.4L6.35 16.25l1.4 1.4l-2.475 2.475Z\"\n      ></path>\n    </svg>\n  );\n}\nexport default LightModeIcon;\n"
  },
  {
    "path": "packages/insights/src/components/icons/manifest.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function ManifestIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <g fill=\"none\">\n        <path\n          stroke=\"black\"\n          stroke-linecap=\"round\"\n          stroke-linejoin=\"round\"\n          stroke-width=\"2\"\n          d=\"M14 8H9m2 4H9\"\n        ></path>\n        <path\n          fill=\"black\"\n          d=\"M3 16h8c0 1.333.8 4 4 4a3 3 0 0 0 3-3V4h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1v7a3 3 0 0 1-3 3H5a2 2 0 0 1-2-2v-2z\"\n        ></path>\n        <path\n          stroke=\"black\"\n          stroke-linecap=\"round\"\n          stroke-linejoin=\"round\"\n          stroke-width=\"2\"\n          d=\"M15 20c-3.2 0-4-2.667-4-4H3v2a2 2 0 0 0 2 2h10zm0 0a3 3 0 0 0 3-3v-7m0-6H7a2 2 0 0 0-2 2v9.5M18 4h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1m0-6v6\"\n        ></path>\n      </g>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/qwik.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport const QwikIcon = function FluentAnimalTurtle24Regular(\n  props: QwikIntrinsicElements['svg'],\n  key: string\n) {\n  return (\n    <svg\n      width=\"500\"\n      height=\"506\"\n      viewBox=\"0 0 500 506\"\n      fill=\"none\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill-rule=\"evenodd\"\n        clip-rule=\"evenodd\"\n        d=\"M250 449.707L431.102 505.511L343.037 423.652L129.174 224.859L179.178 174.86L156.157 16.117L8.34822 193.702C-2.78296 212.982 -2.78273 236.736 8.34883 256.016L102.191 418.551C113.323 437.831 133.894 449.707 156.156 449.707L250 449.707Z\"\n        fill=\"#18B6F6\"\n      />\n      <path\n        d=\"M343.843 0L156.157 1.74069e-05C133.894 1.94717e-05 113.323 11.8771 102.192 31.1573L8.34822 193.702L156.157 16.117L370.826 224.859L330.828 264.86L343.037 423.652L431.102 505.511C436.18 507.075 440.635 501.755 438.204 497.031L397.809 418.551L491.651 256.016C502.783 236.736 502.783 212.982 491.652 193.702L397.808 31.1572C386.677 11.8771 366.106 -2.06475e-06 343.843 0Z\"\n        fill=\"#AC7EF4\"\n      />\n      <path\n        d=\"M370.826 224.859L156.157 16.117L179.178 174.86L129.174 224.859L343.037 423.652L330.828 264.86L370.826 224.859Z\"\n        fill=\"white\"\n      />\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/insights/src/components/icons/routes.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport function RoutesIcon(props: QwikIntrinsicElements['svg'], key: string) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <g fill=\"none\">\n        <path\n          stroke=\"black\"\n          stroke-linecap=\"round\"\n          stroke-linejoin=\"round\"\n          stroke-width=\"2\"\n          d=\"M5 9a2 2 0 1 0 0-4a2 2 0 0 0 0 4zm0 0v1m0 7v-1m2 3a2 2 0 1 0-4 0a2 2 0 0 0 4 0zm0 0h1m9-2a2 2 0 1 1-2 2m2-2a2 2 0 0 0-2 2m2-2v-1m-2 3h-1\"\n        ></path>\n        <circle cx=\"5\" cy=\"13\" r=\"1\" fill=\"black\"></circle>\n        <circle cx=\"11\" cy=\"19\" r=\"1\" fill=\"black\"></circle>\n        <path\n          stroke=\"black\"\n          stroke-linecap=\"round\"\n          stroke-linejoin=\"round\"\n          stroke-width=\"2\"\n          d=\"M21 7c0 2.611-4 6-4 6s-4-3.389-4-6s1.79-4 4-4s4 1.389 4 4z\"\n        ></path>\n        <circle cx=\"17\" cy=\"7\" r=\"1\" fill=\"black\"></circle>\n      </g>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/components/icons/slow.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport const SlowIcon = function FluentAnimalTurtle24Regular(\n  props: QwikIntrinsicElements['svg'],\n  key: string\n) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"black\"\n        d=\"M10.997 5.998a6.14 6.14 0 0 1 5.8 4.126l.075.233l.044.144h2.33a2.749 2.749 0 0 1 2.744 2.582l.005.167v1a1.75 1.75 0 0 1-1.606 1.743l-.143.005H18.62l.241.584a1.75 1.75 0 0 1-.813 2.22l-.137.064a1.749 1.749 0 0 1-.496.124l-.171.008h-1.787a1.75 1.75 0 0 1-1.51-.867l-.072-.137l-.539-1.143l.054-.007c-1.4.186-2.817.208-4.221.066l-.497-.057l-.535 1.136a1.75 1.75 0 0 1-1.583 1.005H4.75a1.749 1.749 0 0 1-1.618-2.415l.433-1.05a3.242 3.242 0 0 1-1.57-2.78a.75.75 0 0 1 .648-.742L2.745 12h1.88l.497-1.643a6.137 6.137 0 0 1 5.875-4.359Zm6.777 9.693c-.771.31-1.559.565-2.356.765l-.549.129l.362.77a.25.25 0 0 0 .117.119l.053.018l.056.007h1.787a.25.25 0 0 0 .248-.28l-.017-.065l-.478-1.156h-.043l.411-.148l.409-.159Zm-13.552 0l.39.152l.388.141l-.482 1.166a.25.25 0 0 0 .232.345h1.804l.057-.007a.25.25 0 0 0 .17-.137l.359-.763l.044.01a18.168 18.168 0 0 1-2.962-.906Zm6.775-8.194a4.638 4.638 0 0 0-4.371 3.087l-.068.207l-1.136 3.75l.163.059a16.67 16.67 0 0 0 10.42.133l.406-.133l.162-.059l-1.136-3.75a4.64 4.64 0 0 0-4.006-3.273l-.216-.016l-.218-.005Zm-6.977 6.5l.151-.5l-.507.002l.025.052c.086.166.198.316.33.446ZM17.37 12l.756 2.498l2.12.001a.25.25 0 0 0 .243-.192l.007-.058v-.999a1.25 1.25 0 0 0-1.122-1.243l-.128-.006H17.37Z\"\n      ></path>\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/insights/src/components/icons/symbol.tsx",
    "content": "import { type QwikIntrinsicElements } from '@builder.io/qwik';\n\nexport const SymbolIcon = function MaterialSymbolsFunction(\n  props: QwikIntrinsicElements['svg'],\n  key: string\n) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      {...props}\n      key={key}\n    >\n      <path\n        fill=\"black\"\n        d=\"M10 18v-2h1.55l2.625-3l-2.625-3H9.9l-1.6 8.6q-.2 1.125-.925 1.763T5.525 21Q4.4 21 3.7 20.4T3 18.8q0-.8.425-1.288t1.075-.487q.625 0 1.063.425T6 18.475q0 .125-.013.225t-.037.225q.125-.025.213-.138t.137-.312L7.85 10H5V8h3.225l.525-2.85q.175-.95.938-1.55T11.5 3q1.1 0 1.8.65t.7 1.625q0 .75-.425 1.238T12.5 7q-.625 0-1.063-.425T11 5.525q0-.125.013-.225t.037-.225q-.15.05-.225.15t-.125.3L10.275 8H15v2h-.8l1.3 1.475L16.8 10H16V8h5v2h-1.55l-2.625 3l2.625 3H21v2h-5v-2h.8l-1.3-1.5l-1.3 1.5h.8v2h-5Z\"\n      ></path>\n    </svg>\n  );\n};\n"
  },
  {
    "path": "packages/insights/src/components/layout/index.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\n\nimport Header from '../header';\n\ntype LayoutProps = {\n  mode?: 'default' | 'bright';\n  class?: string;\n};\n\nexport default component$<LayoutProps>(({ mode = 'default', ...props }) => {\n  return (\n    <>\n      <Header />\n      <main class={[mode === 'bright' ? 'bg-white' : 'bg-slate-100', props.class]}>\n        <Slot />\n      </main>\n      {/* <footer>footer</footer> */}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/minifest-tile/index.tsx",
    "content": "import { ManifestIcon } from '../icons/manifest';\nimport { component$ } from '@builder.io/qwik';\n\nexport const ManifestTile = component$<{ hash: string }>(({ hash }) => {\n  return (\n    <code>\n      <ManifestIcon />\n      <span class=\"ml-1\">{hash}</span>\n    </code>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/popup-manager/index.tsx",
    "content": "import {\n  type Component,\n  Slot,\n  component$,\n  useStore,\n  useSignal,\n  $,\n  type NoSerialize,\n} from '@builder.io/qwik';\nimport { CloseIcon } from '../icons/close';\n\nexport const PopupManager = component$(() => {\n  const popupTarget = useSignal<HTMLElement>();\n  const popup = useStore({\n    Component: null as null | NoSerialize<Component<any>>,\n    props: null as any,\n    currentTarget: null as null | HTMLElement,\n    popupTarget: null as null | HTMLElement,\n    x: 0,\n    y: 0,\n  });\n  return (\n    <div\n      document:onMouseEnter$={(e) => {\n        const target = e.target;\n        if (isHTMLElement(target)) {\n          if (popup.currentTarget?.contains(target) || popupTarget.value?.contains(target)) {\n            return;\n          }\n          target.dispatchEvent(\n            new CustomEvent('popup', {\n              bubbles: false,\n              detail: {\n                show<T extends {}>(component: Component<T>, props: T) {\n                  // TODO: Remove cast once https://github.com/QwikDev/qwik/issues/4794 is fixed\n                  (popup as { Component: any }).Component = component;\n                  popup.props = props;\n                  popup.currentTarget = target;\n                },\n              } satisfies PopupEvent['detail'],\n            })\n          );\n        }\n      }}\n      document:onMouseLeave$={(e) => {\n        const target = e.target;\n        if (isHTMLElement(target)) {\n          if (\n            e.shiftKey ||\n            popup.currentTarget?.contains(target) ||\n            popupTarget.value?.contains(target) ||\n            popupTarget.value?.contains(e.relatedTarget as HTMLElement | null)\n          ) {\n            return;\n          }\n          popup.currentTarget = null;\n        }\n      }}\n      document:onMouseMove$={(e) => {\n        if (!e.shiftKey) {\n          popup.x = e.clientX;\n          popup.y = e.clientY;\n        }\n      }}\n    >\n      <Slot />\n      {popup.currentTarget && popup.Component ? (\n        <div\n          ref={popupTarget}\n          class=\"fixed inline-block border border-slate-200 bg-white shadow-lg z-10\"\n          style={{\n            top: popup.y + 4 + 'px',\n            left: popup.x + 4 + 'px',\n          }}\n        >\n          <CloseIcon\n            onClick$={$(() => (popup.currentTarget = null))}\n            class=\"absolute right-0 m-0\"\n          />\n          <popup.Component {...popup.props} />\n        </div>\n      ) : null}\n    </div>\n  );\n});\n\nfunction isHTMLElement(target: any): target is HTMLElement {\n  return target && target.nodeType === 1;\n}\n\nexport type PopupEvent = CustomEvent<{\n  show<PROPS extends {}>(component: Component<PROPS>, props: PROPS): void;\n}>;\n"
  },
  {
    "path": "packages/insights/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { useDocumentHead, useLocation } from '@builder.io/qwik-city';\n\n/** The RouterHead component is placed inside of the document `<head>` element. */\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.url.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n\n      {head.meta.map((m) => (\n        <meta key={m.key} {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link key={l.key} {...l} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style key={s.key} {...(s.props as any)} dangerouslySetInnerHTML={s.style} />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/components/symbol-tile/index.tsx",
    "content": "import { Resource, component$, useResource$, useStore } from '@builder.io/qwik';\nimport { server$, useLocation } from '@builder.io/qwik-city';\nimport { and, eq } from 'drizzle-orm';\nimport { getDB, symbolDetailTable } from '~/db';\nimport { SymbolIcon } from '../icons/symbol';\nimport { type PopupEvent } from '../popup-manager';\n\nexport const SymbolPopup = component$<{ symbolHash: string }>(({ symbolHash }) => (\n  <div class=\"min-w-[500px] max-w-[75vw]\">\n    <SymbolSource symbolHash={symbolHash} />\n  </div>\n));\n\nexport const SymbolSource = component$<{ symbolHash: string }>(({ symbolHash }) => {\n  const location = useLocation();\n  const state = useStore({\n    symbolHash: symbolHash,\n    fullName: '',\n    origin: '',\n    originUrl: '',\n    lo: 0,\n    hi: 0,\n  });\n  const source = useResource$(async ({ track }) => {\n    state.symbolHash = track(() => symbolHash);\n    if (state.symbolHash) {\n      state.fullName = '...';\n      state.origin = '...';\n      const data = await serverGetSourceSnippet(location.params.publicApiKey, state.symbolHash);\n      state.fullName = data.fullName;\n      state.origin = data.origin;\n      state.originUrl = data.originUrl;\n      return data.source;\n    } else {\n      return { preamble: '', highlight: '', postamble: '' };\n    }\n  });\n  return (\n    <div>\n      <h2 class=\"h5 px-6 py-3\">Details</h2>\n      <table class=\"w-full text-sm text-left\">\n        <tbody>\n          <tr class=\"border-y border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Symbol\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <code>{symbolHash}</code>\n            </td>\n          </tr>\n          <tr class=\"border-b border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Full Name\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <code>{state.fullName}</code>\n            </td>\n          </tr>\n          <tr class=\"border-b border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Origin\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <code>\n                {state.originUrl ? <a href={state.originUrl}>{state.origin}</a> : state.origin}\n              </code>\n            </td>\n          </tr>\n          <tr>\n            <td colSpan={2} class=\"px-6 py-3 text-xs\">\n              <Resource\n                value={source}\n                onPending={() => <div>loading...</div>}\n                onResolved={(source) => (\n                  <div>\n                    <pre>{source.preamble}</pre>\n                    <pre>{source.highlight}</pre>\n                    <pre>{source.postamble}</pre>\n                  </div>\n                )}\n              />\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </div>\n  );\n});\n\nexport const SymbolTile = component$<{ symbol: string }>(({ symbol }) => {\n  return (\n    <code onPopup$={(e: PopupEvent) => e.detail.show(SymbolPopup, { symbolHash: symbol })}>\n      <SymbolIcon />\n      <span class=\"ml-1\">{symbol}</span>\n    </code>\n  );\n});\n\nconst serverGetSourceSnippet = server$(async function (publicApiKey: string, symbolHash: string) {\n  const db = getDB();\n  let [symbolDetail] = await Promise.all([\n    db\n      .select({\n        fullName: symbolDetailTable.fullName,\n        origin: symbolDetailTable.origin,\n        lo: symbolDetailTable.lo,\n        hi: symbolDetailTable.hi,\n      })\n      .from(symbolDetailTable)\n      .where(\n        and(\n          //\n          eq(symbolDetailTable.publicApiKey, publicApiKey),\n          eq(symbolDetailTable.hash, symbolHash)\n        )\n      )\n      .get(),\n  ]);\n  if (!symbolDetail) {\n    symbolDetail = {\n      fullName: 'unknown',\n      origin: 'unknown',\n      lo: 0,\n      hi: 0,\n    };\n  }\n  let source = '...';\n  let url: URL | null = null;\n  let rawUrl: URL | null = null;\n  if (publicApiKey == '221smyuj5gl') {\n    const rawGithub = 'https://raw.githubusercontent.com/QwikDev/qwik/main/packages/docs/src/';\n    const github = 'https://github.com/QwikDev/qwik/blob/main/packages/docs/src/';\n    rawUrl = new URL(rawGithub);\n    url = new URL(github);\n    if (symbolDetail.origin.startsWith('./')) {\n      console.log('ORIGIN:', symbolDetail.origin);\n    } else {\n      rawUrl.pathname += symbolDetail.origin;\n      url.pathname += symbolDetail.origin;\n      const rawSource = await (await fetch(rawUrl.toString())).text();\n      source = rawSource;\n    }\n  }\n  return {\n    fullName: symbolDetail.fullName,\n    origin: symbolDetail.origin,\n    originUrl: url ? url.toString() : '',\n    source: codeHighlight(source, symbolDetail.lo, symbolDetail.hi),\n  };\n});\n\nfunction codeHighlight(\n  code: string,\n  lo: number,\n  hi: number\n): { preamble: string; highlight: string; postamble: string } {\n  const pre = code.substring(0, lo - 1);\n  let preNlIdx = pre.lastIndexOf('\\n', pre.length - 1);\n  preNlIdx = pre.lastIndexOf('\\n', preNlIdx - 1);\n  preNlIdx = pre.lastIndexOf('\\n', preNlIdx - 1);\n  const highlight = code.substring(lo - 1, hi - 1);\n  const post = code.substring(hi - 1);\n  let postNlIdx = post.indexOf('\\n', 1);\n  postNlIdx = post.indexOf('\\n', postNlIdx + 1);\n  postNlIdx = post.indexOf('\\n', postNlIdx + 1);\n  return {\n    preamble: pre.substring(preNlIdx + 1),\n    highlight,\n    postamble: post.substring(0, postNlIdx),\n  };\n}\n"
  },
  {
    "path": "packages/insights/src/db/README.md",
    "content": "Debugging SQLite responses:\n\n```\ncurl https://qwik-bundalyzer-mhevery.turso.io/v2/pipeline \\\n  -d '{\"requests\":[{\"type\": \"execute\", \"stmt\": {\"sql\": \"'$QUERY'\"}}]}'\n  -H \"Authorization: Bearer $PRIVATE_LIBSQL_DB_API_TOKEN\"\n```\n"
  },
  {
    "path": "packages/insights/src/db/index.ts",
    "content": "import { type LibSQLDatabase } from 'drizzle-orm/libsql';\nimport { type DatabaseSchema } from './schema';\nexport * from './schema';\n\nexport type AppDatabase = LibSQLDatabase<DatabaseSchema>;\n\nlet _db!: AppDatabase;\n\nexport function getDB() {\n  // eslint-disable-next-line\n  if (!_db) {\n    throw new Error('DB not set');\n  }\n  return _db;\n}\n\nexport async function initializeDbIfNeeded(factory: () => Promise<AppDatabase>) {\n  // eslint-disable-next-line\n  if (!_db) {\n    _db = await factory();\n  }\n}\n"
  },
  {
    "path": "packages/insights/src/db/logging.ts",
    "content": "import { isDev } from '@builder.io/qwik';\n\nconst LOG_TIMING: boolean = isDev;\n\nconst now = () => new Date().getTime();\n\nexport async function time<T>(name: string, fn: () => Promise<T>): Promise<T> {\n  const start = now();\n  let result: T = undefined!;\n  try {\n    return (result = await fn());\n  } catch (e) {\n    LOG_TIMING && console.error(name, e);\n    throw e;\n  } finally {\n    LOG_TIMING &&\n      console.log(\n        `${name} took ${now() - start}ms`,\n        Array.isArray(result) ? result.length + ' rows' : ''\n      );\n  }\n}\n"
  },
  {
    "path": "packages/insights/src/db/query-helpers.ts",
    "content": "import { sql } from 'drizzle-orm';\nimport { type EdgeRowSansId, edgeTable, type RouteRowSansId, routesTable } from './schema';\nimport { BUCKETS } from '~/stats/vector';\n\nexport type VectorKeys<PREFIX extends string> =\n  | `${PREFIX}00`\n  | `${PREFIX}01`\n  | `${PREFIX}02`\n  | `${PREFIX}03`\n  | `${PREFIX}04`\n  | `${PREFIX}05`\n  | `${PREFIX}06`\n  | `${PREFIX}07`\n  | `${PREFIX}08`\n  | `${PREFIX}09`\n  | `${PREFIX}10`\n  | `${PREFIX}11`\n  | `${PREFIX}12`\n  | `${PREFIX}13`\n  | `${PREFIX}14`\n  | `${PREFIX}15`\n  | `${PREFIX}16`\n  | `${PREFIX}17`\n  | `${PREFIX}18`\n  | `${PREFIX}19`\n  | `${PREFIX}20`\n  | `${PREFIX}21`\n  | `${PREFIX}22`\n  | `${PREFIX}23`\n  | `${PREFIX}24`\n  | `${PREFIX}25`\n  | `${PREFIX}26`\n  | `${PREFIX}27`\n  | `${PREFIX}28`\n  | `${PREFIX}29`\n  | `${PREFIX}30`\n  | `${PREFIX}31`\n  | `${PREFIX}32`\n  | `${PREFIX}33`\n  | `${PREFIX}34`\n  | `${PREFIX}35`\n  | `${PREFIX}36`\n  | `${PREFIX}37`\n  | `${PREFIX}38`\n  | `${PREFIX}39`\n  | `${PREFIX}40`\n  | `${PREFIX}41`\n  | `${PREFIX}42`\n  | `${PREFIX}43`\n  | `${PREFIX}44`\n  | `${PREFIX}45`\n  | `${PREFIX}46`\n  | `${PREFIX}47`\n  | `${PREFIX}48`\n  | `${PREFIX}49`;\nexport type VectorFields<PREFIX extends string> = Record<VectorKeys<PREFIX>, number>;\n\nexport function latencyBucketField(bucket: number): VectorKeys<`latencyCount`> {\n  return ('latencyCount' + pad(bucket)) as any;\n}\n\nexport function delayBucketField(bucket: number): VectorKeys<`delayCount`> {\n  return ('delayCount' + pad(bucket)) as any;\n}\n\nfunction pad(value: number): VectorKeys<''> {\n  return value < 10 ? '0' + value : (String(value) as any);\n}\n\nexport function createEdgeRow({\n  publicApiKey,\n  manifestHash,\n  from,\n  to,\n  interaction,\n}: {\n  publicApiKey: string;\n  manifestHash: string;\n  from?: string | null;\n  to: string;\n  interaction: boolean;\n  delayBucket: number;\n  latencyBucket: number;\n}): EdgeRowSansId {\n  return {\n    publicApiKey,\n    manifestHash,\n    from,\n    to,\n    interaction: interaction ? 0 : 1,\n    delayCount00: 0,\n    delayCount01: 0,\n    delayCount02: 0,\n    delayCount03: 0,\n    delayCount04: 0,\n    delayCount05: 0,\n    delayCount06: 0,\n    delayCount07: 0,\n    delayCount08: 0,\n    delayCount09: 0,\n    delayCount10: 0,\n    delayCount11: 0,\n    delayCount12: 0,\n    delayCount13: 0,\n    delayCount14: 0,\n    delayCount15: 0,\n    delayCount16: 0,\n    delayCount17: 0,\n    delayCount18: 0,\n    delayCount19: 0,\n    delayCount20: 0,\n    delayCount21: 0,\n    delayCount22: 0,\n    delayCount23: 0,\n    delayCount24: 0,\n    delayCount25: 0,\n    delayCount26: 0,\n    delayCount27: 0,\n    delayCount28: 0,\n    delayCount29: 0,\n    delayCount30: 0,\n    delayCount31: 0,\n    delayCount32: 0,\n    delayCount33: 0,\n    delayCount34: 0,\n    delayCount35: 0,\n    delayCount36: 0,\n    delayCount37: 0,\n    delayCount38: 0,\n    delayCount39: 0,\n    delayCount40: 0,\n    delayCount41: 0,\n    delayCount42: 0,\n    delayCount43: 0,\n    delayCount44: 0,\n    delayCount45: 0,\n    delayCount46: 0,\n    delayCount47: 0,\n    delayCount48: 0,\n    delayCount49: 0,\n    latencyCount00: 0,\n    latencyCount01: 0,\n    latencyCount02: 0,\n    latencyCount03: 0,\n    latencyCount04: 0,\n    latencyCount05: 0,\n    latencyCount06: 0,\n    latencyCount07: 0,\n    latencyCount08: 0,\n    latencyCount09: 0,\n    latencyCount10: 0,\n    latencyCount11: 0,\n    latencyCount12: 0,\n    latencyCount13: 0,\n    latencyCount14: 0,\n    latencyCount15: 0,\n    latencyCount16: 0,\n    latencyCount17: 0,\n    latencyCount18: 0,\n    latencyCount19: 0,\n    latencyCount20: 0,\n    latencyCount21: 0,\n    latencyCount22: 0,\n    latencyCount23: 0,\n    latencyCount24: 0,\n    latencyCount25: 0,\n    latencyCount26: 0,\n    latencyCount27: 0,\n    latencyCount28: 0,\n    latencyCount29: 0,\n    latencyCount30: 0,\n    latencyCount31: 0,\n    latencyCount32: 0,\n    latencyCount33: 0,\n    latencyCount34: 0,\n    latencyCount35: 0,\n    latencyCount36: 0,\n    latencyCount37: 0,\n    latencyCount38: 0,\n    latencyCount39: 0,\n    latencyCount40: 0,\n    latencyCount41: 0,\n    latencyCount42: 0,\n    latencyCount43: 0,\n    latencyCount44: 0,\n    latencyCount45: 0,\n    latencyCount46: 0,\n    latencyCount47: 0,\n    latencyCount48: 0,\n    latencyCount49: 0,\n  };\n}\n\nexport const edgeTableDelayCount = sql<number>`sum(\n  ${edgeTable.delayCount00} +\n  ${edgeTable.delayCount01} +\n  ${edgeTable.delayCount02} +\n  ${edgeTable.delayCount03} +\n  ${edgeTable.delayCount04} +\n  ${edgeTable.delayCount05} +\n  ${edgeTable.delayCount06} +\n  ${edgeTable.delayCount07} +\n  ${edgeTable.delayCount08} +\n  ${edgeTable.delayCount09} +\n  ${edgeTable.delayCount10} +\n  ${edgeTable.delayCount11} +\n  ${edgeTable.delayCount12} +\n  ${edgeTable.delayCount13} +\n  ${edgeTable.delayCount14} +\n  ${edgeTable.delayCount15} +\n  ${edgeTable.delayCount16} +\n  ${edgeTable.delayCount17} +\n  ${edgeTable.delayCount18} +\n  ${edgeTable.delayCount19} +\n  ${edgeTable.delayCount20} +\n  ${edgeTable.delayCount21} +\n  ${edgeTable.delayCount22} +\n  ${edgeTable.delayCount23} +\n  ${edgeTable.delayCount24} +\n  ${edgeTable.delayCount25} +\n  ${edgeTable.delayCount26} +\n  ${edgeTable.delayCount27} +\n  ${edgeTable.delayCount28} +\n  ${edgeTable.delayCount29} +\n  ${edgeTable.delayCount30} +\n  ${edgeTable.delayCount31} +\n  ${edgeTable.delayCount32} +\n  ${edgeTable.delayCount33} +\n  ${edgeTable.delayCount34} +\n  ${edgeTable.delayCount35} +\n  ${edgeTable.delayCount36} +\n  ${edgeTable.delayCount37} +\n  ${edgeTable.delayCount38} +\n  ${edgeTable.delayCount39} +\n  ${edgeTable.delayCount40} +\n  ${edgeTable.delayCount41} +\n  ${edgeTable.delayCount42} +\n  ${edgeTable.delayCount43} +\n  ${edgeTable.delayCount44} +\n  ${edgeTable.delayCount45} +\n  ${edgeTable.delayCount46} +\n  ${edgeTable.delayCount47} +\n  ${edgeTable.delayCount48} +\n  ${edgeTable.delayCount49} )`;\n\nexport const delayColumns = {\n  delayCount00: edgeTable.delayCount00,\n  delayCount01: edgeTable.delayCount01,\n  delayCount02: edgeTable.delayCount02,\n  delayCount03: edgeTable.delayCount03,\n  delayCount04: edgeTable.delayCount04,\n  delayCount05: edgeTable.delayCount05,\n  delayCount06: edgeTable.delayCount06,\n  delayCount07: edgeTable.delayCount07,\n  delayCount08: edgeTable.delayCount08,\n  delayCount09: edgeTable.delayCount09,\n  delayCount10: edgeTable.delayCount10,\n  delayCount11: edgeTable.delayCount11,\n  delayCount12: edgeTable.delayCount12,\n  delayCount13: edgeTable.delayCount13,\n  delayCount14: edgeTable.delayCount14,\n  delayCount15: edgeTable.delayCount15,\n  delayCount16: edgeTable.delayCount16,\n  delayCount17: edgeTable.delayCount17,\n  delayCount18: edgeTable.delayCount18,\n  delayCount19: edgeTable.delayCount19,\n  delayCount20: edgeTable.delayCount20,\n  delayCount21: edgeTable.delayCount21,\n  delayCount22: edgeTable.delayCount22,\n  delayCount23: edgeTable.delayCount23,\n  delayCount24: edgeTable.delayCount24,\n  delayCount25: edgeTable.delayCount25,\n  delayCount26: edgeTable.delayCount26,\n  delayCount27: edgeTable.delayCount27,\n  delayCount28: edgeTable.delayCount28,\n  delayCount29: edgeTable.delayCount29,\n  delayCount30: edgeTable.delayCount30,\n  delayCount31: edgeTable.delayCount31,\n  delayCount32: edgeTable.delayCount32,\n  delayCount33: edgeTable.delayCount33,\n  delayCount34: edgeTable.delayCount34,\n  delayCount35: edgeTable.delayCount35,\n  delayCount36: edgeTable.delayCount36,\n  delayCount37: edgeTable.delayCount37,\n  delayCount38: edgeTable.delayCount38,\n  delayCount39: edgeTable.delayCount39,\n  delayCount40: edgeTable.delayCount40,\n  delayCount41: edgeTable.delayCount41,\n  delayCount42: edgeTable.delayCount42,\n  delayCount43: edgeTable.delayCount43,\n  delayCount44: edgeTable.delayCount44,\n  delayCount45: edgeTable.delayCount45,\n  delayCount46: edgeTable.delayCount46,\n  delayCount47: edgeTable.delayCount47,\n  delayCount48: edgeTable.delayCount48,\n  delayCount49: edgeTable.delayCount49,\n};\n\nexport const computeLatency = sql<number>`\n  (\n    sumLatencyCount00 * ${BUCKETS[0].avg} + \n    sumLatencyCount01 * ${BUCKETS[1].avg} +\n    sumLatencyCount02 * ${BUCKETS[2].avg} +\n    sumLatencyCount03 * ${BUCKETS[3].avg} +\n    sumLatencyCount04 * ${BUCKETS[4].avg} +\n    sumLatencyCount05 * ${BUCKETS[5].avg} +\n    sumLatencyCount06 * ${BUCKETS[6].avg} +\n    sumLatencyCount07 * ${BUCKETS[7].avg} +\n    sumLatencyCount08 * ${BUCKETS[8].avg} +\n    sumLatencyCount09 * ${BUCKETS[9].avg} +\n    sumLatencyCount10 * ${BUCKETS[10].avg} +\n    sumLatencyCount11 * ${BUCKETS[11].avg} +\n    sumLatencyCount12 * ${BUCKETS[12].avg} +\n    sumLatencyCount13 * ${BUCKETS[13].avg} +\n    sumLatencyCount14 * ${BUCKETS[14].avg} +\n    sumLatencyCount15 * ${BUCKETS[15].avg} +\n    sumLatencyCount16 * ${BUCKETS[16].avg} +\n    sumLatencyCount17 * ${BUCKETS[17].avg} +\n    sumLatencyCount18 * ${BUCKETS[18].avg} +\n    sumLatencyCount19 * ${BUCKETS[19].avg} +\n    sumLatencyCount20 * ${BUCKETS[20].avg} +\n    sumLatencyCount21 * ${BUCKETS[21].avg} +\n    sumLatencyCount22 * ${BUCKETS[22].avg} +\n    sumLatencyCount23 * ${BUCKETS[23].avg} +\n    sumLatencyCount24 * ${BUCKETS[24].avg} +\n    sumLatencyCount25 * ${BUCKETS[25].avg} +\n    sumLatencyCount26 * ${BUCKETS[26].avg} +\n    sumLatencyCount27 * ${BUCKETS[27].avg} +\n    sumLatencyCount28 * ${BUCKETS[28].avg} +\n    sumLatencyCount29 * ${BUCKETS[29].avg} +\n    sumLatencyCount30 * ${BUCKETS[30].avg} +\n    sumLatencyCount31 * ${BUCKETS[31].avg} +\n    sumLatencyCount32 * ${BUCKETS[32].avg} +\n    sumLatencyCount33 * ${BUCKETS[33].avg} +\n    sumLatencyCount34 * ${BUCKETS[34].avg} +\n    sumLatencyCount35 * ${BUCKETS[35].avg} +\n    sumLatencyCount36 * ${BUCKETS[36].avg} +\n    sumLatencyCount37 * ${BUCKETS[37].avg} +\n    sumLatencyCount38 * ${BUCKETS[38].avg} +\n    sumLatencyCount39 * ${BUCKETS[39].avg} +\n    sumLatencyCount40 * ${BUCKETS[40].avg} +\n    sumLatencyCount41 * ${BUCKETS[41].avg} +\n    sumLatencyCount42 * ${BUCKETS[42].avg} +\n    sumLatencyCount43 * ${BUCKETS[43].avg} +\n    sumLatencyCount44 * ${BUCKETS[44].avg} +\n    sumLatencyCount45 * ${BUCKETS[45].avg} +\n    sumLatencyCount46 * ${BUCKETS[46].avg} +\n    sumLatencyCount47 * ${BUCKETS[47].avg} +\n    sumLatencyCount48 * ${BUCKETS[48].avg} +\n    sumLatencyCount49 * ${BUCKETS[49].avg}\n  ) / (\n    sumLatencyCount00 +\n    sumLatencyCount01 +\n    sumLatencyCount02 +\n    sumLatencyCount03 +\n    sumLatencyCount04 +\n    sumLatencyCount05 +\n    sumLatencyCount06 +\n    sumLatencyCount07 +\n    sumLatencyCount08 +\n    sumLatencyCount09 +\n    sumLatencyCount10 +\n    sumLatencyCount11 +\n    sumLatencyCount12 +\n    sumLatencyCount13 +\n    sumLatencyCount14 +\n    sumLatencyCount15 +\n    sumLatencyCount16 +\n    sumLatencyCount17 +\n    sumLatencyCount18 +\n    sumLatencyCount19 +\n    sumLatencyCount20 +\n    sumLatencyCount21 +\n    sumLatencyCount22 +\n    sumLatencyCount23 +\n    sumLatencyCount24 +\n    sumLatencyCount25 +\n    sumLatencyCount26 +\n    sumLatencyCount27 +\n    sumLatencyCount28 +\n    sumLatencyCount29 +\n    sumLatencyCount30 +\n    sumLatencyCount31 +\n    sumLatencyCount32 +\n    sumLatencyCount33 +\n    sumLatencyCount34 +\n    sumLatencyCount35 +\n    sumLatencyCount36 +\n    sumLatencyCount37 +\n    sumLatencyCount38 +\n    sumLatencyCount39 +\n    sumLatencyCount40 +\n    sumLatencyCount41 +\n    sumLatencyCount42 +\n    sumLatencyCount43 +\n    sumLatencyCount44 +\n    sumLatencyCount45 +\n    sumLatencyCount46 +\n    sumLatencyCount47 +\n    sumLatencyCount48 +\n    sumLatencyCount49\n  )`;\n\nexport const latencyColumnSums = {\n  sumLatencyCount00: sql<number>`sum(${edgeTable.latencyCount00}) as sumLatencyCount00`,\n  sumLatencyCount01: sql<number>`sum(${edgeTable.latencyCount01}) as sumLatencyCount01`,\n  sumLatencyCount02: sql<number>`sum(${edgeTable.latencyCount02}) as sumLatencyCount02`,\n  sumLatencyCount03: sql<number>`sum(${edgeTable.latencyCount03}) as sumLatencyCount03`,\n  sumLatencyCount04: sql<number>`sum(${edgeTable.latencyCount04}) as sumLatencyCount04`,\n  sumLatencyCount05: sql<number>`sum(${edgeTable.latencyCount05}) as sumLatencyCount05`,\n  sumLatencyCount06: sql<number>`sum(${edgeTable.latencyCount06}) as sumLatencyCount06`,\n  sumLatencyCount07: sql<number>`sum(${edgeTable.latencyCount07}) as sumLatencyCount07`,\n  sumLatencyCount08: sql<number>`sum(${edgeTable.latencyCount08}) as sumLatencyCount08`,\n  sumLatencyCount09: sql<number>`sum(${edgeTable.latencyCount09}) as sumLatencyCount09`,\n  sumLatencyCount10: sql<number>`sum(${edgeTable.latencyCount10}) as sumLatencyCount10`,\n  sumLatencyCount11: sql<number>`sum(${edgeTable.latencyCount11}) as sumLatencyCount11`,\n  sumLatencyCount12: sql<number>`sum(${edgeTable.latencyCount12}) as sumLatencyCount12`,\n  sumLatencyCount13: sql<number>`sum(${edgeTable.latencyCount13}) as sumLatencyCount13`,\n  sumLatencyCount14: sql<number>`sum(${edgeTable.latencyCount14}) as sumLatencyCount14`,\n  sumLatencyCount15: sql<number>`sum(${edgeTable.latencyCount15}) as sumLatencyCount15`,\n  sumLatencyCount16: sql<number>`sum(${edgeTable.latencyCount16}) as sumLatencyCount16`,\n  sumLatencyCount17: sql<number>`sum(${edgeTable.latencyCount17}) as sumLatencyCount17`,\n  sumLatencyCount18: sql<number>`sum(${edgeTable.latencyCount18}) as sumLatencyCount18`,\n  sumLatencyCount19: sql<number>`sum(${edgeTable.latencyCount19}) as sumLatencyCount19`,\n  sumLatencyCount20: sql<number>`sum(${edgeTable.latencyCount20}) as sumLatencyCount20`,\n  sumLatencyCount21: sql<number>`sum(${edgeTable.latencyCount21}) as sumLatencyCount21`,\n  sumLatencyCount22: sql<number>`sum(${edgeTable.latencyCount22}) as sumLatencyCount22`,\n  sumLatencyCount23: sql<number>`sum(${edgeTable.latencyCount23}) as sumLatencyCount23`,\n  sumLatencyCount24: sql<number>`sum(${edgeTable.latencyCount24}) as sumLatencyCount24`,\n  sumLatencyCount25: sql<number>`sum(${edgeTable.latencyCount25}) as sumLatencyCount25`,\n  sumLatencyCount26: sql<number>`sum(${edgeTable.latencyCount26}) as sumLatencyCount26`,\n  sumLatencyCount27: sql<number>`sum(${edgeTable.latencyCount27}) as sumLatencyCount27`,\n  sumLatencyCount28: sql<number>`sum(${edgeTable.latencyCount28}) as sumLatencyCount28`,\n  sumLatencyCount29: sql<number>`sum(${edgeTable.latencyCount29}) as sumLatencyCount29`,\n  sumLatencyCount30: sql<number>`sum(${edgeTable.latencyCount30}) as sumLatencyCount30`,\n  sumLatencyCount31: sql<number>`sum(${edgeTable.latencyCount31}) as sumLatencyCount31`,\n  sumLatencyCount32: sql<number>`sum(${edgeTable.latencyCount32}) as sumLatencyCount32`,\n  sumLatencyCount33: sql<number>`sum(${edgeTable.latencyCount33}) as sumLatencyCount33`,\n  sumLatencyCount34: sql<number>`sum(${edgeTable.latencyCount34}) as sumLatencyCount34`,\n  sumLatencyCount35: sql<number>`sum(${edgeTable.latencyCount35}) as sumLatencyCount35`,\n  sumLatencyCount36: sql<number>`sum(${edgeTable.latencyCount36}) as sumLatencyCount36`,\n  sumLatencyCount37: sql<number>`sum(${edgeTable.latencyCount37}) as sumLatencyCount37`,\n  sumLatencyCount38: sql<number>`sum(${edgeTable.latencyCount38}) as sumLatencyCount38`,\n  sumLatencyCount39: sql<number>`sum(${edgeTable.latencyCount39}) as sumLatencyCount39`,\n  sumLatencyCount40: sql<number>`sum(${edgeTable.latencyCount40}) as sumLatencyCount40`,\n  sumLatencyCount41: sql<number>`sum(${edgeTable.latencyCount41}) as sumLatencyCount41`,\n  sumLatencyCount42: sql<number>`sum(${edgeTable.latencyCount42}) as sumLatencyCount42`,\n  sumLatencyCount43: sql<number>`sum(${edgeTable.latencyCount43}) as sumLatencyCount43`,\n  sumLatencyCount44: sql<number>`sum(${edgeTable.latencyCount44}) as sumLatencyCount44`,\n  sumLatencyCount45: sql<number>`sum(${edgeTable.latencyCount45}) as sumLatencyCount45`,\n  sumLatencyCount46: sql<number>`sum(${edgeTable.latencyCount46}) as sumLatencyCount46`,\n  sumLatencyCount47: sql<number>`sum(${edgeTable.latencyCount47}) as sumLatencyCount47`,\n  sumLatencyCount48: sql<number>`sum(${edgeTable.latencyCount48}) as sumLatencyCount48`,\n  sumLatencyCount49: sql<number>`sum(${edgeTable.latencyCount49}) as sumLatencyCount49`,\n};\n\nexport const latencyColumnSumList = sql<string>`\n  CAST(sum(${edgeTable.latencyCount00}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount01}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount02}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount03}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount04}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount05}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount06}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount07}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount08}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount09}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount10}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount11}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount12}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount13}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount14}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount15}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount16}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount17}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount18}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount19}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount20}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount21}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount22}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount23}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount24}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount25}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount26}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount27}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount28}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount29}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount30}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount31}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount32}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount33}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount34}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount35}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount36}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount37}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount38}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount39}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount40}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount41}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount42}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount43}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount44}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount45}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount46}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount47}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount48}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.latencyCount49}) as VARCHAR)`;\n\nexport const delayColumnSumList = sql<string>`\n  CAST(sum(${edgeTable.delayCount00}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount01}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount02}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount03}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount04}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount05}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount06}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount07}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount08}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount09}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount10}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount11}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount12}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount13}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount14}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount15}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount16}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount17}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount18}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount19}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount20}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount21}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount22}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount23}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount24}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount25}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount26}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount27}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount28}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount29}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount30}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount31}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount32}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount33}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount34}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount35}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount36}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount37}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount38}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount39}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount40}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount41}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount42}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount43}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount44}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount45}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount46}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount47}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount48}) as VARCHAR) || ';' ||\n  CAST(sum(${edgeTable.delayCount49}) as VARCHAR)`;\n\nexport const latencyCount = {\n  latencyCount: sql<number>`\n    ${edgeTable.latencyCount00} + \n    ${edgeTable.latencyCount01} + \n    ${edgeTable.latencyCount02} + \n    ${edgeTable.latencyCount03} + \n    ${edgeTable.latencyCount04} + \n    ${edgeTable.latencyCount05} + \n    ${edgeTable.latencyCount06} + \n    ${edgeTable.latencyCount07} + \n    ${edgeTable.latencyCount08} + \n    ${edgeTable.latencyCount09} + \n    ${edgeTable.latencyCount10} + \n    ${edgeTable.latencyCount11} + \n    ${edgeTable.latencyCount12} + \n    ${edgeTable.latencyCount13} + \n    ${edgeTable.latencyCount14} + \n    ${edgeTable.latencyCount15} + \n    ${edgeTable.latencyCount16} + \n    ${edgeTable.latencyCount17} + \n    ${edgeTable.latencyCount18} + \n    ${edgeTable.latencyCount19} + \n    ${edgeTable.latencyCount20} + \n    ${edgeTable.latencyCount21} + \n    ${edgeTable.latencyCount22} + \n    ${edgeTable.latencyCount23} + \n    ${edgeTable.latencyCount24} + \n    ${edgeTable.latencyCount25} + \n    ${edgeTable.latencyCount26} + \n    ${edgeTable.latencyCount27} + \n    ${edgeTable.latencyCount28} + \n    ${edgeTable.latencyCount29} + \n    ${edgeTable.latencyCount30} + \n    ${edgeTable.latencyCount31} + \n    ${edgeTable.latencyCount32} + \n    ${edgeTable.latencyCount33} + \n    ${edgeTable.latencyCount34} + \n    ${edgeTable.latencyCount35} + \n    ${edgeTable.latencyCount36} + \n    ${edgeTable.latencyCount37} + \n    ${edgeTable.latencyCount38} + \n    ${edgeTable.latencyCount39} + \n    ${edgeTable.latencyCount40} + \n    ${edgeTable.latencyCount41} + \n    ${edgeTable.latencyCount42} + \n    ${edgeTable.latencyCount43} + \n    ${edgeTable.latencyCount44} + \n    ${edgeTable.latencyCount45} + \n    ${edgeTable.latencyCount46} + \n    ${edgeTable.latencyCount47} + \n    ${edgeTable.latencyCount48} + \n    ${edgeTable.latencyCount49} as latencyCount`,\n};\n\nexport const delayColumnSums = {\n  sumDelayCount00: sql<number>`sum(${edgeTable.delayCount00}) as sumDelayCount00`,\n  sumDelayCount01: sql<number>`sum(${edgeTable.delayCount01}) as sumDelayCount01`,\n  sumDelayCount02: sql<number>`sum(${edgeTable.delayCount02}) as sumDelayCount02`,\n  sumDelayCount03: sql<number>`sum(${edgeTable.delayCount03}) as sumDelayCount03`,\n  sumDelayCount04: sql<number>`sum(${edgeTable.delayCount04}) as sumDelayCount04`,\n  sumDelayCount05: sql<number>`sum(${edgeTable.delayCount05}) as sumDelayCount05`,\n  sumDelayCount06: sql<number>`sum(${edgeTable.delayCount06}) as sumDelayCount06`,\n  sumDelayCount07: sql<number>`sum(${edgeTable.delayCount07}) as sumDelayCount07`,\n  sumDelayCount08: sql<number>`sum(${edgeTable.delayCount08}) as sumDelayCount08`,\n  sumDelayCount09: sql<number>`sum(${edgeTable.delayCount09}) as sumDelayCount09`,\n  sumDelayCount10: sql<number>`sum(${edgeTable.delayCount10}) as sumDelayCount10`,\n  sumDelayCount11: sql<number>`sum(${edgeTable.delayCount11}) as sumDelayCount11`,\n  sumDelayCount12: sql<number>`sum(${edgeTable.delayCount12}) as sumDelayCount12`,\n  sumDelayCount13: sql<number>`sum(${edgeTable.delayCount13}) as sumDelayCount13`,\n  sumDelayCount14: sql<number>`sum(${edgeTable.delayCount14}) as sumDelayCount14`,\n  sumDelayCount15: sql<number>`sum(${edgeTable.delayCount15}) as sumDelayCount15`,\n  sumDelayCount16: sql<number>`sum(${edgeTable.delayCount16}) as sumDelayCount16`,\n  sumDelayCount17: sql<number>`sum(${edgeTable.delayCount17}) as sumDelayCount17`,\n  sumDelayCount18: sql<number>`sum(${edgeTable.delayCount18}) as sumDelayCount18`,\n  sumDelayCount19: sql<number>`sum(${edgeTable.delayCount19}) as sumDelayCount19`,\n  sumDelayCount20: sql<number>`sum(${edgeTable.delayCount20}) as sumDelayCount20`,\n  sumDelayCount21: sql<number>`sum(${edgeTable.delayCount21}) as sumDelayCount21`,\n  sumDelayCount22: sql<number>`sum(${edgeTable.delayCount22}) as sumDelayCount22`,\n  sumDelayCount23: sql<number>`sum(${edgeTable.delayCount23}) as sumDelayCount23`,\n  sumDelayCount24: sql<number>`sum(${edgeTable.delayCount24}) as sumDelayCount24`,\n  sumDelayCount25: sql<number>`sum(${edgeTable.delayCount25}) as sumDelayCount25`,\n  sumDelayCount26: sql<number>`sum(${edgeTable.delayCount26}) as sumDelayCount26`,\n  sumDelayCount27: sql<number>`sum(${edgeTable.delayCount27}) as sumDelayCount27`,\n  sumDelayCount28: sql<number>`sum(${edgeTable.delayCount28}) as sumDelayCount28`,\n  sumDelayCount29: sql<number>`sum(${edgeTable.delayCount29}) as sumDelayCount29`,\n  sumDelayCount30: sql<number>`sum(${edgeTable.delayCount30}) as sumDelayCount30`,\n  sumDelayCount31: sql<number>`sum(${edgeTable.delayCount31}) as sumDelayCount31`,\n  sumDelayCount32: sql<number>`sum(${edgeTable.delayCount32}) as sumDelayCount32`,\n  sumDelayCount33: sql<number>`sum(${edgeTable.delayCount33}) as sumDelayCount33`,\n  sumDelayCount34: sql<number>`sum(${edgeTable.delayCount34}) as sumDelayCount34`,\n  sumDelayCount35: sql<number>`sum(${edgeTable.delayCount35}) as sumDelayCount35`,\n  sumDelayCount36: sql<number>`sum(${edgeTable.delayCount36}) as sumDelayCount36`,\n  sumDelayCount37: sql<number>`sum(${edgeTable.delayCount37}) as sumDelayCount37`,\n  sumDelayCount38: sql<number>`sum(${edgeTable.delayCount38}) as sumDelayCount38`,\n  sumDelayCount39: sql<number>`sum(${edgeTable.delayCount39}) as sumDelayCount39`,\n  sumDelayCount40: sql<number>`sum(${edgeTable.delayCount40}) as sumDelayCount40`,\n  sumDelayCount41: sql<number>`sum(${edgeTable.delayCount41}) as sumDelayCount41`,\n  sumDelayCount42: sql<number>`sum(${edgeTable.delayCount42}) as sumDelayCount42`,\n  sumDelayCount43: sql<number>`sum(${edgeTable.delayCount43}) as sumDelayCount43`,\n  sumDelayCount44: sql<number>`sum(${edgeTable.delayCount44}) as sumDelayCount44`,\n  sumDelayCount45: sql<number>`sum(${edgeTable.delayCount45}) as sumDelayCount45`,\n  sumDelayCount46: sql<number>`sum(${edgeTable.delayCount46}) as sumDelayCount46`,\n  sumDelayCount47: sql<number>`sum(${edgeTable.delayCount47}) as sumDelayCount47`,\n  sumDelayCount48: sql<number>`sum(${edgeTable.delayCount48}) as sumDelayCount48`,\n  sumDelayCount49: sql<number>`sum(${edgeTable.delayCount49}) as sumDelayCount49`,\n};\n\nexport const timelineDelayAsList = sql<string>`(\n  CAST(SUM(${routesTable.timeline00}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline01}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline02}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline03}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline04}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline05}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline06}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline07}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline08}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline09}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline10}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline11}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline12}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline13}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline14}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline15}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline16}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline17}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline18}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline19}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline20}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline21}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline22}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline23}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline24}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline25}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline26}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline27}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline28}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline29}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline30}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline31}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline32}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline33}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline34}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline35}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline36}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline37}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline38}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline39}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline40}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline41}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline42}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline43}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline44}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline45}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline46}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline47}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline48}) as VARCHAR) || ';' ||\n  CAST(SUM(${routesTable.timeline49}) as VARCHAR)\n)`;\n\nexport const timelineDelays = {\n  timeline00: routesTable.timeline00,\n  timeline01: routesTable.timeline01,\n  timeline02: routesTable.timeline02,\n  timeline03: routesTable.timeline03,\n  timeline04: routesTable.timeline04,\n  timeline05: routesTable.timeline05,\n  timeline06: routesTable.timeline06,\n  timeline07: routesTable.timeline07,\n  timeline08: routesTable.timeline08,\n  timeline09: routesTable.timeline09,\n  timeline10: routesTable.timeline10,\n  timeline11: routesTable.timeline11,\n  timeline12: routesTable.timeline12,\n  timeline13: routesTable.timeline13,\n  timeline14: routesTable.timeline14,\n  timeline15: routesTable.timeline15,\n  timeline16: routesTable.timeline16,\n  timeline17: routesTable.timeline17,\n  timeline18: routesTable.timeline18,\n  timeline19: routesTable.timeline19,\n  timeline20: routesTable.timeline20,\n  timeline21: routesTable.timeline21,\n  timeline22: routesTable.timeline22,\n  timeline23: routesTable.timeline23,\n  timeline24: routesTable.timeline24,\n  timeline25: routesTable.timeline25,\n  timeline26: routesTable.timeline26,\n  timeline27: routesTable.timeline27,\n  timeline28: routesTable.timeline28,\n  timeline29: routesTable.timeline29,\n  timeline30: routesTable.timeline30,\n  timeline31: routesTable.timeline31,\n  timeline32: routesTable.timeline32,\n  timeline33: routesTable.timeline33,\n  timeline34: routesTable.timeline34,\n  timeline35: routesTable.timeline35,\n  timeline36: routesTable.timeline36,\n  timeline37: routesTable.timeline37,\n  timeline38: routesTable.timeline38,\n  timeline39: routesTable.timeline39,\n  timeline40: routesTable.timeline40,\n  timeline41: routesTable.timeline41,\n  timeline42: routesTable.timeline42,\n  timeline43: routesTable.timeline43,\n  timeline44: routesTable.timeline44,\n  timeline45: routesTable.timeline45,\n  timeline46: routesTable.timeline46,\n  timeline47: routesTable.timeline47,\n  timeline48: routesTable.timeline48,\n  timeline49: routesTable.timeline49,\n};\n\nexport const timelineAvg = sql<number>`\n  (\n    ${routesTable.timeline00} * ${BUCKETS[0].avg} + \n    ${routesTable.timeline01} * ${BUCKETS[1].avg} +\n    ${routesTable.timeline02} * ${BUCKETS[2].avg} +\n    ${routesTable.timeline03} * ${BUCKETS[3].avg} +\n    ${routesTable.timeline04} * ${BUCKETS[4].avg} +\n    ${routesTable.timeline05} * ${BUCKETS[5].avg} +\n    ${routesTable.timeline06} * ${BUCKETS[6].avg} +\n    ${routesTable.timeline07} * ${BUCKETS[7].avg} +\n    ${routesTable.timeline08} * ${BUCKETS[8].avg} +\n    ${routesTable.timeline09} * ${BUCKETS[9].avg} +\n    ${routesTable.timeline10} * ${BUCKETS[10].avg} +\n    ${routesTable.timeline11} * ${BUCKETS[11].avg} +\n    ${routesTable.timeline12} * ${BUCKETS[12].avg} +\n    ${routesTable.timeline13} * ${BUCKETS[13].avg} +\n    ${routesTable.timeline14} * ${BUCKETS[14].avg} +\n    ${routesTable.timeline15} * ${BUCKETS[15].avg} +\n    ${routesTable.timeline16} * ${BUCKETS[16].avg} +\n    ${routesTable.timeline17} * ${BUCKETS[17].avg} +\n    ${routesTable.timeline18} * ${BUCKETS[18].avg} +\n    ${routesTable.timeline19} * ${BUCKETS[19].avg} +\n    ${routesTable.timeline20} * ${BUCKETS[20].avg} +\n    ${routesTable.timeline21} * ${BUCKETS[21].avg} +\n    ${routesTable.timeline22} * ${BUCKETS[22].avg} +\n    ${routesTable.timeline23} * ${BUCKETS[23].avg} +\n    ${routesTable.timeline24} * ${BUCKETS[24].avg} +\n    ${routesTable.timeline25} * ${BUCKETS[25].avg} +\n    ${routesTable.timeline26} * ${BUCKETS[26].avg} +\n    ${routesTable.timeline27} * ${BUCKETS[27].avg} +\n    ${routesTable.timeline28} * ${BUCKETS[28].avg} +\n    ${routesTable.timeline29} * ${BUCKETS[29].avg} +\n    ${routesTable.timeline30} * ${BUCKETS[30].avg} +\n    ${routesTable.timeline31} * ${BUCKETS[31].avg} +\n    ${routesTable.timeline32} * ${BUCKETS[32].avg} +\n    ${routesTable.timeline33} * ${BUCKETS[33].avg} +\n    ${routesTable.timeline34} * ${BUCKETS[34].avg} +\n    ${routesTable.timeline35} * ${BUCKETS[35].avg} +\n    ${routesTable.timeline36} * ${BUCKETS[36].avg} +\n    ${routesTable.timeline37} * ${BUCKETS[37].avg} +\n    ${routesTable.timeline38} * ${BUCKETS[38].avg} +\n    ${routesTable.timeline39} * ${BUCKETS[39].avg} +\n    ${routesTable.timeline40} * ${BUCKETS[40].avg} +\n    ${routesTable.timeline41} * ${BUCKETS[41].avg} +\n    ${routesTable.timeline42} * ${BUCKETS[42].avg} +\n    ${routesTable.timeline43} * ${BUCKETS[43].avg} +\n    ${routesTable.timeline44} * ${BUCKETS[44].avg} +\n    ${routesTable.timeline45} * ${BUCKETS[45].avg} +\n    ${routesTable.timeline46} * ${BUCKETS[46].avg} +\n    ${routesTable.timeline47} * ${BUCKETS[47].avg} +\n    ${routesTable.timeline48} * ${BUCKETS[48].avg} +\n    ${routesTable.timeline49} * ${BUCKETS[49].avg}\n  ) / (\n    ${routesTable.timeline00} +\n    ${routesTable.timeline01} +\n    ${routesTable.timeline02} +\n    ${routesTable.timeline03} +\n    ${routesTable.timeline04} +\n    ${routesTable.timeline05} +\n    ${routesTable.timeline06} +\n    ${routesTable.timeline07} +\n    ${routesTable.timeline08} +\n    ${routesTable.timeline09} +\n    ${routesTable.timeline10} +\n    ${routesTable.timeline11} +\n    ${routesTable.timeline12} +\n    ${routesTable.timeline13} +\n    ${routesTable.timeline14} +\n    ${routesTable.timeline15} +\n    ${routesTable.timeline16} +\n    ${routesTable.timeline17} +\n    ${routesTable.timeline18} +\n    ${routesTable.timeline19} +\n    ${routesTable.timeline20} +\n    ${routesTable.timeline21} +\n    ${routesTable.timeline22} +\n    ${routesTable.timeline23} +\n    ${routesTable.timeline24} +\n    ${routesTable.timeline25} +\n    ${routesTable.timeline26} +\n    ${routesTable.timeline27} +\n    ${routesTable.timeline28} +\n    ${routesTable.timeline29} +\n    ${routesTable.timeline30} +\n    ${routesTable.timeline31} +\n    ${routesTable.timeline32} +\n    ${routesTable.timeline33} +\n    ${routesTable.timeline34} +\n    ${routesTable.timeline35} +\n    ${routesTable.timeline36} +\n    ${routesTable.timeline37} +\n    ${routesTable.timeline38} +\n    ${routesTable.timeline39} +\n    ${routesTable.timeline40} +\n    ${routesTable.timeline41} +\n    ${routesTable.timeline42} +\n    ${routesTable.timeline43} +\n    ${routesTable.timeline44} +\n    ${routesTable.timeline45} +\n    ${routesTable.timeline46} +\n    ${routesTable.timeline47} +\n    ${routesTable.timeline48} +\n    ${routesTable.timeline49}\n  )`;\n\nexport const sumTimelineCount = sql<number>`\n    SUM(${routesTable.timeline00}) +\n    SUM(${routesTable.timeline01}) +\n    SUM(${routesTable.timeline02}) +\n    SUM(${routesTable.timeline03}) +\n    SUM(${routesTable.timeline04}) +\n    SUM(${routesTable.timeline05}) +\n    SUM(${routesTable.timeline06}) +\n    SUM(${routesTable.timeline07}) +\n    SUM(${routesTable.timeline08}) +\n    SUM(${routesTable.timeline09}) +\n    SUM(${routesTable.timeline10}) +\n    SUM(${routesTable.timeline11}) +\n    SUM(${routesTable.timeline12}) +\n    SUM(${routesTable.timeline13}) +\n    SUM(${routesTable.timeline14}) +\n    SUM(${routesTable.timeline15}) +\n    SUM(${routesTable.timeline16}) +\n    SUM(${routesTable.timeline17}) +\n    SUM(${routesTable.timeline18}) +\n    SUM(${routesTable.timeline19}) +\n    SUM(${routesTable.timeline20}) +\n    SUM(${routesTable.timeline21}) +\n    SUM(${routesTable.timeline22}) +\n    SUM(${routesTable.timeline23}) +\n    SUM(${routesTable.timeline24}) +\n    SUM(${routesTable.timeline25}) +\n    SUM(${routesTable.timeline26}) +\n    SUM(${routesTable.timeline27}) +\n    SUM(${routesTable.timeline28}) +\n    SUM(${routesTable.timeline29}) +\n    SUM(${routesTable.timeline30}) +\n    SUM(${routesTable.timeline31}) +\n    SUM(${routesTable.timeline32}) +\n    SUM(${routesTable.timeline33}) +\n    SUM(${routesTable.timeline34}) +\n    SUM(${routesTable.timeline35}) +\n    SUM(${routesTable.timeline36}) +\n    SUM(${routesTable.timeline37}) +\n    SUM(${routesTable.timeline38}) +\n    SUM(${routesTable.timeline39}) +\n    SUM(${routesTable.timeline40}) +\n    SUM(${routesTable.timeline41}) +\n    SUM(${routesTable.timeline42}) +\n    SUM(${routesTable.timeline43}) +\n    SUM(${routesTable.timeline44}) +\n    SUM(${routesTable.timeline45}) +\n    SUM(${routesTable.timeline46}) +\n    SUM(${routesTable.timeline47}) +\n    SUM(${routesTable.timeline48}) +\n    SUM(${routesTable.timeline49})`;\n\nexport function listToVector(list: string): number[] {\n  return list.split(';').map((s) => parseInt(s, 10));\n}\n\nexport function toVector<PREFIX extends string>(prefix: PREFIX, dat: VectorFields<PREFIX>) {\n  const obj = dat as Record<string, number>;\n  return [\n    obj[prefix + '00'],\n    obj[prefix + '01'],\n    obj[prefix + '02'],\n    obj[prefix + '03'],\n    obj[prefix + '04'],\n    obj[prefix + '05'],\n    obj[prefix + '06'],\n    obj[prefix + '07'],\n    obj[prefix + '08'],\n    obj[prefix + '09'],\n    obj[prefix + '10'],\n    obj[prefix + '11'],\n    obj[prefix + '12'],\n    obj[prefix + '13'],\n    obj[prefix + '14'],\n    obj[prefix + '15'],\n    obj[prefix + '16'],\n    obj[prefix + '17'],\n    obj[prefix + '18'],\n    obj[prefix + '19'],\n    obj[prefix + '20'],\n    obj[prefix + '21'],\n    obj[prefix + '22'],\n    obj[prefix + '23'],\n    obj[prefix + '24'],\n    obj[prefix + '25'],\n    obj[prefix + '26'],\n    obj[prefix + '27'],\n    obj[prefix + '28'],\n    obj[prefix + '29'],\n    obj[prefix + '30'],\n    obj[prefix + '31'],\n    obj[prefix + '32'],\n    obj[prefix + '33'],\n    obj[prefix + '34'],\n    obj[prefix + '35'],\n    obj[prefix + '36'],\n    obj[prefix + '37'],\n    obj[prefix + '38'],\n    obj[prefix + '39'],\n    obj[prefix + '40'],\n    obj[prefix + '41'],\n    obj[prefix + '42'],\n    obj[prefix + '43'],\n    obj[prefix + '44'],\n    obj[prefix + '45'],\n    obj[prefix + '46'],\n    obj[prefix + '47'],\n    obj[prefix + '48'],\n    obj[prefix + '49'],\n  ];\n}\n\nexport function timelineBucketField(bucket: number): VectorKeys<`timeline`> {\n  return ('timeline' + pad(bucket)) as any;\n}\n\nexport function createRouteRow({\n  publicApiKey,\n  manifestHash,\n  route,\n  symbol,\n}: {\n  publicApiKey: string;\n  manifestHash: string;\n  route: string;\n  symbol: string;\n}): RouteRowSansId {\n  return {\n    publicApiKey,\n    manifestHash,\n    route,\n    symbol,\n    timeline00: 0,\n    timeline01: 0,\n    timeline02: 0,\n    timeline03: 0,\n    timeline04: 0,\n    timeline05: 0,\n    timeline06: 0,\n    timeline07: 0,\n    timeline08: 0,\n    timeline09: 0,\n    timeline10: 0,\n    timeline11: 0,\n    timeline12: 0,\n    timeline13: 0,\n    timeline14: 0,\n    timeline15: 0,\n    timeline16: 0,\n    timeline17: 0,\n    timeline18: 0,\n    timeline19: 0,\n    timeline20: 0,\n    timeline21: 0,\n    timeline22: 0,\n    timeline23: 0,\n    timeline24: 0,\n    timeline25: 0,\n    timeline26: 0,\n    timeline27: 0,\n    timeline28: 0,\n    timeline29: 0,\n    timeline30: 0,\n    timeline31: 0,\n    timeline32: 0,\n    timeline33: 0,\n    timeline34: 0,\n    timeline35: 0,\n    timeline36: 0,\n    timeline37: 0,\n    timeline38: 0,\n    timeline39: 0,\n    timeline40: 0,\n    timeline41: 0,\n    timeline42: 0,\n    timeline43: 0,\n    timeline44: 0,\n    timeline45: 0,\n    timeline46: 0,\n    timeline47: 0,\n    timeline48: 0,\n    timeline49: 0,\n  };\n}\n"
  },
  {
    "path": "packages/insights/src/db/query.ts",
    "content": "import { and, eq, inArray, isNull, sql } from 'drizzle-orm';\nimport { type AppDatabase } from '.';\nimport {\n  computeLatency,\n  createEdgeRow,\n  createRouteRow,\n  delayBucketField,\n  delayColumnSumList,\n  edgeTableDelayCount,\n  latencyBucketField,\n  latencyColumnSumList,\n  latencyColumnSums,\n  listToVector,\n  timelineBucketField,\n  toVector,\n} from './query-helpers';\nimport {\n  applicationTable,\n  edgeTable,\n  routesTable,\n  symbolDetailTable,\n  symbolTable,\n  type SymbolDetailRow,\n} from './schema';\nimport { time } from './logging';\n\nexport async function getEdges(\n  db: AppDatabase,\n  publicApiKey: string,\n  { limit, manifestHashes }: { limit?: number; manifestHashes: string[] }\n) {\n  return time('edgeTable.getEdges', async () => {\n    const where = manifestHashes.length\n      ? and(\n          eq(edgeTable.publicApiKey, publicApiKey),\n          inArray(edgeTable.manifestHash, manifestHashes)\n        )\n      : eq(edgeTable.publicApiKey, publicApiKey);\n\n    const query = db\n      .select({\n        from: edgeTable.from,\n        to: edgeTable.to,\n        latencyColumnSumList: latencyColumnSumList,\n        delayColumnSumList: delayColumnSumList,\n      })\n      .from(edgeTable)\n      .where(where)\n      .groupBy(edgeTable.from, edgeTable.to)\n      .limit(limit || 5_000); // TODO: The 5_000 limit is due to Turso serialization format not being efficient, upgrade this once Turso is fixed.\n    const rows = await query.all();\n    return rows.map((e) => ({\n      from: e.from,\n      to: e.to,\n      delay: listToVector(e.delayColumnSumList),\n      latency: listToVector(e.latencyColumnSumList),\n    }));\n  });\n}\n\nexport interface SlowEdge {\n  manifestHash: string;\n  to: string;\n  latency: number[];\n}\n\nexport async function getSlowEdges(\n  db: AppDatabase,\n  publicApiKey: string,\n  manifests: string[]\n): Promise<SlowEdge[]> {\n  let where = eq(edgeTable.publicApiKey, publicApiKey);\n  if (manifests.length) {\n    where = and(where, inArray(edgeTable.manifestHash, manifests))!;\n  }\n  const query = db\n    .select({\n      manifestHash: edgeTable.manifestHash,\n      to: edgeTable.to,\n      ...latencyColumnSums,\n    })\n    .from(edgeTable)\n    .where(where)\n    .groupBy(edgeTable.manifestHash, edgeTable.to)\n    .orderBy(sql`${computeLatency} DESC`)\n    .limit(400);\n  return (await query.all()).map((e) => ({\n    manifestHash: e.manifestHash,\n    to: e.to,\n    latency: toVector('sumLatencyCount' as const, e),\n  }));\n}\n\nexport type SymbolDetailForApp = Pick<\n  SymbolDetailRow,\n  'hash' | 'fullName' | 'origin' | 'lo' | 'hi'\n>;\n\nexport async function getSymbolDetails(\n  db: AppDatabase,\n  publicApiKey: string,\n  { manifestHashes }: { manifestHashes: string[] }\n): Promise<SymbolDetailForApp[]> {\n  return db\n    .select({\n      hash: symbolDetailTable.hash,\n      fullName: symbolDetailTable.fullName,\n      origin: symbolDetailTable.origin,\n      lo: symbolDetailTable.lo,\n      hi: symbolDetailTable.hi,\n    })\n    .from(symbolDetailTable)\n    .where(\n      and(\n        eq(symbolDetailTable.publicApiKey, publicApiKey),\n        inArray(symbolDetailTable.manifestHash, manifestHashes)\n      )\n    )\n    .limit(1000)\n    .all();\n}\n\nexport async function getAppInfo(\n  db: AppDatabase,\n  publicApiKey: string,\n  options: { autoCreate?: boolean } = {}\n): Promise<{\n  id: number;\n  name: string;\n  description: string | null;\n  publicApiKey: string;\n  url: string | null;\n  github: string | null;\n}> {\n  let app = await db\n    .select()\n    .from(applicationTable)\n    .where(eq(applicationTable.publicApiKey, publicApiKey))\n    .get();\n  if (!app && options.autoCreate) {\n    const appFields = {\n      name: 'Auto create: ' + publicApiKey,\n      description: 'Auto create: ' + publicApiKey,\n      url: '',\n      publicApiKey,\n    };\n    const response = await db.insert(applicationTable).values(appFields).run();\n    app = {\n      id: Number(response.lastInsertRowid),\n      ...appFields,\n    };\n  }\n  return {\n    github:\n      publicApiKey == '221smyuj5gl'\n        ? 'https://github.com/QwikDev/qwik/blob/main/packages/docs/src'\n        : null,\n    ...app!,\n  };\n}\n\nexport async function getEdgeCount(db: AppDatabase, publicApiKey: string): Promise<number> {\n  return (await db\n    .select({ count: edgeTableDelayCount })\n    .from(edgeTable)\n    .where(eq(edgeTable.publicApiKey, publicApiKey))\n    .get())!.count;\n}\n\nexport async function getSymbolEdgeCount(db: AppDatabase, publicApiKey: string): Promise<number> {\n  return (await db\n    .select({ count: sql<number>`count(*)` })\n    .from(symbolTable)\n    .where(eq(symbolTable.publicApiKey, publicApiKey))\n    .get())!.count;\n}\n\nexport async function updateEdge(\n  db: AppDatabase,\n  edge: {\n    publicApiKey: string;\n    manifestHash: string;\n    from?: string | null;\n    to: string;\n    interaction: boolean;\n    delayBucket: number;\n    latencyBucket: number;\n  }\n): Promise<void> {\n  // This may look like a good idea to run in a transaction, but it causes a lot of contention\n  // and than other queries timeout. Yes not running in TX there is a risk of missed update, but\n  // since we are a statistical model, it should not make much of a difference.\n  const latencyField = latencyBucketField(edge.latencyBucket);\n  const delayField = delayBucketField(edge.delayBucket);\n  const result = await db\n    .update(edgeTable)\n    .set({\n      [latencyField]: sql`${edgeTable[latencyField]} + 1`,\n      [delayField]: sql`${edgeTable[delayField]} + 1`,\n    })\n    .where(\n      and(\n        eq(edgeTable.manifestHash, edge.manifestHash),\n        eq(edgeTable.publicApiKey, edge.publicApiKey),\n        edge.from == null ? isNull(edgeTable.from) : eq(edgeTable.from, edge.from),\n        eq(edgeTable.to, edge.to)\n      )\n    )\n    .run();\n  if (result.rowsAffected === 0) {\n    // No row was updated, so insert a new one\n    const edgeRow = createEdgeRow(edge);\n    edgeRow[latencyBucketField(edge.latencyBucket)]++;\n    edgeRow[delayBucketField(edge.latencyBucket)]++;\n    await db.insert(edgeTable).values(edgeRow).run();\n  }\n}\n\nexport async function updateRoutes(\n  db: AppDatabase,\n  row: {\n    publicApiKey: string;\n    manifestHash: string;\n    route: string;\n    symbol: string;\n    timelineBucket: number;\n  }\n): Promise<void> {\n  // This may look like a good idea to run in a transaction, but it causes a lot of contention\n  // and than other queries timeout. Yes not running in TX there is a risk of missed update, but\n  // since we are a statistical model, it should not make much of a difference.\n  const timelineField = timelineBucketField(row.timelineBucket);\n  const result = await db\n    .update(routesTable)\n    .set({\n      [timelineField]: sql`${routesTable[timelineField]} + 1`,\n    })\n    .where(\n      and(\n        eq(routesTable.publicApiKey, row.publicApiKey),\n        eq(routesTable.manifestHash, row.manifestHash),\n        eq(routesTable.route, row.route),\n        eq(routesTable.symbol, row.symbol)\n      )\n    )\n    .run();\n  if (result.rowsAffected === 0) {\n    // No row was updated, so insert a new one\n    const routeRow = createRouteRow(row);\n    routeRow[timelineBucketField(row.timelineBucket)]++;\n    await db.insert(routesTable).values(routeRow).run();\n  }\n}\n"
  },
  {
    "path": "packages/insights/src/db/schema.ts",
    "content": "import { type InferSelectModel, type InferInsertModel } from 'drizzle-orm';\nimport {\n  integer,\n  sqliteTable,\n  text,\n  uniqueIndex,\n  index,\n  foreignKey,\n} from 'drizzle-orm/sqlite-core';\n\nexport type DatabaseSchema = {\n  applicationTable: typeof applicationTable;\n  manifestTabes: typeof manifestTable;\n  symbolTable: typeof symbolTable;\n  symbolDetailTable: typeof symbolDetailTable;\n  errorTable: typeof errorTable;\n};\n\nexport const applicationTable = sqliteTable(\n  'applications',\n  {\n    id: integer('id').primaryKey(),\n    name: text('name').notNull(),\n    description: text('description'),\n    url: text('url'),\n    publicApiKey: text('public_api_key').notNull(),\n  },\n  (applications) => ({\n    publicApiKeyIndex: uniqueIndex('publicApiKeyIndex').on(applications.publicApiKey),\n  })\n);\n\nexport type ApplicationRow = InferSelectModel<typeof applicationTable>;\nexport type ApplicationRowSansId = InferInsertModel<typeof applicationTable>;\n\nexport const symbolTable = sqliteTable('symbols', {\n  id: integer('id').primaryKey(),\n  publicApiKey: text('public_api_key').references(() => applicationTable.publicApiKey),\n  pathname: text('pathname').notNull(),\n  interaction: integer('interaction').notNull(),\n  symbol: text('symbol').notNull(),\n  previousSymbol: text('prev_symbol'),\n  timeDelta: integer('time_delta_ms').notNull(),\n  loadDelay: integer('load_delay_ms').notNull(),\n});\n\nexport type SymbolRow = InferSelectModel<typeof symbolTable>;\nexport type SymbolRowSansId = InferInsertModel<typeof symbolTable>;\n\n// event, source, lineno, colno, error\nexport const errorTable = sqliteTable('errors', {\n  id: integer('id').primaryKey(),\n  publicApiKey: text('public_api_key').references(() => applicationTable.publicApiKey),\n  manifestHash: text('manifest_hash').references(() => manifestTable.hash),\n  timestamp: integer('timestamp', { mode: 'timestamp_ms' }).notNull(),\n  url: text('url').notNull(),\n  source: text('source').notNull(),\n  line: integer('line').notNull(),\n  column: integer('column').notNull(),\n  message: text('message').notNull(),\n  error: text('error').notNull(),\n  stack: text('stack').notNull(),\n});\n\nexport type ErrorRow = InferSelectModel<typeof errorTable>;\n\nexport const manifestTable = sqliteTable(\n  'manifests',\n  {\n    id: integer('id').primaryKey(),\n    publicApiKey: text('public_api_key').references(() => applicationTable.publicApiKey),\n    hash: text('hash').notNull(),\n    timestamp: integer('timestamp', { mode: 'timestamp_ms' }).notNull(),\n  },\n  (table) => ({\n    publicApiKeyHashIndex: index('idx_manifests_apiKey_hash').on(table.hash, table.publicApiKey),\n    publicApiKeyHashIndex_2: index('idx_manifests_apiKey_hash_2').on(\n      table.publicApiKey,\n      table.hash\n    ),\n    apiTimestamp: index('idx_manifest_api_timestamp').on(table.publicApiKey, table.timestamp),\n    publicApiKeyIndex: index('idx_manifests_public_apiKey').on(table.publicApiKey),\n    hashIndex: index('idx_manifests_hash').on(table.hash),\n  })\n);\n\nexport type ManifestRow = InferSelectModel<typeof manifestTable>;\n\nexport const symbolDetailTable = sqliteTable(\n  'symbolDetail',\n  {\n    id: integer('id').primaryKey(),\n    hash: text('hash').notNull(),\n    publicApiKey: text('public_api_key'),\n    manifestHash: text('manifest_hash'),\n    fullName: text('full_name').notNull(),\n    origin: text('origin').notNull(),\n    lo: integer('lo').notNull(),\n    hi: integer('hi').notNull(),\n  },\n  (symbolDetailTable) => ({\n    apiKeyManifestHashIndex: uniqueIndex('idx_symbolDetail_apiKey_manifestHash').on(\n      symbolDetailTable.publicApiKey,\n      symbolDetailTable.manifestHash\n    ),\n    publicApiKeyReference: foreignKey({\n      columns: [symbolDetailTable.publicApiKey],\n      foreignColumns: [applicationTable.publicApiKey],\n    }),\n    manifestHashReference: foreignKey({\n      columns: [symbolDetailTable.publicApiKey, symbolDetailTable.manifestHash],\n      foreignColumns: [manifestTable.publicApiKey, manifestTable.hash],\n    }),\n  })\n);\n\nexport type SymbolDetailRow = InferSelectModel<typeof symbolDetailTable>;\nexport type SymbolDetailRowSansId = InferInsertModel<typeof symbolDetailTable>;\n\nexport const edgeTable = sqliteTable(\n  'edges',\n  {\n    id: integer('id').primaryKey(),\n    publicApiKey: text('public_api_key').references(() => applicationTable.publicApiKey),\n    manifestHash: text('manifest_hash').notNull(),\n    from: text('from'),\n    to: text('to').notNull(),\n    interaction: integer('interaction').notNull(),\n    delayCount00: integer('delay_count_00').notNull(),\n    delayCount01: integer('delay_count_01').notNull(),\n    delayCount02: integer('delay_count_02').notNull(),\n    delayCount03: integer('delay_count_03').notNull(),\n    delayCount04: integer('delay_count_04').notNull(),\n    delayCount05: integer('delay_count_05').notNull(),\n    delayCount06: integer('delay_count_06').notNull(),\n    delayCount07: integer('delay_count_07').notNull(),\n    delayCount08: integer('delay_count_08').notNull(),\n    delayCount09: integer('delay_count_09').notNull(),\n    delayCount10: integer('delay_count_10').notNull(),\n    delayCount11: integer('delay_count_11').notNull(),\n    delayCount12: integer('delay_count_12').notNull(),\n    delayCount13: integer('delay_count_13').notNull(),\n    delayCount14: integer('delay_count_14').notNull(),\n    delayCount15: integer('delay_count_15').notNull(),\n    delayCount16: integer('delay_count_16').notNull(),\n    delayCount17: integer('delay_count_17').notNull(),\n    delayCount18: integer('delay_count_18').notNull(),\n    delayCount19: integer('delay_count_19').notNull(),\n    delayCount20: integer('delay_count_20').notNull(),\n    delayCount21: integer('delay_count_21').notNull(),\n    delayCount22: integer('delay_count_22').notNull(),\n    delayCount23: integer('delay_count_23').notNull(),\n    delayCount24: integer('delay_count_24').notNull(),\n    delayCount25: integer('delay_count_25').notNull(),\n    delayCount26: integer('delay_count_26').notNull(),\n    delayCount27: integer('delay_count_27').notNull(),\n    delayCount28: integer('delay_count_28').notNull(),\n    delayCount29: integer('delay_count_29').notNull(),\n    delayCount30: integer('delay_count_30').notNull(),\n    delayCount31: integer('delay_count_31').notNull(),\n    delayCount32: integer('delay_count_32').notNull(),\n    delayCount33: integer('delay_count_33').notNull(),\n    delayCount34: integer('delay_count_34').notNull(),\n    delayCount35: integer('delay_count_35').notNull(),\n    delayCount36: integer('delay_count_36').notNull(),\n    delayCount37: integer('delay_count_37').notNull(),\n    delayCount38: integer('delay_count_38').notNull(),\n    delayCount39: integer('delay_count_39').notNull(),\n    delayCount40: integer('delay_count_40').notNull(),\n    delayCount41: integer('delay_count_41').notNull(),\n    delayCount42: integer('delay_count_42').notNull(),\n    delayCount43: integer('delay_count_43').notNull(),\n    delayCount44: integer('delay_count_44').notNull(),\n    delayCount45: integer('delay_count_45').notNull(),\n    delayCount46: integer('delay_count_46').notNull(),\n    delayCount47: integer('delay_count_47').notNull(),\n    delayCount48: integer('delay_count_48').notNull(),\n    delayCount49: integer('delay_count_49').notNull(),\n    latencyCount00: integer('latency_count_00').notNull(),\n    latencyCount01: integer('latency_count_01').notNull(),\n    latencyCount02: integer('latency_count_02').notNull(),\n    latencyCount03: integer('latency_count_03').notNull(),\n    latencyCount04: integer('latency_count_04').notNull(),\n    latencyCount05: integer('latency_count_05').notNull(),\n    latencyCount06: integer('latency_count_06').notNull(),\n    latencyCount07: integer('latency_count_07').notNull(),\n    latencyCount08: integer('latency_count_08').notNull(),\n    latencyCount09: integer('latency_count_09').notNull(),\n    latencyCount10: integer('latency_count_10').notNull(),\n    latencyCount11: integer('latency_count_11').notNull(),\n    latencyCount12: integer('latency_count_12').notNull(),\n    latencyCount13: integer('latency_count_13').notNull(),\n    latencyCount14: integer('latency_count_14').notNull(),\n    latencyCount15: integer('latency_count_15').notNull(),\n    latencyCount16: integer('latency_count_16').notNull(),\n    latencyCount17: integer('latency_count_17').notNull(),\n    latencyCount18: integer('latency_count_18').notNull(),\n    latencyCount19: integer('latency_count_19').notNull(),\n    latencyCount20: integer('latency_count_20').notNull(),\n    latencyCount21: integer('latency_count_21').notNull(),\n    latencyCount22: integer('latency_count_22').notNull(),\n    latencyCount23: integer('latency_count_23').notNull(),\n    latencyCount24: integer('latency_count_24').notNull(),\n    latencyCount25: integer('latency_count_25').notNull(),\n    latencyCount26: integer('latency_count_26').notNull(),\n    latencyCount27: integer('latency_count_27').notNull(),\n    latencyCount28: integer('latency_count_28').notNull(),\n    latencyCount29: integer('latency_count_29').notNull(),\n    latencyCount30: integer('latency_count_30').notNull(),\n    latencyCount31: integer('latency_count_31').notNull(),\n    latencyCount32: integer('latency_count_32').notNull(),\n    latencyCount33: integer('latency_count_33').notNull(),\n    latencyCount34: integer('latency_count_34').notNull(),\n    latencyCount35: integer('latency_count_35').notNull(),\n    latencyCount36: integer('latency_count_36').notNull(),\n    latencyCount37: integer('latency_count_37').notNull(),\n    latencyCount38: integer('latency_count_38').notNull(),\n    latencyCount39: integer('latency_count_39').notNull(),\n    latencyCount40: integer('latency_count_40').notNull(),\n    latencyCount41: integer('latency_count_41').notNull(),\n    latencyCount42: integer('latency_count_42').notNull(),\n    latencyCount43: integer('latency_count_43').notNull(),\n    latencyCount44: integer('latency_count_44').notNull(),\n    latencyCount45: integer('latency_count_45').notNull(),\n    latencyCount46: integer('latency_count_46').notNull(),\n    latencyCount47: integer('latency_count_47').notNull(),\n    latencyCount48: integer('latency_count_48').notNull(),\n    latencyCount49: integer('latency_count_49').notNull(),\n  },\n  (table) => ({\n    publicApiKyIndex: index('edgeIndex_PublicApiKey').on(table.publicApiKey),\n    publicApiKeyIndex: index('idx_edge_publicApiKey_manifestHash').on(table.publicApiKey),\n    publicApiKeyManifestHashIndex: index('idx_edge_publicApiKey_manifestHash').on(\n      table.publicApiKey,\n      table.manifestHash\n    ),\n    edgeIndex: index('idx_edge_apiKey_manifestHash_from_to').on(\n      table.publicApiKey,\n      table.manifestHash,\n      table.from,\n      table.to\n    ),\n    idx_edge_from_to: index('idx_edge_from_to').on(table.from, table.to),\n    idx_apiKey_hash_from: index('idx_apiKey_hash_from').on(\n      table.publicApiKey,\n      table.from,\n      table.manifestHash\n    ),\n    idx_hash_to: index('idx_hash_to').on(table.manifestHash, table.to),\n  })\n);\n\nexport type EdgeRow = InferSelectModel<typeof edgeTable>;\nexport type EdgeRowSansId = InferInsertModel<typeof edgeTable>;\n\nexport const routesTable = sqliteTable(\n  'routes',\n  {\n    id: integer('id').primaryKey(),\n    publicApiKey: text('public_api_key').references(() => applicationTable.publicApiKey),\n    manifestHash: text('manifest_hash').notNull(),\n    route: text('route').notNull(),\n    symbol: text('symbol').notNull(),\n    timeline00: integer('timeline_00').notNull(),\n    timeline01: integer('timeline_01').notNull(),\n    timeline02: integer('timeline_02').notNull(),\n    timeline03: integer('timeline_03').notNull(),\n    timeline04: integer('timeline_04').notNull(),\n    timeline05: integer('timeline_05').notNull(),\n    timeline06: integer('timeline_06').notNull(),\n    timeline07: integer('timeline_07').notNull(),\n    timeline08: integer('timeline_08').notNull(),\n    timeline09: integer('timeline_09').notNull(),\n    timeline10: integer('timeline_10').notNull(),\n    timeline11: integer('timeline_11').notNull(),\n    timeline12: integer('timeline_12').notNull(),\n    timeline13: integer('timeline_13').notNull(),\n    timeline14: integer('timeline_14').notNull(),\n    timeline15: integer('timeline_15').notNull(),\n    timeline16: integer('timeline_16').notNull(),\n    timeline17: integer('timeline_17').notNull(),\n    timeline18: integer('timeline_18').notNull(),\n    timeline19: integer('timeline_19').notNull(),\n    timeline20: integer('timeline_20').notNull(),\n    timeline21: integer('timeline_21').notNull(),\n    timeline22: integer('timeline_22').notNull(),\n    timeline23: integer('timeline_23').notNull(),\n    timeline24: integer('timeline_24').notNull(),\n    timeline25: integer('timeline_25').notNull(),\n    timeline26: integer('timeline_26').notNull(),\n    timeline27: integer('timeline_27').notNull(),\n    timeline28: integer('timeline_28').notNull(),\n    timeline29: integer('timeline_29').notNull(),\n    timeline30: integer('timeline_30').notNull(),\n    timeline31: integer('timeline_31').notNull(),\n    timeline32: integer('timeline_32').notNull(),\n    timeline33: integer('timeline_33').notNull(),\n    timeline34: integer('timeline_34').notNull(),\n    timeline35: integer('timeline_35').notNull(),\n    timeline36: integer('timeline_36').notNull(),\n    timeline37: integer('timeline_37').notNull(),\n    timeline38: integer('timeline_38').notNull(),\n    timeline39: integer('timeline_39').notNull(),\n    timeline40: integer('timeline_40').notNull(),\n    timeline41: integer('timeline_41').notNull(),\n    timeline42: integer('timeline_42').notNull(),\n    timeline43: integer('timeline_43').notNull(),\n    timeline44: integer('timeline_44').notNull(),\n    timeline45: integer('timeline_45').notNull(),\n    timeline46: integer('timeline_46').notNull(),\n    timeline47: integer('timeline_47').notNull(),\n    timeline48: integer('timeline_48').notNull(),\n    timeline49: integer('timeline_49').notNull(),\n  },\n  (table) => ({\n    routeSymbolIndex: uniqueIndex('routeIndex_Symbol').on(\n      table.publicApiKey,\n      table.manifestHash,\n      table.route,\n      table.symbol\n    ),\n    publicApiKeyAndManifestHashIndex: index('idx_routes_publicApiKey_manifestHash').on(\n      table.publicApiKey,\n      table.manifestHash\n    ),\n  })\n);\n\nexport type RouteRow = InferSelectModel<typeof routesTable>;\nexport type RouteRowSansId = InferInsertModel<typeof routesTable>;\n\nexport const usersTable = sqliteTable(\n  'users',\n  {\n    id: integer('user_id').primaryKey(),\n    email: text('email').notNull(),\n    created: integer('created', { mode: 'timestamp_ms' }).notNull(),\n    superUser: integer('super_user', { mode: 'boolean' }).notNull(),\n  },\n  (table) => ({\n    emailIndex: uniqueIndex('emailIndex').on(table.email),\n  })\n);\n\nexport const userApplicationMap = sqliteTable(\n  'userApplicationMap',\n  {\n    applicationId: integer('application_id').references(() => applicationTable.id),\n    userId: integer('user_id').references(() => usersTable.id),\n  },\n  (table) => ({\n    userApplicationIndex: uniqueIndex('userApplicationIndex').on(table.applicationId, table.userId),\n  })\n);\n"
  },
  {
    "path": "packages/insights/src/db/sql-edges.ts",
    "content": "import { and, eq, inArray, sql } from 'drizzle-orm';\nimport { type AppDatabase } from './index';\nimport { edgeTableDelayCount, latencyColumnSums, delayColumnSums, toVector } from './query-helpers';\nimport { edgeTable } from './schema';\n\nexport interface OutgoingEdge {\n  manifestHash: string;\n  to: string;\n  latency: number[];\n  delay: number[];\n}\n\nexport async function dbGetOutgoingEdges(\n  db: AppDatabase,\n  publicApiKey: string,\n  symbol: string,\n  manifests: string[]\n): Promise<OutgoingEdge[]> {\n  let where = and(eq(edgeTable.publicApiKey, publicApiKey), eq(edgeTable.from, symbol));\n  if (manifests.length) {\n    where = and(where, inArray(edgeTable.manifestHash, manifests))!;\n  }\n  const query = db\n    .select({\n      manifestHash: edgeTable.manifestHash,\n      to: edgeTable.to,\n      ...latencyColumnSums,\n      ...delayColumnSums,\n    })\n    .from(edgeTable)\n    .where(where)\n    .groupBy(edgeTable.manifestHash, edgeTable.to)\n    .orderBy(sql`${edgeTableDelayCount} DESC`)\n    .limit(50);\n  return (await query.all()).map((e) => {\n    return {\n      manifestHash: e.manifestHash,\n      to: e.to,\n      latency: toVector('sumLatencyCount' as const, e),\n      delay: toVector('sumDelayCount' as const, e),\n    };\n  });\n}\n"
  },
  {
    "path": "packages/insights/src/db/sql-manifest.ts",
    "content": "import { eq, and, sql } from 'drizzle-orm';\nimport { type AppDatabase } from './index';\nimport { type ManifestRow, edgeTable, manifestTable } from './schema';\nimport { latencyColumnSums, latencyCount, toVector } from './query-helpers';\n\nexport async function dbGetManifests(\n  db: AppDatabase,\n  publicApiKey: string\n): Promise<ManifestRow[]> {\n  const manifests = await db\n    .select()\n    .from(manifestTable)\n    .where(and(eq(manifestTable.publicApiKey, publicApiKey)))\n    .orderBy(sql`${manifestTable.timestamp} DESC`)\n    .limit(1000)\n    .all();\n  return manifests;\n}\n\nexport interface ManifestStatsRow {\n  hash: string;\n  timestamp: Date;\n  latency: number[];\n}\n\nexport async function dbGetManifestStats(\n  db: AppDatabase,\n  publicApiKey: string\n): Promise<ManifestStatsRow[]> {\n  const manifests = await db\n    .select({\n      hash: manifestTable.hash,\n      timestamp: manifestTable.timestamp,\n      ...latencyColumnSums,\n    })\n    .from(manifestTable)\n    .innerJoin(edgeTable, eq(edgeTable.manifestHash, manifestTable.hash))\n    .where(and(eq(manifestTable.publicApiKey, publicApiKey)))\n    .groupBy(manifestTable.hash)\n    .orderBy(sql`${manifestTable.timestamp} DESC`)\n    .limit(1000)\n    .all();\n  return manifests.map((manifest) => {\n    return {\n      hash: manifest.hash,\n      timestamp: manifest.timestamp,\n      latency: toVector('sumLatencyCount' as const, manifest),\n    };\n  });\n}\n\nexport async function dbGetManifestInfo(\n  db: AppDatabase,\n  publicApiKey: string,\n  manifestHash: string\n): Promise<ManifestRow> {\n  const manifest = await db\n    .select()\n    .from(manifestTable)\n    .where(and(eq(manifestTable.publicApiKey, publicApiKey), eq(manifestTable.hash, manifestHash)))\n    .get();\n  if (manifest) {\n    return manifest;\n  } else {\n    const manifestFields = {\n      publicApiKey,\n      hash: manifestHash,\n      timestamp: new Date(),\n    };\n    const response = await db.insert(manifestTable).values(manifestFields).run();\n    return {\n      id: Number(response.lastInsertRowid),\n      ...manifestFields,\n    };\n  }\n}\n\nexport async function dbGetManifestHashes(\n  db: AppDatabase,\n  publicApiKey: string,\n  { sampleSize }: { sampleSize?: number } = {}\n): Promise<string[]> {\n  if (typeof sampleSize !== 'number') {\n    sampleSize = 100000;\n  }\n  const manifests = await db\n    .select({ hash: manifestTable.hash, ...latencyCount })\n    .from(manifestTable)\n    .innerJoin(\n      edgeTable,\n      and(\n        eq(edgeTable.publicApiKey, manifestTable.publicApiKey),\n        eq(edgeTable.manifestHash, manifestTable.hash)\n      )\n    )\n    .where(eq(manifestTable.publicApiKey, publicApiKey))\n    .groupBy(manifestTable.hash)\n    .orderBy(sql`${manifestTable.timestamp} DESC`)\n    .limit(1000)\n    .all();\n  const hashes: string[] = [];\n  let sum = 0;\n  for (let i = 0; i < manifests.length; i++) {\n    const row = manifests[i];\n    hashes.push(row.hash);\n    sum += row.latencyCount;\n    if (sum > sampleSize) {\n      break;\n    }\n  }\n  return hashes;\n}\n"
  },
  {
    "path": "packages/insights/src/db/sql-routes.ts",
    "content": "import { and, desc, eq, inArray, sql } from 'drizzle-orm';\nimport { routesTable, type AppDatabase } from '.';\nimport { listToVector, sumTimelineCount, timelineDelayAsList } from './query-helpers';\nimport { time } from './logging';\n\nexport interface RouteSymbolRow {\n  route: string;\n  symbol: string;\n  timeline: number[];\n}\n\nexport async function getRoutes(\n  db: AppDatabase,\n  publicApiKey: string,\n  manifests: string[] | undefined\n): Promise<RouteSymbolRow[]> {\n  let where = eq(routesTable.publicApiKey, publicApiKey);\n  if (manifests && manifests.length) {\n    where = and(where, inArray(routesTable.manifestHash, manifests))!;\n  }\n\n  return time('routesTable.getRoutes', async () => {\n    const query = await db\n      .select({\n        route: routesTable.route,\n        symbol: routesTable.symbol,\n        timelineDelays: timelineDelayAsList,\n      })\n      .from(routesTable)\n      .where(where)\n      .groupBy(routesTable.route, routesTable.symbol)\n      .orderBy(sql`${routesTable.route}`, desc(sumTimelineCount))\n      .limit(1000)\n      .all();\n    return query.map((row) => ({\n      route: row.route,\n      symbol: row.symbol,\n      timeline: listToVector(row.timelineDelays),\n    }));\n  });\n}\n\nexport interface RouteRow {\n  route: string;\n  // timeline: number[];\n}\n\nexport async function getRouteNames(\n  db: AppDatabase,\n  publicApiKey: string,\n  manifests: string[] | undefined\n): Promise<RouteRow[]> {\n  let where = eq(routesTable.publicApiKey, publicApiKey);\n  if (manifests && manifests.length) {\n    where = and(where, inArray(routesTable.manifestHash, manifests))!;\n  }\n\n  return time('routesTable.getRoutes', async () => {\n    const query = await db\n      .select({\n        route: routesTable.route,\n      })\n      .from(routesTable)\n      .where(where)\n      .groupBy(routesTable.route)\n      .orderBy(sql`${routesTable.route}`)\n      .limit(1000)\n      .all();\n    return query.map((row) => ({\n      route: row.route,\n      // timeline: listToVector(row.timelineDelays),\n    }));\n  });\n}\n\nexport interface RouteSymbolRow {\n  route: string;\n  symbol: string;\n  timeline: number[];\n}\n\nexport async function getRouteTimeline(\n  db: AppDatabase,\n  publicApiKey: string,\n  route: string,\n  manifests: string[] | undefined\n): Promise<RouteSymbolRow[]> {\n  let where = and(eq(routesTable.publicApiKey, publicApiKey), eq(routesTable.route, route));\n  if (manifests && manifests.length) {\n    where = and(where, inArray(routesTable.manifestHash, manifests))!;\n  }\n\n  return time(`routesTable.getRouteTimeline(\"${publicApiKey}\", \"${route}\")`, async () => {\n    const query = await db\n      .select({\n        route: routesTable.route,\n        symbol: routesTable.symbol,\n        timelineDelays: timelineDelayAsList,\n      })\n      .from(routesTable)\n      .where(where)\n      .groupBy(routesTable.route, routesTable.symbol)\n      .orderBy(sql`${routesTable.route}`, desc(sumTimelineCount))\n      .limit(1000)\n      .all();\n    return query.map((row) => ({\n      route: row.route,\n      symbol: row.symbol,\n      timeline: listToVector(row.timelineDelays),\n    }));\n  });\n}\n"
  },
  {
    "path": "packages/insights/src/db/sql-user.ts",
    "content": "import { and, eq, sql } from 'drizzle-orm';\nimport { getDB } from './index';\nimport { applicationTable, userApplicationMap, usersTable } from './schema';\n\nexport class InsightsUser {\n  userId: number;\n  email: string;\n  superUser: boolean;\n  applicationPublicApiKeys: string[];\n\n  constructor(\n    userId: number,\n    email: string,\n    superUser: boolean,\n    applicationPublicApiKeys: string[]\n  ) {\n    this.userId = userId;\n    this.email = email;\n    this.superUser = superUser;\n    this.applicationPublicApiKeys = applicationPublicApiKeys;\n  }\n\n  isAuthorizedForApp(publicApiKey: string) {\n    if (this.superUser) {\n      return true;\n    }\n    return this.applicationPublicApiKeys.includes(publicApiKey);\n  }\n}\n\nexport const dbGetInsightUser = async (email: string): Promise<InsightsUser> => {\n  const db = getDB();\n  const users = await db\n    .select({\n      userId: usersTable.id,\n      superUser: usersTable.superUser,\n      publicApiKey: applicationTable.publicApiKey,\n    })\n    .from(usersTable)\n    .leftJoin(userApplicationMap, eq(usersTable.id, userApplicationMap.userId))\n    .leftJoin(applicationTable, eq(applicationTable.id, userApplicationMap.applicationId))\n    .where(eq(usersTable.email, email))\n    .limit(1000)\n    .all();\n  if (users.length === 0) {\n    const insert = await db\n      .insert(usersTable)\n      .values({ email, superUser: false, created: new Date() })\n      .execute();\n    return new InsightsUser(Number(insert.lastInsertRowid), email, false, []);\n  } else {\n    return new InsightsUser(\n      users[0].userId,\n      email,\n      users[0].superUser,\n      users.reduceRight<string[]>((keys, user) => {\n        if (user.publicApiKey) {\n          keys.push(user.publicApiKey);\n        }\n        return keys;\n      }, [])\n    );\n  }\n};\n\nexport const dbGetUsersForApplication = async (publicApiKey: string) => {\n  const users = await getDB()\n    .select({\n      email: usersTable.email,\n    })\n    .from(usersTable)\n    .leftJoin(userApplicationMap, eq(usersTable.id, userApplicationMap.userId))\n    .leftJoin(applicationTable, eq(applicationTable.id, userApplicationMap.applicationId))\n    .where(eq(applicationTable.publicApiKey, publicApiKey))\n    .orderBy(usersTable.email)\n    .limit(1000)\n    .all();\n  return users.map((user) => user.email);\n};\n\nexport const dbRemoveUserFromApplication = async (email: string, publicApiKey: string) => {\n  console.log('dbRemoveUserFromApplication', email, publicApiKey);\n  await getDB()\n    .delete(userApplicationMap)\n    .where(\n      and(\n        eq(\n          userApplicationMap.applicationId,\n          sql`(select ${applicationTable.id} from ${applicationTable} where ${applicationTable.publicApiKey} = ${publicApiKey})`\n        ),\n        eq(\n          userApplicationMap.userId,\n          sql`(select ${usersTable.id} from ${usersTable} where ${usersTable.email} = ${email})`\n        )\n      )\n    );\n};\n\nexport const dbAddUserToApplication = async (email: string, publicApiKey: string) => {\n  const [user, app] = await Promise.all([\n    await dbGetInsightUser(email),\n    await getDB()\n      .select({ applicationId: applicationTable.id })\n      .from(applicationTable)\n      .where(eq(applicationTable.publicApiKey, publicApiKey))\n      .get(),\n  ]);\n  try {\n    await getDB()\n      .insert(userApplicationMap)\n      .values({ userId: user.userId, applicationId: app?.applicationId })\n      .execute();\n  } catch (e) {\n    console.warn('User already exists', email, publicApiKey);\n  }\n};\n"
  },
  {
    "path": "packages/insights/src/entry.dev.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Development entry point using only client-side modules:\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nimport { render, type RenderOptions } from '@builder.io/qwik';\nimport Root from './root';\n\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "packages/insights/src/entry.netlify-edge.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for Netlify Edge when building for production.\n *\n * Learn more about the Netlify integration here:\n * - https://qwik.dev/docs/deployments/netlify-edge/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformNetlify,\n} from '@builder.io/qwik-city/middleware/netlify-edge';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\ndeclare global {\n  type QwikCityPlatform = PlatformNetlify;\n}\n\nexport default createQwikCity({ render, qwikCityPlan, checkOrigin: false });\n"
  },
  {
    "path": "packages/insights/src/entry.preview.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the bundle entry point for `npm run preview`.\n * That is, serving your app built in production mode.\n *\n * Feel free to modify this file, but don't remove it!\n *\n * Learn more about Vite's preview command:\n * - https://vitejs.dev/config/preview-options.html#preview-options\n *\n */\nimport { createQwikCity } from '@builder.io/qwik-city/middleware/node';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from './entry.ssr';\n\n/** The default export is the QwikCity adapter used by Vite preview. */\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "packages/insights/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this entry point\n * will be the common one.\n *\n * - Server (express, cloudflare...)\n * - `npm run start`\n * - `npm run preview`\n * - `npm run build`\n */\nimport { renderToStream, type RenderToStreamOptions } from '@builder.io/qwik/server';\nimport Root from './root';\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    ...opts,\n    // Use container attributes to set attributes on the html tag.\n    containerAttributes: {\n      lang: 'en-us',\n      ...opts.containerAttributes,\n    },\n  });\n}\n"
  },
  {
    "path": "packages/insights/src/global.css",
    "content": "/**\n * Tailwind CSS imports\n * View the full documentation at https://tailwindcss.com\n */\n@import 'tailwindcss';\n\n@theme {\n  /* --link-offset: 0.15rem;\n  --primary-50: #f0f9ff;\n  --primary-100: #dff3ff;\n  --primary-200: #b9e8fe;\n  --primary-300: #7ad7ff;\n  --primary-400: #34c3fc;\n  --primary-500: #18b6f6;\n  --primary-600: #008acb;\n  --primary-700: #006ea4;\n  --primary-800: #045d88;\n  --primary-900: #0a4d70;\n  --primary-950: #07304a;\n\n  --secondary-50: #f9f6fe;\n  --secondary-100: #f1e9fe;\n  --secondary-200: #e5d7fd;\n  --secondary-300: #d1b8fa;\n  --secondary-400: #ac7ef4;\n  --secondary-500: #985eee;\n  --secondary-600: #803edf;\n  --secondary-700: #6c2cc4;\n  --secondary-800: #5d29a0;\n  --secondary-900: #4d2281;\n  --secondary-950: #310c5f;\n\n  --gray-50: #f9fafb;\n  --gray-100: #f3f4f6;\n  --gray-200: #e5e7eb;\n  --gray-300: #d1d5db;\n  --gray-400: #9ca3af;\n  --gray-500: #6b7280;\n  --gray-600: #4b5563;\n  --gray-700: #374151;\n  --gray-800: #1f2937;\n  --gray-900: #111827;\n  --gray-950: #030712;\n\n  --white: #ffffff;\n  --black: #000000;\n\n  --size-0: 0;\n  --size-px: 1px;\n  --size-0_5: 0.125rem;\n  --size-1: 0.25rem;\n  --size-1_5: 0.375rem;\n  --size-2: 0.5rem;\n  --size-2_5: 0.625rem;\n  --size-3: 0.75rem;\n  --size-3_5: 0.875rem;\n  --size-4: 1rem;\n  --size-5: 1.25rem;\n  --size-6: 1.5rem;\n  --size-7: 1.75rem;\n  --size-8: 2rem;\n  --size-9: 2.25rem;\n  --size-10: 2.5rem;\n\n  --size-layout-sm: var(--size-1) var(--size-4);\n  --size-layout-md: var(--size-2) var(--size-8);\n\n  --bg-color-default: var(--gray-100);\n  --bg-color-bright: var(--white);\n  --text-color-default: var(--black);\n  --text-color-light: var(--gray-600);\n  --border-color-default: var(--gray-200);\n\n  --form-element-margin-bottom: var(--size-4); */\n}\n\nhtml {\n  -webkit-text-size-adjust: 100%;\n  -moz-tab-size: 4;\n  -o-tab-size: 4;\n  tab-size: 4;\n  font-family:\n    ui-sans-serif,\n    system-ui,\n    -apple-system,\n    BlinkMacSystemFont,\n    'Segoe UI',\n    Roboto,\n    'Helvetica Neue',\n    Arial,\n    'Noto Sans',\n    sans-serif,\n    'Apple Color Emoji',\n    'Segoe UI Emoji',\n    'Segoe UI Symbol',\n    'Noto Color Emoji';\n}\n\n/* latin */\n@font-face {\n  font-family: 'Poppins';\n  font-style: normal;\n  font-weight: 400;\n  src: url(./fonts/poppins-400.woff2) format('woff2');\n  unicode-range:\n    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* latin */\n@font-face {\n  font-family: 'Poppins';\n  font-style: normal;\n  font-weight: 500;\n  src: url(./fonts/poppins-500.woff2) format('woff2');\n  unicode-range:\n    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\n/* latin */\n@font-face {\n  font-family: 'Poppins';\n  font-style: normal;\n  font-weight: 700;\n  src: url(./fonts/poppins-700.woff2) format('woff2');\n  unicode-range:\n    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n\nhtml,\nbody {\n  height: 100%;\n  font-family: 'Poppins', Helvetica, Arial, sans-serif;\n}\n\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n  font-weight: 500;\n}\n\n.h1 svg,\n.h2 svg,\n.h3 svg,\n.h4 svg,\n.h5 svg,\n.h6 svg {\n  @apply mr-3;\n}\n\n.h1 {\n  @apply text-4xl;\n  @apply mb-9;\n}\n.h2 {\n  @apply text-3xl;\n  @apply mb-8;\n}\n.h3 {\n  @apply text-2xl;\n  @apply mb-7;\n}\n.h4 {\n  @apply text-xl;\n  @apply mb-3;\n}\n.h5 {\n  @apply text-lg;\n  @apply mb-2.5;\n}\n.h6 {\n  @apply text-base;\n  @apply mb-2;\n}\n\na {\n  color: inherit;\n  text-decoration: none;\n}\n\nform > div {\n  @apply mb-4;\n}\n\nlabel {\n  color: black;\n  display: block;\n}\n\ninput {\n  @apply bg-white text-black;\n}\n\ninput {\n  @apply px-4 py-2 w-full rounded-sm;\n}\n\n.button {\n  @apply inline-flex cursor-pointer items-center justify-center gap-3 rounded-sm border border-slate-300 px-8 py-2;\n}\n\nsvg {\n  display: inline-block;\n}\n\n.button svg {\n  width: 1.5rem;\n  height: 1.5rem;\n}\n"
  },
  {
    "path": "packages/insights/src/root.tsx",
    "content": "import './global.css';\nimport { component$ } from '@builder.io/qwik';\nimport { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city';\nimport { Insights } from '@builder.io/qwik-labs';\nimport { RouterHead } from './components/router-head/router-head';\nexport default component$(() => {\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charset=\"utf-8\" />\n        <link rel=\"manifest\" href=\"/manifest.json\" />\n        <RouterHead />\n        <Insights\n          publicApiKey={import.meta.env.PUBLIC_QWIK_INSIGHTS_KEY}\n          postUrl=\"/api/v1/${publicApiKey}/post/\"\n        />\n      </head>\n      <body lang=\"en\">\n        <RouterOutlet />\n        <ServiceWorkerRegister />\n      </body>\n    </QwikCityProvider>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/api/v1/[publicApiKey]/bundles/bundles.tsx",
    "content": "import { type AppDatabase } from '~/db';\nimport { getEdges } from '~/db/query';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport { computeBundles, computeSymbolGraph, computeSymbolVectors } from '~/stats/edges';\n\nexport async function getBundleGrouping({\n  publicApiKey,\n  db,\n}: {\n  publicApiKey: string;\n  db: AppDatabase;\n}): Promise<Record<string, string>> {\n  const symbols = await getEdges(db, publicApiKey, {\n    manifestHashes: await dbGetManifestHashes(db, publicApiKey),\n  });\n  const rootSymbol = computeSymbolGraph(symbols);\n  const vectors = computeSymbolVectors(rootSymbol);\n  const bundles = computeBundles(vectors);\n  const bundleMap: Record<string, string> = {};\n  bundles.forEach((bundle) => {\n    bundle.symbols.forEach((symbol) => {\n      bundleMap[symbol.name] = bundle.name;\n    });\n  });\n  return bundleMap;\n}\n"
  },
  {
    "path": "packages/insights/src/routes/api/v1/[publicApiKey]/bundles/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\nimport { getBundleGrouping } from './bundles';\nimport { getDB } from '../../../../../db';\n\nexport const onGet: RequestHandler = async ({ exit, json, params }) => {\n  json(\n    200,\n    await getBundleGrouping({\n      publicApiKey: params.publicApiKey,\n      db: getDB(),\n    })\n  );\n  exit();\n};\n"
  },
  {
    "path": "packages/insights/src/routes/api/v1/[publicApiKey]/bundles/strategy/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\nimport { getEdges } from '~/db/query';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport { getDB } from '../../../../../../db';\nimport { computeSymbolGraph, computeSymbolVectors, computeBundles } from '~/stats/edges';\nimport { getRoutes } from '~/db/sql-routes';\n\ninterface Strategy {\n  type: 'smart';\n  manual: Record<string, string>;\n  prefetch: Prefetch[];\n}\ninterface Prefetch {\n  route: string;\n  symbols: string[];\n}\n\nexport const onGet: RequestHandler = async ({ json, params }) => {\n  const publicApiKey = params.publicApiKey;\n  const db = getDB();\n  const strategy: Strategy = {\n    type: 'smart',\n    manual: {},\n    prefetch: [],\n  };\n\n  const manifestHashes = await dbGetManifestHashes(db, publicApiKey);\n  const [symbols, routes] = await Promise.all([\n    getEdges(db, publicApiKey, { manifestHashes }),\n    getRoutes(db, publicApiKey, manifestHashes),\n  ]);\n\n  const rootSymbol = computeSymbolGraph(symbols);\n  const vectors = computeSymbolVectors(rootSymbol);\n  const bundles = computeBundles(vectors);\n  const bundleMap: Record<string, string> = strategy.manual;\n  bundles.forEach((bundle) => {\n    bundle.symbols.forEach((symbol) => {\n      bundleMap[symbol.name] = bundle.name;\n    });\n  });\n\n  const routeMap = new Map<string, Prefetch>();\n  routes.forEach((route) => {\n    const prefetch = getRoutePrefetch(route.route);\n    prefetch.symbols.push(route.symbol);\n  });\n\n  json(200, strategy);\n  //////////////////////\n\n  function getRoutePrefetch(route: string): Prefetch {\n    let routeData = routeMap.get(route);\n    if (routeData == undefined) {\n      routeMap.set(route, (routeData = { route, symbols: [] }));\n      strategy.prefetch.push(routeData);\n    }\n    return routeData;\n  }\n};\n"
  },
  {
    "path": "packages/insights/src/routes/api/v1/[publicApiKey]/layout.ts",
    "content": "import type { RequestEvent } from '@builder.io/qwik-city';\n\nexport const onRequest = ({ url, headers }: RequestEvent) => {\n  // add CORS headers\n  headers.set('Access-Control-Allow-Origin', url.origin);\n  headers.set('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');\n  headers.set('Access-Control-Allow-Headers', 'Content-Type');\n  headers.set('Cross-Origin-Resource-Policy', 'cross-origin');\n};\n"
  },
  {
    "path": "packages/insights/src/routes/api/v1/[publicApiKey]/post/error/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\nimport { getDB, errorTable } from '~/db';\nimport { InsightsError } from '@builder.io/qwik-labs';\n\nexport const onPost: RequestHandler = async ({ exit, json, request, params }) => {\n  // console.log('API: POST: symbol');\n  const publicApiKey = params.publicApiKey;\n  const payloadRaw = InsightsError.parse(await request.json());\n  const payload = {\n    ...payloadRaw,\n    timestamp: new Date(payloadRaw.timestamp),\n  };\n  exit();\n  json(200, { code: 200, message: 'OK' });\n  // TODO(misko): assert that manifest table has correct row.\n  await getDB()\n    .insert(errorTable)\n    .values({\n      publicApiKey,\n      ...payload,\n    })\n    .run();\n};\n"
  },
  {
    "path": "packages/insights/src/routes/api/v1/[publicApiKey]/post/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\nimport { InsightsPayload } from '@builder.io/qwik-labs';\nimport { getDB } from '~/db';\nimport { getAppInfo, updateEdge, updateRoutes } from '~/db/query';\nimport { dbGetManifestInfo } from '~/db/sql-manifest';\nimport { toBucket, toBucketTimeline } from '~/stats/vector';\n\nexport const onPost: RequestHandler = async ({ exit, json, request, params }) => {\n  const payloadJson = await request.json();\n  migrate1(payloadJson);\n  // publicApiKey is always part of the URL as route parameter.\n  if (!payloadJson.publicApiKey) {\n    payloadJson.publicApiKey = params.publicApiKey;\n  }\n  const payload = InsightsPayload.parse(payloadJson);\n  // console.log('API: POST: symbol', payload);\n  exit();\n  json(200, { code: 200, message: 'OK' });\n  const db = getDB();\n  let previousSymbol = payload.previousSymbol;\n  const { publicApiKey, manifestHash } = payload;\n  await dbGetManifestInfo(db, publicApiKey, manifestHash);\n  if (publicApiKey && publicApiKey.length > 4) {\n    await getAppInfo(db, publicApiKey, { autoCreate: true });\n    for (const event of payload.symbols) {\n      const symbolHash = cleanupSymbolName(event.symbol);\n      if (symbolHash) {\n        await updateEdge(db, {\n          publicApiKey,\n          manifestHash,\n          from: previousSymbol,\n          to: symbolHash,\n          interaction: event.interaction,\n          delayBucket: toBucket(event.delay),\n          latencyBucket: toBucket(event.latency),\n        });\n        await updateRoutes(db, {\n          publicApiKey,\n          manifestHash,\n          route: event.route,\n          symbol: symbolHash,\n          timelineBucket: toBucketTimeline(event.timeline),\n        });\n      }\n      previousSymbol = symbolHash;\n    }\n  }\n};\n\nfunction cleanupSymbolName(symbolName?: string | null): string | null {\n  if (!symbolName) {\n    return null;\n  }\n  const shortName = symbolName.substring(symbolName.lastIndexOf('_') + 1 || 0);\n  if (shortName == 'hW') {\n    return null;\n  }\n  return shortName;\n}\nfunction migrate1(payloadJson: any) {\n  // delete payloadJson.sessionID;\n  if (!('qVersion' in payloadJson)) {\n    payloadJson.qVersion = 'unknown';\n  }\n}\n"
  },
  {
    "path": "packages/insights/src/routes/api/v1/[publicApiKey]/post/manifest/index.tsx",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\nimport { and, eq } from 'drizzle-orm';\nimport { getDB, symbolDetailTable } from '~/db';\nimport { dbGetManifestInfo } from '~/db/sql-manifest';\nimport { QManifest } from '~/types/q-manifest';\n\nexport const onPost: RequestHandler = async ({ exit, json, request, params }) => {\n  // onsole.log('API: POST: symbol');\n  const publicApiKey = params.publicApiKey;\n  try {\n    const qManifest = QManifest.parse(await request.json());\n    const manifestHash = qManifest.manifestHash;\n    exit();\n    const db = getDB();\n    await dbGetManifestInfo(db, publicApiKey, manifestHash);\n    const existing = await db\n      .select()\n      .from(symbolDetailTable)\n      .where(\n        and(\n          eq(symbolDetailTable.publicApiKey, publicApiKey),\n          eq(symbolDetailTable.manifestHash, manifestHash)\n        )\n      )\n      .limit(1000)\n      .all();\n    const existingMap = new Map<string, (typeof existing)[0]>();\n    existing.forEach((row) => existingMap.set(row.hash, row));\n    const promises: Promise<any>[] = [];\n    for (const symbol of Object.values(qManifest.symbols)) {\n      const existing = existingMap.get(symbol.hash);\n      const lo = symbol.loc[0];\n      const hi = symbol.loc[1];\n      if (existing) {\n        if (\n          existing.fullName !== symbol.displayName ||\n          existing.origin !== symbol.origin ||\n          existing.lo !== lo ||\n          existing.hi !== hi\n        ) {\n          promises.push(\n            db\n              .update(symbolDetailTable)\n              .set({\n                fullName: symbol.displayName,\n                origin: symbol.origin,\n                lo,\n                hi,\n              })\n              .where(eq(symbolDetailTable.id, existing.id))\n              .run()\n          );\n        }\n      } else {\n        promises.push(\n          db\n            .insert(symbolDetailTable)\n            .values({\n              hash: symbol.hash,\n              publicApiKey,\n              manifestHash,\n              fullName: symbol.displayName,\n              origin: symbol.origin,\n              lo,\n              hi,\n            })\n            .run()\n        );\n      }\n      if (promises.length > 10) {\n        await Promise.all(promises);\n        promises.length = 0;\n      }\n    }\n    await Promise.all(promises);\n    json(200, { code: 200, message: 'OK' });\n  } catch (e) {\n    console.error(JSON.stringify(e));\n    json(500, { code: 500, message: 'Internal Server Error', error: e });\n  }\n};\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/app.form.tsx",
    "content": "import * as z from 'zod';\n\nexport const ApplicationForm = z.object({\n  name: z.string().min(1, 'Application name is required.'),\n  url: z.string().url('Application URL must be a valid URL.'),\n  description: z.string().min(1, 'Application description is required.'),\n});\n\nexport type ApplicationForm = z.infer<typeof ApplicationForm>;\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/edit/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from '@builder.io/qwik';\nimport { routeAction$, routeLoader$, useLocation, z, zod$, Form } from '@builder.io/qwik-city';\nimport { formAction$, useForm, zodForm$, type InitialValues } from '@modular-forms/qwik';\nimport { eq } from 'drizzle-orm';\nimport AppCard from '~/components/app-card';\nimport { DiskIcon } from '~/components/icons/disk';\nimport { applicationTable, getDB } from '~/db';\nimport {\n  dbAddUserToApplication,\n  dbGetUsersForApplication,\n  dbRemoveUserFromApplication,\n} from '~/db/sql-user';\nimport { appUrl } from '~/routes.config';\nimport { ApplicationForm } from '../app.form';\nimport { EditIcon } from '~/components/icons/edit';\n\nexport const useFormLoader = routeLoader$<InitialValues<ApplicationForm>>(async ({ params }) => {\n  const db = getDB();\n  const publicApiKey = params.publicApiKey;\n  const app = await db\n    .select()\n    .from(applicationTable)\n    .where(eq(applicationTable.publicApiKey, publicApiKey))\n    .limit(1)\n    .get();\n  return app as ApplicationForm;\n});\n\nexport const useUsers = routeLoader$<string[]>(async ({ params }) => {\n  const publicApiKey = params.publicApiKey;\n  const users = await dbGetUsersForApplication(publicApiKey);\n  return users;\n});\n\nexport const useFormAction = formAction$<ApplicationForm>(\n  async ({ name, description, url }, { redirect, params }) => {\n    const db = getDB();\n    db.update(applicationTable)\n      .set({\n        name,\n        url,\n        description,\n      })\n      .where(eq(applicationTable.publicApiKey, params.publicApiKey))\n      .run();\n    throw redirect(302, appUrl(`/app/[publicApiKey]/`, { publicApiKey: params.publicApiKey }));\n  },\n  zodForm$(ApplicationForm)\n);\n\nexport const useRemoveUserAction = routeAction$(\n  async ({ email }, { params }) => {\n    await dbRemoveUserFromApplication(email, params.publicApiKey);\n  },\n  zod$({\n    email: z.string().email(),\n  })\n);\n\nexport const useAddUserAction = routeAction$(\n  async ({ email }, { params }) => {\n    await dbAddUserToApplication(email, params.publicApiKey);\n  },\n  zod$({\n    email: z.string().email(),\n  })\n);\n\nexport default component$(() => {\n  // const form = useFormLoader();\n  const [loginForm, { Form: ModularForm, Field }] = useForm<ApplicationForm>({\n    loader: useFormLoader(),\n    action: useFormAction(),\n    validate: zodForm$(ApplicationForm),\n  });\n  const location = useLocation();\n  const users = useUsers();\n  const removeUserAction = useRemoveUserAction();\n  const addUserAction = useAddUserAction();\n  const addEmail = useSignal('');\n  useTask$(({ track }) => {\n    const isRunning = track(() => addUserAction.isRunning);\n    if (!isRunning) {\n      addEmail.value = '';\n    }\n  });\n\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <EditIcon />\n        Edit Application\n      </h1>\n      <ModularForm>\n        <div class=\"mb-10\">\n          <AppCard\n            mode=\"show\"\n            title={loginForm.internal.fields.name?.value}\n            publicApiKey={location.params.publicApiKey}\n          />\n        </div>\n        <div>\n          <label>Name</label>\n          <Field name=\"name\">\n            {(field, props) => (\n              <>\n                <input {...props} type=\"text\" value={field.value} />{' '}\n                {field.error && <div>{field.error}</div>}\n              </>\n            )}\n          </Field>\n        </div>\n        <div>\n          <label>Description</label>\n          <Field name=\"description\">\n            {(field, props) => (\n              <>\n                <input {...props} type=\"text\" value={field.value} />\n                {field.error && <div>{field.error}</div>}\n              </>\n            )}\n          </Field>\n        </div>\n        <div>\n          <label>URL</label>\n          <Field name=\"url\">\n            {(field, props) => (\n              <>\n                <input {...props} type=\"text\" value={field.value} />\n                {field.error && <div>{field.error}</div>}\n              </>\n            )}\n          </Field>\n        </div>\n        <div\n          style={{\n            'margin-top': 'calc(var(--form-element-margin-bottom) * 2)',\n          }}\n        >\n          <button type=\"submit\" class=\"button bg-white\">\n            <DiskIcon />\n            Save\n          </button>\n        </div>\n      </ModularForm>\n      <label>Allowed Users</label>\n      <ul>\n        {users.value.map((user) => (\n          <Form action={removeUserAction} key={user}>\n            <li>\n              {user}\n              <input type=\"hidden\" name=\"email\" value={user} />\n              <button type=\"submit\" class=\"button\">\n                ❌\n              </button>\n            </li>\n          </Form>\n        ))}\n      </ul>\n      <label>Add Users</label>\n      <Form action={addUserAction}>\n        <div>\n          <input type=\"text\" name=\"email\" bind:value={addEmail} />\n          <button type=\"submit\" class=\"button\">\n            ➕\n          </button>\n        </div>\n      </Form>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/errors/index.tsx",
    "content": "import { type ReadonlySignal, component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { getDB, errorTable, type ErrorRow } from '~/db';\nimport { eq, sql } from 'drizzle-orm';\nimport { ErrorIcon } from '~/components/icons/error';\nimport { type PopupEvent } from '~/components/popup-manager';\n\nexport const useErrors = routeLoader$(async ({ params }) => {\n  const db = getDB();\n  const errors: ErrorRow[] = await db\n    .select()\n    .from(errorTable)\n    .where(eq(errorTable.publicApiKey, params.publicApiKey))\n    .orderBy(sql`${errorTable.timestamp} DESC`)\n    .limit(1000)\n    .all();\n  return errors;\n});\n\nexport default component$(() => {\n  const errors: ReadonlySignal<ErrorRow[]> = useErrors();\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <ErrorIcon />\n        Errors\n      </h1>\n      <table class=\"w-full text-sm text-left\">\n        <thead class=\"text-xs text-slate-700 uppercase\">\n          <tr class=\"border-b border-slate-200\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Timestamp\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              URL\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Message\n            </th>\n          </tr>\n        </thead>\n        <tbody>\n          {errors.value.map((error) => (\n            <tr\n              key={error.id}\n              onPopup$={(e: PopupEvent) => e.detail.show(Popup, error)}\n              class=\"border-b border-slate-200 text-xs\"\n            >\n              <td scope=\"col\" class=\"px-6 py-3 bg-slate-50 whitespace-nowrap\">\n                {new Date(error.timestamp).toLocaleString()}\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 max-w-lg break-words\">\n                <a href={error.url} target=\"_blank\">\n                  {error.url}\n                </a>\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                {error.message}\n              </td>\n            </tr>\n          ))}\n        </tbody>\n      </table>\n    </div>\n  );\n});\n\nexport const Popup = component$<{\n  timestamp: Date;\n  url: string;\n  manifestHash: string | null;\n  message: string;\n  error: string;\n  stack: string;\n}>(({ timestamp, url, manifestHash, message, error, stack }) => {\n  return (\n    <div class=\"max-w-[75vw] min-w-[300px] overflow-scroll\">\n      <h2 class=\"h5 px-6 py-3\">Details</h2>\n      <table class=\"w-full text-sm text-left mb-6\">\n        <tbody>\n          <tr class=\"border-y border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Timestamp\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <code>{timestamp.toLocaleString()}</code>\n            </td>\n          </tr>\n          <tr class=\"border-b border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              URL\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <code>{url}</code>\n            </td>\n          </tr>\n          <tr class=\"border-b border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Manifest\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <code>{manifestHash}</code>\n            </td>\n          </tr>\n          <tr class=\"border-b border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Message\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <pre>{message}</pre>\n            </td>\n          </tr>\n          <tr class=\"border-b border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Error\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <pre>{error}</pre>\n            </td>\n          </tr>\n          <tr class=\"border-b border-slate-200 text-xs\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Stack\n            </th>\n            <td scope=\"col\" class=\"px-6 py-3\">\n              <pre>{stack}</pre>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/index.tsx",
    "content": "import { getAppInfo, getEdgeCount } from '~/db/query';\nimport { routeLoader$, useLocation } from '@builder.io/qwik-city';\n\nimport AppCard from '~/components/app-card';\nimport { DashboardIcon } from '~/components/icons/dashboard';\nimport { component$ } from '@builder.io/qwik';\nimport { getDB } from '~/db';\n\nexport const useAppData = routeLoader$(async ({ params }) => {\n  const db = getDB();\n  const publicApiKey = params.publicApiKey;\n  const [app, symbolCount] = await Promise.all([\n    getAppInfo(db, publicApiKey),\n    getEdgeCount(db, publicApiKey),\n  ]);\n  return { app, symbolCount };\n});\n\nexport default component$(() => {\n  const data = useAppData();\n  const location = useLocation();\n\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <DashboardIcon />\n        <span>Dashboard</span>\n      </h1>\n      <AppCard\n        mode=\"show\"\n        title={data.value.app.name}\n        publicApiKey={location.params.publicApiKey}\n      />\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/layout.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\nimport { Link, useLocation, type RequestHandler } from '@builder.io/qwik-city';\nimport { EdgeIcon } from '~/components/icons/edge';\nimport { EditIcon } from '~/components/icons/edit';\nimport { SymbolIcon } from '~/components/icons/symbol';\nimport Layout from '~/components/layout';\n\nimport { BundleIcon } from '~/components/icons/bundle';\nimport { DashboardIcon } from '~/components/icons/dashboard';\nimport { ErrorIcon } from '~/components/icons/error';\nimport { ManifestIcon } from '~/components/icons/manifest';\nimport { RoutesIcon } from '~/components/icons/routes';\nimport { SlowIcon } from '~/components/icons/slow';\nimport { getInsightUser } from '../layout';\n\nexport const onRequest: RequestHandler = async ({ sharedMap, redirect, params }) => {\n  const insightUser = getInsightUser(sharedMap);\n  if (!insightUser.isAuthorizedForApp(params.publicApiKey)) {\n    throw redirect(307, '/');\n  }\n};\n\nexport default component$(() => {\n  const location = useLocation();\n  const path = `/app/${location.params.publicApiKey}/`;\n\n  const NAVIGATION = [\n    { path, label: 'Dashboard', icon: <DashboardIcon />, addDividor: true },\n    { path: path + 'manifests/', label: 'Manifests', icon: <ManifestIcon /> },\n    { path: path + 'routes/', label: 'Routes', icon: <RoutesIcon /> },\n    { path: path + 'symbols/', label: 'Symbols', icon: <SymbolIcon /> },\n    { path: path + 'symbols/edge/', label: 'Edge', icon: <EdgeIcon /> },\n    { path: path + 'symbols/bundles/', label: 'Bundles', icon: <BundleIcon /> },\n    { path: path + 'symbols/slow/', label: 'Slow Symbols', icon: <SlowIcon /> },\n    {\n      path: path + 'errors/',\n      label: 'Errors',\n      icon: <ErrorIcon />,\n      addDividor: true,\n    },\n    { path: path + 'edit/', label: 'Edit', icon: <EditIcon /> },\n  ];\n\n  return (\n    <Layout>\n      <div class=\"grid min-h-[calc(100vh-76px)] grid-cols-[240px_1fr]\">\n        <aside>\n          <div class=\"flex h-full flex-col gap-8 overflow-y-auto bg-white p-8\">\n            {NAVIGATION.map(({ path, label, icon, addDividor = false }) => (\n              <>\n                <Link key={path} href={path} class=\"flex items-center gap-3\">\n                  {icon}\n                  <span>{label}</span>\n                </Link>\n                {addDividor && <div class=\"border-t border-t-slate-200\"></div>}\n              </>\n            ))}\n          </div>\n        </aside>\n        <div class=\"m-8 overflow-y-auto\">\n          <Slot />\n        </div>\n      </div>\n    </Layout>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/manifests/index.tsx",
    "content": "import { type ReadonlySignal, component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport Histogram, { latencyColors } from '~/components/histogram';\nimport { ManifestIcon } from '~/components/icons/manifest';\nimport { ManifestTile } from '~/components/minifest-tile';\nimport { getDB } from '~/db';\nimport { type ManifestStatsRow, dbGetManifestStats } from '~/db/sql-manifest';\nimport { vectorAvg, vectorSum, BUCKETS } from '~/stats/vector';\n\nexport const useData = routeLoader$(async ({ params }) => {\n  const publicApiKey = params.publicApiKey;\n  const db = getDB();\n  const data = await dbGetManifestStats(db, publicApiKey);\n  return data;\n});\n\nexport default component$(() => {\n  const data: ReadonlySignal<ManifestStatsRow[]> = useData();\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <ManifestIcon />\n        Manifests\n      </h1>\n      <table class=\"w-full text-sm text-left\">\n        <thead class=\"text-xs text-slate-700 uppercase\">\n          <tr class=\"border-b border-slate-200\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Manifest\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Timestamp\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Samples\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Avg. Latency\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Histogram\n            </th>\n          </tr>\n        </thead>\n        <tbody>\n          {data.value.map((row) => (\n            <tr key={row.hash} class=\"border-b border-slate-200 text-xs\">\n              <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                <ManifestTile hash={row.hash} />\n              </th>\n              <td scope=\"col\" class=\"px-6 py-3\">\n                {row.timestamp.toLocaleString()}\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                {vectorSum(row.latency)}\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3\">\n                {Math.round(vectorAvg(row.latency))}\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                <Histogram vector={row.latency} colors={latencyColors} buckets={BUCKETS} />\n              </td>\n            </tr>\n          ))}\n        </tbody>\n      </table>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/routes/[route]/index.tsx",
    "content": "import { component$, type ReadonlySignal } from '@builder.io/qwik';\nimport { routeLoader$, useLocation } from '@builder.io/qwik-city';\nimport Histogram from '~/components/histogram';\nimport { RoutesIcon } from '~/components/icons/routes';\nimport { SymbolTile } from '~/components/symbol-tile';\nimport { getDB } from '~/db';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport { getRouteTimeline, type RouteSymbolRow } from '~/db/sql-routes';\nimport { TIMELINE_BUCKETS, vectorAvg, vectorSum } from '~/stats/vector';\n\nexport const useRouteData = routeLoader$(async ({ params }) => {\n  const db = getDB();\n  const publicApiKey = params.publicApiKey;\n  const route = decodeURIComponent(params.route);\n  const manifestHashes = await dbGetManifestHashes(db, publicApiKey);\n  const routes = await getRouteTimeline(db, publicApiKey, route, manifestHashes);\n  return routeRowsToRouteTree(routes);\n});\n\nexport default component$(() => {\n  const symbolData: ReadonlySignal<SymbolData[]> = useRouteData();\n  const route = decodeURIComponent(useLocation().params.route);\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <RoutesIcon />\n        Route: <tt>{route}</tt>\n      </h1>\n      <table class=\"w-full text-sm text-left\">\n        <thead class=\"text-xs text-slate-700 uppercase\">\n          <tr class=\"border-b border-slate-200\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Symbol\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Count\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Delay\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Histogram\n            </th>\n          </tr>\n        </thead>\n        <tbody>\n          {symbolData.value.map((symbol) => (\n            <tr key={symbol.symbolName} class=\"border-b border-slate-200 text-xs\">\n              <th scope=\"col\" class=\"px-6 py-3 bg-slate-50 max-w-[250px] overflow-scroll\">\n                <SymbolTile symbol={symbol.symbolName} />\n              </th>\n              <td scope=\"col\" class=\"px-6 py-3\">\n                {symbol.timelineCount.toLocaleString()}\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                {Math.round(symbol.timelineDelay / 1000).toLocaleString()} seconds\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 \">\n                <Histogram vector={symbol.timeline} buckets={TIMELINE_BUCKETS} />\n              </td>\n            </tr>\n          ))}\n        </tbody>\n      </table>\n    </div>\n  );\n});\n\ninterface SymbolData {\n  symbolName: string;\n  timelineDelay: number;\n  timelineCount: number;\n  timeline: number[];\n}\n\nfunction routeRowsToRouteTree(routes: RouteSymbolRow[]): SymbolData[] {\n  return routes.map((route) => {\n    return {\n      symbolName: route.symbol,\n      timelineDelay: vectorAvg(route.timeline, TIMELINE_BUCKETS),\n      timelineCount: vectorSum(route.timeline),\n      timeline: route.timeline,\n    };\n  });\n}\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/routes/index.tsx",
    "content": "import { component$, type ReadonlySignal } from '@builder.io/qwik';\nimport { routeLoader$, useLocation } from '@builder.io/qwik-city';\nimport { RoutesIcon } from '~/components/icons/routes';\nimport { getDB } from '~/db';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport { getRouteNames, type RouteRow } from '~/db/sql-routes';\nimport { AppLink } from '~/routes.config';\n\nexport const useRouteData = routeLoader$(async ({ params }) => {\n  const db = getDB();\n  const publicApiKey = params.publicApiKey;\n  const manifestHashes = await dbGetManifestHashes(db, publicApiKey);\n  const routes = await getRouteNames(db, publicApiKey, manifestHashes);\n  return routes;\n});\n\nexport default component$(() => {\n  const location = useLocation();\n  const routesData: ReadonlySignal<RouteRow[]> = useRouteData();\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <RoutesIcon />\n        Routes\n      </h1>\n      <table class=\"w-full text-sm text-left\">\n        <thead class=\"text-xs text-slate-700 uppercase\">\n          <tr class=\"border-b border-slate-200\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Path\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3  bg-slate-50\">\n              Action\n            </th>\n          </tr>\n        </thead>\n        <tbody>\n          {routesData.value.map((route) => (\n            <tr key={route.route} class=\"border-b border-slate-200 text-xs\">\n              <th scope=\"col\" class=\"px-6 py-3\">\n                <code>{route.route}</code>\n              </th>\n              <td scope=\"col\" class=\"px-6 py-3 w-32\">\n                <AppLink\n                  route=\"/app/[publicApiKey]/routes/[route]/\"\n                  param:publicApiKey={location.params.publicApiKey}\n                  param:route={route.route}\n                >\n                  View details\n                </AppLink>\n              </td>\n            </tr>\n          ))}\n        </tbody>\n      </table>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/symbols/bundles/index.tsx",
    "content": "import { component$, useStore, type ReadonlySignal, type JSXOutput } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { BundleCmp } from '~/components/bundle';\nimport { BundleIcon } from '~/components/icons/bundle';\nimport { SymbolTile } from '~/components/symbol-tile';\nimport { getDB } from '~/db';\nimport { getEdges, getSymbolDetails } from '~/db/query';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport {\n  computeBundles,\n  computeSymbolGraph,\n  computeSymbolVectors,\n  type SymbolVectors,\n  type Symbol,\n  type Bundle,\n} from '~/stats/edges';\nimport { vectorSum } from '~/stats/vector';\n\ninterface BundleInfo {\n  vectors: SymbolVectors;\n  bundles: Bundle[];\n}\n\nexport const useData = routeLoader$<BundleInfo>(async ({ params, url }) => {\n  const db = getDB();\n  const limit = url.searchParams.get('limit')\n    ? parseInt(url.searchParams.get('limit')!)\n    : undefined;\n\n  const manifestHashes = await dbGetManifestHashes(db, params.publicApiKey);\n  const [edges, details] = await Promise.all([\n    getEdges(db, params.publicApiKey, { limit, manifestHashes }),\n    getSymbolDetails(db, params.publicApiKey, { manifestHashes }),\n  ]);\n  const rootSymbol = computeSymbolGraph(edges, details);\n  const vectors = computeSymbolVectors(rootSymbol);\n  const bundles = computeBundles(vectors);\n  return { vectors, bundles };\n});\n\nexport default component$(() => {\n  const data: ReadonlySignal<BundleInfo> = useData();\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <BundleIcon />\n        Correlation Matrix\n      </h1>\n      <CorrelationMatrix matrix={data.value.vectors.vectors} symbols={data.value.vectors.symbols} />\n\n      <h2 class=\"h3\">\n        <BundleIcon />\n        Bundles\n      </h2>\n      <ol class=\"list-decimal list-inside\">\n        {data.value.bundles.map((bundle) => (\n          <li key={bundle.name}>\n            <div class=\"bg-white inline-block py-1 px-4 text-xs text-center rounded-full whitespace-nowrap\">\n              <BundleCmp name={bundle.name} />\n            </div>\n            <ul class=\"mb-10\">\n              {bundle.symbols.map((symbol) => (\n                <li\n                  key={symbol.name}\n                  class=\"relative pt-2 pl-16 whitespace-nowrap text-xs before:absolute before:top-[1px] before:left-8 before:border-l before:border-l-slate-400 before:border-dashed before:h-full before:w-[1px] last:before:h-[16px] after:absolute after:top-4 after:left-8 after:border-t after:border-t-slate-400 after:border-dashed after:h-[1px] after:w-6\"\n                >\n                  <span class=\"font-bold\">\n                    <SymbolTile symbol={symbol.name} />\n                  </span>\n                  <span class=\"text-purple-500 mx-2\">|</span>\n                  <code>{symbol.fullName}</code>\n                  <span class=\"text-purple-500 mx-2\">|</span>\n                  <code>{symbol.fileSrc}</code>\n                </li>\n              ))}\n            </ul>\n          </li>\n        ))}\n      </ol>\n      <hr />\n    </div>\n  );\n});\n\nexport const CorrelationMatrix = component$<{\n  matrix: number[][];\n  symbols: Symbol[];\n}>(({ matrix, symbols }) => {\n  const callout = useStore({\n    visible: false,\n    value: 0,\n    rowSymbol: '',\n    colSymbol: '',\n    x: 0,\n    y: 0,\n  });\n  return (\n    <>\n      <div\n        class=\"border border-slate-200 h-[calc(70vmin-20px)] w-[calc(70vmin-20px)] flex flex-col justify-evenly mb-14\"\n        onMouseEnter$={() => (callout.visible = true)}\n        onMouseLeave$={() => (callout.visible = false)}\n        onMouseMove$={(e) => {\n          callout.x = e.clientX;\n          callout.y = e.clientY;\n          const col = e.target as HTMLElement;\n          const row = col.parentNode as HTMLElement;\n          callout.value = parseFloat(col.dataset.value!);\n          callout.colSymbol = col.dataset.colSymbol!;\n          callout.rowSymbol = row.dataset.rowSymbol!;\n        }}\n      >\n        <MatrixCells matrix={matrix} symbols={symbols} />\n      </div>\n      <div\n        style={{\n          display: callout.visible && !isNaN(callout.value) ? 'inline-block' : 'none',\n          top: callout.y + 5 + 'px',\n          left: callout.x + 5 + 'px',\n        }}\n        class=\"fixed bg-white border border-slate-200 text-xs\"\n      >\n        <table class=\"w-full text-sm text-left\">\n          <tbody>\n            <tr class=\"border-y border-slate-200 text-xs\">\n              <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                Score\n              </th>\n              <td scope=\"col\" class=\"px-6 py-3\">\n                <code\n                  class={[\n                    'rounded-xs px-8 py-1 inline-block',\n                    { 'bg-lime-500': Math.round(callout.value * 100) >= 70 },\n                    {\n                      'bg-lime-300':\n                        Math.round(callout.value * 100) >= 50 &&\n                        Math.round(callout.value * 100) < 70,\n                    },\n                    {\n                      'bg-yellow-500':\n                        Math.round(callout.value * 100) >= 30 &&\n                        Math.round(callout.value * 100) < 50,\n                    },\n                    { 'bg-slate-200': Math.round(callout.value * 100) < 30 },\n                  ]}\n                >\n                  {Math.round(callout.value * 100)}%\n                </code>\n              </td>\n            </tr>\n            <tr class=\"border-b border-slate-200 text-xs\">\n              <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                Row\n              </th>\n              <td scope=\"col\" class=\"px-6 py-3\">\n                <code>{callout.rowSymbol}</code>\n              </td>\n            </tr>\n            <tr class=\"border-b border-slate-200 text-xs\">\n              <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                Column\n              </th>\n              <td scope=\"col\" class=\"px-6 py-3\">\n                <code>{callout.colSymbol}</code>\n              </td>\n            </tr>\n          </tbody>\n        </table>\n      </div>\n    </>\n  );\n});\n\nexport const MatrixCells = component$<{\n  matrix: number[][];\n  symbols: Symbol[];\n}>(({ matrix, symbols }) => {\n  const size = matrix.length;\n  return (\n    <>\n      {matrix.map((row, rowIdx) => (\n        <div\n          class=\"flex\"\n          style={{ height: 100 / size + '%' }}\n          key={rowIdx}\n          data-row-symbol={symbols[rowIdx].name}\n        >\n          {cells(row, symbols)}\n        </div>\n      ))}\n    </>\n  );\n});\n\nfunction cells(row: number[], symbols: Symbol[]) {\n  const size = row.length;\n  const cells: JSXOutput[] = [];\n  const total = vectorSum(row);\n  let sparseSize = 0;\n  for (let colIdx = 0; colIdx < row.length; colIdx++) {\n    const value = row[colIdx];\n    if (value / total > 0.05) {\n      if (sparseSize) {\n        cells.push(\n          <div class=\"h-full inline-block\" style={{ width: (sparseSize * 100) / size + '%' }} />\n        );\n        sparseSize = 0;\n      }\n      cells.push(\n        <div\n          key={colIdx}\n          style={{\n            width: 100 / size + '%',\n            backgroundColor: toRGB(value),\n          }}\n          data-col-symbol={symbols[colIdx].name}\n          data-value={value}\n        ></div>\n      );\n    } else {\n      sparseSize++;\n    }\n  }\n  return cells;\n}\n\nfunction toRGB(value: number): string {\n  const color = Math.round((1 - value) * 255);\n  return `rgb(${color},${color},${color})`;\n}\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/symbols/edge/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { getDB } from '~/db';\nimport { computeSymbolGraph, type Symbol } from '~/stats/edges';\nimport { getSymbolDetails, getEdges } from '~/db/query';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport { SymbolIcon } from '~/components/icons/symbol';\n\nexport const useRootSymbol = routeLoader$(async ({ params, url }) => {\n  const db = getDB();\n  const limit = url.searchParams.get('limit')\n    ? parseInt(url.searchParams.get('limit')!)\n    : undefined;\n  const manifestHashes = await dbGetManifestHashes(db, params.publicApiKey);\n  const [symbols, details] = await Promise.all([\n    getEdges(db, params.publicApiKey, { limit, manifestHashes }),\n    getSymbolDetails(db, params.publicApiKey, { manifestHashes }),\n  ]);\n  return computeSymbolGraph(symbols, details);\n});\n\nexport default component$(() => {\n  const rootSymbol = useRootSymbol();\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <SymbolIcon />\n        Symbols\n      </h1>\n      <SymbolTree symbol={rootSymbol.value[0]} depth={0} />\n    </div>\n  );\n});\n\nfunction SymbolTree({ symbol, depth, count }: { symbol: Symbol; depth: number; count?: number }) {\n  const nextDepth = depth + 1;\n  symbol.children.sort(\n    (a, b) => (b.to.depth === nextDepth ? b.count : 0) - (a.to.depth === nextDepth ? a.count : 0)\n  );\n  const terminal = symbol.depth !== depth;\n  return (\n    <>\n      {depth === 0 && (\n        <div>\n          <span class=\"bg-purple-500 text-white px-4 py-1 text-xs rounded-full whitespace-nowrap\">\n            App\n          </span>\n        </div>\n      )}\n\n      {symbol.count > 0 && (\n        <div class=\"whitespace-nowrap\">\n          <span class=\"bg-white inline-block py-1 min-w-[120px] text-xs text-center rounded-full whitespace-nowrap\">\n            {count} / {symbol.count}\n          </span>\n          <code class=\"text-xs ml-3 whitespace-nowrap\">\n            <span class=\"font-bold\">{(symbol.name as string | undefined) ?? 'n/A'}</span>\n            <span class=\"text-purple-500 mx-2\">|</span>\n            {symbol.fullName ?? 'n/A'}\n            <span class=\"text-purple-500 mx-2\">|</span>\n            {symbol.fileSrc || 'n/A'}\n            <span class=\"text-purple-500 mx-2\">|</span>\n            Depth:{' '}\n            <span class=\"bg-slate-200 inline-block py-[2px] px-2 text-xs text-center rounded-full\">\n              {symbol.depth}\n            </span>\n          </code>\n        </div>\n      )}\n      {!terminal && (\n        <ul>\n          {symbol.children.map((edge) => (\n            <li\n              key={edge.to.name}\n              class=\"relative pt-2 pl-14 before:absolute before:top-[1px] before:left-6 before:border-l before:border-l-slate-400 before:border-dashed before:h-full before:w-[1px] last:before:h-[19px] after:absolute after:top-5 after:left-6 after:border-t after:border-t-slate-400 after:border-dashed after:h-[1px] after:w-6\"\n            >\n              <SymbolTree symbol={edge.to} depth={nextDepth} count={edge.count} />\n            </li>\n          ))}\n        </ul>\n      )}\n    </>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/symbols/index.tsx",
    "content": "import { type ReadonlySignal, component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport Histogram, { delayColors, latencyColors } from '~/components/histogram';\nimport { ManifestIcon } from '~/components/icons/manifest';\nimport { SymbolIcon } from '~/components/icons/symbol';\nimport { SymbolTile } from '~/components/symbol-tile';\nimport { getDB } from '~/db';\nimport { getEdges, getSymbolDetails } from '~/db/query';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport { BUCKETS, vectorAdd, vectorNew } from '~/stats/vector';\n\ninterface Symbol {\n  hash: string;\n  fullName: string;\n  origin: string;\n  manifests: Record<string, Manifest>;\n  delay: number[];\n  latency: number[];\n}\n\ninterface Manifest {\n  hash: string;\n  delay: number[];\n  latency: number[];\n}\n\ninterface SymbolsInfo {\n  symbols: Symbol[];\n  manifests: Manifest[];\n  buckets: typeof BUCKETS;\n}\n\nexport const useData = routeLoader$<SymbolsInfo>(async ({ params, url }) => {\n  const db = getDB();\n  const limit = url.searchParams.get('limit')\n    ? parseInt(url.searchParams.get('limit')!)\n    : undefined;\n  const manifestHashes = await dbGetManifestHashes(db, params.publicApiKey);\n  const [edges, details] = await Promise.all([\n    getEdges(db, params.publicApiKey, { limit, manifestHashes }),\n    getSymbolDetails(db, params.publicApiKey, { manifestHashes }),\n  ]);\n\n  const symbolMap = new Map<string, Symbol>();\n  const manifests = new Map<string, Manifest>();\n  edges.forEach((edge) => {\n    const manifest = getManifest('<UNKNOWN>');\n    const symbol = getSymbol(edge.to);\n    const symbolManifest = getSymbolManifest(symbol, '<UNKNOWN>');\n    vectorAdd(manifest.delay, edge.delay);\n    vectorAdd(manifest.latency, edge.latency);\n    vectorAdd(symbolManifest.delay, edge.delay);\n    vectorAdd(symbolManifest.latency, edge.latency);\n    vectorAdd(symbol.delay, edge.delay);\n    vectorAdd(symbol.latency, edge.latency);\n  });\n  details.forEach((detail) => {\n    const symbol = symbolMap.get(detail.hash);\n    if (symbol) {\n      symbol.fullName = detail.fullName;\n      symbol.origin = detail.origin;\n    }\n  });\n  return {\n    symbols: Array.from(symbolMap.values()),\n    manifests: Array.from(manifests.values()),\n    buckets: BUCKETS,\n  };\n  ////////////////////////////////////////////////////////\n  function getSymbol(name: string) {\n    let symbol = symbolMap.get(name);\n    if (!symbol) {\n      symbol = {\n        hash: name,\n        fullName: '',\n        origin: '',\n        manifests: {} as Symbol['manifests'],\n        delay: vectorNew(),\n        latency: vectorNew(),\n      };\n      symbolMap.set(name, symbol);\n    }\n    return symbol;\n  }\n\n  function getSymbolManifest(symbol: Symbol, manifestHash: string) {\n    let manifest = symbol.manifests[manifestHash] as undefined | Manifest;\n    if (!manifest) {\n      manifest = {\n        hash: manifestHash,\n        delay: vectorNew(),\n        latency: vectorNew(),\n      };\n      symbol.manifests[manifestHash] = manifest;\n    }\n    return manifest;\n  }\n\n  function getManifest(manifestHash: string) {\n    let manifest = manifests.get(manifestHash);\n    if (!manifest) {\n      manifest = {\n        hash: manifestHash,\n        delay: vectorNew(),\n        latency: vectorNew(),\n      };\n      manifests.set(manifestHash, manifest);\n    }\n    return manifest;\n  }\n});\n\nexport default component$(() => {\n  const data: ReadonlySignal<SymbolsInfo> = useData();\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <SymbolIcon />\n        Manifests\n      </h1>\n      <table class=\"w-full text-sm text-left\">\n        <thead class=\"text-xs text-slate-700 uppercase\">\n          <tr class=\"border-b border-slate-200\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Delay\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Latency\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Manifest\n            </th>\n          </tr>\n        </thead>\n        <tbody>\n          {data.value.manifests.map((manifest, idx) => {\n            return (\n              <tr key={idx} class=\"border-b border-slate-200 text-xs\">\n                <td scope=\"col\" class=\"px-6 py-3 bg-slate-50 w-96\">\n                  <Histogram\n                    vector={manifest.delay}\n                    colors={delayColors}\n                    buckets={data.value.buckets}\n                  />\n                </td>\n                <td scope=\"col\" class=\"px-6 py-3 w-96\">\n                  <Histogram\n                    vector={manifest.latency}\n                    colors={latencyColors}\n                    buckets={data.value.buckets}\n                  />\n                </td>\n                <td scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                  <code>\n                    <ManifestIcon />\n                    {manifest.hash}\n                  </code>\n                </td>\n              </tr>\n            );\n          })}\n        </tbody>\n      </table>\n\n      <h1 class=\"h3 mt-10\">\n        <SymbolIcon />\n        Symbols\n      </h1>\n      <table class=\"w-full text-sm text-left\">\n        <thead class=\"text-xs text-slate-700 uppercase\">\n          <tr class=\"border-b border-slate-200\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Delay\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Latency\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Symbol\n            </th>\n          </tr>\n        </thead>\n        <tbody>\n          {data.value.symbols.map((symbol) => (\n            <tr key={symbol.hash} class=\"border-b border-slate-200 text-xs\">\n              <td scope=\"col\" class=\"px-6 py-3 bg-slate-50 w-96\">\n                <Histogram\n                  vector={symbol.delay}\n                  buckets={data.value.buckets}\n                  colors={delayColors}\n                />\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 w-96\">\n                <Histogram\n                  vector={symbol.latency}\n                  colors={latencyColors}\n                  buckets={data.value.buckets}\n                />\n              </td>\n              <td scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n                <SymbolTile symbol={symbol.hash} />\n                <span class=\"block text-slate-500\">\n                  {symbol.origin}\n                  {symbol.fullName}\n                </span>\n              </td>\n            </tr>\n          ))}\n        </tbody>\n      </table>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/symbols/outgoing/index.tsx",
    "content": "import { type ReadonlySignal, component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { getDB } from '~/db';\nimport { type OutgoingEdge, dbGetOutgoingEdges } from '~/db/sql-edges';\nimport { BUCKETS, vectorSum } from '~/stats/vector';\nimport Histogram, { delayColors, latencyColors } from '~/components/histogram';\nimport { SymbolTile } from '~/components/symbol-tile';\nimport { ManifestIcon } from '~/components/icons/manifest';\n\ninterface OutgoingInfo {\n  symbol: string;\n  edges: OutgoingEdge[];\n  total: number;\n  manifestHashes: string[];\n  buckets: typeof BUCKETS;\n  publicApiKey: string;\n}\n\nexport const useData = routeLoader$<OutgoingInfo>(async ({ params, query }) => {\n  const db = getDB();\n  const symbol = query.get('symbol') || '';\n  const publicApiKey = params.publicApiKey;\n  const manifestHashes: string[] = [];\n  const edges = await dbGetOutgoingEdges(db, publicApiKey, symbol, manifestHashes);\n  const total = edges.reduce((total, edge) => total + vectorSum(edge.delay), 0);\n  return {\n    symbol,\n    edges,\n    total,\n    manifestHashes,\n    buckets: BUCKETS,\n    publicApiKey,\n  };\n});\n\nexport default component$(() => {\n  const data: ReadonlySignal<OutgoingInfo> = useData();\n  return (\n    <div>\n      <h1>\n        Outgoing Symbols: <SymbolTile symbol={data.value.symbol} />\n        <table>\n          <tbody>\n            <tr>\n              <th>Manifest</th>\n              <th>To Symbol</th>\n              <th>Count</th>\n              <th>Delay</th>\n              <th>Latency</th>\n            </tr>\n            {data.value.edges.map((edge) => (\n              <tr key={edge.to}>\n                <td>\n                  <ManifestIcon />\n                  {edge.manifestHash}\n                </td>\n                <td>\n                  <a href={`/app/${data.value.publicApiKey}/symbols/outgoing/?symbol=${edge.to}`}>\n                    <SymbolTile symbol={edge.to} />\n                  </a>\n                </td>\n                <td>\n                  {vectorSum(edge.delay)} / {data.value.total}\n                </td>\n                <td>\n                  <Histogram\n                    vector={edge.delay}\n                    colors={delayColors}\n                    buckets={data.value.buckets}\n                  />\n                </td>\n                <td>\n                  <Histogram\n                    vector={edge.latency}\n                    colors={latencyColors}\n                    buckets={data.value.buckets}\n                  />\n                </td>\n              </tr>\n            ))}\n          </tbody>\n        </table>\n      </h1>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/[publicApiKey]/symbols/slow/index.tsx",
    "content": "import { type ReadonlySignal, component$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport Histogram, { latencyColors } from '~/components/histogram';\nimport { SlowIcon } from '~/components/icons/slow';\nimport { SymbolTile } from '~/components/symbol-tile';\nimport { type ApplicationRow, getDB } from '~/db';\nimport {\n  getSlowEdges,\n  getSymbolDetails,\n  getAppInfo,\n  type SlowEdge,\n  type SymbolDetailForApp,\n} from '~/db/query';\nimport { dbGetManifestHashes } from '~/db/sql-manifest';\nimport { BUCKETS, vectorAvg, vectorSum } from '~/stats/vector';\n\ninterface SlowSymbol {\n  app: ApplicationRow;\n  edges: SlowEdge[];\n  detailsMap: Record<string, SymbolDetailForApp | undefined>;\n}\n\nexport const useData = routeLoader$<SlowSymbol>(async ({ params, query }) => {\n  const manifest = query.get('manifest');\n  const manifests = manifest ? manifest.split(',') : [];\n  const db = getDB();\n  const manifestHashes = await dbGetManifestHashes(db, params.publicApiKey);\n  const [app, edges, details] = await Promise.all([\n    getAppInfo(db, params.publicApiKey),\n    getSlowEdges(db, params.publicApiKey, manifests),\n    getSymbolDetails(db, params.publicApiKey, { manifestHashes }),\n  ]);\n  const detailsMap: Record<string, SymbolDetailForApp | undefined> = {};\n  details.forEach((detail) => {\n    detailsMap[detail.hash] = detail;\n  });\n  return { app, edges, detailsMap };\n});\n\nexport default component$(() => {\n  const data: ReadonlySignal<SlowSymbol> = useData();\n  return (\n    <div>\n      <h1 class=\"h3\">\n        <SlowIcon />\n        Slow Symbols\n      </h1>\n      <table>\n        <thead class=\"text-xs text-slate-700 uppercase\">\n          <tr class=\"border-b border-slate-200\">\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Manifest\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Symbol\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Count\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3\">\n              Latency\n            </th>\n            <th scope=\"col\" class=\"px-6 py-3 bg-slate-50\">\n              Histogram\n            </th>\n          </tr>\n        </thead>\n        <tbody>\n          {data.value.edges.map((edge) => {\n            const detail = data.value.detailsMap[edge.to];\n            return (\n              <tr key={edge.to} class=\"border-b border-slate-200 text-xs\">\n                <td class=\"px-6 py-3 bg-slate-50 font-bold\">{edge.manifestHash}</td>\n                <td class=\"px-6 py-3\">\n                  <span class=\"font-bold\">\n                    <SymbolTile symbol={edge.to} />\n                  </span>\n                  <span class=\"block text-slate-500\">{detail?.fullName}</span>\n                </td>\n                <td class=\"px-6 py-3 bg-slate-50\">{vectorSum(edge.latency)}</td>\n                <td class=\"px-6 py-2\">{Math.round(vectorAvg(edge.latency))}ms</td>\n                <td class=\"px-6 py-3 bg-slate-50\">\n                  <Histogram vector={edge.latency} colors={latencyColors} buckets={BUCKETS} />\n                </td>\n              </tr>\n            );\n          })}\n        </tbody>\n      </table>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/add/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\nimport { formAction$, useForm, zodForm$ } from '@modular-forms/qwik';\nimport Container from '~/components/container';\nimport { DiskIcon } from '~/components/icons/disk';\nimport Layout from '~/components/layout';\nimport { applicationTable, getDB, userApplicationMap } from '~/db';\nimport { appUrl } from '~/routes.config';\nimport { ApplicationForm } from '../[publicApiKey]/app.form';\nimport styles from './styles.module.css';\nimport { getInsightUser } from '~/routes/app/layout';\n\nexport const useFormAction = formAction$<ApplicationForm>(\n  async ({ name, description, url }, { redirect, sharedMap }) => {\n    const db = getDB();\n    const publicApiKey = Math.round(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);\n\n    const insightUser = getInsightUser(sharedMap);\n\n    const insert = await db\n      .insert(applicationTable)\n      .values({\n        name,\n        description,\n        publicApiKey,\n        url,\n      })\n      .run();\n\n    const applicationId = insert.lastInsertRowid;\n\n    await db\n      .insert(userApplicationMap)\n      .values({\n        userId: insightUser.userId,\n        applicationId: parseInt(`${applicationId}`),\n      })\n      .run();\n\n    redirect(302, appUrl(`/app/[publicApiKey]/`, { publicApiKey }));\n  },\n  zodForm$(ApplicationForm)\n);\n\nexport default component$(() => {\n  const [, { Form, Field }] = useForm<ApplicationForm>({\n    loader: useSignal({ name: '', description: '', url: '' }),\n    action: useFormAction(),\n    validate: zodForm$(ApplicationForm),\n  });\n  return (\n    <Layout mode=\"bright\">\n      <Container position=\"center\" width=\"small\"></Container>\n      <div class={[styles['add-app-wrapper'], 'p-6']}>\n        <h1 class=\"h3\">Create Application</h1>\n        <Form>\n          <div>\n            <label>Name</label>\n            <Field name=\"name\">\n              {(field, props) => (\n                <>\n                  <input\n                    {...props}\n                    type=\"text\"\n                    value={field.value}\n                    class=\"border-2 border-gray-300\"\n                  />\n                  {field.error && <p class=\"text-red-800\">{field.error}</p>}\n                </>\n              )}\n            </Field>\n          </div>\n          <div>\n            <label>URL</label>\n            <Field name=\"url\">\n              {(field, props) => (\n                <>\n                  <input\n                    {...props}\n                    type=\"url\"\n                    value={field.value}\n                    class=\"border-2 border-gray-300\"\n                  />\n                  {field.error && <p class=\"text-red-800\">{field.error}</p>}\n                </>\n              )}\n            </Field>\n          </div>\n          <div>\n            <label>Description</label>\n            <Field name=\"description\">\n              {(field, props) => (\n                <>\n                  <input\n                    {...props}\n                    type=\"text\"\n                    value={field.value}\n                    class=\"border-2 border-gray-300\"\n                  />\n                  {field.error && <p class=\"text-red-800\">{field.error}</p>}\n                </>\n              )}\n            </Field>\n          </div>\n          <div\n            style={{\n              'margin-top': 'calc(var(--form-element-margin-bottom) * 2)',\n            }}\n          >\n            <button type=\"submit\" class=\"button\">\n              <DiskIcon />\n              Create\n            </button>\n          </div>\n        </Form>\n      </div>\n    </Layout>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/add/styles.module.css",
    "content": ".add-app-wrapper {\n  margin: calc(var(--size-4) * 2);\n}\n"
  },
  {
    "path": "packages/insights/src/routes/app/index.tsx",
    "content": "import { component$, useSignal, type ReadonlySignal, useComputed$ } from '@builder.io/qwik';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport { inArray } from 'drizzle-orm';\nimport AppCard from '~/components/app-card';\nimport Container from '~/components/container';\nimport Layout from '~/components/layout';\nimport { applicationTable, getDB, type ApplicationRow } from '~/db';\nimport { getInsightUser } from './layout';\n\nexport const useApps = routeLoader$<ApplicationRow[]>(async ({ sharedMap }) => {\n  const insightUser = getInsightUser(sharedMap);\n  let query = getDB().select().from(applicationTable).orderBy(applicationTable.name);\n\n  if (insightUser.superUser) {\n    // Select everything\n  } else if (insightUser.applicationPublicApiKeys.length) {\n    query = query.where(\n      inArray(applicationTable.publicApiKey, insightUser.applicationPublicApiKeys)\n    ) as typeof query;\n  } else {\n    // The user has nothing attached to it.\n    return [];\n  }\n  return query.limit(1000).all();\n});\n\nexport default component$(() => {\n  const apps: ReadonlySignal<ApplicationRow[]> = useApps();\n  const filter = useSignal('');\n  const filteredApps = useComputed$(() => {\n    return apps.value.filter(\n      (app) =>\n        app.name.toLowerCase().includes(filter.value) ||\n        app.publicApiKey.toLowerCase().includes(filter.value) ||\n        app.description?.toLowerCase().includes(filter.value) ||\n        app.url?.toLowerCase().includes(filter.value)\n    );\n  });\n  return (\n    <Layout>\n      <Container position=\"center\" width=\"medium\">\n        <div class=\"pt-5\">\n          Filter:\n          <input\n            type=\"text\"\n            class=\"border border-gray-300 rounded-md px-4 py-2 w-1/2 ml-5\"\n            onInput$={(_e, target) => (filter.value = target.value.toLocaleLowerCase())}\n          />\n        </div>\n        <div class=\"grid grid-cols-2 gap-6 py-10\">\n          {/* existing apps */}\n          {filteredApps.value.map((app) => (\n            <div class=\"flex-1\" key={app.id}>\n              <AppCard mode=\"show\" title={app.name} publicApiKey={app.publicApiKey} />\n            </div>\n          ))}\n\n          {/* create new app */}\n          <div class=\"\">\n            <AppCard mode=\"create\" title=\"Add new App\" />\n          </div>\n        </div>\n      </Container>\n    </Layout>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/app/layout.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\nimport { type RequestHandler } from '@builder.io/qwik-city';\nimport { dbGetInsightUser, type InsightsUser } from '~/db/sql-user';\nimport type { SessionData } from '../layout';\n\nexport const onRequest: RequestHandler = async ({ sharedMap, redirect }) => {\n  const session = sharedMap.get('session') as SessionData;\n  const email = session?.user?.email || null;\n  if (!email) {\n    throw redirect(307, '/');\n  }\n  const userInsight = await dbGetInsightUser(email);\n  setInsightUser(sharedMap, userInsight);\n};\n\nconst INSIGHT_USER = 'insightUser';\nfunction setInsightUser(sharedMap: Map<string, any>, insightUser: InsightsUser) {\n  sharedMap.set(INSIGHT_USER, insightUser);\n  return insightUser;\n}\n\nexport function getInsightUser(sharedMap: Map<string, any>) {\n  return sharedMap.get(INSIGHT_USER) as InsightsUser;\n}\n\nexport default component$(() => {\n  return <Slot />;\n});\n"
  },
  {
    "path": "packages/insights/src/routes/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport Button from '~/components/button';\nimport Container from '~/components/container';\nimport GithubIcon from '~/components/icons/github';\nimport Layout from '~/components/layout';\nimport { useSignIn } from './plugin@auth';\n\nexport default component$(() => {\n  const signInSig = useSignIn();\n\n  return (\n    <Layout>\n      <Container position=\"center\" width=\"small\">\n        <div class=\"felx-nowrap flex min-h-[calc(100vh-76px)] flex-col items-center justify-center\">\n          <div class=\"rounded-lg bg-white p-10 text-center shadow-sm\">\n            <h1 class=\"h1 mb-20\">Welcome</h1>\n            <Button\n              theme=\"github\"\n              onClick$={async () => {\n                signInSig.submit({ providerId: 'github' });\n              }}\n            >\n              <GithubIcon />\n              Continue with GitHub\n            </Button>\n          </div>\n        </div>\n      </Container>\n    </Layout>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/layout.tsx",
    "content": "import { Slot, component$ } from '@builder.io/qwik';\n\nimport { PopupManager } from '~/components/popup-manager';\nimport { routeLoader$ } from '@builder.io/qwik-city';\nimport type { GetSessionResult } from '@auth/qwik';\n\nexport type SessionData = Awaited<GetSessionResult>['data'];\n\nexport const useUserSession = routeLoader$(({ sharedMap, redirect, url }) => {\n  const session = sharedMap.get('session') as SessionData;\n  if (session && url.pathname === '/') {\n    // if authorized user try to access login page then redirect to app page\n    throw redirect(307, '/app/');\n  }\n  return session;\n});\n\nexport default component$(() => {\n  return (\n    <PopupManager>\n      <Slot />\n    </PopupManager>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/plugin@auth.ts",
    "content": "import { QwikAuth$ } from '@auth/qwik';\nimport GitHub from '@auth/qwik/providers/github';\n\nexport const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(({ env }) => ({\n  secret: env.get('PRIVATE_AUTH_SECRET'),\n  trustHost: true,\n  basePath: env.get('PRIVATE_AUTH_BASE_API'),\n  providers: [\n    GitHub({\n      clientId: env.get('PRIVATE_GITHUB_ID')!,\n      clientSecret: env.get('PRIVATE_GITHUB_SECRET')!,\n    }),\n  ],\n}));\n"
  },
  {
    "path": "packages/insights/src/routes/plugin@db.ts",
    "content": "import { type RequestHandler } from '@builder.io/qwik-city';\nimport { createClient } from '@libsql/client/web';\nimport { drizzle } from 'drizzle-orm/libsql';\nimport { type Client } from '@libsql/client';\nimport { type AppDatabase, initializeDbIfNeeded } from '~/db';\n\nexport const onRequest: RequestHandler = async ({ env }) => {\n  const url = env.get('PRIVATE_LIBSQL_DB_URL')!;\n  const authToken = env.get('PRIVATE_LIBSQL_DB_API_TOKEN')!;\n  await initializeDbIfNeeded(initLibSql(url, authToken));\n};\n\nconst LOG_QUERY: boolean = false;\n\nfunction initLibSql(url: string, authToken: string): () => Promise<AppDatabase> {\n  return async () => {\n    const client: Client = createClient({\n      url,\n      authToken,\n    });\n    const logger = LOG_QUERY\n      ? {\n          logQuery(query: string, params: unknown[]): void {\n            console.debug('___QUERY___');\n            console.debug(query);\n            console.debug(params);\n            console.debug('___END_QUERY___');\n          },\n        }\n      : undefined;\n    return drizzle({ client, logger });\n  };\n}\n"
  },
  {
    "path": "packages/insights/src/routes/service-worker.ts",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * The service-worker.ts file is used to have state of the art prefetching.\n * https://qwik.dev/qwikcity/prefetching/overview/\n *\n * Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.\n * You can also use this file to add more functionality that runs in the service worker.\n */\nexport declare const self: ServiceWorkerGlobalScope;\n\naddEventListener('install', () => self.skipWaiting());\n\naddEventListener('activate', () => self.clients.claim());\n"
  },
  {
    "path": "packages/insights/src/routes/test/counter/index.tsx",
    "content": "import { component$, useSignal } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      Count: {count.value}\n      <button onClick$={() => count.value++}>+1</button>\n      <button onClick$={() => count.value--}>-1</button>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/test/index.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { AppLink } from '~/routes.config';\n\nexport default component$(() => {\n  return (\n    <div>\n      <ul>\n        <li>\n          <AppLink route=\"/test/visible-task/\">Time (useVisibleTask)</AppLink>\n        </li>\n        <li>\n          <AppLink route=\"/test/counter/\">Counter</AppLink>\n        </li>\n      </ul>\n    </div>\n  );\n});\n"
  },
  {
    "path": "packages/insights/src/routes/test/visible-task/index.tsx",
    "content": "import { component$, useSignal, useVisibleTask$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  const time = useSignal('loading...');\n  // eslint-disable-next-line qwik/no-use-visible-task\n  useVisibleTask$(({ cleanup }) => {\n    const update = () => (time.value = new Date().toLocaleTimeString());\n    update();\n    cleanup(clearInterval.bind(null, setInterval(update, 1000)));\n  });\n  return <div>Time: {time.value}</div>;\n});\n"
  },
  {
    "path": "packages/insights/src/routes.config.tsx",
    "content": "/**\n * This file is created as part of the typed routes, but it is intended to be modified by the\n * developer.\n *\n * @file\n */\nimport { untypedAppUrl, omitProps } from '@builder.io/qwik-labs';\nimport { type AppLinkProps, type AppRouteParamsFunction } from './routes.gen';\nimport { type QwikIntrinsicElements } from '@builder.io/qwik';\n\n/** Configure `appUrl` with the typed information of routes. */\nexport const appUrl = untypedAppUrl as AppRouteParamsFunction;\n\n/**\n * Configure `<AppLink/>` component with the typed information of routes.\n *\n * NOTE: you may consider changing `<a>` to `<Link>` to be globally applied across your application.\n */\nexport function AppLink(props: AppLinkProps & QwikIntrinsicElements['a']) {\n  return (\n    <a\n      href={(appUrl as (route: string, props: any, prefix: string) => string)(\n        props.route,\n        props,\n        'param:'\n      )}\n      {...(omitProps as Function)(props, ['href'])}\n    >\n      {props.children}\n    </a>\n  );\n}\n"
  },
  {
    "path": "packages/insights/src/routes.gen.d.ts",
    "content": "///////////////////////////////////////////////////////////////////////////\n/// GENERATED FILE --- DO NOT EDIT --- YOUR CHANGES WILL BE OVERWRITTEN ///\n///////////////////////////////////////////////////////////////////////////\n\nexport type AppRoutes =\n  | \"/\"\n  | \"/api/v1/[publicApiKey]/bundles/\"\n  | \"/api/v1/[publicApiKey]/bundles/strategy/\"\n  | \"/api/v1/[publicApiKey]/post/\"\n  | \"/api/v1/[publicApiKey]/post/error/\"\n  | \"/api/v1/[publicApiKey]/post/manifest/\"\n  | \"/app/\"\n  | \"/app/[publicApiKey]/\"\n  | \"/app/[publicApiKey]/edit/\"\n  | \"/app/[publicApiKey]/errors/\"\n  | \"/app/[publicApiKey]/manifests/\"\n  | \"/app/[publicApiKey]/routes/\"\n  | \"/app/[publicApiKey]/routes/[route]/\"\n  | \"/app/[publicApiKey]/symbols/\"\n  | \"/app/[publicApiKey]/symbols/bundles/\"\n  | \"/app/[publicApiKey]/symbols/edge/\"\n  | \"/app/[publicApiKey]/symbols/outgoing/\"\n  | \"/app/[publicApiKey]/symbols/slow/\"\n  | \"/app/add/\"\n  | \"/test/\"\n  | \"/test/counter/\"\n  | \"/test/visible-task/\";\n\nexport interface AppRouteMap {\n  \"/\": {};\n  \"/api/v1/[publicApiKey]/bundles/\": { publicApiKey: string };\n  \"/api/v1/[publicApiKey]/bundles/strategy/\": { publicApiKey: string };\n  \"/api/v1/[publicApiKey]/post/\": { publicApiKey: string };\n  \"/api/v1/[publicApiKey]/post/error/\": { publicApiKey: string };\n  \"/api/v1/[publicApiKey]/post/manifest/\": { publicApiKey: string };\n  \"/app/\": {};\n  \"/app/[publicApiKey]/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/edit/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/errors/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/manifests/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/routes/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/routes/[route]/\": {\n    publicApiKey: string;\n    route: string;\n  };\n  \"/app/[publicApiKey]/symbols/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/symbols/bundles/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/symbols/edge/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/symbols/outgoing/\": { publicApiKey: string };\n  \"/app/[publicApiKey]/symbols/slow/\": { publicApiKey: string };\n  \"/app/add/\": {};\n  \"/test/\": {};\n  \"/test/counter/\": {};\n  \"/test/visible-task/\": {};\n}\n\nexport interface AppRouteParamsFunction {\n  (route: \"/\", params?: {}): string;\n  (\n    route: \"/api/v1/[publicApiKey]/bundles/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/api/v1/[publicApiKey]/bundles/strategy/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/api/v1/[publicApiKey]/post/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/api/v1/[publicApiKey]/post/error/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/api/v1/[publicApiKey]/post/manifest/\",\n    params: { publicApiKey: string },\n  ): string;\n  (route: \"/app/\", params?: {}): string;\n  (route: \"/app/[publicApiKey]/\", params: { publicApiKey: string }): string;\n  (\n    route: \"/app/[publicApiKey]/edit/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/errors/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/manifests/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/routes/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/routes/[route]/\",\n    params: { publicApiKey: string; route: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/symbols/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/symbols/bundles/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/symbols/edge/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/symbols/outgoing/\",\n    params: { publicApiKey: string },\n  ): string;\n  (\n    route: \"/app/[publicApiKey]/symbols/slow/\",\n    params: { publicApiKey: string },\n  ): string;\n  (route: \"/app/add/\", params?: {}): string;\n  (route: \"/test/\", params?: {}): string;\n  (route: \"/test/counter/\", params?: {}): string;\n  (route: \"/test/visible-task/\", params?: {}): string;\n}\n\nexport type AppLinkProps =\n  | { route: \"/\" }\n  | { route: \"/api/v1/[publicApiKey]/bundles/\"; \"param:publicApiKey\": string }\n  | {\n      route: \"/api/v1/[publicApiKey]/bundles/strategy/\";\n      \"param:publicApiKey\": string;\n    }\n  | { route: \"/api/v1/[publicApiKey]/post/\"; \"param:publicApiKey\": string }\n  | {\n      route: \"/api/v1/[publicApiKey]/post/error/\";\n      \"param:publicApiKey\": string;\n    }\n  | {\n      route: \"/api/v1/[publicApiKey]/post/manifest/\";\n      \"param:publicApiKey\": string;\n    }\n  | { route: \"/app/\" }\n  | { route: \"/app/[publicApiKey]/\"; \"param:publicApiKey\": string }\n  | { route: \"/app/[publicApiKey]/edit/\"; \"param:publicApiKey\": string }\n  | { route: \"/app/[publicApiKey]/errors/\"; \"param:publicApiKey\": string }\n  | { route: \"/app/[publicApiKey]/manifests/\"; \"param:publicApiKey\": string }\n  | { route: \"/app/[publicApiKey]/routes/\"; \"param:publicApiKey\": string }\n  | {\n      route: \"/app/[publicApiKey]/routes/[route]/\";\n      \"param:publicApiKey\": string;\n      \"param:route\": string;\n    }\n  | { route: \"/app/[publicApiKey]/symbols/\"; \"param:publicApiKey\": string }\n  | {\n      route: \"/app/[publicApiKey]/symbols/bundles/\";\n      \"param:publicApiKey\": string;\n    }\n  | { route: \"/app/[publicApiKey]/symbols/edge/\"; \"param:publicApiKey\": string }\n  | {\n      route: \"/app/[publicApiKey]/symbols/outgoing/\";\n      \"param:publicApiKey\": string;\n    }\n  | { route: \"/app/[publicApiKey]/symbols/slow/\"; \"param:publicApiKey\": string }\n  | { route: \"/app/add/\" }\n  | { route: \"/test/\" }\n  | { route: \"/test/counter/\" }\n  | { route: \"/test/visible-task/\" };\n"
  },
  {
    "path": "packages/insights/src/stats/clustering.unit.ts",
    "content": "import { DBSCAN } from 'density-clustering';\nimport { assert, test } from 'vitest';\n\ntest('dbscan', () => {\n  const dataset = [\n    [1, 1],\n    [0, 1],\n    [1, 0],\n    [10, 10],\n    [10, 13],\n    [13, 13],\n    [54, 54],\n    [55, 55],\n    [89, 89],\n    [57, 55],\n  ];\n\n  const dbscan = new DBSCAN();\n\n  const clusters = dbscan.run(dataset, 5, 2);\n  assert.deepEqual(clusters, [\n    [0, 1, 2],\n    [3, 4, 5],\n    [6, 7, 9],\n  ]);\n  assert.deepEqual(dbscan.noise, [8]);\n});\n"
  },
  {
    "path": "packages/insights/src/stats/edges.ts",
    "content": "import { DBSCAN } from 'density-clustering';\nimport { vectorSum2 } from './vector';\n\nexport interface Symbol {\n  name: string;\n  /** Map of dependent symbols sorted by probability of dependency. */\n  children: Edge[];\n  count: number;\n  /** Unmodified name of the symbol. */\n  fullName: string | null;\n  /** File source of the symbol. */\n  fileSrc: string | null;\n  /**\n   * Depth of the symbol in the graph following the shortest path.\n   *\n   * Initial value is set to Number.MAX_SAFE_INTEGER\n   */\n  depth: number;\n}\n\nexport interface Edge {\n  from: Symbol;\n  to: Symbol;\n  count: number;\n  // latency: number;\n  // delay: number;\n}\n\nexport interface SymbolPairs {\n  from: string | null;\n  to: string;\n  delay: number[];\n  latency: number[];\n}\n\nexport interface SymbolDetail {\n  hash: string;\n  fullName: string;\n  origin: string;\n}\n\nexport function computeSymbolGraph(rows: SymbolPairs[], details?: SymbolDetail[]): Symbol[] {\n  const detailMap = new Map<string, SymbolDetail>();\n  const edgeMap = new Map<string, Edge>();\n  const symbols: Symbol[] = [];\n  details && details.forEach((detail) => detailMap.set(detail.hash, detail));\n  const symbolMap = new Map<string, Symbol>();\n  const rootSymbol = getSymbol('<synthetic.root.symbol>');\n  for (const row of rows) {\n    fixNames(row);\n    const [countRelated, countUnrelated] = vectorSum2(\n      row.delay,\n      // If previous symbol occurred less than x ms than assume that they are related.\n      // if more than x ms than assume that they are unrelated (parent is null).\n      250\n    );\n    const self = getSymbol(row.to);\n    self.count += countRelated + countUnrelated;\n    if (countRelated) {\n      const parent = getSymbol(row.from);\n      const edge = getEdge(parent, self);\n      edge.count += countRelated;\n    }\n    if (countUnrelated) {\n      const edge = getEdge(rootSymbol, self);\n      edge.count += countUnrelated;\n    }\n  }\n\n  computeDepth(rootSymbol, 0);\n  sortEdgesByProbability();\n\n  return symbols;\n\n  /////////////////////////////////////////////////////////\n\n  function sortEdgesByProbability() {\n    for (let i = 0; i < symbols.length; i++) {\n      const edges = symbols[i].children;\n      edges.sort(probabilityComparator);\n    }\n  }\n\n  function probabilityComparator(a: Edge, b: Edge) {\n    return b.count - a.count;\n  }\n\n  function computeDepth(symbol: Symbol, distance: number) {\n    if (distance < symbol.depth) {\n      // shorter path was found.\n      symbol.depth = distance;\n      const children = Object.values(symbol.children) as Edge[];\n      children.forEach((edge) => {\n        computeDepth(edge.to, distance + 1);\n      });\n    }\n  }\n\n  function getEdge(parent: Symbol, self: Symbol): Edge {\n    const edgeName = parent.name + '->' + self.name;\n    let edge = edgeMap.get(edgeName);\n    if (!edge) {\n      edge = { count: 0, from: parent, to: self };\n      parent.children.push(edge);\n      edgeMap.set(edgeName, edge);\n    }\n    return edge;\n  }\n\n  function fixNames(row: SymbolPairs) {\n    row.to = row.to.split('_').pop()!;\n    row.from = row.from == null ? null : row.from.split('_').pop()!;\n    if (row.from === 'hW') {\n      row.from = null;\n    }\n  }\n\n  function getSymbol(name: string | null): Symbol {\n    if (name === null) {\n      return rootSymbol;\n    }\n    let symbol = symbolMap.get(name);\n    if (!symbol) {\n      const detail = detailMap.get(name);\n      symbol = {\n        count: 0,\n        name,\n        children: [],\n        depth: Number.MAX_SAFE_INTEGER,\n        fullName: detail?.fullName || null,\n        fileSrc: detail?.origin || null,\n      };\n      symbolMap.set(name, symbol);\n      symbols.push(symbol);\n    }\n    return symbol;\n  }\n}\n\nexport interface SymbolVectors {\n  symbols: Symbol[];\n  vectors: number[][];\n}\n\nexport function computeSymbolVectors(symbols: Symbol[]): SymbolVectors {\n  const rootSymbol = symbols.shift()!; // remove root symbol\n  const symbolVectorIdxMap = new Map<Symbol, number>();\n  const vectors: number[][] = [];\n  initializeVectorsAndSymbolMap();\n  const alreadyVisited = new Set<Symbol>();\n  const edgePath: Edge[] = [];\n  processChildren(rootSymbol, edgePath, alreadyVisited);\n  return { symbols, vectors };\n  ////////////////////////////////////////\n\n  function processChildren(symbol: Symbol, edgePath: Edge[], alreadyVisited: Set<Symbol>) {\n    const symbolIdx = symbolVectorIdxMap.get(symbol);\n    if (symbolIdx !== undefined) {\n      let weight = 1;\n      const vector = vectors[symbolIdx];\n      vector[symbolIdx] = weight; // self weight\n\n      // back-propagate weights to the symbol which caused the dependency.\n      // TODO(misko): This algorithm for computing weights is not perfect because\n      // it only takes the most frequent path into account.\n      // A better approach would be to sum weights along all paths.\n      for (let i = edgePath.length - 1; 0 <= i; i--) {\n        const edge = edgePath[i];\n        const symbolIdx = symbolVectorIdxMap.get(edge.from);\n        if (symbolIdx !== undefined) {\n          weight = Math.min(1, edge.count / edge.from.count) * weight;\n          vector[symbolIdx] = Math.min(1, vector[symbolIdx] + weight);\n        }\n      }\n    }\n\n    if (alreadyVisited.has(symbol)) {\n      return;\n    }\n    alreadyVisited.add(symbol);\n\n    symbol.children.forEach((edge) => {\n      edgePath.push(edge);\n      processChildren(edge.to, edgePath, alreadyVisited);\n      edgePath.pop();\n    });\n  }\n\n  function initializeVectorsAndSymbolMap() {\n    const vector: number[] = [];\n    for (let i = 0; i < symbols.length; i++) {\n      symbolVectorIdxMap.set(symbols[i], i);\n      vector.push(0);\n    }\n    vectors.push(vector);\n    for (let i = 1; i < vector.length; i++) {\n      vectors.push(vector.slice());\n    }\n    return vectors;\n  }\n}\n\nexport interface Bundle {\n  name: string;\n  symbols: Symbol[];\n}\n\nexport function computeBundles(symbolVectors: SymbolVectors): Bundle[] {\n  const bundles: Bundle[] = [];\n  const dbscan = new DBSCAN();\n  // We want to set the distance so that it is just below (90%) the distance between two unrelated symbols.\n  const maxDistance = 0.95 * Math.sqrt(Math.pow(1, 2) + Math.pow(1, 2));\n  const clusters = dbscan.run(symbolVectors.vectors, maxDistance, 1);\n  clusters.forEach((cluster) => {\n    const symbols = cluster.map((id) => symbolVectors.symbols[id]).filter(Boolean);\n    const symbolNames = symbols.map((s) => s.name);\n    symbolNames.sort();\n    bundles.push({\n      name: 'bundle_' + hashCode(symbolNames.join(',')),\n      symbols,\n    });\n  });\n  bundles.sort((b1, b2) => b2.symbols.length - b1.symbols.length);\n  return bundles;\n}\n\nexport const hashCode = (text: string, hash: number = 0) => {\n  for (let i = 0; i < text.length; i++) {\n    const chr = text.charCodeAt(i);\n    hash = (hash << 5) - hash + chr;\n    hash |= 0; // Convert to 32bit integer\n  }\n  return Number(Math.abs(hash)).toString(36);\n};\n"
  },
  {
    "path": "packages/insights/src/stats/edges.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport {\n  type SymbolPairs,\n  type SymbolVectors,\n  computeSymbolGraph,\n  computeSymbolVectors,\n} from './edges';\n\ntest('simple paths', () => {\n  const graph = computeSymbolGraph([edge('->a'), edge('a->b'), edge('b->c'), edge('c->d')]);\n  const symbolVectors = computeSymbolVectors(graph);\n  const result = toResult(symbolVectors);\n  assert.deepEqual(result, {\n    // How to think about this table:\n    // 1. The top row is the FROM symbol.\n    // 2. The left column is the TO symbol.\n    // 3. The value is the probability given that we start at\n    //    FROM symbol what is the probability that we end up at TO symbol.\n    // NOTE: the diagonal is always 1.0 because it is the identity.\n    //\n    //  FROM\n    //   a    b    c    d\n    a: [1.0, 0.0, 0.0, 0.0],\n    b: [1.0, 1.0, 0.0, 0.0],\n    c: [1.0, 1.0, 1.0, 0.0],\n    d: [1.0, 1.0, 1.0, 1.0],\n  });\n});\n\ntest('diamond', () => {\n  const graph = computeSymbolGraph([\n    edge('->a'),\n    edge('->a'),\n    edge('a->b'),\n    edge('a->c'),\n    edge('b->d'),\n    edge('c->d'),\n  ]);\n  const symbolVectors = computeSymbolVectors(graph);\n  const result = toResult(symbolVectors);\n  assert.deepEqual(result, {\n    // How to think about this table:\n    // 1. The top row is the FROM symbol.\n    // 2. The left column is the TO symbol.\n    // 3. The value is the probability given that we start at\n    //    FROM symbol what is the probability that we end up at TO symbol.\n    // NOTE: the diagonal is always 1.0 because it is the identity.\n    //\n    //  FROM\n    //   a    b    c    d\n    a: [1.0, 0.0, 0.0, 0.0],\n    b: [0.5, 1.0, 0.0, 0.0],\n    c: [0.5, 0.0, 1.0, 0.0],\n    d: [1.0, 1.0, 1.0, 1.0],\n  });\n});\n\ntest('lopsided diamond', () => {\n  const graph = computeSymbolGraph([\n    edge('->a'),\n    edge('->a'),\n    edge('->a'),\n    edge('a->b'),\n    edge('a->b'),\n    edge('a->c'),\n    edge('b->d'),\n    edge('b->d'),\n    edge('c->d'),\n  ]);\n  const symbolVectors = computeSymbolVectors(graph);\n  const result = toResult(symbolVectors);\n  assert.deepEqual(result, {\n    // How to think about this table:\n    // 1. The top row is the FROM symbol.\n    // 2. The left column is the TO symbol.\n    // 3. The value is the probability given that we start at\n    //    FROM symbol what is the probability that we end up at TO symbol.\n    // NOTE: the diagonal is always 1.0 because it is the identity.\n    //\n    //  FROM\n    //   a    b    c    d\n    a: [1.0, 0.0, 0.0, 0.0],\n    b: [2 / 3, 1.0, 0.0, 0.0],\n    c: [1 / 3, 0.0, 1.0, 0.0],\n    d: [1.0, 1.0, 1.0, 1.0],\n  });\n});\n\ntest('incomplete diamond', () => {\n  const graph = computeSymbolGraph([\n    edge('->a'),\n    edge('->a'),\n    edge('a->b'),\n    edge('a->c'),\n    edge('b->d'),\n  ]);\n  const symbolVectors = computeSymbolVectors(graph);\n  const result = toResult(symbolVectors);\n  assert.deepEqual(result, {\n    // How to think about this table:\n    // 1. The top row is the FROM symbol.\n    // 2. The left column is the TO symbol.\n    // 3. The value is the probability given that we start at\n    //    FROM symbol what is the probability that we end up at TO symbol.\n    // NOTE: the diagonal is always 1.0 because it is the identity.\n    //\n    //  FROM\n    //   a    b    c    d\n    a: [1.0, 0.0, 0.0, 0.0],\n    b: [0.5, 1.0, 0.0, 0.0],\n    c: [0.5, 0.0, 1.0, 0.0],\n    d: [0.5, 1.0, 0.0, 1.0],\n  });\n});\n\nfunction edge(name: string): SymbolPairs {\n  const parts = name.split('->');\n  return {\n    from: parts[0] || null,\n    to: parts[1],\n    delay: [1],\n    latency: [1],\n  };\n}\n\nfunction toResult(symbolVectors: SymbolVectors): Record<string, number[]> {\n  const result: Record<string, number[]> = {};\n  const symbols = symbolVectors.symbols;\n  const vectors = symbolVectors.vectors;\n  for (let i = 0; i < symbols.length; i++) {\n    result[symbols[i].name] = vectors[i];\n  }\n  return result;\n}\n"
  },
  {
    "path": "packages/insights/src/stats/vector.ts",
    "content": "/** Controls the number of buckets to quantize to. */\nexport const NUMBER_OF_BUCKETS = 50;\n\n/**\n * Max value which cant be quantized. Any value greater than this value will result in the last\n * bucket.\n */\nexport const MAX_VALUE = 10000;\nexport const TIMELINE_MAX_VALUE = 15 * 60 * 1000;\n\n/**\n * Without offset Math.log2(0) is -Infinity, and Math.Log(1) and Math.Log(2) leave an empty bucket.\n * So by offsetting it we cane ensure that the buckets are not skipped.\n */\nconst VALUE_OFFSET = Math.floor(Math.pow(2, 2.5));\nconst TIMELINE_VALUE_OFFSET = Math.floor(Math.pow(2, 10));\n\nconst getResultOffsetAndScale = (maxValue: number, valueOffset: number) => {\n  let previousResultOffset = -1;\n  let resultOffset = 0;\n  let scale = 1;\n  let count = 10;\n  while (previousResultOffset !== resultOffset && count-- > 0) {\n    previousResultOffset = resultOffset;\n    scale = (NUMBER_OF_BUCKETS + resultOffset - 1) / Math.log2(maxValue + valueOffset);\n    resultOffset = Math.floor(scale * Math.log2(valueOffset));\n  }\n  return { RESULT_OFFSET: resultOffset, SCALE: scale };\n};\n\n/** A computed constant which is used for scaling so that we spread MAX_VALUE into BUCKETS. */\nconst { RESULT_OFFSET, SCALE } = (() => getResultOffsetAndScale(MAX_VALUE, VALUE_OFFSET))();\n\n/**\n * A computed constant which is used for timeline scaling so that we spread TIMELINE_MAX_VALUE into\n * BUCKETS.\n */\nconst { RESULT_OFFSET: TIMELINE_RESULT_OFFSET, SCALE: TIMELINE_SCALE } = (() =>\n  getResultOffsetAndScale(TIMELINE_MAX_VALUE, TIMELINE_VALUE_OFFSET))();\n\n/** Quantize the value into one of the buckets */\nexport function toBucket(value: number): number {\n  value = Math.max(0, value);\n  return Math.min(\n    NUMBER_OF_BUCKETS - 1, // Make sure we never return a value greater than number of buckets\n    Math.floor(SCALE * Math.log2(value + VALUE_OFFSET)) - RESULT_OFFSET\n  );\n}\n\nexport function toBucketTimeline(value: number): number {\n  value = Math.max(0, value);\n  return Math.min(\n    NUMBER_OF_BUCKETS - 1, // Make sure we never return a value greater than number of buckets\n    Math.floor(TIMELINE_SCALE * Math.log2(value + TIMELINE_VALUE_OFFSET)) - TIMELINE_RESULT_OFFSET\n  );\n}\n\nexport interface Bucket {\n  min: number;\n  max: number;\n  avg: number;\n}\nconst computeBuckets = (maxValue: number, toBucket: (value: number) => number): Bucket[] => {\n  const buckets: ReturnType<typeof fromBucket>[] = [];\n  for (let i = 0; i <= maxValue; i++) {\n    const bucketIdx = toBucket(i);\n    if (bucketIdx < buckets.length) {\n      const bucket = buckets[bucketIdx];\n      bucket.max = i + 1;\n      bucket.avg = (bucket.min + i + 1) / 2;\n    } else {\n      buckets.push({ min: i, max: i + 1, avg: (i + i + 1) / 2 });\n    }\n  }\n  return buckets;\n};\nexport const BUCKETS: Bucket[] = computeBuckets(MAX_VALUE, toBucket);\nexport const TIMELINE_BUCKETS: Bucket[] = computeBuckets(TIMELINE_MAX_VALUE, toBucketTimeline);\n\nexport function fromBucket(bucket: number): {\n  min: number;\n  max: number;\n  avg: number;\n} {\n  return BUCKETS[Math.min(BUCKETS.length - 1, bucket)];\n}\n\nexport function vectorSum(vector: number[]): number {\n  let sum = 0;\n  for (let i = 0; i < vector.length; i++) {\n    sum += vector[i];\n  }\n  return sum;\n}\nexport function vectorSum2(vector: number[], split: number): [number, number] {\n  let sum1 = 0;\n  let sum2 = 0;\n  for (let i = 0; i < vector.length; i++) {\n    const bucket = BUCKETS[i];\n    if (bucket.avg < split) {\n      sum1 += vector[i];\n    } else {\n      sum2 += vector[i];\n    }\n  }\n  return [sum1, sum2];\n}\n\nexport function vectorAdd(dst: number[], src: number[]) {\n  let max = 0;\n  for (let i = 0; i < dst.length; i++) {\n    max = Math.max(max, (dst[i] += src[i]));\n  }\n  return max;\n}\n\nexport function vectorAvg(vector: number[], buckets: Bucket[] = BUCKETS): number {\n  let sum = 0;\n  let count = 0;\n  for (let i = 0; i < vector.length; i++) {\n    const value = vector[i];\n    sum += value * buckets[i].avg;\n    count += value;\n  }\n  return sum / count;\n}\n\nexport function vectorMax(vector: number[]): number {\n  let max = 0;\n  for (let i = 0; i < vector.length; i++) {\n    const value = vector[i];\n    max = Math.max(max, value);\n  }\n  return max;\n}\n\nconst VECTOR_TEMPLATE = (() => {\n  const vector: number[] = [];\n  for (let i = 0; i < NUMBER_OF_BUCKETS; i++) {\n    vector.push(0);\n  }\n  return vector;\n})();\n\nexport function vectorNew(): number[] {\n  return VECTOR_TEMPLATE.slice();\n}\n"
  },
  {
    "path": "packages/insights/src/stats/vector.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport {\n  MAX_VALUE,\n  NUMBER_OF_BUCKETS,\n  TIMELINE_MAX_VALUE,\n  fromBucket,\n  toBucket,\n  toBucketTimeline,\n} from './vector';\n\ntest('bucketize values', () => {\n  // let previousBucket = -1;\n  // let value = 0;\n  // while (previousBucket < NUMBER_OF_BUCKETS - 1) {\n  //   const bucket = toBucket(value);\n  //   if (previousBucket !== bucket) {\n  //     console.log(value, '->', bucket);\n  //     previousBucket = bucket;\n  //   }\n  //   value++;\n  // }\n  assert.equal(toBucket(0), 0);\n  assert.equal(toBucket(1), 1);\n  assert.equal(toBucket(2), 2);\n  assert.equal(toBucket(3), 3);\n  assert.equal(toBucket(4), 4);\n  assert.equal(toBucket(5), 4);\n  assert.equal(toBucket(6), 5);\n  assert.equal(toBucket(7), 5);\n  assert.equal(toBucket(8), 6);\n  assert.equal(toBucket(9), 6);\n  assert.equal(toBucket(10), 7);\n  assert.equal(toBucket(MAX_VALUE), NUMBER_OF_BUCKETS - 1);\n  assert.equal(toBucket(Number.MAX_SAFE_INTEGER), NUMBER_OF_BUCKETS - 1);\n  assert.equal(toBucket(MAX_VALUE - 1), NUMBER_OF_BUCKETS - 2);\n});\n\ntest('debucketize', () => {\n  assert.deepEqual(fromBucket(0), { min: 0, max: 1, avg: 0.5 });\n  assert.deepEqual(fromBucket(1), { min: 1, max: 2, avg: 1.5 });\n  assert.deepEqual(fromBucket(NUMBER_OF_BUCKETS - 1).min, MAX_VALUE);\n});\n\ntest('bucketize timeline values', () => {\n  // let previousBucket = -1;\n  // let value = 0;\n  // while (previousBucket < NUMBER_OF_BUCKETS - 1) {\n  //   const bucket = toBucketTimeline(value);\n  //   if (previousBucket !== bucket) {\n  //     console.log(value, '->', bucket);\n  //     previousBucket = bucket;\n  //   }\n  //   value++;\n  // }\n  assert.equal(toBucketTimeline(0), 0);\n  assert.equal(toBucketTimeline(70), 1);\n  assert.equal(toBucketTimeline(233), 2);\n  assert.equal(toBucketTimeline(425), 3);\n  assert.equal(toBucketTimeline(640), 4);\n  assert.equal(toBucketTimeline(800), 4);\n  assert.equal(toBucketTimeline(900), 5);\n  assert.equal(toBucketTimeline(950), 5);\n  assert.equal(toBucketTimeline(1200), 6);\n  assert.equal(toBucketTimeline(1400), 6);\n  assert.equal(toBucketTimeline(1800), 7);\n  assert.equal(toBucketTimeline(TIMELINE_MAX_VALUE), NUMBER_OF_BUCKETS - 1);\n  assert.equal(toBucketTimeline(Number.MAX_SAFE_INTEGER), NUMBER_OF_BUCKETS - 1);\n  assert.equal(toBucketTimeline(TIMELINE_MAX_VALUE - 1), NUMBER_OF_BUCKETS - 2);\n});\n"
  },
  {
    "path": "packages/insights/src/types/q-manifest.ts",
    "content": "import * as z from 'zod';\n\nexport const QManifestSymbol = z.object({\n  origin: z.string(),\n  displayName: z.string(),\n  canonicalFilename: z.string(),\n  hash: z.string(),\n  ctxKind: z.string(),\n  ctxName: z.string(),\n  captures: z.boolean(),\n  loc: z.array(z.number()),\n});\n\nexport const QManifestBundle = z.object({\n  size: z.number(),\n  imports: z.array(z.string()).optional(),\n  origins: z.array(z.string()).optional(),\n});\n\nexport const QManifestInjection = z.object({\n  tag: z.string(),\n  location: z.string(),\n  attributes: z.record(z.string(), z.string()),\n});\n\nexport const QManifestOptions = z.object({\n  target: z.string(),\n  // buildModule: z.string(),\n  // forceFullBuild: z.boolean(),\n  entryStrategy: z.object({\n    type: z.string(),\n  }),\n});\n\nexport const QManifestPlatform = z.object({\n  qwik: z.string(),\n  vite: z.string(),\n  rollup: z.string(),\n  env: z.string(),\n  os: z.string(),\n  node: z.string(),\n});\n\nexport const QManifest = z.object({\n  manifestHash: z.string(),\n  symbols: z.record(z.string(), QManifestSymbol),\n  mapping: z.record(z.string(), z.string()),\n  bundles: z.record(z.string(), QManifestBundle),\n  injections: z.array(QManifestInjection),\n  version: z.string(),\n  options: QManifestOptions,\n  platform: QManifestPlatform,\n});\n"
  },
  {
    "path": "packages/insights/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2022\",\n    \"lib\": [\"es2022\", \"DOM\", \"WebWorker\", \"DOM.Iterable\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"outDir\": \"tmp\",\n    \"noEmit\": true,\n    \"types\": [\"node\", \"vite/client\"],\n    \"paths\": {\n      \"~/*\": [\"./src/*\"],\n      \"@qwik-client-manifest\": [\"../../qwik/src/server/server-modules.d.ts\"]\n    }\n  },\n  \"exclude\": [\"./dist\", \"eslint.config.mjs\"]\n}\n"
  },
  {
    "path": "packages/insights/vite.config.ts",
    "content": "import { defineConfig, loadEnv } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport { qwikCity } from '@builder.io/qwik-city/vite';\nimport tsconfigPaths from 'vite-tsconfig-paths';\nimport { qwikInsights, qwikTypes } from '@builder.io/qwik-labs/vite';\nimport tailwindcss from '@tailwindcss/vite';\n\nexport default defineConfig(async () => {\n  return {\n    plugins: [\n      // Disable CSRF protection\n      qwikCity(),\n      qwikTypes(),\n      qwikVite(),\n      tsconfigPaths({ root: '.' }),\n      qwikInsights({ publicApiKey: loadEnv('', '.', '').PUBLIC_QWIK_INSIGHTS_KEY }),\n      tailwindcss(),\n    ],\n    preview: {\n      headers: {\n        'Cache-Control': 'public, max-age=600',\n      },\n    },\n    optimizeDeps: {\n      include: ['@auth/core'],\n    },\n  };\n});\n"
  },
  {
    "path": "packages/insights/vitest.config.ts",
    "content": "import { defineConfig } from 'vitest/config';\nimport tsconfigPaths from 'vite-tsconfig-paths';\n\nexport default defineConfig({\n  plugins: [tsconfigPaths({ root: '.' })],\n  test: {\n    include: ['**/*.unit.?(c|m)[jt]s?(x)'],\n    setupFiles: ['../../vitest-setup.ts'],\n  },\n});\n"
  },
  {
    "path": "packages/qwik/.npmignore",
    "content": "src\n"
  },
  {
    "path": "packages/qwik/CHANGELOG.md",
    "content": "# @builder.io/qwik\n\n## 1.19.0\n\n### Minor Changes\n\n- ✨ `untrack()` now accepts signals and stores directly, as well as accepting arguments when you pass a function. This makes retrieving values without subscribing to them more efficient. (by [@wmertens](https://github.com/wmertens) in [#8247](https://github.com/QwikDev/qwik/pull/8247))\n\n### Patch Changes\n\n- 🐞🩹 we now prevent merging useVisibleTask$ code together with other segments to prevent overpreloading when their entry contains a lot of transitive imports. (by [@maiieul](https://github.com/maiieul) in [#8275](https://github.com/QwikDev/qwik/pull/8275))\n\n- 🐞🩹 duplicated preload bundles in SSR preload (by [@chebanenko](https://github.com/chebanenko) in [#8248](https://github.com/QwikDev/qwik/pull/8248))\n\n- ⚡️: the core.js and preloader.js references in q-manifest and bundle-graph are now filtered out for smaller outputs. (by [@maiieul](https://github.com/maiieul) in [#8278](https://github.com/QwikDev/qwik/pull/8278))\n\n## 1.18.0\n\n### Minor Changes\n\n- PERF: Computed signals now only trigger listeners if their value has changed (by [@wmertens](https://github.com/wmertens) in [#8148](https://github.com/QwikDev/qwik/pull/8148))\n\n### Patch Changes\n\n- execute cleanup cb for all component tree while calling dispose.cleanup method returned by render fn (by [@sashkashishka](https://github.com/sashkashishka) in [#8164](https://github.com/QwikDev/qwik/pull/8164))\n\n- 🐞🩹 useResource's onRejected now catches errors again; preventing unhandled errors in test environments. (by [@maiieul](https://github.com/maiieul) in [#8197](https://github.com/QwikDev/qwik/pull/8197))\n\n- ✨ `qwik add compiled-i18` now adds easy i18n to your app. (by [@wmertens](https://github.com/wmertens) in [#8177](https://github.com/QwikDev/qwik/pull/8177))\n\n## 1.17.2\n\n## 1.17.1\n\n### Patch Changes\n\n- 🐞🩹 the bunding won't lead to circular dependencies in qwik-astro apps anymore. (by [@maiieul](https://github.com/maiieul) in [#8052](https://github.com/QwikDev/qwik/pull/8052))\n\n- ✨ The optimizer is now built with a recent Rust toolchain. Fresher bits! (by [@wmertens](https://github.com/wmertens) in [#8040](https://github.com/QwikDev/qwik/pull/8040))\n\n## 1.17.0\n\n### Minor Changes\n\n- 🐞🩹 Qwik now leverages Rollup's new `output.onlyExplicitManualChunks` feature, which improves preloading performance and reduces cache invalidation for a snappier user experience. (by [@maiieul](https://github.com/maiieul) in [#7982](https://github.com/QwikDev/qwik/pull/7982))\n\n- ✨ the qwikloader can now be inlined again if required (for testing or specific network conditions). Pass `qwikLoader: 'inline'` to the render options. (by [@wmertens](https://github.com/wmertens) in [#8008](https://github.com/QwikDev/qwik/pull/8008))\n\n### Patch Changes\n\n- 🐞🩹 The Deno integration now builds successfully with version v2.4.3 and above. (by [@gioboa](https://github.com/gioboa) in [#7913](https://github.com/QwikDev/qwik/pull/7913))\n\n- TEST: qwik react mount and unmount (by [@sashkashishka](https://github.com/sashkashishka) in [#7950](https://github.com/QwikDev/qwik/pull/7950))\n\n- 🐞🩹 solve type error when using async \\_resolved function (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7426](https://github.com/QwikDev/qwik/pull/7426))\n\n- 🐞🩹 Click-to-Component is now more reliable across platforms (by [@wmertens](https://github.com/wmertens) in [#7923](https://github.com/QwikDev/qwik/pull/7923))\n\n- 🛠 add qwik react e2e test runs to ci (by [@sashkashishka](https://github.com/sashkashishka) in [#7952](https://github.com/QwikDev/qwik/pull/7952))\n\n## 1.16.1\n\n### Patch Changes\n\n- 🐞🩹 The entry.ssr renderToStream `preloader.preloadProbability` option is now deprecated because this could cause performance issues with bundles fetched on click instead of being preloaded ahead of time. (The preloader still relies on probabilities to know preload the most likely bundles first) (by [@maiieul](https://github.com/maiieul) in [#7847](https://github.com/QwikDev/qwik/pull/7847))\n\n- 🐞🩹 Link prefetch now always preloads Link prefetch bundles on monorepos (by [@maiieul](https://github.com/maiieul) in [#7835](https://github.com/QwikDev/qwik/pull/7835))\n\n- 🐞🩹 Rollup's hoistTranstiveImports is now set to `false` because the hoisting added unnecessary bundles to be preloaded to the bundle-graph static imports graph. This could lead to a suboptimal preloading experience. (by [@maiieul](https://github.com/maiieul) in [#7850](https://github.com/QwikDev/qwik/pull/7850))\n\n- 🛠 Add check-client command to verify bundle freshness (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7517](https://github.com/QwikDev/qwik/pull/7517))\n\n- ✨ All qwik packages are now marked as side effect free in their package.json. This should remove a few unecessary empty imports added by rollup and then not tree-shaken like `import \"./preloader.js\"`. (by [@maiieul](https://github.com/maiieul) in [#7908](https://github.com/QwikDev/qwik/pull/7908))\n\n- 🐞🩹 unmount qwikify react root alongside with qwik component (by [@sashkashishka](https://github.com/sashkashishka) in [#7864](https://github.com/QwikDev/qwik/pull/7864))\n\n- 🐞🩹 preloader now preloads bundles as long as they are part of the current viewport's bundles graph, even if their probability is very small (by [@maiieul](https://github.com/maiieul) in [#7836](https://github.com/QwikDev/qwik/pull/7836))\n\n- ✨ maxIdlePreloads is now constant over time so you know for sure how many bundles will be preloaded concurrently during idle. (by [@maiieul](https://github.com/maiieul) in [#7846](https://github.com/QwikDev/qwik/pull/7846))\n\n- 🛠 use patched domino instead of qwik-dom (by [@gioboa](https://github.com/gioboa) in [#7842](https://github.com/QwikDev/qwik/pull/7842))\n\n- 🐞🩹 Qwik is now smarter at bundling non QRL source files and qwik libraries modules (e.g. helpers, enums, inline components, etc.) together. (by [@maiieul](https://github.com/maiieul) in [#7888](https://github.com/QwikDev/qwik/pull/7888))\n\n## 1.16.0\n\n### Minor Changes\n\n- ✨ bump Vite to v7 (by [@gioboa](https://github.com/gioboa) in [#7762](https://github.com/QwikDev/qwik/pull/7762))\n\n### Patch Changes\n\n- 🐞🩹 Keeping the service worker components now properly unregisters them. (by [@maiieul](https://github.com/maiieul) in [#7781](https://github.com/QwikDev/qwik/pull/7781))\n\n- 🛠 remove a grace period before unregistering events from qwikloader (by [@Varixo](https://github.com/Varixo) in [#7818](https://github.com/QwikDev/qwik/pull/7818))\n\n- 🐞🩹 Keeping the service worker components now also removes their associated Cache storage. (by [@maiieul](https://github.com/maiieul) in [#7782](https://github.com/QwikDev/qwik/pull/7782))\n\n- 🐞🩹 fix up open in editor feature (by [@LazyClicks](https://github.com/LazyClicks) in [#7785](https://github.com/QwikDev/qwik/pull/7785))\n\n- 🐞🩹 SSR was missing some places with nonce for CSP. Now CSP should work even when strict-dynamic (by [@wmertens](https://github.com/wmertens) in [#7776](https://github.com/QwikDev/qwik/pull/7776))\n\n## 1.15.0\n\n### Minor Changes\n\n- 🐞🩹 the preloader bundle graph file is now built as an asset. This is cleaner and avoids i18n translation of the file. (by [@wmertens](https://github.com/wmertens) in [#7650](https://github.com/QwikDev/qwik/pull/7650))\n\n### Patch Changes\n\n- 🐞🩹 Use correct working directory for Deno environment (by [@siguici](https://github.com/siguici) in [#7699](https://github.com/QwikDev/qwik/pull/7699))\n\n- :zap: the qwikloader is no longer embedded in the SSR results. Instead, the same techniques are used as for the preloader to ensure that the qwikloader is active as soon as possible, loaded from a separate bundle. This reduces SSR page size by several kB end ensures that subsequent qwikloader loads are nearly instant. (by [@wmertens](https://github.com/wmertens) in [#7613](https://github.com/QwikDev/qwik/pull/7613))\n\n- 🐞🩹 Removed backdrop-filter of vite-error-overlay to prevent perf issues with multiple errors (by [@intellix](https://github.com/intellix) in [#7676](https://github.com/QwikDev/qwik/pull/7676))\n\n- 🐞🩹 assetsDir and debug:true will no longer break your application. (by [@maiieul](https://github.com/maiieul) in [#7638](https://github.com/QwikDev/qwik/pull/7638))\n\n- 🐞🩹 We now also output the preloader as .cjs for non esm environments (e.g. jest 29 and below). (by [@maiieul](https://github.com/maiieul) in [#7736](https://github.com/QwikDev/qwik/pull/7736))\n\n- 🐞🩹 cypress component tests became slow in 1.9.1. This is now fixed. (by [@maiieul](https://github.com/maiieul) in [#7736](https://github.com/QwikDev/qwik/pull/7736))\n\n- ✨ q-manifest.json now also includes the generated assets (by [@wmertens](https://github.com/wmertens) in [#7650](https://github.com/QwikDev/qwik/pull/7650))\n\n- 🐞🩹 support q-manifest resolution under Bun runtime (#7565) (by [@siguici](https://github.com/siguici) in [#7669](https://github.com/QwikDev/qwik/pull/7669))\n\n- 🐞🩹 set correct script type for qwik loader (by [@Varixo](https://github.com/Varixo) in [#7710](https://github.com/QwikDev/qwik/pull/7710))\n\n- 🛠 update devDependencies and configurations (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7695](https://github.com/QwikDev/qwik/pull/7695))\n\n## 1.14.1\n\n## 1.14.0\n\n### Minor Changes\n\n- ✨ Major improvements to prefetching with automatic bundle preloading (by [@wmertens](https://github.com/wmertens) in [#7453](https://github.com/QwikDev/qwik/pull/7453))\n  - This removes the need for service workers, and instead utilize `modulepreload` link tags for better browser integration.\n  - Improves initial load performance by including dynamic imports in the prefetch\n  - Reduces complexity while maintaining similar (and even better) functionality\n  - Enables some preloading capabilities in dev mode (SSR result only)\n  - Includes path-to-bundle mapping in bundle graph (this improves the experience using the `<Link>` component, AKA \"single page app\" mode)\n  - Server now has built-in manifest support (so no need to pass `manifest` around)\n  - Moves insights-related build code to insights plugin\n\n  ***\n\n  ⚠️ **ATTENTION:**\n  - **Keep** your service worker code as is (either `<ServiceWorkerRegister/>` or `<PrefetchServiceWorker/>`).\n  - **Configure** your server to provide long caching headers.\n\n  **Service Worker:**\n\n  This new implementation will use it to uninstall the current service worker to reduce the unnecessary duplication.\n\n  The builtin service workers components are deprecated but still exist for backwards compatibility.\n\n  ⚠️ **IMPORTANT: Caching Headers:**\n\n  The files under build/ and assets/ are named with their content hash and may therefore be cached indefinitely. Typically you should serve `build/*` and `assets/*` with `Cache-Control: public, max-age=31536000, immutable`.\n\n  However, if you changed the rollup configuration for output filenames, you will have to adjust the caching configuration accordingly.\n\n  ***\n\n  You can configure the preload behavior in your SSR configuration:\n\n  ```ts\n  // entry.ssr.ts\n  export default function (opts: RenderToStreamOptions) {\n    return renderToStream(<Root />, {\n      preload: {\n        // Enable debug logging for preload operations\n        debug: true,\n        // Maximum simultaneous preload links\n        maxIdlePreloads: 5,\n        // Minimum probability threshold for preloading\n        preloadProbability: 0.25\n        // ...and more, see the type JSDoc on hover\n      },\n      ...opts,\n    });\n  }\n  ```\n\n  #### Optional for legacy apps:\n\n  For legacy apps that still need service worker functionality, you can add it back using:\n\n  ```bash\n  npm run qwik add service-worker\n  ```\n\n  This will add a basic service worker setup that you can customize for specific caching strategies, offline support, or other PWA features beyond just prefetching.\n\n### Patch Changes\n\n- 🐞🩹 linting errors which were previously being ignored across the monorepo. (by [@better-salmon](https://github.com/better-salmon) in [#7418](https://github.com/QwikDev/qwik/pull/7418))\n\n- 🐞🩹 now qwikloader is loaded only once in all cases (by [@wmertens](https://github.com/wmertens) in [#7506](https://github.com/QwikDev/qwik/pull/7506))\n\n## 1.13.0\n\n### Minor Changes\n\n- The `useTask# @builder.io/qwik function's `eagerness` option is deprecated and will be removed in version 2. (by [@sreeisalso](https://github.com/sreeisalso) in [#7345](https://github.com/QwikDev/qwik/pull/7345))\n\n### Patch Changes\n\n- 🐞🩹 Error boundary `ErrorBoundary` and fix `useErrorBoundary` (by [@damianpumar](https://github.com/damianpumar) in [#7342](https://github.com/QwikDev/qwik/pull/7342))\n\n- 🐞 🩹 The qwik-city ServiceWorkerRegister and qwik PrefetchServiceWorker now prefetch all their qrls to prevent under-prefetching (by [@maiieul](https://github.com/maiieul) in [#7417](https://github.com/QwikDev/qwik/pull/7417))\n\n- 🐞🩹 When csr is true, it causes a crash because resolve cannot be null as the second parameter (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7420](https://github.com/QwikDev/qwik/pull/7420))\n\n- updated drizzle to latest version (by [@sreeisalso](https://github.com/sreeisalso) in [#7288](https://github.com/QwikDev/qwik/pull/7288))\n\n- 🐞 fix(rollup): improve manualChunks logic to minimize over-prefetching (by [@maiieul](https://github.com/maiieul) in [#7362](https://github.com/QwikDev/qwik/pull/7362))\n\n- ✨ Add the ability to see chunks names in preview/production environments to facilitate debugging of production-only bugs (by [@maiieul](https://github.com/maiieul) in [#7293](https://github.com/QwikDev/qwik/pull/7293))\n\n- Emit an CustomEvent `qviewTransition` when view transition starts. (by [@GrandSchtroumpf](https://github.com/GrandSchtroumpf) in [#7237](https://github.com/QwikDev/qwik/pull/7237))\n\n- ✨ Ability to keep using tailwind v3 through the cli (by [@maiieul](https://github.com/maiieul) in [#7403](https://github.com/QwikDev/qwik/pull/7403))\n\n- dev server now correctly handles css and js importers, also hmr persistence (by [@thejackshelton](https://github.com/thejackshelton) in [#7389](https://github.com/QwikDev/qwik/pull/7389))\n\n- 🐞🩹 set default value of lint to false to improve the execution performance (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7425](https://github.com/QwikDev/qwik/pull/7425))\n\n- 🐞🩹 manual QRL grouping now works again. This is needed for Insights to work. (by [@wmertens](https://github.com/wmertens) in [#7444](https://github.com/QwikDev/qwik/pull/7444))\n\n## 1.12.1\n\n### Patch Changes\n\n- 📃 update turso integration keywords, add contributor (by [@A2-NieR](https://github.com/A2-NieR) in [#7215](https://github.com/QwikDev/qwik/pull/7215))\n\n- ✨ tailwindcss v4 integration (by [@sreeisalso](https://github.com/sreeisalso) in [#7274](https://github.com/QwikDev/qwik/pull/7274))\n\n- 🐞🩹 remove usage of `computedStyleMap` (by [@Varixo](https://github.com/Varixo) in [#7252](https://github.com/QwikDev/qwik/pull/7252))\n\n- 📃 remove shop (by [@gioboa](https://github.com/gioboa) in [#7221](https://github.com/QwikDev/qwik/pull/7221))\n\n- 🐞🩹 error in the middleware occurs 404 (by [@JerryWu1234](https://github.com/JerryWu1234) in [#6951](https://github.com/QwikDev/qwik/pull/6951))\n\n- 🐞🩹 changed turso createClient import to work with file urls, updated docs note with info & link to the corresponding section in the turso docs (by [@A2-NieR](https://github.com/A2-NieR) in [#7211](https://github.com/QwikDev/qwik/pull/7211))\n\n- 📃 add Qwik blog + articles (by [@gioboa](https://github.com/gioboa) in [#7214](https://github.com/QwikDev/qwik/pull/7214))\n\n- 🐞🩹 input's value is string when passing number (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7249](https://github.com/QwikDev/qwik/pull/7249))\n\n## 1.12.0\n\n### Minor Changes\n\n- ✨ The build constants `isDev`, `isBrowser` and `isServer` are now exported from `@builder.io/qwik` directly, so they are more discoverable and easier to add. `@builder.io/qwik/build` still remains. (by [@wmertens](https://github.com/wmertens) in [#7138](https://github.com/QwikDev/qwik/pull/7138))\n\n### Patch Changes\n\n- 🐞🩹 add subscription when doing `\"prop\" in store` (by [@revintec](https://github.com/revintec) in [#7071](https://github.com/QwikDev/qwik/pull/7071))\n\n- 🐞🩹 `stoppropagation` functionality (by [@shairez](https://github.com/shairez) in [#7102](https://github.com/QwikDev/qwik/pull/7102))\n\n## 1.11.0\n\n### Minor Changes\n\n- CHORE: Prepare backwards compatibility for V1 libraries in V2. (by [@wmertens](https://github.com/wmertens) in [#7044](https://github.com/QwikDev/qwik/pull/7044))\n\n  We move internal fields `immutableProps` and `flags` out of JSXNode as they are not meant for public use.\n\n  This will allow projects using older V1 libraries to continue to work with the Qwik V2 by adding the following `package.json` changes:\n\n  ```json\n  {\n    \"dependencies\": {\n      \"@builder.io/qwik\": \"^1.11.0\",\n      \"@qwik.dev/core\": \"^2.0.0\"\n    }\n  }\n  ```\n\n  And will prevent typescript errors when using libraries which haven't upgraded to V2 yet.\n\n- ✨ add monorepo support to the `qwik add` command by adding a `projectDir` param (by [@shairez](https://github.com/shairez) in [#7059](https://github.com/QwikDev/qwik/pull/7059))\n\n  That way you can run `qwik add --projectDir=packages/my-package` and it will add the feature to the specified project/package (sub) folder, instead of the root folder.\n\n## 1.10.0\n\n### Minor Changes\n\n- Async functions in `useComputed` are deprecated. (by [@wmertens](https://github.com/wmertens) in [#7013](https://github.com/QwikDev/qwik/pull/7013))\n\n  **Why?**\n  - Qwik can't track used signals after the first await, which leads to subtle bugs.\n  - When calculating the first time, it will see it's a promise and it will restart the render function.\n  - Both `useTask` and `useResource` are available, without these problems.\n\n  In v2, async functions won't work.\n\n  Again, to get the same functionality use `useTask` or `useResource` instead, or this function:\n\n  ```tsx\n  export const useAsyncComputed$ = (qrlFn: QRL<() => Promise<any>>) => {\n    const sig = useSignal();\n    useTask(({ track }) => {\n      const result = track(qrlFn);\n      if (result && 'then' in result) {\n        result.then(\n          (val) => (sig.value = val),\n          (err) => {\n            console.error('async computed function threw!', err);\n            throw error;\n          }\n        );\n      } else {\n        sig.value = result;\n      }\n    });\n    return sig;\n  };\n  ```\n\n- ✨ Expose `unwrapStore` as a low level AP (by [@GrandSchtroumpf](https://github.com/GrandSchtroumpf) in [#6960](https://github.com/QwikDev/qwik/pull/6960))\n\n  This enables developers to clone the content of a `useStore()` using `structureClone` or IndexedDB\n\n### Patch Changes\n\n- 📃 fix useResource docs example & remove unused demo (by [@ianlet](https://github.com/ianlet) in [#6893](https://github.com/QwikDev/qwik/pull/6893))\n\n- 🐞🩹 QRL segment filenames are no longer lowercased. This was giving trouble with parent lookups in dev mode and there was no good reason for it. (by [@wmertens](https://github.com/wmertens) in [#7003](https://github.com/QwikDev/qwik/pull/7003))\n\n- 🐞🩹 the type for `<textarea>` now accepts text children, as per spec. (by [@wmertens](https://github.com/wmertens) in [#7016](https://github.com/QwikDev/qwik/pull/7016))\n\n- 🐞🩹 dev-mode QRL paths are now handled by Vite so they are the same as the parent paths. You can see this in the Sources section of the browser devtools, where the segments are now always next to their parents (when the parent is loaded). (by [@wmertens](https://github.com/wmertens) in [#7037](https://github.com/QwikDev/qwik/pull/7037))\n\n- 🐞🩹 `vite` is now a peer dependency of `qwik`, `qwik-city`, `qwik-react` and `qwik-labs`, so that there can be no duplicate imports. This should not have consequences, since all apps also directly depend on `vite`. (by [@wmertens](https://github.com/wmertens) in [#6945](https://github.com/QwikDev/qwik/pull/6945))\n\n- ✨ sync$ QRLs will now be serialized into the HTML in a shorter form (by [@wmertens](https://github.com/wmertens) in [#6944](https://github.com/QwikDev/qwik/pull/6944))\n\n- 🐞🩹 cli build command appearing to \"hang\" on errors (by [@shairez](https://github.com/shairez) in [#6943](https://github.com/QwikDev/qwik/pull/6943))\n\n- ✨ Allow setting `linkFetchPriority` for modulepreload links in the prefetch strategy. Also fix the links in dev mode (by [@GrandSchtroumpf](https://github.com/GrandSchtroumpf) in [#6947](https://github.com/QwikDev/qwik/pull/6947))\n\n## 1.9.1\n\n### Patch Changes\n\n- ✨ showing qrl parent names. (by [@wmertens](https://github.com/wmertens) in [#6881](https://github.com/QwikDev/qwik/pull/6881))\n  in dev mode, qrl segments now start with their parent filename so it's easy to see where they came from. Furthermore, in production builds these filenames are also used so that origins in `q-manifest.json` are easy to understand.\n\n- 🐞🩹 Optimizer now ignores unknown deps in graph that caused crashes during build (by [@wmertens](https://github.com/wmertens) in [#6888](https://github.com/QwikDev/qwik/pull/6888))\n\n- 🐞🩹 Do not allow object methods to be serialized with style prop (by [@jakovljevic-mladen](https://github.com/jakovljevic-mladen) in [#6932](https://github.com/QwikDev/qwik/pull/6932))\n\n- 🐞🩹 In dev mode, changes to QRLs now explicitly invalidate the segment so that the browser will reload it (by [@wmertens](https://github.com/wmertens) in [#6938](https://github.com/QwikDev/qwik/pull/6938))\n\n## 1.9.0\n\n### Patch Changes\n\n- ✨ Introducing the `experimental[]` option to the Vite plugin. This allows you to opt in to features that are not guaranteed to have a stable API. (by [@wmertens](https://github.com/wmertens) in [#6880](https://github.com/QwikDev/qwik/pull/6880))\n\n- 🐞🩹 fix typo in using useStore() (by [@zaynet](https://github.com/zaynet) in [#6875](https://github.com/QwikDev/qwik/pull/6875))\n\n- 🐞🩹 gracefully handle image dimensions service errors (by [@JerryWu1234](https://github.com/JerryWu1234) in [#6855](https://github.com/QwikDev/qwik/pull/6855))\n\n- ✨ Lib builds no longer perform qwik transformation. (by [@wmertens](https://github.com/wmertens) in [#6850](https://github.com/QwikDev/qwik/pull/6850))\n\n  This prevents using unstable internal APIs, and doesn't make a difference for the end user. Library authors are strongly urged to push a new library patch version built with this qwik version, and to add `| ^2.0.0` to their accepted qwik version range.\n\n- 🐞🩹 SSG Link component strips search parameters (by [@JerryWu1234](https://github.com/JerryWu1234) in [#6778](https://github.com/QwikDev/qwik/pull/6778))\n\n- 🐞🩹 The PrefetchServiceWorker now has a more efficient graph and only prefetches direct imports and, at a lower priority, task QRL segments. This greatly improves its load performance. (by [@wmertens](https://github.com/wmertens) in [#6853](https://github.com/QwikDev/qwik/pull/6853))\n\n## 1.8.0\n\n### Minor Changes\n\n- Updated SWC parser means that the optimizer now understands `import ... with` syntax and that enums are replaced with numbers where possible. (by [@wmertens](https://github.com/wmertens) in [#6005](https://github.com/QwikDev/qwik/pull/6005))\n\n- The optimizer plugin will now rely on Rollup to group QRL segments. It will only provide hints on which segments fit well together. The result of this change is that now code splitting happens during the transform phase only, and other Rollup/Vite plugins (such as css-in-js plugins) can transform the code before Qwik transforms it. (by [@wmertens](https://github.com/wmertens) in [#6670](https://github.com/QwikDev/qwik/pull/6670))\n\n- The default asset filenames in the build have changed. Now they are under `assets/hash-name.ext`, so they are clearly separated from code. (by [@wmertens](https://github.com/wmertens) in [#5745](https://github.com/QwikDev/qwik/pull/5745))\n\n### Patch Changes\n\n- The `fileFilter` option to `qwikVite()` now always allows `*.qwik.{m,c,}js` files so that QRLs in libraries can be processed. (by [@wmertens](https://github.com/wmertens) in [#6760](https://github.com/QwikDev/qwik/pull/6760))\n\n## 1.7.3\n\n## 1.7.2\n\n### Patch Changes\n\n- Library builds now correctly generate \\_fnSignal calls again. Any Qwik library that exports components should be built again. (by [@wmertens](https://github.com/wmertens) in [#6732](https://github.com/QwikDev/qwik/pull/6732))\n\n- - built files are now under dist/ or lib/. All tools that respect package export maps should just work. (by [@wmertens](https://github.com/wmertens) in [#6715](https://github.com/QwikDev/qwik/pull/6715))\n    If you have trouble with Typescript, ensure that you use `moduleResolution: \"Bundler\"` in your `tsconfig.json`.\n  - `@builder.io/qwik` no longer depends on `undici`\n\n- fix dev mode on windows (by [@Varixo](https://github.com/Varixo) in [#6713](https://github.com/QwikDev/qwik/pull/6713))\n"
  },
  {
    "path": "packages/qwik/build.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './dist/build';\n"
  },
  {
    "path": "packages/qwik/global.d.ts",
    "content": "/* eslint-disable no-var */\n// Globals used by qwik, for internal use only\n\ntype ExperimentalFeatures = import('./src/optimizer/src/plugins/plugin').ExperimentalFeatures;\n\ndeclare var __EXPERIMENTAL__: {\n  [K in ExperimentalFeatures]: boolean;\n};\n"
  },
  {
    "path": "packages/qwik/jsx-dev-runtime.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './dist/jsx-runtime';\n"
  },
  {
    "path": "packages/qwik/jsx-runtime.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './dist/jsx-runtime';\n"
  },
  {
    "path": "packages/qwik/loader.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './dist/loader';\n"
  },
  {
    "path": "packages/qwik/optimizer.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './dist/optimizer';\n"
  },
  {
    "path": "packages/qwik/package.json",
    "content": "{\n  \"name\": \"@builder.io/qwik\",\n  \"description\": \"An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.\",\n  \"version\": \"1.19.0\",\n  \"annotation\": \"This package.json is for internal use in the monorepo, the build actually makes a new package.json for the published package via scripts/package-json.ts\",\n  \"bin\": {\n    \"qwik\": \"./qwik-cli.cjs\"\n  },\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"contributors\": [\n    {\n      \"name\": \"Miško Hevery\",\n      \"email\": \"misko@hevery.com\",\n      \"url\": \"https://github.com/QwikDev/qwik\"\n    },\n    {\n      \"name\": \"Adam Bradley\",\n      \"email\": \"adam@builder.io\",\n      \"url\": \"https://twitter.com/adamdbradley\"\n    },\n    {\n      \"name\": \"Manu Mtz.-Almeida\",\n      \"email\": \"manu@builder.io\",\n      \"url\": \"https://twitter.com/manucorporat\"\n    }\n  ],\n  \"dependencies\": {\n    \"csstype\": \"^3.1.3\",\n    \"launch-editor\": \"^2.11.1\",\n    \"rollup\": \"^4.59.0\"\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@croct/json5-parser\": \"0.2.1\",\n    \"domino\": \"2.1.6\",\n    \"ignore\": \"5.3.1\",\n    \"image-size\": \"1.2.1\",\n    \"kleur\": \"4.1.5\",\n    \"ts-morph\": \"23.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./dist/core.d.ts\",\n      \"import\": {\n        \"development\": \"./dist/core.mjs\",\n        \"production\": \"./dist/core.prod.mjs\",\n        \"min\": \"./dist/core.min.mjs\",\n        \"default\": \"./dist/core.prod.mjs\"\n      },\n      \"require\": {\n        \"development\": \"./dist/core.cjs\",\n        \"production\": \"./dist/core.prod.cjs\",\n        \"default\": \"./dist/core.prod.cjs\"\n      }\n    },\n    \"./cli\": {\n      \"require\": \"./dist/cli.cjs\"\n    },\n    \"./jsx-runtime\": {\n      \"types\": \"./dist/jsx-runtime.d.ts\",\n      \"import\": {\n        \"development\": \"./dist/core.mjs\",\n        \"production\": \"./dist/core.prod.mjs\",\n        \"min\": \"./dist/core.min.mjs\",\n        \"default\": \"./dist/core.prod.mjs\"\n      },\n      \"require\": {\n        \"development\": \"./dist/core.cjs\",\n        \"production\": \"./dist/core.prod.cjs\",\n        \"default\": \"./dist/core.prod.cjs\"\n      }\n    },\n    \"./jsx-dev-runtime\": {\n      \"types\": \"./dist/jsx-runtime.d.ts\",\n      \"import\": {\n        \"development\": \"./dist/core.mjs\",\n        \"production\": \"./dist/core.prod.mjs\",\n        \"min\": \"./dist/core.min.mjs\",\n        \"default\": \"./dist/core.mjs\"\n      },\n      \"require\": {\n        \"development\": \"./dist/core.cjs\",\n        \"production\": \"./dist/core.prod.cjs\",\n        \"default\": \"./dist/core.cjs\"\n      }\n    },\n    \"./build\": {\n      \"types\": \"./dist/build/index.d.ts\",\n      \"import\": {\n        \"development\": \"./dist/build/index.dev.mjs\",\n        \"production\": \"./dist/build/index.prod.mjs\",\n        \"default\": \"./dist/build/index.mjs\"\n      },\n      \"require\": {\n        \"development\": \"./dist/build/index.dev.cjs\",\n        \"production\": \"./dist/build/index.prod.cjs\",\n        \"default\": \"./dist/build/index.cjs\"\n      }\n    },\n    \"./loader\": {\n      \"types\": \"./dist/loader/index.d.ts\",\n      \"import\": \"./dist/loader/index.mjs\",\n      \"require\": \"./dist/loader/index.cjs\"\n    },\n    \"./optimizer.cjs\": \"./dist/optimizer.cjs\",\n    \"./optimizer.mjs\": \"./dist/optimizer.mjs\",\n    \"./optimizer\": {\n      \"types\": \"./dist/optimizer.d.ts\",\n      \"import\": \"./dist/optimizer.mjs\",\n      \"require\": \"./dist/optimizer.cjs\"\n    },\n    \"./preloader\": {\n      \"import\": \"./dist/preloader.mjs\",\n      \"require\": \"./dist/preloader.cjs\"\n    },\n    \"./server.cjs\": \"./dist/server.cjs\",\n    \"./server.mjs\": \"./dist/server.mjs\",\n    \"./server\": {\n      \"types\": \"./dist/server.d.ts\",\n      \"import\": \"./dist/server.mjs\",\n      \"require\": \"./dist/server.cjs\"\n    },\n    \"./testing\": {\n      \"types\": \"./dist/testing/index.d.ts\",\n      \"import\": \"./dist/testing/index.mjs\",\n      \"require\": \"./dist/testing/index.cjs\"\n    },\n    \"./qwikloader.js\": \"./dist/qwikloader.js\",\n    \"./qwikloader.debug.js\": \"./dist/qwikloader.debug.js\",\n    \"./package.json\": \"./dist/package.json\"\n  },\n  \"files\": [\n    \"README.md\",\n    \"LICENSE\",\n    \"dist\",\n    \"bindings\",\n    \"build.d.ts\",\n    \"cli.d.ts\",\n    \"jsx-dev-runtime.d.ts\",\n    \"jsx-runtime.d.ts\",\n    \"loader.d.ts\",\n    \"optimizer.d.ts\",\n    \"server.d.ts\",\n    \"testing.d.ts\",\n    \"qwik-cli.cjs\"\n  ],\n  \"homepage\": \"https://qwik.dev/\",\n  \"keywords\": [\n    \"Builder.io\",\n    \"framework\",\n    \"generator\",\n    \"prerender\",\n    \"server-side-render\",\n    \"ssg\",\n    \"ssr\",\n    \"static-site\",\n    \"static-site-generator\",\n    \"webapp\",\n    \"website\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"./dist/core.mjs\",\n  \"peerDependencies\": {\n    \"vite\": \">=5 <8\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/qwik\"\n  },\n  \"sideEffects\": false,\n  \"type\": \"module\",\n  \"types\": \"./dist/core.d.ts\"\n}\n"
  },
  {
    "path": "packages/qwik/qwik-cli.cjs",
    "content": "#!/usr/bin/env node\n// This requires the build to be run first.\nconst qwik = require('./dist/cli.cjs');\nqwik.runCli();\n"
  },
  {
    "path": "packages/qwik/server.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './dist/server';\n"
  },
  {
    "path": "packages/qwik/src/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"mainEntryPointFilePath\": \"will be set by the configs that import this file\",\n  \"bundledPackages\": [],\n  \"compiler\": {\n    \"overrideTsconfig\": {\n      \"compilerOptions\": {\n        \"target\": \"ES2020\",\n        \"module\": \"ES2020\",\n        \"resolveJsonModule\": true,\n        \"isolatedModules\": true,\n        \"moduleResolution\": \"Bundler\",\n        \"skipLibCheck\": true\n      },\n      \"include\": [\"../../dist-dev/dts-out/packages/qwik/src\"]\n    }\n  },\n  \"docModel\": {\n    \"enabled\": false\n  },\n  \"dtsRollup\": {\n    \"enabled\": false\n  },\n  \"tsdocMetadata\": {\n    \"enabled\": false\n  },\n  \"messages\": {\n    \"compilerMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    },\n    \"extractorMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    },\n    \"tsdocMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/build/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik/src/build/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik.build\",\n    \"reportFolder\": \"<projectFolder>/src/build/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/build/\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/dist/build/index.d.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/build/index.dev.ts",
    "content": "export { isBrowser, isServer } from '.';\n\n/**\n * True when build is in dev mode.\n *\n * @public\n */\nexport const isDev: boolean = true;\n"
  },
  {
    "path": "packages/qwik/src/build/index.prod.ts",
    "content": "export { isBrowser, isServer } from './index';\n\n/**\n * True when build is in dev mode.\n *\n * @public\n */\nexport const isDev: boolean = false;\n"
  },
  {
    "path": "packages/qwik/src/build/index.ts",
    "content": "/**\n * True when build is made for browser, client-side execution.\n *\n * @public\n */\nexport const isBrowser: boolean = /*#__PURE__*/ (() =>\n  typeof window !== 'undefined' &&\n  typeof HTMLElement !== 'undefined' &&\n  !!window.document &&\n  String(HTMLElement).includes('[native code]'))();\n\n/**\n * True when build is made for SSR purposes.\n *\n * @public\n */\nexport const isServer: boolean = !isBrowser;\n\n/**\n * True when build is in dev mode.\n *\n * @public\n */\nexport const isDev: boolean = /*#__PURE__*/ (() => {\n  return (globalThis as any).qDev === true;\n})();\n"
  },
  {
    "path": "packages/qwik/src/build/qwik.build.api.md",
    "content": "## API Report File for \"@builder.io/qwik\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n// @public\nexport const isBrowser: boolean;\n\n// @public\nexport const isDev: boolean;\n\n// @public\nexport const isServer: boolean;\n\n// (No @packageDocumentation comment for this package)\n```\n"
  },
  {
    "path": "packages/qwik/src/cli/add/print-add-help.ts",
    "content": "import { magenta, dim } from 'kleur/colors';\nimport { loadIntegrations, sortIntegrationsAndReturnAsClackOptions } from '../utils/integrations';\nimport { pmRunCmd, note, bye, limitLength } from '../utils/utils';\nimport { confirm, intro, isCancel, select } from '@clack/prompts';\nimport type { IntegrationData } from '../types';\nimport type { AppCommand } from '../utils/app-command';\nimport { runAddInteractive } from './run-add-interactive';\n\nconst SPACE_TO_HINT = 25;\nconst MAX_HINT_LENGTH = 50;\n\nfunction renderIntegration(integrations: IntegrationData[]) {\n  return integrations\n    .map((integration) => {\n      const hint = limitLength(integration.pkgJson.description, MAX_HINT_LENGTH);\n      return (\n        integration.id + ' '.repeat(Math.max(SPACE_TO_HINT - integration.id.length, 2)) + dim(hint)\n      );\n    })\n    .join('\\n');\n}\n\nexport async function printAddHelp(app: AppCommand) {\n  const integrations = await loadIntegrations();\n  const adapters = integrations.filter((i) => i.type === 'adapter');\n  const features = integrations.filter((i) => i.type === 'feature');\n  const pmRun = pmRunCmd();\n\n  intro(`${pmRun} qwik ${magenta(`add`)} [integration]`);\n\n  note(renderIntegration(adapters), 'Adapters');\n  note(renderIntegration(features), 'Features');\n\n  const proceed = await confirm({\n    message: 'Do you want to install an integration?',\n    initialValue: true,\n  });\n\n  if (isCancel(proceed) || !proceed) {\n    bye();\n  }\n\n  const command = await select({\n    message: 'Select an integration',\n    options: await sortIntegrationsAndReturnAsClackOptions(integrations),\n  });\n\n  if (isCancel(command)) {\n    bye();\n  }\n\n  runAddInteractive(app, command as string);\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/add/run-add-command.ts",
    "content": "import type { AppCommand } from '../utils/app-command';\nimport { red } from 'kleur/colors';\nimport { runAddInteractive } from './run-add-interactive';\nimport { printAddHelp } from './print-add-help';\n\nexport async function runAddCommand(app: AppCommand) {\n  try {\n    const id = app.args[1];\n    if (id === 'help') {\n      await printAddHelp(app);\n    } else {\n      await runAddInteractive(app, id);\n    }\n  } catch (e) {\n    console.error(`❌ ${red(String(e))}\\n`);\n    process.exit(1);\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/add/run-add-interactive.ts",
    "content": "import { intro, isCancel, log, outro, select, spinner } from '@clack/prompts';\nimport { bgBlue, bgMagenta, blue, bold, cyan, magenta } from 'kleur/colors';\nimport type { IntegrationData, UpdateAppOptions, UpdateAppResult } from '../types';\nimport { loadIntegrations, sortIntegrationsAndReturnAsClackOptions } from '../utils/integrations';\nimport { bye, getPackageManager, note, panic } from '../utils/utils';\n\nimport { relative } from 'node:path';\nimport type { AppCommand } from '../utils/app-command';\nimport { runInPkg } from '../utils/install-deps';\nimport { logNextStep } from '../utils/log';\nimport { updateApp } from './update-app';\n\nexport async function runAddInteractive(app: AppCommand, id: string | undefined) {\n  const pkgManager = getPackageManager();\n  const integrations = await loadIntegrations();\n  let integration: IntegrationData | undefined;\n\n  if (typeof id === 'string') {\n    // cli passed a flag with the integration id to add\n    integration = integrations.find((i) => i.id === id);\n    if (!integration) {\n      throw new Error(`Invalid integration: ${id}`);\n    }\n\n    intro(`🦋 ${bgBlue(` Add Integration `)} ${bold(magenta(integration.id))}`);\n  } else {\n    // use interactive cli to choose which integration to add\n    intro(`🦋 ${bgBlue(` Add Integration `)}`);\n\n    const integrationChoices = [\n      ...integrations.filter((i) => i.type === 'adapter'),\n      ...integrations.filter((i) => i.type === 'feature'),\n    ];\n\n    const integrationAnswer = await select({\n      message: 'What integration would you like to add?',\n      options: await sortIntegrationsAndReturnAsClackOptions(integrationChoices),\n    });\n\n    if (isCancel(integrationAnswer)) {\n      bye();\n    }\n\n    integration = integrations.find((i) => i.id === integrationAnswer);\n\n    if (!integration) {\n      throw new Error(`Invalid integration: ${id}`);\n    }\n  }\n\n  const integrationHasDeps =\n    Object.keys({\n      ...integration.pkgJson.dependencies,\n      ...integration.pkgJson.devDependencies,\n    }).length > 0;\n\n  let runInstall = false;\n  if (integrationHasDeps) {\n    runInstall = true;\n  }\n\n  const updateAppOptions: UpdateAppOptions = {\n    rootDir: app.rootDir,\n    integration: integration.id,\n    installDeps: runInstall,\n  };\n  const projectDir = app.getArg('projectDir');\n  if (projectDir) {\n    updateAppOptions.projectDir = projectDir;\n  }\n\n  const result = await updateApp(pkgManager, updateAppOptions);\n\n  if (app.getArg('skipConfirmation') !== 'true') {\n    await logUpdateAppResult(pkgManager, result);\n  }\n  await result.commit(true);\n  const postInstall = result.integration.pkgJson.__qwik__?.postInstall;\n  if (postInstall) {\n    const s = spinner();\n    s.start(`Running post install script: ${postInstall}`);\n    await runInPkg(pkgManager, postInstall.split(' '), app.rootDir);\n    s.stop('Post install script complete');\n  }\n  logUpdateAppCommitResult(result, pkgManager);\n\n  // close the process\n  process.exit(0);\n}\n\nasync function logUpdateAppResult(pkgManager: string, result: UpdateAppResult) {\n  const modifyFiles = result.updates.files.filter((f) => f.type === 'modify');\n  const overwriteFiles = result.updates.files.filter((f) => f.type === 'overwrite');\n  const createFiles = result.updates.files.filter((f) => f.type === 'create');\n  const installDepNames = Object.keys(result.updates.installedDeps);\n  const installScripts = result.updates.installedScripts;\n\n  const installDeps = installDepNames.length > 0;\n\n  if (\n    modifyFiles.length === 0 &&\n    overwriteFiles.length === 0 &&\n    createFiles.length === 0 &&\n    installScripts.length === 0 &&\n    !installDeps\n  ) {\n    panic(`No updates made`);\n  }\n\n  log.step(`👻 ${bgBlue(` Ready? `)} Add ${bold(magenta(result.integration.id))} to your app?`);\n\n  if (modifyFiles.length > 0) {\n    log.message(\n      [\n        `🐬 ${cyan('Modify')}`,\n        ...modifyFiles.map((f) => `   - ${relative(process.cwd(), f.path)}`),\n      ].join('\\n')\n    );\n  }\n\n  if (createFiles.length > 0) {\n    log.message(\n      [\n        `🌟 ${cyan(`Create`)}`,\n        ...createFiles.map((f) => `   - ${relative(process.cwd(), f.path)}`),\n      ].join('\\n')\n    );\n  }\n\n  if (overwriteFiles.length > 0) {\n    log.message(\n      [\n        `🐳 ${cyan(`Overwrite`)}`,\n        ...overwriteFiles.map((f) => `   - ${relative(process.cwd(), f.path)}`),\n      ].join('\\n')\n    );\n  }\n\n  if (installDepNames.length > 0) {\n    log.message(\n      [\n        `💾 ${cyan(`Install ${pkgManager} dependenc${installDepNames.length > 1 ? 'ies' : 'y'}:`)}`,\n        ...installDepNames.map(\n          (depName) => `   - ${depName} ${result.updates.installedDeps[depName]}`\n        ),\n      ].join('\\n')\n    );\n  }\n\n  if (installScripts.length > 0) {\n    const prefix = pkgManager === 'npm' ? 'npm run' : pkgManager;\n    log.message(\n      [\n        `📜 ${cyan(`New ${pkgManager} script${installDepNames.length > 1 ? 's' : ''}:`)}`,\n        ...installScripts.map((script) => `   - ${prefix} ${script}`),\n      ].join('\\n')\n    );\n  }\n\n  const commit = await select({\n    message: `Ready to apply the ${bold(magenta(result.integration.id))} updates to your app?`,\n    options: [\n      { label: 'Yes looks good, finish update!', value: true },\n      { label: 'Nope, cancel update', value: false },\n    ],\n  });\n\n  if (isCancel(commit) || !commit) {\n    bye();\n  }\n}\n\nfunction logUpdateAppCommitResult(result: UpdateAppResult, pkgManager: string) {\n  if (result.updates.installedScripts.length > 0) {\n    const prefix = pkgManager === 'npm' || pkgManager === 'bun' ? `${pkgManager} run` : pkgManager;\n    const message = result.updates.installedScripts\n      .map((script) => `- ${prefix} ${blue(script)}`)\n      .join('\\n');\n    note(message, 'New scripts added');\n  }\n\n  const nextSteps = result.integration.pkgJson.__qwik__?.nextSteps;\n  if (nextSteps) {\n    const noteMessage = `🟣 ${bgMagenta(` ${nextSteps.title ?? 'Action Required!'} `)}`;\n    note(logNextStep(nextSteps, pkgManager), noteMessage);\n  }\n\n  outro(`🦄 ${bgMagenta(` Success! `)} Added ${bold(cyan(result.integration.id))} to your app`);\n\n  // TODO: `logSuccessFooter` returns a string, but we don't use it!\n  // logSuccessFooter(result.integration.docs);\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/add/update-app.ts",
    "content": "import { log, spinner } from '@clack/prompts';\nimport { bgRed, cyan } from 'kleur/colors';\nimport fs from 'node:fs';\nimport { dirname } from 'node:path';\nimport type { FsUpdates, UpdateAppOptions, UpdateAppResult } from '../types';\nimport { installDeps } from '../utils/install-deps';\nimport { loadIntegrations } from '../utils/integrations';\nimport { panic } from '../utils/utils';\nimport { mergeIntegrationDir } from './update-files';\nimport { updateViteConfigs } from './update-vite-config';\n\nexport async function updateApp(pkgManager: string, opts: UpdateAppOptions) {\n  const integrations = await loadIntegrations();\n  const integration = integrations.find((s) => s.id === opts.integration);\n  if (!integration) {\n    throw new Error(`Unable to find integration \"${opts.integration}\"`);\n  }\n\n  const fileUpdates: FsUpdates = {\n    files: [],\n    installedDeps: {},\n    installedScripts: Object.keys(integration.pkgJson.scripts || {}),\n  };\n\n  if (opts.installDeps) {\n    fileUpdates.installedDeps = {\n      ...integration.pkgJson.dependencies,\n      ...integration.pkgJson.devDependencies,\n    };\n  }\n\n  await mergeIntegrationDir(\n    fileUpdates,\n    opts,\n    integration.dir,\n    opts.rootDir,\n    integration.alwaysInRoot\n  );\n\n  if ((globalThis as any).CODE_MOD) {\n    await updateViteConfigs(fileUpdates, integration, opts.rootDir);\n  }\n\n  const commit = async (showSpinner?: boolean) => {\n    const isInstallingDeps = Object.keys(fileUpdates.installedDeps).length > 0;\n\n    const s = spinner();\n    if (showSpinner) {\n      s.start(`Updating app${isInstallingDeps ? ' and installing dependencies' : ''}...`);\n    }\n\n    let passed = true;\n    try {\n      const dirs = new Set(fileUpdates.files.map((f) => dirname(f.path)));\n      for (const dir of Array.from(dirs)) {\n        try {\n          fs.mkdirSync(dir, { recursive: true });\n        } catch (e) {\n          //\n        }\n      }\n\n      const fsWrites = Promise.all(\n        fileUpdates.files.map(async (f) => {\n          await fs.promises.writeFile(f.path, f.content);\n        })\n      );\n\n      if (opts.installDeps && Object.keys(fileUpdates.installedDeps).length > 0) {\n        const { install } = installDeps(pkgManager, opts.rootDir);\n        passed = await install;\n      }\n\n      await fsWrites;\n\n      showSpinner && s.stop('App updated');\n\n      if (!passed) {\n        const errorMessage = `${bgRed(\n          ` ${pkgManager} install failed `\n        )}\\n You might need to run \"${cyan(\n          `${pkgManager} install`\n        )}\" manually inside the root of the project.`;\n\n        log.error(errorMessage);\n      }\n    } catch (e) {\n      showSpinner && s.stop('App updated');\n      panic(String(e));\n    }\n  };\n\n  const result: UpdateAppResult = {\n    rootDir: opts.rootDir,\n    integration,\n    updates: fileUpdates,\n    commit,\n  };\n  return result;\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/add/update-files.ts",
    "content": "import { JsonParser, JsonObjectNode } from '@croct/json5-parser';\nimport fs from 'node:fs';\nimport { extname, join } from 'node:path';\nimport type { FsUpdates, UpdateAppOptions } from '../types';\nimport { getPackageManager } from '../utils/utils';\n\nexport async function mergeIntegrationDir(\n  fileUpdates: FsUpdates,\n  opts: UpdateAppOptions,\n  srcDir: string,\n  destDir: string,\n  alwaysInRoot?: string[]\n) {\n  const items = await fs.promises.readdir(srcDir);\n  await Promise.all(\n    items.map(async (itemName) => {\n      const destName = itemName === 'gitignore' ? '.gitignore' : itemName;\n      const ext = extname(destName);\n      const srcChildPath = join(srcDir, itemName);\n\n      const destRootPath = join(destDir, destName);\n\n      const s = await fs.promises.stat(srcChildPath);\n\n      if (s.isDirectory()) {\n        await mergeIntegrationDir(fileUpdates, opts, srcChildPath, destRootPath, alwaysInRoot);\n      } else if (s.isFile()) {\n        const finalDestPath = getFinalDestPath(opts, destRootPath, destDir, destName, alwaysInRoot);\n\n        if (destName === 'package.json') {\n          await mergePackageJsons(fileUpdates, srcChildPath, destRootPath);\n        } else if (destDir.endsWith('.vscode') && destName === 'settings.json') {\n          await mergeVSCodeSettings(fileUpdates, srcChildPath, finalDestPath);\n        } else if (destName === 'README.md') {\n          await mergeReadmes(fileUpdates, srcChildPath, finalDestPath);\n        } else if (\n          destName === '.gitignore' ||\n          destName === '.prettierignore' ||\n          destName === '.eslintignore'\n        ) {\n          await mergeIgnoresFile(fileUpdates, srcChildPath, destRootPath);\n        } else if (ext === '.css') {\n          await mergeCss(fileUpdates, srcChildPath, finalDestPath, opts);\n        } else if (fs.existsSync(finalDestPath)) {\n          fileUpdates.files.push({\n            path: finalDestPath,\n            content: await fs.promises.readFile(srcChildPath),\n            type: 'overwrite',\n          });\n        } else {\n          fileUpdates.files.push({\n            path: finalDestPath,\n            content: await fs.promises.readFile(srcChildPath),\n            type: 'create',\n          });\n        }\n      }\n    })\n  );\n}\n\nfunction getFinalDestPath(\n  opts: UpdateAppOptions,\n  destRootPath: string,\n  destDir: string,\n  destName: string,\n  alwaysInRoot?: string[]\n) {\n  // If the integration has a projectDir, copy the files to the projectDir\n  // Unless that path is part of \"alwaysInRoot\"\n  const projectDir = opts.projectDir ? opts.projectDir : '';\n  const rootDirEndIndex = destDir.indexOf(opts.rootDir) + opts.rootDir.length;\n  const destWithoutRoot = destDir.slice(rootDirEndIndex);\n\n  const destChildPath = join(opts.rootDir, projectDir, destWithoutRoot, destName);\n\n  const finalDestPath =\n    alwaysInRoot &&\n    alwaysInRoot.some((rootItem) => destName.includes(rootItem) || destDir.includes(rootItem))\n      ? destRootPath\n      : destChildPath;\n\n  return finalDestPath;\n}\n\nasync function mergePackageJsons(fileUpdates: FsUpdates, srcPath: string, destPath: string) {\n  const srcContent = await fs.promises.readFile(srcPath, 'utf-8');\n  try {\n    const srcPkgJson = JSON.parse(srcContent);\n    const props = ['scripts', 'dependencies', 'devDependencies'];\n    const destPkgJson = JSON.parse(await fs.promises.readFile(destPath, 'utf-8'));\n    props.forEach((prop) => {\n      mergePackageJsonSort(srcPkgJson, destPkgJson, prop);\n    });\n    if (destPkgJson.scripts?.qwik) {\n      const qwikVal = destPkgJson.scripts.qwik;\n      delete destPkgJson.scripts.qwik;\n      destPkgJson.scripts.qwik = qwikVal;\n    }\n    fileUpdates.files.push({\n      path: destPath,\n      content: JSON.stringify(destPkgJson, null, 2) + '\\n',\n      type: 'modify',\n    });\n  } catch (e) {\n    fileUpdates.files.push({\n      path: destPath,\n      content: srcContent,\n      type: 'create',\n    });\n  }\n}\n\nasync function mergeVSCodeSettings(fileUpdates: FsUpdates, srcPath: string, destPath: string) {\n  const srcContent = await fs.promises.readFile(srcPath, 'utf-8');\n  try {\n    const srcPkgJson = JsonParser.parse(srcContent, JsonObjectNode);\n    const destPkgJson = JsonParser.parse(\n      await fs.promises.readFile(destPath, 'utf-8'),\n      JsonObjectNode\n    );\n    destPkgJson.merge(srcPkgJson);\n\n    fileUpdates.files.push({\n      path: destPath,\n      content: destPkgJson.toString() + '\\n',\n      type: 'modify',\n    });\n  } catch (e) {\n    fileUpdates.files.push({\n      path: destPath,\n      content: srcContent,\n      type: 'create',\n    });\n  }\n}\n\nfunction mergePackageJsonSort(src: any, dest: any, prop: string) {\n  if (src[prop]) {\n    if (dest[prop]) {\n      Object.assign(dest[prop], { ...src[prop] });\n    } else {\n      dest[prop] = { ...src[prop] };\n    }\n\n    const sorted: any = {};\n    const keys = Object.keys(dest[prop]).sort();\n    for (const key of keys) {\n      sorted[key] = dest[prop][key];\n    }\n    dest[prop] = sorted;\n  }\n}\n\nasync function mergeReadmes(fileUpdates: FsUpdates, srcPath: string, destPath: string) {\n  const srcContent = await fs.promises.readFile(srcPath, 'utf-8');\n\n  let type: 'create' | 'modify';\n  let destContent = '';\n  try {\n    destContent = await fs.promises.readFile(destPath, 'utf-8');\n    destContent = destContent.trim() + '\\n\\n' + srcContent;\n    type = 'modify';\n  } catch (e) {\n    destContent = srcContent;\n    type = 'create';\n  }\n\n  const pkgManager = getPackageManager();\n  if (pkgManager !== 'npm') {\n    destContent = destContent.replace(/\\b(npm run|pnpm run|yarn( run)?)\\b/g, pkgManager);\n  }\n\n  fileUpdates.files.push({\n    path: destPath,\n    content: destContent.trim() + '\\n',\n    type,\n  });\n}\n\nasync function mergeIgnoresFile(fileUpdates: FsUpdates, srcPath: string, destPath: string) {\n  const srcContent = await fs.promises.readFile(srcPath, 'utf-8');\n\n  try {\n    const destContent = await fs.promises.readFile(destPath, 'utf-8');\n    const srcLines = srcContent.trim().split(/\\r?\\n/);\n    const destLines = destContent.trim().split(/\\r?\\n/);\n    for (const srcLine of srcLines) {\n      if (!destLines.includes(srcLine)) {\n        if (srcLine.startsWith('#')) {\n          destLines.push('');\n        }\n        destLines.push(srcLine);\n      }\n    }\n    fileUpdates.files.push({\n      path: destPath,\n      content: destLines.join('\\n').trim() + '\\n',\n      type: 'modify',\n    });\n  } catch (e) {\n    fileUpdates.files.push({\n      path: destPath,\n      content: srcContent,\n      type: 'create',\n    });\n  }\n}\n\nasync function mergeCss(\n  fileUpdates: FsUpdates,\n  srcPath: string,\n  destPath: string,\n  opts: UpdateAppOptions\n) {\n  const srcContent = await fs.promises.readFile(srcPath, 'utf-8');\n\n  try {\n    // css file already exists, prepend the src to the dest file\n    const destContent = await fs.promises.readFile(destPath, 'utf-8');\n    const mergedContent = srcContent.trim() + '\\n\\n' + destContent.trim() + '\\n';\n\n    const isAddingLibrary = opts.installDeps === true;\n    // When it's integrating a css library, use merge strategy\n    // Otherwise, it's initializing a new Qwik project, use overwrite strategy\n    fileUpdates.files.push({\n      path: destPath,\n      content: isAddingLibrary ? mergedContent : srcContent,\n      type: isAddingLibrary ? 'modify' : 'overwrite',\n    });\n  } catch (e) {\n    // css file doesn't already exist, just copy it over\n    fileUpdates.files.push({\n      path: destPath,\n      content: srcContent,\n      type: 'create',\n    });\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/add/update-files.unit.ts",
    "content": "import { JsonObjectNode, JsonParser } from '@croct/json5-parser';\nimport { fs } from 'memfs';\nimport { join } from 'path';\nimport { describe, expect, test, vi } from 'vitest';\nimport type { FsUpdates, UpdateAppOptions } from '../types';\nimport { mergeIntegrationDir } from './update-files';\n\nvi.mock('node:fs', () => ({\n  default: fs,\n}));\n\nfunction setup() {\n  const fakeSrcDir = 'srcDir/subSrcDir';\n  createFakeFiles(fakeSrcDir);\n\n  const fakeDestDir = 'destDir/subDestDir';\n\n  const fakeFileUpdates: FsUpdates = {\n    files: [],\n    installedDeps: {},\n    installedScripts: [],\n  };\n\n  const fakeOpts: UpdateAppOptions = {\n    rootDir: fakeDestDir,\n    integration: 'integration',\n  };\n\n  return {\n    fakeSrcDir,\n    fakeDestDir,\n    fakeFileUpdates,\n    fakeOpts,\n  };\n}\n\nfunction createFakeFiles(dir: string) {\n  // Create fake src files\n  fs.mkdirSync(join(dir, 'src'), { recursive: true });\n  fs.writeFileSync(join(dir, 'fake.ts'), 'fake file');\n  fs.writeFileSync(join(dir, 'package.json'), '{\"name\": \"fake\"}');\n  fs.writeFileSync(join(dir, 'src', 'global.css'), 'p{color: red}');\n  fs.mkdirSync(join(dir, '.vscode'), { recursive: true });\n  const settings = JsonParser.parse<JsonObjectNode>(\n    `{\n          // Comment\n          \"name\": \"John Doe\",\n          \"age\": 42,\n      }`,\n    JsonObjectNode\n  );\n  fs.writeFileSync(join(dir, '.vscode', 'settings.json'), settings.toString());\n}\n\ndescribe('mergeIntegrationDir', () => {\n  test('should merge integration directory', async () => {\n    const { fakeSrcDir, fakeDestDir, fakeFileUpdates, fakeOpts } = setup();\n\n    await mergeIntegrationDir(fakeFileUpdates, fakeOpts, fakeSrcDir, fakeDestDir);\n\n    const actualResults = fakeFileUpdates.files.map((f) => f.path);\n    const expectedResults = [\n      'destDir/subDestDir/fake.ts',\n      'destDir/subDestDir/package.json',\n      'destDir/subDestDir/.vscode/settings.json',\n      'destDir/subDestDir/src/global.css',\n    ];\n\n    expect(actualResults).toEqual(expectedResults);\n  });\n\n  test('should merge integration directory in a monorepo', async () => {\n    const { fakeSrcDir, fakeDestDir, fakeFileUpdates, fakeOpts } = setup();\n\n    // Create a global file in the destination director\n    const monorepoSubDir = join(fakeDestDir, 'apps', 'subpackage', 'src');\n    fs.mkdirSync(monorepoSubDir, { recursive: true });\n    fs.writeFileSync(join(monorepoSubDir, 'global.css'), '/* CSS */');\n    const settings = JsonParser.parse<JsonObjectNode>(\n      `{ \n          // Comment Foo\n          \"css.lint.unknownAtRules\": \"ignore\"\n      }`,\n      JsonObjectNode\n    );\n    fs.mkdirSync(join(fakeDestDir, 'apps', 'subpackage', '.vscode'));\n    fs.writeFileSync(\n      join(fakeDestDir, 'apps', 'subpackage', '.vscode', 'settings.json'),\n      settings.toString()\n    );\n\n    // Add a file that should stay in the root\n    fs.writeFileSync(join(fakeSrcDir, 'should-stay-in-root.ts'), 'fake file');\n\n    // Creating a folder that should stay in the root\n    fs.mkdirSync(join(fakeSrcDir, 'should-stay'), { recursive: true });\n    fs.writeFileSync(join(fakeSrcDir, 'should-stay', 'should-also-stay.ts'), 'fake file');\n\n    fakeOpts.projectDir = 'apps/subpackage';\n    fakeOpts.installDeps = true;\n    const fakeAlwaysInRoot = ['should-stay-in-root.ts', 'should-stay'];\n\n    await mergeIntegrationDir(fakeFileUpdates, fakeOpts, fakeSrcDir, fakeDestDir, fakeAlwaysInRoot);\n\n    const actualResults = fakeFileUpdates.files.map((f) => f.path);\n    const expectedResults = [\n      `destDir/subDestDir/apps/subpackage/fake.ts`,\n      `destDir/subDestDir/should-stay-in-root.ts`,\n      `destDir/subDestDir/package.json`,\n      `destDir/subDestDir/should-stay/should-also-stay.ts`,\n      'destDir/subDestDir/apps/subpackage/.vscode/settings.json',\n      `destDir/subDestDir/apps/subpackage/src/global.css`,\n    ];\n\n    expect(actualResults).toEqual(expectedResults);\n\n    const tests = {\n      'destDir/subDestDir/apps/subpackage/fake.ts': 'fake file',\n      'destDir/subDestDir/should-stay-in-root.ts': 'fake file',\n      'destDir/subDestDir/package.json': '{\"name\": \"fake\"}',\n      'destDir/subDestDir/should-stay/should-also-stay.ts': 'fake file',\n      'destDir/subDestDir/apps/subpackage/.vscode/settings.json':\n        '{ \\n          // Comment Foo\\n          \"css.lint.unknownAtRules\": \"ignore\",\\n          // Comment\\n          \"name\": \"John Doe\",\\n          \"age\": 42,\\n      }\\n',\n      'destDir/subDestDir/apps/subpackage/src/global.css': 'p{color: red}\\n\\n/* CSS */\\n',\n    };\n    for (const [fileName, content] of Object.entries(tests)) {\n      const file = fakeFileUpdates.files.find((f) => f.path === fileName);\n      expect(file?.content.toString()).toBe(content);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/cli/add/update-vite-config.ts",
    "content": "import type { FsUpdates, IntegrationData } from '../types';\nimport fs from 'fs';\nimport { join } from 'path';\nimport { updateViteConfig } from '../code-mod/code-mod';\nimport type { Options } from 'prettier';\nimport { panic } from '../utils/utils';\n\nexport async function updateViteConfigs(\n  fileUpdates: FsUpdates,\n  integration: IntegrationData,\n  rootDir: string\n) {\n  try {\n    const viteConfig = integration.pkgJson.__qwik__?.viteConfig;\n    if (viteConfig) {\n      let viteConfigPath = join(rootDir, 'vite.config.ts');\n      if (!fs.existsSync(viteConfigPath)) {\n        viteConfigPath = join(rootDir, 'vite.config.mts');\n      }\n      if (!fs.existsSync(viteConfigPath)) {\n        throw new Error(`Could not find vite.config.ts or vite.config.mts in ${rootDir}`);\n      }\n      const destContent = await fs.promises.readFile(viteConfigPath, 'utf-8');\n\n      const ts = (await import('typescript')).default;\n      let updatedContent = updateViteConfig(ts, destContent, viteConfig);\n\n      if (updatedContent) {\n        try {\n          const prettier = (await import('prettier')).default;\n\n          let prettierOpts: Options = {\n            filepath: viteConfigPath,\n          };\n\n          const opts = await prettier.resolveConfig(viteConfigPath);\n          if (opts) {\n            prettierOpts = { ...opts, ...prettierOpts };\n          }\n\n          updatedContent = await prettier.format(updatedContent, prettierOpts);\n\n          updatedContent = updatedContent.replace(`export default`, `\\nexport default`);\n        } catch (e) {\n          console.error(e);\n        }\n\n        fileUpdates.files.push({\n          path: viteConfigPath,\n          content: updatedContent,\n          type: 'modify',\n        });\n      }\n    }\n  } catch (e) {\n    panic(String(e));\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/check-client/index.ts",
    "content": "import type { AppCommand } from '../utils/app-command';\n// Removed non-critical logging to keep command output silent unless there are serious issues\nimport { red } from 'kleur/colors';\nimport { runInPkg } from '../utils/install-deps';\nimport { getPackageManager, panic } from '../utils/utils';\nimport fs from 'fs/promises';\nimport type { Stats } from 'fs';\nimport path from 'path';\n\nconst getDiskPath = (dist: string) => path.resolve(dist);\nconst getSrcPath = (src: string) => path.resolve(src);\nconst getManifestPath = (dist: string) => path.resolve(dist, 'q-manifest.json');\n\nexport async function runQwikClientCommand(app: AppCommand) {\n  try {\n    const src = app.args[1];\n    const dist = app.args[2];\n    await checkClientCommand(app, src, dist);\n  } catch (e) {\n    console.error(`❌ ${red(String(e))}\\n`);\n    process.exit(1);\n  }\n}\n\n/**\n * Handles the core logic for the 'check-client' command. Exports this function so other modules can\n * import and call it.\n *\n * @param {AppCommand} app - Application command context (assuming structure).\n */\nasync function checkClientCommand(app: AppCommand, src: string, dist: string): Promise<void> {\n  if (!(await clientDirExists(dist))) {\n    await goBuild(app);\n  } else {\n    const manifest = await getManifestTs(getManifestPath(dist));\n    if (manifest === null) {\n      await goBuild(app);\n    } else {\n      if (await hasNewer(getSrcPath(src), manifest)) {\n        await goBuild(app);\n      }\n    }\n  }\n}\n\n/**\n * Builds the application using the appropriate package manager.\n *\n * @param {AppCommand} app - The application command object containing app details.e path to the\n *   manifest file (though it's not used in the current function).\n * @throws {Error} Throws an error if the build process encounters any issues.\n */\n\nasync function goBuild(app: AppCommand) {\n  const pkgManager = getPackageManager();\n  const { install } = await runInPkg(pkgManager, ['run', 'build.client'], app.rootDir);\n  if (!(await install)) {\n    throw new Error('Client build command reported failure.');\n  }\n}\n\n/**\n * Retrieves the last modified timestamp of the manifest file.\n *\n * @param {string} manifestPath - The path to the manifest file.\n * @returns {Promise<number | null>} Returns the last modified timestamp (in milliseconds) of the\n *   manifest file, or null if an error occurs.\n */\nasync function getManifestTs(manifestPath: string) {\n  try {\n    // Get stats for the manifest file\n    const stats: Stats = await fs.stat(manifestPath);\n    return stats.mtimeMs;\n  } catch (err: any) {\n    // Handle errors accessing the manifest file\n    if (err.code !== 'ENOENT') {\n      panic(`Error accessing manifest file ${manifestPath}: ${err.message}`);\n    }\n    return null;\n  }\n}\n\n/**\n * Checks if the specified disk directory exists and is accessible.\n *\n * @returns {Promise<boolean>} Returns true if the directory exists and can be accessed, returns\n *   false if it doesn't exist or an error occurs.\n */\nexport async function clientDirExists(path: string): Promise<boolean> {\n  try {\n    await fs.access(getDiskPath(path));\n    return true; // Directory exists\n  } catch (err: any) {\n    if (!(err.code === 'ENOENT')) {\n      panic(`Error accessing disk directory ${path}: ${err.message}`);\n    }\n    return false; // Directory doesn't exist or there was an error\n  }\n}\n\n/**\n * Recursively finds the latest modification time (mtime) of any file in the given directory.\n *\n * @param {string} srcPath - The directory path to search.\n * @returns {Promise<number>} Returns the latest mtime (Unix timestamp in milliseconds), or 0 if the\n *   directory doesn't exist or is empty.\n */\nexport async function hasNewer(srcPath: string, timestamp: number): Promise<boolean> {\n  let returnValue = false;\n  async function traverse(dir: string): Promise<void> {\n    if (returnValue) {\n      return;\n    }\n    let items: Array<import('fs').Dirent>;\n    try {\n      items = await fs.readdir(dir, { withFileTypes: true });\n    } catch (err: any) {\n      return;\n    }\n\n    for (const item of items) {\n      if (returnValue) {\n        return;\n      }\n      const fullPath = path.join(dir, item.name);\n      try {\n        if (item.isDirectory()) {\n          await traverse(fullPath);\n        } else if (item.isFile()) {\n          const stats = await fs.stat(fullPath);\n          if (stats.mtimeMs > timestamp) {\n            returnValue = true;\n            return;\n          }\n        }\n      } catch (err: any) {\n        // Intentionally silent for non-critical access issues\n      }\n    }\n  }\n\n  await traverse(srcPath);\n  return returnValue;\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/code-mod/code-mod.ts",
    "content": "import type {\n  ArrayLiteralExpression,\n  Block,\n  CallExpression,\n  Expression,\n  Identifier,\n  ImportSpecifier,\n  NamedImports,\n  ObjectLiteralExpression,\n  SourceFile,\n  Statement,\n  TransformerFactory,\n} from 'typescript';\nimport type { EnsureImport, ViteConfigUpdates } from '../types';\n\nexport function updateViteConfig(ts: TypeScript, sourceText: string, updates?: ViteConfigUpdates) {\n  if (\n    !updates?.imports &&\n    !updates?.qwikViteConfig &&\n    !updates?.viteConfig &&\n    !updates?.vitePlugins &&\n    !updates?.vitePluginsPrepend\n  ) {\n    return null;\n  }\n\n  sourceText = transformSource(ts, sourceText, () => (tsSourceFile) => {\n    if (updates.imports) {\n      for (const importData of updates.imports) {\n        tsSourceFile = ensureImport(ts, tsSourceFile, importData);\n      }\n    }\n\n    const statements: Statement[] = [];\n\n    for (const s of tsSourceFile.statements) {\n      if (ts.isExportAssignment(s) && s.expression && ts.isCallExpression(s.expression)) {\n        if (\n          ts.isIdentifier(s.expression.expression) &&\n          s.expression.expression.text === 'defineConfig' &&\n          (updates.viteConfig ||\n            updates.qwikViteConfig ||\n            updates.vitePlugins ||\n            updates.vitePluginsPrepend)\n        ) {\n          statements.push(\n            ts.factory.updateExportAssignment(\n              s,\n              s.modifiers,\n              updateDefineConfig(ts, s.expression, updates)\n            )\n          );\n          continue;\n        }\n      }\n      statements.push(s);\n    }\n\n    return ts.factory.updateSourceFile(tsSourceFile, statements);\n  });\n\n  return sourceText;\n}\n\nfunction ensureImport(ts: TypeScript, tsSourceFile: SourceFile, importData: EnsureImport) {\n  if (importData && importData.importPath) {\n    if (Array.isArray(importData.namedImports)) {\n      importData.namedImports.forEach((namedImport) => {\n        tsSourceFile = ensureNamedImport(ts, tsSourceFile, namedImport, importData.importPath);\n      });\n    }\n    if (typeof importData.defaultImport === 'string') {\n      tsSourceFile = ensureDefaultImport(\n        ts,\n        tsSourceFile,\n        importData.defaultImport,\n        importData.importPath\n      );\n    }\n  }\n  return tsSourceFile;\n}\n\nfunction ensureNamedImport(\n  ts: TypeScript,\n  tsSourceFile: SourceFile,\n  namedImport: string,\n  importPath: string\n) {\n  if (!hasNamedImport(ts, tsSourceFile, namedImport, importPath)) {\n    tsSourceFile = appendImports(ts, tsSourceFile, null, namedImport, importPath);\n  }\n  return tsSourceFile;\n}\n\nfunction ensureDefaultImport(\n  ts: TypeScript,\n  tsSourceFile: SourceFile,\n  defaultImport: string,\n  importPath: string\n) {\n  if (!hasDefaultImport(ts, tsSourceFile, importPath)) {\n    tsSourceFile = appendImports(ts, tsSourceFile, defaultImport, null, importPath);\n  }\n  return tsSourceFile;\n}\n\nfunction hasNamedImport(\n  ts: TypeScript,\n  tsSourceFile: SourceFile,\n  namedImport: string,\n  importPath: string\n) {\n  return !!findNamedImport(ts, tsSourceFile, namedImport, importPath);\n}\n\nfunction hasDefaultImport(ts: TypeScript, tsSourceFile: SourceFile, importPath: string) {\n  return !!findDefaultImport(ts, tsSourceFile, importPath);\n}\n\nfunction findNamedImport(\n  ts: TypeScript,\n  tsSourceFile: SourceFile,\n  namedImport: string,\n  importPath: string\n) {\n  return findImportDeclarations(ts, tsSourceFile).find((n) => {\n    if (n.importClause && n.moduleSpecifier && ts.isStringLiteral(n.moduleSpecifier)) {\n      if (n.moduleSpecifier.text !== importPath) {\n        return false;\n      }\n      const namedImports = n.importClause.namedBindings;\n      if (namedImports && ts.isNamedImports(namedImports) && namedImports.elements) {\n        return namedImports.elements.some((namedImportElement) => {\n          if (ts.isImportSpecifier(namedImportElement)) {\n            const importName = namedImportElement.name;\n            if (importName && ts.isIdentifier(importName)) {\n              return importName.text === namedImport;\n            }\n          }\n          return false;\n        });\n      }\n    }\n    return false;\n  });\n}\n\nfunction findDefaultImport(\n  ts: TypeScript,\n  tsSourceFile: SourceFile,\n\n  importPath: string\n) {\n  return findImportDeclarations(ts, tsSourceFile).find((n) => {\n    if (n.importClause && n.moduleSpecifier) {\n      const modulePath = n.moduleSpecifier;\n      if (ts.isStringLiteral(modulePath) && modulePath.text === importPath) {\n        const moduleDefault = n.importClause.name;\n        if (moduleDefault && moduleDefault.text === importPath) {\n          return true;\n        }\n      }\n    }\n    return false;\n  });\n}\n\nfunction findImportDeclarations(ts: TypeScript, tsSourceFile: SourceFile) {\n  return tsSourceFile.statements.filter(ts.isImportDeclaration);\n}\n\nfunction appendImports(\n  ts: TypeScript,\n  tsSourceFile: SourceFile,\n  defaultImport: string | null,\n  namedImport: string | null,\n  importPath: string\n) {\n  const statements = tsSourceFile.statements.slice();\n  let foundExistingImport = false;\n\n  for (let i = statements.length - 1; i >= 0; i--) {\n    const n = statements[i];\n    if (!ts.isImportDeclaration(n)) {\n      continue;\n    }\n\n    if (!n.moduleSpecifier || !ts.isStringLiteral(n.moduleSpecifier)) {\n      continue;\n    }\n\n    if (n.moduleSpecifier.text !== importPath) {\n      continue;\n    }\n\n    foundExistingImport = true;\n\n    const existingNamedImports: ImportSpecifier[] = [];\n    if (n.importClause) {\n      const namedImports = n.importClause.namedBindings;\n      if (namedImports && ts.isNamedImports(namedImports) && namedImports.elements) {\n        existingNamedImports.push(...namedImports.elements);\n      }\n    }\n\n    if (typeof namedImport === 'string') {\n      const identifier = ts.factory.createIdentifier(namedImport);\n      const importSpecifier = ts.factory.createImportSpecifier(false, undefined, identifier);\n      existingNamedImports.push(importSpecifier);\n    }\n\n    existingNamedImports.sort((a, b) => {\n      const aName = a.name.escapedText.toString();\n      const bName = b.name.escapedText.toString();\n      return aName < bName ? -1 : 1;\n    });\n\n    let defaultIdentifier = n.importClause ? n.importClause.name : undefined;\n    if (typeof defaultImport === 'string') {\n      defaultIdentifier = ts.factory.createIdentifier(defaultImport);\n    }\n\n    let namedBindings: NamedImports = undefined as any;\n    if (existingNamedImports.length > 0) {\n      namedBindings = ts.factory.createNamedImports(existingNamedImports);\n    }\n\n    statements[i] = ts.factory.updateImportDeclaration(\n      n,\n      undefined,\n      ts.factory.createImportClause(false, defaultIdentifier, namedBindings),\n      n.moduleSpecifier,\n      undefined\n    );\n  }\n\n  if (!foundExistingImport) {\n    let defaultIdentifier: Identifier = undefined as any;\n    let namedBindings: NamedImports = undefined as any;\n\n    if (typeof defaultImport === 'string') {\n      defaultIdentifier = ts.factory.createIdentifier(defaultImport);\n    }\n\n    if (typeof namedImport === 'string') {\n      namedBindings = ts.factory.createNamedImports([\n        ts.factory.createImportSpecifier(\n          false,\n          undefined,\n          ts.factory.createIdentifier(namedImport)\n        ),\n      ]);\n    }\n\n    const newNamedImport = ts.factory.createImportDeclaration(\n      undefined,\n      ts.factory.createImportClause(false, defaultIdentifier, namedBindings),\n      ts.factory.createStringLiteral(importPath)\n    );\n    const lastImportIndex = findLastImportIndex(ts, tsSourceFile);\n    statements.splice(lastImportIndex + 1, 0, newNamedImport);\n  }\n\n  return ts.factory.updateSourceFile(tsSourceFile, statements);\n}\n\nfunction findLastImportIndex(ts: TypeScript, tsSourceFile: SourceFile) {\n  for (let i = tsSourceFile.statements.length - 1; i >= 0; i--) {\n    const s = tsSourceFile.statements[i];\n    if (ts.isImportDeclaration(s)) {\n      return i;\n    }\n    if (ts.isStringLiteral(s) && s.text === 'use strict') {\n      return i;\n    }\n  }\n  return 0;\n}\n\nfunction updateDefineConfig(ts: TypeScript, callExp: CallExpression, updates: ViteConfigUpdates) {\n  const args: Expression[] = [];\n\n  for (let i = 0; i < callExp.arguments.length; i++) {\n    const exp = callExp.arguments[i];\n\n    if (i === 0) {\n      if (ts.isArrowFunction(exp) && ts.isBlock(exp.body)) {\n        args.push(\n          ts.factory.updateArrowFunction(\n            exp,\n            exp.modifiers,\n            exp.typeParameters,\n            exp.parameters,\n            exp.type,\n            exp.equalsGreaterThanToken,\n            updateDefineConfigFnReturn(ts, exp.body, updates)\n          )\n        );\n        continue;\n      }\n\n      if (ts.isFunctionExpression(exp) && ts.isBlock(exp.body)) {\n        args.push(\n          ts.factory.updateFunctionExpression(\n            exp,\n            exp.modifiers,\n            exp.asteriskToken,\n            exp.name,\n            exp.typeParameters,\n            exp.parameters,\n            exp.type,\n            updateDefineConfigFnReturn(ts, exp.body, updates)\n          )\n        );\n        continue;\n      }\n\n      if (ts.isObjectLiteralExpression(exp)) {\n        args.push(updateVitConfigObj(ts, exp, updates));\n        continue;\n      }\n    }\n\n    args.push(exp);\n  }\n\n  return ts.factory.updateCallExpression(callExp, callExp.expression, callExp.typeArguments, args);\n}\n\nfunction updateDefineConfigFnReturn(ts: TypeScript, fnBody: Block, updates: ViteConfigUpdates) {\n  const statements: Statement[] = [];\n  for (const s of fnBody.statements) {\n    if (ts.isReturnStatement(s) && s.expression && ts.isObjectLiteralExpression(s.expression)) {\n      statements.push(\n        ts.factory.updateReturnStatement(s, updateVitConfigObj(ts, s.expression, updates))\n      );\n    } else {\n      statements.push(s);\n    }\n  }\n  return ts.factory.updateBlock(fnBody, statements);\n}\n\nfunction updateVitConfigObj(\n  ts: TypeScript,\n  obj: ObjectLiteralExpression,\n  updates: ViteConfigUpdates\n) {\n  if (updates.viteConfig) {\n    obj = updateObjectLiteralExpression(ts, obj, updates.viteConfig);\n  }\n  if (updates.vitePlugins || updates.vitePluginsPrepend || updates.qwikViteConfig) {\n    obj = updatePlugins(ts, obj, updates);\n  }\n  return obj;\n}\n\nfunction updatePlugins(ts: TypeScript, obj: ObjectLiteralExpression, updates: ViteConfigUpdates) {\n  const properties: any[] = [];\n\n  for (const p of obj.properties) {\n    if (ts.isPropertyAssignment(p)) {\n      if (p.name && ts.isIdentifier(p.name) && p.name.text === 'plugins') {\n        if (ts.isArrayLiteralExpression(p.initializer)) {\n          properties.push(\n            ts.factory.updatePropertyAssignment(\n              p,\n              p.name,\n              updatePluginsArray(ts, p.initializer, updates)\n            )\n          );\n          continue;\n        }\n      }\n    }\n    properties.push(p);\n  }\n\n  return ts.factory.updateObjectLiteralExpression(obj, properties);\n}\n\nfunction updatePluginsArray(\n  ts: TypeScript,\n  arr: ArrayLiteralExpression,\n  updates: ViteConfigUpdates\n) {\n  const elms: Expression[] = [...arr.elements];\n\n  if (updates.vitePlugins) {\n    for (const vitePlugin of updates.vitePlugins) {\n      const pluginExp = createPluginCall(ts, vitePlugin);\n      const pluginName = (pluginExp?.expression as Identifier | null)?.escapedText;\n      const alreadyDefined = elms.some(\n        (el) =>\n          ts.isCallExpression(el) &&\n          ts.isIdentifier(el.expression) &&\n          el.expression.escapedText === pluginName\n      );\n      if (pluginExp && !alreadyDefined) {\n        elms.push(pluginExp);\n      }\n    }\n  }\n\n  if (updates.vitePluginsPrepend) {\n    for (const vitePlugin of updates.vitePluginsPrepend) {\n      const pluginExp = createPluginCall(ts, vitePlugin);\n      const pluginName = (pluginExp?.expression as Identifier | null)?.escapedText;\n      const alreadyDefined = elms.some(\n        (el) =>\n          ts.isCallExpression(el) &&\n          ts.isIdentifier(el.expression) &&\n          el.expression.escapedText === pluginName\n      );\n      if (pluginExp && !alreadyDefined) {\n        elms.unshift(pluginExp);\n      }\n    }\n  }\n\n  if (updates.qwikViteConfig) {\n    for (let i = 0; i < elms.length; i++) {\n      const elm = elms[i];\n      if (ts.isCallExpression(elm) && ts.isIdentifier(elm.expression)) {\n        if (elm.expression.escapedText === 'qwikVite') {\n          elms[i] = updateQwikCityPlugin(ts, elm, updates.qwikViteConfig);\n        }\n      }\n    }\n  }\n\n  return ts.factory.updateArrayLiteralExpression(arr, elms);\n}\n\nfunction createPluginCall(ts: TypeScript, vitePlugin: string): CallExpression | null {\n  if (typeof vitePlugin === 'string') {\n    const tmp = ts.createSourceFile(\n      'tmp.ts',\n      'export default ' + vitePlugin,\n      ts.ScriptTarget.Latest\n    );\n    for (const s of tmp.statements) {\n      if (ts.isExportAssignment(s)) {\n        return s.expression as CallExpression;\n      }\n    }\n  }\n  return null;\n}\n\nfunction updateQwikCityPlugin(\n  ts: TypeScript,\n  callExp: CallExpression,\n  qwikViteConfig: { [key: string]: string }\n) {\n  const args = callExp.arguments.slice();\n\n  const config =\n    args[0] && ts.isObjectLiteralExpression(args[0])\n      ? args[0]\n      : ts.factory.createObjectLiteralExpression();\n\n  args[0] = updateObjectLiteralExpression(ts, config, qwikViteConfig);\n\n  return ts.factory.updateCallExpression(callExp, callExp.expression, callExp.typeArguments, args);\n}\n\nfunction updateObjectLiteralExpression(\n  ts: TypeScript,\n  obj: ObjectLiteralExpression,\n  updateObj: { [propName: string]: string }\n) {\n  for (const [propName, value] of Object.entries(updateObj)) {\n    if (typeof value === 'string') {\n      const tmp = ts.createSourceFile('tmp.ts', 'export default ' + value, ts.ScriptTarget.Latest);\n\n      for (const s of tmp.statements) {\n        if (ts.isExportAssignment(s)) {\n          const exp = s.expression;\n          let added = false;\n          const properties: any[] = [];\n          for (const p of obj.properties) {\n            if (p.name && ts.isIdentifier(p.name) && p.name.text === propName) {\n              properties.push(ts.factory.createPropertyAssignment(propName, exp));\n              added = true;\n            } else {\n              properties.push(p);\n            }\n          }\n          if (!added) {\n            properties.unshift(ts.factory.createPropertyAssignment(propName, exp));\n          }\n\n          obj = ts.factory.updateObjectLiteralExpression(obj, properties);\n        }\n      }\n    }\n  }\n  return obj;\n}\n\nfunction transformSource(ts: TypeScript, sourceText: string, transformer: TransformerFactory<any>) {\n  const t = ts.transform(ts.createSourceFile('/tmp.ts', sourceText, ts.ScriptTarget.Latest), [\n    transformer,\n  ]);\n\n  const p = ts.createPrinter({\n    removeComments: false,\n    omitTrailingSemicolon: false,\n    noEmitHelpers: true,\n  });\n\n  return p.printFile(t.transformed[0]);\n}\n\ntype TypeScript = typeof import('typescript');\n"
  },
  {
    "path": "packages/qwik/src/cli/code-mod/code-mod.unit.ts",
    "content": "import { test, assert } from 'vitest';\nimport { updateViteConfig } from './code-mod';\nimport ts from 'typescript';\n\nconst prepareOutput = (str: string) =>\n  str\n    .split('\\n')\n    .map((part) => part.trim())\n    .join('\\n');\n\ntest('update existing qwik vite plugin config prop', () => {\n  const sourceText = `\n    export default defineConfig(() => {\n      return {\n        plugins: [\n          qwikVite({ssr:false}),\n        ],\n      };\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    qwikViteConfig: { ssr: `{ outDir: 'netlify/edge-functions/entry.netlify' }` },\n  })!;\n  assert.include(\n    outputText,\n    'qwikVite({ ssr: { outDir: \"netlify/edge-functions/entry.netlify\" } })'\n  );\n});\n\ntest('update qwik vite plugin config', () => {\n  const sourceText = `\n    export default defineConfig(() => {\n      return {\n        plugins: [\n          qwikVite({abc:88}),\n        ],\n      };\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    qwikViteConfig: { ssr: `{ outDir: 'netlify/edge-functions/entry.netlify' }` },\n  })!;\n  assert.include(\n    outputText,\n    'qwikVite({ ssr: { outDir: \"netlify/edge-functions/entry.netlify\" }, abc: 88 })'\n  );\n});\n\ntest('add qwik vite plugin config', () => {\n  const sourceText = `\n    export default defineConfig(() => {\n      return {\n        plugins: [\n          qwikVite(),\n        ],\n      };\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    qwikViteConfig: { ssr: `{ outDir: 'netlify/edge-functions/entry.netlify' }` },\n  })!;\n  assert.include(\n    outputText,\n    'qwikVite({ ssr: { outDir: \"netlify/edge-functions/entry.netlify\" } })'\n  );\n});\n\ntest('add qwik vite plugin config for object based vite config', () => {\n  const sourceText = `\n    export default defineConfig({\n      plugins: [\n        qwikVite(),\n      ],\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    qwikViteConfig: { ssr: `{ outDir: 'netlify/edge-functions/entry.netlify' }` },\n  })!;\n  assert.include(\n    outputText,\n    'qwikVite({ ssr: { outDir: \"netlify/edge-functions/entry.netlify\" } })'\n  );\n});\n\ntest('add vite plugin', () => {\n  const sourceText = `\n    export default defineConfig(() => {\n      return {\n        plugins: [\n          qwikVite(),\n        ],\n      };\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    vitePlugins: [`netlifyEdge({ functionName: 'entry.netlify' })`],\n  })!;\n  assert.include(outputText, 'netlifyEdge({ functionName: \"entry.netlify\" })');\n});\n\ntest('add vite plugin to object based config', () => {\n  const sourceText = `\n    export default defineConfig({\n      plugins: [\n        qwikVite(),\n      ],\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    vitePlugins: [`netlifyEdge({ functionName: 'entry.netlify' })`],\n  })!;\n  assert.include(outputText, 'netlifyEdge({ functionName: \"entry.netlify\" })');\n});\n\ntest('should not add vite plugin if it is already defined', () => {\n  const sourceText = `\n  export default defineConfig(() => {\n    return {\n      plugins: [\n        qwikVite(),\n        netlifyEdge()\n      ],\n    };\n  });\n`;\n  const outputText = updateViteConfig(ts, sourceText, {\n    vitePlugins: [`netlifyEdge({ functionName: 'entry.netlify' })`],\n  })!;\n\n  const expected = `export default defineConfig(() => {\n        return {\n          plugins: [\n            qwikVite(),\n            netlifyEdge()\n          ]\n        };\n      });\n    `;\n  assert.deepEqual(prepareOutput(outputText), prepareOutput(expected));\n});\n\ntest('update vite config', () => {\n  const sourceText = `\n    export default defineConfig(() => {\n      return {\n        ssr: {},\n        plugins: [\n          qwikVite(),\n        ],\n      };\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    viteConfig: { ssr: `{ target: 'webworker', noExternal: true }` },\n  })!;\n  assert.include(outputText, 'ssr: { target: \"webworker\", noExternal: true');\n});\n\ntest('update object based vite config', () => {\n  const sourceText = `\n    export default defineConfig({\n      ssr: {},\n      plugins: [\n        qwikVite(),\n      ],\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    viteConfig: { ssr: `{ target: 'webworker', noExternal: true }` },\n  })!;\n  assert.include(outputText, 'ssr: { target: \"webworker\", noExternal: true');\n});\n\ntest('add vite config', () => {\n  const sourceText = `\n    export default defineConfig(() => {\n      return {\n        plugins: [\n          qwikVite(),\n        ],\n      };\n    });\n  `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    viteConfig: { ssr: `{ target: 'webworker', noExternal: true }` },\n  })!;\n  assert.include(outputText, 'ssr: { target: \"webworker\", noExternal: true');\n});\n\ntest('add imports to side effect default import', () => {\n  const sourceText = `import a from \"@builder.io/qwik\";`;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [\n      { namedImports: ['b'], importPath: '@builder.io/qwik' },\n      { namedImports: ['c', 'd'], importPath: '@builder.io/sdk-react' },\n    ],\n  })!;\n  assert.include(outputText, 'import a, { b } from \"@builder.io/qwik\";');\n  assert.include(outputText, 'import { c, d } from \"@builder.io/sdk-react\";');\n});\n\ntest('do not re-add named imports', () => {\n  const sourceText = `\n    import { a } from \"@builder.io/qwik\";\n    import { b, c } from \"@builder.io/sdk-react\";\n    `;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [\n      { namedImports: ['a'], importPath: '@builder.io/qwik' },\n      { namedImports: ['b', 'c'], importPath: '@builder.io/sdk-react' },\n    ],\n  })!;\n  assert.include(outputText, 'import { a } from \"@builder.io/qwik\";');\n  assert.include(outputText, 'import { b, c } from \"@builder.io/sdk-react\";');\n});\n\ntest('add imports to side effect import', () => {\n  const sourceText = `import \"@builder.io/qwik\";\\nconsole.log(88);`;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [{ namedImports: ['a'], importPath: '@builder.io/qwik' }],\n  })!;\n  assert.include(outputText, 'import { a } from \"@builder.io/qwik\"');\n});\n\ntest('leave existing imports', () => {\n  const sourceText = `import { a } from \"@builder.io/qwik\";`;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [{ namedImports: ['b'], importPath: '@builder.io/qwik' }],\n  })!;\n  assert.include(outputText, 'import { a, b } from \"@builder.io/qwik\";');\n});\n\ntest('renamed default import with existing named import', () => {\n  const sourceText = `import a, { b } from '@builder.io/sdk-react'`;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [\n      { defaultImport: 'c', importPath: '@builder.io/sdk-react' },\n      { namedImports: ['d'], importPath: '@builder.io/qwik' },\n    ],\n  })!;\n  assert.include(outputText, 'import c, { b } from \"@builder.io/sdk-react\";');\n  assert.include(outputText, 'import { d } from \"@builder.io/qwik\";');\n});\n\ntest('renamed default import', () => {\n  const sourceText = `import a from '@builder.io/sdk-react'`;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [{ defaultImport: 'b', importPath: '@builder.io/sdk-react' }],\n  })!;\n  assert.include(outputText, 'import b from \"@builder.io/sdk-react\";');\n});\n\ntest('add default import to empty file', () => {\n  const sourceText = ``;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [{ defaultImport: 'a', importPath: '@builder.io/sdk-react' }],\n  })!;\n  assert.include(outputText, 'import a from \"@builder.io/sdk-react\";');\n});\n\ntest('add named imports to empty file', () => {\n  const sourceText = ``;\n  const outputText = updateViteConfig(ts, sourceText, {\n    imports: [{ namedImports: ['a'], importPath: '@builder.io/sdk-react' }],\n  })!;\n  assert.include(outputText, 'import { a } from \"@builder.io/sdk-react\";');\n});\n"
  },
  {
    "path": "packages/qwik/src/cli/index.ts",
    "content": "export { runCli } from './run';\nexport { updateApp } from './add/update-app';\n"
  },
  {
    "path": "packages/qwik/src/cli/joke/run-joke-command.ts",
    "content": "import { getRandomJoke } from '../../../../create-qwik/src/helpers/jokes';\nimport { note } from '../utils/utils';\nimport { magenta } from 'kleur/colors';\n\nexport async function runJokeCommand() {\n  const [setup, punchline] = getRandomJoke();\n  note(magenta(`${setup!.trim()}\\n${punchline!.trim()}`), '🙈');\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/rename-import.ts",
    "content": "import { Project, ts } from 'ts-morph';\nimport { visitNotIgnoredFiles } from './tools/visit-not-ignored-files';\nimport { log } from '@clack/prompts';\n\nexport function replaceImportInFiles(\n  changes: [oldImport: string, newImport: string][],\n  library: string\n) {\n  const project = new Project();\n\n  visitNotIgnoredFiles('.', (path) => {\n    if (!path.endsWith('.ts') && !path.endsWith('.tsx')) {\n      return;\n    }\n    project.addSourceFileAtPath(path);\n  });\n\n  project.getSourceFiles().forEach((sourceFile) => {\n    let hasChanges = false;\n\n    sourceFile.getImportDeclarations().forEach((importDeclaration) => {\n      // startsWith is used in order to handle nested imports\n      if (importDeclaration.getModuleSpecifierValue().startsWith(library)) {\n        for (const [oldImport, newImport] of changes) {\n          importDeclaration.getNamedImports().forEach((namedImport) => {\n            if (namedImport.getName() === oldImport) {\n              namedImport.setName(newImport);\n              hasChanges = true;\n            }\n          });\n        }\n      }\n    });\n\n    sourceFile.getDescendantsOfKind(ts.SyntaxKind.Identifier).forEach((identifier) => {\n      for (const [oldImport, newImport] of changes) {\n        if (identifier.getText() === oldImport) {\n          identifier.replaceWithText(newImport);\n          hasChanges = true;\n        }\n      }\n    });\n\n    if (hasChanges) {\n      sourceFile.saveSync();\n      log.info(`Updated imports in ${sourceFile.getFilePath()}`);\n    }\n  });\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/replace-package.ts",
    "content": "import { basename } from 'path';\nimport { isBinaryPath } from './tools/binary-extensions';\nimport { visitNotIgnoredFiles } from './tools/visit-not-ignored-files';\nimport { readFileSync, writeFileSync } from 'fs';\nimport { log } from '@clack/prompts';\n\nfunction updateFileContent(path: string, content: string) {\n  writeFileSync(path, content);\n  log.info(`\"${path}\" has been updated`);\n}\n\nexport function replacePackage(\n  oldPackageName: string,\n  newPackageName: string,\n  skipDependencies = false\n): void {\n  if (!skipDependencies) {\n    replacePackageInDependencies(oldPackageName, newPackageName);\n  }\n\n  replaceMentions(oldPackageName, newPackageName);\n}\n\nfunction replacePackageInDependencies(oldPackageName: string, newPackageName: string) {\n  visitNotIgnoredFiles('.', (path) => {\n    if (basename(path) !== 'package.json') {\n      return;\n    }\n\n    try {\n      const packageJson = JSON.parse(readFileSync(path, 'utf-8'));\n      for (const deps of [\n        packageJson.dependencies ?? {},\n        packageJson.devDependencies ?? {},\n        packageJson.peerDependencies ?? {},\n        packageJson.optionalDependencies ?? {},\n      ]) {\n        if (oldPackageName in deps) {\n          // We keep the old version intentionally. It will be updated later within another step of the migration.\n          deps[newPackageName] = deps[oldPackageName];\n          delete deps[oldPackageName];\n        }\n      }\n      updateFileContent(path, JSON.stringify(packageJson, null, 2));\n    } catch (e) {\n      console.warn(`Could not replace ${oldPackageName} with ${newPackageName} in ${path}.`);\n    }\n  });\n}\n\nfunction replaceMentions(oldPackageName: string, newPackageName: string) {\n  visitNotIgnoredFiles('.', (path) => {\n    if (isBinaryPath(path)) {\n      return;\n    }\n\n    const ignoredFiles = [\n      'yarn.lock',\n      'package-lock.json',\n      'pnpm-lock.yaml',\n      'bun.lockb',\n      'CHANGELOG.md',\n    ];\n    if (ignoredFiles.includes(basename(path))) {\n      return;\n    }\n\n    try {\n      const contents = readFileSync(path, 'utf-8');\n\n      if (!contents.includes(oldPackageName)) {\n        return;\n      }\n\n      updateFileContent(path, contents.replace(new RegExp(oldPackageName, 'g'), newPackageName));\n    } catch {\n      // Its **probably** ok, contents can be null if the file is too large or\n      // there was an access exception.\n      log.warn(\n        `An error was thrown when trying to update ${path}. If you believe the migration should have updated it, be sure to review the file and open an issue.`\n      );\n    }\n  });\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/run-migration.ts",
    "content": "import { confirm, intro, isCancel, log } from '@clack/prompts';\nimport type { AppCommand } from '../utils/app-command';\nimport { bgMagenta, bgRed, bold, green } from 'kleur/colors';\nimport { bye } from '../utils/utils';\nimport { replacePackage } from './replace-package';\nimport {\n  installTsMorph,\n  removeTsMorphFromPackageJson,\n  updateDependencies,\n} from './update-dependencies';\n\nexport async function runV2Migration(app: AppCommand) {\n  intro(\n    `✨  ${bgMagenta(' This command will migrate your Qwik application from v1 to v2')}\\n` +\n      `This includes the following: \\n` +\n      `  - \"@builder.io/qwik\", \"@builder.io/qwik-city\" and \"@builder.io/qwik-react\" packages will be rescoped to \"@qwik.dev/core\", \"@qwik.dev/router\" and \"@qwik.dev/react\" respectively \\n` +\n      `  - related dependencies will be updated \\n\\n` +\n      `${bold(bgRed('Warning: migration tool is experimental and will migrate your application to the \"alpha\" release of Qwik V2'))}`\n  );\n  const proceed = await confirm({\n    message: 'Do you want to proceed?',\n    initialValue: true,\n  });\n\n  if (isCancel(proceed) || !proceed) {\n    bye();\n  }\n\n  try {\n    const installedTsMorph = await installTsMorph();\n    const { replaceImportInFiles } = await import('./rename-import');\n    replaceImportInFiles(\n      [\n        ['QwikCityProvider', 'QwikRouterProvider'],\n        ['qwikCity', 'qwikRouter'],\n        ['QwikCityVitePluginOptions', 'QwikRouterVitePluginOptions'],\n        ['QwikCityPlugin', 'QwikRouterPlugin'],\n        ['createQwikCity', 'createQwikRouter'],\n        ['QwikCityNodeRequestOptions', 'QwikRouterNodeRequestOptions'],\n      ],\n      '@builder.io/qwik-city'\n    );\n    replaceImportInFiles(\n      [['qwikCityPlan', 'qwikRouterConfig']],\n      '@qwik-city-plan' // using old name, package name will be updated in the next step\n    );\n    replaceImportInFiles([['jsxs', 'jsx']], '@builder.io/qwik/jsx-runtime');\n\n    replacePackage('@qwik-city-plan', '@qwik-router-config', true);\n    replacePackage('@builder.io/qwik-city', '@qwik.dev/router');\n    replacePackage('@builder.io/qwik-react', '@qwik.dev/react');\n    // jsx-runtime contains re-exports from \"core\"\n    replacePackage('@builder.io/qwik/jsx-runtime', '@qwik.dev/core');\n    // \"@builder.io/qwik\" should be the last one because it's name is a substring of the package names above\n    replacePackage('@builder.io/qwik', '@qwik.dev/core');\n\n    if (installedTsMorph) {\n      await removeTsMorphFromPackageJson();\n    }\n\n    // COMMENTED OUT FOR NOW 👇 (as this is fixed in https://github.com/QwikDev/qwik/pull/7159)\n    // updateConfigurations();\n\n    await updateDependencies();\n    log.success(`${green(`Your application has been successfully migrated to v2!`)}`);\n  } catch (error) {\n    console.error(error);\n    throw error;\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/tools/binary-extensions.ts",
    "content": "import { extname } from 'path';\n\nconst binaryExtensions = new Set([\n  // types originally from https://github.com/sindresorhus/binary-extensions/blob/40e44b510d87a63dcf42300bc8fbcb105f45a61c/binary-extensions.json\n  '.3dm',\n  '.3ds',\n  '.3g2',\n  '.3gp',\n  '.7z',\n  '.a',\n  '.aac',\n  '.adp',\n  '.ai',\n  '.aif',\n  '.aiff',\n  '.als',\n  '.alz',\n  '.ape',\n  '.apk',\n  '.appimage',\n  '.ar',\n  '.arj',\n  '.asf',\n  '.au',\n  '.avi',\n  '.bak',\n  '.baml',\n  '.bh',\n  '.bin',\n  '.bk',\n  '.bmp',\n  '.btif',\n  '.bz2',\n  '.bzip2',\n  '.cab',\n  '.caf',\n  '.cgm',\n  '.class',\n  '.cmx',\n  '.cpio',\n  '.cr2',\n  '.cur',\n  '.dat',\n  '.dcm',\n  '.deb',\n  '.dex',\n  '.djvu',\n  '.dll',\n  '.dmg',\n  '.dng',\n  '.doc',\n  '.docm',\n  '.docx',\n  '.dot',\n  '.dotm',\n  '.dra',\n  '.DS_Store',\n  '.dsk',\n  '.dts',\n  '.dtshd',\n  '.dvb',\n  '.dwg',\n  '.dxf',\n  '.ecelp4800',\n  '.ecelp7470',\n  '.ecelp9600',\n  '.egg',\n  '.eol',\n  '.eot',\n  '.epub',\n  '.exe',\n  '.f4v',\n  '.fbs',\n  '.fh',\n  '.fla',\n  '.flac',\n  '.flatpak',\n  '.fli',\n  '.flv',\n  '.fpx',\n  '.fst',\n  '.fvt',\n  '.g3',\n  '.gh',\n  '.gif',\n  '.glb',\n  '.graffle',\n  '.gz',\n  '.gzip',\n  '.h261',\n  '.h263',\n  '.h264',\n  '.icns',\n  '.ico',\n  '.ief',\n  '.img',\n  '.ipa',\n  '.iso',\n  '.jar',\n  '.jpeg',\n  '.jpg',\n  '.jpgv',\n  '.jpm',\n  '.jxr',\n  '.key',\n  '.keystore',\n  '.ktx',\n  '.lha',\n  '.lib',\n  '.lvp',\n  '.lz',\n  '.lzh',\n  '.lzma',\n  '.lzo',\n  '.m3u',\n  '.m4a',\n  '.m4v',\n  '.mar',\n  '.mdi',\n  '.mht',\n  '.mid',\n  '.midi',\n  '.mj2',\n  '.mka',\n  '.mkv',\n  '.mmr',\n  '.mng',\n  '.mobi',\n  '.mov',\n  '.movie',\n  '.mp3',\n  '.mp4',\n  '.mp4a',\n  '.mpeg',\n  '.mpg',\n  '.mpga',\n  '.msi',\n  '.mxu',\n  '.nef',\n  '.npx',\n  '.npy',\n  '.numbers',\n  '.nupkg',\n  '.o',\n  '.odp',\n  '.ods',\n  '.odt',\n  '.oga',\n  '.ogg',\n  '.ogv',\n  '.otf',\n  '.ott',\n  '.pages',\n  '.pbm',\n  '.pbf',\n  '.pcx',\n  '.pdb',\n  '.pdf',\n  '.pea',\n  '.pgm',\n  '.pic',\n  '.pkg',\n  '.plist',\n  '.png',\n  '.pnm',\n  '.pot',\n  '.potm',\n  '.potx',\n  '.ppa',\n  '.ppam',\n  '.ppm',\n  '.pps',\n  '.ppsm',\n  '.ppsx',\n  '.ppt',\n  '.pptm',\n  '.pptx',\n  '.psd',\n  '.pxd',\n  '.pxz',\n  '.pya',\n  '.pyc',\n  '.pyo',\n  '.pyv',\n  '.qt',\n  '.rar',\n  '.ras',\n  '.raw',\n  '.resources',\n  '.rgb',\n  '.rip',\n  '.rlc',\n  '.rmf',\n  '.rmvb',\n  '.rpm',\n  '.rtf',\n  '.rz',\n  '.s3m',\n  '.s7z',\n  '.scpt',\n  '.sgi',\n  '.shar',\n  '.snap',\n  '.sil',\n  '.sketch',\n  '.slk',\n  '.smv',\n  '.snk',\n  '.so',\n  '.stl',\n  '.suo',\n  '.sub',\n  '.swf',\n  '.tar',\n  '.tbz',\n  '.tbz2',\n  '.tga',\n  '.tgz',\n  '.thmx',\n  '.tif',\n  '.tiff',\n  '.tlz',\n  '.ttc',\n  '.ttf',\n  '.txz',\n  '.udf',\n  '.uvh',\n  '.uvi',\n  '.uvm',\n  '.uvp',\n  '.uvs',\n  '.uvu',\n  '.viv',\n  '.vob',\n  '.war',\n  '.wav',\n  '.wax',\n  '.wbmp',\n  '.wdp',\n  '.weba',\n  '.webm',\n  '.webp',\n  '.whl',\n  '.wim',\n  '.wm',\n  '.wma',\n  '.wmv',\n  '.wmx',\n  '.woff',\n  '.woff2',\n  '.wrm',\n  '.wvx',\n  '.xbm',\n  '.xif',\n  '.xla',\n  '.xlam',\n  '.xls',\n  '.xlsb',\n  '.xlsm',\n  '.xlsx',\n  '.xlt',\n  '.xltm',\n  '.xltx',\n  '.xm',\n  '.xmind',\n  '.xpi',\n  '.xpm',\n  '.xwd',\n  '.xz',\n  '.z',\n  '.zip',\n  '.zipx',\n]);\n\nexport function isBinaryPath(path: string): boolean {\n  return binaryExtensions.has(extname(path).toLowerCase());\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/tools/visit-not-ignored-files.ts",
    "content": "import { existsSync, lstatSync, readFileSync, readdirSync } from 'fs';\nimport ignore from 'ignore';\nimport { join, relative } from 'path';\n\n/** Utility to act on all files in a tree that are not ignored by git. */\nexport function visitNotIgnoredFiles(dirPath: string, visitor: (path: string) => void): void {\n  let ig: ReturnType<typeof ignore> | undefined;\n  if (existsSync('.gitignore')) {\n    ig = ignore();\n    ig.add('.git');\n    ig.add(readFileSync('.gitignore', 'utf-8'));\n  }\n  dirPath = relative(process.cwd(), dirPath);\n  if (dirPath !== '' && ig?.ignores(dirPath)) {\n    return;\n  }\n  for (const child of readdirSync(join(process.cwd(), dirPath))) {\n    const fullPath = join(dirPath, child);\n    if (ig?.ignores(fullPath)) {\n      continue;\n    }\n    if (lstatSync(fullPath).isFile()) {\n      visitor(fullPath);\n    } else {\n      visitNotIgnoredFiles(fullPath, visitor);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/update-configurations.ts",
    "content": "import { readFileSync, writeFileSync } from 'fs';\nimport { log } from '@clack/prompts';\n\nexport function updateConfigurations() {\n  try {\n    updateTsconfig();\n  } catch (error) {\n    log.error('Failed to update tsconfig.json configuration.');\n  }\n}\n\nfunction updateTsconfig() {\n  const tsConfigPath = 'tsconfig.json';\n  const tsConfig = JSON.parse(readFileSync(tsConfigPath, 'utf-8'));\n  if (!tsConfig) {\n    return;\n  }\n  tsConfig.compilerOptions.moduleResolution = 'bundler';\n  writeFileSync(tsConfigPath, JSON.stringify(tsConfig, null, 2));\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/update-dependencies.ts",
    "content": "import { execSync } from 'node:child_process';\nimport { installDeps } from '../utils/install-deps';\nimport { getPackageManager, readPackageJson, writePackageJson } from './../utils/utils';\nimport { packageNames, versionTagPriority } from './versions';\nimport { major } from 'semver';\nimport { log, spinner } from '@clack/prompts';\n\nexport async function updateDependencies() {\n  // TODO(migrate-v2): rely on workspaceRoot instead?\n  const packageJson = await readPackageJson(process.cwd());\n\n  const version = getPackageTag();\n\n  const dependencyNames = [\n    'dependencies',\n    'devDependencies',\n    'peerDependencies',\n    'optionalDependencies',\n  ] as const;\n\n  for (const name of packageNames) {\n    for (const propName of dependencyNames) {\n      const prop = packageJson[propName];\n      if (prop && prop[name]) {\n        prop[name] = version;\n      }\n    }\n  }\n\n  await writePackageJson(process.cwd(), packageJson);\n  const loading = spinner();\n  loading.start(`Updating dependencies...`);\n  await runInstall();\n  loading.stop('Dependencies have been updated');\n}\n\n/**\n * Resolve the list of available package tags for the \"@qwik.dev/core\" and get the best match of\n * ^2.0.0 based on the \"versionTagPriority\"\n */\nfunction getPackageTag() {\n  // we assume all migrated packages have the same set of tags\n  const tags: [tag: string, version: string][] = execSync('npm dist-tag @qwik.dev/core', {\n    encoding: 'utf-8',\n  })\n    ?.split('\\n')\n    .filter(Boolean)\n    .map((data) =>\n      data\n        .split(':')\n        .map((v) => v?.trim())\n        .filter(Boolean)\n    )\n    .filter((v): v is [string, string] => v.length === 2)\n    .sort((a, b) => {\n      let aIndex = versionTagPriority.indexOf(a[0]);\n      let bIndex = versionTagPriority.indexOf(b[0]);\n      if (aIndex === -1) {\n        aIndex = Infinity;\n      } else if (bIndex === -1) {\n        bIndex = Infinity;\n      }\n      return aIndex - bIndex;\n    });\n\n  for (const [, version] of tags) {\n    if (major(version) === 2) {\n      return version;\n    }\n  }\n  log.warn('Failed to resolve the Qwik version tag, version \"2.0.0\" will be installed');\n  return '2.0.0';\n}\n\nexport async function installTsMorph() {\n  const packageJson = await readPackageJson(process.cwd());\n  if (packageJson.dependencies?.['ts-morph'] || packageJson.devDependencies?.['ts-morph']) {\n    return false;\n  }\n  const loading = spinner();\n  loading.start('Fetching migration tools..');\n  (packageJson.devDependencies ??= {})['ts-morph'] = '23';\n  await writePackageJson(process.cwd(), packageJson);\n  await runInstall();\n  loading.stop('Migration tools have been loaded');\n  return true;\n}\n\nasync function runInstall() {\n  const { install } = installDeps(getPackageManager(), process.cwd());\n  const passed = await install;\n  if (!passed) {\n    throw new Error('Failed to install dependencies');\n  }\n}\n\nexport async function removeTsMorphFromPackageJson() {\n  const packageJson = await readPackageJson(process.cwd());\n  delete packageJson.dependencies?.['ts-morph'];\n  delete packageJson.devDependencies?.['ts-morph'];\n  await writePackageJson(process.cwd(), packageJson);\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/migrate-v2/versions.ts",
    "content": "export const versionTagPriority = ['latest', 'v2', 'rc', 'beta', 'alpha'];\nexport const packageNames = [\n  '@qwik.dev/core',\n  '@qwik.dev/router',\n  '@qwik.dev/react',\n  'eslint-plugin-qwik',\n];\n"
  },
  {
    "path": "packages/qwik/src/cli/new/print-new-help.ts",
    "content": "import { cyan, magenta, gray, dim } from 'kleur/colors';\nimport { loadTemplates } from '../utils/templates';\nimport { pmRunCmd, note } from '../utils/utils';\n\nexport async function printNewHelp() {\n  const pmRun = pmRunCmd();\n  const templates = await loadTemplates();\n\n  const outString = [];\n  outString.push(`${cyan('Interactive')}`);\n  outString.push(`  ${pmRun} qwik ${magenta(`new`)}`);\n\n  outString.push(``);\n  outString.push(`${cyan('New route')}`);\n  outString.push(\n    `  ${pmRun} qwik ${magenta(`new /about`)}: ${dim('Create a new route for /about')}`\n  );\n\n  outString.push(``);\n  outString.push(`${cyan('New component')}`);\n  outString.push(\n    `  ${pmRun} qwik ${magenta(`new my-button`)}: ${dim(\n      'Create a new component in src/components/my-button'\n    )}`\n  );\n  outString.push(\n    `  ${pmRun} qwik ${magenta(`new nested/my-button`)}: ${dim(\n      'Create a new component in src/components/nested/my-button'\n    )}`\n  );\n\n  outString.push(``);\n  outString.push(`${cyan('Available templates')}`);\n  for (const t of templates) {\n    let postfix = '';\n    if (t.id === 'qwik') {\n      postfix = ' (default)';\n    }\n\n    outString.push(`  ${t.id}${gray(postfix)}`);\n  }\n\n  note(outString.join('\\n'), 'Available commands');\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/new/run-new-command.ts",
    "content": "import { green, bgMagenta, dim } from 'kleur/colors';\nimport fs from 'node:fs';\nimport { join } from 'path';\nimport { isCancel, select, text, log, intro } from '@clack/prompts';\nimport { bye } from '../utils/utils';\nimport type { Template } from '../types';\nimport type { AppCommand } from '../utils/app-command';\nimport { loadTemplates } from '../utils/templates';\nimport { printNewHelp } from './print-new-help';\nimport { POSSIBLE_TYPES } from './utils';\n\nconst SLUG_KEY = '[slug]';\nconst NAME_KEY = '[name]';\nconst MARKDOWN_SUFFIX = '.md';\nconst MDX_SUFFIX = '.mdx';\n\nexport async function runNewCommand(app: AppCommand) {\n  try {\n    // render help\n    if (app.args.length > 1 && app.args[1] === 'help') {\n      intro(`🔭  ${bgMagenta(' Qwik Help ')}`);\n      await printNewHelp();\n      bye();\n    } else {\n      intro(`✨  ${bgMagenta(' Create a new Qwik component or route ')}`);\n    }\n\n    const args = app.args.filter((a) => !a.startsWith('--'));\n\n    const mainInput = args.slice(1).join(' ');\n    let typeArg: 'route' | 'component' | 'markdown' | 'mdx' | undefined = undefined;\n    let nameArg: string | undefined;\n    let outDir: string | undefined;\n    if (mainInput && mainInput.startsWith('/')) {\n      if (mainInput.endsWith(MARKDOWN_SUFFIX)) {\n        typeArg = 'markdown';\n        nameArg = mainInput.replace(MARKDOWN_SUFFIX, '');\n      } else if (mainInput.endsWith(MDX_SUFFIX)) {\n        typeArg = 'mdx';\n        nameArg = mainInput.replace(MDX_SUFFIX, '');\n      } else {\n        typeArg = 'route';\n        nameArg = mainInput;\n      }\n    } else if (mainInput) {\n      typeArg = 'component';\n      nameArg = mainInput;\n    }\n\n    let templateArg = app.args\n      .filter((a) => a.startsWith('--'))\n      .map((a) => a.substring(2))\n      .join('');\n\n    if (!templateArg && mainInput) {\n      templateArg = 'qwik';\n    }\n\n    if (!typeArg) {\n      typeArg = await selectType();\n    }\n\n    if (!POSSIBLE_TYPES.includes(typeArg)) {\n      throw new Error(`Invalid type: ${typeArg}`);\n    }\n\n    if (!nameArg) {\n      nameArg = await selectName(typeArg);\n    }\n\n    const { name, slug } = parseInputName(nameArg);\n\n    let template: Template | undefined;\n    if (!templateArg) {\n      template = await selectTemplate(typeArg);\n    } else {\n      const allTemplates = await loadTemplates();\n      const templates = allTemplates.filter(\n        (i) => i.id === templateArg && i[typeArg!] && i[typeArg!].length\n      );\n\n      if (!templates.length) {\n        log.error(`Template \"${templateArg}\" not found`);\n        bye();\n      }\n\n      template = templates[0][typeArg][0];\n    }\n\n    if (typeArg === 'route' || typeArg === 'markdown' || typeArg === 'mdx') {\n      outDir = join(app.rootDir, 'src', `routes`, nameArg);\n    } else {\n      outDir = join(app.rootDir, 'src', `components`, nameArg);\n    }\n\n    const fileOutput = await writeToFile(name, slug, template, outDir);\n\n    log.success(`${green(`${toPascal([typeArg])} \"${slug}\" created!`)}`);\n    log.message(`Emitted in ${dim(fileOutput)}`);\n  } catch (e) {\n    log.error(String(e));\n    await printNewHelp();\n  }\n  bye();\n}\n\nasync function selectType() {\n  const typeAnswer = await select({\n    message: 'What would you like to create?',\n    options: [\n      { value: 'component', label: 'Component' },\n      { value: 'route', label: 'Route' },\n      { value: 'markdown', label: 'Route (Markdown)' },\n      { value: 'mdx', label: 'Route (MDX)' },\n    ],\n  });\n\n  if (isCancel(typeAnswer)) {\n    bye();\n  }\n\n  return typeAnswer as (typeof POSSIBLE_TYPES)[number];\n}\n\nasync function selectName(type: 'route' | 'component' | 'markdown' | 'mdx') {\n  const messages = {\n    route: 'New route path',\n    markdown: 'New Markdown route path',\n    mdx: 'New MDX route path',\n    component: 'Name your component',\n  };\n  const message = messages[type];\n\n  const placeholders = {\n    route: '/product/[id]',\n    markdown: '/some/page' + MARKDOWN_SUFFIX,\n    mdx: '/some/page' + MDX_SUFFIX,\n    component: 'my-component',\n  };\n  const placeholder = placeholders[type];\n\n  const nameAnswer = await text({\n    message,\n    placeholder,\n    validate: (v) => {\n      if (v.length < 1) {\n        return 'Value can not be empty';\n      }\n    },\n  });\n\n  if (isCancel(nameAnswer)) {\n    bye();\n  }\n  if (typeof nameAnswer !== 'string') {\n    bye();\n  }\n\n  let result = nameAnswer;\n\n  if (type !== 'component' && !nameAnswer.startsWith('/')) {\n    result = `/${result}`;\n  }\n\n  if (type === 'markdown') {\n    result = result.replace(MARKDOWN_SUFFIX, '');\n  } else if (type === 'mdx') {\n    result = result.replace(MDX_SUFFIX, '');\n  }\n\n  return result;\n}\n\nasync function selectTemplate(typeArg: (typeof POSSIBLE_TYPES)[number]) {\n  const allTemplates = await loadTemplates();\n\n  const templates = allTemplates.filter((i) => i[typeArg] && i[typeArg].length);\n\n  if (!templates.length) {\n    log.error(`No templates found for type \"${typeArg}\"`);\n    bye();\n  }\n  if (templates.length === 1) {\n    return templates[0][typeArg][0];\n  }\n  const templateAnswer = await select({\n    message: 'Which template would you like to use?',\n    options: templates.map((t) => ({ value: t[typeArg][0], label: t.id })),\n  });\n\n  if (isCancel(templateAnswer)) {\n    bye();\n  }\n\n  return templateAnswer as Template;\n}\n\nasync function writeToFile(name: string, slug: string, template: Template, outDir: string) {\n  // Build the full output file path + name\n  const outFile = join(outDir, template.relative);\n\n  // String replace the file path\n  const fileOutput = inject(outFile, [\n    [SLUG_KEY, slug],\n    ['.template', ''],\n  ]);\n\n  // Exit if the module already exists\n  if (fs.existsSync(fileOutput)) {\n    const filename = fileOutput.split('/').pop();\n    throw new Error(`\"${filename}\" already exists in \"${outDir}\"`);\n  }\n\n  // Get the template content\n  const text = await fs.promises.readFile(template.absolute, { encoding: 'utf-8' });\n\n  // String replace the template content\n  const templateOut = inject(text, [\n    [SLUG_KEY, slug],\n    [NAME_KEY, name],\n  ]);\n\n  // Create recursive folders\n  await fs.promises.mkdir(outDir, { recursive: true });\n\n  // Write to file\n  await fs.promises.writeFile(fileOutput, templateOut, { encoding: 'utf-8' });\n\n  return fileOutput;\n}\n\nfunction inject(raw: string, vars: string[][]) {\n  let output = raw;\n\n  for (const v of vars) {\n    output = output.replaceAll(v[0], v[1]);\n  }\n\n  return output;\n}\n\nfunction parseInputName(input: string) {\n  const parts = input.split(/[-_\\s]/g);\n\n  return {\n    slug: toSlug(parts),\n    name: toPascal(parts),\n  };\n}\n\nfunction toSlug(list: string[]) {\n  return list.join('-');\n}\n\nfunction toPascal(list: string[]) {\n  return list.map((p) => p[0].toUpperCase() + p.substring(1)).join('');\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/new/utils.ts",
    "content": "export const POSSIBLE_TYPES = ['component', 'route', 'markdown', 'mdx'] as const;\n"
  },
  {
    "path": "packages/qwik/src/cli/qwik.cjs",
    "content": "#!/usr/bin/env node\nconst qwik = require('./cli.cjs');\nqwik.runCli();\n"
  },
  {
    "path": "packages/qwik/src/cli/run.ts",
    "content": "/* eslint-disable no-console */\nimport { red, dim, cyan, bgMagenta } from 'kleur/colors';\nimport { AppCommand } from './utils/app-command';\nimport { runAddCommand } from './add/run-add-command';\nimport { runNewCommand } from './new/run-new-command';\nimport { runJokeCommand } from './joke/run-joke-command';\nimport { note, panic, pmRunCmd, printHeader, bye } from './utils/utils';\nimport { runBuildCommand } from './utils/run-build-command';\nimport { intro, isCancel, select, confirm } from '@clack/prompts';\nimport { runV2Migration } from './migrate-v2/run-migration';\nimport { runQwikClientCommand } from './check-client';\n\nconst SPACE_TO_HINT = 18;\nconst COMMANDS = [\n  {\n    value: 'add',\n    label: 'add',\n    hint: 'Add an integration to this app',\n    run: (app: AppCommand) => runAddCommand(app),\n    showInHelp: true,\n  },\n  {\n    value: 'build',\n    label: 'build',\n    hint: 'Parallelize builds and type checking',\n    run: (app: AppCommand) => runBuildCommand(app),\n    showInHelp: true,\n  },\n  {\n    value: 'build preview',\n    label: 'build preview',\n    hint: 'Same as \"build\", but for preview server',\n    run: (app: AppCommand) => runBuildCommand(app),\n    showInHelp: true,\n  },\n  {\n    value: 'new',\n    label: 'new',\n    hint: 'Create a new component or route',\n    run: (app: AppCommand) => runNewCommand(app),\n    showInHelp: true,\n  },\n  {\n    value: 'joke',\n    label: 'joke',\n    hint: 'Tell a random dad joke',\n    run: () => runJokeCommand(),\n    showInHelp: true,\n  },\n  {\n    value: 'migrate-v2',\n    label: 'migrate-v2',\n    hint: 'Rescopes the application from @builder.io/* namespace to @qwik.dev/*',\n    run: (app: AppCommand) => runV2Migration(app),\n    showInHelp: false,\n  },\n  {\n    value: 'check-client',\n    label: 'check-client',\n    hint: 'Make sure the client bundle is up-to-date with the source code',\n    run: (app: AppCommand) => runQwikClientCommand(app),\n    showInHelp: true,\n  },\n  {\n    value: 'help',\n    label: 'help',\n    hint: 'Show this help',\n    run: (app: AppCommand) => printHelp(app),\n    showInHelp: false,\n  },\n  {\n    value: 'version',\n    label: 'version',\n    hint: 'Show the version',\n    run: () => printVersion(),\n    showInHelp: false,\n  },\n];\n\nexport async function runCli() {\n  printHeader();\n\n  try {\n    const app = new AppCommand({\n      rootDir: '',\n      cwd: process.cwd(),\n      args: process.argv.slice(2),\n    });\n    await runCommand(app);\n  } catch (e) {\n    panic(String(e));\n  }\n}\n\nasync function runCommand(app: AppCommand) {\n  switch (app.task) {\n    case 'add': {\n      await runAddCommand(app);\n      return;\n    }\n    case 'build': {\n      await runBuildCommand(app);\n      return;\n    }\n    case 'help': {\n      printHelp(app);\n      return;\n    }\n    case 'new': {\n      await runNewCommand(app);\n      return;\n    }\n    case 'joke': {\n      await runJokeCommand();\n      return;\n    }\n    case 'migrate-v2': {\n      await runV2Migration(app);\n      return;\n    }\n    case 'check-client': {\n      await runQwikClientCommand(app);\n      return;\n    }\n    case 'version': {\n      printVersion();\n      return;\n    }\n  }\n\n  if (typeof app.task === 'string') {\n    console.log(red(`Unrecognized qwik command: ${app.task}`) + '\\n');\n  }\n\n  await printHelp(app);\n  process.exit(1);\n}\n\nasync function printHelp(app: AppCommand) {\n  const pmRun = pmRunCmd();\n\n  intro(`🔭  ${bgMagenta(' Qwik Help ')}`);\n\n  note(\n    COMMANDS.filter((cmd) => cmd.showInHelp)\n      .map(\n        (cmd) =>\n          `${pmRun} qwik ${cyan(cmd.label)}` +\n          ' '.repeat(Math.max(SPACE_TO_HINT - cmd.label.length, 2)) +\n          dim(cmd.hint)\n      )\n      .join('\\n'),\n    'Available commands'\n  );\n\n  const proceed = await confirm({\n    message: 'Do you want to run a command?',\n    initialValue: true,\n  });\n\n  if (isCancel(proceed) || !proceed) {\n    bye();\n  }\n\n  const command = await select({\n    message: 'Select a command',\n    options: COMMANDS.filter((cmd) => cmd.showInHelp).map((cmd) => ({\n      value: cmd.value,\n      label: `${pmRun} qwik ${cyan(cmd.label)}`,\n      hint: cmd.hint,\n    })),\n  });\n\n  if (isCancel(command)) {\n    bye();\n  }\n  const args = (command as string).split(' ');\n  await runCommand(Object.assign(app, { task: args[0], args }));\n}\n\nfunction printVersion() {\n  console.log((globalThis as any).QWIK_VERSION);\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/types.ts",
    "content": "import type { AppCommand } from './utils/app-command';\n\nexport interface CreateAppOptions {\n  starterId: string;\n  outDir: string;\n}\n\nexport interface CreateAppResult extends CreateAppOptions {\n  docs: string[];\n  pkgManager: string;\n}\n\nexport interface UpdateAppOptions {\n  rootDir: string;\n  integration: string;\n  installDeps?: boolean;\n  projectDir?: string;\n}\n\nexport interface UpdateAppResult {\n  rootDir: string;\n  integration: IntegrationData;\n  updates: FsUpdates;\n  commit: (showSpinner?: boolean) => Promise<void>;\n}\n\nexport interface FsUpdates {\n  files: {\n    path: string;\n    content: string | Buffer;\n    type: 'create' | 'overwrite' | 'modify';\n  }[];\n  installedDeps: { [dep: string]: string };\n  installedScripts: string[];\n}\n\nexport interface IntegrationData {\n  id: string;\n  type: IntegrationType;\n  name: string;\n  pkgJson: IntegrationPackageJson;\n  dir: string;\n  target?: string;\n  priority: number;\n  docs: string[];\n  viteConfig?: ViteConfigUpdates;\n  // Files and folders that should be copied to root ignoring `projectDir`\n  alwaysInRoot?: string[];\n}\n\nexport type IntegrationType = 'app' | 'feature' | 'adapter';\n\nexport interface Feature {\n  id: string;\n  description: string;\n  add: FeatureCmd;\n}\n\nexport type FeatureCmd = (app: AppCommand) => Promise<void>;\n\nexport interface NextSteps {\n  title?: string;\n  lines: string[];\n}\n\nexport interface IntegrationPackageJson {\n  name: string;\n  description: string;\n  version?: string;\n  scripts?: { [k: string]: string };\n  dependencies?: { [k: string]: string };\n  devDependencies?: { [k: string]: string };\n  peerDependencies?: { [k: string]: string };\n  optionalDependencies?: { [k: string]: string };\n  engines?: { node: string };\n  private?: boolean;\n  files?: string[];\n  main?: string;\n  exports?: any;\n  module?: string;\n  qwik?: string;\n  qwikTemplates?: string[];\n  types?: string;\n  type?: string;\n  __qwik__?: QwikIntegrationConfig;\n}\n\nexport interface QwikIntegrationConfig {\n  displayName?: string;\n  nextSteps?: NextSteps;\n  docs?: string[];\n  priority: number;\n  postInstall?: string;\n  viteConfig?: ViteConfigUpdates;\n  alwaysInRoot?: string[];\n}\n\nexport interface EnsureImport {\n  defaultImport?: string;\n  namedImports?: string[];\n  importPath: string;\n}\n\nexport interface ViteConfigUpdates {\n  imports?: EnsureImport[];\n  viteConfig?: { [key: string]: string };\n  vitePlugins?: string[];\n  vitePluginsPrepend?: string[];\n  qwikViteConfig?: { [key: string]: string };\n}\n\nexport interface Template {\n  absolute: string;\n  relative: string;\n}\n\nexport interface TemplateSet {\n  id: string;\n  component: Template[];\n  route: Template[];\n  markdown: Template[];\n  mdx: Template[];\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/utils/app-command.ts",
    "content": "import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport type { PackageJSON } from '../../../../../scripts/types.ts';\n\nexport class AppCommand {\n  args: string[];\n  task: string;\n  cwd: string;\n  private _rootDir: string | undefined;\n  private _rootPkgJson: PackageJSON | undefined;\n\n  constructor(opts: { rootDir: string; cwd: string; args: string[] }) {\n    this._rootDir = opts.rootDir;\n    this.cwd = opts.cwd;\n    this.args = opts.args.slice();\n    this.task = this.args[0];\n  }\n\n  get rootDir() {\n    if (!this._rootDir) {\n      const fsRoot = resolve('/');\n      let testDir = process.cwd();\n      for (let i = 0; i < 20; i++) {\n        const pkgPath = join(testDir, 'package.json');\n        if (existsSync(pkgPath)) {\n          this._rootDir = testDir;\n          break;\n        }\n        if (testDir === fsRoot) {\n          break;\n        }\n        testDir = dirname(testDir);\n      }\n      if (!this._rootDir) {\n        throw new Error(`Unable to find Qwik app package.json`);\n      }\n    }\n    return this._rootDir;\n  }\n\n  set rootDir(rootDir) {\n    this._rootDir = rootDir;\n  }\n\n  get packageJson(): PackageJSON {\n    if (!this._rootPkgJson) {\n      const pkgJsonPath = join(this.rootDir, 'package.json');\n      this._rootPkgJson = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));\n    }\n    return this._rootPkgJson!;\n  }\n\n  getArg(name: string): string | undefined {\n    const key = `--${name}`;\n    const matcher = new RegExp(`^${key}($|=)`);\n    const index = this.args.findIndex((arg) => matcher.test(arg));\n    if (index === -1) {\n      return;\n    }\n\n    if (this.args[index].includes('=')) {\n      return this.args[index].split('=')[1];\n    }\n    return this.args[index + 1];\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/utils/install-deps.ts",
    "content": "import { bgRed, cyan, red } from 'kleur/colors';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { log } from '@clack/prompts';\nimport type { IntegrationData } from '../types';\nimport { runCommand } from './utils';\n\nexport function installDeps(pkgManager: string, dir: string) {\n  return runCommand(pkgManager, ['install'], dir);\n}\n\nexport function runInPkg(pkgManager: string, args: string[], cwd: string) {\n  const cmd = pkgManager === 'npm' ? 'npx' : pkgManager;\n  return runCommand(cmd, args, cwd);\n}\n\n/**\n * This does an initial install of the base dependencies in the background while the install is\n * running. Afterwards the actual dependencies get added and the package manager re-run\n */\nexport function backgroundInstallDeps(pkgManager: string, baseApp: IntegrationData) {\n  const { tmpInstallDir } = setupTmpInstall(baseApp);\n\n  const { install, abort } = installDeps(pkgManager, tmpInstallDir);\n\n  const complete = async (outDir: string) => {\n    let success = false;\n\n    try {\n      const installed = await install;\n      if (installed) {\n        const tmpNodeModules = path.join(tmpInstallDir, 'node_modules');\n        const appNodeModules = path.join(outDir, 'node_modules');\n        await fs.promises.rename(tmpNodeModules, appNodeModules);\n\n        try {\n          await fs.promises.rename(\n            path.join(tmpInstallDir, 'package-lock.json'),\n            path.join(outDir, 'package-lock.json')\n          );\n        } catch (e) {\n          //\n        }\n        try {\n          await fs.promises.rename(\n            path.join(tmpInstallDir, 'yarn.lock'),\n            path.join(outDir, 'yarn.lock')\n          );\n        } catch (e) {\n          //\n        }\n        try {\n          await fs.promises.rename(\n            path.join(tmpInstallDir, 'pnpm-lock.yaml'),\n            path.join(outDir, 'pnpm-lock.yaml')\n          );\n        } catch (e) {\n          //\n        }\n\n        success = true;\n        fs.rmSync(tmpInstallDir, { recursive: true });\n      }\n    } catch (e: any) {\n      if (e) {\n        if (e.message) {\n          log.error(red(String(e.message)) + `\\n\\n`);\n        } else {\n          log.error(red(String(e)) + `\\n\\n`);\n        }\n      }\n    }\n\n    if (!success) {\n      const errorMessage =\n        `${bgRed(` ${pkgManager} install failed `)}\\n` +\n        ` You might need to run ${cyan(\n          `\"${pkgManager} install\"`\n        )} manually inside the root of the project.\\n\\n`;\n      log.error(errorMessage);\n    }\n\n    return success;\n  };\n\n  const out = {\n    abort: () => abort().finally(() => fs.rmSync(tmpInstallDir, { recursive: true })),\n    complete,\n    success: undefined as boolean | undefined,\n  };\n  install.then((success) => (out.success = success));\n\n  return out;\n}\n\nfunction setupTmpInstall(baseApp: IntegrationData) {\n  const tmpId =\n    '.create-qwik-' +\n    Math.round(Math.random() * Number.MAX_SAFE_INTEGER)\n      .toString(36)\n      .toLowerCase();\n  // Keep in same mountpoint so renames can move quickly\n  const tmpInstallDir = path.resolve(baseApp.target!, '..', tmpId);\n\n  try {\n    fs.mkdirSync(tmpInstallDir);\n  } catch (e) {\n    log.error(`❌ ${red(String(e))}`);\n  }\n\n  const basePkgJson = path.join(baseApp.dir, 'package.json');\n  const tmpPkgJson = path.join(tmpInstallDir, 'package.json');\n  fs.copyFileSync(basePkgJson, tmpPkgJson);\n\n  return { tmpInstallDir };\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/utils/integrations.ts",
    "content": "import fs from 'node:fs';\nimport { join } from 'node:path';\nimport type { IntegrationData, IntegrationType } from '../types';\nimport { dashToTitleCase, limitLength, readPackageJson } from './utils';\n\nlet integrations: IntegrationData[] | null = null;\n\nexport async function sortIntegrationsAndReturnAsClackOptions(\n  integrations: IntegrationData[],\n  { maxHintLength = 50, showHint = true }: { maxHintLength?: number; showHint?: boolean } = {}\n) {\n  return integrations\n    .sort((a, b) => {\n      if (a.priority > b.priority) {\n        return -1;\n      }\n      if (a.priority < b.priority) {\n        return 1;\n      }\n      return a.id < b.id ? -1 : 1;\n    })\n    .map((i) => ({\n      value: i.id,\n      label: i.name,\n      hint: (showHint && limitLength(i.pkgJson.description, maxHintLength)) || undefined,\n    }));\n}\n\nexport async function loadIntegrations() {\n  if (!integrations) {\n    const loadingIntegrations: IntegrationData[] = [];\n    const integrationTypes: IntegrationType[] = ['app', 'feature', 'adapter'];\n\n    const integrationsDir = join(__dirname, 'starters');\n    const integrationsDirNames = await fs.promises.readdir(integrationsDir);\n\n    await Promise.all(\n      integrationsDirNames.map(async (integrationsDirName) => {\n        const integrationType = integrationsDirName.slice(0, integrationsDirName.length - 1) as any;\n        if (integrationTypes.includes(integrationType)) {\n          const dir = join(integrationsDir, integrationsDirName);\n\n          const dirItems = await fs.promises.readdir(dir);\n          await Promise.all(\n            dirItems.map(async (dirItem) => {\n              const dirPath = join(dir, dirItem);\n              const stat = await fs.promises.stat(dirPath);\n              if (stat.isDirectory()) {\n                const pkgJson = await readPackageJson(dirPath);\n                const integration: IntegrationData = {\n                  id: dirItem,\n                  name: pkgJson.__qwik__?.displayName ?? dashToTitleCase(dirItem),\n                  type: integrationType,\n                  dir: dirPath,\n                  pkgJson,\n                  docs: pkgJson.__qwik__?.docs ?? [],\n                  priority: pkgJson?.__qwik__?.priority ?? 0,\n                  alwaysInRoot: pkgJson.__qwik__?.alwaysInRoot ?? [],\n                };\n                loadingIntegrations.push(integration);\n              }\n            })\n          );\n        }\n      })\n    );\n\n    loadingIntegrations.sort((a, b) => {\n      if (a.priority > b.priority) {\n        return -1;\n      }\n      if (a.priority < b.priority) {\n        return 1;\n      }\n      return a.id < b.id ? -1 : 1;\n    });\n\n    integrations = loadingIntegrations;\n  }\n\n  return integrations;\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/utils/log.ts",
    "content": "import type { NextSteps } from '../types';\nimport { cyan } from 'kleur/colors';\n\nexport function logSuccessFooter(docs: string[]) {\n  const outString = [];\n\n  if (docs.length > 0) {\n    outString.push(`📄 ${cyan('Relevant docs:')}`);\n    docs.forEach((link) => {\n      outString.push(`   ${link}`);\n    });\n  }\n  outString.push(``);\n  outString.push(`💬 ${cyan('Questions? Start the conversation at:')}`);\n  outString.push(`   https://qwik.dev/chat`);\n  outString.push(`   https://twitter.com/QwikDev`);\n  outString.push(``);\n\n  return outString.join('\\n');\n}\n\n/** Log the next STEPS _ACTION REQUIRED_ */\nexport function logNextStep(nextSteps: NextSteps | undefined, packageManager: string) {\n  const outString: string[] = [];\n  if (nextSteps) {\n    nextSteps.lines.forEach((step) =>\n      outString.push(`${step.replace(/\\bpnpm\\b/g, packageManager)}`)\n    );\n  }\n  return outString.join('\\n');\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/utils/run-build-command.ts",
    "content": "/* eslint-disable no-console */\nimport { execaCommand } from 'execa';\nimport { bgMagenta, cyan, dim, magenta, red } from 'kleur/colors';\nimport type { AppCommand } from './app-command';\nimport { getPackageManager, pmRunCmd } from './utils';\ninterface Step {\n  title: string;\n  stdout?: string;\n}\nexport async function runBuildCommand(app: AppCommand) {\n  const pkgJsonScripts = app.packageJson.scripts;\n  if (!pkgJsonScripts) {\n    throw new Error(`No \"scripts\" property found in package.json`);\n  }\n  const pkgManager = getPackageManager();\n\n  const getScript = (name: string) => {\n    if (pkgJsonScripts[name]) {\n      return `${pkgManager} run ${name}`;\n    }\n    return undefined;\n  };\n\n  const isPreviewBuild = app.args.includes('preview');\n  const buildLibScript = getScript('build.lib');\n  const isLibraryBuild = !!buildLibScript;\n  const buildClientScript = getScript('build.client');\n  const buildPreviewScript = isPreviewBuild ? getScript('build.preview') : undefined;\n  const buildServerScript = !isPreviewBuild ? getScript('build.server') : undefined;\n  const buildStaticScript = getScript('build.static');\n  const runSsgScript = getScript('ssg');\n  const buildTypes = getScript('build.types');\n  const lint = getScript('lint');\n  const mode = app.getArg('mode');\n\n  const prebuildScripts = Object.keys(pkgJsonScripts)\n    .filter((s) => s.startsWith('prebuild.'))\n    .map(getScript)\n    .filter(isString);\n\n  const postbuildScripts = Object.keys(pkgJsonScripts)\n    .filter((s) => s.startsWith('postbuild.'))\n    .map(getScript)\n    .filter(isString);\n\n  const scripts = [\n    buildTypes,\n    buildClientScript,\n    buildLibScript,\n    buildPreviewScript,\n    buildServerScript,\n    buildStaticScript,\n    lint,\n  ].filter(isString);\n\n  if (!isLibraryBuild && !buildClientScript) {\n    console.log(pkgJsonScripts);\n    throw new Error(`\"build.client\" script not found in package.json`);\n  }\n\n  if (isPreviewBuild && !buildPreviewScript && !buildStaticScript) {\n    throw new Error(\n      `Neither \"build.preview\" or \"build.static\" script found in package.json for preview`\n    );\n  }\n\n  console.log(``);\n  for (const script of prebuildScripts) {\n    console.log(dim(script!));\n  }\n  for (const script of scripts) {\n    console.log(dim(script!));\n  }\n  for (const script of postbuildScripts) {\n    console.log(dim(script!));\n  }\n  console.log(``);\n\n  let typecheck: Promise<Step> | null = null;\n\n  for (const script of prebuildScripts) {\n    try {\n      await execaCommand(script, {\n        cwd: app.rootDir,\n        stdout: 'inherit',\n        stderr: 'inherit',\n        env: {\n          FORCE_COLOR: 'true',\n        },\n      });\n    } catch (e) {\n      console.error(script, 'failed');\n      process.exitCode = 1;\n      throw e;\n    }\n  }\n\n  if (buildTypes) {\n    let copyScript = buildTypes;\n    if (!copyScript.includes('--pretty')) {\n      // ensures colors flow throw when we console log the stdout\n      copyScript += ' --pretty';\n    }\n    typecheck = execaCommand(copyScript, {\n      stdout: 'inherit',\n      stderr: 'inherit',\n      cwd: app.rootDir,\n    })\n      .then(() => ({\n        title: 'Type checked',\n      }))\n      .catch((e) => {\n        let out = e.stdout || '';\n        if (out.startsWith('tsc')) {\n          out = out.slice(3);\n        }\n        console.log('\\n' + out);\n        process.exitCode = 1;\n        throw new Error(`Type check failed: ${out}`);\n      });\n  }\n\n  if (buildClientScript) {\n    const script = attachArg(buildClientScript, 'mode', mode);\n    await execaCommand(script, {\n      stdout: 'inherit',\n      stderr: 'inherit',\n      cwd: app.rootDir,\n    }).catch((error) => {\n      process.exitCode = 1;\n      throw new Error(`Client build failed: ${error}`);\n    });\n\n    console.log(``);\n    console.log(`${cyan('✓')} Built client modules`);\n  }\n\n  const step2: Promise<Step>[] = [];\n\n  if (buildLibScript) {\n    const script = attachArg(buildLibScript, 'mode', mode);\n    const libBuild = execaCommand(script, {\n      stdout: 'inherit',\n      stderr: 'inherit',\n      cwd: app.rootDir,\n      env: {\n        FORCE_COLOR: 'true',\n      },\n    })\n      .then((e) => ({\n        title: 'Built library modules',\n        stdout: e.stdout,\n      }))\n      .catch((e) => {\n        console.log(``);\n        if (e.stderr) {\n          console.log(e.stderr);\n        } else {\n          console.log(e.stdout);\n        }\n        console.log(``);\n        process.exitCode = 1;\n        throw e;\n      });\n    step2.push(libBuild);\n  }\n\n  if (buildPreviewScript) {\n    const script = attachArg(buildPreviewScript, 'mode', mode);\n    const previewBuild = execaCommand(script, {\n      stdout: 'inherit',\n      stderr: 'inherit',\n      cwd: app.rootDir,\n      env: {\n        FORCE_COLOR: 'true',\n      },\n    })\n      .then((e) => ({\n        title: 'Built preview (ssr) modules',\n        stdout: e.stdout,\n      }))\n      .catch((e) => {\n        console.log(``);\n        if (e.stderr) {\n          console.log(e.stderr);\n        } else {\n          console.log(e.stdout);\n        }\n        console.log(``);\n        process.exitCode = 1;\n        throw e;\n      });\n    step2.push(previewBuild);\n  }\n\n  if (buildServerScript) {\n    const script = attachArg(buildServerScript, 'mode', mode);\n    const serverBuild = execaCommand(script, {\n      stdout: 'inherit',\n      stderr: 'inherit',\n      cwd: app.rootDir,\n      env: {\n        FORCE_COLOR: 'true',\n      },\n    })\n      .then((e) => ({\n        title: 'Built server (ssr) modules',\n        stdout: e.stdout,\n      }))\n      .catch((e) => {\n        console.log(``);\n        if (e.stderr) {\n          console.log(e.stderr);\n        } else {\n          console.log(e.stdout);\n        }\n        console.log(``);\n        process.exitCode = 1;\n        throw e;\n      });\n    step2.push(serverBuild);\n  }\n\n  if (buildStaticScript) {\n    const staticBuild = execaCommand(buildStaticScript, {\n      stdout: 'inherit',\n      stderr: 'inherit',\n      cwd: app.rootDir,\n      env: {\n        FORCE_COLOR: 'true',\n      },\n    })\n      .then((e) => ({\n        title: 'Built static (ssg) modules',\n        stdout: e.stdout,\n      }))\n      .catch((e) => {\n        console.log(``);\n        if (e.stderr) {\n          console.log(e.stderr);\n        } else {\n          console.log(e.stdout);\n        }\n        console.log(``);\n        process.exitCode = 1;\n        throw e;\n      });\n    step2.push(staticBuild);\n  }\n\n  if (typecheck) {\n    step2.push(typecheck);\n  }\n\n  if (lint) {\n    const lintBuild = execaCommand(lint, {\n      stdout: 'inherit',\n      stderr: 'inherit',\n      cwd: app.rootDir,\n      env: {\n        FORCE_COLOR: 'true',\n      },\n    })\n      .then(() => ({\n        title: 'Lint checked',\n      }))\n      .catch((e) => {\n        console.log(``);\n        console.log(e.stdout);\n        console.error(e.stderr);\n        console.log(``);\n        process.exitCode = 1;\n        throw e;\n      });\n    step2.push(lintBuild);\n  }\n\n  if (step2.length > 0) {\n    await Promise.all(step2)\n      .then((steps) => {\n        steps.forEach((step) => {\n          if (step.stdout) {\n            console.log('');\n            console.log(step.stdout);\n          }\n          console.log(`${cyan('✓')} ${step.title}`);\n        });\n\n        if (!isPreviewBuild && !buildServerScript && !buildStaticScript && !isLibraryBuild) {\n          const pmRun = pmRunCmd();\n          console.log(``);\n          console.log(`${bgMagenta(' Missing an integration ')}`);\n          console.log(``);\n          console.log(`${magenta('・')} Use ${magenta(pmRun + ' qwik add')} to add an integration`);\n          console.log(`${magenta('・')} Use ${magenta(pmRun + ' preview')} to preview the build`);\n        }\n\n        if (isPreviewBuild && buildStaticScript && runSsgScript) {\n          return execaCommand(buildStaticScript, {\n            stdout: 'inherit',\n            stderr: 'inherit',\n            cwd: app.rootDir,\n            env: {\n              FORCE_COLOR: 'true',\n            },\n          }).catch((e) => {\n            console.log(``);\n            if (e.stderr) {\n              console.log(e.stderr);\n            } else {\n              console.log(e.stdout);\n            }\n            console.log(``);\n            process.exitCode = 1;\n          });\n        }\n      })\n      .catch((error) => console.log(red(error)));\n  }\n\n  for (const script of postbuildScripts) {\n    try {\n      await execaCommand(script, {\n        stdout: 'inherit',\n        stderr: 'inherit',\n        cwd: app.rootDir,\n        env: {\n          FORCE_COLOR: 'true',\n        },\n      });\n    } catch (e) {\n      console.error(script, 'failed');\n      process.exitCode = 1;\n      throw e;\n    }\n  }\n\n  console.log(``);\n}\n\nfunction attachArg(command: string, key: string, value?: string): string {\n  if (value !== undefined) {\n    return `${command} --${key} ${value}`;\n  }\n  return command;\n}\n\nfunction isString(s: string | null | undefined): s is string {\n  return typeof s === 'string' && s.trim().length > 0;\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/utils/templates.ts",
    "content": "import fs from 'node:fs';\nimport { join, sep } from 'node:path';\nimport type { TemplateSet } from '../types';\nimport { getFilesDeep } from './utils';\n\nlet templates: TemplateSet[] | null = null;\n\nexport async function loadTemplates() {\n  if (!templates) {\n    const allTemplates: TemplateSet[] = [];\n\n    const templatesDir = join(__dirname, 'templates');\n    const templatesDirNames = await fs.promises.readdir(templatesDir);\n\n    await Promise.all(\n      templatesDirNames.map(async (templatesDirName) => {\n        const dir = join(templatesDir, templatesDirName);\n        const files = await readTemplates(dir);\n        const template = { id: templatesDirName, ...files };\n        allTemplates.push(template);\n      })\n    );\n\n    // Sort qwik templates first so they can be overridden, then alphabetical\n    allTemplates.sort((a, b) => {\n      if (a.id === 'qwik') {\n        return -1;\n      } else if (b.id === 'qwik') {\n        return 1;\n      }\n\n      return a.id > b.id ? 1 : -1;\n    });\n\n    templates = allTemplates;\n  }\n\n  return templates;\n}\n\nexport async function readTemplates(rootDir: string) {\n  const componentDir = join(rootDir, 'component');\n  const routeDir = join(rootDir, 'route');\n  const markdownDir = join(rootDir, 'markdown');\n  const mdxDir = join(rootDir, 'mdx');\n\n  const component = await getFilesDeep(componentDir);\n  const route = await getFilesDeep(routeDir);\n  const markdown = await getFilesDeep(markdownDir);\n  const mdx = await getFilesDeep(mdxDir);\n\n  return {\n    component: component.map((c) => parseTemplatePath(c, 'component')),\n    route: route.map((r) => parseTemplatePath(r, 'route')),\n    markdown: markdown.map((m) => parseTemplatePath(m, 'markdown')),\n    mdx: mdx.map((m) => parseTemplatePath(m, 'mdx')),\n  };\n}\n\nfunction parseTemplatePath(path: string, type: string) {\n  const parts = path.split(sep + type + sep);\n\n  return {\n    absolute: path,\n    relative: parts[1],\n  };\n}\n"
  },
  {
    "path": "packages/qwik/src/cli/utils/utils.ts",
    "content": "import { blue, gray, green, magenta, red, reset, white } from 'kleur/colors';\nimport { log, outro } from '@clack/prompts';\n\nimport type { ChildProcess } from 'node:child_process';\nimport type { IntegrationPackageJson } from '../types';\nimport detectPackageManager from 'which-pm-runs';\nimport fs from 'node:fs';\nimport { join } from 'node:path';\nimport spawn from 'cross-spawn';\n\nexport function runCommand(cmd: string, args: string[], cwd: string) {\n  let child: ChildProcess;\n\n  const install = new Promise<boolean>((resolve) => {\n    try {\n      child = spawn(cmd, args, {\n        cwd,\n        stdio: 'ignore',\n      });\n\n      child.on('error', (e) => {\n        if (e) {\n          if (e.message) {\n            log.error(red(String(e.message)) + `\\n\\n`);\n          } else {\n            log.error(red(String(e)) + `\\n\\n`);\n          }\n        }\n        resolve(false);\n      });\n\n      child.on('close', (code) => {\n        if (code === 0) {\n          resolve(true);\n        } else {\n          resolve(false);\n        }\n      });\n    } catch (e) {\n      resolve(false);\n    }\n  });\n\n  const abort = async () => {\n    if (child) {\n      child.kill('SIGINT');\n    }\n  };\n\n  return { abort, install };\n}\n\nexport async function readPackageJson(dir: string) {\n  const path = join(dir, 'package.json');\n  const pkgJson: IntegrationPackageJson = JSON.parse(await fs.promises.readFile(path, 'utf-8'));\n  return pkgJson;\n}\n\nexport async function writePackageJson(dir: string, pkgJson: IntegrationPackageJson) {\n  const path = join(dir, 'package.json');\n  await fs.promises.writeFile(path, JSON.stringify(pkgJson, null, 2) + '\\n');\n}\n\nexport function wait(ms: number) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport function cleanPackageJson(srcPkg: IntegrationPackageJson) {\n  srcPkg = { ...srcPkg };\n\n  const cleanedPkg: IntegrationPackageJson = {\n    name: srcPkg.name,\n    version: srcPkg.version,\n    description: srcPkg.description,\n    scripts: srcPkg.scripts,\n    dependencies: srcPkg.dependencies,\n    devDependencies: srcPkg.devDependencies,\n    main: srcPkg.main,\n    qwik: srcPkg.qwik,\n    module: srcPkg.module,\n    types: srcPkg.types,\n    exports: srcPkg.exports,\n    files: srcPkg.files,\n    engines: { node: '^18.17.0 || ^20.3.0 || >=21.0.0' },\n  };\n\n  Object.keys(cleanedPkg).forEach((prop) => {\n    delete (srcPkg as any)[prop];\n  });\n  delete srcPkg.__qwik__;\n\n  const sortedKeys = Object.keys(srcPkg).sort();\n  for (const key of sortedKeys) {\n    (cleanedPkg as any)[key] = (srcPkg as any)[key];\n  }\n\n  return cleanedPkg;\n}\n\nexport function dashToTitleCase(str: string) {\n  return str\n    .toLocaleLowerCase()\n    .split('-')\n    .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n    .join(' ');\n}\n\nexport function toDashCase(str: string) {\n  return str.toLocaleLowerCase().replace(/ /g, '-');\n}\n\nexport function limitLength(hint: string, maxLength: number = 50) {\n  if (hint.length > maxLength) {\n    return hint.substring(0, maxLength - 3) + '...';\n  }\n  return hint;\n}\n\nexport function getPackageManager() {\n  return detectPackageManager()?.name || 'pnpm';\n}\n\nexport function pmRunCmd() {\n  const pm = getPackageManager();\n  if (pm !== 'npm') {\n    return pm;\n  }\n  return `${pm} run`;\n}\n\nexport function panic(msg: string) {\n  console.error(`\\n❌ ${red(msg)}\\n`);\n  process.exit(1);\n}\n\nexport function bye(): never {\n  outro('Take care, see you soon! 👋');\n  process.exit(0);\n}\n\nexport function printHeader() {\n  /* eslint-disable no-console */\n  console.log(\n    blue(`\n      ${magenta('............')}\n    .::: ${magenta(':--------:.')}\n   .::::  ${magenta('.:-------:.')}\n  .:::::.   ${magenta('.:-------.')}\n  ::::::.     ${magenta('.:------.')}\n ::::::.        ${magenta(':-----:')}\n ::::::.       ${magenta('.:-----.')}\n  :::::::.     ${magenta('.-----.')}\n   ::::::::..   ${magenta('---:.')}\n    .:::::::::. ${magenta(':-:.')}\n     ..::::::::::::\n             ...::::\n    `),\n    '\\n'\n  );\n}\n\nexport async function getFilesDeep(root: string) {\n  const files: string[] = [];\n\n  async function getFiles(directory: string) {\n    if (!fs.existsSync(directory)) {\n      return;\n    }\n\n    const filesInDirectory = await fs.promises.readdir(directory);\n    for (const file of filesInDirectory) {\n      const absolute = join(directory, file);\n\n      if (fs.statSync(absolute).isDirectory()) {\n        await getFiles(absolute);\n      } else {\n        files.push(absolute);\n      }\n    }\n  }\n\n  await getFiles(root);\n  return files;\n}\n\n// Used from https://github.com/sindresorhus/is-unicode-supported/blob/main/index.js\nexport default function isUnicodeSupported() {\n  if (process.platform !== 'win32') {\n    return process.env.TERM !== 'linux'; // Linux console (kernel)\n  }\n\n  return (\n    Boolean(process.env.CI) ||\n    Boolean(process.env.WT_SESSION) || // Windows Terminal\n    Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)\n    process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder\n    process.env.TERM_PROGRAM === 'Terminus-Sublime' ||\n    process.env.TERM_PROGRAM === 'vscode' ||\n    process.env.TERM === 'xterm-256color' ||\n    process.env.TERM === 'alacritty' ||\n    process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm'\n  );\n}\n\n// Used from https://github.com/natemoo-re/clack/blob/main/packages/prompts/src/index.ts\nconst unicode = isUnicodeSupported();\nconst s = (c: string, fallback: string) => (unicode ? c : fallback);\nconst S_BAR = s('│', '|');\nconst S_BAR_H = s('─', '-');\nconst S_CORNER_TOP_RIGHT = s('╮', '+');\nconst S_CONNECT_LEFT = s('├', '+');\nconst S_CORNER_BOTTOM_RIGHT = s('╯', '+');\nconst S_STEP_SUBMIT = s('◇', 'o');\n\nfunction ansiRegex() {\n  const pattern = [\n    '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n    '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))',\n  ].join('|');\n\n  return new RegExp(pattern, 'g');\n}\n\nconst strip = (str: string) => str.replace(ansiRegex(), '');\nexport const note = (message = '', title = '') => {\n  const lines = `\\n${message}\\n`.split('\\n');\n  const titleLen = strip(title).length;\n  const len =\n    Math.max(\n      lines.reduce((sum, ln) => {\n        ln = strip(ln);\n        return ln.length > sum ? ln.length : sum;\n      }, 0),\n      titleLen\n    ) + 2;\n  const msg = lines\n    .map((ln) => `${gray(S_BAR)}  ${white(ln)}${' '.repeat(len - strip(ln).length)}${gray(S_BAR)}`)\n    .join('\\n');\n  process.stdout.write(\n    `${gray(S_BAR)}\\n${green(S_STEP_SUBMIT)}  ${reset(title)} ${gray(\n      S_BAR_H.repeat(Math.max(len - titleLen - 1, 1)) + S_CORNER_TOP_RIGHT\n    )}\\n${msg}\\n${gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\\n`\n  );\n};\n// End of used code from clack\n"
  },
  {
    "path": "packages/qwik/src/core/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik/src/core/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik.core\",\n    \"reportFolder\": \"<projectFolder>/src/core/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/core/\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/dist/core.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>../../dist-dev/api/qwik/core/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/core/component/component.public.ts",
    "content": "import { $, type PropFnInterface, type QRL } from '../qrl/qrl.public';\nimport type { JSXNode, JSXOutput } from '../render/jsx/types/jsx-node';\nimport { OnRenderProp, QSlot } from '../util/markers';\nimport type {\n  ComponentBaseProps,\n  EventHandler,\n  JSXChildren,\n  QRLEventHandlerMulti,\n} from '../render/jsx/types/jsx-qwik-attributes';\nimport type { FunctionComponent } from '../render/jsx/types/jsx-node';\nimport { Virtual, _jsxC } from '../render/jsx/jsx-runtime';\nimport { SERIALIZABLE_STATE } from '../container/serializers';\nimport { qTest } from '../util/qdev';\nimport { assertQrl } from '../qrl/qrl-class';\nimport { _IMMUTABLE } from '../state/constants';\nimport { assertNumber } from '../error/assert';\nimport type { QwikIntrinsicElements } from '../render/jsx/types/jsx-qwik-elements';\n\n// TS way to check for any\ntype IsAny<T> = 0 extends T & 1 ? true : false;\n\ntype ObjectProps<T> =\n  IsAny<T> extends true\n    ? any\n    : // unknown means we don't accept any props\n      unknown extends T\n      ? never\n      : T extends Record<any, any>\n        ? T\n        : never;\n\n/**\n * Infers `Props` from the component or tag.\n *\n * @example\n *\n * ```tsx\n * const Desc = component$(({desc, ...props}: { desc: string } & PropsOf<'div'>) => {\n *  return <div {...props}>{desc}</div>;\n * });\n *\n * const TitleBox = component$(({title, ...props}: { title: string } & PropsOf<Box>) => {\n *   return <Box {...props}><h1>{title}</h1></Box>;\n * });\n * ```\n *\n * @public\n */\n// </docs>\nexport type PropsOf<COMP> = COMP extends string\n  ? COMP extends keyof QwikIntrinsicElements\n    ? QwikIntrinsicElements[COMP]\n    : // `<span/>` has no special attributes\n      QwikIntrinsicElements['span']\n  : NonNullable<COMP> extends never\n    ? never\n    : COMP extends FunctionComponent<infer PROPS>\n      ? PROPS extends Record<any, infer V>\n        ? IsAny<V> extends true\n          ? // we couldn't figure it out\n            never\n          : ObjectProps<PROPS>\n        : COMP extends Component<infer OrigProps>\n          ? ObjectProps<OrigProps>\n          : // something complex, just return as-is\n            PROPS\n      : never;\n\n/**\n * Type representing the Qwik component.\n *\n * `Component` is the type returned by invoking `component$`.\n *\n * ```tsx\n * interface MyComponentProps {\n *   someProp: string;\n * }\n * const MyComponent: Component<MyComponentProps> = component$((props: MyComponentProps) => {\n *   return <span>{props.someProp}</span>;\n * });\n * ```\n *\n * @public\n */\n// In reality, Component is a QRL but that makes the types too complex\nexport type Component<PROPS = unknown> = FunctionComponent<PublicProps<PROPS>>;\n\nexport type ComponentChildren<PROPS> = PROPS extends {\n  children: any;\n}\n  ? never\n  : { children?: JSXChildren };\n/**\n * Extends the defined component PROPS, adding the default ones (children and q:slot) and allowing\n * plain functions to QRL arguments.\n *\n * @public\n */\nexport type PublicProps<PROPS> =\n  // Use Omit + _Only$ so that inferring polymorpic components works\n  // Mapping the entire PROPS doesn't work, maybe TS doesn't like inferring through conditional types\n  (PROPS extends Record<any, any>\n    ? Omit<PROPS, `${string}$`> & _Only$<PROPS>\n    : unknown extends PROPS\n      ? {}\n      : PROPS) &\n    ComponentBaseProps &\n    ComponentChildren<PROPS>;\n\n/** @internal */\nexport type _AllowPlainQrl<Q> =\n  // QRLEventHandlerMulti gets a special case to simplify the result\n  // It needs to be handled carefully because it matches regular functions too\n  QRLEventHandlerMulti<any, any> extends Q\n    ? Q extends QRLEventHandlerMulti<infer EV, infer EL>\n      ?\n          | Q\n          // It can infer unknown and that breaks things\n          | (EL extends Element ? EventHandler<EV, EL> : never)\n      : Q\n    : Q extends QRL<infer U>\n      ? Q | U\n      : NonNullable<Q> extends never\n        ? Q\n        : QRL<Q> | Q;\n/** @internal */\nexport type _Only$<P> = {\n  [K in keyof P as K extends `${string}$` ? K : never]: _AllowPlainQrl<P[K]>;\n};\n\n// <docs markdown=\"../readme.md#component\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#component instead)\n/**\n * Declare a Qwik component that can be used to create UI.\n *\n * Use `component$` to declare a Qwik component. A Qwik component is a special kind of component\n * that allows the Qwik framework to lazy load and execute the component independently of other Qwik\n * components as well as lazy load the component's life-cycle hooks and event handlers.\n *\n * Side note: You can also declare regular (standard JSX) components that will have standard\n * synchronous behavior.\n *\n * Qwik component is a facade that describes how the component should be used without forcing the\n * implementation of the component to be eagerly loaded. A minimum Qwik definition consists of:\n *\n * ### Example\n *\n * An example showing how to create a counter component:\n *\n * ```tsx\n * export interface CounterProps {\n *   initialValue?: number;\n *   step?: number;\n * }\n * export const Counter = component$((props: CounterProps) => {\n *   const state = useStore({ count: props.initialValue || 0 });\n *   return (\n *     <div>\n *       <span>{state.count}</span>\n *       <button onClick$={() => (state.count += props.step || 1)}>+</button>\n *     </div>\n *   );\n * });\n * ```\n *\n * - `component$` is how a component gets declared.\n * - `{ value?: number; step?: number }` declares the public (props) interface of the component.\n * - `{ count: number }` declares the private (state) interface of the component.\n *\n * The above can then be used like so:\n *\n * ```tsx\n * export const OtherComponent = component$(() => {\n *   return <Counter initialValue={100} />;\n * });\n * ```\n *\n * See also: `component`, `useCleanup`, `onResume`, `onPause`, `useOn`, `useOnDocument`,\n * `useOnWindow`, `useStyles`\n *\n * @public\n */\n// </docs>\nexport const componentQrl = <PROPS extends Record<any, any>>(\n  componentQrl: QRL<OnRenderFn<PROPS>>\n): Component<PROPS> => {\n  // Return a QComponent Factory function.\n  function QwikComponent(props: PublicProps<PROPS>, key: string | null, flags: number): JSXNode {\n    assertQrl(componentQrl);\n    assertNumber(flags, 'The Qwik Component was not invoked correctly');\n    const hash = qTest ? 'sX' : componentQrl.$hash$.slice(0, 4);\n    const finalKey = hash + ':' + (key ? key : '');\n    return _jsxC(\n      Virtual,\n      {\n        [OnRenderProp]: componentQrl,\n        [QSlot]: props[QSlot],\n        [_IMMUTABLE]: (props as any)[_IMMUTABLE],\n        children: props.children,\n        props,\n      },\n      flags,\n      finalKey\n    ) as any;\n  }\n  (QwikComponent as any)[SERIALIZABLE_STATE] = [componentQrl];\n  return QwikComponent as any;\n};\n\nexport const isQwikComponent = <T extends Component<any>>(component: unknown): component is T => {\n  return typeof component == 'function' && (component as any)[SERIALIZABLE_STATE] !== undefined;\n};\n\n/** @public @deprecated Use `QRL<>` on your function props instead */\nexport type PropFunctionProps<PROPS extends Record<any, any>> = {\n  [K in keyof PROPS]: PROPS[K] extends undefined\n    ? PROPS[K]\n    : PROPS[K] extends ((...args: infer ARGS) => infer RET) | undefined\n      ? PropFnInterface<ARGS, Awaited<RET>>\n      : PROPS[K];\n};\n\n// <docs markdown=\"../readme.md#component\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#component instead)\n/**\n * Declare a Qwik component that can be used to create UI.\n *\n * Use `component$` to declare a Qwik component. A Qwik component is a special kind of component\n * that allows the Qwik framework to lazy load and execute the component independently of other Qwik\n * components as well as lazy load the component's life-cycle hooks and event handlers.\n *\n * Side note: You can also declare regular (standard JSX) components that will have standard\n * synchronous behavior.\n *\n * Qwik component is a facade that describes how the component should be used without forcing the\n * implementation of the component to be eagerly loaded. A minimum Qwik definition consists of:\n *\n * ### Example\n *\n * An example showing how to create a counter component:\n *\n * ```tsx\n * export interface CounterProps {\n *   initialValue?: number;\n *   step?: number;\n * }\n * export const Counter = component$((props: CounterProps) => {\n *   const state = useStore({ count: props.initialValue || 0 });\n *   return (\n *     <div>\n *       <span>{state.count}</span>\n *       <button onClick$={() => (state.count += props.step || 1)}>+</button>\n *     </div>\n *   );\n * });\n * ```\n *\n * - `component$` is how a component gets declared.\n * - `{ value?: number; step?: number }` declares the public (props) interface of the component.\n * - `{ count: number }` declares the private (state) interface of the component.\n *\n * The above can then be used like so:\n *\n * ```tsx\n * export const OtherComponent = component$(() => {\n *   return <Counter initialValue={100} />;\n * });\n * ```\n *\n * See also: `component`, `useCleanup`, `onResume`, `onPause`, `useOn`, `useOnDocument`,\n * `useOnWindow`, `useStyles`\n *\n * @public\n */\n// </docs>\nexport const component$ = <PROPS = unknown>(onMount: OnRenderFn<PROPS>): Component<PROPS> => {\n  return componentQrl($(onMount));\n};\n\n/** @public */\nexport type OnRenderFn<PROPS> = (props: PROPS) => JSXOutput;\n\nexport interface RenderFactoryOutput<PROPS> {\n  renderQRL: QRL<OnRenderFn<PROPS>>;\n  waitOn: any[];\n}\n"
  },
  {
    "path": "packages/qwik/src/core/component/component.unit.tsx",
    "content": "import { createDOM } from '../../testing/library';\nimport { expectDOM } from '../../testing/expect-dom';\nimport { inlinedQrl } from '../qrl/qrl';\nimport { useStylesQrl } from '../use/use-styles';\nimport { type PropsOf, component$, type Component } from './component.public';\nimport { useStore } from '../use/use-store.public';\nimport { useLexicalScope } from '../use/use-lexical-scope.public';\nimport { describe, test, expectTypeOf } from 'vitest';\nimport type { InputHTMLAttributes } from '../render/jsx/types/jsx-generated';\nimport type { QwikIntrinsicElements } from '../render/jsx/types/jsx-qwik-elements';\nimport type { PropFunction, QRL } from '../qrl/qrl.public';\n\ndescribe('q-component', () => {\n  /**\n   * Applying new unit test library/layer\n   *\n   * `@builder.io/qwik/testing` ==> ../../testing/library\n   */\n  test('should declare and render basic component', async () => {\n    const { screen, render } = await createDOM();\n    await render(<HelloWorld />);\n    await expectDOM(\n      screen,\n      `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n        <style q:style=\"pfkgyr-0\" hidden=\"\">\n          {}\n        </style>\n        <!--qv -->\n        <span>Hello World</span>\n        <!--/qv-->\n      </host>`\n    );\n  });\n\n  test('should render Counter and accept events', async () => {\n    const { screen, render, userEvent } = await createDOM();\n\n    await render(<MyCounter step={5} value={15} />);\n    await expectDOM(\n      screen,\n      `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n    <!--qv -->\n    <my-counter>\n      <button class=\"decrement\">-</button>\n      <span>15</span>\n      <button class=\"increment\">+</button>\n    </my-counter>\n    <!--/qv-->\n  </host>`\n    );\n    await userEvent('button.decrement', 'click');\n    await expectDOM(\n      screen,\n      `\n<host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n  <!--qv -->\n  <my-counter>\n    <button\n      class=\"decrement\"\n    >\n      -\n    </button>\n    <span>10</span>\n    <button\n      class=\"increment\"\n    >\n      +\n    </button>\n  </my-counter>\n  <!--/qv-->\n</host>`\n    );\n  });\n\n  test('should render a collection of todo items', async () => {\n    const { screen, render } = await createDOM();\n\n    const items = {\n      items: [\n        {\n          done: true,\n          title: 'Task 1',\n        },\n        {\n          done: false,\n          title: 'Task 2',\n        },\n      ],\n    };\n    await render(<Items items={items} />);\n    await delay(0);\n    await expectDOM(\n      screen,\n      `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n      <!--qv -->\n      <items>\n        <!--qv -->\n        <item-detail>\n          <input type=\"checkbox\" checked=\"\" />\n          <span>Task 1</span>\n        </item-detail>\n        <!--/qv-->\n        <!--qv -->\n        <item-detail>\n          <input type=\"checkbox\" />\n          <span>Task 2</span>\n        </item-detail>\n        <!--/qv-->\n        Total: 2\n      </items>\n      <!--/qv-->\n    </host>\n    `\n    );\n  });\n\n  test('types work as expected', () => () => {\n    // Let's keep one of these old type exports around for now.\n    const Input1 = component$<InputHTMLAttributes<HTMLInputElement>>((props) => {\n      return <input {...props} />;\n    });\n\n    const Input2 = component$((props: PropsOf<'input'>) => {\n      return <input {...props} />;\n    });\n\n    type Input3Props = {\n      type: 'text' | 'number';\n    } & Partial<PropsOf<'input'>>;\n\n    const Input3 = component$<Input3Props>(({ type, ...props }) => {\n      return <input type={type} {...props} />;\n    });\n\n    type Input4Props = {\n      type: 'text' | 'number';\n    } & QwikIntrinsicElements['input'];\n\n    const Input4 = component$<Input4Props>(({ type, ...props }) => {\n      return (\n        <div>\n          <input type={type} {...props} />\n        </div>\n      );\n    });\n\n    component$(() => {\n      return (\n        <>\n          <Input1\n            style={{\n              paddingInlineEnd: '10px',\n            }}\n            value=\"1\"\n          />\n          <Input2 value=\"2\" />\n          <Input3 value=\"3\" type=\"text\" />\n          <Input4 value=\"4\" type=\"number\" />\n        </>\n      );\n    });\n  });\n\n  test('custom function types should work', () => () => {\n    type TestProps = PropsOf<'h1'> & {\n      qrl$?: QRL<() => void>;\n    };\n    const Test1 = component$<TestProps>(({ qrl$, ...props }) => {\n      return (\n        <>\n          <h1 onClick$={qrl$} {...props}>\n            Hi 👋\n          </h1>\n        </>\n      );\n    });\n    expectTypeOf<TestProps['qrl$']>().toMatchTypeOf<Parameters<typeof Test1>[0]['qrl$']>();\n    expectTypeOf<Parameters<typeof Test1>[0]['qrl$']>().toEqualTypeOf<\n      (() => void) | QRL<() => void> | undefined\n    >();\n\n    const Test2 = component$(({ qrl$, ...props }: TestProps) => {\n      return (\n        <>\n          <h1 onClick$={qrl$} {...props}>\n            Hi 👋\n          </h1>\n        </>\n      );\n    });\n    expectTypeOf<TestProps['qrl$']>().toMatchTypeOf<Parameters<typeof Test2>[0]['qrl$']>();\n    expectTypeOf<Parameters<typeof Test2>[0]['qrl$']>().toEqualTypeOf<\n      (() => void) | QRL<() => void> | undefined\n    >();\n    component$(() => {\n      return (\n        <>\n          <Test1 />\n          <Test2 />\n        </>\n      );\n    });\n  });\n\n  test('PropFunction should work', () => () => {\n    type TestProps = PropsOf<'h1'> & {\n      test$?: PropFunction<() => void>;\n    };\n    const Test1 = component$<TestProps>(({ test$, ...props }) => {\n      return (\n        <>\n          <h1 onClick$={test$} {...props}>\n            Hi 👋\n          </h1>\n        </>\n      );\n    });\n    expectTypeOf<TestProps['test$']>().toMatchTypeOf<Parameters<typeof Test1>[0]['test$']>();\n    expectTypeOf<QRL<() => void>>().toMatchTypeOf<Parameters<typeof Test1>[0]['test$']>();\n  });\n\n  test('Inline Components should be able to use Component', () => () => {\n    const InlineComponent: Component<PropsOf<'div'>> = (props) => {\n      expectTypeOf(props).not.toBeAny();\n      return <div {...props} />;\n    };\n    // Passing a plain function should not error\n    return <InlineComponent onClick$={() => {}} />;\n  });\n});\n\n/////////////////////////////////////////////////////////////////////////////\nexport const HelloWorld = component$(() => {\n  useStylesQrl(inlinedQrl(`{}`, 'named-style'));\n  return <span>Hello World</span>;\n});\n\n/////////////////////////////////////////////////////////////////////////////\n// <Greeter salutation=\"\" name=\"\"/>\n\nexport const Greeter = component$((props: { salutation?: string; name?: string }) => {\n  const state = useStore({ count: 0 });\n  return (\n    <div>\n      {' '}\n      {props.salutation} {props.name} ({state.count}){' '}\n    </div>\n  );\n});\n\n//////////////////////////////////////////////\n// import { QComponent, component, qView, qHandler, getState, markDirty } from '@builder.io/qwik';\n\n// Component view may need additional handlers describing the component's behavior.\nexport const MyCounter_update = () => {\n  const [props, state, args] =\n    useLexicalScope<[PropsOf<typeof MyCounter>, { count: number }, { dir: number }]>();\n  state.count += args.dir * (props.step || 1);\n};\n\n// Finally tie it all together into a component.\nexport const MyCounter = component$((props: { step?: number; value?: number }) => {\n  const state = useStore({ count: props.value || 0 });\n  return (\n    <my-counter>\n      <button\n        class=\"decrement\"\n        onClick$={inlinedQrl(MyCounter_update, 'update', [props, state, { dir: -1 }])}\n      >\n        -\n      </button>\n      <span>{state.count}</span>\n      <button\n        class=\"increment\"\n        onClick$={inlinedQrl(MyCounter_update, 'update', [props, state, { dir: 1 }])}\n      >\n        +\n      </button>\n    </my-counter>\n  );\n});\n\n/////////////////////////////////////////////////////////////////////////////\n/////////////////////////////////////////////////////////////////////////////\n/////////////////////////////////////////////////////////////////////////////\n/////////////////////////////////////////////////////////////////////////////\n\ninterface ItemObj {\n  title: string;\n  done: boolean;\n}\n\ninterface ItemsObj {\n  items: ItemObj[];\n}\n\n/////////////////////////////////////////////////////////////////////////////\n\nexport const ItemDetail = component$((props: { itemObj: ItemObj }) => {\n  // const state = useStore({ editing: false });\n  return (\n    <item-detail>\n      <input type=\"checkbox\" checked={props.itemObj.done} />\n      <span>{props.itemObj.title || 'loading...'}</span>\n    </item-detail>\n  );\n});\n\n/////////////////////////////////////////////////////////////////////////////\n\nexport const Items = component$((props: { items: ItemsObj }) => {\n  // const state = useStore({ editing: false });\n  return (\n    <items>\n      {props.items.items.map((item) => (\n        <ItemDetail itemObj={item} />\n      ))}\n      Total: {props.items.items.length}\n    </items>\n  );\n});\n\nfunction delay(milliseconds: number): Promise<void> {\n  return new Promise((res) => setTimeout(res, milliseconds));\n}\n"
  },
  {
    "path": "packages/qwik/src/core/components/prefetch.ts",
    "content": "// keep this import from qwik/build so the cjs build works\nimport { isDev } from '@builder.io/qwik/build';\nimport type { JSXNode } from '@builder.io/qwik/jsx-runtime';\nimport { _jsxC } from '../internal';\nimport type { JSXOutput } from '../render/jsx/types/jsx-node';\n\n/**\n * @deprecated This is no longer needed as the preloading happens automatically in qrl-class.ts.\n *   Leave this in your app for a while so it uninstalls existing service workers, but don't use it\n *   for new projects.\n * @alpha\n */\nexport const PrefetchServiceWorker = (opts: {\n  base?: string;\n  scope?: string;\n  path?: string;\n  verbose?: boolean;\n  fetchBundleGraph?: boolean;\n  nonce?: string;\n}): JSXNode<'script'> => {\n  const isTest = import.meta.env.TEST;\n  if (isDev && !isTest) {\n    const props = {\n      dangerouslySetInnerHTML: '<!-- PrefetchServiceWorker is disabled in dev mode. -->',\n    };\n    return _jsxC('script', props, 0, 'prefetch-service-worker');\n  }\n\n  // if an MFE app has a custom BASE_URL then this will be the correct value\n  // if you're not using MFE from another codebase then you want to override this value to your custom setup\n  const baseUrl = import.meta.env.BASE_URL || '/';\n  const resolvedOpts = {\n    path: 'qwik-prefetch-service-worker.js',\n    ...opts,\n  };\n  if (opts?.path?.startsWith?.('/')) {\n    // allow different path and base\n    resolvedOpts.path = opts.path;\n  } else {\n    // baseUrl: '/'\n    // path: 'qwik-prefetch-service-worker.js'\n    // the file 'qwik-prefetch-service-worker.js' is not located in /build/\n    resolvedOpts.path = baseUrl + resolvedOpts.path;\n  }\n  let code = PREFETCH_CODE.replace('\"_URL_\"', JSON.stringify(resolvedOpts.path.split('/').pop()));\n  if (!isDev) {\n    // consecutive spaces are indentation\n    code = code.replaceAll(/\\s\\s+/gm, '');\n  }\n  const props = {\n    dangerouslySetInnerHTML: [\n      '(' + code + ')(',\n      [\n        'navigator.serviceWorker', // Service worker container\n      ].join(','),\n      ');',\n    ].join(''),\n    nonce: resolvedOpts.nonce,\n  };\n  return _jsxC('script', props, 0, 'prefetch-service-worker');\n};\n\nconst PREFETCH_CODE = /*#__PURE__*/ ((\n  c: ServiceWorkerContainer // Service worker container\n) => {\n  if ('getRegistrations' in c) {\n    c.getRegistrations().then((registrations) => {\n      registrations.forEach((registration) => {\n        if (registration.active) {\n          if (registration.active.scriptURL.endsWith('_URL_')) {\n            registration.unregister().catch(console.error);\n          }\n        }\n      });\n    });\n  }\n  if ('caches' in window) {\n    caches\n      .keys()\n      .then((names) => {\n        const cacheName = names.find((name) => name.startsWith('QwikBundles'));\n        if (cacheName) {\n          caches.delete(cacheName).catch(console.error);\n        }\n      })\n      .catch(console.error);\n  }\n}).toString();\n\n/**\n * @deprecated This is no longer needed as the preloading happens automatically in qrl-class. You\n *   can remove this component from your app.\n * @alpha\n */\nexport const PrefetchGraph = (\n  opts: { base?: string; manifestHash?: string; manifestURL?: string; nonce?: string } = {}\n): JSXOutput => null;\n"
  },
  {
    "path": "packages/qwik/src/core/container/container.ts",
    "content": "import { qError, QError_invalidRefValue } from '../error/error';\nimport type { ResourceReturnInternal, SubscriberEffect } from '../use/use-task';\nimport { seal } from '../util/qdev';\nimport { isFunction } from '../util/types';\nimport type { QRL } from '../qrl/qrl.public';\nimport { fromKebabToCamelCase } from '../util/case';\nimport { QContainerAttr } from '../util/markers';\nimport { isElement } from '../util/element';\nimport {\n  createSubscriptionManager,\n  type SubscriberSignal,\n  type SubscriptionManager,\n} from '../state/common';\nimport { isSignal, type Signal, type SignalImpl } from '../state/signal';\nimport { directGetAttribute } from '../render/fast-calls';\nimport type { QContext } from '../state/context';\nimport { isServerPlatform } from '../platform/platform';\n\nexport type GetObject = (id: string) => any;\nexport type GetObjID = (obj: any) => string | null;\nexport type MustGetObjID = (obj: any) => string;\n\n/** @public */\nexport interface SnapshotMetaValue {\n  w?: string; // q:watches\n  s?: string; // q:seq\n  h?: string; // q:host\n  c?: string; // q:context\n}\n\n/** @public */\nexport type SnapshotMeta = Record<string, SnapshotMetaValue>;\n\n/** @public */\nexport interface SnapshotState {\n  ctx: SnapshotMeta;\n  refs: Record<string, string>;\n  objs: any[];\n  subs: any[];\n}\n\n/** @public */\nexport interface SnapshotListener {\n  key: string;\n  qrl: QRL<any>;\n  el: Element;\n}\n\n/** @public */\nexport interface SnapshotResult {\n  state: SnapshotState;\n  funcs: string[];\n  qrls: QRL[];\n  objs: any[];\n  resources: ResourceReturnInternal<any>[];\n  mode: 'render' | 'listeners' | 'static';\n}\n\nexport type ObjToProxyMap = WeakMap<any, any>;\n\n/** @public */\nexport interface PauseContext {\n  getObject: GetObject;\n  meta: SnapshotMeta;\n  refs: Record<string, string>;\n}\n\n/** @public */\nexport interface ContainerState {\n  readonly $containerEl$: Element;\n\n  readonly $proxyMap$: ObjToProxyMap;\n  $subsManager$: SubscriptionManager;\n\n  readonly $taskNext$: Set<SubscriberEffect>;\n  readonly $taskStaging$: Set<SubscriberEffect>;\n\n  readonly $opsNext$: Set<SubscriberSignal>;\n\n  readonly $hostsNext$: Set<QContext>;\n  readonly $hostsStaging$: Set<QContext>;\n  readonly $base$: string;\n\n  $hostsRendering$: Set<QContext> | undefined;\n  $renderPromise$: Promise<void> | undefined;\n\n  $serverData$: Record<string, any>;\n  $elementIndex$: number;\n\n  $pauseCtx$: PauseContext | undefined;\n  $styleMoved$: boolean;\n  readonly $styleIds$: Set<string>;\n  readonly $events$: Set<string>;\n  readonly $inlineFns$: Map<string, number>;\n}\n\nconst CONTAINER_STATE = Symbol('ContainerState');\n\n/** @internal */\nexport const _getContainerState = (containerEl: Element): ContainerState => {\n  let state = (containerEl as any)[CONTAINER_STATE] as ContainerState;\n  if (!state) {\n    (containerEl as any)[CONTAINER_STATE] = state = createContainerState(\n      containerEl,\n      directGetAttribute(containerEl, 'q:base') ?? '/'\n    );\n  }\n  return state;\n};\n\nexport const createContainerState = (containerEl: Element, base: string) => {\n  const containerAttributes: Record<string, string> = {};\n  if (containerEl) {\n    const attrs = containerEl.attributes;\n    if (attrs) {\n      for (let index = 0; index < attrs.length; index++) {\n        const attr = attrs[index];\n        containerAttributes[attr.name] = attr.value;\n      }\n    }\n  }\n  const containerState: ContainerState = {\n    $containerEl$: containerEl,\n\n    $elementIndex$: 0,\n    $styleMoved$: false,\n\n    $proxyMap$: new WeakMap(),\n\n    $opsNext$: new Set(),\n\n    $taskNext$: new Set(),\n    $taskStaging$: new Set(),\n\n    $hostsNext$: new Set(),\n    $hostsStaging$: new Set(),\n\n    $styleIds$: new Set(),\n    $events$: new Set(),\n\n    $serverData$: { containerAttributes },\n    $base$: base,\n    $renderPromise$: undefined,\n    $hostsRendering$: undefined,\n    $pauseCtx$: undefined,\n    $subsManager$: null as any,\n    $inlineFns$: new Map(),\n  };\n  seal(containerState);\n  containerState.$subsManager$ = createSubscriptionManager(containerState);\n  return containerState;\n};\n\nexport const removeContainerState = (containerEl: Element) => {\n  delete (containerEl as any)[CONTAINER_STATE];\n};\n\nexport const setRef = (value: any, elm: Element) => {\n  if (isFunction(value)) {\n    return value(elm);\n  } else if (isSignal(value)) {\n    if (isServerPlatform()) {\n      // During SSR, assigning a ref should not cause reactivity because\n      // the expectation is that the ref is filled in on the client\n      return ((value as SignalImpl<Element>).untrackedValue = elm);\n    } else {\n      return ((value as Signal<Element>).value = elm);\n    }\n  }\n  throw qError(QError_invalidRefValue, value);\n};\n\nexport const SHOW_ELEMENT = 1;\nexport const SHOW_COMMENT = 128;\nexport const FILTER_ACCEPT = 1;\nexport const FILTER_REJECT = 2;\nexport const FILTER_SKIP = 3;\n\nexport const isContainer = (el: Node) => {\n  return isElement(el) && el.hasAttribute(QContainerAttr);\n};\n\nexport const intToStr = (nu: number) => {\n  return nu.toString(36);\n};\n\nexport const strToInt = (nu: string) => {\n  return parseInt(nu, 36);\n};\n\nexport const getEventName = (attribute: string) => {\n  const colonPos = attribute.indexOf(':');\n  if (attribute) {\n    return fromKebabToCamelCase(attribute.slice(colonPos + 1));\n  } else {\n    return attribute;\n  }\n};\n\nexport interface QContainerElement extends Element {\n  _qwikjson_?: any;\n}\n"
  },
  {
    "path": "packages/qwik/src/core/container/index.html",
    "content": "<!doctype html>\n<html lang=\"en\" q:container>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Document</title>\n  </head>\n  <body>\n    <div q:id=\"1\"></div>\n    <div q:id=\"2\">\n      <div q:id=\"3\">\n        <div q:container>\n          <div q:id=\"1\" class=\"not\"></div>\n          <div q:id=\"2\" class=\"not\"></div>\n        </div>\n      </div>\n    </div>\n    <div q:id=\"4\"></div>\n  </body>\n</html>\n"
  },
  {
    "path": "packages/qwik/src/core/container/pause.ts",
    "content": "import { assertDefined, assertElement, assertEqual } from '../error/assert';\nimport { getDocument } from '../util/dom';\nimport {\n  isComment,\n  isDocument,\n  isElement,\n  isNode,\n  isQwikElement,\n  isText,\n  isVirtualElement,\n} from '../util/element';\nimport { logWarn } from '../util/log';\nimport { ELEMENT_ID, ELEMENT_ID_PREFIX, QContainerAttr, QScopedStyle } from '../util/markers';\nimport { qDev } from '../util/qdev';\n\nimport {\n  QError_containerAlreadyPaused,\n  QError_missingObjectId,\n  QError_verifySerializable,\n  qError,\n} from '../error/error';\nimport { serializeQRLs } from '../qrl/qrl';\nimport type { QRL } from '../qrl/qrl.public';\nimport {\n  processVirtualNodes,\n  type QwikElement,\n  type VirtualElement,\n} from '../render/dom/virtual-element';\nimport { directGetAttribute, directSetAttribute } from '../render/fast-calls';\nimport {\n  LocalSubscriptionManager,\n  fastSkipSerialize,\n  fastWeakSerialize,\n  getProxyFlags,\n  getProxyTarget,\n  getSubscriptionManager,\n  isConnected,\n  serializeSubscription,\n  type Subscriptions,\n  type SubscriberSignal,\n} from '../state/common';\nimport { QObjectImmutable, QObjectRecursive } from '../state/constants';\nimport { HOST_FLAG_DYNAMIC, tryGetContext, type QContext } from '../state/context';\nimport { groupListeners } from '../state/listeners';\nimport { SignalImpl } from '../state/signal';\nimport { serializeSStyle } from '../style/qrl-styles';\nimport {\n  TaskFlagsIsDirty,\n  destroyTask,\n  isResourceTask,\n  type ResourceReturnInternal,\n} from '../use/use-task';\nimport { isNotNullable, isPromise } from '../util/promises';\nimport { isArray, isObject, isSerializableObject } from '../util/types';\nimport {\n  FILTER_REJECT,\n  FILTER_SKIP,\n  SHOW_COMMENT,\n  SHOW_ELEMENT,\n  _getContainerState,\n  intToStr,\n  type ContainerState,\n  type GetObjID,\n  type SnapshotMeta,\n  type SnapshotMetaValue,\n  type SnapshotResult,\n  createContainerState,\n} from './container';\nimport { UNDEFINED_PREFIX, collectDeps, serializeValue } from './serializers';\nimport { isQrl } from '../qrl/qrl-class';\n\n/** @internal */\nexport const _serializeData = async (data: any, pureQRL?: boolean) => {\n  const containerState = createContainerState(null!, null!);\n  const collector = createCollector(containerState);\n  collectValue(data, collector, false);\n\n  // Wait for remaining promises\n  let promises: Promise<any>[];\n  while ((promises = collector.$promises$).length > 0) {\n    collector.$promises$ = [];\n    const results = await Promise.allSettled(promises);\n    for (const result of results) {\n      if (result.status === 'rejected') {\n        console.error(result.reason);\n      }\n    }\n  }\n\n  const objs = Array.from(collector.$objSet$.keys());\n  let count = 0;\n\n  const objToId = new Map<any, string>();\n  for (const obj of objs) {\n    objToId.set(obj, intToStr(count));\n    count++;\n  }\n  if (collector.$noSerialize$.length > 0) {\n    const undefinedID = objToId.get(undefined);\n    assertDefined(undefinedID, 'undefined ID must be defined');\n    for (const obj of collector.$noSerialize$) {\n      objToId.set(obj, undefinedID);\n    }\n  }\n\n  const mustGetObjId = (obj: any): string => {\n    let suffix = '';\n    if (isPromise(obj)) {\n      const promiseValue = getPromiseValue(obj);\n      if (!promiseValue) {\n        throw qError(QError_missingObjectId, obj);\n      }\n      obj = promiseValue.value;\n      if (promiseValue.resolved) {\n        suffix += '~';\n      } else {\n        suffix += '_';\n      }\n    }\n    if (isObject(obj)) {\n      const target = getProxyTarget(obj);\n      if (target) {\n        suffix += '!';\n        obj = target;\n      }\n    }\n    const key = objToId.get(obj);\n    if (key === undefined) {\n      throw qError(QError_missingObjectId, obj);\n    }\n    return key + suffix;\n  };\n\n  const convertedObjs = serializeObjects(objs, mustGetObjId, null, collector, containerState);\n\n  return JSON.stringify({\n    _entry: mustGetObjId(data),\n    _objs: convertedObjs,\n  });\n};\n\n// <docs markdown=\"../readme.md#pauseContainer\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#pauseContainer instead)\n// </docs>\n/** This pauses a running container in the browser. It is not used for SSR */\n// TODO(mhevery): this is a remnant when you could have paused on client. Should be deleted.\nexport const pauseContainer = async (\n  elmOrDoc: Element | Document,\n  defaultParentJSON?: Element\n): Promise<SnapshotResult> => {\n  const doc = getDocument(elmOrDoc);\n  const documentElement = doc.documentElement;\n  const containerEl = isDocument(elmOrDoc) ? documentElement : elmOrDoc;\n  if (directGetAttribute(containerEl, QContainerAttr) === 'paused') {\n    throw qError(QError_containerAlreadyPaused);\n  }\n  const parentJSON =\n    defaultParentJSON ?? (containerEl === doc.documentElement ? doc.body : containerEl);\n\n  const containerState = _getContainerState(containerEl);\n  const contexts = getNodesInScope(containerEl, hasContext);\n\n  // Set container to paused\n  directSetAttribute(containerEl, QContainerAttr, 'paused');\n\n  // Update elements with context\n  for (const elCtx of contexts) {\n    const elm = elCtx.$element$;\n    const listeners = elCtx.li;\n    if (elCtx.$scopeIds$) {\n      const value = serializeSStyle(elCtx.$scopeIds$);\n      if (value) {\n        elm.setAttribute(QScopedStyle, value);\n      }\n    }\n    if (elCtx.$id$) {\n      elm.setAttribute(ELEMENT_ID, elCtx.$id$);\n    }\n    if (isElement(elm) && listeners.length > 0) {\n      const groups = groupListeners(listeners);\n      for (const listener of groups) {\n        elm.setAttribute(listener[0], serializeQRLs(listener[1], containerState, elCtx));\n      }\n    }\n  }\n\n  // Serialize data\n  const data = await _pauseFromContexts(contexts, containerState, (el) => {\n    if (isNode(el) && isText(el)) {\n      return getTextID(el, containerState);\n    }\n    return null;\n  });\n\n  // Emit Qwik JSON\n  const qwikJson = doc.createElement('script');\n  directSetAttribute(qwikJson, 'type', 'qwik/json');\n  qwikJson.textContent = escapeText(JSON.stringify(data.state, undefined, qDev ? '  ' : undefined));\n  parentJSON.appendChild(qwikJson);\n\n  // Emit event registration\n  const extraListeners = Array.from(containerState.$events$, (s) => JSON.stringify(s));\n  const eventsScript = doc.createElement('script');\n  eventsScript.textContent = `(window.qwikevents||=[]).push(${extraListeners.join(', ')})`;\n  parentJSON.appendChild(eventsScript);\n\n  return data;\n};\n\n/**\n * Grab all state needed to resume the container later.\n *\n * @internal\n */\nexport const _pauseFromContexts = async (\n  allContexts: QContext[],\n  containerState: ContainerState,\n  fallbackGetObjId?: GetObjID,\n  textNodes?: Map<string, string>\n): Promise<SnapshotResult> => {\n  const collector = createCollector(containerState);\n  textNodes?.forEach((_, key) => {\n    collector.$seen$.add(key);\n  });\n  let hasListeners = false;\n\n  // Collect resources\n  // TODO: optimize\n  for (const ctx of allContexts) {\n    if (ctx.$tasks$) {\n      for (const task of ctx.$tasks$) {\n        if (qDev) {\n          if (task.$flags$ & TaskFlagsIsDirty) {\n            logWarn(\n              `Serializing dirty task. Looks like an internal error. \nTask Symbol: ${task.$qrl$.$symbol$}\n`\n            );\n          }\n          if (!isConnected(task)) {\n            logWarn('Serializing disconnected task. Looks like an internal error.');\n          }\n        }\n        if (isResourceTask(task)) {\n          collector.$resources$.push(task.$state$!);\n        }\n        destroyTask(task);\n      }\n    }\n  }\n\n  // Find all listeners. They are the \"entries\" for resuming the container.\n  // Any lexical scope they reference must be serialized.\n  for (const ctx of allContexts) {\n    const el = ctx.$element$;\n    const ctxListeners = ctx.li;\n    for (const listener of ctxListeners) {\n      if (isElement(el)) {\n        const qrl = listener[1];\n        const captured = qrl.$captureRef$;\n        if (captured) {\n          for (const obj of captured) {\n            /**\n             * Collect the lexical scope used by the listener. This also collects all the\n             * subscribers of any reactive state in scope, since the listener might change that\n             * state\n             */\n            collectValue(obj, collector, true);\n          }\n        }\n        collector.$qrls$.push(qrl);\n        hasListeners = true;\n      }\n    }\n  }\n\n  // No listeners implies static page\n  if (!hasListeners) {\n    return {\n      state: {\n        refs: {},\n        ctx: {},\n        objs: [],\n        subs: [],\n      },\n      objs: [],\n      funcs: [],\n      qrls: [],\n      resources: collector.$resources$,\n      mode: 'static',\n    };\n  }\n\n  // Wait for remaining promises\n  let promises: Promise<any>[];\n  while ((promises = collector.$promises$).length > 0) {\n    collector.$promises$ = [];\n    await Promise.all(promises);\n  }\n\n  // If at this point any component can render, we need to capture Context and Props\n  const canRender = collector.$elements$.length > 0;\n  if (canRender) {\n    for (const elCtx of collector.$deferElements$) {\n      collectElementData(elCtx, collector, elCtx.$element$);\n    }\n\n    for (const ctx of allContexts) {\n      collectProps(ctx, collector);\n    }\n  }\n\n  // Wait for remaining promises\n  while ((promises = collector.$promises$).length > 0) {\n    collector.$promises$ = [];\n    await Promise.all(promises);\n  }\n\n  // Convert objSet to array\n  const elementToIndex = new Map<Node | QwikElement, string | null>();\n  const objs = Array.from(collector.$objSet$.keys());\n  const objToId = new Map<any, string>();\n\n  const getElementID = (el: QwikElement): string | null => {\n    let id = elementToIndex.get(el);\n    if (id === undefined) {\n      id = getQId(el);\n      if (!id) {\n        console.warn('Missing ID', el);\n      }\n      elementToIndex.set(el, id);\n    }\n    return id;\n  };\n\n  const getObjId: GetObjID = (obj) => {\n    let suffix = '';\n    if (isPromise(obj)) {\n      const promiseValue = getPromiseValue(obj);\n      if (!promiseValue) {\n        return null;\n      }\n      obj = promiseValue.value;\n      if (promiseValue.resolved) {\n        suffix += '~';\n      } else {\n        suffix += '_';\n      }\n    }\n\n    if (isObject(obj)) {\n      const target = getProxyTarget(obj);\n      if (target) {\n        suffix += '!';\n        obj = target;\n      } else if (isQwikElement(obj)) {\n        const elID = getElementID(obj);\n        if (elID) {\n          return ELEMENT_ID_PREFIX + elID + suffix;\n        }\n        return null;\n      }\n    }\n    const id = objToId.get(obj);\n    if (id) {\n      return id + suffix;\n    }\n    const textId = textNodes?.get(obj);\n    if (textId) {\n      return '*' + textId;\n    }\n    if (fallbackGetObjId) {\n      return fallbackGetObjId(obj);\n    }\n    return null;\n  };\n\n  const mustGetObjId = (obj: any): string => {\n    const key = getObjId(obj);\n    if (key === null) {\n      // TODO(mhevery): this is a hack as we should never get here.\n      // This as a workaround for https://github.com/QwikDev/qwik/issues/4979\n      if (isQrl(obj)) {\n        const id = intToStr(objToId.size);\n        objToId.set(obj, id);\n        return id;\n      } else {\n        throw qError(QError_missingObjectId, obj);\n      }\n    }\n    return key;\n  };\n\n  // Compute subscriptions\n  const subsMap = new Map<any, (Subscriptions | number)[]>();\n  for (const obj of objs) {\n    const subs = getManager(obj, containerState)?.$subs$;\n    if (!subs) {\n      continue;\n    }\n    const flags = getProxyFlags(obj) ?? 0;\n    const converted: (Subscriptions | number)[] = [];\n    if (flags & QObjectRecursive) {\n      converted.push(flags);\n    }\n    for (const sub of subs) {\n      const host = sub[1];\n      if (sub[0] === 0 && isNode(host) && isVirtualElement(host)) {\n        if (!collector.$elements$.includes(tryGetContext(host)!)) {\n          continue;\n        }\n      }\n      converted.push(sub);\n    }\n    if (converted.length > 0) {\n      subsMap.set(obj, converted);\n    }\n  }\n\n  // Sort objects: the ones with subscriptions go first\n  objs.sort((a, b) => {\n    const isProxyA = subsMap.has(a) ? 0 : 1;\n    const isProxyB = subsMap.has(b) ? 0 : 1;\n    return isProxyA - isProxyB;\n  });\n\n  // Generate object ID by using a monotonic counter\n  let count = 0;\n  for (const obj of objs) {\n    objToId.set(obj, intToStr(count));\n    count++;\n  }\n  if (collector.$noSerialize$.length > 0) {\n    const undefinedID = objToId.get(undefined);\n    assertDefined(undefinedID, 'undefined ID must be defined');\n    for (const obj of collector.$noSerialize$) {\n      objToId.set(obj, undefinedID);\n    }\n  }\n\n  // Serialize object subscriptions\n  const subs: string[][] = [];\n  for (const obj of objs) {\n    const value = subsMap.get(obj);\n    if (value == null) {\n      break;\n    }\n    subs.push(\n      value\n        .map((s) => {\n          if (typeof s === 'number') {\n            return `_${s}`;\n          }\n          return serializeSubscription(s, getObjId);\n        })\n        .filter(isNotNullable)\n    );\n  }\n  assertEqual(subs.length, subsMap.size, 'missing subscriptions to serialize', subs, subsMap);\n\n  const convertedObjs = serializeObjects(objs, mustGetObjId, getObjId, collector, containerState);\n\n  const meta: SnapshotMeta = {};\n  const refs: Record<string, string> = {};\n\n  // Write back to the dom\n  for (const ctx of allContexts) {\n    const node = ctx.$element$;\n    const elementID = ctx.$id$;\n    const ref = ctx.$refMap$;\n    const props = ctx.$props$;\n    const contexts = ctx.$contexts$;\n    const tasks = ctx.$tasks$;\n    const renderQrl = ctx.$componentQrl$;\n    const seq = ctx.$seq$;\n    const metaValue: SnapshotMetaValue = {};\n    const elementCaptured = isVirtualElement(node) && collector.$elements$.includes(ctx);\n    assertDefined(elementID, `pause: can not generate ID for dom node`, node);\n\n    if (ref.length > 0) {\n      assertElement(node);\n      const value = mapJoin(ref, mustGetObjId, ' ');\n      if (value) {\n        refs[elementID] = value;\n      }\n    } else if (canRender) {\n      let add = false;\n      if (elementCaptured) {\n        assertDefined(renderQrl, 'renderQrl must be defined');\n        const propsId = getObjId(props);\n        metaValue.h = mustGetObjId(renderQrl) + (propsId ? ' ' + propsId : '');\n        add = true;\n      } else {\n        const propsId = getObjId(props);\n        if (propsId) {\n          metaValue.h = ' ' + propsId;\n          add = true;\n        }\n      }\n\n      if (tasks && tasks.length > 0) {\n        const value = mapJoin(tasks, getObjId, ' ');\n        if (value) {\n          metaValue.w = value;\n          add = true;\n        }\n      }\n\n      if (elementCaptured && seq && seq.length > 0) {\n        const value = mapJoin(seq, mustGetObjId, ' ');\n        metaValue.s = value;\n        add = true;\n      }\n\n      if (contexts) {\n        const serializedContexts: string[] = [];\n        contexts.forEach((value, key) => {\n          const id = getObjId(value);\n          if (id) {\n            serializedContexts.push(`${key}=${id}`);\n          }\n        });\n        const value = serializedContexts.join(' ');\n        if (value) {\n          metaValue.c = value;\n          add = true;\n        }\n      }\n      if (add) {\n        meta[elementID] = metaValue;\n      }\n    }\n  }\n\n  // Sanity check of serialized element\n  if (qDev) {\n    elementToIndex.forEach((value, el) => {\n      if (!value) {\n        logWarn('unconnected element', el.nodeName, '\\n');\n      }\n    });\n  }\n\n  return {\n    state: {\n      refs,\n      ctx: meta,\n      objs: convertedObjs,\n      subs,\n    },\n    objs,\n    funcs: collector.$inlinedFunctions$,\n    resources: collector.$resources$,\n    qrls: collector.$qrls$,\n    mode: canRender ? 'render' : 'listeners',\n  };\n};\n\nexport const mapJoin = (objects: any[], getObjectId: GetObjID, sep: string): string => {\n  let output = '';\n  for (const obj of objects) {\n    const id = getObjectId(obj);\n    if (id !== null) {\n      if (output !== '') {\n        output += sep;\n      }\n      output += id;\n    }\n  }\n  return output;\n};\n\nexport const getNodesInScope = <T>(\n  parent: Element,\n  predicate: (el: Node) => T | undefined\n): T[] => {\n  const results: T[] = [];\n  const v = predicate(parent);\n  if (v !== undefined) {\n    results.push(v);\n  }\n  const walker = parent.ownerDocument.createTreeWalker(parent, SHOW_ELEMENT | SHOW_COMMENT, {\n    acceptNode(node) {\n      if (isContainer(node)) {\n        return FILTER_REJECT;\n      }\n      const v = predicate(node);\n      if (v !== undefined) {\n        results.push(v);\n      }\n      return FILTER_SKIP;\n    },\n  });\n  while (walker.nextNode()) {\n    // do nothing\n  }\n\n  return results;\n};\n\nexport interface Collector {\n  $seen$: Set<any>;\n  $objSet$: Set<any>;\n  $noSerialize$: any[];\n  $elements$: QContext[];\n  $qrls$: QRL[];\n  $inlinedFunctions$: string[];\n  $resources$: ResourceReturnInternal<unknown>[];\n  $prefetch$: number;\n  $deferElements$: QContext[];\n  $containerState$: ContainerState;\n  $promises$: Promise<any>[];\n}\n\n// Collect props proxy objects\nconst collectProps = (elCtx: QContext, collector: Collector) => {\n  const parentCtx = elCtx.$realParentCtx$ || elCtx.$parentCtx$;\n  const props = elCtx.$props$;\n  // Collect only if the parent (which changes the props) is part of the listener graph\n  if (parentCtx && props && !isEmptyObj(props) && collector.$elements$.includes(parentCtx)) {\n    const subs = getSubscriptionManager(props)?.$subs$;\n    const el = elCtx.$element$ as VirtualElement;\n    if (subs) {\n      for (const [type, host] of subs) {\n        if (type === 0) {\n          if (host !== el) {\n            collectSubscriptions(getSubscriptionManager(props)!, collector, false);\n          }\n          if (isNode(host)) {\n            collectElement(host, collector);\n          } else {\n            collectValue(host, collector, true);\n          }\n        } else {\n          collectValue(props, collector, false);\n          collectSubscriptions(getSubscriptionManager(props)!, collector, false);\n        }\n      }\n    }\n  }\n};\n\nconst createCollector = (containerState: ContainerState): Collector => {\n  const inlinedFunctions: string[] = [];\n  containerState.$inlineFns$.forEach((id, fnStr) => {\n    while (inlinedFunctions.length <= id) {\n      inlinedFunctions.push('');\n    }\n    inlinedFunctions[id] = fnStr;\n  });\n  return {\n    $containerState$: containerState,\n    $seen$: new Set(),\n    $objSet$: new Set(),\n    $prefetch$: 0,\n    $noSerialize$: [],\n    $inlinedFunctions$: inlinedFunctions,\n    $resources$: [],\n    $elements$: [],\n    $qrls$: [],\n    $deferElements$: [],\n    $promises$: [],\n  };\n};\n\nconst collectDeferElement = (el: VirtualElement, collector: Collector) => {\n  const ctx = tryGetContext(el)!;\n  if (collector.$elements$.includes(ctx)) {\n    return;\n  }\n  collector.$elements$.push(ctx);\n  if (ctx.$flags$ & HOST_FLAG_DYNAMIC) {\n    collector.$prefetch$++;\n    collectElementData(ctx, collector, true);\n    collector.$prefetch$--;\n  } else {\n    collector.$deferElements$.push(ctx);\n  }\n};\n\nconst collectElement = (el: QwikElement, collector: Collector) => {\n  const ctx = tryGetContext(el);\n  if (ctx) {\n    if (collector.$elements$.includes(ctx)) {\n      return;\n    }\n    collector.$elements$.push(ctx);\n    collectElementData(ctx, collector, el);\n  }\n};\n\nexport const collectElementData = (\n  elCtx: QContext,\n  collector: Collector,\n  dynamicCtx: QwikElement | boolean\n) => {\n  if (elCtx.$props$ && !isEmptyObj(elCtx.$props$)) {\n    collectValue(elCtx.$props$, collector, dynamicCtx);\n    collectSubscriptions(getSubscriptionManager(elCtx.$props$)!, collector, dynamicCtx);\n  }\n  if (elCtx.$componentQrl$) {\n    collectValue(elCtx.$componentQrl$, collector, dynamicCtx);\n  }\n  if (elCtx.$seq$) {\n    for (const obj of elCtx.$seq$) {\n      collectValue(obj, collector, dynamicCtx);\n    }\n  }\n  if (elCtx.$tasks$) {\n    const map = collector.$containerState$.$subsManager$.$groupToManagers$;\n    for (const obj of elCtx.$tasks$) {\n      if (map.has(obj)) {\n        collectValue(obj, collector, dynamicCtx);\n      }\n    }\n  }\n\n  if (dynamicCtx === true) {\n    collectContext(elCtx, collector);\n    if (elCtx.$dynamicSlots$) {\n      for (const slotCtx of elCtx.$dynamicSlots$) {\n        collectContext(slotCtx, collector);\n      }\n    }\n  }\n};\n\nconst collectContext = (elCtx: QContext | null | undefined, collector: Collector) => {\n  while (elCtx) {\n    if (elCtx.$contexts$) {\n      for (const obj of elCtx.$contexts$.values()) {\n        collectValue(obj, collector, true);\n      }\n    }\n    elCtx = elCtx.$parentCtx$;\n  }\n};\n\nexport const escapeText = (str: string) => {\n  return str.replace(/<(\\/?script)/gi, '\\\\x3C$1');\n};\n\n// Collect all the subscribers of this manager\nexport const collectSubscriptions = (\n  manager: LocalSubscriptionManager,\n  collector: Collector,\n  leaks: boolean | QwikElement\n) => {\n  // if (!leaks) {\n  //   return;\n  // }\n  if (collector.$seen$.has(manager)) {\n    return;\n  }\n  collector.$seen$.add(manager);\n\n  const subs = manager.$subs$;\n  assertDefined(subs, 'subs must be defined');\n  for (const sub of subs) {\n    const type = sub[0];\n    if (type > 0) {\n      collectValue((sub as SubscriberSignal)[2], collector, leaks);\n    }\n    if (leaks === true) {\n      const host = sub[1];\n      if (isNode(host) && isVirtualElement(host)) {\n        if (sub[0] === 0) {\n          collectDeferElement(host, collector);\n        }\n      } else {\n        collectValue(host, collector, true);\n      }\n    }\n  }\n};\n\nconst PROMISE_VALUE = Symbol();\n\ninterface PromiseValue {\n  resolved: boolean;\n  value: any;\n}\nconst resolvePromise = (promise: Promise<any>) => {\n  return promise.then(\n    (value) => {\n      const v: PromiseValue = {\n        resolved: true,\n        value,\n      };\n      (promise as any)[PROMISE_VALUE] = v;\n      return value;\n    },\n    (value) => {\n      const v: PromiseValue = {\n        resolved: false,\n        value,\n      };\n      (promise as any)[PROMISE_VALUE] = v;\n      return value;\n    }\n  );\n};\n\nconst getPromiseValue = (promise: Promise<any>): PromiseValue | undefined => {\n  return (promise as any)[PROMISE_VALUE];\n};\n\nexport const collectValue = (obj: unknown, collector: Collector, leaks: boolean | QwikElement) => {\n  if (obj != null) {\n    const objType = typeof obj;\n    switch (objType) {\n      case 'function':\n      case 'object': {\n        if (collector.$seen$.has(obj)) {\n          return;\n        }\n        collector.$seen$.add(obj);\n        if (fastSkipSerialize(obj)) {\n          collector.$objSet$.add(undefined);\n          collector.$noSerialize$.push(obj);\n          return;\n        }\n\n        /** The possibly proxied `obj` */\n        const input = obj;\n        const target = getProxyTarget(obj);\n        if (target) {\n          // `obj` is now the non-proxied object\n          obj = target;\n          // NOTE: You may be tempted to add the `target` to the `seen` set,\n          // but that would not work as it is possible for the `target` object\n          // to already be in `seen` set if it was passed in directly, so\n          // we can't short circuit and need to do the work.\n          // Issue: https://github.com/QwikDev/qwik/issues/5001\n          const mutable = (getProxyFlags(obj)! & QObjectImmutable) === 0;\n          if (leaks && mutable) {\n            collectSubscriptions(getSubscriptionManager(input)!, collector, leaks);\n          }\n          if (fastWeakSerialize(input)) {\n            collector.$objSet$.add(obj);\n            return;\n          }\n        }\n        const collected = collectDeps(obj, collector, leaks);\n        if (collected) {\n          collector.$objSet$.add(obj);\n          return;\n        }\n\n        if (isPromise(obj)) {\n          collector.$promises$.push(\n            resolvePromise(obj).then((value) => {\n              collectValue(value, collector, leaks);\n            })\n          );\n          return;\n        }\n\n        if (objType === 'object') {\n          if (isNode(obj)) {\n            return;\n          }\n          if (isArray(obj)) {\n            for (let i = 0; i < obj.length; i++) {\n              collectValue((input as typeof obj)[i], collector, leaks);\n            }\n          } else if (isSerializableObject(obj)) {\n            for (const key in obj) {\n              collectValue((input as typeof obj)[key], collector, leaks);\n            }\n          }\n        }\n        break;\n      }\n    }\n  }\n  collector.$objSet$.add(obj);\n};\n\nexport const isContainer = (el: Node) => {\n  return isElement(el) && el.hasAttribute(QContainerAttr);\n};\n\nconst hasContext = (el: Node) => {\n  const node = processVirtualNodes(el);\n  if (isQwikElement(node)) {\n    const ctx = tryGetContext(node);\n    if (ctx && ctx.$id$) {\n      return ctx;\n    }\n  }\n  return undefined;\n};\n\nconst getManager = (obj: any, containerState: ContainerState) => {\n  if (!isObject(obj)) {\n    return undefined;\n  }\n  if (obj instanceof SignalImpl) {\n    return getSubscriptionManager(obj);\n  }\n  const proxy = containerState.$proxyMap$.get(obj);\n  if (proxy) {\n    return getSubscriptionManager(proxy);\n  }\n  return undefined;\n};\n\nconst getQId = (el: QwikElement): string | null => {\n  const ctx = tryGetContext(el);\n  if (ctx) {\n    return ctx.$id$;\n  }\n  return null;\n};\n\nconst getTextID = (node: Text, containerState: ContainerState) => {\n  const prev = node.previousSibling;\n  if (prev && isComment(prev)) {\n    if (prev.data.startsWith('t=')) {\n      return ELEMENT_ID_PREFIX + prev.data.slice(2);\n    }\n  }\n  const doc = node.ownerDocument;\n  const id = intToStr(containerState.$elementIndex$++);\n  const open = doc.createComment(`t=${id}`);\n  const close = doc.createComment('');\n  const parent = node.parentElement!;\n  parent.insertBefore(open, node);\n  parent.insertBefore(close, node.nextSibling);\n  return ELEMENT_ID_PREFIX + id;\n};\n\nconst isEmptyObj = (obj: Record<string, any>) => {\n  return Object.keys(obj).length === 0;\n};\nfunction serializeObjects(\n  objs: any[],\n  mustGetObjId: (obj: any) => string,\n  getObjId: GetObjID | null,\n  collector: Collector,\n  containerState: any\n) {\n  return objs.map((obj) => {\n    if (obj === null) {\n      return null;\n    }\n    const typeObj = typeof obj;\n    switch (typeObj) {\n      case 'undefined':\n        return UNDEFINED_PREFIX;\n      case 'number':\n        if (!Number.isFinite(obj)) {\n          break;\n        }\n        return obj;\n      case 'string':\n        if ((obj as string).charCodeAt(0) < 32 /* space */) {\n          // if strings starts with a special character let the string serializer handle it\n          // to deal with escape sequences.\n          break;\n        } else {\n          // Fast path of just serializing the string.\n          return obj;\n        }\n      case 'boolean':\n        return obj;\n    }\n    const value = serializeValue(obj, mustGetObjId, collector, containerState);\n    if (value !== undefined) {\n      return value;\n    }\n    if (typeObj === 'object') {\n      if (isArray(obj)) {\n        return obj.map(mustGetObjId);\n      }\n      if (isSerializableObject(obj)) {\n        const output: Record<string, any> = {};\n        for (const key in obj) {\n          if (getObjId) {\n            const id = getObjId(obj[key]);\n            if (id !== null) {\n              output[key] = id;\n            }\n          } else {\n            output[key] = mustGetObjId(obj[key]);\n          }\n        }\n        return output;\n      }\n    }\n    throw qError(QError_verifySerializable, obj);\n  });\n}\n"
  },
  {
    "path": "packages/qwik/src/core/container/pause.unit.tsx",
    "content": "import type { SymbolMapper, SymbolMapperFn } from '../../optimizer/src/types';\nimport { componentQrl } from '../component/component.public';\nimport { useComputedQrl } from '../use/use-task';\nimport { useSignal } from '../use/use-signal';\nimport { renderToString } from '../../server/render';\nimport { assert, test } from 'vitest';\nimport { inlinedQrl } from '../qrl/qrl';\n\nconst symbolMapper: SymbolMapperFn = (symbolName: string, mapper: SymbolMapper | undefined) => {\n  return [symbolName, `q-${symbolName}.js`];\n};\n\ntest('issue-4979', async () => {\n  await renderToString(<Issue4979 />, {\n    containerTagName: 'div',\n    symbolMapper: symbolMapper,\n    manifest: {} as any,\n  });\n\n  assert(true, 'Serialized successfully');\n});\n\nexport const Issue4979Inner = componentQrl<{ value: number }>(\n  inlinedQrl(\n    (props) => {\n      const foo = useComputedQrl(\n        inlinedQrl(\n          () => {\n            return Object.entries(props);\n          },\n          's_foo',\n          [props]\n        )\n      );\n\n      return <span {...foo.value} />;\n    },\n    's_issue4979Inner',\n    []\n  )\n);\n\nexport const Issue4979 = componentQrl(\n  inlinedQrl(\n    () => {\n      const pageSig = useSignal(1);\n\n      const currentDataSig = useComputedQrl(\n        inlinedQrl(\n          () => {\n            return [pageSig.value];\n          },\n          's_currentData',\n          [pageSig]\n        )\n      );\n\n      return (\n        <>\n          <button onClick$={inlinedQrl(() => (pageSig.value += 1), 's_click', [pageSig])}>\n            Next\n          </button>\n          {currentDataSig.value.map((o) => (\n            <Issue4979Inner key={o} value={o} />\n          ))}\n        </>\n      );\n    },\n    's_issue4979',\n    []\n  )\n);\n"
  },
  {
    "path": "packages/qwik/src/core/container/render.unit.tsx",
    "content": "import { assert, suite, test } from 'vitest';\nimport { renderToString } from '../../server/render';\nimport { createDocument } from '../../testing/document';\nimport { createDOM } from '../../testing/library';\nimport { component$ } from '../component/component.public';\nimport { _fnSignal } from '../internal';\nimport { useSignal } from '../use/use-signal';\nimport type { JSXOutput } from '../render/jsx/types/jsx-node';\n\nsuite('jsx signals', () => {\n  const RenderJSX = component$(() => {\n    const jsx = useSignal<string | JSXOutput>(<span>SSR</span>);\n    return (\n      <>\n        <button\n          class=\"set-jsx\"\n          onJsx$={(e: CustomEvent<JSXOutput | string>) => (jsx.value = e.detail)}\n        />\n        <div class=\"jsx\">{jsx.value}</div>\n        <div class=\"jsx-signal\">{_fnSignal((p0) => p0.value, [jsx], 'p0.value')}</div>\n      </>\n    );\n  });\n\n  test.skip('SSR jsx', async () => {\n    const output = await renderToString(<RenderJSX />, { containerTagName: 'div' });\n    const document = createDocument();\n    document.body.innerHTML = output.html;\n    const div = document.querySelector('.jsx')!;\n    assert.equal(div.innerHTML, '<span>SSR</span>');\n    const divSignal = document.querySelector('.jsx-signal')!;\n    assert.equal(divSignal.innerHTML, '<!--t=1--><span>SSR</span><!---->');\n  });\n\n  test('CSR basic jsx', async () => {\n    const { screen, render, userEvent } = await createDOM();\n\n    await render(<RenderJSX />);\n    const div = screen.querySelector('.jsx')!;\n    const divSignal = screen.querySelector('.jsx-signal')!;\n    assert.equal(div.innerHTML, '<span>SSR</span>');\n    assert.equal(divSignal.innerHTML, '<span>SSR</span>');\n\n    await userEvent('.set-jsx', 'jsx', { detail: 'text' });\n    assert.equal(div.innerHTML, 'text');\n    assert.equal(divSignal.innerHTML, 'text');\n\n    await userEvent('.set-jsx', 'jsx', { detail: <i>i</i> });\n    assert.equal(div.innerHTML, '<i>i</i>');\n    assert.equal(divSignal.innerHTML, '<i>i</i>');\n\n    await userEvent('.set-jsx', 'jsx', { detail: <b>b</b> });\n    assert.equal(div.innerHTML, '<b>b</b>');\n    assert.equal(divSignal.innerHTML, '<b>b</b>');\n\n    await userEvent('.set-jsx', 'jsx', { detail: <>v</> });\n    assert.equal(div.innerHTML, 'v');\n    assert.equal(divSignal.innerHTML, 'v');\n\n    await userEvent('.set-jsx', 'jsx', { detail: <b>b</b> });\n    assert.equal(div.innerHTML, '<b>b</b>');\n    assert.equal(divSignal.innerHTML, '<b>b</b>');\n\n    await userEvent('.set-jsx', 'jsx', { detail: 'text' });\n    assert.equal(div.innerHTML, 'text');\n    assert.equal(divSignal.innerHTML, 'text');\n  });\n\n  test('CSR jsx primitives', async () => {\n    const { screen, render, userEvent } = await createDOM();\n\n    await render(<RenderJSX />);\n    const div = screen.querySelector('.jsx')!;\n    const divSignal = screen.querySelector('.jsx-signal')!;\n    assert.equal(div.innerHTML, '<span>SSR</span>');\n    assert.equal(divSignal.innerHTML, '<span>SSR</span>');\n\n    await userEvent('.set-jsx', 'jsx', { detail: true });\n    assert.equal(div.innerHTML, '');\n    assert.equal(divSignal.innerHTML, '');\n\n    await userEvent('.set-jsx', 'jsx', { detail: 0 });\n    assert.equal(div.innerHTML, '0');\n    assert.equal(divSignal.innerHTML, '0');\n  });\n\n  test('CSR jsx arrays', async () => {\n    const { screen, render, userEvent } = await createDOM();\n\n    await render(<RenderJSX />);\n    const div = screen.querySelector('.jsx')!;\n    const divSignal = screen.querySelector('.jsx-signal')!;\n    assert.equal(div.innerHTML, '<span>SSR</span>');\n    assert.equal(divSignal.innerHTML, '<span>SSR</span>');\n\n    await userEvent('.set-jsx', 'jsx', { detail: [] });\n    assert.equal(div.innerHTML, '');\n    assert.equal(divSignal.innerHTML, '<!--qv --><!--/qv-->');\n\n    await userEvent('.set-jsx', 'jsx', { detail: ['text', <b>b</b>] });\n    assert.equal(div.innerHTML, 'text<b>b</b>');\n    assert.equal(divSignal.innerHTML, '<!--qv -->text<b>b</b><!--/qv-->');\n  });\n\n  test.skip('CSR jsx Promises', async () => {\n    // Render signals that resolves promise is not supported\n    const { screen, render, userEvent } = await createDOM();\n\n    await render(<RenderJSX />);\n    const div = screen.querySelector('.jsx')!;\n    const divSignal = screen.querySelector('.jsx-signal')!;\n    assert.equal(div.innerHTML, '<span>SSR</span>');\n    assert.equal(divSignal.innerHTML, '<span>SSR</span>');\n\n    await userEvent('.set-jsx', 'jsx', { detail: Promise.resolve('Test') });\n    assert.equal(div.innerHTML, 'Test');\n    assert.equal(divSignal.innerHTML, 'Test');\n  });\n\n  const ChildComp = component$(() => <span>ChildComp</span>);\n\n  test('CSR jsx with component', async () => {\n    // Render signals that resolves promise is not supported\n    const { screen, render, userEvent } = await createDOM();\n\n    await render(<RenderJSX />);\n    const div = screen.querySelector('.jsx')!;\n    const divSignal = screen.querySelector('.jsx-signal')!;\n    assert.equal(div.innerHTML, '<span>SSR</span>');\n    assert.equal(divSignal.innerHTML, '<span>SSR</span>');\n\n    await userEvent('.set-jsx', 'jsx', {\n      detail: <ChildComp />,\n    });\n    assert.equal(div.innerHTML, '<!--qv --><span>ChildComp</span><!--/qv-->');\n    assert.equal(divSignal.innerHTML, '<!--qv --><span>ChildComp</span><!--/qv-->');\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/container/resume.ts",
    "content": "import { assertDefined, assertTrue } from '../error/assert';\nimport { getDocument } from '../util/dom';\nimport { isComment, isElement, isNode, isQwikElement, isText } from '../util/element';\nimport { logDebug, logWarn } from '../util/log';\nimport { ELEMENT_ID, QContainerAttr, QInstance, getQFuncs } from '../util/markers';\n\nimport { emitEvent } from '../util/event';\n\nimport { isArray, isSerializableObject, isString } from '../util/types';\nimport { directGetAttribute, directSetAttribute } from '../render/fast-calls';\nimport { createParser, OBJECT_TRANSFORMS, type Parser, UNDEFINED_PREFIX } from './serializers';\nimport {\n  type ContainerState,\n  _getContainerState,\n  type GetObject,\n  isContainer,\n  SHOW_COMMENT,\n  type SnapshotState,\n  strToInt,\n} from './container';\nimport { getVirtualElement } from '../render/dom/virtual-element';\nimport { getSubscriptionManager, parseSubscription, type Subscriptions } from '../state/common';\nimport { createProxy, setObjectFlags } from '../state/store';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { pauseContainer } from './pause';\nimport { isPrimitive } from '../render/dom/render-dom';\nimport { getWrappingContainer } from '../use/use-core';\nimport { getContext } from '../state/context';\n\nexport const resumeIfNeeded = (containerEl: Element): void => {\n  const isResumed = directGetAttribute(containerEl, QContainerAttr);\n  if (isResumed === 'paused') {\n    resumeContainer(containerEl);\n    if (qSerialize) {\n      appendQwikDevTools(containerEl);\n    }\n  }\n};\n\nexport const getPauseState = (containerEl: Element): SnapshotState | undefined => {\n  const doc = getDocument(containerEl);\n  const isDocElement = containerEl === doc.documentElement;\n  const parentJSON = isDocElement ? doc.body : containerEl;\n  const script = getQwikJSON(parentJSON, 'type');\n  if (script) {\n    const data = (script.firstChild! as any).data;\n    return JSON.parse(unescapeText(data) || '{}') as SnapshotState;\n  }\n};\n\n/** @internal */\nexport const _deserializeData = (data: string, element?: unknown) => {\n  const obj = JSON.parse(data);\n  if (typeof obj !== 'object') {\n    return null;\n  }\n  const { _objs, _entry } = obj;\n  if (typeof _objs === 'undefined' || typeof _entry === 'undefined') {\n    return null;\n  }\n  let doc = {} as Document;\n  let containerState = {} as any;\n  if (isNode(element) && isQwikElement(element)) {\n    const containerEl = getWrappingContainer(element);\n    if (containerEl) {\n      containerState = _getContainerState(containerEl);\n      doc = containerEl.ownerDocument;\n    }\n  }\n  const parser = createParser(containerState, doc);\n\n  for (let i = 0; i < _objs.length; i++) {\n    const value = _objs[i];\n    if (isString(value)) {\n      _objs[i] = value === UNDEFINED_PREFIX ? undefined : parser.prepare(value);\n    }\n  }\n\n  const getObject: GetObject = (id) => _objs[strToInt(id)];\n  for (const obj of _objs) {\n    reviveNestedObjects(obj, getObject, parser);\n  }\n  return getObject(_entry);\n};\n\nexport const resumeContainer = (containerEl: Element) => {\n  if (!isContainer(containerEl)) {\n    logWarn('Skipping resuming because parent element is not q:container');\n    return;\n  }\n\n  const pauseState =\n    (containerEl as any)['_qwikjson_'] ?? (getPauseState(containerEl) as SnapshotState);\n\n  (containerEl as any)['_qwikjson_'] = null;\n  if (!pauseState) {\n    logWarn('Skipping resuming qwik/json metadata was not found.');\n    return;\n  }\n\n  const doc = getDocument(containerEl);\n  const hash = containerEl.getAttribute(QInstance)!;\n  const isDocElement = containerEl === doc.documentElement;\n  const parentJSON = isDocElement ? doc.body : containerEl;\n  if (qDev) {\n    const script = getQwikJSON(parentJSON, 'type');\n    if (!script) {\n      logWarn('Skipping resuming qwik/json metadata was not found.');\n      return;\n    }\n  }\n\n  const inlinedFunctions = getQFuncs(doc, hash);\n  const containerState = _getContainerState(containerEl);\n\n  // Collect all elements\n  const elements = new Map<number, Node>();\n  const text = new Map<number, string>();\n  let node: Comment | null = null;\n  let container = 0;\n\n  // Collect all virtual elements\n  const elementWalker = doc.createTreeWalker(containerEl, SHOW_COMMENT);\n\n  while ((node = elementWalker.nextNode() as Comment)) {\n    const data = node.data;\n    if (container === 0) {\n      if (data.startsWith('qv ')) {\n        const id = getID(data); // TODO: remove\n        if (id >= 0) {\n          elements.set(id, node);\n        }\n      } else if (data.startsWith('t=')) {\n        const id = data.slice(2);\n        const index = strToInt(id);\n        const textNode = getTextNode(node);\n        elements.set(index, textNode);\n        text.set(index, textNode.data);\n      }\n    }\n    if (data === 'cq') {\n      container++;\n    } else if (data === '/cq') {\n      container--;\n    }\n  }\n\n  // Collect all elements\n  // If there are nested container, we are forced to take a slower path.\n  // In order to check if there are nested containers, we use the `'qc📦'` class.\n  // This is because checking for class is the fastest way for the browser to find it.\n  const slotPath = containerEl.getElementsByClassName('qc📦').length !== 0;\n  containerEl.querySelectorAll('[q\\\\:id]').forEach((el) => {\n    if (slotPath && el.closest('[q\\\\:container]') !== containerEl) {\n      return;\n    }\n    const id = directGetAttribute(el, ELEMENT_ID);\n    assertDefined(id, `resume: element missed q:id`, el);\n    const index = strToInt(id);\n    elements.set(index, el);\n  });\n  const parser = createParser(containerState, doc);\n\n  const finalized = new Map<string, any>();\n  const revived = new Set<number>();\n\n  const getObject: GetObject = (id) => {\n    assertTrue(\n      typeof id === 'string' && id.length > 0,\n      'resume: id must be an non-empty string, got:',\n      id\n    );\n    if (finalized.has(id)) {\n      return finalized.get(id);\n    }\n    return computeObject(id);\n  };\n\n  const computeObject: GetObject = (id) => {\n    // Handle elements\n    if (id.startsWith('#')) {\n      const elementId = id.slice(1);\n      const index = strToInt(elementId);\n      assertTrue(elements.has(index), `missing element for id:`, elementId);\n      const rawElement = elements.get(index);\n      assertDefined(rawElement, `missing element for id:`, elementId);\n      if (isComment(rawElement)) {\n        if (!rawElement.isConnected) {\n          finalized.set(id, undefined);\n          return undefined;\n        }\n        const virtual = getVirtualElement(rawElement);\n        finalized.set(id, virtual);\n        getContext(virtual!, containerState);\n        return virtual;\n      } else if (isElement(rawElement)) {\n        finalized.set(id, rawElement);\n        getContext(rawElement, containerState);\n        return rawElement;\n      }\n      finalized.set(id, rawElement);\n      return rawElement;\n    } else if (id.startsWith('@')) {\n      const funcId = id.slice(1);\n      const index = strToInt(funcId);\n      const func = inlinedFunctions[index];\n      assertDefined(func, `missing inlined function for id:`, funcId);\n      return func;\n    } else if (id.startsWith('*')) {\n      const elementId = id.slice(1);\n      const index = strToInt(elementId);\n      assertTrue(elements.has(index), `missing element for id:`, elementId);\n      const str = text.get(index);\n      assertDefined(str, `missing element for id:`, elementId);\n      finalized.set(id, str);\n      return str;\n    }\n    const index = strToInt(id);\n    const objs = pauseState.objs;\n    assertTrue(objs.length > index, 'resume: index is out of bounds', id);\n    let value = objs[index];\n    if (isString(value)) {\n      value = value === UNDEFINED_PREFIX ? undefined : parser.prepare(value);\n    }\n    let obj = value;\n    for (let i = id.length - 1; i >= 0; i--) {\n      const code = id[i];\n      const transform = OBJECT_TRANSFORMS[code];\n      if (!transform) {\n        break;\n      }\n      obj = transform(obj, containerState);\n    }\n    finalized.set(id, obj);\n\n    if (!isPrimitive(value) && !revived.has(index)) {\n      revived.add(index);\n      reviveSubscriptions(value, index, pauseState.subs, getObject, containerState, parser);\n      reviveNestedObjects(value, getObject, parser);\n    }\n    return obj;\n  };\n\n  containerState.$elementIndex$ = 100000;\n  containerState.$pauseCtx$ = {\n    getObject,\n    meta: pauseState.ctx,\n    refs: pauseState.refs,\n  };\n\n  directSetAttribute(containerEl, QContainerAttr, 'resumed');\n  logDebug('Container resumed');\n  emitEvent(containerEl, 'qresume', undefined, true);\n};\n\nconst reviveSubscriptions = (\n  value: any,\n  i: number,\n  objsSubs: any[],\n  getObject: GetObject,\n  containerState: ContainerState,\n  parser: Parser\n) => {\n  const subs = objsSubs[i] as string[];\n  if (subs) {\n    const converted: Subscriptions[] = [];\n    let flag = 0;\n    for (const sub of subs) {\n      if (sub.startsWith('_')) {\n        flag = parseInt(sub.slice(1), 10);\n      } else {\n        const parsed = parseSubscription(sub, getObject);\n        if (parsed) {\n          converted.push(parsed);\n        }\n      }\n    }\n    if (flag > 0) {\n      setObjectFlags(value, flag);\n    }\n    if (!parser.subs(value, converted)) {\n      const proxy = containerState.$proxyMap$.get(value);\n      if (proxy) {\n        getSubscriptionManager(proxy)!.$addSubs$(converted);\n      } else {\n        createProxy(value, containerState, converted);\n      }\n    }\n  }\n};\n\nconst reviveNestedObjects = (obj: unknown, getObject: GetObject, parser: Parser) => {\n  if (parser.fill(obj, getObject)) {\n    return;\n  }\n\n  if (obj && typeof obj == 'object') {\n    if (isArray(obj)) {\n      for (let i = 0; i < obj.length; i++) {\n        obj[i] = getObject(obj[i] as string);\n      }\n    } else if (isSerializableObject(obj)) {\n      for (const key in obj) {\n        obj[key] = getObject(obj[key] as string);\n      }\n    }\n  }\n};\n\nconst unescapeText = (str: string) => {\n  return str.replace(/\\\\x3C(\\/?script)/gi, '<$1');\n};\n\nexport const getQwikJSON = (\n  parentElm: Element,\n  attribute: string\n): HTMLScriptElement | undefined => {\n  let child = parentElm.lastElementChild;\n  while (child) {\n    if (child.tagName === 'SCRIPT' && directGetAttribute(child, attribute) === 'qwik/json') {\n      return child as HTMLScriptElement;\n    }\n    child = child.previousElementSibling;\n  }\n  return undefined;\n};\n\nconst getTextNode = (mark: Comment) => {\n  const nextNode = mark.nextSibling!;\n  if (isText(nextNode)) {\n    return nextNode;\n  } else {\n    const textNode = mark.ownerDocument.createTextNode('');\n    mark.parentElement!.insertBefore(textNode, mark);\n    return textNode;\n  }\n};\n\nexport const appendQwikDevTools = (containerEl: Element) => {\n  (containerEl as any)['qwik'] = {\n    pause: () => pauseContainer(containerEl),\n    state: _getContainerState(containerEl),\n  };\n};\n\nexport const getID = (stuff: string) => {\n  const index = stuff.indexOf('q:id=');\n  if (index > 0) {\n    return strToInt(stuff.slice(index + 5));\n  }\n  return -1;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/container/serializers.ts",
    "content": "import {\n  type Component,\n  componentQrl,\n  isQwikComponent,\n  type OnRenderFn,\n} from '../component/component.public';\nimport { parseQRL, serializeQRL } from '../qrl/qrl';\nimport { isQrl, type QRLInternal } from '../qrl/qrl-class';\nimport { intToStr, type ContainerState, type GetObject, type MustGetObjID } from './container';\nimport { isResourceReturn, parseResourceReturn, serializeResource } from '../use/use-resource';\nimport {\n  isSubscriberDescriptor,\n  parseTask,\n  type ResourceReturnInternal,\n  serializeTask,\n  type SubscriberEffect,\n} from '../use/use-task';\nimport { isDocument } from '../util/element';\nimport {\n  QObjectSignalFlags,\n  SIGNAL_IMMUTABLE,\n  SignalDerived,\n  SignalImpl,\n  SignalWrapper,\n} from '../state/signal';\nimport { type Collector, collectSubscriptions, collectValue, mapJoin } from './pause';\nimport {\n  fastWeakSerialize,\n  getSubscriptionManager,\n  LocalSubscriptionManager,\n  type SubscriptionManager,\n  type Subscriptions,\n} from '../state/common';\nimport { getOrCreateProxy } from '../state/store';\nimport { QObjectManagerSymbol } from '../state/constants';\nimport { serializeDerivedSignalFunc } from '../qrl/inlined-fn';\nimport type { QwikElement } from '../render/dom/virtual-element';\nimport { assertString, assertTrue } from '../error/assert';\nimport { Fragment, JSXNodeImpl, isJSXNode } from '../render/jsx/jsx-runtime';\nimport { Slot } from '../render/jsx/slot.public';\nimport type { JSXNodeInternal } from '../render/jsx/types/jsx-node';\n\n/**\n * - 0, 8, 9, A, B, C, D\n * - `\\0`: null character (U+0000 NULL) (only if the next character is not a decimal digit; else it’s\n *   an octal escape sequence)\n * - `\\b`: backspace (U+0008 BACKSPACE)\n * - `\\t`: horizontal tab (U+0009 CHARACTER TABULATION)\n * - `\\n`: line feed (U+000A LINE FEED)\n * - `\\v`: vertical tab (U+000B LINE TABULATION)\n * - `\\f`: form feed (U+000C FORM FEED)\n * - `\\r`: carriage return (U+000D CARRIAGE RETURN)\n * - `\\\"`: double quote (U+0022 QUOTATION MARK)\n * - `\\'`: single quote (U+0027 APOSTROPHE)\n * - `\\\\`: backslash (U+005C REVERSE SOLIDUS)\n */\nexport const UNDEFINED_PREFIX = '\\u0001';\n\ninterface SerializerInput<T> {\n  /** Unique identifier for this type */\n  $prefix$: string;\n  /** Can this serializer can serialize the given object? */\n  $test$: (obj: unknown) => boolean;\n  /** Convert the object to a string. */\n  $serialize$?:\n    | ((\n        obj: T,\n        getObjID: MustGetObjID,\n        collector: Collector,\n        containerState: ContainerState\n      ) => string)\n    | undefined;\n\n  /** Collect all relevant values before serializing */\n  $collect$?: undefined | ((obj: T, collector: Collector, leaks: boolean | QwikElement) => void);\n\n  /** Deserialize the object, first pass */\n  $prepare$: (data: string, containerState: ContainerState, doc: Document) => T;\n  /** After $prepare$, restore subscribers of the object. */\n  $subs$?: undefined | ((obj: T, subs: Subscriptions[], containerState: ContainerState) => void);\n\n  /** After $prepare$, fill in the object. */\n  $fill$?: ((obj: T, getObject: GetObject, containerState: ContainerState) => void) | undefined;\n}\n\ninterface Serializer<T> extends Omit<SerializerInput<T>, '$prefix$' | '$test$'> {\n  /** The identifier as a charcode */\n  $prefixCode$: number;\n  /** The identifier as a string */\n  $prefixChar$: string;\n  /** Can this serializer can serialize the given object? */\n  $test$: (obj: unknown) => obj is T;\n}\n\n/**\n * Normalize the shape of the serializer for better inline-cache performance.\n *\n * @param serializer\n * @returns\n */\nfunction serializer<T>(serializer: SerializerInput<T>): Serializer<T> {\n  return {\n    $prefixCode$: serializer.$prefix$.charCodeAt(0),\n    $prefixChar$: serializer.$prefix$,\n    $test$: serializer.$test$ as any,\n    $serialize$: serializer.$serialize$,\n    $prepare$: serializer.$prepare$,\n    $fill$: serializer.$fill$,\n    $collect$: serializer.$collect$,\n    $subs$: serializer.$subs$,\n  };\n}\n\nconst QRLSerializer = /*#__PURE__*/ serializer<QRLInternal>({\n  $prefix$: '\\u0002',\n  $test$: (v) => isQrl(v),\n  $collect$: (v, collector, leaks) => {\n    if (v.$captureRef$) {\n      for (const item of v.$captureRef$) {\n        collectValue(item, collector, leaks);\n      }\n    }\n    if (collector.$prefetch$ === 0) {\n      collector.$qrls$.push(v);\n    }\n  },\n  $serialize$: (obj, getObjId) => {\n    return serializeQRL(obj, {\n      $getObjId$: getObjId,\n    });\n  },\n  $prepare$: (data, containerState) => {\n    return parseQRL(data, containerState.$containerEl$);\n  },\n  $fill$: (qrl, getObject) => {\n    if (qrl.$capture$ && qrl.$capture$.length > 0) {\n      qrl.$captureRef$ = qrl.$capture$.map(getObject);\n      qrl.$capture$ = null;\n    }\n  },\n});\n\nconst TaskSerializer = /*#__PURE__*/ serializer<SubscriberEffect>({\n  $prefix$: '\\u0003',\n  $test$: (v) => isSubscriberDescriptor(v),\n  $collect$: (v, collector, leaks) => {\n    collectValue(v.$qrl$, collector, leaks);\n    if (v.$state$) {\n      collectValue(v.$state$, collector, leaks);\n      if (leaks === true && v.$state$ instanceof SignalImpl) {\n        collectSubscriptions(v.$state$[QObjectManagerSymbol], collector, true);\n      }\n    }\n  },\n  $serialize$: (obj, getObjId) => serializeTask(obj, getObjId),\n  $prepare$: (data) => parseTask(data) as any,\n  $fill$: (task, getObject) => {\n    task.$el$ = getObject(task.$el$ as any);\n    task.$qrl$ = getObject(task.$qrl$ as any);\n    if (task.$state$) {\n      task.$state$ = getObject(task.$state$ as any);\n    }\n  },\n});\n\nconst ResourceSerializer = /*#__PURE__*/ serializer<ResourceReturnInternal<any>>({\n  $prefix$: '\\u0004',\n  $test$: (v) => isResourceReturn(v),\n  $collect$: (obj, collector, leaks) => {\n    collectValue(obj.value, collector, leaks);\n    collectValue(obj._resolved, collector, leaks);\n  },\n  $serialize$: (obj, getObjId) => {\n    return serializeResource(obj, getObjId);\n  },\n  $prepare$: (data) => {\n    return parseResourceReturn(data);\n  },\n  $fill$: (resource, getObject) => {\n    if (resource._state === 'resolved') {\n      resource._resolved = getObject(resource._resolved);\n      resource.value = Promise.resolve(resource._resolved);\n    } else if (resource._state === 'rejected') {\n      const p = Promise.reject(resource._error);\n      p.catch(() => null);\n      resource._error = getObject(resource._error as any as string);\n      resource.value = p;\n    }\n  },\n});\n\nconst URLSerializer = /*#__PURE__*/ serializer<URL>({\n  $prefix$: '\\u0005',\n  $test$: (v) => v instanceof URL,\n  $serialize$: (obj) => obj.href,\n  $prepare$: (data) => new URL(data),\n});\n\nconst DateSerializer = /*#__PURE__*/ serializer<Date>({\n  $prefix$: '\\u0006',\n  $test$: (v) => v instanceof Date,\n  $serialize$: (obj) => obj.toISOString(),\n  $prepare$: (data) => new Date(data),\n});\n\nconst RegexSerializer = /*#__PURE__*/ serializer<RegExp>({\n  $prefix$: '\\u0007',\n  $test$: (v) => v instanceof RegExp,\n  $serialize$: (obj) => `${obj.flags} ${obj.source}`,\n  $prepare$: (data) => {\n    const space = data.indexOf(' ');\n    const source = data.slice(space + 1);\n    const flags = data.slice(0, space);\n    return new RegExp(source, flags);\n  },\n});\n\nconst ErrorSerializer = /*#__PURE__*/ serializer<Error>({\n  $prefix$: '\\u000E',\n  $test$: (v) => v instanceof Error,\n  $serialize$: (obj) => {\n    return obj.message;\n  },\n  $prepare$: (text) => {\n    const err = new Error(text);\n    err.stack = undefined;\n    return err;\n  },\n});\n\nconst DocumentSerializer = /*#__PURE__*/ serializer<Document>({\n  $prefix$: '\\u000F',\n  $test$: (v) => !!v && typeof v === 'object' && isDocument(v as Node),\n  $prepare$: (_, _c, doc) => {\n    return doc;\n  },\n});\n\nexport const SERIALIZABLE_STATE = Symbol('serializable-data');\nconst ComponentSerializer = /*#__PURE__*/ serializer<Component>({\n  $prefix$: '\\u0010',\n  $test$: (obj) => isQwikComponent(obj),\n  $serialize$: (obj, getObjId) => {\n    const [qrl]: [QRLInternal] = (obj as any)[SERIALIZABLE_STATE];\n    return serializeQRL(qrl, {\n      $getObjId$: getObjId,\n    });\n  },\n  $prepare$: (data, containerState) => {\n    const qrl = parseQRL<OnRenderFn<any>>(data, containerState.$containerEl$);\n    return componentQrl(qrl);\n  },\n  $fill$: (component, getObject) => {\n    const [qrl]: [QRLInternal] = (component as any)[SERIALIZABLE_STATE];\n    if (qrl.$capture$?.length) {\n      qrl.$captureRef$ = qrl.$capture$.map(getObject);\n      qrl.$capture$ = null;\n    }\n  },\n});\n\nconst DerivedSignalSerializer = /*#__PURE__*/ serializer<SignalDerived>({\n  $prefix$: '\\u0011',\n  $test$: (obj) => obj instanceof SignalDerived,\n  $collect$: (obj, collector, leaks) => {\n    if (obj.$args$) {\n      for (const arg of obj.$args$) {\n        collectValue(arg, collector, leaks);\n      }\n    }\n  },\n  $serialize$: (signal, getObjID, collector) => {\n    const serialized = serializeDerivedSignalFunc(signal);\n    let index = collector.$inlinedFunctions$.indexOf(serialized);\n    if (index < 0) {\n      index = collector.$inlinedFunctions$.length;\n      collector.$inlinedFunctions$.push(serialized);\n    }\n    return mapJoin(signal.$args$, getObjID, ' ') + ' @' + intToStr(index);\n  },\n  $prepare$: (data) => {\n    const ids = data.split(' ');\n    const args = ids.slice(0, -1);\n    const fn = ids[ids.length - 1];\n    return new SignalDerived(fn as any, args as any[], fn);\n  },\n  $fill$: (fn, getObject) => {\n    assertString(fn.$func$, 'fn.$func$ should be a string');\n    fn.$func$ = getObject(fn.$func$);\n    fn.$args$ = (fn.$args$ as string[]).map(getObject);\n  },\n});\n\nconst SignalSerializer = /*#__PURE__*/ serializer<SignalImpl<any>>({\n  $prefix$: '\\u0012',\n  $test$: (v) => v instanceof SignalImpl,\n  $collect$: (obj, collector, leaks) => {\n    collectValue(obj.untrackedValue, collector, leaks);\n    const mutable = (obj[QObjectSignalFlags] & SIGNAL_IMMUTABLE) === 0;\n    if (leaks === true && mutable) {\n      collectSubscriptions(obj[QObjectManagerSymbol], collector, true);\n    }\n    return obj;\n  },\n  $serialize$: (obj, getObjId) => {\n    return getObjId(obj.untrackedValue);\n  },\n  $prepare$: (data, containerState) => {\n    return new SignalImpl(data, containerState?.$subsManager$?.$createManager$(), 0);\n  },\n  $subs$: (signal, subs) => {\n    signal[QObjectManagerSymbol].$addSubs$(subs);\n  },\n  $fill$: (signal, getObject) => {\n    signal.untrackedValue = getObject(signal.untrackedValue);\n  },\n});\n\nconst SignalWrapperSerializer = /*#__PURE__*/ serializer<SignalWrapper<any, any>>({\n  $prefix$: '\\u0013',\n  $test$: (v) => v instanceof SignalWrapper,\n  $collect$(obj, collector, leaks) {\n    collectValue(obj.ref, collector, leaks);\n    if (fastWeakSerialize(obj.ref)) {\n      const localManager = getSubscriptionManager(obj.ref)!;\n      if (isTreeShakeable(collector.$containerState$.$subsManager$, localManager, leaks)) {\n        collectValue(obj.ref[obj.prop], collector, leaks);\n      }\n    }\n    return obj;\n  },\n  $serialize$: (obj, getObjId) => {\n    return `${getObjId(obj.ref)} ${obj.prop}`;\n  },\n  $prepare$: (data) => {\n    const [id, prop] = data.split(' ');\n    return new SignalWrapper(id as any, prop);\n  },\n  $fill$: (signal, getObject) => {\n    signal.ref = getObject(signal.ref);\n  },\n});\n\nconst NoFiniteNumberSerializer = /*#__PURE__*/ serializer<number>({\n  $prefix$: '\\u0014',\n  $test$: (v) => typeof v === 'number',\n  $serialize$: (v) => {\n    return String(v);\n  },\n  $prepare$: (data) => {\n    return Number(data);\n  },\n});\n\nconst URLSearchParamsSerializer = /*#__PURE__*/ serializer<URLSearchParams>({\n  $prefix$: '\\u0015',\n  $test$: (v) => v instanceof URLSearchParams,\n  $serialize$: (obj) => obj.toString(),\n  $prepare$: (data) => new URLSearchParams(data),\n});\n\nconst FormDataSerializer = /*#__PURE__*/ serializer<FormData>({\n  $prefix$: '\\u0016',\n  $test$: (v) => typeof FormData !== 'undefined' && v instanceof globalThis.FormData,\n  $serialize$: (formData) => {\n    const array: [string, string][] = [];\n    formData.forEach((value, key) => {\n      if (typeof value === 'string') {\n        array.push([key, value]);\n      } else {\n        array.push([key, value.name]);\n      }\n    });\n    return JSON.stringify(array);\n  },\n  $prepare$: (data) => {\n    const array = JSON.parse(data);\n    const formData = new FormData();\n    for (const [key, value] of array) {\n      formData.append(key, value);\n    }\n    return formData;\n  },\n});\n\nconst JSXNodeSerializer = /*#__PURE__*/ serializer<JSXNodeInternal>({\n  $prefix$: '\\u0017',\n  $test$: (v) => isJSXNode(v),\n  $collect$: (node, collector, leaks) => {\n    collectValue(node.children, collector, leaks);\n    collectValue(node.props, collector, leaks);\n    collectValue(node.immutableProps, collector, leaks);\n    collectValue(node.key, collector, leaks);\n    let type = node.type;\n    if (type === Slot) {\n      type = ':slot';\n    } else if (type === Fragment) {\n      type = ':fragment';\n    }\n    collectValue(type, collector, leaks);\n  },\n  $serialize$: (node, getObjID) => {\n    let type = node.type;\n    if (type === Slot) {\n      type = ':slot';\n    } else if (type === Fragment) {\n      type = ':fragment';\n    }\n    return `${getObjID(type)} ${getObjID(node.props)} ${getObjID(node.immutableProps)} ${getObjID(\n      node.key\n    )} ${getObjID(node.children)} ${node.flags}`;\n  },\n  $prepare$: (data) => {\n    const [type, props, immutableProps, key, children, flags] = data.split(' ');\n    const node = new JSXNodeImpl(\n      type as string,\n      props as any,\n      immutableProps as any,\n      children,\n      parseInt(flags, 10),\n      key as string\n    );\n    return node;\n  },\n  $fill$: (node, getObject) => {\n    node.type = getResolveJSXType(getObject(node.type as string));\n    node.props = getObject(node.props as any as string);\n    node.immutableProps = getObject(node.immutableProps as any as string);\n    node.key = getObject(node.key as string);\n    node.children = getObject(node.children as string);\n  },\n});\n\nconst BigIntSerializer = /*#__PURE__*/ serializer<bigint>({\n  $prefix$: '\\u0018',\n  $test$: (v) => typeof v === 'bigint',\n  $serialize$: (v) => {\n    return v.toString();\n  },\n  $prepare$: (data) => {\n    return BigInt(data);\n  },\n});\n\nconst Uint8ArraySerializer = /*#__PURE__*/ serializer<Uint8Array>({\n  $prefix$: '\\u001c',\n  $test$: (v) => v instanceof Uint8Array,\n  $serialize$: (v) => {\n    let buf = '';\n    for (const c of v) {\n      buf += String.fromCharCode(c);\n    }\n    return btoa(buf).replace(/=+$/, '');\n  },\n  $prepare$: (data) => {\n    const buf = atob(data);\n    const bytes = new Uint8Array(buf.length);\n    let i = 0;\n    for (const s of buf) {\n      bytes[i++] = s.charCodeAt(0);\n    }\n    return bytes;\n  },\n  $fill$: undefined,\n});\n\nconst DATA = Symbol();\nconst SetSerializer = /*#__PURE__*/ serializer<Set<any>>({\n  $prefix$: '\\u0019',\n  $test$: (v) => v instanceof Set,\n  $collect$: (set, collector, leaks) => {\n    set.forEach((value) => collectValue(value, collector, leaks));\n  },\n  $serialize$: (v, getObjID) => {\n    return Array.from(v).map(getObjID).join(' ');\n  },\n  $prepare$: (data) => {\n    const set = new Set();\n    (set as any)[DATA] = data;\n    return set;\n  },\n  $fill$: (set, getObject) => {\n    const data = (set as any)[DATA];\n    (set as any)[DATA] = undefined;\n    assertString(data, 'SetSerializer should be defined');\n    const items = data.length === 0 ? [] : data.split(' ');\n    for (const id of items) {\n      set.add(getObject(id));\n    }\n  },\n});\n\nconst MapSerializer = /*#__PURE__*/ serializer<Map<any, any>>({\n  $prefix$: '\\u001a',\n  $test$: (v) => v instanceof Map,\n  $collect$: (map, collector, leaks) => {\n    map.forEach((value, key) => {\n      collectValue(value, collector, leaks);\n      collectValue(key, collector, leaks);\n    });\n  },\n  $serialize$: (map, getObjID) => {\n    const result: string[] = [];\n    map.forEach((value, key) => {\n      result.push(getObjID(key) + ' ' + getObjID(value));\n    });\n    return result.join(' ');\n  },\n  $prepare$: (data) => {\n    const set = new Map();\n    (set as any)[DATA] = data;\n    return set;\n  },\n  $fill$: (set, getObject) => {\n    const data = (set as any)[DATA];\n    (set as any)[DATA] = undefined;\n    assertString(data, 'SetSerializer should be defined');\n    const items = data.length === 0 ? [] : data.split(' ');\n    assertTrue(items.length % 2 === 0, 'MapSerializer should have even number of items');\n    for (let i = 0; i < items.length; i += 2) {\n      set.set(getObject(items[i]), getObject(items[i + 1]));\n    }\n  },\n});\n\nconst StringSerializer = /*#__PURE__*/ serializer<string>({\n  $prefix$: '\\u001b',\n  $test$: (v) => !!getSerializer(v) || v === UNDEFINED_PREFIX,\n  $serialize$: (v) => v,\n  $prepare$: (data) => data,\n});\n\nconst serializers: Serializer<any>[] = [\n  // NULL                       \\u0000\n  // UNDEFINED_PREFIX           \\u0001\n  QRLSerializer, ////////////// \\u0002\n  TaskSerializer, ///////////// \\u0003\n  ResourceSerializer, ///////// \\u0004\n  URLSerializer, ////////////// \\u0005\n  DateSerializer, ///////////// \\u0006\n  RegexSerializer, //////////// \\u0007\n  // BACKSPACE                  \\u0008\n  // HORIZONTAL TAB             \\u0009\n  // NEW LINE                   \\u000A\n  // VERTICAL TAB               \\u000B\n  // FORM FEED                  \\u000C\n  // CARRIAGE RETURN            \\u000D\n  ErrorSerializer, //////////// \\u000E\n  DocumentSerializer, ///////// \\u000F\n  ComponentSerializer, //////// \\u0010\n  DerivedSignalSerializer, //// \\u0011\n  SignalSerializer, /////////// \\u0012\n  SignalWrapperSerializer, //// \\u0013\n  NoFiniteNumberSerializer, /// \\u0014\n  URLSearchParamsSerializer, // \\u0015\n  FormDataSerializer, ///////// \\u0016\n  JSXNodeSerializer, ////////// \\u0017\n  BigIntSerializer, /////////// \\u0018\n  SetSerializer, ////////////// \\u0019\n  MapSerializer, ////////////// \\u001a\n  StringSerializer, /////////// \\u001b\n  Uint8ArraySerializer, /////// \\u001c\n];\n\nconst serializerByPrefix: (Serializer<unknown> | undefined)[] = /*#__PURE__*/ (() => {\n  const serializerByPrefix: (Serializer<unknown> | undefined)[] = [];\n  serializers.forEach((s) => {\n    const prefix = s.$prefixCode$;\n    while (serializerByPrefix.length < prefix) {\n      serializerByPrefix.push(undefined);\n    }\n    serializerByPrefix.push(s);\n  });\n  return serializerByPrefix;\n})();\n\nexport function getSerializer(obj: any): Serializer<unknown> | undefined {\n  if (typeof obj === 'string') {\n    const prefix = obj.charCodeAt(0);\n    if (prefix < serializerByPrefix.length) {\n      return serializerByPrefix[prefix];\n    }\n  }\n  return undefined;\n}\n\nconst collectorSerializers = /*#__PURE__*/ serializers.filter((a) => a.$collect$);\n\nexport const canSerialize = (obj: any): boolean => {\n  for (const s of serializers) {\n    if (s.$test$(obj)) {\n      return true;\n    }\n  }\n  return false;\n};\n\nexport const collectDeps = (obj: unknown, collector: Collector, leaks: boolean | QwikElement) => {\n  for (const s of collectorSerializers) {\n    if (s.$test$(obj)) {\n      s.$collect$!(obj, collector, leaks);\n      return true;\n    }\n  }\n  return false;\n};\n\nexport const serializeValue = (\n  obj: any,\n  getObjID: MustGetObjID,\n  collector: Collector,\n  containerState: ContainerState\n) => {\n  for (const s of serializers) {\n    if (s.$test$(obj)) {\n      let value = s.$prefixChar$;\n      if (s.$serialize$) {\n        value += s.$serialize$(obj, getObjID, collector, containerState);\n      }\n      return value;\n    }\n  }\n  if (typeof obj === 'string') {\n    return obj;\n  }\n  return undefined;\n};\n\nexport interface Parser {\n  prepare(data: string): any;\n  subs(obj: any, subs: Subscriptions[]): boolean;\n  fill(obj: any, getObject: GetObject): boolean;\n}\n\nexport const createParser = (containerState: ContainerState, doc: Document): Parser => {\n  const fillMap = new Map<any, Serializer<any>>();\n  const subsMap = new Map<any, Serializer<any>>();\n\n  return {\n    prepare(data: string) {\n      const serializer = getSerializer(data);\n      if (serializer) {\n        const value = serializer.$prepare$(data.slice(1), containerState, doc);\n        if (serializer.$fill$) {\n          fillMap.set(value, serializer);\n        }\n        if (serializer.$subs$) {\n          subsMap.set(value, serializer);\n        }\n        return value;\n      }\n      return data;\n    },\n    subs(obj: any, subs: Subscriptions[]) {\n      const serializer = subsMap.get(obj);\n      if (serializer) {\n        serializer.$subs$!(obj, subs, containerState);\n        return true;\n      }\n      return false;\n    },\n    fill(obj: any, getObject: GetObject) {\n      const serializer = fillMap.get(obj);\n      if (serializer) {\n        serializer.$fill$!(obj, getObject, containerState);\n        return true;\n      }\n      return false;\n    },\n  };\n};\n\nexport const OBJECT_TRANSFORMS: Record<string, (obj: any, containerState: ContainerState) => any> =\n  {\n    '!': (obj: any, containerState: ContainerState) => {\n      return containerState.$proxyMap$.get(obj) ?? getOrCreateProxy(obj, containerState);\n    },\n    '~': (obj: any) => {\n      return Promise.resolve(obj);\n    },\n    _: (obj: any) => {\n      return Promise.reject(obj);\n    },\n  };\n\nconst isTreeShakeable = (\n  manager: SubscriptionManager,\n  target: LocalSubscriptionManager,\n  leaks: QwikElement | boolean\n) => {\n  if (typeof leaks === 'boolean') {\n    return leaks;\n  }\n  const localManager = manager.$groupToManagers$.get(leaks);\n  if (localManager && localManager.length > 0) {\n    if (localManager.length === 1) {\n      return localManager[0] !== target;\n    }\n    return true;\n  }\n  return false;\n};\n\nconst getResolveJSXType = (type: any) => {\n  if (type === ':slot') {\n    return Slot;\n  }\n  if (type === ':fragment') {\n    return Fragment;\n  }\n  return type;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/container/serializers.unit.ts",
    "content": "import { describe, test, expect } from 'vitest';\nimport { getSerializer } from './serializers';\nimport crypto from 'node:crypto';\n\ndescribe('Uint8ArraySerializer', () => {\n  const serializer = getSerializer('\\u001c');\n  if (!serializer) {\n    throw new Error('Serializer not found');\n  }\n\n  test('get it', () => {\n    expect(serializer).toBeDefined();\n  });\n\n  test('serialize/deserialize', () => {\n    const _: any = undefined;\n    const array = new Uint8Array(1024);\n    expect(serializer.$test$(array)).toBe(true);\n    for (let i = 0; i < 1000; i++) {\n      crypto.getRandomValues(array);\n      const code = serializer.$serialize$!(array, _, _, _);\n      const decoded = serializer.$prepare$!(code, _, _);\n      expect(decoded).toStrictEqual(array);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/container/store.unit.tsx",
    "content": "import { createDocument } from '../../testing/document';\nimport { useStore } from '../use/use-store.public';\nimport { useLexicalScope } from '../use/use-lexical-scope.public';\nimport { component$ } from '../component/component.public';\nimport { $ } from '../qrl/qrl.public';\nimport { logDebug } from '../util/log';\nimport { inlinedQrl } from '../qrl/qrl';\nimport { render } from '../render/dom/render.public';\nimport { expectDOM } from '../../testing/expect-dom';\nimport { pauseContainer } from './pause';\nimport { noSerialize } from '../state/common';\nimport { useSignal } from '../use/use-signal';\nimport { getQwikJSON } from './resume';\nimport { assert, test } from 'vitest';\n\ntest.skip('should serialize content', async () => {\n  const document = createDocument();\n\n  await render(\n    document.body,\n    <div>\n      <LexicalScope />\n    </div>\n  );\n  await expectDOM(\n    document.body,\n    `\n  <body q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n    <div>\n      <!--qv -->\n      <div>0</div>\n      <!--/qv-->\n    </div>\n  </body>`\n  );\n  await pauseContainer(document.body);\n  const script = getQwikJSON(document.body, 'type')!;\n  script.remove();\n\n  await expectDOM(\n    document.body,\n    `\n    <body q:version=\"dev\" q:container=\"paused\" q:render=\"dom-dev\">\n      <div>\n        <!--qv q:id=0-->\n        <div>\n          0\n        </div>\n        <!--/qv-->\n      </div>\n      <script>\n        (window.qwikevents ||= []).push(\"click\");\n      </script>\n    </body>`\n  );\n\n  assert.deepEqual(JSON.parse(script.textContent!), {\n    refs: {\n      '1': '1 2 f o 8 i 7 6 k! o l 0 n',\n    },\n    ctx: {},\n    objs: [\n      '\\u0012j',\n      1,\n      'hola',\n      12,\n      {\n        thing: '3',\n      },\n      123,\n      false,\n      true,\n      null,\n      'string',\n      {\n        hola: '1',\n      },\n      'hello',\n      ['b'],\n      ['1', '9', '6', 'a', 'c'],\n      '\\u0010/runtimeQRL#_',\n      {\n        a: '4',\n        b: '2',\n        c: '5',\n        d: '6',\n        e: '7',\n        f: '8',\n        g: 'o',\n        h: 'd',\n        i: 'e',\n      },\n      2,\n      {},\n      ['1', 'g', '2', 'h'],\n      0,\n      {\n        count: 'j',\n      },\n      '\\u0002/runtimeQRL#_',\n      'ok',\n      '\\u0012m',\n      '\\u0001',\n    ],\n    subs: [['4 #0 0 #2']],\n  });\n});\n\nexport const LexicalScope_render = () => {\n  const [a, b, c, d, e, f, g, h, state, noserialize] = useLexicalScope();\n  return (\n    <section>\n      <p>{JSON.stringify(a)}</p>\n      <p>{JSON.stringify(b)}</p>\n      <p>{JSON.stringify(c)}</p>\n      <p>{String(d)}</p>\n      <p>{String(e)}</p>\n      <p>{JSON.stringify(f)}</p>\n      <p>{JSON.stringify(g)}</p>\n      <p>{JSON.stringify(h)}</p>\n      <p>{noserialize.text}</p>\n      <button document:onClick$={() => state.count++}>Rerender {state.count}</button>\n    </section>\n  );\n};\n\nexport const LexicalScope = component$(() => {\n  const state = useStore({\n    count: 0,\n  });\n  const signal = useSignal(0);\n  const signalFromFn = useSignal(() => 'ok');\n  const nu = 1;\n  const str = 'hola';\n  const obj = {\n    a: { thing: 12 },\n    b: 'hola',\n    c: 123,\n    d: false,\n    e: true,\n    f: null,\n    g: undefined,\n    h: [1, 'string', false, { hola: 1 }, ['hello']],\n    i: LexicalScope,\n  };\n  const noserialize = noSerialize({ text: 'not included', window: () => {} });\n  const undef = undefined;\n  const nulll = null;\n  const array = [1, 2, 'hola', {}];\n  const boolTrue = true;\n  const boolFalse = false;\n  const qrl = $(() => logDebug('qrl'));\n  const thing = inlinedQrl(LexicalScope_render, 'LexicalScope_render', [\n    nu,\n    str,\n    obj,\n    undef,\n    nulll,\n    array,\n    boolTrue,\n    boolFalse,\n    state,\n    noserialize,\n    qrl,\n    signal,\n    signalFromFn,\n  ]);\n  return <div onClick$={thing}>{signal as any}</div>;\n});\n"
  },
  {
    "path": "packages/qwik/src/core/document.ts",
    "content": "/** Contains additional items which Qwik patches on the Document. */\nexport interface QwikDocument extends Document {\n  __q_context__?: [HTMLElement, Event, URL] | {};\n}\n\nexport const _is_module = true;\n"
  },
  {
    "path": "packages/qwik/src/core/error/assert.ts",
    "content": "import type { QwikElement, VirtualElement } from '../render/dom/virtual-element';\nimport { isElement, isQwikElement } from '../util/element';\nimport { throwErrorAndStop } from '../util/log';\nimport { qDev } from '../util/qdev';\n\nconst ASSERT_DISCLAIMER = 'Internal assert, this is likely caused by a bug in Qwik: ';\n\nexport function assertDefined<T>(\n  value: T,\n  text: string,\n  ...parts: any[]\n): asserts value is NonNullable<T> {\n  if (qDev) {\n    if (value != null) {\n      return;\n    }\n    throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n  }\n}\n\nexport function assertEqual(\n  value1: any,\n  value2: any,\n  text: string,\n  ...parts: any[]\n): asserts value1 is typeof value2 {\n  if (qDev) {\n    if (value1 === value2) {\n      return;\n    }\n    throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n  }\n}\n\nexport function assertFail(text: string, ...parts: any[]): never;\nexport function assertFail(text: string, ...parts: any[]) {\n  if (qDev) {\n    throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n  }\n}\n\nexport function assertTrue(value1: any, text: string, ...parts: any[]): asserts value1 is true {\n  if (qDev) {\n    if (value1 === true) {\n      return;\n    }\n    throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n  }\n}\n\nexport function assertNumber(value1: any, text: string, ...parts: any[]): asserts value1 is number {\n  if (qDev) {\n    if (typeof value1 === 'number') {\n      return;\n    }\n    throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n  }\n}\n\nexport function assertString(value1: any, text: string, ...parts: any[]): asserts value1 is string {\n  if (qDev) {\n    if (typeof value1 === 'string') {\n      return;\n    }\n    throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n  }\n}\n\nexport function assertQwikElement(el: any): asserts el is QwikElement {\n  if (qDev) {\n    if (!isQwikElement(el)) {\n      console.error('Not a Qwik Element, got', el);\n      throwErrorAndStop(ASSERT_DISCLAIMER + 'Not a Qwik Element');\n    }\n  }\n}\n\nexport function assertElement(el: Node | VirtualElement): asserts el is Element {\n  if (qDev) {\n    if (!isElement(el)) {\n      console.error('Not a Element, got', el);\n      throwErrorAndStop(ASSERT_DISCLAIMER + 'Not an Element');\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/core/error/error.ts",
    "content": "import { logErrorAndStop } from '../util/log';\nimport { qDev } from '../util/qdev';\n\nexport const codeToText = (code: number, ...parts: any[]): string => {\n  if (qDev) {\n    // Keep one error, one line to make it easier to search for the error message.\n    const MAP = [\n      'Error while serializing class or style attributes', // 0\n      'Can not serialize a HTML Node that is not an Element', // 1\n      'Runtime but no instance found on element.', // 2\n      'Only primitive and object literals can be serialized', // 3\n      'Crash while rendering', // 4\n      'You can render over a existing q:container. Skipping render().', // 5\n      'Set property {{0}}', // 6\n      \"Only function's and 'string's are supported.\", // 7\n      \"Only objects can be wrapped in 'QObject'\", // 8\n      `Only objects literals can be wrapped in 'QObject'`, // 9\n      'QRL is not a function', // 10\n      'Dynamic import not found', // 11\n      'Unknown type argument', // 12\n      `Actual value for useContext({{0}}) can not be found, make sure some ancestor component has set a value using useContextProvider(). In the browser make sure that the context was used during SSR so its state was serialized.`, // 13\n      \"Invoking 'use*()' method outside of invocation context.\", // 14\n      'Cant access renderCtx for existing context', // 15\n      'Cant access document for existing context', // 16\n      'props are immutable', // 17\n      '<div> component can only be used at the root of a Qwik component$()', // 18\n      'Props are immutable by default.', // 19\n      `Calling a 'use*()' method outside 'component$(() => { HERE })' is not allowed. 'use*()' methods provide hooks to the 'component$' state and lifecycle, ie 'use' hooks can only be called synchronously within the 'component$' function or another 'use' method.\\nSee https://qwik.dev/docs/core/tasks/#use-method-rules`, // 20\n      'Container is already paused. Skipping', // 21\n      '', // 22 -- unused\n      'When rendering directly on top of Document, the root node must be a <html>', // 23\n      'A <html> node must have 2 children. The first one <head> and the second one a <body>', // 24\n      'Invalid JSXNode type \"{{0}}\". It must be either a function or a string. Found:', // 25\n      'Tracking value changes can only be done to useStore() objects and component props', // 26\n      'Missing Object ID for captured object', // 27\n      'The provided Context reference \"{{0}}\" is not a valid context created by createContextId()', // 28\n      '<html> is the root container, it can not be rendered inside a component', // 29\n      'QRLs can not be resolved because it does not have an attached container. This means that the QRL does not know where it belongs inside the DOM, so it cant dynamically import() from a relative path.', // 30\n      'QRLs can not be dynamically resolved, because it does not have a chunk path', // 31\n      'The JSX ref attribute must be a Signal', // 32\n    ];\n    let text = MAP[code] ?? '';\n    if (parts.length) {\n      text = text.replaceAll(/{{(\\d+)}}/g, (_, index) => {\n        let v = parts[index];\n        if (v && typeof v === 'object' && v.constructor === Object) {\n          v = JSON.stringify(v).slice(0, 50);\n        }\n        return v;\n      });\n    }\n    return `Code(${code}): ${text}`;\n  } else {\n    // cute little hack to give roughly the correct line number. Update the line number if it shifts.\n    return `Code(${code}) https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/core/error/error.ts#L${8 + code}`;\n  }\n};\n\nexport const QError_stringifyClassOrStyle = 0;\nexport const QError_cannotSerializeNode = 1;\nexport const QError_runtimeQrlNoElement = 2;\nexport const QError_verifySerializable = 3;\nexport const QError_errorWhileRendering = 4;\nexport const QError_cannotRenderOverExistingContainer = 5;\nexport const QError_setProperty = 6;\nexport const QError_qrlOrError = 7;\nexport const QError_onlyObjectWrapped = 8;\nexport const QError_onlyLiteralWrapped = 9;\nexport const QError_qrlIsNotFunction = 10;\nexport const QError_dynamicImportFailed = 11;\nexport const QError_unknownTypeArgument = 12;\nexport const QError_notFoundContext = 13;\nexport const QError_useMethodOutsideContext = 14;\nexport const QError_missingRenderCtx = 15;\nexport const QError_missingDoc = 16;\nexport const QError_immutableProps = 17;\nexport const QError_hostCanOnlyBeAtRoot = 18;\nexport const QError_immutableJsxProps = 19;\nexport const QError_useInvokeContext = 20;\nexport const QError_containerAlreadyPaused = 21;\nexport const QError_unused_please_reuse = 22;\nexport const QError_rootNodeMustBeHTML = 23;\nexport const QError_strictHTMLChildren = 24;\nexport const QError_invalidJsxNodeType = 25;\nexport const QError_trackUseStore = 26;\nexport const QError_missingObjectId = 27;\nexport const QError_invalidContext = 28;\nexport const QError_canNotRenderHTML = 29;\nexport const QError_qrlMissingContainer = 30;\nexport const QError_qrlMissingChunk = 31;\nexport const QError_invalidRefValue = 32;\nexport const qError = (code: number, ...parts: any[]): Error => {\n  const text = codeToText(code, ...parts);\n  return logErrorAndStop(text, ...parts);\n};\n"
  },
  {
    "path": "packages/qwik/src/core/examples.tsx",
    "content": "/* eslint-disable no-console */\n//\n// This file stores example snippets which are found in the docs.\n//\n// Edit the snippet here and verify that it compiles, than paste\n// it to the desired comment location\n//\n\nimport { component$ } from './component/component.public';\nimport { qrl } from './qrl/qrl';\nimport { $, type QRL } from './qrl/qrl.public';\nimport { useOn, useOnDocument, useOnWindow } from './use/use-on';\nimport { useStore } from './use/use-store.public';\nimport { useStyles$, useStylesScoped$ } from './use/use-styles';\nimport { useVisibleTask$, useTask$ } from './use/use-task';\nimport { implicit$FirstArg } from './util/implicit_dollar';\nimport { isServer, isBrowser } from '../build';\n\n//////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////\n// DOCS: component\n//////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////\n\n//\n// <docs anchor=\"component\">\nexport interface CounterProps {\n  initialValue?: number;\n  step?: number;\n}\nexport const Counter = component$((props: CounterProps) => {\n  const state = useStore({ count: props.initialValue || 0 });\n  return (\n    <div>\n      <span>{state.count}</span>\n      <button onClick$={() => (state.count += props.step || 1)}>+</button>\n    </div>\n  );\n});\n// </docs>\n//\n\n//\n// <docs anchor=\"component-usage\">\nexport const OtherComponent = component$(() => {\n  return <Counter initialValue={100} />;\n});\n// </docs>\n//\n\n// <docs anchor=\"use-styles\">\nimport styles from './code-block.css?inline';\n\nexport const CmpStyles = component$(() => {\n  useStyles$(styles);\n\n  return <div>Some text</div>;\n});\n// </docs>\n\n// <docs anchor=\"use-styles-scoped\">\nimport scoped from './code-block.css?inline';\n\nexport const CmpScopedStyles = component$(() => {\n  useStylesScoped$(scoped);\n\n  return <div>Some text</div>;\n});\n// </docs>\n\n// <docs anchor=\"use-styles-inline\">\nexport const CmpInline = component$(() => {\n  useStyles$(`.my-button {\n    font-size: 20px;\n  }`);\n\n  return <button class=\"my-button\">Profit!</button>;\n});\n// </docs>\n\n() => {\n  // <docs anchor=\"use-on\">\n  function useClick() {\n    useOn(\n      'click',\n      $((event) => {\n        console.log('clicked host element', event);\n      })\n    );\n  }\n\n  const Cmp = component$(() => {\n    useClick();\n    return <div>Profit!</div>;\n  });\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-on-document\">\n  function useScroll() {\n    useOnDocument(\n      'scroll',\n      $((event) => {\n        console.log('body scrolled', event);\n      })\n    );\n  }\n\n  const Cmp = component$(() => {\n    useScroll();\n    return <div>Profit!</div>;\n  });\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-on-window\">\n  function useAnalytics() {\n    useOnWindow(\n      'popstate',\n      $((event) => {\n        console.log('navigation happened', event);\n        // report to analytics\n      })\n    );\n  }\n\n  const Cmp = component$(() => {\n    useAnalytics();\n    return <div>Profit!</div>;\n  });\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-task\">\n  const Cmp = component$(() => {\n    const store = useStore({\n      count: 0,\n      doubleCount: 0,\n      debounced: 0,\n    });\n\n    // Double count task\n    useTask$(({ track }) => {\n      const count = track(() => store.count);\n      store.doubleCount = 2 * count;\n    });\n\n    // Debouncer task\n    useTask$(({ track }) => {\n      const doubleCount = track(() => store.doubleCount);\n      const timer = setTimeout(() => {\n        store.debounced = doubleCount;\n      }, 2000);\n      return () => {\n        clearTimeout(timer);\n      };\n    });\n    return (\n      <div>\n        <div>\n          {store.count} / {store.doubleCount}\n        </div>\n        <div>{store.debounced}</div>\n      </div>\n    );\n  });\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-resource\">\n  const Cmp = component$(() => {\n    const cityS = useSignal('');\n\n    const weatherResource = useResource$(async ({ track, cleanup }) => {\n      const cityName = track(cityS);\n      const abortController = new AbortController();\n      cleanup(() => abortController.abort('cleanup'));\n      const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\n        signal: abortController.signal,\n      });\n      const data = await res.json();\n      return data as { temp: number };\n    });\n\n    return (\n      <div>\n        <input name=\"city\" bind:value={cityS} />\n        <Resource\n          value={weatherResource}\n          onResolved={(weather) => {\n            return <div>Temperature: {weather.temp}</div>;\n          }}\n        />\n      </div>\n    );\n  });\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-task-simple\">\n  const Cmp = component$(() => {\n    const store = useStore({ count: 0, doubleCount: 0 });\n    const signal = useSignal(0);\n    useTask$(({ track }) => {\n      // Any signals or stores accessed inside the task will be tracked\n      const count = track(() => store.count);\n      // You can also pass a signal to track() directly\n      const signalCount = track(signal);\n      store.doubleCount = count + signalCount;\n    });\n    return (\n      <div>\n        <span>\n          {store.count} / {store.doubleCount}\n        </span>\n        <button\n          onClick$={() => {\n            store.count++;\n            signal.value++;\n          }}\n        >\n          +\n        </button>\n      </div>\n    );\n  });\n  // </docs>\n\n  return Cmp;\n};\n\n() => {\n  let db: any;\n  // <docs anchor=\"use-server-mount\">\n  const Cmp = component$(() => {\n    const store = useStore({\n      users: [],\n    });\n\n    useTask$(async () => {\n      if (isServer) {\n        // This code will ONLY run once in the server, when the component is mounted\n        store.users = await db.requestUsers();\n      }\n    });\n\n    return (\n      <div>\n        {store.users.map((user) => (\n          <User user={user} />\n        ))}\n      </div>\n    );\n  });\n\n  interface User {\n    name: string;\n  }\n  function User(props: { user: User }) {\n    return <div>Name: {props.user.name}</div>;\n  }\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-client-mount\">\n  const Cmp = component$(() => {\n    useTask$(async () => {\n      if (isBrowser) {\n        // This code will ONLY run once in the client, when the component is mounted\n      }\n    });\n\n    return <div>Cmp</div>;\n  });\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-mount\">\n  const Cmp = component$(() => {\n    const store = useStore({\n      temp: 0,\n    });\n\n    useTask$(async () => {\n      // This code will run once whenever a component is mounted in the server, or in the client\n      const res = await fetch('weather-api.example');\n      const json = (await res.json()) as any;\n      store.temp = json.temp;\n    });\n\n    return (\n      <div>\n        <p>The temperature is: ${store.temp}</p>\n      </div>\n    );\n  });\n  // </docs>\n  return Cmp;\n};\n\n() => {\n  // <docs anchor=\"use-client-effect\">\n  const Timer = component$(() => {\n    const store = useStore({\n      count: 0,\n    });\n\n    useVisibleTask$(() => {\n      // Only runs in the client\n      const timer = setInterval(() => {\n        store.count++;\n      }, 500);\n      return () => {\n        clearInterval(timer);\n      };\n    });\n\n    return <div>{store.count}</div>;\n  });\n  // </docs>\n  return Timer;\n};\n\n() => {\n  // <docs anchor=\"use-store\">\n  const Stores = component$(() => {\n    const counter = useCounter(1);\n\n    // Reactivity happens even for nested objects and arrays\n    const userData = useStore({\n      name: 'Manu',\n      address: {\n        address: '',\n        city: '',\n      },\n      orgs: [],\n    });\n\n    // useStore() can also accept a function to calculate the initial value\n    const state = useStore(() => {\n      return {\n        value: expensiveInitialValue(),\n      };\n    });\n\n    return (\n      <div>\n        <div>Counter: {counter.value}</div>\n        <Child userData={userData} state={state} />\n      </div>\n    );\n  });\n\n  function useCounter(step: number) {\n    // Multiple stores can be created in custom hooks for convenience and composability\n    const counterStore = useStore({\n      value: 0,\n    });\n    useVisibleTask$(() => {\n      // Only runs in the client\n      const timer = setInterval(() => {\n        counterStore.value += step;\n      }, 500);\n      return () => {\n        clearInterval(timer);\n      };\n    });\n    return counterStore;\n  }\n  // </docs>\n\n  function expensiveInitialValue() {\n    return 42;\n  }\n\n  function Child(_props: any) {\n    return <div />;\n  }\n  return Stores;\n};\n\n//\n// <docs anchor=\"context\">\n// Declare the Context type.\ninterface TodosStore {\n  items: string[];\n}\n// Create a Context ID (no data is saved here.)\n// You will use this ID to both create and retrieve the Context.\nexport const TodosContext = createContextId<TodosStore>('Todos');\n\n// Example of providing context to child components.\nexport const App = component$(() => {\n  useContextProvider(\n    TodosContext,\n    useStore<TodosStore>({\n      items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n    })\n  );\n\n  return <Items />;\n});\n\n// Example of retrieving the context provided by a parent component.\nexport const Items = component$(() => {\n  const todos = useContext(TodosContext);\n  return (\n    <ul>\n      {todos.items.map((item) => (\n        <li>{item}</li>\n      ))}\n    </ul>\n  );\n});\n\n// </docs>\n//\n\n// <docs anchor=\"qrl-usage-$\">\nuseOnDocument(\n  'mousemove',\n  $((event) => console.log('mousemove', event))\n);\n// </docs>\n\n// <docs anchor=\"qrl-usage-$-optimized\">\n// FILE: <current file>\nuseOnDocument('mousemove', qrl('./chunk-abc.js', 'onMousemove'));\n\n// FILE: chunk-abc.js\nexport const onMousemove = () => console.log('mousemove');\n// </docs>\n\n// <docs anchor=\"qrl-usage-type\">\n// Example of declaring a custom functions which takes callback as QRL.\nexport function useMyFunction(callback: QRL<() => void>) {\n  doExtraStuff();\n  // The callback passed to `onDocument` requires `QRL`.\n  useOnDocument('mousemove', callback);\n}\n// </docs>\n\nfunction doExtraStuff() {\n  throw new Error('Function not implemented.');\n}\n\n(async function () {\n  // <docs anchor=\"qrl-usage-import\">\n  // Assume you have QRL reference to a greet function\n  const lazyGreet: QRL<() => void> = $(() => console.log('Hello World!'));\n\n  // Use `qrlImport` to load / resolve the reference.\n  const greet: () => void = await lazyGreet.resolve();\n\n  //  Invoke it\n  greet();\n  // </docs>\n})();\n\n// <docs anchor=\"qrl-capturing-rules\">\n\nimport { createContextId, useContext, useContextProvider } from './use/use-context';\nimport { Resource, useResource$ } from './use/use-resource';\nimport { useSignal } from './use/use-signal';\n\nexport const greet = () => console.log('greet');\nfunction topLevelFn() {}\n\nfunction myCode() {\n  const store = useStore({});\n  function localFn() {}\n  // Valid Examples\n  $(greet); // greet is importable\n  $(() => greet()); // greet is importable;\n  $(() => console.log(store)); // store is serializable.\n\n  // Compile time errors\n  $(topLevelFn); // ERROR: `topLevelFn` not importable\n  $(() => topLevelFn()); // ERROR: `topLevelFn` not importable\n\n  // Runtime errors\n  $(localFn); // ERROR: `localFn` fails serialization\n  $(() => localFn()); // ERROR: `localFn` fails serialization\n}\n\n// </docs>\n\nconsole.log(myCode);\n\n// <docs anchor=\"implicit$FirstArg\">\nexport function myApi(callback: QRL<() => void>): void {\n  // ...\n}\n\nexport const myApi$ = implicit$FirstArg(myApi);\n// type of myApi$: (callback: () => void): void\n\n// can be used as:\nmyApi$(() => console.log('callback'));\n\n// will be transpiled to:\n// FILE: <current file>\nmyApi(qrl('./chunk-abc.js', 'callback'));\n\n// FILE: chunk-abc.js\nexport const callback = () => console.log('callback');\n// </docs>\n"
  },
  {
    "path": "packages/qwik/src/core/index.ts",
    "content": "//////////////////////////////////////////////////////////////////////////////////////////\n// Developer Core API\n//////////////////////////////////////////////////////////////////////////////////////////\nexport { componentQrl, component$ } from './component/component.public';\n\nexport type {\n  PropsOf,\n  OnRenderFn,\n  Component,\n  PublicProps,\n  PropFunctionProps,\n  _AllowPlainQrl,\n  _Only$,\n} from './component/component.public';\n\nexport { isBrowser, isDev, isServer } from '@builder.io/qwik/build';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Developer Event API\n//////////////////////////////////////////////////////////////////////////////////////////\nexport type {\n  SnapshotState,\n  SnapshotResult,\n  SnapshotMeta,\n  SnapshotMetaValue,\n  SnapshotListener,\n} from './container/container';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Internal Runtime\n//////////////////////////////////////////////////////////////////////////////////////////\nexport { $, sync$, _qrlSync, type SyncQRL } from './qrl/qrl.public';\nexport { event$, eventQrl } from './qrl/qrl.public';\n\nexport { qrl, inlinedQrl, inlinedQrlDEV, qrlDEV } from './qrl/qrl';\nexport type { QRL, PropFunction, PropFnInterface } from './qrl/qrl.public';\nexport { implicit$FirstArg } from './util/implicit_dollar';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// PLATFORM\n//////////////////////////////////////////////////////////////////////////////////////////\nexport { getPlatform, setPlatform } from './platform/platform';\nexport type { CorePlatform } from './platform/types';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// JSX Runtime\n//////////////////////////////////////////////////////////////////////////////////////////\nexport { h, h as createElement } from './render/jsx/factory';\nexport {\n  SSRStreamBlock,\n  SSRRaw,\n  SSRStream,\n  SSRComment,\n  SSRHint,\n  SkipRender,\n} from './render/jsx/utils.public';\nexport type { SSRStreamProps, SSRHintProps } from './render/jsx/utils.public';\nexport { Slot } from './render/jsx/slot.public';\nexport { Fragment, HTMLFragment, RenderOnce, jsx, jsxDEV, jsxs } from './render/jsx/jsx-runtime';\nexport type * from './render/jsx/types/jsx-generated';\nexport type {\n  DOMAttributes,\n  QwikAttributes,\n  JSXTagName,\n  JSXChildren,\n  ComponentBaseProps,\n  ClassList,\n  CorrectedToggleEvent,\n  EventHandler,\n  QRLEventHandlerMulti,\n} from './render/jsx/types/jsx-qwik-attributes';\nexport type { JSXOutput, FunctionComponent, JSXNode, DevJSX } from './render/jsx/types/jsx-node';\nexport type { QwikDOMAttributes, QwikJSX, QwikJSX as JSX } from './render/jsx/types/jsx-qwik';\n\nexport type { QwikIntrinsicElements } from './render/jsx/types/jsx-qwik-elements';\nexport type { QwikHTMLElements, QwikSVGElements } from './render/jsx/types/jsx-generated';\nexport { render } from './render/dom/render.public';\nexport type { RenderSSROptions, StreamWriter } from './render/ssr/render-ssr';\nexport type { RenderOptions, RenderResult } from './render/dom/render.public';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// use API\n//////////////////////////////////////////////////////////////////////////////////////////\nexport { useLexicalScope } from './use/use-lexical-scope.public';\nexport { useStore } from './use/use-store.public';\nexport { untrack } from './use/use-core';\nexport { useId } from './use/use-id';\nexport { useContext, useContextProvider, createContextId } from './use/use-context';\nexport { useServerData } from './use/use-env-data';\nexport { useStylesQrl, useStyles$, useStylesScopedQrl, useStylesScoped$ } from './use/use-styles';\nexport { useOn, useOnDocument, useOnWindow } from './use/use-on';\nexport { useSignal, useConstant, createSignal } from './use/use-signal';\nexport { withLocale, getLocale } from './use/use-locale';\n\nexport type { UseStylesScoped } from './use/use-styles';\nexport type { UseSignal } from './use/use-signal';\nexport type { ContextId } from './use/use-context';\nexport type { UseStoreOptions } from './use/use-store.public';\nexport type {\n  ComputedFn,\n  EagernessOptions,\n  OnVisibleTaskOptions,\n  ResourceCtx,\n  ResourceFn,\n  ResourcePending,\n  ResourceRejected,\n  ResourceResolved,\n  ResourceReturn,\n  TaskCtx,\n  TaskFn,\n  Tracker,\n  UseTaskOptions,\n  VisibleTaskStrategy,\n} from './use/use-task';\nexport type { ResourceProps, ResourceOptions } from './use/use-resource';\nexport { useResource$, useResourceQrl, Resource } from './use/use-resource';\nexport { useTask$, useTaskQrl } from './use/use-task';\nexport { useVisibleTask$, useVisibleTaskQrl } from './use/use-task';\nexport { useComputed$, useComputedQrl, createComputed$, createComputedQrl } from './use/use-task';\nexport { useErrorBoundary } from './use/use-error-boundary';\nexport type { ErrorBoundaryStore } from './render/error-handling';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Developer Low-Level API\n//////////////////////////////////////////////////////////////////////////////////////////\nexport type { ValueOrPromise } from './util/types';\nexport type { Signal, ReadonlySignal } from './state/signal';\nexport type { NoSerialize } from './state/common';\nexport { noSerialize, unwrapProxy as unwrapStore } from './state/common';\nexport { isSignal } from './state/signal';\nexport { version } from './version';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Qwik Events\n//////////////////////////////////////////////////////////////////////////////////////////\nexport type {\n  KnownEventNames,\n  QwikSymbolEvent,\n  QwikVisibleEvent,\n  QwikIdleEvent,\n  QwikInitEvent,\n  QwikTransitionEvent,\n  // old\n  NativeAnimationEvent,\n  NativeClipboardEvent,\n  NativeCompositionEvent,\n  NativeDragEvent,\n  NativeFocusEvent,\n  NativeKeyboardEvent,\n  NativeMouseEvent,\n  NativePointerEvent,\n  NativeTouchEvent,\n  NativeTransitionEvent,\n  NativeUIEvent,\n  NativeWheelEvent,\n  QwikAnimationEvent,\n  QwikClipboardEvent,\n  QwikCompositionEvent,\n  QwikDragEvent,\n  QwikPointerEvent,\n  QwikFocusEvent,\n  QwikSubmitEvent,\n  QwikInvalidEvent,\n  QwikChangeEvent,\n  QwikKeyboardEvent,\n  QwikMouseEvent,\n  QwikTouchEvent,\n  QwikUIEvent,\n  QwikWheelEvent,\n} from './render/jsx/types/jsx-qwik-events';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Components\n//////////////////////////////////////////////////////////////////////////////////////////\nexport { PrefetchServiceWorker, PrefetchGraph } from './components/prefetch';\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// INTERNAL\n//////////////////////////////////////////////////////////////////////////////////////////\nexport * from './internal';\n"
  },
  {
    "path": "packages/qwik/src/core/internal.ts",
    "content": "export { _pauseFromContexts, _serializeData } from './container/pause';\nexport { _noopQrl, _noopQrlDEV, _regSymbol } from './qrl/qrl';\nexport { _renderSSR } from './render/ssr/render-ssr';\nexport { _hW } from './render/dom/notify-render';\nexport { _wrapSignal, _wrapProp } from './state/signal';\nexport { _restProps } from './state/store';\nexport { _IMMUTABLE } from './state/constants';\nexport { _weakSerialize } from './state/common';\nexport { _deserializeData } from './container/resume';\nexport { verifySerializable as _verifySerializable } from './state/common';\nexport {\n  _getContextElement,\n  _getContextEvent,\n  _jsxBranch,\n  _waitUntilRendered,\n} from './use/use-core';\nexport { _jsxQ, _jsxC, _jsxS } from './render/jsx/jsx-runtime';\nexport { _fnSignal } from './qrl/inlined-fn';\n"
  },
  {
    "path": "packages/qwik/src/core/platform/platform.ts",
    "content": "// keep this import from qwik/build so the cjs build works\nimport { isServer } from '@builder.io/qwik/build';\nimport {\n  qError,\n  QError_dynamicImportFailed,\n  QError_qrlMissingChunk,\n  QError_qrlMissingContainer,\n} from '../error/error';\nimport { getSymbolHash } from '../qrl/qrl-class';\nimport type { QwikElement } from '../render/dom/virtual-element';\nimport { qDynamicPlatform } from '../util/qdev';\nimport type { CorePlatform } from './types';\n\nexport const createPlatform = (): CorePlatform => {\n  return {\n    isServer,\n    importSymbol(containerEl, url, symbolName) {\n      if (isServer) {\n        const hash = getSymbolHash(symbolName);\n        const regSym = (globalThis as any).__qwik_reg_symbols?.get(hash);\n        if (regSym) {\n          return regSym;\n        }\n        // we never lazy import on the server\n        throw qError(QError_dynamicImportFailed, symbolName);\n      }\n      if (!url) {\n        throw qError(QError_qrlMissingChunk, symbolName);\n      }\n      if (!containerEl) {\n        throw qError(QError_qrlMissingContainer, url, symbolName);\n      }\n      const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url).toString();\n      const urlCopy = new URL(urlDoc);\n      urlCopy.hash = '';\n      const importURL = urlCopy.href;\n      return import(/* @vite-ignore */ importURL).then((mod) => {\n        return mod[symbolName];\n      });\n    },\n    raf: (fn) => {\n      return new Promise((resolve) => {\n        requestAnimationFrame(() => {\n          resolve(fn());\n        });\n      });\n    },\n    nextTick: (fn) => {\n      return new Promise((resolve) => {\n        setTimeout(() => {\n          resolve(fn());\n        });\n      });\n    },\n    chunkForSymbol(symbolName, chunk) {\n      return [symbolName, chunk ?? '_'];\n    },\n  };\n};\n\n/**\n * Convert relative base URI and relative URL into a fully qualified URL.\n *\n * @param base -`QRL`s are relative, and therefore they need a base for resolution.\n *\n *   - `Element` use `base.ownerDocument.baseURI`\n *   - `Document` use `base.baseURI`\n *   - `string` use `base` as is\n *   - `QConfig` use `base.baseURI`\n *\n * @param url - Relative URL\n * @returns Fully qualified URL.\n */\nexport const toUrl = (doc: Document, containerEl: QwikElement, url: string | URL): URL => {\n  const baseURI = doc.baseURI;\n  const base = new URL(containerEl.getAttribute('q:base') ?? baseURI, baseURI);\n  return new URL(url, base);\n};\n\nlet _platform = /*#__PURE__ */ createPlatform();\n\n// <docs markdown=\"./readme.md#setPlatform\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ./readme.md#setPlatform instead)\n/**\n * Sets the `CorePlatform`.\n *\n * This is useful to override the platform in tests to change the behavior of,\n * `requestAnimationFrame`, and import resolution.\n *\n * @param doc - The document of the application for which the platform is needed.\n * @param platform - The platform to use.\n * @public\n */\n// </docs>\nexport const setPlatform = (plt: CorePlatform) => (_platform = plt);\n\n// <docs markdown=\"./readme.md#getPlatform\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ./readme.md#getPlatform instead)\n/**\n * Retrieve the `CorePlatform`.\n *\n * The `CorePlatform` is also responsible for retrieving the Manifest, that contains mappings from\n * symbols to javascript import chunks. For this reason, `CorePlatform` can't be global, but is\n * specific to the application currently running. On server it is possible that many different\n * applications are running in a single server instance, and for this reason the `CorePlatform` is\n * associated with the application document.\n *\n * @param docOrNode - The document (or node) of the application for which the platform is needed.\n * @public\n */\n// </docs>\nexport const getPlatform = (): CorePlatform => {\n  return _platform;\n};\n\nexport const isServerPlatform = () => {\n  if (qDynamicPlatform) {\n    return _platform.isServer;\n  }\n  return false;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/platform/platform.unit.ts",
    "content": "import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest';\nimport { createPlatform, setPlatform } from './platform';\nimport { getSymbolHash } from '../qrl/qrl-class';\n\ndescribe('core platform', () => {\n  beforeEach(() => {\n    // Initialize a fresh Map for each test to avoid pollution\n    (globalThis as any).__qwik_reg_symbols = new Map<string, any>();\n  });\n\n  afterEach(() => {\n    // Clean up global state\n    delete (globalThis as any).__qwik_reg_symbols;\n  });\n\n  describe('importSymbol - server mode', () => {\n    test('returns registered symbol without importing', async () => {\n      const platform = createPlatform();\n\n      // Register a mock symbol\n      const symbolName = 'myComponent_abc123';\n      const hash = getSymbolHash(symbolName);\n      const mockFunction = () => 'mock component';\n      (globalThis as any).__qwik_reg_symbols.set(hash, mockFunction);\n\n      // importSymbol should return the registered symbol synchronously\n      const result = await platform.importSymbol(null as any, '', symbolName);\n\n      expect(result).toBe(mockFunction);\n    });\n\n    test('throws error for unregistered symbol without importing', async () => {\n      const platform = createPlatform();\n\n      const symbolName = 'unregisteredSymbol_xyz789';\n\n      // importSymbol should throw qError without attempting any dynamic import\n      expect(() => platform.importSymbol(null as any, '', symbolName)).toThrow();\n\n      let didThrow = false;\n      // Verify it throws with the correct error structure\n      try {\n        platform.importSymbol(null as any, '', symbolName);\n        expect.unreachable('Should have thrown an error');\n      } catch (e: any) {\n        didThrow = true;\n        // The error should be a QError with code for dynamic import failed\n        expect(e.message).toMatch(/Code\\(\\d+\\)/);\n        expect(e.message).toContain('Dynamic import not found');\n      }\n      expect(didThrow).toBe(true);\n    });\n\n    test('does not call dynamic import on server', async () => {\n      const platform = createPlatform();\n\n      const symbolName = 'testSymbol_test123';\n\n      // Verify that the function throws synchronously without any async import\n      const startTime = Date.now();\n      try {\n        platform.importSymbol(null as any, '', symbolName);\n      } catch (e) {\n        // Expected to throw\n      }\n      const endTime = Date.now();\n\n      // Should complete nearly instantly (no network/file I/O)\n      // If it took more than 100ms, something is probably doing async work\n      expect(endTime - startTime).toBeLessThan(100);\n    });\n\n    test('works with symbols containing multiple underscores in server mode', async () => {\n      const platform = createPlatform();\n\n      const symbolName = 'my_component_with_underscores_abc123';\n      const hash = getSymbolHash(symbolName);\n      const mockFunction = () => 'mock';\n      (globalThis as any).__qwik_reg_symbols.set(hash, mockFunction);\n\n      const result = await platform.importSymbol(null as any, '', symbolName);\n\n      expect(result).toBe(mockFunction);\n    });\n  });\n\n  describe('setPlatform and getPlatform', () => {\n    test('setPlatform updates the platform', () => {\n      const customPlatform = createPlatform();\n      const customImportSymbol = vi.fn();\n      customPlatform.importSymbol = customImportSymbol;\n\n      setPlatform(customPlatform);\n\n      // The platform should now use the custom implementation\n      expect(customPlatform.importSymbol).toBe(customImportSymbol);\n    });\n  });\n\n  describe('platform utilities', () => {\n    test('nextTick returns a promise and executes callback', async () => {\n      const platform = createPlatform();\n      const mockFn = vi.fn(() => 'result');\n\n      const promise = platform.nextTick(mockFn);\n\n      expect(promise).toBeInstanceOf(Promise);\n      const result = await promise;\n      expect(mockFn).toHaveBeenCalled();\n      expect(result).toBe('result');\n    });\n\n    test('chunkForSymbol returns symbol and chunk', () => {\n      const platform = createPlatform();\n\n      const result1 = platform.chunkForSymbol('mySymbol', 'chunk.js');\n      expect(result1).toEqual(['mySymbol', 'chunk.js']);\n\n      const result2 = platform.chunkForSymbol('mySymbol', null);\n      expect(result2).toEqual(['mySymbol', '_']);\n    });\n  });\n\n  describe('getSymbolHash', () => {\n    test('extracts hash after last underscore', () => {\n      expect(getSymbolHash('mySymbol_abc123')).toBe('abc123');\n      expect(getSymbolHash('component_with_multiple_underscores_xyz789')).toBe('xyz789');\n    });\n\n    test('returns full name if no underscore present', () => {\n      expect(getSymbolHash('noUnderscore')).toBe('noUnderscore');\n      expect(getSymbolHash('simpleSymbol')).toBe('simpleSymbol');\n    });\n\n    test('handles edge cases', () => {\n      expect(getSymbolHash('_leadingUnderscore')).toBe('leadingUnderscore');\n      expect(getSymbolHash('trailingUnderscore_')).toBe('');\n      expect(getSymbolHash('_')).toBe('');\n    });\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/platform/readme.md",
    "content": "# `CorePlatform`\n\nLow-level API for platform abstraction.\n\nDifferent platforms (browser, node, service workers) may have different ways of handling things such as `requestAnimationFrame` and imports. To make Qwik platform-independent Qwik uses the `CorePlatform` API to access the platform API.\n\n`CorePlatform` also is responsible for importing symbols. The import map is different on the client (browser) then on the server. For this reason, the server has a manifest that is used to map symbols to javascript chunks. The manifest is encapsulated in `CorePlatform`, for this reason, the `CorePlatform` can't be global as there may be multiple applications running at server concurrently.\n\nThis is a low-level API and there should not be a need for you to access this.\n\n@public\n\n# `CorePlatform.isServer`\n\nTrue of running on the server platform.\n\n@returns True if we are running on the server (not the browser.)\n\n# `CorePlatform.importSymbol`\n\nRetrieve a symbol value from QRL.\n\nQwik needs to lazy load data and closures. For this Qwik uses QRLs that are serializable references of resources that are needed. The QRLs contain all the information necessary to retrieve the reference using `importSymbol`.\n\nWhy not use `import()`? Because `import()` is relative to the current file, and the current file is always the Qwik framework. So QRLs have additional information that allows them to serialize imports relative to application base rather than the Qwik framework file.\n\n@param element - The element against which the `url` is resolved. Used to locate the container root and `q:base` attribute.\n@param url - Relative URL retrieved from the attribute that needs to be resolved against the container `q:base` attribute.\n@param symbol - The name of the symbol to import.\n@returns A promise that resolves to the imported symbol.\n\n# `CorePlatform.raf`\n\nPerform operation on next request-animation-frame.\n\n@param fn - The function to call when the next animation frame is ready.\n\n# `CorePlatform.nextTick`\n\nPerform operation on next tick.\n\n@param fn - The function to call when the tick is ready.\n\n# `CorePlatform.chunkForSymbol`\n\nRetrieve chunk name for the symbol.\n\nWhen the application is running on the server the symbols may be imported from different files (as server build is typically a single javascript chunk.) For this reason, it is necessary to convert the chunks from server format to client (browser) format. This is done by looking up symbols (which are globally unique) in the manifest. (Manifest is the mapping of symbols to the client chunk names.)\n\n@param symbolName - Resolve `symbolName` against the manifest and return the chunk that contains the symbol.\n\n# `getPlatform`\n\nRetrieve the `CorePlatform`.\n\nThe `CorePlatform` is also responsible for retrieving the Manifest, that contains mappings from symbols to javascript import chunks. For this reason, `CorePlatform` can't be global, but is specific to the application currently running. On server it is possible that many different applications are running in a single server instance, and for this reason the `CorePlatform` is associated with the application document.\n\n@param docOrNode - The document (or node) of the application for which the platform is needed.\n@public\n\n# `setPlatform`\n\nSets the `CorePlatform`.\n\nThis is useful to override the platform in tests to change the behavior of, `requestAnimationFrame`, and import resolution.\n\n@param doc - The document of the application for which the platform is needed.\n@param platform - The platform to use.\n@public\n"
  },
  {
    "path": "packages/qwik/src/core/platform/types.ts",
    "content": "import type { ValueOrPromise } from '../util/types';\n\n// <docs markdown=\"./readme.md#CorePlatform\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ./readme.md#CorePlatform instead)\n/**\n * Low-level API for platform abstraction.\n *\n * Different platforms (browser, node, service workers) may have different ways of handling things\n * such as `requestAnimationFrame` and imports. To make Qwik platform-independent Qwik uses the\n * `CorePlatform` API to access the platform API.\n *\n * `CorePlatform` also is responsible for importing symbols. The import map is different on the\n * client (browser) then on the server. For this reason, the server has a manifest that is used to\n * map symbols to javascript chunks. The manifest is encapsulated in `CorePlatform`, for this\n * reason, the `CorePlatform` can't be global as there may be multiple applications running at\n * server concurrently.\n *\n * This is a low-level API and there should not be a need for you to access this.\n *\n * @public\n */\n// </docs>\nexport interface CorePlatform {\n  // <docs markdown=\"./readme.md#CorePlatform.isServer\">\n  // !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n  // (edit ./readme.md#CorePlatform.isServer instead)\n  /**\n   * True of running on the server platform.\n   *\n   * @returns True if we are running on the server (not the browser.)\n   */\n  // </docs>\n  isServer: boolean;\n  // <docs markdown=\"./readme.md#CorePlatform.importSymbol\">\n  // !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n  // (edit ./readme.md#CorePlatform.importSymbol instead)\n  /**\n   * Retrieve a symbol value from QRL.\n   *\n   * Qwik needs to lazy load data and closures. For this Qwik uses QRLs that are serializable\n   * references of resources that are needed. The QRLs contain all the information necessary to\n   * retrieve the reference using `importSymbol`.\n   *\n   * Why not use `import()`? Because `import()` is relative to the current file, and the current\n   * file is always the Qwik framework. So QRLs have additional information that allows them to\n   * serialize imports relative to application base rather than the Qwik framework file.\n   *\n   * @param element - The element against which the `url` is resolved. Used to locate the container\n   *   root and `q:base` attribute.\n   * @param url - Relative URL retrieved from the attribute that needs to be resolved against the\n   *   container `q:base` attribute.\n   * @param symbol - The name of the symbol to import.\n   * @returns A promise that resolves to the imported symbol.\n   */\n  // </docs>\n  importSymbol: (\n    containerEl: Element | undefined,\n    url: string | URL | undefined | null,\n    symbol: string\n  ) => ValueOrPromise<any>;\n  // <docs markdown=\"./readme.md#CorePlatform.raf\">\n  // !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n  // (edit ./readme.md#CorePlatform.raf instead)\n  /**\n   * Perform operation on next request-animation-frame.\n   *\n   * @param fn - The function to call when the next animation frame is ready.\n   */\n  // </docs>\n  raf: (fn: () => any) => Promise<any>;\n  // <docs markdown=\"./readme.md#CorePlatform.nextTick\">\n  // !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n  // (edit ./readme.md#CorePlatform.nextTick instead)\n  /**\n   * Perform operation on next tick.\n   *\n   * @param fn - The function to call when the tick is ready.\n   */\n  // </docs>\n  nextTick: (fn: () => any) => Promise<any>;\n  // <docs markdown=\"./readme.md#CorePlatform.chunkForSymbol\">\n  // !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n  // (edit ./readme.md#CorePlatform.chunkForSymbol instead)\n  /**\n   * Retrieve chunk name for the symbol.\n   *\n   * When the application is running on the server the symbols may be imported from different files\n   * (as server build is typically a single javascript chunk.) For this reason, it is necessary to\n   * convert the chunks from server format to client (browser) format. This is done by looking up\n   * symbols (which are globally unique) in the manifest. (Manifest is the mapping of symbols to the\n   * client chunk names.)\n   *\n   * @param symbolName - Resolve `symbolName` against the manifest and return the chunk that\n   *   contains the symbol.\n   */\n  // </docs>\n  chunkForSymbol: (\n    symbolName: string,\n    chunk: string | null,\n    parent?: string\n  ) => readonly [symbol: string, chunk: string] | undefined;\n}\n\nexport interface CorePlatformServer extends CorePlatform {\n  isServer: true;\n}\n"
  },
  {
    "path": "packages/qwik/src/core/preloader/bundle-graph.ts",
    "content": "import { isBrowser } from '@builder.io/qwik/build';\nimport { config, isJSRegex } from './constants';\nimport { adjustProbabilities, bundles, log, shouldResetFactor, trigger } from './queue';\nimport type { BundleGraph, BundleImport, ImportProbability } from './types';\nimport { BundleImportState_None, BundleImportState_Alias } from './types';\n\nexport let base: string | undefined;\nexport let graph: BundleGraph;\n\nconst makeBundle = (name: string, deps?: ImportProbability[]) => {\n  return {\n    $name$: name,\n    $state$: isJSRegex.test(name) ? BundleImportState_None : BundleImportState_Alias,\n    $deps$: shouldResetFactor ? deps?.map((d) => ({ ...d, $factor$: 1 })) : deps,\n    $inverseProbability$: 1,\n    $createdTs$: Date.now(),\n    $waitedMs$: 0,\n    $loadedMs$: 0,\n  };\n};\n\nexport const parseBundleGraph = (serialized: (string | number)[]) => {\n  const graph: BundleGraph = new Map();\n  let i = 0;\n  while (i < serialized.length) {\n    const name = serialized[i++] as string;\n    const deps: ImportProbability[] = [];\n    let idx: number | string;\n    let probability = 1;\n    while (((idx = serialized[i]), typeof idx === 'number')) {\n      if (idx < 0) {\n        probability = -idx / 10;\n      } else {\n        deps.push({\n          $name$: serialized[idx] as string,\n          $importProbability$: probability,\n          $factor$: 1,\n        });\n      }\n      i++;\n    }\n    graph.set(name, deps);\n  }\n  return graph;\n};\n\nexport const getBundle = (name: string) => {\n  let bundle = bundles.get(name);\n  if (!bundle) {\n    let deps: ImportProbability[] | undefined;\n    if (graph) {\n      deps = graph.get(name);\n      if (!deps) {\n        return;\n      }\n      if (!deps.length) {\n        deps = undefined;\n      }\n    }\n    bundle = makeBundle(name, deps);\n    bundles.set(name, bundle);\n  }\n  return bundle;\n};\n\n/** Used in browser */\nexport const loadBundleGraph = (\n  basePath: string,\n  serializedResponse?: ReturnType<typeof fetch>,\n  opts?: {\n    /** Enable logging */\n    debug?: boolean;\n    /** Maximum number of simultaneous preload links */\n    P?: number;\n    /** Minimum probability for a bundle to be added to the preload queue */\n    Q?: number;\n  }\n) => {\n  if (opts) {\n    if ('d' in opts) {\n      config.$DEBUG$ = !!opts.d;\n    }\n    if ('P' in opts) {\n      config.$maxIdlePreloads$ = opts['P'] as number;\n    }\n    if ('Q' in opts) {\n      config.$invPreloadProbability$ = 1 - (opts['Q'] as number);\n    }\n  }\n  if (!isBrowser || basePath == null) {\n    return;\n  }\n  base = basePath;\n\n  if (serializedResponse) {\n    serializedResponse\n      .then((r) => r.text())\n      .then((text) => {\n        graph = parseBundleGraph(JSON.parse(text));\n        const toAdjust: [BundleImport, number][] = [];\n        for (const [name, deps] of graph.entries()) {\n          const bundle = getBundle(name)!;\n          bundle.$deps$ = deps;\n          if (bundle.$inverseProbability$ < 1) {\n            toAdjust.push([bundle, bundle.$inverseProbability$]);\n            bundle.$inverseProbability$ = 1;\n          }\n        }\n        config.$DEBUG$ &&\n          log(`parseBundleGraph got ${graph.size} bundles, adjusting ${toAdjust.length}`);\n        for (const [bundle, inverseProbability] of toAdjust) {\n          adjustProbabilities(bundle, inverseProbability);\n        }\n        trigger();\n      })\n      .catch(console.warn);\n  }\n};\n\n/** Used during SSR */\nexport const initPreloader = (\n  serializedBundleGraph?: (string | number)[],\n  opts?: {\n    debug?: boolean;\n    preloadProbability?: number;\n  }\n) => {\n  if (opts) {\n    if ('debug' in opts) {\n      config.$DEBUG$ = !!opts.debug;\n    }\n    if (typeof opts.preloadProbability === 'number') {\n      config.$invPreloadProbability$ = 1 - opts.preloadProbability;\n    }\n  }\n  if (base != null || !serializedBundleGraph) {\n    return;\n  }\n  base = '';\n  graph = parseBundleGraph(serializedBundleGraph);\n};\n"
  },
  {
    "path": "packages/qwik/src/core/preloader/constants.ts",
    "content": "import { isBrowser } from '@builder.io/qwik/build';\n\n// Browser-specific setup\nexport const doc = isBrowser ? document : undefined!;\nexport const modulePreloadStr = 'modulepreload';\nexport const preloadStr = 'preload';\n\nexport const config = {\n  $DEBUG$: false,\n  $maxIdlePreloads$: 25,\n  $invPreloadProbability$: 0.65,\n};\n\n// Determine which rel attribute to use based on browser support\nexport const rel =\n  isBrowser && doc.createElement('link').relList.supports(modulePreloadStr)\n    ? modulePreloadStr\n    : preloadStr;\n\n// Global state\nexport const loadStart = Date.now();\n\nexport const isJSRegex = /\\.[mc]?js$/;\n"
  },
  {
    "path": "packages/qwik/src/core/preloader/index.ts",
    "content": "/**\n * Note: this file gets built separately from the rest of the core module, and is then kept separate\n * in the dist directory via manualChunks. This way it can run before the rest of the core module is\n * loaded, but core can still use it.\n *\n * Here we handle preloading of bundles. See @link{./preloading.md} for more details.\n */\n\n// Short names for minification\nexport { loadBundleGraph as l, parseBundleGraph as g } from './bundle-graph';\nexport { preload as p, handleBundle as h } from './queue';\n"
  },
  {
    "path": "packages/qwik/src/core/preloader/preloader.unit.ts",
    "content": "import { readFileSync } from 'fs';\nimport { expect, test } from 'vitest';\nimport compress from 'brotli/compress.js';\nimport { fileURLToPath } from 'url';\nimport { dirname, resolve } from 'path';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n// Run `pnpm build --qwik --dev` to update\ntest('preloader script', () => {\n  let preLoader: string = '';\n  try {\n    preLoader = readFileSync(resolve(__dirname, '../../../dist/preloader.mjs'), 'utf-8');\n  } catch {\n    // ignore, we didn't build yet\n  }\n  // This is to ensure we are deliberate about changes to preloader.\n  expect(preLoader.length).toBeGreaterThan(0);\n  /**\n   * Note that the source length can be shorter by using strings in variables and using those to\n   * dereference objects etc, but that actually results in worse compression\n   */\n  const compressed = compress(Buffer.from(preLoader), { mode: 1, quality: 11 });\n  expect([compressed.length, preLoader.length]).toEqual([1818, 5417]);\n});\n"
  },
  {
    "path": "packages/qwik/src/core/preloader/queue.ts",
    "content": "import { isBrowser } from '@builder.io/qwik/build';\nimport { base, getBundle, graph } from './bundle-graph';\nimport { config, doc, loadStart, rel } from './constants';\nimport type { BundleImport, BundleImports } from './types';\nimport {\n  BundleImportState_Loaded,\n  BundleImportState_None,\n  BundleImportState_Preload,\n  BundleImportState_Queued,\n} from './types';\nimport type { QwikSymbolEvent } from '../render/jsx/types/jsx-qwik-events';\n\nexport const bundles: BundleImports = new Map();\nexport let shouldResetFactor: boolean;\nlet queueDirty: boolean;\nlet preloadCount = 0;\nconst queue: BundleImport[] = [];\n\nexport const log = (...args: any[]) => {\n  // eslint-disable-next-line no-console\n  console.log(\n    `Preloader ${Date.now() - loadStart}ms ${preloadCount}/${queue.length} queued>`,\n    ...args\n  );\n};\n\nexport const resetQueue = () => {\n  bundles.clear();\n  queueDirty = false;\n  shouldResetFactor = true;\n  preloadCount = 0;\n  queue.length = 0;\n};\nexport const sortQueue = () => {\n  if (queueDirty) {\n    queue.sort((a, b) => a.$inverseProbability$ - b.$inverseProbability$);\n    queueDirty = false;\n  }\n};\n/**\n * This returns `[probability, url1, url2, probability, url3, ...]` in the way `preload()` expects.\n *\n * `probability` is a number between 0 and 10.\n *\n * The client will use this array to reconstruct the queue.\n */\nexport const getQueue = () => {\n  sortQueue();\n  let probability = 0.4;\n  const result: (string | number)[] = [];\n  for (const b of queue) {\n    const nextProbability = Math.round((1 - b.$inverseProbability$) * 10);\n    if (nextProbability !== probability) {\n      probability = nextProbability;\n      result.push(probability);\n    }\n    result.push(b.$name$);\n  }\n  return result;\n};\n\n/**\n * This is called when a bundle is queued, or finished loading.\n *\n * Because Chrome doesn't treat new modulepreloads as higher priority, we only make\n * maxSimultaneousPreloads links available at a time, so that when a new high priority bundle comes\n * in, it is soon preloaded.\n *\n * We make sure to first preload the high priority items.\n */\nexport const trigger = () => {\n  if (!queue.length) {\n    return;\n  }\n  sortQueue();\n  while (queue.length) {\n    const bundle = queue[0];\n    const inverseProbability = bundle.$inverseProbability$;\n    const probability = 1 - inverseProbability;\n    const allowedPreloads = graph\n      ? config.$maxIdlePreloads$\n      : // While the graph is not available, we limit to 5 preloads\n        5;\n    // When we're 99% sure, everything needs to be queued\n    if (probability >= 0.99 || preloadCount < allowedPreloads) {\n      queue.shift();\n      preloadOne(bundle);\n    } else {\n      break;\n    }\n  }\n  /**\n   * The low priority bundles are opportunistic, and we want to give the browser some breathing room\n   * for other resources, so we cycle between 4 and 10 outstanding modulepreloads.\n   */\n  if (config.$DEBUG$ && !queue.length) {\n    const loaded = [...bundles.values()].filter((b) => b.$state$ > BundleImportState_None);\n    const waitTime = loaded.reduce((acc, b) => acc + b.$waitedMs$, 0);\n    const loadTime = loaded.reduce((acc, b) => acc + b.$loadedMs$, 0);\n    log(\n      `>>>> done ${loaded.length}/${bundles.size} total: ${waitTime}ms waited, ${loadTime}ms loaded`\n    );\n  }\n};\n\nconst preloadOne = (bundle: BundleImport) => {\n  if (bundle.$state$ >= BundleImportState_Preload) {\n    return;\n  }\n  preloadCount++;\n\n  const start = Date.now();\n  bundle.$waitedMs$ = start - bundle.$createdTs$;\n  bundle.$state$ = BundleImportState_Preload;\n\n  config.$DEBUG$ &&\n    log(\n      `<< load ${Math.round((1 - bundle.$inverseProbability$) * 100)}% after ${`${bundle.$waitedMs$}ms`}`,\n      bundle.$name$\n    );\n\n  const link = doc.createElement('link');\n  // Only bundles with state none are js bundles\n  link.href = new URL(`${base}${bundle.$name$}`, doc.baseURI).toString();\n  link.rel = rel;\n  // Needed when rel is 'preload'\n  link.as = 'script';\n  // Handle completion of the preload\n  link.onload = link.onerror = () => {\n    preloadCount--;\n    const end = Date.now();\n    bundle.$loadedMs$ = end - start;\n    bundle.$state$ = BundleImportState_Loaded;\n    config.$DEBUG$ && log(`>> done after ${bundle.$loadedMs$}ms`, bundle.$name$);\n    // Keep the <head> clean\n    link.remove();\n    // More bundles may be ready to preload\n    trigger();\n  };\n\n  doc.head.appendChild(link);\n};\n\n/**\n * Adjust the probability of a bundle based on the probability of its dependent bundles, and queue\n * it if it's likely enough to be preloaded.\n *\n * Note that if the probability is 100%, we treat the dynamic imports as 99% sure, and both will be\n * preloaded without limit.\n *\n * We also limit \"organic\" probability to 98% so they don't get unlimited preloads.\n */\nexport const adjustProbabilities = (\n  bundle: BundleImport,\n  newInverseProbability: number,\n  seen?: Set<BundleImport>\n) => {\n  if (seen?.has(bundle)) {\n    return;\n  }\n\n  const previousInverseProbability = bundle.$inverseProbability$;\n  bundle.$inverseProbability$ = newInverseProbability;\n  // Don't propagate tiny changes\n  if (previousInverseProbability - bundle.$inverseProbability$ < 0.01) {\n    return;\n  }\n\n  if (\n    // don't queue until we have initialized the preloader\n    base != null &&\n    bundle.$state$ < BundleImportState_Preload\n  ) {\n    if (bundle.$state$ === BundleImportState_None) {\n      bundle.$state$ = BundleImportState_Queued;\n      queue.push(bundle);\n      config.$DEBUG$ &&\n        log(`queued ${Math.round((1 - bundle.$inverseProbability$) * 100)}%`, bundle.$name$);\n    }\n\n    // It's in the queue, so we need to re-sort it\n    queueDirty = true;\n  }\n\n  if (bundle.$deps$) {\n    seen ||= new Set();\n    seen.add(bundle);\n    const probability = 1 - bundle.$inverseProbability$;\n    for (const dep of bundle.$deps$) {\n      const depBundle = getBundle(dep.$name$)!;\n      if (depBundle.$inverseProbability$ === 0) {\n        // it's already at max probability\n        continue;\n      }\n      /**\n       * The chance that a dep won't be loaded is 1-(the chance that the dep will be loaded)*(the\n       * chance that the current bundle will be loaded).\n       *\n       * We can multiply this chance together with all other bundle adjustments to get the chance\n       * that a dep will be loaded given all the chances of the other bundles.\n       *\n       * But when we're very likely to load the current bundle, make the dynamic imports very likely\n       * too.\n       */\n      let newInverseProbability: number;\n      if (probability === 1 || (probability >= 0.99 && depsCount < 100)) {\n        depsCount++;\n        // we're loaded at max probability, so elevate dynamic imports to 99% sure\n        newInverseProbability = Math.min(0.01, 1 - dep.$importProbability$);\n      } else {\n        const newInverseImportProbability = 1 - dep.$importProbability$ * probability;\n        /** We need to undo the previous adjustment */\n        const prevAdjust = dep.$factor$;\n        const factor = newInverseImportProbability / prevAdjust;\n        // limit organic probability to 98%\n        newInverseProbability = Math.max(0.02, depBundle.$inverseProbability$ * factor);\n        dep.$factor$ = factor;\n      }\n\n      adjustProbabilities(depBundle, newInverseProbability, seen);\n    }\n  }\n};\n\nexport const handleBundle = (name: string, inverseProbability: number) => {\n  const bundle = getBundle(name);\n  if (bundle && bundle.$inverseProbability$ > inverseProbability) {\n    adjustProbabilities(bundle, inverseProbability);\n  }\n};\n\nlet depsCount: number;\n\nexport const preload = (name: string | (number | string)[], probability?: number) => {\n  if (!name?.length) {\n    return;\n  }\n  depsCount = 0;\n\n  let inverseProbability = probability ? 1 - probability : 0.4;\n  if (Array.isArray(name)) {\n    // We must process in reverse order to ensure first bundles are handled first\n    for (let i = name.length - 1; i >= 0; i--) {\n      const item = name[i];\n      if (typeof item === 'number') {\n        inverseProbability = 1 - item / 10;\n      } else {\n        handleBundle(item, inverseProbability);\n      }\n    }\n  } else {\n    handleBundle(name, inverseProbability);\n  }\n  if (isBrowser) {\n    trigger();\n  }\n};\n\nif (isBrowser) {\n  // Get early hints from qwikloader\n  document.addEventListener('qsymbol', (ev) => {\n    const { symbol, href } = (ev as QwikSymbolEvent).detail;\n    // the qrl class doesn't emit href, we don't need to preload\n    if (href) {\n      const hash = symbol.slice(symbol.lastIndexOf('_') + 1);\n      preload(hash, 1);\n    }\n  });\n}\n"
  },
  {
    "path": "packages/qwik/src/core/preloader/types.ts",
    "content": "export const BundleImportState_None = 0;\nexport const BundleImportState_Queued = 1;\nexport const BundleImportState_Preload = 2;\nexport const BundleImportState_Alias = 3;\nexport const BundleImportState_Loaded = 4;\n\nexport type BundleInfo = {\n  $inverseProbability$: number;\n  // TODO check if for performance we should use refs instead of ids\n  $deps$?: ImportProbability[];\n};\n\nexport type BundleImport = BundleInfo & {\n  $name$: string;\n  $state$: number;\n  $createdTs$: number;\n  $waitedMs$: number;\n  $loadedMs$: number;\n};\n\nexport type BundleImports = Map<string, BundleImport>;\n\nexport type ImportProbability = {\n  /** Bundle name */\n  $name$: string;\n  /** Probability */\n  $importProbability$: number;\n  /** Probability adjust factor */\n  $factor$: number;\n};\n\nexport type BundleGraph = Map<string, ImportProbability[]>;\n"
  },
  {
    "path": "packages/qwik/src/core/qrl/inlined-fn.ts",
    "content": "import { assertDefined } from '../error/assert';\nimport { SignalDerived } from '../state/signal';\nimport { qSerialize } from '../util/qdev';\n\n/** @internal */\nexport const _fnSignal = <T extends (...args: any) => any>(\n  fn: T,\n  args: Parameters<T>,\n  fnStr?: string\n) => {\n  return new SignalDerived<ReturnType<T>, Parameters<T>>(fn, args, fnStr);\n};\n\nexport const serializeDerivedSignalFunc = (signal: SignalDerived) => {\n  const fnBody = qSerialize ? signal.$funcStr$ : 'null';\n  assertDefined(fnBody, 'If qSerialize is true then fnStr must be provided.');\n  let args = '';\n  for (let i = 0; i < signal.$args$.length; i++) {\n    args += `p${i},`;\n  }\n  return `(${args})=>(${fnBody})`;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/qrl/qrl-class.ts",
    "content": "import { assertDefined } from '../error/assert';\nimport { qError, QError_qrlIsNotFunction } from '../error/error';\nimport { getPlatform, isServerPlatform } from '../platform/platform';\nimport { verifySerializable } from '../state/common';\nimport { isSignal, type SignalInternal } from '../state/signal';\nimport {\n  invoke,\n  newInvokeContext,\n  newInvokeContextFromTuple,\n  tryGetInvokeContext,\n  type InvokeContext,\n  type InvokeTuple,\n} from '../use/use-core';\nimport { getQFuncs, QInstance } from '../util/markers';\nimport { isPromise, maybeThen } from '../util/promises';\nimport { qDev, qSerialize, qTest, seal } from '../util/qdev';\nimport { isArray, isFunction, type ValueOrPromise } from '../util/types';\n// @ts-expect-error we don't have types for the preloader\nimport { p as preload } from '@builder.io/qwik/preloader';\nimport type { QRLDev } from './qrl';\nimport type { QRL, QrlArgs, QrlReturn } from './qrl.public';\nimport { isBrowser } from '@builder.io/qwik/build';\n\nexport const isQrl = <T = unknown>(value: unknown): value is QRLInternal<T> => {\n  return typeof value === 'function' && typeof (value as any).getSymbol === 'function';\n};\n\n// Make sure this value is same as value in `platform.ts`\nexport const SYNC_QRL = '<sync>';\n\n/** Sync QRL is a function which is serialized into `<script q:func=\"qwik/json\">` tag. */\nexport const isSyncQrl = (value: any): value is QRLInternal => {\n  return isQrl(value) && value.$symbol$ == SYNC_QRL;\n};\n\nexport type QRLInternalMethods<TYPE> = {\n  readonly $chunk$: string | null;\n  readonly $symbol$: string;\n  readonly $refSymbol$: string | null;\n  readonly $hash$: string;\n\n  $capture$: string[] | null;\n  $captureRef$: unknown[] | null;\n  dev: QRLDev | null;\n\n  resolved: undefined | TYPE;\n\n  resolve(): Promise<TYPE>;\n  getSymbol(): string;\n  getHash(): string;\n  getCaptured(): unknown[] | null;\n  getFn(\n    currentCtx?: InvokeContext | InvokeTuple,\n    beforeFn?: () => void\n  ): TYPE extends (...args: any) => any\n    ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE>>\n    : // unknown so we allow assigning function QRLs to any\n      unknown;\n\n  $setContainer$(containerEl: Element | undefined): Element | undefined;\n  $resolveLazy$(containerEl: Element): ValueOrPromise<TYPE>;\n};\n\nexport type QRLInternal<TYPE = unknown> = QRL<TYPE> & QRLInternalMethods<TYPE>;\n\nexport const createQRL = <TYPE>(\n  chunk: string | null,\n  symbol: string,\n  symbolRef: null | ValueOrPromise<TYPE>,\n  symbolFn: null | (() => Promise<Record<string, TYPE>>),\n  capture: null | Readonly<string[]>,\n  captureRef: Readonly<unknown[]> | null,\n  refSymbol: string | null\n): QRLInternal<TYPE> => {\n  if (qDev && qSerialize) {\n    if (captureRef) {\n      for (const item of captureRef) {\n        verifySerializable(item, 'Captured variable in the closure can not be serialized');\n      }\n    }\n  }\n\n  let _containerEl: Element | undefined;\n\n  const qrl = async function (this: unknown, ...args: QrlArgs<TYPE>) {\n    const fn = invokeFn.call(this, tryGetInvokeContext());\n    const result = await fn(...args);\n    return result;\n  } as QRLInternal<TYPE>;\n\n  const setContainer = (el: Element | undefined) => {\n    if (!_containerEl) {\n      _containerEl = el;\n    }\n    return _containerEl;\n  };\n\n  // Wrap functions to provide their lexical scope\n  const wrapFn = (fn: TYPE): TYPE => {\n    if (typeof fn !== 'function' || (!capture?.length && !captureRef?.length)) {\n      return fn;\n    }\n    return function (this: unknown, ...args: QrlArgs<TYPE>) {\n      let context = tryGetInvokeContext();\n      if (context) {\n        const prevQrl = context.$qrl$;\n        context.$qrl$ = qrl;\n        const prevEvent = context.$event$;\n        if (context.$event$ === undefined) {\n          context.$event$ = this as Event;\n        }\n        try {\n          return fn.apply(this, args);\n        } finally {\n          context.$qrl$ = prevQrl;\n          context.$event$ = prevEvent;\n        }\n      }\n      context = newInvokeContext();\n      context.$qrl$ = qrl;\n      context.$event$ = this as Event;\n      return invoke.call(this, context, fn as any, ...args);\n    } as TYPE;\n  };\n\n  const resolve = async (containerEl?: Element): Promise<TYPE> => {\n    if (symbolRef !== null) {\n      // Resolving (Promise) or already resolved (value)\n      return symbolRef;\n    }\n    if (containerEl) {\n      setContainer(containerEl);\n    }\n    if (chunk === '') {\n      // Sync QRL\n      assertDefined(_containerEl, 'Sync QRL must have container element');\n      const hash = _containerEl.getAttribute(QInstance)!;\n      const doc = _containerEl.ownerDocument!;\n      const qFuncs = getQFuncs(doc, hash);\n      // No need to wrap, syncQRLs can't have captured scope\n      return (qrl.resolved = symbolRef = qFuncs[Number(symbol)] as TYPE);\n    }\n\n    if (isBrowser && chunk) {\n      /** We run the QRL, so now the probability of the chunk is 100% */\n      preload(chunk, 1);\n    }\n\n    const start = now();\n    const ctx = tryGetInvokeContext();\n    if (symbolFn !== null) {\n      symbolRef = symbolFn().then((module) => (qrl.resolved = symbolRef = wrapFn(module[symbol])));\n    } else {\n      const imported = getPlatform().importSymbol(_containerEl, chunk, symbol);\n      symbolRef = maybeThen(imported, (ref) => (qrl.resolved = symbolRef = wrapFn(ref)));\n    }\n    if (typeof symbolRef === 'object' && isPromise(symbolRef)) {\n      symbolRef.then(\n        () => emitUsedSymbol(symbol, ctx?.$element$, start),\n        (err) => {\n          console.error(`qrl ${symbol} failed to load`, err);\n          // We shouldn't cache rejections, we can try again later\n          symbolRef = null;\n        }\n      );\n    }\n    return symbolRef;\n  };\n\n  const resolveLazy = (containerEl?: Element): ValueOrPromise<TYPE> => {\n    return symbolRef !== null ? symbolRef : resolve(containerEl);\n  };\n\n  function invokeFn(\n    this: unknown,\n    currentCtx?: InvokeContext | InvokeTuple,\n    beforeFn?: () => void | boolean\n  ) {\n    // Note that we bind the current `this`\n    return (...args: QrlArgs<TYPE>): QrlReturn<TYPE> =>\n      maybeThen(resolveLazy(), (f) => {\n        if (!isFunction(f)) {\n          throw qError(QError_qrlIsNotFunction);\n        }\n        if (beforeFn && beforeFn() === false) {\n          return;\n        }\n        const context = createOrReuseInvocationContext(currentCtx);\n        return invoke.call(this, context, f, ...(args as Parameters<typeof f>));\n      });\n  }\n\n  const createOrReuseInvocationContext = (invoke: InvokeContext | InvokeTuple | undefined) => {\n    if (invoke == null) {\n      return newInvokeContext();\n    } else if (isArray(invoke)) {\n      return newInvokeContextFromTuple(invoke);\n    } else {\n      return invoke;\n    }\n  };\n\n  const resolvedSymbol = refSymbol ?? symbol;\n  const hash = getSymbolHash(resolvedSymbol);\n\n  Object.assign(qrl, {\n    getSymbol: () => resolvedSymbol,\n    getHash: () => hash,\n    getCaptured: () => captureRef,\n    resolve,\n    $resolveLazy$: resolveLazy,\n    $setContainer$: setContainer,\n    $chunk$: chunk,\n    $symbol$: symbol,\n    $refSymbol$: refSymbol,\n    $hash$: hash,\n    getFn: invokeFn,\n\n    $capture$: capture,\n    $captureRef$: captureRef,\n    dev: null,\n    resolved: undefined,\n  });\n  if (symbolRef) {\n    // Replace symbolRef with (a promise for) the value or wrapped function\n    symbolRef = maybeThen(symbolRef, (resolved) => (qrl.resolved = symbolRef = wrapFn(resolved)));\n  }\n  if (qDev) {\n    seal(qrl);\n  }\n  if (isBrowser && resolvedSymbol) {\n    /**\n     * Preloading the symbol instead of the chunk allows us to get probabilities for the bundle\n     * based on its contents.\n     */\n    preload(resolvedSymbol, 0.8);\n  }\n  return qrl;\n};\n\nexport const getSymbolHash = (symbolName: string) => {\n  const index = symbolName.lastIndexOf('_');\n  if (index > -1) {\n    return symbolName.slice(index + 1);\n  }\n  return symbolName;\n};\n\nexport function assertQrl<T>(qrl: QRL<T>): asserts qrl is QRLInternal<T> {\n  if (qDev) {\n    if (!isQrl(qrl)) {\n      throw new Error('Not a QRL');\n    }\n  }\n}\n\nexport function assertSignal<T>(obj: unknown): asserts obj is SignalInternal<T> {\n  if (qDev) {\n    if (!isSignal(obj)) {\n      throw new Error('Not a Signal');\n    }\n  }\n}\n\nconst EMITTED = /*#__PURE__*/ new Set();\n\nexport const emitUsedSymbol = (symbol: string, element: Element | undefined, reqTime: number) => {\n  if (!EMITTED.has(symbol)) {\n    EMITTED.add(symbol);\n    emitEvent('qsymbol', {\n      symbol,\n      element,\n      reqTime,\n    });\n  }\n};\n\nexport const emitEvent = <T extends CustomEvent = any>(eventName: string, detail: T['detail']) => {\n  if (!qTest && !isServerPlatform() && typeof document === 'object') {\n    document.dispatchEvent(\n      new CustomEvent(eventName, {\n        bubbles: false,\n        detail,\n      }) as T\n    );\n  }\n};\n\nconst now = () => {\n  if (qTest || isServerPlatform()) {\n    return 0;\n  }\n  if (typeof performance === 'object') {\n    return performance.now();\n  }\n  return 0;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/qrl/qrl.public.ts",
    "content": "import { implicit$FirstArg } from '../util/implicit_dollar';\nimport { qDev, qRuntimeQrl } from '../util/qdev';\nimport type { QRLDev } from './qrl';\nimport { SYNC_QRL, createQRL } from './qrl-class';\n\n// We use `unknown` instead of `never` when it's not a function so we allow assigning QRL<function> to QRL<any>\nexport type QrlArgs<T> = T extends (...args: infer ARGS) => any ? ARGS : unknown[];\nexport type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;\n\n// <docs markdown=\"../readme.md#QRL\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#QRL instead)\n/**\n * The `QRL` type represents a lazy-loadable AND serializable resource.\n *\n * QRL stands for Qwik URL.\n *\n * Use `QRL` when you want to refer to a lazy-loaded resource. `QRL`s are most often used for code\n * (functions) but can also be used for other resources such as `string`s in the case of styles.\n *\n * `QRL` is an opaque token that is generated by the Qwik Optimizer. (Do not rely on any properties\n * in `QRL` as it may change between versions.)\n *\n * ## Creating `QRL` references\n *\n * Creating `QRL` is done using `$(...)` function. `$(...)` is a special marker for the Qwik\n * Optimizer that marks that the code should be extracted into a lazy-loaded symbol.\n *\n * ```tsx\n * useOnDocument(\n *   'mousemove',\n *   $((event) => console.log('mousemove', event))\n * );\n * ```\n *\n * In the above code, the Qwik Optimizer detects `$(...)` and transforms the code as shown below:\n *\n * ```tsx\n * // FILE: <current file>\n * useOnDocument('mousemove', qrl('./chunk-abc.js', 'onMousemove'));\n *\n * // FILE: chunk-abc.js\n * export const onMousemove = () => console.log('mousemove');\n * ```\n *\n * NOTE: `qrl(...)` is a result of Qwik Optimizer transformation. You should never have to invoke\n * this function directly in your application. The `qrl(...)` function should be invoked only after\n * the Qwik Optimizer transformation.\n *\n * ## Using `QRL`s\n *\n * Use `QRL` type in your application when you want to get a lazy-loadable reference to a resource\n * (most likely a function).\n *\n * ```tsx\n * // Example of declaring a custom functions which takes callback as QRL.\n * export function useMyFunction(callback: QRL<() => void>) {\n *   doExtraStuff();\n *   // The callback passed to `onDocument` requires `QRL`.\n *   useOnDocument('mousemove', callback);\n * }\n * ```\n *\n * In the above example, the way to think about the code is that you are not asking for a callback\n * function but rather a reference to a lazy-loadable callback function. Specifically, the function\n * loading should be delayed until it is actually needed. In the above example, the function would\n * not load until after a `mousemove` event on `document` fires.\n *\n * ## Resolving `QRL` references\n *\n * At times it may be necessary to resolve a `QRL` reference to the actual value. This can be\n * performed using `QRL.resolve(..)` function.\n *\n * ```tsx\n * // Assume you have QRL reference to a greet function\n * const lazyGreet: QRL<() => void> = $(() => console.log('Hello World!'));\n *\n * // Use `qrlImport` to load / resolve the reference.\n * const greet: () => void = await lazyGreet.resolve();\n *\n * //  Invoke it\n * greet();\n * ```\n *\n * NOTE: `element` is needed because `QRL`s are relative and need a base location to resolve\n * against. The base location is encoded in the HTML in the form of `<div q:base=\"/url\">`.\n *\n * ## `QRL.resolved`\n *\n * Once `QRL.resolve()` returns, the value is stored under `QRL.resolved`. This allows the value to\n * be used without having to await `QRL.resolve()` again.\n *\n * ## Question: Why not just use `import()`?\n *\n * At first glance, `QRL` serves the same purpose as `import()`. However, there are three subtle\n * differences that need to be taken into account.\n *\n * 1. `QRL`s must be serializable into HTML.\n * 2. `QRL`s must be resolved by framework relative to `q:base`.\n * 3. `QRL`s must be able to capture lexically scoped variables.\n * 4. `QRL`s encapsulate the difference between running with and without Qwik Optimizer.\n * 5. `QRL`s allow expressing lazy-loaded boundaries without thinking about chunk and symbol names.\n *\n * Let's assume that you intend to write code such as this:\n *\n * ```tsx\n * return <button onClick={() => (await import('./chunk-abc.js')).onClick}>\n * ```\n *\n * The above code needs to be serialized into DOM such as:\n *\n * ```\n * <div q:base=\"/build/\">\n *   <button on:click=\"./chunk-abc.js#onClick\">...</button>\n * </div>\n * ```\n *\n * 1. Notice there is no easy way to extract chunk (`./chunk-abc.js`) and symbol (`onClick`) into HTML.\n * 2. Notice that even if you could extract it, the `import('./chunk-abc.js')` would become relative to\n *    where the `import()` file is declared. Because it is our framework doing the load, the\n *    `./chunk-abc.js` would become relative to the framework file. This is not correct, as it\n *    should be relative to the original file generated by the bundler.\n * 3. Next, the framework needs to resolve the `./chunk-abc.js` and needs a base location that is\n *    encoded in the HTML.\n * 4. The QRL needs to be able to capture lexically scoped variables. (`import()` only allows loading\n *    top-level symbols which don't capture variables.)\n * 5. As a developer, you don't want to think about `import` and naming the chunks and symbols. You\n *    just want to say: \"this should be lazy.\"\n *\n * These are the main reasons why Qwik introduces its own concept of `QRL`.\n *\n * @public\n * @see `$`\n */\n// </docs>\nexport type QRL<TYPE = unknown> = {\n  // Special type brand to let eslint that the Type is serializable\n  __qwik_serializable__?: any;\n  __brand__QRL__: TYPE;\n\n  /** Resolve the QRL and return the actual value. */\n  resolve(): Promise<TYPE>;\n  /** The resolved value, once `resolve()` returns. */\n  resolved: undefined | TYPE;\n\n  getCaptured(): unknown[] | null;\n  getSymbol(): string;\n  getHash(): string;\n  dev: QRLDev | null;\n} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;\n\n// https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types/52668133#52668133\ntype BivariantQrlFn<ARGS extends any[], RETURN> = {\n  /**\n   * Resolve the QRL of closure and invoke it.\n   *\n   * @param args - Closure arguments.\n   * @returns A promise of the return value of the closure.\n   */\n  bivarianceHack(...args: ARGS): Promise<RETURN>;\n}['bivarianceHack'];\n\n/**\n * @deprecated Use `QRL<>` instead\n * @public\n */\nexport type PropFnInterface<ARGS extends any[], RET> = {\n  __qwik_serializable__?: any;\n  (...args: ARGS): Promise<RET>;\n};\n\nlet runtimeSymbolId = 0;\n\n/**\n * Alias for `QRL<T>`. Of historic relevance only.\n *\n * @public\n */\nexport type PropFunction<T> = QRL<T>;\n\n// <docs markdown=\"../readme.md#$\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#$ instead)\n/**\n * Qwik Optimizer marker function.\n *\n * Use `$(...)` to tell Qwik Optimizer to extract the expression in `$(...)` into a lazy-loadable\n * resource referenced by `QRL`.\n *\n * @param expression - Expression which should be lazy loaded\n * @public\n * @see `implicit$FirstArg` for additional `____$(...)` rules.\n *\n * In this example, `$(...)` is used to capture the callback function of `onmousemove` into a\n * lazy-loadable reference. This allows the code to refer to the function without actually\n * loading the function. In this example, the callback function does not get loaded until\n * `mousemove` event fires.\n *\n * ```tsx\n * useOnDocument(\n *   'mousemove',\n *   $((event) => console.log('mousemove', event))\n * );\n * ```\n *\n * In this code, the Qwik Optimizer detects `$(...)` and transforms the code into:\n *\n * ```tsx\n * // FILE: <current file>\n * useOnDocument('mousemove', qrl('./chunk-abc.js', 'onMousemove'));\n *\n * // FILE: chunk-abc.js\n * export const onMousemove = () => console.log('mousemove');\n * ```\n *\n * ## Special Rules\n *\n * The Qwik Optimizer places special rules on functions that can be lazy-loaded.\n *\n * 1. The expression of the `$(expression)` function must be importable by the system.\n * (expression shows up in `import` or has `export`)\n * 2. If inlined function, then all lexically captured values must be:\n *    - importable (vars show up in `import`s or `export`s)\n *    - const (The capturing process differs from JS capturing in that writing to captured\n * variables does not update them, and therefore writes are forbidden. The best practice is that\n * all captured variables are constants.)\n *    - Must be runtime serializable.\n *\n * ```tsx\n *\n * import { createContextId, useContext, useContextProvider } from './use/use-context';\n * import { Resource, useResource$ } from './use/use-resource';\n * import { useSignal } from './use/use-signal';\n *\n * export const greet = () => console.log('greet');\n * function topLevelFn() {}\n *\n * function myCode() {\n *   const store = useStore({});\n *   function localFn() {}\n *   // Valid Examples\n *   $(greet); // greet is importable\n *   $(() => greet()); // greet is importable;\n *   $(() => console.log(store)); // store is serializable.\n *\n *   // Compile time errors\n *   $(topLevelFn); // ERROR: `topLevelFn` not importable\n *   $(() => topLevelFn()); // ERROR: `topLevelFn` not importable\n *\n *   // Runtime errors\n *   $(localFn); // ERROR: `localFn` fails serialization\n *   $(() => localFn()); // ERROR: `localFn` fails serialization\n * }\n *\n * ```\n */\n// </docs>\nexport const $ = <T>(expression: T): QRL<T> => {\n  if (!qRuntimeQrl && qDev) {\n    throw new Error(\n      'Optimizer should replace all usages of $() with some special syntax. If you need to create a QRL manually, use inlinedQrl() instead.'\n    );\n  }\n\n  return createQRL<T>(null, 's' + runtimeSymbolId++, expression, null, null, null, null);\n};\n\n/** @public */\nexport const eventQrl = <T>(qrl: QRL<T>): QRL<T> => {\n  return qrl;\n};\n\n/** @public */\nexport const event$ = implicit$FirstArg(eventQrl);\n\n/** @alpha */\nexport interface SyncQRL<TYPE extends Function = any> extends QRL<TYPE> {\n  __brand__SyncQRL__: TYPE;\n\n  /**\n   * Resolve the QRL of closure and invoke it.\n   *\n   * @param args - Closure arguments.\n   * @returns A return value of the closure.\n   */\n  (\n    ...args: TYPE extends (...args: infer ARGS) => any ? ARGS : never\n  ): TYPE extends (...args: any[]) => infer RETURN ? RETURN : never;\n\n  resolved: TYPE;\n  dev: QRLDev | null;\n}\n\n/**\n * Extract function into a synchronously loadable QRL.\n *\n * NOTE: Synchronous QRLs functions can't close over any variables, including exports.\n *\n * @param fn - Function to extract.\n * @returns\n * @alpha\n */\nexport const sync$ = <T extends Function>(fn: T): SyncQRL<T> => {\n  if (!qRuntimeQrl && qDev) {\n    throw new Error(\n      'Optimizer should replace all usages of sync$() with some special syntax. If you need to create a QRL manually, use inlinedSyncQrl() instead.'\n    );\n  }\n  if (qDev) {\n    // To make sure that in dev mode we don't accidentally capture context in `sync$()` we serialize and deserialize the function.\n    // eslint-disable-next-line no-new-func\n    fn = new Function('return ' + fn.toString())() as any;\n  }\n\n  return createQRL<T>('', SYNC_QRL, fn, null, null, null, null) as any;\n};\n\n/**\n * Extract function into a synchronously loadable QRL.\n *\n * NOTE: Synchronous QRLs functions can't close over any variables, including exports.\n *\n * @param fn - Extracted function\n * @param serializedFn - Serialized function in string form.\n * @returns\n * @alpha\n */\nexport const _qrlSync = function <TYPE extends Function>(\n  fn: TYPE,\n  serializedFn?: string\n): SyncQRL<TYPE> {\n  if (serializedFn === undefined) {\n    serializedFn = fn.toString();\n  }\n  (fn as any).serialized = serializedFn;\n  return createQRL<TYPE>('', SYNC_QRL, fn, null, null, null, null) as any;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/qrl/qrl.ts",
    "content": "import { EMPTY_ARRAY } from '../util/flyweight';\nimport type { QRL } from './qrl.public';\nimport { assertQrl, createQRL, isSyncQrl, type QRLInternal } from './qrl-class';\nimport { isFunction, isString } from '../util/types';\nimport {\n  qError,\n  QError_dynamicImportFailed,\n  QError_qrlMissingChunk,\n  QError_unknownTypeArgument,\n} from '../error/error';\nimport { qRuntimeQrl, qSerialize } from '../util/qdev';\nimport { getPlatform } from '../platform/platform';\nimport { assertDefined, assertTrue, assertElement } from '../error/assert';\nimport type { ContainerState, MustGetObjID } from '../container/container';\nimport type { QContext } from '../state/context';\nimport { mapJoin } from '../container/pause';\nimport { throwErrorAndStop } from '../util/log';\n\n// https://regexr.com/68v72\nconst EXTRACT_IMPORT_PATH = /\\(\\s*(['\"])([^\\1]+)\\1\\s*\\)/;\n\n// https://regexr.com/690ds\nconst EXTRACT_SELF_IMPORT = /Promise\\s*\\.\\s*resolve/;\n\n// https://regexr.com/6a83h\nconst EXTRACT_FILE_NAME = /[\\\\/(]([\\w\\d.\\-_]+\\.(js|ts)x?):/;\n\nconst announcedQRL = /*#__PURE__*/ new Set<string>();\n\n/** @public */\nexport interface QRLDev {\n  file: string;\n  lo: number;\n  hi: number;\n}\n\n// <docs markdown=\"../readme.md#qrl\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#qrl instead)\n/**\n * Used by Qwik Optimizer to point to lazy-loaded resources.\n *\n * This function should be used by the Qwik Optimizer only. The function should not be directly\n * referred to in the source code of the application.\n *\n * @param chunkOrFn - Chunk name (or function which is stringified to extract chunk name)\n * @param symbol - Symbol to lazy load\n * @param lexicalScopeCapture - A set of lexically scoped variables to capture.\n * @public\n * @see `QRL`, `$(...)`\n */\n// </docs>\nexport const qrl = <T = any>(\n  chunkOrFn: string | (() => Promise<any>),\n  symbol: string,\n  lexicalScopeCapture: any[] = EMPTY_ARRAY,\n  stackOffset = 0\n): QRL<T> => {\n  let chunk: string | null = null;\n  let symbolFn: null | (() => Promise<Record<string, any>>) = null;\n  if (isFunction(chunkOrFn)) {\n    symbolFn = chunkOrFn;\n    if (qSerialize) {\n      let match: RegExpMatchArray | null;\n      const srcCode = String(chunkOrFn);\n      if ((match = srcCode.match(EXTRACT_IMPORT_PATH)) && match[2]) {\n        chunk = match[2];\n      } else if ((match = srcCode.match(EXTRACT_SELF_IMPORT))) {\n        const ref = 'QWIK-SELF';\n        const frames = new Error(ref).stack!.split('\\n');\n        const start = frames.findIndex((f) => f.includes(ref));\n        const frame = frames[start + 2 + stackOffset];\n        match = frame.match(EXTRACT_FILE_NAME);\n        if (!match) {\n          chunk = 'main';\n        } else {\n          chunk = match[1];\n        }\n      } else {\n        throw qError(QError_dynamicImportFailed, srcCode);\n      }\n    }\n  } else if (isString(chunkOrFn)) {\n    chunk = chunkOrFn;\n  } else {\n    throw qError(QError_unknownTypeArgument, chunkOrFn);\n  }\n\n  if (!announcedQRL.has(symbol)) {\n    // Emit event\n    announcedQRL.add(symbol);\n  }\n\n  // Unwrap subscribers\n  return createQRL<T>(chunk, symbol, null, symbolFn, null, lexicalScopeCapture, null);\n};\n\n/** @internal */\nexport const inlinedQrl = <T>(\n  symbol: T,\n  symbolName: string,\n  lexicalScopeCapture: any[] = EMPTY_ARRAY\n): QRL<T> => {\n  // Unwrap subscribers\n  return createQRL<T>(null, symbolName, symbol, null, null, lexicalScopeCapture, null);\n};\n\n/** @internal */\nexport const _noopQrl = <T>(\n  symbolName: string,\n  lexicalScopeCapture: any[] = EMPTY_ARRAY\n): QRL<T> => {\n  return createQRL<T>(null, symbolName, null, null, null, lexicalScopeCapture, null);\n};\n\n/** @internal */\nexport const _noopQrlDEV = <T>(\n  symbolName: string,\n  opts: QRLDev,\n  lexicalScopeCapture: any[] = EMPTY_ARRAY\n): QRL<T> => {\n  const newQrl = _noopQrl(symbolName, lexicalScopeCapture) as QRLInternal<T>;\n  newQrl.dev = opts;\n  return newQrl;\n};\n\n/** @internal */\nexport const qrlDEV = <T = any>(\n  chunkOrFn: string | (() => Promise<any>),\n  symbol: string,\n  opts: QRLDev,\n  lexicalScopeCapture: any[] = EMPTY_ARRAY\n): QRL<T> => {\n  const newQrl = qrl(chunkOrFn, symbol, lexicalScopeCapture, 1) as QRLInternal<T>;\n  newQrl.dev = opts;\n  return newQrl;\n};\n\n/** @internal */\nexport const inlinedQrlDEV = <T = any>(\n  symbol: T,\n  symbolName: string,\n  opts: QRLDev,\n  lexicalScopeCapture: any[] = EMPTY_ARRAY\n): QRL<T> => {\n  const qrl = inlinedQrl(symbol, symbolName, lexicalScopeCapture) as QRLInternal<T>;\n  qrl.dev = opts;\n  return qrl;\n};\n\nexport interface QRLSerializeOptions {\n  $getObjId$?: MustGetObjID;\n  $addRefMap$?: (obj: any) => string;\n  $containerState$?: ContainerState;\n}\n\nexport const serializeQRL = (qrl: QRLInternal, opts: QRLSerializeOptions = {}) => {\n  assertTrue(qSerialize, 'In order to serialize a QRL, qSerialize must be true');\n  assertQrl(qrl);\n  let symbol = qrl.$symbol$;\n  let chunk = qrl.$chunk$;\n  const refSymbol = qrl.$refSymbol$ ?? symbol;\n  const platform = getPlatform();\n\n  if (platform) {\n    const result = platform.chunkForSymbol(refSymbol, chunk, qrl.dev?.file);\n    if (result) {\n      chunk = result[1];\n      if (!qrl.$refSymbol$) {\n        symbol = result[0];\n      }\n    } else {\n      console.error('serializeQRL: Cannot resolve symbol', symbol, 'in', chunk, qrl.dev?.file);\n    }\n  }\n\n  if (qRuntimeQrl && chunk == null) {\n    chunk = '/runtimeQRL';\n    symbol = '_';\n  }\n  if (chunk == null) {\n    throw qError(QError_qrlMissingChunk, qrl.$symbol$);\n  }\n  if (chunk.startsWith('./')) {\n    chunk = chunk.slice(2);\n  }\n  if (isSyncQrl(qrl)) {\n    if (opts.$containerState$) {\n      const fn = qrl.resolved as Function;\n      const containerState = opts.$containerState$;\n      const fnStrKey = ((fn as any).serialized as string) || fn.toString();\n      let id = containerState.$inlineFns$.get(fnStrKey);\n      if (id === undefined) {\n        id = containerState.$inlineFns$.size;\n        containerState.$inlineFns$.set(fnStrKey, id);\n      }\n      symbol = String(id);\n    } else {\n      throwErrorAndStop('Sync QRL without containerState');\n    }\n  }\n  let output = `${chunk}#${symbol}`;\n  const capture = qrl.$capture$;\n  const captureRef = qrl.$captureRef$;\n  if (captureRef && captureRef.length) {\n    if (opts.$getObjId$) {\n      output += `[${mapJoin(captureRef, opts.$getObjId$, ' ')}]`;\n    } else if (opts.$addRefMap$) {\n      output += `[${mapJoin(captureRef, opts.$addRefMap$, ' ')}]`;\n    }\n  } else if (capture && capture.length > 0) {\n    output += `[${capture.join(' ')}]`;\n  }\n  return output;\n};\n\nexport const serializeQRLs = (\n  existingQRLs: QRLInternal<any>[],\n  containerState: ContainerState,\n  elCtx: QContext\n): string => {\n  assertElement(elCtx.$element$);\n  const opts: QRLSerializeOptions = {\n    $containerState$: containerState,\n    $addRefMap$: (obj) => addToArray(elCtx.$refMap$, obj),\n  };\n  return mapJoin(existingQRLs, (qrl) => serializeQRL(qrl, opts), '\\n');\n};\n\n/** `./chunk#symbol[captures] */\nexport const parseQRL = <T = any>(qrl: string, containerEl?: Element): QRLInternal<T> => {\n  const endIdx = qrl.length;\n  const hashIdx = indexOf(qrl, 0, '#');\n  const captureIdx = indexOf(qrl, hashIdx, '[');\n\n  const chunkEndIdx = Math.min(hashIdx, captureIdx);\n  const chunk = qrl.substring(0, chunkEndIdx);\n\n  const symbolStartIdx = hashIdx == endIdx ? hashIdx : hashIdx + 1;\n  const symbolEndIdx = captureIdx;\n  const symbol =\n    symbolStartIdx == symbolEndIdx ? 'default' : qrl.substring(symbolStartIdx, symbolEndIdx);\n\n  const captureStartIdx = captureIdx;\n  const captureEndIdx = endIdx;\n  const capture =\n    captureStartIdx === captureEndIdx\n      ? EMPTY_ARRAY\n      : qrl.substring(captureStartIdx + 1, captureEndIdx - 1).split(' ');\n\n  const iQrl = createQRL<any>(chunk, symbol, null, null, capture, null, null);\n  if (containerEl) {\n    iQrl.$setContainer$(containerEl);\n  }\n  return iQrl as QRLInternal<T>;\n};\n\nconst indexOf = (text: string, startIdx: number, char: string) => {\n  const endIdx = text.length;\n  const charIdx = text.indexOf(char, startIdx == endIdx ? 0 : startIdx);\n  return charIdx == -1 ? endIdx : charIdx;\n};\n\nconst addToArray = (array: any[], obj: any) => {\n  const index = array.indexOf(obj);\n  if (index === -1) {\n    array.push(obj);\n    return String(array.length - 1);\n  }\n  return String(index);\n};\n\nexport const inflateQrl = (qrl: QRLInternal, elCtx: QContext) => {\n  assertDefined(qrl.$capture$, 'invoke: qrl capture must be defined inside useLexicalScope()', qrl);\n  return (qrl.$captureRef$ = qrl.$capture$.map((idx) => {\n    const int = parseInt(idx, 10);\n    const obj = elCtx.$refMap$[int];\n    assertTrue(elCtx.$refMap$.length > int, 'out of bounds inflate access', idx);\n    return obj;\n  }));\n};\n\n/** @internal */\nexport const _regSymbol = (symbol: any, hash: string) => {\n  if (typeof (globalThis as any).__qwik_reg_symbols === 'undefined') {\n    (globalThis as any).__qwik_reg_symbols = new Map<string, any>();\n  }\n  (globalThis as any).__qwik_reg_symbols.set(hash, symbol);\n  return symbol;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/qrl/qrl.unit.ts",
    "content": "import { parseQRL, serializeQRL } from './qrl';\nimport { createQRL } from './qrl-class';\nimport { qrl } from './qrl';\nimport { describe, test, assert, assertType, expectTypeOf } from 'vitest';\nimport { $, type QRL } from './qrl.public';\nimport { useLexicalScope } from '../use/use-lexical-scope.public';\n\nfunction matchProps(obj: any, properties: Record<string, any>) {\n  for (const [key, value] of Object.entries(properties)) {\n    assert.deepEqual(obj[key], value, `${obj[key]} !== ${value}`);\n  }\n}\n\ndescribe('types', () => {\n  // double function because we test at typecheck time\n  test('matching', () => () => {\n    const fakeStr = true as any as QRL<'hello'>;\n    expectTypeOf(fakeStr).not.toBeAny();\n    assertType<() => Promise<string>>(fakeStr.resolve);\n    const fooFn = (hi: boolean) => 'foo';\n    const fakeFn = true as any as QRL<typeof fooFn>;\n    expectTypeOf(fakeFn).not.toBeAny();\n    assertType<(hi: boolean) => Promise<string>>(fakeFn);\n  });\n  test('inferring', () => () => {\n    const myWrapper = (fn: QRL<(hi: boolean) => string>) => fn(true);\n    const result = myWrapper(\n      $((hi) => {\n        expectTypeOf(hi).toEqualTypeOf<boolean>();\n        return 'hello';\n      })\n    );\n    expectTypeOf(result).toEqualTypeOf<Promise<string>>();\n    const myPropsWrapper = (props: { fn: QRL<(hi: boolean) => string> }) => props.fn(true);\n    const propsResult = myPropsWrapper({\n      fn: $((hi) => {\n        expectTypeOf(hi).toEqualTypeOf<boolean>();\n        return 'hello';\n      }),\n    });\n    expectTypeOf(propsResult).toEqualTypeOf<Promise<string>>();\n  });\n});\n\ndescribe('serialization', () => {\n  test('should parse', () => {\n    matchProps(parseQRL('./chunk#default'), {\n      $chunk$: './chunk',\n      $symbol$: 'default',\n      resolved: undefined,\n    });\n    matchProps(parseQRL('./chunk#mySymbol'), {\n      $chunk$: './chunk',\n      $symbol$: 'mySymbol',\n    });\n    matchProps(parseQRL('./chunk#mySymbol'), {\n      $chunk$: './chunk',\n      $symbol$: 'mySymbol',\n    });\n    matchProps(parseQRL('./chunk#s1'), {\n      $chunk$: './chunk',\n      $symbol$: 's1',\n      $capture$: [],\n    });\n    matchProps(parseQRL('./chunk#s1[1 b]'), {\n      $chunk$: './chunk',\n      $symbol$: 's1',\n      $capture$: ['1', 'b'],\n    });\n    matchProps(parseQRL('./chunk#s1[1 b]'), {\n      $chunk$: './chunk',\n      $symbol$: 's1',\n      $capture$: ['1', 'b'],\n    });\n    matchProps(parseQRL('./chunk#s1[1 b]'), {\n      $chunk$: './chunk',\n      $symbol$: 's1',\n      $capture$: ['1', 'b'],\n    });\n    matchProps(parseQRL('./chunk[1 b]'), {\n      $chunk$: './chunk',\n      $capture$: ['1', 'b'],\n    });\n    matchProps(parseQRL('./path#symbol[2]'), {\n      $chunk$: './path',\n      $symbol$: 'symbol',\n      $capture$: ['2'],\n    });\n    matchProps(\n      parseQRL(\n        '/src/path%2d/foo_symbol.js?_qrl_parent=/home/user/project/src/path/foo.js#symbol[2]'\n      ),\n      {\n        $chunk$: '/src/path%2d/foo_symbol.js?_qrl_parent=/home/user/project/src/path/foo.js',\n        $symbol$: 'symbol',\n        $capture$: ['2'],\n      }\n    );\n  });\n\n  test('serialize qrls', () => {\n    assert.equal(serializeQRL(createQRL('./chunk', '', null, null, null, null, null)), 'chunk#');\n    assert.equal(serializeQRL(createQRL('./c', 's1', null, null, null, null, null)), 'c#s1');\n    assert.equal(serializeQRL(createQRL('./c', 's1', null, null, [], null, null)), 'c#s1');\n    assert.equal(\n      serializeQRL(createQRL('./c', 's1', null, null, [1, '2'] as any, null, null)),\n      'c#s1[1 2]'\n    );\n    assert.equal(\n      serializeQRL(createQRL('c', 's1', null, null, [1 as any, '2'], null, null)),\n      'c#s1[1 2]'\n    );\n    assert.equal(\n      serializeQRL(\n        createQRL('src/routes/[...index]/a+b/c?foo', 's1', null, null, [1 as any, '2'], null, null)\n      ),\n      'src/routes/[...index]/a+b/c?foo#s1[1 2]'\n    );\n  });\n\n  test('should parse reference', () => {\n    const require = (str: string) => {\n      console.warn(str);\n    };\n    matchProps(\n      qrl(\n        () =>\n          Promise.resolve().then(function () {\n            return require('./h_my-app_myapp_init-73253fd4.js');\n          }),\n        'MyApp_init'\n      ),\n      {\n        $chunk$: './h_my-app_myapp_init-73253fd4.js',\n        $symbol$: 'MyApp_init',\n      }\n    );\n  });\n\n  // See https://github.com/QwikDev/qwik/issues/5087#issuecomment-1707185010\n  test.skip('should parse self-reference', () => {});\n\n  test('should store resolved value', async () => {\n    const q = qrl(() => Promise.resolve({ hi: 'hello' }), 'hi');\n    assert.equal(q.resolved, undefined);\n    await q.resolve();\n    assert.equal(q.resolved, 'hello');\n  });\n});\n\ndescribe('createQRL', () => {\n  test('should create QRL', () => {\n    const q = createQRL('chunk', 'symbol', 'resolved', null, null, null, null);\n    matchProps(q, {\n      $chunk$: 'chunk',\n      $symbol$: 'symbol',\n      resolved: 'resolved',\n    });\n  });\n  test('should have .resolved: given scalar', async () => {\n    const q = createQRL('chunk', 'symbol', 'resolved', null, null, null, null);\n    assert.equal(q.resolved, 'resolved');\n  });\n  test('should have .resolved: given promise for scalar', async () => {\n    const q = createQRL('chunk', 'symbol', Promise.resolve('resolved'), null, null, null, null);\n    assert.equal(q.resolved, undefined);\n    assert.equal(await q.resolve(), 'resolved');\n    assert.equal(q.resolved, 'resolved');\n  });\n  test('should have .resolved: promise for scalar', async () => {\n    const q = createQRL(\n      'chunk',\n      'symbol',\n      null,\n      () => Promise.resolve({ symbol: 'resolved' }),\n      null,\n      null,\n      null\n    );\n    assert.equal(q.resolved, undefined);\n    assert.equal(await q.resolve(), 'resolved');\n    assert.equal(q.resolved, 'resolved');\n  });\n\n  const fn = () => 'hi';\n  test('should have .resolved: given function without captures', async () => {\n    const q = createQRL('chunk', 'symbol', fn, null, null, null, null);\n    assert.equal(q.resolved, fn);\n  });\n  test('should have .resolved: given promise for function without captures', async () => {\n    const q = createQRL('chunk', 'symbol', Promise.resolve(fn), null, null, null, null);\n    assert.equal(q.resolved, undefined);\n    assert.equal(await q.resolve(), fn);\n    assert.equal(q.resolved, fn);\n  });\n  test('should have .resolved: promise for function without captures', async () => {\n    const q = createQRL(\n      'chunk',\n      'symbol',\n      null,\n      () => Promise.resolve({ symbol: fn }),\n      null,\n      null,\n      null\n    );\n    assert.equal(q.resolved, undefined);\n    assert.equal(await q.resolve(), fn);\n    assert.equal(q.resolved, fn);\n  });\n\n  const capFn = () => useLexicalScope();\n  test('should have .resolved: given function with captures', async () => {\n    const q = createQRL('chunk', 'symbol', capFn, null, null, ['hi'], null);\n    assert.isDefined(q.resolved);\n    assert.notEqual(q.resolved, capFn);\n    assert.deepEqual(q.resolved!(), ['hi']);\n  });\n  test('should have .resolved: given promise for function with captures', async () => {\n    const q = createQRL('chunk', 'symbol', Promise.resolve(capFn), null, null, ['hi'], null);\n    assert.equal(q.resolved, undefined);\n    assert.deepEqual(await q(), ['hi']);\n    assert.notEqual(q.resolved, capFn);\n    assert.deepEqual(q.resolved!(), ['hi']);\n  });\n  test('should have .resolved: promise for function with captures', async () => {\n    const q = createQRL<Function>(\n      'chunk',\n      'symbol',\n      null,\n      () => Promise.resolve({ symbol: capFn }),\n      null,\n      ['hi'],\n      null\n    );\n    assert.equal(q.resolved, undefined);\n    assert.deepEqual(await q(), ['hi']);\n    assert.notEqual(q.resolved, capFn);\n    assert.deepEqual(q.resolved!(), ['hi']);\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/qwik.core.api.md",
    "content": "## API Report File for \"@builder.io/qwik\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport * as CSS_2 from 'csstype';\nimport { isBrowser } from '@builder.io/qwik/build';\nimport { isDev } from '@builder.io/qwik/build';\nimport { isServer } from '@builder.io/qwik/build';\nimport type { JSXNode as JSXNode_2 } from '@builder.io/qwik/jsx-runtime';\n\n// @public\nexport const $: <T>(expression: T) => QRL<T>;\n\n// @internal (undocumented)\nexport type _AllowPlainQrl<Q> = QRLEventHandlerMulti<any, any> extends Q ? Q extends QRLEventHandlerMulti<infer EV, infer EL> ? Q | (EL extends Element ? EventHandler<EV, EL> : never) : Q : Q extends QRL<infer U> ? Q | U : NonNullable<Q> extends never ? Q : QRL<Q> | Q;\n\n// Warning: (ae-forgotten-export) The symbol \"Attrs\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport interface AnchorHTMLAttributes<T extends Element> extends Attrs<'a', T> {\n}\n\n// @public (undocumented)\nexport interface AreaHTMLAttributes<T extends Element> extends Attrs<'area', T> {\n}\n\n// @public\nexport interface AriaAttributes {\n    'aria-activedescendant'?: string | undefined;\n    'aria-atomic'?: Booleanish | undefined;\n    'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both' | undefined;\n    'aria-busy'?: Booleanish | undefined;\n    'aria-checked'?: boolean | 'false' | 'mixed' | 'true' | undefined;\n    'aria-colcount'?: number | undefined;\n    'aria-colindex'?: number | undefined;\n    'aria-colspan'?: number | undefined;\n    'aria-controls'?: string | undefined;\n    'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time' | undefined;\n    'aria-describedby'?: string | undefined;\n    'aria-details'?: string | undefined;\n    'aria-disabled'?: Booleanish | undefined;\n    // @deprecated\n    'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup' | undefined;\n    'aria-errormessage'?: string | undefined;\n    'aria-expanded'?: Booleanish | undefined;\n    'aria-flowto'?: string | undefined;\n    // @deprecated\n    'aria-grabbed'?: Booleanish | undefined;\n    'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined;\n    'aria-hidden'?: Booleanish | undefined;\n    'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling' | undefined;\n    'aria-keyshortcuts'?: string | undefined;\n    'aria-label'?: string | undefined;\n    'aria-labelledby'?: string | undefined;\n    'aria-level'?: number | undefined;\n    'aria-live'?: 'off' | 'assertive' | 'polite' | undefined;\n    'aria-modal'?: Booleanish | undefined;\n    'aria-multiline'?: Booleanish | undefined;\n    'aria-multiselectable'?: Booleanish | undefined;\n    'aria-orientation'?: 'horizontal' | 'vertical' | undefined;\n    'aria-owns'?: string | undefined;\n    'aria-placeholder'?: string | undefined;\n    'aria-posinset'?: number | undefined;\n    'aria-pressed'?: boolean | 'false' | 'mixed' | 'true' | undefined;\n    'aria-readonly'?: Booleanish | undefined;\n    'aria-relevant'?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals' | undefined;\n    'aria-required'?: Booleanish | undefined;\n    'aria-roledescription'?: string | undefined;\n    'aria-rowcount'?: number | undefined;\n    'aria-rowindex'?: number | undefined;\n    'aria-rowspan'?: number | undefined;\n    'aria-selected'?: Booleanish | undefined;\n    'aria-setsize'?: number | undefined;\n    'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | undefined;\n    'aria-valuemax'?: number | undefined;\n    'aria-valuemin'?: number | undefined;\n    'aria-valuenow'?: number | undefined;\n    'aria-valuetext'?: string | undefined;\n}\n\n// @public (undocumented)\nexport type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem' | (string & {});\n\n// @public (undocumented)\nexport interface AudioHTMLAttributes<T extends Element> extends Attrs<'audio', T> {\n}\n\n// @public (undocumented)\nexport interface BaseHTMLAttributes<T extends Element> extends Attrs<'base', T> {\n}\n\n// @public (undocumented)\nexport interface BlockquoteHTMLAttributes<T extends Element> extends Attrs<'blockquote', T> {\n}\n\n// @public (undocumented)\nexport type Booleanish = boolean | `${boolean}`;\n\n// @public (undocumented)\nexport interface ButtonHTMLAttributes<T extends Element> extends Attrs<'button', T> {\n}\n\n// @public (undocumented)\nexport interface CanvasHTMLAttributes<T extends Element> extends Attrs<'canvas', T> {\n}\n\n// @public\nexport type ClassList = string | undefined | null | false | Record<string, boolean | string | number | null | undefined> | ClassList[];\n\n// @public (undocumented)\nexport interface ColgroupHTMLAttributes<T extends Element> extends Attrs<'colgroup', T> {\n}\n\n// @public (undocumented)\nexport interface ColHTMLAttributes<T extends Element> extends Attrs<'col', T> {\n}\n\n// @public\nexport const component$: <PROPS = unknown>(onMount: OnRenderFn<PROPS>) => Component<PROPS>;\n\n// @public\nexport type Component<PROPS = unknown> = FunctionComponent<PublicProps<PROPS>>;\n\n// @public (undocumented)\nexport interface ComponentBaseProps {\n    // (undocumented)\n    'q:slot'?: string;\n    // (undocumented)\n    key?: string | number | null | undefined;\n}\n\n// @public\nexport const componentQrl: <PROPS extends Record<any, any>>(componentQrl: QRL<OnRenderFn<PROPS>>) => Component<PROPS>;\n\n// @public (undocumented)\nexport type ComputedFn<T> = () => T;\n\n// @public\nexport interface ContextId<STATE> {\n    readonly __brand_context_type__: STATE;\n    readonly id: string;\n}\n\n// @public\nexport interface CorePlatform {\n    chunkForSymbol: (symbolName: string, chunk: string | null, parent?: string) => readonly [symbol: string, chunk: string] | undefined;\n    importSymbol: (containerEl: Element | undefined, url: string | URL | undefined | null, symbol: string) => ValueOrPromise<any>;\n    isServer: boolean;\n    nextTick: (fn: () => any) => Promise<any>;\n    raf: (fn: () => any) => Promise<any>;\n}\n\n// @public\nexport interface CorrectedToggleEvent extends Event {\n    // (undocumented)\n    readonly newState: 'open' | 'closed';\n    // (undocumented)\n    readonly prevState: 'open' | 'closed';\n}\n\n// @public @deprecated\nexport const createComputed$: <T>(qrl: ComputedFn<T>) => Signal<Awaited<T>>;\n\n// @public (undocumented)\nexport const createComputedQrl: <T>(qrl: QRL<ComputedFn<T>>) => Signal<Awaited<T>>;\n\n// @public\nexport const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;\n\n// @public @deprecated\nexport const createSignal: UseSignal;\n\n// @public (undocumented)\nexport interface CSSProperties extends CSS_2.Properties<string | number>, CSS_2.PropertiesHyphen<string | number> {\n    [v: `--${string}`]: string | number | undefined;\n}\n\n// @public (undocumented)\nexport interface DataHTMLAttributes<T extends Element> extends Attrs<'data', T> {\n}\n\n// @public (undocumented)\nexport interface DelHTMLAttributes<T extends Element> extends Attrs<'del', T> {\n}\n\n// @internal (undocumented)\nexport const _deserializeData: (data: string, element?: unknown) => any;\n\n// @public (undocumented)\nexport interface DetailsHTMLAttributes<T extends Element> extends Attrs<'details', T> {\n}\n\n// @public (undocumented)\nexport interface DevJSX {\n    // (undocumented)\n    columnNumber: number;\n    // (undocumented)\n    fileName: string;\n    // (undocumented)\n    lineNumber: number;\n    // (undocumented)\n    stack?: string;\n}\n\n// @public (undocumented)\nexport interface DialogHTMLAttributes<T extends Element> extends Attrs<'dialog', T> {\n}\n\n// Warning: (ae-forgotten-export) The symbol \"DOMAttributesBase\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"QwikEvents\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport interface DOMAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL> {\n    // (undocumented)\n    class?: ClassList | Signal<ClassList> | undefined;\n}\n\n// @public @deprecated (undocumented)\nexport type EagernessOptions = 'visible' | 'load' | 'idle';\n\n// @public (undocumented)\nexport interface EmbedHTMLAttributes<T extends Element> extends Attrs<'embed', T> {\n}\n\n// @public (undocumented)\nexport interface ErrorBoundaryStore {\n    // (undocumented)\n    error: any | undefined;\n}\n\n// @public (undocumented)\nexport const event$: <T>(qrl: T) => QRL<T>;\n\n// @public\nexport type EventHandler<EV = Event, EL = Element> = {\n    bivarianceHack(event: EV, element: EL): any;\n}['bivarianceHack'];\n\n// @public (undocumented)\nexport const eventQrl: <T>(qrl: QRL<T>) => QRL<T>;\n\n// @public (undocumented)\nexport interface FieldsetHTMLAttributes<T extends Element> extends Attrs<'fieldset', T> {\n}\n\n// Warning: (ae-forgotten-export) The symbol \"SignalDerived\" needs to be exported by the entry point index.d.ts\n//\n// @internal (undocumented)\nexport const _fnSignal: <T extends (...args: any) => any>(fn: T, args: Parameters<T>, fnStr?: string) => SignalDerived<ReturnType<T>, Parameters<T>>;\n\n// @public (undocumented)\nexport interface FormHTMLAttributes<T extends Element> extends Attrs<'form', T> {\n}\n\n// @public (undocumented)\nexport const Fragment: FunctionComponent<{\n    children?: any;\n    key?: string | number | null;\n}>;\n\n// @public\nexport type FunctionComponent<P = unknown> = {\n    renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;\n}['renderFn'];\n\n// @internal (undocumented)\nexport const _getContextElement: () => unknown;\n\n// @internal (undocumented)\nexport const _getContextEvent: () => unknown;\n\n// Warning: (ae-internal-missing-underscore) The name \"getLocale\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal\nexport function getLocale(defaultLocale?: string): string;\n\n// @public\nexport const getPlatform: () => CorePlatform;\n\n// @public (undocumented)\nfunction h<TYPE extends string | FunctionComponent<PROPS>, PROPS extends {} = {}>(type: TYPE, props: PROPS | null, ...children: any[]): JSXNode<TYPE>;\n\n// @public (undocumented)\nnamespace h {\n    // (undocumented)\n    function h(type: any): JSXNode<any>;\n    // (undocumented)\n    function h(type: Node, data: any): JSXNode<any>;\n    // (undocumented)\n    function h(type: any, text: string): JSXNode<any>;\n    // (undocumented)\n    function h(type: any, children: Array<any>): JSXNode<any>;\n    // (undocumented)\n    function h(type: any, data: any, text: string): JSXNode<any>;\n    // (undocumented)\n    function h(type: any, data: any, children: Array<JSXNode<any> | undefined | null>): JSXNode<any>;\n    // (undocumented)\n    function h(sel: any, data: any | null, children: JSXNode<any>): JSXNode<any>;\n        { JSX };\n}\nexport { h as createElement }\nexport { h }\n\n// @public (undocumented)\nexport interface HrHTMLAttributes<T extends Element> extends Attrs<'hr', T> {\n}\n\n// @public (undocumented)\nexport type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});\n\n// @public (undocumented)\nexport type HTMLAttributeReferrerPolicy = ReferrerPolicy;\n\n// @public (undocumented)\nexport interface HTMLAttributes<E extends Element> extends HTMLElementAttrs, DOMAttributes<E> {\n}\n\n// @public (undocumented)\nexport type HTMLCrossOriginAttribute = 'anonymous' | 'use-credentials' | '' | undefined;\n\n// Warning: (ae-forgotten-export) The symbol \"HTMLAttributesBase\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"FilterBase\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement> {\n}\n\n// @public (undocumented)\nexport const HTMLFragment: FunctionComponent<{\n    dangerouslySetInnerHTML: string;\n}>;\n\n// @public (undocumented)\nexport interface HtmlHTMLAttributes<T extends Element> extends Attrs<'html', T> {\n}\n\n// @public (undocumented)\nexport type HTMLInputAutocompleteAttribute = 'on' | 'off' | 'billing' | 'shipping' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'url' | 'photo';\n\n// @public (undocumented)\nexport type HTMLInputTypeAttribute = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});\n\n// @internal\nexport const _hW: () => void;\n\n// @public (undocumented)\nexport interface IframeHTMLAttributes<T extends Element> extends Attrs<'iframe', T> {\n}\n\n// @public (undocumented)\nexport interface ImgHTMLAttributes<T extends Element> extends Attrs<'img', T> {\n}\n\n// @internal (undocumented)\nexport const _IMMUTABLE: unique symbol;\n\n// @public\nexport const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);\n\n// Warning: (ae-internal-missing-underscore) The name \"inlinedQrl\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal (undocumented)\nexport const inlinedQrl: <T>(symbol: T, symbolName: string, lexicalScopeCapture?: any[]) => QRL<T>;\n\n// Warning: (ae-forgotten-export) The symbol \"QRLDev\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-internal-missing-underscore) The name \"inlinedQrlDEV\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal (undocumented)\nexport const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: any[]) => QRL<T>;\n\n// @public (undocumented)\nexport type InputHTMLAttributes<T extends Element> = Attrs<'input', T, HTMLInputElement>;\n\n// @public (undocumented)\nexport interface InsHTMLAttributes<T extends Element> extends Attrs<'ins', T> {\n}\n\n// Warning: (ae-incompatible-release-tags) The symbol \"IntrinsicElements\" is marked as @public, but its signature references \"IntrinsicHTMLElements\" which is marked as @internal\n// Warning: (ae-incompatible-release-tags) The symbol \"IntrinsicElements\" is marked as @public, but its signature references \"IntrinsicSVGElements\" which is marked as @internal\n//\n// @public (undocumented)\nexport interface IntrinsicElements extends IntrinsicHTMLElements, IntrinsicSVGElements {\n}\n\n// Warning: (ae-forgotten-export) The symbol \"Augmented\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"SpecialAttrs\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-internal-missing-underscore) The name \"IntrinsicHTMLElements\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal\nexport type IntrinsicHTMLElements = {\n    [key in keyof HTMLElementTagNameMap]: Augmented<HTMLElementTagNameMap[key], SpecialAttrs[key]> & HTMLAttributes<HTMLElementTagNameMap[key]>;\n} & {\n    [unknownTag: string]: {\n        [prop: string]: any;\n    } & HTMLElementAttrs & HTMLAttributes<any>;\n};\n\n// Warning: (ae-internal-missing-underscore) The name \"IntrinsicSVGElements\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal\nexport type IntrinsicSVGElements = {\n    [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: LenientSVGProps<SVGElementTagNameMap[K]>;\n};\n\nexport { isBrowser }\n\nexport { isDev }\n\nexport { isServer }\n\n// @public\nexport const isSignal: <T = unknown>(obj: any) => obj is Signal<T>;\n\n// @public\nconst jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>, key?: string | number | null) => JSXNode<T>;\nexport { jsx }\nexport { jsx as jsxs }\n\n// @internal (undocumented)\nexport const _jsxBranch: <T>(input?: T) => T | undefined;\n\n// Warning: (ae-forgotten-export) The symbol \"JsxDevOpts\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"JSXNodeInternal\" needs to be exported by the entry point index.d.ts\n//\n// @internal\nexport const _jsxC: <T extends string | FunctionComponent<Record<any, unknown>>>(type: T, mutableProps: (T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>) | null, flags: number, key: string | number | null, dev?: JsxDevOpts) => JSXNodeInternal<T>;\n\n// @public (undocumented)\nexport type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;\n\n// @public (undocumented)\nexport const jsxDEV: <T extends string | FunctionComponent<Record<any, unknown>>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>, key: string | number | null | undefined, _isStatic: boolean, opts: JsxDevOpts, _ctx: unknown) => JSXNode<T>;\n\n// @public\nexport interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {\n    // (undocumented)\n    children: JSXChildren | null;\n    // (undocumented)\n    dev?: DevJSX;\n    // (undocumented)\n    key: string | null;\n    // (undocumented)\n    props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;\n    // (undocumented)\n    type: T;\n}\n\n// @public\nexport type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];\n\n// @internal\nexport const _jsxQ: <T extends string>(type: T, mutableProps: Record<any, unknown> | null, immutableProps: Record<any, unknown> | null, children: JSXChildren | null, flags: number, key: string | number | null, dev?: DevJSX) => JSXNodeInternal<T>;\n\n// @internal\nexport const _jsxS: <T extends string>(type: T, mutableProps: Record<any, unknown> | null, immutableProps: Record<any, unknown> | null, flags: number, key: string | number | null, dev?: DevJSX) => JSXNodeInternal<T>;\n\n// @public (undocumented)\nexport type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;\n\n// @public @deprecated (undocumented)\nexport interface KeygenHTMLAttributes<T extends Element> extends Attrs<'base', T> {\n}\n\n// Warning: (ae-forgotten-export) The symbol \"LiteralUnion\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"AllEventKeys\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport type KnownEventNames = LiteralUnion<AllEventKeys, string>;\n\n// @public (undocumented)\nexport interface LabelHTMLAttributes<T extends Element> extends Attrs<'label', T> {\n}\n\n// Warning: (ae-internal-missing-underscore) The name \"LenientSVGProps\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal (undocumented)\nexport interface LenientSVGProps<T extends Element> extends SVGAttributes, DOMAttributes<T> {\n}\n\n// @public (undocumented)\nexport interface LiHTMLAttributes<T extends Element> extends Attrs<'li', T> {\n}\n\n// @public (undocumented)\nexport interface LinkHTMLAttributes<T extends Element> extends Attrs<'link', T> {\n}\n\n// @public (undocumented)\nexport interface MapHTMLAttributes<T extends Element> extends Attrs<'map', T> {\n}\n\n// @public (undocumented)\nexport interface MediaHTMLAttributes<T extends Element> extends HTMLAttributes<T>, Augmented<HTMLMediaElement, {\n    crossOrigin?: HTMLCrossOriginAttribute;\n}> {\n}\n\n// @public (undocumented)\nexport interface MenuHTMLAttributes<T extends Element> extends Attrs<'menu', T> {\n}\n\n// @public (undocumented)\nexport interface MetaHTMLAttributes<T extends Element> extends Attrs<'meta', T> {\n}\n\n// @public (undocumented)\nexport interface MeterHTMLAttributes<T extends Element> extends Attrs<'meter', T> {\n}\n\n// @public @deprecated (undocumented)\nexport type NativeAnimationEvent = AnimationEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeClipboardEvent = ClipboardEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeCompositionEvent = CompositionEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeDragEvent = DragEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeFocusEvent = FocusEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeKeyboardEvent = KeyboardEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeMouseEvent = MouseEvent;\n\n// @public @deprecated (undocumented)\nexport type NativePointerEvent = PointerEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeTouchEvent = TouchEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeTransitionEvent = TransitionEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeUIEvent = UIEvent;\n\n// @public @deprecated (undocumented)\nexport type NativeWheelEvent = WheelEvent;\n\n// @internal (undocumented)\nexport const _noopQrl: <T>(symbolName: string, lexicalScopeCapture?: any[]) => QRL<T>;\n\n// @internal (undocumented)\nexport const _noopQrlDEV: <T>(symbolName: string, opts: QRLDev, lexicalScopeCapture?: any[]) => QRL<T>;\n\n// @public\nexport type NoSerialize<T> = (T & {\n    __no_serialize__: true;\n}) | undefined;\n\n// @public\nexport const noSerialize: <T extends object | undefined>(input: T) => NoSerialize<T>;\n\n// @public (undocumented)\nexport type Numberish = number | `${number}`;\n\n// @public (undocumented)\nexport interface ObjectHTMLAttributes<T extends Element> extends Attrs<'object', T> {\n}\n\n// @public (undocumented)\nexport interface OlHTMLAttributes<T extends Element> extends Attrs<'ol', T> {\n}\n\n// @internal (undocumented)\nexport type _Only$<P> = {\n    [K in keyof P as K extends `${string}$` ? K : never]: _AllowPlainQrl<P[K]>;\n};\n\n// @public (undocumented)\nexport type OnRenderFn<PROPS> = (props: PROPS) => JSXOutput;\n\n// @public (undocumented)\nexport interface OnVisibleTaskOptions {\n    strategy?: VisibleTaskStrategy;\n}\n\n// @public (undocumented)\nexport interface OptgroupHTMLAttributes<T extends Element> extends Attrs<'optgroup', T> {\n}\n\n// @public (undocumented)\nexport interface OptionHTMLAttributes<T extends Element> extends Attrs<'option', T> {\n}\n\n// @public (undocumented)\nexport interface OutputHTMLAttributes<T extends Element> extends Attrs<'output', T> {\n}\n\n// @public @deprecated (undocumented)\nexport interface ParamHTMLAttributes<T extends Element> extends Attrs<'base', T, HTMLParamElement> {\n}\n\n// Warning: (ae-forgotten-export) The symbol \"QContext\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"ContainerState\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"GetObjID\" needs to be exported by the entry point index.d.ts\n//\n// @internal\nexport const _pauseFromContexts: (allContexts: QContext[], containerState: ContainerState, fallbackGetObjId?: GetObjID, textNodes?: Map<string, string>) => Promise<SnapshotResult>;\n\n// @alpha @deprecated (undocumented)\nexport const PrefetchGraph: (opts?: {\n    base?: string;\n    manifestHash?: string;\n    manifestURL?: string;\n    nonce?: string;\n}) => JSXOutput;\n\n// @alpha @deprecated (undocumented)\nexport const PrefetchServiceWorker: (opts: {\n    base?: string;\n    scope?: string;\n    path?: string;\n    verbose?: boolean;\n    fetchBundleGraph?: boolean;\n    nonce?: string;\n}) => JSXNode_2<'script'>;\n\n// @public (undocumented)\nexport interface ProgressHTMLAttributes<T extends Element> extends Attrs<'progress', T> {\n}\n\n// @public @deprecated (undocumented)\nexport type PropFnInterface<ARGS extends any[], RET> = {\n    __qwik_serializable__?: any;\n    (...args: ARGS): Promise<RET>;\n};\n\n// @public\nexport type PropFunction<T> = QRL<T>;\n\n// @public @deprecated (undocumented)\nexport type PropFunctionProps<PROPS extends Record<any, any>> = {\n    [K in keyof PROPS]: PROPS[K] extends undefined ? PROPS[K] : PROPS[K] extends ((...args: infer ARGS) => infer RET) | undefined ? PropFnInterface<ARGS, Awaited<RET>> : PROPS[K];\n};\n\n// Warning: (ae-forgotten-export) The symbol \"IsAny\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"ObjectProps\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport type PropsOf<COMP> = COMP extends string ? COMP extends keyof QwikIntrinsicElements ? QwikIntrinsicElements[COMP] : QwikIntrinsicElements['span'] : NonNullable<COMP> extends never ? never : COMP extends FunctionComponent<infer PROPS> ? PROPS extends Record<any, infer V> ? IsAny<V> extends true ? never : ObjectProps<PROPS> : COMP extends Component<infer OrigProps> ? ObjectProps<OrigProps> : PROPS : never;\n\n// Warning: (ae-forgotten-export) The symbol \"ComponentChildren\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-incompatible-release-tags) The symbol \"PublicProps\" is marked as @public, but its signature references \"_Only$\" which is marked as @internal\n//\n// @public\nexport type PublicProps<PROPS> = (PROPS extends Record<any, any> ? Omit<PROPS, `${string}$`> & _Only$<PROPS> : unknown extends PROPS ? {} : PROPS) & ComponentBaseProps & ComponentChildren<PROPS>;\n\n// Warning: (ae-forgotten-export) The symbol \"BivariantQrlFn\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"QrlArgs\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"QrlReturn\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport type QRL<TYPE = unknown> = {\n    __qwik_serializable__?: any;\n    __brand__QRL__: TYPE;\n    resolve(): Promise<TYPE>;\n    resolved: undefined | TYPE;\n    getCaptured(): unknown[] | null;\n    getSymbol(): string;\n    getHash(): string;\n    dev: QRLDev | null;\n} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;\n\n// @public\nexport const qrl: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, lexicalScopeCapture?: any[], stackOffset?: number) => QRL<T>;\n\n// Warning: (ae-internal-missing-underscore) The name \"qrlDEV\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal (undocumented)\nexport const qrlDEV: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, opts: QRLDev, lexicalScopeCapture?: any[]) => QRL<T>;\n\n// @beta\nexport type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[] | EventHandler<EV, EL>;\n\n// @alpha\nexport const _qrlSync: <TYPE extends Function>(fn: TYPE, serializedFn?: string) => SyncQRL<TYPE>;\n\n// @public (undocumented)\nexport interface QuoteHTMLAttributes<T extends Element> extends Attrs<'q', T> {\n}\n\n// @public @deprecated (undocumented)\nexport type QwikAnimationEvent<T = Element> = NativeAnimationEvent;\n\n// @public\nexport interface QwikAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL, false> {\n    // (undocumented)\n    class?: ClassList | undefined;\n}\n\n// @public @deprecated (undocumented)\nexport type QwikChangeEvent<T = Element> = Event;\n\n// @public @deprecated (undocumented)\nexport type QwikClipboardEvent<T = Element> = NativeClipboardEvent;\n\n// @public @deprecated (undocumented)\nexport type QwikCompositionEvent<T = Element> = NativeCompositionEvent;\n\n// @public (undocumented)\nexport interface QwikDOMAttributes extends DOMAttributes<Element> {\n}\n\n// @public @deprecated (undocumented)\nexport type QwikDragEvent<T = Element> = NativeDragEvent;\n\n// @public @deprecated (undocumented)\nexport type QwikFocusEvent<T = Element> = NativeFocusEvent;\n\n// @public\nexport type QwikHTMLElements = {\n    [tag in keyof HTMLElementTagNameMap]: Augmented<HTMLElementTagNameMap[tag], SpecialAttrs[tag]> & HTMLElementAttrs & QwikAttributes<HTMLElementTagNameMap[tag]>;\n};\n\n// @public\nexport type QwikIdleEvent = CustomEvent<{}>;\n\n// @public\nexport type QwikInitEvent = CustomEvent<{}>;\n\n// @public\nexport interface QwikIntrinsicElements extends QwikHTMLElements, QwikSVGElements {\n}\n\n// @public @deprecated (undocumented)\nexport type QwikInvalidEvent<T = Element> = Event;\n\n// @public (undocumented)\nnamespace QwikJSX {\n    // (undocumented)\n    type Element = JSXOutput;\n    // (undocumented)\n    interface ElementChildrenAttribute {\n        // (undocumented)\n        children: JSXChildren;\n    }\n    // (undocumented)\n    type ElementType = string | FunctionComponent<Record<any, any>>;\n    // Warning: (ae-forgotten-export) The symbol \"QwikIntrinsicAttributes\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    interface IntrinsicAttributes extends QwikIntrinsicAttributes {\n    }\n    // Warning: (ae-forgotten-export) The symbol \"LenientQwikElements\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    interface IntrinsicElements extends LenientQwikElements {\n    }\n}\nexport { QwikJSX as JSX }\nexport { QwikJSX }\n\n// @public @deprecated (undocumented)\nexport type QwikKeyboardEvent<T = Element> = NativeKeyboardEvent;\n\n// @public @deprecated (undocumented)\nexport type QwikMouseEvent<T = Element, E = NativeMouseEvent> = E;\n\n// @public @deprecated (undocumented)\nexport type QwikPointerEvent<T = Element> = NativePointerEvent;\n\n// @public @deprecated (undocumented)\nexport type QwikSubmitEvent<T = Element> = SubmitEvent;\n\n// @public\nexport type QwikSVGElements = {\n    [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: SVGProps<SVGElementTagNameMap[K]>;\n};\n\n// @public\nexport type QwikSymbolEvent = CustomEvent<{\n    symbol: string;\n    element: Element;\n    reqTime: number;\n    qBase?: string;\n    qManifest?: string;\n    qVersion?: string;\n    href?: string;\n}>;\n\n// @public @deprecated (undocumented)\nexport type QwikTouchEvent<T = Element> = NativeTouchEvent;\n\n// @public @deprecated (undocumented)\nexport type QwikTransitionEvent<T = Element> = NativeTransitionEvent;\n\n// @public @deprecated (undocumented)\nexport type QwikUIEvent<T = Element> = NativeUIEvent;\n\n// @public\nexport type QwikVisibleEvent = CustomEvent<IntersectionObserverEntry>;\n\n// @public @deprecated (undocumented)\nexport type QwikWheelEvent<T = Element> = NativeWheelEvent;\n\n// @public (undocumented)\nexport type ReadonlySignal<T = unknown> = Readonly<Signal<T>>;\n\n// @internal (undocumented)\nexport const _regSymbol: (symbol: any, hash: string) => any;\n\n// @public\nexport const render: (parent: Element | Document, jsxOutput: JSXOutput | FunctionComponent<any>, opts?: RenderOptions) => Promise<RenderResult>;\n\n// @public (undocumented)\nexport const RenderOnce: FunctionComponent<{\n    children?: unknown;\n    key?: string | number | null | undefined;\n}>;\n\n// @public (undocumented)\nexport interface RenderOptions {\n    // (undocumented)\n    serverData?: Record<string, any>;\n}\n\n// @public (undocumented)\nexport interface RenderResult {\n    // (undocumented)\n    cleanup(): void;\n}\n\n// @internal (undocumented)\nexport const _renderSSR: (node: JSXOutput, opts: RenderSSROptions) => Promise<void>;\n\n// @public (undocumented)\nexport interface RenderSSROptions {\n    // (undocumented)\n    base?: string;\n    // (undocumented)\n    beforeClose?: (contexts: QContext[], containerState: ContainerState, containsDynamic: boolean, textNodes: Map<string, string>) => Promise<JSXNode>;\n    // (undocumented)\n    beforeContent?: JSXNode<string>[];\n    // (undocumented)\n    containerAttributes: Record<string, string>;\n    // (undocumented)\n    containerTagName: string;\n    // (undocumented)\n    manifestHash: string;\n    // (undocumented)\n    serverData?: Record<string, any>;\n    // (undocumented)\n    stream: StreamWriter;\n}\n\n// @public\nexport const Resource: <T>(props: ResourceProps<T>) => JSXOutput;\n\n// @public (undocumented)\nexport interface ResourceCtx<T> {\n    // (undocumented)\n    cache(policyOrMilliseconds: number | 'immutable'): void;\n    // (undocumented)\n    cleanup(callback: () => void): void;\n    // (undocumented)\n    readonly previous: T | undefined;\n    // (undocumented)\n    readonly track: Tracker;\n}\n\n// @public (undocumented)\nexport type ResourceFn<T> = (ctx: ResourceCtx<unknown>) => ValueOrPromise<T>;\n\n// @public\nexport interface ResourceOptions {\n    timeout?: number;\n}\n\n// @public (undocumented)\nexport interface ResourcePending<T> {\n    // (undocumented)\n    readonly loading: boolean;\n    // (undocumented)\n    readonly value: Promise<T>;\n}\n\n// @public (undocumented)\nexport interface ResourceProps<T> {\n    // (undocumented)\n    onPending?: () => JSXOutput | Promise<JSXOutput>;\n    // (undocumented)\n    onRejected?: (reason: Error) => JSXOutput | Promise<JSXOutput>;\n    // (undocumented)\n    onResolved: (value: T) => JSXOutput | Promise<JSXOutput>;\n    // (undocumented)\n    readonly value: ResourceReturn<T> | Signal<Promise<T> | T> | Promise<T>;\n}\n\n// @public (undocumented)\nexport interface ResourceRejected<T> {\n    // (undocumented)\n    readonly loading: boolean;\n    // (undocumented)\n    readonly value: Promise<T>;\n}\n\n// @public (undocumented)\nexport interface ResourceResolved<T> {\n    // (undocumented)\n    readonly loading: boolean;\n    // (undocumented)\n    readonly value: Promise<T>;\n}\n\n// @public (undocumented)\nexport type ResourceReturn<T> = ResourcePending<T> | ResourceResolved<T> | ResourceRejected<T>;\n\n// @internal (undocumented)\nexport const _restProps: (props: Record<string, any>, omit: string[]) => Record<string, any>;\n\n// @public (undocumented)\nexport interface ScriptHTMLAttributes<T extends Element> extends Attrs<'script', T> {\n}\n\n// @public (undocumented)\nexport interface SelectHTMLAttributes<T extends Element> extends Attrs<'select', T> {\n}\n\n// @internal (undocumented)\nexport const _serializeData: (data: any, pureQRL?: boolean) => Promise<string>;\n\n// @public\nexport const setPlatform: (plt: CorePlatform) => CorePlatform;\n\n// @public\nexport interface Signal<T = any> {\n    // (undocumented)\n    value: T;\n}\n\n// @public (undocumented)\nexport type Size = number | string;\n\n// @public (undocumented)\nexport const SkipRender: JSXNode;\n\n// @public\nexport const Slot: FunctionComponent<{\n    name?: string;\n}>;\n\n// @public (undocumented)\nexport interface SlotHTMLAttributes<T extends Element> extends Attrs<'slot', T> {\n}\n\n// @public (undocumented)\nexport interface SnapshotListener {\n    // (undocumented)\n    el: Element;\n    // (undocumented)\n    key: string;\n    // (undocumented)\n    qrl: QRL<any>;\n}\n\n// @public (undocumented)\nexport type SnapshotMeta = Record<string, SnapshotMetaValue>;\n\n// @public (undocumented)\nexport interface SnapshotMetaValue {\n    // (undocumented)\n    c?: string;\n    // (undocumented)\n    h?: string;\n    // (undocumented)\n    s?: string;\n    // (undocumented)\n    w?: string;\n}\n\n// @public (undocumented)\nexport interface SnapshotResult {\n    // (undocumented)\n    funcs: string[];\n    // (undocumented)\n    mode: 'render' | 'listeners' | 'static';\n    // (undocumented)\n    objs: any[];\n    // (undocumented)\n    qrls: QRL[];\n    // Warning: (ae-forgotten-export) The symbol \"ResourceReturnInternal\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    resources: ResourceReturnInternal<any>[];\n    // (undocumented)\n    state: SnapshotState;\n}\n\n// @public (undocumented)\nexport interface SnapshotState {\n    // (undocumented)\n    ctx: SnapshotMeta;\n    // (undocumented)\n    objs: any[];\n    // (undocumented)\n    refs: Record<string, string>;\n    // (undocumented)\n    subs: any[];\n}\n\n// @public (undocumented)\nexport interface SourceHTMLAttributes<T extends Element> extends Attrs<'source', T> {\n}\n\n// @public (undocumented)\nexport const SSRComment: FunctionComponent<{\n    data: string;\n}>;\n\n// @public @deprecated (undocumented)\nexport const SSRHint: FunctionComponent<SSRHintProps>;\n\n// @public (undocumented)\nexport type SSRHintProps = {\n    dynamic?: boolean;\n};\n\n// @public (undocumented)\nexport const SSRRaw: FunctionComponent<{\n    data: string;\n}>;\n\n// @public (undocumented)\nexport const SSRStream: FunctionComponent<SSRStreamProps>;\n\n// @public (undocumented)\nexport const SSRStreamBlock: FunctionComponent<{\n    children?: any;\n}>;\n\n// @public (undocumented)\nexport type SSRStreamProps = {\n    children: AsyncGenerator<JSXChildren, void, any> | ((stream: StreamWriter) => Promise<void>) | (() => AsyncGenerator<JSXChildren, void, any>);\n};\n\n// @public (undocumented)\nexport type StreamWriter = {\n    write: (chunk: string) => void;\n};\n\n// @public (undocumented)\nexport interface StyleHTMLAttributes<T extends Element> extends Attrs<'style', T> {\n}\n\n// @public\nexport interface SVGAttributes<T extends Element = Element> extends AriaAttributes {\n    // (undocumented)\n    'accent-height'?: number | string | undefined;\n    // (undocumented)\n    'alignment-baseline'?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit' | undefined;\n    // (undocumented)\n    'arabic-form'?: 'initial' | 'medial' | 'terminal' | 'isolated' | undefined;\n    // (undocumented)\n    'baseline-shift'?: number | string | undefined;\n    // (undocumented)\n    'cap-height'?: number | string | undefined;\n    // (undocumented)\n    'clip-path'?: string | undefined;\n    // (undocumented)\n    'clip-rule'?: number | string | undefined;\n    // (undocumented)\n    'color-interpolation'?: number | string | undefined;\n    // (undocumented)\n    'color-interpolation-filters'?: 'auto' | 's-rGB' | 'linear-rGB' | 'inherit' | undefined;\n    // (undocumented)\n    'color-profile'?: number | string | undefined;\n    // (undocumented)\n    'color-rendering'?: number | string | undefined;\n    // (undocumented)\n    'dominant-baseline'?: number | string | undefined;\n    // (undocumented)\n    'edge-mode'?: number | string | undefined;\n    // (undocumented)\n    'enable-background'?: number | string | undefined;\n    // (undocumented)\n    'fill-opacity'?: number | string | undefined;\n    // (undocumented)\n    'fill-rule'?: 'nonzero' | 'evenodd' | 'inherit' | undefined;\n    // (undocumented)\n    'flood-color'?: number | string | undefined;\n    // (undocumented)\n    'flood-opacity'?: number | string | undefined;\n    // (undocumented)\n    'font-family'?: string | undefined;\n    // (undocumented)\n    'font-size'?: number | string | undefined;\n    // (undocumented)\n    'font-size-adjust'?: number | string | undefined;\n    // (undocumented)\n    'font-stretch'?: number | string | undefined;\n    // (undocumented)\n    'font-style'?: number | string | undefined;\n    // (undocumented)\n    'font-variant'?: number | string | undefined;\n    // (undocumented)\n    'font-weight'?: number | string | undefined;\n    // (undocumented)\n    'glyph-name'?: number | string | undefined;\n    // (undocumented)\n    'glyph-orientation-horizontal'?: number | string | undefined;\n    // (undocumented)\n    'glyph-orientation-vertical'?: number | string | undefined;\n    // (undocumented)\n    'horiz-adv-x'?: number | string | undefined;\n    // (undocumented)\n    'horiz-origin-x'?: number | string | undefined;\n    // (undocumented)\n    'image-rendering'?: number | string | undefined;\n    // (undocumented)\n    'letter-spacing'?: number | string | undefined;\n    // (undocumented)\n    'lighting-color'?: number | string | undefined;\n    // (undocumented)\n    'marker-end'?: string | undefined;\n    // (undocumented)\n    'marker-mid'?: string | undefined;\n    // (undocumented)\n    'marker-start'?: string | undefined;\n    // (undocumented)\n    'overline-position'?: number | string | undefined;\n    // (undocumented)\n    'overline-thickness'?: number | string | undefined;\n    // (undocumented)\n    'paint-order'?: number | string | undefined;\n    // (undocumented)\n    'pointer-events'?: number | string | undefined;\n    // (undocumented)\n    'rendering-intent'?: number | string | undefined;\n    // (undocumented)\n    'shape-rendering'?: number | string | undefined;\n    // (undocumented)\n    'stop-color'?: string | undefined;\n    // (undocumented)\n    'stop-opacity'?: number | string | undefined;\n    // (undocumented)\n    'strikethrough-position'?: number | string | undefined;\n    // (undocumented)\n    'strikethrough-thickness'?: number | string | undefined;\n    // (undocumented)\n    'stroke-dasharray'?: string | number | undefined;\n    // (undocumented)\n    'stroke-dashoffset'?: string | number | undefined;\n    // (undocumented)\n    'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit' | undefined;\n    // (undocumented)\n    'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit' | undefined;\n    // (undocumented)\n    'stroke-miterlimit'?: string | undefined;\n    // (undocumented)\n    'stroke-opacity'?: number | string | undefined;\n    // (undocumented)\n    'stroke-width'?: number | string | undefined;\n    // (undocumented)\n    'text-anchor'?: string | undefined;\n    // (undocumented)\n    'text-decoration'?: number | string | undefined;\n    // (undocumented)\n    'text-rendering'?: number | string | undefined;\n    // (undocumented)\n    'underline-position'?: number | string | undefined;\n    // (undocumented)\n    'underline-thickness'?: number | string | undefined;\n    // (undocumented)\n    'unicode-bidi'?: number | string | undefined;\n    // (undocumented)\n    'unicode-range'?: number | string | undefined;\n    // (undocumented)\n    'units-per-em'?: number | string | undefined;\n    // (undocumented)\n    'v-alphabetic'?: number | string | undefined;\n    // (undocumented)\n    'v-hanging'?: number | string | undefined;\n    // (undocumented)\n    'v-ideographic'?: number | string | undefined;\n    // (undocumented)\n    'v-mathematical'?: number | string | undefined;\n    // (undocumented)\n    'vector-effect'?: number | string | undefined;\n    // (undocumented)\n    'vert-adv-y'?: number | string | undefined;\n    // (undocumented)\n    'vert-origin-x'?: number | string | undefined;\n    // (undocumented)\n    'vert-origin-y'?: number | string | undefined;\n    // (undocumented)\n    'word-spacing'?: number | string | undefined;\n    // (undocumented)\n    'writing-mode'?: number | string | undefined;\n    // (undocumented)\n    'x-channel-selector'?: string | undefined;\n    // (undocumented)\n    'x-height'?: number | string | undefined;\n    // (undocumented)\n    'xlink:actuate'?: string | undefined;\n    // (undocumented)\n    'xlink:arcrole'?: string | undefined;\n    // (undocumented)\n    'xlink:href'?: string | undefined;\n    // (undocumented)\n    'xlink:role'?: string | undefined;\n    // (undocumented)\n    'xlink:show'?: string | undefined;\n    // (undocumented)\n    'xlink:title'?: string | undefined;\n    // (undocumented)\n    'xlink:type'?: string | undefined;\n    // (undocumented)\n    'xml:base'?: string | undefined;\n    // (undocumented)\n    'xml:lang'?: string | undefined;\n    // (undocumented)\n    'xml:space'?: string | undefined;\n    // (undocumented)\n    'xmlns:xlink'?: string | undefined;\n    // (undocumented)\n    accumulate?: 'none' | 'sum' | undefined;\n    // (undocumented)\n    additive?: 'replace' | 'sum' | undefined;\n    // (undocumented)\n    allowReorder?: 'no' | 'yes' | undefined;\n    // (undocumented)\n    alphabetic?: number | string | undefined;\n    // (undocumented)\n    amplitude?: number | string | undefined;\n    // (undocumented)\n    ascent?: number | string | undefined;\n    // (undocumented)\n    attributeName?: string | undefined;\n    // (undocumented)\n    attributeType?: string | undefined;\n    // (undocumented)\n    autoReverse?: Booleanish | undefined;\n    // (undocumented)\n    azimuth?: number | string | undefined;\n    // (undocumented)\n    baseFrequency?: number | string | undefined;\n    // (undocumented)\n    baseProfile?: number | string | undefined;\n    // (undocumented)\n    bbox?: number | string | undefined;\n    // (undocumented)\n    begin?: number | string | undefined;\n    // (undocumented)\n    bias?: number | string | undefined;\n    // (undocumented)\n    by?: number | string | undefined;\n    // (undocumented)\n    calcMode?: number | string | undefined;\n    // (undocumented)\n    clip?: number | string | undefined;\n    // (undocumented)\n    clipPathUnits?: number | string | undefined;\n    // (undocumented)\n    color?: string | undefined;\n    // (undocumented)\n    contentScriptType?: number | string | undefined;\n    // (undocumented)\n    contentStyleType?: number | string | undefined;\n    // (undocumented)\n    crossOrigin?: HTMLCrossOriginAttribute;\n    // (undocumented)\n    cursor?: number | string;\n    // (undocumented)\n    cx?: number | string | undefined;\n    // (undocumented)\n    cy?: number | string | undefined;\n    // (undocumented)\n    d?: string | undefined;\n    // (undocumented)\n    decelerate?: number | string | undefined;\n    // (undocumented)\n    descent?: number | string | undefined;\n    // (undocumented)\n    diffuseConstant?: number | string | undefined;\n    // (undocumented)\n    direction?: number | string | undefined;\n    // (undocumented)\n    display?: number | string | undefined;\n    // (undocumented)\n    divisor?: number | string | undefined;\n    // (undocumented)\n    dur?: number | string | undefined;\n    // (undocumented)\n    dx?: number | string | undefined;\n    // (undocumented)\n    dy?: number | string | undefined;\n    // (undocumented)\n    elevation?: number | string | undefined;\n    // (undocumented)\n    end?: number | string | undefined;\n    // (undocumented)\n    exponent?: number | string | undefined;\n    // (undocumented)\n    externalResourcesRequired?: number | string | undefined;\n    // (undocumented)\n    fill?: string | undefined;\n    // (undocumented)\n    filter?: string | undefined;\n    // (undocumented)\n    filterRes?: number | string | undefined;\n    // (undocumented)\n    filterUnits?: number | string | undefined;\n    // (undocumented)\n    focusable?: number | string | undefined;\n    // (undocumented)\n    format?: number | string | undefined;\n    // (undocumented)\n    fr?: number | string | undefined;\n    // (undocumented)\n    from?: number | string | undefined;\n    // (undocumented)\n    fx?: number | string | undefined;\n    // (undocumented)\n    fy?: number | string | undefined;\n    // (undocumented)\n    g1?: number | string | undefined;\n    // (undocumented)\n    g2?: number | string | undefined;\n    // (undocumented)\n    glyphRef?: number | string | undefined;\n    // (undocumented)\n    gradientTransform?: string | undefined;\n    // (undocumented)\n    gradientUnits?: string | undefined;\n    // (undocumented)\n    hanging?: number | string | undefined;\n    // (undocumented)\n    height?: Size | undefined;\n    // (undocumented)\n    href?: string | undefined;\n    // (undocumented)\n    id?: string | undefined;\n    // (undocumented)\n    ideographic?: number | string | undefined;\n    // (undocumented)\n    in?: string | undefined;\n    // (undocumented)\n    in2?: number | string | undefined;\n    // (undocumented)\n    intercept?: number | string | undefined;\n    // (undocumented)\n    k?: number | string | undefined;\n    // (undocumented)\n    k1?: number | string | undefined;\n    // (undocumented)\n    k2?: number | string | undefined;\n    // (undocumented)\n    k3?: number | string | undefined;\n    // (undocumented)\n    k4?: number | string | undefined;\n    // (undocumented)\n    kernelMatrix?: number | string | undefined;\n    // (undocumented)\n    kernelUnitLength?: number | string | undefined;\n    // (undocumented)\n    kerning?: number | string | undefined;\n    // (undocumented)\n    keyPoints?: number | string | undefined;\n    // (undocumented)\n    keySplines?: number | string | undefined;\n    // (undocumented)\n    keyTimes?: number | string | undefined;\n    // (undocumented)\n    lang?: string | undefined;\n    // (undocumented)\n    lengthAdjust?: number | string | undefined;\n    // (undocumented)\n    limitingConeAngle?: number | string | undefined;\n    // (undocumented)\n    local?: number | string | undefined;\n    // (undocumented)\n    markerHeight?: number | string | undefined;\n    // (undocumented)\n    markerUnits?: number | string | undefined;\n    // (undocumented)\n    markerWidth?: number | string | undefined;\n    // (undocumented)\n    mask?: string | undefined;\n    // (undocumented)\n    maskContentUnits?: number | string | undefined;\n    // (undocumented)\n    maskUnits?: number | string | undefined;\n    // (undocumented)\n    mathematical?: number | string | undefined;\n    // (undocumented)\n    max?: number | string | undefined;\n    // (undocumented)\n    media?: string | undefined;\n    // (undocumented)\n    method?: string | undefined;\n    // (undocumented)\n    min?: number | string | undefined;\n    // (undocumented)\n    mode?: number | string | undefined;\n    // (undocumented)\n    name?: string | undefined;\n    // (undocumented)\n    numOctaves?: number | string | undefined;\n    // (undocumented)\n    offset?: number | string | undefined;\n    // (undocumented)\n    opacity?: number | string | undefined;\n    // (undocumented)\n    operator?: number | string | undefined;\n    // (undocumented)\n    order?: number | string | undefined;\n    // (undocumented)\n    orient?: number | string | undefined;\n    // (undocumented)\n    orientation?: number | string | undefined;\n    // (undocumented)\n    origin?: number | string | undefined;\n    // (undocumented)\n    overflow?: number | string | undefined;\n    // (undocumented)\n    panose1?: number | string | undefined;\n    // (undocumented)\n    path?: string | undefined;\n    // (undocumented)\n    pathLength?: number | string | undefined;\n    // (undocumented)\n    patternContentUnits?: string | undefined;\n    // (undocumented)\n    patternTransform?: number | string | undefined;\n    // (undocumented)\n    patternUnits?: string | undefined;\n    // (undocumented)\n    points?: string | undefined;\n    // (undocumented)\n    pointsAtX?: number | string | undefined;\n    // (undocumented)\n    pointsAtY?: number | string | undefined;\n    // (undocumented)\n    pointsAtZ?: number | string | undefined;\n    // (undocumented)\n    preserveAlpha?: number | string | undefined;\n    // (undocumented)\n    preserveAspectRatio?: string | undefined;\n    // (undocumented)\n    primitiveUnits?: number | string | undefined;\n    // (undocumented)\n    r?: number | string | undefined;\n    // (undocumented)\n    radius?: number | string | undefined;\n    // (undocumented)\n    refX?: number | string | undefined;\n    // (undocumented)\n    refY?: number | string | undefined;\n    // (undocumented)\n    repeatCount?: number | string | undefined;\n    // (undocumented)\n    repeatDur?: number | string | undefined;\n    // (undocumented)\n    requiredextensions?: number | string | undefined;\n    // (undocumented)\n    requiredFeatures?: number | string | undefined;\n    // (undocumented)\n    restart?: number | string | undefined;\n    // (undocumented)\n    result?: string | undefined;\n    // (undocumented)\n    role?: string | undefined;\n    // (undocumented)\n    rotate?: number | string | undefined;\n    // (undocumented)\n    rx?: number | string | undefined;\n    // (undocumented)\n    ry?: number | string | undefined;\n    // (undocumented)\n    scale?: number | string | undefined;\n    // (undocumented)\n    seed?: number | string | undefined;\n    // (undocumented)\n    slope?: number | string | undefined;\n    // (undocumented)\n    spacing?: number | string | undefined;\n    // (undocumented)\n    specularConstant?: number | string | undefined;\n    // (undocumented)\n    specularExponent?: number | string | undefined;\n    // (undocumented)\n    speed?: number | string | undefined;\n    // (undocumented)\n    spreadMethod?: string | undefined;\n    // (undocumented)\n    startOffset?: number | string | undefined;\n    // (undocumented)\n    stdDeviation?: number | string | undefined;\n    // (undocumented)\n    stemh?: number | string | undefined;\n    // (undocumented)\n    stemv?: number | string | undefined;\n    // (undocumented)\n    stitchTiles?: number | string | undefined;\n    // (undocumented)\n    string?: number | string | undefined;\n    // (undocumented)\n    stroke?: string | undefined;\n    // (undocumented)\n    style?: CSSProperties | string | undefined;\n    // (undocumented)\n    surfaceScale?: number | string | undefined;\n    // (undocumented)\n    systemLanguage?: number | string | undefined;\n    // (undocumented)\n    tabindex?: number | undefined;\n    // (undocumented)\n    tableValues?: number | string | undefined;\n    // (undocumented)\n    target?: string | undefined;\n    // (undocumented)\n    targetX?: number | string | undefined;\n    // (undocumented)\n    targetY?: number | string | undefined;\n    // (undocumented)\n    textLength?: number | string | undefined;\n    // (undocumented)\n    to?: number | string | undefined;\n    // (undocumented)\n    transform?: string | undefined;\n    // (undocumented)\n    type?: string | undefined;\n    // (undocumented)\n    u1?: number | string | undefined;\n    // (undocumented)\n    u2?: number | string | undefined;\n    // (undocumented)\n    unicode?: number | string | undefined;\n    // (undocumented)\n    values?: string | undefined;\n    // (undocumented)\n    version?: string | undefined;\n    // (undocumented)\n    viewBox?: string | undefined;\n    // (undocumented)\n    viewTarget?: number | string | undefined;\n    // (undocumented)\n    visibility?: number | string | undefined;\n    // (undocumented)\n    width?: Size | undefined;\n    // (undocumented)\n    widths?: number | string | undefined;\n    // (undocumented)\n    x?: number | string | undefined;\n    // (undocumented)\n    x1?: number | string | undefined;\n    // (undocumented)\n    x2?: number | string | undefined;\n    // (undocumented)\n    xmlns?: string | undefined;\n    // (undocumented)\n    y?: number | string | undefined;\n    // (undocumented)\n    y1?: number | string | undefined;\n    // (undocumented)\n    y2?: number | string | undefined;\n    // (undocumented)\n    yChannelSelector?: string | undefined;\n    // (undocumented)\n    z?: number | string | undefined;\n    // (undocumented)\n    zoomAndPan?: string | undefined;\n}\n\n// @public (undocumented)\nexport interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T> {\n}\n\n// @alpha\nexport const sync$: <T extends Function>(fn: T) => SyncQRL<T>;\n\n// @alpha (undocumented)\nexport interface SyncQRL<TYPE extends Function = any> extends QRL<TYPE> {\n    // (undocumented)\n    __brand__SyncQRL__: TYPE;\n    (...args: TYPE extends (...args: infer ARGS) => any ? ARGS : never): TYPE extends (...args: any[]) => infer RETURN ? RETURN : never;\n    // (undocumented)\n    dev: QRLDev | null;\n    // (undocumented)\n    resolved: TYPE;\n}\n\n// @public (undocumented)\nexport interface TableHTMLAttributes<T extends Element> extends Attrs<'table', T> {\n}\n\n// @public (undocumented)\nexport interface TaskCtx {\n    // (undocumented)\n    cleanup(callback: () => void): void;\n    // (undocumented)\n    track: Tracker;\n}\n\n// @public (undocumented)\nexport type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => void)>;\n\n// @public (undocumented)\nexport interface TdHTMLAttributes<T extends Element> extends Attrs<'td', T> {\n}\n\n// @public (undocumented)\nexport interface TextareaHTMLAttributes<T extends Element> extends Attrs<'textarea', T> {\n}\n\n// @public (undocumented)\nexport interface ThHTMLAttributes<T extends Element> extends Attrs<'tr', T> {\n}\n\n// @public (undocumented)\nexport interface TimeHTMLAttributes<T extends Element> extends Attrs<'time', T> {\n}\n\n// @public (undocumented)\nexport interface TitleHTMLAttributes<T extends Element> extends Attrs<'title', T> {\n}\n\n// @public\nexport interface Tracker {\n    <T>(fn: () => T): T;\n    <T extends object>(obj: T): T extends Signal<infer U> ? U : T;\n}\n\n// @public (undocumented)\nexport interface TrackHTMLAttributes<T extends Element> extends Attrs<'track', T> {\n}\n\n// @public\nexport const untrack: <T, A extends any[]>(expr: ((...args: A) => T) | Signal<T> | T, ...args: A) => T;\n\n// @public\nexport const unwrapStore: <T>(proxy: T) => T;\n\n// @public\nexport const useComputed$: <T>(qrl: ComputedFn<T>) => Signal<Awaited<T>>;\n\n// @public (undocumented)\nexport const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>) => Signal<Awaited<T>>;\n\n// @public @deprecated\nexport const useConstant: <T>(value: (() => T) | T) => T;\n\n// Warning: (ae-forgotten-export) The symbol \"UseContext\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport const useContext: UseContext;\n\n// @public\nexport const useContextProvider: <STATE>(context: ContextId<STATE>, newValue: STATE) => void;\n\n// @public (undocumented)\nexport const useErrorBoundary: () => ErrorBoundaryStore;\n\n// @public (undocumented)\nexport const useId: () => string;\n\n// Warning: (ae-internal-missing-underscore) The name \"useLexicalScope\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal\nexport const useLexicalScope: <VARS extends any[]>() => VARS;\n\n// Warning: (ae-forgotten-export) The symbol \"EventQRL\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void;\n\n// @public\nexport const useOnDocument: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void;\n\n// @public\nexport const useOnWindow: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => void;\n\n// @public\nexport const useResource$: <T>(generatorFn: ResourceFn<T>, opts?: ResourceOptions) => ResourceReturn<T>;\n\n// @public\nexport const useResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: ResourceOptions) => ResourceReturn<T>;\n\n// @public (undocumented)\nexport function useServerData<T>(key: string): T | undefined;\n\n// @public (undocumented)\nexport function useServerData<T, B = T>(key: string, defaultValue: B): T | B;\n\n// @public (undocumented)\nexport interface UseSignal {\n    // (undocumented)\n    <T>(): Signal<T | undefined>;\n    // (undocumented)\n    <T>(value: T | (() => T)): Signal<T>;\n}\n\n// @public\nexport const useSignal: UseSignal;\n\n// @public\nexport const useStore: <STATE extends object>(initialState: STATE | (() => STATE), opts?: UseStoreOptions) => STATE;\n\n// @public (undocumented)\nexport interface UseStoreOptions {\n    deep?: boolean;\n    reactive?: boolean;\n}\n\n// @public\nexport const useStyles$: (qrl: string) => void;\n\n// @public\nexport const useStylesQrl: (styles: QRL<string>) => void;\n\n// @public\nexport const useStylesScoped$: (qrl: string) => UseStylesScoped;\n\n// @public (undocumented)\nexport interface UseStylesScoped {\n    // (undocumented)\n    scopeId: string;\n}\n\n// @public\nexport const useStylesScopedQrl: (styles: QRL<string>) => UseStylesScoped;\n\n// @public\nexport const useTask$: (qrl: TaskFn, opts?: UseTaskOptions | undefined) => void;\n\n// @public @deprecated (undocumented)\nexport interface UseTaskOptions {\n    eagerness?: EagernessOptions;\n}\n\n// @public\nexport const useTaskQrl: (qrl: QRL<TaskFn>, opts?: UseTaskOptions) => void;\n\n// @public\nexport const useVisibleTask$: (qrl: TaskFn, opts?: OnVisibleTaskOptions | undefined) => void;\n\n// @public\nexport const useVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void;\n\n// @public\nexport type ValueOrPromise<T> = T | Promise<T>;\n\n// @internal (undocumented)\nexport const _verifySerializable: <T>(value: T, preMessage?: string) => T;\n\n// @public\nexport const version: string;\n\n// @public (undocumented)\nexport interface VideoHTMLAttributes<T extends Element> extends Attrs<'video', T> {\n}\n\n// @public (undocumented)\nexport type VisibleTaskStrategy = 'intersection-observer' | 'document-ready' | 'document-idle';\n\n// @internal (undocumented)\nexport const _waitUntilRendered: (elm: Element) => Promise<void>;\n\n// @internal (undocumented)\nexport const _weakSerialize: <T extends object>(input: T) => Partial<T>;\n\n// @public @deprecated (undocumented)\nexport interface WebViewHTMLAttributes<T extends Element> extends HTMLAttributes<T> {\n    // (undocumented)\n    allowFullScreen?: boolean | undefined;\n    // (undocumented)\n    allowpopups?: boolean | undefined;\n    // (undocumented)\n    autoFocus?: boolean | undefined;\n    // (undocumented)\n    autosize?: boolean | undefined;\n    // (undocumented)\n    blinkfeatures?: string | undefined;\n    // (undocumented)\n    disableblinkfeatures?: string | undefined;\n    // (undocumented)\n    disableguestresize?: boolean | undefined;\n    // (undocumented)\n    disablewebsecurity?: boolean | undefined;\n    // (undocumented)\n    guestinstance?: string | undefined;\n    // (undocumented)\n    httpreferrer?: string | undefined;\n    // (undocumented)\n    nodeintegration?: boolean | undefined;\n    // (undocumented)\n    partition?: string | undefined;\n    // (undocumented)\n    plugins?: boolean | undefined;\n    // (undocumented)\n    preload?: string | undefined;\n    // (undocumented)\n    src?: string | undefined;\n    // (undocumented)\n    useragent?: string | undefined;\n    // (undocumented)\n    webpreferences?: string | undefined;\n}\n\n// Warning: (ae-internal-missing-underscore) The name \"withLocale\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal\nexport function withLocale<T>(locale: string, fn: () => T): T;\n\n// @internal (undocumented)\nexport const _wrapProp: <T extends Record<any, any>, P extends keyof T>(obj: T, prop: P) => any;\n\n// @internal (undocumented)\nexport const _wrapSignal: <T extends Record<any, any>, P extends keyof T>(obj: T, prop: P) => any;\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik/src/core/readme.md",
    "content": "# API DOCS for: `component.public.ts`\n\n---\n\n# `component`\n\nDeclare a Qwik component that can be used to create UI.\n\nUse `component$` to declare a Qwik component. A Qwik component is a special kind of component that allows the Qwik framework to lazy load and execute the component independently of other Qwik components as well as lazy load the component's life-cycle hooks and event handlers.\n\nSide note: You can also declare regular (standard JSX) components that will have standard synchronous behavior.\n\nQwik component is a facade that describes how the component should be used without forcing the implementation of the component to be eagerly loaded. A minimum Qwik definition consists of:\n\n### Example\n\nAn example showing how to create a counter component:\n\n<docs code=\"./examples.tsx#component\"/>\n\n- `component$` is how a component gets declared.\n- `{ value?: number; step?: number }` declares the public (props) interface of the component.\n- `{ count: number }` declares the private (state) interface of the component.\n\nThe above can then be used like so:\n\n<docs code=\"./examples.tsx#component-usage\"/>\n\nSee also: `component`, `useCleanup`, `onResume`, `onPause`, `useOn`, `useOnDocument`, `useOnWindow`, `useStyles`\n\n@public\n\n# `useStore`\n\nCreates an object that Qwik can track across serializations.\n\nUse `useStore` to create a state for your application. The returned object is a proxy that has a unique ID. The ID of the object is used in the `QRL`s to refer to the store.\n\n### Example\n\nExample showing how `useStore` is used in Counter example to keep track of the count.\n\n<docs code=\"./examples.tsx#use-store\"/>\n\n@public\n\n# `useResource`\n\nThis method works like an async memoized function that runs whenever some tracked value changes and returns some data.\n\n`useResource` however returns immediate a `ResourceReturn` object that contains the data and a state that indicates if the data is available or not.\n\nThe status can be one of the following:\n\n- `pending` - the data is not yet available.\n- `resolved` - the data is available.\n- `rejected` - the data is not available due to an error or timeout.\n\nAvoid using a `try/catch` statement in `useResource$`. If you catch the error instead of passing it, the resource status will never be `rejected`.\n\n### Example\n\nExample showing how `useResource` to perform a fetch to request the weather, whenever the input city name changes.\n\n<docs code=\"./examples.tsx#use-resource\"/>\n\n@see Resource\n@see ResourceReturn\n\n@public\n\n# `useTask`\n\nReruns the `taskFn` when the observed inputs change.\n\nUse `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when those inputs change.\n\nThe `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs` function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to rerun.\n\n@see `Tracker`\n\n@public\n\n### Example\n\nThe `useTask` function is used to observe the `store.count` property. Any changes to the `store.count` cause the `taskFn` to execute which in turn updates the `store.doubleCount` to the double of `store.count`.\n\n<docs code=\"./examples.tsx#use-task\"/>\n\n@param task - Function which should be re-executed when changes to the inputs are detected\n@public\n\n# `useVisibleTask`\n\n```tsx\nconst Timer = component$(() => {\n  const store = useStore({\n    count: 0,\n  });\n\n  useVisibleTask$(() => {\n    // Only runs in the client\n    const timer = setInterval(() => {\n      store.count++;\n    }, 500);\n    return () => {\n      clearInterval(timer);\n    };\n  });\n\n  return <div>{store.count}</div>;\n});\n```\n\n@public\n\n# `Tracker`\n\nUsed to signal to Qwik which state should be watched for changes.\n\nThe `Tracker` is passed into the `taskFn` of `useTask`. It is intended to be used to wrap state objects in a read proxy which signals to Qwik which properties should be watched for changes. A change to any of the properties causes the `taskFn` to rerun.\n\n### Example\n\nThe `obs` passed into the `taskFn` is used to mark `state.count` as a property of interest. Any changes to the `state.count` property will cause the `taskFn` to rerun.\n\n<docs code=\"./examples.tsx#use-task-simple\"/>\n\n@see `useTask`\n\n@public\n\n# `useStyles`\n\nA lazy-loadable reference to a component's styles.\n\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\n\n<docs code=\"./examples.tsx#use-styles\"/>\n\n@see `useStylesScoped`\n\n@public\n\n# `useStylesScoped`\n\nA lazy-loadable reference to a component's styles, that is scoped to the component.\n\nComponent styles allow Qwik to lazy load the style information for the component only when needed. (And avoid double loading it in case of SSR hydration.)\n\n<docs code=\"./examples.tsx#use-styles-scoped\"/>\n\n@see `useStyles`\n\n@public\n\n# `useOn`\n\nRegister a listener on the current component's host element.\n\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.\n\n@see `useOn`, `useOnWindow`, `useOnDocument`.\n\n@public\n\n# `useOnWindow`\n\nRegister a listener on `window`.\n\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX.\n\n@see `useOn`, `useOnWindow`, `useOnDocument`.\n\n<docs code=\"./examples.tsx#use-on-window\"/>\n\n@public\n\n# `useOnDocument`\n\nRegister a listener on `document`.\n\nUsed to programmatically add event listeners. Useful from custom `use*` methods, which do not have access to the JSX.\n\n@see `useOn`, `useOnWindow`, `useOnDocument`.\n\n<docs code=\"./examples.tsx#use-on-document\"/>\n\n@public\n\n# `noSerialize`\n\nMarks a property on a store as non-serializable.\n\nAt times it is necessary to store values on a store that are non-serializable. Normally this is a runtime error as Store wants to eagerly report when a non-serializable property is assigned to it.\n\nYou can use `noSerialize()` to mark a value as non-serializable. The value is persisted in the Store but does not survive serialization. The implication is that when your application is resumed, the value of this object will be `undefined`. You will be responsible for recovering from this.\n\nSee: [noSerialize Tutorial](http://qwik.dev/tutorial/store/no-serialize)\n\n@public\n\n# `useLexicalScope`\n\nUsed by the Qwik Optimizer to restore the lexically scoped variables.\n\nThis method should not be present in the application source code.\n\nNOTE: `useLexicalScope` method can only be used in the synchronous portion of the callback (before any `await` statements.)\n\n@internal\n\n# `QRL`\n\nThe `QRL` type represents a lazy-loadable AND serializable resource.\n\nQRL stands for Qwik URL.\n\nUse `QRL` when you want to refer to a lazy-loaded resource. `QRL`s are most often used for code (functions) but can also be used for other resources such as `string`s in the case of styles.\n\n`QRL` is an opaque token that is generated by the Qwik Optimizer. (Do not rely on any properties in `QRL` as it may change between versions.)\n\n## Creating `QRL` references\n\nCreating `QRL` is done using `$(...)` function. `$(...)` is a special marker for the Qwik Optimizer that marks that the code should be extracted into a lazy-loaded symbol.\n\n<docs code=\"./examples.tsx#qrl-usage-$\"/>\n\nIn the above code, the Qwik Optimizer detects `$(...)` and transforms the code as shown below:\n\n<docs code=\"./examples.tsx#qrl-usage-$-optimized\"/>\n\nNOTE: `qrl(...)` is a result of Qwik Optimizer transformation. You should never have to invoke this function directly in your application. The `qrl(...)` function should be invoked only after the Qwik Optimizer transformation.\n\n## Using `QRL`s\n\nUse `QRL` type in your application when you want to get a lazy-loadable reference to a resource (most likely a function).\n\n<docs code=\"./examples.tsx#qrl-usage-type\"/>\n\nIn the above example, the way to think about the code is that you are not asking for a callback function but rather a reference to a lazy-loadable callback function. Specifically, the function loading should be delayed until it is actually needed. In the above example, the function would not load until after a `mousemove` event on `document` fires.\n\n## Resolving `QRL` references\n\nAt times it may be necessary to resolve a `QRL` reference to the actual value. This can be performed using `QRL.resolve(..)` function.\n\n<docs code=\"./examples.tsx#qrl-usage-import\"/>\n\nNOTE: `element` is needed because `QRL`s are relative and need a base location to resolve against. The base location is encoded in the HTML in the form of `<div q:base=\"/url\">`.\n\n## `QRL.resolved`\n\nOnce `QRL.resolve()` returns, the value is stored under `QRL.resolved`. This allows the value to be used without having to await `QRL.resolve()` again.\n\n## Question: Why not just use `import()`?\n\nAt first glance, `QRL` serves the same purpose as `import()`. However, there are three subtle differences that need to be taken into account.\n\n1. `QRL`s must be serializable into HTML.\n2. `QRL`s must be resolved by framework relative to `q:base`.\n3. `QRL`s must be able to capture lexically scoped variables.\n4. `QRL`s encapsulate the difference between running with and without Qwik Optimizer.\n5. `QRL`s allow expressing lazy-loaded boundaries without thinking about chunk and symbol names.\n\nLet's assume that you intend to write code such as this:\n\n```tsx\nreturn <button onClick={() => (await import('./chunk-abc.js')).onClick}>\n```\n\nThe above code needs to be serialized into DOM such as:\n\n```\n<div q:base=\"/build/\">\n  <button on:click=\"./chunk-abc.js#onClick\">...</button>\n</div>\n```\n\n1. Notice there is no easy way to extract chunk (`./chunk-abc.js`) and symbol (`onClick`) into HTML.\n2. Notice that even if you could extract it, the `import('./chunk-abc.js')` would become relative to where the `import()` file is declared. Because it is our framework doing the load, the `./chunk-abc.js` would become relative to the framework file. This is not correct, as it should be relative to the original file generated by the bundler.\n3. Next, the framework needs to resolve the `./chunk-abc.js` and needs a base location that is encoded in the HTML.\n4. The QRL needs to be able to capture lexically scoped variables. (`import()` only allows loading top-level symbols which don't capture variables.)\n5. As a developer, you don't want to think about `import` and naming the chunks and symbols. You just want to say: \"this should be lazy.\"\n\nThese are the main reasons why Qwik introduces its own concept of `QRL`.\n\n@see `$`\n\n@public\n\n# `$`\n\nQwik Optimizer marker function.\n\nUse `$(...)` to tell Qwik Optimizer to extract the expression in `$(...)` into a lazy-loadable resource referenced by `QRL`.\n\n@see `implicit$FirstArg` for additional `____$(...)` rules.\n\nIn this example, `$(...)` is used to capture the callback function of `onmousemove` into a lazy-loadable reference. This allows the code to refer to the function without actually loading the function. In this example, the callback function does not get loaded until `mousemove` event fires.\n\n<docs code=\"./examples.tsx#qrl-usage-$\"/>\n\nIn this code, the Qwik Optimizer detects `$(...)` and transforms the code into:\n\n<docs code=\"./examples.tsx#qrl-usage-$-optimized\"/>\n\n## Special Rules\n\nThe Qwik Optimizer places special rules on functions that can be lazy-loaded.\n\n1. The expression of the `$(expression)` function must be importable by the system. (expression shows up in `import` or has `export`)\n2. If inlined function, then all lexically captured values must be:\n   - importable (vars show up in `import`s or `export`s)\n   - const (The capturing process differs from JS capturing in that writing to captured variables does not update them, and therefore writes are forbidden. The best practice is that all captured variables are constants.)\n   - Must be runtime serializable.\n\n<docs code=\"./examples.tsx#qrl-capturing-rules\"/>\n\n@param expression - Expression which should be lazy loaded\n@public\n\n# `implicit$FirstArg`\n\nCreate a `____$(...)` convenience method from `___(...)`.\n\nIt is very common for functions to take a lazy-loadable resource as a first argument. For this reason, the Qwik Optimizer automatically extracts the first argument from any function which ends in `$`.\n\nThis means that `foo$(arg0)` and `foo($(arg0))` are equivalent with respect to Qwik Optimizer. The former is just a shorthand for the latter.\n\nFor example, these function calls are equivalent:\n\n- `component$(() => {...})` is same as `component($(() => {...}))`\n\n<docs code=\"./examples.tsx#implicit$FirstArg\"/>\n\n@param fn - a function that should have its first argument automatically `$`.\n@public\n\n# `qrl`\n\nUsed by Qwik Optimizer to point to lazy-loaded resources.\n\nThis function should be used by the Qwik Optimizer only. The function should not be directly referred to in the source code of the application.\n\n@see `QRL`, `$(...)`\n\n@param chunkOrFn - Chunk name (or function which is stringified to extract chunk name)\n@param symbol - Symbol to lazy load\n@param lexicalScopeCapture - a set of lexically scoped variables to capture.\n@public\n\n# `useDocument`\n\nRetrieves the document of the current element. It's important to use this method instead of accessing `document` directly because during SSR, the global document might not exist.\n\nNOTE: `useDocument` method can only be used in the synchronous portion of the callback (before any `await` statements.)\n\n@public\n\n# `ContextId`\n\nContextId is a typesafe ID for your context.\n\nContext is a way to pass stores to the child components without prop-drilling.\n\nUse `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier for the context. It is not the context value itself. See `useContextProvider()` and `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can track context providers and consumers in a way that survives resumability.\n\n### Example\n\n<docs code=\"./examples.tsx#context\"/>\n@public\n\n# `createContextId`\n\nCreate a context ID to be used in your application.\nThe name should be written with no spaces.\n\nContext is a way to pass stores to the child components without prop-drilling.\n\nUse `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier for the context. It is not the context value itself. See `useContextProvider()` and `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can track context providers and consumers in a way that survives resumability.\n\n### Example\n\n<docs code=\"./examples.tsx#context\"/>\n@param name - The name of the context.\n@public\n\n# `useContextProvider`\n\nAssign a value to a Context.\n\nUse `useContextProvider()` to assign a value to a context. The assignment happens in the component's function. Once assigned, use `useContext()` in any child component to retrieve the value.\n\nContext is a way to pass stores to the child components without prop-drilling.\n\n### Example\n\n<docs code=\"./examples.tsx#context\"/>\n@param context - The context to assign a value to.\n@param value - The value to assign to the context.\n@public\n\n# `useContext`\n\nRetrieve Context value.\n\nUse `useContext()` to retrieve the value of context in a component. To retrieve a value a parent component needs to invoke `useContextProvider()` to assign a value.\n\n### Example\n\n<docs code=\"./examples.tsx#context\"/>\n@param context - The context to retrieve a value from.\n@public\n"
  },
  {
    "path": "packages/qwik/src/core/render/README.md",
    "content": "# `render` sub-system\n\nRendering sub-system of `Qwik`. Currently, only `JSX` implementation is present, but the system is designed to support other rendering systems provided that they abide by these rules:\n\n- Must be able to render by reusing existing DOM nodes (rather than replace existing DOM nodes).\n- Must have a mechanism for rendering `Qwik` special attributes.\n\n## JSX\n\nQwik uses `JSX` syntax, which converts `<Tag prop><Child /></Tag>` into a function call tree like `jsx(Tag, {prop: true}, jsx(Child, null, null))`. `jsx()`, in turn, converts such a call tree into nested JsxNode objects, and then a render pass runs each type (`Tag` in this case) with the props, including the prop `children`\n\nIn Qwik, wrapping a component with `component$` creates a wrapped component, where the children are not passed to the original component. Instead, the original component must return `<Slot/>` elements and those act as placeholders for the `children`.\n\nThe component is executed first, and then the children are executed, inside the context of the deepest `<Slot/>` component.\n\n## DOM structure\n\nEverything managed by Qwik is inside a container. This is a DOM element with the attribute `q:container`. For Qwik-City applications, this is normally the `<html>` element.\n\nEvery Qwik component renders a pair of comments and then its contents. The open comment is `<!--qv ...-->` with extra metadata encoded, and the closing comment is `<!--/qv-->`.\n\nThe contents are `<q-template />` elements that are waiting for their slot to become available, `<style />` elements, and the actual content of the component.\n\n## Rendering\n\nRendering happens in multple phases:\n\n- During compilations, the embedded `<Tag />` blocks are converted to nested `jsx(componentFn, props)` calls, with the children given as the `children` entry in `props`. (The optimizer converts those `jsx()` calls into `_jsxS()`, `_jsxC()` and `_jsxQ()` depending on the situation for performance reasons)\n- At runtime, the `jsx()` calls are executed, and the result is a `JSXNode` object. The deepest children are executed first, and the result is passed as `props.children` to the parent, which is then executed, and so on until the root component is reached.\n- Then, the `JSXNode` objects are converted to DOM nodes, starting at the root, and inserted into the DOM.\n\nThe conversion from `JSXNode` to DOM nodes uses multiple contexts to keep track of the current state. These are different from the context managed with `useContext()`. The contexts are:\n\n- `QContext`: the component's context\n- `RenderContext`: the rendering state, shared between nodes in a subtree\n- `SSRContext`: global state during SSR\n- `InvokeContext`: used for `invoke()` calls, allowing tracking signal listeners etc\n\nThere are 2 kinds of components, Qwik and inline. An inline component is a function of the form `(props) => JsxNode`. A Qwik component is an inline component that was wrapped in `component$`.\n\nOnly Qwik components are allowed to use hooks. To allow this, they are internally converted to `<Virtual onRenderFn={componentFn} props={componentProps}>{componentProps.children}</Virtual>`. This `Virtual` component is treated specially during render to set up the contexts that allow tracking hooks.\n\nQwik components do not get their children; instead, they have to render `<Slot />` in their JsxNode subtree, which acts as a placeholder.\n\nThis means the abovementioned `<Virtual/>` component has to keep track of 2 sets of children: The result of the `componentFn` and the children that were passed to the component. Those latter are assigned to slots stored in `$projectedChildren$` and when a `<Slot />` is encountered they are used, otherwise they're rendered invisibly into a `<q:template />` DOM element.\n\n## SSR\n\nSSR could be done by rendering into a virtual DOM and then pausing and serializing.\n\nHowever, this uses quite a lot of memory and CPU, so instead when rendering SSR, a streaming approach is taken. Components are emitted as text as soon as possible, and use of the DOM API is avoided.\n\nAfter SSR completes, the state is partially serialized. The complete state consists of:\n\n- SSR context:\n  - locale\n  - head nodes to emit\n  - serverData\n  - ...\n- vDOM: the element tree\n- Element context:\n  - internal id\n  - props\n  - event listeners\n  - tasks\n  - styles to inject, including optional scope id\n  - QRL used to render + lexical scope\n  - parent element\n- stores/signals:\n  - content\n  - subscribers\n\nSome parts of the state are encoded as attributes or structure in the DOM tree.\nTo resume the container, only the state that is referred to by event listeners and their graph needs to be serialized. For example, if a signal is tracked in a task but not referred to by an event listerer, it cannot change, so neither the task nor the signal state need serializing.\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/notify-render.ts",
    "content": "import { assertDefined, assertTrue } from '../../error/assert';\nimport { executeContextWithScrollAndTransition, IS_HEAD, IS_SVG, SVG_NS } from './visitor';\nimport { getDocument } from '../../util/dom';\nimport { logError, logWarn } from '../../util/log';\nimport { getWrappingContainer } from '../../use/use-core';\nimport {\n  runSubscriber,\n  type SubscriberEffect,\n  TaskFlagsIsDirty,\n  TaskFlagsIsVisibleTask,\n  TaskFlagsIsResource,\n  TaskFlagsIsTask,\n  isSubscriberDescriptor,\n} from '../../use/use-task';\nimport { maybeThen } from '../../util/promises';\nimport type { ValueOrPromise } from '../../util/types';\nimport { useLexicalScope } from '../../use/use-lexical-scope.public';\nimport { renderComponent } from './render-dom';\nimport type { RenderContext } from '../types';\nimport { type ContainerState, _getContainerState } from '../../container/container';\nimport { createRenderContext } from '../execute-component';\nimport { getRootNode, type QwikElement } from './virtual-element';\nimport { appendChild, printRenderStats } from './operations';\nimport { executeSignalOperation } from './signals';\nimport { getPlatform, isServerPlatform } from '../../platform/platform';\nimport { qDev } from '../../util/qdev';\nimport type { SubscriberSignal, Subscriptions } from '../../state/common';\nimport { resumeIfNeeded } from '../../container/resume';\nimport { getContext, HOST_FLAG_DIRTY, type QContext } from '../../state/context';\nimport { directGetAttribute } from '../fast-calls';\nimport { QStyle } from '../../util/markers';\n\nexport const notifyChange = (subAction: Subscriptions, containerState: ContainerState) => {\n  if (subAction[0] === 0) {\n    const host = subAction[1];\n    if (isSubscriberDescriptor(host)) {\n      notifyTask(host, containerState);\n    } else {\n      notifyRender(host, containerState);\n    }\n  } else {\n    notifySignalOperation(subAction, containerState);\n  }\n};\n\n/**\n * Mark component for rendering.\n *\n * Use `notifyRender` method to mark a component for rendering at some later point in time. This\n * method uses `getPlatform(doc).queueRender` for scheduling of the rendering. The default\n * implementation of the method is to use `requestAnimationFrame` to do actual rendering.\n *\n * The method is intended to coalesce multiple calls into `notifyRender` into a single call for\n * rendering.\n *\n * @param hostElement - Host-element of the component to re-render.\n * @returns A promise which is resolved when the component has been rendered.\n */\nconst notifyRender = (hostElement: QwikElement, containerState: ContainerState): void => {\n  const server = isServerPlatform();\n  if (!server) {\n    resumeIfNeeded(containerState.$containerEl$);\n  }\n\n  const elCtx = getContext(hostElement, containerState);\n  assertDefined(\n    elCtx.$componentQrl$,\n    `render: notified host element must have a defined $renderQrl$`,\n    elCtx\n  );\n  if (elCtx.$flags$ & HOST_FLAG_DIRTY) {\n    return;\n  }\n  elCtx.$flags$ |= HOST_FLAG_DIRTY;\n  const activeRendering = containerState.$hostsRendering$ !== undefined;\n  if (activeRendering) {\n    containerState.$hostsStaging$.add(elCtx);\n  } else {\n    if (server) {\n      logWarn('Can not rerender in server platform');\n      return undefined;\n    }\n    containerState.$hostsNext$.add(elCtx);\n    scheduleFrame(containerState);\n  }\n};\n\nconst notifySignalOperation = (op: SubscriberSignal, containerState: ContainerState): void => {\n  const activeRendering = containerState.$hostsRendering$ !== undefined;\n  containerState.$opsNext$.add(op);\n  if (!activeRendering) {\n    scheduleFrame(containerState);\n  }\n};\nexport const notifyTask = (task: SubscriberEffect, containerState: ContainerState) => {\n  if (task.$flags$ & TaskFlagsIsDirty) {\n    return;\n  }\n  task.$flags$ |= TaskFlagsIsDirty;\n\n  const activeRendering = containerState.$hostsRendering$ !== undefined;\n  if (activeRendering) {\n    containerState.$taskStaging$.add(task);\n  } else {\n    containerState.$taskNext$.add(task);\n    scheduleFrame(containerState);\n  }\n};\n\nconst scheduleFrame = (containerState: ContainerState): Promise<void> => {\n  if (containerState.$renderPromise$ === undefined) {\n    containerState.$renderPromise$ = getPlatform().nextTick(() => renderMarked(containerState));\n  }\n  return containerState.$renderPromise$;\n};\n\n/**\n * Low-level API used by the Optimizer to process `useTask$()` API. This method is not intended to\n * be used by developers.\n *\n * @internal\n */\nexport const _hW = () => {\n  const [task] = useLexicalScope<[SubscriberEffect]>();\n  notifyTask(task, _getContainerState(getWrappingContainer(task.$el$)!));\n};\n\nconst renderMarked = async (containerState: ContainerState): Promise<void> => {\n  const containerEl = containerState.$containerEl$;\n  const doc = getDocument(containerEl);\n\n  try {\n    const rCtx = createRenderContext(doc, containerState);\n    const staticCtx = rCtx.$static$;\n    const hostsRendering = (containerState.$hostsRendering$ = new Set(containerState.$hostsNext$));\n    containerState.$hostsNext$.clear();\n    await executeTasksBefore(containerState, rCtx);\n\n    containerState.$hostsStaging$.forEach((host) => {\n      hostsRendering.add(host);\n    });\n    containerState.$hostsStaging$.clear();\n\n    const signalOperations = Array.from(containerState.$opsNext$);\n    containerState.$opsNext$.clear();\n\n    const renderingQueue = Array.from(hostsRendering);\n    sortNodes(renderingQueue);\n\n    if (!containerState.$styleMoved$ && renderingQueue.length > 0) {\n      containerState.$styleMoved$ = true;\n      const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n      parentJSON.querySelectorAll('style[q\\\\:style]').forEach((el) => {\n        containerState.$styleIds$.add(directGetAttribute(el, QStyle)!);\n        appendChild(staticCtx, doc.head, el);\n      });\n    }\n\n    for (const elCtx of renderingQueue) {\n      const el = elCtx.$element$;\n      if (!staticCtx.$hostElements$.has(el)) {\n        if (elCtx.$componentQrl$) {\n          assertTrue(el.isConnected, 'element must be connected to the dom');\n          staticCtx.$roots$.push(elCtx);\n          try {\n            await renderComponent(rCtx, elCtx, getFlags(el.parentElement));\n          } catch (err) {\n            if (qDev) {\n              throw err;\n            } else {\n              logError(err);\n            }\n          }\n        }\n      }\n    }\n\n    signalOperations.forEach((op) => {\n      executeSignalOperation(rCtx, op);\n    });\n\n    // Add post operations\n    staticCtx.$operations$.push(...staticCtx.$postOperations$);\n\n    // Early exist, no dom operations\n    if (staticCtx.$operations$.length === 0) {\n      printRenderStats(staticCtx);\n      await postRendering(containerState, rCtx);\n      return;\n    }\n\n    await executeContextWithScrollAndTransition(staticCtx);\n    printRenderStats(staticCtx);\n    return postRendering(containerState, rCtx);\n  } catch (err) {\n    logError(err);\n  }\n};\n\nconst getFlags = (el: Element | null) => {\n  let flags = 0;\n  if (el) {\n    if (el.namespaceURI === SVG_NS) {\n      flags |= IS_SVG;\n    }\n    if (el.tagName === 'HEAD') {\n      flags |= IS_HEAD;\n    }\n  }\n  return flags;\n};\n\nexport const postRendering = async (containerState: ContainerState, rCtx: RenderContext) => {\n  const hostElements = rCtx.$static$.$hostElements$;\n\n  await executeTasksAfter(containerState, rCtx, (task, stage) => {\n    if ((task.$flags$ & TaskFlagsIsVisibleTask) === 0) {\n      return false;\n    }\n    if (stage) {\n      return hostElements.has(task.$el$);\n    }\n    return true;\n  });\n\n  // Clear staging\n  containerState.$hostsStaging$.forEach((el) => {\n    containerState.$hostsNext$.add(el);\n  });\n  containerState.$hostsStaging$.clear();\n\n  containerState.$hostsRendering$ = undefined;\n  containerState.$renderPromise$ = undefined;\n\n  const pending =\n    containerState.$hostsNext$.size +\n    containerState.$taskNext$.size +\n    containerState.$opsNext$.size;\n\n  if (pending > 0) {\n    // Immediately render again\n    containerState.$renderPromise$ = renderMarked(containerState);\n  }\n};\n\nconst isTask = (task: SubscriberEffect) => (task.$flags$ & TaskFlagsIsTask) !== 0;\nconst isResourceTask = (task: SubscriberEffect) => (task.$flags$ & TaskFlagsIsResource) !== 0;\nconst executeTasksBefore = async (containerState: ContainerState, rCtx: RenderContext) => {\n  const containerEl = containerState.$containerEl$;\n  const resourcesPromises: ValueOrPromise<SubscriberEffect>[] = [];\n  const taskPromises: ValueOrPromise<SubscriberEffect>[] = [];\n\n  containerState.$taskNext$.forEach((task) => {\n    if (isTask(task)) {\n      taskPromises.push(maybeThen(task.$qrl$.$resolveLazy$(containerEl), () => task));\n      containerState.$taskNext$.delete(task);\n    }\n    if (isResourceTask(task)) {\n      resourcesPromises.push(maybeThen(task.$qrl$.$resolveLazy$(containerEl), () => task));\n      containerState.$taskNext$.delete(task);\n    }\n  });\n  do {\n    // Run staging effected\n    containerState.$taskStaging$.forEach((task) => {\n      if (isTask(task)) {\n        taskPromises.push(maybeThen(task.$qrl$.$resolveLazy$(containerEl), () => task));\n      } else if (isResourceTask(task)) {\n        resourcesPromises.push(maybeThen(task.$qrl$.$resolveLazy$(containerEl), () => task));\n      } else {\n        containerState.$taskNext$.add(task);\n      }\n    });\n\n    containerState.$taskStaging$.clear();\n\n    // Wait for all promises\n    if (taskPromises.length > 0) {\n      const tasks = await Promise.all(taskPromises);\n      sortTasks(tasks);\n      await Promise.all(\n        tasks.map((task) => {\n          return runSubscriber(task, containerState, rCtx);\n        })\n      );\n      taskPromises.length = 0;\n    }\n  } while (containerState.$taskStaging$.size > 0);\n\n  if (resourcesPromises.length > 0) {\n    const resources = await Promise.all(resourcesPromises);\n    sortTasks(resources);\n    // no await so these run concurrently with the rendering\n    for (const task of resources) {\n      runSubscriber(task, containerState, rCtx);\n    }\n  }\n};\n\n/** Execute tasks that are dirty during SSR render */\nexport const executeSSRTasks = (containerState: ContainerState, rCtx: RenderContext) => {\n  const containerEl = containerState.$containerEl$;\n  const staging = containerState.$taskStaging$;\n  if (!staging.size) {\n    return;\n  }\n  const taskPromises: ValueOrPromise<SubscriberEffect>[] = [];\n\n  let tries = 20;\n  const runTasks = () => {\n    // SSR dirty tasks are in taskStaging\n    staging.forEach((task) => {\n      if (isTask(task)) {\n        taskPromises.push(maybeThen(task.$qrl$.$resolveLazy$(containerEl), () => task));\n      }\n      // We ignore other types of tasks, they are handled via waitOn\n    });\n\n    staging.clear();\n\n    // Wait for all promises\n    if (taskPromises.length > 0) {\n      return Promise.all(taskPromises).then(async (tasks): Promise<unknown> => {\n        sortTasks(tasks);\n        await Promise.all(\n          tasks.map((task) => {\n            return runSubscriber(task, containerState, rCtx);\n          })\n        );\n        taskPromises.length = 0;\n        if (--tries && staging.size > 0) {\n          return runTasks();\n        }\n        if (!tries) {\n          logWarn(\n            `Infinite task loop detected. Tasks:\\n${Array.from(staging)\n              .map((task) => `  ${task.$qrl$.$symbol$}`)\n              .join('\\n')}`\n          );\n        }\n      });\n    }\n  };\n  return runTasks();\n};\n\nconst executeTasksAfter = async (\n  containerState: ContainerState,\n  rCtx: RenderContext,\n  taskPred: (task: SubscriberEffect, staging: boolean) => boolean\n) => {\n  const taskPromises: ValueOrPromise<SubscriberEffect>[] = [];\n  const containerEl = containerState.$containerEl$;\n\n  containerState.$taskNext$.forEach((task) => {\n    if (taskPred(task, false)) {\n      if (task.$el$.isConnected) {\n        taskPromises.push(maybeThen(task.$qrl$.$resolveLazy$(containerEl), () => task));\n      }\n      containerState.$taskNext$.delete(task);\n    }\n  });\n  do {\n    // Run staging effected\n    containerState.$taskStaging$.forEach((task) => {\n      if (task.$el$.isConnected) {\n        if (taskPred(task, true)) {\n          taskPromises.push(maybeThen(task.$qrl$.$resolveLazy$(containerEl), () => task));\n        } else {\n          containerState.$taskNext$.add(task);\n        }\n      }\n    });\n    containerState.$taskStaging$.clear();\n\n    // Wait for all promises\n    if (taskPromises.length > 0) {\n      const tasks = await Promise.all(taskPromises);\n      sortTasks(tasks);\n      for (const task of tasks) {\n        runSubscriber(task, containerState, rCtx);\n      }\n      taskPromises.length = 0;\n    }\n  } while (containerState.$taskStaging$.size > 0);\n};\n\nconst sortNodes = (elements: QContext[]) => {\n  elements.sort((a, b) =>\n    a.$element$.compareDocumentPosition(getRootNode(b.$element$)) & 2 ? 1 : -1\n  );\n};\n\nconst sortTasks = (tasks: SubscriberEffect[]) => {\n  const isServer = isServerPlatform();\n  tasks.sort((a, b) => {\n    if (isServer || a.$el$ === b.$el$) {\n      return a.$index$ < b.$index$ ? -1 : 1;\n    }\n    return (a.$el$.compareDocumentPosition(getRootNode(b.$el$)) & 2) !== 0 ? 1 : -1;\n  });\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/operations.ts",
    "content": "import type { ContainerState } from '../../container/container';\nimport { assertDefined } from '../../error/assert';\nimport { codeToText, QError_setProperty } from '../../error/error';\nimport type { StyleAppend } from '../../use/use-core';\nimport { getDocument } from '../../util/dom';\nimport { isElement, isNode, isQwikElement } from '../../util/element';\nimport { logDebug, logError, logWarn } from '../../util/log';\nimport { QSlot, QSlotRef, QStyle } from '../../util/markers';\nimport { qDev } from '../../util/qdev';\nimport { directGetAttribute, directSetAttribute } from '../fast-calls';\nimport type { RenderStaticContext } from '../types';\nimport type { QwikElement, VirtualElement } from './virtual-element';\nimport {\n  cleanupTree,\n  directAppendChild,\n  directInsertAfter,\n  directInsertBefore,\n  directRemoveChild,\n  getChildren,\n  isChildComponent,\n  isSlotTemplate,\n  SVG_NS,\n} from './visitor';\n\nexport const setAttribute = (\n  staticCtx: RenderStaticContext,\n  el: QwikElement,\n  prop: string,\n  value: any\n) => {\n  staticCtx.$operations$.push({\n    $operation$: _setAttribute,\n    $args$: [el, prop, value],\n  });\n};\n\nconst _setAttribute = (el: QwikElement, prop: string, value: any) => {\n  if (value == null || value === false) {\n    el.removeAttribute(prop);\n  } else {\n    // element.setAttribute requires string. Boolean attributes automatically convert \"\" to `true`\n    const str = value === true ? '' : String(value);\n    directSetAttribute(el, prop, str);\n  }\n};\n\nexport const setProperty = (staticCtx: RenderStaticContext, node: any, key: string, value: any) => {\n  staticCtx.$operations$.push({\n    $operation$: _setProperty,\n    $args$: [node, key, value],\n  });\n};\n\nexport const setPropertyPost = (\n  staticCtx: RenderStaticContext,\n  node: any,\n  key: string,\n  value: any\n) => {\n  staticCtx.$postOperations$.push({\n    $operation$: _setProperty,\n    $args$: [node, key, value],\n  });\n};\n\nconst _setProperty = (node: any, key: string, value: any) => {\n  try {\n    node[key] = value == null ? '' : value;\n    if (value == null && isNode(node) && isElement(node)) {\n      node.removeAttribute(key);\n    }\n  } catch (err) {\n    logError(codeToText(QError_setProperty), key, { node, value }, err);\n  }\n};\n\nexport const createElement = (doc: Document, expectTag: string, isSvg: boolean): Element => {\n  const el = isSvg ? doc.createElementNS(SVG_NS, expectTag) : doc.createElement(expectTag);\n\n  return el;\n};\n\nexport const insertBefore = <T extends Node | VirtualElement>(\n  staticCtx: RenderStaticContext,\n  parent: QwikElement,\n  newChild: T,\n  refChild: Node | VirtualElement | null | undefined\n): T => {\n  staticCtx.$operations$.push({\n    $operation$: directInsertBefore,\n    $args$: [parent, newChild, refChild ? refChild : null],\n  });\n  return newChild;\n};\n\nexport const insertAfter = <T extends Node | VirtualElement>(\n  staticCtx: RenderStaticContext,\n  parent: QwikElement,\n  newChild: T,\n  refChild: Node | VirtualElement | null | undefined\n): T => {\n  staticCtx.$operations$.push({\n    $operation$: directInsertAfter,\n    $args$: [parent, newChild, refChild ? refChild : null],\n  });\n  return newChild;\n};\n\nexport const appendChild = <T extends Node | VirtualElement>(\n  staticCtx: RenderStaticContext,\n  parent: QwikElement,\n  newChild: T\n): T => {\n  staticCtx.$operations$.push({\n    $operation$: directAppendChild,\n    $args$: [parent, newChild],\n  });\n  return newChild;\n};\n\nexport const appendHeadStyle = (staticCtx: RenderStaticContext, styleTask: StyleAppend) => {\n  staticCtx.$containerState$.$styleIds$.add(styleTask.styleId);\n  staticCtx.$postOperations$.push({\n    $operation$: _appendHeadStyle,\n    $args$: [staticCtx.$containerState$, styleTask],\n  });\n};\n\nexport const setClasslist = (\n  staticCtx: RenderStaticContext,\n  elm: Element,\n  toRemove: string[],\n  toAdd: string[]\n) => {\n  staticCtx.$operations$.push({\n    $operation$: _setClasslist,\n    $args$: [elm, toRemove, toAdd],\n  });\n};\n\nexport const _setClasslist = (elm: Element, toRemove: string[], toAdd: string[]) => {\n  const classList = elm.classList;\n  classList.remove(...toRemove);\n  classList.add(...toAdd);\n};\n\nexport const _appendHeadStyle = (containerState: ContainerState, styleTask: StyleAppend) => {\n  const containerEl = containerState.$containerEl$;\n  const doc = getDocument(containerEl);\n  const isDoc = doc.documentElement === containerEl;\n  const headEl = doc.head;\n  const style = doc.createElement('style');\n  if (isDoc && !headEl) {\n    logWarn('document.head is undefined');\n  }\n  directSetAttribute(style, QStyle, styleTask.styleId);\n  directSetAttribute(style, 'hidden', '');\n\n  style.textContent = styleTask.content;\n  if (isDoc && headEl) {\n    directAppendChild(headEl, style);\n  } else {\n    directInsertBefore(containerEl, style, containerEl.firstChild);\n  }\n};\n\nexport const prepend = (staticCtx: RenderStaticContext, parent: QwikElement, newChild: Node) => {\n  staticCtx.$operations$.push({\n    $operation$: directPrepend,\n    $args$: [parent, newChild],\n  });\n};\n\nexport const directPrepend = (parent: QwikElement, newChild: Node) => {\n  directInsertBefore(parent, newChild, parent.firstChild);\n};\n\nexport const removeNode = (staticCtx: RenderStaticContext, el: Node | VirtualElement) => {\n  if (isQwikElement(el)) {\n    const subsManager = staticCtx.$containerState$.$subsManager$;\n    cleanupTree(el as Element, staticCtx, subsManager, true);\n  }\n  staticCtx.$operations$.push({\n    $operation$: _removeNode,\n    $args$: [el, staticCtx],\n  });\n};\n\nconst _removeNode = (el: Node | VirtualElement, staticCtx: RenderStaticContext) => {\n  const parent = el.parentElement;\n  if (parent) {\n    directRemoveChild(parent, el);\n  } else if (qDev) {\n    logWarn('Trying to remove component already removed', el);\n  }\n};\n\nexport const createTemplate = (doc: Document, slotName: string) => {\n  const template = createElement(doc, 'q:template', false);\n  directSetAttribute(template, QSlot, slotName);\n  directSetAttribute(template, 'hidden', '');\n  directSetAttribute(template, 'aria-hidden', 'true');\n\n  return template;\n};\n\nexport const executeDOMRender = (staticCtx: RenderStaticContext) => {\n  for (const op of staticCtx.$operations$) {\n    // PERF(misko): polymorphic execution\n    op.$operation$.apply(undefined, op.$args$);\n  }\n  resolveSlotProjection(staticCtx);\n};\n\nexport const getKey = (el: QwikElement): string | null => {\n  return directGetAttribute(el, 'q:key');\n};\n\nexport const setKey = (el: QwikElement, key: string | null) => {\n  if (key !== null) {\n    directSetAttribute(el, 'q:key', key);\n  }\n};\n\nexport const resolveSlotProjection = (staticCtx: RenderStaticContext) => {\n  // Slots removed\n  const subsManager = staticCtx.$containerState$.$subsManager$;\n  for (const slotEl of staticCtx.$rmSlots$) {\n    const key = getKey(slotEl);\n    assertDefined(key, 'slots must have a key');\n\n    const slotChildren = getChildren(slotEl, isChildComponent);\n    if (slotChildren.length > 0) {\n      const sref = slotEl.getAttribute(QSlotRef);\n      const hostCtx = staticCtx.$roots$.find((r) => r.$id$ === sref);\n      if (hostCtx) {\n        const hostElm = hostCtx.$element$;\n        if (hostElm.isConnected) {\n          const hasTemplate = getChildren(hostElm, isSlotTemplate).some(\n            (node: any) => directGetAttribute(node, QSlot) === key\n          );\n\n          if (!hasTemplate) {\n            const template = createTemplate(staticCtx.$doc$, key);\n            for (const child of slotChildren) {\n              directAppendChild(template, child);\n            }\n            directInsertBefore(hostElm, template, hostElm.firstChild);\n          } else {\n            cleanupTree(slotEl, staticCtx, subsManager, false);\n          }\n        } else {\n          cleanupTree(slotEl, staticCtx, subsManager, false);\n        }\n      } else {\n        // If slot content cannot be relocated, it means it's content is definitely removed\n        // Cleanup needs to be executed\n        cleanupTree(slotEl, staticCtx, subsManager, false);\n      }\n    }\n  }\n\n  // Slots added\n  for (const [slotEl, hostElm] of staticCtx.$addSlots$) {\n    const key = getKey(slotEl);\n    assertDefined(key, 'slots must have a key');\n\n    const template = getChildren(hostElm, isSlotTemplate).find((node: any) => {\n      return node.getAttribute(QSlot) === key;\n    }) as Element | undefined;\n    if (template) {\n      getChildren(template, isChildComponent).forEach((child) => {\n        directAppendChild(slotEl, child);\n      });\n      template.remove();\n    }\n  }\n};\n\nexport const printRenderStats = (staticCtx: RenderStaticContext) => {\n  if (qDev) {\n    if (typeof window !== 'undefined' && window.document != null) {\n      const byOp: Record<string, number> = {};\n      for (const op of staticCtx.$operations$) {\n        byOp[op.$operation$.name] = (byOp[op.$operation$.name] ?? 0) + 1;\n      }\n      const stats = {\n        byOp,\n        roots: staticCtx.$roots$.map((ctx) => ctx.$element$),\n        hostElements: Array.from(staticCtx.$hostElements$),\n        operations: staticCtx.$operations$.map((v) => [v.$operation$.name, ...v.$args$]),\n      };\n      const noOps = staticCtx.$operations$.length === 0;\n      logDebug('Render stats.', noOps ? 'No operations' : '', stats);\n    }\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/render-dom.ts",
    "content": "import { qError, QError_invalidJsxNodeType } from '../../error/error';\nimport { type InvokeContext, newInvokeContext, invoke } from '../../use/use-core';\nimport { EMPTY_ARRAY, EMPTY_OBJ } from '../../util/flyweight';\nimport { logWarn } from '../../util/log';\nimport { isNotNullable, isPromise, promiseAll, maybeThen } from '../../util/promises';\nimport { qDev, qInspector, seal } from '../../util/qdev';\nimport { isArray, isFunction, isObject, isString, type ValueOrPromise } from '../../util/types';\nimport { domToVnode, smartUpdateChildren } from './visitor';\nimport { SkipRender } from '../jsx/utils.public';\nimport { isJSXNode, SKIP_RENDER_TYPE, _jsxC, Virtual } from '../jsx/jsx-runtime';\nimport type { DevJSX, JSXNodeInternal } from '../jsx/types/jsx-node';\nimport { executeComponent, shouldWrapFunctional } from '../execute-component';\nimport type { RenderContext } from '../types';\nimport { type QwikElement, VIRTUAL, type VirtualElement } from './virtual-element';\nimport { appendHeadStyle } from './operations';\nimport { isSignal, type Signal } from '../../state/signal';\nimport { HOST_FLAG_MOUNTED, type QContext } from '../../state/context';\n\nexport const renderComponent = (\n  rCtx: RenderContext,\n  elCtx: QContext,\n  flags: number\n): ValueOrPromise<void> => {\n  const justMounted = !(elCtx.$flags$ & HOST_FLAG_MOUNTED);\n  const hostElement = elCtx.$element$;\n  const containerState = rCtx.$static$.$containerState$;\n  // Component is not dirty any more\n  containerState.$hostsStaging$.delete(elCtx);\n  // Clean current subscription before render\n  containerState.$subsManager$.$clearSub$(hostElement);\n\n  // TODO, serialize scopeIds\n  return maybeThen(executeComponent(rCtx, elCtx), (res) => {\n    const staticCtx = rCtx.$static$;\n    const newCtx = res.rCtx;\n    const iCtx = newInvokeContext(rCtx.$static$.$locale$, hostElement);\n    staticCtx.$hostElements$.add(hostElement);\n    iCtx.$subscriber$ = [0, hostElement];\n    iCtx.$renderCtx$ = newCtx;\n    if (justMounted) {\n      if (elCtx.$appendStyles$) {\n        for (const style of elCtx.$appendStyles$) {\n          appendHeadStyle(staticCtx, style);\n        }\n      }\n    }\n    const processedJSXNode = processData(res.node, iCtx);\n    return maybeThen(processedJSXNode, (processedJSXNode) => {\n      const newVdom = wrapJSX(hostElement, processedJSXNode);\n      // const oldVdom = getVdom(hostElement);\n      const oldVdom = getVdom(elCtx);\n      return maybeThen(smartUpdateChildren(newCtx, oldVdom, newVdom, flags), () => {\n        // setVdom(hostElement, newVdom);\n        elCtx.$vdom$ = newVdom;\n      });\n    });\n  });\n};\n\nexport const getVdom = (elCtx: QContext) => {\n  if (!elCtx.$vdom$) {\n    elCtx.$vdom$ = domToVnode(elCtx.$element$);\n  }\n  return elCtx.$vdom$;\n};\n\nexport class ProcessedJSXNodeImpl implements ProcessedJSXNode {\n  $elm$: Node | VirtualElement | null = null;\n  $text$: string = '';\n  $signal$: Signal<any> | null = null;\n  $id$: string;\n  $dev$: DevJSX | undefined;\n\n  constructor(\n    public $type$: string,\n    public $props$: Record<string, any>,\n    public $immutableProps$: Record<string, any> | null,\n    public $children$: ProcessedJSXNode[],\n    public $flags$: number,\n    public $key$: string | null\n  ) {\n    this.$id$ = $type$ + ($key$ ? ':' + $key$ : '');\n    if (qDev && qInspector) {\n      this.$dev$ = undefined;\n    }\n    seal(this);\n  }\n}\n\nexport const processNode = (\n  node: JSXNodeInternal,\n  invocationContext?: InvokeContext\n): ValueOrPromise<ProcessedJSXNode | ProcessedJSXNode[] | undefined> => {\n  const { key, type, props, children, flags, immutableProps } = node;\n  let textType = '';\n  if (isString(type)) {\n    textType = type;\n  } else if (type === Virtual) {\n    textType = VIRTUAL;\n  } else if (isFunction(type)) {\n    const res = invoke(invocationContext, type, props, key, flags, node.dev);\n    if (!shouldWrapFunctional(res, node)) {\n      return processData(res, invocationContext);\n    }\n    return processNode(_jsxC(Virtual, { children: res }, 0, key), invocationContext);\n  } else {\n    throw qError(QError_invalidJsxNodeType, type);\n  }\n  let convertedChildren = EMPTY_ARRAY as ProcessedJSXNode[];\n  if (children != null) {\n    return maybeThen(processData(children, invocationContext), (result) => {\n      if (result !== undefined) {\n        convertedChildren = isArray(result) ? result : [result];\n      }\n      const vnode = new ProcessedJSXNodeImpl(\n        textType,\n        props,\n        immutableProps,\n        convertedChildren,\n        flags,\n        key\n      );\n      if (qDev && qInspector) {\n        vnode.$dev$ = node.dev;\n      }\n      return vnode;\n    });\n  } else {\n    const vnode = new ProcessedJSXNodeImpl(\n      textType,\n      props,\n      immutableProps,\n      convertedChildren,\n      flags,\n      key\n    );\n    if (qDev && qInspector) {\n      vnode.$dev$ = node.dev;\n    }\n    return vnode;\n  }\n};\n\nexport const wrapJSX = (\n  element: QwikElement,\n  input: ProcessedJSXNode[] | ProcessedJSXNode | undefined\n) => {\n  const children: ProcessedJSXNode[] =\n    input === undefined ? EMPTY_ARRAY : isArray(input) ? input : [input];\n  const node = new ProcessedJSXNodeImpl(':virtual', {}, null, children, 0, null);\n  node.$elm$ = element;\n  return node;\n};\n\nexport const processData = (\n  node: any,\n  invocationContext?: InvokeContext\n): ValueOrPromise<ProcessedJSXNode[] | ProcessedJSXNode | undefined> => {\n  if (node == null || typeof node === 'boolean') {\n    return undefined;\n  }\n  if (isPrimitive(node)) {\n    const newNode = new ProcessedJSXNodeImpl('#text', EMPTY_OBJ, null, EMPTY_ARRAY, 0, null);\n    newNode.$text$ = String(node);\n    return newNode;\n  } else if (isJSXNode(node)) {\n    return processNode(node, invocationContext);\n  } else if (isSignal(node)) {\n    const newNode = new ProcessedJSXNodeImpl('#signal', EMPTY_OBJ, null, EMPTY_ARRAY, 0, null);\n    newNode.$signal$ = node;\n    return newNode;\n  } else if (isArray(node)) {\n    const output = promiseAll(node.flatMap((n) => processData(n, invocationContext)));\n    return maybeThen(output, (array) => array.flat(100).filter(isNotNullable));\n  } else if (isPromise(node)) {\n    return node.then((node) => processData(node, invocationContext));\n  } else if (node === SkipRender) {\n    return new ProcessedJSXNodeImpl(SKIP_RENDER_TYPE, EMPTY_OBJ, null, EMPTY_ARRAY, 0, null);\n  } else {\n    logWarn('A unsupported value was passed to the JSX, skipping render. Value:', node);\n    return undefined;\n  }\n};\n\nexport const isProcessedJSXNode = (n: any): n is ProcessedJSXNode => {\n  if (qDev) {\n    if (n instanceof ProcessedJSXNodeImpl) {\n      return true;\n    }\n    if (isObject(n) && n.constructor.name === ProcessedJSXNodeImpl.name) {\n      throw new Error(`Duplicate implementations of \"ProcessedJSXNodeImpl\" found`);\n    }\n    return false;\n  } else {\n    return n instanceof ProcessedJSXNodeImpl;\n  }\n};\n\nexport const isPrimitive = (obj: any) => {\n  return isString(obj) || typeof obj === 'number';\n};\n\nexport type ProcessedJSXNodeType =\n  | '#text'\n  | ':virtual'\n  | ':signal'\n  | typeof SKIP_RENDER_TYPE\n  | string;\n\nexport interface ProcessedJSXNode {\n  $type$: ProcessedJSXNodeType;\n  $id$: string;\n  $props$: Record<string, any>;\n  $immutableProps$: Record<string, any> | null;\n  $flags$: number;\n  $children$: ProcessedJSXNode[];\n  $key$: string | null;\n  $elm$: Node | VirtualElement | null;\n  $text$: string;\n  $signal$: Signal<any> | null;\n  $dev$?: DevJSX;\n}\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/render.public.ts",
    "content": "import { isDocument } from '../../util/element';\nimport { jsx } from '../jsx/jsx-runtime';\nimport type { JSXOutput, FunctionComponent } from '../jsx/types/jsx-node';\nimport { cleanupTree, domToVnode, smartUpdateChildren } from './visitor';\nimport { getDocument } from '../../util/dom';\nimport { qDev } from '../../util/qdev';\nimport { version } from '../../version';\nimport { QContainerAttr } from '../../util/markers';\nimport { qError, QError_cannotRenderOverExistingContainer } from '../../error/error';\nimport { directRemoveAttribute, directSetAttribute } from '../fast-calls';\nimport { processData, wrapJSX } from './render-dom';\nimport {\n  type ContainerState,\n  removeContainerState,\n  _getContainerState,\n} from '../../container/container';\nimport { postRendering } from './notify-render';\nimport { createRenderContext } from '../execute-component';\nimport { executeDOMRender, printRenderStats } from './operations';\nimport { logError } from '../../util/log';\nimport { appendQwikDevTools } from '../../container/resume';\nimport type { RenderContext } from '../types';\n\n/** @public */\nexport interface RenderOptions {\n  serverData?: Record<string, any>;\n}\n\n/** @public */\nexport interface RenderResult {\n  cleanup(): void;\n}\n\n/**\n * Render JSX.\n *\n * Use this method to render JSX. This function does reconciling which means it always tries to\n * reuse what is already in the DOM (rather then destroy and recreate content.) It returns a cleanup\n * function you could use for cleaning up subscriptions.\n *\n * @param parent - Element which will act as a parent to `jsxNode`. When possible the rendering will\n *   try to reuse existing nodes.\n * @param jsxOutput - JSX to render\n * @returns An object containing a cleanup function.\n * @public\n */\nexport const render = async (\n  parent: Element | Document,\n  jsxOutput: JSXOutput | FunctionComponent<any>,\n  opts?: RenderOptions\n): Promise<RenderResult> => {\n  // If input is a component, convert it\n  if (typeof jsxOutput === 'function') {\n    jsxOutput = jsx(jsxOutput, null);\n  }\n  const doc = getDocument(parent);\n  const containerEl = getElement(parent);\n  if (qDev && containerEl.hasAttribute(QContainerAttr)) {\n    throw qError(QError_cannotRenderOverExistingContainer, containerEl);\n  }\n  // if (qDev) {\n  //   if (parent.childNodes.length > 0) {\n  //     throw new Error('Container must be empty before mounting anything inside');\n  //   }\n  // }\n  injectQContainer(containerEl);\n\n  const containerState = _getContainerState(containerEl);\n  const serverData = opts?.serverData;\n  if (serverData) {\n    Object.assign(containerState.$serverData$, serverData);\n  }\n  const rCtx = createRenderContext(doc, containerState);\n  containerState.$hostsRendering$ = new Set();\n  containerState.$styleMoved$ = true;\n  await renderRoot(rCtx, containerEl, jsxOutput, doc, containerState, containerEl);\n\n  await postRendering(containerState, rCtx);\n\n  return {\n    cleanup() {\n      cleanupContainer(rCtx, containerEl);\n    },\n  };\n};\n\nconst renderRoot = async (\n  rCtx: RenderContext,\n  parent: Element,\n  jsxOutput: JSXOutput,\n  doc: Document,\n  containerState: ContainerState,\n  containerEl: Element\n) => {\n  const staticCtx = rCtx.$static$;\n\n  try {\n    const processedNodes = await processData(jsxOutput);\n    // const rootJsx = getVdom(parent);\n    const rootJsx = domToVnode(parent);\n    await smartUpdateChildren(rCtx, rootJsx, wrapJSX(parent, processedNodes), 0);\n  } catch (err) {\n    logError(err);\n  }\n\n  staticCtx.$operations$.push(...staticCtx.$postOperations$);\n  executeDOMRender(staticCtx);\n\n  if (qDev) {\n    appendQwikDevTools(containerEl);\n  }\n  printRenderStats(staticCtx);\n};\n\nexport const getElement = (docOrElm: Document | Element): Element => {\n  return isDocument(docOrElm) ? docOrElm.documentElement : docOrElm;\n};\n\nexport const injectQContainer = (containerEl: Element) => {\n  directSetAttribute(containerEl, 'q:version', version ?? 'dev');\n  directSetAttribute(containerEl, QContainerAttr, 'resumed');\n  directSetAttribute(containerEl, 'q:render', qDev ? 'dom-dev' : 'dom');\n};\n\nfunction cleanupContainer(renderCtx: RenderContext, container: Element) {\n  const subsManager = renderCtx.$static$.$containerState$.$subsManager$;\n  cleanupTree(container, renderCtx.$static$, subsManager, true, true);\n\n  removeContainerState(container);\n\n  // Clean up attributes\n  directRemoveAttribute(container, 'q:version');\n  directRemoveAttribute(container, QContainerAttr);\n  directRemoveAttribute(container, 'q:render');\n\n  // Remove children\n  container.replaceChildren();\n}\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/render.unit.tsx",
    "content": "import { ElementFixture, trigger } from '../../../testing/element-fixture';\nimport { expectDOM } from '../../../testing/expect-dom';\nimport { component$ } from '../../component/component.public';\nimport { inlinedQrl } from '../../qrl/qrl';\nimport { useLexicalScope } from '../../use/use-lexical-scope.public';\nimport { useStore } from '../../use/use-store.public';\nimport { useVisibleTask$, useTask$ } from '../../use/use-task';\nimport { useOn } from '../../use/use-on';\nimport { Slot } from '../jsx/slot.public';\nimport { render } from './render.public';\nimport { useStylesQrl, useStylesScopedQrl } from '../../use/use-styles';\nimport { pauseContainer } from '../../container/pause';\nimport { useSignal } from '../../use/use-signal';\nimport { assert, test, suite } from 'vitest';\nimport { createDOM } from '../../../testing/library';\nimport { renderToString } from '../../../server/render';\nimport { createDocument } from '../../../testing/document';\n\ntest('should render basic content', async () => {\n  const fixture = new ElementFixture();\n  await render(fixture.host, <div></div>);\n  await expectRendered(fixture, '<div></div>');\n  assert.equal(fixture.host.getAttribute('q:version'), 'dev');\n  assert.equal(fixture.host.getAttribute('q:container'), 'resumed');\n\n  await pauseContainer(fixture.host);\n  assert.equal(fixture.host.getAttribute('q:container'), 'paused');\n});\n\ntest('should only render string/number', async () => {\n  const fixture = new ElementFixture();\n  await render(\n    fixture.host,\n    <div>\n      {'string'}\n      {123}\n      {false}\n      {true}\n      {null}\n      {undefined}\n      {[]}\n    </div>\n  );\n  await expectRendered(fixture, '<div>string123</div>');\n});\n\ntest('should serialize events correctly', async () => {\n  const fixture = new ElementFixture();\n  await render(\n    fixture.host,\n    <div\n      onMouseDown$={() => {}}\n      onKeyUp$={() => {}}\n      onDblClick$={() => {}}\n      on-DblClick$={() => {}}\n      onQVisible$={() => {}}\n      document:onLoad$={() => {}}\n      document:onThing$={() => {}}\n      document:on-Thing$={() => {}}\n      window:onScroll$={() => {}}\n      window:on-Scroll$={() => {}}\n    ></div>\n  );\n  await expectRendered(\n    fixture,\n    `\n      <div\n        on-document:load=\"\"\n        on-document:thing=\"\"\n        on-document:-thing=\"\"\n        on-window:scroll=\"\"\n        on-window:-scroll=\"\"\n    ></div>\n    `\n  );\n});\ntest('should serialize boolean attributes correctly', async () => {\n  const fixture = new ElementFixture();\n  await render(fixture.host, <input required={true} disabled={false}></input>);\n  await expectRendered(fixture, '<input required=\"\" />');\n});\n\ntest('should render aria', async () => {\n  const fixture = new ElementFixture();\n  await render(\n    fixture.host,\n    <div\n      id=\"abc\"\n      title=\"bar\"\n      aria-required={true}\n      aria-busy={false}\n      role=\"\"\n      preventdefault:click\n      aria-hidden={undefined}\n    ></div>\n  );\n  await expectRendered(\n    fixture,\n    '<div id=\"abc\" title=\"bar\" aria-required=\"true\" aria-busy=\"false\" role=\"\" preventdefault:click=\"\"></div>'\n  );\n});\n\ntest('should render into a document', async () => {\n  const fixture = new ElementFixture();\n  fixture.document.head.appendChild(fixture.document.createElement('existing'));\n  await render(\n    fixture.document,\n    <Transparent>\n      <head>\n        <title>Replace</title>\n        <div>\n          <div></div>\n        </div>\n      </head>\n      <body>WORKS</body>\n    </Transparent>\n  );\n  await expectDOM(\n    fixture.document.documentElement,\n    `\n  <html q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n  <!--qv -->\n  <!--qv q:key q:sref=0 q:s-->\n    <head>\n      <title></title>\n      <existing></existing>\n      <title>Replace</title>\n      <div><div></div></div>\n    </head>\n    <body>\n      WORKS\n    </body>\n    <!--/qv-->\n    <!--/qv-->\n  </html>`\n  );\n});\n\ntest('should render attributes', async () => {\n  const fixture = new ElementFixture();\n  await render(fixture.host, <div id=\"abc\" title=\"bar\" preventdefault:click></div>);\n  await expectRendered(fixture, '<div id=\"abc\" title=\"bar\" preventdefault:click=\"\"></div>');\n});\n\ntest('should render style only for defined attributes', async () => {\n  const fixture = new ElementFixture();\n  await render(\n    fixture.host,\n    <div id=\"both\" style={{ color: 'red', display: 'block' }}>\n      <div id=\"only-color\" style={{ display: undefined as unknown as string, color: 'red' }}></div>\n      <div id=\"no-style\" style={{ display: undefined as unknown as string }}></div>\n    </div>\n  );\n  await expectRendered(\n    fixture,\n    `\n      <div id=\"both\" style=\"color: red; display: block\">\n        <div id=\"only-color\" style=\"color: red\"></div>\n        <div id=\"no-style\" style=\"\"></div>\n      </div>`\n  );\n});\n\ntest('should render style css variables correctly', async () => {\n  const fixture = new ElementFixture();\n  await render(\n    fixture.host,\n    <div\n      style={{\n        top: 0,\n        '--stuff-nu': -1,\n        '--stuff-hey': 'hey',\n        '--stuffCase': 'foo',\n      }}\n    />\n  );\n  await expectRendered(\n    fixture,\n    `<div style=\"top: 0; --stuff-nu: -1; --stuff-hey: hey; --stuffCase: foo\"></div>`\n  );\n});\n\ntest('should render children', async () => {\n  const fixture = new ElementFixture();\n  await render(\n    fixture.host,\n    <div>\n      <span>text</span>\n    </div>\n  );\n  await expectRendered(fixture, '<div><span>text</span></div>');\n});\n\ntest('should render svg', async () => {\n  const fixture = new ElementFixture();\n  await render(\n    fixture.host,\n    <svg viewBox=\"0 0 100 100\">\n      <span>text</span>\n    </svg>\n  );\n  await expectRendered(fixture, '<svg viewBox=\"0 0 100 100\"><span>text</span></svg>');\n});\n\ntest('should render a component', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <HelloWorld name=\"World\" />);\n  await expectRendered(fixture, '<span>Hello World</span>');\n});\n\ntest('should render a component with scoped styles', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <HelloWorldScoped />);\n  await expectDOM(\n    fixture.host,\n    `\n  <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n    <style q:style=\"ml52vk-0\" hidden=\"\">\n      .stuff.⭐️ml52vk-0 {\n        color: red;\n      }\n    </style>\n    <!--qv -->\n    <div class=\"⭐️ml52vk-0\">\n      <div class=\"⭐️ml52vk-0 stuff\" aria-hidden=\"true\">\n        Hello\n        <button class=\"⭐️ml52vk-0\">\n          Toggle\n        </button>\n      </div>\n    </div>\n    <!--/qv-->\n  </host>\n  `\n  );\n  await trigger(fixture.host, 'button', 'click');\n  await expectDOM(\n    fixture.host,\n    `\n  <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n    <style q:style=\"ml52vk-0\" hidden=\"\">\n      .stuff.⭐️ml52vk-0 {\n        color: red;\n      }\n    </style>\n    <!--qv -->\n    <div class=\"⭐️ml52vk-0\">\n      <div class=\"⭐️ml52vk-0\">\n        Hello\n        <button class=\"⭐️ml52vk-0\">\n          Toggle\n        </button>\n      </div>\n    </div>\n    <!--/qv-->\n  </host>\n  `\n  );\n});\n\ntest('should render component external props', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <RenderProps thing=\"World\" q:slot=\"start\" innerHTML=\"123\" dangerouslySetInnerHTML=\"432\" />\n  );\n  await expectRendered(\n    fixture,\n    '<render-props><span>{\"thing\":\"World\",\"innerHTML\":\"123\",\"dangerouslySetInnerHTML\":\"432\"}</span></render-props>'\n  );\n});\n\ntest('should render a blank component', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <InnerHTMLComponent />);\n  await expectRendered(fixture, `<div><span>WORKS</span></div>`);\n});\n\ntest('should render a div then a component', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <ToggleRootComponent />);\n  await expectDOM(\n    fixture.host,\n    `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n      <!--qv -->\n      <div aria-hidden=\"false\">\n        <div class=\"normal\">Normal div</div>\n        <button>toggle</button>\n      </div>\n      <!--/qv-->\n    </host>`\n  );\n  await trigger(fixture.host, 'button', 'click');\n  await expectDOM(\n    fixture.host,\n    `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n      <!--qv -->\n      <div aria-hidden=\"true\">\n        <!--qv -->\n        <div><div>this is ToggleChild</div></div>\n        <!--/qv-->\n        <button>toggle</button>\n      </div>\n      <!--/qv-->\n    </host>\n    `\n  );\n});\n\ntest('should process clicks', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <Counter step={5} />);\n  await expectDOM(\n    fixture.host,\n    `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n      <!--qv -->\n      <button class=\"decrement\">-</button>\n      <span>0</span>\n      <button class=\"increment\">+</button>\n      <!--/qv-->\n    </host>`\n  );\n  await trigger(fixture.host, 'button.increment', 'click');\n  await expectDOM(\n    fixture.host,\n    `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n      <!--qv -->\n      <button class=\"decrement\">-</button>\n      <span>5</span>\n      <button class=\"increment\">+</button>\n      <!--/qv-->\n    </host>`\n  );\n});\n\ntest('should project no content', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <Project></Project>);\n  await expectRendered(\n    fixture,\n    `\n      <section>\n        <!--qv q:key q:sref=0 q:s-->\n        <!--/qv-->\n        <!--qv q:key=details q:sref=0 q:s-->\n        <!--/qv-->\n        <!--qv q:key=description q:sref=0 q:s-->\n        <!--/qv-->\n      </section>`\n  );\n});\n\ntest('should project un-named slot text', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <Project>projection</Project>);\n  await expectRendered(\n    fixture,\n    `\n      <section>\n        <!--qv q:key q:sref=0 q:s-->\n        projection\n        <!--/qv-->\n        <!--qv q:key=details q:sref=0 q:s-->\n        <!--/qv-->\n        <!--qv q:key=description q:sref=0 q:s-->\n        <!--/qv-->\n      </section>`\n  );\n});\n\ntest('should project un-named slot component', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <Project>\n      <HelloWorld />\n    </Project>\n  );\n});\n\ntest('should render host events on the first element', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <UseEvents />);\n  await expectDOM(\n    fixture.host,\n    `\n  <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n    <!--qv -->\n    hello\n    <div>\n      thing\n    </div>\n    stuff\n    <!--/qv-->\n  </host>`\n  );\n});\n\ntest('should project named slot component', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <Project>\n      PROJECTION\n      <span q:slot=\"details\">DETAILS</span>\n      <span q:slot=\"description\">DESCRIPTION</span>\n    </Project>\n  );\n  await expectRendered(\n    fixture,\n    `\n      <section>\n        <!--qv q:key q:sref=0 q:s-->\n        PROJECTION\n        <!--/qv-->\n        <!--qv q:key=details q:sref=0 q:s-->\n        <span q:slot=\"details\">DETAILS</span>\n        <!--/qv-->\n        <!--qv q:key=description q:sref=0 q:s-->\n        <span q:slot=\"description\">DESCRIPTION</span>\n        <!--/qv-->\n      </section>`\n  );\n});\n\ntest('should project multiple slot with same name', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <Project>\n      <span q:slot=\"details\">DETAILS1</span>\n      <span q:slot=\"details\">DETAILS2</span>\n      <span q:slot=\"ignore\">IGNORE</span>\n    </Project>\n  );\n  await expectDOM(\n    fixture.host,\n    `\n    <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n      <!--qv -->\n      <q:template q:slot=\"ignore\" hidden=\"\" aria-hidden=\"true\">\n        <span q:slot=\"ignore\">IGNORE</span>\n      </q:template>\n      <section>\n        <!--qv q:key q:sref=0 q:s-->\n        <!--/qv-->\n        <!--qv q:key=details q:sref=0 q:s-->\n        <span q:slot=\"details\">DETAILS1</span>\n        <span q:slot=\"details\">DETAILS2</span>\n        <!--/qv-->\n        <!--qv q:key=description q:sref=0 q:s-->\n        <!--/qv-->\n      </section>\n      <!--/qv-->\n    </host>\n    `\n  );\n});\ntest('should not destroy projection when <Project> reruns', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <SimpleProject>\n      <span>PROJECTION</span>\n    </SimpleProject>\n  );\n  await expectRendered(\n    fixture,\n    `\n      <section>\n        <!--qv q:key q:sref=0 q:s-->\n        <span>PROJECTION</span>\n        <!--/qv-->\n      </section>`\n  );\n});\n\ntest('should render into host component', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <divfixture\n      on:click=\"./lazy.js\"\n      onscrolling=\"./test.js\"\n      hostAttrs={JSON.stringify({\n        id: 'TEST',\n        class: { thing: true },\n        name: 'NAME',\n      })}\n      content=\"CONTENT\"\n    />\n  );\n  await expectRendered(\n    fixture,\n    `\n      <divfixture\n        on:click=\"./lazy.js\"\n        onscrolling=\"./test.js\"\n        hostattrs='{\"id\":\"TEST\",\"class\":{\"thing\":true},\"name\":\"NAME\"}'\n        content=\"CONTENT\"\n      >\n      </divfixture>`\n  );\n});\n\ntest('should render a promise', async () => {\n  const fixture = new ElementFixture();\n  await render(fixture.host, <div>{Promise.resolve('WORKS')}</div>);\n  await expectRendered(fixture, '<div>WORKS</div>');\n});\n\ntest('should render a component with hooks', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <Hooks />);\n  await expectRendered(\n    fixture,\n    `\n    <div>\n      <div id=\"effect\">true</div>\n      <div id=\"effect-destroy\"></div>\n      <div id=\"watch\">true</div>\n      <div id=\"watch-destroy\"></div>\n      <div id=\"server-mount\">false</div>\n      <div id=\"reference\">true</div>\n    </div>`\n  );\n\n  await pauseContainer(fixture.host);\n  await expectRendered(\n    fixture,\n    `\n    <div>\n      <div id=\"effect\">true</div>\n      <div id=\"effect-destroy\">true</div>\n      <div id=\"watch\">true</div>\n      <div id=\"watch-destroy\">true</div>\n      <div id=\"server-mount\">false</div>\n      <div id=\"reference\">true</div>\n    </div>`\n  );\n});\n\ntest('should insert a style', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <HelloWorld name=\"World\" />);\n  const style = fixture.document.querySelector(`style[q\\\\:style]`);\n  assert.include(style!.textContent!, 'color: red');\n  await expectRendered(fixture, '<span>Hello World</span>');\n});\ntest('should render #text nodes', async () => {\n  const fixture = new ElementFixture();\n\n  const lines = ['hola', 'adios'];\n  await render(\n    fixture.host,\n    <svg viewBox=\"0 0 100 4\" class={'svg-container'}>\n      {lines.map((a) => {\n        return (\n          <text class={'svg-text'} style={{ color: a }}>\n            Hola {a}\n          </text>\n        );\n      })}\n    </svg>\n  );\n  await expectRendered(\n    fixture,\n    `\n      <svg viewBox=\"0 0 100 4\" class=\"svg-container\">\n        <text class=\"svg-text\" style=\"color: hola\">Hola hola</text>\n        <text class=\"svg-text\" style=\"color: adios\">Hola adios</text>\n      </svg>`\n  );\n\n  // Ensure all SVG elements have the SVG namespace\n  const namespaces = Array.from(fixture.host.querySelectorAll('text')).map(\n    (e: any) => e.namespaceURI\n  );\n  assert.deepEqual(namespaces, ['http://www.w3.org/2000/svg', 'http://www.w3.org/2000/svg']);\n});\n\ntest('should render class object correctly', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <div\n      class={{\n        stuff: true,\n        other: false,\n        'm-0 p-2': true,\n      }}\n    ></div>\n  );\n  await expectRendered(fixture, `<div class=\"stuff m-0 p-2\"></div>`);\n});\n\ntest('should render class array correctly', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <div class={['stuff', '', 'm-0 p-2', null, 'active', undefined, 'container']}></div>\n  );\n  await expectRendered(fixture, `<div class=\"stuff m-0 p-2 active container\"></div>`);\n});\n\ntest('should re-render classes correctly', async () => {\n  const fixture = new ElementFixture();\n\n  await render(fixture.host, <RenderClasses></RenderClasses>);\n  await expectDOM(\n    fixture.host,\n    `\n  <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n    <!--qv -->\n    <button class=\"increment\">+</button>\n    <div class=\"stuff m-0 p-2\">Div 1</div>\n    <div class=\"stuff m-0 p-2 active container\">Div 2</div>\n    <!--/qv-->\n  </host>`\n  );\n\n  await trigger(fixture.host, 'button', 'click');\n\n  await expectDOM(\n    fixture.host,\n    `\n  <host q:version=\"dev\" q:container=\"resumed\" q:render=\"dom-dev\">\n    <!--qv -->\n    <button class=\"increment\">+</button>\n    <div class=\"other\">Div 1</div>\n    <div class=\"stuff m-0 p-2 almost-null active container\">Div 2</div>\n    <!--/qv-->\n  </host>`\n  );\n});\n\ntest('should render camelCase attributes', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <svg id=\"my-svg\" viewBox=\"0 0 100 4\" preserveAspectRatio=\"none\">\n      <a href=\"/path\"></a>\n    </svg>\n  );\n  await expectRendered(\n    fixture,\n    `\n      <svg id=\"my-svg\" viewBox=\"0 0 100 4\" preserveAspectRatio=\"none\">\n        <a href=\"/path\"></a>\n      </svg>`\n  );\n});\n\ntest('should render path', async () => {\n  const fixture = new ElementFixture();\n\n  await render(\n    fixture.host,\n    <div>\n      <a href=\"#\">Dude!!</a>\n      <svg id=\"my-svg\" viewBox=\"0 0 100 4\" preserveAspectRatio=\"none\">\n        <path\n          id=\"my-svg-path\"\n          d=\"M 0,2 L 100,2\"\n          stroke=\"#FFEA82\"\n          stroke-width=\"4\"\n          fill-opacity=\"0\"\n        />\n      </svg>\n    </div>\n  );\n  await expectRendered(\n    fixture,\n    `\n      <div>\n        <a href=\"#\">Dude!!</a>\n        <svg id=\"my-svg\" viewBox=\"0 0 100 4\" preserveAspectRatio=\"none\">\n          <path\n            id=\"my-svg-path\"\n            d=\"M 0,2 L 100,2\"\n            stroke=\"#FFEA82\"\n            stroke-width=\"4\"\n            fill-opacity=\"0\"\n          ></path>\n        </svg>\n      </div>`\n  );\n});\n\ntest('should render foreignObject properly', async () => {\n  const fixture = new ElementFixture();\n\n  const Text = 'text' as any;\n  await render(\n    fixture.host,\n    <div class=\"is-html\">\n      <Text class=\"is-html\" shouldKebab=\"true\">\n        Start\n      </Text>\n      <svg class=\"is-svg\" preserveAspectRatio=\"true\">\n        <Text class=\"is-svg\" shouldCamelCase=\"true\">\n          start\n        </Text>\n        <foreignObject class=\"is-svg\">\n          <div class=\"is-html\">hello</div>\n          <svg class=\"is-svg\">\n            <feGaussianBlur class=\"is-svg\"></feGaussianBlur>\n            <foreignObject class=\"is-svg\">\n              <foreignObject class=\"is-html\"></foreignObject>\n              <div class=\"is-html\">Still outside svg</div>\n            </foreignObject>\n          </svg>\n          <feGaussianBlur class=\"is-html\">bye</feGaussianBlur>\n        </foreignObject>\n        <text class=\"is-svg\">Hello</text>\n        <text class=\"is-svg\">Bye</text>\n      </svg>\n      <text class=\"is-html\">end</text>\n    </div>\n  );\n  for (const el of Array.from(fixture.host.querySelectorAll('.is-html'))) {\n    assert.equal(el.namespaceURI, 'http://www.w3.org/1999/xhtml', el.outerHTML);\n  }\n  for (const el of Array.from(fixture.host.querySelectorAll('.is-svg'))) {\n    assert.equal(el.namespaceURI, 'http://www.w3.org/2000/svg', el.outerHTML);\n  }\n\n  await expectRendered(\n    fixture,\n    `\n    <div class=\"is-html\">\n      <text class=\"is-html\" shouldkebab=\"true\">Start</text>\n      <svg class=\"is-svg\" preserveAspectRatio=\"true\">\n        <text class=\"is-svg\" shouldCamelCase=\"true\">start</text>\n        <foreignObject class=\"is-svg\">\n          <div class=\"is-html\">hello</div>\n          <svg class=\"is-svg\">\n            <feGaussianBlur class=\"is-svg\"></feGaussianBlur>\n            <foreignObject class=\"is-svg\">\n              <foreignobject class=\"is-html\"></foreignobject>\n              <div class=\"is-html\">Still outside svg</div>\n            </foreignObject>\n          </svg>\n          <fegaussianblur class=\"is-html\">bye</fegaussianblur>\n        </foreignObject>\n        <text class=\"is-svg\">Hello</text>\n        <text class=\"is-svg\">Bye</text>\n      </svg>\n      <text class=\"is-html\">end</text>\n    </div>`\n  );\n});\n\ntest('should clean up subscriptions after calling the returned cleanup function', async () => {\n  const fixture = new ElementFixture();\n\n  const spies = {\n    cleanup: false,\n  };\n\n  const { cleanup } = await render(fixture.host, <CleanupComponent spies={spies} />);\n\n  cleanup();\n\n  assert.equal(spies.cleanup, true);\n});\n\ntest('should clean up nested subscriptions after calling the returned cleanup function', async () => {\n  const fixture = new ElementFixture();\n\n  const spies = {\n    parentCleanup: false,\n    cleanup: false,\n    slottedCleanup: false,\n  };\n\n  const { cleanup } = await render(\n    fixture.host,\n    <ParentCleanupComponent spies={spies}>\n      <SlottedCleanupComponent spies={spies} />\n    </ParentCleanupComponent>\n  );\n\n  cleanup();\n\n  assert.equal(spies.parentCleanup, true);\n  assert.equal(spies.cleanup, true);\n  assert.equal(spies.slottedCleanup, true);\n});\n\nasync function expectRendered(fixture: ElementFixture, expected: string) {\n  const firstNode = getFirstNode(fixture.host);\n  return await expectDOM(firstNode, expected);\n}\n\nfunction getFirstNode(el: Element) {\n  let firstNode = el.firstElementChild!;\n  while (firstNode.nodeName === 'STYLE') {\n    firstNode = firstNode.nextElementSibling!;\n  }\n  return firstNode;\n}\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Hello World\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const HelloWorld = component$((props: { name?: string }) => {\n  useStylesQrl(inlinedQrl(`span.� { color: red; }`, 'style-1'));\n  const state = useStore({ salutation: 'Hello' });\n  return (\n    <span>\n      {state.salutation} {props.name || 'World'}\n    </span>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Hello World\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const HelloWorldScoped = component$(() => {\n  useStylesScopedQrl(inlinedQrl(`.stuff { color: red; }`, 'style-scoped-1'));\n  const state = useStore({ cond: false });\n  return (\n    <div>\n      {state.cond && (\n        <div key=\"a\">\n          Hello\n          <button onClick$={() => (state.cond = !state.cond)}>Toggle</button>\n        </div>\n      )}\n      {!state.cond && (\n        <div key=\"b\" class=\"stuff\" aria-hidden=\"true\">\n          Hello\n          <button onClick$={() => (state.cond = !state.cond)}>Toggle</button>\n        </div>\n      )}\n    </div>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Hello World\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const RenderProps = component$((props: Record<string, any>) => {\n  return (\n    <render-props href={props.href}>\n      <span>{JSON.stringify(props)}</span>\n    </render-props>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Render Classes\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const RenderClasses = component$(() => {\n  const state = useStore({\n    count: 0,\n  });\n  return (\n    <>\n      <button\n        class=\"increment\"\n        onClick$={inlinedQrl(Counter_add, 'Counteradd', [state, { value: 1 }])}\n      >\n        +\n      </button>\n      <div\n        class={{\n          stuff: state.count % 2 === 0,\n          other: state.count % 2 === 1,\n          'm-0 p-2': state.count % 2 === 0,\n        }}\n      >\n        Div 1\n      </div>\n      <div\n        class={[\n          'stuff',\n          '',\n          'm-0 p-2',\n          state.count % 2 === 0 ? null : 'almost-null',\n          'active',\n          undefined,\n          'container',\n        ]}\n      >\n        Div 2\n      </div>\n    </>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Counter\n//////////////////////////////////////////////////////////////////////////////////////////\n\nexport const Counter = component$((props: { step?: number }) => {\n  const state = useStore({ count: 0 });\n  const step = Number(props.step || 1);\n  return (\n    <>\n      <button\n        class=\"decrement\"\n        onClick$={inlinedQrl(Counter_add, 'Counteradd', [state, { value: -step }])}\n      >\n        -\n      </button>\n      <span>{state.count}</span>\n      <button\n        class=\"increment\"\n        onClick$={inlinedQrl(Counter_add, 'Counteradd', [state, { value: step }])}\n      >\n        +\n      </button>\n    </>\n  );\n});\nexport const Counter_add = () => {\n  const [state, args] = useLexicalScope();\n  state.count += args.value;\n};\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// Project\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const Project = component$(() => {\n  return (\n    <section>\n      <Slot></Slot>\n      <Slot name=\"details\"></Slot>\n      <Slot name=\"description\"></Slot>\n    </section>\n  );\n});\n\nexport const SimpleProject = component$(() => {\n  return (\n    <section>\n      <Slot></Slot>\n    </section>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\n// HostFixture\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const HostFixture = component$((props: { hostAttrs?: string; content?: string }) => {\n  return <div {...JSON.parse(props.hostAttrs || '{}')}>{props.content}</div>;\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const InnerHTMLComponent = component$(() => {\n  const html = '<span>WORKS</span>';\n  return (\n    <div dangerouslySetInnerHTML={html}>\n      <div>not rendered</div>\n    </div>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\n\nexport const ToggleRootComponent = component$(() => {\n  const state = useStore({\n    cond: false,\n  });\n  return (\n    <div aria-hidden={state.cond ? 'true' : 'false'}>\n      {state.cond ? <ToggleChild /> : <div class=\"normal\">Normal div</div>}\n      <button onClick$={() => (state.cond = !state.cond)}>toggle</button>\n    </div>\n  );\n});\n\nexport const ToggleChild = component$(() => {\n  return (\n    <div>\n      <div>this is ToggleChild</div>\n    </div>\n  );\n});\n\nexport const Transparent = component$(() => {\n  return <Slot></Slot>;\n});\n\nexport const UseEvents = component$(() => {\n  useVisibleTask$(() => {\n    console.warn('hello');\n  });\n  useOn(\n    'click',\n    inlinedQrl(() => {\n      console.warn('click');\n    }, 'use-on-click')\n  );\n  return (\n    <>\n      hello\n      <div>thing</div>\n      stuff\n    </>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\nexport const Hooks = component$(() => {\n  const taskDestroyDiv = useSignal<HTMLElement>();\n  const visibleTaskDiv = useSignal<HTMLElement>();\n  const visibleTaskDestroyDiv = useSignal<HTMLElement>();\n\n  const state = useStore({\n    task: 'false',\n    server: 'false',\n  });\n\n  useTask$(() => {\n    state.task = 'true';\n    return () => {\n      taskDestroyDiv.value!.textContent = 'true';\n    };\n  });\n\n  useVisibleTask$(() => {\n    visibleTaskDiv.value!.textContent = 'true';\n    return () => {\n      visibleTaskDestroyDiv.value!.textContent = 'true';\n    };\n  });\n\n  return (\n    <div>\n      <div id=\"effect\" ref={visibleTaskDiv}></div>\n      <div id=\"effect-destroy\" ref={visibleTaskDestroyDiv}></div>\n\n      <div id=\"watch\">{state.task}</div>\n      <div id=\"watch-destroy\" ref={taskDestroyDiv}></div>\n\n      <div id=\"server-mount\">{state.server}</div>\n\n      <div id=\"reference\">true</div>\n    </div>\n  );\n});\n\n//////////////////////////////////////////////////////////////////////////////////////////\n\ninterface CleanupProps {\n  spies: {\n    parentCleanup?: boolean;\n    cleanup?: boolean;\n    slottedCleanup?: boolean;\n  };\n}\n\nexport const ParentCleanupComponent = component$((props: CleanupProps) => {\n  useTask$(({ cleanup }) => {\n    cleanup(() => {\n      props.spies.parentCleanup = true;\n    });\n  });\n\n  return (\n    <div>\n      <div id=\"parent-cleanup\">true</div>\n      <CleanupComponent spies={props.spies}>\n        <Slot />\n      </CleanupComponent>\n    </div>\n  );\n});\n\nexport const CleanupComponent = component$((props: CleanupProps) => {\n  useTask$(({ cleanup }) => {\n    cleanup(() => {\n      props.spies.cleanup = true;\n    });\n  });\n\n  return (\n    <div>\n      <div id=\"cleanup\">true</div>\n      <Slot />\n    </div>\n  );\n});\n\nexport const SlottedCleanupComponent = component$((props: CleanupProps) => {\n  useTask$(({ cleanup }) => {\n    cleanup(() => {\n      props.spies.slottedCleanup = true;\n    });\n  });\n\n  return (\n    <div>\n      <div id=\"slotted-cleanup\">true</div>\n    </div>\n  );\n});\n\nsuite('should properly render styles from style prop', () => {\n  const RenderJSX = component$(() => {\n    const pStyles = {\n      fontSize: 30, // auto-converted to px\n      fontWeight: 800, // shouldn't get converted to px\n    };\n    return (\n      <main id=\"root\">\n        <div\n          style={{\n            marginTop: 50, // auto-converted to px\n            height: 200, // auto-converted to px\n            width: 200, // auto-converted to px\n            backgroundColor: 'red',\n          }}\n        >\n          <p style={pStyles}>Big square</p>\n        </div>\n      </main>\n    );\n  });\n\n  test('SSR jsx style render', async () => {\n    const output = await renderToString(<RenderJSX />, { containerTagName: 'div' });\n    const document = createDocument();\n    document.body.innerHTML = output.html;\n    const main = document.querySelector('#root')!;\n    const resultHTML = `<div style=\"margin-top:50px;height:200px;width:200px;background-color:red\"><p style=\"font-size:30px;font-weight:800\">Big square</p></div>`;\n    assert.equal(main.innerHTML, resultHTML);\n  });\n\n  test('CSR jsx style render', async () => {\n    const { screen, render } = await createDOM();\n\n    await render(<RenderJSX />);\n    const main = screen.querySelector('#root')!;\n    const resultHTML = `<div style=\"margin-top:50px;height:200px;width:200px;background-color:red\"><p style=\"font-size:30px;font-weight:800\">Big square</p></div>`;\n    assert.equal(main.innerHTML, resultHTML);\n  });\n});\n\ntest('should render value=\"\" on option', async () => {\n  const { screen, render } = await createDOM();\n\n  await render(\n    <select>\n      <option value=\"\">Empty</option>\n    </select>\n  );\n  const option = screen.querySelector('option')!;\n  assert.isTrue(option.hasAttribute('value'));\n  assert.equal(option.getAttribute('value'), '');\n  assert.equal(option.outerHTML, '<option value=\"\">Empty</option>');\n});\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/signals.ts",
    "content": "import { getLastSubscription, type SubscriberSignal } from '../../state/common';\nimport { getContext, tryGetContext } from '../../state/context';\nimport { trackSignal } from '../../use/use-core';\nimport { logError } from '../../util/log';\nimport { serializeClassWithHost, stringifyStyle } from '../execute-component';\nimport type { RenderContext } from '../types';\nimport { insertBefore, removeNode } from './operations';\nimport { getVdom, processData, type ProcessedJSXNode } from './render-dom';\nimport type { QwikElement } from './virtual-element';\nimport { SVG_NS, createElm, diffVnode, getVnodeFromEl, smartSetProperty } from './visitor';\nimport { Virtual, JSXNodeImpl } from '../jsx/jsx-runtime';\nimport { isPromise } from '../../util/promises';\nimport { isQwikElement } from '../../util/element';\n\nexport const executeSignalOperation = (rCtx: RenderContext, operation: SubscriberSignal) => {\n  try {\n    const type = operation[0];\n    const staticCtx = rCtx.$static$;\n    switch (type) {\n      case 1:\n      case 2: {\n        let elm;\n        let hostElm;\n        if (type === 1) {\n          elm = operation[1];\n          hostElm = operation[3];\n        } else {\n          elm = operation[3];\n          hostElm = operation[1];\n        }\n        // assertTrue(elm.isConnected, 'element must be connected to the dom');\n        // assertTrue(hostElm.isConnected, 'host element must be connected to the dom');\n        const elCtx = tryGetContext(elm);\n        if (elCtx == null) {\n          return;\n        }\n        const prop = operation[4];\n        const isSVG = elm.namespaceURI === SVG_NS;\n        staticCtx.$containerState$.$subsManager$.$clearSignal$(operation);\n        let value = trackSignal(operation[2], operation.slice(0, -1) as any) as any;\n        if (prop === 'class') {\n          value = serializeClassWithHost(value, tryGetContext(hostElm));\n        } else if (prop === 'style') {\n          value = stringifyStyle(value);\n        }\n        const vdom = getVdom(elCtx);\n        if (prop in vdom.$props$ && vdom.$props$[prop] === value) {\n          return;\n        }\n        vdom.$props$[prop] = value;\n        return smartSetProperty(staticCtx, elm, prop, value, isSVG);\n      }\n      case 3:\n      case 4: {\n        const elm = operation[3];\n        if (!staticCtx.$visited$.includes(elm)) {\n          // assertTrue(elm.isConnected, 'text node must be connected to the dom');\n          staticCtx.$containerState$.$subsManager$.$clearSignal$(operation);\n          // MISKO: I believe no `invocationContext` is OK because the JSX in signal\n          // has already been converted to JSX and there is nothing to execute there.\n          const invocationContext = undefined;\n          let signalValue = trackSignal(operation[2], operation.slice(0, -1) as any);\n          const subscription = getLastSubscription()!;\n\n          if (Array.isArray(signalValue)) {\n            signalValue = new JSXNodeImpl<typeof Virtual>(Virtual, {}, null, signalValue, 0, null);\n          }\n          let newVnode = processData(signalValue, invocationContext) as\n            | ProcessedJSXNode\n            | undefined;\n          if (isPromise(newVnode)) {\n            logError('Rendering promises in JSX signals is not supported');\n          } else {\n            if (newVnode === undefined) {\n              newVnode = processData('', invocationContext) as ProcessedJSXNode;\n            }\n            const oldVnode = getVnodeFromEl(elm);\n            const element = getQwikElement(operation[1]);\n            rCtx.$cmpCtx$ = getContext(element, rCtx.$static$.$containerState$);\n            if (\n              oldVnode.$type$ == newVnode.$type$ &&\n              oldVnode.$key$ == newVnode.$key$ &&\n              oldVnode.$id$ == newVnode.$id$\n            ) {\n              diffVnode(rCtx, oldVnode, newVnode, 0);\n            } else {\n              const promises: Promise<any>[] = []; // TODO(misko): hook this up\n              const oldNode = oldVnode.$elm$;\n              const newElm = createElm(rCtx, newVnode, 0, promises);\n              if (promises.length) {\n                logError('Rendering promises in JSX signals is not supported');\n              }\n              subscription[3] = newElm;\n              insertBefore(rCtx.$static$, elm.parentElement!, newElm, oldNode);\n              oldNode && removeNode(staticCtx, oldNode);\n            }\n          }\n        }\n      }\n    }\n  } catch (e) {\n    // Ignore\n  }\n};\nfunction getQwikElement(element: QwikElement | Text): QwikElement {\n  while (element) {\n    if (isQwikElement(element)) {\n      return element;\n    }\n    element = element.parentElement!;\n  }\n  throw new Error('Not found');\n}\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/virtual-element.ts",
    "content": "import { assertEqual, assertFail, assertTrue } from '../../error/assert';\nimport { VIRTUAL_SYMBOL } from '../../state/constants';\nimport {\n  isComment,\n  isElement,\n  isNodeElement,\n  isQwikElement,\n  isVirtualElement,\n} from '../../util/element';\nimport { qSerialize, seal } from '../../util/qdev';\nimport { directGetAttribute } from '../fast-calls';\nimport { createElement } from './operations';\nimport { SVG_NS, getChildren } from './visitor';\n\nexport interface VirtualElement {\n  readonly open: Comment;\n  readonly close: Comment;\n  readonly isSvg: boolean;\n  readonly insertBefore: <T extends Node>(node: T, child: Node | null) => T;\n  readonly appendChild: <T extends Node>(node: T) => T;\n  readonly insertBeforeTo: (newParent: QwikElement, child: Node | null) => void;\n  readonly appendTo: (newParent: QwikElement) => void;\n  readonly ownerDocument: Document;\n  readonly namespaceURI: string;\n  readonly nodeType: 111;\n  readonly childNodes: Node[];\n  readonly firstChild: Node | null;\n  readonly previousSibling: Node | null;\n  readonly nextSibling: Node | null;\n  readonly remove: () => void;\n  readonly closest: (query: string) => Element | null;\n  readonly hasAttribute: (prop: string) => boolean;\n  readonly getAttribute: (prop: string) => string | null;\n  readonly removeAttribute: (prop: string) => void;\n  readonly querySelector: (query: string) => QwikElement | null;\n  readonly querySelectorAll: (query: string) => QwikElement[];\n  readonly compareDocumentPosition: (other: Node) => number;\n  readonly matches: (query: string) => boolean;\n  readonly setAttribute: (prop: string, value: string) => void;\n  readonly removeChild: (node: Node) => void;\n  readonly localName: string;\n  readonly nodeName: string;\n  readonly isConnected: boolean;\n  readonly parentElement: Element | null;\n  innerHTML: string;\n}\n\nexport type QwikElement = Element | VirtualElement;\n\nexport const newVirtualElement = (doc: Document, isSvg: boolean): VirtualElement => {\n  const open = doc.createComment('qv ');\n  const close = doc.createComment('/qv');\n  return new VirtualElementImpl(open, close, isSvg);\n};\n\nexport const parseVirtualAttributes = (str: string): Record<string, string> => {\n  if (!str) {\n    return {};\n  }\n  const attributes = str.split(' ');\n  return Object.fromEntries(\n    attributes.map((attr) => {\n      const index = attr.indexOf('=');\n      if (index >= 0) {\n        return [attr.slice(0, index), unescape(attr.slice(index + 1))];\n      } else {\n        return [attr, ''];\n      }\n    })\n  );\n};\n\nexport const serializeVirtualAttributes = (map: Record<string, string>) => {\n  const attributes: string[] = [];\n  Object.entries(map).forEach(([key, value]) => {\n    if (!value) {\n      attributes.push(`${key}`);\n    } else {\n      attributes.push(`${key}=${escape(value)}`);\n    }\n  });\n  return attributes.join(' ');\n};\n\nconst SHOW_COMMENT = 128;\nconst FILTER_ACCEPT = 1;\nconst FILTER_REJECT = 2;\n\nexport const walkerVirtualByAttribute = (el: Element, prop: string, value: string) => {\n  return el.ownerDocument.createTreeWalker(el, SHOW_COMMENT, {\n    acceptNode(c) {\n      const virtual = getVirtualElement(c as Comment);\n      if (virtual) {\n        return directGetAttribute(virtual, prop) === value ? FILTER_ACCEPT : FILTER_REJECT;\n      }\n      return FILTER_REJECT;\n    },\n  });\n};\n\nexport const queryVirtualByAttribute = (el: Element, prop: string, value: string) => {\n  const walker = walkerVirtualByAttribute(el, prop, value);\n  const open = walker.firstChild();\n  if (open) {\n    return getVirtualElement(open as Comment);\n  }\n  return null;\n};\n\nexport const queryAllVirtualByAttribute = (el: Element, prop: string, value: string) => {\n  const walker = walkerVirtualByAttribute(el, prop, value);\n  const pars: VirtualElement[] = [];\n  let currentNode: Node | null = null;\n  while ((currentNode = walker.nextNode())) {\n    pars.push(getVirtualElement(currentNode as Comment)!);\n  }\n  return pars;\n};\n\nexport const escape = (s: string) => {\n  return s.replace(/ /g, '+');\n};\n\nexport const unescape = (s: string) => {\n  return s.replace(/\\+/g, ' ');\n};\n\nexport const VIRTUAL = ':virtual';\n\nexport class VirtualElementImpl implements VirtualElement {\n  ownerDocument: Document;\n  _qc_: any = null;\n\n  readonly nodeType = 111 as const;\n  readonly localName = VIRTUAL;\n  readonly nodeName = VIRTUAL;\n\n  private $attributes$: Record<string, string>;\n  private $template$: HTMLTemplateElement;\n\n  constructor(\n    readonly open: Comment,\n    readonly close: Comment,\n    readonly isSvg: boolean\n  ) {\n    const doc = (this.ownerDocument = open.ownerDocument);\n    this.$template$ = createElement(doc, 'template', false) as HTMLTemplateElement;\n    this.$attributes$ = parseVirtualAttributes(open.data.slice(3));\n    assertTrue(open.data.startsWith('qv '), 'comment is not a qv');\n    (open as any)[VIRTUAL_SYMBOL] = this;\n    (close as any)[VIRTUAL_SYMBOL] = this;\n    seal(this);\n  }\n\n  insertBefore<T extends Node>(node: T, ref: Node | null): T {\n    const parent = this.parentElement;\n    if (parent) {\n      const ref2 = ref ? ref : this.close;\n      parent.insertBefore(node, ref2);\n    } else {\n      this.$template$.insertBefore(node, ref);\n    }\n    return node;\n  }\n\n  remove() {\n    const parent = this.parentElement;\n    if (parent) {\n      const ch = this.childNodes;\n      assertEqual(this.$template$.childElementCount, 0, 'children should be empty');\n      parent.removeChild(this.open);\n      for (let i = 0; i < ch.length; i++) {\n        this.$template$.appendChild(ch[i]);\n      }\n      parent.removeChild(this.close);\n    }\n  }\n\n  appendChild<T extends Node>(node: T): T {\n    return this.insertBefore(node, null);\n  }\n\n  insertBeforeTo(newParent: QwikElement, child: Node | null) {\n    // const ch = this.childNodes;\n    const ch = this.childNodes;\n    // TODO\n    // if (this.parentElement) {\n    //   console.warn('already attached');\n    // }\n    newParent.insertBefore(this.open, child);\n    for (const c of ch) {\n      newParent.insertBefore(c, child);\n    }\n    newParent.insertBefore(this.close, child);\n    assertEqual(this.$template$.childElementCount, 0, 'children should be empty');\n  }\n\n  appendTo(newParent: QwikElement) {\n    this.insertBeforeTo(newParent, null);\n  }\n\n  get namespaceURI() {\n    return this.parentElement?.namespaceURI ?? '';\n  }\n\n  removeChild(child: Node) {\n    if (this.parentElement) {\n      this.parentElement.removeChild(child);\n    } else {\n      this.$template$.removeChild(child);\n    }\n  }\n\n  getAttribute(prop: string) {\n    return this.$attributes$[prop] ?? null;\n  }\n\n  hasAttribute(prop: string) {\n    return prop in this.$attributes$;\n  }\n\n  setAttribute(prop: string, value: string) {\n    this.$attributes$[prop] = value;\n    if (qSerialize) {\n      this.open.data = updateComment(this.$attributes$);\n    }\n  }\n\n  removeAttribute(prop: string) {\n    delete this.$attributes$[prop];\n    if (qSerialize) {\n      this.open.data = updateComment(this.$attributes$);\n    }\n  }\n\n  matches(_: string) {\n    return false;\n  }\n\n  compareDocumentPosition(other: Node) {\n    return this.open.compareDocumentPosition(other);\n  }\n\n  closest(query: string) {\n    const parent = this.parentElement;\n    if (parent) {\n      return parent.closest(query);\n    }\n    return null;\n  }\n\n  querySelectorAll(query: string) {\n    const result: QwikElement[] = [];\n    const ch = getChildren(this, isNodeElement);\n    ch.forEach((el) => {\n      if (isQwikElement(el)) {\n        if (el.matches(query)) {\n          result.push(el);\n        }\n        result.concat(Array.from(el.querySelectorAll(query)));\n      }\n    });\n    return result;\n  }\n\n  querySelector(query: string) {\n    for (const el of this.childNodes) {\n      if (isElement(el)) {\n        if (el.matches(query)) {\n          return el;\n        }\n        const v = el.querySelector(query);\n        if (v !== null) {\n          return v;\n        }\n      }\n    }\n    return null;\n  }\n\n  get innerHTML() {\n    return '';\n  }\n\n  set innerHTML(html: string) {\n    const parent = this.parentElement;\n    if (parent) {\n      this.childNodes.forEach((a) => this.removeChild(a));\n      this.$template$.innerHTML = html;\n      parent.insertBefore(this.$template$.content, this.close);\n    } else {\n      this.$template$.innerHTML = html;\n    }\n  }\n\n  get firstChild() {\n    if (this.parentElement) {\n      const first = this.open.nextSibling;\n      if (first === this.close) {\n        return null;\n      }\n      return first;\n    } else {\n      return this.$template$.firstChild;\n    }\n  }\n  get nextSibling() {\n    return this.close.nextSibling;\n  }\n  get previousSibling() {\n    return this.open.previousSibling;\n  }\n  get childNodes(): Node[] {\n    if (!this.parentElement) {\n      return Array.from(this.$template$.childNodes) as any;\n    }\n    const nodes: Node[] = [];\n    let node: Node | null = this.open;\n    while ((node = node.nextSibling)) {\n      if (node === this.close) {\n        break;\n      }\n      nodes.push(node);\n    }\n    return nodes;\n  }\n  get isConnected() {\n    return this.open.isConnected;\n  }\n  /** The DOM parent element (not the vDOM parent, use findVirtual for that) */\n  get parentElement() {\n    return this.open.parentElement;\n  }\n}\n\nconst updateComment = (attributes: Record<string, string>) => {\n  return `qv ${serializeVirtualAttributes(attributes)}`;\n};\n\nexport const processVirtualNodes = <T extends Node | null>(node: T): T | VirtualElement => {\n  if (node == null) {\n    return null as T;\n  }\n\n  if (isComment(node)) {\n    const virtual = getVirtualElement(node);\n    if (virtual) {\n      return virtual;\n    }\n  }\n  return node;\n};\n\nconst findClose = (open: Comment): Comment => {\n  let node: Node | null = open;\n  let stack = 1;\n  while ((node = node.nextSibling)) {\n    if (isComment(node)) {\n      // We don't want to resume virtual nodes but if they're already resumed, use them\n      const virtual = (node as any)[VIRTUAL_SYMBOL] as ChildNode;\n      if (virtual) {\n        // This is not our existing virtual node because otherwise findClose wouldn't have been called\n        node = virtual;\n      } else if (node.data.startsWith('qv ')) {\n        stack++;\n      } else if (node.data === '/qv') {\n        stack--;\n        if (stack === 0) {\n          return node;\n        }\n      }\n    }\n  }\n  assertFail('close not found');\n};\n\nexport const getVirtualElement = (open: Comment): VirtualElement | null => {\n  const virtual = (open as any)[VIRTUAL_SYMBOL];\n  if (virtual) {\n    return virtual;\n  }\n  if (open.data.startsWith('qv ')) {\n    const close = findClose(open);\n    return new VirtualElementImpl(open, close, open.parentElement?.namespaceURI === SVG_NS);\n  }\n  return null;\n};\n\nexport const getRootNode = (node: Node | VirtualElement | null): Node => {\n  if (node == null) {\n    return null as any; // TODO\n  }\n  if (isVirtualElement(node)) {\n    return node.open;\n  } else {\n    return node;\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/dom/visitor.ts",
    "content": "import type { OnRenderFn } from '../../component/component.public';\nimport { getEventName, setRef, type ContainerState } from '../../container/container';\nimport {\n  assertDefined,\n  assertElement,\n  assertEqual,\n  assertFail,\n  assertQwikElement,\n  assertTrue,\n} from '../../error/assert';\nimport { assertQrl, isQrl } from '../../qrl/qrl-class';\nimport { PREVENT_DEFAULT, isOnProp, setEvent } from '../../state/listeners';\nimport { isElement, isQwikElement, isText, isVirtualElement } from '../../util/element';\nimport { logWarn } from '../../util/log';\nimport { ELEMENT_ID, OnRenderProp, QSlot, QSlotRef, QSlotS, QStyle } from '../../util/markers';\nimport { isPromise, maybeThen, promiseAll, promiseAllLazy } from '../../util/promises';\nimport { qDev, qInspector, qTest } from '../../util/qdev';\nimport type { ValueOrPromise } from '../../util/types';\nimport {\n  dangerouslySetInnerHTML,\n  isAriaAttribute,\n  jsxToString,\n  pushRenderContext,\n  serializeClassWithHost,\n  setQId,\n  static_listeners,\n  static_subtree,\n  stringifyStyle,\n} from '../execute-component';\nimport { directGetAttribute, directSetAttribute } from '../fast-calls';\nimport { SKIP_RENDER_TYPE, isJSXNode } from '../jsx/jsx-runtime';\nimport type { RenderContext, RenderStaticContext } from '../types';\nimport {\n  ProcessedJSXNodeImpl,\n  getVdom,\n  processData,\n  renderComponent,\n  type ProcessedJSXNode,\n} from './render-dom';\nimport {\n  VIRTUAL,\n  getRootNode,\n  newVirtualElement,\n  processVirtualNodes,\n  queryAllVirtualByAttribute,\n  type QwikElement,\n  type VirtualElement,\n} from './virtual-element';\n\n// keep this import from qwik/build so the cjs build works\nimport { isBrowser } from '@builder.io/qwik/build';\nimport {\n  getProxyTarget,\n  getSubscriptionManager,\n  type SubscriberC,\n  type SubscriptionManager,\n} from '../../state/common';\nimport { _IMMUTABLE, _IMMUTABLE_PREFIX } from '../../state/constants';\nimport {\n  HOST_FLAG_DIRTY,\n  HOST_FLAG_NEED_ATTACH_LISTENER,\n  cleanupContext,\n  createContext,\n  getContext,\n  tryGetContext,\n  type QContext,\n} from '../../state/context';\nimport { isSignal } from '../../state/signal';\nimport { ReadWriteProxyHandler, createPropsState, createProxy } from '../../state/store';\nimport { trackSignal } from '../../use/use-core';\nimport { EMPTY_OBJ } from '../../util/flyweight';\nimport {\n  appendChild,\n  createElement,\n  createTemplate,\n  executeDOMRender,\n  getKey,\n  insertAfter,\n  insertBefore,\n  prepend,\n  removeNode,\n  setAttribute,\n  setKey,\n  setProperty,\n  setPropertyPost,\n} from './operations';\n\nexport const SVG_NS = 'http://www.w3.org/2000/svg';\n\nexport const IS_SVG = 1 << 0;\nexport const IS_HEAD = 1 << 1;\nexport const IS_IMMUTABLE = 1 << 2;\n\ntype KeyToIndexMap = { [key: string]: number };\n\nconst CHILDREN_PLACEHOLDER: ProcessedJSXNode[] = [];\ntype PropHandler = (\n  staticCtx: RenderStaticContext,\n  el: HTMLElement,\n  newValue: any,\n  ProcessedJSXNodeImpl: string\n) => boolean;\n\nexport type ChildrenMode = 'root' | 'head' | 'elements';\n\nexport const smartUpdateChildren = (\n  ctx: RenderContext,\n  oldVnode: ProcessedJSXNode,\n  newVnode: ProcessedJSXNode,\n  flags: number\n) => {\n  assertQwikElement(oldVnode.$elm$);\n\n  const ch = newVnode.$children$;\n  if (ch.length === 1 && ch[0].$type$ === SKIP_RENDER_TYPE) {\n    newVnode.$children$ = oldVnode.$children$;\n    return;\n  }\n  const elm = oldVnode.$elm$;\n  const needsDOMRead = oldVnode.$children$ === CHILDREN_PLACEHOLDER;\n  let filter = isChildComponent;\n  if (needsDOMRead) {\n    const isHead = elm.nodeName === 'HEAD';\n    if (isHead) {\n      filter = isHeadChildren;\n      flags |= IS_HEAD;\n    }\n  }\n\n  const oldCh = getVnodeChildren(oldVnode, filter);\n  if (oldCh.length > 0 && ch.length > 0) {\n    return diffChildren(ctx, elm, oldCh, ch, flags);\n  } else if (oldCh.length > 0 && ch.length === 0) {\n    return removeChildren(ctx.$static$, oldCh, 0, oldCh.length - 1);\n  } else if (ch.length > 0) {\n    return addChildren(ctx, elm, null, ch, 0, ch.length - 1, flags);\n  }\n};\n\nexport const getVnodeChildren = (\n  oldVnode: ProcessedJSXNode,\n  filter: (el: Node | VirtualElement) => boolean\n) => {\n  const oldCh = oldVnode.$children$;\n  const elm = oldVnode.$elm$ as Element;\n  if (oldCh === CHILDREN_PLACEHOLDER) {\n    return (oldVnode.$children$ = getChildrenVnodes(elm, filter));\n  }\n  return oldCh;\n};\n\nexport const diffChildren = (\n  ctx: RenderContext,\n  parentElm: QwikElement,\n  oldCh: ProcessedJSXNode[],\n  newCh: ProcessedJSXNode[],\n  flags: number\n): ValueOrPromise<void> => {\n  let oldStartIdx = 0;\n  let newStartIdx = 0;\n  let oldEndIdx = oldCh.length - 1;\n  let oldStartVnode = oldCh[0] as ProcessedJSXNode | undefined;\n  let oldEndVnode = oldCh[oldEndIdx] as ProcessedJSXNode | undefined;\n  let newEndIdx = newCh.length - 1;\n  let newStartVnode = newCh[0] as ProcessedJSXNode | undefined;\n  let newEndVnode = newCh[newEndIdx] as ProcessedJSXNode | undefined;\n  let oldKeyToIdx: KeyToIndexMap | undefined;\n  let idxInOld: number;\n  let elmToMove: ProcessedJSXNode;\n  const results: any[] = [];\n  const staticCtx = ctx.$static$;\n\n  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n    if (oldStartVnode == null) {\n      oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left\n    } else if (oldEndVnode == null) {\n      oldEndVnode = oldCh[--oldEndIdx];\n    } else if (newStartVnode == null) {\n      newStartVnode = newCh[++newStartIdx];\n    } else if (newEndVnode == null) {\n      newEndVnode = newCh[--newEndIdx];\n    } else if (oldStartVnode.$id$ === newStartVnode.$id$) {\n      results.push(diffVnode(ctx, oldStartVnode, newStartVnode, flags));\n      oldStartVnode = oldCh[++oldStartIdx];\n      newStartVnode = newCh[++newStartIdx];\n    } else if (oldEndVnode.$id$ === newEndVnode.$id$) {\n      results.push(diffVnode(ctx, oldEndVnode, newEndVnode, flags));\n      oldEndVnode = oldCh[--oldEndIdx];\n      newEndVnode = newCh[--newEndIdx];\n    } else if (oldStartVnode.$key$ && oldStartVnode.$id$ === newEndVnode.$id$) {\n      assertDefined(oldStartVnode.$elm$, 'oldStartVnode $elm$ must be defined');\n      assertDefined(oldEndVnode.$elm$, 'oldEndVnode $elm$ must be defined');\n\n      // Vnode moved right\n      results.push(diffVnode(ctx, oldStartVnode, newEndVnode, flags));\n      insertAfter(staticCtx, parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$);\n      oldStartVnode = oldCh[++oldStartIdx];\n      newEndVnode = newCh[--newEndIdx];\n    } else if (oldEndVnode.$key$ && oldEndVnode.$id$ === newStartVnode.$id$) {\n      assertDefined(oldStartVnode.$elm$, 'oldStartVnode $elm$ must be defined');\n      assertDefined(oldEndVnode.$elm$, 'oldEndVnode $elm$ must be defined');\n\n      // Vnode moved left\n      results.push(diffVnode(ctx, oldEndVnode, newStartVnode, flags));\n      insertBefore(staticCtx, parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);\n      oldEndVnode = oldCh[--oldEndIdx];\n      newStartVnode = newCh[++newStartIdx];\n    } else {\n      if (oldKeyToIdx === undefined) {\n        oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\n      }\n      idxInOld = oldKeyToIdx[newStartVnode.$key$ as string];\n      if (idxInOld === undefined) {\n        // New element\n        const newElm = createElm(ctx, newStartVnode, flags, results);\n        insertBefore(staticCtx, parentElm, newElm, oldStartVnode?.$elm$);\n      } else {\n        elmToMove = oldCh[idxInOld];\n        if (elmToMove.$type$ !== newStartVnode.$type$) {\n          const newElm = createElm(ctx, newStartVnode, flags, results);\n          // TO CHECK: should we not await these promises?\n          maybeThen(newElm, (newElm) => {\n            insertBefore(staticCtx, parentElm, newElm, oldStartVnode?.$elm$);\n          });\n        } else {\n          results.push(diffVnode(ctx, elmToMove, newStartVnode, flags));\n          oldCh[idxInOld] = undefined as any;\n          assertDefined(elmToMove.$elm$, 'elmToMove $elm$ must be defined');\n          insertBefore(staticCtx, parentElm, elmToMove.$elm$, oldStartVnode.$elm$);\n        }\n      }\n      newStartVnode = newCh[++newStartIdx];\n    }\n  }\n\n  if (newStartIdx <= newEndIdx) {\n    const before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$;\n    results.push(addChildren(ctx, parentElm, before, newCh, newStartIdx, newEndIdx, flags));\n  }\n\n  let wait = promiseAll(results) as any;\n  if (oldStartIdx <= oldEndIdx) {\n    wait = maybeThen(wait, () => {\n      removeChildren(staticCtx, oldCh, oldStartIdx, oldEndIdx);\n    });\n  }\n  return wait;\n};\n\nexport const getChildren = (elm: QwikElement, filter: (el: Node | VirtualElement) => boolean) => {\n  const end = isVirtualElement(elm) ? elm.close : null;\n  const nodes: (Node | VirtualElement)[] = [];\n  let node: Node | null | VirtualElement = elm.firstChild;\n  while ((node = processVirtualNodes(node))) {\n    if (filter(node)) {\n      nodes.push(node);\n    }\n    node = node.nextSibling;\n    if (node === end) {\n      break;\n    }\n  }\n  return nodes;\n};\n\n// export const getChildren = (elm: QwikElement, mode: ChildrenMode): (Node | VirtualElement)[] => {\n//   // console.warn('DOM READ: getChildren()', elm);\n//   switch (mode) {\n//     case 'root':\n//       return getCh(elm, isChildComponent);\n//     case 'head':\n//       return getCh(elm, isHeadChildren);\n//     case 'elements':\n//       return getCh(elm, isNodeElement);\n//   }\n// };\n\nconst getChildrenVnodes = (elm: QwikElement, filter: (el: Node | VirtualElement) => boolean) => {\n  return getChildren(elm, filter).map(getVnodeFromEl);\n};\n\nexport const getVnodeFromEl = (el: Node | VirtualElement) => {\n  if (isElement(el)) {\n    return tryGetContext(el)?.$vdom$ ?? domToVnode(el);\n  }\n  return domToVnode(el);\n};\n\nexport const domToVnode = (node: Node | VirtualElement): ProcessedJSXNode => {\n  if (isQwikElement(node)) {\n    const t = new ProcessedJSXNodeImpl(\n      node.localName,\n      {},\n      null,\n      CHILDREN_PLACEHOLDER,\n      0,\n      getKey(node)\n    );\n    t.$elm$ = node;\n    return t;\n  } else if (isText(node)) {\n    const t = new ProcessedJSXNodeImpl(\n      node.nodeName,\n      EMPTY_OBJ,\n      null,\n      CHILDREN_PLACEHOLDER,\n      0,\n      null\n    );\n    t.$text$ = node.data;\n    t.$elm$ = node;\n    return t;\n  }\n  assertFail('Invalid node type');\n};\n\nconst isHeadChildren = (node: Node | VirtualElement): boolean => {\n  const type = node.nodeType;\n  if (type === 1) {\n    return (node as Element).hasAttribute('q:head');\n  }\n  return type === 111;\n};\n\nexport const isSlotTemplate = (node: Node | VirtualElement): node is Element => {\n  return node.nodeName === 'Q:TEMPLATE';\n};\n\nexport const isChildComponent = (node: Node | VirtualElement): boolean => {\n  const type = node.nodeType;\n  if (type === 3 || type === 111) {\n    return true;\n  }\n  if (type !== 1) {\n    return false;\n  }\n  const nodeName = node.nodeName;\n  if (nodeName === 'Q:TEMPLATE') {\n    return false;\n  }\n  if (nodeName === 'HEAD') {\n    return (node as Element).hasAttribute('q:head');\n  }\n  if (nodeName === 'STYLE') {\n    return !(node as Element).hasAttribute(QStyle);\n  }\n  return true;\n};\n\nexport const splitChildren = (input: ProcessedJSXNode[]): Record<string, ProcessedJSXNode> => {\n  const output: Record<string, ProcessedJSXNode> = {};\n  for (const item of input) {\n    const key = getSlotName(item);\n    const node =\n      output[key] ??\n      (output[key] = new ProcessedJSXNodeImpl(\n        VIRTUAL,\n        {\n          [QSlotS]: '',\n        },\n        null,\n        [],\n        0,\n        key\n      ));\n    node.$children$.push(item);\n  }\n  return output;\n};\n\nexport const diffVnode = (\n  rCtx: RenderContext,\n  oldVnode: ProcessedJSXNode,\n  newVnode: ProcessedJSXNode,\n  flags: number\n): ValueOrPromise<void> => {\n  assertEqual(oldVnode.$type$, newVnode.$type$, 'old and new vnodes type must be the same');\n  assertEqual(oldVnode.$key$, newVnode.$key$, 'old and new vnodes key must be the same');\n  assertEqual(oldVnode.$id$, newVnode.$id$, 'old and new vnodes key must be the same');\n  const elm = oldVnode.$elm$;\n  const tag = newVnode.$type$;\n  const staticCtx = rCtx.$static$;\n  const containerState = staticCtx.$containerState$;\n  const currentComponent = rCtx.$cmpCtx$;\n  assertDefined(elm, 'while patching element must be defined');\n  assertDefined(currentComponent, 'while patching current component must be defined');\n\n  newVnode.$elm$ = elm;\n\n  // Render text nodes\n  if (tag === '#text') {\n    staticCtx.$visited$.push(elm);\n    const signal = newVnode.$signal$;\n    if (signal) {\n      newVnode.$text$ = jsxToString(\n        trackSignal(signal, [4, currentComponent.$element$, signal, elm as Text])\n      );\n    }\n    setProperty(staticCtx, elm, 'data', newVnode.$text$);\n    return;\n  } else if (tag === '#signal') {\n    return;\n  }\n  assertQwikElement(elm);\n\n  const props = newVnode.$props$;\n  const vnodeFlags = newVnode.$flags$;\n  const elCtx = getContext(elm, containerState);\n\n  if (tag !== VIRTUAL) {\n    // Track SVG state\n    let isSvg = (flags & IS_SVG) !== 0;\n    if (!isSvg && tag === 'svg') {\n      flags |= IS_SVG;\n      isSvg = true;\n    }\n\n    if (props !== EMPTY_OBJ) {\n      // elCtx.$vdom$ = newVnode;\n      if ((vnodeFlags & static_listeners) === 0) {\n        elCtx.li.length = 0;\n      }\n      const values = oldVnode.$props$;\n      newVnode.$props$ = values;\n      for (const prop in props) {\n        let newValue = props[prop];\n        if (prop === 'ref') {\n          assertElement(elm);\n          if (newValue !== undefined) {\n            setRef(newValue, elm);\n          }\n          continue;\n        }\n\n        if (isOnProp(prop)) {\n          const normalized = setEvent(elCtx.li, prop, newValue, containerState.$containerEl$);\n          addQwikEvent(staticCtx, elm, normalized);\n          continue;\n        }\n\n        if (isSignal(newValue)) {\n          newValue = trackSignal(newValue, [1, currentComponent.$element$, newValue, elm, prop]);\n        }\n        if (prop === 'class') {\n          newValue = serializeClassWithHost(newValue, currentComponent);\n        } else if (prop === 'style') {\n          newValue = stringifyStyle(newValue);\n        }\n        if (values[prop] !== newValue) {\n          values[prop] = newValue;\n          smartSetProperty(staticCtx, elm as HTMLElement, prop, newValue, isSvg);\n        }\n      }\n    }\n    if (vnodeFlags & static_subtree) {\n      return;\n    }\n\n    if (isSvg && tag === 'foreignObject') {\n      flags &= ~IS_SVG;\n    }\n\n    const setsInnerHTML = props[dangerouslySetInnerHTML] !== undefined;\n    if (setsInnerHTML) {\n      if (qDev && newVnode.$children$.length > 0) {\n        logWarn('Node can not have children when innerHTML is set');\n      }\n      return;\n    }\n    if (tag === 'textarea') {\n      return;\n    }\n    return smartUpdateChildren(rCtx, oldVnode, newVnode, flags);\n  } else if (OnRenderProp in props) {\n    const cmpProps = props.props;\n    setComponentProps(containerState, elCtx, cmpProps);\n    let needsRender = !!(elCtx.$flags$ & HOST_FLAG_DIRTY);\n    // TODO: review this corner case\n    if (!needsRender && !elCtx.$componentQrl$ && !elCtx.$element$.hasAttribute(ELEMENT_ID)) {\n      setQId(rCtx, elCtx);\n      elCtx.$componentQrl$ = cmpProps[OnRenderProp];\n      assertQrl(elCtx.$componentQrl$ as any);\n      needsRender = true;\n    }\n\n    // Rendering of children of component is more complicated,\n    // since the children must be projected into the rendered slots\n    // In addition, nested children might need rerendering, if that's the case\n    // we need to render the nested component, and wait before projecting the content\n    // since otherwise we don't know where the slots\n    if (needsRender) {\n      return maybeThen(renderComponent(rCtx, elCtx, flags), () =>\n        renderContentProjection(rCtx, elCtx, newVnode, flags)\n      );\n    }\n    return renderContentProjection(rCtx, elCtx, newVnode, flags);\n  } else if (QSlotS in props) {\n    assertDefined(currentComponent.$slots$, 'current component slots must be a defined array');\n    currentComponent.$slots$.push(newVnode);\n    return;\n  } else if (dangerouslySetInnerHTML in props) {\n    setProperty(staticCtx, elm, 'innerHTML', props[dangerouslySetInnerHTML]);\n    return;\n  }\n  if (vnodeFlags & static_subtree) {\n    return;\n  }\n  return smartUpdateChildren(rCtx, oldVnode, newVnode, flags);\n};\n\nconst renderContentProjection = (\n  rCtx: RenderContext,\n  hostCtx: QContext,\n  vnode: ProcessedJSXNode,\n  flags: number\n): ValueOrPromise<void> => {\n  if (vnode.$flags$ & static_subtree) {\n    return;\n  }\n  const newChildren = vnode.$children$;\n  const staticCtx = rCtx.$static$;\n  const splittedNewChildren = splitChildren(newChildren);\n  const slotMaps = getSlotMap(hostCtx);\n\n  // Remove content from empty slots\n  for (const key in slotMaps.slots) {\n    if (!splittedNewChildren[key]) {\n      const slotEl = slotMaps.slots[key];\n      const oldCh = getChildrenVnodes(slotEl, isChildComponent);\n      if (oldCh.length > 0) {\n        // getVdom(slotEl).$children$ = [];\n        const slotCtx = tryGetContext(slotEl);\n        if (slotCtx && slotCtx.$vdom$) {\n          slotCtx.$vdom$.$children$ = [];\n        }\n        removeChildren(staticCtx, oldCh, 0, oldCh.length - 1);\n      }\n    }\n  }\n\n  // Remove empty templates\n  for (const key in slotMaps.templates) {\n    const templateEl = slotMaps.templates[key];\n    if (templateEl && !splittedNewChildren[key]) {\n      slotMaps.templates[key] = undefined;\n      removeNode(staticCtx, templateEl);\n    }\n  }\n\n  // Render into slots\n  return promiseAll(\n    Object.keys(splittedNewChildren).map((slotName) => {\n      const newVdom = splittedNewChildren[slotName];\n      const slotCtx = getSlotCtx(\n        staticCtx,\n        slotMaps,\n        hostCtx,\n        slotName,\n        rCtx.$static$.$containerState$\n      );\n      const oldVdom = getVdom(slotCtx);\n      const slotRctx = pushRenderContext(rCtx);\n      const slotEl = slotCtx.$element$ as VirtualElement;\n      slotRctx.$slotCtx$ = slotCtx;\n      slotCtx.$vdom$ = newVdom;\n      newVdom.$elm$ = slotEl;\n      let newFlags = flags & ~IS_SVG;\n      if (slotEl.isSvg) {\n        newFlags |= IS_SVG;\n      }\n\n      const index = staticCtx.$addSlots$.findIndex((slot) => slot[0] === slotEl);\n      if (index >= 0) {\n        staticCtx.$addSlots$.splice(index, 1);\n      }\n      return smartUpdateChildren(slotRctx, oldVdom, newVdom, newFlags);\n    })\n  ) as any;\n};\n\nconst addChildren = (\n  ctx: RenderContext,\n  parentElm: QwikElement,\n  before: Node | VirtualElement | null,\n  vnodes: ProcessedJSXNode[],\n  startIdx: number,\n  endIdx: number,\n  flags: number\n): ValueOrPromise<void> => {\n  const promises: Promise<any>[] = [];\n  for (; startIdx <= endIdx; ++startIdx) {\n    const ch = vnodes[startIdx];\n    assertDefined(ch, 'render: node must be defined at index', startIdx, vnodes);\n    const elm = createElm(ctx, ch, flags, promises);\n    insertBefore(ctx.$static$, parentElm, elm, before);\n  }\n  return promiseAllLazy(promises);\n};\n\nconst removeChildren = (\n  staticCtx: RenderStaticContext,\n  nodes: ProcessedJSXNode[],\n  startIdx: number,\n  endIdx: number\n): void => {\n  for (; startIdx <= endIdx; ++startIdx) {\n    const ch = nodes[startIdx];\n    if (ch) {\n      assertDefined(ch.$elm$, 'vnode elm must be defined');\n      removeNode(staticCtx, ch.$elm$);\n    }\n  }\n};\n\nconst getSlotCtx = (\n  staticCtx: RenderStaticContext,\n  slotMaps: SlotMaps,\n  hostCtx: QContext,\n  slotName: string,\n  containerState: ContainerState\n): QContext => {\n  // If a slot is known, render children inside\n  const slotEl = slotMaps.slots[slotName];\n  if (slotEl) {\n    return getContext(slotEl, containerState);\n  }\n  // Otherwise we park the children in a template\n  const templateEl = slotMaps.templates[slotName];\n  if (templateEl) {\n    return getContext(templateEl, containerState);\n  }\n  const template = createTemplate(staticCtx.$doc$, slotName);\n  const elCtx = createContext(template);\n  elCtx.$parentCtx$ = hostCtx;\n  prepend(staticCtx, hostCtx.$element$, template);\n  slotMaps.templates[slotName] = template;\n  return elCtx;\n};\n\nconst getSlotName = (node: ProcessedJSXNode): string => {\n  return node.$props$[QSlot] ?? '';\n};\n\nexport const createElm = (\n  rCtx: RenderContext,\n  vnode: ProcessedJSXNode,\n  flags: number,\n  promises: Promise<any>[]\n): Node | VirtualElement => {\n  const tag = vnode.$type$;\n  const doc = rCtx.$static$.$doc$;\n  const currentComponent = rCtx.$cmpCtx$;\n  if (tag === '#text') {\n    return (vnode.$elm$ = doc.createTextNode(vnode.$text$));\n  }\n\n  if (tag === '#signal') {\n    const signal = vnode.$signal$!;\n    assertDefined(signal, 'expecting signal here');\n    assertDefined(currentComponent, 'signals can not be used outside components');\n    const signalValue = signal.value;\n    if (isJSXNode(signalValue)) {\n      // convert signal value to ProcessedJSXNode\n      const processedSignal = processData(signalValue);\n      if (isSignal(processedSignal)) {\n        throw new Error('NOT IMPLEMENTED: Promise');\n      } else if (Array.isArray(processedSignal)) {\n        throw new Error('NOT IMPLEMENTED: Array');\n      } else {\n        // crate elements\n        const elm = createElm(rCtx, processedSignal as ProcessedJSXNode, flags, promises);\n        // create subscription\n        trackSignal(\n          signal,\n          flags & IS_IMMUTABLE\n            ? ([3, elm, signal, elm] as SubscriberC)\n            : ([4, currentComponent.$element$, signal, elm] as SubscriberC)\n        );\n        // update the vNode for future diff.\n        return (vnode.$elm$ = elm);\n      }\n    } else {\n      // create element\n      const elm = doc.createTextNode(vnode.$text$);\n      elm.data = vnode.$text$ = jsxToString(signalValue);\n      // create subscription\n      trackSignal(\n        signal,\n        flags & IS_IMMUTABLE\n          ? ([3, elm, signal, elm] as SubscriberC)\n          : ([4, currentComponent.$element$, signal, elm] as SubscriberC)\n      );\n      // update the vNode for future diff.\n      return (vnode.$elm$ = elm);\n    }\n  }\n\n  let elm: QwikElement;\n  let isSvg = !!(flags & IS_SVG);\n  if (!isSvg && tag === 'svg') {\n    flags |= IS_SVG;\n    isSvg = true;\n  }\n  const isVirtual = tag === VIRTUAL;\n  const props = vnode.$props$;\n  const staticCtx = rCtx.$static$;\n  const containerState = staticCtx.$containerState$;\n  if (isVirtual) {\n    elm = newVirtualElement(doc, isSvg);\n  } else if (tag === 'head') {\n    elm = doc.head;\n    flags |= IS_HEAD;\n  } else {\n    elm = createElement(doc, tag, isSvg);\n    flags &= ~IS_HEAD;\n  }\n  if (vnode.$flags$ & static_subtree) {\n    flags |= IS_IMMUTABLE;\n  }\n\n  vnode.$elm$ = elm;\n  const elCtx = createContext(elm);\n  if (rCtx.$slotCtx$) {\n    elCtx.$parentCtx$ = rCtx.$slotCtx$;\n    elCtx.$realParentCtx$ = rCtx.$cmpCtx$!;\n  } else {\n    elCtx.$parentCtx$ = rCtx.$cmpCtx$;\n  }\n  if (!isVirtual) {\n    if (qDev && qInspector) {\n      const dev = vnode.$dev$;\n      if (dev) {\n        directSetAttribute(\n          elm,\n          'data-qwik-inspector',\n          `${dev.fileName}:${dev.lineNumber}:${dev.columnNumber}`\n        );\n      }\n    }\n    if (vnode.$immutableProps$) {\n      const immProps =\n        props !== EMPTY_OBJ\n          ? Object.fromEntries(\n              Object.entries(vnode.$immutableProps$).map(([k, v]) => [\n                k,\n                v === _IMMUTABLE ? props[k] : v,\n              ])\n            )\n          : vnode.$immutableProps$;\n      setProperties(staticCtx, elCtx, currentComponent, immProps, isSvg, true);\n    }\n    if (props !== EMPTY_OBJ) {\n      elCtx.$vdom$ = vnode;\n      const p = vnode.$immutableProps$\n        ? Object.fromEntries(Object.entries(props).filter(([k]) => !(k in vnode.$immutableProps$!)))\n        : props;\n      vnode.$props$ = setProperties(staticCtx, elCtx, currentComponent, p, isSvg, false);\n    }\n    if (isSvg && tag === 'foreignObject') {\n      isSvg = false;\n      flags &= ~IS_SVG;\n    }\n    if (currentComponent) {\n      const scopedIds = currentComponent.$scopeIds$;\n      if (scopedIds) {\n        scopedIds.forEach((styleId) => {\n          (elm as Element).classList.add(styleId);\n        });\n      }\n      if (currentComponent.$flags$ & HOST_FLAG_NEED_ATTACH_LISTENER) {\n        elCtx.li.push(...currentComponent.li);\n        currentComponent.$flags$ &= ~HOST_FLAG_NEED_ATTACH_LISTENER;\n      }\n    }\n    for (const listener of elCtx.li) {\n      addQwikEvent(staticCtx, elm, listener[0]);\n    }\n    const setsInnerHTML = props[dangerouslySetInnerHTML] !== undefined;\n    if (setsInnerHTML) {\n      if (qDev && vnode.$children$.length > 0) {\n        logWarn('Node can not have children when innerHTML is set');\n      }\n      return elm;\n    }\n    if (isSvg && tag === 'foreignObject') {\n      isSvg = false;\n      flags &= ~IS_SVG;\n    }\n  } else if (OnRenderProp in props) {\n    const renderQRL = props[OnRenderProp];\n    assertQrl<OnRenderFn<any>>(renderQRL);\n    const target = createPropsState();\n    const manager = containerState.$subsManager$.$createManager$();\n    const proxy = new Proxy(target, new ReadWriteProxyHandler(containerState, manager));\n    const expectProps = props.props;\n    containerState.$proxyMap$.set(target, proxy);\n    elCtx.$props$ = proxy;\n    if (expectProps !== EMPTY_OBJ) {\n      const immutableMeta = ((target as any)[_IMMUTABLE] =\n        (expectProps as any)[_IMMUTABLE] ?? EMPTY_OBJ);\n\n      for (const prop in expectProps) {\n        if (prop !== 'children' && prop !== QSlot) {\n          const immutableValue = immutableMeta[prop];\n          if (isSignal(immutableValue)) {\n            target[_IMMUTABLE_PREFIX + prop] = immutableValue;\n          } else {\n            target[prop] = expectProps[prop];\n          }\n        }\n      }\n    }\n    setQId(rCtx, elCtx);\n\n    // Run mount hook\n    elCtx.$componentQrl$ = renderQRL;\n\n    const wait = maybeThen(renderComponent(rCtx, elCtx, flags), () => {\n      let children = vnode.$children$;\n      if (children.length === 0) {\n        return;\n      }\n      if (children.length === 1 && children[0].$type$ === SKIP_RENDER_TYPE) {\n        children = children[0].$children$;\n      }\n      const slotMap = getSlotMap(elCtx);\n      const p: Promise<void>[] = [];\n      const splittedNewChildren = splitChildren(children);\n      for (const slotName in splittedNewChildren) {\n        const newVnode = splittedNewChildren[slotName];\n        const slotCtx = getSlotCtx(staticCtx, slotMap, elCtx, slotName, staticCtx.$containerState$);\n        const slotRctx = pushRenderContext(rCtx);\n        const slotEl = slotCtx.$element$ as VirtualElement;\n        slotRctx.$slotCtx$ = slotCtx;\n        slotCtx.$vdom$ = newVnode;\n        newVnode.$elm$ = slotEl;\n        let newFlags = flags & ~IS_SVG;\n        if (slotEl.isSvg) {\n          newFlags |= IS_SVG;\n        }\n        for (const node of newVnode.$children$) {\n          const nodeElm = createElm(slotRctx, node, newFlags, p);\n          assertDefined(node.$elm$, 'vnode elm must be defined');\n          assertEqual(nodeElm, node.$elm$, 'vnode elm must be defined');\n          appendChild(staticCtx, slotEl, nodeElm);\n        }\n      }\n      return promiseAllLazy(p);\n    });\n    if (isPromise(wait)) {\n      promises.push(wait);\n    }\n    return elm;\n  } else if (QSlotS in props) {\n    assertDefined(currentComponent, 'slot can only be used inside component');\n    assertDefined(currentComponent.$slots$, 'current component slots must be a defined array');\n\n    setKey(elm, vnode.$key$);\n    directSetAttribute(elm, QSlotRef, currentComponent.$id$);\n    directSetAttribute(elm, QSlotS, '');\n    currentComponent.$slots$.push(vnode);\n    staticCtx.$addSlots$.push([elm, currentComponent.$element$]);\n  } else if (dangerouslySetInnerHTML in props) {\n    setProperty(staticCtx, elm, 'innerHTML', props[dangerouslySetInnerHTML]);\n    return elm;\n  }\n\n  let children = vnode.$children$;\n  if (children.length === 0) {\n    return elm;\n  }\n  if (children.length === 1 && children[0].$type$ === SKIP_RENDER_TYPE) {\n    children = children[0].$children$;\n  }\n  const nodes = children.map((ch) => createElm(rCtx, ch, flags, promises));\n  for (const node of nodes) {\n    directAppendChild(elm, node);\n  }\n  return elm;\n};\n\ninterface SlotMaps {\n  slots: Record<string, QwikElement>;\n  templates: Record<string, Element | undefined>;\n}\n\nconst getSlots = (elCtx: QContext): ProcessedJSXNode[] => {\n  const slots = elCtx.$slots$;\n  if (!slots) {\n    const parent = elCtx.$element$.parentElement;\n    assertDefined(parent, 'component should be already attached to the dom');\n    return (elCtx.$slots$ = readDOMSlots(elCtx));\n  }\n  return slots;\n};\n\nconst getSlotMap = (elCtx: QContext): SlotMaps => {\n  const slotsArray = getSlots(elCtx);\n  const slots: Record<string, QwikElement> = {};\n  const templates: Record<string, Element | undefined> = {};\n  const t = Array.from(elCtx.$element$.childNodes).filter(isSlotTemplate);\n\n  // Map virtual slots\n  for (const vnode of slotsArray) {\n    assertQwikElement(vnode.$elm$);\n    slots[vnode.$key$ ?? ''] = vnode.$elm$;\n  }\n  // Map templates\n  for (const elm of t) {\n    templates[directGetAttribute(elm, QSlot) ?? ''] = elm;\n  }\n  return { slots, templates };\n};\n\nconst readDOMSlots = (elCtx: QContext): ProcessedJSXNode[] => {\n  const parent = elCtx.$element$.parentElement;\n  assertDefined(parent, 'component should be already attached to the dom');\n  return queryAllVirtualByAttribute(parent, QSlotRef, elCtx.$id$).map(domToVnode);\n};\n\nconst handleStyle: PropHandler = (ctx, elm, newValue) => {\n  setProperty(ctx, elm.style, 'cssText', newValue);\n  return true;\n};\n\nconst handleClass: PropHandler = (ctx, elm, newValue) => {\n  assertTrue(\n    newValue == null || typeof newValue === 'string',\n    'class newValue must be either nullish or string',\n    newValue\n  );\n  if (elm.namespaceURI === SVG_NS) {\n    setAttribute(ctx, elm, 'class', newValue);\n  } else {\n    setProperty(ctx, elm, 'className', newValue);\n  }\n  return true;\n};\n\nconst checkBeforeAssign: PropHandler = (ctx, elm, newValue, prop) => {\n  if (prop in elm) {\n    // a selected <option> is different from a selected <option value> (innerText vs '')\n    if ((elm as any)[prop] !== newValue || (prop === 'value' && !elm.hasAttribute(prop))) {\n      if (\n        // we must set value last so that it adheres to min,max,step\n        prop === 'value' &&\n        // but we must also set options first so they are present before updating select\n        elm.tagName !== 'OPTION'\n      ) {\n        setPropertyPost(ctx, elm, prop, newValue);\n      } else {\n        setProperty(ctx, elm, prop, newValue);\n      }\n    }\n    return true;\n  }\n  return false;\n};\n\nconst forceAttribute: PropHandler = (ctx, elm, newValue, prop) => {\n  setAttribute(ctx, elm, prop.toLowerCase(), newValue);\n  return true;\n};\n\nconst setInnerHTML: PropHandler = (ctx, elm, newValue) => {\n  setProperty(ctx, elm, 'innerHTML', newValue);\n  return true;\n};\n\nconst noop: PropHandler = () => {\n  return true;\n};\n\nexport const PROP_HANDLER_MAP: Record<string, PropHandler | undefined> = {\n  style: handleStyle,\n  class: handleClass,\n  className: handleClass,\n  value: checkBeforeAssign,\n  checked: checkBeforeAssign,\n  href: forceAttribute,\n  list: forceAttribute,\n  form: forceAttribute,\n  tabIndex: forceAttribute,\n  download: forceAttribute,\n  innerHTML: noop,\n  [dangerouslySetInnerHTML]: setInnerHTML,\n};\n\nexport const smartSetProperty = (\n  staticCtx: RenderStaticContext,\n  elm: QwikElement,\n  prop: string,\n  newValue: any,\n  isSvg: boolean\n) => {\n  // aria attribute value should be rendered as string\n  if (isAriaAttribute(prop)) {\n    setAttribute(staticCtx, elm, prop, newValue != null ? String(newValue) : newValue);\n    return;\n  }\n\n  // Check if its an exception\n  const exception = PROP_HANDLER_MAP[prop];\n  if (exception) {\n    if (exception(staticCtx, elm as HTMLElement, newValue, prop)) {\n      return;\n    }\n  }\n\n  // Check if property in prototype\n  if (!isSvg && prop in elm) {\n    setProperty(staticCtx, elm, prop, newValue);\n    return;\n  }\n\n  if (prop.startsWith(PREVENT_DEFAULT)) {\n    registerQwikEvent(prop.slice(PREVENT_DEFAULT.length));\n  }\n\n  // Fallback to render attribute\n  setAttribute(staticCtx, elm, prop, newValue);\n};\n\nexport const areExactQRLs = (oldValue: any, newValue: any) => {\n  if (!isQrl(oldValue) || !isQrl(newValue) || oldValue.$hash$ !== newValue.$hash$) {\n    return false;\n  }\n  const cA = oldValue.$captureRef$;\n  const cB = newValue.$captureRef$;\n  if (cA && cB) {\n    return sameArrays(cA, cB);\n  }\n  return false;\n};\n\nexport const sameArrays = (a1: any[], a2: any[]) => {\n  const len = a1.length;\n  if (len !== a2.length) {\n    return false;\n  }\n\n  for (let i = 0; i < len; i++) {\n    if (a1[i] !== a2[i]) {\n      return false;\n    }\n  }\n  return true;\n};\n\nexport const setProperties = (\n  staticCtx: RenderStaticContext,\n  elCtx: QContext,\n  hostCtx: QContext | null,\n  newProps: Record<string, any>,\n  isSvg: boolean,\n  immutable: boolean\n): Record<string, any> => {\n  const values: Record<string, any> = {};\n  const elm = elCtx.$element$;\n  for (const prop in newProps) {\n    let newValue = newProps[prop];\n    if (prop === 'ref') {\n      assertElement(elm);\n      if (newValue !== undefined) {\n        setRef(newValue, elm);\n      }\n      continue;\n    }\n\n    if (isOnProp(prop)) {\n      setEvent(elCtx.li, prop, newValue, staticCtx.$containerState$.$containerEl$);\n      continue;\n    }\n\n    if (isSignal(newValue)) {\n      assertDefined(hostCtx, 'Signals can only be used in components');\n      newValue = trackSignal(\n        newValue,\n        immutable\n          ? [1, elm, newValue, hostCtx.$element$, prop]\n          : [2, hostCtx.$element$, newValue, elm, prop]\n      );\n    }\n\n    if (prop === 'class') {\n      if (qDev && values.class) {\n        throw new TypeError('Can only provide one of class or className');\n      }\n      newValue = serializeClassWithHost(newValue, hostCtx);\n      if (!newValue) {\n        continue;\n      }\n    } else if (prop === 'style') {\n      newValue = stringifyStyle(newValue);\n    }\n    values[prop] = newValue;\n    smartSetProperty(staticCtx, elm, prop, newValue, isSvg);\n  }\n  return values;\n};\n\nexport const setComponentProps = (\n  containerState: ContainerState,\n  elCtx: QContext,\n  expectProps: Record<string, any>\n) => {\n  let props = elCtx.$props$;\n  if (!props) {\n    elCtx.$props$ = props = createProxy(createPropsState(), containerState);\n  }\n  if (expectProps === EMPTY_OBJ) {\n    return;\n  }\n\n  const manager = getSubscriptionManager(props);\n  assertDefined(manager, `props have to be a proxy, but it is not`, props);\n  const target = getProxyTarget(props);\n  assertDefined(target, `props have to be a proxy, but it is not`, props);\n\n  const immutableMeta = ((target as any)[_IMMUTABLE] =\n    (expectProps as any)[_IMMUTABLE] ?? EMPTY_OBJ);\n\n  for (const prop in expectProps) {\n    if (prop !== 'children' && prop !== QSlot && !immutableMeta[prop]) {\n      const value = expectProps[prop];\n      if (target[prop] !== value) {\n        target[prop] = value;\n        manager.$notifySubs$(prop);\n      }\n    }\n  }\n};\n\nexport const cleanupTree = (\n  elm: Node | VirtualElement,\n  staticCtx: RenderStaticContext,\n  subsManager: SubscriptionManager,\n  stopSlots: boolean,\n  dispose = false\n) => {\n  subsManager.$clearSub$(elm);\n  if (isQwikElement(elm)) {\n    if (!dispose && stopSlots && elm.hasAttribute(QSlotS)) {\n      staticCtx.$rmSlots$.push(elm);\n      return;\n    }\n    const ctx = tryGetContext(elm);\n    if (ctx) {\n      cleanupContext(ctx, subsManager);\n    }\n    const end = isVirtualElement(elm) ? elm.close : null;\n    let node: Node | null | VirtualElement = elm.firstChild;\n    while ((node = processVirtualNodes(node))) {\n      cleanupTree(node!, staticCtx, subsManager, true, dispose);\n      node = node.nextSibling;\n      if (node === end) {\n        break;\n      }\n    }\n  }\n};\n\nconst restoreScroll = () => {\n  if (document.__q_scroll_restore__) {\n    document.__q_scroll_restore__();\n    document.__q_scroll_restore__ = undefined;\n  }\n};\n\nexport const executeContextWithScrollAndTransition = async (ctx: RenderStaticContext) => {\n  // try to use `document.startViewTransition`\n  if (isBrowser && !qTest) {\n    if (document.__q_view_transition__) {\n      document.__q_view_transition__ = undefined;\n      if (document.startViewTransition) {\n        const transition = document.startViewTransition(() => {\n          executeDOMRender(ctx);\n          restoreScroll();\n        });\n        const event = new CustomEvent('qviewTransition', {\n          detail: transition,\n        });\n        document.dispatchEvent(event);\n        await transition.finished;\n        return;\n      }\n    }\n  }\n  // fallback\n  executeDOMRender(ctx);\n  if (isBrowser) {\n    restoreScroll();\n  }\n};\n\nexport const directAppendChild = (parent: QwikElement, child: Node | VirtualElement) => {\n  if (isVirtualElement(child)) {\n    child.appendTo(parent);\n  } else {\n    parent.appendChild(child);\n  }\n};\n\nexport const directRemoveChild = (parent: QwikElement, child: Node | VirtualElement) => {\n  if (isVirtualElement(child)) {\n    child.remove();\n  } else {\n    parent.removeChild(child);\n  }\n};\n\nexport const directInsertAfter = (\n  parent: QwikElement,\n  child: Node | VirtualElement,\n  ref: Node | VirtualElement | null\n) => {\n  if (isVirtualElement(child)) {\n    child.insertBeforeTo(parent, ref?.nextSibling ?? null);\n  } else {\n    parent.insertBefore(child, ref?.nextSibling ?? null);\n  }\n};\n\nexport const directInsertBefore = (\n  parent: QwikElement,\n  child: Node | VirtualElement,\n  ref: Node | VirtualElement | null\n) => {\n  if (isVirtualElement(child)) {\n    child.insertBeforeTo(parent, getRootNode(ref));\n  } else {\n    parent.insertBefore(child, getRootNode(ref));\n  }\n};\n\nconst createKeyToOldIdx = (\n  children: ProcessedJSXNode[],\n  beginIdx: number,\n  endIdx: number\n): KeyToIndexMap => {\n  const map: KeyToIndexMap = {};\n  for (let i = beginIdx; i <= endIdx; ++i) {\n    const child = children[i];\n    const key = child.$key$;\n    if (key != null) {\n      map[key as string] = i;\n    }\n  }\n  return map;\n};\n\nexport const addQwikEvent = (staticCtx: RenderStaticContext, elm: QwikElement, prop: string) => {\n  if (!prop.startsWith('on:')) {\n    setAttribute(staticCtx, elm, prop, '');\n  }\n  registerQwikEvent(prop);\n};\n\nexport const registerQwikEvent = (prop: string) => {\n  if (!qTest) {\n    const eventName = getEventName(prop);\n    try {\n      // This is managed by qwik-loader\n      ((globalThis as any).qwikevents ||= []).push(eventName);\n    } catch (err) {\n      logWarn(err);\n    }\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/error-handling.ts",
    "content": "import { isServerPlatform } from '../platform/platform';\nimport { tryGetContext } from '../state/context';\nimport { createContextId, resolveContext } from '../use/use-context';\nimport { isVirtualElement } from '../util/element';\nimport { qDev } from '../util/qdev';\nimport type { QwikElement } from './dom/virtual-element';\nimport type { RenderContext } from './types';\n\n/** @public */\nexport interface ErrorBoundaryStore {\n  error: any | undefined;\n}\n\nexport const ERROR_CONTEXT = /*#__PURE__*/ createContextId<ErrorBoundaryStore>('qk-error');\n\nexport const handleError = (err: any, hostElement: QwikElement, rCtx: RenderContext) => {\n  const elCtx = tryGetContext(hostElement)!;\n  if (qDev) {\n    // Clean vdom\n    if (!isServerPlatform() && typeof document !== 'undefined' && isVirtualElement(hostElement)) {\n      // (hostElement as any).$vdom$ = null;\n      elCtx.$vdom$ = null;\n      const errorDiv = document.createElement('errored-host');\n      if (err && err instanceof Error) {\n        (errorDiv as any).props = { error: err };\n      }\n      errorDiv.setAttribute('q:key', '_error_');\n      errorDiv.append(...hostElement.childNodes);\n      hostElement.appendChild(errorDiv);\n    }\n\n    if (err && err instanceof Error) {\n      if (!('hostElement' in err)) {\n        (err as any)['hostElement'] = hostElement;\n      }\n    }\n    if (!isRecoverable(err)) {\n      throw err;\n    }\n  }\n  if (isServerPlatform()) {\n    throw err;\n  } else {\n    const errorStore = resolveContext(ERROR_CONTEXT, elCtx, rCtx.$static$.$containerState$);\n    if (errorStore === undefined) {\n      throw err;\n    }\n    errorStore.error = err;\n  }\n};\n\nconst isRecoverable = (err: any) => {\n  if (err && err instanceof Error) {\n    if ('plugin' in err) {\n      return false;\n    }\n  }\n  return true;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/execute-component.ts",
    "content": "import { assertDefined } from '../error/assert';\nimport { RenderEvent } from '../util/markers';\nimport { maybeThen, promiseAllLazy, safeCall } from '../util/promises';\nimport { newInvokeContext } from '../use/use-core';\nimport { isArray, isFunction, isString, type ValueOrPromise } from '../util/types';\nimport type { JSXNode, JSXOutput } from './jsx/types/jsx-node';\nimport type { ClassList } from './jsx/types/jsx-qwik-attributes';\nimport type { RenderContext } from './types';\nimport { type ContainerState, intToStr } from '../container/container';\nimport { fromCamelToKebabCase } from '../util/case';\nimport { qError, QError_stringifyClassOrStyle } from '../error/error';\nimport { seal } from '../util/qdev';\nimport { SkipRender } from './jsx/utils.public';\nimport { handleError } from './error-handling';\nimport { HOST_FLAG_DIRTY, HOST_FLAG_MOUNTED, type QContext } from '../state/context';\nimport { isSignal, SignalUnassignedException } from '../state/signal';\nimport { isJSXNode } from './jsx/jsx-runtime';\nimport { isUnitlessNumber } from '../util/unitless_number';\nimport { isServerPlatform } from '../platform/platform';\nimport { executeSSRTasks } from './dom/notify-render';\nimport { logWarn } from '../util/log';\n\nexport interface ExecuteComponentOutput {\n  node: JSXOutput;\n  rCtx: RenderContext;\n}\n\nexport const executeComponent = (\n  rCtx: RenderContext,\n  elCtx: QContext,\n  attempt?: number\n): ValueOrPromise<ExecuteComponentOutput> => {\n  elCtx.$flags$ &= ~HOST_FLAG_DIRTY;\n  elCtx.$flags$ |= HOST_FLAG_MOUNTED;\n  elCtx.$slots$ = [];\n  elCtx.li.length = 0;\n\n  const hostElement = elCtx.$element$;\n  const componentQRL = elCtx.$componentQrl$;\n  const props = elCtx.$props$;\n  const iCtx = newInvokeContext(rCtx.$static$.$locale$, hostElement, undefined, RenderEvent);\n  const waitOn: Promise<unknown>[] = (iCtx.$waitOn$ = []);\n  assertDefined(componentQRL, `render: host element to render must have a $renderQrl$:`, elCtx);\n  assertDefined(props, `render: host element to render must have defined props`, elCtx);\n\n  // Set component context\n  const newCtx = pushRenderContext(rCtx);\n  newCtx.$cmpCtx$ = elCtx;\n  newCtx.$slotCtx$ = undefined;\n\n  // Invoke render hook\n  iCtx.$subscriber$ = [0, hostElement];\n  iCtx.$renderCtx$ = rCtx;\n\n  // Resolve render function\n  componentQRL.$setContainer$(rCtx.$static$.$containerState$.$containerEl$);\n  const componentFn = componentQRL.getFn(iCtx);\n\n  return safeCall(\n    () => componentFn(props),\n    (jsxNode) => {\n      return maybeThen(\n        isServerPlatform()\n          ? maybeThen(promiseAllLazy(waitOn), () =>\n              // Run dirty tasks before SSR output is generated.\n              maybeThen(executeSSRTasks(rCtx.$static$.$containerState$, rCtx), () =>\n                promiseAllLazy(waitOn)\n              )\n            )\n          : promiseAllLazy(waitOn),\n        () => {\n          if (elCtx.$flags$ & HOST_FLAG_DIRTY) {\n            if (attempt && attempt > 100) {\n              logWarn(`Infinite loop detected. Element: ${elCtx.$componentQrl$?.$symbol$}`);\n            } else {\n              return executeComponent(rCtx, elCtx, attempt ? attempt + 1 : 1);\n            }\n          }\n          return {\n            node: jsxNode,\n            rCtx: newCtx,\n          };\n        }\n      );\n    },\n    (err) => {\n      if (err === SignalUnassignedException) {\n        if (attempt && attempt > 100) {\n          logWarn(`Infinite loop detected. Element: ${elCtx.$componentQrl$?.$symbol$}`);\n        } else {\n          return maybeThen(promiseAllLazy(waitOn), () => {\n            return executeComponent(rCtx, elCtx, attempt ? attempt + 1 : 1);\n          });\n        }\n      }\n      handleError(err, hostElement, rCtx);\n      return {\n        node: SkipRender,\n        rCtx: newCtx,\n      };\n    }\n  );\n};\n\nexport const createRenderContext = (\n  doc: Document,\n  containerState: ContainerState\n): RenderContext => {\n  const ctx: RenderContext = {\n    $static$: {\n      $doc$: doc,\n      $locale$: containerState.$serverData$.locale,\n      $containerState$: containerState,\n      $hostElements$: new Set(),\n      $operations$: [],\n      $postOperations$: [],\n      $roots$: [],\n      $addSlots$: [],\n      $rmSlots$: [],\n      $visited$: [],\n    },\n    $cmpCtx$: null,\n    $slotCtx$: undefined,\n  };\n  seal(ctx);\n  seal(ctx.$static$);\n  return ctx;\n};\n\nexport const pushRenderContext = (ctx: RenderContext): RenderContext => {\n  const newCtx: RenderContext = {\n    $static$: ctx.$static$,\n    $cmpCtx$: ctx.$cmpCtx$,\n    $slotCtx$: ctx.$slotCtx$,\n  };\n  return newCtx;\n};\n\nexport const serializeClassWithHost = (\n  obj: ClassList,\n  hostCtx: QContext | undefined | null\n): string => {\n  if (hostCtx?.$scopeIds$?.length) {\n    return hostCtx.$scopeIds$.join(' ') + ' ' + serializeClass(obj);\n  }\n  return serializeClass(obj);\n};\n\nexport const serializeClass = (obj: ClassList): string => {\n  if (!obj) {\n    return '';\n  }\n  if (isString(obj)) {\n    return obj.trim();\n  }\n\n  const classes: string[] = [];\n\n  if (isArray(obj)) {\n    for (const o of obj) {\n      const classList = serializeClass(o);\n      if (classList) {\n        classes.push(classList);\n      }\n    }\n  } else {\n    for (const [key, value] of Object.entries(obj)) {\n      if (value) {\n        classes.push(key.trim());\n      }\n    }\n  }\n\n  return classes.join(' ');\n};\n\nexport const stringifyStyle = (obj: any): string => {\n  if (obj == null) {\n    return '';\n  }\n  if (typeof obj == 'object') {\n    if (isArray(obj)) {\n      throw qError(QError_stringifyClassOrStyle, obj, 'style');\n    } else {\n      const chunks: string[] = [];\n      for (const key in obj) {\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\n          const value = obj[key];\n          if (value != null && typeof value !== 'function') {\n            if (key.startsWith('--')) {\n              chunks.push(key + ':' + value);\n            } else {\n              chunks.push(fromCamelToKebabCase(key) + ':' + setValueForStyle(key, value));\n            }\n          }\n        }\n      }\n      return chunks.join(';');\n    }\n  }\n  return String(obj);\n};\n\nexport const setValueForStyle = (styleName: string, value: any) => {\n  if (typeof value === 'number' && value !== 0 && !isUnitlessNumber(styleName)) {\n    return value + 'px';\n  }\n  return value;\n};\n\nexport const getNextIndex = (ctx: RenderContext) => {\n  return intToStr(ctx.$static$.$containerState$.$elementIndex$++);\n};\n\nexport const setQId = (rCtx: RenderContext, elCtx: QContext) => {\n  const id = getNextIndex(rCtx);\n  elCtx.$id$ = id;\n};\n\nexport const jsxToString = (data: any): string => {\n  if (isSignal(data)) {\n    return jsxToString(data.value);\n  }\n  return data == null || typeof data === 'boolean' ? '' : String(data);\n};\n\nexport function isAriaAttribute(prop: string): boolean {\n  return prop.startsWith('aria-');\n}\n\nexport const shouldWrapFunctional = (res: unknown, node: JSXNode) => {\n  if (node.key) {\n    return !isJSXNode(res) || (!isFunction(res.type) && res.key != node.key);\n  }\n  return false;\n};\n\nexport const static_listeners = 1 << 0;\nexport const static_subtree = 1 << 1;\nexport const dangerouslySetInnerHTML = 'dangerouslySetInnerHTML';\n"
  },
  {
    "path": "packages/qwik/src/core/render/execute-component.unit.ts",
    "content": "import { suite, test, assert } from 'vitest';\nimport {\n  serializeClass,\n  serializeClassWithHost,\n  stringifyStyle,\n  setValueForStyle,\n} from './execute-component';\nimport type { QContext } from '../state/context';\n\nconst obj = {\n  foo: false,\n  bar: true,\n  'foo-bar': null,\n  'foo-baz': undefined,\n  'bar-foo': '',\n  'bar-baz': 'bar-baz',\n  'baz-foo': 0,\n  'baz-bar': 1,\n};\n\nsuite('serializeClass', () => {\n  test('should serialize undefined', () => {\n    assert.equal(serializeClass(undefined), '');\n  });\n\n  test('should serialize null', () => {\n    assert.equal(serializeClass(null), '');\n  });\n\n  suite('string values', () => {\n    test('should serialize empty string', () => {\n      assert.equal(serializeClass(''), '');\n    });\n\n    test('should serialize string with no whitespace', () => {\n      assert.equal(serializeClass('foo'), 'foo');\n    });\n\n    test('should serialize multiple classes', () => {\n      assert.equal(serializeClass('foo bar'), 'foo bar');\n      assert.equal(serializeClass('foo bar baz'), 'foo bar baz');\n    });\n  });\n\n  test('should serialize boolean', () => {\n    assert.equal(serializeClass(false), '');\n    assert.equal(serializeClass(true as any), '');\n  });\n\n  suite('should serialize object', () => {\n    test('should serialize empty object', () => {\n      assert.equal(serializeClass({}), '');\n    });\n\n    test('should serialize object with single boolean value', () => {\n      assert.equal(serializeClass({ foo: true }), 'foo');\n      assert.equal(serializeClass({ foo: false }), '');\n    });\n\n    test('should serialize object with single number value', () => {\n      assert.equal(serializeClass({ foo: 1 }), 'foo');\n      assert.equal(serializeClass({ foo: 0 }), '');\n      assert.equal(serializeClass({ foo: -1 }), 'foo');\n    });\n\n    test('should serialize object with single string value', () => {\n      assert.equal(serializeClass({ foo: 'bar' }), 'foo');\n      assert.equal(serializeClass({ foo: '' }), '');\n    });\n\n    test('should serialize object with nullish values', () => {\n      assert.equal(serializeClass({ foo: null }), '');\n      assert.equal(serializeClass({ foo: undefined }), '');\n    });\n\n    test('should serialize object with non-string keys', () => {\n      assert.equal(serializeClass({ 1: true }), '1');\n      assert.equal(serializeClass({ 0: true }), '0');\n      assert.equal(serializeClass({ 1: false }), '');\n      assert.equal(serializeClass({ 0: false }), '');\n    });\n\n    test('should serialize object with key with dashes', () => {\n      assert.equal(serializeClass({ 'foo-bar': true }), 'foo-bar');\n      assert.equal(serializeClass({ 'foo-bar foo-baz': true }), 'foo-bar foo-baz');\n    });\n\n    test('should serialize object with multitude of values', () => {\n      assert.equal(serializeClass(obj), 'bar bar-baz baz-bar');\n    });\n  });\n\n  suite('should serialize array', () => {\n    test('should serialize empty array', () => {\n      assert.equal(serializeClass([]), '');\n    });\n\n    test('should serialize array with single boolean value', () => {\n      assert.equal(serializeClass([true as any]), '');\n      assert.equal(serializeClass([false]), '');\n    });\n\n    test('should ignore nullish values', () => {\n      assert.equal(serializeClass([null, undefined]), '');\n      let test: boolean | undefined = false;\n      assert.equal(serializeClass([test && 'foo', 'bar']), 'bar');\n      test = true;\n      assert.equal(serializeClass([test && 'foo', 'bar']), 'foo bar');\n      test = undefined;\n      assert.equal(serializeClass([test && 'foo', 'bar']), 'bar');\n    });\n\n    test('should serialize array with string values', () => {\n      assert.equal(serializeClass(['foo']), 'foo');\n      assert.equal(serializeClass(['foo', 'bar']), 'foo bar');\n      assert.equal(serializeClass(['foo', 'bar', 'baz']), 'foo bar baz');\n    });\n\n    test('should serialize array with object values', () => {\n      assert.equal(serializeClass([{ foo: true }]), 'foo');\n      assert.equal(serializeClass([{ foo: false }]), '');\n      assert.equal(serializeClass([{ foo: true }, { bar: true }]), 'foo bar');\n      assert.equal(serializeClass([{ foo: true }, { bar: false }]), 'foo');\n      assert.equal(serializeClass([{ foo: true }, { bar: false }, { baz: true }]), 'foo baz');\n      assert.equal(serializeClass([obj]), 'bar bar-baz baz-bar');\n      assert.equal(serializeClass([obj, obj]), 'bar bar-baz baz-bar bar bar-baz baz-bar');\n    });\n\n    test('should serialize array with mixed values', () => {\n      const test = false;\n      assert.equal(serializeClass(['foo', { bar: true }]), 'foo bar');\n      assert.equal(serializeClass([{ foo: test }, 'bar']), 'bar');\n      assert.equal(serializeClass([test && 'foo', { bar: test, baz: true }]), 'baz');\n      assert.equal(\n        serializeClass([test && 'foo', { bar: test, baz: true }, obj]),\n        'baz bar bar-baz baz-bar'\n      );\n    });\n  });\n\n  test('should trim classes', () => {\n    assert.equal(serializeClass('foo '), 'foo');\n    assert.equal(serializeClass(' foo '), 'foo');\n    assert.equal(serializeClass(' foo'), 'foo');\n    assert.equal(serializeClass(' foo bar '), 'foo bar');\n    assert.equal(serializeClass({ ' foo ': true, '  bar ': true }), 'foo bar');\n    assert.equal(serializeClass(['  foo   ', '    bar  ', { ' baz  ': true }]), 'foo bar baz');\n  });\n});\n\nsuite('serializeClassWithHost', () => {\n  test('should serialize null context', () => {\n    assert.equal(serializeClassWithHost(obj, null), 'bar bar-baz baz-bar');\n  });\n\n  test('should serialize undefined context', () => {\n    assert.equal(serializeClassWithHost(obj, undefined), 'bar bar-baz baz-bar');\n  });\n\n  test('should serialize empty context', () => {\n    assert.equal(serializeClassWithHost(obj, {} as QContext), 'bar bar-baz baz-bar');\n  });\n\n  test('should serialize context with empty $scopeIds$', () => {\n    assert.equal(\n      serializeClassWithHost(obj, { $scopeIds$: [] as string[] } as QContext),\n      'bar bar-baz baz-bar'\n    );\n  });\n\n  test('should serialize context with one item in $scopeIds$', () => {\n    assert.equal(\n      serializeClassWithHost(obj, { $scopeIds$: ['foo'] } as QContext),\n      'foo bar bar-baz baz-bar'\n    );\n  });\n\n  test('should serialize context with multiple items in $scopeIds$', () => {\n    assert.equal(\n      serializeClassWithHost(obj, { $scopeIds$: ['foo', 'baz'] } as QContext),\n      'foo baz bar bar-baz baz-bar'\n    );\n  });\n});\n\nsuite('stringifyStyle', () => {\n  test('should stringify null', () => {\n    assert.equal(stringifyStyle(null), '');\n  });\n\n  test('should stringify undefined', () => {\n    assert.equal(stringifyStyle(undefined), '');\n  });\n\n  test('should stringify string', () => {\n    assert.equal(stringifyStyle('color: red;'), 'color: red;');\n  });\n\n  test('should stringify number', () => {\n    assert.equal(stringifyStyle(10), '10');\n  });\n\n  test('should stringify boolean', () => {\n    assert.equal(stringifyStyle(true), 'true');\n    assert.equal(stringifyStyle(false), 'false');\n  });\n\n  suite('object values', () => {\n    test('should throw an error for array', () => {\n      assert.throws(\n        () => stringifyStyle([]),\n        'Code(0): Error while serializing class or style attributes'\n      );\n    });\n\n    suite('regular objects', () => {\n      test('should stringify object with nullish values', () => {\n        assert.equal(stringifyStyle({ color: null, backgroundColor: undefined }), '');\n      });\n\n      test('should stringify empty object', () => {\n        assert.equal(stringifyStyle({}), '');\n      });\n\n      test('should stringify object with single property', () => {\n        assert.equal(stringifyStyle({ color: 'red' }), 'color:red');\n      });\n\n      test('should stringify object with multiple properties', () => {\n        assert.equal(\n          stringifyStyle({ color: 'red', 'background-color': 'blue' }),\n          'color:red;background-color:blue'\n        );\n      });\n\n      test('should stringify object with numeric values', () => {\n        assert.equal(stringifyStyle({ width: 10, height: 20 }), 'width:10px;height:20px');\n      });\n\n      test('should convert camelCase to kebab-case', () => {\n        assert.equal(stringifyStyle({ backgroundColor: 'blue' }), 'background-color:blue');\n      });\n\n      test('should stringify object with unitless properties', () => {\n        assert.equal(stringifyStyle({ lineHeight: 1.5 }), 'line-height:1.5');\n      });\n\n      test('should stringify properties that start with two dashes', () => {\n        assert.equal(stringifyStyle({ '--foo': 'bar' }), '--foo:bar');\n      });\n\n      test('should stringify properties with numeric values that start with two dashes', () => {\n        assert.equal(stringifyStyle({ '--foo': 10 }), '--foo:10');\n      });\n    });\n\n    suite('objects with methods', () => {\n      test('should stringify object with own properties only', () => {\n        const obj = Object.create({ color: 'red' });\n        obj.marginTop = '10em';\n        assert.equal(obj.color, 'red');\n        assert.equal(stringifyStyle(obj), 'margin-top:10em');\n      });\n\n      test('should ignore object methods', () => {\n        const obj = {\n          margin: () => 10,\n          color: 'red',\n          backgroundColor: 'blue',\n        };\n        assert.equal(stringifyStyle(obj), 'color:red;background-color:blue');\n      });\n\n      test('should stringify object with custom hasOwnProperty method', () => {\n        const obj = {\n          hasOwnProperty: () => false,\n          color: 'red',\n          backgroundColor: 'blue',\n        };\n        assert.equal(stringifyStyle(obj), 'color:red;background-color:blue');\n      });\n    });\n  });\n});\n\nsuite('setValueForStyle', () => {\n  suite('properties with units', () => {\n    test('should not add \"px\" to numeric zero value (= 0)', () => {\n      assert.equal(setValueForStyle('margin', 0), '0');\n    });\n\n    test('should add \"px\" to numeric value that is non-zero (<> 0)', () => {\n      assert.equal(setValueForStyle('margin', 10), '10px');\n    });\n\n    test('should not add \"px\" to string zero value (= \"0\")', () => {\n      assert.equal(setValueForStyle('margin', '0'), '0');\n    });\n\n    test('should not add \"px\" to string zero value ending with \"px\" (= \"0px\")', () => {\n      assert.equal(setValueForStyle('margin', '0px'), '0px');\n    });\n\n    test('should not add \"px\" to string zero value ending with \"rem\" (= \"0rem\")', () => {\n      assert.equal(setValueForStyle('margin', '0rem'), '0rem');\n    });\n\n    test('should not add \"px\" to string value that is word (= \"red\")', () => {\n      assert.equal(setValueForStyle('color', 'red'), 'red');\n    });\n\n    test('should not add \"px\" to string value that is non-zero ending with \"px\" (= \"10px\")', () => {\n      assert.equal(setValueForStyle('margin', '10px'), '10px');\n    });\n\n    test('should not add \"px\" to string value that is non-zero ending with \"rem\" (= \"10rem\")', () => {\n      assert.equal(setValueForStyle('margin', '10rem'), '10rem');\n    });\n  });\n\n  suite('unitless properties', () => {\n    test('should not add \"px\" to numeric zero value (= 0)', () => {\n      assert.equal(setValueForStyle('lineHeight', 0), '0');\n    });\n\n    test('should not add \"px\" to numeric value that is non-zero (<> 0)', () => {\n      assert.equal(setValueForStyle('lineHeight', 10), '10');\n    });\n\n    test('should not add \"px\" to string value', () => {\n      assert.equal(setValueForStyle('lineHeight', '0'), '0');\n      assert.equal(setValueForStyle('lineHeight', '10'), '10');\n    });\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/render/fast-calls.ts",
    "content": "import type { QwikElement } from './dom/virtual-element';\n\nexport const directSetAttribute = (el: QwikElement, prop: string, value: string) => {\n  return el.setAttribute(prop, value);\n};\n\nexport const directGetAttribute = (el: QwikElement, prop: string) => {\n  return el.getAttribute(prop);\n};\n\nexport const directRemoveAttribute = (el: QwikElement, prop: string) => {\n  return el.removeAttribute(prop);\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/README.md",
    "content": "# `render/jsx`\n\nDefault JSX based implementation of rendering.\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/factory.ts",
    "content": "/* eslint-disable */\nimport { jsx } from './jsx-runtime';\nimport type { QwikJSX as JSX } from './types/jsx-qwik';\nimport type { FunctionComponent, JSXNode } from './types/jsx-node';\nimport { isArray } from '../../util/types';\n\nexport const flattenArray = <T>(array: (T | T[])[], dst?: T[]): T[] => {\n  // Yes this function is just Array.flat, but we need to run on old versions of Node.\n  if (!dst) dst = [];\n  for (const item of array) {\n    if (isArray(item)) {\n      flattenArray(item, dst);\n    } else {\n      dst.push(item);\n    }\n  }\n  return dst;\n};\n\n/** @public */\nexport function h<TYPE extends string | FunctionComponent<PROPS>, PROPS extends {} = {}>(\n  type: TYPE,\n  props: PROPS | null,\n  ...children: any[]\n): JSXNode<TYPE> {\n  // Using legacy h() jsx transform and morphing it\n  // so it can use the modern vdom structure\n  // https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html\n  // https://www.typescriptlang.org/tsconfig#jsxImportSource\n\n  const normalizedProps: any = {\n    children: arguments.length > 2 ? flattenArray(children) : undefined,\n  };\n\n  let key: any;\n  let i: any;\n\n  for (i in props) {\n    if (i == 'key') key = (props as Record<string, any>)[i];\n    else normalizedProps[i] = (props as Record<string, any>)[i];\n  }\n\n  if (typeof type === 'string' && !key && 'dangerouslySetInnerHTML' in normalizedProps) {\n    key = 'innerhtml';\n  }\n  return jsx(type, normalizedProps, key);\n}\n\n/** @public */\nexport declare namespace h {\n  export function h(type: any): JSXNode<any>;\n  export function h(type: Node, data: any): JSXNode<any>;\n  export function h(type: any, text: string): JSXNode<any>;\n  export function h(type: any, children: Array<any>): JSXNode<any>;\n  export function h(type: any, data: any, text: string): JSXNode<any>;\n  export function h(\n    type: any,\n    data: any,\n    children: Array<JSXNode<any> | undefined | null>\n  ): JSXNode<any>;\n  export function h(sel: any, data: any | null, children: JSXNode<any>): JSXNode<any>;\n\n  export { JSX };\n}\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/factory.unit.ts",
    "content": "import { h } from './factory';\nimport { isJSXNode, Fragment } from './jsx-runtime';\nimport type { FunctionComponent, JSXNodeInternal } from './types/jsx-node';\nimport { type ProcessedJSXNode, processNode } from '../dom/render-dom';\nimport { test, assert } from 'vitest';\n\ntest('map multiple nodes, flatten', () => {\n  // <parent>\n  //   a\n  //   {[1, 2].map((n) => (\n  //     <child>{n}</child>\n  //   ))}\n  //   b\n  // </parent>;\n  const v = processNode(\n    h(\n      'parent',\n      null,\n      'a',\n      [1, 2].map((n) => h('child', null, n)),\n      'b'\n    ) as JSXNodeInternal\n  ) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$.length, 4);\n  assert.deepEqual(v.$children$[0].$text$, 'a');\n  assert.deepEqual(v.$children$[1].$type$, 'child');\n  assert.deepEqual(v.$children$[1].$children$.length, 1);\n  assert.deepEqual(v.$children$[2].$type$, 'child');\n  assert.deepEqual(v.$children$[2].$children$.length, 1);\n  assert.deepEqual(v.$children$[3].$text$, 'b');\n});\n\ntest('one child node', () => {\n  // <parent><child></child></parent>\n  const v = processNode(h('parent', null, h('child', null)) as JSXNodeInternal) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$.length, 1);\n  assert.deepEqual(v.$children$[0].$type$, 'child');\n  assert.deepEqual(v.$children$[0].$props$, {});\n  assert.deepEqual(v.$children$[0].$children$, []);\n});\n\ntest('text w/ expression', () => {\n  // <div>1 {2} 3</div>\n  const v = processNode(h('div', null, '1 ', 2, ' 3') as JSXNodeInternal) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$[0].$type$, '#text');\n  assert.deepEqual(v.$children$[0].$text$, '1 ');\n  assert.deepEqual(v.$children$[0].$key$, null);\n\n  assert.deepEqual(v.$children$[1].$type$, '#text');\n  assert.deepEqual(v.$children$[1].$text$, '2');\n  assert.deepEqual(v.$children$[1].$key$, null);\n\n  assert.deepEqual(v.$children$[2].$type$, '#text');\n  assert.deepEqual(v.$children$[2].$text$, ' 3');\n  assert.deepEqual(v.$children$[2].$key$, null);\n});\n\ntest('text child', () => {\n  // <div>text</div>\n  const v = processNode(h('div', null, 'text') as JSXNodeInternal) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$[0].$type$, '#text');\n  assert.deepEqual(v.$children$[0].$text$, 'text');\n  assert.deepEqual(v.$children$[0].$key$, null);\n});\n\ntest('no children', () => {\n  // <div/>\n  const v = processNode(h('div', null) as JSXNodeInternal) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$, []);\n});\n\ntest('key', () => {\n  // <div key=\"val\"/>\n  const v = h('div', { key: 'val' });\n  assert.deepEqual(v.props, {});\n  assert.deepEqual(v.key, 'val');\n});\n\ntest('name/value props', () => {\n  // <div id=\"val\"/>\n  const v = h('div', { id: 'val' });\n  assert.deepEqual(v.props, { id: 'val' });\n});\n\ntest('boolean props', () => {\n  // <input checked/>\n  const v = h('input', { checked: true });\n  assert.deepEqual(v.props, { checked: true });\n});\n\ntest('no props', () => {\n  // <div/>\n  const v = h('div', null);\n  assert.deepEqual(v.props, {});\n  assert.deepEqual(v.key, null);\n});\n\ntest('tag', () => {\n  const v = h('div', null);\n  assert.deepEqual(v.type, 'div');\n});\n\ntest('Function Component', () => {\n  const Cmp: FunctionComponent<any> = () => h('fn-cmp', null);\n  const v = h(Cmp, {});\n  assert.deepEqual(v.type, Cmp);\n});\n\ntest('Fragment', () => {\n  // <><div/></>\n  const v = h(Fragment, null, h('div', null));\n  assert.deepEqual(v.type, Fragment);\n});\ntest('valid JSXNode', () => {\n  // <div/>\n  const v = h('div', null);\n  assert.deepEqual(isJSXNode(v), true);\n});\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/jsx-runtime.ts",
    "content": "import type { DevJSX, FunctionComponent, JSXNode, JSXNodeInternal } from './types/jsx-node';\nimport type { QwikJSX } from './types/jsx-qwik';\nimport { qDev, qRuntimeQrl, seal } from '../../util/qdev';\nimport { logError, logOnceWarn, logWarn } from '../../util/log';\nimport { isArray, isFunction, isObject, isString } from '../../util/types';\nimport { isQrl, type QRLInternal } from '../../qrl/qrl-class';\nimport { invoke, untrack } from '../../use/use-core';\nimport { verifySerializable } from '../../state/common';\nimport { isQwikComponent, type OnRenderFn } from '../../component/component.public';\nimport { isSignal } from '../../state/signal';\nimport { isPromise } from '../../util/promises';\nimport { SkipRender } from './utils.public';\nimport { EMPTY_OBJ } from '../../util/flyweight';\nimport { _IMMUTABLE } from '../../internal';\n// keep this import from qwik/build so the cjs build works\nimport { isBrowser } from '@builder.io/qwik/build';\nimport { assertString } from '../../error/assert';\nimport { static_subtree } from '../execute-component';\nimport type { JsxChild } from 'typescript';\nimport { ELEMENT_ID, OnRenderProp, QScopedStyle, QSlot, QSlotS } from '../../util/markers';\nimport type { JSXChildren } from './types/jsx-qwik-attributes';\nimport { _IMMUTABLE_PREFIX } from '../../state/constants';\n\n/**\n * @internal\n *\n * Create a JSXNode for a string tag\n */\nexport const _jsxQ = <T extends string>(\n  type: T,\n  mutableProps: Record<any, unknown> | null,\n  immutableProps: Record<any, unknown> | null,\n  children: JSXChildren | null,\n  flags: number,\n  key: string | number | null,\n  dev?: DevJSX\n): JSXNodeInternal<T> => {\n  assertString(type, 'jsx type must be a string');\n  const processed = key == null ? null : String(key);\n  const node = new JSXNodeImpl<T>(\n    type,\n    mutableProps || (EMPTY_OBJ as any),\n    immutableProps,\n    children,\n    flags,\n    processed\n  );\n  if (qDev && dev) {\n    node.dev = {\n      stack: new Error().stack,\n      ...dev,\n    };\n  }\n  validateJSXNode(node);\n  seal(node);\n  return node;\n};\n\n/**\n * @internal\n *\n * A string tag with dynamic props, possibly containing children\n */\nexport const _jsxS = <T extends string>(\n  type: T,\n  mutableProps: Record<any, unknown> | null,\n  immutableProps: Record<any, unknown> | null,\n  flags: number,\n  key: string | number | null,\n  dev?: DevJSX\n): JSXNodeInternal<T> => {\n  let children: JSXChildren = null;\n  if (mutableProps && 'children' in mutableProps) {\n    children = mutableProps.children as JSXChildren;\n    delete mutableProps.children;\n  }\n  return _jsxQ(type, mutableProps, immutableProps, children, flags, key, dev);\n};\n\n/**\n * @internal\n *\n * Create a JSXNode for any tag, with possibly immutable props embedded in props\n */\nexport const _jsxC = <T extends string | FunctionComponent<Record<any, unknown>>>(\n  type: T,\n  mutableProps: (T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>) | null,\n  flags: number,\n  key: string | number | null,\n  dev?: JsxDevOpts\n): JSXNodeInternal<T> => {\n  const processed = key == null ? null : String(key);\n  const props = mutableProps ?? ({} as NonNullable<typeof mutableProps>);\n  // In dynamic components, type could be a string\n  if (typeof type === 'string' && _IMMUTABLE in props) {\n    const immutableProps = props[_IMMUTABLE] as Record<any, unknown>;\n    delete props[_IMMUTABLE];\n    const children = props.children as JSXChildren;\n    delete props.children;\n    // Immutable handling for string tags is a bit different, merge all and consider immutable\n    for (const [k, v] of Object.entries(immutableProps)) {\n      if (v !== _IMMUTABLE) {\n        delete props[k];\n        (props as any)[k] = v;\n      }\n    }\n    return _jsxQ(type, null, props, children, flags, key, dev);\n  }\n  const node = new JSXNodeImpl<T>(\n    type,\n    props,\n    null,\n    props.children as JSXChildren,\n    flags,\n    processed\n  );\n  if (typeof type === 'string' && mutableProps) {\n    delete mutableProps.children;\n  }\n  if (qDev && dev) {\n    node.dev = {\n      stack: new Error().stack,\n      ...dev,\n    };\n  }\n  validateJSXNode(node);\n  seal(node);\n  return node;\n};\n\n/**\n * @public\n * Used by the JSX transpilers to create a JSXNode.\n * Note that the optimizer will not use this, instead using _jsxQ, _jsxS, and _jsxC directly.\n */\nexport const jsx = <T extends string | FunctionComponent<any>>(\n  type: T,\n  props: T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>,\n  key?: string | number | null\n): JSXNode<T> => {\n  const processed = key == null ? null : String(key);\n  const children = untrack(() => {\n    const c = props.children;\n    if (typeof type === 'string') {\n      delete props.children;\n    }\n    return c;\n  });\n  if (isString(type)) {\n    if ('className' in props) {\n      (props as any).class = props.className;\n      delete props.className;\n      if (qDev) {\n        logOnceWarn('jsx: `className` is deprecated. Use `class` instead.');\n      }\n    }\n  }\n  const node = new JSXNodeImpl<T>(type, props, null, children, 0, processed);\n  validateJSXNode(node);\n  seal(node);\n  return node;\n};\n\nexport const SKIP_RENDER_TYPE = ':skipRender';\n\nexport class JSXNodeImpl<T> implements JSXNode<T> {\n  dev?: DevJSX;\n  constructor(\n    public type: T,\n    public props: T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>,\n    public immutableProps: Record<any, unknown> | null,\n    public children: JSXChildren,\n    public flags: number,\n    public key: string | null = null\n  ) {}\n}\n\n/** @public */\nexport const Virtual: FunctionComponent<{\n  children?: JSXChildren;\n  dangerouslySetInnerHTML?: string;\n  [OnRenderProp]?: QRLInternal<OnRenderFn<any>>;\n  [QSlot]?: string;\n  [QSlotS]?: string;\n  [_IMMUTABLE]?: Record<any, unknown>;\n  props?: Record<any, unknown>;\n  [QScopedStyle]?: string;\n  [ELEMENT_ID]?: string;\n}> = (props: any) => props.children;\n\n/** @public */\nexport const RenderOnce: FunctionComponent<{\n  children?: unknown;\n  key?: string | number | null | undefined;\n}> = (props: any, key) => {\n  return new JSXNodeImpl(Virtual, EMPTY_OBJ, null, props.children, static_subtree, key);\n};\n\nconst validateJSXNode = (node: JSXNodeInternal) => {\n  if (qDev) {\n    const { type, props, immutableProps, children } = node;\n    invoke(undefined, () => {\n      const isQwikC = isQwikComponent(type);\n      if (!isString(type) && !isFunction(type)) {\n        throw new Error(\n          `The <Type> of the JSX element must be either a string or a function. Instead, it's a \"${typeof type}\": ${String(\n            type\n          )}.`\n        );\n      }\n      if (children) {\n        const flatChildren = isArray(children) ? children.flat() : [children];\n        if (isString(type) || isQwikC) {\n          flatChildren.forEach((child: unknown) => {\n            if (!isValidJSXChild(child)) {\n              const typeObj = typeof child;\n              let explanation = '';\n              if (typeObj === 'object') {\n                if (child?.constructor) {\n                  explanation = `it's an instance of \"${child?.constructor.name}\".`;\n                } else {\n                  explanation = `it's a object literal: ${printObjectLiteral(child as {})} `;\n                }\n              } else if (typeObj === 'function') {\n                explanation += `it's a function named \"${(child as Function).name}\".`;\n              } else {\n                explanation = `it's a \"${typeObj}\": ${String(child)}.`;\n              }\n\n              throw new Error(\n                `One of the children of <${type}> is not an accepted value. JSX children must be either: string, boolean, number, <element>, Array, undefined/null, or a Promise/Signal. Instead, ${explanation}\\n`\n              );\n            }\n          });\n        }\n        if (isBrowser) {\n          if (isFunction(type) || immutableProps) {\n            const keys: Record<string, boolean> = {};\n            flatChildren.forEach((child: unknown) => {\n              if (isJSXNode(child) && child.key != null) {\n                const key = String(child.type) + ':' + child.key;\n                if (keys[key]) {\n                  const err = createJSXError(\n                    `Multiple JSX sibling nodes with the same key.\\nThis is likely caused by missing a custom key in a for loop`,\n                    child\n                  );\n                  if (err) {\n                    if (isString(child.type)) {\n                      logOnceWarn(err);\n                    } else {\n                      logOnceWarn(err);\n                    }\n                  }\n                } else {\n                  keys[key] = true;\n                }\n              }\n            });\n          }\n        }\n      }\n\n      const allProps = [\n        ...Object.entries(props),\n        ...(immutableProps ? Object.entries(immutableProps) : []),\n      ];\n      if (!qRuntimeQrl) {\n        for (const [prop, value] of allProps) {\n          if (prop.endsWith('$') && value) {\n            if (!isQrl(value) && !Array.isArray(value)) {\n              throw new Error(\n                `The value passed in ${prop}={...}> must be a QRL, instead you passed a \"${typeof value}\". Make sure your ${typeof value} is wrapped with $(...), so it can be serialized. Like this:\\n$(${String(\n                  value\n                )})`\n              );\n            }\n          }\n          if (prop !== 'children' && isQwikC && value) {\n            verifySerializable(\n              value,\n              `The value of the JSX attribute \"${prop}\" can not be serialized`\n            );\n          }\n        }\n      }\n      if (isString(type)) {\n        const hasSetInnerHTML = allProps.some((a) => a[0] === 'dangerouslySetInnerHTML');\n        if (hasSetInnerHTML && children) {\n          const err = createJSXError(\n            `The JSX element <${type}> can not have both 'dangerouslySetInnerHTML' and children.`,\n            node\n          );\n          logError(err);\n        }\n        if (allProps.some((a) => a[0] === 'children')) {\n          throw new Error(`The JSX element <${type}> can not have both 'children' as a property.`);\n        }\n        if (type === 'style') {\n          if (children) {\n            logOnceWarn(`jsx: Using <style>{content}</style> will escape the content, effectively breaking the CSS.\nIn order to disable content escaping use '<style dangerouslySetInnerHTML={content}/>'\n\nHowever, if the use case is to inject component styleContent, use 'useStyles$()' instead, it will be a lot more efficient.\nSee https://qwik.dev/docs/core/styles/#usestyles for more information.`);\n          }\n        }\n        if (type === 'script') {\n          if (children) {\n            logOnceWarn(`jsx: Using <script>{content}</script> will escape the content, effectively breaking the inlined JS.\nIn order to disable content escaping use '<script dangerouslySetInnerHTML={content}/>'`);\n          }\n        }\n      }\n    });\n  }\n};\n\nconst printObjectLiteral = (obj: Record<string, unknown>) => {\n  return `{ ${Object.keys(obj)\n    .map((key) => `\"${key}\"`)\n    .join(', ')} }`;\n};\n\nexport const isJSXNode = (n: unknown): n is JSXNodeInternal => {\n  if (qDev) {\n    if (n instanceof JSXNodeImpl) {\n      return true;\n    }\n    if (isObject(n) && 'key' in n && 'props' in n && 'type' in n) {\n      logWarn(`Duplicate implementations of \"JSXNode\" found`);\n      return true;\n    }\n    return false;\n  } else {\n    return n instanceof JSXNodeImpl;\n  }\n};\n\nexport const isValidJSXChild = (node: unknown): node is JsxChild => {\n  if (!node) {\n    return true;\n  } else if (node === SkipRender) {\n    return true;\n  } else if (isString(node) || typeof node === 'number' || typeof node === 'boolean') {\n    return true;\n  } else if (isJSXNode(node)) {\n    return true;\n  } else if (isArray(node)) {\n    return node.every(isValidJSXChild);\n  }\n  if (isSignal(node)) {\n    return isValidJSXChild(node.value);\n  } else if (isPromise(node)) {\n    return true;\n  }\n  return false;\n};\n\n/** @public */\nexport const Fragment: FunctionComponent<{ children?: any; key?: string | number | null }> = (\n  props\n) => props.children;\n\ninterface JsxDevOpts {\n  fileName: string;\n  lineNumber: number;\n  columnNumber: number;\n}\n\n/** @public */\nexport const HTMLFragment: FunctionComponent<{ dangerouslySetInnerHTML: string }> = (props) =>\n  jsx(Virtual, props);\n\n/** @public */\nexport const jsxDEV = <T extends string | FunctionComponent<Record<any, unknown>>>(\n  type: T,\n  props: T extends FunctionComponent<infer PROPS> ? PROPS : Record<any, unknown>,\n  key: string | number | null | undefined,\n  _isStatic: boolean,\n  opts: JsxDevOpts,\n  _ctx: unknown\n): JSXNode<T> => {\n  const processed = key == null ? null : String(key);\n  const children = untrack(() => {\n    const c = props.children;\n    if (typeof type === 'string') {\n      delete props.children;\n    }\n    return c;\n  }) as JSXChildren;\n  if (isString(type)) {\n    if ('className' in props) {\n      (props as any).class = props.className;\n      delete props.className;\n      if (qDev) {\n        logOnceWarn('jsx: `className` is deprecated. Use `class` instead.');\n      }\n    }\n  }\n  const node = new JSXNodeImpl<T>(type, props, null, children, 0, processed);\n  node.dev = {\n    stack: new Error().stack,\n    ...opts,\n  };\n  validateJSXNode(node);\n  seal(node);\n  return node;\n};\n\nexport type { QwikJSX as JSX };\n\nexport const createJSXError = (message: string, node: JSXNode) => {\n  const error = new Error(message);\n  if (!node.dev) {\n    return error;\n  }\n  error.stack = `JSXError: ${message}\\n${filterStack(node.dev.stack!, 1)}`;\n  return error;\n};\n\nconst filterStack = (stack: string, offset: number = 0) => {\n  return stack.split('\\n').slice(offset).join('\\n');\n};\n\nexport { jsx as jsxs };\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/jsx-runtime.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { type ProcessedJSXNode, processNode } from '../dom/render-dom';\nimport { jsx, isJSXNode, Fragment } from './jsx-runtime';\nimport type { FunctionComponent, JSXNodeInternal } from './types/jsx-node';\n\ntest('map multiple nodes', () => {\n  // <parent>\n  //   {[1,2].map(n => (<child>{n}</child>))}\n  // </parent>\n  const v = processNode(\n    jsx('parent', {\n      children: [1, 2].map((n) => jsx('child', { children: n })),\n    }) as JSXNodeInternal\n  ) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$.length, 2);\n  assert.deepEqual(v.$children$[0].$type$, 'child');\n  assert.deepEqual(v.$children$[1].$type$, 'child');\n});\n\ntest('one child node', () => {\n  // <parent><child></child></parent>\n  const v = processNode(\n    jsx('parent', { children: jsx('child', {}) }) as JSXNodeInternal\n  ) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$.length, 1);\n  assert.deepEqual(v.$children$[0].$type$, 'child');\n  assert.deepEqual(v.$children$[0].$props$, {});\n  assert.deepEqual(v.$children$[0].$children$, []);\n});\n\ntest('text w/ expression', () => {\n  // <div>1 {2} 3</div>\n  const v = processNode(\n    jsx('div', { children: ['1 ', 2, ' 3'] }) as JSXNodeInternal\n  ) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$[0].$type$, '#text');\n  assert.deepEqual(v.$children$[0].$text$, '1 ');\n  assert.deepEqual(v.$children$[0].$key$, null);\n\n  assert.deepEqual(v.$children$[1].$type$, '#text');\n  assert.deepEqual(v.$children$[1].$text$, '2');\n  assert.deepEqual(v.$children$[1].$key$, null);\n\n  assert.deepEqual(v.$children$[2].$type$, '#text');\n  assert.deepEqual(v.$children$[2].$text$, ' 3');\n  assert.deepEqual(v.$children$[2].$key$, null);\n});\n\ntest('text child', () => {\n  // <div>text</div>\n  const v = processNode(jsx('div', { children: 'text' }) as JSXNodeInternal) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$[0].$type$, '#text');\n  assert.deepEqual(v.$children$[0].$text$, 'text');\n  assert.deepEqual(v.$children$[0].$key$, null);\n});\n\ntest('no children', () => {\n  // <div/>\n  const v = processNode(jsx('div', {}) as JSXNodeInternal) as ProcessedJSXNode;\n  assert.deepEqual(v.$children$, []);\n});\ntest('key', () => {\n  // <div key=\"val\"/>\n  const v = jsx('div', {}, 'val');\n  assert.deepEqual(v.props, {});\n  assert.deepEqual(v.key, 'val');\n});\n\ntest('name/value props', () => {\n  // <div id=\"val\"/>\n  const v = jsx('div', { id: 'val' });\n  assert.deepEqual(v.props, { id: 'val' });\n});\n\ntest('boolean props', () => {\n  // <input checked/>\n  const v = jsx('input', { checked: true });\n  assert.deepEqual(v.props, { checked: true });\n});\n\ntest('no props', () => {\n  // <div/>\n  const v = jsx('div', {});\n  assert.deepEqual(v.props, {});\n  assert.deepEqual(v.key, null);\n});\ntest('tag', () => {\n  const v = jsx('div', {});\n  assert.deepEqual(v.type, 'div');\n});\n\ntest('Function Component', () => {\n  const Cmp: FunctionComponent<any> = () => jsx('fn-cmp', {});\n  const v = jsx(Cmp, {});\n  assert.deepEqual(v.type, Cmp);\n});\n\ntest('Fragment', () => {\n  const v = jsx(Fragment, {});\n  assert.deepEqual(v.type, Fragment);\n});\ntest('valid JSXNode', () => {\n  const v = jsx('div', {});\n  assert.deepEqual(isJSXNode(v), true);\n});\ntest('invalid string', () => {\n  assert.deepEqual(isJSXNode('text'), false);\n});\ntest('invalid class', () => {\n  assert.deepEqual(isJSXNode(class {}), false);\n});\ntest('invalid array', () => {\n  assert.deepEqual(isJSXNode([]), false);\n});\ntest('invalid null/undefined', () => {\n  assert.deepEqual(isJSXNode(null), false);\n  assert.deepEqual(isJSXNode(undefined), false);\n});\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/slot.public.ts",
    "content": "import { QSlotS } from '../../util/markers';\nimport { Virtual, _jsxC } from './jsx-runtime';\nimport type { FunctionComponent } from './types/jsx-node';\n\n/**\n * Allows to project the children of the current component. `<Slot/>` can only be used within the\n * context of a component defined with `component$`.\n *\n * @public\n */\nexport const Slot: FunctionComponent<{\n  name?: string;\n}> = (props) => {\n  return _jsxC(\n    Virtual,\n    {\n      [QSlotS]: '',\n    },\n    0,\n    props.name ?? ''\n  );\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/types/jsx-generated.ts",
    "content": "import * as CSS from 'csstype';\nimport type { Signal } from '../../../state/signal';\nimport type { DOMAttributes, ClassList, QwikAttributes } from './jsx-qwik-attributes';\n/** @public */\nexport type Booleanish = boolean | `${boolean}`;\n/** @public */\nexport type Size = number | string;\n/** @public */\nexport type Numberish = number | `${number}`;\n\n/** @public */\nexport interface CSSProperties\n  extends CSS.Properties<string | number>,\n    CSS.PropertiesHyphen<string | number> {\n  /**\n   * The index signature was removed to enable closed typing for style using CSSType. You're able to\n   * use type assertion or module augmentation to add properties or an index signature of your own.\n   *\n   * For examples and more information, visit:\n   * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors\n   */\n  [v: `--${string}`]: string | number | undefined;\n}\n\n/**\n * TS defines these with the React syntax which is not compatible with Qwik. E.g. `ariaAtomic`\n * instead of `aria-atomic`.\n *\n * @public\n */\nexport interface AriaAttributes {\n  /**\n   * Identifies the currently active element when DOM focus is on a composite widget, textbox,\n   * group, or application.\n   */\n  'aria-activedescendant'?: string | undefined;\n  /**\n   * Indicates whether assistive technologies will present all, or only parts of, the changed region\n   * based on the change notifications defined by the aria-relevant attribute.\n   */\n  'aria-atomic'?: Booleanish | undefined;\n  /**\n   * Indicates whether inputting text could trigger display of one or more predictions of the user's\n   * intended value for an input and specifies how predictions would be presented if they are made.\n   */\n  'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both' | undefined;\n  /**\n   * Indicates an element is being modified and that assistive technologies MAY want to wait until\n   * the modifications are complete before exposing them to the user.\n   */\n  'aria-busy'?: Booleanish | undefined;\n  /**\n   * Indicates the current \"checked\" state of checkboxes, radio buttons, and other widgets.\n   *\n   * @see aria-pressed @see aria-selected.\n   */\n  'aria-checked'?: boolean | 'false' | 'mixed' | 'true' | undefined;\n  /**\n   * Defines the total number of columns in a table, grid, or treegrid.\n   *\n   * @see aria-colindex.\n   */\n  'aria-colcount'?: number | undefined;\n  /**\n   * Defines an element's column index or position with respect to the total number of columns\n   * within a table, grid, or treegrid.\n   *\n   * @see aria-colcount @see aria-colspan.\n   */\n  'aria-colindex'?: number | undefined;\n  /**\n   * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n   *\n   * @see aria-colindex @see aria-rowspan.\n   */\n  'aria-colspan'?: number | undefined;\n  /**\n   * Identifies the element (or elements) whose contents or presence are controlled by the current\n   * element.\n   *\n   * @see aria-owns.\n   */\n  'aria-controls'?: string | undefined;\n  /**\n   * Indicates the element that represents the current item within a container or set of related\n   * elements.\n   */\n  'aria-current'?:\n    | boolean\n    | 'false'\n    | 'true'\n    | 'page'\n    | 'step'\n    | 'location'\n    | 'date'\n    | 'time'\n    | undefined;\n  /**\n   * Identifies the element (or elements) that describes the object.\n   *\n   * @see aria-labelledby\n   */\n  'aria-describedby'?: string | undefined;\n  /**\n   * Identifies the element that provides a detailed, extended description for the object.\n   *\n   * @see aria-describedby.\n   */\n  'aria-details'?: string | undefined;\n  /**\n   * Indicates that the element is perceivable but disabled, so it is not editable or otherwise\n   * operable.\n   *\n   * @see aria-hidden @see aria-readonly.\n   */\n  'aria-disabled'?: Booleanish | undefined;\n  /**\n   * Indicates what functions can be performed when a dragged object is released on the drop target.\n   *\n   * @deprecated In ARIA 1.1\n   */\n  'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup' | undefined;\n  /**\n   * Identifies the element that provides an error message for the object.\n   *\n   * @see aria-invalid @see aria-describedby.\n   */\n  'aria-errormessage'?: string | undefined;\n  /**\n   * Indicates whether the element, or another grouping element it controls, is currently expanded\n   * or collapsed.\n   */\n  'aria-expanded'?: Booleanish | undefined;\n  /**\n   * Identifies the next element (or elements) in an alternate reading order of content which, at\n   * the user's discretion, allows assistive technology to override the general default of reading\n   * in document source order.\n   */\n  'aria-flowto'?: string | undefined;\n  /**\n   * Indicates an element's \"grabbed\" state in a drag-and-drop operation.\n   *\n   * @deprecated In ARIA 1.1\n   */\n  'aria-grabbed'?: Booleanish | undefined;\n  /**\n   * Indicates the availability and type of interactive popup element, such as menu or dialog, that\n   * can be triggered by an element.\n   */\n  'aria-haspopup'?:\n    | boolean\n    | 'false'\n    | 'true'\n    | 'menu'\n    | 'listbox'\n    | 'tree'\n    | 'grid'\n    | 'dialog'\n    | undefined;\n  /**\n   * Indicates whether the element is exposed to an accessibility API.\n   *\n   * @see aria-disabled.\n   */\n  'aria-hidden'?: Booleanish | undefined;\n  /**\n   * Indicates the entered value does not conform to the format expected by the application.\n   *\n   * @see aria-errormessage.\n   */\n  'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling' | undefined;\n  /**\n   * Indicates keyboard shortcuts that an author has implemented to activate or give focus to an\n   * element.\n   */\n  'aria-keyshortcuts'?: string | undefined;\n  /**\n   * Defines a string value that labels the current element.\n   *\n   * @see aria-labelledby.\n   */\n  'aria-label'?: string | undefined;\n  /**\n   * Identifies the element (or elements) that labels the current element.\n   *\n   * @see aria-describedby.\n   */\n  'aria-labelledby'?: string | undefined;\n  /** Defines the hierarchical level of an element within a structure. */\n  'aria-level'?: number | undefined;\n  /**\n   * Indicates that an element will be updated, and describes the types of updates the user agents,\n   * assistive technologies, and user can expect from the live region.\n   */\n  'aria-live'?: 'off' | 'assertive' | 'polite' | undefined;\n  /** Indicates whether an element is modal when displayed. */\n  'aria-modal'?: Booleanish | undefined;\n  /** Indicates whether a text box accepts multiple lines of input or only a single line. */\n  'aria-multiline'?: Booleanish | undefined;\n  /** Indicates that the user may select more than one item from the current selectable descendants. */\n  'aria-multiselectable'?: Booleanish | undefined;\n  /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */\n  'aria-orientation'?: 'horizontal' | 'vertical' | undefined;\n  /**\n   * Identifies an element (or elements) in order to define a visual, functional, or contextual\n   * parent/child relationship between DOM elements where the DOM hierarchy cannot be used to\n   * represent the relationship.\n   *\n   * @see aria-controls.\n   */\n  'aria-owns'?: string | undefined;\n  /**\n   * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the\n   * control has no value. A hint could be a sample value or a brief description of the expected\n   * format.\n   */\n  'aria-placeholder'?: string | undefined;\n  /**\n   * Defines an element's number or position in the current set of listitems or treeitems. Not\n   * required if all elements in the set are present in the DOM.\n   *\n   * @see aria-setsize.\n   */\n  'aria-posinset'?: number | undefined;\n  /**\n   * Indicates the current \"pressed\" state of toggle buttons.\n   *\n   * @see aria-checked @see aria-selected.\n   */\n  'aria-pressed'?: boolean | 'false' | 'mixed' | 'true' | undefined;\n  /**\n   * Indicates that the element is not editable, but is otherwise operable.\n   *\n   * @see aria-disabled.\n   */\n  'aria-readonly'?: Booleanish | undefined;\n  /**\n   * Indicates what notifications the user agent will trigger when the accessibility tree within a\n   * live region is modified.\n   *\n   * @see aria-atomic.\n   */\n  'aria-relevant'?:\n    | 'additions'\n    | 'additions removals'\n    | 'additions text'\n    | 'all'\n    | 'removals'\n    | 'removals additions'\n    | 'removals text'\n    | 'text'\n    | 'text additions'\n    | 'text removals'\n    | undefined;\n  /** Indicates that user input is required on the element before a form may be submitted. */\n  'aria-required'?: Booleanish | undefined;\n  /** Defines a human-readable, author-localized description for the role of an element. */\n  'aria-roledescription'?: string | undefined;\n  /**\n   * Defines the total number of rows in a table, grid, or treegrid.\n   *\n   * @see aria-rowindex.\n   */\n  'aria-rowcount'?: number | undefined;\n  /**\n   * Defines an element's row index or position with respect to the total number of rows within a\n   * table, grid, or treegrid.\n   *\n   * @see aria-rowcount @see aria-rowspan.\n   */\n  'aria-rowindex'?: number | undefined;\n  /**\n   * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n   *\n   * @see aria-rowindex @see aria-colspan.\n   */\n  'aria-rowspan'?: number | undefined;\n  /**\n   * Indicates the current \"selected\" state of various widgets.\n   *\n   * @see aria-checked @see aria-pressed.\n   */\n  'aria-selected'?: Booleanish | undefined;\n  /**\n   * Defines the number of items in the current set of listitems or treeitems. Not required if all\n   * elements in the set are present in the DOM.\n   *\n   * @see aria-posinset.\n   */\n  'aria-setsize'?: number | undefined;\n  /** Indicates if items in a table or grid are sorted in ascending or descending order. */\n  'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | undefined;\n  /** Defines the maximum allowed value for a range widget. */\n  'aria-valuemax'?: number | undefined;\n  /** Defines the minimum allowed value for a range widget. */\n  'aria-valuemin'?: number | undefined;\n  /**\n   * Defines the current value for a range widget.\n   *\n   * @see aria-valuetext.\n   */\n  'aria-valuenow'?: number | undefined;\n  /** Defines the human readable text alternative of aria-valuenow for a range widget. */\n  'aria-valuetext'?: string | undefined;\n}\n\n/** @public */\nexport type AriaRole =\n  | 'alert'\n  | 'alertdialog'\n  | 'application'\n  | 'article'\n  | 'banner'\n  | 'button'\n  | 'cell'\n  | 'checkbox'\n  | 'columnheader'\n  | 'combobox'\n  | 'complementary'\n  | 'contentinfo'\n  | 'definition'\n  | 'dialog'\n  | 'directory'\n  | 'document'\n  | 'feed'\n  | 'figure'\n  | 'form'\n  | 'grid'\n  | 'gridcell'\n  | 'group'\n  | 'heading'\n  | 'img'\n  | 'link'\n  | 'list'\n  | 'listbox'\n  | 'listitem'\n  | 'log'\n  | 'main'\n  | 'marquee'\n  | 'math'\n  | 'menu'\n  | 'menubar'\n  | 'menuitem'\n  | 'menuitemcheckbox'\n  | 'menuitemradio'\n  | 'navigation'\n  | 'none'\n  | 'note'\n  | 'option'\n  | 'presentation'\n  | 'progressbar'\n  | 'radio'\n  | 'radiogroup'\n  | 'region'\n  | 'row'\n  | 'rowgroup'\n  | 'rowheader'\n  | 'scrollbar'\n  | 'search'\n  | 'searchbox'\n  | 'separator'\n  | 'slider'\n  | 'spinbutton'\n  | 'status'\n  | 'switch'\n  | 'tab'\n  | 'table'\n  | 'tablist'\n  | 'tabpanel'\n  | 'term'\n  | 'textbox'\n  | 'timer'\n  | 'toolbar'\n  | 'tooltip'\n  | 'tree'\n  | 'treegrid'\n  | 'treeitem'\n  | (string & {});\n\n// All the keys that must be removed\ntype UnwantedKeys =\n  // We have our own\n  | keyof HTMLAttributesBase\n  | keyof DOMAttributes<any>\n  // We don't support these\n  | keyof ARIAMixin\n  // We should use onEventName$ instead\n  | keyof GlobalEventHandlers\n  // deprecated or overridden or can't filter out automatically\n  | 'enterKeyHint'\n  | 'innerText'\n  | 'innerHTML'\n  | 'outerHTML'\n  | 'inputMode'\n  | 'outerText'\n  | 'nodeValue'\n  | 'textContent';\n\ninterface HTMLAttributesBase extends AriaAttributes {\n  /** @deprecated Use `class` instead */\n  className?: ClassList | undefined;\n  contentEditable?: 'true' | 'false' | 'inherit' | undefined;\n  style?: CSSProperties | string | undefined;\n  role?: AriaRole | undefined;\n\n  about?: string | undefined;\n  datatype?: string | undefined;\n  inlist?: any;\n  property?: string | undefined;\n  resource?: string | undefined;\n  typeof?: string | undefined;\n  vocab?: string | undefined;\n\n  autoCapitalize?: 'none' | 'off' | 'sentences' | 'on' | 'words' | 'characters' | undefined;\n  autoCorrect?: string | undefined;\n  autoFocus?: boolean | undefined;\n  autoSave?: string | undefined;\n  hidden?: boolean | 'hidden' | 'until-found' | undefined;\n  itemProp?: string | undefined;\n  itemScope?: boolean | undefined;\n  itemType?: string | undefined;\n  itemID?: string | undefined;\n  itemRef?: string | undefined;\n  results?: number | undefined;\n  translate?: 'yes' | 'no' | undefined;\n  security?: string | undefined;\n  unselectable?: 'on' | 'off' | undefined;\n\n  /**\n   * Hints at the type of data that might be entered by the user while editing the element or its\n   * contents\n   *\n   * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute\n   */\n  inputMode?:\n    | 'none'\n    | 'text'\n    | 'tel'\n    | 'url'\n    | 'email'\n    | 'numeric'\n    | 'decimal'\n    | 'search'\n    | undefined;\n  /**\n   * Specify that a standard HTML element should behave like a defined custom built-in element\n   *\n   * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is\n   */\n  is?: string | undefined;\n\n  popover?: 'manual' | 'auto' | undefined;\n}\n\n/** @public */\nexport interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement> {}\n\n/** @public */\nexport interface HTMLAttributes<E extends Element> extends HTMLElementAttrs, DOMAttributes<E> {}\n\ntype Prettify<T> = {} & {\n  [K in keyof T]: T[K];\n};\n\ntype IfEquals<X, Y, A, B> =\n  (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B;\ntype IsReadOnlyKey<T, K extends keyof T> = IfEquals<\n  { [Q in K]: T[K] },\n  { -readonly [Q in K]: T[K] },\n  false,\n  true\n>;\ntype IsAcceptableDOMValue<T> = T extends boolean | number | string | null | undefined\n  ? ((...args: any[]) => any) extends T\n    ? false\n    : true\n  : false;\n\n/** Only keep props that are specific to the element and make partial */\ntype Filtered<T, A = {}> = {\n  [K in keyof Omit<FilterBase<T>, keyof HTMLAttributes<any> | keyof A>]?: T[K];\n};\ntype FilterBase<T> = {\n  [K in keyof T as K extends string\n    ? // No uppercase keys\n      K extends Uppercase<K>\n      ? never\n      : // No `any` values\n        any extends T[K]\n        ? never\n        : // Only allow basic types\n          false extends IsAcceptableDOMValue<T[K]>\n          ? never\n          : // No readonly values\n            IsReadOnlyKey<T, K> extends true\n            ? never\n            : K extends UnwantedKeys\n              ? never\n              : // Ok this key is allowed\n                K\n    : never]?: T[K];\n};\n/**\n * Replace given element's props with custom types and return all props specific to the element. Use\n * this for known props that are incorrect or missing.\n *\n * Uses Prettify so we see the special props for each element in editor hover\n */\ntype Augmented<E, A = {}> = Prettify<Filtered<E, A> & A>;\n\ntype TableCellSpecialAttrs = {\n  align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined;\n  height?: Size | undefined;\n  width?: Size | undefined;\n  valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined;\n};\ntype MediaSpecialAttrs = {\n  crossOrigin?: HTMLCrossOriginAttribute;\n};\ntype PopoverTargetAction = 'hide' | 'show' | 'toggle';\n\ntype SpecialAttrs = {\n  a: {\n    download?: any;\n    target?: HTMLAttributeAnchorTarget | undefined;\n    referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;\n  };\n  area: {\n    referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;\n    children?: undefined;\n  };\n  audio: MediaSpecialAttrs;\n  base: {\n    children?: undefined;\n  };\n  button: {\n    form?: string | undefined;\n    value?: string | ReadonlyArray<string> | number | undefined;\n    popovertarget?: string | undefined;\n    popovertargetaction?: PopoverTargetAction | undefined;\n  };\n  canvas: {\n    height?: Size | undefined;\n    width?: Size | undefined;\n  };\n  col: {\n    width?: Size | undefined;\n    children?: undefined;\n  };\n  data: {\n    value?: string | ReadonlyArray<string> | number | undefined;\n  };\n  embed: {\n    height?: Size | undefined;\n    width?: Size | undefined;\n    children?: undefined;\n  };\n  fieldset: {\n    form?: string | undefined;\n  };\n  hr: {\n    children?: undefined;\n  };\n  iframe: {\n    allowTransparency?: boolean | undefined;\n    /** @deprecated Deprecated */\n    frameBorder?: number | string | undefined;\n    height?: Size | undefined;\n    loading?: 'eager' | 'lazy' | undefined;\n    sandbox?: string | undefined;\n    seamless?: boolean | undefined;\n    width?: Size | undefined;\n    children?: undefined;\n  };\n  img: {\n    crossOrigin?: HTMLCrossOriginAttribute;\n    /** Intrinsic height of the image in pixels. */\n    height?: Numberish | undefined;\n    referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;\n    /** Intrinsic width of the image in pixels. */\n    width?: Numberish | undefined;\n    children?: undefined;\n  };\n  input: {\n    /**\n     * For type: HTMLInputTypeAttribute, excluding 'button' | 'color' | 'file' | 'hidden' | 'image'|\n     * 'range' | 'reset' | 'submit' | 'checkbox' | 'radio'\n     */\n    autoComplete?:\n      | HTMLInputAutocompleteAttribute\n      | Omit<HTMLInputAutocompleteAttribute, string>\n      | undefined;\n    /** For type: 'checkbox' | 'radio' */\n    'bind:checked'?: Signal<boolean | undefined>;\n    /**\n     * For type: HTMLInputTypeAttribute, excluding 'button' | 'reset' | 'submit' | 'checkbox' |\n     * 'radio'\n     */\n    'bind:value'?: Signal<string | undefined | number>;\n    enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined;\n    height?: Size | undefined;\n    max?: number | string | undefined;\n    maxLength?: number | undefined;\n    min?: number | string | undefined;\n    minLength?: number | undefined;\n    step?: number | string | undefined;\n    type?: HTMLInputTypeAttribute | undefined;\n    value?: string | ReadonlyArray<string> | number | undefined | null | FormDataEntryValue;\n    width?: Size | undefined;\n    children?: undefined;\n    /** For type: 'button' */\n    popovertarget?: string | undefined;\n    popovertargetaction?: PopoverTargetAction | undefined;\n  };\n  label: {\n    form?: string | undefined;\n    for?: string | undefined;\n    /** @deprecated Use `for` */\n    htmlFor?: string | undefined;\n  };\n  li: {\n    value?: string | ReadonlyArray<string> | number | undefined;\n  };\n  link: {\n    crossOrigin?: HTMLCrossOriginAttribute;\n    referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;\n    sizes?: string | undefined;\n    type?: string | undefined;\n    /** @deprecated Use `charset` instead */\n    charSet?: string | undefined;\n    charset?: string | undefined;\n    children?: undefined;\n  };\n  meta: {\n    /** @deprecated Use `charset` instead */\n    charSet?: 'utf-8' | undefined;\n    /** Qwik only supports utf-8 */\n    charset?: 'utf-8' | undefined;\n    children?: undefined;\n  };\n  meter: {\n    form?: string | undefined;\n    value?: string | ReadonlyArray<string> | number | undefined;\n  };\n  object: {\n    classID?: string | undefined;\n    form?: string | undefined;\n    height?: Size | undefined;\n    width?: Size | undefined;\n    wmode?: string | undefined;\n  };\n  ol: {\n    type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined;\n  };\n  optgroup: {\n    disabled?: boolean | undefined;\n    // not sure if correct\n    label?: string | undefined;\n  };\n  option: {\n    value?: string | ReadonlyArray<string> | number | undefined;\n    children?: string;\n  };\n  output: {\n    form?: string | undefined;\n    for?: string | undefined;\n    /** @deprecated Use `for` instead */\n    htmlFor?: string | undefined;\n  };\n  param: {\n    value?: string | ReadonlyArray<string> | number | undefined;\n    children?: undefined;\n  };\n  progress: {\n    max?: number | string | undefined;\n    value?: string | ReadonlyArray<string> | number | undefined;\n  };\n  script: {\n    crossOrigin?: HTMLCrossOriginAttribute;\n    referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;\n  };\n  select: {\n    form?: string | undefined;\n    value?: string | ReadonlyArray<string> | number | undefined;\n    'bind:value'?: Signal<string | undefined>;\n  };\n  source: {\n    /** Allowed if the parent is a `picture` element */\n    height?: Size | undefined;\n    /** Allowed if the parent is a `picture` element */\n    width?: Size | undefined;\n    children?: undefined;\n  };\n  style: {\n    // not sure if correct\n    scoped?: boolean | undefined;\n    children?: string;\n  };\n  table: {\n    cellPadding?: number | string | undefined;\n    cellSpacing?: number | string | undefined;\n    width?: Size | undefined;\n  };\n  td: TableCellSpecialAttrs;\n  th: TableCellSpecialAttrs;\n  title: {\n    children?: string;\n  };\n  textarea: {\n    enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined;\n    form?: string | undefined;\n    value?: string | ReadonlyArray<string> | number | undefined;\n    'bind:value'?: Signal<string | undefined>;\n    children?: string;\n  };\n  track: {\n    children?: undefined;\n  };\n  video: MediaSpecialAttrs & {\n    height?: Numberish | undefined;\n    width?: Numberish | undefined;\n    disablePictureInPicture?: boolean | undefined;\n    disableRemotePlayback?: boolean | undefined;\n  };\n} & {\n  [key: string]: {};\n};\n\ntype Attrs<\n  Name extends keyof HTMLElementTagNameMap,\n  EL extends Element = HTMLElementTagNameMap[Name],\n  AttrEl = HTMLElementTagNameMap[Name],\n> = HTMLAttributes<EL> & Augmented<AttrEl, SpecialAttrs[Name]>;\n\n/** @public */\nexport type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});\n/** @public */\nexport type HTMLAttributeReferrerPolicy = ReferrerPolicy;\n/** @public */\nexport interface AnchorHTMLAttributes<T extends Element> extends Attrs<'a', T> {}\n/** @public */\nexport interface AreaHTMLAttributes<T extends Element> extends Attrs<'area', T> {}\n/** @public */\nexport interface MediaHTMLAttributes<T extends Element>\n  extends HTMLAttributes<T>,\n    Augmented<HTMLMediaElement, { crossOrigin?: HTMLCrossOriginAttribute }> {}\n/** @public */\nexport interface AudioHTMLAttributes<T extends Element> extends Attrs<'audio', T> {}\n/** @public */\nexport interface BaseHTMLAttributes<T extends Element> extends Attrs<'base', T> {}\n/** @public */\nexport interface BlockquoteHTMLAttributes<T extends Element> extends Attrs<'blockquote', T> {}\n/** @public */\nexport interface ButtonHTMLAttributes<T extends Element> extends Attrs<'button', T> {}\n/** @public */\nexport interface CanvasHTMLAttributes<T extends Element> extends Attrs<'canvas', T> {}\n/** @public */\nexport interface ColHTMLAttributes<T extends Element> extends Attrs<'col', T> {}\n/** @public */\nexport interface ColgroupHTMLAttributes<T extends Element> extends Attrs<'colgroup', T> {}\n/** @public */\nexport interface DataHTMLAttributes<T extends Element> extends Attrs<'data', T> {}\n/** @public */\nexport interface DelHTMLAttributes<T extends Element> extends Attrs<'del', T> {}\n/** @public */\nexport interface DetailsHTMLAttributes<T extends Element> extends Attrs<'details', T> {}\n/** @public */\nexport interface DialogHTMLAttributes<T extends Element> extends Attrs<'dialog', T> {}\n/** @public */\nexport interface EmbedHTMLAttributes<T extends Element> extends Attrs<'embed', T> {}\n/** @public */\nexport interface FieldsetHTMLAttributes<T extends Element> extends Attrs<'fieldset', T> {}\n/** @public */\nexport interface FormHTMLAttributes<T extends Element> extends Attrs<'form', T> {}\n/** @public */\nexport interface HtmlHTMLAttributes<T extends Element> extends Attrs<'html', T> {}\n/** @public */\nexport interface IframeHTMLAttributes<T extends Element> extends Attrs<'iframe', T> {}\n/** @public */\nexport interface ImgHTMLAttributes<T extends Element> extends Attrs<'img', T> {}\n/** @public */\nexport interface HrHTMLAttributes<T extends Element> extends Attrs<'hr', T> {}\n/** @public */\nexport type HTMLCrossOriginAttribute = 'anonymous' | 'use-credentials' | '' | undefined;\n/** @public */\nexport type HTMLInputTypeAttribute =\n  | 'button'\n  | 'checkbox'\n  | 'color'\n  | 'date'\n  | 'datetime-local'\n  | 'email'\n  | 'file'\n  | 'hidden'\n  | 'image'\n  | 'month'\n  | 'number'\n  | 'password'\n  | 'radio'\n  | 'range'\n  | 'reset'\n  | 'search'\n  | 'submit'\n  | 'tel'\n  | 'text'\n  | 'time'\n  | 'url'\n  | 'week'\n  | (string & {});\n\n/** @public */\nexport type HTMLInputAutocompleteAttribute =\n  | 'on'\n  | 'off'\n  | 'billing'\n  | 'shipping'\n  | 'name'\n  | 'honorific-prefix'\n  | 'given-name'\n  | 'additional-name'\n  | 'family-name'\n  | 'honorific-suffix'\n  | 'nickname'\n  | 'username'\n  | 'new-password'\n  | 'current-password'\n  | 'one-time-code'\n  | 'organization-title'\n  | 'organization'\n  | 'street-address'\n  | 'address-line1'\n  | 'address-line2'\n  | 'address-line3'\n  | 'address-level4'\n  | 'address-level3'\n  | 'address-level2'\n  | 'address-level1'\n  | 'country'\n  | 'country-name'\n  | 'postal-code'\n  | 'cc-name'\n  | 'cc-given-name'\n  | 'cc-additional-name'\n  | 'cc-family-name'\n  | 'cc-number'\n  | 'cc-exp'\n  | 'cc-exp-month'\n  | 'cc-exp-year'\n  | 'cc-csc'\n  | 'cc-type'\n  | 'transaction-currency'\n  | 'transaction-amount'\n  | 'language'\n  | 'bday'\n  | 'bday-day'\n  | 'bday-month'\n  | 'bday-year'\n  | 'sex'\n  | 'url'\n  | 'photo';\n\n/** @public */\nexport type InputHTMLAttributes<T extends Element> = Attrs<'input', T, HTMLInputElement>;\n/** @public */\nexport interface InsHTMLAttributes<T extends Element> extends Attrs<'ins', T> {}\n/** @public @deprecated in html5 */\nexport interface KeygenHTMLAttributes<T extends Element> extends Attrs<'base', T> {}\n/** @public */\nexport interface LabelHTMLAttributes<T extends Element> extends Attrs<'label', T> {}\n/** @public */\nexport interface LiHTMLAttributes<T extends Element> extends Attrs<'li', T> {}\n/** @public */\nexport interface LinkHTMLAttributes<T extends Element> extends Attrs<'link', T> {}\n/** @public */\nexport interface MapHTMLAttributes<T extends Element> extends Attrs<'map', T> {}\n/** @public */\nexport interface MenuHTMLAttributes<T extends Element> extends Attrs<'menu', T> {}\n/** @public */\nexport interface MetaHTMLAttributes<T extends Element> extends Attrs<'meta', T> {}\n/** @public */\nexport interface MeterHTMLAttributes<T extends Element> extends Attrs<'meter', T> {}\n/** @public */\nexport interface ObjectHTMLAttributes<T extends Element> extends Attrs<'object', T> {}\n/** @public */\nexport interface OlHTMLAttributes<T extends Element> extends Attrs<'ol', T> {}\n/** @public */\nexport interface OptgroupHTMLAttributes<T extends Element> extends Attrs<'optgroup', T> {}\n/** @public */\nexport interface OptionHTMLAttributes<T extends Element> extends Attrs<'option', T> {}\n/** @public */\nexport interface OutputHTMLAttributes<T extends Element> extends Attrs<'output', T> {}\n/** @public @deprecated Old DOM API */\nexport interface ParamHTMLAttributes<T extends Element>\n  extends Attrs<'base', T, HTMLParamElement> {}\n/** @public */\nexport interface ProgressHTMLAttributes<T extends Element> extends Attrs<'progress', T> {}\n/** @public */\nexport interface QuoteHTMLAttributes<T extends Element> extends Attrs<'q', T> {}\n/** @public */\nexport interface SlotHTMLAttributes<T extends Element> extends Attrs<'slot', T> {}\n/** @public */\nexport interface ScriptHTMLAttributes<T extends Element> extends Attrs<'script', T> {}\n/** @public */\nexport interface SelectHTMLAttributes<T extends Element> extends Attrs<'select', T> {}\n/** @public */\nexport interface SourceHTMLAttributes<T extends Element> extends Attrs<'source', T> {}\n/** @public */\nexport interface StyleHTMLAttributes<T extends Element> extends Attrs<'style', T> {}\n/** @public */\nexport interface TableHTMLAttributes<T extends Element> extends Attrs<'table', T> {}\n/** @public */\nexport interface TdHTMLAttributes<T extends Element> extends Attrs<'td', T> {}\n/** @public */\nexport interface TextareaHTMLAttributes<T extends Element> extends Attrs<'textarea', T> {}\n/** @public */\nexport interface ThHTMLAttributes<T extends Element> extends Attrs<'tr', T> {}\n/** @public */\nexport interface TimeHTMLAttributes<T extends Element> extends Attrs<'time', T> {}\n/** @public */\nexport interface TitleHTMLAttributes<T extends Element> extends Attrs<'title', T> {}\n/** @public */\nexport interface TrackHTMLAttributes<T extends Element> extends Attrs<'track', T> {}\n/** @public */\nexport interface VideoHTMLAttributes<T extends Element> extends Attrs<'video', T> {}\n\n/**\n * @deprecated This is the type for a React Native WebView. It doesn't belong in Qwik (yet?) but\n *   we're keeping it for backwards compatibility.\n * @public\n */\nexport interface WebViewHTMLAttributes<T extends Element> extends HTMLAttributes<T> {\n  allowFullScreen?: boolean | undefined;\n  allowpopups?: boolean | undefined;\n  autoFocus?: boolean | undefined;\n  autosize?: boolean | undefined;\n  blinkfeatures?: string | undefined;\n  disableblinkfeatures?: string | undefined;\n  disableguestresize?: boolean | undefined;\n  disablewebsecurity?: boolean | undefined;\n  guestinstance?: string | undefined;\n  httpreferrer?: string | undefined;\n  nodeintegration?: boolean | undefined;\n  partition?: string | undefined;\n  plugins?: boolean | undefined;\n  preload?: string | undefined;\n  src?: string | undefined;\n  useragent?: string | undefined;\n  webpreferences?: string | undefined;\n}\n\n/**\n * The TS types don't include the SVG attributes so we have to define them ourselves\n *\n * NOTE: These props are probably not complete\n *\n * @public\n */\nexport interface SVGAttributes<T extends Element = Element> extends AriaAttributes {\n  color?: string | undefined;\n  height?: Size | undefined;\n  id?: string | undefined;\n  lang?: string | undefined;\n  max?: number | string | undefined;\n  media?: string | undefined;\n  method?: string | undefined;\n  min?: number | string | undefined;\n  name?: string | undefined;\n  style?: CSSProperties | string | undefined;\n  target?: string | undefined;\n  type?: string | undefined;\n  width?: Size | undefined;\n\n  role?: string | undefined;\n  tabindex?: number | undefined;\n  crossOrigin?: HTMLCrossOriginAttribute;\n\n  'accent-height'?: number | string | undefined;\n  accumulate?: 'none' | 'sum' | undefined;\n  additive?: 'replace' | 'sum' | undefined;\n  'alignment-baseline'?:\n    | 'auto'\n    | 'baseline'\n    | 'before-edge'\n    | 'text-before-edge'\n    | 'middle'\n    | 'central'\n    | 'after-edge'\n    | 'text-after-edge'\n    | 'ideographic'\n    | 'alphabetic'\n    | 'hanging'\n    | 'mathematical'\n    | 'inherit'\n    | undefined;\n  allowReorder?: 'no' | 'yes' | undefined;\n  alphabetic?: number | string | undefined;\n  amplitude?: number | string | undefined;\n  'arabic-form'?: 'initial' | 'medial' | 'terminal' | 'isolated' | undefined;\n  ascent?: number | string | undefined;\n  attributeName?: string | undefined;\n  attributeType?: string | undefined;\n  autoReverse?: Booleanish | undefined;\n  azimuth?: number | string | undefined;\n  baseFrequency?: number | string | undefined;\n  'baseline-shift'?: number | string | undefined;\n  baseProfile?: number | string | undefined;\n  bbox?: number | string | undefined;\n  begin?: number | string | undefined;\n  bias?: number | string | undefined;\n  by?: number | string | undefined;\n  calcMode?: number | string | undefined;\n  'cap-height'?: number | string | undefined;\n  clip?: number | string | undefined;\n  'clip-path'?: string | undefined;\n  clipPathUnits?: number | string | undefined;\n  'clip-rule'?: number | string | undefined;\n  'color-interpolation'?: number | string | undefined;\n  'color-interpolation-filters'?: 'auto' | 's-rGB' | 'linear-rGB' | 'inherit' | undefined;\n  'color-profile'?: number | string | undefined;\n  'color-rendering'?: number | string | undefined;\n  contentScriptType?: number | string | undefined;\n  contentStyleType?: number | string | undefined;\n  cursor?: number | string;\n  cx?: number | string | undefined;\n  cy?: number | string | undefined;\n  d?: string | undefined;\n  decelerate?: number | string | undefined;\n  descent?: number | string | undefined;\n  diffuseConstant?: number | string | undefined;\n  direction?: number | string | undefined;\n  display?: number | string | undefined;\n  divisor?: number | string | undefined;\n  'dominant-baseline'?: number | string | undefined;\n  dur?: number | string | undefined;\n  dx?: number | string | undefined;\n  dy?: number | string | undefined;\n  'edge-mode'?: number | string | undefined;\n  elevation?: number | string | undefined;\n  'enable-background'?: number | string | undefined;\n  end?: number | string | undefined;\n  exponent?: number | string | undefined;\n  externalResourcesRequired?: number | string | undefined;\n  fill?: string | undefined;\n  'fill-opacity'?: number | string | undefined;\n  'fill-rule'?: 'nonzero' | 'evenodd' | 'inherit' | undefined;\n  filter?: string | undefined;\n  filterRes?: number | string | undefined;\n  filterUnits?: number | string | undefined;\n  'flood-color'?: number | string | undefined;\n  'flood-opacity'?: number | string | undefined;\n  focusable?: number | string | undefined;\n  'font-family'?: string | undefined;\n  'font-size'?: number | string | undefined;\n  'font-size-adjust'?: number | string | undefined;\n  'font-stretch'?: number | string | undefined;\n  'font-style'?: number | string | undefined;\n  'font-variant'?: number | string | undefined;\n  'font-weight'?: number | string | undefined;\n  format?: number | string | undefined;\n  fr?: number | string | undefined;\n  from?: number | string | undefined;\n  fx?: number | string | undefined;\n  fy?: number | string | undefined;\n  g1?: number | string | undefined;\n  g2?: number | string | undefined;\n  'glyph-name'?: number | string | undefined;\n  'glyph-orientation-horizontal'?: number | string | undefined;\n  'glyph-orientation-vertical'?: number | string | undefined;\n  glyphRef?: number | string | undefined;\n  gradientTransform?: string | undefined;\n  gradientUnits?: string | undefined;\n  hanging?: number | string | undefined;\n  'horiz-adv-x'?: number | string | undefined;\n  'horiz-origin-x'?: number | string | undefined;\n  href?: string | undefined;\n  ideographic?: number | string | undefined;\n  'image-rendering'?: number | string | undefined;\n  in2?: number | string | undefined;\n  in?: string | undefined;\n  intercept?: number | string | undefined;\n  k1?: number | string | undefined;\n  k2?: number | string | undefined;\n  k3?: number | string | undefined;\n  k4?: number | string | undefined;\n  k?: number | string | undefined;\n  kernelMatrix?: number | string | undefined;\n  kernelUnitLength?: number | string | undefined;\n  kerning?: number | string | undefined;\n  keyPoints?: number | string | undefined;\n  keySplines?: number | string | undefined;\n  keyTimes?: number | string | undefined;\n  lengthAdjust?: number | string | undefined;\n  'letter-spacing'?: number | string | undefined;\n  'lighting-color'?: number | string | undefined;\n  limitingConeAngle?: number | string | undefined;\n  local?: number | string | undefined;\n  'marker-end'?: string | undefined;\n  markerHeight?: number | string | undefined;\n  'marker-mid'?: string | undefined;\n  'marker-start'?: string | undefined;\n  markerUnits?: number | string | undefined;\n  markerWidth?: number | string | undefined;\n  mask?: string | undefined;\n  maskContentUnits?: number | string | undefined;\n  maskUnits?: number | string | undefined;\n  mathematical?: number | string | undefined;\n  mode?: number | string | undefined;\n  numOctaves?: number | string | undefined;\n  offset?: number | string | undefined;\n  opacity?: number | string | undefined;\n  operator?: number | string | undefined;\n  order?: number | string | undefined;\n  orient?: number | string | undefined;\n  orientation?: number | string | undefined;\n  origin?: number | string | undefined;\n  overflow?: number | string | undefined;\n  'overline-position'?: number | string | undefined;\n  'overline-thickness'?: number | string | undefined;\n  'paint-order'?: number | string | undefined;\n  panose1?: number | string | undefined;\n  path?: string | undefined;\n  pathLength?: number | string | undefined;\n  patternContentUnits?: string | undefined;\n  patternTransform?: number | string | undefined;\n  patternUnits?: string | undefined;\n  'pointer-events'?: number | string | undefined;\n  points?: string | undefined;\n  pointsAtX?: number | string | undefined;\n  pointsAtY?: number | string | undefined;\n  pointsAtZ?: number | string | undefined;\n  preserveAlpha?: number | string | undefined;\n  preserveAspectRatio?: string | undefined;\n  primitiveUnits?: number | string | undefined;\n  r?: number | string | undefined;\n  radius?: number | string | undefined;\n  refX?: number | string | undefined;\n  refY?: number | string | undefined;\n  'rendering-intent'?: number | string | undefined;\n  repeatCount?: number | string | undefined;\n  repeatDur?: number | string | undefined;\n  requiredextensions?: number | string | undefined;\n  requiredFeatures?: number | string | undefined;\n  restart?: number | string | undefined;\n  result?: string | undefined;\n  rotate?: number | string | undefined;\n  rx?: number | string | undefined;\n  ry?: number | string | undefined;\n  scale?: number | string | undefined;\n  seed?: number | string | undefined;\n  'shape-rendering'?: number | string | undefined;\n  slope?: number | string | undefined;\n  spacing?: number | string | undefined;\n  specularConstant?: number | string | undefined;\n  specularExponent?: number | string | undefined;\n  speed?: number | string | undefined;\n  spreadMethod?: string | undefined;\n  startOffset?: number | string | undefined;\n  stdDeviation?: number | string | undefined;\n  stemh?: number | string | undefined;\n  stemv?: number | string | undefined;\n  stitchTiles?: number | string | undefined;\n  'stop-color'?: string | undefined;\n  'stop-opacity'?: number | string | undefined;\n  'strikethrough-position'?: number | string | undefined;\n  'strikethrough-thickness'?: number | string | undefined;\n  string?: number | string | undefined;\n  stroke?: string | undefined;\n  'stroke-dasharray'?: string | number | undefined;\n  'stroke-dashoffset'?: string | number | undefined;\n  'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit' | undefined;\n  'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit' | undefined;\n  'stroke-miterlimit'?: string | undefined;\n  'stroke-opacity'?: number | string | undefined;\n  'stroke-width'?: number | string | undefined;\n  surfaceScale?: number | string | undefined;\n  systemLanguage?: number | string | undefined;\n  tableValues?: number | string | undefined;\n  targetX?: number | string | undefined;\n  targetY?: number | string | undefined;\n  'text-anchor'?: string | undefined;\n  'text-decoration'?: number | string | undefined;\n  textLength?: number | string | undefined;\n  'text-rendering'?: number | string | undefined;\n  to?: number | string | undefined;\n  transform?: string | undefined;\n  u1?: number | string | undefined;\n  u2?: number | string | undefined;\n  'underline-position'?: number | string | undefined;\n  'underline-thickness'?: number | string | undefined;\n  unicode?: number | string | undefined;\n  'unicode-bidi'?: number | string | undefined;\n  'unicode-range'?: number | string | undefined;\n  'units-per-em'?: number | string | undefined;\n  'v-alphabetic'?: number | string | undefined;\n  values?: string | undefined;\n  'vector-effect'?: number | string | undefined;\n  version?: string | undefined;\n  'vert-adv-y'?: number | string | undefined;\n  'vert-origin-x'?: number | string | undefined;\n  'vert-origin-y'?: number | string | undefined;\n  'v-hanging'?: number | string | undefined;\n  'v-ideographic'?: number | string | undefined;\n  viewBox?: string | undefined;\n  viewTarget?: number | string | undefined;\n  visibility?: number | string | undefined;\n  'v-mathematical'?: number | string | undefined;\n  widths?: number | string | undefined;\n  'word-spacing'?: number | string | undefined;\n  'writing-mode'?: number | string | undefined;\n  x1?: number | string | undefined;\n  x2?: number | string | undefined;\n  x?: number | string | undefined;\n  'x-channel-selector'?: string | undefined;\n  'x-height'?: number | string | undefined;\n  'xlink:actuate'?: string | undefined;\n  'xlink:arcrole'?: string | undefined;\n  'xlink:href'?: string | undefined;\n  'xlink:role'?: string | undefined;\n  'xlink:show'?: string | undefined;\n  'xlink:title'?: string | undefined;\n  'xlink:type'?: string | undefined;\n  'xml:base'?: string | undefined;\n  'xml:lang'?: string | undefined;\n  'xml:space'?: string | undefined;\n  xmlns?: string | undefined;\n  'xmlns:xlink'?: string | undefined;\n  y1?: number | string | undefined;\n  y2?: number | string | undefined;\n  y?: number | string | undefined;\n  yChannelSelector?: string | undefined;\n  z?: number | string | undefined;\n  zoomAndPan?: string | undefined;\n}\n/** @public */\nexport interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T> {}\n/** @internal */\nexport interface LenientSVGProps<T extends Element> extends SVGAttributes, DOMAttributes<T> {}\n/** @public */\nexport interface IntrinsicElements extends IntrinsicHTMLElements, IntrinsicSVGElements {}\n\n/**\n * These are the HTML tags with handlers allowing plain callbacks, to be used for the JSX interface\n *\n * @internal\n */\nexport type IntrinsicHTMLElements = {\n  // Generating it this way shows the special props for each element in editor hover\n  [key in keyof HTMLElementTagNameMap]: Augmented<HTMLElementTagNameMap[key], SpecialAttrs[key]> &\n    HTMLAttributes<HTMLElementTagNameMap[key]>;\n} & {\n  /** For unknown tags we allow all props */\n  [unknownTag: string]: { [prop: string]: any } & HTMLElementAttrs & HTMLAttributes<any>;\n};\n/**\n * These are the SVG tags with handlers allowing plain callbacks, to be used for the JSX interface\n *\n * @internal\n */\nexport type IntrinsicSVGElements = {\n  [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: LenientSVGProps<\n    SVGElementTagNameMap[K]\n  >;\n};\n\n/**\n * The DOM props without plain handlers, for use inside functions\n *\n * @public\n */\nexport type QwikHTMLElements = {\n  [tag in keyof HTMLElementTagNameMap]: Augmented<HTMLElementTagNameMap[tag], SpecialAttrs[tag]> &\n    HTMLElementAttrs &\n    QwikAttributes<HTMLElementTagNameMap[tag]>;\n};\n/**\n * The SVG props without plain handlers, for use inside functions\n *\n * @public\n */\nexport type QwikSVGElements = {\n  [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: SVGProps<\n    SVGElementTagNameMap[K]\n  >;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/types/jsx-node.ts",
    "content": "import type { JSXChildren } from './jsx-qwik-attributes';\n\n/**\n * Any valid output for a component\n *\n * @public\n */\nexport type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];\n\n/**\n * Any function taking a props object that returns JSXOutput.\n *\n * The `key`, `flags` and `dev` parameters are for internal use.\n *\n * @public\n */\nexport type FunctionComponent<P = unknown> = {\n  renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;\n}['renderFn'];\n\n/** @public */\nexport interface DevJSX {\n  fileName: string;\n  lineNumber: number;\n  columnNumber: number;\n  stack?: string;\n}\n\n/**\n * A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.\n *\n * @public\n */\nexport interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {\n  type: T;\n  props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;\n  children: JSXChildren | null;\n  key: string | null;\n  dev?: DevJSX;\n}\n\n/**\n * The internal representation of a JSX node.\n *\n * @internal\n */\nexport interface JSXNodeInternal<T extends string | FunctionComponent | unknown = unknown>\n  extends JSXNode<T> {\n  immutableProps: Record<any, unknown> | null;\n  flags: number;\n}\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/types/jsx-qwik-attributes.ts",
    "content": "import type { QRL } from '../../../qrl/qrl.public';\nimport type { Signal } from '../../../state/signal';\nimport type { JSXNode } from './jsx-node';\nimport type {\n  QwikIdleEvent,\n  QwikInitEvent,\n  QwikSymbolEvent,\n  QwikViewTransitionEvent,\n  QwikVisibleEvent,\n} from './jsx-qwik-events';\n\n/**\n * Capitalized multi-word names of some known events so we have nicer qwik attributes. For example,\n * instead of `oncompositionEnd$` we can use `onCompositionEnd$`. Note that any capitalization\n * works, so `oncompositionend$` is also valid. This is just for DX.\n *\n * Add any multi-word event names to this list. Single word events are automatically converted.\n */\ntype PascalCaseNames =\n  | 'AnimationEnd'\n  | 'AnimationIteration'\n  | 'AnimationStart'\n  | 'AuxClick'\n  | 'BeforeToggle'\n  | 'CanPlay'\n  | 'CanPlayThrough'\n  | 'CompositionEnd'\n  | 'CompositionStart'\n  | 'CompositionUpdate'\n  | 'ContextMenu'\n  | 'DblClick'\n  | 'DragEnd'\n  | 'DragEnter'\n  | 'DragExit'\n  | 'DragLeave'\n  | 'DragOver'\n  | 'DragStart'\n  | 'DurationChange'\n  | 'FocusIn'\n  | 'FocusOut'\n  | 'FullscreenChange'\n  | 'FullscreenError'\n  | 'GotPointerCapture'\n  | 'KeyDown'\n  | 'KeyPress'\n  | 'KeyUp'\n  | 'LoadedData'\n  | 'LoadedMetadata'\n  | 'LoadEnd'\n  | 'LoadStart'\n  | 'LostPointerCapture'\n  | 'MouseDown'\n  | 'MouseEnter'\n  | 'MouseLeave'\n  | 'MouseMove'\n  | 'MouseOut'\n  | 'MouseOver'\n  | 'MouseUp'\n  | 'PointerCancel'\n  | 'PointerDown'\n  | 'PointerEnter'\n  | 'PointerLeave'\n  | 'PointerMove'\n  | 'PointerOut'\n  | 'PointerOver'\n  | 'PointerUp'\n  | 'QIdle'\n  | 'QInit'\n  | 'QSymbol'\n  | 'QVisible'\n  | 'RateChange'\n  | 'RateChange'\n  | 'SecurityPolicyViolation'\n  | 'SelectionChange'\n  | 'SelectStart'\n  | 'TimeUpdate'\n  | 'TouchCancel'\n  | 'TouchEnd'\n  | 'TouchMove'\n  | 'TouchStart'\n  | 'TransitionCancel'\n  | 'TransitionEnd'\n  | 'TransitionRun'\n  | 'TransitionStart'\n  | 'VisibilityChange'\n  | 'VolumeChange';\n\ntype LcEventNameMap = {\n  [name in PascalCaseNames as Lowercase<name>]: name;\n};\n\n/**\n * Convert an event map to PascalCase. For example, `HTMLElementEventMap` contains lowercase keys,\n * so this will capitalize them, and use the `LcEventNameMap` for multi-word events names.\n */\ntype PascalMap<M> = {\n  [K in Extract<keyof M, string> as K extends keyof LcEventNameMap\n    ? LcEventNameMap[K]\n    : Capitalize<K>]: M[K];\n};\n\ntype PreventDefault = {\n  [K in keyof HTMLElementEventMap as `preventdefault:${K}`]?: boolean;\n};\n\ntype StopPropagation = {\n  [K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;\n};\n\ntype AllEventMapRaw = HTMLElementEventMap &\n  DocumentEventMap &\n  WindowEventHandlersEventMap & {\n    qidle: QwikIdleEvent;\n    qinit: QwikInitEvent;\n    qsymbol: QwikSymbolEvent;\n    qvisible: QwikVisibleEvent;\n    qviewTransition: QwikViewTransitionEvent;\n  };\n\n/** This corrects the TS definition for ToggleEvent @public */\nexport interface CorrectedToggleEvent extends Event {\n  readonly newState: 'open' | 'closed';\n  readonly prevState: 'open' | 'closed';\n}\n// Corrections to the TS types\ntype EventCorrectionMap = {\n  auxclick: PointerEvent;\n  beforetoggle: CorrectedToggleEvent;\n  click: PointerEvent;\n  dblclick: PointerEvent;\n  input: InputEvent;\n  toggle: CorrectedToggleEvent;\n};\n\ntype AllEventsMap = Omit<AllEventMapRaw, keyof EventCorrectionMap> & EventCorrectionMap;\ntype AllPascalEventMaps = PascalMap<AllEventsMap>;\n\nexport type AllEventKeys = keyof AllEventsMap;\n\ntype LcEvent<T extends string, C extends string = Lowercase<T>> = C extends keyof AllEventsMap\n  ? AllEventsMap[C]\n  : Event;\n\nexport type EventFromName<T extends string> = LcEvent<T>;\n\n/**\n * A class list can be a string, a boolean, an array, or an object.\n *\n * If it's an array, each item is a class list and they are all added.\n *\n * If it's an object, then the keys are class name strings, and the values are booleans that\n * determine if the class name string should be added or not.\n *\n * @public\n */\nexport type ClassList =\n  | string\n  | undefined\n  | null\n  | false\n  | Record<string, boolean | string | number | null | undefined>\n  | ClassList[];\n\n/**\n * A DOM event handler\n *\n * @public\n */\nexport type EventHandler<EV = Event, EL = Element> = {\n  // https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types/52668133#52668133\n  bivarianceHack(event: EV, element: EL): any;\n}['bivarianceHack'];\n\n/**\n * An event handler for Qwik events, can be a handler QRL or an array of handler QRLs.\n *\n * @beta\n */\nexport type QRLEventHandlerMulti<EV extends Event, EL> =\n  | QRL<EventHandler<EV, EL>>\n  | undefined\n  | null\n  | QRLEventHandlerMulti<EV, EL>[]\n  | EventHandler<EV, EL>;\n\ntype QwikCustomEvents<EL> = {\n  /**\n   * We don't add custom events here because often people will add props to DOM props that look like\n   * custom events but are not\n   */\n};\ntype QwikCustomEventsPlain<EL> = {\n  /** The handler */\n  [key: `${'document:' | 'window:' | ''}on${string}$`]:\n    | QRLEventHandlerMulti<Event, EL>\n    | EventHandler<Event, EL>;\n};\n\ntype QwikKnownEvents<EL> = {\n  [K in keyof AllPascalEventMaps as `${\n    | 'document:'\n    | 'window:'\n    | ''}on${K}$`]?: QRLEventHandlerMulti<AllPascalEventMaps[K], EL>;\n};\ntype QwikKnownEventsPlain<EL> = {\n  [K in keyof AllPascalEventMaps as `${'document:' | 'window:' | ''}on${K}$`]?:\n    | QRLEventHandlerMulti<AllPascalEventMaps[K], EL>\n    | EventHandler<AllPascalEventMaps[K], EL>;\n};\n\n/** @public */\nexport type QwikEvents<EL, Plain extends boolean = true> = Plain extends true\n  ? QwikKnownEventsPlain<EL> & QwikCustomEventsPlain<EL>\n  : QwikKnownEvents<EL> & QwikCustomEvents<EL>;\n\n/** @public */\nexport type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;\n\n/** @public */\nexport interface ComponentBaseProps {\n  key?: string | number | null | undefined;\n  'q:slot'?: string;\n}\n\n/** @public */\nexport type JSXChildren =\n  | string\n  | number\n  | boolean\n  | null\n  | undefined\n  | Function\n  | RegExp\n  | JSXChildren[]\n  | Promise<JSXChildren>\n  | Signal<JSXChildren>\n  | JSXNode;\n\n/** @public */\nexport interface QwikIntrinsicAttributes {\n  key?: string | number | null | undefined;\n  children?: JSXChildren;\n\n  /** Corresponding slot name used to project the element into. */\n  'q:slot'?: string;\n  'q:shadowRoot'?: boolean;\n  fetchPriority?: 'auto' | 'high' | 'low';\n}\n\n/**\n * A ref can be either a signal or a function. Note that the type of Signal is Element so that it\n * can accept more specialized elements too\n *\n * @public\n */\nexport type Ref<EL extends Element = Element> = Signal<Element | undefined> | RefFnInterface<EL>;\ntype RefFnInterface<EL> = {\n  (el: EL): void;\n};\ninterface RefAttr<EL extends Element> {\n  ref?: Ref<EL> | undefined;\n}\ninterface DOMAttributesBase<EL extends Element>\n  extends QwikIntrinsicAttributes,\n    PreventDefault,\n    StopPropagation,\n    RefAttr<EL> {\n  dangerouslySetInnerHTML?: string | undefined;\n}\n\n/** The Qwik-specific attributes that DOM elements accept @public */\nexport interface DOMAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL> {\n  class?: ClassList | Signal<ClassList> | undefined;\n}\n\n/** The Qwik DOM attributes without plain handlers, for use as function parameters @public */\nexport interface QwikAttributes<EL extends Element>\n  extends DOMAttributesBase<EL>,\n    QwikEvents<EL, false> {\n  class?: ClassList | undefined;\n}\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/types/jsx-qwik-elements.ts",
    "content": "import type {\n  IntrinsicHTMLElements,\n  IntrinsicSVGElements,\n  QwikHTMLElements,\n  QwikSVGElements,\n} from './jsx-generated';\n\nexport type { QwikIntrinsicAttributes } from './jsx-qwik-attributes';\n\n/**\n * The interface holds available attributes of both native DOM elements and custom Qwik elements. An\n * example showing how to define a customizable wrapper component:\n *\n * ```tsx\n * import { component$, Slot, type QwikIntrinsicElements } from \"@builder.io/qwik\";\n *\n * type WrapperProps = {\n *   attributes?: QwikIntrinsicElements[\"div\"];\n * };\n *\n * export default component$<WrapperProps>(({ attributes }) => {\n *   return (\n *     <div {...attributes} class=\"p-2\">\n *       <Slot />\n *     </div>\n *   );\n * });\n * ```\n *\n * Note: It is shorter to use `PropsOf<'div'>`\n *\n * @public\n */\nexport interface QwikIntrinsicElements extends QwikHTMLElements, QwikSVGElements {}\n\n/**\n * These definitions are for the JSX namespace, they allow passing plain event handlers instead of\n * QRLs\n */\nexport interface LenientQwikElements extends IntrinsicHTMLElements, IntrinsicSVGElements {}\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/types/jsx-qwik-events.ts",
    "content": "import type { AllEventKeys } from './jsx-qwik-attributes';\n\n/** Emitted by qwik-loader when an element becomes visible. Used by `useVisibleTask$` @public */\nexport type QwikVisibleEvent = CustomEvent<IntersectionObserverEntry>;\n/** Emitted by qwik-loader when a module was lazily loaded @public */\nexport type QwikSymbolEvent = CustomEvent<{\n  symbol: string;\n  element: Element;\n  reqTime: number;\n  qBase?: string;\n  qManifest?: string;\n  qVersion?: string;\n  href?: string;\n}>;\n/** Emitted by qwik-loader on document when the document first becomes interactive @public */\nexport type QwikInitEvent = CustomEvent<{}>;\n/** Emitted by qwik-loader on document when the document first becomes idle @public */\nexport type QwikIdleEvent = CustomEvent<{}>;\n/** Emitted by qwik-core on document when the a view transition start @public */\nexport type QwikViewTransitionEvent = CustomEvent<ViewTransition>;\n/** Emitted by qwik-loader on document when there was an error loading a module @public */\nexport type QwikErrorEvent = CustomEvent<\n  {\n    importError?: 'sync' | 'async' | 'no-symbol';\n    error: unknown;\n  } & QwikSymbolEvent['detail']\n>;\n\n// Utility types for supporting autocompletion in union types\n\n/** Matches any primitive value. */\nexport type Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\n/**\n * Allows creating a union type by combining primitive types and literal types without sacrificing\n * auto-completion in IDEs for the literal type part of the union.\n *\n * This type is a workaround for Microsoft/TypeScript#29729. It will be removed as soon as it's not\n * needed anymore.\n *\n * Example:\n *\n * ```ts\n * // Before\n * type Pet = 'dog' | 'cat' | string;\n *\n * const pet: Pet = '';\n * // Start typing in your TypeScript-enabled IDE.\n * // You **will not** get auto-completion for `dog` and `cat` literals.\n *\n * // After\n * type Pet2 = LiteralUnion<'dog' | 'cat', string>;\n *\n * const pet: Pet2 = '';\n * // You **will** get auto-completion for `dog` and `cat` literals.\n * ```\n */\nexport type LiteralUnion<LiteralType, BaseType extends Primitive> =\n  | LiteralType\n  | (BaseType & Record<never, never>);\n\n/**\n * The names of events that Qwik knows about. They are all lowercase, but on the JSX side, they are\n * PascalCase for nicer DX. (`onAuxClick$` vs `onauxclick$`)\n *\n * @public\n */\nexport type KnownEventNames = LiteralUnion<AllEventKeys, string>;\n\n// Deprecated old types\nexport type SyntheticEvent<T = Element, E = Event> = E & { target: EventTarget & T };\n/** @public @deprecated Use `AnimationEvent` and use the second argument to the handler function for the current event target */\nexport type NativeAnimationEvent = AnimationEvent;\n/** @public @deprecated Use `ClipboardEvent` and use the second argument to the handler function for the current event target */\nexport type NativeClipboardEvent = ClipboardEvent;\n/** @public @deprecated Use `CompositionEvent` and use the second argument to the handler function for the current event target */\nexport type NativeCompositionEvent = CompositionEvent;\n/** @public @deprecated Use `DragEvent` and use the second argument to the handler function for the current event target */\nexport type NativeDragEvent = DragEvent;\n/** @public @deprecated Use `FocusEvent` and use the second argument to the handler function for the current event target */\nexport type NativeFocusEvent = FocusEvent;\n/** @public @deprecated Use `KeyboardEvent` and use the second argument to the handler function for the current event target */\nexport type NativeKeyboardEvent = KeyboardEvent;\n/** @public @deprecated Use `MouseEvent` and use the second argument to the handler function for the current event target */\nexport type NativeMouseEvent = MouseEvent;\n/** @public @deprecated Use `TouchEvent` and use the second argument to the handler function for the current event target */\nexport type NativeTouchEvent = TouchEvent;\n/** @public @deprecated Use `PointerEvent` and use the second argument to the handler function for the current event target */\nexport type NativePointerEvent = PointerEvent;\n/** @public @deprecated Use `TransitionEvent` and use the second argument to the handler function for the current event target */\nexport type NativeTransitionEvent = TransitionEvent;\n/** @public @deprecated Use `UIEvent` and use the second argument to the handler function for the current event target */\nexport type NativeUIEvent = UIEvent;\n/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */\nexport type NativeWheelEvent = WheelEvent;\n/** @public @deprecated Use `AnimationEvent` and use the second argument to the handler function for the current event target */\nexport type QwikAnimationEvent<T = Element> = NativeAnimationEvent;\n/** @public @deprecated Use `ClipboardEvent` and use the second argument to the handler function for the current event target */\nexport type QwikClipboardEvent<T = Element> = NativeClipboardEvent;\n/** @public @deprecated Use `CompositionEvent` and use the second argument to the handler function for the current event target */\nexport type QwikCompositionEvent<T = Element> = NativeCompositionEvent;\n/** @public @deprecated Use `DragEvent` and use the second argument to the handler function for the current event target */\nexport type QwikDragEvent<T = Element> = NativeDragEvent;\n/** @public @deprecated Use `PointerEvent` and use the second argument to the handler function for the current event target */\nexport type QwikPointerEvent<T = Element> = NativePointerEvent;\n/** @public @deprecated Use `FocusEvent` and use the second argument to the handler function for the current event target */\nexport type QwikFocusEvent<T = Element> = NativeFocusEvent;\n/** @public @deprecated Use `SubmitEvent` and use the second argument to the handler function for the current event target */\nexport type QwikSubmitEvent<T = Element> = SubmitEvent;\n/** @public @deprecated Use `Event` and use the second argument to the handler function for the current event target */\nexport type QwikInvalidEvent<T = Element> = Event;\n/** @public @deprecated Use `Event` and use the second argument to the handler function for the current event target. Also note that in Qwik, onInput$ with the InputEvent is the event that behaves like onChange in React. */\nexport type QwikChangeEvent<T = Element> = Event;\n/** @public @deprecated Use `KeyboardEvent` and use the second argument to the handler function for the current event target */\nexport type QwikKeyboardEvent<T = Element> = NativeKeyboardEvent;\n/** @public @deprecated Use `MouseEvent` and use the second argument to the handler function for the current event target */\nexport type QwikMouseEvent<T = Element, E = NativeMouseEvent> = E;\n/** @public @deprecated Use `TouchEvent` and use the second argument to the handler function for the current event target */\nexport type QwikTouchEvent<T = Element> = NativeTouchEvent;\n/** @public @deprecated Use `UIEvent` and use the second argument to the handler function for the current event target */\nexport type QwikUIEvent<T = Element> = NativeUIEvent;\n/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */\nexport type QwikWheelEvent<T = Element> = NativeWheelEvent;\n/** @public @deprecated Use `TransitionEvent` and use the second argument to the handler function for the current event target */\nexport type QwikTransitionEvent<T = Element> = NativeTransitionEvent;\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/types/jsx-qwik.ts",
    "content": "import type { DOMAttributes, JSXChildren } from './jsx-qwik-attributes';\nimport type { FunctionComponent, JSXOutput } from './jsx-node';\nimport type { QwikIntrinsicAttributes, LenientQwikElements } from './jsx-qwik-elements';\n\n/** @public */\nexport namespace QwikJSX {\n  export type Element = JSXOutput;\n  export type ElementType = string | FunctionComponent<Record<any, any>>;\n\n  export interface IntrinsicAttributes extends QwikIntrinsicAttributes {}\n  export interface ElementChildrenAttribute {\n    children: JSXChildren;\n  }\n  export interface IntrinsicElements extends LenientQwikElements {}\n}\n/** @public */\nexport interface QwikDOMAttributes extends DOMAttributes<Element> {}\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/types/jsx-types.unit.tsx",
    "content": "import { assertType, describe, expectTypeOf, test } from 'vitest';\nimport { component$, type PropsOf, type PublicProps } from '../../../component/component.public';\nimport { $, type PropFunction } from '../../../qrl/qrl.public';\nimport type { JSX } from '../jsx-runtime';\nimport type { QwikHTMLElements, QwikSVGElements, Size } from './jsx-generated';\nimport type { FunctionComponent, JSXOutput } from './jsx-node';\nimport type { EventHandler, JSXChildren, QRLEventHandlerMulti } from './jsx-qwik-attributes';\nimport type { QwikIntrinsicElements } from './jsx-qwik-elements';\n\ndescribe('types', () => {\n  // Note, these type checks happen at compile time. We don't need to call anything, so we do ()=>()=>. We just need to\n  // make sure the type check runs.\n  test('basic', () => () => {\n    expectTypeOf(<div />).toEqualTypeOf<JSXOutput>();\n    expectTypeOf<QRLEventHandlerMulti<PointerEvent, HTMLDivElement>>().toMatchTypeOf<\n      QwikIntrinsicElements['div']['onAuxClick$']\n    >();\n    expectTypeOf<QwikIntrinsicElements['li']['children']>().toEqualTypeOf<JSXChildren>();\n    expectTypeOf<QwikIntrinsicElements['link']['children']>().toEqualTypeOf<undefined>();\n    expectTypeOf<QwikIntrinsicElements['svg']['width']>().toEqualTypeOf<Size | undefined>();\n  });\n\n  test('untyped components', () => () => {\n    const WithP = component$((p) => {\n      expectTypeOf(p).toEqualTypeOf<unknown>();\n      return <div />;\n    });\n    const NoP = component$(() => <div />);\n    expectTypeOf<PropsOf<typeof WithP>>().toEqualTypeOf<never>();\n    expectTypeOf<PropsOf<typeof NoP>>().toEqualTypeOf<never>();\n    component$(() => {\n      return (\n        <>\n          <WithP key={123}>\n            <div />\n          </WithP>\n          <NoP key={123}>\n            <div />\n          </NoP>\n        </>\n      );\n    });\n\n    const Fn = () => <div />;\n    expectTypeOf<PropsOf<typeof Fn>>().toEqualTypeOf<never>();\n    const Cmp = component$(Fn);\n    expectTypeOf(Cmp).toEqualTypeOf<FunctionComponent<PublicProps<unknown>>>();\n    expectTypeOf(Cmp).not.toEqualTypeOf<FunctionComponent<{ foo: string }>>();\n  });\n\n  test('inferring FunctionComponent', () => () => {\n    const makeFC = <T,>(fn: (p: T) => JSX.Element): FunctionComponent<T> => fn;\n\n    const FCNoP = makeFC(() => <div />);\n    expectTypeOf<PropsOf<typeof FCNoP>>().toEqualTypeOf<never>();\n\n    const FCWithP = makeFC((p) => {\n      expectTypeOf(p).not.toBeAny();\n      expectTypeOf(p).toEqualTypeOf<unknown>();\n      return <div />;\n    });\n\n    expectTypeOf<PropsOf<typeof FCWithP>>().toEqualTypeOf<never>();\n  });\n\n  test('accepting FunctionComponent', () => () => {\n    const f = <P,>(fn: FunctionComponent<P>) => null as P;\n    expectTypeOf(f(() => <div />)).toEqualTypeOf<unknown>();\n    expectTypeOf(\n      f((p) => {\n        expectTypeOf(p).not.toBeAny();\n        expectTypeOf(p).toEqualTypeOf<unknown>();\n        return <div />;\n      })\n    ).toEqualTypeOf<unknown>();\n    expectTypeOf(f(component$<{ foo: string }>(() => <div />))).toEqualTypeOf<\n      PublicProps<{ foo: string }>\n    >();\n  });\n\n  test('component', () => () => {\n    const Cmp = component$((props: PropsOf<'svg'>) => {\n      const { width = '240', height = '56', onClick$, ...rest } = props;\n      expectTypeOf(onClick$).toEqualTypeOf<QRLEventHandlerMulti<PointerEvent, SVGSVGElement>>();\n      return (\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          version=\"1.1\"\n          width={width}\n          height={height}\n          {...rest}\n        />\n      );\n    });\n    expectTypeOf<Parameters<typeof Cmp>[0]['onClick$']>().toMatchTypeOf<\n      EventHandler<PointerEvent, SVGSVGElement> | QRLEventHandlerMulti<PointerEvent, SVGSVGElement>\n    >();\n\n    return (\n      <p>\n        <Cmp />\n      </p>\n    );\n  });\n  test('PropFunction', () => () => {\n    const CmpButton = component$<{\n      onClick$?: PropFunction<() => void>;\n    }>((props) => <button onClick$={props.onClick$} />);\n\n    <CmpButton onClick$={() => alert('CLICKED!')}>click me!</CmpButton>;\n  });\n\n  test('unknown string component', () => () => {\n    const t = (\n      <hello-there\n        class=\"hi\"\n        onClick$={(ev, el) => {\n          expectTypeOf(ev).not.toBeAny();\n          expectTypeOf(ev).toEqualTypeOf<PointerEvent>();\n          // Because of interface constraints, this type is \"never\"\n          // expectTypeOf(el).toEqualTypeOf<Element>();\n        }}\n      />\n    );\n    expectTypeOf(t).toEqualTypeOf<JSX.Element>();\n  });\n\n  test('inferring', () => () => {\n    // Popover API\n    expectTypeOf<PropsOf<'button'>>().toMatchTypeOf<{\n      popovertarget?: string;\n    }>();\n    expectTypeOf<{\n      type: 'button';\n      popovertarget?: string;\n    }>().toMatchTypeOf<PropsOf<'input'>>();\n    <>\n      <button popovertarget=\"meep\" />\n      <input type=\"button\" popovertarget=\"meep\" />\n      <div popover=\"manual\" id=\"meep\" />\n      <div\n        onToggle$={(ev, el) => {\n          expectTypeOf(ev).not.toBeAny();\n          // It's Event because api extractor doesn't know about ToggleEvent\n          // assertType<ToggleEvent>(ev);\n          expectTypeOf(ev.newState).toBeString();\n        }}\n        onBeforeToggle$={(ev, el) => {\n          expectTypeOf(ev).not.toBeAny();\n          // assertType<ToggleEvent>(ev);\n          expectTypeOf(ev.prevState).toBeString();\n        }}\n        onBlur$={(ev) => {\n          expectTypeOf(ev).not.toBeAny();\n          assertType<FocusEvent>(ev);\n        }}\n        window:onAnimationEnd$={(ev) => {\n          expectTypeOf(ev).not.toBeAny();\n          assertType<AnimationEvent>(ev);\n        }}\n        document:onAbort$={(ev) => {\n          expectTypeOf(ev).not.toBeAny();\n          assertType<UIEvent>(ev);\n        }}\n        // Infer through $\n        onAuxClick$={$((ev) => {\n          expectTypeOf(ev).not.toBeAny();\n          assertType<PointerEvent>(ev);\n        })}\n        // Array of handlers\n        onInput$={[\n          $((ev) => {\n            expectTypeOf(ev).not.toBeAny();\n            assertType<InputEvent>(ev);\n          }),\n          null,\n          undefined,\n          [\n            $(async (ev, el) => {\n              expectTypeOf(ev).not.toBeAny();\n              assertType<InputEvent>(ev);\n              expectTypeOf(el).not.toBeAny();\n              assertType<HTMLDivElement>(el);\n            }),\n          ],\n        ]}\n      />\n    </>;\n  });\n\n  test('polymorphic component', () => () => {\n    const Poly = component$(\n      <C extends string | FunctionComponent = 'div'>({\n        as,\n        ...props\n      }: { as?: C } & PropsOf<string extends C ? 'div' : C>) => {\n        const Cmp = as || 'div';\n        return <Cmp {...props}>hi</Cmp>;\n      }\n    );\n    expectTypeOf<Parameters<typeof Poly<'button'>>[0]['popovertarget']>().toEqualTypeOf<\n      string | undefined\n    >();\n    expectTypeOf<Parameters<typeof Poly<'a'>>[0]['href']>().toEqualTypeOf<string | undefined>();\n    expectTypeOf<Parameters<typeof Poly<'button'>>[0]>().not.toHaveProperty('href');\n    expectTypeOf<Parameters<typeof Poly<'a'>>[0]>().not.toHaveProperty('popovertarget');\n    expectTypeOf<\n      Parameters<Extract<Parameters<typeof Poly>[0]['onClick$'], EventHandler>>[1]\n    >().toEqualTypeOf<HTMLDivElement>();\n\n    const MyCmp = component$((p: { name: string }) => <span>Hi {p.name}</span>);\n\n    return (\n      <>\n        <Poly\n          onClick$={(ev, el) => {\n            expectTypeOf(ev).not.toBeAny();\n            expectTypeOf(ev).toEqualTypeOf<PointerEvent>();\n            expectTypeOf(el).toEqualTypeOf<HTMLDivElement>();\n          }}\n          // This should error\n          // popovertarget\n        >\n          Foo\n        </Poly>\n        <Poly\n          as=\"a\"\n          onClick$={(ev, el) => {\n            expectTypeOf(ev).not.toBeAny();\n            expectTypeOf(ev).toEqualTypeOf<PointerEvent>();\n            expectTypeOf(el).toEqualTypeOf<HTMLAnchorElement>();\n          }}\n          href=\"hi\"\n          // This should error\n          // popovertarget\n        >\n          Foo\n        </Poly>\n        <Poly\n          as=\"button\"\n          onClick$={(ev, el) => {\n            expectTypeOf(ev).not.toBeAny();\n            expectTypeOf(ev).toEqualTypeOf<PointerEvent>();\n            expectTypeOf(el).toEqualTypeOf<HTMLButtonElement>();\n          }}\n          popovertarget=\"foo\"\n        >\n          Bar\n        </Poly>\n        <Poly as={Poly} />\n        <Poly as={MyCmp} name=\"meep\" />\n      </>\n    );\n  });\n\n  test('FunctionComponent', () => () => {\n    const Cmp = component$((props: { foo: string }) => null);\n    expectTypeOf(Cmp).toMatchTypeOf<FunctionComponent<{ foo: string }>>();\n    expectTypeOf<FunctionComponent<{ foo: string }>>().toMatchTypeOf(Cmp);\n\n    expectTypeOf((p: { hi: number }) => <span>{p.hi}</span>).toMatchTypeOf<FunctionComponent>();\n    expectTypeOf((p: { hi: number }) => <span>{p.hi}</span>).toMatchTypeOf<\n      FunctionComponent<{ hi: number }>\n    >();\n    expectTypeOf((p: { hi: number }) => <span>{p.hi}</span>).not.toMatchTypeOf<\n      FunctionComponent<{ hi: string }>\n    >();\n    expectTypeOf((p: { hi: number }) => <span>{p.hi}</span>).not.toMatchTypeOf<\n      FunctionComponent<{ meep: string }>\n    >();\n    expectTypeOf((p: { hi: number }) => `${p.hi}`).toMatchTypeOf<\n      FunctionComponent<{ hi: number }>\n    >();\n    expectTypeOf((p: { hi: number }) => p.hi).toMatchTypeOf<FunctionComponent<{ hi: number }>>();\n    expectTypeOf((p: { hi?: number | boolean | null }) => p.hi).toMatchTypeOf<\n      FunctionComponent<{ hi: number }>\n    >();\n    expectTypeOf(() => null).toMatchTypeOf<FunctionComponent<{ hi: number }>>();\n\n    expectTypeOf(() => new Date()).not.toMatchTypeOf<FunctionComponent>();\n  });\n\n  test('PropsOf', () => () => {\n    // tags\n    expectTypeOf<PropsOf<'div'>>().toEqualTypeOf<QwikHTMLElements['div']>();\n    expectTypeOf<PropsOf<'div'>>().not.toEqualTypeOf<QwikIntrinsicElements['li']>();\n    expectTypeOf<PropsOf<'path'>>().toEqualTypeOf<QwikSVGElements['path']>();\n    expectTypeOf<PropsOf<'not-exist'>>().toEqualTypeOf<QwikHTMLElements['span']>();\n\n    // functions\n    const NoProps = () => <div />;\n    expectTypeOf<PropsOf<typeof NoProps>>().toEqualTypeOf<never>();\n    const UnknownProps = (p: unknown) => <div />;\n    expectTypeOf<PropsOf<typeof UnknownProps>>().toEqualTypeOf<never>();\n    const AnyProps = (p: any) => <div />;\n    expectTypeOf<PropsOf<typeof AnyProps>>().toEqualTypeOf<any>();\n    const DefProps = (props: { foo: string }) => <div />;\n    expectTypeOf<PropsOf<typeof DefProps>>().toEqualTypeOf<{ foo: string }>();\n    const PolyProps = <C extends string = ''>(\n      p: { as?: C; b: boolean } & (C extends 'hi' ? { foo: boolean } : never)\n    ) => <div />;\n    expectTypeOf<PropsOf<typeof PolyProps<'hi'>>>().toMatchTypeOf<{\n      as?: 'hi';\n      b: boolean;\n      foo: boolean;\n    }>();\n\n    // components\n    const NoProps$ = component$(NoProps);\n    expectTypeOf<PropsOf<typeof NoProps$>>().toEqualTypeOf<never>();\n    const UnknownProps$ = component$(UnknownProps);\n    expectTypeOf<PropsOf<typeof UnknownProps$>>().toEqualTypeOf<never>();\n    const AnyProps$ = component$(AnyProps);\n    expectTypeOf<PropsOf<typeof AnyProps$>>().toEqualTypeOf<any>();\n    const DefProps$ = component$(DefProps);\n    expectTypeOf<PropsOf<typeof DefProps$>>().toEqualTypeOf<{ foo: string }>();\n    const PolyProps$ = component$(PolyProps);\n    expectTypeOf<PropsOf<typeof PolyProps$<'hi'>>>().toMatchTypeOf<{\n      as?: 'hi';\n      b: boolean;\n      foo: boolean;\n    }>();\n\n    // edge cases\n    expectTypeOf<PropsOf<typeof DefProps$ | null>>().toEqualTypeOf<{ foo: string }>();\n\n    expectTypeOf<PropsOf<17>>().toEqualTypeOf<never>();\n  });\n\n  test('CSSProperties', () => () => {\n    return (\n      <div\n        style={{\n          color: 'red',\n          backgroundColor: 'blue',\n          // Using a CSS variable\n          '--my-variable': '10px',\n          // Using a number value\n          marginTop: 10,\n          // Using a string value\n          padding: '5px',\n        }}\n      />\n    );\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/render/jsx/utils.public.ts",
    "content": "import { jsx, RenderOnce } from '../jsx/jsx-runtime';\nimport type { StreamWriter } from '../ssr/render-ssr';\nimport type { FunctionComponent, JSXNode } from './types/jsx-node';\nimport type { JSXChildren } from './types/jsx-qwik-attributes';\n\n/** @public */\nexport const SkipRender: JSXNode = Symbol('skip render') as any;\n\n/** @public */\nexport const SSRRaw: FunctionComponent<{ data: string }> = (() => null) as any;\n\n/** @public */\nexport const SSRComment: FunctionComponent<{ data: string }> = (props) =>\n  jsx(SSRRaw, { data: `<!--${props.data}-->` }, null) as any;\n\n/** @public */\nexport const SSRStreamBlock: FunctionComponent<{ children?: any }> = (props) => {\n  return [\n    jsx(SSRComment, { data: 'qkssr-pu' }),\n    props.children,\n    jsx(SSRComment, { data: 'qkssr-po' }),\n  ] as any;\n};\n\n/** @public */\nexport type SSRStreamProps = {\n  children:\n    | AsyncGenerator<JSXChildren, void, any>\n    | ((stream: StreamWriter) => Promise<void>)\n    | (() => AsyncGenerator<JSXChildren, void, any>);\n};\n\n/** @public */\nexport const SSRStream: FunctionComponent<SSRStreamProps> = (props, key) =>\n  jsx(RenderOnce, { children: jsx(InternalSSRStream, props) }, key);\n\n/** @public */\nexport type SSRHintProps = {\n  dynamic?: boolean;\n};\n\n/**\n * @deprecated - It has no effect\n * @public\n */\nexport const SSRHint: FunctionComponent<SSRHintProps> = (() => null) as any;\n\nexport const InternalSSRStream: FunctionComponent<SSRStreamProps> = () => null;\n"
  },
  {
    "path": "packages/qwik/src/core/render/ssr/render-ssr.ts",
    "content": "import {\n  createContainerState,\n  getEventName,\n  setRef,\n  type ContainerState,\n} from '../../container/container';\nimport { assertDefined } from '../../error/assert';\nimport { QError_canNotRenderHTML, qError } from '../../error/error';\nimport { serializeQRLs } from '../../qrl/qrl';\nimport { Q_CTX, _IMMUTABLE, _IMMUTABLE_PREFIX } from '../../state/constants';\nimport {\n  HOST_FLAG_DIRTY,\n  HOST_FLAG_DYNAMIC,\n  HOST_FLAG_NEED_ATTACH_LISTENER,\n  createContext,\n  type QContext,\n} from '../../state/context';\nimport {\n  PREVENT_DEFAULT,\n  groupListeners,\n  isOnProp,\n  setEvent,\n  type Listener,\n} from '../../state/listeners';\nimport { isSignal } from '../../state/signal';\nimport { createPropsState, createProxy } from '../../state/store';\nimport { serializeSStyle } from '../../style/qrl-styles';\nimport { invoke, newInvokeContext, trackSignal, type InvokeContext } from '../../use/use-core';\nimport { EMPTY_OBJ } from '../../util/flyweight';\nimport { logError, logWarn } from '../../util/log';\nimport { ELEMENT_ID, OnRenderProp, QScopedStyle, QSlot, QSlotS, QStyle } from '../../util/markers';\nimport { isPromise, maybeThen } from '../../util/promises';\nimport { qDev, qInspector, seal } from '../../util/qdev';\nimport { isArray, isFunction, isString, type ValueOrPromise } from '../../util/types';\nimport { version } from '../../version';\nimport type { QwikElement } from '../dom/virtual-element';\nimport {\n  createRenderContext,\n  dangerouslySetInnerHTML,\n  executeComponent,\n  getNextIndex,\n  isAriaAttribute,\n  jsxToString,\n  pushRenderContext,\n  serializeClass,\n  shouldWrapFunctional,\n  static_subtree,\n  stringifyStyle,\n} from '../execute-component';\nimport { Virtual, _jsxC, _jsxQ, createJSXError, isJSXNode } from '../jsx/jsx-runtime';\nimport type { FunctionComponent, JSXNode, JSXNodeInternal, JSXOutput } from '../jsx/types/jsx-node';\nimport type { ClassList, JSXChildren } from '../jsx/types/jsx-qwik-attributes';\nimport { InternalSSRStream, SSRRaw } from '../jsx/utils.public';\nimport type { RenderContext } from '../types';\n\nconst FLUSH_COMMENT = '<!--qkssr-f-->';\n\n/** @public */\nexport type StreamWriter = {\n  write: (chunk: string) => void;\n};\n\n/** @public */\nexport interface RenderSSROptions {\n  containerTagName: string;\n  containerAttributes: Record<string, string>;\n  stream: StreamWriter;\n  base?: string;\n  serverData?: Record<string, any>;\n  beforeContent?: JSXNode<string>[];\n  beforeClose?: (\n    contexts: QContext[],\n    containerState: ContainerState,\n    containsDynamic: boolean,\n    textNodes: Map<string, string>\n  ) => Promise<JSXNode>;\n  manifestHash: string;\n}\n\nexport interface SSRContext {\n  $projectedCtxs$: [RenderContext, SSRContext] | undefined;\n  $projectedChildren$: Record<string, any[] | undefined> | undefined;\n  $invocationContext$: InvokeContext | undefined;\n  $static$: SSRContextStatic;\n}\n\nexport interface SSRContextStatic {\n  $locale$: string;\n  $contexts$: QContext[];\n  $headNodes$: JSXNode<string>[];\n  $textNodes$: Map<string, string>;\n}\n\nconst IS_HEAD = 1 << 0;\nconst IS_HTML = 1 << 2;\nconst IS_TEXT = 1 << 3;\nconst IS_INVISIBLE = 1 << 4;\nconst IS_PHASING = 1 << 5;\nconst IS_ANCHOR = 1 << 6;\nconst IS_BUTTON = 1 << 7;\nconst IS_TABLE = 1 << 8;\nconst IS_PHRASING_CONTAINER = 1 << 9;\nconst IS_IMMUTABLE = 1 << 10;\n\nclass MockElement {\n  [Q_CTX] = null;\n  constructor(public readonly nodeType: number) {\n    seal(this);\n  }\n}\n\nconst createDocument = () => {\n  return new MockElement(9);\n};\n\n/** @internal */\nexport const _renderSSR = async (node: JSXOutput, opts: RenderSSROptions) => {\n  const root = opts.containerTagName;\n  const containerEl = createMockQContext(1).$element$;\n  const containerState = createContainerState(containerEl as Element, opts.base ?? '/');\n  containerState.$serverData$.locale = opts.serverData?.locale;\n  const doc = createDocument();\n  const rCtx = createRenderContext(doc as any, containerState);\n  const headNodes = opts.beforeContent ?? [];\n  if (qDev) {\n    if (\n      root in phasingContent ||\n      root in emptyElements ||\n      root in tableContent ||\n      root in startPhasingContent ||\n      root in invisibleElements\n    ) {\n      throw new Error(\n        `The \"containerTagName\" can not be \"${root}\". Please choose a different tag name like: \"div\", \"html\", \"custom-container\".`\n      );\n    }\n  }\n  const ssrCtx: SSRContext = {\n    $static$: {\n      $contexts$: [],\n      $headNodes$: root === 'html' ? headNodes : [],\n      $locale$: opts.serverData?.locale,\n      $textNodes$: new Map(),\n    },\n    $projectedChildren$: undefined,\n    $projectedCtxs$: undefined,\n    $invocationContext$: undefined,\n  };\n  seal(ssrCtx);\n\n  const locale = opts.serverData?.locale;\n  const containerAttributes = opts.containerAttributes;\n  const qRender = containerAttributes['q:render'];\n  containerAttributes['q:container'] = 'paused';\n  containerAttributes['q:version'] = version ?? 'dev';\n  containerAttributes['q:render'] = (qRender ? qRender + '-' : '') + (qDev ? 'ssr-dev' : 'ssr');\n  containerAttributes['q:base'] = opts.base || '';\n  containerAttributes['q:locale'] = locale;\n  containerAttributes['q:manifest-hash'] = opts.manifestHash;\n  containerAttributes['q:instance'] = hash();\n\n  const children = root === 'html' ? [node] : [headNodes, node];\n  if (root !== 'html') {\n    containerAttributes.class =\n      'qc📦' + (containerAttributes.class ? ' ' + containerAttributes.class : '');\n  }\n  const serverData = (containerState.$serverData$ = {\n    ...containerState.$serverData$,\n    ...opts.serverData,\n  });\n  serverData.containerAttributes = {\n    ...serverData['containerAttributes'],\n    ...containerAttributes,\n  };\n  const invokeCtx = (ssrCtx.$invocationContext$ = newInvokeContext(locale));\n  invokeCtx.$renderCtx$ = rCtx;\n  ssrCtx.$invocationContext$;\n\n  const rootNode = _jsxQ(\n    root,\n    null,\n    containerAttributes,\n    children,\n    HOST_FLAG_DIRTY | HOST_FLAG_NEED_ATTACH_LISTENER,\n    null\n  );\n  containerState.$hostsRendering$ = new Set();\n  await Promise.resolve().then(() =>\n    renderRoot(rootNode, rCtx, ssrCtx, opts.stream, containerState, opts)\n  );\n};\n\nconst hash = () => Math.random().toString(36).slice(2);\n\nconst renderRoot = async (\n  node: JSXNodeInternal,\n  rCtx: RenderContext,\n  ssrCtx: SSRContext,\n  stream: StreamWriter,\n  containerState: ContainerState,\n  opts: RenderSSROptions\n) => {\n  const beforeClose = opts.beforeClose;\n\n  await renderNode(\n    node,\n    rCtx,\n    ssrCtx,\n    stream,\n    0,\n    beforeClose\n      ? (stream: StreamWriter) => {\n          const result = beforeClose(\n            ssrCtx.$static$.$contexts$,\n            containerState,\n            false,\n            ssrCtx.$static$.$textNodes$\n          );\n          return processData(result, rCtx, ssrCtx, stream, 0, undefined);\n        }\n      : undefined\n  );\n\n  if (qDev) {\n    if (ssrCtx.$static$.$headNodes$.length > 0) {\n      logError(\n        'Missing <head>. Global styles could not be rendered. Please render a <head> element at the root of the app'\n      );\n    }\n  }\n  return rCtx;\n};\n\nconst renderGenerator = async (\n  node: JSXNode<typeof InternalSSRStream>,\n  rCtx: RenderContext,\n  ssrCtx: SSRContext,\n  stream: StreamWriter,\n  flags: number\n) => {\n  stream.write(FLUSH_COMMENT);\n  const generator = node.props.children;\n  let value: AsyncGenerator;\n  if (isFunction(generator)) {\n    const v = generator({\n      write(chunk) {\n        stream.write(chunk);\n        stream.write(FLUSH_COMMENT);\n      },\n    });\n    if (isPromise(v)) {\n      return v;\n    }\n    value = v;\n  } else {\n    value = generator;\n  }\n  for await (const chunk of value) {\n    await processData(chunk, rCtx, ssrCtx, stream, flags, undefined);\n    stream.write(FLUSH_COMMENT);\n  }\n};\n\nconst renderNodeVirtual = (\n  node: JSXNode<typeof Virtual>,\n  elCtx: QContext,\n  extraNodes: JSXNode<string>[] | undefined,\n  rCtx: RenderContext,\n  ssrCtx: SSRContext,\n  stream: StreamWriter,\n  flags: number,\n  beforeClose?: (stream: StreamWriter) => ValueOrPromise<void>\n) => {\n  const props = node.props;\n  const renderQrl = props[OnRenderProp];\n  if (renderQrl) {\n    elCtx.$componentQrl$ = renderQrl;\n    return renderSSRComponent(rCtx, ssrCtx, stream, elCtx, node, flags, beforeClose);\n  }\n  let virtualComment = '<!--qv' + renderVirtualAttributes(props as any);\n  const isSlot = QSlotS in props;\n  const key = node.key != null ? escapeHtml(String(node.key)) : null;\n  if (isSlot) {\n    assertDefined(rCtx.$cmpCtx$?.$id$, 'hostId must be defined for a slot');\n    virtualComment += ' q:sref=' + rCtx.$cmpCtx$.$id$;\n  }\n  if (key != null) {\n    virtualComment += ' q:key=' + key;\n  }\n  virtualComment += '-->';\n  stream.write(virtualComment);\n\n  const html = node.props[dangerouslySetInnerHTML];\n  if (html) {\n    stream.write(html);\n    stream.write(CLOSE_VIRTUAL);\n    return;\n  }\n  if (extraNodes) {\n    for (const node of extraNodes) {\n      // We trust that the attributes are strings\n      renderNodeElementSync(node.type, node.props as any as Record<string, string>, stream);\n    }\n  }\n  const promise = walkChildren(node.children, rCtx, ssrCtx, stream, flags);\n  return maybeThen(promise, () => {\n    // Fast path\n    if (!isSlot && !beforeClose) {\n      stream.write(CLOSE_VIRTUAL);\n      return;\n    }\n\n    let promise: ValueOrPromise<void> | undefined;\n    if (isSlot) {\n      assertDefined(key, 'key must be defined for a slot');\n      const content = ssrCtx.$projectedChildren$?.[key];\n      if (content) {\n        const [rCtx, sCtx] = ssrCtx.$projectedCtxs$!;\n        const newSlotRctx = pushRenderContext(rCtx);\n        newSlotRctx.$slotCtx$ = elCtx;\n        ssrCtx.$projectedChildren$![key] = undefined;\n        promise = processData(content, newSlotRctx, sCtx, stream, flags);\n      }\n    }\n    // Inject before close\n    if (beforeClose) {\n      promise = maybeThen(promise, () => beforeClose(stream));\n    }\n\n    return maybeThen(promise, () => {\n      stream.write(CLOSE_VIRTUAL);\n    });\n  });\n};\n\nconst CLOSE_VIRTUAL = `<!--/qv-->`;\n\nexport const renderAttributes = (attributes: Record<string, string>): string => {\n  let text = '';\n  for (const prop in attributes) {\n    if (prop === dangerouslySetInnerHTML) {\n      continue;\n    }\n    const value = attributes[prop];\n    if (value != null) {\n      text += ' ' + (value === '' ? prop : prop + '=\"' + escapeValue(value) + '\"');\n    }\n  }\n  return text;\n};\n\nexport const renderVirtualAttributes = (attributes: Record<string, string>): string => {\n  let text = '';\n  for (const prop in attributes) {\n    if (prop === 'children' || prop === dangerouslySetInnerHTML) {\n      continue;\n    }\n    const value = attributes[prop];\n    if (value != null) {\n      text += ' ' + (value === '' ? prop : prop + '=' + escapeValue(value) + '');\n    }\n  }\n  return text;\n};\n\nconst renderNodeElementSync = (\n  tagName: string,\n  attributes: Record<string, string>,\n  stream: StreamWriter\n) => {\n  stream.write('<' + tagName + renderAttributes(attributes) + '>');\n  const empty = !!emptyElements[tagName];\n  if (empty) {\n    return;\n  }\n\n  // Render innerHTML\n  const innerHTML = attributes[dangerouslySetInnerHTML];\n  if (innerHTML != null) {\n    stream.write(innerHTML);\n  }\n  stream.write(`</${tagName}>`);\n};\n\n/** Render a component$ */\nconst renderSSRComponent = (\n  rCtx: RenderContext,\n  ssrCtx: SSRContext,\n  stream: StreamWriter,\n  elCtx: QContext,\n  node: JSXNode<typeof Virtual>,\n  flags: number,\n  beforeClose?: (stream: StreamWriter) => ValueOrPromise<void>\n): ValueOrPromise<void> => {\n  const props = node.props;\n  setComponentProps(rCtx, elCtx, props.props!);\n  return maybeThen(executeComponent(rCtx, elCtx), (res) => {\n    const hostElement = elCtx.$element$;\n    const newRCtx = res.rCtx;\n    const iCtx = newInvokeContext(ssrCtx.$static$.$locale$, hostElement, undefined);\n    iCtx.$subscriber$ = [0, hostElement];\n    iCtx.$renderCtx$ = newRCtx;\n    const newSSrContext: SSRContext = {\n      $static$: ssrCtx.$static$,\n      $projectedChildren$: splitProjectedChildren(node.children, ssrCtx),\n      $projectedCtxs$: [rCtx, ssrCtx],\n      $invocationContext$: iCtx,\n    };\n\n    const extraNodes: JSXNode<string>[] = [];\n    if (elCtx.$appendStyles$) {\n      const isHTML = !!(flags & IS_HTML);\n      const array = isHTML ? ssrCtx.$static$.$headNodes$ : extraNodes;\n      for (const style of elCtx.$appendStyles$) {\n        array.push(\n          _jsxQ(\n            'style',\n            {\n              [QStyle]: style.styleId,\n              [dangerouslySetInnerHTML]: style.content,\n              hidden: '',\n            },\n            null,\n            null,\n            0,\n            null\n          )\n        );\n      }\n    }\n    const newID = getNextIndex(rCtx);\n    const scopeId = elCtx.$scopeIds$ ? serializeSStyle(elCtx.$scopeIds$) : undefined;\n    const processedNode = _jsxC(\n      node.type,\n      {\n        [QScopedStyle]: scopeId,\n        [ELEMENT_ID]: newID,\n        children: res.node,\n      },\n      0,\n      node.key\n    );\n\n    elCtx.$id$ = newID;\n    ssrCtx.$static$.$contexts$.push(elCtx);\n\n    return renderNodeVirtual(\n      processedNode,\n      elCtx,\n      extraNodes,\n      newRCtx,\n      newSSrContext,\n      stream,\n      flags,\n      (stream) => {\n        if (elCtx.$flags$ & HOST_FLAG_NEED_ATTACH_LISTENER) {\n          const placeholderCtx = createMockQContext(1);\n          const listeners = placeholderCtx.li;\n          listeners.push(...elCtx.li);\n          elCtx.$flags$ &= ~HOST_FLAG_NEED_ATTACH_LISTENER;\n          placeholderCtx.$id$ = getNextIndex(rCtx);\n          /**\n           * This is a placeholder for qwik attributes when the component does not have a DOM\n           * element. We keep it empty, so it can be a script tag without type.\n           */\n          const attributes: Record<string, string> = {\n            hidden: '',\n            'q:id': placeholderCtx.$id$,\n          };\n          ssrCtx.$static$.$contexts$.push(placeholderCtx);\n\n          const groups = groupListeners(listeners);\n          for (const listener of groups) {\n            const eventName = normalizeInvisibleEvents(listener[0]);\n            attributes[eventName] = serializeQRLs(\n              listener[1],\n              rCtx.$static$.$containerState$,\n              placeholderCtx\n            );\n            registerQwikEvent(eventName, rCtx.$static$.$containerState$);\n          }\n          renderNodeElementSync('script', attributes, stream);\n        }\n        const projectedChildren = newSSrContext.$projectedChildren$;\n        let missingSlotsDone;\n        if (projectedChildren) {\n          const nodes = Object.keys(projectedChildren).map((slotName) => {\n            const escapedSlotName = slotName ? escapeHtml(slotName) : slotName;\n            const content = projectedChildren[escapedSlotName];\n            // projectedChildren[slotName] = undefined;\n            if (content) {\n              return _jsxQ(\n                'q:template',\n                { [QSlot]: escapedSlotName || true, hidden: true, 'aria-hidden': 'true' },\n                null,\n                content,\n                0,\n                null\n              );\n            }\n          });\n          const [_rCtx, sCtx] = newSSrContext.$projectedCtxs$!;\n          const newSlotRctx = pushRenderContext(_rCtx);\n          newSlotRctx.$slotCtx$ = elCtx;\n          missingSlotsDone = processData(nodes, newSlotRctx, sCtx, stream, 0, undefined);\n        }\n        return beforeClose\n          ? maybeThen(missingSlotsDone, () => beforeClose(stream))\n          : missingSlotsDone;\n      }\n    );\n  });\n};\n\nconst splitProjectedChildren = (children: JSXChildren, ssrCtx: SSRContext) => {\n  const flatChildren = flatVirtualChildren(children, ssrCtx);\n  if (flatChildren === null) {\n    return undefined;\n  }\n  const slotMap: Record<string, JSXNode[]> = {};\n\n  for (const child of flatChildren) {\n    let slotName = '';\n    if (isJSXNode(child)) {\n      slotName = escapeHtml((child.props[QSlot] as string) || '');\n    }\n    (slotMap[slotName] ||= []).push(child);\n  }\n  return slotMap;\n};\n\nconst createMockQContext = (nodeType: 1 | 111) => {\n  const elm = new MockElement(nodeType);\n  return createContext(elm as any);\n};\n\nconst renderNode = (\n  node: JSXNodeInternal,\n  rCtx: RenderContext,\n  ssrCtx: SSRContext,\n  stream: StreamWriter,\n  flags: number,\n  beforeClose?: (stream: StreamWriter) => ValueOrPromise<void>\n): ValueOrPromise<void> => {\n  const tagName = node.type;\n  const hostCtx = rCtx.$cmpCtx$;\n  if (typeof tagName === 'string') {\n    const key = node.key;\n    const props = node.props;\n    const immutable = node.immutableProps || EMPTY_OBJ;\n    const elCtx = createMockQContext(1);\n    const elm = elCtx.$element$ as Element;\n    const isHead = tagName === 'head';\n    let openingElement = '<' + tagName;\n    let useSignal = false;\n    let hasRef = false;\n    let classStr = '';\n    let htmlStr = null;\n    const handleProp = (rawProp: string, value: unknown, isImmutable: boolean) => {\n      if (rawProp === 'ref') {\n        if (value !== undefined) {\n          setRef(value, elm);\n          hasRef = true;\n        }\n        return;\n      }\n      if (isOnProp(rawProp)) {\n        setEvent(elCtx.li, rawProp, value, undefined);\n        return;\n      }\n      if (isSignal(value)) {\n        assertDefined(hostCtx, 'Signals can not be used outside the root');\n        if (isImmutable) {\n          value = trackSignal(value, [1, elm, value, hostCtx.$element$, rawProp]);\n        } else {\n          value = trackSignal(value, [2, hostCtx.$element$, value, elm, rawProp]);\n        }\n        useSignal = true;\n      }\n      if (rawProp === dangerouslySetInnerHTML) {\n        htmlStr = value;\n        return;\n      }\n      if (rawProp.startsWith(PREVENT_DEFAULT)) {\n        registerQwikEvent(rawProp.slice(PREVENT_DEFAULT.length), rCtx.$static$.$containerState$);\n      }\n      let attrValue;\n      const prop = rawProp === 'htmlFor' ? 'for' : rawProp;\n      if (prop === 'class' || prop === 'className') {\n        classStr = serializeClass(value as ClassList);\n      } else if (prop === 'style') {\n        attrValue = stringifyStyle(value);\n      } else if (isAriaAttribute(prop) || prop === 'draggable' || prop === 'spellcheck') {\n        attrValue = value != null ? String(value) : null;\n        value = attrValue;\n      } else if (value === false || value == null) {\n        attrValue = null;\n      } else {\n        attrValue = String(value);\n      }\n      if (attrValue != null) {\n        if (prop === 'value' && tagName === 'textarea') {\n          htmlStr = escapeHtml(attrValue);\n        } else if (isSSRUnsafeAttr(prop)) {\n          if (qDev) {\n            logError('Attribute value is unsafe for SSR');\n          }\n        } else {\n          openingElement +=\n            ' ' + (value === true ? prop : prop + '=\"' + escapeHtml(attrValue) + '\"');\n        }\n      }\n    };\n    for (const prop in props) {\n      let isImmutable = false;\n      let value;\n      if (prop in immutable) {\n        isImmutable = true;\n        value = immutable[prop];\n        if (value === _IMMUTABLE) {\n          value = props[prop];\n        }\n      } else {\n        value = props[prop];\n      }\n      handleProp(prop, value, isImmutable);\n    }\n    for (const prop in immutable) {\n      if (prop in props) {\n        continue;\n      }\n      const value = immutable[prop];\n      if (value !== _IMMUTABLE) {\n        handleProp(prop, value, true);\n      }\n    }\n    const listeners = elCtx.li;\n    if (hostCtx) {\n      if (qDev) {\n        if (tagName === 'html') {\n          throw qError(QError_canNotRenderHTML);\n        }\n      }\n      if (hostCtx.$scopeIds$?.length) {\n        const extra = hostCtx.$scopeIds$.join(' ');\n        classStr = classStr ? `${extra} ${classStr}` : extra;\n      }\n      if (hostCtx.$flags$ & HOST_FLAG_NEED_ATTACH_LISTENER) {\n        listeners.push(...hostCtx.li);\n        hostCtx.$flags$ &= ~HOST_FLAG_NEED_ATTACH_LISTENER;\n      }\n    }\n\n    // Reset HOST flags\n    if (qDev) {\n      if (flags & IS_PHASING && !(flags & IS_PHRASING_CONTAINER)) {\n        if (!(tagName in phasingContent)) {\n          throw createJSXError(\n            `<${tagName}> can not be rendered because one of its ancestor is a <p> or a <pre>.\\n\nThis goes against the HTML spec: https://html.spec.whatwg.org/multipage/dom.html#phrasing-content-2`,\n            node\n          );\n        }\n      }\n      if (tagName === 'table') {\n        flags |= IS_TABLE;\n      } else {\n        if (flags & IS_TABLE && !(tagName in tableContent)) {\n          throw createJSXError(\n            `The <table> element requires that its direct children to be '<tbody>', '<thead>', '<tfoot>' or '<caption>' instead, '<${tagName}>' was rendered.`,\n            node\n          );\n        }\n        flags &= ~IS_TABLE;\n      }\n\n      if (tagName === 'button') {\n        if (flags & IS_BUTTON) {\n          throw createJSXError(\n            `<${tagName}> can not be rendered because one of its ancestor is already a <button>.\\n\nThis goes against the HTML spec: https://html.spec.whatwg.org/multipage/dom.html#interactive-content`,\n            node\n          );\n        } else {\n          flags |= IS_BUTTON;\n        }\n      }\n      if (tagName === 'a') {\n        if (flags & IS_ANCHOR) {\n          throw createJSXError(\n            `<${tagName}> can not be rendered because one of its ancestor is already a <a>.\\n\nThis goes against the HTML spec: https://html.spec.whatwg.org/multipage/dom.html#interactive-content`,\n            node\n          );\n        } else {\n          flags |= IS_ANCHOR;\n        }\n      }\n      if (tagName === 'svg' || tagName === 'math') {\n        // These types of elements are considered phrasing content, but contain children that aren't phrasing content.\n        flags |= IS_PHRASING_CONTAINER;\n      }\n      if (flags & IS_HEAD) {\n        if (!(tagName in headContent)) {\n          throw createJSXError(\n            `<${tagName}> can not be rendered because it's not a valid children of the <head> element. https://html.spec.whatwg.org/multipage/dom.html#metadata-content`,\n            node\n          );\n        }\n      }\n      if (flags & IS_HTML) {\n        if (!(tagName in htmlContent)) {\n          throw createJSXError(\n            `<${tagName}> can not be rendered because it's not a valid direct children of the <html> element, only <head> and <body> are allowed.`,\n            node\n          );\n        }\n      } else if (tagName in htmlContent) {\n        throw createJSXError(\n          `<${tagName}> can not be rendered because its parent is not a <html> element. Make sure the 'containerTagName' is set to 'html' in entry.ssr.tsx`,\n          node\n        );\n      }\n      if (tagName in startPhasingContent) {\n        flags |= IS_PHASING;\n      }\n    }\n    if (isHead) {\n      flags |= IS_HEAD;\n    }\n    if (tagName in invisibleElements) {\n      flags |= IS_INVISIBLE;\n    }\n    if (tagName in textOnlyElements) {\n      flags |= IS_TEXT;\n    }\n\n    if (classStr) {\n      openingElement += ' class=\"' + escapeHtml(classStr) + '\"';\n    }\n\n    if (listeners.length > 0) {\n      const groups = groupListeners(listeners);\n      const isInvisible = (flags & IS_INVISIBLE) !== 0;\n      for (const listener of groups) {\n        const eventName = isInvisible ? normalizeInvisibleEvents(listener[0]) : listener[0];\n        openingElement +=\n          ' ' +\n          eventName +\n          '=\"' +\n          serializeQRLs(listener[1], rCtx.$static$.$containerState$, elCtx) +\n          '\"';\n        registerQwikEvent(eventName, rCtx.$static$.$containerState$);\n      }\n    }\n    if (key != null) {\n      openingElement += ' q:key=\"' + escapeHtml(key) + '\"';\n    }\n    if (hasRef || useSignal || listeners.length > 0) {\n      if (hasRef || useSignal || listenersNeedId(listeners)) {\n        const newID = getNextIndex(rCtx);\n        openingElement += ' q:id=\"' + newID + '\"';\n        elCtx.$id$ = newID;\n      }\n      ssrCtx.$static$.$contexts$.push(elCtx);\n    }\n    if (flags & IS_HEAD) {\n      openingElement += ' q:head';\n    }\n    if (qDev && qInspector && node.dev && !(flags & IS_HEAD)) {\n      const sanitizedFileName = node?.dev?.fileName?.replace(/\\\\/g, '/');\n      if (sanitizedFileName && !/data-qwik-inspector/.test(openingElement)) {\n        openingElement += ` data-qwik-inspector=\"${escapeHtml(\n          `${sanitizedFileName}:${node.dev.lineNumber}:${node.dev.columnNumber}`\n        )}\"`;\n      }\n    }\n    openingElement += '>';\n    stream.write(openingElement);\n\n    if (tagName in emptyElements) {\n      return;\n    }\n\n    if (htmlStr != null) {\n      stream.write(String(htmlStr));\n      stream.write(`</${tagName}>`);\n      return;\n    }\n    if (tagName === 'html') {\n      flags |= IS_HTML;\n    } else {\n      flags &= ~IS_HTML;\n    }\n    if (node.flags & static_subtree) {\n      flags |= IS_IMMUTABLE;\n    }\n    const promise = processData(node.children, rCtx, ssrCtx, stream, flags);\n    return maybeThen(promise, () => {\n      // If head inject base styles\n      if (isHead) {\n        for (const node of ssrCtx.$static$.$headNodes$) {\n          renderNodeElementSync(node.type, node.props as Record<string, string>, stream);\n        }\n        ssrCtx.$static$.$headNodes$.length = 0;\n      }\n      // Fast path\n      if (!beforeClose) {\n        stream.write(`</${tagName}>`);\n        return;\n      }\n\n      // Inject before close\n      return maybeThen(beforeClose(stream), () => {\n        stream.write(`</${tagName}>`);\n      });\n    });\n  }\n\n  if (tagName === Virtual) {\n    const elCtx = createMockQContext(111);\n    if (rCtx.$slotCtx$) {\n      elCtx.$parentCtx$ = rCtx.$slotCtx$;\n      elCtx.$realParentCtx$ = rCtx.$cmpCtx$!;\n    } else {\n      elCtx.$parentCtx$ = rCtx.$cmpCtx$;\n    }\n    if (hostCtx && hostCtx.$flags$ & HOST_FLAG_DYNAMIC) {\n      addDynamicSlot(hostCtx, elCtx);\n    }\n    return renderNodeVirtual(\n      node as JSXNode<typeof Virtual>,\n      elCtx,\n      undefined,\n      rCtx,\n      ssrCtx,\n      stream,\n      flags,\n      beforeClose\n    );\n  }\n\n  if (tagName === SSRRaw) {\n    stream.write((node as JSXNodeInternal<typeof SSRRaw>).props.data);\n    return;\n  }\n  if (tagName === InternalSSRStream) {\n    return renderGenerator(\n      node as JSXNodeInternal<typeof InternalSSRStream>,\n      rCtx,\n      ssrCtx,\n      stream,\n      flags\n    );\n  }\n  // Inline component\n  const res = invoke(\n    ssrCtx.$invocationContext$,\n    tagName as FunctionComponent,\n    node.props,\n    node.key,\n    node.flags,\n    node.dev\n  );\n  if (!shouldWrapFunctional(res, node)) {\n    return processData(res, rCtx, ssrCtx, stream, flags, beforeClose);\n  }\n  return renderNode(\n    _jsxC(Virtual, { children: res }, 0, node.key),\n    rCtx,\n    ssrCtx,\n    stream,\n    flags,\n    beforeClose\n  );\n};\n\n/** Embed metadata while rendering the tree, to be used when resuming */\nconst processData = (\n  node: any,\n  rCtx: RenderContext,\n  ssrCtx: SSRContext,\n  stream: StreamWriter,\n  flags: number,\n  beforeClose?: (stream: StreamWriter) => ValueOrPromise<void>\n): ValueOrPromise<void> => {\n  if (node == null || typeof node === 'boolean') {\n    return;\n  }\n  if (isString(node) || typeof node === 'number') {\n    stream.write(escapeHtml(String(node)));\n  } else if (isJSXNode(node)) {\n    return renderNode(node, rCtx, ssrCtx, stream, flags, beforeClose);\n  } else if (isArray(node)) {\n    return walkChildren(node, rCtx, ssrCtx, stream, flags);\n  } else if (isSignal(node)) {\n    const insideText = flags & IS_TEXT;\n    const hostEl = rCtx.$cmpCtx$?.$element$ as QwikElement;\n    let value;\n    if (hostEl) {\n      if (!insideText) {\n        const id = getNextIndex(rCtx);\n        const subs =\n          flags & IS_IMMUTABLE\n            ? ([3, ('#' + id) as any, node, ('#' + id) as any] as const)\n            : ([4, hostEl, node, ('#' + id) as any] as const);\n\n        value = trackSignal(node, subs);\n        if (isString(value)) {\n          const str = jsxToString(value);\n          ssrCtx.$static$.$textNodes$.set(str, id);\n        }\n        stream.write(`<!--t=${id}-->`);\n        processData(value, rCtx, ssrCtx, stream, flags, beforeClose);\n        stream.write(`<!---->`);\n        return;\n      } else {\n        value = invoke(ssrCtx.$invocationContext$, () => node.value);\n      }\n    }\n    stream.write(escapeHtml(jsxToString(value)));\n    return;\n  } else if (isPromise(node)) {\n    stream.write(FLUSH_COMMENT);\n    return node.then((node) => processData(node, rCtx, ssrCtx, stream, flags, beforeClose));\n  } else {\n    logWarn('A unsupported value was passed to the JSX, skipping render. Value:', node);\n    return;\n  }\n};\n\nconst walkChildren = (\n  children: unknown,\n  rCtx: RenderContext,\n  ssrContext: SSRContext,\n  stream: StreamWriter,\n  flags: number\n): ValueOrPromise<void> => {\n  if (children == null) {\n    return;\n  }\n  if (!isArray(children)) {\n    return processData(children, rCtx, ssrContext, stream, flags);\n  }\n  const len = children.length;\n  if (len === 1) {\n    return processData(children[0], rCtx, ssrContext, stream, flags);\n  }\n  if (len === 0) {\n    return;\n  }\n\n  let currentIndex = 0;\n  const buffers: string[][] = [];\n  return children.reduce((prevPromise: Promise<void> | undefined, child, index) => {\n    const buffer: string[] = [];\n    buffers.push(buffer);\n    const localStream: StreamWriter = prevPromise\n      ? {\n          write(chunk) {\n            if (currentIndex === index) {\n              stream.write(chunk);\n            } else {\n              buffer.push(chunk);\n            }\n          },\n        }\n      : stream;\n\n    const rendered = processData(child, rCtx, ssrContext, localStream, flags);\n    if (prevPromise || isPromise(rendered)) {\n      const next = () => {\n        currentIndex++;\n        if (buffers.length > currentIndex) {\n          buffers[currentIndex].forEach((chunk) => stream.write(chunk));\n        }\n      };\n      if (isPromise(rendered)) {\n        if (prevPromise) {\n          return Promise.all([rendered, prevPromise]).then(next);\n        } else {\n          return rendered.then(next);\n        }\n      }\n      return prevPromise!.then(next);\n    } else {\n      currentIndex++;\n      return undefined;\n    }\n  }, undefined);\n};\n\nconst flatVirtualChildren = (children: any, ssrCtx: SSRContext): any[] | null => {\n  if (children == null) {\n    return null;\n  }\n  const result = _flatVirtualChildren(children, ssrCtx);\n  const nodes = isArray(result) ? result : [result];\n  if (nodes.length === 0) {\n    return null;\n  }\n  return nodes;\n};\n\nconst _flatVirtualChildren = (children: any, ssrCtx: SSRContext): any => {\n  if (children == null) {\n    return null;\n  }\n  if (isArray(children)) {\n    return children.flatMap((c) => _flatVirtualChildren(c, ssrCtx));\n  } else if (\n    isJSXNode(children) &&\n    isFunction(children.type) &&\n    children.type !== SSRRaw &&\n    children.type !== InternalSSRStream &&\n    children.type !== Virtual\n  ) {\n    const res = invoke(\n      ssrCtx.$invocationContext$,\n      children.type,\n      children.props,\n      children.key,\n      children.flags\n    );\n    return flatVirtualChildren(res, ssrCtx);\n  }\n  return children;\n};\n\nconst setComponentProps = (\n  rCtx: RenderContext,\n  elCtx: QContext,\n  expectProps: Record<string, any>\n) => {\n  const keys = Object.keys(expectProps);\n  const target = createPropsState();\n\n  elCtx.$props$ = createProxy(target, rCtx.$static$.$containerState$);\n\n  if (keys.length === 0) {\n    return;\n  }\n  const immutableMeta = ((target as any)[_IMMUTABLE] =\n    (expectProps as any)[_IMMUTABLE] ?? EMPTY_OBJ);\n  for (const prop of keys) {\n    if (prop === 'children' || prop === QSlot) {\n      continue;\n    }\n    if (isSignal(immutableMeta[prop])) {\n      target[_IMMUTABLE_PREFIX + prop] = immutableMeta[prop];\n    } else {\n      target[prop] = expectProps[prop];\n    }\n  }\n};\n\nconst invisibleElements: Record<string, true | undefined> = {\n  head: true,\n  style: true,\n  script: true,\n  link: true,\n  meta: true,\n};\n\nconst textOnlyElements: Record<string, true | undefined> = {\n  title: true,\n  style: true,\n  script: true,\n  noframes: true,\n  textarea: true,\n};\n\nconst emptyElements: Record<string, true | undefined> = {\n  area: true,\n  base: true,\n  basefont: true,\n  bgsound: true,\n  br: true,\n  col: true,\n  embed: true,\n  frame: true,\n  hr: true,\n  img: true,\n  input: true,\n  keygen: true,\n  link: true,\n  meta: true,\n  param: true,\n  source: true,\n  track: true,\n  wbr: true,\n};\n\nconst startPhasingContent: Record<string, true | undefined> = {\n  p: true,\n  pre: true,\n};\n\nconst htmlContent: Record<string, true | undefined> = {\n  head: true,\n  body: true,\n};\n\nconst tableContent: Record<string, true | undefined> = {\n  tbody: true,\n  thead: true,\n  tfoot: true,\n  caption: true,\n  colgroup: true,\n};\n\nconst headContent: Record<string, true | undefined> = {\n  meta: true,\n  title: true,\n  link: true,\n  style: true,\n  script: true,\n  noscript: true,\n  template: true,\n  base: true,\n};\n\nconst phasingContent: Record<string, true | undefined> = {\n  a: true,\n  abbr: true,\n  area: true,\n  audio: true,\n  b: true,\n  bdi: true,\n  bdo: true,\n  br: true,\n  button: true,\n  canvas: true,\n  cite: true,\n  code: true,\n  command: true,\n  data: true,\n  datalist: true,\n  del: true,\n  dfn: true,\n  em: true,\n  embed: true,\n  i: true,\n  iframe: true,\n  img: true,\n  input: true,\n  ins: true,\n  itemprop: true,\n  kbd: true,\n  keygen: true,\n  label: true,\n  link: true,\n  map: true,\n  mark: true,\n  math: true,\n  meta: true,\n  meter: true,\n  noscript: true,\n  object: true,\n  option: true,\n  output: true,\n  picture: true,\n  progress: true,\n  q: true,\n  ruby: true,\n  s: true,\n  samp: true,\n  script: true,\n  select: true,\n  slot: true,\n  small: true,\n  span: true,\n  strong: true,\n  sub: true,\n  sup: true,\n  svg: true,\n  template: true,\n  textarea: true,\n  time: true,\n  u: true,\n  var: true,\n  video: true,\n  wbr: true,\n};\n\nexport interface ServerDocument {\n  nodeType: 9;\n  parentElement: null;\n  ownerDocument: null;\n  createElement(tagName: string): any;\n}\n\nconst ESCAPE_HTML = /[&<>'\"]/g;\n\nexport const registerQwikEvent = (prop: string, containerState: ContainerState) => {\n  containerState.$events$.add(getEventName(prop));\n};\n\nconst escapeValue = (value: any) => {\n  if (typeof value === 'string') {\n    return escapeHtml(value);\n  }\n  return value;\n};\n\nconst escapeHtml = (s: string) => {\n  return s.replace(ESCAPE_HTML, (c) => {\n    switch (c) {\n      case '&':\n        return '&amp;';\n      case '<':\n        return '&lt;';\n      case '>':\n        return '&gt;';\n      case '\"':\n        return '&quot;';\n      case \"'\":\n        return '&#39;';\n      default:\n        return '';\n    }\n  });\n};\n\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/; // eslint-disable-line no-control-regex\nexport const isSSRUnsafeAttr = (name: string): boolean => {\n  return unsafeAttrCharRE.test(name);\n};\n\nconst listenersNeedId = (listeners: Listener[]) => {\n  return listeners.some((l) => l[1].$captureRef$ && l[1].$captureRef$.length > 0);\n};\n\nconst addDynamicSlot = (hostCtx: QContext, elCtx: QContext) => {\n  const dynamicSlots = (hostCtx.$dynamicSlots$ ||= []);\n  if (!dynamicSlots.includes(elCtx)) {\n    dynamicSlots.push(elCtx);\n  }\n};\n\nconst normalizeInvisibleEvents = (eventName: string) => {\n  return eventName === 'on:qvisible' ? 'on-document:qinit' : eventName;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/render/ssr/render-ssr.unit.tsx",
    "content": "import { format } from 'prettier';\n\nimport { describe, expect, test, vi } from 'vitest';\nimport type { StreamWriter } from '../../../server/types';\nimport { component$ } from '../../component/component.public';\nimport { inlinedQrl } from '../../qrl/qrl';\nimport { $ } from '../../qrl/qrl.public';\nimport { createContextId, useContext, useContextProvider } from '../../use/use-context';\nimport { useOn, useOnDocument, useOnWindow } from '../../use/use-on';\nimport { Resource, useResource$ } from '../../use/use-resource';\nimport { useSignal } from '../../use/use-signal';\nimport { useStore } from '../../use/use-store.public';\nimport { useStylesQrl, useStylesScopedQrl } from '../../use/use-styles';\nimport { useTask$, useVisibleTask$ } from '../../use/use-task';\nimport { delay } from '../../util/promises';\nimport { HTMLFragment, jsx } from '../jsx/jsx-runtime';\nimport { Slot } from '../jsx/slot.public';\nimport type { JSXOutput } from '../jsx/types/jsx-node';\nimport { SSRComment, SSRRaw } from '../jsx/utils.public';\nimport {\n  _renderSSR,\n  renderAttributes,\n  renderVirtualAttributes,\n  type RenderSSROptions,\n} from './render-ssr';\nimport { dangerouslySetInnerHTML } from '../execute-component';\n\ntest('render attributes', async () => {\n  await testSSR(\n    <body id=\"stuff\" aria-required=\"true\" role=\"\"></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body id=\"stuff\" aria-required=\"true\" role=\"\"></body></html>'\n  );\n});\n\ntest('render aria value', async () => {\n  await testSSR(\n    <body\n      id=\"stuff\"\n      aria-required={true}\n      aria-busy={false}\n      role=\"\"\n      preventdefault:click\n      aria-hidden={undefined}\n    ></body>,\n    `\n        <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n          <body id=\"stuff\" aria-required=\"true\" aria-busy=\"false\" role=\"\" preventdefault:click></body>\n        </html>\n        `\n  );\n});\n\ntest('render className', async () => {\n  await testSSR(\n    <body class=\"stuff\"></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body class=\"stuff\"></body></html>'\n  );\n});\n\ntest('should not allow div inside p', async () => {\n  await throws(async () => {\n    await testSSR(\n      <body>\n        <p>\n          <div></div>\n        </p>\n      </body>,\n      ''\n    );\n  });\n  await throws(async () => {\n    await testSSR(\n      <body>\n        <p>\n          <span>\n            <div></div>\n          </span>\n        </p>\n      </body>,\n      ''\n    );\n  });\n});\n\ntest('should not allow button inside button', async () => {\n  await throws(async () => {\n    await testSSR(\n      <body>\n        <button>\n          <button></button>\n        </button>\n      </body>,\n      ''\n    );\n  });\n  await throws(async () => {\n    await testSSR(\n      <body>\n        <button>\n          <span>\n            <button></button>\n          </span>\n        </button>\n      </body>,\n      ''\n    );\n  });\n});\n\ntest('should not allow a inside a', async () => {\n  await throws(async () => {\n    await testSSR(\n      <body>\n        <a>\n          <a></a>\n        </a>\n      </body>,\n      ''\n    );\n  });\n  await throws(async () => {\n    await testSSR(\n      <body>\n        <a>\n          <span>\n            <a></a>\n          </span>\n        </a>\n      </body>,\n      ''\n    );\n  });\n});\n\ntest('should not allow div inside html', async () => {\n  await throws(async () => {\n    await testSSR(<div></div>, '');\n  });\n});\n\ntest('should not allow div inside head', async () => {\n  await throws(async () => {\n    await testSSR(\n      <head>\n        <div></div>\n      </head>,\n      ''\n    );\n  });\n});\n\ntest('render class', async () => {\n  await testSSR(\n    <body\n      class={{\n        stuff: true,\n        other: false,\n        'm-0 p-2': true,\n      }}\n    ></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body class=\"stuff m-0 p-2\"></body></html>'\n  );\n\n  const Test = component$(() => {\n    // Extra spaces to ensure signal hasn't changed\n    const sigClass = useSignal(' myClass ');\n    return <div class={sigClass} />;\n  });\n  await testSSR(\n    <body>\n      <Test />\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n        <div class=\"myClass\" q:id=\"1\"></div>\n        <!--/qv-->\n      </body>\n    </html>`\n  );\n\n  await testSSR(\n    <body\n      class={['stuff', '', 'm-0 p-2', null, { active: 1 }, undefined, [{ container: 'yup' }]]}\n    ></body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body class=\"stuff m-0 p-2 active container\"></body>\n    </html>`\n  );\n});\n\ntest('render contentEditable', async () => {\n  await testSSR(\n    <body contentEditable=\"true\"></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body contentEditable=\"true\"></body></html>'\n  );\n});\n\ntest('render draggable', async () => {\n  await testSSR(\n    <body>\n      <div draggable={true}></div>\n      <div draggable={false}></div>\n      <div draggable={undefined}></div>\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <div draggable=\"true\"></div>\n        <div draggable=\"false\"></div>\n        <div></div>\n      </body>\n    </html>\n    `\n  );\n});\n\ntest('render <textarea>', async () => {\n  await testSSR(\n    <body>\n      <textarea value=\"some text\"></textarea>\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <textarea>some text</textarea>\n      </body>\n    </html>\n    `\n  );\n});\n\ntest('render spellcheck', async () => {\n  await testSSR(\n    <body>\n      <div spellcheck={true}></div>\n      <div spellcheck={false}></div>\n      <div spellcheck={undefined}></div>\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <div spellcheck=\"true\"></div>\n        <div spellcheck=\"false\"></div>\n        <div></div>\n      </body>\n    </html>\n    `\n  );\n});\n\ntest('render styles', async () => {\n  await testSSR(\n    <body\n      style={{\n        'padding-top': '10px',\n        paddingBottom: '10px',\n        top: 0,\n        '--stuff-nu': -1,\n        '--stuff-hey': 'hey',\n        '--stuffCase': 'foo',\n      }}\n    ></body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body style=\"\n          padding-top: 10px;\n          padding-bottom: 10px;\n          top: 0;\n          --stuff-nu: -1;\n          --stuff-hey: hey;\n          --stuffCase: foo;\n        \"\n      ></body>\n    </html>`\n  );\n});\n\ntest('render fake click handler', async () => {\n  const Div = 'body' as any;\n  await testSSR(\n    <Div on:click=\"true\" onScroll=\"text\"></Div>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body on:click=\"true\" onScroll=\"text\"></body>\n    </html>`\n  );\n});\n\ntest('self closing elements', async () => {\n  await testSSR(\n    <body>\n      <input></input>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <input>\n      </body>\n    </html>`\n  );\n});\n\ntest('single simple children', async () => {\n  await testSSR(\n    <body>hola</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body>hola</body></html>'\n  );\n  await testSSR(\n    <body>{0}</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body>0</body></html>'\n  );\n  await testSSR(\n    <body>{true}</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body></body></html>'\n  );\n  await testSSR(\n    <body>{false}</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body></body></html>'\n  );\n  await testSSR(\n    <body>{null}</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body></body></html>'\n  );\n  await testSSR(\n    <body>{undefined}</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body></body></html>'\n  );\n});\n\ntest('valid phrasing content', async () => {\n  await testSSR(\n    <body>\n      <p>\n        <del>Del</del>\n      </p>\n    </body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body><p><del>Del</del></p></body>'\n  );\n  await testSSR(\n    <body>\n      <p>\n        <select>\n          <option>A</option>\n          <option>B</option>\n        </select>\n      </p>\n    </body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body><p><select><option>A</option><option>B</option></select></p></body>'\n  );\n  await testSSR(\n    <body>\n      <p>\n        <link rel=\"example\" />\n      </p>\n    </body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body><p><link rel=\"example\"/></p></body>'\n  );\n  await testSSR(\n    <body>\n      <p>\n        <map name=\"my-map\">\n          <area shape=\"poly\" coords=\"0,0,10,10,10,0\" href=\"/example\" alt=\"Example\" />\n        </map>\n        <img useMap=\"#my-map\" src=\"/example.png\" alt=\"Example\" />\n      </p>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <p>\n          <map name=\"my-map\">\n            <area shape=\"poly\" coords=\"0,0,10,10,10,0\" href=\"/example\" alt=\"Example\">\n          </map>\n          <img usemap=\"#my-map\" src=\"/example.png\" alt=\"Example\">\n        </p>\n        </body>\n      </html>`\n  );\n  await testSSR(\n    <body>\n      <p>\n        <svg\n          viewBox=\"0 0 10 10\"\n          xmlns=\"http://www.w3.org/2000/svg\"\n          xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n        >\n          <path d=\"M 0 0 L 10 10\"></path>\n          <circle cx=\"5\" cy=\"5\" rx=\"5\" ry=\"5\"></circle>\n        </svg>\n      </p>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <p>\n          <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n            <path d=\"M 0 0 L 10 10\"></path>\n            <circle cx=\"5\" cy=\"5\" rx=\"5\" ry=\"5\"></circle>\n          </svg>\n        </p>\n      </body>\n    </html>`\n  );\n  await testSSR(\n    <body>\n      <p>\n        <math>\n          <semantics>\n            <mrow>\n              <mi>2</mi>\n              <mo>+</mo>\n              <mi>2</mi>\n            </mrow>\n          </semantics>\n        </math>\n      </p>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <p>\n          <math>\n            <semantics>\n              <mrow>\n                <mi>2</mi>\n                <mo>+</mo>\n                <mi>2</mi>\n              </mrow>\n            </semantics>\n          </math>\n        </p>\n      </body>\n    </html>`\n  );\n});\n\ntest('events', async () => {\n  await testSSR(\n    <body onClick$={() => console.warn('hol')}>hola</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body on:click=\"/runtimeQRL#_\">hola</body></html>'\n  );\n  await testSSR(\n    <body onClick$={[undefined, $(() => console.warn('hol'))]}>hola</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body on:click=\"/runtimeQRL#_\">hola</body></html>'\n  );\n  await testSSR(\n    <body onClick$={[undefined, [$(() => console.warn('hol'))]]}>hola</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body on:click=\"/runtimeQRL#_\">hola</body></html>'\n  );\n  await testSSR(\n    <body document:onClick$={() => console.warn('hol')}>hola</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body on-document:click=\"/runtimeQRL#_\">hola</body></html>'\n  );\n  await testSSR(\n    <body window:onClick$={() => console.warn('hol')}>hola</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body on-window:click=\"/runtimeQRL#_\">hola</body></html>'\n  );\n  await testSSR(\n    <body>\n      <input onInput$={() => console.warn('hol')} />\n    </body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body><input on:input=\"/runtimeQRL#_\"></body></html>'\n  );\n});\n\ntest('innerHTML', async () => {\n  await testSSR(\n    <body dangerouslySetInnerHTML=\"<p>hola</p>\"></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body><p>hola</p></body></html>'\n  );\n  await testSSR(\n    <body dangerouslySetInnerHTML=\"\"></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body></body></html>'\n  );\n  const Div = 'body' as any;\n  await testSSR(\n    <Div dangerouslySetInnerHTML={0}></Div>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body>0</body></html>'\n  );\n  await testSSR(\n    <body>\n      <script dangerouslySetInnerHTML=\"() => null\"></script>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <script>\n          () => null\n        </script>\n      </body>\n    </html>`\n  );\n});\n\ntest('single complex children', async () => {\n  await testSSR(\n    <div>\n      <p>hola</p>\n    </div>,\n    '<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\"><div><p>hola</p></div></container>',\n    {\n      containerTagName: 'container',\n    }\n  );\n  await testSSR(\n    <div>\n      hola {2}\n      <p>hola</p>\n    </div>,\n    '<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\"><div>hola 2<p>hola</p></div></container>',\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('single multiple children', async () => {\n  await testSSR(\n    <ul>\n      <li>1</li>\n      <li>2</li>\n      <li>3</li>\n      <li>4</li>\n      <li>5</li>\n      <li>6</li>\n      <li>7</li>\n      <li>8</li>\n    </ul>,\n    '<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\"><ul><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li></ul></container>',\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('sanity', async () => {\n  await testSSR(\n    <body>\n      <div>{`.rule > thing{}`}</div>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <div>.rule &gt; thing{}</div>\n      </body>\n    </html>`\n  );\n});\n\ntest('using fragment', async () => {\n  await testSSR(\n    <ul>\n      <>\n        <li>1</li>\n        <li>2</li>\n      </>\n      <li>3</li>\n      <>\n        <li>4</li>\n        <>\n          <li>5</li>\n          <>\n            <>\n              <li>6</li>\n            </>\n          </>\n        </>\n        <li>7</li>\n      </>\n      <li>8</li>\n    </ul>,\n    '<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\"><ul><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li></ul></container>',\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('using promises', async () => {\n  await testSSR(\n    <body>{Promise.resolve('hola')}</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body><!--qkssr-f-->hola</body></html>'\n  );\n  await testSSR(\n    <body>{Promise.resolve(<p>hola</p>)}</body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body><!--qkssr-f--><p>hola</p></body></html>'\n  );\n\n  await testSSR(\n    <ul>\n      {Promise.resolve(<li>1</li>)}\n      <li>2</li>\n      {delay(100).then(() => (\n        <li>3</li>\n      ))}\n      {delay(10).then(() => (\n        <li>4</li>\n      ))}\n    </ul>,\n    [\n      '<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">',\n      '<ul>',\n      '<!--qkssr-f-->',\n      '<li>',\n      '1',\n      '</li>',\n      '<li>',\n      '2',\n      '</li>',\n      '<!--qkssr-f-->',\n      '<li>',\n      '3',\n      '</li>',\n      '<!--qkssr-f-->',\n      '<li>',\n      '4',\n      '</li>',\n      '</ul>',\n      '</container>',\n    ],\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('mixed children', async () => {\n  await testSSR(\n    <ul>\n      <li>0</li>\n      <li>1</li>\n      <li>2</li>\n      {Promise.resolve(<li>3</li>)}\n      <li>4</li>\n      {delay(100).then(() => (\n        <li>5</li>\n      ))}\n      {delay(10).then(() => (\n        <li>6</li>\n      ))}\n    </ul>,\n    `\n        <container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n        <ul>\n        <li>0</li>\n        <li>1</li>\n        <li>2</li>\n        <!--qkssr-f-->\n        <li>3</li>\n        <li>4</li>\n        <!--qkssr-f-->\n        <li>5</li>\n        <!--qkssr-f-->\n        <li>6</li>\n        </ul>\n        </container>`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('DelayResource', async () => {\n  await testSSR(\n    <body>\n      <ul>\n        <DelayResource text=\"thing\" delay={100} />\n        <DelayResource text=\"thing\" delay={10} />\n      </ul>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n    <body>\n      <ul>\n        <!--qv q:id=0 q:key=sX:-->\n          <style q:style=\"fio5tb-0\" hidden>.cmp {background: blue}</style>\n          <div class=\"cmp\"><!--qkssr-f--><span>thing</span></div>\n        <!--/qv-->\n        <!--qv q:id=1 q:key=sX:-->\n          <div class=\"cmp\"><!--qkssr-f--><span>thing</span></div>\n        <!--/qv-->\n      </ul>\n    </body>\n  </html>`\n  );\n});\n\ntest('using promises with DelayResource', async () => {\n  await testSSR(\n    <body>\n      <ul>\n        {delay(10).then(() => (\n          <li>thing</li>\n        ))}\n        <DelayResource text=\"thing\" delay={500} />\n      </ul>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n      <ul>\n        <!--qkssr-f-->\n        <li>thing</li>\n        <!--qv q:id=0 q:key=sX:-->\n          <style q:style=\"fio5tb-0\" hidden>.cmp {background: blue}</style>\n          <div class=\"cmp\"><!--qkssr-f--><span>thing</span></div>\n        <!--/qv-->\n      </ul>\n      </body>\n    </html>`\n  );\n});\n\ntest('using component', async () => {\n  await testSSR(\n    <MyCmp />,\n    `<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <!--qv q:id=0 q:key=sX:-->\n      <section><div>MyCmp{}</div></section>\n      <!--/qv-->\n    </container>`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('using component with key', async () => {\n  await testSSR(\n    <body>\n      <MyCmp key=\"hola\" />\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:hola-->\n        <section><div>MyCmp{}</div></section>\n        <!--/qv-->\n      </body>\n    </html>`\n  );\n});\n\ntest('using element with key', async () => {\n  await testSSR(\n    <body>\n      <div key=\"hola\" />\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <div q:key=\"hola\"></div>\n      </body>\n    </html>`\n  );\n});\n\ntest('using element with key containing double quotes', async () => {\n  await testSSR(\n    <body>\n      <div key={'\"hola\"'} />\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <div q:key=\"&quot;hola&quot;\"></div>\n      </body>\n    </html>`\n  );\n});\n\ntest('using component props', async () => {\n  await testSSR(\n    <MyCmp\n      id=\"12\"\n      host:prop=\"attribute\"\n      innerHTML=\"123\"\n      dangerouslySetInnerHTML=\"432\"\n      onClick=\"lazy.js\"\n      prop=\"12\"\n      q:slot=\"name\"\n    >\n      stuff\n    </MyCmp>,\n    `\n    <container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <!--qv q:id=0 q:key=sX:-->\n      <section>\n        <div>MyCmp{&quot;id&quot;:&quot;12&quot;,&quot;host:prop&quot;:&quot;attribute&quot;,&quot;innerHTML&quot;:&quot;123&quot;,&quot;dangerouslySetInnerHTML&quot;:&quot;432&quot;,&quot;onClick&quot;:&quot;lazy.js&quot;,&quot;prop&quot;:&quot;12&quot;}</div>\n      </section>\n      <q:template q:slot hidden aria-hidden=\"true\">stuff</q:template>\n      <!--/qv-->\n    </container>\n    `,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('using component project content', async () => {\n  await testSSR(\n    <MyCmp>\n      <div>slot</div>\n    </MyCmp>,\n    `\n  <container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n    <!--qv q:id=0 q:key=sX:-->\n    <section><div>MyCmp{}</div></section>\n    <q:template q:slot hidden aria-hidden=\"true\"><div>slot</div></q:template>\n    <!--/qv-->\n  </container>\n`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('using complex component', async () => {\n  await testSSR(\n    <body>\n      <MyCmpComplex></MyCmpComplex>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n        <div on:click=\"/runtimeQRL#_\" q:id=\"1\">\n          <button on:click=\"/runtimeQRL#_\">Click</button>\n          <!--qv q:s q:sref=0 q:key=--><!--/qv-->\n        </div>\n        <!--/qv-->\n      </body>\n    </html>`\n  );\n});\n\ntest('using complex component with slot', async () => {\n  await testSSR(\n    <MyCmpComplex>Hola</MyCmpComplex>,\n    `\n    <container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <!--qv q:id=0 q:key=sX:-->\n      <div on:click=\"/runtimeQRL#_\" q:id=\"1\">\n        <button on:click=\"/runtimeQRL#_\">Click</button>\n        <!--qv q:s q:sref=0 q:key=-->\n        Hola\n        <!--/qv-->\n      </div>\n      <!--/qv-->\n    </container>`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('<head>', async () => {\n  await testSSR(\n    <head>\n      <title>hola</title>\n      <>\n        <meta></meta>\n      </>\n    </head>,\n    `\n  <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n    <head q:head>\n      <title q:head>hola</title>\n      <meta q:head>\n    </head>\n  </html>`\n  );\n});\n\ntest('named slots', async () => {\n  await testSSR(\n    <NamedSlot>\n      Text\n      <div q:slot=\"start\">START: 1</div>\n      <>\n        <div q:slot=\"end\">END: 1</div>\n        from\n        <div q:slot=\"start\">START: 2</div>\n      </>\n      <div q:slot=\"end\">END: 2</div>\n      default\n    </NamedSlot>,\n    `\n    <container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <!--qv q:id=0 q:key=sX:-->\n      <div>\n        <!--qv q:s q:sref=0 q:key=start-->\n        <div q:slot=\"start\">START: 1</div>\n        <div q:slot=\"start\">START: 2</div>\n        <!--/qv-->\n        <div><!--qv q:s q:sref=0 q:key=-->Textfromdefault<!--/qv--></div>\n        <!--qv q:s q:sref=0 q:key=end-->\n        <div q:slot=\"end\">END: 1</div>\n        <div q:slot=\"end\">END: 2</div>\n        <!--/qv-->\n      </div>\n      <!--/qv-->\n    </container>\n`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('nested slots', async () => {\n  await testSSR(\n    <SimpleSlot name=\"root\">\n      <SimpleSlot name=\"level 1\">\n        <SimpleSlot name=\"level 2\">\n          BEFORE CONTENT\n          <div>Content</div>\n          AFTER CONTENT\n        </SimpleSlot>\n      </SimpleSlot>\n    </SimpleSlot>,\n    `\n    <container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <!--qv q:id=0 q:key=sX:-->\n        <div id=\"root\">\n          Before root\n          <!--qv q:s q:sref=0 q:key=-->\n            <!--qv q:id=1 q:key=sX:-->\n            <div id=\"level 1\">\n              Before level 1\n              <!--qv q:s q:sref=1 q:key=-->\n                <!--qv q:id=2 q:key=sX:-->\n                  <div id=\"level 2\">\n                    Before level 2\n                    <!--qv q:s q:sref=2 q:key=-->\n                      BEFORE CONTENT\n                      <div>Content</div>\n                      AFTER CONTENT\n                    <!--/qv-->\n                    After level 2\n                  </div>\n                <!--/qv-->\n              <!--/qv-->\n              After level 1\n            </div>\n            <!--/qv-->\n          <!--/qv-->\n          After root\n        </div>\n      <!--/qv-->\n    </container>`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('mixes slots', async () => {\n  await testSSR(\n    <MixedSlot>Content</MixedSlot>,\n    `\n    <container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <!--qv q:id=0 q:key=sX:-->\n      <!--qv q:id=1 q:key=sX:-->\n        <div id=\"1\">Before 1\n        <!--qv q:s q:sref=1 q:key=-->\n          <!--qv q:s q:sref=0 q:key=-->\n            Content\n          <!--/qv-->\n        <!--/qv-->\n        After 1\n      </div>\n      <!--/qv-->\n      <!--/qv-->\n    </container>`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('component RenderSignals()', async () => {\n  vi.spyOn(console, 'warn');\n  await testSSR(\n    <RenderSignals />,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <!--qv q:id=0 q:key=sX:-->\n      <head q:head>\n        <title q:head>value</title>\n        <style q:head>\n          value\n        </style>\n        <script q:head>\n          value\n        </script>\n      </head>\n      <!--/qv-->\n    </html>`\n  );\n  expect(console.warn).toHaveBeenCalledTimes(2);\n});\n\ntest('component useContextProvider()', async () => {\n  await testSSR(\n    <Context>\n      <ContextConsumer />\n    </Context>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <!--qv q:id=0 q:key=sX:-->\n        <!--qv q:s q:sref=0 q:key=-->\n          <!--qv q:id=1 q:key=sX:-->hello bye<!--/qv-->\n        <!--/qv-->\n        <!--qv q:id=2 q:key=sX:-->hello bye<!--/qv-->\n      <!--/qv-->\n    </html>`\n  );\n});\n\ntest('component useContextProvider() + useContext()', async () => {\n  await testSSR(\n    <ContextWithValueAndUse value=\"hello bye\" />,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <!--qv q:id=0 q:key=sX:-->hello bye<!--/qv-->\n    </html>`\n  );\n});\n\ntest('component slotted context', async () => {\n  await testSSR(\n    <body>\n      <VariadicContext>\n        <ReadValue />\n        <ReadValue q:slot=\"start\" />\n        <ReadValue q:slot=\"end\" />\n      </VariadicContext>\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n        <!--qv q:id=1 q:key=sX:-->\n        <!--qv q:s q:sref=1 q:key=-->\n        <!--qv q:s q:sref=0 q:key=start-->\n        <!--qv q:id=2 q:key=sX:-->\n        <span>start</span>\n        <!--/qv-->\n        <!--/qv-->\n        <!--/qv-->\n        <!--/qv-->\n        <!--qv q:id=3 q:key=sX:-->\n        <!--qv q:s q:sref=3 q:key=-->\n        <!--qv q:s q:sref=0 q:key=-->\n        <!--qv q:id=4 q:key=sX:-->\n        <span>default</span>\n        <!--/qv-->\n        <!--/qv-->\n        <!--/qv-->\n        <!--/qv-->\n        <!--qv q:id=5 q:key=sX:-->\n        <!--qv q:s q:sref=5 q:key=-->\n        <!--qv q:s q:sref=0 q:key=end-->\n        <!--qv q:id=6 q:key=sX:-->\n        <span>end</span>\n        <!--/qv-->\n        <!--/qv-->\n        <!--/qv-->\n        <!--/qv-->\n        <!--/qv-->\n      </body>\n    </html>`\n  );\n});\n\ntest('component useOn()', async () => {\n  await testSSR(\n    <body>\n      <Events />\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n      <!--qv q:id=0 q:key=sX:-->\n      <div on:click=\"/runtimeQRL#_\\n/runtimeQRL#_\" on-window:click=\"/runtimeQRL#_\" on-document:click=\"/runtimeQRL#_\"></div>\n      <!--/qv-->\n      </body>\n    </html>`\n  );\n});\n\ntest('component useOn([array])', async () => {\n  await testSSR(\n    <body>\n      <UseOnMultiple />\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n        <div on:click=\"/runtimeQRL#_\\n/runtimeQRL#_\"\n          on:scroll=\"/runtimeQRL#_\"\n          on-window:click=\"/runtimeQRL#_\"\n          on-window:scroll=\"/runtimeQRL#_\"\n          on-document:click=\"/runtimeQRL#_\"\n          on-document:scroll=\"/runtimeQRL#_\"\n        ></div>\n        <!--/qv-->\n      </body>\n    </html>`\n  );\n});\n\ntest('component useStyles()', async () => {\n  await testSSR(\n    <>\n      <body>\n        <Styles />\n      </body>\n    </>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n          <style q:style=\"17nc-0\" hidden>.host {color: red}</style>\n          <div class=\"host\">\n            Text\n          </div>\n        <!--/qv-->\n      </body>\n    </html>`\n  );\n});\n\ntest('component useStylesScoped()', async () => {\n  await testSSR(\n    <>\n      <body>\n        <ScopedStyles1>\n          <div>projected</div>\n        </ScopedStyles1>\n      </body>\n    </>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:sstyle=⭐️1d-0|⭐️1e-1 q:id=0 q:key=sX:-->\n        <style q:style=\"1d-0\" hidden>\n          .host.⭐️1d-0 {\n            color: red;\n          }\n        </style>\n        <style q:style=\"1e-1\" hidden>\n          .blue.⭐️1e-1 {\n            color: blue;\n          }\n        </style>\n        <div class=\"⭐️1d-0 ⭐️1e-1 host\">\n          <div class=\"⭐️1d-0 ⭐️1e-1 div\">\n            Scoped1\n            <!--qv q:s q:sref=0 q:key=-->\n            <div>projected</div>\n            <!--/qv-->\n            <p class=\"⭐️1d-0 ⭐️1e-1\">Que tal?</p>\n          </div>\n          <!--qv q:sstyle=⭐️f0gmsw-0 q:id=1 q:key=sX:-->\n          <style q:style=\"f0gmsw-0\" hidden>\n            .host.⭐️f0gmsw-0 {\n              color: blue;\n            }\n          </style>\n          <div class=\"⭐️f0gmsw-0 host\">\n            <div class=\"⭐️f0gmsw-0\">\n              Scoped2\n              <p class=\"⭐️f0gmsw-0\">Bien</p>\n            </div>\n          </div>\n          <!--/qv-->\n          <!--qv q:sstyle=⭐️f0gmsw-0 q:id=2 q:key=sX:-->\n          <div class=\"⭐️f0gmsw-0 host\">\n            <div class=\"⭐️f0gmsw-0\">\n              Scoped2\n              <p class=\"⭐️f0gmsw-0\">Bien</p>\n            </div>\n          </div>\n          <!--/qv-->\n        </div>\n        <!--/qv-->\n      </body>\n    </html>\n    `\n  );\n});\n\ntest('component useStylesScoped() + slot', async () => {\n  await testSSR(\n    <>\n      <RootStyles></RootStyles>\n    </>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <!--qv q:sstyle=⭐️lkei4s-0 q:id=0 q:key=sX:-->\n      <body class=\"⭐️lkei4s-0\">\n        <!--qv q:sstyle=⭐️tdblg1-0 q:id=1 q:key=sX:-->\n        <style q:style=\"tdblg1-0\" hidden>\n          .host.⭐️tdblg1-0 {\n            background: green;\n          }\n        </style>\n        <div class=\"⭐️tdblg1-0\">\n          <!--qv q:s q:sref=1 q:key=one-->\n          <div q:slot=\"one\" class=\"⭐️lkei4s-0\">One</div>\n          <!--/qv-->\n        </div>\n        <q:template q:slot=\"two\" hidden aria-hidden=\"true\" class=\"⭐️lkei4s-0\">\n          <div q:slot=\"two\" class=\"⭐️lkei4s-0\">Two</div>\n        </q:template>\n        <!--/qv-->\n      </body>\n      <!--/qv-->\n    </html>\n    `\n  );\n});\n\ntest('component useBrowserVisibleTask()', async () => {\n  await testSSR(\n    <UseClientEffect />,\n    `<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <!--qv q:id=0 q:key=sX:-->\n        <div on:qvisible=\"/runtimeQRL#_[0]\n/runtimeQRL#_[1]\" q:id=\"1\"></div>\n      <!--/qv-->\n    </container>`,\n    {\n      containerTagName: 'container',\n    }\n  );\n});\n\ntest('component useBrowserVisibleTask() without elements', async () => {\n  await testSSR(\n    <body>\n      <UseEmptyClientEffect />\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n        Hola\n        <script hidden q:id=\"1\" on-document:qinit=\"/runtimeQRL#_[0]\\n/runtimeQRL#_[1]\"></script>\n        <!--/qv-->\n      </body>\n    </html>\n    `\n  );\n});\n\ntest('component useBrowserVisibleTask() inside <head>', async () => {\n  await testSSR(\n    <head>\n      <UseEmptyClientEffect />\n      <UseClientEffect as=\"style\" />\n    </head>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <head q:head>\n        <!--qv q:id=0 q:key=sX:-->\n        Hola\n        <script hidden q:id=\"1\" on-document:qinit=\"/runtimeQRL#_[0]\\n/runtimeQRL#_[1]\"></script>\n        <!--/qv-->\n        <!--qv q:id=2 q:key=sX:-->\n        <style on-document:qinit=\"/runtimeQRL#_[0]\\n/runtimeQRL#_[1]\" q:id=\"3\" q:head></style>\n        <!--/qv-->\n      </head>\n    </html>`\n  );\n});\n\ntest('nested html', async () => {\n  await testSSR(\n    <>\n      <body></body>\n    </>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body></body></html>`\n  );\n});\n\ntest('root html component', async () => {\n  await testSSR(\n    <HeadCmp host:aria-hidden=\"true\">\n      <link></link>\n    </HeadCmp>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <!--qv q:id=0 q:key=sX:-->\n      <head on-document:qinit=\"/runtimeQRL#_[0]\" q:id=\"1\" q:head>\n        <title q:head>hola</title>\n        <!--qv q:s q:sref=0 q:key=-->\n        <link q:head />\n        <!--/qv-->\n      </head>\n      <!--/qv-->\n    </html>\n    `\n  );\n});\n\ntest('containerTagName', async () => {\n  await testSSR(\n    <>\n      <Styles />\n      <UseClientEffect></UseClientEffect>\n      <section></section>\n    </>,\n    `<container q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"/manu/folder\" q:manifest-hash=\"test\" class=\"qc📦\">\n      <link rel=\"stylesheet\" href=\"/global.css\">\n      <!--qv q:id=0 q:key=sX:-->\n        <style q:style=\"17nc-0\" hidden>.host {color: red}</style>\n        <div class=\"host\">Text</div>\n      <!--/qv-->\n      <!--qv q:id=1 q:key=sX:-->\n        <div on:qvisible=\"/runtimeQRL#_[0]\n/runtimeQRL#_[1]\" q:id=\"2\"></div>\n      <!--/qv-->\n      <section></section>\n    </container>`,\n    {\n      containerTagName: 'container',\n      base: '/manu/folder',\n      beforeContent: [jsx('link', { rel: 'stylesheet', href: '/global.css' })],\n    }\n  );\n});\n\ntest('containerAttributes', async () => {\n  await testSSR(\n    <>\n      <body></body>\n    </>,\n    `\n    <html prefix=\"something\" q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n     <body></body>\n    </html>\n    `,\n    {\n      containerAttributes: {\n        prefix: 'something',\n      },\n    }\n  );\n  await testSSR(\n    <>\n      <div></div>\n    </>,\n    `\n    <app prefix=\"something\" q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\" class='qc📦 thing'>\n     <div></div>\n    </app>\n    `,\n    {\n      containerTagName: 'app',\n      containerAttributes: {\n        prefix: 'something',\n        class: 'thing',\n      },\n    }\n  );\n});\n\ntest('custom q:render', async () => {\n  await testSSR(\n    <>\n      <body></body>\n    </>,\n    `\n    <html q:render=\"static-ssr-dev\" q:container=\"paused\" q:version=\"dev\" q:base=\"\" q:manifest-hash=\"test\">\n     <body></body>\n    </html>\n    `,\n    {\n      containerAttributes: {\n        'q:render': 'static',\n      },\n    }\n  );\n  await testSSR(\n    <>\n      <body></body>\n    </>,\n    `\n    <html q:render=\"ssr-dev\" q:container=\"paused\" q:version=\"dev\" q:base=\"\" q:manifest-hash=\"test\">\n     <body></body>\n    </html>\n    `,\n    {\n      containerAttributes: {\n        'q:render': '',\n      },\n    }\n  );\n});\n\ntest('ssr marks', async () => {\n  await testSSR(\n    <body>\n      {delay(100).then(() => (\n        <li>1</li>\n      ))}\n      {delay(10).then(() => (\n        <li>2</li>\n      ))}\n      <SSRComment data=\"here\" />\n      <div>\n        <SSRComment data=\"i am\" />\n      </div>\n      {delay(120).then(() => (\n        <li>3</li>\n      ))}\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qkssr-f-->\n        <li>1</li>\n        <!--qkssr-f-->\n        <li>2</li>\n        <!--here-->\n        <div>\n          <!--i am-->\n        </div>\n        <!--qkssr-f-->\n        <li>3</li>\n      </body>\n    </html>`\n  );\n});\n\ntest('ssr raw', async () => {\n  await testSSR(\n    <body>\n      <SSRRaw data=\"<div>hello</div>\" />\n    </body>,\n    `\n  <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n    <body>\n      <div>hello</div>\n    </body>\n  </html>`\n  );\n});\n\ntest('html fragment', async () => {\n  await testSSR(\n    <body>\n      <HTMLFragment dangerouslySetInnerHTML=\"<div>hello</div>\" />\n    </body>,\n    `\n  <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n    <body>\n      <!--qv-->\n      <div>hello</div>\n      <!--/qv-->\n    </body>\n  </html>`\n  );\n});\n\ntest('html slot', async () => {\n  await testSSR(\n    <HtmlContext>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik</title>\n      </head>\n      <body>\n        <div></div>\n      </body>\n    </HtmlContext>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"/manu/folder\" q:manifest-hash=\"test\">\n      <!--qv q:id=0 q:key=sX:-->\n      <!--qv q:s q:sref=0 q:key=-->\n      <head q:head>\n        <meta charset=\"utf-8\" q:head />\n        <title q:head>Qwik</title>\n        <link rel=\"stylesheet\" href=\"/global.css\" />\n        <style q:style=\"fio5tb-1\" hidden>\n          body {\n            background: blue;\n          }\n        </style>\n      </head>\n      <body>\n        <div></div>\n      </body>\n      <!--/qv-->\n      <!--/qv-->\n    </html>`,\n    {\n      beforeContent: [jsx('link', { rel: 'stylesheet', href: '/global.css' })],\n      base: '/manu/folder',\n    }\n  );\n});\n\ntest('null component', async () => {\n  await testSSR(\n    <>\n      <NullCmp />\n    </>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><!--qv q:id=0 q:key=sX:--><!--/qv--></html>`\n  );\n});\n\ntest('cleanse attribute name', async () => {\n  const o = {\n    '\"><script>alert(\"ಠ~ಠ\")</script>': 'xss',\n  };\n  await testSSR(\n    <body {...o}></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body></body></html>'\n  );\n});\n\ntest('cleanse class attribute', async () => {\n  const o = {\n    class: '\"><script>alert(\"ಠ~ಠ\")</script>',\n  };\n  await testSSR(\n    <body {...o}></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body class=\"&quot;&gt;&lt;script&gt;alert(&quot;ಠ~ಠ&quot;)&lt;/script&gt;\"></body></html>'\n  );\n});\n\ntest('class emoji valid', async () => {\n  const o = {\n    class: 'package📦',\n  };\n  await testSSR(\n    <body {...o}></body>,\n    '<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\"><body class=\"package📦\"></body></html>'\n  );\n});\n\ntest('issue 4283', async () => {\n  await testSSR(\n    <body>\n      <Issue4283>\n        <p>index page</p>\n      </Issue4283>\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n        <!--qv q:id=1 q:key=sX:-->\n        <div on:qvisible=\"/runtimeQRL#_[0]\" q:id=\"2\"></div>\n        <q:template q:slot hidden aria-hidden=\"true\">\n          <p>Content</p>\n          <!--qv q:s q:sref=0 q:key=-->\n          <p>index page</p>\n          <!--/qv-->\n        </q:template>\n        <!--/qv-->\n        <!--/qv-->\n      </body>\n    </html>\n    `\n  );\n});\n\ntest('AsyncResource', async () => {\n  await testSSR(\n    <body>\n      <ul>\n        <AsyncResource text=\"thing\" delay={500} />\n      </ul>\n    </body>,\n    `<html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n    <body>\n      <ul>\n        <!--qv q:id=0 q:key=sX:-->\n          <div class=\"cmp1\"><!--qkssr-f--><span>1</span>;</div>\n        <!--/qv-->\n      </ul>\n    </body>\n  </html>`\n  );\n});\n\ntest('Slot name escaping', async () => {\n  await testSSR(\n    <body>\n      <SlotNameEscapingComponent>\n        <div q:slot={PAYLOAD}>Injected Content</div>\n      </SlotNameEscapingComponent>\n    </body>,\n    `\n    <html q:container=\"paused\" q:version=\"dev\" q:render=\"ssr-dev\" q:base=\"\" q:manifest-hash=\"test\">\n      <body>\n        <!--qv q:id=0 q:key=sX:-->\n        <div>\n          <p>Injecting via Slot Name...</p>\n          <!--qv q:s q:sref=0 q:key=--&gt;&lt;img src=x onerror=alert(&#39;XSS&#39;)&gt;-->\n          <div q:slot=\"--&gt;&lt;img src=x onerror=alert(&#39;XSS&#39;)&gt;\">Injected Content</div>\n          <!--/qv-->\n        </div>\n        <!--/qv-->\n      </body>\n    </html>\n    `\n  );\n});\n\ndescribe('renderVirtualAttributes', () => {\n  test('escapes values and handles empty props', () => {\n    const attrs = { a: 'a&<>\"\\'' };\n    const out = renderVirtualAttributes(attrs as any);\n    expect(out).toBe(' a=a&amp;&lt;&gt;&quot;&#39;');\n  });\n\n  test('renders boolean/empty attribute as prop without value', () => {\n    const attrs = { disabled: '' };\n    const out = renderVirtualAttributes(attrs as any);\n    expect(out).toBe(' disabled');\n  });\n\n  test('skips children and dangerouslySetInnerHTML', () => {\n    const attrs: Record<string, string> = {\n      children: 'x',\n      [dangerouslySetInnerHTML]: '<p>hi</p>',\n      foo: 'bar',\n    };\n    const out = renderVirtualAttributes(attrs as any);\n    expect(out).toBe(' foo=bar');\n  });\n\n  test('renders numeric attributes', () => {\n    const attrs = { width: 300, height: 150 };\n    const out = renderVirtualAttributes(attrs as any);\n    expect(out).toBe(' width=300 height=150');\n  });\n\n  test('renders boolean attributes', () => {\n    const attrs = { disabled: true, readonly: false, required: true };\n    const out = renderVirtualAttributes(attrs as any);\n    expect(out).toBe(' disabled=true readonly=false required=true');\n  });\n});\n\ndescribe('renderAttributes', () => {\n  test('escapes values and handles empty props', () => {\n    const attrs = { a: 'a&<>\"\\'' };\n    const out = renderAttributes(attrs as any);\n    expect(out).toBe(' a=\"a&amp;&lt;&gt;&quot;&#39;\"');\n  });\n\n  test('renders boolean/empty attribute as prop without value', () => {\n    const attrs = { disabled: '' };\n    const out = renderAttributes(attrs as any);\n    expect(out).toBe(' disabled');\n  });\n\n  test('skips children and dangerouslySetInnerHTML', () => {\n    const attrs: Record<string, string> = {\n      [dangerouslySetInnerHTML]: '<p>hi</p>',\n      foo: 'bar',\n    };\n    const out = renderAttributes(attrs as any);\n    expect(out).toBe(' foo=\"bar\"');\n  });\n\n  test('renders numeric attributes', () => {\n    const attrs = { width: 300, height: 150 };\n    const out = renderAttributes(attrs as any);\n    expect(out).toBe(' width=\"300\" height=\"150\"');\n  });\n\n  test('renders boolean attributes', () => {\n    const attrs = { disabled: true, readonly: false, required: true };\n    const out = renderAttributes(attrs as any);\n    expect(out).toBe(' disabled=\"true\" readonly=\"false\" required=\"true\"');\n  });\n});\n\nconst PAYLOAD = `--><img src=x onerror=alert('XSS')>`;\nexport const SlotNameEscapingComponent = component$(() => {\n  return (\n    <div>\n      <p>Injecting via Slot Name...</p>\n      <Slot name={PAYLOAD} />\n    </div>\n  );\n});\n\n// TODO\n// Merge props on host\n// - host events\n// - class\n// - style\n// Container with tagName\n// End-to-end with qwikcity\n// SVG rendering\n// Performance metrics\n\nexport const MyCmp = component$((props: Record<string, any>) => {\n  return (\n    <section>\n      <div>\n        MyCmp\n        {JSON.stringify(props)}\n      </div>\n    </section>\n  );\n});\n\nexport const MyCmpComplex = component$(() => {\n  const ref = useSignal<HTMLElement>();\n  return (\n    <div ref={ref} onClick$={() => console.warn('from component')}>\n      <button onClick$={() => console.warn('click')}>Click</button>\n      <Slot></Slot>\n    </div>\n  );\n});\n\nexport const SimpleSlot = component$((props: { name: string }) => {\n  return (\n    <div id={props.name}>\n      Before {props.name}\n      <Slot></Slot>\n      After {props.name}\n    </div>\n  );\n});\n\nexport const MixedSlot = component$(() => {\n  return (\n    <SimpleSlot name=\"1\">\n      <Slot />\n    </SimpleSlot>\n  );\n});\n\nexport const NamedSlot = component$(() => {\n  return (\n    <div>\n      <Slot name=\"start\" />\n      <div>\n        <Slot></Slot>\n      </div>\n      <Slot name=\"end\" />\n    </div>\n  );\n});\n\nexport const Events = component$(() => {\n  useOn(\n    'click',\n    $(() => console.warn('click'))\n  );\n  useOnWindow(\n    'click',\n    $(() => console.warn('window:click'))\n  );\n  useOnDocument(\n    'click',\n    $(() => console.warn('document:click'))\n  );\n\n  return <div onClick$={() => console.warn('scroll')}></div>;\n});\n\nexport const UseOnMultiple = component$(() => {\n  useOn(\n    ['click', 'scroll'],\n    $(() => console.warn('click or scroll'))\n  );\n  useOnWindow(\n    ['click', 'scroll'],\n    $(() => console.warn('window:click or scroll'))\n  );\n  useOnDocument(\n    ['click', 'scroll'],\n    $(() => console.warn('document:click or scroll'))\n  );\n\n  return <div onClick$={() => console.warn('scroll')}></div>;\n});\n\nexport const Styles = component$(() => {\n  useStylesQrl(inlinedQrl('.host {color: red}', 'styles_987'));\n\n  return <div class=\"host\">Text</div>;\n});\n\nexport const ScopedStyles1 = component$(() => {\n  useStylesScopedQrl(inlinedQrl('.host {color: red}', 'styles_scoped_1'));\n  useStylesScopedQrl(inlinedQrl('.blue {color: blue}', 'styles_scoped_2'));\n\n  return (\n    <div class=\"host\">\n      <div class=\"div\">\n        Scoped1\n        <Slot></Slot>\n        <p>Que tal?</p>\n      </div>\n      <ScopedStyles2 />\n      <ScopedStyles2 />\n    </div>\n  );\n});\n\nexport const ScopedStyles2 = component$(() => {\n  useStylesScopedQrl(inlinedQrl('.host {color: blue}', '20_styles_scoped'));\n\n  return (\n    <div class=\"host\">\n      <div>\n        Scoped2\n        <p>Bien</p>\n      </div>\n    </div>\n  );\n});\n\nexport const RootStyles = component$(() => {\n  useStylesScopedQrl(inlinedQrl('.host {background: blue}', '20_stylesscopedblue'));\n\n  return (\n    <body>\n      <ComponentA>\n        <div q:slot=\"one\">One</div>\n        <div q:slot=\"two\">Two</div>\n      </ComponentA>\n    </body>\n  );\n});\n\nexport const ComponentA = component$(() => {\n  useStylesScopedQrl(inlinedQrl('.host {background: green}', '20_stylesscopedgreen'));\n\n  return (\n    <div>\n      <Slot name=\"one\" />\n    </div>\n  );\n});\n\nconst CTX_INTERNAL = createContextId<{ value: string }>('internal');\nconst CTX_QWIK_CITY = createContextId<{ value: string }>('qwikcity');\nconst CTX_VALUE = createContextId<{ value: string }>('value');\n\nexport const VariadicContext = component$(() => {\n  return (\n    <>\n      <ContextWithValue value=\"start\">\n        <Slot name=\"start\"></Slot>\n      </ContextWithValue>\n      <ContextWithValue value=\"default\">\n        <Slot></Slot>\n      </ContextWithValue>\n      <ContextWithValue value=\"end\">\n        <Slot name=\"end\"></Slot>\n      </ContextWithValue>\n    </>\n  );\n});\n\nexport const ReadValue = component$(() => {\n  const ctx = useContext(CTX_VALUE);\n  return <span>{ctx.value}</span>;\n});\n\nexport const ContextWithValue = component$((props: { value: string }) => {\n  const value = {\n    value: props.value,\n  };\n  useContextProvider(CTX_VALUE, value);\n  return (\n    <>\n      <Slot />\n    </>\n  );\n});\n\nexport const ContextWithValueAndUse = component$((props: { value: string }) => {\n  const value = {\n    value: props.value,\n  };\n  useContextProvider(CTX_VALUE, value);\n  const ctx = useContext(CTX_VALUE);\n  return <>{ctx.value}</>;\n});\n\nexport const Context = component$(() => {\n  useContextProvider(CTX_INTERNAL, {\n    value: 'hello',\n  });\n  useContextProvider(CTX_QWIK_CITY, {\n    value: 'bye',\n  });\n  return (\n    <>\n      <Slot />\n      <ContextConsumer />\n    </>\n  );\n});\n\nexport const ContextConsumer = component$(() => {\n  const internal = useContext(CTX_INTERNAL);\n  const qwikCity = useContext(CTX_QWIK_CITY);\n\n  return (\n    <>\n      {internal.value} {qwikCity.value}\n    </>\n  );\n});\n\nexport const UseClientEffect = component$((props: any) => {\n  useVisibleTask$(() => {\n    console.warn('client effect');\n  });\n  useVisibleTask$(() => {\n    console.warn('second client effect');\n  });\n  useTask$(async () => {\n    await delay(10);\n  });\n\n  const Div = props.as ?? 'div';\n  return <Div />;\n});\n\nexport const UseEmptyClientEffect = component$(() => {\n  useVisibleTask$(() => {\n    console.warn('client effect');\n  });\n  useVisibleTask$(() => {\n    console.warn('second client effect');\n  });\n  useTask$(async () => {\n    await delay(10);\n  });\n\n  return <>Hola</>;\n});\n\nexport const HeadCmp = component$(() => {\n  useVisibleTask$(() => {\n    console.warn('client effect');\n  });\n  return (\n    <head>\n      <title>hola</title>\n      <Slot></Slot>\n    </head>\n  );\n});\n\nexport const RenderSignals = component$(() => {\n  const signal = useSignal('value');\n  return (\n    <>\n      <head>\n        <title>{signal.value}</title>\n        <style>{signal.value}</style>\n        <script>{signal.value}</script>\n      </head>\n    </>\n  );\n});\n\nexport const HtmlContext = component$(() => {\n  const store = useStore({});\n  useStylesQrl(inlinedQrl(`body {background: blue}`, 'styles_DelayResource'));\n  useContextProvider(CTX_INTERNAL, store);\n\n  return <Slot />;\n});\n\nasync function testSSR(\n  node: JSXOutput,\n  expected: string | string[],\n  opts?: Partial<RenderSSROptions>\n) {\n  let chunks: string[] = [];\n  const stream: StreamWriter = {\n    write(chunk) {\n      chunks.push(chunk);\n    },\n  };\n  await _renderSSR(node, {\n    stream,\n    containerTagName: 'html',\n    containerAttributes: {},\n    manifestHash: 'test',\n    ...opts,\n  });\n  chunks = chunks.map((c) => c.replace(/ q:instance=\"[^\"]+\"/, ''));\n  if (typeof expected === 'string') {\n    const options = { parser: 'html', htmlWhitespaceSensitivity: 'ignore' } as const;\n    expect(await format(chunks.join(''), options)).toBe(\n      await format(expected.replace(/(\\n|^)\\s+/gm, ''), options)\n    );\n  } else {\n    expect(chunks).toEqual(expected);\n  }\n}\n\nexport const DelayResource = component$((props: { text: string; delay: number }) => {\n  useStylesQrl(inlinedQrl(`.cmp {background: blue}`, 'styles_DelayResource'));\n\n  const resource = useResource$<string>(async ({ track }) => {\n    track(() => props.text);\n    await delay(props.delay);\n    return props.text;\n  });\n  return (\n    <div class=\"cmp\">\n      <Resource value={resource} onResolved={(value) => <span>{value}</span>} />\n    </div>\n  );\n});\n\nexport const AsyncResource = component$((props: { text: string; delay: number }) => {\n  const resource = useResource$<string>(async ({ track }) => {\n    track(() => props.text);\n    await delay(props.delay);\n    return props.text;\n  });\n  return (\n    <div class=\"cmp1\">\n      <Resource\n        value={resource}\n        onResolved={async () => <span>1</span>}\n        onRejected={async () => <span>1</span>}\n        onPending={async () => <span>1</span>}\n      />\n      ;\n    </div>\n  );\n});\n\nexport const NullCmp = component$(() => {\n  return null;\n});\n\nexport const EffectTransparent = component$(() => {\n  useVisibleTask$(() => {\n    console.warn('log');\n  });\n  return <Slot />;\n});\n\nexport const EffectTransparentRoot = component$(() => {\n  useVisibleTask$(() => {\n    console.warn('log');\n  });\n  return (\n    <EffectTransparent>\n      <section>Hello</section>\n    </EffectTransparent>\n  );\n});\n\nexport const HideUntilVisible = component$(() => {\n  const isNotVisible = useSignal(true);\n\n  useVisibleTask$(() => {\n    if (isNotVisible.value) {\n      isNotVisible.value = false;\n    }\n  });\n\n  // NOTE: if you comment the line below,\n  // there will only be one \"Content\"\n  if (isNotVisible.value) {\n    return <div></div>;\n  }\n\n  return (\n    <div>\n      <p>Hide until visible</p>\n      <Slot />\n    </div>\n  );\n});\n\nexport const Issue4283 = component$(() => {\n  return (\n    <HideUntilVisible>\n      <p>Content</p>\n      <Slot />\n    </HideUntilVisible>\n  );\n});\n\nasync function throws<T>(fn: () => T, expected?: string | RegExp): Promise<void> {\n  try {\n    await fn();\n    expect.unreachable('Expression should throw');\n  } catch (e) {\n    if (expected) {\n      expect(String(e)).toBe(expected);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/core/render/sync-qrl.unit.tsx",
    "content": "import { assert, suite, test } from 'vitest';\nimport { createDOM } from '../../testing/library';\nimport { sync$ } from '../qrl/qrl.public';\nimport { renderToString } from '../../server/render';\n\nsuite('sync-qrl', () => {\n  test('default updates the checkbox', async () => {\n    const { screen, render } = await createDOM();\n    await render(<input type=\"checkbox\" checked={false} />);\n    const input = screen.querySelector('input')!;\n    assert.equal(input.checked, false);\n    input.click();\n    assert.equal(input.checked, true);\n  });\n\n  test('default prevents updates the checkbox', async () => {\n    const { screen, userEvent, render } = await createDOM();\n    await render(\n      <input\n        type=\"checkbox\"\n        onClick$={[\n          sync$((e: Event, target: Element) => {\n            if (target.getAttribute('shouldPreventDefault')) {\n              e.preventDefault();\n            }\n            target.setAttribute('prevented', String(e.defaultPrevented));\n          }),\n        ]}\n      />\n    );\n    const input = screen.querySelector('input')!;\n    await userEvent(input, 'click');\n    assert.equal(input.getAttribute('prevented'), 'false');\n    input.setAttribute('shouldPreventDefault', 'true');\n    await userEvent(input, 'click');\n    assert.equal(input.getAttribute('prevented'), 'true');\n  });\n\n  // Currently the testing does not support resuming from SSR\n  test.skip('render SSR', async () => {\n    const response = await renderToString(\n      <input\n        type=\"checkbox\"\n        onClick$={[\n          sync$(function (e: Event, target: Element) {\n            if (target.getAttribute('shouldPreventDefault')) {\n              e.preventDefault();\n            }\n            target.setAttribute('prevented', String(e.defaultPrevented));\n          }),\n        ]}\n      />,\n      { containerTagName: 'container' }\n    );\n\n    const { screen, userEvent } = await createDOM({ html: response.html });\n    const input = screen.querySelector('input')!;\n    await userEvent(input, 'click');\n    assert.equal(input.getAttribute('prevented'), 'false');\n    input.setAttribute('shouldPreventDefault', 'true');\n    await userEvent(input, 'click');\n    assert.equal(input.getAttribute('prevented'), 'true');\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/render/types.ts",
    "content": "import type { ContainerState } from '../container/container';\nimport type { QContext } from '../state/context';\nimport type { QwikElement } from './dom/virtual-element';\n\n/** @public */\nexport interface RenderOperation {\n  $operation$: (...args: any[]) => void;\n  $args$: any[];\n}\n\n/** @public */\nexport interface RenderContext {\n  readonly $static$: RenderStaticContext;\n  /** Current Qwik component */\n  $cmpCtx$: QContext | null;\n  /** Current Slot parent */\n  $slotCtx$: QContext | undefined;\n}\n\nexport interface RenderStaticContext {\n  readonly $locale$: string;\n  readonly $doc$: Document;\n  readonly $roots$: QContext[];\n  readonly $hostElements$: Set<QwikElement>;\n  readonly $visited$: (Node | QwikElement)[];\n  readonly $operations$: RenderOperation[];\n  readonly $postOperations$: RenderOperation[];\n  readonly $containerState$: ContainerState;\n  readonly $addSlots$: [QwikElement, QwikElement][];\n  readonly $rmSlots$: QwikElement[];\n}\n\n// Polyfills for ViewTransition API & scroll restoration\ndeclare global {\n  interface ViewTransition {\n    ready: Promise<void>;\n    finished: Promise<void>;\n    updateCallbackDone: Promise<void>;\n    skipTransition: () => void;\n  }\n\n  interface Document {\n    startViewTransition?: (callback: () => void | Promise<void>) => ViewTransition;\n    __q_view_transition__?: true | undefined;\n    __q_scroll_restore__?: (() => void) | undefined;\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/core/state/common.ts",
    "content": "import { assertFail, assertTrue } from '../error/assert';\nimport { qError, QError_verifySerializable } from '../error/error';\nimport { isNode } from '../util/element';\nimport { seal } from '../util/qdev';\nimport { isArray, isFunction, isObject, isSerializableObject } from '../util/types';\nimport { isPromise } from '../util/promises';\nimport { canSerialize } from '../container/serializers';\nimport type { ContainerState, GetObject, GetObjID } from '../container/container';\nimport {\n  isSubscriberDescriptor,\n  type SubscriberEffect,\n  type SubscriberHost,\n} from '../use/use-task';\nimport type { QwikElement } from '../render/dom/virtual-element';\nimport { notifyChange } from '../render/dom/notify-render';\nimport { logError, throwErrorAndStop } from '../util/log';\nimport { tryGetContext } from './context';\nimport { QObjectFlagsSymbol, QObjectManagerSymbol, QOjectTargetSymbol } from './constants';\nimport type { Signal } from './signal';\n\nexport interface SubscriptionManager {\n  $groupToManagers$: GroupToManagersMap;\n  $createManager$(map?: Subscriptions[]): LocalSubscriptionManager;\n  $clearSub$: (group: Group) => void;\n  $clearSignal$: (signal: SubscriberSignal) => void;\n}\n\nexport type QObject<T extends {}> = T & { __brand__: 'QObject' };\n\nexport type TargetType = Record<string | symbol, any>;\n\n/** @internal */\nexport const verifySerializable = <T>(value: T, preMessage?: string): T => {\n  const seen = new Set();\n  return _verifySerializable(value, seen, '_', preMessage);\n};\n\nconst _verifySerializable = <T>(value: T, seen: Set<any>, ctx: string, preMessage?: string): T => {\n  const unwrapped = unwrapProxy(value);\n  if (unwrapped == null) {\n    return value;\n  }\n  if (shouldSerialize(unwrapped)) {\n    if (seen.has(unwrapped)) {\n      return value;\n    }\n    seen.add(unwrapped);\n    if (canSerialize(unwrapped)) {\n      return value;\n    }\n    const typeObj = typeof unwrapped;\n    switch (typeObj) {\n      case 'object':\n        if (isPromise(unwrapped)) {\n          return value;\n        }\n        if (isNode(unwrapped)) {\n          return value;\n        }\n        if (isArray(unwrapped)) {\n          let expectIndex = 0;\n          // Make sure the array has no holes\n          unwrapped.forEach((v, i) => {\n            if (i !== expectIndex) {\n              throw qError(QError_verifySerializable, unwrapped);\n            }\n            _verifySerializable(v, seen, ctx + '[' + i + ']');\n            expectIndex = i + 1;\n          });\n          return value;\n        }\n        if (isSerializableObject(unwrapped)) {\n          for (const [key, item] of Object.entries(unwrapped)) {\n            _verifySerializable(item, seen, ctx + '.' + key);\n          }\n          return value;\n        }\n        break;\n      case 'boolean':\n      case 'string':\n      case 'number':\n        return value;\n    }\n    let message = '';\n    if (preMessage) {\n      message = preMessage;\n    } else {\n      message = 'Value cannot be serialized';\n    }\n    if (ctx !== '_') {\n      message += ` in ${ctx},`;\n    }\n    if (typeObj === 'object') {\n      message += ` because it's an instance of \"${value?.constructor.name}\". You might need to use 'noSerialize()' or use an object literal instead. Check out https://qwik.dev/docs/advanced/dollar/`;\n    } else if (typeObj === 'function') {\n      const fnName = (value as Function).name;\n      message += ` because it's a function named \"${fnName}\". You might need to convert it to a QRL using $(fn):\\n\\nconst ${fnName} = $(${String(\n        value\n      )});\\n\\nPlease check out https://qwik.dev/docs/advanced/qrl/ for more information.`;\n    }\n    console.error('Trying to serialize', value);\n    throwErrorAndStop(message);\n  }\n  return value;\n};\nconst noSerializeSet = /*#__PURE__*/ new WeakSet<object>();\nconst weakSerializeSet = /*#__PURE__*/ new WeakSet<object>();\n\nexport const shouldSerialize = (obj: unknown): boolean => {\n  if (isObject(obj) || isFunction(obj)) {\n    return !noSerializeSet.has(obj);\n  }\n  return true;\n};\n\nexport const fastSkipSerialize = (obj: object): boolean => {\n  return noSerializeSet.has(obj);\n};\n\nexport const fastWeakSerialize = (obj: object): boolean => {\n  return weakSerializeSet.has(obj);\n};\n\n/**\n * Returned type of the `noSerialize()` function. It will be TYPE or undefined.\n *\n * @public\n * @see noSerialize\n */\nexport type NoSerialize<T> = (T & { __no_serialize__: true }) | undefined;\n\n// <docs markdown=\"../readme.md#noSerialize\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#noSerialize instead)\n/**\n * Marks a property on a store as non-serializable.\n *\n * At times it is necessary to store values on a store that are non-serializable. Normally this is a\n * runtime error as Store wants to eagerly report when a non-serializable property is assigned to\n * it.\n *\n * You can use `noSerialize()` to mark a value as non-serializable. The value is persisted in the\n * Store but does not survive serialization. The implication is that when your application is\n * resumed, the value of this object will be `undefined`. You will be responsible for recovering\n * from this.\n *\n * See: [noSerialize Tutorial](http://qwik.dev/tutorial/store/no-serialize)\n *\n * @public\n */\n// </docs>\nexport const noSerialize = <T extends object | undefined>(input: T): NoSerialize<T> => {\n  // only add supported values to the noSerializeSet, prevent console errors\n  if ((typeof input === 'object' && input !== null) || typeof input === 'function') {\n    noSerializeSet.add(input);\n  }\n  return input as any;\n};\n\n/** @internal */\nexport const _weakSerialize = <T extends object>(input: T): Partial<T> => {\n  weakSerializeSet.add(input);\n  return input as any;\n};\n\nexport const isConnected = (sub: SubscriberEffect | SubscriberHost): boolean => {\n  if (isSubscriberDescriptor(sub)) {\n    return isConnected(sub.$el$);\n  } else {\n    return !!tryGetContext(sub) || sub.isConnected;\n  }\n};\n\n/**\n * Get the target value of the Proxy. Useful if you want to clone a store (structureClone,\n * IndexedDB,...)\n *\n * @public\n */\nexport const unwrapProxy = <T>(proxy: T): T => {\n  return isObject(proxy) ? (getProxyTarget<any>(proxy) ?? proxy) : proxy;\n};\n\nexport const getProxyTarget = <T extends object>(obj: T): T | undefined => {\n  return (obj as any)[QOjectTargetSymbol];\n};\n\nexport const getSubscriptionManager = (obj: object): LocalSubscriptionManager | undefined => {\n  return (obj as any)[QObjectManagerSymbol];\n};\n\nexport const getProxyFlags = <T = object>(obj: T): number | undefined => {\n  return (obj as any)[QObjectFlagsSymbol];\n};\n\ntype SubscriberA = readonly [type: 0, host: SubscriberEffect | SubscriberHost];\n\ntype SubscriberB = readonly [\n  type: 1 | 2,\n  host: SubscriberHost,\n  signal: Signal,\n  elm: QwikElement,\n  prop: string,\n];\n\nexport type SubscriberC = readonly [\n  type: 3 | 4,\n  host: SubscriberHost | Text,\n  signal: Signal,\n  elm: Node | string | QwikElement,\n];\n\nexport type Subscriber = SubscriberA | SubscriberB | SubscriberC;\n\ntype A = [type: 0, host: SubscriberEffect | SubscriberHost, key: string | undefined];\ntype B = [\n  type: 1 | 2,\n  host: SubscriberHost,\n  signal: Signal,\n  elm: QwikElement,\n  prop: string,\n  key: string | undefined,\n];\ntype C = [\n  type: 3 | 4,\n  host: SubscriberHost | Text,\n  signal: Signal,\n  elm: Node | QwikElement,\n  key: string | undefined,\n];\n\nexport type SubscriberSignal = B | C;\n\nexport type Subscriptions = A | SubscriberSignal;\n\ntype Group = SubscriberEffect | SubscriberHost | Node;\n\nexport type GroupToManagersMap = Map<Group, LocalSubscriptionManager[]>;\n\nexport const serializeSubscription = (sub: Subscriptions, getObjId: GetObjID) => {\n  const type = sub[0];\n  const host = typeof sub[1] === 'string' ? sub[1] : getObjId(sub[1]);\n  if (!host) {\n    return undefined;\n  }\n  let base = type + ' ' + host;\n  let key: string | undefined;\n  if (type === 0) {\n    key = sub[2];\n  } else {\n    const signalID = getObjId(sub[2]);\n    if (!signalID) {\n      return undefined;\n    }\n    if (type <= 2) {\n      key = sub[5];\n      base += ` ${signalID} ${must(getObjId(sub[3]))} ${sub[4]}`;\n    } else if (type <= 4) {\n      key = sub[4];\n      const nodeID = typeof sub[3] === 'string' ? sub[3] : must(getObjId(sub[3]));\n      base += ` ${signalID} ${nodeID}`;\n    } else {\n      assertFail('Should not get here');\n    }\n  }\n  if (key) {\n    base += ` ${encodeURI(key)}`;\n  }\n  return base;\n};\n\nexport const parseSubscription = (sub: string, getObject: GetObject): Subscriptions | undefined => {\n  const parts = sub.split(' ');\n  const type = parseInt(parts[0], 10);\n  assertTrue(parts.length >= 2, 'At least 2 parts');\n  const host = getObject(parts[1]);\n  if (!host) {\n    return undefined;\n  }\n  if (isSubscriberDescriptor(host) && !host.$el$) {\n    return undefined;\n  }\n  const subscription = [type, host];\n  if (type === 0) {\n    assertTrue(parts.length <= 3, 'Max 3 parts');\n    subscription.push(safeDecode(parts[2]));\n  } else if (type <= 2) {\n    assertTrue(parts.length === 5 || parts.length === 6, 'Type 1 has 5');\n    subscription.push(getObject(parts[2]), getObject(parts[3]), parts[4], safeDecode(parts[5]));\n  } else if (type <= 4) {\n    assertTrue(parts.length === 4 || parts.length === 5, 'Type 2 has 4');\n    subscription.push(getObject(parts[2]), getObject(parts[3]), safeDecode(parts[4]));\n  }\n  return subscription as any;\n};\n\nconst safeDecode = (str: string | undefined) => {\n  if (str !== undefined) {\n    return decodeURI(str);\n  }\n  return undefined;\n};\n\nexport const createSubscriptionManager = (containerState: ContainerState): SubscriptionManager => {\n  const groupToManagers: GroupToManagersMap = new Map();\n  const manager: SubscriptionManager = {\n    $groupToManagers$: groupToManagers,\n    $createManager$: (initialMap?: Subscriptions[]) => {\n      return new LocalSubscriptionManager(groupToManagers, containerState, initialMap);\n    },\n    $clearSub$: (group: Group) => {\n      const managers = groupToManagers.get(group);\n      if (managers) {\n        for (const manager of managers) {\n          manager.$unsubGroup$(group);\n        }\n        groupToManagers.delete(group);\n        managers.length = 0;\n      }\n    },\n    $clearSignal$: (signal: SubscriberSignal) => {\n      const managers = groupToManagers.get(signal[1]);\n      if (managers) {\n        for (const manager of managers) {\n          manager.$unsubEntry$(signal);\n        }\n      }\n    },\n  };\n  seal(manager);\n  return manager;\n};\n\nexport class LocalSubscriptionManager {\n  readonly $subs$: Subscriptions[];\n\n  constructor(\n    private $groupToManagers$: GroupToManagersMap,\n    private $containerState$: ContainerState,\n    initialMap?: Subscriptions[]\n  ) {\n    this.$subs$ = [];\n\n    if (initialMap) {\n      this.$addSubs$(initialMap);\n    }\n    seal(this);\n  }\n\n  $addSubs$(subs: Subscriptions[]) {\n    this.$subs$.push(...subs);\n    for (const sub of this.$subs$) {\n      this.$addToGroup$(sub[1], this);\n    }\n  }\n\n  $addToGroup$(group: Group, manager: LocalSubscriptionManager) {\n    let managers = this.$groupToManagers$.get(group);\n    if (!managers) {\n      this.$groupToManagers$.set(group, (managers = []));\n    }\n    if (!managers.includes(manager)) {\n      managers.push(manager);\n    }\n  }\n\n  $unsubGroup$(group: Group) {\n    const subs = this.$subs$;\n    for (let i = 0; i < subs.length; i++) {\n      const found = subs[i][1] === group;\n      if (found) {\n        subs.splice(i, 1);\n        i--;\n      }\n    }\n  }\n\n  $unsubEntry$(entry: SubscriberSignal) {\n    const [type, group, signal, elm] = entry;\n    const subs = this.$subs$;\n    if (type === 1 || type === 2) {\n      const prop = entry[4];\n      for (let i = 0; i < subs.length; i++) {\n        const sub = subs[i];\n        const match =\n          sub[0] === type &&\n          sub[1] === group &&\n          sub[2] === signal &&\n          sub[3] === elm &&\n          sub[4] === prop;\n        if (match) {\n          subs.splice(i, 1);\n          i--;\n        }\n      }\n    } else if (type === 3 || type === 4) {\n      for (let i = 0; i < subs.length; i++) {\n        const sub = subs[i];\n        const match = sub[0] === type && sub[1] === group && sub[2] === signal && sub[3] === elm;\n        if (match) {\n          subs.splice(i, 1);\n          i--;\n        }\n      }\n    }\n  }\n\n  $addSub$(sub: Subscriber, key?: string) {\n    const subs = this.$subs$;\n    const group = sub[1];\n    if (\n      sub[0] === 0 &&\n      subs.some(([_type, _group, _key]) => _type === 0 && _group === group && _key === key)\n    ) {\n      return;\n    }\n    subs.push((__lastSubscription = [...sub, key] as any));\n    this.$addToGroup$(group, this);\n  }\n\n  $notifySubs$(key?: string | undefined) {\n    const subs = this.$subs$;\n    for (const sub of subs) {\n      const compare = sub[sub.length - 1];\n      if (key && compare && compare !== key) {\n        continue;\n      }\n      notifyChange(sub, this.$containerState$);\n    }\n  }\n}\n\nlet __lastSubscription: Subscriptions | undefined;\n\nexport function getLastSubscription(): Subscriptions | undefined {\n  // HACK(misko): This is a hack to get the last subscription.\n  // It is used by `executeSignalOperation` to update the target element\n  // after the subscription has been created.\n  return __lastSubscription;\n}\n\nconst must = <T>(a: T): NonNullable<T> => {\n  if (a == null) {\n    throw logError('must be non null', a);\n  }\n  return a;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/state/constants.ts",
    "content": "export const QObjectRecursive = 1 << 0;\nexport const QObjectImmutable = 1 << 1;\n\nexport const QOjectTargetSymbol = Symbol('proxy target');\nexport const QObjectFlagsSymbol = Symbol('proxy flags');\nexport const QObjectManagerSymbol = Symbol('proxy manager');\n\n/** @internal */\nexport const _IMMUTABLE = Symbol('IMMUTABLE');\n\nexport const _IMMUTABLE_PREFIX = '$$';\n\n/**\n * @internal\n * Key for the virtual element stored on qv comments\n */\nexport const VIRTUAL_SYMBOL = '__virtual';\n/**\n * @internal\n * Key for the `QContext` object stored on QwikElements\n */\nexport const Q_CTX = '_qc_';\n"
  },
  {
    "path": "packages/qwik/src/core/state/context.ts",
    "content": "import type { OnRenderFn } from '../component/component.public';\nimport { destroyTask, type SubscriberEffect } from '../use/use-task';\nimport type { QRLInternal } from '../qrl/qrl-class';\nimport type { QRL } from '../qrl/qrl.public';\nimport type { StyleAppend } from '../use/use-core';\nimport type { ProcessedJSXNode } from '../render/dom/render-dom';\nimport type { QwikElement, VirtualElement } from '../render/dom/virtual-element';\nimport { getProxyTarget, type SubscriptionManager } from './common';\nimport type { ContainerState } from '../container/container';\nimport { getDomListeners, type Listener } from './listeners';\nimport { seal } from '../util/qdev';\nimport { directGetAttribute } from '../render/fast-calls';\nimport { isElement } from '../../testing/html';\nimport { assertQwikElement } from '../error/assert';\nimport { QScopedStyle } from '../util/markers';\nimport { createPropsState, createProxy, setObjectFlags } from './store';\nimport { _IMMUTABLE, _IMMUTABLE_PREFIX, Q_CTX, QObjectImmutable } from './constants';\n\nexport interface QContextEvents {\n  [eventName: string]: QRL | undefined;\n}\n\nexport const HOST_FLAG_DIRTY = 1 << 0;\nexport const HOST_FLAG_NEED_ATTACH_LISTENER = 1 << 1;\nexport const HOST_FLAG_MOUNTED = 1 << 2;\nexport const HOST_FLAG_DYNAMIC = 1 << 3;\nexport const HOST_REMOVED = 1 << 4;\n\n/** Qwik Context of an element. */\nexport interface QContext {\n  /** VDOM element. */\n  $element$: QwikElement;\n  $refMap$: any[];\n  $flags$: number;\n  /** QId, for referenced components */\n  $id$: string;\n  /** Proxy for the component props */\n  $props$: Record<string, any> | null;\n  /** The QRL if this is `component$`-wrapped component. */\n  $componentQrl$: QRLInternal<OnRenderFn<any>> | null;\n  /** The event handlers for this element */\n  li: Listener[];\n  /** Sequential data store for hooks, managed by useSequentialScope. */\n  $seq$: any[] | null;\n  $tasks$: SubscriberEffect[] | null;\n  /** The public contexts defined on this (always Virtual) component, managed by useContextProvider. */\n  $contexts$: Map<string, any> | null;\n  $appendStyles$: StyleAppend[] | null;\n  $scopeIds$: string[] | null;\n  $vdom$: ProcessedJSXNode | null;\n  $slots$: ProcessedJSXNode[] | null;\n  $dynamicSlots$: QContext[] | null;\n  /**\n   * The Qwik Context of the virtual parent component, null if no parent. For an real element, it's\n   * the owner virtual component, and for a virtual component it's the wrapping virtual component.\n   */\n  $parentCtx$: QContext | null | undefined;\n  /**\n   * During SSR, separately store the actual parent of slotted components to correctly pause\n   * subscriptions\n   */\n  $realParentCtx$: QContext | undefined;\n}\n\nexport const tryGetContext = (element: QwikElement): QContext | undefined => {\n  return (element as any)[Q_CTX];\n};\n\nexport const getContext = (el: QwikElement, containerState: ContainerState): QContext => {\n  assertQwikElement(el);\n  const ctx = tryGetContext(el)!;\n  if (ctx) {\n    return ctx;\n  }\n  const elCtx = createContext(el);\n  const elementID = directGetAttribute(el, 'q:id');\n  if (elementID) {\n    const pauseCtx = containerState.$pauseCtx$;\n    elCtx.$id$ = elementID;\n    if (pauseCtx) {\n      const { getObject, meta, refs } = pauseCtx;\n      if (isElement(el)) {\n        const refMap = refs[elementID];\n        if (refMap) {\n          elCtx.$refMap$ = refMap.split(' ').map(getObject);\n          elCtx.li = getDomListeners(elCtx, containerState.$containerEl$);\n        }\n      } else {\n        const styleIds = el.getAttribute(QScopedStyle);\n        elCtx.$scopeIds$ = styleIds ? styleIds.split('|') : null;\n\n        const ctxMeta = meta[elementID];\n        if (ctxMeta) {\n          const seq = ctxMeta.s;\n          const host = ctxMeta.h;\n          const contexts = ctxMeta.c;\n          const tasks = ctxMeta.w;\n          if (seq) {\n            elCtx.$seq$ = seq.split(' ').map(getObject);\n          }\n          if (tasks) {\n            elCtx.$tasks$ = tasks.split(' ').map(getObject);\n          }\n          if (contexts) {\n            elCtx.$contexts$ = new Map();\n            for (const part of contexts.split(' ')) {\n              const [key, value] = part.split('=');\n              elCtx.$contexts$.set(key, getObject(value));\n            }\n          }\n\n          // Restore sequence scoping\n          if (host) {\n            const [renderQrl, props] = host.split(' ') as [string | undefined, string | undefined];\n            elCtx.$flags$ = HOST_FLAG_MOUNTED;\n            if (renderQrl) {\n              elCtx.$componentQrl$ = getObject(renderQrl);\n            }\n            if (props) {\n              const propsObj = getObject(props);\n              elCtx.$props$ = propsObj;\n              setObjectFlags(propsObj, QObjectImmutable);\n              propsObj[_IMMUTABLE] = getImmutableFromProps(propsObj);\n            } else {\n              elCtx.$props$ = createProxy(createPropsState(), containerState);\n            }\n          }\n        }\n      }\n    }\n  }\n\n  return elCtx;\n};\n\nconst getImmutableFromProps = (props: Record<string, any>): Record<string, any> => {\n  const immutable: Record<string, any> = {};\n  const target = getProxyTarget(props);\n  for (const key in target) {\n    if (key.startsWith(_IMMUTABLE_PREFIX)) {\n      immutable[key.slice(_IMMUTABLE_PREFIX.length)] = target[key];\n    }\n  }\n  return immutable;\n};\n\nexport const createContext = (element: Element | VirtualElement): QContext => {\n  const ctx = {\n    $flags$: 0,\n    $id$: '',\n    $element$: element,\n    $refMap$: [],\n    li: [],\n    $tasks$: null,\n    $seq$: null,\n    $slots$: null,\n    $scopeIds$: null,\n    $appendStyles$: null,\n    $props$: null,\n    $vdom$: null,\n    $componentQrl$: null,\n    $contexts$: null,\n    $dynamicSlots$: null,\n    $parentCtx$: undefined,\n    $realParentCtx$: undefined,\n  } as QContext;\n  seal(ctx);\n  (element as any)[Q_CTX] = ctx;\n  return ctx;\n};\n\nexport const cleanupContext = (elCtx: QContext, subsManager: SubscriptionManager) => {\n  elCtx.$tasks$?.forEach((task) => {\n    subsManager.$clearSub$(task);\n    destroyTask(task);\n  });\n  elCtx.$componentQrl$ = null;\n  elCtx.$seq$ = null;\n  elCtx.$tasks$ = null;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/state/listeners.ts",
    "content": "import { inflateQrl, parseQRL } from '../qrl/qrl';\nimport { assertQrl, isQrl, type QRLInternal } from '../qrl/qrl-class';\nimport { $ } from '../qrl/qrl.public';\nimport { isArray } from '../util/types';\nimport { assertTrue } from '../error/assert';\nimport { EMPTY_ARRAY } from '../util/flyweight';\nimport { qRuntimeQrl, qSerialize } from '../util/qdev';\nimport { fromCamelToKebabCase } from '../util/case';\nimport type { QContext } from './context';\nimport type { PossibleEvents } from '../use/use-core';\n\nconst ON_PROP_REGEX = /^(on|window:|document:)/;\n\n/** A QRL that will be called when the event occurs */\nexport type Listener = [\n  eventName: string,\n  qrl: QRLInternal<(event: PossibleEvents, elem?: Element) => any>,\n];\n\nexport const PREVENT_DEFAULT = 'preventdefault:';\n\nexport const isOnProp = (prop: string): boolean => {\n  return prop.endsWith('$') && ON_PROP_REGEX.test(prop);\n};\n\nexport const groupListeners = (listeners: Listener[]): Readonly<[string, Listener[1][]][]> => {\n  if (listeners.length === 0) {\n    return EMPTY_ARRAY as any;\n  }\n  if (listeners.length === 1) {\n    const listener = listeners[0];\n    return [[listener[0], [listener[1]]]];\n  }\n\n  const keys: string[] = [];\n  for (let i = 0; i < listeners.length; i++) {\n    const eventName = listeners[i][0];\n    if (!keys.includes(eventName)) {\n      keys.push(eventName);\n    }\n  }\n  return keys.map((eventName) => {\n    return [eventName, listeners.filter((l) => l[0] === eventName).map((a) => a[1])];\n  });\n};\n\nexport const setEvent = (\n  existingListeners: Listener[],\n  prop: string,\n  input: any,\n  containerEl: Element | undefined\n) => {\n  assertTrue(prop.endsWith('$'), 'render: event property does not end with $', prop);\n  prop = normalizeOnProp(prop.slice(0, -1));\n  if (input) {\n    if (isArray(input)) {\n      const processed = input\n        .flat(Infinity)\n        .filter((q) => q != null)\n        .map((q) => [prop, ensureQrl(q, containerEl)] as Listener);\n      existingListeners.push(...processed);\n    } else {\n      existingListeners.push([prop, ensureQrl(input, containerEl)]);\n    }\n  }\n  return prop;\n};\n\nconst PREFIXES = ['on', 'window:on', 'document:on'];\nconst SCOPED = ['on', 'on-window', 'on-document'];\n\nexport const normalizeOnProp = (prop: string) => {\n  let scope = 'on';\n  for (let i = 0; i < PREFIXES.length; i++) {\n    const prefix = PREFIXES[i];\n    if (prop.startsWith(prefix)) {\n      scope = SCOPED[i];\n      prop = prop.slice(prefix.length);\n      break;\n    }\n  }\n  if (prop.startsWith('-')) {\n    prop = fromCamelToKebabCase(prop.slice(1));\n  } else {\n    prop = prop.toLowerCase();\n  }\n  return scope + ':' + prop;\n};\n\nconst ensureQrl = <T = unknown>(value: any, containerEl: Element | undefined) => {\n  if (qSerialize && !qRuntimeQrl) {\n    assertQrl<T>(value);\n    value.$setContainer$(containerEl);\n    return value;\n  }\n  const qrl = isQrl<T>(value) ? value : ($(value) as QRLInternal<T>);\n  qrl.$setContainer$(containerEl);\n  return qrl;\n};\n\nexport const getDomListeners = (elCtx: QContext, containerEl: Element): Listener[] => {\n  const attributes = (elCtx.$element$ as Element).attributes;\n  const listeners: Listener[] = [];\n  for (let i = 0; i < attributes.length; i++) {\n    const { name, value } = attributes.item(i)!;\n    if (\n      name.startsWith('on:') ||\n      name.startsWith('on-window:') ||\n      name.startsWith('on-document:')\n    ) {\n      const urls = value.split('\\n');\n      for (const url of urls) {\n        const qrl = parseQRL(url, containerEl) as Listener[1];\n        if (qrl.$capture$) {\n          inflateQrl(qrl, elCtx);\n        }\n        listeners.push([name, qrl]);\n      }\n    }\n  }\n  return listeners;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/state/signal.ts",
    "content": "import { assertEqual, assertTrue } from '../error/assert';\nimport { tryGetInvokeContext } from '../use/use-core';\nimport { logWarn } from '../util/log';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { ComputedEvent, RenderEvent, ResourceEvent } from '../util/markers';\nimport { isObject } from '../util/types';\nimport type { ContainerState } from '../container/container';\nimport {\n  getSubscriptionManager,\n  getProxyTarget,\n  LocalSubscriptionManager,\n  type Subscriptions,\n  verifySerializable,\n} from './common';\nimport { QObjectManagerSymbol, _IMMUTABLE, _IMMUTABLE_PREFIX } from './constants';\nimport { _fnSignal } from '../qrl/inlined-fn';\n\n/**\n * A signal is a reactive value which can be read and written. When the signal is written, all tasks\n * which are tracking the signal will be re-run and all components that read the signal will be\n * re-rendered.\n *\n * Furthermore, when a signal value is passed as a prop to a component, the optimizer will\n * automatically forward the signal. This means that `return <div title={signal.value}>hi</div>`\n * will update the `title` attribute when the signal changes without having to re-render the\n * component.\n *\n * @public\n */\nexport interface Signal<T = any> {\n  value: T;\n}\n\n/** @public */\nexport type ReadonlySignal<T = unknown> = Readonly<Signal<T>>;\n\n/** @public */\nexport type ValueOrSignal<T> = T | Signal<T>;\n\n/** @internal */\nexport const _createSignal = <T>(\n  value: T,\n  containerState: ContainerState,\n  flags: number,\n  subscriptions?: Subscriptions[]\n): SignalInternal<T> => {\n  const manager = containerState.$subsManager$.$createManager$(subscriptions);\n  const signal = new SignalImpl<T>(value, manager, flags);\n  return signal;\n};\n\nexport const QObjectSignalFlags = Symbol('proxy manager');\n\nexport const SIGNAL_IMMUTABLE = 1 << 0;\nexport const SIGNAL_UNASSIGNED = 1 << 1;\n\nexport const SignalUnassignedException = Symbol('unassigned signal');\n\nexport interface SignalInternal<T> extends Signal<T> {\n  untrackedValue: T;\n  [QObjectManagerSymbol]: LocalSubscriptionManager;\n  [QObjectSignalFlags]: number;\n}\n\nexport class SignalBase {}\n\nexport class SignalImpl<T> extends SignalBase implements Signal<T> {\n  untrackedValue: T;\n  [QObjectManagerSymbol]: LocalSubscriptionManager;\n  [QObjectSignalFlags]: number = 0;\n\n  constructor(v: T, manager: LocalSubscriptionManager, flags: number) {\n    super();\n    this.untrackedValue = v;\n    this[QObjectManagerSymbol] = manager;\n    this[QObjectSignalFlags] = flags;\n  }\n\n  // prevent accidental use as value\n  valueOf() {\n    if (qDev) {\n      throw new TypeError('Cannot coerce a Signal, use `.value` instead');\n    }\n  }\n  toString() {\n    return `[Signal ${String(this.value)}]`;\n  }\n  toJSON() {\n    return { value: this.value };\n  }\n\n  get value() {\n    if (this[QObjectSignalFlags] & SIGNAL_UNASSIGNED) {\n      throw SignalUnassignedException;\n    }\n    const sub = tryGetInvokeContext()?.$subscriber$;\n    if (sub) {\n      this[QObjectManagerSymbol].$addSub$(sub);\n    }\n    return this.untrackedValue;\n  }\n\n  set value(v: T) {\n    if (qDev) {\n      if (this[QObjectSignalFlags] & SIGNAL_IMMUTABLE) {\n        throw new Error('Cannot mutate immutable signal');\n      }\n      if (qSerialize) {\n        verifySerializable(v);\n      }\n      const invokeCtx = tryGetInvokeContext();\n      if (invokeCtx) {\n        if (invokeCtx.$event$ === RenderEvent) {\n          logWarn(\n            'State mutation inside render function. Use useTask$() instead.',\n            invokeCtx.$hostElement$\n          );\n        } else if (invokeCtx.$event$ === ComputedEvent) {\n          logWarn(\n            'State mutation inside useComputed$() is an antipattern. Use useTask$() instead',\n            invokeCtx.$hostElement$\n          );\n        } else if (invokeCtx.$event$ === ResourceEvent) {\n          logWarn(\n            'State mutation inside useResource$() is an antipattern. Use useTask$() instead',\n            invokeCtx.$hostElement$\n          );\n        }\n      }\n    }\n    const manager = this[QObjectManagerSymbol];\n    const oldValue = this.untrackedValue;\n    if (manager && oldValue !== v) {\n      this.untrackedValue = v;\n      manager.$notifySubs$();\n    }\n  }\n}\n\nexport class SignalDerived<RETURN = unknown, ARGS extends any[] = unknown[]> extends SignalBase {\n  constructor(\n    public $func$: (...args: ARGS) => RETURN,\n    public $args$: ARGS,\n    public $funcStr$?: string\n  ) {\n    super();\n  }\n\n  get value(): RETURN {\n    return this.$func$.apply(undefined, this.$args$);\n  }\n}\n\nexport class SignalWrapper<T extends Record<string, any>, P extends keyof T> extends SignalBase {\n  constructor(\n    public ref: T,\n    public prop: P\n  ) {\n    super();\n  }\n\n  get [QObjectManagerSymbol]() {\n    return getSubscriptionManager(this.ref);\n  }\n\n  get value(): T[P] {\n    return this.ref[this.prop];\n  }\n\n  set value(value: T[P]) {\n    this.ref[this.prop] = value;\n  }\n}\n\n/**\n * Checks if a given object is a `Signal`.\n *\n * @param obj - The object to check if `Signal`.\n * @returns Boolean - True if the object is a `Signal`.\n * @public\n */\nexport const isSignal = <T = unknown>(obj: any): obj is Signal<T> => {\n  return obj instanceof SignalBase;\n};\n\n/** @internal */\nexport const _wrapProp = <T extends Record<any, any>, P extends keyof T>(obj: T, prop: P): any => {\n  if (!isObject(obj)) {\n    return obj[prop];\n  }\n  if (obj instanceof SignalBase) {\n    assertEqual(prop, 'value', 'Left side is a signal, prop must be value');\n    return obj;\n  }\n  const target = getProxyTarget(obj);\n  if (target) {\n    const signal = target[_IMMUTABLE_PREFIX + (prop as any)];\n    if (signal) {\n      assertTrue(isSignal(signal), `${_IMMUTABLE_PREFIX} has to be a signal kind`);\n      return signal;\n    }\n    if ((target as any)[_IMMUTABLE]?.[prop] !== true) {\n      return new SignalWrapper(obj, prop);\n    }\n  }\n  const immutable = (obj as any)[_IMMUTABLE]?.[prop];\n  if (isSignal(immutable)) {\n    return immutable;\n  }\n  return _IMMUTABLE;\n};\n\n/** @internal */\nexport const _wrapSignal = <T extends Record<any, any>, P extends keyof T>(\n  obj: T,\n  prop: P\n): any => {\n  const r = _wrapProp(obj, prop);\n  if (r === _IMMUTABLE) {\n    return obj[prop];\n  }\n  return r;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/state/store.ts",
    "content": "import { assertEqual, assertNumber, assertTrue } from '../error/assert';\nimport { qError, QError_immutableProps } from '../error/error';\nimport { tryGetInvokeContext } from '../use/use-core';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { ComputedEvent, RenderEvent, ResourceEvent } from '../util/markers';\nimport { isArray, isObject, isSerializableObject } from '../util/types';\nimport type { ContainerState } from '../container/container';\nimport {\n  fastSkipSerialize,\n  LocalSubscriptionManager,\n  type Subscriber,\n  type Subscriptions,\n  unwrapProxy,\n  verifySerializable,\n} from './common';\nimport { isSignal } from './signal';\nimport {\n  QObjectFlagsSymbol,\n  QObjectImmutable,\n  QObjectManagerSymbol,\n  QObjectRecursive,\n  QOjectTargetSymbol,\n  _IMMUTABLE,\n  _IMMUTABLE_PREFIX,\n} from './constants';\nimport { logError, logWarn } from '../util/log';\n\nexport type QObject<T extends {}> = T & { __brand__: 'QObject' };\n\n/** Creates a proxy that notifies of any writes. */\nexport const getOrCreateProxy = <T extends object>(\n  target: T,\n  containerState: ContainerState,\n  flags = 0\n): T => {\n  const proxy = containerState.$proxyMap$.get(target);\n  if (proxy) {\n    return proxy;\n  }\n  if (flags !== 0) {\n    setObjectFlags(target, flags);\n  }\n  return createProxy(target, containerState, undefined);\n};\n\nexport const createProxy = <T extends object>(\n  target: T,\n  containerState: ContainerState,\n  subs?: Subscriptions[]\n): T => {\n  assertEqual(unwrapProxy(target), target, 'Unexpected proxy at this location', target);\n  assertTrue(!containerState.$proxyMap$.has(target), 'Proxy was already created', target);\n  assertTrue(isObject(target), 'Target must be an object');\n  assertTrue(\n    isSerializableObject(target) || isArray(target),\n    'Target must be a serializable object'\n  );\n\n  const manager = containerState.$subsManager$.$createManager$(subs);\n  const proxy = new Proxy(target, new ReadWriteProxyHandler(containerState, manager)) as any as T;\n  containerState.$proxyMap$.set(target, proxy);\n  return proxy;\n};\n\nexport const createPropsState = (): Record<string, any> => {\n  const props = {};\n  setObjectFlags(props, QObjectImmutable);\n  return props;\n};\n\nexport const setObjectFlags = (obj: object, flags: number) => {\n  Object.defineProperty(obj, QObjectFlagsSymbol, { value: flags, enumerable: false });\n};\n\nexport type TargetType = Record<string | symbol, any>;\n\n/** @internal */\nexport const _restProps = (props: Record<string, any>, omit: string[]) => {\n  const rest: Record<string, any> = {};\n  for (const key in props) {\n    if (!omit.includes(key)) {\n      rest[key] = props[key];\n    }\n  }\n  return rest;\n};\n\nexport class ReadWriteProxyHandler implements ProxyHandler<TargetType> {\n  constructor(\n    private $containerState$: ContainerState,\n    private $manager$: LocalSubscriptionManager\n  ) {}\n\n  deleteProperty(target: TargetType, prop: string | symbol): boolean {\n    if (target[QObjectFlagsSymbol] & QObjectImmutable) {\n      throw qError(QError_immutableProps);\n    }\n    if (typeof prop != 'string' || !delete target[prop]) {\n      return false;\n    }\n    this.$manager$.$notifySubs$(isArray(target) ? undefined : prop);\n    return true;\n  }\n\n  get(target: TargetType, prop: string | symbol): any {\n    if (typeof prop === 'symbol') {\n      if (prop === QOjectTargetSymbol) {\n        return target;\n      }\n      if (prop === QObjectManagerSymbol) {\n        return this.$manager$;\n      }\n      return target[prop];\n    }\n    const flags = target[QObjectFlagsSymbol] ?? 0;\n    assertNumber(flags, 'flags must be an number');\n    const invokeCtx = tryGetInvokeContext();\n    const recursive = (flags & QObjectRecursive) !== 0;\n    const immutable = (flags & QObjectImmutable) !== 0;\n    const hiddenSignal = target[_IMMUTABLE_PREFIX + prop];\n    let subscriber: Subscriber | undefined | null;\n    let value;\n    if (invokeCtx) {\n      subscriber = invokeCtx.$subscriber$;\n    }\n    if (immutable && (!(prop in target) || immutableValue(target[_IMMUTABLE]?.[prop]))) {\n      subscriber = null;\n    }\n    if (hiddenSignal) {\n      assertTrue(isSignal(hiddenSignal), '$$ prop must be a signal');\n      value = hiddenSignal.value;\n      subscriber = null;\n    } else {\n      value = target[prop];\n    }\n    if (subscriber) {\n      const isA = isArray(target);\n      this.$manager$.$addSub$(subscriber, isA ? undefined : prop);\n    }\n    return recursive ? wrap(value, this.$containerState$) : value;\n  }\n\n  set(target: TargetType, prop: string | symbol, newValue: any): boolean {\n    if (typeof prop === 'symbol') {\n      target[prop] = newValue;\n      return true;\n    }\n    const flags = target[QObjectFlagsSymbol] ?? 0;\n    assertNumber(flags, 'flags must be an number');\n    const immutable = (flags & QObjectImmutable) !== 0;\n    if (immutable) {\n      throw qError(QError_immutableProps);\n    }\n    const recursive = (flags & QObjectRecursive) !== 0;\n    const unwrappedNewValue = recursive ? unwrapProxy(newValue) : newValue;\n    if (qDev) {\n      if (qSerialize) {\n        verifySerializable(unwrappedNewValue);\n      }\n      const invokeCtx = tryGetInvokeContext();\n      if (invokeCtx) {\n        if (invokeCtx.$event$ === RenderEvent) {\n          logError(\n            'State mutation inside render function. Move mutation to useTask$() or useVisibleTask$()',\n            prop\n          );\n        } else if (invokeCtx.$event$ === ComputedEvent) {\n          logWarn(\n            'State mutation inside useComputed$() is an antipattern. Use useTask$() instead',\n            invokeCtx.$hostElement$\n          );\n        } else if (invokeCtx.$event$ === ResourceEvent) {\n          logWarn(\n            'State mutation inside useResource$() is an antipattern. Use useTask$() instead',\n            invokeCtx.$hostElement$\n          );\n        }\n      }\n    }\n    const isA = isArray(target);\n    if (isA) {\n      target[prop as any] = unwrappedNewValue;\n      this.$manager$.$notifySubs$();\n      return true;\n    }\n\n    const oldValue = target[prop];\n    target[prop] = unwrappedNewValue;\n    if (oldValue !== unwrappedNewValue) {\n      this.$manager$.$notifySubs$(prop);\n    }\n    return true;\n  }\n\n  has(target: TargetType, prop: string | symbol): boolean {\n    if (prop === QOjectTargetSymbol) {\n      return true;\n    }\n    const invokeCtx = tryGetInvokeContext();\n    if (typeof prop === 'string' && invokeCtx) {\n      const subscriber = invokeCtx.$subscriber$;\n      if (subscriber) {\n        const isA = isArray(target);\n        this.$manager$.$addSub$(subscriber, isA ? undefined : prop);\n      }\n    }\n    const hasOwnProperty = Object.prototype.hasOwnProperty;\n    if (hasOwnProperty.call(target, prop)) {\n      return true;\n    }\n    if (typeof prop === 'string' && hasOwnProperty.call(target, _IMMUTABLE_PREFIX + prop)) {\n      return true;\n    }\n    return false;\n  }\n\n  ownKeys(target: TargetType): ArrayLike<string | symbol> {\n    const flags = target[QObjectFlagsSymbol] ?? 0;\n    assertNumber(flags, 'flags must be an number');\n    const immutable = (flags & QObjectImmutable) !== 0;\n    if (!immutable) {\n      let subscriber: Subscriber | null | undefined = null;\n      const invokeCtx = tryGetInvokeContext();\n      if (invokeCtx) {\n        subscriber = invokeCtx.$subscriber$;\n      }\n      if (subscriber) {\n        this.$manager$.$addSub$(subscriber);\n      }\n    }\n    if (isArray(target)) {\n      return Reflect.ownKeys(target);\n    }\n    return Reflect.ownKeys(target).map((a) => {\n      return typeof a === 'string' && a.startsWith(_IMMUTABLE_PREFIX)\n        ? a.slice(_IMMUTABLE_PREFIX.length)\n        : a;\n    });\n  }\n  getOwnPropertyDescriptor(\n    target: TargetType,\n    prop: string | symbol\n  ): PropertyDescriptor | undefined {\n    const descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n    if (isArray(target) || typeof prop === 'symbol') {\n      return descriptor;\n    }\n\n    if (descriptor && !descriptor.configurable) {\n      return descriptor;\n    }\n\n    return {\n      enumerable: true,\n      configurable: true,\n    };\n  }\n}\n\nconst immutableValue = (value: any) => {\n  return value === _IMMUTABLE || isSignal(value);\n};\n\nconst wrap = <T>(value: T, containerState: ContainerState): T => {\n  if (isObject(value)) {\n    if (Object.isFrozen(value)) {\n      return value;\n    }\n    const nakedValue = unwrapProxy(value);\n    if (nakedValue !== value) {\n      // already a proxy return;\n      return value;\n    }\n    if (fastSkipSerialize(nakedValue)) {\n      return value;\n    }\n    if (isSerializableObject(nakedValue) || isArray(nakedValue)) {\n      const proxy = containerState.$proxyMap$.get(nakedValue);\n      return proxy ? proxy : getOrCreateProxy(nakedValue as any, containerState, QObjectRecursive);\n    }\n  }\n  return value;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/style/qrl-styles.ts",
    "content": "import { ComponentStylesPrefixContent } from '../util/markers';\nimport { hashCode } from '../util/hash_code';\nimport type { QRL } from '../qrl/qrl.public';\nimport { assertQrl } from '../qrl/qrl-class';\n\nexport const styleKey = (qStyles: QRL<string>, index: number): string => {\n  assertQrl(qStyles);\n  return `${hashCode(qStyles.$hash$)}-${index}`;\n};\n\nexport const styleHost = (styleId: string): string => {\n  return styleId;\n};\n\nexport const styleContent = (styleId: string): string => {\n  return ComponentStylesPrefixContent + styleId;\n};\n\nexport const serializeSStyle = (scopeIds: string[]) => {\n  const value = scopeIds.join('|');\n  if (value.length > 0) {\n    return value;\n  }\n  return undefined;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/style/scoped-stylesheet.ts",
    "content": "/* eslint-disable no-console */\nimport { ComponentStylesPrefixContent } from '../util/markers';\nimport { qDev } from '../util/qdev';\n\n// Make sure this is always set to `false` in production, but it is useful to set for `true` in development for debugging.\nconst DEBUG: boolean = false;\n\nexport const STYLE_CACHE = /*#__PURE__*/ new Map();\n\nexport const getScopedStyles = (css: string, scopeId: string): string => {\n  if (qDev) {\n    return scopeStylesheet(css, scopeId);\n  }\n  let styleCss = STYLE_CACHE.get(scopeId);\n  if (!styleCss) {\n    STYLE_CACHE.set(scopeId, (styleCss = scopeStylesheet(css, scopeId)));\n  }\n  return styleCss;\n};\n\nexport const scopeStylesheet = (css: string, scopeId: string): string => {\n  const end = css.length;\n  const out: string[] = [];\n  const stack: number[] = [];\n  let idx = 0;\n  let lastIdx = idx;\n  let mode: number = rule;\n  let lastCh = 0;\n  DEBUG && console.log('--------------------------');\n  while (idx < end) {\n    DEBUG && console.log(css);\n    DEBUG && console.log(new Array(idx).fill(' ').join('') + '^');\n    DEBUG && console.log('MODE', ...stack.map(modeToString), modeToString(mode));\n    const chIdx = idx;\n    let ch = css.charCodeAt(idx++);\n    if (ch === BACKSLASH) {\n      idx++;\n      ch = A; // Pretend it's a letter\n    }\n    const arcs = STATE_MACHINE[mode];\n    for (let i = 0; i < arcs.length; i++) {\n      const arc = arcs[i];\n      const [expectLastCh, expectCh, newMode] = arc;\n      if (\n        expectLastCh === lastCh ||\n        expectLastCh === ANY ||\n        (expectLastCh === IDENT && isIdent(lastCh)) ||\n        (expectLastCh === WHITESPACE && isWhiteSpace(lastCh))\n      ) {\n        if (\n          expectCh === ch ||\n          expectCh === ANY ||\n          (expectCh === IDENT && isIdent(ch)) ||\n          (expectCh === NOT_IDENT && !isIdent(ch) && ch !== DOT) ||\n          (expectCh === WHITESPACE && isWhiteSpace(ch))\n        ) {\n          if (arc.length == 3 || lookAhead(arc)) {\n            if (arc.length > 3) {\n              // If matched on lookAhead than we we have to update current `ch`\n              ch = css.charCodeAt(idx - 1);\n            }\n            DEBUG &&\n              console.log(\n                'MATCH',\n                charToString(expectLastCh),\n                charToString(expectCh),\n                modeToString(newMode)\n              );\n            // We found a match!\n            if (newMode === EXIT || newMode == EXIT_INSERT_SCOPE) {\n              if (newMode === EXIT_INSERT_SCOPE) {\n                if (mode === starSelector && !shouldNotInsertScoping()) {\n                  // Replace `*` with the scoping elementClassIdSelector.\n                  if (isChainedSelector(ch)) {\n                    // *foo\n                    flush(idx - 2);\n                  } else {\n                    // * (by itself)\n                    insertScopingSelector(idx - 2);\n                  }\n                  lastIdx++;\n                } else {\n                  if (!isChainedSelector(ch)) {\n                    // We are exiting one of the Selector so we may need to\n                    const offset =\n                      expectCh == NOT_IDENT ? 1 : expectCh == CLOSE_PARENTHESIS ? 2 : 0;\n                    insertScopingSelector(idx - offset);\n                  }\n                }\n              }\n              if (expectCh === NOT_IDENT) {\n                // NOT_IDENT is not a real character more like lack of what we expected.\n                // if pseudoGlobal we need to give it a chance to exit as well.\n                // For this reason we need to reparse the last character again.\n                idx--;\n                ch = lastCh;\n              }\n              do {\n                mode = stack.pop() || rule;\n                if (mode === pseudoGlobal) {\n                  // Skip over the `)` in `:global(...)`.\n                  flush(idx - 1);\n                  lastIdx++;\n                }\n              } while (isSelfClosingRule(mode));\n            } else {\n              stack.push(mode);\n              if (mode === pseudoGlobal && newMode === rule) {\n                flush(idx - 8); // `:global(`.length\n                lastIdx = idx; // skip over \":global(\"\n              } else if (newMode === pseudoElement) {\n                // We are entering pseudoElement `::foo`; insert scoping in front of it.\n                insertScopingSelector(chIdx);\n              }\n              mode = newMode;\n              ch == SPACE; // Pretend not an identifier so that we don't flush again on elementClassIdSelector\n            }\n            break; // get out of the for loop as we found a match\n          }\n        }\n      }\n    }\n    lastCh = ch;\n  }\n  flush(idx);\n  return out.join('');\n\n  function flush(idx: number) {\n    out.push(css.substring(lastIdx, idx));\n    DEBUG && console.log('FLUSH', out.join(''));\n    lastIdx = idx;\n  }\n  function insertScopingSelector(idx: number) {\n    if (mode === pseudoGlobal || shouldNotInsertScoping()) {\n      return;\n    }\n\n    flush(idx);\n    out.push('.', ComponentStylesPrefixContent, scopeId);\n    DEBUG && console.log('INSERT', out.join(''));\n  }\n  function lookAhead(arc: StateArc): boolean {\n    let prefix = 0; // Ignore vendor prefixes such as `-webkit-`.\n    if (css.charCodeAt(idx) === DASH) {\n      for (let i = 1; i < 10; i++) {\n        // give up after 10 characters\n        if (css.charCodeAt(idx + i) === DASH) {\n          prefix = i + 1;\n          break;\n        }\n      }\n    }\n    words: for (let arcIndx = 3; arcIndx < arc.length; arcIndx++) {\n      const txt = arc[arcIndx] as string;\n      for (let i = 0; i < txt.length; i++) {\n        if ((css.charCodeAt(idx + i + prefix) | LOWERCASE) !== txt.charCodeAt(i)) {\n          continue words;\n        }\n      }\n      // we found a match;\n      idx += txt.length + prefix;\n      return true;\n    }\n    return false;\n  }\n\n  function shouldNotInsertScoping(): boolean {\n    return stack.indexOf(pseudoGlobal) !== -1 || stack.indexOf(atRuleSelector) !== -1;\n  }\n};\n\nconst isIdent = (ch: number): boolean => {\n  return (\n    (ch >= _0 && ch <= _9) ||\n    (ch >= A && ch <= Z) ||\n    (ch >= a && ch <= z) ||\n    ch >= 0x80 ||\n    ch === UNDERSCORE ||\n    ch === DASH\n  );\n};\n\nconst isChainedSelector = (ch: number): boolean => {\n  return ch === COLON || ch === DOT || ch === OPEN_BRACKET || ch === HASH || isIdent(ch);\n};\n\nconst isSelfClosingRule = (mode: number): boolean => {\n  return (\n    mode === atRuleBlock || mode === atRuleSelector || mode === atRuleInert || mode === pseudoGlobal\n  );\n};\n\nconst isWhiteSpace = (ch: number): boolean => {\n  return ch === SPACE || ch === TAB || ch === NEWLINE || ch === CARRIAGE_RETURN;\n};\n\nconst modeToString = (mode: number): string => {\n  return [\n    'rule',\n    'elementClassIdSelector',\n    'starSelector',\n    'pseudoClassWithSelector',\n    'pseudoClass',\n    'pseudoGlobal',\n    'pseudoElement',\n    'attrSelector',\n    'inertParenthesis',\n    'inertBlock',\n    'atRuleSelector',\n    'atRuleBlock',\n    'atInert',\n    'body',\n    'stringSingle',\n    'stringDouble',\n    'commentMultiline',\n    'EXIT',\n    'EXIT_INSERT_SCOPE',\n  ][mode];\n};\n\nconst charToString = (ch: number): string => {\n  return ['ANY', 'IDENT', 'NOT_IDENT', 'WHITESPACE'][ch] || String.fromCharCode(ch);\n};\n\nconst rule = 0; // top level initial space.\nconst elementClassIdSelector = 1; // .elementClassIdSelector {}\nconst starSelector = 2; // * {}\nconst pseudoClassWithSelector = 3; // :pseudoClass(elementClassIdSelector) {}\nconst pseudoClass = 4; // :pseudoClass {}\nconst pseudoGlobal = 5; // :global(elementClassIdSelector)\nconst pseudoElement = 6; // ::pseudoElement {}\nconst attrSelector = 7; // [attr] {}\nconst inertParenthesis = 8; // (ignored)\nconst inertBlock = 9; // {ignored}\nconst atRuleSelector = 10; // @keyframe elementClassIdSelector {}\nconst atRuleBlock = 11; // @media {elementClassIdSelector {}}\nconst atRuleInert = 12; // @atRule something;\nconst body = 13; // .elementClassIdSelector {body}\nconst stringSingle = 14; // 'text'\nconst stringDouble = 15; // 'text'\nconst commentMultiline = 16; // /* ... */\n// NOT REAL MODES\nconst EXIT = 17; // Exit the mode\nconst EXIT_INSERT_SCOPE = 18; // Exit the mode INSERT SCOPE\n\nconst ANY = 0;\nconst IDENT = 1;\nconst NOT_IDENT = 2;\nconst WHITESPACE = 3;\nconst TAB = 9; // `\\t`.charCodeAt(0);\nconst NEWLINE = 10; // `\\n`.charCodeAt(0);\nconst CARRIAGE_RETURN = 13; // `\\r`.charCodeAt(0);\nconst SPACE = 32; // ` `.charCodeAt(0);\nconst DOUBLE_QUOTE = 34; // `\"`.charCodeAt(0);\nconst HASH = 35; // `#`.charCodeAt(0);\nconst SINGLE_QUOTE = 39; // `'`.charCodeAt(0);\nconst OPEN_PARENTHESIS = 40; // `(`.charCodeAt(0);\nconst CLOSE_PARENTHESIS = 41; // `)`.charCodeAt(0);\nconst STAR = 42; // `*`.charCodeAt(0);\n// const COMMA = 44; // `,`.charCodeAt(0);\nconst DASH = 45; // `-`.charCodeAt(0);\nconst DOT = 46; // `.`.charCodeAt(0);\nconst FORWARD_SLASH = 47; // `/`.charCodeAt(0);\nconst _0 = 48; // `0`.charCodeAt(0);\nconst _9 = 57; // `9`.charCodeAt(0);\nconst COLON = 58; // `:`.charCodeAt(0);\nconst SEMICOLON = 59; // `;`.charCodeAt(0);\n// const LESS_THAN = 60; // `<`.charCodeAt(0);\nconst AT = 64; // `@`.charCodeAt(0);\nconst A = 65; // `A`.charCodeAt(0);\nconst Z = 90; // `Z`.charCodeAt(0);\nconst OPEN_BRACKET = 91; // `[`.charCodeAt(0);\nconst CLOSE_BRACKET = 93; // `]`.charCodeAt(0);\nconst BACKSLASH = 92; // `\\\\`.charCodeAt(0);\nconst UNDERSCORE = 95; // `_`.charCodeAt(0);\nconst LOWERCASE = 0x20; // `a`.charCodeAt(0);\nconst a = 97; // `a`.charCodeAt(0);\n// const d = 100; // `d`.charCodeAt(0);\n// const g = 103; // 'g'.charCodeAt(0);\n// const h = 104; // `h`.charCodeAt(0);\n// const i = 105; // `i`.charCodeAt(0);\n// const l = 108; // `l`.charCodeAt(0);\n// const t = 116; // `t`.charCodeAt(0);\nconst z = 122; // `z`.charCodeAt(0);\nconst OPEN_BRACE = 123; // `{`.charCodeAt(0);\nconst CLOSE_BRACE = 125; // `}`.charCodeAt(0);\n\ntype StateArc = [\n  /// If the last character is this:\n  number,\n  /// If the current character is this:\n  number,\n  /// Then transition to this state:\n  number,\n  /// Optional look ahead strings\n  ...string[],\n];\n\nconst STRINGS_COMMENTS: StateArc[] = /*__PURE__*/ (() => [\n  [ANY, SINGLE_QUOTE, stringSingle],\n  [ANY, DOUBLE_QUOTE, stringDouble],\n  [ANY, FORWARD_SLASH, commentMultiline, '*'],\n])();\n\nconst STATE_MACHINE: StateArc[][] = /*__PURE__*/ (() => [\n  [\n    /// rule\n    [ANY, STAR, starSelector],\n    [ANY, OPEN_BRACKET, attrSelector],\n    [ANY, COLON, pseudoElement, ':', 'before', 'after', 'first-letter', 'first-line'],\n    [ANY, COLON, pseudoGlobal, 'global'],\n    [\n      ANY,\n      COLON,\n      pseudoClassWithSelector,\n      'has',\n      'host-context',\n      'not',\n      'where',\n      'is',\n      'matches',\n      'any',\n    ],\n    [ANY, COLON, pseudoClass],\n    [ANY, IDENT, elementClassIdSelector],\n    [ANY, DOT, elementClassIdSelector],\n    [ANY, HASH, elementClassIdSelector],\n    [ANY, AT, atRuleSelector, 'keyframe'],\n    [ANY, AT, atRuleBlock, 'media', 'supports', 'container'],\n    [ANY, AT, atRuleInert],\n    [ANY, OPEN_BRACE, body],\n    [FORWARD_SLASH, STAR, commentMultiline],\n    [ANY, SEMICOLON, EXIT],\n    [ANY, CLOSE_BRACE, EXIT],\n    [ANY, CLOSE_PARENTHESIS, EXIT],\n    ...STRINGS_COMMENTS,\n  ],\n  [\n    /// elementClassIdSelector\n    [ANY, NOT_IDENT, EXIT_INSERT_SCOPE],\n  ],\n  [\n    /// starSelector\n    [ANY, NOT_IDENT, EXIT_INSERT_SCOPE],\n  ],\n  [\n    /// pseudoClassWithSelector\n    [ANY, OPEN_PARENTHESIS, rule],\n    [ANY, NOT_IDENT, EXIT_INSERT_SCOPE],\n  ],\n  [\n    /// pseudoClass\n    [ANY, OPEN_PARENTHESIS, inertParenthesis],\n    [ANY, NOT_IDENT, EXIT_INSERT_SCOPE],\n  ],\n  [\n    /// pseudoGlobal\n    [ANY, OPEN_PARENTHESIS, rule],\n    [ANY, NOT_IDENT, EXIT],\n  ],\n  [\n    /// pseudoElement\n    [ANY, NOT_IDENT, EXIT],\n  ],\n  [\n    /// attrSelector\n    [ANY, CLOSE_BRACKET, EXIT_INSERT_SCOPE],\n    [ANY, SINGLE_QUOTE, stringSingle],\n    [ANY, DOUBLE_QUOTE, stringDouble],\n  ],\n  [\n    /// inertParenthesis\n    [ANY, CLOSE_PARENTHESIS, EXIT],\n    ...STRINGS_COMMENTS,\n  ],\n  [\n    /// inertBlock\n    [ANY, CLOSE_BRACE, EXIT],\n    ...STRINGS_COMMENTS,\n  ],\n  [\n    /// atRuleSelector\n    [ANY, CLOSE_BRACE, EXIT],\n    [WHITESPACE, IDENT, elementClassIdSelector],\n    [ANY, COLON, pseudoGlobal, 'global'],\n    [ANY, OPEN_BRACE, body],\n    ...STRINGS_COMMENTS,\n  ],\n  [\n    /// atRuleBlock\n    [ANY, OPEN_BRACE, rule],\n    [ANY, SEMICOLON, EXIT],\n    ...STRINGS_COMMENTS,\n  ],\n  [\n    /// atRuleInert\n    [ANY, SEMICOLON, EXIT],\n    [ANY, OPEN_BRACE, inertBlock],\n    ...STRINGS_COMMENTS,\n  ],\n  [\n    /// body\n    [ANY, CLOSE_BRACE, EXIT],\n    [ANY, OPEN_BRACE, body],\n    [ANY, OPEN_PARENTHESIS, inertParenthesis],\n    ...STRINGS_COMMENTS,\n  ],\n  [\n    /// stringSingle\n    [ANY, SINGLE_QUOTE, EXIT],\n  ],\n  [\n    /// stringDouble\n    [ANY, DOUBLE_QUOTE, EXIT],\n  ],\n  [\n    /// commentMultiline\n    [STAR, FORWARD_SLASH, EXIT],\n  ],\n])();\n"
  },
  {
    "path": "packages/qwik/src/core/style/scoped-stylesheet.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { scopeStylesheet } from './scoped-stylesheet';\n\ntest('selectors', () => {\n  assert.equal(scopeStylesheet('div {}', '_'), 'div.⭐️_ {}');\n  assert.equal(scopeStylesheet('div {}div{} div {}', '_'), 'div.⭐️_ {}div.⭐️_{} div.⭐️_ {}');\n  assert.equal(scopeStylesheet('div, p {}', '_'), 'div.⭐️_, p.⭐️_ {}');\n\n  assert.equal(scopeStylesheet('div p {}', '_'), 'div.⭐️_ p.⭐️_ {}');\n  assert.equal(scopeStylesheet('div > p {}', '_'), 'div.⭐️_ > p.⭐️_ {}');\n  assert.equal(scopeStylesheet('div + p {}', '_'), 'div.⭐️_ + p.⭐️_ {}');\n  assert.equal(scopeStylesheet('div ~ p {}', '_'), 'div.⭐️_ ~ p.⭐️_ {}');\n\n  assert.equal(scopeStylesheet('.red {}', '_'), '.red.⭐️_ {}');\n  assert.equal(scopeStylesheet('div.red {}', '_'), 'div.red.⭐️_ {}');\n});\ntest('unicode', () => {\n  assert.equal(scopeStylesheet('.miško{}', '_'), '.miško.⭐️_{}');\n});\ntest('selectors with *', () => {\n  assert.equal(scopeStylesheet('* {}', '_'), '.⭐️_ {}');\n  assert.equal(scopeStylesheet('.red * {}', '_'), '.red.⭐️_ .⭐️_ {}');\n  assert.equal(scopeStylesheet('#red * {}', '_'), '#red.⭐️_ .⭐️_ {}');\n});\n\ntest('selectors with chains', () => {\n  assert.equal(scopeStylesheet('.red.text {}', '_'), '.red.text.⭐️_ {}');\n\n  assert.equal(scopeStylesheet('#red {}', '_'), '#red.⭐️_ {}');\n  assert.equal(scopeStylesheet('div#red {}', '_'), 'div#red.⭐️_ {}');\n\n  assert.equal(scopeStylesheet('div { }', '_'), 'div.⭐️_ { }');\n  assert.equal(scopeStylesheet('div {}', '_'), 'div.⭐️_ {}');\n  assert.equal(\n    scopeStylesheet('div {background-color: blue; }', '_'),\n    'div.⭐️_ {background-color: blue; }'\n  );\n  assert.equal(\n    scopeStylesheet('div { color: red !important; }', '_'),\n    'div.⭐️_ { color: red !important; }'\n  );\n  assert.equal(scopeStylesheet('div{color:red;}', '_'), 'div.⭐️_{color:red;}');\n  assert.equal(scopeStylesheet('div { content: \"}\"; }', '_'), 'div.⭐️_ { content: \"}\"; }');\n  assert.equal(scopeStylesheet(\"div { content: '}'; }\", '_'), \"div.⭐️_ { content: '}'; }\");\n});\n\ntest('attribute selectors', () => {\n  assert.equal(scopeStylesheet('*[a]{}', '_'), '[a].⭐️_{}');\n  assert.equal(scopeStylesheet('*[a] {}', '_'), '[a].⭐️_ {}');\n  assert.equal(scopeStylesheet('*[target] span {}', '_'), '[target].⭐️_ span.⭐️_ {}');\n\n  assert.equal(scopeStylesheet('a[target] {}', '_'), 'a[target].⭐️_ {}');\n  assert.equal(scopeStylesheet('a[target=\"_blank\"] {}', '_'), 'a[target=\"_blank\"].⭐️_ {}');\n  assert.equal(scopeStylesheet('input[type=\"button\"] {}', '_'), 'input[type=\"button\"].⭐️_ {}');\n\n  assert.equal(scopeStylesheet('a[title~=\"red\"] {}', '_'), 'a[title~=\"red\"].⭐️_ {}');\n  assert.equal(scopeStylesheet('a[class^=\"red\"] {}', '_'), 'a[class^=\"red\"].⭐️_ {}');\n  assert.equal(scopeStylesheet('a[class|=\"red\"] {}', '_'), 'a[class|=\"red\"].⭐️_ {}');\n  assert.equal(scopeStylesheet('a[class*=\"red\"] {}', '_'), 'a[class*=\"red\"].⭐️_ {}');\n  assert.equal(scopeStylesheet('a[class$=\"red\"] {}', '_'), 'a[class$=\"red\"].⭐️_ {}');\n});\n\ntest('pseudo classes', () => {\n  assert.equal(scopeStylesheet('p:lang(en) {}', '_'), 'p:lang(en).⭐️_ {}');\n  assert.equal(scopeStylesheet('a:link {}', '_'), 'a:link.⭐️_ {}');\n  assert.equal(scopeStylesheet('p:nth-child(2) {}', '_'), 'p:nth-child(2).⭐️_ {}');\n  assert.equal(scopeStylesheet('p:nth-child(3n+1) {}', '_'), 'p:nth-child(3n+1).⭐️_ {}');\n});\ntest('pseudo classes without selector', () => {\n  assert.equal(scopeStylesheet(':root {}', '_'), ':root.⭐️_ {}');\n});\ntest('pseudo selector with negation', () => {\n  assert.equal(scopeStylesheet('p:not(.blue) {}', '_'), 'p:not(.blue.⭐️_).⭐️_ {}');\n});\ntest('pseudo selector with :nth', () => {\n  assert.equal(\n    scopeStylesheet('p:nth-child(3n+1):hover {}', '_'),\n    'p:nth-child(3n+1):hover.⭐️_ {}'\n  );\n  assert.equal(\n    scopeStylesheet('p:nth-child(3n+1) div {}', '_'),\n    'p:nth-child(3n+1).⭐️_ div.⭐️_ {}'\n  );\n});\n\ntest('pseudo elements', () => {\n  assert.equal(scopeStylesheet('::selection {}', '_'), '.⭐️_::selection {}');\n  assert.equal(scopeStylesheet(' ::space {}', '_'), ' .⭐️_::space {}');\n\n  assert.equal(scopeStylesheet('a::before {}', '_'), 'a.⭐️_::before {}');\n  assert.equal(scopeStylesheet('a::after {}', '_'), 'a.⭐️_::after {}');\n\n  assert.equal(scopeStylesheet('a::first-line {}', '_'), 'a.⭐️_::first-line {}');\n\n  assert.equal(scopeStylesheet('a.red::before {}', '_'), 'a.red.⭐️_::before {}');\n  assert.equal(scopeStylesheet('a.red span::before {}', '_'), 'a.red.⭐️_ span.⭐️_::before {}');\n  ['before', 'after', 'first-letter', 'first-line'].forEach((selector) => {\n    assert.equal(scopeStylesheet(`:${selector} {}`, '_'), `.⭐️_:${selector} {}`);\n    assert.equal(scopeStylesheet(`a:${selector} {}`, '_'), `a.⭐️_:${selector} {}`);\n  });\n});\n\ntest('complex properties', () => {\n  assert.equal(\n    scopeStylesheet('div { background: #D0E4F5 url(\"./bg.jpg\") no-repeat scroll 0 0; }', '_'),\n    'div.⭐️_ { background: #D0E4F5 url(\"./bg.jpg\") no-repeat scroll 0 0; }'\n  );\n\n  assert.equal(\n    scopeStylesheet(\n      'div { background: -webkit-linear-gradient(left, #1C6EA4 0%, #2388CB 50%, #144E75 100%); }',\n      '_'\n    ),\n    'div.⭐️_ { background: -webkit-linear-gradient(left, #1C6EA4 0%, #2388CB 50%, #144E75 100%); }'\n  );\n});\n\ntest('@keyframe', () => {\n  assert.equal(\n    scopeStylesheet('@keyframes slidein {from{b:c(0%);}to{b:c(0%);}}', '_'),\n    '@keyframes slidein {from{b:c(0%);}to{b:c(0%);}}'\n  );\n  assert.equal(\n    scopeStylesheet('@-prefix-keyframes slidein {from{b:c(0%);}to{b:c(0%);}}', '_'),\n    '@-prefix-keyframes slidein {from{b:c(0%);}to{b:c(0%);}}'\n  );\n});\n\ntest('animation-name', () => {\n  assert.equal(scopeStylesheet('p{animation-name: x}', '_'), 'p.⭐️_{animation-name: x}');\n});\n\ntest('animation', () => {\n  assert.equal(scopeStylesheet('p{animation: a b c }', '_'), 'p.⭐️_{animation: a b c }');\n});\n\ntest('@font-face', () => {\n  assert.equal(\n    scopeStylesheet(\n      '@font-face { font-family: \"Open Sans\"; src: url(\"/fonts/OpenSans-Regular-webfont.woff2\") format(\"woff2\"), url(\"/fonts/OpenSans-Regular-webfont.woff\") format(\"woff\"); }',\n      '_'\n    ),\n    '@font-face { font-family: \"Open Sans\"; src: url(\"/fonts/OpenSans-Regular-webfont.woff2\") format(\"woff2\"), url(\"/fonts/OpenSans-Regular-webfont.woff\") format(\"woff\"); }'\n  );\n});\n\ntest('@media', () => {\n  assert.equal(\n    scopeStylesheet('@media screen and (min-width: 900px) { div {} }', '_'),\n    '@media screen and (min-width: 900px) { div.⭐️_ {} }'\n  );\n});\n\ntest('@container', () => {\n  assert.equal(\n    scopeStylesheet('@container (min-width: 1px) { div {} span {} }', '_'),\n    '@container (min-width: 1px) { div.⭐️_ {} span.⭐️_ {} }'\n  );\n});\n\ntest('@supports', () => {\n  assert.equal(\n    scopeStylesheet(\n      '@supports (display: flex) { @media screen and (min-width: 900px) { div {} } }',\n      '_'\n    ),\n    '@supports (display: flex) { @media screen and (min-width: 900px) { div.⭐️_ {} } }'\n  );\n});\n\ntest('@supports nested', () => {\n  assert.equal(scopeStylesheet('@media screen(a:1){}div{}', '_'), '@media screen(a:1){}div.⭐️_{}');\n\n  assert.equal(\n    scopeStylesheet('@supports(d:b){div{}@media screen(a:1){div{}}div{}}', '_'),\n    '@supports(d:b){div.⭐️_{}@media screen(a:1){div.⭐️_{}}div.⭐️_{}}'\n  );\n\n  assert.equal(\n    scopeStylesheet('@supports not (not (transform-origin: 2px)) { div {} }', '_'),\n    '@supports not (not (transform-origin: 2px)) { div.⭐️_ {} }'\n  );\n  assert.equal(\n    scopeStylesheet('@supports (display: grid) and (not (display: inline-grid)) { div {} }', '_'),\n    '@supports (display: grid) and (not (display: inline-grid)) { div.⭐️_ {} }'\n  );\n\n  assert.equal(\n    scopeStylesheet(\n      '@supports ((perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px)) { div {} }',\n      '_'\n    ),\n    '@supports ((perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px)) { div.⭐️_ {} }'\n  );\n});\n\ntest('comments', () => {\n  assert.equal(scopeStylesheet('div {} /* comment */', '_'), 'div.⭐️_ {} /* comment */');\n  assert.equal(scopeStylesheet('div { /**/ }', '_'), 'div.⭐️_ { /**/ }');\n  assert.equal(scopeStylesheet('div /* comment */ {}', '_'), 'div.⭐️_ /* comment */ {}');\n  assert.equal(scopeStylesheet('div/* comment */ {}', '_'), 'div.⭐️_/* comment */ {}');\n  assert.equal(scopeStylesheet('/* comment */div {}', '_'), '/* comment */div.⭐️_ {}');\n  assert.equal(\n    scopeStylesheet('div /* comment */ > span {}', '_'),\n    'div.⭐️_ /* comment */ > span.⭐️_ {}'\n  );\n});\n\ntest('global selector', () => {\n  assert.equal(scopeStylesheet(':global(*) {}', '_'), '* {}');\n});\ntest('global selector with attribute', () => {\n  assert.equal(scopeStylesheet(':global([t=\"(\"]) {}', '_'), '[t=\"(\"] {}');\n\n  assert.equal(scopeStylesheet(':global(div) {}', '_'), 'div {}');\n  assert.equal(scopeStylesheet(':global(div), p {}', '_'), 'div, p.⭐️_ {}');\n\n  assert.equal(scopeStylesheet('div :global(p) {}', '_'), 'div.⭐️_ p {}');\n  assert.equal(scopeStylesheet(':global(div) > p {}', '_'), 'div > p.⭐️_ {}');\n\n  assert.equal(scopeStylesheet(':global(.red) {}', '_'), '.red {}');\n  assert.equal(scopeStylesheet(':global(div).red {}', '_'), 'div.red.⭐️_ {}');\n  assert.equal(scopeStylesheet(':global(div.red) {}', '_'), 'div.red {}');\n\n  assert.equal(scopeStylesheet(':global(#red) {}', '_'), '#red {}');\n\n  assert.equal(scopeStylesheet(':global(div) { }', '_'), 'div { }');\n  assert.equal(scopeStylesheet(':global(div) {}', '_'), 'div {}');\n  assert.equal(scopeStylesheet(':global(div){color:red;}', '_'), 'div{color:red;}');\n\n  assert.equal(scopeStylesheet(':global(*[target]) {}', '_'), '*[target] {}');\n  assert.equal(scopeStylesheet(':global(*[target]) span {}', '_'), '*[target] span.⭐️_ {}');\n  assert.equal(scopeStylesheet('*[target] :global(span) {}', '_'), '[target].⭐️_ span {}');\n\n  assert.equal(scopeStylesheet(':global(a):link {}', '_'), 'a:link.⭐️_ {}');\n  assert.equal(scopeStylesheet(':global(a:link) {}', '_'), 'a:link {}');\n  assert.equal(scopeStylesheet(':global(p:lang(en)) {}', '_'), 'p:lang(en) {}');\n  assert.equal(scopeStylesheet(':global(p:nth-child(2)) {}', '_'), 'p:nth-child(2) {}');\n  assert.equal(scopeStylesheet(':global(:root) {}', '_'), ':root {}');\n  assert.equal(scopeStylesheet(':global(p:not(.blue)) {}', '_'), 'p:not(.blue) {}');\n});\n\ntest('nested global inside not', () => {\n  assert.equal(scopeStylesheet('p:not(:global(.red)){}', '_'), 'p:not(.red).⭐️_{}');\n\n  assert.equal(\n    scopeStylesheet(':global(p:nth-child(3n+1):hover) {}', '_'),\n    'p:nth-child(3n+1):hover {}'\n  );\n  assert.equal(\n    scopeStylesheet(':global(p:nth-child(3n+1) div) {}', '_'),\n    'p:nth-child(3n+1) div {}'\n  );\n\n  assert.equal(scopeStylesheet(':global(::selection) {}', '_'), '::selection {}');\n});\ntest('global with pseudo element', () => {\n  assert.equal(scopeStylesheet(':global(a::after){}', '_'), 'a::after{}');\n  // assert.equal(scopeStylesheet(':global(a)::before{}', '_'), 'a::before{}');\n\n  assert.equal(scopeStylesheet(':global(a).red::before {}', '_'), 'a.red.⭐️_::before {}');\n  assert.equal(\n    scopeStylesheet(':global(a.red) span::before {}', '_'),\n    'a.red span.⭐️_::before {}'\n  );\n});\n\ntest('global with pseudo element', () => {\n  assert.equal(\n    scopeStylesheet(\n      '@keyframes :global(slidein) { from { transform: translateX(0%); } to { transform: translateX(100%); } }',\n      '_'\n    ),\n    '@keyframes slidein { from { transform: translateX(0%); } to { transform: translateX(100%); } }'\n  );\n  assert.equal(\n    scopeStylesheet('@media screen and (min-width: 900px) { :global(div) {} }', '_'),\n    '@media screen and (min-width: 900px) { div {} }'\n  );\n});\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-context.ts",
    "content": "import { fromCamelToKebabCase } from '../util/case';\nimport { qError, QError_invalidContext, QError_notFoundContext } from '../error/error';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { isObject } from '../util/types';\nimport { useSequentialScope } from './use-sequential-scope';\nimport { assertTrue } from '../error/assert';\nimport { verifySerializable } from '../state/common';\nimport { getContext, type QContext } from '../state/context';\nimport type { ContainerState } from '../container/container';\nimport { invoke } from './use-core';\nimport {\n  type QwikElement,\n  type VirtualElement,\n  getVirtualElement,\n} from '../render/dom/virtual-element';\nimport { isComment } from '../util/element';\nimport { Q_CTX, VIRTUAL_SYMBOL } from '../state/constants';\n\n// <docs markdown=\"../readme.md#ContextId\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#ContextId instead)\n/**\n * ContextId is a typesafe ID for your context.\n *\n * Context is a way to pass stores to the child components without prop-drilling.\n *\n * Use `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier\n * for the context. It is not the context value itself. See `useContextProvider()` and\n * `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can\n * track context providers and consumers in a way that survives resumability.\n *\n * ### Example\n *\n * ```tsx\n * // Declare the Context type.\n * interface TodosStore {\n *   items: string[];\n * }\n * // Create a Context ID (no data is saved here.)\n * // You will use this ID to both create and retrieve the Context.\n * export const TodosContext = createContextId<TodosStore>('Todos');\n *\n * // Example of providing context to child components.\n * export const App = component$(() => {\n *   useContextProvider(\n *     TodosContext,\n *     useStore<TodosStore>({\n *       items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n *     })\n *   );\n *\n *   return <Items />;\n * });\n *\n * // Example of retrieving the context provided by a parent component.\n * export const Items = component$(() => {\n *   const todos = useContext(TodosContext);\n *   return (\n *     <ul>\n *       {todos.items.map((item) => (\n *         <li>{item}</li>\n *       ))}\n *     </ul>\n *   );\n * });\n *\n * ```\n *\n * @public\n */\n// </docs>\nexport interface ContextId<STATE> {\n  /** Design-time property to store type information for the context. */\n  readonly __brand_context_type__: STATE;\n  /** A unique ID for the context. */\n  readonly id: string;\n}\n\n// <docs markdown=\"../readme.md#createContextId\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#createContextId instead)\n/**\n * Create a context ID to be used in your application. The name should be written with no spaces.\n *\n * Context is a way to pass stores to the child components without prop-drilling.\n *\n * Use `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier\n * for the context. It is not the context value itself. See `useContextProvider()` and\n * `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can\n * track context providers and consumers in a way that survives resumability.\n *\n * ### Example\n *\n * ```tsx\n * // Declare the Context type.\n * interface TodosStore {\n *   items: string[];\n * }\n * // Create a Context ID (no data is saved here.)\n * // You will use this ID to both create and retrieve the Context.\n * export const TodosContext = createContextId<TodosStore>('Todos');\n *\n * // Example of providing context to child components.\n * export const App = component$(() => {\n *   useContextProvider(\n *     TodosContext,\n *     useStore<TodosStore>({\n *       items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n *     })\n *   );\n *\n *   return <Items />;\n * });\n *\n * // Example of retrieving the context provided by a parent component.\n * export const Items = component$(() => {\n *   const todos = useContext(TodosContext);\n *   return (\n *     <ul>\n *       {todos.items.map((item) => (\n *         <li>{item}</li>\n *       ))}\n *     </ul>\n *   );\n * });\n *\n * ```\n *\n * @param name - The name of the context.\n * @public\n */\n// </docs>\nexport const createContextId = <STATE = unknown>(name: string): ContextId<STATE> => {\n  assertTrue(/^[\\w/.-]+$/.test(name), 'Context name must only contain A-Z,a-z,0-9, _', name);\n  return /*#__PURE__*/ Object.freeze({\n    id: fromCamelToKebabCase(name),\n  } as any);\n};\n\n// <docs markdown=\"../readme.md#useContextProvider\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useContextProvider instead)\n/**\n * Assign a value to a Context.\n *\n * Use `useContextProvider()` to assign a value to a context. The assignment happens in the\n * component's function. Once assigned, use `useContext()` in any child component to retrieve the\n * value.\n *\n * Context is a way to pass stores to the child components without prop-drilling. Note that scalar\n * values are allowed, but for reactivity you need signals or stores.\n *\n * ### Example\n *\n * ```tsx\n * // Declare the Context type.\n * interface TodosStore {\n *   items: string[];\n * }\n * // Create a Context ID (no data is saved here.)\n * // You will use this ID to both create and retrieve the Context.\n * export const TodosContext = createContextId<TodosStore>('Todos');\n *\n * // Example of providing context to child components.\n * export const App = component$(() => {\n *   useContextProvider(\n *     TodosContext,\n *     useStore<TodosStore>({\n *       items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n *     })\n *   );\n *\n *   return <Items />;\n * });\n *\n * // Example of retrieving the context provided by a parent component.\n * export const Items = component$(() => {\n *   const todos = useContext(TodosContext);\n *   return (\n *     <ul>\n *       {todos.items.map((item) => (\n *         <li>{item}</li>\n *       ))}\n *     </ul>\n *   );\n * });\n *\n * ```\n *\n * @param context - The context to assign a value to.\n * @param value - The value to assign to the context.\n * @public\n */\n// </docs>\nexport const useContextProvider = <STATE>(context: ContextId<STATE>, newValue: STATE) => {\n  const { val, set, elCtx } = useSequentialScope<boolean>();\n  if (val !== undefined) {\n    return;\n  }\n  if (qDev) {\n    validateContext(context);\n  }\n  const contexts = (elCtx.$contexts$ ||= new Map());\n  if (qDev && qSerialize) {\n    verifySerializable(newValue);\n  }\n  contexts.set(context.id, newValue);\n  set(true);\n};\n\nexport interface UseContext {\n  <STATE, T>(context: ContextId<STATE>, transformer: (value: STATE) => T): T;\n  <STATE, T>(context: ContextId<STATE>, defaultValue: T): STATE | T;\n  <STATE>(context: ContextId<STATE>): STATE;\n}\n\n// <docs markdown=\"../readme.md#useContext\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useContext instead)\n/**\n * Retrieve Context value.\n *\n * Use `useContext()` to retrieve the value of context in a component. To retrieve a value a parent\n * component needs to invoke `useContextProvider()` to assign a value.\n *\n * ### Example\n *\n * ```tsx\n * // Declare the Context type.\n * interface TodosStore {\n *   items: string[];\n * }\n * // Create a Context ID (no data is saved here.)\n * // You will use this ID to both create and retrieve the Context.\n * export const TodosContext = createContextId<TodosStore>('Todos');\n *\n * // Example of providing context to child components.\n * export const App = component$(() => {\n *   useContextProvider(\n *     TodosContext,\n *     useStore<TodosStore>({\n *       items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n *     })\n *   );\n *\n *   return <Items />;\n * });\n *\n * // Example of retrieving the context provided by a parent component.\n * export const Items = component$(() => {\n *   const todos = useContext(TodosContext);\n *   return (\n *     <ul>\n *       {todos.items.map((item) => (\n *         <li>{item}</li>\n *       ))}\n *     </ul>\n *   );\n * });\n *\n * ```\n *\n * @param context - The context to retrieve a value from.\n * @public\n */\n// </docs>\nexport const useContext: UseContext = <STATE>(\n  context: ContextId<STATE>,\n  defaultValue?: STATE | ((current: STATE | undefined) => STATE)\n) => {\n  const { val, set, iCtx, elCtx } = useSequentialScope<STATE>();\n  if (val !== undefined) {\n    return val;\n  }\n  if (qDev) {\n    validateContext(context);\n  }\n\n  const value = resolveContext(context, elCtx, iCtx.$renderCtx$.$static$.$containerState$);\n  if (typeof defaultValue === 'function') {\n    return set(invoke(undefined, defaultValue as any, value));\n  }\n  if (value !== undefined) {\n    return set(value);\n  }\n  if (defaultValue !== undefined) {\n    return set(defaultValue);\n  }\n  throw qError(QError_notFoundContext, context.id);\n};\n\n/** Find a wrapping Virtual component in the DOM */\nconst findParentCtx = (el: QwikElement | null, containerState: ContainerState) => {\n  let node = el;\n  let stack = 1;\n  while (node && !node.hasAttribute?.('q:container')) {\n    // Walk the siblings backwards, each comment might be the Virtual wrapper component\n    while ((node = node.previousSibling as QwikElement | null)) {\n      if (isComment(node)) {\n        const virtual = (node as any)[VIRTUAL_SYMBOL] as VirtualElement;\n        if (virtual) {\n          const qtx = (virtual as any)[Q_CTX] as QContext | undefined;\n          if (node === virtual.open) {\n            // We started inside this node so this is our parent\n            return qtx ?? getContext(virtual, containerState);\n          }\n          // This is a sibling, check if it knows our parent\n          if (qtx?.$parentCtx$) {\n            return qtx.$parentCtx$;\n          }\n          // Skip over this entire virtual sibling\n          node = virtual;\n          continue;\n        }\n        if (node.data === '/qv') {\n          stack++;\n        } else if (node.data.startsWith('qv ')) {\n          stack--;\n          if (stack === 0) {\n            return getContext(getVirtualElement(node)!, containerState);\n          }\n        }\n      }\n    }\n    // No more siblings, walk up the DOM tree. The parent will never be a Virtual component.\n    node = el!.parentElement;\n    el = node;\n  }\n  return null;\n};\n\nconst getParentProvider = (ctx: QContext, containerState: ContainerState): QContext | null => {\n  // `null` means there's no parent, `undefined` means we don't know yet.\n  if (ctx.$parentCtx$ === undefined) {\n    // Not fully resumed container, find context from DOM\n    // We cannot recover $realParentCtx$ from this but that's fine because we don't need to pause on the client\n    ctx.$parentCtx$ = findParentCtx(ctx.$element$, containerState);\n  }\n  /**\n   * Note, the parentCtx is used during pause to to get the immediate parent, so we can't shortcut\n   * the search for $contexts$ here. If that turns out to be needed, it needs to be cached in a\n   * separate property.\n   */\n  return ctx.$parentCtx$;\n};\n\nexport const resolveContext = <STATE>(\n  context: ContextId<STATE>,\n  hostCtx: QContext,\n  containerState: ContainerState\n): STATE | undefined => {\n  const contextID = context.id;\n  if (!hostCtx) {\n    return;\n  }\n  let ctx = hostCtx;\n  while (ctx) {\n    const found = ctx.$contexts$?.get(contextID);\n    if (found) {\n      return found;\n    }\n    ctx = getParentProvider(ctx, containerState)!;\n  }\n};\n\nexport const validateContext = (context: ContextId<any>) => {\n  if (!isObject(context) || typeof context.id !== 'string' || context.id.length === 0) {\n    throw qError(QError_invalidContext, context);\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-core.ts",
    "content": "import { _getContainerState } from '../container/container';\nimport type { QwikDocument } from '../document';\nimport { assertDefined } from '../error/assert';\nimport { qError, QError_useInvokeContext, QError_useMethodOutsideContext } from '../error/error';\nimport type { QRLInternal } from '../qrl/qrl-class';\nimport type { QRL } from '../qrl/qrl.public';\nimport type { QwikElement } from '../render/dom/virtual-element';\nimport type { RenderContext } from '../render/types';\nimport { getContext, HOST_FLAG_DYNAMIC } from '../state/context';\nimport {\n  ComputedEvent,\n  QContainerSelector,\n  QLocaleAttr,\n  RenderEvent,\n  ResourceEvent,\n  TaskEvent,\n} from '../util/markers';\nimport { isPromise } from '../util/promises';\nimport { seal } from '../util/qdev';\nimport { isArray } from '../util/types';\nimport { setLocale } from './use-locale';\nimport type { Subscriber } from '../state/common';\nimport { isSignal, type Signal, type SignalInternal } from '../state/signal';\nimport { unwrapStore } from '../index';\n\ndeclare const document: QwikDocument;\n\n// Simplified version of `ServerRequestEvent` from `@builder.io/qwik-city` package.\nexport interface SimplifiedServerRequestEvent<T = unknown> {\n  url: URL;\n  locale: string | undefined;\n  request: Request;\n}\n\nexport interface StyleAppend {\n  styleId: string;\n  content: string | null;\n}\n\n// Simplified version of `ServerRequestEvent` from `@builder.io/qwik-city` package.\nexport interface ServerRequestEvent<T = unknown> {\n  url: URL;\n  locale: string | undefined;\n  request: Request;\n}\n\nexport type PossibleEvents =\n  | Event\n  | SimplifiedServerRequestEvent\n  | typeof TaskEvent\n  | typeof RenderEvent\n  | typeof ComputedEvent\n  | typeof ResourceEvent;\n\nexport interface RenderInvokeContext extends InvokeContext {\n  $renderCtx$: RenderContext;\n  /** The parent document */\n  $doc$: Document;\n  // The below are just always-defined attributes of InvokeContext.\n  $hostElement$: QwikElement;\n  $event$: PossibleEvents;\n  $waitOn$: Promise<unknown>[];\n  $subscriber$: Subscriber | null;\n}\n\nexport type InvokeTuple = [Element, Event, URL?];\n\n/** The shared state during an invoke() call */\nexport interface InvokeContext {\n  /* The URL of the QRL */\n  $url$: URL | undefined;\n  /** The next available index for the sequentialScope array */\n  $i$: number;\n  /** The Virtual parent component for the current component code */\n  $hostElement$: QwikElement | undefined;\n  /** The current DOM element */\n  $element$: Element | undefined;\n  /** The event we're currently handling */\n  $event$: PossibleEvents | undefined;\n  /** The QRL function we're currently executing */\n  $qrl$: QRL | undefined;\n  /** Promises that need awaiting before the current invocation is done */\n  $waitOn$: Promise<unknown>[] | undefined;\n  /** The current subscriber for registering signal reads */\n  $subscriber$: Subscriber | null | undefined;\n  $renderCtx$: RenderContext | undefined;\n  $locale$: string | undefined;\n}\n\nlet _context: InvokeContext | undefined;\n\n/** @public */\nexport const tryGetInvokeContext = (): InvokeContext | undefined => {\n  if (!_context) {\n    const context = typeof document !== 'undefined' && document && document.__q_context__;\n    if (!context) {\n      return undefined;\n    }\n    if (isArray(context)) {\n      return (document.__q_context__ = newInvokeContextFromTuple(context as InvokeTuple));\n    }\n    return context as InvokeContext;\n  }\n  return _context;\n};\n\nexport const getInvokeContext = (): InvokeContext => {\n  const ctx = tryGetInvokeContext();\n  if (!ctx) {\n    throw qError(QError_useMethodOutsideContext);\n  }\n  return ctx;\n};\n\nexport const useInvokeContext = (): RenderInvokeContext => {\n  const ctx = tryGetInvokeContext();\n  if (!ctx || ctx.$event$ !== RenderEvent) {\n    throw qError(QError_useInvokeContext);\n  }\n  assertDefined(ctx.$hostElement$, `invoke: $hostElement$ must be defined`, ctx);\n  assertDefined(ctx.$waitOn$, `invoke: $waitOn$ must be defined`, ctx);\n  assertDefined(ctx.$renderCtx$, `invoke: $renderCtx$ must be defined`, ctx);\n  assertDefined(ctx.$subscriber$, `invoke: $subscriber$ must be defined`, ctx);\n\n  return ctx as RenderInvokeContext;\n};\nexport const useContainerState = () => {\n  const ctx = useInvokeContext();\n  return ctx.$renderCtx$.$static$.$containerState$;\n};\n\nexport function useBindInvokeContext<FN extends (...args: any) => any>(\n  this: unknown,\n  fn: FN | undefined\n): typeof fn {\n  if (fn == null) {\n    return fn;\n  }\n  const ctx = getInvokeContext();\n  return function (this: unknown, ...args: Parameters<FN>) {\n    return (invokeApply<FN>).call(this, ctx, fn!, args);\n  } as FN;\n}\n\n/** Call a function with the given InvokeContext and given arguments. */\nexport function invoke<FN extends (...args: any[]) => any>(\n  this: unknown,\n  context: InvokeContext | undefined,\n  fn: FN,\n  ...args: Parameters<FN>\n): ReturnType<FN> {\n  return invokeApply.call(this, context, fn, args);\n}\n\n/** Call a function with the given InvokeContext and array of arguments. */\nexport function invokeApply<FN extends (...args: any) => any>(\n  this: unknown,\n  context: InvokeContext | undefined,\n  fn: FN,\n  args: Parameters<FN>\n): ReturnType<FN> {\n  const previousContext = _context;\n  let returnValue: ReturnType<FN>;\n  try {\n    _context = context;\n    returnValue = fn.apply(this, args);\n  } finally {\n    _context = previousContext;\n  }\n  return returnValue;\n}\n\nexport const waitAndRun = (ctx: RenderInvokeContext, callback: () => unknown) => {\n  const waitOn = ctx.$waitOn$;\n  if (waitOn.length === 0) {\n    const result = callback();\n    if (isPromise(result)) {\n      waitOn.push(result);\n    }\n  } else {\n    waitOn.push(Promise.all(waitOn).then(callback));\n  }\n};\n\nexport const newInvokeContextFromTuple = ([element, event, url]: InvokeTuple) => {\n  const container = element.closest(QContainerSelector);\n  const locale = container?.getAttribute(QLocaleAttr) || undefined;\n  locale && setLocale(locale);\n  return newInvokeContext(locale, undefined, element, event, url);\n};\n\n// TODO how about putting url and locale (and event/custom?) in to a \"static\" object\nexport const newInvokeContext = (\n  locale?: string,\n  hostElement?: QwikElement,\n  element?: Element,\n  event?: PossibleEvents,\n  url?: URL\n): InvokeContext => {\n  // ServerRequestEvent has .locale, but it's not always defined.\n  const $locale$ =\n    locale || (typeof event === 'object' && event && 'locale' in event ? event.locale : undefined);\n  const ctx: InvokeContext = {\n    $url$: url,\n    $i$: 0,\n    $hostElement$: hostElement,\n    $element$: element,\n    $event$: event,\n    $qrl$: undefined,\n    $waitOn$: undefined,\n    $subscriber$: undefined,\n    $renderCtx$: undefined,\n    $locale$,\n  };\n  seal(ctx);\n  return ctx;\n};\n\nexport const getWrappingContainer = (el: QwikElement): Element | null => {\n  return el.closest(QContainerSelector);\n};\n\n/**\n * Get the value of the expression without tracking listeners. A function will be invoked, signals\n * will return their value, and stores will be unwrapped (they return the backing object).\n *\n * When you pass a function, you can also pass additional arguments that the function will receive.\n *\n * Note that stores are not unwrapped recursively.\n *\n * @param expr - The function or object to evaluate without tracking.\n * @param args - Additional arguments to pass when `expr` is a function.\n * @public\n */\nexport const untrack = <T, A extends any[]>(\n  expr: ((...args: A) => T) | Signal<T> | T,\n  ...args: A\n): T => {\n  if (typeof expr === 'function') {\n    return invoke(undefined, expr as (...args: A) => T, ...args);\n  }\n  if (isSignal(expr)) {\n    return (expr as SignalInternal<T>).untrackedValue;\n  }\n  return unwrapStore(expr);\n};\n\nconst trackInvocation = /*#__PURE__*/ newInvokeContext(\n  undefined,\n  undefined,\n  undefined,\n  RenderEvent\n);\n\n/**\n * Mark sub as a listener for the signal\n *\n * @public\n */\nexport const trackSignal = <T>(signal: Signal, sub: Subscriber): T => {\n  trackInvocation.$subscriber$ = sub;\n  return invoke(trackInvocation, () => signal.value);\n};\n\n/** @internal */\nexport const _getContextElement = (): unknown => {\n  const iCtx = tryGetInvokeContext();\n  if (iCtx) {\n    return (\n      iCtx.$element$ ?? iCtx.$hostElement$ ?? (iCtx.$qrl$ as QRLInternal)?.$setContainer$(undefined)\n    );\n  }\n};\n\n/** @internal */\nexport const _getContextEvent = (): unknown => {\n  const iCtx = tryGetInvokeContext();\n  if (iCtx) {\n    return iCtx.$event$;\n  }\n};\n\n/** @internal */\nexport const _jsxBranch = <T>(input?: T) => {\n  const iCtx = tryGetInvokeContext();\n  if (iCtx && iCtx.$hostElement$ && iCtx.$renderCtx$) {\n    const hostElement = iCtx.$hostElement$;\n    const elCtx = getContext(hostElement, iCtx.$renderCtx$.$static$.$containerState$);\n    elCtx.$flags$ |= HOST_FLAG_DYNAMIC;\n  }\n  return input;\n};\n\n/** @internal */\nexport const _waitUntilRendered = (elm: Element) => {\n  const containerEl = getWrappingContainer(elm);\n  if (!containerEl) {\n    return Promise.resolve();\n  }\n  const containerState = _getContainerState(containerEl);\n  return containerState.$renderPromise$ ?? Promise.resolve();\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-env-data.ts",
    "content": "import { tryGetInvokeContext } from './use-core';\n\n/** @public */\nexport function useServerData<T>(key: string): T | undefined;\n\n/** @public */\nexport function useServerData<T, B = T>(key: string, defaultValue: B): T | B;\n\n/** @public */\nexport function useServerData(key: string, defaultValue?: any) {\n  const ctx = tryGetInvokeContext();\n  return ctx?.$renderCtx$?.$static$.$containerState$.$serverData$[key] ?? defaultValue;\n}\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-error-boundary.ts",
    "content": "import { type ErrorBoundaryStore, ERROR_CONTEXT } from '../render/error-handling';\nimport { useContextProvider } from './use-context';\nimport { useStore } from './use-store.public';\n\n/** @public */\nexport const useErrorBoundary = () => {\n  const error = useStore<ErrorBoundaryStore>({ error: undefined });\n  useContextProvider(ERROR_CONTEXT, error);\n\n  return error;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-id.ts",
    "content": "import { getNextIndex } from '../render/execute-component';\nimport { hashCode } from '../util/hash_code';\nimport { useSequentialScope } from './use-sequential-scope';\n\n/** @public */\nexport const useId = (): string => {\n  const { val, set, elCtx, iCtx } = useSequentialScope<string>();\n  if (val != null) {\n    return val;\n  }\n\n  const containerBase = iCtx.$renderCtx$?.$static$?.$containerState$?.$base$ || '';\n  const base = containerBase ? hashCode(containerBase) : '';\n  const hash = elCtx.$componentQrl$?.getHash() || '';\n  const counter = getNextIndex(iCtx.$renderCtx$) || '';\n  const id = `${base}-${hash}-${counter}`; // If no base and no hash, then \"--#\"\n  return set(id);\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-lexical-scope.public.ts",
    "content": "import { assertDefined } from '../error/assert';\nimport { inflateQrl, parseQRL } from '../qrl/qrl';\nimport { getWrappingContainer, getInvokeContext } from './use-core';\nimport { assertQrl } from '../qrl/qrl-class';\nimport { getContext } from '../state/context';\nimport { resumeIfNeeded } from '../container/resume';\nimport { _getContainerState } from '../container/container';\n\n// <docs markdown=\"../readme.md#useLexicalScope\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useLexicalScope instead)\n/**\n * Used by the Qwik Optimizer to restore the lexically scoped variables.\n *\n * This method should not be present in the application source code.\n *\n * NOTE: `useLexicalScope` method can only be used in the synchronous portion of the callback\n * (before any `await` statements.)\n *\n * @internal\n */\n// </docs>\nexport const useLexicalScope = <VARS extends any[]>(): VARS => {\n  const context = getInvokeContext();\n  let qrl = context.$qrl$;\n  if (!qrl) {\n    const el = context.$element$;\n    assertDefined(el, 'invoke: element must be defined inside useLexicalScope()', context);\n    const container = getWrappingContainer(el);\n    assertDefined(container, `invoke: cant find parent q:container of`, el);\n    qrl = parseQRL(decodeURIComponent(String(context.$url$)), container);\n    assertQrl(qrl);\n    resumeIfNeeded(container);\n    const elCtx = getContext(el, _getContainerState(container));\n    inflateQrl(qrl, elCtx);\n  } else {\n    assertQrl(qrl);\n    assertDefined(\n      qrl.$captureRef$,\n      'invoke: qrl $captureRef$ must be defined inside useLexicalScope()',\n      qrl\n    );\n  }\n  return qrl.$captureRef$ as VARS;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-locale.ts",
    "content": "import { tryGetInvokeContext } from './use-core';\n\nlet _locale: string | undefined = undefined;\n\n/**\n * Retrieve the current locale.\n *\n * If no current locale and there is no `defaultLocale` the function throws an error.\n *\n * @returns The locale.\n * @internal\n */\nexport function getLocale(defaultLocale?: string): string {\n  if (_locale === undefined) {\n    const ctx = tryGetInvokeContext();\n    if (ctx && ctx.$locale$) {\n      return ctx.$locale$;\n    }\n    if (defaultLocale !== undefined) {\n      return defaultLocale;\n    }\n    throw new Error('Reading `locale` outside of context.');\n  }\n  return _locale;\n}\n\n/**\n * Override the `getLocale` with `lang` within the `fn` execution.\n *\n * @internal\n */\nexport function withLocale<T>(locale: string, fn: () => T): T {\n  const previousLang = _locale;\n  try {\n    _locale = locale;\n    return fn();\n  } finally {\n    _locale = previousLang;\n  }\n}\n\n/**\n * Globally set a lang.\n *\n * This can be used only in browser. Server execution requires that each request could potentially\n * be a different lang, therefore setting a global lang would produce incorrect responses.\n *\n * @param lang\n */\nexport function setLocale(locale: string): void {\n  _locale = locale;\n}\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-on.ts",
    "content": "import { assertQrl } from '../qrl/qrl-class';\nimport type { QRL } from '../qrl/qrl.public';\nimport { getContext, HOST_FLAG_NEED_ATTACH_LISTENER } from '../state/context';\nimport { type Listener, normalizeOnProp } from '../state/listeners';\nimport { useInvokeContext } from './use-core';\nimport { type KnownEventNames } from '../render/jsx/types/jsx-qwik-events';\nimport type {\n  EventHandler,\n  EventFromName,\n  AllEventKeys,\n} from '../render/jsx/types/jsx-qwik-attributes';\n\nexport type EventQRL<T extends string = AllEventKeys> =\n  | QRL<EventHandler<EventFromName<T>, Element>>\n  | undefined;\n\n// <docs markdown=\"../readme.md#useOn\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useOn instead)\n/**\n * Register a listener on the current component's host element.\n *\n * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not\n * have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.\n *\n * @public\n * @see `useOn`, `useOnWindow`, `useOnDocument`.\n */\n// </docs>\nexport const useOn = <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => {\n  _useOn(createEventName(event, undefined), eventQrl);\n};\n\n// <docs markdown=\"../readme.md#useOnDocument\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useOnDocument instead)\n/**\n * Register a listener on `document`.\n *\n * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not\n * have access to the JSX.\n *\n * @public\n * @see `useOn`, `useOnWindow`, `useOnDocument`.\n *\n * ```tsx\n * function useScroll() {\n *   useOnDocument(\n *     'scroll',\n *     $((event) => {\n *       console.log('body scrolled', event);\n *     })\n *   );\n * }\n *\n * const Cmp = component$(() => {\n *   useScroll();\n *   return <div>Profit!</div>;\n * });\n * ```\n */\n// </docs>\nexport const useOnDocument = <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => {\n  _useOn(createEventName(event, 'document'), eventQrl);\n};\n\n// <docs markdown=\"../readme.md#useOnWindow\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useOnWindow instead)\n/**\n * Register a listener on `window`.\n *\n * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not\n * have access to the JSX.\n *\n * @public\n * @see `useOn`, `useOnWindow`, `useOnDocument`.\n *\n * ```tsx\n * function useAnalytics() {\n *   useOnWindow(\n *     'popstate',\n *     $((event) => {\n *       console.log('navigation happened', event);\n *       // report to analytics\n *     })\n *   );\n * }\n *\n * const Cmp = component$(() => {\n *   useAnalytics();\n *   return <div>Profit!</div>;\n * });\n * ```\n */\n// </docs>\nexport const useOnWindow = <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>) => {\n  _useOn(createEventName(event, 'window'), eventQrl);\n};\n\nconst createEventName = (\n  event: KnownEventNames | KnownEventNames[],\n  eventType: 'window' | 'document' | undefined\n) => {\n  const formattedEventType = eventType !== undefined ? eventType + ':' : '';\n  const res = Array.isArray(event)\n    ? event.map((e) => `${formattedEventType}on-${e}`)\n    : `${formattedEventType}on-${event}`;\n  return res;\n};\n\nconst _useOn = (eventName: string | string[], eventQrl: EventQRL) => {\n  if (eventQrl) {\n    const invokeCtx = useInvokeContext();\n    const elCtx = getContext(\n      invokeCtx.$hostElement$,\n      invokeCtx.$renderCtx$.$static$.$containerState$\n    );\n    assertQrl(eventQrl as any);\n    if (typeof eventName === 'string') {\n      elCtx.li.push([normalizeOnProp(eventName), eventQrl] as Listener);\n    } else {\n      elCtx.li.push(...eventName.map((name) => [normalizeOnProp(name), eventQrl] as Listener));\n    }\n    elCtx.$flags$ |= HOST_FLAG_NEED_ATTACH_LISTENER;\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-on.unit.ts",
    "content": "import { assertType, describe, expectTypeOf, test } from 'vitest';\nimport { useOn, type EventQRL } from './use-on';\nimport { $, type QRL, type QrlReturn } from '../qrl/qrl.public';\n\ndescribe('types', () => {\n  // Note, these type checks happen at compile time. We don't need to call anything, so we do ()=>()=>. We just need to\n  // make sure the type check runs.\n  test('EventQRL matching', () => () => {\n    const cb0 = () => 'hello';\n    const cb1 = (ev: MouseEvent) => 'hello';\n    const cb2 = (ev: Event, elem: Element) => 'hello';\n    const cbAny = (ev: any) => 'hello';\n    const wrong1 = (ev: MouseEvent, elem: Element, extra: string) => 'hello';\n    const wrong2 = (ev: boolean) => 'hello';\n\n    expectTypeOf<undefined>().toMatchTypeOf<EventQRL>();\n    expectTypeOf<QRL<typeof cb0>>().toMatchTypeOf<EventQRL>();\n    expectTypeOf<QRL<typeof cb1>>().toMatchTypeOf<EventQRL>();\n    expectTypeOf<QRL<typeof cb2>>().toMatchTypeOf<EventQRL>();\n\n    expectTypeOf<QRL<typeof cbAny>>().toMatchTypeOf<EventQRL>();\n\n    expectTypeOf<QRL<typeof wrong1>>().not.toMatchTypeOf<EventQRL>();\n    expectTypeOf<QRL<typeof wrong2>>().not.toMatchTypeOf<EventQRL>();\n  });\n\n  test('inferring', () => () => {\n    const getResult = <T extends EventQRL>(e: T) => e?.(true as any, true as any) as QrlReturn<T>;\n\n    const called = getResult(\n      $((ev, el) => {\n        return { ev, el };\n      })\n    );\n    expectTypeOf(called.ev).not.toBeAny();\n    expectTypeOf(called.el).not.toBeAny();\n    assertType<Element | undefined>(called.el);\n    expectTypeOf<Event>().toMatchTypeOf(called.ev);\n  });\n\n  test('useOn', () => () => {\n    useOn(\n      'click',\n      $((ev) => {\n        expectTypeOf(ev).not.toBeAny();\n        assertType<MouseEvent>(ev);\n      })\n    );\n    useOn(\n      'copy',\n      $((ev) => {\n        expectTypeOf(ev).not.toBeAny();\n        assertType<ClipboardEvent>(ev);\n      })\n    );\n    useOn(\n      'custom',\n      $((ev) => {\n        expectTypeOf(ev).not.toBeAny();\n        assertType<Event>(ev);\n      })\n    );\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-resource.ts",
    "content": "import { $, type QRL } from '../qrl/qrl.public';\nimport { assertQrl } from '../qrl/qrl-class';\nimport {\n  type ResourceReturn,\n  type ResourceDescriptor,\n  type ResourceFn,\n  runResource,\n  TaskFlagsIsDirty,\n  TaskFlagsIsResource,\n  Task,\n  type ResourceReturnInternal,\n} from './use-task';\nimport { Fragment, jsx } from '../render/jsx/jsx-runtime';\nimport { isServerPlatform } from '../platform/platform';\nimport { untrack, useBindInvokeContext } from './use-core';\n\nimport type { ContainerState, GetObjID } from '../container/container';\nimport { useSequentialScope } from './use-sequential-scope';\nimport { createProxy } from '../state/store';\nimport { getProxyTarget } from '../state/common';\nimport { isSignal, type Signal } from '../state/signal';\nimport { isObject } from '../util/types';\nimport { isPromise } from '../util/promises';\nimport type { JSXOutput } from '../render/jsx/types/jsx-node';\n\n/**\n * Options to pass to `useResource$()`\n *\n * @public\n * @see useResource\n */\nexport interface ResourceOptions {\n  /**\n   * Timeout in milliseconds. If the resource takes more than the specified millisecond, it will\n   * timeout. Resulting on a rejected resource.\n   */\n  timeout?: number;\n}\n\n// <docs markdown=\"../readme.md#useResource\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useResource instead)\n/**\n * This method works like an async memoized function that runs whenever some tracked value changes\n * and returns some data.\n *\n * `useResource` however returns immediate a `ResourceReturn` object that contains the data and a\n * state that indicates if the data is available or not.\n *\n * The status can be one of the following:\n *\n * - `pending` - the data is not yet available.\n * - `resolved` - the data is available.\n * - `rejected` - the data is not available due to an error or timeout.\n *\n * Avoid using a `try/catch` statement in `useResource$`. If you catch the error instead of passing\n * it, the resource status will never be `rejected`.\n *\n * ### Example\n *\n * Example showing how `useResource` to perform a fetch to request the weather, whenever the input\n * city name changes.\n *\n * ```tsx\n * const Cmp = component$(() => {\n *   const cityS = useSignal('');\n *\n *   const weatherResource = useResource$(async ({ track, cleanup }) => {\n *     const cityName = track(cityS);\n *     const abortController = new AbortController();\n *     cleanup(() => abortController.abort('cleanup'));\n *     const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\n *       signal: abortController.signal,\n *     });\n *     const data = await res.json();\n *     return data as { temp: number };\n *   });\n *\n *   return (\n *     <div>\n *       <input name=\"city\" bind:value={cityS} />\n *       <Resource\n *         value={weatherResource}\n *         onResolved={(weather) => {\n *           return <div>Temperature: {weather.temp}</div>;\n *         }}\n *       />\n *     </div>\n *   );\n * });\n * ```\n *\n * @public\n * @see Resource\n * @see ResourceReturn\n */\n// </docs>\nexport const useResourceQrl = <T>(\n  qrl: QRL<ResourceFn<T>>,\n  opts?: ResourceOptions\n): ResourceReturn<T> => {\n  const { val, set, i, iCtx, elCtx } = useSequentialScope<ResourceReturn<T>>();\n  if (val != null) {\n    return val;\n  }\n  assertQrl(qrl);\n\n  const containerState = iCtx.$renderCtx$.$static$.$containerState$;\n  const resource = createResourceReturn<T>(containerState, opts);\n  const el = elCtx.$element$;\n  const task = new Task(\n    TaskFlagsIsDirty | TaskFlagsIsResource,\n    i,\n    el,\n    qrl,\n    resource\n  ) as ResourceDescriptor<any>;\n  const previousWait = Promise.all(iCtx.$waitOn$.slice());\n  runResource(task, containerState, iCtx.$renderCtx$, previousWait);\n  if (!elCtx.$tasks$) {\n    elCtx.$tasks$ = [];\n  }\n  elCtx.$tasks$.push(task);\n  set(resource);\n\n  return resource;\n};\n\n// <docs markdown=\"../readme.md#useResource\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useResource instead)\n/**\n * This method works like an async memoized function that runs whenever some tracked value changes\n * and returns some data.\n *\n * `useResource` however returns immediate a `ResourceReturn` object that contains the data and a\n * state that indicates if the data is available or not.\n *\n * The status can be one of the following:\n *\n * - 'pending' - the data is not yet available.\n * - 'resolved' - the data is available.\n * - 'rejected' - the data is not available due to an error or timeout.\n *\n * ### Example\n *\n * Example showing how `useResource` to perform a fetch to request the weather, whenever the input\n * city name changes.\n *\n * ```tsx\n * const Cmp = component$(() => {\n *   const cityS = useSignal('');\n *\n *   const weatherResource = useResource$(async ({ track, cleanup }) => {\n *     const cityName = track(cityS);\n *     const abortController = new AbortController();\n *     cleanup(() => abortController.abort('cleanup'));\n *     const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\n *       signal: abortController.signal,\n *     });\n *     const data = await res.json();\n *     return data as { temp: number };\n *   });\n *\n *   return (\n *     <div>\n *       <input name=\"city\" bind:value={cityS} />\n *       <Resource\n *         value={weatherResource}\n *         onResolved={(weather) => {\n *           return <div>Temperature: {weather.temp}</div>;\n *         }}\n *       />\n *     </div>\n *   );\n * });\n * ```\n *\n * @public\n * @see Resource\n * @see ResourceReturn\n */\n// </docs>\nexport const useResource$ = <T>(\n  generatorFn: ResourceFn<T>,\n  opts?: ResourceOptions\n): ResourceReturn<T> => {\n  return useResourceQrl<T>($(generatorFn), opts);\n};\n\n/** @public */\nexport interface ResourceProps<T> {\n  readonly value: ResourceReturn<T> | Signal<Promise<T> | T> | Promise<T>;\n  onResolved: (value: T) => JSXOutput | Promise<JSXOutput>;\n  onPending?: () => JSXOutput | Promise<JSXOutput>;\n  onRejected?: (reason: Error) => JSXOutput | Promise<JSXOutput>;\n}\n\n// <docs markdown=\"../readme.md#useResource\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useResource instead)\n/**\n * This method works like an async memoized function that runs whenever some tracked value changes\n * and returns some data.\n *\n * `useResource` however returns immediate a `ResourceReturn` object that contains the data and a\n * state that indicates if the data is available or not.\n *\n * The status can be one of the following:\n *\n * - 'pending' - the data is not yet available.\n * - 'resolved' - the data is available.\n * - 'rejected' - the data is not available due to an error or timeout.\n *\n * ### Example\n *\n * Example showing how `useResource` to perform a fetch to request the weather, whenever the input\n * city name changes.\n *\n * ```tsx\n * const Cmp = component$(() => {\n *   const cityS = useSignal('');\n *\n *   const weatherResource = useResource$(async ({ track, cleanup }) => {\n *     const cityName = track(cityS);\n *     const abortController = new AbortController();\n *     cleanup(() => abortController.abort('cleanup'));\n *     const res = await fetch(`http://weatherdata.com?city=${cityName}`, {\n *       signal: abortController.signal,\n *     });\n *     const data = await res.json();\n *     return data as { temp: number };\n *   });\n *\n *   return (\n *     <div>\n *       <input name=\"city\" bind:value={cityS} />\n *       <Resource\n *         value={weatherResource}\n *         onResolved={(weather) => {\n *           return <div>Temperature: {weather.temp}</div>;\n *         }}\n *       />\n *     </div>\n *   );\n * });\n * ```\n *\n * @public\n * @see Resource\n * @see ResourceReturn\n */\n// </docs>\nexport const Resource = <T>(props: ResourceProps<T>): JSXOutput => {\n  // Resource path\n  return jsx(Fragment, {\n    children: getResourceValueAsPromise(props),\n  });\n};\nfunction getResourceValueAsPromise<T>(props: ResourceProps<T>): Promise<JSXOutput> | JSXOutput {\n  const resource = props.value as ResourceReturnInternal<T> | Promise<T> | Signal<T>;\n  if (isResourceReturn(resource)) {\n    const isBrowser = !isServerPlatform();\n    if (isBrowser) {\n      if (props.onRejected) {\n        resource.value.catch(() => {});\n        if (resource._state === 'rejected') {\n          return Promise.resolve(resource._error!).then(useBindInvokeContext(props.onRejected));\n        }\n      }\n      if (props.onPending) {\n        const state = resource._state;\n        if (state === 'resolved') {\n          return Promise.resolve(resource._resolved!).then(useBindInvokeContext(props.onResolved));\n        } else if (state === 'pending') {\n          return Promise.resolve().then(useBindInvokeContext(props.onPending));\n        } else if (state === 'rejected') {\n          throw resource._error;\n        }\n      }\n      if (untrack(() => resource._resolved) !== undefined) {\n        return Promise.resolve(resource._resolved!).then(useBindInvokeContext(props.onResolved));\n      }\n    }\n    const value = resource.value;\n    if (value) {\n      return value.then(\n        useBindInvokeContext(props.onResolved),\n        useBindInvokeContext(props.onRejected)\n      );\n    } else {\n      // this is temporary value until the `runResource` is executed and promise is assigned to the value\n      return Promise.resolve(undefined);\n    }\n  } else if (isPromise(resource)) {\n    return resource.then(\n      useBindInvokeContext(props.onResolved),\n      useBindInvokeContext(props.onRejected)\n    );\n  } else if (isSignal(resource)) {\n    return Promise.resolve(resource.value).then(\n      useBindInvokeContext(props.onResolved),\n      useBindInvokeContext(props.onRejected)\n    );\n  } else {\n    return Promise.resolve(resource as T).then(\n      useBindInvokeContext(props.onResolved),\n      useBindInvokeContext(props.onRejected)\n    );\n  }\n}\n\nexport const _createResourceReturn = <T>(opts?: ResourceOptions): ResourceReturnInternal<T> => {\n  const resource: ResourceReturnInternal<T> = {\n    __brand: 'resource',\n    value: undefined as never,\n    loading: isServerPlatform() ? false : true,\n    _resolved: undefined as never,\n    _error: undefined as never,\n    _state: 'pending',\n    _timeout: opts?.timeout ?? -1,\n    _cache: 0,\n  };\n  return resource;\n};\n\nexport const createResourceReturn = <T>(\n  containerState: ContainerState,\n  opts?: ResourceOptions,\n  initialPromise?: Promise<T>\n): ResourceReturnInternal<T> => {\n  const result = _createResourceReturn<T>(opts);\n  result.value = initialPromise as any;\n  const resource = createProxy(result, containerState, undefined);\n  return resource;\n};\n\nexport const getInternalResource = <T>(resource: ResourceReturn<T>): ResourceReturnInternal<T> => {\n  return getProxyTarget(resource) as any;\n};\n\nexport const isResourceReturn = (obj: any): obj is ResourceReturn<unknown> => {\n  return isObject(obj) && (obj as any).__brand === 'resource';\n};\n\nexport const serializeResource = (\n  resource: ResourceReturnInternal<unknown>,\n  getObjId: GetObjID\n) => {\n  const state = resource._state;\n  if (state === 'resolved') {\n    return `0 ${getObjId(resource._resolved)}`;\n  } else if (state === 'pending') {\n    return `1`;\n  } else {\n    return `2 ${getObjId(resource._error)}`;\n  }\n};\n\nexport const parseResourceReturn = <T>(data: string): ResourceReturnInternal<T> => {\n  const [first, id] = data.split(' ');\n  const result = _createResourceReturn<T>(undefined);\n  result.value = Promise.resolve() as any;\n  if (first === '0') {\n    result._state = 'resolved';\n    result._resolved = id as any;\n    result.loading = false;\n  } else if (first === '1') {\n    result._state = 'pending';\n    result.value = new Promise(() => {});\n    result.loading = true;\n  } else if (first === '2') {\n    result._state = 'rejected';\n    result._error = id as any;\n    result.loading = false;\n  }\n  return result;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-sequential-scope.ts",
    "content": "import { verifySerializable } from '../state/common';\nimport { getContext, type QContext } from '../state/context';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { type RenderInvokeContext, useInvokeContext } from './use-core';\n\nexport interface SequentialScope<T> {\n  /** The currently stored data for the hook that calls this */\n  readonly val: T | undefined;\n  /** Store new data for the hook that calls this */\n  readonly set: (v: T) => T;\n  /** Index of the hook */\n  readonly i: number;\n  readonly iCtx: RenderInvokeContext;\n  readonly elCtx: QContext;\n}\n\n/**\n * @internal\n * The storage provider for hooks. Each invocation increases index i. Data is stored in an array.\n */\nexport const useSequentialScope = <T>(): SequentialScope<T> => {\n  const iCtx = useInvokeContext();\n  const hostElement = iCtx.$hostElement$;\n  const elCtx = getContext(hostElement, iCtx.$renderCtx$.$static$.$containerState$);\n  const seq = (elCtx.$seq$ ||= []);\n  const i = iCtx.$i$++;\n\n  const set = (value: T) => {\n    if (qDev && qSerialize) {\n      verifySerializable(value);\n    }\n    return (seq[i] = value);\n  };\n\n  return {\n    val: seq[i],\n    set,\n    i,\n    iCtx,\n    elCtx,\n  };\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-signal.ts",
    "content": "import { isQwikComponent } from '../component/component.public';\nimport { _createSignal, type Signal } from '../state/signal';\nimport { isFunction } from '../util/types';\nimport { invoke, useContainerState } from './use-core';\nimport { useSequentialScope } from './use-sequential-scope';\n\n/** @public */\nexport interface UseSignal {\n  <T>(): Signal<T | undefined>;\n  <T>(value: T | (() => T)): Signal<T>;\n}\n\n/**\n * Creates a signal.\n *\n * If the initial state is a function, the function is invoked to calculate the actual initial\n * state.\n *\n * @deprecated This is a technology preview\n * @public\n */\nexport const createSignal: UseSignal = <STATE>(initialState?: STATE): Signal<STATE> => {\n  const containerState = useContainerState();\n  const value =\n    isFunction(initialState) && !isQwikComponent(initialState)\n      ? invoke(undefined, initialState as any)\n      : initialState;\n  return _createSignal(value, containerState, 0) as Signal<STATE>;\n};\n\n/**\n * Stores a value which is retained for the lifetime of the component.\n *\n * If the value is a function, the function is invoked to calculate the actual value.\n *\n * @deprecated This is a technology preview\n * @public\n */\nexport const useConstant = <T>(value: (() => T) | T): T => {\n  const { val, set } = useSequentialScope<T>();\n  if (val != null) {\n    return val;\n  }\n  // Note: We are not using `invoke` here because we don't want to clear the context\n  value = isFunction(value) && !isQwikComponent(value) ? value() : value;\n  return set(value as T);\n};\n\n/**\n * Hook that creates a signal that is retained for the lifetime of the component.\n *\n * @public\n */\nexport const useSignal: UseSignal = (initialState?: any) => {\n  return useConstant(() => createSignal(initialState));\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-store.public.ts",
    "content": "import { QObjectRecursive } from '../state/constants';\nimport { getOrCreateProxy } from '../state/store';\nimport { isFunction } from '../util/types';\nimport { invoke } from './use-core';\nimport { useSequentialScope } from './use-sequential-scope';\n\n/** @public */\nexport interface UseStoreOptions {\n  /** If `true` then all nested objects and arrays will be tracked as well. Default is `true`. */\n  deep?: boolean;\n\n  /** If `false` then the object will not be tracked for changes. Default is `true`. */\n  reactive?: boolean;\n}\n\n// <docs markdown=\"../readme.md#useStore\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useStore instead)\n/**\n * Creates an object that Qwik can track across serializations.\n *\n * Use `useStore` to create a state for your application. The returned object is a proxy that has a\n * unique ID. The ID of the object is used in the `QRL`s to refer to the store.\n *\n * ### Example\n *\n * Example showing how `useStore` is used in Counter example to keep track of the count.\n *\n * ```tsx\n * const Stores = component$(() => {\n *   const counter = useCounter(1);\n *\n *   // Reactivity happens even for nested objects and arrays\n *   const userData = useStore({\n *     name: 'Manu',\n *     address: {\n *       address: '',\n *       city: '',\n *     },\n *     orgs: [],\n *   });\n *\n *   // useStore() can also accept a function to calculate the initial value\n *   const state = useStore(() => {\n *     return {\n *       value: expensiveInitialValue(),\n *     };\n *   });\n *\n *   return (\n *     <div>\n *       <div>Counter: {counter.value}</div>\n *       <Child userData={userData} state={state} />\n *     </div>\n *   );\n * });\n *\n * function useCounter(step: number) {\n *   // Multiple stores can be created in custom hooks for convenience and composability\n *   const counterStore = useStore({\n *     value: 0,\n *   });\n *   useVisibleTask$(() => {\n *     // Only runs in the client\n *     const timer = setInterval(() => {\n *       counterStore.value += step;\n *     }, 500);\n *     return () => {\n *       clearInterval(timer);\n *     };\n *   });\n *   return counterStore;\n * }\n * ```\n *\n * @public\n */\n// </docs>\nexport const useStore = <STATE extends object>(\n  initialState: STATE | (() => STATE),\n  opts?: UseStoreOptions\n): STATE => {\n  const { val, set, iCtx } = useSequentialScope<STATE>();\n  if (val != null) {\n    return val;\n  }\n  const value = isFunction(initialState) ? invoke(undefined, initialState) : initialState;\n  if (opts?.reactive === false) {\n    set(value);\n    return value;\n  } else {\n    const containerState = iCtx.$renderCtx$.$static$.$containerState$;\n    const recursive = opts?.deep ?? true;\n    const flags = recursive ? QObjectRecursive : 0;\n    const newStore = getOrCreateProxy(value, containerState, flags);\n    set(newStore);\n    return newStore;\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-styles.ts",
    "content": "import { styleContent, styleKey } from '../style/qrl-styles';\nimport type { QRL } from '../qrl/qrl.public';\nimport { implicit$FirstArg } from '../util/implicit_dollar';\nimport { getScopedStyles } from '../style/scoped-stylesheet';\nimport { useSequentialScope } from './use-sequential-scope';\nimport { assertQrl } from '../qrl/qrl-class';\nimport { isPromise } from '../util/promises';\nimport { assertDefined } from '../error/assert';\nimport { ComponentStylesPrefixContent } from '../util/markers';\n\n/** @public */\nexport interface UseStylesScoped {\n  scopeId: string;\n}\n\n// <docs markdown=\"../readme.md#useStyles\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useStyles instead)\n/**\n * A lazy-loadable reference to a component's styles.\n *\n * Component styles allow Qwik to lazy load the style information for the component only when\n * needed. (And avoid double loading it in case of SSR hydration.)\n *\n * ```tsx\n * import styles from './code-block.css?inline';\n *\n * export const CmpStyles = component$(() => {\n *   useStyles$(styles);\n *\n *   return <div>Some text</div>;\n * });\n * ```\n *\n * @public\n * @see `useStylesScoped`\n */\n// </docs>\nexport const useStylesQrl = (styles: QRL<string>): void => {\n  _useStyles(styles, (str) => str, false);\n};\n\n// <docs markdown=\"../readme.md#useStyles\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useStyles instead)\n/**\n * A lazy-loadable reference to a component's styles.\n *\n * Component styles allow Qwik to lazy load the style information for the component only when\n * needed. (And avoid double loading it in case of SSR hydration.)\n *\n * ```tsx\n * import styles from './code-block.css?inline';\n *\n * export const CmpStyles = component$(() => {\n *   useStyles$(styles);\n *\n *   return <div>Some text</div>;\n * });\n * ```\n *\n * @public\n * @see `useStylesScoped`\n */\n// </docs>\nexport const useStyles$ = /*#__PURE__*/ implicit$FirstArg(useStylesQrl);\n\n// <docs markdown=\"../readme.md#useStylesScoped\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useStylesScoped instead)\n/**\n * A lazy-loadable reference to a component's styles, that is scoped to the component.\n *\n * Component styles allow Qwik to lazy load the style information for the component only when\n * needed. (And avoid double loading it in case of SSR hydration.)\n *\n * ```tsx\n * import scoped from './code-block.css?inline';\n *\n * export const CmpScopedStyles = component$(() => {\n *   useStylesScoped$(scoped);\n *\n *   return <div>Some text</div>;\n * });\n * ```\n *\n * @public\n * @see `useStyles`\n */\n// </docs>\nexport const useStylesScopedQrl = (styles: QRL<string>): UseStylesScoped => {\n  return {\n    scopeId: ComponentStylesPrefixContent + _useStyles(styles, getScopedStyles, true),\n  };\n};\n\n// <docs markdown=\"../readme.md#useStylesScoped\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useStylesScoped instead)\n/**\n * A lazy-loadable reference to a component's styles, that is scoped to the component.\n *\n * Component styles allow Qwik to lazy load the style information for the component only when\n * needed. (And avoid double loading it in case of SSR hydration.)\n *\n * ```tsx\n * import scoped from './code-block.css?inline';\n *\n * export const CmpScopedStyles = component$(() => {\n *   useStylesScoped$(scoped);\n *\n *   return <div>Some text</div>;\n * });\n * ```\n *\n * @public\n * @see `useStyles`\n */\n// </docs>\nexport const useStylesScoped$ = /*#__PURE__*/ implicit$FirstArg(useStylesScopedQrl);\n\nconst _useStyles = (\n  styleQrl: QRL<string>,\n  transform: (str: string, styleId: string) => string,\n  scoped: boolean\n): string => {\n  assertQrl(styleQrl);\n\n  const { val, set, iCtx, i, elCtx } = useSequentialScope<string>();\n  if (val) {\n    return val;\n  }\n  const styleId = styleKey(styleQrl, i);\n  const containerState = iCtx.$renderCtx$.$static$.$containerState$;\n  set(styleId);\n\n  if (!elCtx.$appendStyles$) {\n    elCtx.$appendStyles$ = [];\n  }\n  if (!elCtx.$scopeIds$) {\n    elCtx.$scopeIds$ = [];\n  }\n  if (scoped) {\n    elCtx.$scopeIds$.push(styleContent(styleId));\n  }\n  if (containerState.$styleIds$.has(styleId)) {\n    return styleId;\n  }\n  containerState.$styleIds$.add(styleId);\n  const value = styleQrl.$resolveLazy$(containerState.$containerEl$);\n  const appendStyle = (styleText: string) => {\n    assertDefined(elCtx.$appendStyles$, 'appendStyles must be defined');\n    elCtx.$appendStyles$.push({\n      styleId,\n      content: transform(styleText, styleId),\n    });\n  };\n  if (isPromise(value)) {\n    iCtx.$waitOn$.push(value.then(appendStyle));\n  } else {\n    appendStyle(value);\n  }\n  return styleId;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-task.ts",
    "content": "import { type ContainerState, intToStr, type MustGetObjID, strToInt } from '../container/container';\nimport { assertDefined, assertEqual } from '../error/assert';\nimport { codeToText, QError_trackUseStore } from '../error/error';\nimport { isServerPlatform } from '../platform/platform';\nimport { assertQrl, assertSignal, createQRL, type QRLInternal } from '../qrl/qrl-class';\nimport type { QRL } from '../qrl/qrl.public';\nimport { _hW, notifyTask } from '../render/dom/notify-render';\nimport type { QwikElement } from '../render/dom/virtual-element';\nimport { handleError } from '../render/error-handling';\nimport type { RenderContext } from '../render/types';\nimport {\n  getSubscriptionManager,\n  noSerialize,\n  type NoSerialize,\n  unwrapProxy,\n} from '../state/common';\nimport { QObjectManagerSymbol } from '../state/constants';\nimport { getContext } from '../state/context';\nimport {\n  _createSignal,\n  isSignal,\n  QObjectSignalFlags,\n  type ReadonlySignal,\n  type Signal,\n  SIGNAL_IMMUTABLE,\n  SIGNAL_UNASSIGNED,\n  type SignalInternal,\n} from '../state/signal';\nimport { implicit$FirstArg } from '../util/implicit_dollar';\nimport { logError, logErrorAndStop, logOnceWarn } from '../util/log';\nimport { ComputedEvent, TaskEvent } from '../util/markers';\nimport { delay, isPromise, maybeThen, safeCall } from '../util/promises';\nimport { isFunction, isObject, type ValueOrPromise } from '../util/types';\nimport { invoke, newInvokeContext, untrack, useInvokeContext, waitAndRun } from './use-core';\nimport { useOn, useOnDocument } from './use-on';\nimport { useSequentialScope } from './use-sequential-scope';\nimport { useConstant } from './use-signal';\n\nexport const TaskFlagsIsVisibleTask = 1 << 0;\nexport const TaskFlagsIsTask = 1 << 1;\nexport const TaskFlagsIsResource = 1 << 2;\nexport const TaskFlagsIsComputed = 1 << 3;\nexport const TaskFlagsIsDirty = 1 << 4;\nexport const TaskFlagsIsCleanup = 1 << 5;\n\n// <docs markdown=\"../readme.md#Tracker\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#Tracker instead)\n/**\n * Used to signal to Qwik which state should be watched for changes.\n *\n * The `Tracker` is passed into the `taskFn` of `useTask`. It is intended to be used to wrap state\n * objects in a read proxy which signals to Qwik which properties should be watched for changes. A\n * change to any of the properties causes the `taskFn` to rerun.\n *\n * ### Example\n *\n * The `obs` passed into the `taskFn` is used to mark `state.count` as a property of interest. Any\n * changes to the `state.count` property will cause the `taskFn` to rerun.\n *\n * ```tsx\n * const Cmp = component$(() => {\n *   const store = useStore({ count: 0, doubleCount: 0 });\n *   const signal = useSignal(0);\n *   useTask$(({ track }) => {\n *     // Any signals or stores accessed inside the task will be tracked\n *     const count = track(() => store.count);\n *     // You can also pass a signal to track() directly\n *     const signalCount = track(signal);\n *     store.doubleCount = count + signalCount;\n *   });\n *   return (\n *     <div>\n *       <span>\n *         {store.count} / {store.doubleCount}\n *       </span>\n *       <button\n *         onClick$={() => {\n *           store.count++;\n *           signal.value++;\n *         }}\n *       >\n *         +\n *       </button>\n *     </div>\n *   );\n * });\n * ```\n *\n * @public\n * @see `useTask`\n */\n// </docs>\nexport interface Tracker {\n  /**\n   * Include the expression using stores / signals to track:\n   *\n   * ```tsx\n   * track(() => store.count);\n   * ```\n   *\n   * The `track()` function also returns the value of the scoped expression:\n   *\n   * ```tsx\n   * const count = track(() => store.count);\n   * ```\n   */\n  <T>(fn: () => T): T;\n\n  /**\n   * Used to track the whole object. If any property of the passed store changes, the task will be\n   * scheduled to run. Also accepts signals.\n   *\n   * Note that the change tracking is not deep. If you want to track changes to nested properties,\n   * you need to use `track` on each of them.\n   *\n   * ```tsx\n   * track(store); // returns store\n   * track(signal); // returns signal.value\n   * ```\n   */\n  <T extends object>(obj: T): T extends Signal<infer U> ? U : T;\n}\n\n/** @public */\nexport interface TaskCtx {\n  track: Tracker;\n  cleanup(callback: () => void): void;\n}\n\n/** @public */\nexport interface ResourceCtx<T> {\n  readonly track: Tracker;\n  cleanup(callback: () => void): void;\n  cache(policyOrMilliseconds: number | 'immutable'): void;\n  readonly previous: T | undefined;\n}\n\n/** @public */\nexport type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => void)>;\n\n/** @public */\nexport type ComputedFn<T> = () => T;\n\n/** @public */\nexport type ResourceFn<T> = (ctx: ResourceCtx<unknown>) => ValueOrPromise<T>;\n\n/** @public */\nexport type ResourceReturn<T> = ResourcePending<T> | ResourceResolved<T> | ResourceRejected<T>;\n\n/** @public */\nexport interface ResourcePending<T> {\n  readonly value: Promise<T>;\n  readonly loading: boolean;\n}\n\n/** @public */\nexport interface ResourceResolved<T> {\n  readonly value: Promise<T>;\n  readonly loading: boolean;\n}\n\n/** @public */\nexport interface ResourceRejected<T> {\n  readonly value: Promise<T>;\n  readonly loading: boolean;\n}\n\nexport interface ResourceReturnInternal<T> {\n  __brand: 'resource';\n  _state: 'pending' | 'resolved' | 'rejected';\n  _resolved: T | undefined;\n  _error: Error | undefined;\n  _cache: number;\n  _timeout: number;\n  value: Promise<T>;\n  loading: boolean;\n}\n/** @public */\nexport interface DescriptorBase<T = unknown, B = unknown> {\n  $qrl$: QRLInternal<T>;\n  $el$: QwikElement;\n  $flags$: number;\n  $index$: number;\n  $destroy$?: NoSerialize<() => void>;\n  $state$: B | undefined;\n}\n\n/** @public @deprecated use useVisibleTask$ or useResource$, useTask$ is for running tasks as part of the initial SSR render */\nexport type EagernessOptions = 'visible' | 'load' | 'idle';\n\n/** @public */\nexport type VisibleTaskStrategy = 'intersection-observer' | 'document-ready' | 'document-idle';\n\n/** @public */\nexport interface OnVisibleTaskOptions {\n  /**\n   * The strategy to use to determine when the \"VisibleTask\" should first execute.\n   *\n   * - `intersection-observer`: the task will first execute when the element is visible in the\n   *   viewport, under the hood it uses the IntersectionObserver API.\n   * - `document-ready`: the task will first execute when the document is ready, under the hood it\n   *   uses the document `load` event.\n   * - `document-idle`: the task will first execute when the document is idle, under the hood it uses\n   *   the requestIdleCallback API.\n   */\n  strategy?: VisibleTaskStrategy;\n}\n\n/** @public @deprecated use useVisibleTask$ or useResource$, useTask$ is for running tasks as part of the initial SSR render */\nexport interface UseTaskOptions {\n  /**\n   * - `visible`: run the effect when the element is visible.\n   * - `load`: eagerly run the effect when the application resumes.\n   */\n  eagerness?: EagernessOptions;\n}\n\n// <docs markdown=\"../readme.md#useTask\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useTask instead)\n/**\n * Reruns the `taskFn` when the observed inputs change.\n *\n * Use `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when those\n * inputs change.\n *\n * The `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs`\n * function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to\n * rerun.\n *\n * @param task - Function which should be re-executed when changes to the inputs are detected\n * @public\n *\n * ### Example\n *\n * The `useTask` function is used to observe the `store.count` property. Any changes to the\n * `store.count` cause the `taskFn` to execute which in turn updates the `store.doubleCount` to\n * the double of `store.count`.\n *\n * ```tsx\n * const Cmp = component$(() => {\n *   const store = useStore({\n *     count: 0,\n *     doubleCount: 0,\n *     debounced: 0,\n *   });\n *\n *   // Double count task\n *   useTask$(({ track }) => {\n *     const count = track(() => store.count);\n *     store.doubleCount = 2 * count;\n *   });\n *\n *   // Debouncer task\n *   useTask$(({ track }) => {\n *     const doubleCount = track(() => store.doubleCount);\n *     const timer = setTimeout(() => {\n *       store.debounced = doubleCount;\n *     }, 2000);\n *     return () => {\n *       clearTimeout(timer);\n *     };\n *   });\n *   return (\n *     <div>\n *       <div>\n *         {store.count} / {store.doubleCount}\n *       </div>\n *       <div>{store.debounced}</div>\n *     </div>\n *   );\n * });\n * ```\n *\n * @public\n * @see `Tracker`\n */\n// </docs>\nexport const useTaskQrl = (qrl: QRL<TaskFn>, opts?: UseTaskOptions): void => {\n  const { val, set, iCtx, i, elCtx } = useSequentialScope<boolean>();\n  if (val) {\n    return;\n  }\n  assertQrl(qrl);\n\n  const containerState = iCtx.$renderCtx$.$static$.$containerState$;\n  const task = new Task(TaskFlagsIsDirty | TaskFlagsIsTask, i, elCtx.$element$, qrl, undefined);\n  set(true);\n  qrl.$resolveLazy$(containerState.$containerEl$);\n  if (!elCtx.$tasks$) {\n    elCtx.$tasks$ = [];\n  }\n  elCtx.$tasks$.push(task);\n  waitAndRun(iCtx, () => runTask(task, containerState, iCtx.$renderCtx$));\n  if (isServerPlatform()) {\n    useRunTask(task, opts?.eagerness);\n  }\n};\n\n/** @public */\nexport const createComputedQrl = <T>(qrl: QRL<ComputedFn<T>>): Signal<Awaited<T>> => {\n  assertQrl(qrl);\n  const iCtx = useInvokeContext();\n  const hostElement = iCtx.$hostElement$;\n  const containerState = iCtx.$renderCtx$.$static$.$containerState$;\n  const elCtx = getContext(hostElement, containerState);\n  const signal = _createSignal(\n    undefined as Awaited<T>,\n    containerState,\n    SIGNAL_UNASSIGNED | SIGNAL_IMMUTABLE,\n    undefined\n  );\n\n  const task = new Task(\n    TaskFlagsIsDirty | TaskFlagsIsTask | TaskFlagsIsComputed,\n    // Computed signals should update immediately\n    0,\n    elCtx.$element$,\n    qrl,\n    signal\n  );\n  qrl.$resolveLazy$(containerState.$containerEl$);\n  (elCtx.$tasks$ ||= []).push(task);\n\n  waitAndRun(iCtx, () => runComputed(task, containerState, iCtx.$renderCtx$));\n  return signal as ReadonlySignal<Awaited<T>>;\n};\n/** @public */\nexport const useComputedQrl = <T>(qrl: QRL<ComputedFn<T>>): Signal<Awaited<T>> => {\n  return useConstant(() => createComputedQrl(qrl));\n};\n\n/**\n * Returns a computed signal which is calculated from the given function. A computed signal is a\n * signal which is calculated from other signals. When the signals change, the computed signal is\n * recalculated, and if the result changed, all tasks which are tracking the signal will be re-run\n * and all components that read the signal will be re-rendered.\n *\n * The function must be synchronous and must not have any side effects.\n *\n * Async functions are deprecated because:\n *\n * - When calculating the first time, it will see it's a promise and it will restart the render\n *   function.\n * - Qwik can't track used signals after the first await, which leads to subtle bugs.\n * - Both `useTask$` and `useResource$` are available, without these problems.\n *\n * In v2, async functions won't work.\n *\n * @public\n */\nexport const useComputed$ = implicit$FirstArg(useComputedQrl);\n/**\n * Returns read-only signal that updates when signals used in the `ComputedFn` change. Unlike\n * useComputed$, this is not a hook and it always creates a new signal.\n *\n * @deprecated This is a technology preview\n * @public\n */\nexport const createComputed$ = implicit$FirstArg(createComputedQrl);\n\n// <docs markdown=\"../readme.md#useTask\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useTask instead)\n/**\n * Reruns the `taskFn` when the observed inputs change.\n *\n * Use `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when those\n * inputs change.\n *\n * The `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs`\n * function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to\n * rerun.\n *\n * @param task - Function which should be re-executed when changes to the inputs are detected\n * @public\n *\n * ### Example\n *\n * The `useTask` function is used to observe the `store.count` property. Any changes to the\n * `store.count` cause the `taskFn` to execute which in turn updates the `store.doubleCount` to\n * the double of `store.count`.\n *\n * ```tsx\n * const Cmp = component$(() => {\n *   const store = useStore({\n *     count: 0,\n *     doubleCount: 0,\n *     debounced: 0,\n *   });\n *\n *   // Double count task\n *   useTask$(({ track }) => {\n *     const count = track(() => store.count);\n *     store.doubleCount = 2 * count;\n *   });\n *\n *   // Debouncer task\n *   useTask$(({ track }) => {\n *     const doubleCount = track(() => store.doubleCount);\n *     const timer = setTimeout(() => {\n *       store.debounced = doubleCount;\n *     }, 2000);\n *     return () => {\n *       clearTimeout(timer);\n *     };\n *   });\n *   return (\n *     <div>\n *       <div>\n *         {store.count} / {store.doubleCount}\n *       </div>\n *       <div>{store.debounced}</div>\n *     </div>\n *   );\n * });\n * ```\n *\n * @public\n * @see `Tracker`\n */\n// </docs>\nexport const useTask$ = /*#__PURE__*/ implicit$FirstArg(useTaskQrl);\n\n// <docs markdown=\"../readme.md#useVisibleTask\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useVisibleTask instead)\n/**\n * ```tsx\n * const Timer = component$(() => {\n *   const store = useStore({\n *     count: 0,\n *   });\n *\n *   useVisibleTask$(() => {\n *     // Only runs in the client\n *     const timer = setInterval(() => {\n *       store.count++;\n *     }, 500);\n *     return () => {\n *       clearInterval(timer);\n *     };\n *   });\n *\n *   return <div>{store.count}</div>;\n * });\n * ```\n *\n * @public\n */\n// </docs>\nexport const useVisibleTaskQrl = (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions): void => {\n  const { val, set, i, iCtx, elCtx } = useSequentialScope<Task<TaskFn>>();\n  const eagerness = opts?.strategy ?? 'intersection-observer';\n  if (val) {\n    if (isServerPlatform()) {\n      useRunTask(val, eagerness);\n    }\n    return;\n  }\n  assertQrl(qrl);\n  const task = new Task(TaskFlagsIsVisibleTask, i, elCtx.$element$, qrl, undefined);\n  const containerState = iCtx.$renderCtx$.$static$.$containerState$;\n  if (!elCtx.$tasks$) {\n    elCtx.$tasks$ = [];\n  }\n  elCtx.$tasks$.push(task);\n  set(task);\n  useRunTask(task, eagerness);\n  if (!isServerPlatform()) {\n    qrl.$resolveLazy$(containerState.$containerEl$);\n    notifyTask(task, containerState);\n  }\n};\n\n// <docs markdown=\"../readme.md#useVisibleTask\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useVisibleTask instead)\n/**\n * ```tsx\n * const Timer = component$(() => {\n *   const store = useStore({\n *     count: 0,\n *   });\n *\n *   useVisibleTask$(() => {\n *     // Only runs in the client\n *     const timer = setInterval(() => {\n *       store.count++;\n *     }, 500);\n *     return () => {\n *       clearInterval(timer);\n *     };\n *   });\n *\n *   return <div>{store.count}</div>;\n * });\n * ```\n *\n * @public\n */\n// </docs>\nexport const useVisibleTask$ = /*#__PURE__*/ implicit$FirstArg(useVisibleTaskQrl);\n\nexport type TaskDescriptor = DescriptorBase<TaskFn>;\n\nexport interface ResourceDescriptor<T>\n  extends DescriptorBase<ResourceFn<T>, ResourceReturnInternal<T>> {}\n\nexport interface ComputedDescriptor<T> extends DescriptorBase<ComputedFn<T>, Signal<T>> {}\n\nexport type SubscriberHost = QwikElement;\n\nexport type SubscriberEffect =\n  | TaskDescriptor\n  | ResourceDescriptor<unknown>\n  | ComputedDescriptor<unknown>;\n\nexport const isResourceTask = (task: SubscriberEffect): task is ResourceDescriptor<unknown> => {\n  return (task.$flags$ & TaskFlagsIsResource) !== 0;\n};\n\nexport const isComputedTask = (task: SubscriberEffect): task is ComputedDescriptor<unknown> => {\n  return (task.$flags$ & TaskFlagsIsComputed) !== 0;\n};\nexport const runSubscriber = async (\n  task: SubscriberEffect,\n  containerState: ContainerState,\n  rCtx: RenderContext\n) => {\n  assertEqual(!!(task.$flags$ & TaskFlagsIsDirty), true, 'Resource is not dirty', task);\n  if (isResourceTask(task)) {\n    return runResource(task, containerState, rCtx);\n  } else if (isComputedTask(task)) {\n    return runComputed(task, containerState, rCtx);\n  } else {\n    return runTask(task, containerState, rCtx);\n  }\n};\n\nexport const runResource = <T>(\n  task: ResourceDescriptor<T>,\n  containerState: ContainerState,\n  rCtx: RenderContext,\n  waitOn?: Promise<unknown>\n): ValueOrPromise<void> => {\n  task.$flags$ &= ~TaskFlagsIsDirty;\n  cleanupTask(task);\n\n  const el = task.$el$;\n  const iCtx = newInvokeContext(rCtx.$static$.$locale$, el, undefined, TaskEvent);\n  const { $subsManager$: subsManager } = containerState;\n  iCtx.$renderCtx$ = rCtx;\n  const taskFn = task.$qrl$.getFn(iCtx, () => {\n    subsManager.$clearSub$(task);\n  });\n\n  const cleanups: (() => void)[] = [];\n  const resource = task.$state$;\n  assertDefined(\n    resource,\n    'useResource: when running a resource, \"task.r\" must be a defined.',\n    task\n  );\n\n  const track: Tracker = (obj: (() => unknown) | object | Signal, prop?: string) => {\n    if (isFunction(obj)) {\n      const ctx = newInvokeContext();\n      ctx.$renderCtx$ = rCtx;\n      ctx.$subscriber$ = [0, task];\n      return invoke(ctx, obj);\n    }\n    const manager = getSubscriptionManager(obj);\n    if (manager) {\n      manager.$addSub$([0, task], prop);\n    } else {\n      logErrorAndStop(codeToText(QError_trackUseStore), obj);\n    }\n    if (prop) {\n      return (obj as Record<string, unknown>)[prop];\n    } else if (isSignal(obj)) {\n      return obj.value;\n    } else {\n      return obj;\n    }\n  };\n  const resourceTarget = unwrapProxy(resource);\n  const opts: ResourceCtx<T> = {\n    track,\n    cleanup(callback) {\n      cleanups.push(callback);\n    },\n    cache(policy) {\n      let milliseconds = 0;\n      if (policy === 'immutable') {\n        milliseconds = Infinity;\n      } else {\n        milliseconds = policy;\n      }\n      resource._cache = milliseconds;\n    },\n    previous: resourceTarget._resolved,\n  };\n\n  let resolve: (v: T) => void;\n  let reject: (v: unknown) => void;\n  let done = false;\n\n  const setState = (resolved: boolean, value: T | Error) => {\n    if (!done) {\n      done = true;\n      if (resolved) {\n        done = true;\n        resource.loading = false;\n        resource._state = 'resolved';\n        resource._resolved = value as T;\n        resource._error = undefined;\n\n        resolve(value as T);\n      } else {\n        done = true;\n        resource.loading = false;\n        resource._state = 'rejected';\n        resource._error = value as Error;\n        reject(value as Error);\n      }\n      return true;\n    }\n    return false;\n  };\n\n  // Execute mutation inside empty invocation\n  invoke(iCtx, () => {\n    resource._state = 'pending';\n    resource.loading = !isServerPlatform();\n    resource.value = new Promise((r, re) => {\n      resolve = r;\n      reject = re;\n    });\n  });\n\n  task.$destroy$ = noSerialize(() => {\n    done = true;\n    cleanups.forEach((fn) => fn());\n  });\n\n  const promise = safeCall(\n    () => maybeThen(waitOn, () => taskFn(opts)),\n    (value) => {\n      setState(true, value);\n    },\n    (reason) => {\n      setState(false, reason);\n    }\n  );\n\n  const timeout = resourceTarget._timeout;\n  if (timeout > 0) {\n    return Promise.race([\n      promise,\n      delay(timeout).then(() => {\n        if (setState(false, new Error('timeout'))) {\n          cleanupTask(task);\n        }\n      }),\n    ]);\n  }\n  return promise;\n};\n\nexport const runTask = (\n  task: TaskDescriptor | ComputedDescriptor<unknown>,\n  containerState: ContainerState,\n  rCtx: RenderContext\n): ValueOrPromise<void> => {\n  task.$flags$ &= ~TaskFlagsIsDirty;\n\n  cleanupTask(task);\n  const hostElement = task.$el$;\n  const iCtx = newInvokeContext(rCtx.$static$.$locale$, hostElement, undefined, TaskEvent);\n  iCtx.$renderCtx$ = rCtx;\n  const { $subsManager$: subsManager } = containerState;\n  const taskFn = task.$qrl$.getFn(iCtx, () => {\n    subsManager.$clearSub$(task);\n  }) as TaskFn;\n  const track: Tracker = (obj: (() => unknown) | object | Signal, prop?: string) => {\n    if (isFunction(obj)) {\n      const ctx = newInvokeContext();\n      ctx.$subscriber$ = [0, task];\n      return invoke(ctx, obj);\n    }\n    const manager = getSubscriptionManager(obj);\n    if (manager) {\n      manager.$addSub$([0, task], prop);\n    } else {\n      logErrorAndStop(codeToText(QError_trackUseStore), obj);\n    }\n    if (prop) {\n      return (obj as Record<string, unknown>)[prop];\n    } else if (isSignal(obj)) {\n      return obj.value;\n    } else {\n      return obj;\n    }\n  };\n  const cleanups: (() => void)[] = [];\n  task.$destroy$ = noSerialize(() => {\n    cleanups.forEach((fn) => fn());\n  });\n\n  const opts: TaskCtx = {\n    track,\n    cleanup(callback) {\n      cleanups.push(callback);\n    },\n  };\n  return safeCall(\n    () => taskFn(opts),\n    (returnValue) => {\n      if (isFunction(returnValue)) {\n        cleanups.push(returnValue);\n      }\n    },\n    (reason) => {\n      handleError(reason, hostElement, rCtx);\n    }\n  );\n};\n\nexport const runComputed = (\n  task: ComputedDescriptor<unknown>,\n  containerState: ContainerState,\n  rCtx: RenderContext\n): ValueOrPromise<void> => {\n  assertSignal(task.$state$);\n  task.$flags$ &= ~TaskFlagsIsDirty;\n  cleanupTask(task);\n  const hostElement = task.$el$;\n  const iCtx = newInvokeContext(rCtx.$static$.$locale$, hostElement, undefined, ComputedEvent);\n  iCtx.$subscriber$ = [0, task];\n  iCtx.$renderCtx$ = rCtx;\n\n  const { $subsManager$: subsManager } = containerState;\n  const taskFn = task.$qrl$.getFn(iCtx, () => {\n    subsManager.$clearSub$(task);\n  }) as ComputedFn<unknown>;\n\n  const ok = (returnValue: any) => {\n    untrack(() => {\n      const signal = task.$state$! as SignalInternal<unknown>;\n      signal[QObjectSignalFlags] &= ~SIGNAL_UNASSIGNED;\n      if (signal.untrackedValue !== returnValue) {\n        signal.untrackedValue = returnValue;\n        signal[QObjectManagerSymbol].$notifySubs$();\n      }\n    });\n  };\n  const fail = (reason: unknown) => {\n    handleError(reason, hostElement, rCtx);\n  };\n  try {\n    return maybeThen(task.$qrl$.$resolveLazy$(containerState.$containerEl$), () => {\n      const result = taskFn();\n      if (isPromise(result)) {\n        const warningMessage =\n          'useComputed$: Async functions in computed tasks are deprecated and will stop working in v2. Use useTask$ or useResource$ instead.';\n        const stack = new Error(warningMessage).stack;\n        if (!stack) {\n          logOnceWarn(warningMessage);\n        } else {\n          const lessScaryStack = stack.replace(/^Error:\\s*/, '');\n          logOnceWarn(lessScaryStack);\n        }\n\n        return result.then(ok, fail);\n      } else {\n        ok(result);\n      }\n    });\n  } catch (reason) {\n    fail(reason);\n  }\n};\n\nexport const cleanupTask = (task: SubscriberEffect) => {\n  const destroy = task.$destroy$;\n  if (destroy) {\n    task.$destroy$ = undefined;\n    try {\n      destroy();\n    } catch (err) {\n      logError(err);\n    }\n  }\n};\n\nexport const destroyTask = (task: SubscriberEffect) => {\n  if (task.$flags$ & TaskFlagsIsCleanup) {\n    task.$flags$ &= ~TaskFlagsIsCleanup;\n    const cleanup = task.$qrl$;\n    (cleanup as Function)();\n  } else {\n    cleanupTask(task);\n  }\n};\n\nconst useRunTask = (\n  task: SubscriberEffect,\n  eagerness: VisibleTaskStrategy | EagernessOptions | undefined\n) => {\n  if (eagerness === 'visible' || eagerness === 'intersection-observer') {\n    useOn('qvisible', getTaskHandlerQrl(task));\n  } else if (eagerness === 'load' || eagerness === 'document-ready') {\n    useOnDocument('qinit', getTaskHandlerQrl(task));\n  } else if (eagerness === 'idle' || eagerness === 'document-idle') {\n    useOnDocument('qidle', getTaskHandlerQrl(task));\n  }\n};\n\nconst getTaskHandlerQrl = (task: SubscriberEffect): QRL<(ev: Event) => void> => {\n  const taskQrl = task.$qrl$;\n  const taskHandler = createQRL<(ev: Event) => void>(\n    taskQrl.$chunk$,\n    '_hW',\n    _hW,\n    null,\n    null,\n    [task],\n    taskQrl.$symbol$\n  );\n  // Needed for chunk lookup in dev mode\n  if (taskQrl.dev) {\n    taskHandler.dev = taskQrl.dev;\n  }\n  return taskHandler;\n};\n\nexport const isTaskCleanup = (obj: unknown): obj is TaskDescriptor => {\n  return isSubscriberDescriptor(obj) && !!(obj.$flags$ & TaskFlagsIsCleanup);\n};\n\nexport const isSubscriberDescriptor = (obj: unknown): obj is SubscriberEffect => {\n  return isObject(obj) && obj instanceof Task;\n};\n\nexport const serializeTask = (task: SubscriberEffect, getObjId: MustGetObjID) => {\n  let value = `${intToStr(task.$flags$)} ${intToStr(task.$index$)} ${getObjId(\n    task.$qrl$\n  )} ${getObjId(task.$el$)}`;\n  if (task.$state$) {\n    value += ` ${getObjId(task.$state$)}`;\n  }\n  return value;\n};\n\nexport const parseTask = (data: string) => {\n  const [flags, index, qrl, el, resource] = data.split(' ');\n  return new Task(strToInt(flags), strToInt(index), el as any, qrl as any, resource as any);\n};\n\nexport class Task<T = unknown, B = T> implements DescriptorBase<unknown, Signal<B>> {\n  constructor(\n    public $flags$: number,\n    public $index$: number,\n    public $el$: QwikElement,\n    public $qrl$: QRLInternal<T>,\n    public $state$: Signal<B> | undefined\n  ) {}\n}\n"
  },
  {
    "path": "packages/qwik/src/core/use/use-task.unit.ts",
    "content": "import { describe, expectTypeOf, test } from 'vitest';\nimport { component$ } from '../component/component.public';\nimport { useResource$ } from './use-resource';\nimport { useSignal } from './use-signal';\nimport { useStore } from './use-store.public';\nimport { useTask$ } from './use-task';\n\ndescribe('types', () => {\n  test('track', () => () => {\n    component$(() => {\n      const sig = useSignal(1);\n      const store = useStore({ count: 1 });\n      useResource$(({ track }) => {\n        expectTypeOf(track(store)).toEqualTypeOf(store);\n        expectTypeOf(track(sig)).toEqualTypeOf<number>();\n        expectTypeOf(track(() => sig.value)).toEqualTypeOf<number>();\n        expectTypeOf(track(() => store.count)).toEqualTypeOf<number>();\n      });\n      useTask$(({ track }) => {\n        expectTypeOf(track(store)).toEqualTypeOf(store);\n        expectTypeOf(track(sig)).toEqualTypeOf<number>();\n        expectTypeOf(track(() => sig.value)).toEqualTypeOf<number>();\n        expectTypeOf(track(() => store.count)).toEqualTypeOf<number>();\n      });\n      return null;\n    });\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/core/util/README.md",
    "content": "# `util`\n\nCommon utilities that are not tied to any one rendering technology/framework.\n"
  },
  {
    "path": "packages/qwik/src/core/util/case.ts",
    "content": "export const fromCamelToKebabCase = (text: string): string => {\n  return text.replace(/([A-Z])/g, '-$1').toLowerCase();\n};\n\nexport const fromKebabToCamelCase = (text: string): string => {\n  return text.replace(/-./g, (x) => x[1].toUpperCase());\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/case.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { fromCamelToKebabCase } from './case';\n\ntest('should convert to kebab', () => {\n  assert.equal(fromCamelToKebabCase('HelloWorld'), '-hello-world');\n  assert.equal(fromCamelToKebabCase('on:ClicK'), 'on:-clic-k');\n  assert.equal(fromCamelToKebabCase('a:b'), 'a:b');\n});\n"
  },
  {
    "path": "packages/qwik/src/core/util/dom.ts",
    "content": "import { assertDefined } from '../error/assert';\nimport type { QwikElement } from '../render/dom/virtual-element';\nimport { qDynamicPlatform } from './qdev';\n\nexport const getDocument = (node: QwikElement | Document): Document => {\n  if (!qDynamicPlatform) {\n    return document;\n  }\n  if (typeof document !== 'undefined') {\n    return document;\n  }\n  if (node.nodeType === 9) {\n    return node as any as Document;\n  }\n  const doc = node.ownerDocument;\n  assertDefined(doc, 'doc must be defined');\n  return doc!;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/element.ts",
    "content": "import type { QwikElement, VirtualElement } from '../render/dom/virtual-element';\n\nexport const isNode = (value: any): value is Node => {\n  return value && typeof value.nodeType === 'number';\n};\n\nexport const isDocument = (value: Node): value is Document => {\n  return (value as any).nodeType === 9;\n};\n\nexport const isElement = (value: object): value is Element => {\n  return (value as any).nodeType === 1;\n};\n\nexport const isQwikElement = (value: object): value is QwikElement => {\n  const nodeType = (value as any).nodeType;\n  return nodeType === 1 || nodeType === 111;\n};\n\nexport const isNodeElement = (value: object): value is QwikElement => {\n  const nodeType = (value as any).nodeType;\n  return nodeType === 1 || nodeType === 111 || nodeType === 3;\n};\n\nexport const isVirtualElement = (value: object): value is VirtualElement => {\n  return (value as any).nodeType === 111;\n};\n\nexport const isVirtualElementOpenComment = (value: Node | VirtualElement): value is Comment => {\n  return isComment(value) && value.data.startsWith('qv ');\n};\n\nexport const isText = (value: Node | QwikElement): value is Text => {\n  return (value as any).nodeType === 3;\n};\n\nexport const isComment = (value: Node | QwikElement): value is Comment => {\n  return (value as any).nodeType === 8;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/event.ts",
    "content": "// keep this import from qwik/build so the cjs build works\nimport { isBrowser } from '@builder.io/qwik/build';\nimport { qTest } from './qdev';\n\nexport const emitEvent = (\n  el: Element | undefined,\n  eventName: string,\n  detail: any,\n  bubbles: boolean\n) => {\n  if (!qTest && (isBrowser || typeof CustomEvent === 'function')) {\n    if (el) {\n      el.dispatchEvent(\n        new CustomEvent(eventName, {\n          detail,\n          bubbles: bubbles,\n          composed: bubbles,\n        })\n      );\n    }\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/flyweight.ts",
    "content": "// import { qDev } from './qdev';\n\nimport { qDev } from './qdev';\n\nexport const EMPTY_ARRAY = [] as any[];\nexport const EMPTY_OBJ = {} as Record<string, any>;\n\nif (qDev) {\n  Object.freeze(EMPTY_ARRAY);\n  Object.freeze(EMPTY_OBJ);\n}\n"
  },
  {
    "path": "packages/qwik/src/core/util/hash_code.ts",
    "content": "export const hashCode = (text: string, hash: number = 0) => {\n  for (let i = 0; i < text.length; i++) {\n    const chr = text.charCodeAt(i);\n    hash = (hash << 5) - hash + chr;\n    hash |= 0; // Convert to 32bit integer\n  }\n  return Number(Math.abs(hash)).toString(36);\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/implicit_dollar.ts",
    "content": "import { $, type QRL } from '../qrl/qrl.public';\n\n// <docs markdown=\"../readme.md#implicit$FirstArg\">\n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#implicit$FirstArg instead)\n/**\n * Create a `____$(...)` convenience method from `___(...)`.\n *\n * It is very common for functions to take a lazy-loadable resource as a first argument. For this\n * reason, the Qwik Optimizer automatically extracts the first argument from any function which ends\n * in `$`.\n *\n * This means that `foo$(arg0)` and `foo($(arg0))` are equivalent with respect to Qwik Optimizer.\n * The former is just a shorthand for the latter.\n *\n * For example, these function calls are equivalent:\n *\n * - `component$(() => {...})` is same as `component($(() => {...}))`\n *\n * ```tsx\n * export function myApi(callback: QRL<() => void>): void {\n *   // ...\n * }\n *\n * export const myApi$ = implicit$FirstArg(myApi);\n * // type of myApi$: (callback: () => void): void\n *\n * // can be used as:\n * myApi$(() => console.log('callback'));\n *\n * // will be transpiled to:\n * // FILE: <current file>\n * myApi(qrl('./chunk-abc.js', 'callback'));\n *\n * // FILE: chunk-abc.js\n * export const callback = () => console.log('callback');\n * ```\n *\n * @param fn - A function that should have its first argument automatically `$`.\n * @public\n */\n// </docs>\nexport const implicit$FirstArg = <FIRST, REST extends any[], RET>(\n  fn: (qrl: QRL<FIRST>, ...rest: REST) => RET\n): ((qrl: FIRST, ...rest: REST) => RET) => {\n  return function (first: FIRST, ...rest: REST): RET {\n    return fn.call(null, $(first), ...rest);\n  };\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/log.ts",
    "content": "import type { QwikElement } from '../render/dom/virtual-element';\nimport type { QContext } from '../state/context';\nimport { isElement, isNode } from './element';\nimport { qDev, qTest } from './qdev';\n\nconst STYLE = qDev\n  ? `background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;`\n  : '';\n\nexport const logError = (message?: any, ...optionalParams: any[]) => {\n  return createAndLogError(false, message, ...optionalParams);\n};\n\nexport const throwErrorAndStop = (message?: any, ...optionalParams: any[]): never => {\n  const error = createAndLogError(false, message, ...optionalParams);\n  // eslint-disable-next-line no-debugger\n  debugger;\n  throw error;\n};\n\nexport const logErrorAndStop = (message?: any, ...optionalParams: any[]) => {\n  const err = createAndLogError(qDev, message, ...optionalParams);\n  // eslint-disable-next-line no-debugger\n  debugger;\n  return err;\n};\n\nconst _printed = /*#__PURE__*/ new Set<string>();\n\nexport const logOnceWarn = (message?: any, ...optionalParams: any[]) => {\n  if (qDev) {\n    const key = 'warn' + String(message);\n    if (!_printed.has(key)) {\n      _printed.add(key);\n      logWarn(message, ...optionalParams);\n    }\n  }\n};\n\nexport const logWarn = (message?: any, ...optionalParams: any[]) => {\n  if (qDev) {\n    console.warn('%cQWIK WARN', STYLE, message, ...printParams(optionalParams));\n  }\n};\n\nexport const logDebug = (message?: string, ...optionalParams: any[]) => {\n  if (qDev) {\n    // eslint-disable-next-line no-console\n    console.debug('%cQWIK', STYLE, message, ...printParams(optionalParams));\n  }\n};\n\nexport const tryGetContext = (element: QwikElement): QContext | undefined => {\n  return (element as any)['_qc_'];\n};\n\nconst printParams = (optionalParams: any[]) => {\n  if (qDev) {\n    return optionalParams.map((p) => {\n      if (isNode(p) && isElement(p)) {\n        return printElement(p);\n      }\n      return p;\n    });\n  }\n  return optionalParams;\n};\n\nconst printElement = (el: Element) => {\n  const ctx = tryGetContext(el);\n  const isServer: boolean = /*#__PURE__*/ (() =>\n    typeof process !== 'undefined' && !!process.versions && !!process.versions.node)();\n\n  return {\n    tagName: el.tagName,\n    renderQRL: ctx?.$componentQrl$?.getSymbol(),\n    element: isServer ? undefined : el,\n    ctx: isServer ? undefined : ctx,\n  };\n};\n\nconst createAndLogError = (asyncThrow: boolean, message?: any, ...optionalParams: any[]) => {\n  const err = message instanceof Error ? message : new Error(message);\n\n  // display the error message first, then the optional params, and finally the stack trace\n  // the stack needs to be displayed last because the given params will be lost among large stack traces so it will\n  // provide a bad developer experience\n  console.error('%cQWIK ERROR', STYLE, err.message, ...printParams(optionalParams), err.stack);\n\n  asyncThrow &&\n    !qTest &&\n    setTimeout(() => {\n      // throwing error asynchronously to avoid breaking the current call stack.\n      // We throw so that the error is delivered to the global error handler for\n      // reporting it to a third-party tools such as Qwik Insights, Sentry or New Relic.\n      throw err;\n    }, 0);\n  return err;\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/markers.ts",
    "content": "/** State factory of the component. */\nexport const OnRenderProp = 'q:renderFn';\n\n/** Component style host prefix */\nexport const ComponentStylesPrefixHost = '💎';\n\n/** Component style content prefix */\nexport const ComponentStylesPrefixContent = '⭐️';\n\n/** Prefix used to identify on listeners. */\nexport const EventPrefix = 'on:';\n\n/** Attribute used to mark that an event listener is attached. */\nexport const EventAny = 'on:.';\n/** `<some-element q:slot=\"...\">` */\nexport const QSlot = 'q:slot';\nexport const QSlotRef = 'q:sref';\nexport const QSlotS = 'q:s';\nexport const QStyle = 'q:style';\nexport const QScopedStyle = 'q:sstyle';\nexport const QCtxAttr = 'q:ctx';\nexport const QManifestHash = 'q:manifest-hash';\nexport const QInstance = 'q:instance';\nexport const QFuncsPrefix = 'qFuncs_';\n\nexport const getQFuncs = (document: Document, hash: string): Function[] => {\n  return (document as any)[QFuncsPrefix + hash] || [];\n};\n\nexport const QLocaleAttr = 'q:locale';\nexport const QContainerAttr = 'q:container';\nexport const QBaseAttr = 'q:base';\nexport const QContainerSelector = '[q\\\\:container]';\n\nexport const ResourceEvent = 'qResource';\nexport const ComputedEvent = 'qComputed';\nexport const RenderEvent = 'qRender';\nexport const TaskEvent = 'qTask';\n\n/** `<q:slot name=\"...\">` */\nexport const QSlotInertName = '\\u0000';\n\nexport const ELEMENT_ID = 'q:id';\nexport const ELEMENT_ID_SELECTOR = '[q\\\\:id]';\nexport const ELEMENT_ID_PREFIX = '#';\nexport const INLINE_FN_PREFIX = '@';\n"
  },
  {
    "path": "packages/qwik/src/core/util/promises.ts",
    "content": "import type { ValueOrPromise } from './types';\n\nexport type PromiseTree<T> = T | Promise<T> | Promise<T[]> | Array<PromiseTree<T>>;\n\nexport const isPromise = (value: any): value is Promise<any> => {\n  // not using \"value instanceof Promise\" to have zone.js support\n  return value && typeof value.then === 'function';\n};\n\nexport const safeCall = <T, B, C>(\n  call: () => ValueOrPromise<T>,\n  thenFn: { f(arg: Awaited<T>): ValueOrPromise<B> }['f'],\n  rejectFn: { f(reason: any): ValueOrPromise<C> }['f']\n): ValueOrPromise<B | C> => {\n  try {\n    const promise = call();\n    if (isPromise(promise)) {\n      return promise.then(thenFn as any, rejectFn);\n    } else {\n      return thenFn(promise as any);\n    }\n  } catch (e) {\n    return rejectFn(e);\n  }\n};\n\nexport const maybeThen = <T, B>(\n  promise: ValueOrPromise<T>,\n  thenFn: (arg: Awaited<T>) => ValueOrPromise<B>\n): ValueOrPromise<B> => {\n  return isPromise(promise) ? promise.then(thenFn as any) : thenFn(promise as any);\n};\n\nexport const promiseAll = <T extends readonly unknown[] | []>(\n  promises: T\n): ValueOrPromise<{ -readonly [P in keyof T]: Awaited<T[P]> }> => {\n  const hasPromise = promises.some(isPromise);\n  if (hasPromise) {\n    return Promise.all(promises);\n  }\n  return promises as any;\n};\n\nexport const promiseAllLazy = <T extends readonly unknown[] | []>(\n  promises: T\n): ValueOrPromise<void> => {\n  if (promises.length > 0) {\n    return Promise.all(promises) as any;\n  }\n  return promises as any;\n};\n\nexport const isNotNullable = <T>(v: T): v is NonNullable<T> => {\n  return v != null;\n};\n\nexport const delay = (timeout: number) => {\n  return new Promise((resolve) => {\n    setTimeout(resolve, timeout);\n  });\n};\n"
  },
  {
    "path": "packages/qwik/src/core/util/qdev.ts",
    "content": "export const qDev = globalThis.qDev !== false;\nexport const qInspector = globalThis.qInspector === true;\nexport const qSerialize = globalThis.qSerialize !== false;\nexport const qDynamicPlatform = globalThis.qDynamicPlatform !== false;\nexport const qTest = globalThis.qTest === true;\nexport const qRuntimeQrl = globalThis.qRuntimeQrl === true;\n\nexport const seal = (obj: any) => {\n  if (qDev) {\n    Object.seal(obj);\n  }\n};\n\ndeclare const globalThis: any;\n"
  },
  {
    "path": "packages/qwik/src/core/util/types.ts",
    "content": "/** @private */\nexport const isHtmlElement = (node: unknown): node is Element => {\n  return node ? (node as Node).nodeType === 1 : false;\n};\n\nexport const isSerializableObject = (v: unknown): v is Record<string, unknown> => {\n  const proto = Object.getPrototypeOf(v);\n  return proto === Object.prototype || proto === null;\n};\n\nexport const isObject = (v: unknown): v is object => {\n  return !!v && typeof v === 'object';\n};\n\nexport const isArray = (v: unknown): v is unknown[] => {\n  return Array.isArray(v);\n};\n\nexport const isString = (v: unknown): v is string => {\n  return typeof v === 'string';\n};\n\nexport const isFunction = <T extends (...args: any) => any>(v: unknown): v is T => {\n  return typeof v === 'function';\n};\n\n/**\n * Type representing a value which is either resolve or a promise.\n *\n * @public\n */\nexport type ValueOrPromise<T> = T | Promise<T>;\n"
  },
  {
    "path": "packages/qwik/src/core/util/unitless_number.ts",
    "content": "/** CSS properties which accept numbers but are not in units of \"px\". */\nconst unitlessNumbers = new Set([\n  'animationIterationCount',\n  'aspectRatio',\n  'borderImageOutset',\n  'borderImageSlice',\n  'borderImageWidth',\n  'boxFlex',\n  'boxFlexGroup',\n  'boxOrdinalGroup',\n  'columnCount',\n  'columns',\n  'flex',\n  'flexGrow',\n  'flexShrink',\n  'gridArea',\n  'gridRow',\n  'gridRowEnd',\n  'gridRowStart',\n  'gridColumn',\n  'gridColumnEnd',\n  'gridColumnStart',\n  'fontWeight',\n  'lineClamp',\n  'lineHeight',\n  'opacity',\n  'order',\n  'orphans',\n  'scale',\n  'tabSize',\n  'widows',\n  'zIndex',\n  'zoom',\n  'MozAnimationIterationCount', // Known Prefixed Properties\n  'MozBoxFlex', // TODO: Remove these since they shouldn't be used in modern code\n  'msFlex',\n  'msFlexPositive',\n  'WebkitAnimationIterationCount',\n  'WebkitBoxFlex',\n  'WebkitBoxOrdinalGroup',\n  'WebkitColumnCount',\n  'WebkitColumns',\n  'WebkitFlex',\n  'WebkitFlexGrow',\n  'WebkitFlexShrink',\n  'WebkitLineClamp',\n]);\n\nexport const isUnitlessNumber = (name: string): boolean => {\n  return unitlessNumbers.has(name);\n};\n"
  },
  {
    "path": "packages/qwik/src/core/version.ts",
    "content": "/**\n * QWIK_VERSION\n *\n * @public\n */\nexport const version = (globalThis as any).QWIK_VERSION as string;\n"
  },
  {
    "path": "packages/qwik/src/jsx-runtime.ts",
    "content": "export { jsx, jsxs, jsxDEV, Fragment } from './core';\nexport type { JSX, JSXNode, FunctionComponent } from './core';\n"
  },
  {
    "path": "packages/qwik/src/napi/Cargo.toml",
    "content": "[package]\nauthors = [\"Manu Mtz.-Almeida <manu@builder.io>\"]\nname = \"qwik_napi\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[lib]\ncrate-type = [\"cdylib\"]\n\n[dependencies]\nnapi = { version = \"2\", features = [\"serde-json\"] }\nnapi-derive = \"2\"\nqwik-core = { path = \"../optimizer/core\", features = [\"fs\", \"parallel\"] }\n\n[target.'cfg(windows)'.dependencies]\nmimalloc = { version = \"0.1.25\", default-features = false }\n\n[build-dependencies]\nnapi-build = { version = \"2\" }\n"
  },
  {
    "path": "packages/qwik/src/napi/Cargo.toml.template",
    "content": "[package]\nauthors = [\"Manu Mtz.-Almeida <manu@builder.io>\"]\nname = \"qwik-napi\"\nversion = \"0.0.0\"\nedition = \"2021\"\n\n[lib]\ncrate-type = [\"cdylib\"]\n\n[dependencies]\nnapi = { version = \"1\", features = [\"serde-json\"] }\nnapi-derive = \"1\"\nqwik-core = { path = \"../optimizer/core\" }\n\n[target.'cfg(windows)'.dependencies]\nmimalloc = { version = \"0.1.25\", default-features = false }\n\n[build-dependencies]\nnapi-build = { version = \"1\" }\n"
  },
  {
    "path": "packages/qwik/src/napi/build.rs",
    "content": "extern crate napi_build;\n\nfn main() {\n\tnapi_build::setup();\n}\n"
  },
  {
    "path": "packages/qwik/src/napi/napi.config.json",
    "content": "{\n  \"napi\": {\n    \"name\": \"qwik\",\n    \"triples\": {\n      \"defaults\": true\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/napi/src/lib.rs",
    "content": "#![deny(clippy::all)]\n#![deny(clippy::perf)]\n#![deny(clippy::nursery)]\n\nextern crate napi;\n#[macro_use]\nextern crate napi_derive;\n\nuse napi::{CallContext, JsObject, JsUnknown, Result};\n\n#[cfg(windows)]\n#[global_allocator]\nstatic ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;\n\n#[allow(clippy::needless_pass_by_value)]\n#[js_function(1)]\nfn transform_fs(ctx: CallContext) -> Result<JsUnknown> {\n\tlet opts = ctx.get::<JsObject>(0)?;\n\tlet config: qwik_core::TransformFsOptions = ctx.env.from_js_value(opts)?;\n\n\tlet result = qwik_core::transform_fs(config).unwrap();\n\tctx.env.to_js_value(&result)\n}\n\n#[allow(clippy::needless_pass_by_value)]\n#[js_function(1)]\nfn transform_modules(ctx: CallContext) -> Result<JsUnknown> {\n\tlet opts = ctx.get::<JsObject>(0)?;\n\tlet config: qwik_core::TransformModulesOptions = ctx.env.from_js_value(opts)?;\n\n\tlet result = qwik_core::transform_modules(config).unwrap();\n\tctx.env.to_js_value(&result)\n}\n\n#[module_exports]\nfn init(mut exports: JsObject) -> Result<()> {\n\texports.create_named_method(\"transform_fs\", transform_fs)?;\n\texports.create_named_method(\"transform_modules\", transform_modules)?;\n\n\tOk(())\n}\n"
  },
  {
    "path": "packages/qwik/src/napi/test.cjs",
    "content": "//  node src/napi/test.cjs\n\nasync function run() {\n  const { Optimizer } = require('../../dist/optimizer/index.cjs');\n  const optimizer = new Optimizer();\n\n  const result = await optimizer.transformFs({\n    rootDir: '/Users/manualmeida/repos/builderio/qwik/integration/todo/src',\n  });\n\n  console.log(result);\n}\n\nrun();\n"
  },
  {
    "path": "packages/qwik/src/optimizer/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik/src/optimizer/src/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik.optimizer\",\n    \"reportFolder\": \"<projectFolder>/src/optimizer/src/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/optimizer/\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/dist/optimizer.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik/optimizer/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/cli/Cargo.toml",
    "content": "[package]\nname = \"qwik\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n[dependencies]\nclap = \"3.1.8\"\nqwik-core = { path = \"../core\", features = [\"fs\", \"parallel\"] }\npath-absolutize = \"3.0.11\""
  },
  {
    "path": "packages/qwik/src/optimizer/cli/src/main.rs",
    "content": "#![deny(clippy::all)]\n#![deny(clippy::perf)]\n#![deny(clippy::nursery)]\n\nuse std::path::PathBuf;\n\nuse clap::{Arg, Command};\nuse path_absolutize::Absolutize;\nuse qwik_core::{transform_fs, EmitMode, EntryStrategy, MinifyMode, TransformFsOptions};\n\nstruct OptimizerInput {\n\tglob: Option<String>,\n\tmanifest: Option<String>,\n\tcore_module: Option<String>,\n\tscope: Option<String>,\n\tsrc: PathBuf,\n\tdest: PathBuf,\n\tmode: EmitMode,\n\tstrategy: EntryStrategy,\n\ttranspile_ts: bool,\n\ttranspile_jsx: bool,\n\tpreserve_filenames: bool,\n\tminify: MinifyMode,\n\tsourcemaps: bool,\n\texplicit_extensions: bool,\n}\n\nfn main() -> Result<(), Box<dyn std::error::Error>> {\n\tlet matches = Command::new(\"qwik\")\n        .version(\"1.0\")\n        .arg_required_else_help(true)\n        .subcommand_required(true)\n        .infer_subcommands(true)\n        .disable_help_subcommand(true)\n        .subcommand_required(true).arg_required_else_help(true)\n        .about(\"Qwik CLI allows to optimize qwik projects before bundling\")\n        .subcommand(\n            Command::new(\"optimize\")\n                .about(\"takes a source directory of qwik code and outputs an optimized version that lazy loads\")\n                .arg_required_else_help(true)\n                .arg(\n                    Arg::new(\"src\")\n                        .short('s')\n                        .long(\"src\")\n                        .default_value(\".\")\n                        .takes_value(true)\n                        .help(\"relative path to the source directory\"),\n                )\n                .arg(\n                    Arg::new(\"dest\")\n                        .short('d')\n                        .long(\"dest\")\n                        .required(true)\n                        .takes_value(true)\n                        .help(\"relative path to the output directory\"),\n                )\n                .arg(\n                    Arg::new(\"strategy\")\n                    .long(\"strategy\")\n                        .possible_values([\"inline\",\"single\", \"hook\", \"segment\", \"smart\", \"component\"])\n                        .takes_value(true)\n                        .help(\"entry strategy used to group segments\"),\n                )\n                .arg(\n                    Arg::new(\"manifest\")\n                        .short('m')\n                        .long(\"manifest\")\n                        .takes_value(true)\n                        .help(\"filename of the manifest\"),\n                )\n                .arg(\n                    Arg::new(\"no-ts\")\n                    .long(\"no-ts\")\n                    .help(\"no transpile TS\").takes_value(false)\n                 )\n                 .arg(\n                    Arg::new(\"no-jsx\")\n                    .long(\"no-jsx\")\n                    .help(\"no transpile JSX\").takes_value(false)\n                 )\n                 .arg(Arg::new(\"preserve-filenames\").long(\"preserve-filenames\").help(\"preserves original filename\").takes_value(false))\n                .arg(Arg::new(\"minify\").long(\"minify\").possible_values([\"minify\", \"simplify\", \"none\"]).takes_value(true).help(\"outputs minified source code\"))\n                .arg(Arg::new(\"sourcemaps\").long(\"sourcemaps\").help(\"generates sourcemaps\").takes_value(false))\n                .arg(Arg::new(\"extensions\").long(\"extensions\").help(\"keep explicit extensions on imports\").takes_value(false)),\n        )\n        .get_matches();\n\n\t// You can check for the existence of subcommands, and if found use their\n\t// matches just as you would the top level app\n\tif let Some(matches) = matches.subcommand_matches(\"optimize\") {\n\t\t// \"$ myapp test\" was run\n\t\tlet strategy = match matches.value_of(\"strategy\") {\n\t\t\tSome(\"inline\") => EntryStrategy::Inline,\n\t\t\tSome(\"hook\") => EntryStrategy::Segment,\n\t\t\tSome(\"segment\") => EntryStrategy::Segment,\n\t\t\tSome(\"single\") => EntryStrategy::Single,\n\t\t\tSome(\"component\") => EntryStrategy::Component,\n\t\t\tSome(\"smart\") | None => EntryStrategy::Smart,\n\t\t\t_ => panic!(\"Invalid strategy option\"),\n\t\t};\n\n\t\tlet minify = match matches.value_of(\"minify\") {\n\t\t\tSome(\"none\") => MinifyMode::None,\n\t\t\tSome(\"simplify\") | None => MinifyMode::Simplify,\n\t\t\t_ => panic!(\"Invalid minify option\"),\n\t\t};\n\n\t\tlet mode = match matches.value_of(\"mode\") {\n\t\t\tSome(\"dev\") => EmitMode::Dev,\n\t\t\tSome(\"prod\") => EmitMode::Prod,\n\t\t\tSome(\"lib\") | None => EmitMode::Lib,\n\t\t\t_ => panic!(\"Invalid mode option\"),\n\t\t};\n\t\toptimize(OptimizerInput {\n\t\t\tsrc: matches.value_of_t_or_exit(\"src\"),\n\t\t\tdest: matches.value_of_t_or_exit(\"dest\"),\n\t\t\tmanifest: matches.value_of(\"manifest\").map(|s| s.into()),\n\t\t\tcore_module: matches.value_of(\"core_module\").map(|s| s.into()),\n\t\t\tscope: matches.value_of(\"scope\").map(|s| s.into()),\n\t\t\tmode,\n\t\t\tglob: None,\n\t\t\tstrategy,\n\t\t\tminify,\n\t\t\texplicit_extensions: matches.is_present(\"extensions\"),\n\t\t\ttranspile_jsx: !matches.is_present(\"no-jsx\"),\n\t\t\ttranspile_ts: !matches.is_present(\"no-ts\"),\n\t\t\tpreserve_filenames: matches.is_present(\"preserve-filenames\"),\n\t\t\tsourcemaps: matches.is_present(\"sourcemaps\"),\n\t\t})?;\n\t}\n\tOk(())\n}\n\nfn optimize(\n\toptimizer_input: OptimizerInput,\n) -> Result<qwik_core::TransformOutput, Box<dyn std::error::Error>> {\n\tlet current_dir = std::env::current_dir()?;\n\tlet src_dir = current_dir.join(optimizer_input.src).canonicalize()?;\n\n\tlet result = transform_fs(TransformFsOptions {\n\t\tsrc_dir: src_dir.to_string_lossy().to_string(),\n\t\tvendor_roots: vec![],\n\t\tglob: optimizer_input.glob,\n\t\tsource_maps: optimizer_input.sourcemaps,\n\t\tminify: optimizer_input.minify,\n\t\ttranspile_jsx: optimizer_input.transpile_jsx,\n\t\ttranspile_ts: optimizer_input.transpile_ts,\n\t\tpreserve_filenames: optimizer_input.preserve_filenames,\n\t\tentry_strategy: optimizer_input.strategy,\n\t\texplicit_extensions: optimizer_input.explicit_extensions,\n\t\tcore_module: optimizer_input.core_module,\n\t\troot_dir: None,\n\n\t\tmode: optimizer_input.mode,\n\t\tscope: optimizer_input.scope,\n\n\t\tstrip_exports: None,\n\t\tstrip_ctx_name: None,\n\t\tstrip_event_handlers: false,\n\t\treg_ctx_name: None,\n\t\tis_server: None,\n\t})?;\n\n\tresult.write_to_fs(\n\t\t&current_dir.join(optimizer_input.dest).absolutize()?,\n\t\toptimizer_input.manifest,\n\t)?;\n\tOk(result)\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/Cargo.toml",
    "content": "[package]\nauthors = [\"Manu <manu@builder.io>\"]\nname = \"qwik-core\"\nversion = \"0.2.0\"\nedition = \"2021\"\nrepository = \"https://github.com/QwikDev/qwik\"\nlicense = \"MIT\"\ndescription = \"Qwik optimizer compiler\"\nkeywords = [\"qwik\", \"swc\", \"javascript\", \"optimizer\", \"compiler\"]\ncategories = [\"development-tools\", \"development-tools::cargo-plugins\"]\n\n[lib]\ncrate-type = [\"rlib\"]\n\n[dependencies]\nswc_ecmascript = { version = \"*\", features = [\"codegen\", \"utils\", \"visit\", \"parser\", \"transforms\", \"typescript\",  \"react\", \"optimization\"] }\nswc_common = { version = \"*\", features = [\"sourcemap\"] }\nswc_atoms = \"*\"\nserde = \"1.0.160\"\nserde_bytes = \"0.11.9\"\nserde_json = \"1.0.96\"\nsimple-error = \"0.3.0\"\nbase64 = \"0.22.1\"\npathdiff = \"0.2.1\"\nrelative-path = \"1.8.0\"\nlazy_static = \"1.4.0\"\nanyhow = \"1.0.70\"\nderivative = \"2.2.0\"\nrayon = \"1.7.0\"\npath-slash=\"0.2.1\"\n\n[dev-dependencies]\ninsta = \"1.29.0\"\n\n[features]\nfs=[]\nparallel=[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/Makefile",
    "content": "build:\n\tcargo build\n\nfmt:\n\tcargo fmt\n\ntest:\n\tcargo test -- --nocapture\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/README.md",
    "content": "# qwik-core\n\n## 1. Install rust\n\nhttps://www.rust-lang.org/tools/install\n\n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n## 2. Build library\n\n```\nmake build\n```\n\nor\n\n```\ncargo build\n```\n\n## 3. Run tests\n\n```\nmake test\n```\n\nor\n\n```\ncargo test\n```\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/benches/transform.rs",
    "content": "#![feature(test)]\n\nextern crate test;\n\nuse qwik_core::*;\nuse test::Bencher;\n\n#[bench]\nfn transform_todo_app(b: &mut Bencher) {\n\tb.iter(|| {\n      let code = r#\"\n      import {\n          Fragment,\n          Host,\n          qComponent$,\n          $,\n          useStore,\n          useHostElement,\n          useEvent,\n        } from '@builder.io/qwik';\n        import {\n          addItem,\n          clearCompleted,\n          FilterStates,\n          getFilteredCount,\n          getFilteredItems,\n          removeItem,\n          TodoItem,\n          Todos,\n          toggleItem,\n          updateFilter,\n        } from './state';\n\n\n        export const ToDoApp = qComponent$((props: { todos: Todos }) => {\n          return $(() => {\n            console.log('on-qRender$ => <ToDoApp/>');\n            return (\n              <section class=\"todoapp\">\n                <Header todos={props.todos} />\n                <Main todos={props.todos} />\n                <Footer todos={props.todos} />\n              </section>\n            );\n          });\n        });\n\n        export const Header = qComponent$((props: { todos: Todos }) => {\n          const state = useStore({ text: '' });\n          return $(() => {\n            console.log('on-qRender$ => <Header/>');\n            return (\n              <>\n                <h1>todos</h1>\n                <input\n                  class=\"new-todo\"\n                  placeholder=\"What needs to be done?\"\n                  autoFocus\n                  value={state.text}\n                  onKeyup$={() => {\n                    const event = useEvent<KeyboardEvent>();\n                    const inputValue = (event.target as HTMLInputElement).value;\n                    state.text = inputValue;\n                    if (event.key === 'Enter' && inputValue) {\n                      addItem(props.todos, state.text);\n                      state.text = '';\n                    }\n                  }}\n                />\n              </>\n            );\n          });\n        });\n\n        export const Main = qComponent$((props: { todos: Todos }) => {\n          return $(() => {\n            console.log('on-qRender$ => <Main/>');\n            return (\n              <div class=\"main\">\n                <ul class=\"todo-list\">\n                  {getFilteredItems(props.todos).map((key) => (\n                    <Item item={key} todos={props.todos} />\n                  ))}\n                </ul>\n              </div>\n            );\n          });\n        });\n\n        export const Item = qComponent$((props: { item: TodoItem; todos: Todos }) => {\n          const state = useStore({ editing: false });\n          return $(() => {\n            console.log(\n              'on-qRender$ => <Item item=\"' +\n                JSON.stringify(props.item, (key, value) => (key.startsWith('__') ? undefined : value)) +\n                '\"/>'\n            );\n            return (\n              <div class={{ completed: props.item.completed, editing: state.editing }}>\n                <div class=\"view\">\n                  <input\n                    class=\"toggle\"\n                    type=\"checkbox\"\n                    checked={props.item.completed}\n                    onClick$={() => toggleItem(props.todos, props.item)}\n                  />\n                  <label\n                    onDblclick$={async () => {\n                      state.editing = true;\n                      const hostElement = useHostElement()!;\n                      await qNotifyRender(hostElement);\n                      const inputEl = hostElement.querySelector('input.edit') as HTMLInputElement;\n                      inputEl.focus();\n                      inputEl.selectionStart = inputEl.selectionEnd = inputEl.value.length;\n                    }}\n                  >\n                    {props.item.title}\n                  </label>\n                  <button class=\"destroy\" onClick$={() => removeItem(props.todos, props.item)}></button>\n                </div>\n                {state.editing ? (\n                  <input\n                    class=\"edit\"\n                    value={props.item.title}\n                    onBlur$={() => (state.editing = false)}\n                    onKeyup$={() => {\n                      const event = useEvent<KeyboardEvent>();\n                      const inputValue = (event.target as HTMLInputElement).value;\n                      props.item.title = inputValue;\n                      if (event.key === 'Enter') {\n                        state.editing = false;\n                      }\n                    }}\n                  />\n                ) : null}\n              </div>\n            );\n          });\n        });\n\n        export const Footer = qComponent$((props: { todos: Todos }) => {\n          return $(() => {\n            console.log('on-qRender$ => <Footer/>');\n            /**\n             * Example of lite-component (it will always be included with the parent component)\n             */\n            function Filter({ filter }: { filter: FilterStates }) {\n              const lMode = filter.toLowerCase();\n              return (\n                <li>\n                  <a\n                    class={{ selected: props.todos.filter == lMode }}\n                    onClick$={() => updateFilter(props.todos, filter)}\n                  >\n                    {filter[0].toUpperCase() + filter.slice(1)}\n                  </a>\n                </li>\n              );\n            }\n            const remaining = getFilteredCount(props.todos);\n            return (\n              <div class=\"footer\">\n                {props.todos.items.length > 0 ? (\n                  <>\n                    <span class=\"todo-count\">\n                      <strong>{remaining}</strong>\n                      {remaining == 1 ? ' item' : ' items'} left\n                    </span>\n                    <ul class=\"filters\">\n                      {FilterStates.map((f) => (\n                        <Filter filter={f} />\n                      ))}\n                    </ul>\n                    {remaining > 0 ? (\n                      <button class=\"clear-completed\" onClick$={() => clearCompleted(props.todos)}>\n                        Clear completed\n                      </button>\n                    ) : null}\n                  </>\n                ) : null}\n              </div>\n            );\n          });\n        });\n      \"#;\n      transform_modules(TransformModulesOptions {\n        src_dir: \"/user/qwik/src/\".into(),\n          input: vec![TransformModuleInput {\n              code: code.into(),\n              path: \"file.tsx\".into(),\n              dev_path: None,\n          }],\n          root_dir: None,\n          core_module: None,\n          source_maps: false,\n          explicit_extensions: false,\n          minify: MinifyMode::Simplify,\n          transpile_ts: true,\n          transpile_jsx: true,\n          preserve_filenames: false,\n          entry_strategy: EntryStrategy::Single,\n          mode: EmitMode::Prod,\n          scope: None,\n          reg_ctx_name: None,\n          strip_exports: None,\n          strip_ctx_name: None,\n          strip_event_handlers: false,\n          is_server: None,\n      })\n  });\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/add_side_effect.rs",
    "content": "use std::collections::HashSet;\nuse std::path::Path;\n\nuse crate::collector::GlobalCollect;\nuse crate::parse::PathData;\nuse path_slash::PathBufExt;\nuse swc_atoms::JsWord;\nuse swc_common::DUMMY_SP;\nuse swc_ecmascript::ast;\nuse swc_ecmascript::visit::{VisitMut, VisitMutWith};\n\npub struct SideEffectVisitor<'a> {\n\tglobal_collector: &'a GlobalCollect,\n\timports: HashSet<JsWord>,\n\tpath_data: &'a PathData,\n\tsrc_dir: &'a Path,\n}\n\nimpl<'a> SideEffectVisitor<'a> {\n\tpub fn new(\n\t\tglobal_collector: &'a GlobalCollect,\n\t\tpath_data: &'a PathData,\n\t\tsrc_dir: &'a Path,\n\t) -> Self {\n\t\tSelf {\n\t\t\tglobal_collector,\n\t\t\tpath_data,\n\t\t\tsrc_dir,\n\t\t\timports: HashSet::new(),\n\t\t}\n\t}\n}\n\nimpl<'a> VisitMut for SideEffectVisitor<'a> {\n\tfn visit_mut_import_decl(&mut self, node: &mut ast::ImportDecl) {\n\t\tif node.src.value.starts_with('.') {\n\t\t\tself.imports.insert(node.src.value.clone());\n\t\t}\n\t}\n\tfn visit_mut_module(&mut self, node: &mut ast::Module) {\n\t\tnode.visit_mut_children_with(self);\n\t\tlet mut imports: Vec<_> = self.global_collector.imports.values().collect();\n\t\timports.sort_by_key(|i| i.source.clone());\n\n\t\tfor import in imports {\n\t\t\tif import.source.starts_with('.') && !self.imports.contains(&import.source) {\n\t\t\t\tlet abs_dir = self.path_data.abs_dir.to_slash_lossy();\n\t\t\t\tlet relative = relative_path::RelativePath::new(&abs_dir);\n\t\t\t\tlet final_path = relative.join(import.source.as_ref()).normalize();\n\t\t\t\tif final_path.starts_with(self.src_dir.to_str().unwrap()) {\n\t\t\t\t\tnode.body.insert(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tast::ModuleItem::ModuleDecl(ast::ModuleDecl::Import(ast::ImportDecl {\n\t\t\t\t\t\t\twith: None,\n\t\t\t\t\t\t\tphase: Default::default(),\n\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\tspecifiers: vec![],\n\t\t\t\t\t\t\ttype_only: false,\n\t\t\t\t\t\t\tsrc: Box::new(ast::Str::from(import.source.clone())),\n\t\t\t\t\t\t})),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/clean_side_effects.rs",
    "content": "use std::cell::RefCell;\nuse std::collections::HashSet;\nuse std::rc::Rc;\n\nuse swc_common::Span;\nuse swc_common::Spanned;\nuse swc_ecmascript::ast::Module;\nuse swc_ecmascript::ast::{Expr, ModuleItem, Stmt};\nuse swc_ecmascript::visit::VisitMut;\n\n/// This is a simple treeshaker that removes anything with side effects from the module.\n/// These are:\n/// - `new` expressions\n/// - `call` expressions\n///\n/// but only when they are not assigned and used elsewhere, or when they were already present before simplifying.\n///\n/// - First it marks top-level expressions\n/// - Then the code needs to be simplified by you\n/// - Then it removes all top-level expressions that are not marked. Those will be expressions that were\n///   assigned to unused variables etc.\npub struct Treeshaker {\n\tpub marker: CleanMarker,\n\tpub cleaner: CleanSideEffects,\n}\n\npub struct CleanMarker {\n\tset: Rc<RefCell<HashSet<Span>>>,\n}\n\npub struct CleanSideEffects {\n\tpub did_drop: bool,\n\tset: Rc<RefCell<HashSet<Span>>>,\n}\n\nimpl Treeshaker {\n\tpub fn new() -> Self {\n\t\tlet set = Rc::new(RefCell::new(HashSet::new()));\n\t\tSelf {\n\t\t\tmarker: CleanMarker {\n\t\t\t\tset: Rc::clone(&set),\n\t\t\t},\n\t\t\tcleaner: CleanSideEffects {\n\t\t\t\tdid_drop: false,\n\t\t\t\tset: Rc::clone(&set),\n\t\t\t},\n\t\t}\n\t}\n}\n\nimpl VisitMut for CleanMarker {\n\tfn visit_mut_module_item(&mut self, node: &mut ModuleItem) {\n\t\tif let ModuleItem::Stmt(Stmt::Expr(expr)) = node {\n\t\t\tmatch &*expr.expr {\n\t\t\t\tExpr::New(e) => {\n\t\t\t\t\tself.set.borrow_mut().insert(e.span());\n\t\t\t\t}\n\t\t\t\tExpr::Call(e) => {\n\t\t\t\t\tself.set.borrow_mut().insert(e.span());\n\t\t\t\t}\n\t\t\t\t_ => {}\n\t\t\t}\n\t\t}\n\t}\n}\n\nimpl VisitMut for CleanSideEffects {\n\tfn visit_mut_module(&mut self, node: &mut Module) {\n\t\tnode.body.retain(|item| match item {\n\t\t\tModuleItem::Stmt(Stmt::Expr(expr)) => match &*expr.expr {\n\t\t\t\tExpr::New(e) => {\n\t\t\t\t\tif self.set.borrow().contains(&e.span()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tself.did_drop = true;\n\t\t\t\t\tfalse\n\t\t\t\t}\n\t\t\t\tExpr::Call(e) => {\n\t\t\t\t\tif self.set.borrow().contains(&e.span()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tself.did_drop = true;\n\t\t\t\t\tfalse\n\t\t\t\t}\n\t\t\t\t_ => true,\n\t\t\t},\n\t\t\t_ => true,\n\t\t});\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/code_move.rs",
    "content": "use crate::collector::{new_ident_from_id, GlobalCollect, Id, ImportKind};\nuse crate::parse::PathData;\nuse crate::transform::{add_handle_watch, create_synthetic_named_import};\nuse crate::words::*;\n\nuse anyhow::Error;\nuse swc_atoms::JsWord;\nuse swc_common::comments::{SingleThreadedComments, SingleThreadedCommentsMap};\nuse swc_common::DUMMY_SP;\nuse swc_ecmascript::ast;\nuse swc_ecmascript::utils::private_ident;\n\nmacro_rules! id {\n\t($ident: expr) => {\n\t\t($ident.sym.clone(), $ident.ctxt)\n\t};\n}\n\npub struct NewModuleCtx<'a> {\n\tpub expr: Box<ast::Expr>,\n\tpub path: &'a PathData,\n\tpub name: &'a str,\n\tpub local_idents: &'a [Id],\n\tpub scoped_idents: &'a [Id],\n\tpub global: &'a GlobalCollect,\n\tpub core_module: &'a JsWord,\n\tpub need_handle_watch: bool,\n\tpub need_transform: bool,\n\tpub explicit_extensions: bool,\n\tpub leading_comments: SingleThreadedCommentsMap,\n\tpub trailing_comments: SingleThreadedCommentsMap,\n}\n\npub fn new_module(ctx: NewModuleCtx) -> Result<(ast::Module, SingleThreadedComments), Error> {\n\tlet comments = SingleThreadedComments::from_leading_and_trailing(\n\t\tctx.leading_comments,\n\t\tctx.trailing_comments,\n\t);\n\tlet max_cap = ctx.global.imports.len() + ctx.global.exports.len();\n\tlet mut module = ast::Module {\n\t\tspan: DUMMY_SP,\n\t\tbody: Vec::with_capacity(max_cap),\n\t\tshebang: None,\n\t};\n\n\tlet has_scoped_idents = ctx.need_transform && !ctx.scoped_idents.is_empty();\n\tlet use_lexical_scope = if has_scoped_idents {\n\t\tlet new_local = id!(private_ident!(&*USE_LEXICAL_SCOPE.clone()));\n\t\tmodule\n\t\t\t.body\n\t\t\t.push(create_synthetic_named_import(&new_local, ctx.core_module));\n\t\tSome(new_local)\n\t} else {\n\t\tNone\n\t};\n\n\tfor id in ctx.local_idents {\n\t\tif let Some(import) = ctx.global.imports.get(id) {\n\t\t\tlet specifier = match import.kind {\n\t\t\t\tImportKind::Named => ast::ImportSpecifier::Named(ast::ImportNamedSpecifier {\n\t\t\t\t\tis_type_only: false,\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\timported: if import.specifier == id.0 {\n\t\t\t\t\t\tNone\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSome(ast::ModuleExportName::Ident(ast::Ident::new(\n\t\t\t\t\t\t\timport.specifier.clone(),\n\t\t\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\t\t\tDefault::default(),\n\t\t\t\t\t\t)))\n\t\t\t\t\t},\n\t\t\t\t\tlocal: new_ident_from_id(id),\n\t\t\t\t}),\n\t\t\t\tImportKind::Default => ast::ImportSpecifier::Default(ast::ImportDefaultSpecifier {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tlocal: new_ident_from_id(id),\n\t\t\t\t}),\n\t\t\t\tImportKind::All => ast::ImportSpecifier::Namespace(ast::ImportStarAsSpecifier {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tlocal: new_ident_from_id(id),\n\t\t\t\t}),\n\t\t\t};\n\t\t\tmodule\n\t\t\t\t.body\n\t\t\t\t.push(ast::ModuleItem::ModuleDecl(ast::ModuleDecl::Import(\n\t\t\t\t\tast::ImportDecl {\n\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\ttype_only: false,\n\t\t\t\t\t\twith: import.asserts.clone(),\n\t\t\t\t\t\tphase: Default::default(),\n\t\t\t\t\t\tsrc: Box::new(ast::Str {\n\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\tvalue: import.source.clone(),\n\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tspecifiers: vec![specifier],\n\t\t\t\t\t},\n\t\t\t\t)));\n\t\t} else if let Some(export) = ctx.global.exports.get(id) {\n\t\t\tlet filename = if ctx.explicit_extensions {\n\t\t\t\t&ctx.path.file_name\n\t\t\t} else {\n\t\t\t\t&ctx.path.file_stem\n\t\t\t};\n\t\t\tlet imported = export.as_ref().map(|e| {\n\t\t\t\tast::ModuleExportName::Ident(ast::Ident::new(\n\t\t\t\t\te.clone(),\n\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\tDefault::default(),\n\t\t\t\t))\n\t\t\t});\n\t\t\tmodule\n\t\t\t\t.body\n\t\t\t\t.push(ast::ModuleItem::ModuleDecl(ast::ModuleDecl::Import(\n\t\t\t\t\tast::ImportDecl {\n\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\ttype_only: false,\n\t\t\t\t\t\twith: None,\n\t\t\t\t\t\tphase: Default::default(),\n\t\t\t\t\t\tsrc: Box::new(ast::Str {\n\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\tvalue: format!(\"./{}\", filename).into(),\n\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tspecifiers: vec![ast::ImportSpecifier::Named(ast::ImportNamedSpecifier {\n\t\t\t\t\t\t\tis_type_only: false,\n\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\timported,\n\t\t\t\t\t\t\tlocal: new_ident_from_id(id),\n\t\t\t\t\t\t})],\n\t\t\t\t\t},\n\t\t\t\t)));\n\t\t}\n\t}\n\n\tlet expr = if let Some(use_lexical_scope) = use_lexical_scope {\n\t\tBox::new(transform_function_expr(\n\t\t\t*ctx.expr,\n\t\t\t&use_lexical_scope,\n\t\t\tctx.scoped_idents,\n\t\t))\n\t} else {\n\t\tctx.expr\n\t};\n\n\tmodule.body.push(create_named_export(expr, ctx.name));\n\tif ctx.need_handle_watch {\n\t\t// Inject qwik internal import\n\t\tadd_handle_watch(&mut module.body, ctx.core_module);\n\t}\n\tOk((module, comments))\n}\n\nfn create_named_export(expr: Box<ast::Expr>, name: &str) -> ast::ModuleItem {\n\tast::ModuleItem::ModuleDecl(ast::ModuleDecl::ExportDecl(ast::ExportDecl {\n\t\tspan: DUMMY_SP,\n\t\tdecl: ast::Decl::Var(Box::new(ast::VarDecl {\n\t\t\tspan: DUMMY_SP,\n\t\t\tctxt: Default::default(),\n\t\t\tkind: ast::VarDeclKind::Const,\n\t\t\tdeclare: false,\n\t\t\tdecls: vec![ast::VarDeclarator {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\tdefinite: false,\n\t\t\t\tname: ast::Pat::Ident(ast::BindingIdent::from(ast::Ident::new(\n\t\t\t\t\tJsWord::from(name),\n\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\tDefault::default(),\n\t\t\t\t))),\n\t\t\t\tinit: Some(expr),\n\t\t\t}],\n\t\t})),\n\t}))\n}\n\npub fn transform_function_expr(\n\texpr: ast::Expr,\n\tuse_lexical_scope: &Id,\n\tscoped_idents: &[Id],\n) -> ast::Expr {\n\tmatch expr {\n\t\tast::Expr::Arrow(node) => {\n\t\t\tast::Expr::Arrow(transform_arrow_fn(node, use_lexical_scope, scoped_idents))\n\t\t}\n\t\tast::Expr::Fn(node) => ast::Expr::Fn(transform_fn(node, use_lexical_scope, scoped_idents)),\n\t\t_ => expr,\n\t}\n}\n\nfn transform_arrow_fn(\n\tarrow: ast::ArrowExpr,\n\tuse_lexical_scope: &Id,\n\tscoped_idents: &[Id],\n) -> ast::ArrowExpr {\n\tmatch arrow.body {\n\t\tbox ast::BlockStmtOrExpr::BlockStmt(mut block) => {\n\t\t\tlet mut stmts = Vec::with_capacity(1 + block.stmts.len());\n\t\t\tstmts.push(create_use_lexical_scope(use_lexical_scope, scoped_idents));\n\t\t\tstmts.append(&mut block.stmts);\n\t\t\tast::ArrowExpr {\n\t\t\t\tbody: Box::new(ast::BlockStmtOrExpr::BlockStmt(ast::BlockStmt {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tctxt: Default::default(),\n\t\t\t\t\tstmts,\n\t\t\t\t})),\n\t\t\t\t..arrow\n\t\t\t}\n\t\t}\n\t\tbox ast::BlockStmtOrExpr::Expr(expr) => {\n\t\t\tlet mut stmts = Vec::with_capacity(2);\n\t\t\tif !scoped_idents.is_empty() {\n\t\t\t\tstmts.push(create_use_lexical_scope(use_lexical_scope, scoped_idents));\n\t\t\t}\n\t\t\tstmts.push(create_return_stmt(expr));\n\t\t\tast::ArrowExpr {\n\t\t\t\tbody: Box::new(ast::BlockStmtOrExpr::BlockStmt(ast::BlockStmt {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tctxt: Default::default(),\n\t\t\t\t\tstmts,\n\t\t\t\t})),\n\t\t\t\t..arrow\n\t\t\t}\n\t\t}\n\t}\n}\n\nfn transform_fn(node: ast::FnExpr, use_lexical_scope: &Id, scoped_idents: &[Id]) -> ast::FnExpr {\n\tlet mut stmts = Vec::with_capacity(\n\t\t1 + node\n\t\t\t.function\n\t\t\t.body\n\t\t\t.as_ref()\n\t\t\t.map_or(0, |body| body.stmts.len()),\n\t);\n\tif !scoped_idents.is_empty() {\n\t\tstmts.push(create_use_lexical_scope(use_lexical_scope, scoped_idents));\n\t}\n\tif let Some(mut body) = node.function.body {\n\t\tstmts.append(&mut body.stmts);\n\t}\n\tast::FnExpr {\n\t\tfunction: Box::new(ast::Function {\n\t\t\tbody: Some(ast::BlockStmt {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\tctxt: Default::default(),\n\t\t\t\tstmts,\n\t\t\t}),\n\t\t\t..*node.function\n\t\t}),\n\t\t..node\n\t}\n}\n\npub const fn create_return_stmt(expr: Box<ast::Expr>) -> ast::Stmt {\n\tast::Stmt::Return(ast::ReturnStmt {\n\t\targ: Some(expr),\n\t\tspan: DUMMY_SP,\n\t})\n}\n\nfn create_use_lexical_scope(use_lexical_scope: &Id, scoped_idents: &[Id]) -> ast::Stmt {\n\tast::Stmt::Decl(ast::Decl::Var(Box::new(ast::VarDecl {\n\t\tspan: DUMMY_SP,\n\t\tctxt: Default::default(),\n\t\tdeclare: false,\n\t\tkind: ast::VarDeclKind::Const,\n\t\tdecls: vec![ast::VarDeclarator {\n\t\t\tdefinite: false,\n\t\t\tspan: DUMMY_SP,\n\t\t\tinit: Some(Box::new(ast::Expr::Call(ast::CallExpr {\n\t\t\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(\n\t\t\t\t\tuse_lexical_scope,\n\t\t\t\t)))),\n\t\t\t\t..Default::default()\n\t\t\t}))),\n\t\t\tname: ast::Pat::Array(ast::ArrayPat {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\toptional: false,\n\t\t\t\ttype_ann: None,\n\t\t\t\telems: scoped_idents\n\t\t\t\t\t.iter()\n\t\t\t\t\t.map(|id| {\n\t\t\t\t\t\tSome(ast::Pat::Ident(ast::BindingIdent::from(new_ident_from_id(\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t))))\n\t\t\t\t\t})\n\t\t\t\t\t.collect(),\n\t\t\t}),\n\t\t}],\n\t})))\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/collector.rs",
    "content": "use std::collections::{HashMap, HashSet};\n\nuse swc_atoms::{js_word, JsWord};\nuse swc_common::{Span, SyntaxContext, DUMMY_SP};\nuse swc_ecmascript::ast;\nuse swc_ecmascript::utils::private_ident;\nuse swc_ecmascript::visit::{noop_visit_type, Visit, VisitWith};\n\nmacro_rules! id {\n\t($ident: expr) => {\n\t\t($ident.sym.clone(), $ident.ctxt)\n\t};\n}\n\npub type Id = (JsWord, SyntaxContext);\n\npub fn new_ident_from_id(id: &Id) -> ast::Ident {\n\tast::Ident::new(id.0.clone(), DUMMY_SP, id.1)\n}\n\n#[derive(Eq, PartialEq, Clone, Copy)]\npub enum ImportKind {\n\tNamed,\n\tAll,\n\tDefault,\n}\n\n#[derive(Clone)]\npub struct Import {\n\tpub source: JsWord,\n\tpub specifier: JsWord,\n\tpub kind: ImportKind,\n\tpub synthetic: bool,\n\tpub asserts: Option<Box<ast::ObjectLit>>,\n}\n\npub struct GlobalCollect {\n\tpub synthetic: Vec<(Id, Import)>,\n\tpub imports: HashMap<Id, Import>,\n\tpub exports: HashMap<Id, Option<JsWord>>,\n\tpub root: HashMap<Id, Span>,\n\n\trev_imports: HashMap<(JsWord, JsWord), Id>,\n\tin_export_decl: bool,\n}\n\npub fn global_collect(program: &ast::Program) -> GlobalCollect {\n\tlet mut collect = GlobalCollect {\n\t\tsynthetic: vec![],\n\t\timports: HashMap::with_capacity(16),\n\t\texports: HashMap::with_capacity(16),\n\n\t\troot: HashMap::with_capacity(16),\n\t\trev_imports: HashMap::with_capacity(16),\n\n\t\tin_export_decl: false,\n\t};\n\tprogram.visit_with(&mut collect);\n\tcollect\n}\n\nimpl GlobalCollect {\n\tpub fn get_imported_local(&self, specifier: &JsWord, source: &JsWord) -> Option<Id> {\n\t\tself.imports\n\t\t\t.iter()\n\t\t\t.find(|(_, import)| &import.specifier == specifier && &import.source == source)\n\t\t\t.map(|s| s.0.clone())\n\t}\n\n\tpub fn is_global(&self, local: &Id) -> bool {\n\t\tif self.imports.contains_key(local) {\n\t\t\treturn true;\n\t\t}\n\t\tif self.exports.contains_key(local) {\n\t\t\treturn true;\n\t\t}\n\t\tif self.root.contains_key(local) {\n\t\t\treturn true;\n\t\t}\n\t\tfalse\n\t}\n\n\tpub fn import(&mut self, specifier: &JsWord, source: &JsWord) -> Id {\n\t\tself.rev_imports\n\t\t\t.get(&(specifier.clone(), source.clone()))\n\t\t\t.cloned()\n\t\t\t.map_or_else(\n\t\t\t\t|| {\n\t\t\t\t\tlet local = id!(private_ident!(specifier.clone()));\n\t\t\t\t\tself.add_import(\n\t\t\t\t\t\tlocal.clone(),\n\t\t\t\t\t\tImport {\n\t\t\t\t\t\t\tsource: source.clone(),\n\t\t\t\t\t\t\tspecifier: specifier.clone(),\n\t\t\t\t\t\t\tkind: ImportKind::Named,\n\t\t\t\t\t\t\tsynthetic: true,\n\t\t\t\t\t\t\tasserts: None,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\tlocal\n\t\t\t\t},\n\t\t\t\t|local| local,\n\t\t\t)\n\t}\n\n\tpub fn add_import(&mut self, local: Id, import: Import) {\n\t\tif import.synthetic {\n\t\t\tself.synthetic.push((local.clone(), import.clone()));\n\t\t}\n\t\tself.rev_imports.insert(\n\t\t\t(import.specifier.clone(), import.source.clone()),\n\t\t\tlocal.clone(),\n\t\t);\n\t\tself.imports.insert(local, import);\n\t}\n\n\tpub fn add_export(&mut self, local: Id, exported: Option<JsWord>) -> bool {\n\t\tif let std::collections::hash_map::Entry::Vacant(e) = self.exports.entry(local) {\n\t\t\te.insert(exported);\n\t\t\ttrue\n\t\t} else {\n\t\t\tfalse\n\t\t}\n\t}\n}\n\nimpl Visit for GlobalCollect {\n\tnoop_visit_type!();\n\n\tfn visit_module_item(&mut self, node: &ast::ModuleItem) {\n\t\tif let ast::ModuleItem::Stmt(ast::Stmt::Decl(decl)) = node {\n\t\t\tmatch decl {\n\t\t\t\tast::Decl::Fn(function) => {\n\t\t\t\t\tself.root.insert(id!(function.ident), function.ident.span);\n\t\t\t\t}\n\t\t\t\tast::Decl::Class(class) => {\n\t\t\t\t\tself.root.insert(id!(class.ident), class.ident.span);\n\t\t\t\t}\n\t\t\t\tast::Decl::Var(var) => {\n\t\t\t\t\tfor decl in &var.decls {\n\t\t\t\t\t\tlet mut identifiers: Vec<(Id, Span)> = vec![];\n\t\t\t\t\t\tcollect_from_pat(&decl.name, &mut identifiers);\n\t\t\t\t\t\tself.root.extend(identifiers.into_iter());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tast::Decl::TsEnum(enu) => {\n\t\t\t\t\tself.root.insert(id!(enu.id), enu.id.span);\n\t\t\t\t}\n\t\t\t\t_ => {}\n\t\t\t}\n\t\t} else {\n\t\t\tnode.visit_children_with(self);\n\t\t}\n\t}\n\n\tfn visit_import_decl(&mut self, node: &ast::ImportDecl) {\n\t\tfor specifier in &node.specifiers {\n\t\t\tmatch specifier {\n\t\t\t\tast::ImportSpecifier::Named(named) => {\n\t\t\t\t\tlet imported = match &named.imported {\n\t\t\t\t\t\tSome(ast::ModuleExportName::Ident(ident)) => ident.sym.clone(),\n\t\t\t\t\t\t_ => named.local.sym.clone(),\n\t\t\t\t\t};\n\t\t\t\t\tself.add_import(\n\t\t\t\t\t\tid!(named.local),\n\t\t\t\t\t\tImport {\n\t\t\t\t\t\t\tsource: node.src.value.clone(),\n\t\t\t\t\t\t\tspecifier: imported,\n\t\t\t\t\t\t\tkind: ImportKind::Named,\n\t\t\t\t\t\t\tsynthetic: false,\n\t\t\t\t\t\t\tasserts: node.with.clone(),\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tast::ImportSpecifier::Default(default) => {\n\t\t\t\t\tself.add_import(\n\t\t\t\t\t\tid!(default.local),\n\t\t\t\t\t\tImport {\n\t\t\t\t\t\t\tsource: node.src.value.clone(),\n\t\t\t\t\t\t\tspecifier: js_word!(\"default\"),\n\t\t\t\t\t\t\tkind: ImportKind::Default,\n\t\t\t\t\t\t\tsynthetic: false,\n\t\t\t\t\t\t\tasserts: node.with.clone(),\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tast::ImportSpecifier::Namespace(namespace) => {\n\t\t\t\t\tself.add_import(\n\t\t\t\t\t\tid!(namespace.local),\n\t\t\t\t\t\tImport {\n\t\t\t\t\t\t\tsource: node.src.value.clone(),\n\t\t\t\t\t\t\tspecifier: \"*\".into(),\n\t\t\t\t\t\t\tkind: ImportKind::All,\n\t\t\t\t\t\t\tsynthetic: false,\n\t\t\t\t\t\t\tasserts: node.with.clone(),\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfn visit_named_export(&mut self, node: &ast::NamedExport) {\n\t\tif node.src.is_some() {\n\t\t\treturn;\n\t\t}\n\n\t\tfor specifier in &node.specifiers {\n\t\t\tmatch specifier {\n\t\t\t\tast::ExportSpecifier::Named(named) => {\n\t\t\t\t\tlet local = match &named.orig {\n\t\t\t\t\t\tast::ModuleExportName::Ident(ident) => Some(id!(ident)),\n\t\t\t\t\t\t_ => None,\n\t\t\t\t\t};\n\t\t\t\t\tlet exported = match &named.exported {\n\t\t\t\t\t\tSome(ast::ModuleExportName::Ident(exported)) => Some(exported.sym.clone()),\n\t\t\t\t\t\t_ => None,\n\t\t\t\t\t};\n\t\t\t\t\tif let Some(local) = local {\n\t\t\t\t\t\tself.add_export(local, exported);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tast::ExportSpecifier::Default(default) => {\n\t\t\t\t\tself.exports\n\t\t\t\t\t\t.entry(id!(default.exported))\n\t\t\t\t\t\t.or_insert(Some(js_word!(\"default\")));\n\t\t\t\t}\n\t\t\t\tast::ExportSpecifier::Namespace(namespace) => {\n\t\t\t\t\tif let ast::ModuleExportName::Ident(ident) = &namespace.name {\n\t\t\t\t\t\tself.exports\n\t\t\t\t\t\t\t.entry(id!(ident))\n\t\t\t\t\t\t\t.or_insert_with(|| Some(\"*\".into()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfn visit_export_decl(&mut self, node: &ast::ExportDecl) {\n\t\tmatch &node.decl {\n\t\t\tast::Decl::TsEnum(enu) => {\n\t\t\t\tself.add_export(id!(enu.id), None);\n\t\t\t}\n\t\t\tast::Decl::Class(class) => {\n\t\t\t\tself.add_export(id!(class.ident), None);\n\t\t\t}\n\t\t\tast::Decl::Fn(func) => {\n\t\t\t\tself.add_export(id!(func.ident), None);\n\t\t\t}\n\t\t\tast::Decl::Var(var) => {\n\t\t\t\tfor decl in &var.decls {\n\t\t\t\t\tself.in_export_decl = true;\n\t\t\t\t\tdecl.name.visit_with(self);\n\t\t\t\t\tself.in_export_decl = false;\n\n\t\t\t\t\tdecl.init.visit_with(self);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_ => {}\n\t\t}\n\t}\n\n\tfn visit_export_default_decl(&mut self, node: &ast::ExportDefaultDecl) {\n\t\tmatch &node.decl {\n\t\t\tast::DefaultDecl::Class(class) => {\n\t\t\t\tif let Some(ident) = &class.ident {\n\t\t\t\t\tself.add_export(id!(ident), Some(js_word!(\"default\")));\n\t\t\t\t}\n\t\t\t}\n\t\t\tast::DefaultDecl::Fn(func) => {\n\t\t\t\tif let Some(ident) = &func.ident {\n\t\t\t\t\tself.add_export(id!(ident), Some(js_word!(\"default\")));\n\t\t\t\t}\n\t\t\t}\n\t\t\t_ => {\n\t\t\t\tunreachable!(\"unsupported export default declaration\");\n\t\t\t}\n\t\t};\n\t}\n\n\tfn visit_binding_ident(&mut self, node: &ast::BindingIdent) {\n\t\tif self.in_export_decl {\n\t\t\tself.add_export(id!(node.id), None);\n\t\t}\n\t}\n\n\tfn visit_assign_pat_prop(&mut self, node: &ast::AssignPatProp) {\n\t\tif self.in_export_decl {\n\t\t\tself.add_export(id!(node.key), None);\n\t\t}\n\t}\n}\n\n#[derive(Debug)]\nenum ExprOrSkip {\n\tExpr,\n\tSkip,\n}\n\n#[derive(Debug)]\npub struct IdentCollector {\n\tpub local_idents: HashSet<Id>,\n\tpub use_h: bool,\n\tpub use_fragment: bool,\n\n\texpr_ctxt: Vec<ExprOrSkip>,\n}\n\nimpl IdentCollector {\n\tpub fn new() -> Self {\n\t\tSelf {\n\t\t\tlocal_idents: HashSet::new(),\n\t\t\texpr_ctxt: Vec::with_capacity(32),\n\t\t\tuse_h: false,\n\t\t\tuse_fragment: false,\n\t\t}\n\t}\n\n\tpub fn get_words(self) -> Vec<Id> {\n\t\tlet mut local_idents: Vec<Id> = self.local_idents.into_iter().collect();\n\t\tlocal_idents.sort();\n\t\tlocal_idents\n\t}\n}\n\nimpl Visit for IdentCollector {\n\tnoop_visit_type!();\n\n\tfn visit_expr(&mut self, node: &ast::Expr) {\n\t\tself.expr_ctxt.push(ExprOrSkip::Expr);\n\t\tnode.visit_children_with(self);\n\t\tself.expr_ctxt.pop();\n\t}\n\n\tfn visit_stmt(&mut self, node: &ast::Stmt) {\n\t\tself.expr_ctxt.push(ExprOrSkip::Skip);\n\t\tnode.visit_children_with(self);\n\t\tself.expr_ctxt.pop();\n\t}\n\n\tfn visit_jsx_element(&mut self, node: &ast::JSXElement) {\n\t\tself.use_h = true;\n\t\tnode.visit_children_with(self);\n\t}\n\n\tfn visit_jsx_fragment(&mut self, node: &ast::JSXFragment) {\n\t\tself.use_h = true;\n\t\tself.use_fragment = true;\n\t\tnode.visit_children_with(self);\n\t}\n\n\tfn visit_jsx_element_name(&mut self, node: &ast::JSXElementName) {\n\t\tif let ast::JSXElementName::Ident(ref ident) = node {\n\t\t\tlet ident_name = ident.sym.as_ref().chars().next();\n\t\t\tif let Some('A'..='Z') = ident_name {\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tnode.visit_children_with(self);\n\t}\n\tfn visit_jsx_attr(&mut self, node: &ast::JSXAttr) {\n\t\tself.expr_ctxt.push(ExprOrSkip::Skip);\n\t\tnode.visit_children_with(self);\n\t\tself.expr_ctxt.pop();\n\t}\n\n\tfn visit_ident(&mut self, node: &ast::Ident) {\n\t\tif matches!(self.expr_ctxt.last(), Some(ExprOrSkip::Expr))\n\t\t\t&& node.ctxt != SyntaxContext::empty()\n\t\t{\n\t\t\tself.local_idents.insert(id!(node));\n\t\t}\n\t}\n\n\tfn visit_key_value_prop(&mut self, node: &ast::KeyValueProp) {\n\t\tself.expr_ctxt.push(ExprOrSkip::Skip);\n\t\tnode.visit_children_with(self);\n\t\tself.expr_ctxt.pop();\n\t}\n}\n\npub fn collect_from_pat(pat: &ast::Pat, identifiers: &mut Vec<(Id, Span)>) -> bool {\n\tmatch pat {\n\t\tast::Pat::Ident(ident) => {\n\t\t\tidentifiers.push((id!(ident.id), ident.id.span));\n\t\t\ttrue\n\t\t}\n\t\tast::Pat::Array(array) => {\n\t\t\tfor el in array.elems.iter().flatten() {\n\t\t\t\tcollect_from_pat(el, identifiers);\n\t\t\t}\n\t\t\tfalse\n\t\t}\n\t\tast::Pat::Rest(rest) => {\n\t\t\tif let ast::Pat::Ident(ident) = rest.arg.as_ref() {\n\t\t\t\tidentifiers.push((id!(ident.id), ident.id.span));\n\t\t\t}\n\t\t\tfalse\n\t\t}\n\t\tast::Pat::Assign(expr) => {\n\t\t\tif let ast::Pat::Ident(ident) = expr.left.as_ref() {\n\t\t\t\tidentifiers.push((id!(ident.id), ident.id.span));\n\t\t\t}\n\t\t\tfalse\n\t\t}\n\t\tast::Pat::Object(obj) => {\n\t\t\tfor prop in &obj.props {\n\t\t\t\tmatch prop {\n\t\t\t\t\tast::ObjectPatProp::Assign(ref v) => {\n\t\t\t\t\t\tidentifiers.push((id!(v.key), v.key.span));\n\t\t\t\t\t}\n\t\t\t\t\tast::ObjectPatProp::KeyValue(ref v) => {\n\t\t\t\t\t\tcollect_from_pat(&v.value, identifiers);\n\t\t\t\t\t}\n\t\t\t\t\tast::ObjectPatProp::Rest(ref v) => {\n\t\t\t\t\t\tif let ast::Pat::Ident(ident) = v.arg.as_ref() {\n\t\t\t\t\t\t\tidentifiers.push((id!(ident.id), ident.id.span));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfalse\n\t\t}\n\t\t_ => false,\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/const_replace.rs",
    "content": "use crate::collector::{GlobalCollect, Id};\nuse crate::words::*;\nuse swc_common::DUMMY_SP;\nuse swc_ecmascript::ast;\nuse swc_ecmascript::visit::{VisitMut, VisitMutWith};\npub struct ConstReplacerVisitor {\n\tpub is_server: bool,\n\tpub is_dev: bool,\n\tpub is_server_ident: Option<Id>,\n\tpub is_browser_ident: Option<Id>,\n\tpub is_dev_ident: Option<Id>,\n\tpub is_core_server_ident: Option<Id>,\n\tpub is_core_browser_ident: Option<Id>,\n\tpub is_core_dev_ident: Option<Id>,\n}\n\nimpl ConstReplacerVisitor {\n\tpub fn new(is_server: bool, is_dev: bool, global_collector: &GlobalCollect) -> Self {\n\t\tSelf {\n\t\t\tis_server,\n\t\t\tis_dev,\n\t\t\tis_server_ident: global_collector\n\t\t\t\t.get_imported_local(&IS_SERVER, &BUILDER_IO_QWIK_BUILD),\n\t\t\tis_browser_ident: global_collector\n\t\t\t\t.get_imported_local(&IS_BROWSER, &BUILDER_IO_QWIK_BUILD),\n\t\t\tis_dev_ident: global_collector.get_imported_local(&IS_DEV, &BUILDER_IO_QWIK_BUILD),\n\t\t\tis_core_server_ident: global_collector.get_imported_local(&IS_SERVER, &BUILDER_IO_QWIK),\n\t\t\tis_core_browser_ident: global_collector\n\t\t\t\t.get_imported_local(&IS_BROWSER, &BUILDER_IO_QWIK),\n\t\t\tis_core_dev_ident: global_collector.get_imported_local(&IS_DEV, &BUILDER_IO_QWIK),\n\t\t}\n\t}\n}\nmacro_rules! id_eq {\n\t($ident: expr, $cid: expr) => {\n\t\tif let Some(cid) = $cid {\n\t\t\tcid.0 == $ident.sym && cid.1 == $ident.ctxt\n\t\t} else {\n\t\t\tfalse\n\t\t}\n\t};\n}\n\nenum ConstVariable {\n\tIsServer,\n\tIsBrowser,\n\tIsDev,\n\tNone,\n}\nimpl VisitMut for ConstReplacerVisitor {\n\tfn visit_mut_expr(&mut self, node: &mut ast::Expr) {\n\t\tlet mode = match node {\n\t\t\tast::Expr::Ident(ref ident) => {\n\t\t\t\tif id_eq!(ident, &self.is_server_ident) {\n\t\t\t\t\tConstVariable::IsServer\n\t\t\t\t} else if id_eq!(ident, &self.is_browser_ident) {\n\t\t\t\t\tConstVariable::IsBrowser\n\t\t\t\t} else if id_eq!(ident, &self.is_dev_ident) {\n\t\t\t\t\tConstVariable::IsDev\n\t\t\t\t} else if id_eq!(ident, &self.is_core_server_ident) {\n\t\t\t\t\tConstVariable::IsServer\n\t\t\t\t} else if id_eq!(ident, &self.is_core_browser_ident) {\n\t\t\t\t\tConstVariable::IsBrowser\n\t\t\t\t} else if id_eq!(ident, &self.is_core_dev_ident) {\n\t\t\t\t\tConstVariable::IsDev\n\t\t\t\t} else {\n\t\t\t\t\tConstVariable::None\n\t\t\t\t}\n\t\t\t}\n\t\t\t_ => ConstVariable::None,\n\t\t};\n\t\tmatch mode {\n\t\t\tConstVariable::IsServer => {\n\t\t\t\t*node = ast::Expr::Lit(ast::Lit::Bool(ast::Bool {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: self.is_server,\n\t\t\t\t}))\n\t\t\t}\n\t\t\tConstVariable::IsBrowser => {\n\t\t\t\t*node = ast::Expr::Lit(ast::Lit::Bool(ast::Bool {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: !self.is_server,\n\t\t\t\t}))\n\t\t\t}\n\t\t\tConstVariable::IsDev => {\n\t\t\t\t*node = ast::Expr::Lit(ast::Lit::Bool(ast::Bool {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: self.is_dev,\n\t\t\t\t}))\n\t\t\t}\n\t\t\tConstVariable::None => {\n\t\t\t\tnode.visit_mut_children_with(self);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/entry_strategy.rs",
    "content": "use crate::transform::{SegmentData, SegmentKind};\nuse serde::{Deserialize, Serialize};\nuse swc_atoms::JsWord;\n\nuse lazy_static::lazy_static;\n\nlazy_static! {\n\tstatic ref ENTRY_SEGMENTS: JsWord = JsWord::from(\"entry_segments\");\n}\n\n// EntryStrategies\n#[derive(Debug, Serialize, Copy, Clone, Deserialize)]\n#[serde(rename_all = \"camelCase\")]\npub enum EntryStrategy {\n\tInline,\n\tHoist,\n\tSingle,\n\tHook,\n\tSegment,\n\tComponent,\n\tSmart,\n}\n\npub trait EntryPolicy: Send + Sync {\n\tfn get_entry_for_sym(&self, context: &[String], segment: &SegmentData) -> Option<JsWord>;\n}\n\n#[derive(Default, Clone)]\npub struct InlineStrategy;\n\nimpl EntryPolicy for InlineStrategy {\n\tfn get_entry_for_sym(&self, _context: &[String], _segment: &SegmentData) -> Option<JsWord> {\n\t\tSome(ENTRY_SEGMENTS.clone())\n\t}\n}\n\n#[derive(Clone)]\npub struct SingleStrategy {}\n\nimpl SingleStrategy {\n\tpub const fn new() -> Self {\n\t\tSelf {}\n\t}\n}\n\nimpl EntryPolicy for SingleStrategy {\n\tfn get_entry_for_sym(&self, _context: &[String], _segment: &SegmentData) -> Option<JsWord> {\n\t\tSome(ENTRY_SEGMENTS.clone())\n\t}\n}\n\n#[derive(Clone)]\npub struct PerSegmentStrategy {}\n\nimpl PerSegmentStrategy {\n\tpub const fn new() -> Self {\n\t\tSelf {}\n\t}\n}\n\nimpl EntryPolicy for PerSegmentStrategy {\n\tfn get_entry_for_sym(&self, _context: &[String], _segment: &SegmentData) -> Option<JsWord> {\n\t\tNone\n\t}\n}\n\n#[derive(Clone)]\npub struct PerComponentStrategy {}\n\nimpl PerComponentStrategy {\n\tpub const fn new() -> Self {\n\t\tSelf {}\n\t}\n}\n\nimpl EntryPolicy for PerComponentStrategy {\n\tfn get_entry_for_sym(&self, context: &[String], segment: &SegmentData) -> Option<JsWord> {\n\t\tcontext.first().map_or_else(\n\t\t\t|| Some(ENTRY_SEGMENTS.clone()),\n\t\t\t|root| Some(JsWord::from([&segment.origin, \"_entry_\", root].concat())),\n\t\t)\n\t}\n}\n\n#[derive(Clone)]\npub struct SmartStrategy {}\n\nimpl SmartStrategy {\n\tpub const fn new() -> Self {\n\t\tSelf {}\n\t}\n}\n\nimpl EntryPolicy for SmartStrategy {\n\tfn get_entry_for_sym(&self, context: &[String], segment: &SegmentData) -> Option<JsWord> {\n\t\t// Event handlers without scope variables are put into a separate file\n\t\tif segment.scoped_idents.is_empty()\n\t\t\t&& (segment.ctx_kind != SegmentKind::Function || &segment.ctx_name == \"event$\")\n\t\t{\n\t\t\treturn None;\n\t\t}\n\n\t\t// Everything else is put into a single file per component\n\t\t// This means that all QRLs for a component are loaded together\n\t\t// if one is used\n\t\tcontext.first().map_or_else(\n\t\t\t// Top-level QRLs are put into a separate file\n\t\t\t|| None,\n\t\t\t// Other QRLs are put into a file named after the original file + the root component\n\t\t\t|root| Some(JsWord::from([&segment.origin, \"_entry_\", root].concat())),\n\t\t)\n\t}\n}\n\npub fn parse_entry_strategy(strategy: &EntryStrategy) -> Box<dyn EntryPolicy> {\n\tmatch strategy {\n\t\tEntryStrategy::Inline | EntryStrategy::Hoist => Box::<InlineStrategy>::default(),\n\t\tEntryStrategy::Hook => Box::new(PerSegmentStrategy::new()),\n\t\tEntryStrategy::Segment => Box::new(PerSegmentStrategy::new()),\n\t\tEntryStrategy::Single => Box::new(SingleStrategy::new()),\n\t\tEntryStrategy::Component => Box::new(PerComponentStrategy::new()),\n\t\tEntryStrategy::Smart => Box::new(SmartStrategy::new()),\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/errors.rs",
    "content": "use swc_common::errors::DiagnosticId;\n\npub enum Error {\n\tFunctionReference = 2,\n\tCanNotCapture,\n\tMissingQrlImplementation = 5,\n}\n\npub fn get_diagnostic_id(err: Error) -> DiagnosticId {\n\tlet id = err as u32;\n\tDiagnosticId::Error(format!(\"C{:02}\", id))\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/filter_exports.rs",
    "content": "use swc_atoms::JsWord;\nuse swc_common::DUMMY_SP;\nuse swc_ecmascript::ast;\nuse swc_ecmascript::visit::VisitMut;\n\npub struct StripExportsVisitor<'a> {\n\tpub filter_symbols: &'a [JsWord],\n}\n\nimpl<'a> StripExportsVisitor<'a> {\n\tpub const fn new(filter_symbols: &'a [JsWord]) -> Self {\n\t\tSelf { filter_symbols }\n\t}\n}\n\nimpl<'a> VisitMut for StripExportsVisitor<'a> {\n\tfn visit_mut_module(&mut self, node: &mut ast::Module) {\n\t\tfor item in &mut node.body {\n\t\t\tif let ast::ModuleItem::ModuleDecl(ast::ModuleDecl::ExportDecl(decl)) = item {\n\t\t\t\tmatch &decl.decl {\n\t\t\t\t\tast::Decl::Var(var) => {\n\t\t\t\t\t\tif var.decls.len() == 1 {\n\t\t\t\t\t\t\tif let Some(ast::VarDeclarator {\n\t\t\t\t\t\t\t\tname: ast::Pat::Ident(ident),\n\t\t\t\t\t\t\t\t..\n\t\t\t\t\t\t\t}) = var.decls.first()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif self.filter_symbols.contains(&ident.id.sym) {\n\t\t\t\t\t\t\t\t\t*item = empty_module_item(ident.id.clone());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tast::Decl::Fn(fn_decl) => {\n\t\t\t\t\t\tif self.filter_symbols.contains(&fn_decl.ident.sym) {\n\t\t\t\t\t\t\t*item = empty_module_item(fn_decl.ident.clone());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t_ => {}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfn empty_module_item(ident: ast::Ident) -> ast::ModuleItem {\n\tast::ModuleItem::ModuleDecl(ast::ModuleDecl::ExportDecl(ast::ExportDecl {\n        span: DUMMY_SP,\n        decl: ast::Decl::Var(Box::new(ast::VarDecl {\n            kind: ast::VarDeclKind::Const,\n            decls: vec![ast::VarDeclarator {\n                definite: true,\n                span: DUMMY_SP,\n                name: ast::Pat::Ident(ast::BindingIdent {\n                    id: ident,\n                    type_ann: None,\n                }),\n                init: Some(Box::new(ast::Expr::Arrow(ast::ArrowExpr {\n                    body: Box::new(ast::BlockStmtOrExpr::BlockStmt(ast::BlockStmt {\n                        stmts: vec![ast::Stmt::Throw(ast::ThrowStmt {\n                            span: DUMMY_SP,\n                            arg: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n                                span: DUMMY_SP,\n                                value: JsWord::from(\"Symbol removed by Qwik Optimizer, it can not be called from current platform\"),\n                                raw: None,\n                            }))),\n                        })],\n                        ..Default::default()\n                    })),\n                    ..Default::default()\n                }))),\n            }],\n            ..Default::default()\n        })),\n    }))\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/fixtures/index.qwik.mjs",
    "content": "import {\n  createContextId,\n  componentQrl,\n  inlinedQrl,\n  _jsxBranch,\n  useOnDocument,\n  eventQrl,\n  useContext,\n  _jsxC,\n  SkipRender,\n  withLocale,\n  _deserializeData,\n  noSerialize,\n  useServerData,\n  useStylesQrl,\n  useStore,\n  _weakSerialize,\n  useSignal,\n  useLexicalScope,\n  _getContextElement,\n  useContextProvider,\n  useTaskQrl,\n  Slot,\n  getLocale,\n  untrack,\n  _jsxS,\n  _jsxQ,\n  _wrapSignal,\n  implicit$FirstArg,\n  _serializeData,\n  _restProps,\n  _fnSignal,\n} from '@builder.io/qwik';\nimport { isBrowser, isServer, isDev } from '@builder.io/qwik/build';\nimport * as qwikCity from '@qwik-city-plan';\nimport swRegister from '@qwik-city-sw-register';\nimport { z } from 'zod';\nimport { z as z2 } from 'zod';\nconst RouteStateContext = /* @__PURE__ */ createContextId('qc-s');\nconst ContentContext = /* @__PURE__ */ createContextId('qc-c');\nconst ContentInternalContext = /* @__PURE__ */ createContextId('qc-ic');\nconst DocumentHeadContext = /* @__PURE__ */ createContextId('qc-h');\nconst RouteLocationContext = /* @__PURE__ */ createContextId('qc-l');\nconst RouteNavigateContext = /* @__PURE__ */ createContextId('qc-n');\nconst RouteActionContext = /* @__PURE__ */ createContextId('qc-a');\nconst RouterOutlet = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl(() => {\n    _jsxBranch();\n    useOnDocument(\n      'qinit',\n      eventQrl(\n        /* @__PURE__ */ inlinedQrl(() => {\n          const POPSTATE_FALLBACK_INITIALIZED = '_qCityPopstateFallback';\n          const CLIENT_HISTORY_INITIALIZED = '_qCityHistory';\n          if (!window[POPSTATE_FALLBACK_INITIALIZED]) {\n            window[POPSTATE_FALLBACK_INITIALIZED] = () => {\n              if (!window[CLIENT_HISTORY_INITIALIZED]) location.reload();\n            };\n            setTimeout(() => {\n              addEventListener('popstate', window[POPSTATE_FALLBACK_INITIALIZED]);\n            }, 0);\n          }\n        }, 'RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc')\n      )\n    );\n    const context = useContext(ContentInternalContext);\n    if (context.value && context.value.length > 0) {\n      const contentsLen = context.value.length;\n      let cmp = null;\n      for (let i = contentsLen - 1; i >= 0; i--)\n        cmp = _jsxC(\n          context.value[i].default,\n          {\n            children: cmp,\n          },\n          1,\n          'k8_0'\n        );\n      return cmp;\n    }\n    return SkipRender;\n  }, 'RouterOutlet_component_AKetNByE5TM')\n);\nconst MODULE_CACHE = /* @__PURE__ */ new WeakMap();\nconst CLIENT_DATA_CACHE = /* @__PURE__ */ new Map();\nconst QACTION_KEY = 'qaction';\nconst toPath = (url) => url.pathname + url.search + url.hash;\nconst toUrl = (url, baseUrl) => new URL(url, baseUrl.href);\nconst isSameOrigin = (a, b) => a.origin === b.origin;\nconst isSamePath = (a, b) => a.pathname + a.search === b.pathname + b.search;\nconst isSamePathname = (a, b) => a.pathname === b.pathname;\nconst isSameOriginDifferentPathname = (a, b) => isSameOrigin(a, b) && !isSamePath(a, b);\nconst getClientDataPath = (pathname, pageSearch, action) => {\n  let search = pageSearch ?? '';\n  if (action) search += (search ? '&' : '?') + QACTION_KEY + '=' + encodeURIComponent(action.id);\n  return pathname + (pathname.endsWith('/') ? '' : '/') + 'q-data.json' + search;\n};\nconst getClientNavPath = (props, baseUrl) => {\n  const href = props.href;\n  if (typeof href === 'string' && href.trim() !== '' && typeof props.target !== 'string')\n    try {\n      const linkUrl = toUrl(href, baseUrl.url);\n      const currentUrl = toUrl('', baseUrl.url);\n      if (isSameOrigin(linkUrl, currentUrl)) return toPath(linkUrl);\n    } catch (e) {\n      console.error(e);\n    }\n  else if (props.reload) return toPath(toUrl('', baseUrl.url));\n  return null;\n};\nconst getPrefetchDataset = (props, clientNavPath, currentLoc) => {\n  if (props.prefetch === true && clientNavPath) {\n    const prefetchUrl = toUrl(clientNavPath, currentLoc.url);\n    if (!isSamePathname(prefetchUrl, toUrl('', currentLoc.url))) return '';\n  }\n  return null;\n};\nconst clientNavigate = (win, newUrl, routeNavigate) => {\n  const currentUrl = win.location;\n  if (isSameOriginDifferentPathname(currentUrl, newUrl)) {\n    handleScroll(win, currentUrl, newUrl);\n    win.history.pushState('', '', toPath(newUrl));\n  }\n  if (!win._qCityHistory) {\n    win._qCityHistory = 1;\n    win.addEventListener('popstate', () => {\n      const currentUrl2 = win.location;\n      const previousUrl = toUrl(routeNavigate.value, currentUrl2);\n      if (isSameOriginDifferentPathname(currentUrl2, previousUrl)) {\n        handleScroll(win, previousUrl, currentUrl2);\n        routeNavigate.value = toPath(new URL(currentUrl2.href));\n      }\n    });\n    win.removeEventListener('popstate', win._qCityPopstateFallback);\n  }\n};\nconst handleScroll = async (win, previousUrl, newUrl) => {\n  const doc = win.document;\n  const newHash = newUrl.hash;\n  if (isSamePath(previousUrl, newUrl)) {\n    if (previousUrl.hash !== newHash) {\n      await domWait();\n      if (newHash) scrollToHashId(doc, newHash);\n      else win.scrollTo(0, 0);\n    }\n  } else {\n    if (newHash)\n      for (let i = 0; i < 24; i++) {\n        await domWait();\n        if (scrollToHashId(doc, newHash)) break;\n      }\n    else {\n      await domWait();\n      win.scrollTo(0, 0);\n    }\n  }\n};\nconst domWait = () => new Promise((resolve) => setTimeout(resolve, 12));\nconst scrollToHashId = (doc, hash) => {\n  const elmId = hash.slice(1);\n  const elm = doc.getElementById(elmId);\n  if (elm) elm.scrollIntoView();\n  return elm;\n};\nconst dispatchPrefetchEvent = (prefetchData) => {\n  if (typeof document !== 'undefined')\n    document.dispatchEvent(\n      new CustomEvent('qprefetch', {\n        detail: prefetchData,\n      })\n    );\n};\nconst resolveHead = (endpoint, routeLocation, contentModules, locale) => {\n  const head = createDocumentHead();\n  const getData = (loaderOrAction) => {\n    const id = loaderOrAction.__id;\n    if (loaderOrAction.__brand === 'server_loader') {\n      if (!(id in endpoint.loaders))\n        throw new Error(\n          'You can not get the returned data of a loader that has not been executed for this request.'\n        );\n    }\n    const data = endpoint.loaders[id];\n    if (data instanceof Promise)\n      throw new Error('Loaders returning a function can not be referred to in the head function.');\n    return data;\n  };\n  const headProps = {\n    head,\n    withLocale: (fn) => withLocale(locale, fn),\n    resolveValue: getData,\n    ...routeLocation,\n  };\n  for (let i = contentModules.length - 1; i >= 0; i--) {\n    const contentModuleHead = contentModules[i] && contentModules[i].head;\n    if (contentModuleHead) {\n      if (typeof contentModuleHead === 'function')\n        resolveDocumentHead(\n          head,\n          withLocale(locale, () => contentModuleHead(headProps))\n        );\n      else if (typeof contentModuleHead === 'object') resolveDocumentHead(head, contentModuleHead);\n    }\n  }\n  return headProps.head;\n};\nconst resolveDocumentHead = (resolvedHead, updatedHead) => {\n  if (typeof updatedHead.title === 'string') resolvedHead.title = updatedHead.title;\n  mergeArray(resolvedHead.meta, updatedHead.meta);\n  mergeArray(resolvedHead.links, updatedHead.links);\n  mergeArray(resolvedHead.styles, updatedHead.styles);\n  Object.assign(resolvedHead.frontmatter, updatedHead.frontmatter);\n};\nconst mergeArray = (existingArr, newArr) => {\n  if (Array.isArray(newArr))\n    for (const newItem of newArr) {\n      if (typeof newItem.key === 'string') {\n        const existingIndex = existingArr.findIndex((i) => i.key === newItem.key);\n        if (existingIndex > -1) {\n          existingArr[existingIndex] = newItem;\n          continue;\n        }\n      }\n      existingArr.push(newItem);\n    }\n};\nconst createDocumentHead = () => ({\n  title: '',\n  meta: [],\n  links: [],\n  styles: [],\n  frontmatter: {},\n});\nconst loadRoute = async (routes, menus, cacheModules, pathname) => {\n  if (Array.isArray(routes))\n    for (const route of routes) {\n      const match = route[0].exec(pathname);\n      if (match) {\n        const loaders = route[1];\n        const params = getPathParams(route[2], match);\n        const routeBundleNames = route[4];\n        const mods = new Array(loaders.length);\n        const pendingLoads = [];\n        const menuLoader = getMenuLoader(menus, pathname);\n        let menu = void 0;\n        loaders.forEach((moduleLoader, i) => {\n          loadModule(\n            moduleLoader,\n            pendingLoads,\n            (routeModule) => (mods[i] = routeModule),\n            cacheModules\n          );\n        });\n        loadModule(\n          menuLoader,\n          pendingLoads,\n          (menuModule) => (menu = menuModule?.default),\n          cacheModules\n        );\n        if (pendingLoads.length > 0) await Promise.all(pendingLoads);\n        return [params, mods, menu, routeBundleNames];\n      }\n    }\n  return null;\n};\nconst loadModule = (moduleLoader, pendingLoads, moduleSetter, cacheModules) => {\n  if (typeof moduleLoader === 'function') {\n    const loadedModule = MODULE_CACHE.get(moduleLoader);\n    if (loadedModule) moduleSetter(loadedModule);\n    else {\n      const l = moduleLoader();\n      if (typeof l.then === 'function')\n        pendingLoads.push(\n          l.then((loadedModule2) => {\n            if (cacheModules !== false) MODULE_CACHE.set(moduleLoader, loadedModule2);\n            moduleSetter(loadedModule2);\n          })\n        );\n      else if (l) moduleSetter(l);\n    }\n  }\n};\nconst getMenuLoader = (menus, pathname) => {\n  if (menus) {\n    pathname = pathname.endsWith('/') ? pathname : pathname + '/';\n    const menu = menus.find(\n      (m) => m[0] === pathname || pathname.startsWith(m[0] + (pathname.endsWith('/') ? '' : '/'))\n    );\n    if (menu) return menu[1];\n  }\n};\nconst getPathParams = (paramNames, match) => {\n  const params = {};\n  if (paramNames)\n    for (let i = 0; i < paramNames.length; i++) {\n      const param = match?.[i + 1] ?? '';\n      const v = param.endsWith('/') ? param.slice(0, -1) : param;\n      params[paramNames[i]] = decodeURIComponent(v);\n    }\n  return params;\n};\nconst loadClientData = async (url, element, clearCache, action) => {\n  const pagePathname = url.pathname;\n  const pageSearch = url.search;\n  const clientDataPath = getClientDataPath(pagePathname, pageSearch, action);\n  let qData = void 0;\n  if (!action) qData = CLIENT_DATA_CACHE.get(clientDataPath);\n  dispatchPrefetchEvent({\n    links: [pagePathname],\n  });\n  if (!qData) {\n    const options = getFetchOptions(action);\n    if (action) action.data = void 0;\n    qData = fetch(clientDataPath, options).then((rsp) => {\n      const redirectedURL = new URL(rsp.url);\n      if (redirectedURL.origin !== location.origin || !isQDataJson(redirectedURL.pathname)) {\n        location.href = redirectedURL.href;\n        return;\n      }\n      if ((rsp.headers.get('content-type') || '').includes('json'))\n        return rsp.text().then((text) => {\n          const clientData = _deserializeData(text, element);\n          if (!clientData) {\n            location.href = url.href;\n            return;\n          }\n          if (clearCache) CLIENT_DATA_CACHE.delete(clientDataPath);\n          if (clientData.redirect) location.href = clientData.redirect;\n          else if (action) {\n            const actionData = clientData.loaders[action.id];\n            action.resolve({\n              status: rsp.status,\n              result: actionData,\n            });\n          }\n          return clientData;\n        });\n      else {\n        location.href = url.href;\n        return void 0;\n      }\n    });\n    if (!action) CLIENT_DATA_CACHE.set(clientDataPath, qData);\n  }\n  return qData.then((v) => {\n    if (!v) CLIENT_DATA_CACHE.delete(clientDataPath);\n    return v;\n  });\n};\nconst getFetchOptions = (action) => {\n  const actionData = action?.data;\n  if (!actionData) return void 0;\n  if (actionData instanceof FormData)\n    return {\n      method: 'POST',\n      body: actionData,\n    };\n  else\n    return {\n      method: 'POST',\n      body: JSON.stringify(actionData),\n      headers: {\n        'Content-Type': 'application/json, charset=UTF-8',\n      },\n    };\n};\nconst isQDataJson = (pathname) => {\n  return pathname.endsWith(QDATA_JSON);\n};\nconst QDATA_JSON = '/q-data.json';\nconst useContent = () => useContext(ContentContext);\nconst useDocumentHead = () => useContext(DocumentHeadContext);\nconst useLocation = () => useContext(RouteLocationContext);\nconst useNavigate = () => useContext(RouteNavigateContext);\nconst useAction = () => useContext(RouteActionContext);\nconst useQwikCityEnv = () => noSerialize(useServerData('qwikcity'));\nconst QwikCityProvider = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    useStylesQrl(\n      /* @__PURE__ */ inlinedQrl(\n        `:root{view-transition-name: none}`,\n        'QwikCityProvider_component_useStyles_RPDJAz33WLA'\n      )\n    );\n    const env = useQwikCityEnv();\n    if (!env?.params) throw new Error(`Missing Qwik City Env Data`);\n    const urlEnv = useServerData('url');\n    if (!urlEnv) throw new Error(`Missing Qwik URL Env Data`);\n    const url = new URL(urlEnv);\n    const routeLocation = useStore(\n      {\n        url,\n        params: env.params,\n        isNavigating: false,\n      },\n      {\n        deep: false,\n      }\n    );\n    const loaderState = _weakSerialize(\n      useStore(env.response.loaders, {\n        deep: false,\n      })\n    );\n    const navPath = useSignal(toPath(url));\n    const documentHead = useStore(createDocumentHead);\n    const content = useStore({\n      headings: void 0,\n      menu: void 0,\n    });\n    const contentInternal = useSignal();\n    const currentActionId = env.response.action;\n    const currentAction = currentActionId ? env.response.loaders[currentActionId] : void 0;\n    const actionState = useSignal(\n      currentAction\n        ? {\n            id: currentActionId,\n            data: env.response.formData,\n            output: {\n              result: currentAction,\n              status: env.response.status,\n            },\n          }\n        : void 0\n    );\n    const goto = eventQrl(\n      /* @__PURE__ */ inlinedQrl(\n        async (path, forceReload) => {\n          const [actionState2, navPath2, routeLocation2] = useLexicalScope();\n          if (path === void 0) {\n            path = navPath2.value;\n            navPath2.value = '';\n          } else if (forceReload) navPath2.value = '';\n          const resolvedURL = new URL(path, routeLocation2.url);\n          path = toPath(resolvedURL);\n          if (!forceReload && navPath2.value === path) return;\n          navPath2.value = path;\n          if (isBrowser) {\n            loadClientData(resolvedURL, _getContextElement());\n            loadRoute(qwikCity.routes, qwikCity.menus, qwikCity.cacheModules, resolvedURL.pathname);\n          }\n          actionState2.value = void 0;\n          routeLocation2.isNavigating = true;\n        },\n        'QwikCityProvider_component_goto_event_cBcjROynRVg',\n        [actionState, navPath, routeLocation]\n      )\n    );\n    useContextProvider(ContentContext, content);\n    useContextProvider(ContentInternalContext, contentInternal);\n    useContextProvider(DocumentHeadContext, documentHead);\n    useContextProvider(RouteLocationContext, routeLocation);\n    useContextProvider(RouteNavigateContext, goto);\n    useContextProvider(RouteStateContext, loaderState);\n    useContextProvider(RouteActionContext, actionState);\n    useTaskQrl(\n      /* @__PURE__ */ inlinedQrl(\n        ({ track }) => {\n          const [\n            actionState2,\n            content2,\n            contentInternal2,\n            documentHead2,\n            env2,\n            loaderState2,\n            navPath2,\n            props2,\n            routeLocation2,\n            url2,\n          ] = useLexicalScope();\n          async function run() {\n            const [path, action] = track(() => [navPath2.value, actionState2.value]);\n            const locale = getLocale('');\n            let trackUrl;\n            let clientPageData;\n            let loadedRoute = null;\n            if (isServer) {\n              trackUrl = new URL(path, routeLocation2.url);\n              loadedRoute = env2.loadedRoute;\n              clientPageData = env2.response;\n            } else {\n              trackUrl = new URL(path, location);\n              if (trackUrl.pathname.endsWith('/')) {\n                if (!qwikCity.trailingSlash) trackUrl.pathname = trackUrl.pathname.slice(0, -1);\n              } else if (qwikCity.trailingSlash) trackUrl.pathname += '/';\n              let loadRoutePromise = loadRoute(\n                qwikCity.routes,\n                qwikCity.menus,\n                qwikCity.cacheModules,\n                trackUrl.pathname\n              );\n              const element = _getContextElement();\n              const pageData = (clientPageData = await loadClientData(\n                trackUrl,\n                element,\n                true,\n                action\n              ));\n              if (!pageData) {\n                navPath2.untrackedValue = toPath(trackUrl);\n                return;\n              }\n              const newHref = pageData.href;\n              const newURL = new URL(newHref, trackUrl.href);\n              if (newURL.pathname !== trackUrl.pathname) {\n                trackUrl = newURL;\n                loadRoutePromise = loadRoute(\n                  qwikCity.routes,\n                  qwikCity.menus,\n                  qwikCity.cacheModules,\n                  trackUrl.pathname\n                );\n              }\n              loadedRoute = await loadRoutePromise;\n            }\n            if (loadedRoute) {\n              const [params, mods, menu] = loadedRoute;\n              const contentModules = mods;\n              const pageModule = contentModules[contentModules.length - 1];\n              routeLocation2.url = trackUrl;\n              routeLocation2.params = {\n                ...params,\n              };\n              navPath2.untrackedValue = toPath(trackUrl);\n              const resolvedHead = resolveHead(\n                clientPageData,\n                routeLocation2,\n                contentModules,\n                locale\n              );\n              content2.headings = pageModule.headings;\n              content2.menu = menu;\n              contentInternal2.value = noSerialize(contentModules);\n              documentHead2.links = resolvedHead.links;\n              documentHead2.meta = resolvedHead.meta;\n              documentHead2.styles = resolvedHead.styles;\n              documentHead2.title = resolvedHead.title;\n              documentHead2.frontmatter = resolvedHead.frontmatter;\n              if (isBrowser) {\n                if (\n                  (props2.viewTransition ?? true) &&\n                  isSameOriginDifferentPathname(window.location, url2)\n                )\n                  document.__q_view_transition__ = true;\n                const loaders = clientPageData?.loaders;\n                if (loaders) Object.assign(loaderState2, loaders);\n                CLIENT_DATA_CACHE.clear();\n                clientNavigate(window, trackUrl, navPath2);\n                routeLocation2.isNavigating = false;\n              }\n            }\n          }\n          const promise = run();\n          if (isServer) return promise;\n          else return;\n        },\n        'QwikCityProvider_component_useTask_02wMImzEAbk',\n        [\n          actionState,\n          content,\n          contentInternal,\n          documentHead,\n          env,\n          loaderState,\n          navPath,\n          props,\n          routeLocation,\n          url,\n        ]\n      )\n    );\n    return /* @__PURE__ */ _jsxC(Slot, null, 3, 'qY_0');\n  }, 'QwikCityProvider_component_TxCFOy819ag')\n);\nconst QwikCityMockProvider = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    const urlEnv = props.url ?? 'http://localhost/';\n    const url = new URL(urlEnv);\n    const routeLocation = useStore(\n      {\n        url,\n        params: props.params ?? {},\n        isNavigating: false,\n      },\n      {\n        deep: false,\n      }\n    );\n    const loaderState = useSignal({});\n    const goto = /* @__PURE__ */ inlinedQrl(async (path) => {\n      throw new Error('Not implemented');\n    }, 'QwikCityMockProvider_component_goto_BUbtvTyvVRE');\n    const documentHead = useStore(createDocumentHead, {\n      deep: false,\n    });\n    const content = useStore(\n      {\n        headings: void 0,\n        menu: void 0,\n      },\n      {\n        deep: false,\n      }\n    );\n    const contentInternal = useSignal();\n    useContextProvider(ContentContext, content);\n    useContextProvider(ContentInternalContext, contentInternal);\n    useContextProvider(DocumentHeadContext, documentHead);\n    useContextProvider(RouteLocationContext, routeLocation);\n    useContextProvider(RouteNavigateContext, goto);\n    useContextProvider(RouteStateContext, loaderState);\n    return /* @__PURE__ */ _jsxC(Slot, null, 3, 'qY_1');\n  }, 'QwikCityMockProvider_component_WmYC5H00wtI')\n);\nconst Link = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    const nav = useNavigate();\n    const loc = useLocation();\n    const linkProps = {\n      ...props,\n    };\n    const clientNavPath = untrack(() => getClientNavPath(linkProps, loc));\n    const prefetchDataset = untrack(() => getPrefetchDataset(props, clientNavPath, loc));\n    const reload = !!linkProps.reload;\n    linkProps['preventdefault:click'] = !!clientNavPath;\n    linkProps.href = clientNavPath || props.href;\n    const event = eventQrl(\n      /* @__PURE__ */ inlinedQrl(\n        (ev, elm) => prefetchLinkResources(elm, ev.type === 'qvisible'),\n        'Link_component_event_event_5g4B0Gd1Wck'\n      )\n    );\n    return /* @__PURE__ */ _jsxS(\n      'a',\n      {\n        ...linkProps,\n        'data-prefetch': prefetchDataset,\n        children: /* @__PURE__ */ _jsxC(Slot, null, 3, 'AD_0'),\n        onClick$: /* @__PURE__ */ inlinedQrl(\n          (_, elm) => {\n            const [nav2, reload2] = useLexicalScope();\n            if (elm.href) nav2(elm.href, reload2);\n          },\n          'Link_component_a_onClick_kzjavhDI3L0',\n          [nav, reload]\n        ),\n        onMouseOver$: event,\n        onFocus$: event,\n        onQVisible$: event,\n      },\n      null,\n      0,\n      'AD_1'\n    );\n  }, 'Link_component_8gdLBszqbaM')\n);\nconst prefetchLinkResources = (elm, isOnVisible) => {\n  if (elm && elm.href && elm.hasAttribute('data-prefetch')) {\n    if (!windowInnerWidth) windowInnerWidth = innerWidth;\n    if (!isOnVisible || (isOnVisible && windowInnerWidth < 520))\n      loadClientData(new URL(elm.href), elm);\n  }\n};\nlet windowInnerWidth = 0;\nconst ServiceWorkerRegister = (props) =>\n  _jsxQ(\n    'script',\n    {\n      nonce: _wrapSignal(props, 'nonce'),\n    },\n    {\n      dangerouslySetInnerHTML: swRegister,\n    },\n    null,\n    3,\n    '1Z_0'\n  );\nconst routeActionQrl = (actionQrl, ...rest) => {\n  const { id, validators } = getValidators(rest, actionQrl);\n  function action() {\n    const loc = useLocation();\n    const currentAction = useAction();\n    const initialState = {\n      actionPath: `?${QACTION_KEY}=${id}`,\n      isRunning: false,\n      status: void 0,\n      value: void 0,\n      formData: void 0,\n    };\n    const state = useStore(() => {\n      const value = currentAction.value;\n      if (value && value?.id === id) {\n        const data = value.data;\n        if (data instanceof FormData) initialState.formData = data;\n        if (value.output) {\n          const { status, result } = value.output;\n          initialState.status = status;\n          initialState.value = result;\n        }\n      }\n      return initialState;\n    });\n    const submit = /* @__PURE__ */ inlinedQrl(\n      (input = {}) => {\n        const [currentAction2, id2, loc2, state2] = useLexicalScope();\n        if (isServer)\n          throw new Error(`Actions can not be invoked within the server during SSR.\nAction.run() can only be called on the browser, for example when a user clicks a button, or submits a form.`);\n        let data;\n        let form;\n        if (input instanceof SubmitEvent) {\n          form = input.target;\n          data = new FormData(form);\n          if (\n            (input.submitter instanceof HTMLInputElement ||\n              input.submitter instanceof HTMLButtonElement) &&\n            input.submitter.name\n          ) {\n            if (input.submitter.name) data.append(input.submitter.name, input.submitter.value);\n          }\n        } else data = input;\n        return new Promise((resolve) => {\n          if (data instanceof FormData) state2.formData = data;\n          state2.isRunning = true;\n          loc2.isNavigating = true;\n          currentAction2.value = {\n            data,\n            id: id2,\n            resolve: noSerialize(resolve),\n          };\n        }).then(({ result, status }) => {\n          state2.isRunning = false;\n          state2.status = status;\n          state2.value = result;\n          if (form) {\n            if (form.getAttribute('data-spa-reset') === 'true') form.reset();\n            const detail = {\n              status,\n              value: result,\n            };\n            form.dispatchEvent(\n              new CustomEvent('submitcompleted', {\n                bubbles: false,\n                cancelable: false,\n                composed: false,\n                detail,\n              })\n            );\n          }\n          return {\n            status,\n            value: result,\n          };\n        });\n      },\n      'routeActionQrl_action_submit_A5bZC7WO00A',\n      [currentAction, id, loc, state]\n    );\n    initialState.submit = submit;\n    return state;\n  }\n  action.__brand = 'server_action';\n  action.__validators = validators;\n  action.__qrl = actionQrl;\n  action.__id = id;\n  Object.freeze(action);\n  return action;\n};\nconst globalActionQrl = (actionQrl, ...rest) => {\n  const action = routeActionQrl(actionQrl, ...rest);\n  if (isServer) {\n    if (typeof globalThis._qwikActionsMap === 'undefined')\n      globalThis._qwikActionsMap = /* @__PURE__ */ new Map();\n    globalThis._qwikActionsMap.set(action.__id, action);\n  }\n  return action;\n};\nconst routeAction$ = /* @__PURE__ */ implicit$FirstArg(routeActionQrl);\nconst globalAction$ = /* @__PURE__ */ implicit$FirstArg(globalActionQrl);\nconst routeLoaderQrl = (loaderQrl, ...rest) => {\n  const { id, validators } = getValidators(rest, loaderQrl);\n  function loader() {\n    return useContext(RouteStateContext, (state) => {\n      if (!(id in state))\n        throw new Error(`Loader (${id}) was used in a path where the 'loader$' was not declared.\n    This is likely because the used loader was not exported in a layout.tsx or index.tsx file of the existing route.\n    For more information check: https://qwik.dev/qwikcity/route-loader/`);\n      return _wrapSignal(state, id);\n    });\n  }\n  loader.__brand = 'server_loader';\n  loader.__qrl = loaderQrl;\n  loader.__validators = validators;\n  loader.__id = id;\n  Object.freeze(loader);\n  return loader;\n};\nconst routeLoader$ = /* @__PURE__ */ implicit$FirstArg(routeLoaderQrl);\nconst validatorQrl = (validator) => {\n  if (isServer)\n    return {\n      validate: validator,\n    };\n  return void 0;\n};\nconst validator$ = /* @__PURE__ */ implicit$FirstArg(validatorQrl);\nconst zodQrl = (qrl) => {\n  if (isServer) {\n    const schema = qrl.resolve().then((obj) => {\n      if (typeof obj === 'function') obj = obj(z);\n      if (obj instanceof z.Schema) return obj;\n      else return z.object(obj);\n    });\n    return {\n      async validate(ev, inputData) {\n        const data = inputData ?? (await ev.parseBody());\n        const result = await (await schema).safeParseAsync(data);\n        if (result.success) return result;\n        else {\n          if (isDev)\n            console.error(\n              '\\nVALIDATION ERROR\\naction$() zod validated failed',\n              '\\n  - Issues:',\n              result.error.issues\n            );\n          return {\n            success: false,\n            status: 400,\n            error: result.error.flatten(),\n          };\n        }\n      },\n    };\n  }\n  return void 0;\n};\nconst zod$ = /* @__PURE__ */ implicit$FirstArg(zodQrl);\nconst serverQrl = (qrl) => {\n  if (isServer) {\n    const captured = qrl.getCaptured();\n    if (captured && captured.length > 0 && !_getContextElement())\n      throw new Error('For security reasons, we cannot serialize QRLs that capture lexical scope.');\n  }\n  function stuff() {\n    return /* @__PURE__ */ inlinedQrl(\n      async (...args) => {\n        const [qrl2] = useLexicalScope();\n        if (isServer) {\n          const requestEvent = useQwikCityEnv()?.ev;\n          return qrl2.apply(requestEvent, args);\n        } else {\n          const ctxElm = _getContextElement();\n          const filtered = args.map((arg) => {\n            if (arg instanceof SubmitEvent && arg.target instanceof HTMLFormElement)\n              return new FormData(arg.target);\n            else if (arg instanceof Event) return null;\n            else if (arg instanceof Node) return null;\n            return arg;\n          });\n          const hash = qrl2.getHash();\n          const path = `?qfunc=${qrl2.getHash()}`;\n          const body = await _serializeData([qrl2, ...filtered], false);\n          const res = await fetch(path, {\n            method: 'POST',\n            headers: {\n              'Content-Type': 'application/qwik-json',\n              'X-QRL': hash,\n            },\n            body,\n          });\n          const contentType = res.headers.get('Content-Type');\n          if (res.ok && contentType === 'text/event-stream') {\n            const { writable, readable } = getSSETransformer();\n            res.body?.pipeTo(writable);\n            return streamAsyncIterator(readable, ctxElm ?? document.documentElement);\n          } else if (contentType === 'application/qwik-json') {\n            const str = await res.text();\n            const obj = await _deserializeData(str, ctxElm ?? document.documentElement);\n            if (res.status === 500) throw obj;\n            return obj;\n          }\n        }\n      },\n      'serverQrl_stuff_wOIPfiQ04l4',\n      [qrl]\n    );\n  }\n  return stuff();\n};\nconst server$ = /* @__PURE__ */ implicit$FirstArg(serverQrl);\nconst getValidators = (rest, qrl) => {\n  let id;\n  const validators = [];\n  if (rest.length === 1) {\n    const options = rest[0];\n    if (options && typeof options === 'object') {\n      if ('validate' in options) validators.push(options);\n      else {\n        id = options.id;\n        if (options.validation) validators.push(...options.validation);\n      }\n    }\n  } else if (rest.length > 1) validators.push(...rest.filter((v) => !!v));\n  if (typeof id === 'string') {\n    if (isDev) {\n      if (!/^[\\w/.-]+$/.test(id))\n        throw new Error(`Invalid id: ${id}, id can only contain [a-zA-Z0-9_.-]`);\n    }\n    id = `id_${id}`;\n  } else id = qrl.getHash();\n  return {\n    validators: validators.reverse(),\n    id,\n  };\n};\nconst getSSETransformer = () => {\n  let currentLine = '';\n  const encoder = new TextDecoder();\n  const transformer = new TransformStream({\n    transform(chunk, controller) {\n      const lines = encoder.decode(chunk).split('\\n\\n');\n      for (let i = 0; i < lines.length - 1; i++) {\n        const line = currentLine + lines[i];\n        if (line.length === 0) {\n          controller.terminate();\n          break;\n        } else {\n          controller.enqueue(parseEvent(line));\n          currentLine = '';\n        }\n      }\n      currentLine += lines[lines.length - 1];\n    },\n  });\n  return transformer;\n};\nconst parseEvent = (message) => {\n  const lines = message.split('\\n');\n  const event = {\n    data: '',\n  };\n  let data = '';\n  for (const line of lines)\n    if (line.startsWith('data: ')) data += line.slice(6) + '\\n';\n    else {\n      const [key, value] = line.split(':');\n      if (typeof key === 'string' && typeof value === 'string') event[key] = value.trim();\n    }\n  event.data = data;\n  return event;\n};\nasync function* streamAsyncIterator(stream, ctxElm) {\n  const reader = stream.getReader();\n  try {\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) return;\n      const obj = await _deserializeData(value.data, ctxElm);\n      yield obj;\n    }\n  } finally {\n    reader.releaseLock();\n  }\n}\nconst Form = ({ action, spaReset, reloadDocument, onSubmit$, ...rest }, key) => {\n  _jsxBranch();\n  if (action)\n    return _jsxS(\n      'form',\n      {\n        ...rest,\n        action: _wrapSignal(action, 'actionPath'),\n        'preventdefault:submit': !reloadDocument,\n        ['data-spa-reset']: spaReset ? 'true' : void 0,\n        onSubmit$: [!reloadDocument ? action.submit : void 0, onSubmit$],\n      },\n      {\n        method: 'post',\n      },\n      0,\n      key\n    );\n  else\n    return /* @__PURE__ */ _jsxC(\n      GetForm,\n      {\n        spaReset,\n        reloadDocument,\n        onSubmit$,\n        ...rest,\n      },\n      0,\n      key\n    );\n};\nconst GetForm = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    const rest = _restProps(props, ['action', 'spaReset', 'reloadDocument', 'onSubmit$']);\n    const nav = useNavigate();\n    return /* @__PURE__ */ _jsxS(\n      'form',\n      {\n        ...rest,\n        children: /* @__PURE__ */ _jsxC(Slot, null, 3, 'BC_0'),\n        onSubmit$: /* @__PURE__ */ inlinedQrl(\n          async (_, form) => {\n            const [nav2] = useLexicalScope();\n            const formData = new FormData(form);\n            const params = new URLSearchParams();\n            formData.forEach((value, key) => {\n              if (typeof value === 'string') params.append(key, value);\n            });\n            nav2('?' + params.toString(), true).then(() => {\n              if (form.getAttribute('data-spa-reset') === 'true') form.reset();\n              form.dispatchEvent(\n                new CustomEvent('submitcompleted', {\n                  bubbles: false,\n                  cancelable: false,\n                  composed: false,\n                  detail: {\n                    status: 200,\n                  },\n                })\n              );\n            });\n          },\n          'GetForm_component_form_onSubmit_p9MSze0ojs4',\n          [nav]\n        ),\n      },\n      {\n        action: 'get',\n        'preventdefault:submit': _fnSignal(\n          (p0) => !p0.reloadDocument,\n          [props],\n          '!p0.reloadDocument'\n        ),\n        'data-spa-reset': _fnSignal(\n          (p0) => (p0.spaReset ? 'true' : void 0),\n          [props],\n          'p0.spaReset?\"true\":undefined'\n        ),\n      },\n      0,\n      'BC_1'\n    );\n  }, 'GetForm_component_Nk9PlpjQm9Y')\n);\nexport {\n  Form,\n  Link,\n  QwikCityMockProvider,\n  QwikCityProvider,\n  RouterOutlet,\n  ServiceWorkerRegister,\n  globalAction$,\n  globalActionQrl,\n  routeAction$,\n  routeActionQrl,\n  routeLoader$,\n  routeLoaderQrl,\n  server$,\n  serverQrl,\n  useContent,\n  useDocumentHead,\n  useLocation,\n  useNavigate,\n  validator$,\n  validatorQrl,\n  z2 as z,\n  zod$,\n  zodQrl,\n};\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/has_branches.rs",
    "content": "use std::collections::HashSet;\n\nuse crate::collector::Id;\nuse swc_ecmascript::ast;\nuse swc_ecmascript::visit::{noop_visit_type, Visit, VisitWith};\n\nmacro_rules! id {\n\t($ident: expr) => {\n\t\t($ident.sym.clone(), $ident.ctxt)\n\t};\n}\n\npub fn is_conditional_jsx(\n\texpr: &ast::BlockStmtOrExpr,\n\tjsx_functions: &HashSet<Id>,\n\timmutable_function_cmp: &HashSet<Id>,\n) -> bool {\n\tlet mut collector = HasBranches::new(jsx_functions, immutable_function_cmp);\n\texpr.visit_with(&mut collector);\n\tcollector.conditional\n}\n\npub fn is_conditional_jsx_block(\n\texpr: &ast::BlockStmt,\n\tjsx_functions: &HashSet<Id>,\n\timmutable_function_cmp: &HashSet<Id>,\n) -> bool {\n\tlet mut collector = HasBranches::new(jsx_functions, immutable_function_cmp);\n\texpr.visit_with(&mut collector);\n\tcollector.conditional\n}\n\npub struct HasBranches<'a> {\n\tunder_conditional: i32,\n\tjsx_functions: &'a HashSet<Id>,\n\timmutable_function_cmp: &'a HashSet<Id>,\n\tconditional: bool,\n\tfound_return: bool,\n}\n\nimpl<'a> HasBranches<'a> {\n\tconst fn new(jsx_functions: &'a HashSet<Id>, immutable_function_cmp: &'a HashSet<Id>) -> Self {\n\t\tSelf {\n\t\t\tjsx_functions,\n\t\t\timmutable_function_cmp,\n\t\t\tunder_conditional: 0,\n\t\t\tconditional: false,\n\t\t\tfound_return: false,\n\t\t}\n\t}\n}\n\nimpl<'a> Visit for HasBranches<'a> {\n\tnoop_visit_type!();\n\n\tfn visit_arrow_expr(&mut self, _: &ast::ArrowExpr) {}\n\tfn visit_fn_expr(&mut self, _: &ast::FnExpr) {}\n\tfn visit_fn_decl(&mut self, _: &ast::FnDecl) {}\n\n\tfn visit_return_stmt(&mut self, node: &ast::ReturnStmt) {\n\t\tnode.visit_children_with(self);\n\t\tself.found_return = true;\n\t}\n\n\tfn visit_for_in_stmt(&mut self, node: &ast::ForInStmt) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_for_of_stmt(&mut self, node: &ast::ForOfStmt) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_for_stmt(&mut self, node: &ast::ForStmt) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_if_stmt(&mut self, node: &ast::IfStmt) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_while_stmt(&mut self, node: &ast::WhileStmt) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_do_while_stmt(&mut self, node: &ast::DoWhileStmt) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_switch_stmt(&mut self, node: &ast::SwitchStmt) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_cond_expr(&mut self, node: &ast::CondExpr) {\n\t\tself.under_conditional += 1;\n\t\tnode.visit_children_with(self);\n\t\tself.under_conditional -= 1;\n\t}\n\n\tfn visit_bin_expr(&mut self, node: &ast::BinExpr) {\n\t\tif matches!(\n\t\t\tnode.op,\n\t\t\tast::BinaryOp::LogicalAnd | ast::BinaryOp::LogicalOr | ast::BinaryOp::NullishCoalescing\n\t\t) {\n\t\t\tself.under_conditional += 1;\n\t\t\tnode.visit_children_with(self);\n\t\t\tself.under_conditional -= 1;\n\t\t} else {\n\t\t\tnode.visit_children_with(self);\n\t\t}\n\t}\n\n\tfn visit_call_expr(&mut self, node: &ast::CallExpr) {\n\t\tif self.under_conditional > 0 || self.found_return {\n\t\t\tif let ast::Callee::Expr(box ast::Expr::Ident(ident)) = &node.callee {\n\t\t\t\tif self.jsx_functions.contains(&id!(ident)) {\n\t\t\t\t\tlet first_arg = node.args.first();\n\t\t\t\t\tif let Some(name) = first_arg {\n\t\t\t\t\t\tif let ast::Expr::Ident(jsx_id) = &*name.expr {\n\t\t\t\t\t\t\tif !self.immutable_function_cmp.contains(&id!(jsx_id)) {\n\t\t\t\t\t\t\t\tself.conditional = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnode.visit_children_with(self);\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/inlined_fn.rs",
    "content": "use std::collections::HashMap;\n\nuse crate::collector::{new_ident_from_id, Id};\nuse std::str;\nuse swc_common::DUMMY_SP;\nuse swc_common::{sync::Lrc, SourceMap};\nuse swc_ecmascript::ast;\nuse swc_ecmascript::codegen::text_writer::JsWriter;\nuse swc_ecmascript::transforms::fixer;\nuse swc_ecmascript::transforms::hygiene::hygiene_with_config;\nuse swc_ecmascript::{\n\tutils::private_ident,\n\tvisit::{VisitMut, VisitMutWith},\n};\n\nmacro_rules! id {\n\t($ident: expr) => {\n\t\t($ident.sym.clone(), $ident.ctxt)\n\t};\n}\n\npub fn convert_inlined_fn(\n\tmut expr: ast::Expr,\n\tscoped_idents: Vec<Id>,\n\tqqsegment: &Id,\n\taccept_call_expr: bool,\n\tserialize_fn: bool,\n) -> (Option<ast::Expr>, bool) {\n\tlet mut identifiers = HashMap::new();\n\tlet params: Vec<ast::Pat> = scoped_idents\n\t\t.iter()\n\t\t.enumerate()\n\t\t.map(|(index, id)| {\n\t\t\tlet new_ident = private_ident!(format!(\"p{}\", index));\n\t\t\tidentifiers.insert(id.clone(), ast::Expr::Ident(new_ident.clone()));\n\t\t\tast::Pat::Ident(ast::BindingIdent {\n\t\t\t\tid: new_ident,\n\t\t\t\ttype_ann: None,\n\t\t\t})\n\t\t})\n\t\t.collect();\n\n\tif matches!(expr, ast::Expr::Arrow(_)) {\n\t\treturn (None, false);\n\t}\n\n\t// Replace identifier\n\tlet mut replace_identifiers = ReplaceIdentifiers::new(identifiers, accept_call_expr);\n\texpr.visit_mut_with(&mut replace_identifiers);\n\n\tif replace_identifiers.abort {\n\t\treturn (None, false);\n\t}\n\n\tlet rendered_expr = render_expr(&expr);\n\tif rendered_expr.len() > 150 {\n\t\treturn (None, false);\n\t}\n\n\tif scoped_idents.is_empty() {\n\t\treturn (None, true);\n\t}\n\n\t// Generate stringified version\n\tlet rendered_str =\n\t\tast::ExprOrSpread::from(ast::Expr::Lit(ast::Lit::Str(ast::Str::from(rendered_expr))));\n\n\t// Wrap around arrow functions\n\tlet expr = ast::Expr::Arrow(ast::ArrowExpr {\n\t\tbody: Box::new(ast::BlockStmtOrExpr::Expr(Box::new(expr))),\n\t\tparams,\n\t\t..Default::default()\n\t});\n\n\tlet mut args = vec![\n\t\tast::ExprOrSpread::from(expr),\n\t\tast::ExprOrSpread::from(ast::Expr::Array(ast::ArrayLit {\n\t\t\tspan: DUMMY_SP,\n\t\t\telems: scoped_idents\n\t\t\t\t.iter()\n\t\t\t\t.map(|id| {\n\t\t\t\t\tSome(ast::ExprOrSpread::from(ast::Expr::Ident(\n\t\t\t\t\t\tnew_ident_from_id(id),\n\t\t\t\t\t)))\n\t\t\t\t})\n\t\t\t\t.collect(),\n\t\t})),\n\t];\n\n\tif serialize_fn {\n\t\targs.push(rendered_str)\n\t}\n\n\t(\n\t\tSome(ast::Expr::Call(ast::CallExpr {\n\t\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(qqsegment)))),\n\t\t\targs,\n\t\t\t..Default::default()\n\t\t})),\n\t\ttrue,\n\t)\n}\n\nstruct ReplaceIdentifiers {\n\tpub identifiers: HashMap<Id, ast::Expr>,\n\tpub accept_call_expr: bool,\n\tpub abort: bool,\n}\n\nimpl ReplaceIdentifiers {\n\tconst fn new(identifiers: HashMap<Id, ast::Expr>, accept_call_expr: bool) -> Self {\n\t\tSelf {\n\t\t\tidentifiers,\n\t\t\taccept_call_expr,\n\t\t\tabort: false,\n\t\t}\n\t}\n}\n\nimpl VisitMut for ReplaceIdentifiers {\n\tfn visit_mut_expr(&mut self, node: &mut ast::Expr) {\n\t\tmatch node {\n\t\t\tast::Expr::Ident(ident) => {\n\t\t\t\tif let Some(expr) = self.identifiers.get(&id!(ident)) {\n\t\t\t\t\t*node = expr.clone();\n\t\t\t\t}\n\t\t\t}\n\t\t\t_ => {\n\t\t\t\tnode.visit_mut_children_with(self);\n\t\t\t}\n\t\t}\n\t}\n\n\tfn visit_mut_prop(&mut self, node: &mut ast::Prop) {\n\t\tif let ast::Prop::Shorthand(short) = node {\n\t\t\tif let Some(expr) = self.identifiers.get(&id!(short)) {\n\t\t\t\t*node = ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\tkey: ast::PropName::Ident(short.clone().into()),\n\t\t\t\t\tvalue: Box::new(expr.clone()),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tnode.visit_mut_children_with(self);\n\t}\n\n\tfn visit_mut_callee(&mut self, node: &mut ast::Callee) {\n\t\tif !self.accept_call_expr || matches!(node, ast::Callee::Import(_)) {\n\t\t\tself.abort = true;\n\t\t} else {\n\t\t\tnode.visit_mut_children_with(self);\n\t\t}\n\t}\n\n\tfn visit_mut_arrow_expr(&mut self, _: &mut ast::ArrowExpr) {\n\t\tself.abort = true;\n\t}\n\n\tfn visit_mut_function(&mut self, _: &mut ast::Function) {\n\t\tself.abort = true;\n\t}\n\n\tfn visit_mut_class_expr(&mut self, _: &mut ast::ClassExpr) {\n\t\tself.abort = true;\n\t}\n\n\tfn visit_mut_decorator(&mut self, _: &mut ast::Decorator) {\n\t\tself.abort = true;\n\t}\n\n\tfn visit_mut_stmt(&mut self, _: &mut ast::Stmt) {\n\t\tself.abort = true;\n\t}\n}\n\npub fn render_expr(expr: &ast::Expr) -> String {\n\tlet mut expr = expr.clone();\n\tlet mut buf = Vec::new();\n\tlet source_map = Lrc::new(SourceMap::default());\n\tlet writer = Box::new(JsWriter::new(Lrc::clone(&source_map), \"\\n\", &mut buf, None));\n\tlet config = swc_ecmascript::codegen::Config::default().with_minify(true);\n\tlet mut emitter = swc_ecmascript::codegen::Emitter {\n\t\tcfg: config,\n\t\tcomments: None,\n\t\tcm: Lrc::clone(&source_map),\n\t\twr: writer,\n\t};\n\texpr.visit_mut_with(&mut hygiene_with_config(Default::default()));\n\texpr.visit_mut_with(&mut fixer(None));\n\temitter\n\t\t.emit_module_item(&ast::ModuleItem::Stmt(ast::Stmt::Expr(ast::ExprStmt {\n\t\t\tspan: DUMMY_SP,\n\t\t\texpr: Box::new(expr),\n\t\t})))\n\t\t.expect(\"Should emit\");\n\n\tstr::from_utf8(&buf)\n\t\t.expect(\"should be utf8\")\n\t\t.trim_end_matches(';')\n\t\t.to_string()\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/is_immutable.rs",
    "content": "use crate::collector::GlobalCollect;\nuse crate::transform::{IdPlusType, IdentType};\nuse swc_ecmascript::ast;\nuse swc_ecmascript::visit::{noop_visit_type, Visit};\n\nmacro_rules! id {\n\t($ident: expr) => {\n\t\t($ident.sym.clone(), $ident.ctxt)\n\t};\n}\n\npub fn is_immutable_expr(\n\texpr: &ast::Expr,\n\tglobal: &GlobalCollect,\n\tcurrent_stack: Option<&Vec<IdPlusType>>,\n) -> bool {\n\tlet mut collector = ImmutableCollector::new(global, current_stack);\n\tcollector.visit_expr(expr);\n\tcollector.is_immutable\n}\n\npub struct ImmutableCollector<'a> {\n\tglobal: &'a GlobalCollect,\n\timmutable_idents: Option<&'a Vec<IdPlusType>>,\n\n\tpub is_immutable: bool,\n}\n\nimpl<'a> ImmutableCollector<'a> {\n\tconst fn new(global: &'a GlobalCollect, immutable_idents: Option<&'a Vec<IdPlusType>>) -> Self {\n\t\tSelf {\n\t\t\tglobal,\n\t\t\tis_immutable: true,\n\t\t\timmutable_idents,\n\t\t}\n\t}\n}\n\n// A prop is considered mutable if it:\n// - calls a function\n// - accesses a member\n// - is a variable that is not an import, an export, or in the immutable stack\nimpl<'a> Visit for ImmutableCollector<'a> {\n\tnoop_visit_type!();\n\n\tfn visit_call_expr(&mut self, _: &ast::CallExpr) {\n\t\tself.is_immutable = false;\n\t}\n\n\tfn visit_member_expr(&mut self, _: &ast::MemberExpr) {\n\t\tself.is_immutable = false;\n\t}\n\n\tfn visit_arrow_expr(&mut self, _: &ast::ArrowExpr) {}\n\n\tfn visit_ident(&mut self, ident: &ast::Ident) {\n\t\tlet id = id!(ident);\n\t\tif self.global.imports.contains_key(&id) {\n\t\t\treturn;\n\t\t}\n\t\tif self.global.exports.contains_key(&id) {\n\t\t\treturn;\n\t\t}\n\t\tif let Some(current_stack) = self.immutable_idents {\n\t\t\tif current_stack\n\t\t\t\t.iter()\n\t\t\t\t.any(|item| item.1 == IdentType::Var(true) && item.0 == id)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tself.is_immutable = false;\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/lib.rs",
    "content": "#![deny(clippy::all)]\n#![deny(clippy::perf)]\n#![deny(clippy::nursery)]\n#![allow(clippy::use_self)]\n#![feature(box_patterns)]\n#![allow(clippy::option_if_let_else)]\n#![allow(clippy::iter_with_drain)]\n#[cfg(test)]\nmod test;\n\nmod add_side_effect;\nmod clean_side_effects;\nmod code_move;\nmod collector;\nmod const_replace;\nmod entry_strategy;\nmod errors;\nmod filter_exports;\nmod has_branches;\nmod inlined_fn;\nmod is_immutable;\nmod package_json;\nmod parse;\nmod props_destructuring;\nmod transform;\nmod utils;\nmod words;\n\n#[cfg(feature = \"parallel\")]\nuse rayon::prelude::*;\n\n#[cfg(feature = \"parallel\")]\nuse anyhow::Context;\nuse words::BUILDER_IO_QWIK;\n\n#[cfg(feature = \"fs\")]\nuse std::fs;\n\nuse anyhow::Error;\nuse serde::{Deserialize, Serialize};\nuse std::path::Path;\nuse std::str;\nuse swc_atoms::JsWord;\n\nuse crate::entry_strategy::parse_entry_strategy;\npub use crate::entry_strategy::EntryStrategy;\npub use crate::parse::EmitMode;\nuse crate::parse::{transform_code, TransformCodeOptions};\npub use crate::parse::{\n\tErrorBuffer, MinifyMode, SegmentAnalysis, TransformModule, TransformOutput,\n};\n\n#[cfg(feature = \"fs\")]\n#[derive(Serialize, Debug, Deserialize)]\n#[serde(rename_all = \"camelCase\")]\npub struct TransformFsOptions {\n\tpub src_dir: String,\n\tpub root_dir: Option<String>,\n\tpub vendor_roots: Vec<String>,\n\tpub glob: Option<String>,\n\tpub minify: MinifyMode,\n\tpub entry_strategy: EntryStrategy,\n\tpub source_maps: bool,\n\tpub transpile_ts: bool,\n\tpub transpile_jsx: bool,\n\tpub preserve_filenames: bool,\n\tpub explicit_extensions: bool,\n\tpub mode: EmitMode,\n\tpub scope: Option<String>,\n\n\tpub core_module: Option<String>,\n\tpub strip_exports: Option<Vec<JsWord>>,\n\tpub strip_ctx_name: Option<Vec<JsWord>>,\n\tpub strip_event_handlers: bool,\n\tpub reg_ctx_name: Option<Vec<JsWord>>,\n\tpub is_server: Option<bool>,\n}\n\n#[derive(Serialize, Debug, Deserialize)]\n#[serde(rename_all = \"camelCase\")]\npub struct TransformModuleInput {\n\tpub path: String,\n\tpub dev_path: Option<String>,\n\tpub code: String,\n}\n\n#[derive(Debug, Serialize, Deserialize)]\n#[serde(rename_all = \"camelCase\")]\npub struct TransformModulesOptions {\n\tpub src_dir: String,\n\tpub root_dir: Option<String>,\n\tpub input: Vec<TransformModuleInput>,\n\tpub source_maps: bool,\n\tpub minify: MinifyMode,\n\tpub transpile_ts: bool,\n\tpub transpile_jsx: bool,\n\tpub preserve_filenames: bool,\n\tpub entry_strategy: EntryStrategy,\n\tpub explicit_extensions: bool,\n\tpub mode: EmitMode,\n\tpub scope: Option<String>,\n\n\tpub core_module: Option<String>,\n\tpub strip_exports: Option<Vec<JsWord>>,\n\tpub strip_ctx_name: Option<Vec<JsWord>>,\n\tpub strip_event_handlers: bool,\n\tpub reg_ctx_name: Option<Vec<JsWord>>,\n\tpub is_server: Option<bool>,\n}\n\n#[cfg(feature = \"fs\")]\npub fn transform_fs(config: TransformFsOptions) -> Result<TransformOutput, Error> {\n\tlet core_module = config\n\t\t.core_module\n\t\t.map_or_else(|| BUILDER_IO_QWIK.clone(), |s| s.into());\n\tlet src_dir = Path::new(&config.src_dir);\n\tlet root_dir = config.root_dir.as_ref().map(Path::new);\n\n\tlet mut paths = vec![];\n\tlet entry_policy = &*parse_entry_strategy(&config.entry_strategy);\n\tcrate::package_json::find_modules(src_dir, config.vendor_roots, &mut paths)?;\n\n\t#[cfg(feature = \"parallel\")]\n\tlet iterator = paths.par_iter();\n\n\t#[cfg(not(feature = \"parallel\"))]\n\tlet iterator = paths.iter();\n\tlet mut final_output = iterator\n\t\t.map(|path| -> Result<TransformOutput, Error> {\n\t\t\tlet code = fs::read_to_string(path)\n\t\t\t\t.with_context(|| format!(\"Opening {}\", &path.to_string_lossy()))?;\n\n\t\t\tlet relative_path = pathdiff::diff_paths(path, &config.src_dir).unwrap();\n\t\t\ttransform_code(TransformCodeOptions {\n\t\t\t\tsrc_dir,\n\t\t\t\troot_dir,\n\t\t\t\trelative_path: relative_path.to_str().unwrap(),\n\t\t\t\tdev_path: None,\n\t\t\t\tminify: config.minify,\n\t\t\t\tcode: &code,\n\t\t\t\texplicit_extensions: config.explicit_extensions,\n\t\t\t\tsource_maps: config.source_maps,\n\t\t\t\ttranspile_jsx: config.transpile_jsx,\n\t\t\t\ttranspile_ts: config.transpile_ts,\n\t\t\t\tpreserve_filenames: config.preserve_filenames,\n\t\t\t\tscope: config.scope.as_ref(),\n\t\t\t\tentry_policy,\n\t\t\t\tmode: config.mode,\n\t\t\t\tcore_module: core_module.clone(),\n\t\t\t\tentry_strategy: config.entry_strategy,\n\t\t\t\treg_ctx_name: config.reg_ctx_name.as_deref(),\n\t\t\t\tstrip_exports: config.strip_exports.as_deref(),\n\t\t\t\tstrip_ctx_name: config.strip_ctx_name.as_deref(),\n\t\t\t\tstrip_event_handlers: config.strip_event_handlers,\n\t\t\t\t// If you don't specify is_server, the safe value is true\n\t\t\t\tis_server: config.is_server.unwrap_or(true),\n\t\t\t})\n\t\t})\n\t\t.reduce(|| Ok(TransformOutput::new()), |x, y| Ok(x?.append(&mut y?)))?;\n\n\tfinal_output.modules.sort_unstable_by_key(|key| key.order);\n\n\tOk(final_output)\n}\n\npub fn transform_modules(config: TransformModulesOptions) -> Result<TransformOutput, Error> {\n\tlet core_module = config\n\t\t.core_module\n\t\t.map_or_else(|| BUILDER_IO_QWIK.clone(), |s| s.into());\n\tlet src_dir = std::path::Path::new(&config.src_dir);\n\tlet root_dir = config.root_dir.as_ref().map(Path::new);\n\n\tlet entry_policy = &*parse_entry_strategy(&config.entry_strategy);\n\n\t#[cfg(feature = \"parallel\")]\n\tlet iterator = config.input.par_iter();\n\t#[cfg(not(feature = \"parallel\"))]\n\tlet iterator = config.input.iter();\n\n\tlet iterator = iterator.map(|input| -> Result<TransformOutput, Error> {\n\t\ttransform_code(TransformCodeOptions {\n\t\t\tsrc_dir,\n\t\t\troot_dir,\n\t\t\trelative_path: &input.path,\n\t\t\tdev_path: input.dev_path.as_deref(),\n\t\t\tcode: &input.code,\n\t\t\tminify: config.minify,\n\t\t\tsource_maps: config.source_maps,\n\t\t\ttranspile_ts: config.transpile_ts,\n\t\t\ttranspile_jsx: config.transpile_jsx,\n\t\t\tpreserve_filenames: config.preserve_filenames,\n\t\t\texplicit_extensions: config.explicit_extensions,\n\t\t\tentry_policy,\n\t\t\tmode: config.mode,\n\t\t\tscope: config.scope.as_ref(),\n\t\t\tcore_module: core_module.clone(),\n\t\t\tentry_strategy: config.entry_strategy,\n\t\t\treg_ctx_name: config.reg_ctx_name.as_deref(),\n\t\t\tstrip_exports: config.strip_exports.as_deref(),\n\t\t\tstrip_ctx_name: config.strip_ctx_name.as_deref(),\n\t\t\tstrip_event_handlers: config.strip_event_handlers,\n\t\t\t// If you don't specify is_server, the safe value is true\n\t\t\tis_server: config.is_server.unwrap_or(true),\n\t\t})\n\t});\n\n\t#[cfg(feature = \"parallel\")]\n\tlet final_output: Result<TransformOutput, Error> =\n\t\titerator.reduce(|| Ok(TransformOutput::new()), |x, y| Ok(x?.append(&mut y?)));\n\n\t#[cfg(not(feature = \"parallel\"))]\n\t#[allow(clippy::manual_try_fold)]\n\tlet final_output: Result<TransformOutput, Error> =\n\t\titerator.fold(Ok(TransformOutput::new()), |x, y| Ok(x?.append(&mut y?)));\n\n\tlet mut final_output = final_output?;\n\tfinal_output.modules.sort_unstable_by_key(|key| key.order);\n\n\tOk(final_output)\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/package_json.rs",
    "content": "#[cfg(feature = \"fs\")]\npub fn find_modules(\n\tsrc_dir: &std::path::Path,\n\tvendor_dirs: Vec<String>,\n\tfiles: &mut Vec<std::path::PathBuf>,\n) -> std::io::Result<()> {\n\tfor root in &vendor_dirs {\n\t\tfind_files(std::path::Path::new(root), files)?;\n\t}\n\tfind_files(src_dir, files)\n}\n\n#[cfg(feature = \"fs\")]\nfn find_files(dir: &std::path::Path, files: &mut Vec<std::path::PathBuf>) -> std::io::Result<()> {\n\tif dir.is_dir() {\n\t\tfor entry in std::fs::read_dir(dir)? {\n\t\t\tlet entry = entry?;\n\t\t\tlet path = entry.path();\n\t\t\tif path.is_dir() {\n\t\t\t\tfind_files(&path, files)?;\n\t\t\t} else if should_capture_file(&path) {\n\t\t\t\tfiles.push(path);\n\t\t\t}\n\t\t}\n\t} else if should_capture_file(dir) {\n\t\tfiles.push(dir.to_path_buf());\n\t}\n\tOk(())\n}\n\n#[cfg(feature = \"fs\")]\nfn should_capture_file(path: &std::path::Path) -> bool {\n\tlet ext = path.extension().and_then(|p| p.to_str());\n\tmatches!(\n\t\text,\n\t\tSome(\"ts\" | \"tsx\" | \"js\" | \"jsx\" | \"mjs\" | \"mts\" | \"mtsx\" | \"mjsx\")\n\t)\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/parse.rs",
    "content": "use std::collections::hash_map::DefaultHasher;\nuse std::collections::HashMap;\nuse std::ffi::OsStr;\nuse std::hash::Hasher;\nuse std::path::{Component, Path, PathBuf};\nuse std::str;\n\nuse crate::add_side_effect::SideEffectVisitor;\nuse crate::clean_side_effects::Treeshaker;\nuse crate::code_move::{new_module, NewModuleCtx};\nuse crate::collector::global_collect;\nuse crate::const_replace::ConstReplacerVisitor;\nuse crate::entry_strategy::EntryPolicy;\nuse crate::filter_exports::StripExportsVisitor;\nuse crate::props_destructuring::transform_props_destructuring;\nuse crate::transform::{QwikTransform, QwikTransformOptions, Segment, SegmentKind};\nuse crate::utils::{Diagnostic, DiagnosticCategory, DiagnosticScope, SourceLocation};\nuse crate::EntryStrategy;\nuse path_slash::PathExt;\nuse serde::{Deserialize, Serialize};\n\n#[cfg(feature = \"fs\")]\nuse std::fs;\n\nuse anyhow::{Context, Error};\n\nuse swc_atoms::JsWord;\nuse swc_common::comments::SingleThreadedComments;\nuse swc_common::errors::{DiagnosticBuilder, DiagnosticId, Emitter, Handler};\nuse swc_common::{sync::Lrc, FileName, Globals, Mark, SourceMap};\nuse swc_ecmascript::ast;\nuse swc_ecmascript::codegen::text_writer::JsWriter;\nuse swc_ecmascript::parser::lexer::Lexer;\nuse swc_ecmascript::parser::{EsSyntax, PResult, Parser, StringInput, Syntax, TsSyntax};\nuse swc_ecmascript::transforms::{\n\tfixer, hygiene::hygiene_with_config, optimization::simplify, react, resolver, typescript,\n};\nuse swc_ecmascript::visit::{FoldWith, VisitMutWith};\n\n#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]\n#[serde(rename_all = \"camelCase\")]\npub struct SegmentAnalysis {\n\tpub origin: JsWord,\n\tpub name: JsWord,\n\tpub entry: Option<JsWord>,\n\tpub display_name: JsWord,\n\tpub hash: JsWord,\n\tpub canonical_filename: JsWord,\n\tpub path: JsWord,\n\tpub extension: JsWord,\n\tpub parent: Option<JsWord>,\n\tpub ctx_kind: SegmentKind,\n\tpub ctx_name: JsWord,\n\tpub captures: bool,\n\tpub loc: (u32, u32),\n}\n\n#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq)]\n#[serde(rename_all = \"camelCase\")]\npub enum MinifyMode {\n\tSimplify,\n\tNone,\n}\n\n#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq)]\n#[serde(rename_all = \"camelCase\")]\npub enum EmitMode {\n\tProd,\n\tLib,\n\tDev,\n\tTest,\n}\n\npub struct TransformCodeOptions<'a> {\n\tpub relative_path: &'a str,\n\tpub dev_path: Option<&'a str>,\n\tpub src_dir: &'a Path,\n\tpub root_dir: Option<&'a Path>,\n\tpub source_maps: bool,\n\tpub minify: MinifyMode,\n\tpub transpile_ts: bool,\n\tpub transpile_jsx: bool,\n\tpub preserve_filenames: bool,\n\tpub explicit_extensions: bool,\n\tpub code: &'a str,\n\tpub entry_policy: &'a dyn EntryPolicy,\n\tpub mode: EmitMode,\n\tpub scope: Option<&'a String>,\n\tpub entry_strategy: EntryStrategy,\n\tpub core_module: JsWord,\n\n\tpub reg_ctx_name: Option<&'a [JsWord]>,\n\tpub strip_exports: Option<&'a [JsWord]>,\n\tpub strip_ctx_name: Option<&'a [JsWord]>,\n\tpub strip_event_handlers: bool,\n\tpub is_server: bool,\n}\n\n#[derive(Debug, Serialize, Deserialize, Default)]\n#[serde(rename_all = \"camelCase\")]\npub struct TransformOutput {\n\tpub modules: Vec<TransformModule>,\n\tpub diagnostics: Vec<Diagnostic>,\n\tpub is_type_script: bool,\n\tpub is_jsx: bool,\n}\n\n#[derive(Debug, Serialize, Deserialize, Default)]\n#[serde(rename_all = \"camelCase\")]\npub struct QwikBundle {\n\tpub size: usize,\n\tpub symbols: Vec<JsWord>,\n}\n\n#[derive(Debug, Serialize, Deserialize, Default)]\n#[serde(rename_all = \"camelCase\")]\npub struct QwikManifest {\n\tpub version: JsWord,\n\tpub symbols: HashMap<JsWord, SegmentAnalysis>,\n\tpub bundles: HashMap<JsWord, QwikBundle>,\n\tpub mapping: HashMap<JsWord, JsWord>,\n}\n\nimpl TransformOutput {\n\tpub fn new() -> Self {\n\t\tSelf::default()\n\t}\n\n\tpub fn append(mut self, output: &mut Self) -> Self {\n\t\tself.modules.append(&mut output.modules);\n\t\tself.diagnostics.append(&mut output.diagnostics);\n\t\tself.is_type_script = self.is_type_script || output.is_type_script;\n\t\tself.is_jsx = self.is_jsx || output.is_jsx;\n\t\tself\n\t}\n\n\tpub fn get_manifest(&self) -> QwikManifest {\n\t\tlet mut manifest = QwikManifest {\n\t\t\tbundles: HashMap::new(),\n\t\t\tsymbols: HashMap::new(),\n\t\t\tmapping: HashMap::new(),\n\t\t\tversion: \"1\".into(),\n\t\t};\n\t\tfor module in &self.modules {\n\t\t\tif let Some(segment) = &module.segment {\n\t\t\t\tlet filename = JsWord::from(format!(\n\t\t\t\t\t\"{}.{}\",\n\t\t\t\t\tsegment.canonical_filename, segment.extension\n\t\t\t\t));\n\t\t\t\tmanifest\n\t\t\t\t\t.mapping\n\t\t\t\t\t.insert(segment.name.clone(), filename.clone());\n\t\t\t\tmanifest\n\t\t\t\t\t.symbols\n\t\t\t\t\t.insert(segment.name.clone(), segment.clone());\n\t\t\t\tmanifest.bundles.insert(\n\t\t\t\t\tfilename.clone(),\n\t\t\t\t\tQwikBundle {\n\t\t\t\t\t\tsymbols: vec![segment.name.clone()],\n\t\t\t\t\t\tsize: module.code.len(),\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tmanifest\n\t}\n\n\t#[cfg(feature = \"fs\")]\n\tpub fn write_to_fs(\n\t\t&self,\n\t\tdestination: &Path,\n\t\tmanifest: Option<String>,\n\t) -> Result<usize, Error> {\n\t\tfor module in &self.modules {\n\t\t\tlet write_path = destination.join(&module.path);\n\t\t\tfs::create_dir_all(write_path.parent().with_context(|| {\n\t\t\t\tformat!(\"Computing path parent of {}\", write_path.to_string_lossy())\n\t\t\t})?)?;\n\t\t\tfs::write(write_path, &module.code)?;\n\t\t}\n\t\tif let Some(manifest) = manifest {\n\t\t\tlet write_path = destination.join(manifest);\n\t\t\tlet manifest = self.get_manifest();\n\t\t\tlet json = serde_json::to_string(&manifest)?;\n\t\t\tfs::write(write_path, json)?;\n\t\t}\n\t\tOk(self.modules.len())\n\t}\n}\n\n#[derive(Debug, Serialize, Deserialize, Default)]\n#[serde(rename_all = \"camelCase\")]\npub struct TransformModule {\n\tpub path: String,\n\tpub code: String,\n\n\tpub map: Option<String>,\n\n\tpub segment: Option<SegmentAnalysis>,\n\tpub is_entry: bool,\n\n\t#[serde(skip_serializing)]\n\tpub order: u64,\n}\n\n#[derive(Debug, Clone, Default)]\npub struct ErrorBuffer(std::sync::Arc<std::sync::Mutex<Vec<swc_common::errors::Diagnostic>>>);\n\nimpl Emitter for ErrorBuffer {\n\tfn emit(&mut self, db: &DiagnosticBuilder) {\n\t\tself.0.lock().unwrap().push((**db).clone());\n\t}\n}\n\npub fn transform_code(config: TransformCodeOptions) -> Result<TransformOutput, anyhow::Error> {\n\tlet source_map = Lrc::new(SourceMap::default());\n\tlet path_data = parse_path(\n\t\tconfig.relative_path.replace('\\\\', \"/\").as_str(),\n\t\tconfig.src_dir,\n\t)?;\n\tlet result = parse(\n\t\tconfig.code,\n\t\t&path_data,\n\t\tconfig.root_dir,\n\t\tLrc::clone(&source_map),\n\t);\n\t// dbg!(&module);\n\tlet transpile_jsx = config.transpile_jsx;\n\tlet transpile_ts = config.transpile_ts;\n\n\tlet origin: JsWord = JsWord::from(path_data.rel_path.to_string_lossy());\n\n\tmatch result {\n\t\tOk((program, comments, is_type_script, is_jsx)) => {\n\t\t\tlet extension = match (transpile_ts, transpile_jsx, is_type_script, is_jsx) {\n\t\t\t\t(true, true, _, _) => JsWord::from(\"js\"),\n\t\t\t\t(true, false, _, true) => JsWord::from(\"jsx\"),\n\t\t\t\t(true, false, _, false) => JsWord::from(\"js\"),\n\t\t\t\t(false, true, true, _) => JsWord::from(\"ts\"),\n\t\t\t\t(false, true, false, _) => JsWord::from(\"js\"),\n\t\t\t\t(false, false, _, _) => JsWord::from(path_data.extension.clone()),\n\t\t\t};\n\t\t\tlet error_buffer = ErrorBuffer::default();\n\t\t\tlet handler = swc_common::errors::Handler::with_emitter(\n\t\t\t\ttrue,\n\t\t\t\tfalse,\n\t\t\t\tBox::new(error_buffer.clone()),\n\t\t\t);\n\n\t\t\tswc_common::GLOBALS.set(&Globals::new(), || {\n\t\t\t\tswc_common::errors::HANDLER.set(&handler, || {\n\t\t\t\t\tlet unresolved_mark = Mark::new();\n\t\t\t\t\tlet top_level_mark = Mark::new();\n\n\t\t\t\t\tlet mut program = program;\n\n\t\t\t\t\tif let Some(strip_exports) = config.strip_exports {\n\t\t\t\t\t\tlet mut visitor = StripExportsVisitor::new(strip_exports);\n\t\t\t\t\t\tprogram.visit_mut_with(&mut visitor);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet mut did_transform = false;\n\n\t\t\t\t\tif transpile_ts && is_type_script {\n\t\t\t\t\t\tdid_transform = true;\n\t\t\t\t\t\tprogram.mutate(&mut typescript::strip(Default::default(), top_level_mark));\n\t\t\t\t\t}\n\n\t\t\t\t\tif transpile_jsx && is_jsx {\n\t\t\t\t\t\tdid_transform = true;\n\t\t\t\t\t\tlet mut react_options = react::Options::default();\n\t\t\t\t\t\tif is_jsx {\n\t\t\t\t\t\t\treact_options.next = Some(true);\n\t\t\t\t\t\t\treact_options.throw_if_namespace = Some(false);\n\t\t\t\t\t\t\treact_options.runtime = Some(react::Runtime::Automatic);\n\t\t\t\t\t\t\treact_options.import_source = Some(\"@builder.io/qwik\".to_string());\n\t\t\t\t\t\t};\n\t\t\t\t\t\tprogram.mutate(&mut react::react(\n\t\t\t\t\t\t\tLrc::clone(&source_map),\n\t\t\t\t\t\t\tSome(&comments),\n\t\t\t\t\t\t\treact_options,\n\t\t\t\t\t\t\ttop_level_mark,\n\t\t\t\t\t\t\tunresolved_mark,\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Resolve with mark\n\t\t\t\t\tprogram.visit_mut_with(&mut resolver(\n\t\t\t\t\t\tunresolved_mark,\n\t\t\t\t\t\ttop_level_mark,\n\t\t\t\t\t\tis_type_script && !transpile_ts,\n\t\t\t\t\t));\n\t\t\t\t\t// Collect import/export metadata\n\t\t\t\t\tlet mut collect = global_collect(&program);\n\n\t\t\t\t\tlet mut qt: Option<QwikTransform<'_>> = None;\n\t\t\t\t\tlet mut segments: Vec<Segment> = Vec::new();\n\n\t\t\t\t\t// Don't further process library code\n\t\t\t\t\t// It will be processed during client build\n\t\t\t\t\t// This way no internal API usage is published\n\t\t\t\t\tif config.mode != EmitMode::Lib {\n\t\t\t\t\t\tlet is_dev = config.mode == EmitMode::Dev;\n\n\t\t\t\t\t\t// reconstruct destructured props for signal forwarding\n\t\t\t\t\t\ttransform_props_destructuring(\n\t\t\t\t\t\t\t&mut program,\n\t\t\t\t\t\t\t&mut collect,\n\t\t\t\t\t\t\t&config.core_module,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// replace const values\n\t\t\t\t\t\tif config.mode != EmitMode::Test {\n\t\t\t\t\t\t\tlet mut const_replacer =\n\t\t\t\t\t\t\t\tConstReplacerVisitor::new(config.is_server, is_dev, &collect);\n\t\t\t\t\t\t\tprogram.visit_mut_with(&mut const_replacer);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// split into segments\n\t\t\t\t\t\tlet mut qwik_transform = QwikTransform::new(QwikTransformOptions {\n\t\t\t\t\t\t\tpath_data: &path_data,\n\t\t\t\t\t\t\tdev_path: config.dev_path,\n\t\t\t\t\t\t\tentry_policy: config.entry_policy,\n\t\t\t\t\t\t\texplicit_extensions: config.explicit_extensions,\n\t\t\t\t\t\t\textension: extension.clone(),\n\t\t\t\t\t\t\tcomments: Some(&comments),\n\t\t\t\t\t\t\tglobal_collect: collect,\n\t\t\t\t\t\t\tscope: config.scope,\n\t\t\t\t\t\t\tmode: config.mode,\n\t\t\t\t\t\t\tcore_module: config.core_module,\n\t\t\t\t\t\t\tentry_strategy: config.entry_strategy,\n\t\t\t\t\t\t\treg_ctx_name: config.reg_ctx_name,\n\t\t\t\t\t\t\tstrip_ctx_name: config.strip_ctx_name,\n\t\t\t\t\t\t\tstrip_event_handlers: config.strip_event_handlers,\n\t\t\t\t\t\t\tis_server: config.is_server,\n\t\t\t\t\t\t\tcm: Lrc::clone(&source_map),\n\t\t\t\t\t\t});\n\t\t\t\t\t\tprogram = program.fold_with(&mut qwik_transform);\n\n\t\t\t\t\t\tlet mut treeshaker = Treeshaker::new();\n\t\t\t\t\t\tif config.minify != MinifyMode::None {\n\t\t\t\t\t\t\t// remove all side effects from client, step 1\n\t\t\t\t\t\t\tif !config.is_server {\n\t\t\t\t\t\t\t\tprogram.visit_mut_with(&mut treeshaker.marker);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// simplify & strip unused code\n\t\t\t\t\t\t\tprogram.mutate(&mut simplify::simplifier(\n\t\t\t\t\t\t\t\tunresolved_mark,\n\t\t\t\t\t\t\t\tsimplify::Config {\n\t\t\t\t\t\t\t\t\tdce: simplify::dce::Config {\n\t\t\t\t\t\t\t\t\t\tpreserve_imports_with_side_effects: false,\n\t\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif matches!(\n\t\t\t\t\t\t\tconfig.entry_strategy,\n\t\t\t\t\t\t\tEntryStrategy::Inline | EntryStrategy::Hoist\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tprogram.visit_mut_with(&mut SideEffectVisitor::new(\n\t\t\t\t\t\t\t\t&qwik_transform.options.global_collect,\n\t\t\t\t\t\t\t\t&path_data,\n\t\t\t\t\t\t\t\tconfig.src_dir,\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t} else if config.minify != MinifyMode::None && !config.is_server {\n\t\t\t\t\t\t\t// remove all side effects from client, step 2\n\t\t\t\t\t\t\tprogram.visit_mut_with(&mut treeshaker.cleaner);\n\t\t\t\t\t\t\tif treeshaker.cleaner.did_drop {\n\t\t\t\t\t\t\t\tprogram.mutate(&mut simplify::simplifier(\n\t\t\t\t\t\t\t\t\tunresolved_mark,\n\t\t\t\t\t\t\t\t\tsimplify::Config {\n\t\t\t\t\t\t\t\t\t\tdce: simplify::dce::Config {\n\t\t\t\t\t\t\t\t\t\t\tpreserve_imports_with_side_effects: false,\n\t\t\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsegments = qwik_transform.segments.clone();\n\t\t\t\t\t\tqt = Some(qwik_transform);\n\t\t\t\t\t}\n\t\t\t\t\tprogram.visit_mut_with(&mut hygiene_with_config(Default::default()));\n\t\t\t\t\tprogram.visit_mut_with(&mut fixer(None));\n\n\t\t\t\t\tlet mut modules: Vec<TransformModule> = Vec::with_capacity(segments.len() + 10);\n\n\t\t\t\t\tlet comments_maps = comments.clone().take_all();\n\t\t\t\t\t// Now process each segment\n\t\t\t\t\tif !segments.is_empty() {\n\t\t\t\t\t\tlet q = qt.as_ref().unwrap();\n\t\t\t\t\t\tfor h in segments.into_iter() {\n\t\t\t\t\t\t\tlet is_entry = h.entry.is_none();\n\t\t\t\t\t\t\tlet path_str = h.data.path.to_string();\n\t\t\t\t\t\t\tlet path = if path_str.is_empty() {\n\t\t\t\t\t\t\t\tpath_str\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t[&path_str, \"/\"].concat()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tlet segment_path = [\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\t[&h.canonical_filename, \".\", &h.data.extension].concat(),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t.concat();\n\t\t\t\t\t\t\tlet need_handle_watch =\n\t\t\t\t\t\t\t\tmight_need_handle_watch(&h.data.ctx_kind, &h.data.ctx_name);\n\n\t\t\t\t\t\t\tlet (mut segment_module, comments) = new_module(NewModuleCtx {\n\t\t\t\t\t\t\t\texpr: h.expr,\n\t\t\t\t\t\t\t\tpath: &path_data,\n\t\t\t\t\t\t\t\tname: &h.name,\n\t\t\t\t\t\t\t\tlocal_idents: &h.data.local_idents,\n\t\t\t\t\t\t\t\tscoped_idents: &h.data.scoped_idents,\n\t\t\t\t\t\t\t\tneed_transform: h.data.need_transform,\n\t\t\t\t\t\t\t\texplicit_extensions: q.options.explicit_extensions,\n\t\t\t\t\t\t\t\tglobal: &q.options.global_collect,\n\t\t\t\t\t\t\t\tcore_module: &q.options.core_module,\n\t\t\t\t\t\t\t\tneed_handle_watch,\n\t\t\t\t\t\t\t\tleading_comments: comments_maps.0.clone(),\n\t\t\t\t\t\t\t\ttrailing_comments: comments_maps.1.clone(),\n\t\t\t\t\t\t\t})?;\n\t\t\t\t\t\t\t// we don't need to remove side effects because the optimizer only moves what's really used\n\t\t\t\t\t\t\tif config.minify != MinifyMode::None {\n\t\t\t\t\t\t\t\tlet mut program = ast::Program::Module(segment_module);\n\t\t\t\t\t\t\t\tprogram.mutate(&mut simplify::simplifier(\n\t\t\t\t\t\t\t\t\tunresolved_mark,\n\t\t\t\t\t\t\t\t\tsimplify::Config {\n\t\t\t\t\t\t\t\t\t\tdce: simplify::dce::Config {\n\t\t\t\t\t\t\t\t\t\t\tpreserve_imports_with_side_effects: false,\n\t\t\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\tsegment_module = program.expect_module();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsegment_module\n\t\t\t\t\t\t\t\t.visit_mut_with(&mut hygiene_with_config(Default::default()));\n\t\t\t\t\t\t\tsegment_module.visit_mut_with(&mut fixer(None));\n\n\t\t\t\t\t\t\tlet (code, map) = emit_source_code(\n\t\t\t\t\t\t\t\tLrc::clone(&source_map),\n\t\t\t\t\t\t\t\tSome(comments),\n\t\t\t\t\t\t\t\t&segment_module,\n\t\t\t\t\t\t\t\tconfig.root_dir,\n\t\t\t\t\t\t\t\tconfig.source_maps,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.unwrap();\n\n\t\t\t\t\t\t\tmodules.push(TransformModule {\n\t\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\t\tmap,\n\t\t\t\t\t\t\t\tis_entry,\n\t\t\t\t\t\t\t\tpath: segment_path,\n\t\t\t\t\t\t\t\torder: h.hash,\n\t\t\t\t\t\t\t\tsegment: Some(SegmentAnalysis {\n\t\t\t\t\t\t\t\t\torigin: h.data.origin,\n\t\t\t\t\t\t\t\t\tname: h.name,\n\t\t\t\t\t\t\t\t\tentry: h.entry,\n\t\t\t\t\t\t\t\t\textension: h.data.extension,\n\t\t\t\t\t\t\t\t\tcanonical_filename: h.canonical_filename,\n\t\t\t\t\t\t\t\t\tpath: h.data.path,\n\t\t\t\t\t\t\t\t\tparent: h.data.parent_segment,\n\t\t\t\t\t\t\t\t\tctx_kind: h.data.ctx_kind,\n\t\t\t\t\t\t\t\t\tctx_name: h.data.ctx_name,\n\t\t\t\t\t\t\t\t\tcaptures: !h.data.scoped_idents.is_empty(),\n\t\t\t\t\t\t\t\t\tdisplay_name: h.data.display_name,\n\t\t\t\t\t\t\t\t\thash: h.data.hash,\n\t\t\t\t\t\t\t\t\tloc: (h.span.lo.0, h.span.hi.0),\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlet (code, map) = match program {\n\t\t\t\t\t\tast::Program::Module(ref modu) => emit_source_code(\n\t\t\t\t\t\t\tLrc::clone(&source_map),\n\t\t\t\t\t\t\tSome(comments),\n\t\t\t\t\t\t\tmodu,\n\t\t\t\t\t\t\tconfig.root_dir,\n\t\t\t\t\t\t\tconfig.source_maps,\n\t\t\t\t\t\t)?,\n\t\t\t\t\t\t_ => (String::new(), None),\n\t\t\t\t\t};\n\n\t\t\t\t\tlet a = if did_transform && !config.preserve_filenames {\n\t\t\t\t\t\t[&path_data.file_stem, \".\", &extension].concat()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpath_data.file_name\n\t\t\t\t\t};\n\t\t\t\t\tlet path = path_data.rel_dir.join(a).to_slash_lossy().to_string();\n\n\t\t\t\t\tlet mut hasher = DefaultHasher::new();\n\t\t\t\t\thasher.write(path.as_bytes());\n\n\t\t\t\t\tmodules.push(TransformModule {\n\t\t\t\t\t\tis_entry: false,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tmap,\n\t\t\t\t\t\torder: hasher.finish(),\n\t\t\t\t\t\tsegment: None,\n\t\t\t\t\t});\n\n\t\t\t\t\tlet diagnostics = handle_error(&error_buffer, origin, &source_map);\n\t\t\t\t\tOk(TransformOutput {\n\t\t\t\t\t\tmodules,\n\t\t\t\t\t\tdiagnostics,\n\t\t\t\t\t\tis_type_script,\n\t\t\t\t\t\tis_jsx,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t\tErr(err) => {\n\t\t\tlet error_buffer = ErrorBuffer::default();\n\t\t\tlet handler = Handler::with_emitter(true, false, Box::new(error_buffer.clone()));\n\t\t\terr.into_diagnostic(&handler).emit();\n\t\t\tlet diagnostics = handle_error(&error_buffer, origin, &source_map);\n\t\t\tOk(TransformOutput {\n\t\t\t\tmodules: vec![],\n\t\t\t\tdiagnostics,\n\t\t\t\tis_type_script: false,\n\t\t\t\tis_jsx: false,\n\t\t\t})\n\t\t}\n\t}\n}\n\nfn parse(\n\tcode: &str,\n\tpath_data: &PathData,\n\troot_dir: Option<&Path>,\n\tsource_map: Lrc<SourceMap>,\n) -> PResult<(ast::Program, SingleThreadedComments, bool, bool)> {\n\tlet sm_path = if let Some(root_dir) = root_dir {\n\t\tpathdiff::diff_paths(path_data.abs_path.clone(), root_dir).unwrap()\n\t} else {\n\t\tpath_data.abs_path.clone()\n\t};\n\tlet source_file = source_map.new_source_file(FileName::Real(sm_path).into(), code.into());\n\n\tlet comments = SingleThreadedComments::default();\n\tlet (is_type_script, is_jsx) = parse_filename(path_data);\n\tlet syntax = if is_type_script {\n\t\tSyntax::Typescript(TsSyntax {\n\t\t\ttsx: is_jsx,\n\t\t\tdecorators: true,\n\t\t\t..Default::default()\n\t\t})\n\t} else {\n\t\tSyntax::Es(EsSyntax {\n\t\t\tjsx: is_jsx,\n\t\t\texport_default_from: true,\n\t\t\t..Default::default()\n\t\t})\n\t};\n\n\tlet lexer = Lexer::new(\n\t\tsyntax,\n\t\tDefault::default(),\n\t\tStringInput::from(&*source_file),\n\t\tSome(&comments),\n\t);\n\n\tlet mut parser = Parser::new_from(lexer);\n\tmatch parser.parse_program() {\n\t\tErr(err) => Err(err),\n\t\tOk(result) => Ok((result, comments, is_type_script, is_jsx)),\n\t}\n}\n\nfn parse_filename(path_data: &PathData) -> (bool, bool) {\n\tmatch path_data.extension.as_str() {\n\t\t\"ts\" => (true, false),\n\t\t\"mts\" => (true, false),\n\t\t\"mtsx\" => (true, true),\n\t\t\"js\" => (false, false),\n\t\t\"mjs\" => (false, false),\n\t\t\"cjs\" => (false, false),\n\t\t\"jsx\" => (false, true),\n\t\t\"mjsx\" => (false, true),\n\t\t\"cjsx\" => (false, true),\n\t\t_ => (true, true),\n\t}\n}\n\npub fn emit_source_code(\n\tsource_map: Lrc<SourceMap>,\n\tcomments: Option<SingleThreadedComments>,\n\tmodule: &ast::Module,\n\troot_dir: Option<&Path>,\n\tsource_maps: bool,\n) -> Result<(String, Option<String>), Error> {\n\tlet mut src_map_buf = Vec::new();\n\tlet mut buf = Vec::new();\n\t{\n\t\tlet writer = Box::new(JsWriter::new(\n\t\t\tLrc::clone(&source_map),\n\t\t\t\"\\n\",\n\t\t\t&mut buf,\n\t\t\tif source_maps {\n\t\t\t\tSome(&mut src_map_buf)\n\t\t\t} else {\n\t\t\t\tNone\n\t\t\t},\n\t\t));\n\t\tlet config = swc_ecmascript::codegen::Config::default();\n\t\tlet mut emitter = swc_ecmascript::codegen::Emitter {\n\t\t\tcfg: config,\n\t\t\tcomments: Some(&comments),\n\t\t\tcm: Lrc::clone(&source_map),\n\t\t\twr: writer,\n\t\t};\n\t\temitter.emit_module(module)?;\n\t}\n\n\tlet mut map_buf = vec![];\n\tlet emit_source_maps = if source_maps {\n\t\tlet mut s = source_map.build_source_map(&src_map_buf);\n\t\tif let Some(root_dir) = root_dir {\n\t\t\ts.set_source_root(Some(root_dir.to_str().unwrap()));\n\t\t}\n\t\ts.to_writer(&mut map_buf).is_ok()\n\t} else {\n\t\tfalse\n\t};\n\tif emit_source_maps {\n\t\tOk((\n\t\t\tunsafe { str::from_utf8_unchecked(&buf).to_string() },\n\t\t\tunsafe { Some(str::from_utf8_unchecked(&map_buf).to_string()) },\n\t\t))\n\t} else {\n\t\tOk((unsafe { str::from_utf8_unchecked(&buf).to_string() }, None))\n\t}\n}\n\nfn handle_error(\n\terror_buffer: &ErrorBuffer,\n\torigin: JsWord,\n\tsource_map: &Lrc<SourceMap>,\n) -> Vec<Diagnostic> {\n\terror_buffer\n\t\t.0\n\t\t.lock()\n\t\t.map(|diagnostics| diagnostics.clone())\n\t\t.ok()\n\t\t.unwrap_or_default()\n\t\t.iter()\n\t\t.map(|diagnostic| {\n\t\t\tlet message = diagnostic.message();\n\t\t\tlet code = diagnostic.get_code().and_then(|m| {\n\t\t\t\tif let DiagnosticId::Error(s) = m {\n\t\t\t\t\tSome(s)\n\t\t\t\t} else {\n\t\t\t\t\tNone\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet span = diagnostic.span.clone();\n\t\t\tlet suggestions = diagnostic.suggestions.clone();\n\n\t\t\tlet span_labels = span.span_labels();\n\t\t\tlet highlights = if span_labels.is_empty() {\n\t\t\t\tNone\n\t\t\t} else {\n\t\t\t\tSome(\n\t\t\t\t\tspan_labels\n\t\t\t\t\t\t.into_iter()\n\t\t\t\t\t\t.flat_map(|span_label| {\n\t\t\t\t\t\t\tif span_label.span.hi == span_label.span.lo {\n\t\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSome(SourceLocation::from(source_map, span_label.span))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.collect(),\n\t\t\t\t)\n\t\t\t};\n\n\t\t\tlet suggestions = if suggestions.is_empty() {\n\t\t\t\tNone\n\t\t\t} else {\n\t\t\t\tSome(\n\t\t\t\t\tsuggestions\n\t\t\t\t\t\t.into_iter()\n\t\t\t\t\t\t.map(|suggestion| suggestion.msg)\n\t\t\t\t\t\t.collect(),\n\t\t\t\t)\n\t\t\t};\n\n\t\t\tDiagnostic {\n\t\t\t\tfile: origin.clone(),\n\t\t\t\tcode,\n\t\t\t\tmessage,\n\t\t\t\thighlights,\n\t\t\t\tsuggestions,\n\t\t\t\tcategory: DiagnosticCategory::Error,\n\t\t\t\tscope: DiagnosticScope::Optimizer,\n\t\t\t}\n\t\t})\n\t\t.collect()\n}\n\npub struct PathData {\n\tpub abs_path: PathBuf,\n\tpub rel_path: PathBuf,\n\tpub abs_dir: PathBuf,\n\tpub rel_dir: PathBuf,\n\tpub file_stem: String,\n\tpub extension: String,\n\tpub file_name: String,\n}\n\npub fn parse_path(src: &str, base_dir: &Path) -> Result<PathData, Error> {\n\tlet path = Path::new(src);\n\tlet lossy = path.to_slash_lossy();\n\tlet path = Path::new(lossy.as_ref());\n\tlet file_stem = path\n\t\t.file_stem()\n\t\t.and_then(OsStr::to_str)\n\t\t.map(Into::into)\n\t\t.with_context(|| format!(\"Computing file stem for {}\", path.to_string_lossy()))?;\n\n\tlet rel_dir = path.parent().unwrap().to_path_buf();\n\tlet extension = path.extension().and_then(OsStr::to_str).unwrap();\n\tlet file_name = path\n\t\t.file_name()\n\t\t.and_then(OsStr::to_str)\n\t\t.with_context(|| format!(\"Computing filename for {}\", path.to_string_lossy()))?;\n\n\tlet abs_path = normalize_path(base_dir.join(path));\n\tlet abs_dir = normalize_path(abs_path.parent().unwrap());\n\n\tOk(PathData {\n\t\tabs_path,\n\t\trel_path: path.into(),\n\t\tabs_dir,\n\t\trel_dir,\n\t\textension: extension.into(),\n\t\tfile_name: file_name.into(),\n\t\tfile_stem,\n\t})\n}\n\npub fn normalize_path<P: AsRef<Path>>(path: P) -> PathBuf {\n\tlet ends_with_slash = path.as_ref().to_str().is_some_and(|s| s.ends_with('/'));\n\tlet mut normalized = PathBuf::new();\n\tfor component in path.as_ref().components() {\n\t\tmatch &component {\n\t\t\tComponent::ParentDir => {\n\t\t\t\tif !normalized.pop() {\n\t\t\t\t\tnormalized.push(component);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_ => {\n\t\t\t\tnormalized.push(component);\n\t\t\t}\n\t\t}\n\t}\n\tif ends_with_slash {\n\t\tnormalized.push(\"\");\n\t}\n\tnormalized\n}\n\npub fn might_need_handle_watch(ctx_kind: &SegmentKind, ctx_name: &str) -> bool {\n\tif !matches!(ctx_kind, SegmentKind::Function) {\n\t\treturn false;\n\t}\n\tmatches!(\n\t\tctx_name,\n\t\t\"useTask$\" | \"useVisibleTask$\" | \"useBrowserVisibleTask$\" | \"useClientEffect$\" | \"$\"\n\t)\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/props_destructuring.rs",
    "content": "use std::collections::HashMap;\n\nuse crate::code_move::create_return_stmt;\nuse crate::collector::{new_ident_from_id, GlobalCollect, Id};\nuse crate::is_immutable::is_immutable_expr;\nuse crate::words::*;\nuse swc_atoms::JsWord;\nuse swc_common::DUMMY_SP;\nuse swc_ecmascript::ast;\nuse swc_ecmascript::utils::private_ident;\nuse swc_ecmascript::visit::{VisitMut, VisitMutWith};\n\nstruct PropsDestructuring<'a> {\n\tcomponent_ident: Option<Id>,\n\tpub identifiers: HashMap<Id, ast::Expr>,\n\tpub global_collect: &'a mut GlobalCollect,\n\tpub core_module: &'a JsWord,\n}\n\npub fn transform_props_destructuring(\n\tprogram: &mut ast::Program,\n\tglobal_collect: &mut GlobalCollect,\n\tcore_module: &JsWord,\n) {\n\tprogram.visit_mut_with(&mut PropsDestructuring {\n\t\tcomponent_ident: global_collect.get_imported_local(&COMPONENT, core_module),\n\t\tidentifiers: HashMap::new(),\n\t\tglobal_collect,\n\t\tcore_module,\n\t});\n}\n\nmacro_rules! id {\n\t($ident: expr) => {\n\t\t($ident.sym.clone(), $ident.ctxt)\n\t};\n}\n\nmacro_rules! id_eq {\n\t($ident: expr, $cid: expr) => {\n\t\tif let Some(cid) = $cid {\n\t\t\tcid.0 == $ident.sym && cid.1 == $ident.ctxt\n\t\t} else {\n\t\t\tfalse\n\t\t}\n\t};\n}\n\nenum TransformInit {\n\tKeep,\n\tRemove,\n\tReplace(ast::Expr),\n}\n\nimpl<'a> PropsDestructuring<'a> {\n\tfn transform_component_props(&mut self, arrow: &mut ast::ArrowExpr) {\n\t\tif let Some(ast::Pat::Object(obj)) = arrow.params.first() {\n\t\t\tlet new_ident = private_ident!(\"props\");\n\t\t\tif let Some((rest_id, local)) =\n\t\t\t\ttransform_pat(ast::Expr::Ident(new_ident.clone()), obj, self)\n\t\t\t{\n\t\t\t\tif let Some(rest_id) = rest_id {\n\t\t\t\t\tlet omit_fn = self.global_collect.import(&_REST_PROPS, self.core_module);\n\t\t\t\t\tlet omit = local.iter().map(|(_, id, _)| id.clone()).collect();\n\t\t\t\t\ttransform_rest(\n\t\t\t\t\t\tarrow,\n\t\t\t\t\t\t&omit_fn,\n\t\t\t\t\t\t&rest_id,\n\t\t\t\t\t\tast::Expr::Ident(new_ident.clone()),\n\t\t\t\t\t\tomit,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tfor (id, _, expr) in local {\n\t\t\t\t\tself.identifiers.insert(id, expr);\n\t\t\t\t}\n\t\t\t\tarrow.params[0] = ast::Pat::Ident(ast::BindingIdent::from(new_ident));\n\t\t\t}\n\t\t}\n\t\tif let ast::BlockStmtOrExpr::BlockStmt(body) = &mut *arrow.body {\n\t\t\tself.transform_component_body(body);\n\t\t}\n\t}\n\tfn transform_component_body(&mut self, body: &mut ast::BlockStmt) {\n\t\tlet mut inserts = vec![];\n\t\tfor (index, stmt) in body.stmts.iter_mut().enumerate() {\n\t\t\tif let ast::Stmt::Decl(ast::Decl::Var(var_decl)) = stmt {\n\t\t\t\tif var_decl.kind == ast::VarDeclKind::Const {\n\t\t\t\t\tfor decl in var_decl.decls.iter_mut() {\n\t\t\t\t\t\tlet convert = match &decl.init {\n\t\t\t\t\t\t\tSome(box ast::Expr::Lit(lit)) => {\n\t\t\t\t\t\t\t\tlet new_ident = private_ident!(\"_unused\");\n\t\t\t\t\t\t\t\tSome((\n\t\t\t\t\t\t\t\t\tnew_ident,\n\t\t\t\t\t\t\t\t\tast::Expr::Lit(lit.clone()),\n\t\t\t\t\t\t\t\t\tTransformInit::Remove,\n\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSome(box ast::Expr::Member(member_expr)) => match &member_expr.obj {\n\t\t\t\t\t\t\t\tbox ast::Expr::Ident(ident) => {\n\t\t\t\t\t\t\t\t\tlet new_ident = private_ident!(\"_unused\");\n\t\t\t\t\t\t\t\t\tlet expr = self\n\t\t\t\t\t\t\t\t\t\t.identifiers\n\t\t\t\t\t\t\t\t\t\t.get(&id!(ident.clone()))\n\t\t\t\t\t\t\t\t\t\t.cloned()\n\t\t\t\t\t\t\t\t\t\t.unwrap_or_else(|| ast::Expr::Ident(ident.clone()));\n\n\t\t\t\t\t\t\t\t\tlet mut cloned_prop = member_expr.prop.clone();\n\t\t\t\t\t\t\t\t\tcloned_prop.visit_mut_with(self);\n\t\t\t\t\t\t\t\t\tlet new_replace = ast::Expr::Member(ast::MemberExpr {\n\t\t\t\t\t\t\t\t\t\tobj: Box::new(expr),\n\t\t\t\t\t\t\t\t\t\tprop: cloned_prop,\n\t\t\t\t\t\t\t\t\t\tspan: member_expr.span,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tSome((new_ident, new_replace, TransformInit::Remove))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbox ast::Expr::Call(call_expr) => {\n\t\t\t\t\t\t\t\t\tif let ast::Callee::Expr(box ast::Expr::Ident(ref ident)) =\n\t\t\t\t\t\t\t\t\t\t&call_expr.callee\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ident.sym.starts_with(\"use\") {\n\t\t\t\t\t\t\t\t\t\t\tlet new_ident =\n\t\t\t\t\t\t\t\t\t\t\t\tprivate_ident!(ident.sym[3..].to_lowercase());\n\n\t\t\t\t\t\t\t\t\t\t\tlet mut cloned_prop = member_expr.prop.clone();\n\t\t\t\t\t\t\t\t\t\t\tcloned_prop.visit_mut_with(self);\n\n\t\t\t\t\t\t\t\t\t\t\tlet new_replace = ast::Expr::Member(ast::MemberExpr {\n\t\t\t\t\t\t\t\t\t\t\t\tobj: Box::new(ast::Expr::Ident(new_ident.clone())),\n\t\t\t\t\t\t\t\t\t\t\t\tprop: cloned_prop,\n\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\tSome((\n\t\t\t\t\t\t\t\t\t\t\t\tnew_ident,\n\t\t\t\t\t\t\t\t\t\t\t\tnew_replace,\n\t\t\t\t\t\t\t\t\t\t\t\tTransformInit::Replace(ast::Expr::Call(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcall_expr.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t_ => None,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tSome(box ast::Expr::Ident(ref ident)) => {\n\t\t\t\t\t\t\t\tlet new_ident = private_ident!(\"_unused\");\n\t\t\t\t\t\t\t\tlet new_replace = self\n\t\t\t\t\t\t\t\t\t.identifiers\n\t\t\t\t\t\t\t\t\t.get(&id!(ident.clone()))\n\t\t\t\t\t\t\t\t\t.cloned()\n\t\t\t\t\t\t\t\t\t.unwrap_or_else(|| ast::Expr::Ident(ident.clone()));\n\t\t\t\t\t\t\t\tSome((new_ident, new_replace, TransformInit::Remove))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSome(box ast::Expr::Call(call_expr)) => {\n\t\t\t\t\t\t\t\tif let ast::Callee::Expr(box ast::Expr::Ident(ref ident)) =\n\t\t\t\t\t\t\t\t\t&call_expr.callee\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ident.sym.starts_with(\"use\") {\n\t\t\t\t\t\t\t\t\t\tlet new_ident =\n\t\t\t\t\t\t\t\t\t\t\tprivate_ident!(ident.sym[3..].to_lowercase());\n\t\t\t\t\t\t\t\t\t\tlet new_replace = ast::Expr::Ident(new_ident.clone());\n\t\t\t\t\t\t\t\t\t\tSome((new_ident, new_replace, TransformInit::Keep))\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_ => None,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif let Some((replace_pat, new_ref, init)) = convert {\n\t\t\t\t\t\t\tlet keep_ident = matches!(init, TransformInit::Keep);\n\t\t\t\t\t\t\tlet mut transform_init = init;\n\t\t\t\t\t\t\tmatch &decl.name {\n\t\t\t\t\t\t\t\tast::Pat::Ident(ident) => {\n\t\t\t\t\t\t\t\t\tif !keep_ident {\n\t\t\t\t\t\t\t\t\t\tself.identifiers.insert(id!(ident.id.clone()), new_ref);\n\t\t\t\t\t\t\t\t\t\tdecl.name =\n\t\t\t\t\t\t\t\t\t\t\tast::Pat::Ident(ast::BindingIdent::from(replace_pat));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttransform_init = TransformInit::Keep;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tast::Pat::Object(obj_pat) => {\n\t\t\t\t\t\t\t\t\tif let Some((rest_id, local)) =\n\t\t\t\t\t\t\t\t\t\ttransform_pat(new_ref.clone(), obj_pat, self)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif let Some(rest_id) = rest_id {\n\t\t\t\t\t\t\t\t\t\t\tlet omit_fn = self\n\t\t\t\t\t\t\t\t\t\t\t\t.global_collect\n\t\t\t\t\t\t\t\t\t\t\t\t.import(&_REST_PROPS, self.core_module);\n\t\t\t\t\t\t\t\t\t\t\tlet omit =\n\t\t\t\t\t\t\t\t\t\t\t\tlocal.iter().map(|(_, id, _)| id.clone()).collect();\n\n\t\t\t\t\t\t\t\t\t\t\tlet element = create_omit_props(\n\t\t\t\t\t\t\t\t\t\t\t\t&omit_fn, &rest_id, new_ref, omit,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tinserts.push((index + 1 + inserts.len(), element));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tfor (id, _, expr) in local {\n\t\t\t\t\t\t\t\t\t\t\tself.identifiers.insert(id, expr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdecl.name =\n\t\t\t\t\t\t\t\t\t\t\tast::Pat::Ident(ast::BindingIdent::from(replace_pat));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ttransform_init = TransformInit::Keep;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t_ => {\n\t\t\t\t\t\t\t\t\ttransform_init = TransformInit::Keep;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmatch transform_init {\n\t\t\t\t\t\t\t\tTransformInit::Remove => {\n\t\t\t\t\t\t\t\t\tdecl.init = None;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tTransformInit::Replace(expr) => {\n\t\t\t\t\t\t\t\t\tdecl.init = Some(Box::new(expr));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tTransformInit::Keep => {}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (index, stmt) in inserts {\n\t\t\tbody.stmts.insert(index, stmt);\n\t\t}\n\t}\n}\n\nimpl<'a> VisitMut for PropsDestructuring<'a> {\n\tfn visit_mut_call_expr(&mut self, node: &mut ast::CallExpr) {\n\t\tif let ast::Callee::Expr(box ast::Expr::Ident(ref ident)) = &node.callee {\n\t\t\tif id_eq!(ident, &self.component_ident) {\n\t\t\t\tif let Some(first_arg) = node.args.first_mut() {\n\t\t\t\t\tif let ast::Expr::Arrow(arrow) = &mut *first_arg.expr {\n\t\t\t\t\t\tself.transform_component_props(arrow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tnode.visit_mut_children_with(self);\n\t}\n\n\tfn visit_mut_expr(&mut self, node: &mut ast::Expr) {\n\t\tmatch node {\n\t\t\tast::Expr::Ident(ident) => {\n\t\t\t\tif let Some(expr) = self.identifiers.get(&id!(ident)) {\n\t\t\t\t\t*node = expr.clone();\n\t\t\t\t}\n\t\t\t}\n\t\t\t_ => {\n\t\t\t\tnode.visit_mut_children_with(self);\n\t\t\t}\n\t\t}\n\t}\n\n\tfn visit_mut_prop(&mut self, node: &mut ast::Prop) {\n\t\tif let ast::Prop::Shorthand(short) = node {\n\t\t\tif let Some(expr) = self.identifiers.get(&id!(short)) {\n\t\t\t\t*node = ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\tkey: ast::PropName::Ident(short.clone().into()),\n\t\t\t\t\tvalue: Box::new(expr.clone()),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tnode.visit_mut_children_with(self);\n\t}\n}\n\ntype TransformPatReturn = (Option<Id>, Vec<(Id, JsWord, ast::Expr)>);\nfn transform_pat(\n\tnew_ident: ast::Expr,\n\tobj: &ast::ObjectPat,\n\tprops_transform: &mut PropsDestructuring,\n) -> Option<TransformPatReturn> {\n\tlet mut local = vec![];\n\tlet mut skip = false;\n\tlet mut rest_id = None;\n\tfor prop in &obj.props {\n\t\tmatch prop {\n\t\t\tast::ObjectPatProp::Assign(ref v) => {\n\t\t\t\tlet access = ast::Expr::Member(ast::MemberExpr {\n\t\t\t\t\tobj: Box::new(new_ident.clone()),\n\t\t\t\t\tprop: ast::MemberProp::Ident(v.key.clone().into()),\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t});\n\t\t\t\tif let Some(value) = &v.value {\n\t\t\t\t\tif is_immutable_expr(value.as_ref(), props_transform.global_collect, None) {\n\t\t\t\t\t\tlocal.push((\n\t\t\t\t\t\t\tid!(v.key),\n\t\t\t\t\t\t\tv.key.sym.clone(),\n\t\t\t\t\t\t\tast::Expr::Bin(ast::BinExpr {\n\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\top: ast::BinaryOp::NullishCoalescing,\n\t\t\t\t\t\t\t\tleft: Box::new(access),\n\t\t\t\t\t\t\t\tright: value.clone(),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tskip = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlocal.push((id!(v.key), v.key.sym.clone(), access));\n\t\t\t\t}\n\t\t\t}\n\t\t\tast::ObjectPatProp::KeyValue(ref v) => {\n\t\t\t\tif let ast::PropName::Ident(ref key) = v.key {\n\t\t\t\t\tmatch &v.value {\n\t\t\t\t\t\tbox ast::Pat::Ident(ref ident) => {\n\t\t\t\t\t\t\tlet access = ast::Expr::Member(ast::MemberExpr {\n\t\t\t\t\t\t\t\tobj: Box::new(new_ident.clone()),\n\t\t\t\t\t\t\t\tprop: ast::MemberProp::Ident(key.clone()),\n\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tlocal.push((id!(ident), key.sym.clone(), access));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbox ast::Pat::Assign(ast::AssignPat {\n\t\t\t\t\t\t\tleft: box ast::Pat::Ident(ident),\n\t\t\t\t\t\t\tright: value,\n\t\t\t\t\t\t\t..\n\t\t\t\t\t\t}) => {\n\t\t\t\t\t\t\tif is_immutable_expr(\n\t\t\t\t\t\t\t\tvalue.as_ref(),\n\t\t\t\t\t\t\t\tprops_transform.global_collect,\n\t\t\t\t\t\t\t\tNone,\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tlet access = ast::Expr::Member(ast::MemberExpr {\n\t\t\t\t\t\t\t\t\tobj: Box::new(new_ident.clone()),\n\t\t\t\t\t\t\t\t\tprop: ast::MemberProp::Ident(key.clone()),\n\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tlocal.push((\n\t\t\t\t\t\t\t\t\tid!(ident.id),\n\t\t\t\t\t\t\t\t\tkey.sym.clone(),\n\t\t\t\t\t\t\t\t\tast::Expr::Bin(ast::BinExpr {\n\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\top: ast::BinaryOp::NullishCoalescing,\n\t\t\t\t\t\t\t\t\t\tleft: Box::new(access),\n\t\t\t\t\t\t\t\t\t\tright: value.clone(),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_ => {\n\t\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tskip = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tast::ObjectPatProp::Rest(ast::RestPat { box arg, .. }) => {\n\t\t\t\tif let ast::Pat::Ident(ref ident) = arg {\n\t\t\t\t\trest_id = Some(id!(&ident.id));\n\t\t\t\t} else {\n\t\t\t\t\tskip = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif skip || local.is_empty() {\n\t\treturn None;\n\t}\n\tSome((rest_id, local))\n}\n\nfn transform_rest(\n\tarrow: &mut ast::ArrowExpr,\n\tomit_fn: &Id,\n\trest_id: &Id,\n\tprops_expr: ast::Expr,\n\tomit: Vec<JsWord>,\n) {\n\tlet new_stmt = create_omit_props(omit_fn, rest_id, props_expr, omit);\n\tmatch &mut arrow.body {\n\t\tbox ast::BlockStmtOrExpr::BlockStmt(block) => {\n\t\t\tblock.stmts.insert(0, new_stmt);\n\t\t}\n\t\tbox ast::BlockStmtOrExpr::Expr(ref expr) => {\n\t\t\tarrow.body = Box::new(ast::BlockStmtOrExpr::BlockStmt(ast::BlockStmt {\n\t\t\t\tstmts: vec![new_stmt, create_return_stmt(expr.clone())],\n\t\t\t\t..Default::default()\n\t\t\t}));\n\t\t}\n\t}\n}\n\nfn create_omit_props(\n\tomit_fn: &Id,\n\trest_id: &Id,\n\tprops_expr: ast::Expr,\n\tomit: Vec<JsWord>,\n) -> ast::Stmt {\n\tast::Stmt::Decl(ast::Decl::Var(Box::new(ast::VarDecl {\n\t\tkind: ast::VarDeclKind::Const,\n\t\tdecls: vec![ast::VarDeclarator {\n\t\t\tdefinite: false,\n\t\t\tspan: DUMMY_SP,\n\t\t\tinit: Some(Box::new(ast::Expr::Call(ast::CallExpr {\n\t\t\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(omit_fn)))),\n\t\t\t\targs: vec![\n\t\t\t\t\tast::ExprOrSpread {\n\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\texpr: Box::new(props_expr),\n\t\t\t\t\t},\n\t\t\t\t\tast::ExprOrSpread {\n\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\texpr: Box::new(ast::Expr::Array(ast::ArrayLit {\n\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\telems: omit\n\t\t\t\t\t\t\t\t.into_iter()\n\t\t\t\t\t\t\t\t.map(|v| {\n\t\t\t\t\t\t\t\t\tSome(ast::ExprOrSpread {\n\t\t\t\t\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\t\t\t\t\texpr: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\tvalue: v,\n\t\t\t\t\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t\t\t\t\t}))),\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.collect(),\n\t\t\t\t\t\t})),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t..Default::default()\n\t\t\t}))),\n\t\t\tname: ast::Pat::Ident(ast::BindingIdent::from(new_ident_from_id(rest_id))),\n\t\t}],\n\t\t..Default::default()\n\t})))\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_1.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 91\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component, onRender } from '@builder.io/qwik';\n\nexport const renderHeader = $(() => {\n    return (\n        <div onClick={$((ctx) => console.log(ctx))}/>\n    );\n});\nconst renderHeader = component($(() => {\n  console.log(\"mount\");\n  return render;\n}));\n\n============================= test.tsx_renderHeader_zBbHWn4e8Cg.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const renderHeader_zBbHWn4e8Cg = ()=>{\n    return <div onClick={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_renderHeader_div_onClick_fV2uzAL99u4\"), \"renderHeader_div_onClick_fV2uzAL99u4\")}/>;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";wCAG8B;IAC1B,QACK,IAAI;AAEb\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"renderHeader_zBbHWn4e8Cg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_renderHeader\",\n  \"hash\": \"zBbHWn4e8Cg\",\n  \"canonicalFilename\": \"test.tsx_renderHeader_zBbHWn4e8Cg\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    92,\n    175\n  ]\n}\n*/\n============================= test.tsx_renderHeader_component_U6Kkv07sbpQ.tsx (ENTRY POINT)==\n\nexport const renderHeader_component_U6Kkv07sbpQ = ()=>{\n    console.log(\"mount\");\n    return render;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"kDAQiC;IAC/B,QAAQ,GAAG,CAAC;IACZ,OAAO;AACT\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"renderHeader_component_U6Kkv07sbpQ\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_renderHeader_component\",\n  \"hash\": \"U6Kkv07sbpQ\",\n  \"canonicalFilename\": \"test.tsx_renderHeader_component_U6Kkv07sbpQ\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    211,\n    261\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { component } from '@builder.io/qwik';\nexport const renderHeader = /*#__PURE__*/ qrl(()=>import(\"./test.tsx_renderHeader_zBbHWn4e8Cg\"), \"renderHeader_zBbHWn4e8Cg\");\nconst renderHeader = component(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_renderHeader_component_U6Kkv07sbpQ\"), \"renderHeader_component_U6Kkv07sbpQ\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";AACA,SAAY,SAAS,QAAkB,mBAAmB;AAE1D,OAAO,MAAM,gHAIV;AACH,MAAM,eAAe\\\"}\")\n============================= test.tsx_renderHeader_div_onClick_fV2uzAL99u4.tsx (ENTRY POINT)==\n\nexport const renderHeader_div_onClick_fV2uzAL99u4 = (ctx)=>console.log(ctx);\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"oDAKwB,CAAC,MAAQ,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"renderHeader_div_onClick_fV2uzAL99u4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_renderHeader_div_onClick\",\n  \"hash\": \"fV2uzAL99u4\",\n  \"canonicalFilename\": \"test.tsx_renderHeader_div_onClick_fV2uzAL99u4\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"renderHeader_zBbHWn4e8Cg\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    137,\n    162\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_10.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 268\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nconst Header = $((decl1, {decl2}, [decl3]) => {\n\n    const hola = ident1.no;\n    ident2;\n    const a = ident1 + ident3;\n    const b = ident1 + ident3;\n    ident4(ident5, [ident6], {ident7}, {key: ident8});\n    class Some {\n        prop = ident9;\n        method() {\n            return ident10;\n        }\n    }\n\n    return (\n        <div onClick={(ident11) => ident11 + ident12} required={false}/>\n    )\n});\n\n============================= project/test.tsx_Header_WlR3xnI6u38.tsx (ENTRY POINT)==\n\nexport const Header_WlR3xnI6u38 = (decl1, { decl2 }, [decl3])=>{\n    ident1.no;\n    ident2;\n    ident1, ident3;\n    ident1, ident3;\n    ident4(ident5, [\n        ident6\n    ], {\n        ident7\n    }, {\n        key: ident8\n    });\n    class Some {\n        prop = ident9;\n        method() {\n            return ident10;\n        }\n    }\n    return <div onClick={(ident11)=>ident11 + ident12} required={false}/>;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"kCAEiB,CAAC,OAAO,EAAC,KAAK,EAAC,EAAE,CAAC,MAAM;IAExB,OAAO,EAAE;IACtB;IACU,QAAS;IACT,QAAS;IACnB,OAAO,QAAQ;QAAC;KAAO,EAAE;QAAC;IAAM,GAAG;QAAC,KAAK;IAAM;IAC/C,MAAM;QACF,OAAO,OAAO;QACd,SAAS;YACL,OAAO;QACX;IACJ;IAEA,QACK,IAAI,SAAS,CAAC,UAAY,UAAU,SAAS,UAAU;AAEhE\\\"}\")\n/*\n{\n  \"origin\": \"project/test.tsx\",\n  \"name\": \"Header_WlR3xnI6u38\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header\",\n  \"hash\": \"WlR3xnI6u38\",\n  \"canonicalFilename\": \"test.tsx_Header_WlR3xnI6u38\",\n  \"path\": \"project\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    69,\n    455\n  ]\n}\n*/\n============================= project/test.tsx ==\n\nimport { qrl } from \"@builder.io/qwik\";\n/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_WlR3xnI6u38\"), \"Header_WlR3xnI6u38\");\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[],\\\"names\\\":[],\\\"mappings\\\":\\\"\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_11.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 298\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nimport {foo, bar as bbar} from \"../state\";\nimport * as dep2 from \"dep2\";\nimport dep3 from \"dep3/something\";\n\nexport const Header = component$(() => {\n    return (\n        <Header onClick={$((ev) => dep3(ev))}>\n            {dep2.stuff()}{bbar()}\n        </Header>\n    );\n});\n\nexport const App = component$(() => {\n    return (\n        <Header>{foo()}</Header>\n    );\n});\n\n============================= project/test.tsx_Header_component_Header_onClick_KjD9TCNkNxY.tsx ==\n\nimport dep3 from \"dep3/something\";\nexport const Header_component_Header_onClick_KjD9TCNkNxY = (ev)=>dep3(ev);\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";2DAQ2B,CAAC,KAAO,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"project/test.tsx\",\n  \"name\": \"Header_component_Header_onClick_KjD9TCNkNxY\",\n  \"entry\": \"entry_segments\",\n  \"displayName\": \"test.tsx_Header_component_Header_onClick\",\n  \"hash\": \"KjD9TCNkNxY\",\n  \"canonicalFilename\": \"test.tsx_Header_component_Header_onClick_KjD9TCNkNxY\",\n  \"path\": \"project\",\n  \"extension\": \"tsx\",\n  \"parent\": \"Header_component_UVBJuFYfvDo\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    242,\n    258\n  ]\n}\n*/\n============================= project/test.tsx_Header_component_UVBJuFYfvDo.tsx ==\n\nimport { Header } from \"./test\";\nimport { bar as bbar } from \"../state\";\nimport * as dep2 from \"dep2\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header_component_UVBJuFYfvDo = ()=>{\n    return <Header onClick={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_Header_onClick_KjD9TCNkNxY\"), \"Header_component_Header_onClick_KjD9TCNkNxY\")}>\n            {dep2.stuff()}{bbar()}\n        </Header>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;4CAMiC;IAC7B,QACK,OAAO,iJAA8B;YAClC,CAAC,KAAK,KAAK,IAAI,OAAO;QAC1B,EAAE;AAEV\\\"}\")\n/*\n{\n  \"origin\": \"project/test.tsx\",\n  \"name\": \"Header_component_UVBJuFYfvDo\",\n  \"entry\": \"entry_segments\",\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"UVBJuFYfvDo\",\n  \"canonicalFilename\": \"test.tsx_Header_component_UVBJuFYfvDo\",\n  \"path\": \"project\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    194,\n    323\n  ]\n}\n*/\n============================= project/test.tsx_App_component_wGkRHWXaqjs.tsx ==\n\nimport { Header } from \"./test\";\nimport { foo } from \"../state\";\nexport const App_component_wGkRHWXaqjs = ()=>{\n    return <Header>{foo()}</Header>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAc8B;IAC1B,QACK,QAAQ,QAAQ;AAEzB\\\"}\")\n/*\n{\n  \"origin\": \"project/test.tsx\",\n  \"name\": \"App_component_wGkRHWXaqjs\",\n  \"entry\": \"entry_segments\",\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"wGkRHWXaqjs\",\n  \"canonicalFilename\": \"test.tsx_App_component_wGkRHWXaqjs\",\n  \"path\": \"project\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    357,\n    419\n  ]\n}\n*/\n============================= project/test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_UVBJuFYfvDo\"), \"Header_component_UVBJuFYfvDo\"));\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_wGkRHWXaqjs\"), \"App_component_wGkRHWXaqjs\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAMA,OAAO,MAAM,uBAAS,uHAMnB;AAEH,OAAO,MAAM,oBAAM,iHAIhB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_2.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 112\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nexport const Header = component$(() => {\n    console.log(\"mount\");\n    return (\n        <div onClick={$((ctx) => console.log(ctx))}/>\n    );\n});\n\n============================= test.tsx_Header_component_J4uyIhaBNR4.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header_component_J4uyIhaBNR4 = ()=>{\n    console.log(\"mount\");\n    return <div onClick={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_div_onClick_i7ekvWH3674\"), \"Header_component_div_onClick_i7ekvWH3674\")}/>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAEiC;IAC7B,QAAQ,GAAG,CAAC;IACZ,QACK,IAAI;AAEb\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_J4uyIhaBNR4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"J4uyIhaBNR4\",\n  \"canonicalFilename\": \"test.tsx_Header_component_J4uyIhaBNR4\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    85,\n    194\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_J4uyIhaBNR4\"), \"Header_component_J4uyIhaBNR4\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEA,OAAO,MAAM,uBAAS,uHAKnB\\\"}\")\n============================= test.tsx_Header_component_div_onClick_i7ekvWH3674.tsx (ENTRY POINT)==\n\nexport const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log(ctx);\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"wDAKwB,CAAC,MAAQ,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_div_onClick_i7ekvWH3674\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component_div_onClick\",\n  \"hash\": \"i7ekvWH3674\",\n  \"canonicalFilename\": \"test.tsx_Header_component_div_onClick_i7ekvWH3674\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"Header_component_J4uyIhaBNR4\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    156,\n    181\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_3.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 129\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nexport const App = () => {\n    const Header = component$(() => {\n        console.log(\"mount\");\n        return (\n            <div onClick={$((ctx) => console.log(ctx))}/>\n        );\n    });\n    return Header;\n});\n\n============================= test.tsx_App_Header_component_B9F3YeqcO1w.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const App_Header_component_B9F3YeqcO1w = ()=>{\n    console.log(\"mount\");\n    return <div onClick={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_Header_component_div_onClick_aO7uI7Iw6oQ\"), \"App_Header_component_div_onClick_aO7uI7Iw6oQ\")}/>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";gDAG8B;IACtB,QAAQ,GAAG,CAAC;IACZ,QACK,IAAI;AAEb\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_Header_component_B9F3YeqcO1w\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_Header_component\",\n  \"hash\": \"B9F3YeqcO1w\",\n  \"canonicalFilename\": \"test.tsx_App_Header_component_B9F3YeqcO1w\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    109,\n    238\n  ]\n}\n*/\n============================= test.tsx_App_Header_component_div_onClick_aO7uI7Iw6oQ.tsx (ENTRY POINT)==\n\nexport const App_Header_component_div_onClick_aO7uI7Iw6oQ = (ctx)=>console.log(ctx);\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"4DAM4B,CAAC,MAAQ,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_Header_component_div_onClick_aO7uI7Iw6oQ\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_Header_component_div_onClick\",\n  \"hash\": \"aO7uI7Iw6oQ\",\n  \"canonicalFilename\": \"test.tsx_App_Header_component_div_onClick_aO7uI7Iw6oQ\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"App_Header_component_B9F3YeqcO1w\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    192,\n    217\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = ()=>{\n    const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_Header_component_B9F3YeqcO1w\"), \"App_Header_component_B9F3YeqcO1w\"));\n    return Header;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEA,OAAO,MAAM,MAAM;IACf,MAAM,uBAAS;IAMf,OAAO;AACX,EAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_4.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 149\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nexport function App() {\n    const Header = component$(() => {\n        console.log(\"mount\");\n        return (\n            <div onClick={$((ctx) => console.log(ctx))}/>\n        );\n    });\n    return Header;\n}\n\n============================= test.tsx_App_Header_component_B9F3YeqcO1w.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const App_Header_component_B9F3YeqcO1w = ()=>{\n    console.log(\"mount\");\n    return <div onClick={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_Header_component_div_onClick_aO7uI7Iw6oQ\"), \"App_Header_component_div_onClick_aO7uI7Iw6oQ\")}/>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";gDAG8B;IACtB,QAAQ,GAAG,CAAC;IACZ,QACK,IAAI;AAEb\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_Header_component_B9F3YeqcO1w\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_Header_component\",\n  \"hash\": \"B9F3YeqcO1w\",\n  \"canonicalFilename\": \"test.tsx_App_Header_component_B9F3YeqcO1w\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    106,\n    235\n  ]\n}\n*/\n============================= test.tsx_App_Header_component_div_onClick_aO7uI7Iw6oQ.tsx (ENTRY POINT)==\n\nexport const App_Header_component_div_onClick_aO7uI7Iw6oQ = (ctx)=>console.log(ctx);\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"4DAM4B,CAAC,MAAQ,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_Header_component_div_onClick_aO7uI7Iw6oQ\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_Header_component_div_onClick\",\n  \"hash\": \"aO7uI7Iw6oQ\",\n  \"canonicalFilename\": \"test.tsx_App_Header_component_div_onClick_aO7uI7Iw6oQ\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"App_Header_component_B9F3YeqcO1w\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    189,\n    214\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport function App() {\n    const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_Header_component_B9F3YeqcO1w\"), \"App_Header_component_B9F3YeqcO1w\"));\n    return Header;\n}\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEA,OAAO,SAAS;IACZ,MAAM,uBAAS;IAMf,OAAO;AACX\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_5.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 169\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nexport const Header = component$(() => {\n    return (\n        <>\n            <div onClick={(ctx) => console.log(\"1\")}/>\n            <div onClick={$((ctx) => console.log(\"2\"))}/>\n        </>\n    );\n});\n\n============================= test.tsx_Header_component_J4uyIhaBNR4.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header_component_J4uyIhaBNR4 = ()=>{\n    return <>\n            <div onClick={(ctx)=>console.log(\"1\")}/>\n            <div onClick={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_div_onClick_i7ekvWH3674\"), \"Header_component_div_onClick_i7ekvWH3674\")}/>\n        </>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAEiC;IAC7B,SACM;YACE,CAAC,IAAI,SAAS,CAAC,MAAQ,QAAQ,GAAG,CAAC,OAAO;YAC1C,CAAC,IAAI,4IAAwC;QACjD;AAER\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_J4uyIhaBNR4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"J4uyIhaBNR4\",\n  \"canonicalFilename\": \"test.tsx_Header_component_J4uyIhaBNR4\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    85,\n    250\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_J4uyIhaBNR4\"), \"Header_component_J4uyIhaBNR4\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEA,OAAO,MAAM,uBAAS,uHAOnB\\\"}\")\n============================= test.tsx_Header_component_div_onClick_i7ekvWH3674.tsx (ENTRY POINT)==\n\nexport const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log(\"2\");\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"wDAM4B,CAAC,MAAQ,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_div_onClick_i7ekvWH3674\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component_div_onClick\",\n  \"hash\": \"i7ekvWH3674\",\n  \"canonicalFilename\": \"test.tsx_Header_component_div_onClick_i7ekvWH3674\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"Header_component_J4uyIhaBNR4\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    200,\n    225\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_6.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 188\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nexport const sym1 = $((ctx) => console.log(\"1\"));\n\n============================= test.tsx_sym1_aXUrPXX5Lak.tsx (ENTRY POINT)==\n\nexport const sym1_aXUrPXX5Lak = (ctx)=>console.log(\"1\");\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"gCAEsB,CAAC,MAAQ,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"sym1_aXUrPXX5Lak\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_sym1\",\n  \"hash\": \"aXUrPXX5Lak\",\n  \"canonicalFilename\": \"test.tsx_sym1_aXUrPXX5Lak\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    74,\n    99\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const sym1 = /*#__PURE__*/ qrl(()=>import(\"./test.tsx_sym1_aXUrPXX5Lak\"), \"sym1_aXUrPXX5Lak\");\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";AAEA,OAAO,MAAM,wFAAoC\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_7.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 200\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Header = component$(() => {\n    console.log(\"mount\");\n    return (\n        <div onClick={$((ctx) => console.log(ctx))}/>\n    );\n  });\n\nconst App = component$(() => {\n    return (\n        <Header/>\n    );\n});\n\n============================= test.tsx_Header_component_J4uyIhaBNR4.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header_component_J4uyIhaBNR4 = ()=>{\n    console.log(\"mount\");\n    return <div onClick={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_div_onClick_i7ekvWH3674\"), \"Header_component_div_onClick_i7ekvWH3674\")}/>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAGiC;IAC7B,QAAQ,GAAG,CAAC;IACZ,QACK,IAAI;AAEX\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_J4uyIhaBNR4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"J4uyIhaBNR4\",\n  \"canonicalFilename\": \"test.tsx_Header_component_J4uyIhaBNR4\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    86,\n    197\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_J4uyIhaBNR4\"), \"Header_component_J4uyIhaBNR4\"));\n/*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,uBAAS,uHAKjB;cAEO\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.tsx (ENTRY POINT)==\n\nimport { Header } from \"./test\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    return <Header/>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAUuB;IACnB,QACK;AAET\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    224,\n    271\n  ]\n}\n*/\n============================= test.tsx_Header_component_div_onClick_i7ekvWH3674.tsx (ENTRY POINT)==\n\nexport const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log(ctx);\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"wDAMwB,CAAC,MAAQ,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_div_onClick_i7ekvWH3674\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component_div_onClick\",\n  \"hash\": \"i7ekvWH3674\",\n  \"canonicalFilename\": \"test.tsx_Header_component_div_onClick_i7ekvWH3674\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"Header_component_J4uyIhaBNR4\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    157,\n    182\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_8.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 224\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Header = component$(() => {\n    return $((hola) => {\n        const hola = this;\n        const {something, styff} = hola;\n        const hello = hola.nothere.stuff[global];\n        return (\n            <Header/>\n        );\n    });\n});\n\n============================= test.tsx_Header_component_J4uyIhaBNR4.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header_component_J4uyIhaBNR4 = ()=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_1_2B8d0oH9ZWc\"), \"Header_component_1_2B8d0oH9ZWc\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAGiC;IAC7B;AAQJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_J4uyIhaBNR4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"J4uyIhaBNR4\",\n  \"canonicalFilename\": \"test.tsx_Header_component_J4uyIhaBNR4\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    86,\n    296\n  ]\n}\n*/\n============================= test.tsx_Header_component_1_2B8d0oH9ZWc.tsx (ENTRY POINT)==\n\nimport { Header } from \"./test\";\nexport const Header_component_1_2B8d0oH9ZWc = (hola)=>{\n    const hola = this;\n    const { something, styff } = hola;\n    hola.nothere.stuff[global];\n    return <Header/>;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";8CAIa,CAAC;IACN,MAAM,OAAO,IAAI;IACjB,MAAM,EAAC,SAAS,EAAE,KAAK,EAAC,GAAG;IACb,KAAK,OAAO,CAAC,KAAK,CAAC,OAAO;IACxC,QACK;AAET\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_1_2B8d0oH9ZWc\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component_1\",\n  \"hash\": \"2B8d0oH9ZWc\",\n  \"canonicalFilename\": \"test.tsx_Header_component_1_2B8d0oH9ZWc\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"Header_component_J4uyIhaBNR4\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    107,\n    292\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_J4uyIhaBNR4\"), \"Header_component_J4uyIhaBNR4\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,uBAAS,uHASnB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_9.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 246\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nconst Header = $((decl1, {decl2}, [decl3]) => {\n    const {decl4, key: decl5} = this;\n    let [decl6, ...decl7] = stuff;\n    const decl8 = 1, decl9;\n    function decl10(decl11, {decl12}, [decl13]) {}\n    class decl14 {\n        method(decl15, {decl16}, [decl17]) {}\n    }\n    try{}catch(decl18){}\n    try{}catch({decl19}){}\n});\n\n============================= test.tsx_Header_WjUaUQN7Oxg.tsx (ENTRY POINT)==\n\nexport const Header_WjUaUQN7Oxg = (decl1, { decl2 }, [decl3])=>{\n    const { decl4, key: decl5 } = this;\n    let [decl6, ...decl7] = stuff;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"kCAEiB,CAAC,OAAO,EAAC,KAAK,EAAC,EAAE,CAAC,MAAM;IACrC,MAAM,EAAC,KAAK,EAAE,KAAK,KAAK,EAAC,GAAG,IAAI;IAChC,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG;AAQ5B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_WjUaUQN7Oxg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header\",\n  \"hash\": \"WjUaUQN7Oxg\",\n  \"canonicalFilename\": \"test.tsx_Header_WjUaUQN7Oxg\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    69,\n    376\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { qrl } from \"@builder.io/qwik\";\n/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_WjUaUQN7Oxg\"), \"Header_WjUaUQN7Oxg\");\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[],\\\"names\\\":[],\\\"mappings\\\":\\\"\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_build_server.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2620\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, isDev, isServer as isServer2 } from '@builder.io/qwik';\nimport { isServer, isBrowser as isb } from '@builder.io/qwik/build';\nimport { mongodb } from 'mondodb';\nimport { threejs } from 'threejs';\n\nimport L from 'leaflet';\n\nexport const functionThatNeedsWindow = () => {\n  if (isb) {\n    console.log('l', L);\n    console.log('hey');\n    window.alert('hey');\n  }\n};\n\nexport const App = component$(() => {\n    useMount$(() => {\n        if (isServer) {\n            console.log('server', mongodb());\n        }\n        if (isb) {\n            console.log('browser', new threejs());\n        }\n    });\n    return (\n        <Cmp>\n            {isServer2 && <p>server</p>}\n            {isb && <p>server</p>}\n        </Cmp>\n    );\n});\n\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const functionThatNeedsWindow = ()=>{};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"s_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAQA,OAAO,MAAM,0BAA0B,KAMvC,EAAE;AAEF,OAAO,MAAM,oBAAM,qGAehB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.tsx (ENTRY POINT)==\n\nimport { mongodb } from \"mondodb\";\nexport const s_ckEPmXZlub0 = ()=>{\n    useMount$(()=>{\n        console.log('server', mongodb());\n    });\n    return <Cmp>\n            {<p>server</p>}\n            {false}\n        </Cmp>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";6BAgB8B;IAC1B,UAAU;QAEF,QAAQ,GAAG,CAAC,UAAU;IAK9B;IACA,QACK,IAAI;YACD,EAAe,EAAE,MAAM,EAAE,GAAG;YAC5B,OAAsB;QAC1B,EAAE;AAEV\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"s_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    427,\n    751\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capture_imports.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 914\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStyles$ } from '@builder.io/qwik';\nimport css1 from './global.css';\nimport css2 from './style.css';\nimport css3 from './style.css';\n\nexport const App = component$(() => {\n    useStyles$(`${css1}${css2}`);\n    useStyles$(css3);\n})\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAMA,OAAO,MAAM,oBAAM,iHAGjB\\\"}\")\n============================= test.tsx_App_component_useStyles_t35nSa5UV7U.js (ENTRY POINT)==\n\nimport css1 from \"./global.css\";\nimport css2 from \"./style.css\";\nexport const App_component_useStyles_t35nSa5UV7U = `${css1}${css2}`;\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;mDAOe,GAAG,OAAO,MAAM\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_useStyles_t35nSa5UV7U\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_useStyles\",\n  \"hash\": \"t35nSa5UV7U\",\n  \"canonicalFilename\": \"test.tsx_App_component_useStyles_t35nSa5UV7U\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useStyles$\",\n  \"captures\": false,\n  \"loc\": [\n    212,\n    228\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStylesQrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    useStylesQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_useStyles_t35nSa5UV7U\"), \"App_component_useStyles_t35nSa5UV7U\"));\n    useStylesQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_useStyles_1_xBK4W0ZKWe8\"), \"App_component_useStyles_1_xBK4W0ZKWe8\"));\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAM8B;IAC1B;IACA;AACJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    189,\n    254\n  ]\n}\n*/\n============================= test.tsx_App_component_useStyles_1_xBK4W0ZKWe8.js (ENTRY POINT)==\n\nimport css3 from \"./style.css\";\nexport const App_component_useStyles_1_xBK4W0ZKWe8 = css3;\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";qDAQe\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_useStyles_1_xBK4W0ZKWe8\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_useStyles_1\",\n  \"hash\": \"xBK4W0ZKWe8\",\n  \"canonicalFilename\": \"test.tsx_App_component_useStyles_1_xBK4W0ZKWe8\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useStyles$\",\n  \"captures\": false,\n  \"loc\": [\n    246,\n    250\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capturing_fn_class.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 935\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    function hola() {\n      console.log('hola');\n    }\n    class Thing {}\n    class Other {}\n\n    return $(() => {\n      hola();\n      new Thing();\n      return (\n          <div></div>\n      )\n    });\n})\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAcjB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_1_w0t0o3QMovU\"), \"App_component_1_w0t0o3QMovU\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAG8B;IAO1B;AAOJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    83,\n    293\n  ]\n}\n*/\n============================= test.tsx_App_component_1_w0t0o3QMovU.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_1_w0t0o3QMovU = ()=>{\n    hola();\n    new Thing();\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_0\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";2CAUa;IACP;IACA,IAAI;IACJ,qBACI,MAAC;AAEP\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_1_w0t0o3QMovU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_1\",\n  \"hash\": \"w0t0o3QMovU\",\n  \"canonicalFilename\": \"test.tsx_App_component_1_w0t0o3QMovU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    198,\n    289\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[\n  {\n    \"category\": \"error\",\n    \"code\": \"C02\",\n    \"file\": \"test.tsx\",\n    \"message\": \"Reference to identifier 'Thing' can not be used inside a Qrl($) scope because it's a function\",\n    \"highlights\": null,\n    \"suggestions\": null,\n    \"scope\": \"optimizer\"\n  },\n  {\n    \"category\": \"error\",\n    \"code\": \"C02\",\n    \"file\": \"test.tsx\",\n    \"message\": \"Reference to identifier 'hola' can not be used inside a Qrl($) scope because it's a function\",\n    \"highlights\": null,\n    \"suggestions\": null,\n    \"scope\": \"optimizer\"\n  }\n]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_class_name.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2537\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport const App2 = component$(() => {\n    const signal = useSignal();\n    const computed = signal.value + 'foo';\n    return (\n        <>\n            <div className=\"hola\"></div>\n            <div className={signal.value}></div>\n            <div className={signal}></div>\n            <div className={computed}></div>\n\n            <Foo className=\"hola\"></Foo>\n            <Foo className={signal.value}></Foo>\n            <Foo className={signal}></Foo>\n            <Foo className={computed}></Foo>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App2 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App2_component_3yveMqbQ3Fs.js\"), \"App2_component_3yveMqbQ3Fs\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,qBAAO,sHAgBjB\\\"}\")\n============================= test.tsx_App2_component_3yveMqbQ3Fs.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App2_component_3yveMqbQ3Fs = ()=>{\n    const signal = useSignal();\n    const computed = signal.value + 'foo';\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", null, {\n                className: \"hola\"\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, {\n                className: _fnSignal((p0)=>p0.value, [\n                    signal\n                ], \"p0.value\")\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, {\n                className: signal\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", {\n                className: computed\n            }, null, null, 3, null),\n            /*#__PURE__*/ _jsxC(Foo, {\n                className: \"hola\",\n                [_IMMUTABLE]: {\n                    className: _IMMUTABLE\n                }\n            }, 3, \"u6_0\"),\n            /*#__PURE__*/ _jsxC(Foo, {\n                get className () {\n                    return signal.value;\n                },\n                [_IMMUTABLE]: {\n                    className: _fnSignal((p0)=>p0.value, [\n                        signal\n                    ], \"p0.value\")\n                }\n            }, 3, \"u6_1\"),\n            /*#__PURE__*/ _jsxC(Foo, {\n                className: signal,\n                [_IMMUTABLE]: {\n                    className: _IMMUTABLE\n                }\n            }, 3, \"u6_2\"),\n            /*#__PURE__*/ _jsxC(Foo, {\n                className: computed\n            }, 3, \"u6_3\")\n        ]\n    }, 1, \"u6_4\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;0CAG+B;IAC3B,MAAM,SAAS;IACf,MAAM,WAAW,OAAO,KAAK,GAAG;IAChC,qBACI;;0BACI,MAAC;gBAAI,WAAU;;0BACf,MAAC;gBAAI,SAAS,kBAAE,GAAO,KAAK;;;;0BAC5B,MAAC;gBAAI,WAAW;;0BAChB,MAAC;gBAAI,WAAW;;0BAEhB,MAAC;gBAAI,WAAU;;oBAAV,SAAS;;;0BACd,MAAC;oBAAI;2BAAW,OAAO,KAAK;;;oBAAvB,SAAS,kBAAE,GAAO,KAAK;;;;;0BAC5B,MAAC;gBAAI,WAAW;;oBAAX,SAAS;;;0BACd,MAAC;gBAAI,WAAW;;;;AAG5B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App2_component_3yveMqbQ3Fs\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App2_component\",\n  \"hash\": \"3yveMqbQ3Fs\",\n  \"canonicalFilename\": \"test.tsx_App2_component_3yveMqbQ3Fs\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    81,\n    565\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_custom_inlined_functions.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1197\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, $, useStore, wrap, useEffect } from '@builder.io/qwik';\n\nexport const useMemoQrl = (qrt) => {\n    useEffect(qrt);\n};\n\nexport const useMemo$ = wrap(useMemoQrl);\n\nexport const App = component$((props) => {\n    const state = useStore({count: 0});\n    useMemo$(() => {\n        console.log(state.count);\n    });\n    return $(() => (\n        <div>{state.count}</div>\n    ));\n});\n\nexport const Lightweight = (props) => {\n    useMemo$(() => {\n        console.log(state.count);\n    });\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { wrap, useEffect } from '@builder.io/qwik';\nexport const useMemoQrl = (qrt)=>{\n    useEffect(qrt);\n};\nexport const useMemo$ = wrap(useMemoQrl);\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\nexport const Lightweight = (props)=>{\n    useMemoQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Lightweight_useMemo_UIcxVTQF1a8\"), \"Lightweight_useMemo_UIcxVTQF1a8\"));\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AACA,SAAkC,IAAI,EAAE,SAAS,QAAQ,mBAAmB;AAE5E,OAAO,MAAM,aAAa,CAAC;IACvB,UAAU;AACd,EAAE;AAEF,OAAO,MAAM,WAAW,KAAK,YAAY;AAEzC,OAAO,MAAM,oBAAM,iHAQhB;AAEH,OAAO,MAAM,cAAc,CAAC;IACxB;AAGJ,EAAG\\\"}\")\n============================= test.tsx_App_component_useMemo_6Sc9KVki3Y0.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const App_component_useMemo_6Sc9KVki3Y0 = ()=>{\n    const [state] = useLexicalScope();\n    console.log(state.count);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";iDAWa;;IACL,QAAQ,GAAG,CAAC,MAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_useMemo_6Sc9KVki3Y0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_useMemo\",\n  \"hash\": \"6Sc9KVki3Y0\",\n  \"canonicalFilename\": \"test.tsx_App_component_useMemo_6Sc9KVki3Y0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useMemo$\",\n  \"captures\": true,\n  \"loc\": [\n    280,\n    327\n  ]\n}\n*/\n============================= test.tsx_Lightweight_useMemo_UIcxVTQF1a8.js (ENTRY POINT)==\n\nexport const Lightweight_useMemo_UIcxVTQF1a8 = ()=>{\n    console.log(state.count);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"+CAoBa;IACL,QAAQ,GAAG,CAAC,MAAM,KAAK;AAC3B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Lightweight_useMemo_UIcxVTQF1a8\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Lightweight_useMemo\",\n  \"hash\": \"UIcxVTQF1a8\",\n  \"canonicalFilename\": \"test.tsx_Lightweight_useMemo_UIcxVTQF1a8\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useMemo$\",\n  \"captures\": false,\n  \"loc\": [\n    450,\n    497\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useMemoQrl } from \"./test\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    const state = useStore({\n        count: 0\n    });\n    useMemoQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_useMemo_6Sc9KVki3Y0\"), \"App_component_useMemo_6Sc9KVki3Y0\", [\n        state\n    ]));\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_1_w0t0o3QMovU\"), \"App_component_1_w0t0o3QMovU\", [\n        state\n    ]);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;yCAS8B,CAAC;IAC3B,MAAM,QAAQ,SAAS;QAAC,OAAO;IAAC;IAChC;;;IAGA;;;AAGJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    214,\n    393\n  ]\n}\n*/\n============================= test.tsx_App_component_1_w0t0o3QMovU.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_1_w0t0o3QMovU = ()=>{\n    const [state] = useLexicalScope();\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.count, [\n        state\n    ], \"p0.count\"), 3, \"u6_0\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;2CAca;;yBACL,MAAC,mCAAK,GAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_1_w0t0o3QMovU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_1\",\n  \"hash\": \"w0t0o3QMovU\",\n  \"canonicalFilename\": \"test.tsx_App_component_1_w0t0o3QMovU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    343,\n    389\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_dead_code.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 449\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\nimport { deps } from 'deps';\n\nexport const Foo = component$(({foo}) => {\n    useMount$(() => {\n        if (false) {\n            deps();\n        }\n    });\n    return (\n        <div />\n    );\n})\n\n============================= test.tsx_Foo_component_HTDRsvUbLiE.tsx (ENTRY POINT)==\n\nexport const Foo_component_HTDRsvUbLiE = (props)=>{\n    useMount$(()=>{});\n    return <div/>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"yCAI8B;IAC1B,UAAU,KAIV;IACA,QACK;AAET\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    109,\n    240\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAIA,OAAO,MAAM,oBAAM,iHASjB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_default_export.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1438\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\nimport { sibling } from './sibling';\n\nexport default component$(() => {\n    return (\n        <div onClick$={() => console.log(mongodb, sibling)}>\n        </div>\n    );\n});\n\n\n============================= src/routes/_repl/[id]/[[...slug]].js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./[[...slug]].tsx_slug_component_0AM8HPnkNs4.js\"), \"slug_component_0AM8HPnkNs4\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/src/routes/_repl/[id]/[[...slug]].tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAIA,6BAAe,6HAKZ\\\"}\")\n============================= src/routes/_repl/[id]/[[...slug]].tsx_slug_component_div_onClick_xevvy0Qc7pA.js (ENTRY POINT)==\n\nimport { sibling } from \"./sibling\";\nexport const slug_component_div_onClick_xevvy0Qc7pA = ()=>console.log(mongodb, sibling);\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/src/routes/_repl/[id]/[[...slug]].tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";sDAMuB,IAAM,QAAQ,GAAG,CAAC,SAAS\\\"}\")\n/*\n{\n  \"origin\": \"src/routes/_repl/[id]/[[...slug]].tsx\",\n  \"name\": \"slug_component_div_onClick_xevvy0Qc7pA\",\n  \"entry\": null,\n  \"displayName\": \"[[...slug]].tsx_slug_component_div_onClick\",\n  \"hash\": \"xevvy0Qc7pA\",\n  \"canonicalFilename\": \"[[...slug]].tsx_slug_component_div_onClick_xevvy0Qc7pA\",\n  \"path\": \"src/routes/_repl/[id]\",\n  \"extension\": \"js\",\n  \"parent\": \"slug_component_0AM8HPnkNs4\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    157,\n    192\n  ]\n}\n*/\n============================= src/routes/_repl/[id]/[[...slug]].tsx_slug_component_0AM8HPnkNs4.js ==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const slug_component_0AM8HPnkNs4 = ()=>{\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./[[...slug]].tsx_slug_component_div_onClick_xevvy0Qc7pA.js\"), \"slug_component_div_onClick_xevvy0Qc7pA\")\n    }, null, 3, \"W4_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/src/routes/_repl/[id]/[[...slug]].tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;0CAI0B;IACtB,qBACI,MAAC;QAAI,QAAQ;;AAGrB\\\"}\")\n/*\n{\n  \"origin\": \"src/routes/_repl/[id]/[[...slug]].tsx\",\n  \"name\": \"slug_component_0AM8HPnkNs4\",\n  \"entry\": \"src/routes/_repl/[id]/[[...slug]].tsx_entry_[[...slug]]\",\n  \"displayName\": \"[[...slug]].tsx_slug_component\",\n  \"hash\": \"0AM8HPnkNs4\",\n  \"canonicalFilename\": \"[[...slug]].tsx_slug_component_0AM8HPnkNs4\",\n  \"path\": \"src/routes/_repl/[id]\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    113,\n    218\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_default_export_index.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1463\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n    return (\n        <div onClick$={() => console.log(mongodb)}>\n        </div>\n    );\n});\n\n\n============================= src/components/mongo/index.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    return <div onClick$={/*#__PURE__*/ inlinedQrl(()=>console.log(mongodb), \"mongo_component_div_onClick_2EK0wZbP8qw\")}>\n        </div>;\n}, \"mongo_component_ouWLj4jA2oI\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/src/components/mongo/index.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,6BAAe,sCAAW;IACtB,QACK,IAAI,mCAAU,IAAM,QAAQ,GAAG,CAAC,sDAAU;QAC3C,EAAE;AAEV,mCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_default_export_invalid_ident.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1484\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n    return (\n        <div onClick$={() => console.log(mongodb)}>\n        </div>\n    );\n});\n\n\n============================= src/components/mongo/404.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./404.tsx__404_component_zRvoWc98eqo\"), \"_404_component_zRvoWc98eqo\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/src/components/mongo/404.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,6BAAe,kHAKZ\\\"}\")\n============================= src/components/mongo/404.tsx__404_component_zRvoWc98eqo.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const _404_component_zRvoWc98eqo = ()=>{\n    return <div onClick$={/*#__PURE__*/ qrl(()=>import(\"./404.tsx__404_component_div_onClick_OiMo9dvEW9Q\"), \"_404_component_div_onClick_OiMo9dvEW9Q\")}>\n        </div>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/src/components/mongo/404.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";0CAG0B;IACtB,QACK,IAAI,uIAAsC;QAC3C,EAAE;AAEV\\\"}\")\n/*\n{\n  \"origin\": \"src/components/mongo/404.tsx\",\n  \"name\": \"_404_component_zRvoWc98eqo\",\n  \"entry\": null,\n  \"displayName\": \"404.tsx__404_component\",\n  \"hash\": \"zRvoWc98eqo\",\n  \"canonicalFilename\": \"404.tsx__404_component_zRvoWc98eqo\",\n  \"path\": \"src/components/mongo\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    76,\n    172\n  ]\n}\n*/\n============================= src/components/mongo/404.tsx__404_component_div_onClick_OiMo9dvEW9Q.tsx (ENTRY POINT)==\n\nexport const _404_component_div_onClick_OiMo9dvEW9Q = ()=>console.log(mongodb);\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/src/components/mongo/404.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"sDAKuB,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"src/components/mongo/404.tsx\",\n  \"name\": \"_404_component_div_onClick_OiMo9dvEW9Q\",\n  \"entry\": null,\n  \"displayName\": \"404.tsx__404_component_div_onClick\",\n  \"hash\": \"OiMo9dvEW9Q\",\n  \"canonicalFilename\": \"404.tsx__404_component_div_onClick_OiMo9dvEW9Q\",\n  \"path\": \"src/components/mongo\",\n  \"extension\": \"tsx\",\n  \"parent\": \"_404_component_zRvoWc98eqo\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    120,\n    146\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_derived_signals_children.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2751\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\n\nexport const TextContent = component$((props) => {\n    return (\n        <>\n            <div>data-nu: {props['data-nu']}</div>\n            <div>class: {props.class}</div>\n        </>\n    );\n});\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <>\n            <div>text</div>\n            <div>{`text`}</div>\n            <div>{1}</div>\n            <div>{true}</div>\n            <div>{`text${12}`}</div>\n            <div>{typeof `text${12}` === 'string' ? 12 : 43}</div>\n            <div>{signal}</div>\n            <div>{signal.value}</div>\n            <div>{12 + signal.value}</div>\n            <div>{store.address.city.name}</div>\n            <div>{store.address.city.name ? 'true' : 'false'}</div>\n            <div>{dep}</div>\n            <div>{dep.thing}</div>\n            <div>{dep.thing + 'stuff'}</div>\n            <div>{globalThing}</div>\n            <div>{globalThing.thing}</div>\n            <div>{globalThing.thing + 'stuff'}</div>\n            <div>{signal.value()}</div>\n            <div>{signal.value + unknown()}</div>\n            <div>{mutable(signal)}</div>\n            <div>{signal.value + dep}</div>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { useStore, mutable } from '@builder.io/qwik';\nimport { dep } from './file';\nconst TextContent_component_puSwpKXO7Kg = (props)=>{\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"data-nu: \",\n                _fnSignal((p0)=>p0['data-nu'], [\n                    props\n                ], 'p0[\"data-nu\"]')\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"class: \",\n                _fnSignal((p0)=>p0.class, [\n                    props\n                ], \"p0.class\")\n            ], 3, null)\n        ]\n    }, 3, \"u6_0\");\n};\nexport const TextContent = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(TextContent_component_puSwpKXO7Kg, \"TextContent_component_puSwpKXO7Kg\"));\nconst App_component_ckEPmXZlub0 = ()=>{\n    const signal = useSignal(0);\n    const store = useStore({});\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, \"text\", 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, `text`, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, 1, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, true, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, `text${12}`, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, typeof `text${12}` === 'string' ? 12 : 43, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, signal, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.value, [\n                signal\n            ], \"p0.value\"), 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>12 + p0.value, [\n                signal\n            ], \"12+p0.value\"), 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.address.city.name, [\n                store\n            ], \"p0.address.city.name\"), 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.address.city.name ? 'true' : 'false', [\n                store\n            ], 'p0.address.city.name?\"true\":\"false\"'), 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, dep, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, dep.thing, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, dep.thing + 'stuff', 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, globalThing, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, globalThing.thing, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, globalThing.thing + 'stuff', 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, signal.value(), 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, signal.value + unknown(), 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, mutable(signal), 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, signal.value + dep, 1, null)\n        ]\n    }, 1, \"u6_1\");\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(App_component_ckEPmXZlub0, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;AACA,SAAqB,QAAQ,EAAE,OAAO,QAAQ,mBAAmB;AAEjE,SAAQ,GAAG,QAAO,SAAS;0CAEW,CAAC;IACnC,qBACI;;0BACI,MAAC;gBAAI;gCAAU,EAAK,CAAC,UAAU;;;;0BAC/B,MAAC;gBAAI;gCAAQ,GAAM,KAAK;;;;;;AAGpC;AAPA,OAAO,MAAM,4BAAc,+GAOxB;kCAE2B;IAC1B,MAAM,SAAS,UAAU;IACzB,MAAM,QAAQ,SAAS,CAAC;IACxB,qBACI;;0BACI,MAAC,mBAAI;0BACL,MAAC,mBAAK,CAAC,IAAI,CAAC;0BACZ,MAAC,mBAAK;0BACN,MAAC,mBAAK;0BACN,MAAC,mBAAK,CAAC,IAAI,EAAE,IAAI;0BACjB,MAAC,mBAAK,OAAO,CAAC,IAAI,EAAE,IAAI,KAAK,WAAW,KAAK;0BAC7C,MAAC,mBAAK;0BACN,MAAC,mCAAK,GAAO,KAAK;;;0BAClB,MAAC,mCAAK,KAAK,GAAO,KAAK;;;0BACvB,MAAC,mCAAK,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI;;;0BAC7B,MAAC,mCAAK,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS;;;0BACzC,MAAC,mBAAK;0BACN,MAAC,mBAAK,IAAI,KAAK;0BACf,MAAC,mBAAK,IAAI,KAAK,GAAG;0BAClB,MAAC,mBAAK;0BACN,MAAC,mBAAK,YAAY,KAAK;0BACvB,MAAC,mBAAK,YAAY,KAAK,GAAG;0BAC1B,MAAC,mBAAK,OAAO,KAAK;0BAClB,MAAC,mBAAK,OAAO,KAAK,GAAG;0BACrB,MAAC,mBAAK,QAAQ;0BACd,MAAC,mBAAK,OAAO,KAAK,GAAG;;;AAGjC;AA5BA,OAAO,MAAM,oBAAM,+FA4BhB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_derived_signals_cmp.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2884\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\nimport {Cmp} from './cmp';\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <Cmp\n            staticText=\"text\"\n            staticText2={`text`}\n            staticNumber={1}\n            staticBoolean={true}\n            staticExpr={`text${12}`}\n            staticExpr2={typeof `text${12}` === 'string' ? 12 : 43}\n\n            signal={signal}\n            signalValue={signal.value}\n            signalComputedValue={12 + signal.value}\n\n            store={store.address.city.name}\n            storeComputed={store.address.city.name ? 'true' : 'false'}\n\n            dep={dep}\n            depAccess={dep.thing}\n            depComputed={dep.thing + 'stuff'}\n\n            global={globalThing}\n            globalAccess={globalThing.thing}\n            globalComputed={globalThing.thing + 'stuff'}\n\n\n            noInline={signal.value()}\n            noInline2={signal.value + unknown()}\n            noInline3={mutable(signal)}\n            noInline4={signal.value + dep}\n        />\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { useStore, mutable } from '@builder.io/qwik';\nimport { dep } from './file';\nimport { Cmp } from './cmp';\nconst App_component_ckEPmXZlub0 = ()=>{\n    const signal = useSignal(0);\n    const store = useStore({});\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        staticText: \"text\",\n        staticText2: `text`,\n        staticNumber: 1,\n        staticBoolean: true,\n        staticExpr: `text${12}`,\n        staticExpr2: typeof `text${12}` === 'string' ? 12 : 43,\n        signal: signal,\n        get signalValue () {\n            return signal.value;\n        },\n        get signalComputedValue () {\n            return 12 + signal.value;\n        },\n        get store () {\n            return store.address.city.name;\n        },\n        get storeComputed () {\n            return store.address.city.name ? 'true' : 'false';\n        },\n        dep: dep,\n        get depAccess () {\n            return dep.thing;\n        },\n        get depComputed () {\n            return dep.thing + 'stuff';\n        },\n        get global () {\n            return globalThing;\n        },\n        get globalAccess () {\n            return globalThing.thing;\n        },\n        get globalComputed () {\n            return globalThing.thing + 'stuff';\n        },\n        get noInline () {\n            return signal.value();\n        },\n        get noInline2 () {\n            return signal.value + unknown();\n        },\n        noInline3: mutable(signal),\n        noInline4: signal.value + dep,\n        [_IMMUTABLE]: {\n            staticText: _IMMUTABLE,\n            staticText2: _IMMUTABLE,\n            staticNumber: _IMMUTABLE,\n            staticBoolean: _IMMUTABLE,\n            staticExpr: _IMMUTABLE,\n            staticExpr2: _IMMUTABLE,\n            signal: _IMMUTABLE,\n            signalValue: _fnSignal((p0)=>p0.value, [\n                signal\n            ], \"p0.value\"),\n            signalComputedValue: _fnSignal((p0)=>12 + p0.value, [\n                signal\n            ], \"12+p0.value\"),\n            store: _fnSignal((p0)=>p0.address.city.name, [\n                store\n            ], \"p0.address.city.name\"),\n            storeComputed: _fnSignal((p0)=>p0.address.city.name ? 'true' : 'false', [\n                store\n            ], 'p0.address.city.name?\"true\":\"false\"'),\n            dep: _IMMUTABLE,\n            depAccess: _IMMUTABLE,\n            depComputed: _IMMUTABLE,\n            global: _IMMUTABLE,\n            globalAccess: _IMMUTABLE,\n            globalComputed: _IMMUTABLE,\n            noInline: _fnSignal((p0)=>p0.value(), [\n                signal\n            ], \"p0.value()\"),\n            noInline2: _fnSignal((p0)=>p0.value + unknown(), [\n                signal\n            ], \"p0.value+unknown()\")\n        }\n    }, 3, \"u6_0\");\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(App_component_ckEPmXZlub0, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;AACA,SAAqB,QAAQ,EAAE,OAAO,QAAQ,mBAAmB;AAEjE,SAAQ,GAAG,QAAO,SAAS;AAC3B,SAAQ,GAAG,QAAO,QAAQ;kCAEI;IAC1B,MAAM,SAAS,UAAU;IACzB,MAAM,QAAQ,SAAS,CAAC;IACxB,qBACI,MAAC;QACG,YAAW;QACX,aAAa,CAAC,IAAI,CAAC;QACnB,cAAc;QACd,eAAe;QACf,YAAY,CAAC,IAAI,EAAE,IAAI;QACvB,aAAa,OAAO,CAAC,IAAI,EAAE,IAAI,KAAK,WAAW,KAAK;QAEpD,QAAQ;YACR;mBAAa,OAAO,KAAK;;YACzB;mBAAqB,KAAK,OAAO,KAAK;;YAEtC;mBAAO,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI;;YAC9B;mBAAe,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS;;QAElD,KAAK;YACL;mBAAW,IAAI,KAAK;;YACpB;mBAAa,IAAI,KAAK,GAAG;;YAEzB;mBAAQ;;YACR;mBAAc,YAAY,KAAK;;YAC/B;mBAAgB,YAAY,KAAK,GAAG;;YAGpC;mBAAU,OAAO,KAAK;;YACtB;mBAAW,OAAO,KAAK,GAAG;;QAC1B,WAAW,QAAQ;QACnB,WAAW,OAAO,KAAK,GAAG;;YA1B1B,UAAU;YACV,WAAW;YACX,YAAY;YACZ,aAAa;YACb,UAAU;YACV,WAAW;YAEX,MAAM;YACN,WAAW,kBAAE,GAAO,KAAK;;;YACzB,mBAAmB,kBAAE,KAAK,GAAO,KAAK;;;YAEtC,KAAK,kBAAE,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI;;;YAC9B,aAAa,kBAAE,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS;;;YAElD,GAAG;YACH,SAAS;YACT,WAAW;YAEX,MAAM;YACN,YAAY;YACZ,cAAc;YAGd,QAAQ,kBAAE,GAAO,KAAK;;;YACtB,SAAS,kBAAE,GAAO,KAAK,GAAG;;;;;AAKtC;AAlCA,OAAO,MAAM,oBAAM,+FAkChB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_derived_signals_complext_children.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2852\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <>\n            <ul id=\"issue-2800-result\">\n                {Object.entries(store).map(([key, value]) => (\n                <li>\n                    {key} - {value}\n                </li>\n                ))}\n            </ul>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { useStore } from '@builder.io/qwik';\nconst App_component_ckEPmXZlub0 = ()=>{\n    useSignal(0);\n    const store = useStore({});\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: /*#__PURE__*/ _jsxQ(\"ul\", null, {\n            id: \"issue-2800-result\"\n        }, Object.entries(store).map(([key, value])=>/*#__PURE__*/ _jsxQ(\"li\", null, null, [\n                key,\n                \" - \",\n                value\n            ], 1, \"u6_0\")), 1, null)\n    }, 1, \"u6_1\");\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(App_component_ckEPmXZlub0, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;AACA,SAAqB,QAAQ,QAAiB,mBAAmB;kCAInC;IACX,UAAU;IACzB,MAAM,QAAQ,SAAS,CAAC;IACxB,qBACI;kBACI,cAAA,MAAC;YAAG,IAAG;WACF,OAAO,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,iBACxC,MAAC;gBACI;gBAAI;gBAAI;;;AAM7B;AAdA,OAAO,MAAM,oBAAM,+FAchB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_derived_signals_div.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2663\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\nimport styles from './styles.module.css';\n\nexport const App = component$((props) => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    const count = props.counter.count;\n\n    return (\n        <div\n            class={{\n                even: count % 2 === 0,\n                odd: count % 2 === 1,\n                stable0: true,\n                hidden: false,\n            }}\n            staticClass={styles.foo}\n            staticDocument={window.document}\n            staticText=\"text\"\n            staticText2={`text`}\n            staticNumber={1}\n            staticBoolean={true}\n            staticExpr={`text${12}`}\n            staticExpr2={typeof `text${12}` === 'string' ? 12 : 43}\n\n            signal={signal}\n            signalValue={signal.value}\n            signalComputedValue={12 + signal.value}\n\n            store={store.address.city.name}\n            storeComputed={store.address.city.name ? 'true' : 'false'}\n\n            dep={dep}\n            depAccess={dep.thing}\n            depComputed={dep.thing + 'stuff'}\n\n            global={globalThing}\n            globalAccess={globalThing.thing}\n            globalComputed={globalThing.thing + 'stuff'}\n\n\n            noInline={signal.value()}\n            noInline2={signal.value + unknown()}\n            noInline3={mutable(signal)}\n            noInline4={signal.value + dep}\n        />\n\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { useStore, mutable } from '@builder.io/qwik';\nimport { dep } from './file';\nimport styles from './styles.module.css';\nconst App_component_ckEPmXZlub0 = (props)=>{\n    const signal = useSignal(0);\n    const store = useStore({});\n    const count = props.counter.count;\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        class: {\n            even: count % 2 === 0,\n            odd: count % 2 === 1,\n            stable0: true,\n            hidden: false\n        },\n        noInline3: mutable(signal),\n        noInline4: signal.value + dep\n    }, {\n        staticClass: styles.foo,\n        staticDocument: window.document,\n        staticText: \"text\",\n        staticText2: `text`,\n        staticNumber: 1,\n        staticBoolean: true,\n        staticExpr: `text${12}`,\n        staticExpr2: typeof `text${12}` === 'string' ? 12 : 43,\n        signal: signal,\n        signalValue: _fnSignal((p0)=>p0.value, [\n            signal\n        ], \"p0.value\"),\n        signalComputedValue: _fnSignal((p0)=>12 + p0.value, [\n            signal\n        ], \"12+p0.value\"),\n        store: _fnSignal((p0)=>p0.address.city.name, [\n            store\n        ], \"p0.address.city.name\"),\n        storeComputed: _fnSignal((p0)=>p0.address.city.name ? 'true' : 'false', [\n            store\n        ], 'p0.address.city.name?\"true\":\"false\"'),\n        dep: dep,\n        depAccess: dep.thing,\n        depComputed: dep.thing + 'stuff',\n        global: globalThing,\n        globalAccess: globalThing.thing,\n        globalComputed: globalThing.thing + 'stuff',\n        noInline: _fnSignal((p0)=>p0.value(), [\n            signal\n        ], \"p0.value()\"),\n        noInline2: _fnSignal((p0)=>p0.value + unknown(), [\n            signal\n        ], \"p0.value+unknown()\")\n    }, null, 3, \"u6_0\");\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(App_component_ckEPmXZlub0, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;AACA,SAAqB,QAAQ,EAAE,OAAO,QAAQ,mBAAmB;AAEjE,SAAQ,GAAG,QAAO,SAAS;AAC3B,OAAO,YAAY,sBAAsB;kCAEX,CAAC;IAC3B,MAAM,SAAS,UAAU;IACzB,MAAM,QAAQ,SAAS,CAAC;IACxB,MAAM,QAAQ,MAAM,OAAO,CAAC,KAAK;IAEjC,qBACI,MAAC;QACG,OAAO;YACH,MAAM,QAAQ,MAAM;YACpB,KAAK,QAAQ,MAAM;YACnB,SAAS;YACT,QAAQ;QACZ;QA4BA,WAAW,QAAQ;QACnB,WAAW,OAAO,KAAK,GAAG;;QA5B1B,aAAa,OAAO,GAAG;QACvB,gBAAgB,OAAO,QAAQ;QAC/B,YAAW;QACX,aAAa,CAAC,IAAI,CAAC;QACnB,cAAc;QACd,eAAe;QACf,YAAY,CAAC,IAAI,EAAE,IAAI;QACvB,aAAa,OAAO,CAAC,IAAI,EAAE,IAAI,KAAK,WAAW,KAAK;QAEpD,QAAQ;QACR,WAAW,kBAAE,GAAO,KAAK;;;QACzB,mBAAmB,kBAAE,KAAK,GAAO,KAAK;;;QAEtC,KAAK,kBAAE,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI;;;QAC9B,aAAa,kBAAE,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS;;;QAElD,KAAK;QACL,WAAW,IAAI,KAAK;QACpB,aAAa,IAAI,KAAK,GAAG;QAEzB,QAAQ;QACR,cAAc,YAAY,KAAK;QAC/B,gBAAgB,YAAY,KAAK,GAAG;QAGpC,QAAQ,kBAAE,GAAO,KAAK;;;QACtB,SAAS,kBAAE,GAAO,KAAK,GAAG;;;;AAMtC;AA7CA,OAAO,MAAM,oBAAM,+FA6ChB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_derived_signals_multiple_children.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2806\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <>\n            <div>First text</div>\n            <div>First {`text`}</div>\n            <div>First {1}</div>\n            <div>First {true}</div>\n            <div>First {`text${12}`}</div>\n            <div>First {typeof `text${12}` === 'string' ? 12 : 43}</div>\n            <div>First {signal}</div>\n            <div>First {signal.value}</div>\n            <div>First {12 + signal.value}</div>\n            <div>First {store.address.city.name}</div>\n            <div>First {store.address.city.name ? 'true' : 'false'}</div>\n            <div>First {dep}</div>\n            <div>First {dep.thing}</div>\n            <div>First {dep.thing + 'stuff'}</div>\n            <div>First {globalThing}</div>\n            <div>First {globalThing.thing}</div>\n            <div>First {globalThing.thing + 'stuff'}</div>\n            <div>First {signal.value()}</div>\n            <div>First {signal.value + unknown()}</div>\n            <div>First {mutable(signal)}</div>\n            <div>First {signal.value + dep}</div>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { useStore, mutable } from '@builder.io/qwik';\nimport { dep } from './file';\nconst App_component_ckEPmXZlub0 = ()=>{\n    const signal = useSignal(0);\n    const store = useStore({});\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, \"First text\", 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                `text`\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                1\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                true\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                `text${12}`\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                typeof `text${12}` === 'string' ? 12 : 43\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                signal\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                _fnSignal((p0)=>p0.value, [\n                    signal\n                ], \"p0.value\")\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                _fnSignal((p0)=>12 + p0.value, [\n                    signal\n                ], \"12+p0.value\")\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                _fnSignal((p0)=>p0.address.city.name, [\n                    store\n                ], \"p0.address.city.name\")\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                _fnSignal((p0)=>p0.address.city.name ? 'true' : 'false', [\n                    store\n                ], 'p0.address.city.name?\"true\":\"false\"')\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                dep\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                dep.thing\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                dep.thing + 'stuff'\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                globalThing\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                globalThing.thing\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                globalThing.thing + 'stuff'\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                signal.value()\n            ], 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                signal.value + unknown()\n            ], 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                mutable(signal)\n            ], 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"First \",\n                signal.value + dep\n            ], 1, null)\n        ]\n    }, 1, \"u6_0\");\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(App_component_ckEPmXZlub0, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;AACA,SAAqB,QAAQ,EAAE,OAAO,QAAQ,mBAAmB;AAEjE,SAAQ,GAAG,QAAO,SAAS;kCAEG;IAC1B,MAAM,SAAS,UAAU;IACzB,MAAM,QAAQ,SAAS,CAAC;IACxB,qBACI;;0BACI,MAAC,mBAAI;0BACL,MAAC;gBAAI;gBAAO,CAAC,IAAI,CAAC;;0BAClB,MAAC;gBAAI;gBAAO;;0BACZ,MAAC;gBAAI;gBAAO;;0BACZ,MAAC;gBAAI;gBAAO,CAAC,IAAI,EAAE,IAAI;;0BACvB,MAAC;gBAAI;gBAAO,OAAO,CAAC,IAAI,EAAE,IAAI,KAAK,WAAW,KAAK;;0BACnD,MAAC;gBAAI;gBAAO;;0BACZ,MAAC;gBAAI;gCAAO,GAAO,KAAK;;;;0BACxB,MAAC;gBAAI;gCAAO,KAAK,GAAO,KAAK;;;;0BAC7B,MAAC;gBAAI;gCAAO,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI;;;;0BACnC,MAAC;gBAAI;gCAAO,GAAM,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS;;;;0BAC/C,MAAC;gBAAI;gBAAO;;0BACZ,MAAC;gBAAI;gBAAO,IAAI,KAAK;;0BACrB,MAAC;gBAAI;gBAAO,IAAI,KAAK,GAAG;;0BACxB,MAAC;gBAAI;gBAAO;;0BACZ,MAAC;gBAAI;gBAAO,YAAY,KAAK;;0BAC7B,MAAC;gBAAI;gBAAO,YAAY,KAAK,GAAG;;0BAChC,MAAC;gBAAI;gBAAO,OAAO,KAAK;;0BACxB,MAAC;gBAAI;gBAAO,OAAO,KAAK,GAAG;;0BAC3B,MAAC;gBAAI;gBAAO,QAAQ;;0BACpB,MAAC;gBAAI;gBAAO,OAAO,KAAK,GAAG;;;;AAGvC;AA5BA,OAAO,MAAM,oBAAM,+FA4BhB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_dev_mode.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2188\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrlDEV } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrlDEV(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\", {\n    file: \"/user/qwik/src/test.tsx\",\n    lo: 90,\n    hi: 229,\n    displayName: \"test.tsx_App_component\"\n}));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM;;;;;IAMhB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrlDEV } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\",\n            onClick$: /*#__PURE__*/ qrlDEV(()=>import(\"./test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto\"), \"App_component_Cmp_p_onClick_vuXzfUTkpto\", {\n                file: \"/user/qwik/src/test.tsx\",\n                lo: 164,\n                hi: 189,\n                displayName: \"test.tsx_App_component_Cmp_p_onClick\"\n            })\n        }, \"Hello Qwik\", 3, null, {\n            fileName: \"test.tsx\",\n            lineNumber: 7,\n            columnNumber: 13\n        })\n    }, 3, \"u6_0\", {\n        fileName: \"test.tsx\",\n        lineNumber: 6,\n        columnNumber: 9\n    });\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;yCAG8B;IAC1B,qBACI,MAAC;kBACG,cAAA,MAAC;YAAE,OAAM;YAAQ,QAAQ;;;;;;WAA6B;;;;;;;;;;AAGlE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    90,\n    229\n  ]\n}\n*/\n============================= test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto.js (ENTRY POINT)==\n\nexport const App_component_Cmp_p_onClick_vuXzfUTkpto = ()=>console.log('warn');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"uDAMuC,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_Cmp_p_onClick_vuXzfUTkpto\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_Cmp_p_onClick\",\n  \"hash\": \"vuXzfUTkpto\",\n  \"canonicalFilename\": \"test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    164,\n    189\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_dev_mode_inlined.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2210\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrlDEV } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrlDEV(()=>{\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\",\n            onClick$: /*#__PURE__*/ inlinedQrlDEV(()=>console.log('warn'), \"App_component_Cmp_p_onClick_vuXzfUTkpto\", {\n                file: \"/user/qwik/src/test.tsx\",\n                lo: 164,\n                hi: 189,\n                displayName: \"test.tsx_App_component_Cmp_p_onClick\"\n            })\n        }, \"Hello Qwik\", 3, null, {\n            fileName: \"test.tsx\",\n            lineNumber: 7,\n            columnNumber: 13\n        })\n    }, 3, \"u6_0\", {\n        fileName: \"test.tsx\",\n        lineNumber: 6,\n        columnNumber: 9\n    });\n}, \"App_component_ckEPmXZlub0\", {\n    file: \"/user/qwik/src/test.tsx\",\n    lo: 90,\n    hi: 229,\n    displayName: \"test.tsx_App_component\"\n}));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;AAGA,OAAO,MAAM,oBAAM,yCAAW;IAC1B,qBACI,MAAC;kBACG,cAAA,MAAC;YAAE,OAAM;YAAQ,QAAQ,8BAAE,IAAM,QAAQ,GAAG,CAAC;;;;;;WAAS;;;;;;;;;;AAGlE;;;;;IAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_drop_side_effects.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 711\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\nimport { clientSupabase } from 'supabase';\nimport { Client } from 'openai';\nimport { secret } from './secret';\nimport { sideEffect } from './secret';\n\nconst supabase = clientSupabase();\nconst dfd = new Client(secret);\n\n(function() {\n    console.log('run');\n  })();\n  (() => {\n    console.log('run');\n  })();\n\nsideEffect();\n\nexport const api = server$(() => {\n    supabase.from('ffg').do(dfd);\n});\n\nexport default component$(() => {\n    return (\n      <button onClick$={() => await api()}></button>\n    )\n  });\n\n============================= test.js ==\n\nimport { serverQrl } from \"@builder.io/qwik-city\";\nimport { _noopQrlDEV } from \"@builder.io/qwik\";\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrlDEV } from \"@builder.io/qwik\";\nimport { sideEffect } from './secret';\n(function() {\n    console.log('run');\n})();\n(()=>{\n    console.log('run');\n})();\nsideEffect();\nexport const api = serverQrl(/*#__PURE__*/ _noopQrlDEV(\"api_server_JonPp043gH0\", {\n    file: \"/user/qwik/src/test.tsx\",\n    lo: 0,\n    hi: 0,\n    displayName: \"test.tsx_api_server\"\n}));\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrlDEV(()=>import(\"./test.tsx_test_component_LUXeXe0DQrg\"), \"test_component_LUXeXe0DQrg\", {\n    file: \"/user/qwik/src/test.tsx\",\n    lo: 522,\n    hi: 605,\n    displayName: \"test.tsx_test_component\"\n}));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;AAMA,SAAS,UAAU,QAAQ,WAAW;AAKtC,CAAC;IACG,QAAQ,GAAG,CAAC;AACd,CAAC;AACD,CAAC;IACC,QAAQ,GAAG,CAAC;AACd,CAAC;AAEH;AAEA,OAAO,MAAM,MAAM;;;;;IAEhB;AAEH,6BAAe;;;;;IAIV\\\"}\")\n============================= test.tsx_test_component_button_onClick_DGk9xLyRokA.js (ENTRY POINT)==\n\nimport { api } from \"./test\";\nexport const test_component_button_onClick_DGk9xLyRokA = ()=>await api();\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yDA0BwB,IAAM,MAAM\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_button_onClick_DGk9xLyRokA\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component_button_onClick\",\n  \"hash\": \"DGk9xLyRokA\",\n  \"canonicalFilename\": \"test.tsx_test_component_button_onClick_DGk9xLyRokA\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"test_component_LUXeXe0DQrg\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    567,\n    584\n  ]\n}\n*/\n============================= test.tsx_test_component_LUXeXe0DQrg.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrlDEV } from \"@builder.io/qwik\";\nexport const test_component_LUXeXe0DQrg = ()=>{\n    return /*#__PURE__*/ _jsxQ(\"button\", null, {\n        onClick$: /*#__PURE__*/ qrlDEV(()=>import(\"./test.tsx_test_component_button_onClick_DGk9xLyRokA\"), \"test_component_button_onClick_DGk9xLyRokA\", {\n            file: \"/user/qwik/src/test.tsx\",\n            lo: 567,\n            hi: 584,\n            displayName: \"test.tsx_test_component_button_onClick\"\n        })\n    }, null, 3, \"u6_0\", {\n        fileName: \"test.tsx\",\n        lineNumber: 27,\n        columnNumber: 7\n    });\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;0CAwB0B;IACtB,qBACE,MAAC;QAAO,QAAQ;;;;;;;;;;;AAEpB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_LUXeXe0DQrg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component\",\n  \"hash\": \"LUXeXe0DQrg\",\n  \"canonicalFilename\": \"test.tsx_test_component_LUXeXe0DQrg\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    522,\n    605\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_no_transpile.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1303\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, $, useStyles$ } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    useStyles$('hola');\n    return $(() => (\n        <div></div>\n    ));\n});\n\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0.tsx\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,qHAKhB\\\"}\")\n============================= test.tsx_App_component_useStyles_t35nSa5UV7U.tsx ==\n\nexport const App_component_useStyles_t35nSa5UV7U = 'hola';\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"mDAIe\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_useStyles_t35nSa5UV7U\",\n  \"entry\": \"entry_segments\",\n  \"displayName\": \"test.tsx_App_component_useStyles\",\n  \"hash\": \"t35nSa5UV7U\",\n  \"canonicalFilename\": \"test.tsx_App_component_useStyles_t35nSa5UV7U\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useStyles$\",\n  \"captures\": false,\n  \"loc\": [\n    123,\n    129\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.tsx ==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStylesQrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    useStylesQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_useStyles_t35nSa5UV7U.tsx\"), \"App_component_useStyles_t35nSa5UV7U\"));\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_1_w0t0o3QMovU.tsx\"), \"App_component_1_w0t0o3QMovU\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAG8B,CAAC;IAC3B;IACA;AAGJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": \"entry_segments\",\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    95,\n    182\n  ]\n}\n*/\n============================= test.tsx_App_component_1_w0t0o3QMovU.tsx ==\n\nexport const App_component_1_w0t0o3QMovU = ()=><div></div>;\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"2CAKa,KACJ,MAAM\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_1_w0t0o3QMovU\",\n  \"entry\": \"entry_segments\",\n  \"displayName\": \"test.tsx_App_component_1\",\n  \"hash\": \"w0t0o3QMovU\",\n  \"canonicalFilename\": \"test.tsx_App_component_1_w0t0o3QMovU\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    145,\n    178\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_transpile.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1282\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, $, useStyles$ } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    useStyles$('hola');\n    return $(() => (\n        <div></div>\n    ));\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0.js\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,oHAKhB\\\"}\")\n============================= test.tsx_App_component_useStyles_t35nSa5UV7U.js (ENTRY POINT)==\n\nexport const App_component_useStyles_t35nSa5UV7U = 'hola';\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"mDAIe\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_useStyles_t35nSa5UV7U\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_useStyles\",\n  \"hash\": \"t35nSa5UV7U\",\n  \"canonicalFilename\": \"test.tsx_App_component_useStyles_t35nSa5UV7U\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useStyles$\",\n  \"captures\": false,\n  \"loc\": [\n    123,\n    129\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStylesQrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    useStylesQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_useStyles_t35nSa5UV7U.js\"), \"App_component_useStyles_t35nSa5UV7U\"));\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_1_w0t0o3QMovU.js\"), \"App_component_1_w0t0o3QMovU\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAG8B,CAAC;IAC3B;IACA;AAGJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    95,\n    182\n  ]\n}\n*/\n============================= test.tsx_App_component_1_w0t0o3QMovU.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_1_w0t0o3QMovU = ()=>/*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_0\");\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";2CAKa,kBACL,MAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_1_w0t0o3QMovU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_1\",\n  \"hash\": \"w0t0o3QMovU\",\n  \"canonicalFilename\": \"test.tsx_App_component_1_w0t0o3QMovU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    145,\n    178\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_export_issue.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2298\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nconst App = component$(() => {\n    return (\n        <div>hola</div>\n    );\n});\n\n\nexport const Root = component$((props: Stuff) => {\n    return (\n        <App/>\n    );\n});\n\nconst Other = 12;\nexport { Other as App };\n\nexport default App;\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nconst App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\nexport const Root = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Root_component_royhjYaCbYE\"), \"Root_component_royhjYaCbYE\"));\nconst Other = 12;\nexport { Other as App };\nexport default App;\nexport { App as _auto_App };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,MAAM,oBAAM;AAOZ,OAAO,MAAM,qBAAO,mHAIjB;AAEH,MAAM,QAAQ;AACd,SAAS,SAAS,GAAG,GAAG;AAExB,eAAe,IAAI\\\"}\")\n============================= test.tsx_Root_component_royhjYaCbYE.js (ENTRY POINT)==\n\nimport { _auto_App as App } from \"./test\";\nimport { _jsxC } from \"@builder.io/qwik\";\nexport const Root_component_royhjYaCbYE = (props)=>{\n    return /*#__PURE__*/ _jsxC(App, null, 3, \"u6_1\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;0CAU+B,CAAC;IAC5B,qBACI,MAAC;AAET\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Root_component_royhjYaCbYE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Root_component\",\n  \"hash\": \"royhjYaCbYE\",\n  \"canonicalFilename\": \"test.tsx_Root_component_royhjYaCbYE\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    162,\n    218\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, \"hola\", 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAGuB;IACnB,qBACI,MAAC,mBAAI;AAEb\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    73,\n    126\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_exports.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 985\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const [a, {b, v1: [c], d=v2, ...e}, f=v3, ...g] = obj;\n\nconst exp1 = 1;\nconst internal = 2;\nexport {exp1, internal as expr2};\n\nexport function foo() { }\nexport class bar {}\n\nexport default function DefaultFn() {}\n\nexport const Header = component$(() => {\n    return $(() => (\n        <Footer>\n            <div>{a}{b}{c}{d}{e}{f}{exp1}{internal}{foo}{bar}{DefaultFn}</div>\n            <div>{v1}{v2}{v3}{obj}</div>\n        </Footer>\n    ))\n});\n\nexport const Footer = component$();\n\n============================= project/test.tsx_Header_component_UVBJuFYfvDo.jsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Header_component_UVBJuFYfvDo = ()=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_1_uWM1kg0IGO0\"), \"Header_component_1_uWM1kg0IGO0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAciC;IAC7B;AAMJ\\\"}\")\n/*\n{\n  \"origin\": \"project/test.tsx\",\n  \"name\": \"Header_component_UVBJuFYfvDo\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"UVBJuFYfvDo\",\n  \"canonicalFilename\": \"test.tsx_Header_component_UVBJuFYfvDo\",\n  \"path\": \"project\",\n  \"extension\": \"jsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    307,\n    499\n  ]\n}\n*/\n============================= project/test.jsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const [a, { b, v1: [c], d = v2, ...e }, f = v3, ...g] = obj;\nconst exp1 = 1;\nconst internal = 2;\nexport { exp1, internal as expr2 };\nexport function foo() {}\nexport class bar {\n}\nexport default function DefaultFn() {}\nexport const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_UVBJuFYfvDo\"), \"Header_component_UVBJuFYfvDo\"));\nexport const Footer = /*#__PURE__*/ componentQrl();\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,CAAC,GAAG,EAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,IAAE,EAAE,EAAE,GAAG,GAAE,EAAE,IAAE,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;AAE7D,MAAM,OAAO;AACb,MAAM,WAAW;AACjB,SAAQ,IAAI,EAAE,YAAY,KAAK,GAAE;AAEjC,OAAO,SAAS,OAAQ;AACxB,OAAO,MAAM;AAAK;AAElB,eAAe,SAAS,aAAa;AAErC,OAAO,MAAM,uBAAS,uHAOnB;AAEH,OAAO,MAAM,uBAAS,eAAa\\\"}\")\n============================= project/test.tsx_Header_component_1_uWM1kg0IGO0.jsx (ENTRY POINT)==\n\nimport { default as DefaultFn } from \"./test\";\nimport { Footer } from \"./test\";\nimport { a } from \"./test\";\nimport { b } from \"./test\";\nimport { bar } from \"./test\";\nimport { c } from \"./test\";\nimport { d } from \"./test\";\nimport { e } from \"./test\";\nimport { exp1 } from \"./test\";\nimport { f } from \"./test\";\nimport { foo } from \"./test\";\nimport { expr2 as internal } from \"./test\";\nexport const Header_component_1_uWM1kg0IGO0 = ()=><Footer>\n            <div>{a}{b}{c}{d}{e}{f}{exp1}{internal}{foo}{bar}{DefaultFn}</div>\n            <div>{v1}{v2}{v3}{obj}</div>\n        </Footer>;\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;;;8CAea,KACJ,OAAO;YACJ,CAAC,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,UAAU,KAAK,KAAK,YAAY,IAAI;YAClE,CAAC,KAAK,IAAI,IAAI,IAAI,MAAM,IAAI;QAChC,EAAE\\\"}\")\n/*\n{\n  \"origin\": \"project/test.tsx\",\n  \"name\": \"Header_component_1_uWM1kg0IGO0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component_1\",\n  \"hash\": \"uWM1kg0IGO0\",\n  \"canonicalFilename\": \"test.tsx_Header_component_1_uWM1kg0IGO0\",\n  \"path\": \"project\",\n  \"extension\": \"jsx\",\n  \"parent\": \"Header_component_UVBJuFYfvDo\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    328,\n    496\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_fix_dynamic_import.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1170\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\nimport thing from \"../state\";\n\nexport function foo() {\n    return import(\"../foo/state2\")\n}\n\nexport const Header = component$(() => {\n    return (\n        <div>\n            {import(\"../folder/state3\")}\n            {thing}\n        </div>\n    );\n});\n\n============================= project/folder/test.tsx_Header_component_RGgm7Ks9QWI.tsx ==\n\nimport thing from \"../state\";\nexport const Header_component_RGgm7Ks9QWI = ()=>{\n    return <div>\n            {import(\"../folder/state3\")}\n            {thing}\n        </div>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/folder/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAQiC;IAC7B,QACK,IAAI;YACD,CAAC,MAAM,CAAC,oBAAoB;YAC5B,CAAC,MAAM;QACX,EAAE;AAEV\\\"}\")\n/*\n{\n  \"origin\": \"project/folder/test.tsx\",\n  \"name\": \"Header_component_RGgm7Ks9QWI\",\n  \"entry\": \"entry_segments\",\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"RGgm7Ks9QWI\",\n  \"canonicalFilename\": \"test.tsx_Header_component_RGgm7Ks9QWI\",\n  \"path\": \"project/folder\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    178,\n    297\n  ]\n}\n*/\n============================= project/folder/test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport function foo() {\n    return import(\"../foo/state2\");\n}\nexport const Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_RGgm7Ks9QWI\"), \"Header_component_RGgm7Ks9QWI\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/folder/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAIA,OAAO,SAAS;IACZ,OAAO,MAAM,CAAC;AAClB;AAEA,OAAO,MAAM,uBAAS,uHAOnB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 328\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useStore } from '@builder.io/qwik';\nconst Header = component$(() => {\n    const thing = useStore();\n    const {foo, bar} = foo();\n\n    return (\n        <div>{thing}</div>\n    );\n});\n\n============================= test.tsx_Header_component_J4uyIhaBNR4.tsx (ENTRY POINT)==\n\nimport { useStore } from \"@builder.io/qwik\";\nexport const Header_component_J4uyIhaBNR4 = ()=>{\n    const thing = useStore();\n    const { foo, bar } = foo();\n    return <div>{thing}</div>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAE0B;IACtB,MAAM,QAAQ;IACd,MAAM,EAAC,GAAG,EAAE,GAAG,EAAC,GAAG;IAEnB,QACK,KAAK,QAAQ;AAEtB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Header_component_J4uyIhaBNR4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Header_component\",\n  \"hash\": \"J4uyIhaBNR4\",\n  \"canonicalFilename\": \"test.tsx_Header_component_J4uyIhaBNR4\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    88,\n    205\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { $, component$, useStore } from '@builder.io/qwik';\nconst Header = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Header_component_J4uyIhaBNR4\"), \"Header_component_J4uyIhaBNR4\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AACA,SAAS,CAAC,EAAE,UAAU,EAAE,QAAQ,QAAQ,mBAAmB;AAC3D,MAAM,uBAAS\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_2.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 348\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useStore } from '@builder.io/qwik';\nexport const useCounter = () => {\n    return useStore({count: 0});\n}\n\nexport const STEP = 1;\n\nexport const App = component$((props) => {\n    const state = useCounter();\n    const thing = useStore({thing: 0});\n    const STEP_2 = 2;\n\n    const count2 = state.count * 2;\n    return (\n        <div onClick$={() => state.count+=count2 }>\n            <span>{state.count}</span>\n            {buttons.map(btn => (\n                <button\n                    onClick$={() => state.count += btn.offset + thing + STEP + STEP_2 + props.step}\n                >\n                    {btn.name}\n                </button>\n            ))}\n\n        </div>\n\n    );\n})\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from '@builder.io/qwik';\nexport const useCounter = ()=>{\n    return useStore({\n        count: 0\n    });\n};\nexport const STEP = 1;\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AACA,SAAwB,QAAQ,QAAQ,mBAAmB;AAC3D,OAAO,MAAM,aAAa;IACtB,OAAO,SAAS;QAAC,OAAO;IAAC;AAC7B,EAAC;AAED,OAAO,MAAM,OAAO,EAAE;AAEtB,OAAO,MAAM,oBAAM,iHAoBjB\\\"}\")\n============================= test.tsx_App_component_div_onClick_1CGetmFZx0g.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const App_component_div_onClick_1CGetmFZx0g = ()=>{\n    const [count2, state] = useLexicalScope();\n    return state.count += count2;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";qDAeuB;;WAAM,MAAM,KAAK,IAAE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_div_onClick_1CGetmFZx0g\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_div_onClick\",\n  \"hash\": \"1CGetmFZx0g\",\n  \"canonicalFilename\": \"test.tsx_App_component_div_onClick_1CGetmFZx0g\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    366,\n    391\n  ]\n}\n*/\n============================= test.tsx_App_component_div_button_onClick_f5NwW9e63a4.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { STEP } from \"./test\";\nexport const App_component_div_button_onClick_f5NwW9e63a4 = ()=>{\n    const [btn, props, state, thing] = useLexicalScope();\n    return state.count += btn.offset + thing + STEP + 2 + props.step;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;4DAmB8B;;WAAM,MAAM,KAAK,IAAI,IAAI,MAAM,GAAG,QAAQ,OARrD,IAQqE,MAAM,IAAI\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_div_button_onClick_f5NwW9e63a4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_div_button_onClick\",\n  \"hash\": \"f5NwW9e63a4\",\n  \"canonicalFilename\": \"test.tsx_App_component_div_button_onClick_f5NwW9e63a4\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    522,\n    590\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _wrapSignal } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useCounter } from \"./test\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    const state = useCounter();\n    const thing = useStore({\n        thing: 0\n    });\n    const count2 = state.count * 2;\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_div_onClick_1CGetmFZx0g\"), \"App_component_div_onClick_1CGetmFZx0g\", [\n            count2,\n            state\n        ])\n    }, null, [\n        /*#__PURE__*/ _jsxQ(\"span\", null, null, _fnSignal((p0)=>p0.count, [\n            state\n        ], \"p0.count\"), 3, null),\n        buttons.map((btn)=>/*#__PURE__*/ _jsxQ(\"button\", {\n                onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_div_button_onClick_f5NwW9e63a4\"), \"App_component_div_button_onClick_f5NwW9e63a4\", [\n                    btn,\n                    props,\n                    state,\n                    thing\n                ])\n            }, null, _wrapSignal(btn, \"name\"), 0, \"u6_0\"))\n    ], 0, \"u6_1\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;yCAQ8B,CAAC;IAC3B,MAAM,QAAQ;IACd,MAAM,QAAQ,SAAS;QAAC,OAAO;IAAC;IAGhC,MAAM,SAAS,MAAM,KAAK,GAAG;IAC7B,qBACI,MAAC;QAAI,QAAQ;;;;;sBACT,MAAC,oCAAM,GAAM,KAAK;;;QACjB,QAAQ,GAAG,CAAC,CAAA,oBACT,MAAC;gBACG,QAAQ;;;;;;iCAEP;;AAOrB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    186,\n    708\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_capture_props.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 388\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(({count, rest: [I2, {I3, v1: [I4], I5=v2, ...I6}, I7=v3, ...I8]}) => {\n    const state = useStore({count: 0});\n    const {rest: [C2, {C3, v1: [C4], C5=v2, ...C6}, C7=v3, ...C8]} = foo();\n    return $(() => {\n        return (\n            <div onClick$={() => state.count += count + total }>\n                {I2}{I3}{I4}{I5}{I6}{I7}{I8}\n                {C2}{C3}{C4}{C5}{C6}{C7}{C8}\n                {v1}{v2}{v3}\n            </div>\n        )\n    });\n})\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAYjB\\\"}\")\n============================= test.tsx_App_component_div_onClick_1CGetmFZx0g.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const App_component_div_onClick_1CGetmFZx0g = ()=>{\n    const [count, state] = useLexicalScope();\n    return state.count += count + total;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";qDAQ2B;;WAAM,MAAM,KAAK,IAAI,QAAQ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_div_onClick_1CGetmFZx0g\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_div_onClick\",\n  \"hash\": \"1CGetmFZx0g\",\n  \"canonicalFilename\": \"test.tsx_App_component_div_onClick_1CGetmFZx0g\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_1_w0t0o3QMovU\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    345,\n    379\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ({ count, rest: [I2, { I3, v1: [I4], I5 = v2, ...I6 }, I7 = v3, ...I8] })=>{\n    const state = useStore({\n        count: 0\n    });\n    const { rest: [C2, { C3, v1: [C4], C5 = v2, ...C6 }, C7 = v3, ...C8] } = foo();\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_1_w0t0o3QMovU\"), \"App_component_1_w0t0o3QMovU\", [\n        C2,\n        C3,\n        C4,\n        C5,\n        C6,\n        C7,\n        C8,\n        I2,\n        I3,\n        I4,\n        I5,\n        I6,\n        I7,\n        I8,\n        count,\n        state\n    ]);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAG8B,CAAC,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,KAAG,EAAE,EAAE,GAAG,IAAG,EAAE,KAAG,EAAE,EAAE,GAAG,GAAG,EAAC;IAC1F,MAAM,QAAQ,SAAS;QAAC,OAAO;IAAC;IAChC,MAAM,EAAC,MAAM,CAAC,IAAI,EAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,KAAG,EAAE,EAAE,GAAG,IAAG,EAAE,KAAG,EAAE,EAAE,GAAG,GAAG,EAAC,GAAG;IACjE;;;;;;;;;;;;;;;;;;AASJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    93,\n    540\n  ]\n}\n*/\n============================= test.tsx_App_component_1_w0t0o3QMovU.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App_component_1_w0t0o3QMovU = ()=>{\n    const [C2, C3, C4, C5, C6, C7, C8, I2, I3, I4, I5, I6, I7, I8, count, state] = useLexicalScope();\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_div_onClick_1CGetmFZx0g\"), \"App_component_div_onClick_1CGetmFZx0g\", [\n            count,\n            state\n        ])\n    }, null, [\n        I2,\n        I3,\n        I4,\n        I5,\n        I6,\n        I7,\n        I8,\n        C2,\n        C3,\n        C4,\n        C5,\n        C6,\n        C7,\n        C8,\n        v1,\n        v2,\n        v3\n    ], 0, \"u6_0\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;2CAMa;;IACL,qBACI,MAAC;QAAI,QAAQ;;;;;QACR;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QACxB;QAAI;QAAI;QAAI;QAAI;QAAI;QAAI;QACxB;QAAI;QAAI\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_1_w0t0o3QMovU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_1\",\n  \"hash\": \"w0t0o3QMovU\",\n  \"canonicalFilename\": \"test.tsx_App_component_1_w0t0o3QMovU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    293,\n    536\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_getter_generation.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2964\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    const store = useStore({\n        count: 0,\n        stuff: 0,\n        nested: {\n            count: 0\n        }\n    });\n    const signal = useSignal(0);\n    return (\n        <Cmp\n            prop={'true' + 1 ? 'true' : ''}\n            count={store.count}\n            nested={store.nested.count}\n            signal={signal}\n            store={store.stuff + 12}\n            value={signal.formData?.get('username')}\n        >\n        </Cmp>\n    );\n});\n\nexport const Cmp = component$((props) => {\n    return (\n        <>\n            <p data-value={props.count}>{props.nested.count}</p>\n            <p>Value {props.count}<span></span></p>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\nexport const Cmp = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Cmp_component_4ryKJTOKjWE\"), \"Cmp_component_4ryKJTOKjWE\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAoBhB;AAEH,OAAO,MAAM,oBAAM,iHAOhB\\\"}\")\n============================= test.tsx_Cmp_component_4ryKJTOKjWE.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const Cmp_component_4ryKJTOKjWE = (props)=>{\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"p\", null, {\n                \"data-value\": _fnSignal((p0)=>p0.count, [\n                    props\n                ], \"p0.count\")\n            }, _fnSignal((p0)=>p0.nested.count, [\n                props\n            ], \"p0.nested.count\"), 3, null),\n            /*#__PURE__*/ _jsxQ(\"p\", null, null, [\n                \"Value \",\n                _fnSignal((p0)=>p0.count, [\n                    props\n                ], \"p0.count\"),\n                /*#__PURE__*/ _jsxQ(\"span\", null, null, null, 3, null)\n            ], 3, null)\n        ]\n    }, 3, \"u6_1\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;yCAyB8B,CAAC;IAC3B,qBACI;;0BACI,MAAC;gBAAE,YAAU,kBAAE,GAAM,KAAK;;;+BAAG,GAAM,MAAM,CAAC,KAAK;;;0BAC/C,MAAC;gBAAE;gCAAO,GAAM,KAAK;;;8BAAC,MAAC;;;;AAGnC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Cmp_component_4ryKJTOKjWE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Cmp_component\",\n  \"hash\": \"4ryKJTOKjWE\",\n  \"canonicalFilename\": \"test.tsx_Cmp_component_4ryKJTOKjWE\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    580,\n    754\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { Cmp } from \"./test\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    const store = useStore({\n        count: 0,\n        stuff: 0,\n        nested: {\n            count: 0\n        }\n    });\n    const signal = useSignal(0);\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        prop: 'true',\n        get count () {\n            return store.count;\n        },\n        get nested () {\n            return store.nested.count;\n        },\n        signal: signal,\n        get store () {\n            return store.stuff + 12;\n        },\n        get value () {\n            return signal.formData?.get('username');\n        },\n        [_IMMUTABLE]: {\n            prop: _IMMUTABLE,\n            count: _fnSignal((p0)=>p0.count, [\n                store\n            ], \"p0.count\"),\n            nested: _fnSignal((p0)=>p0.nested.count, [\n                store\n            ], \"p0.nested.count\"),\n            signal: _IMMUTABLE,\n            store: _fnSignal((p0)=>p0.stuff + 12, [\n                store\n            ], \"p0.stuff+12\"),\n            value: _fnSignal((p0)=>p0.formData?.get('username'), [\n                signal\n            ], 'p0.formData?.get(\"username\")')\n        }\n    }, 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;yCAG8B;IAC1B,MAAM,QAAQ,SAAS;QACnB,OAAO;QACP,OAAO;QACP,QAAQ;YACJ,OAAO;QACX;IACJ;IACA,MAAM,SAAS,UAAU;IACzB,qBACI,MAAC;QACG,MAAmB;YACnB;mBAAO,MAAM,KAAK;;YAClB;mBAAQ,MAAM,MAAM,CAAC,KAAK;;QAC1B,QAAQ;YACR;mBAAO,MAAM,KAAK,GAAG;;YACrB;mBAAO,OAAO,QAAQ,EAAE,IAAI;;;YAL5B,IAAI;YACJ,KAAK,kBAAE,GAAM,KAAK;;;YAClB,MAAM,kBAAE,GAAM,MAAM,CAAC,KAAK;;;YAC1B,MAAM;YACN,KAAK,kBAAE,GAAM,KAAK,GAAG;;;YACrB,KAAK,kBAAE,GAAO,QAAQ,EAAE,IAAI;;;;;AAIxC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    90,\n    546\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_immutable_analysis.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2026\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, $ } from '@builder.io/qwik';\nimport importedValue from 'v';\nimport styles from './styles.module.css';\n\nexport const App = component$((props) => {\n    const {Model} = props;\n    const state = useStore({count: 0});\n    const remove = $((id: number) => {\n        const d = state.data;\n        d.splice(\n          d.findIndex((d) => d.id === id),\n          1\n        )\n      });\n    return (\n        <>\n            <p class=\"stuff\" onClick$={props.onClick$}>Hello Qwik</p>\n            <Div\n                class={styles.foo}\n                document={window.document}\n                onClick$={props.onClick$}\n                onEvent$={() => console.log('stuff')}\n                transparent$={() => {console.log('stuff')}}\n                immutable1=\"stuff\"\n                immutable2={{\n                    foo: 'bar',\n                    baz: importedValue ? true : false,\n                }}\n                immutable3={2}\n                immutable4$={(ev) => console.log(state.count)}\n                immutable5={[1, 2, importedValue, null, {}]}\n            >\n                <p>Hello Qwik</p>\n            </Div>\n            [].map(() => (\n                <Model\n                    class={state}\n                    remove$={remove}\n                    mutable1={{\n                        foo: 'bar',\n                        baz: state.count ? true : false,\n                    }}\n                    mutable2={(() => console.log(state.count))()}\n                    mutable3={[1, 2, state, null, {}]}\n                />\n            ));\n        </>\n    );\n});\n\n============================= test.tsx_App_component_Fragment_Div_onEvent_zrFduYbT3xM.js (ENTRY POINT)==\n\nexport const App_component_Fragment_Div_onEvent_zrFduYbT3xM = ()=>console.log('stuff');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"8DAsB0B,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_Fragment_Div_onEvent_zrFduYbT3xM\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_Fragment_Div_onEvent\",\n  \"hash\": \"zrFduYbT3xM\",\n  \"canonicalFilename\": \"test.tsx_App_component_Fragment_Div_onEvent_zrFduYbT3xM\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onEvent$\",\n  \"captures\": false,\n  \"loc\": [\n    665,\n    691\n  ]\n}\n*/\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAKA,OAAO,MAAM,oBAAM,iHA4ChB\\\"}\")\n============================= test.tsx_App_component_Fragment_Div_immutable4_2zF7jA3Yti0.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const App_component_Fragment_Div_immutable4_2zF7jA3Yti0 = (ev)=>{\n    const [state] = useLexicalScope();\n    return console.log(state.count);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";iEA8B6B,CAAC;;WAAO,QAAQ,GAAG,CAAC,MAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_Fragment_Div_immutable4_2zF7jA3Yti0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_Fragment_Div_immutable4\",\n  \"hash\": \"2zF7jA3Yti0\",\n  \"canonicalFilename\": \"test.tsx_App_component_Fragment_Div_immutable4_2zF7jA3Yti0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"immutable4$\",\n  \"captures\": true,\n  \"loc\": [\n    984,\n    1016\n  ]\n}\n*/\n============================= test.tsx_App_component_Fragment_Div_transparent_eeDEK6EM1oo.js (ENTRY POINT)==\n\nexport const App_component_Fragment_Div_transparent_eeDEK6EM1oo = ()=>{\n    console.log('stuff');\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"kEAuB8B;IAAO,QAAQ,GAAG,CAAC;AAAQ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_Fragment_Div_transparent_eeDEK6EM1oo\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_Fragment_Div_transparent\",\n  \"hash\": \"eeDEK6EM1oo\",\n  \"canonicalFilename\": \"test.tsx_App_component_Fragment_Div_transparent_eeDEK6EM1oo\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"transparent$\",\n  \"captures\": false,\n  \"loc\": [\n    723,\n    751\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport importedValue from \"v\";\nimport { qrl } from \"@builder.io/qwik\";\nimport styles from \"./styles.module.css\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    const state = useStore({\n        count: 0\n    });\n    const remove = /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_remove_pU6yOC5P6sY\"), \"App_component_remove_pU6yOC5P6sY\", [\n        state\n    ]);\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"p\", {\n                onClick$: props.onClick$\n            }, {\n                class: \"stuff\"\n            }, \"Hello Qwik\", 2, null),\n            /*#__PURE__*/ _jsxC(Div, {\n                get class () {\n                    return styles.foo;\n                },\n                get document () {\n                    return window.document;\n                },\n                onClick$: props.onClick$,\n                onEvent$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_Fragment_Div_onEvent_zrFduYbT3xM\"), \"App_component_Fragment_Div_onEvent_zrFduYbT3xM\"),\n                transparent$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_Fragment_Div_transparent_eeDEK6EM1oo\"), \"App_component_Fragment_Div_transparent_eeDEK6EM1oo\"),\n                immutable1: \"stuff\",\n                immutable2: {\n                    foo: 'bar',\n                    baz: importedValue ? true : false\n                },\n                immutable3: 2,\n                immutable4$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_Fragment_Div_immutable4_2zF7jA3Yti0\"), \"App_component_Fragment_Div_immutable4_2zF7jA3Yti0\", [\n                    state\n                ]),\n                immutable5: [\n                    1,\n                    2,\n                    importedValue,\n                    null,\n                    {}\n                ],\n                children: /*#__PURE__*/ _jsxQ(\"p\", null, null, \"Hello Qwik\", 3, null),\n                [_IMMUTABLE]: {\n                    class: _IMMUTABLE,\n                    document: _IMMUTABLE,\n                    onEvent$: _IMMUTABLE,\n                    transparent$: _IMMUTABLE,\n                    immutable1: _IMMUTABLE,\n                    immutable2: _IMMUTABLE,\n                    immutable3: _IMMUTABLE,\n                    immutable4$: _IMMUTABLE,\n                    immutable5: _IMMUTABLE\n                }\n            }, 2, \"u6_0\"),\n            \"[].map(() => (\",\n            /*#__PURE__*/ _jsxC(props.Model, {\n                class: state,\n                remove$: remove,\n                get mutable1 () {\n                    return {\n                        foo: 'bar',\n                        baz: state.count ? true : false\n                    };\n                },\n                mutable2: (()=>console.log(state.count))(),\n                mutable3: [\n                    1,\n                    2,\n                    state,\n                    null,\n                    {}\n                ],\n                [_IMMUTABLE]: {\n                    class: _IMMUTABLE,\n                    remove$: _IMMUTABLE,\n                    mutable1: _fnSignal((p0)=>({\n                            foo: 'bar',\n                            baz: p0.count ? true : false\n                        }), [\n                        state\n                    ], '{foo:\"bar\",baz:p0.count?true:false}'),\n                    mutable3: _IMMUTABLE\n                }\n            }, 3, \"u6_1\"),\n            \"));\"\n        ]\n    }, 1, \"u6_2\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;yCAK8B,CAAC;IAE3B,MAAM,QAAQ,SAAS;QAAC,OAAO;IAAC;IAChC,MAAM;;;IAON,qBACI;;0BACI,MAAC;gBAAgB,UAAU,MAAM,QAAQ;;gBAAtC,OAAM;eAAkC;0BAC3C,MAAC;oBACG;2BAAO,OAAO,GAAG;;oBACjB;2BAAU,OAAO,QAAQ;;gBACzB,UAAU,MAAM,QAAQ;gBACxB,QAAQ;gBACR,YAAY;gBACZ,YAAW;gBACX,YAAY;oBACR,KAAK;oBACL,KAAK,gBAAgB,OAAO;gBAChC;gBACA,YAAY;gBACZ,WAAW;;;gBACX,YAAY;oBAAC;oBAAG;oBAAG;oBAAe;oBAAM,CAAC;iBAAE;0BAE3C,cAAA,MAAC,iBAAE;;oBAdH,KAAK;oBACL,QAAQ;oBAER,QAAQ;oBACR,YAAY;oBACZ,UAAU;oBACV,UAAU;oBAIV,UAAU;oBACV,WAAW;oBACX,UAAU;;;YAGR;0BAEF,MA9BI,MAAT;gBA+BS,OAAO;gBACP,SAAS;oBACT;2BAAU;wBACN,KAAK;wBACL,KAAK,MAAM,KAAK,GAAG,OAAO;oBAC9B;;gBACA,UAAU,CAAC,IAAM,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC;gBACzC,UAAU;oBAAC;oBAAG;oBAAG;oBAAO;oBAAM,CAAC;iBAAE;;oBAPjC,KAAK;oBACL,OAAO;oBACP,QAAQ,kBAAE,CAAA;4BACN,KAAK;4BACL,KAAK,GAAM,KAAK,GAAG,OAAO;wBAC9B,CAAA;;;oBAEA,QAAQ;;;YACV;;;AAIlB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    166,\n    1591\n  ]\n}\n*/\n============================= test.tsx_App_component_remove_pU6yOC5P6sY.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const App_component_remove_pU6yOC5P6sY = (id)=>{\n    const [state] = useLexicalScope();\n    const d = state.data;\n    d.splice(d.findIndex((d)=>d.id === id), 1);\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";gDAQqB,CAAC;;IACd,MAAM,IAAI,MAAM,IAAI;IACpB,EAAE,MAAM,CACN,EAAE,SAAS,CAAC,CAAC,IAAM,EAAE,EAAE,KAAK,KAC5B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_remove_pU6yOC5P6sY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_remove\",\n  \"hash\": \"pU6yOC5P6sY\",\n  \"canonicalFilename\": \"test.tsx_App_component_remove_pU6yOC5P6sY\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    267,\n    405\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_immutable_function_components.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2492\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, Slot } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <div>\n            <Slot/>\n        </div>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { Slot } from '@builder.io/qwik';\nconst App_component_ckEPmXZlub0 = (props)=>{\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, /*#__PURE__*/ _jsxC(Slot, null, 3, \"u6_0\"), 1, \"u6_1\");\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(App_component_ckEPmXZlub0, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;AACA,SAA+B,IAAI,QAAQ,mBAAmB;kCAEhC,CAAC;IAC3B,qBACI,MAAC,iCACG,MAAC;AAGb;AANA,OAAO,MAAM,oBAAM,+FAMhB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_import_assertion.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1932\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, $ } from '@builder.io/qwik';\nimport json from \"./foo.json\" assert { type: \"json\" };\n\nexport const Greeter = component$(() => {\n    return json;\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Greeter = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Greeter_component_n7HuG2hhU0Q\"), \"Greeter_component_n7HuG2hhU0Q\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAIA,OAAO,MAAM,wBAAU,yHAEpB\\\"}\")\n============================= test.tsx_Greeter_component_n7HuG2hhU0Q.js (ENTRY POINT)==\n\nimport json from \"./foo.json\" with {\n    type: \"json\"\n};\nexport const Greeter_component_n7HuG2hhU0Q = ()=>{\n    return json;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"mCAEqC;IAAE,MAAM;AAAO;6CAElB;IAC9B,OAAO;AACX\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Greeter_component_n7HuG2hhU0Q\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Greeter_component\",\n  \"hash\": \"n7HuG2hhU0Q\",\n  \"canonicalFilename\": \"test.tsx_Greeter_component_n7HuG2hhU0Q\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    142,\n    168\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_inlined_entry_strategy.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1405\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useBrowserVisibleTask$, useStore, useStyles$ } from '@builder.io/qwik';\nimport { thing } from './sibling';\nimport mongodb from 'mongodb';\n\nexport const Child = component$(() => {\n\n    useStyles$('somestring');\n    const state = useStore({\n        count: 0\n    });\n\n    // Double count watch\n    useBrowserVisibleTask$(() => {\n        state.count = thing.doStuff() + import(\"./sibling\");\n    });\n\n    return (\n        <div onClick$={() => console.log(mongodb)}>\n        </div>\n    );\n});\n\n\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { useStylesQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { useBrowserVisibleTaskQrl } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { useStore } from '@builder.io/qwik';\nimport { thing } from './sibling';\nimport mongodb from 'mongodb';\nexport const Child = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    useStylesQrl(/*#__PURE__*/ inlinedQrl('somestring', \"Child_component_useStyles_qBZTuFM0160\"));\n    const state = useStore({\n        count: 0\n    });\n    // Double count watch\n    useBrowserVisibleTaskQrl(/*#__PURE__*/ inlinedQrl(()=>{\n        const [state] = useLexicalScope();\n        state.count = thing.doStuff() + import(\"./sibling\");\n    }, \"Child_component_useBrowserVisibleTask_0IGFPOyJmQA\", [\n        state\n    ]));\n    return <div onClick$={/*#__PURE__*/ inlinedQrl(()=>console.log(mongodb), \"Child_component_div_onClick_elliVSnAiOQ\")}>\n        </div>;\n}, \"Child_component_9GyF01GDKqw\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;AACA,SAA6C,QAAQ,QAAoB,mBAAmB;AAC5F,SAAS,KAAK,QAAQ,YAAY;AAClC,OAAO,aAAa,UAAU;AAE9B,OAAO,MAAM,sBAAQ,sCAAW;IAE5B,sCAAW;IACX,MAAM,QAAQ,SAAS;QACnB,OAAO;IACX;IAEA,qBAAqB;IACrB,kDAAuB;;QACnB,MAAM,KAAK,GAAG,MAAM,OAAO,KAAK,MAAM,CAAC;;;;IAG3C,QACK,IAAI,mCAAU,IAAM,QAAQ,GAAG,CAAC,sDAAU;QAC3C,EAAE;AAEV,mCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_input_bind.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1901\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, $ } from '@builder.io/qwik';\n\nexport const Greeter = component$(() => {\n    const value = useSignal(0);\n    const checked = useSignal(false);\n    const stuff = useSignal();\n    return (\n        <>\n            <input bind:value={value} />\n            <input bind:checked={checked} />\n            <input bind:stuff={stuff} />\n            <div>{value}</div>\n            <div>{value.value}</div>\n        </>\n\n    )\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nexport const Greeter = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    const value = useSignal(0);\n    const checked = useSignal(false);\n    const stuff = useSignal();\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"input\", null, {\n                \"value\": value,\n                \"onInput$\": /*#__PURE__*/ inlinedQrl((_, elm)=>{\n                    const [value] = useLexicalScope();\n                    return value.value = elm.type == \"number\" ? elm.valueAsNumber : elm.value;\n                }, \"s_6IZeYpXCNXA\", [\n                    value\n                ])\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"input\", null, {\n                \"checked\": checked,\n                \"onInput$\": /*#__PURE__*/ inlinedQrl((_, elm)=>{\n                    const [checked] = useLexicalScope();\n                    return checked.value = elm.type == \"number\" ? elm.valueAsNumber : elm.checked;\n                }, \"s_JPI3bLCVnso\", [\n                    checked\n                ])\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"input\", null, {\n                \"stuff\": stuff,\n                \"onChange$\": /*#__PURE__*/ inlinedQrl((_, elm)=>{\n                    const [stuff] = useLexicalScope();\n                    return stuff.value = elm.type == \"number\" ? elm.valueAsNumber : elm.stuff;\n                }, \"s_eyREJ0lZTFw\", [\n                    stuff\n                ])\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, value, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.value, [\n                value\n            ], \"p0.value\"), 3, null)\n        ]\n    }, 3, \"u6_0\");\n}, \"s_n7HuG2hhU0Q\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;AAGA,OAAO,MAAM,wBAAU,sCAAW;IAC9B,MAAM,QAAQ,UAAU;IACxB,MAAM,UAAU,UAAU;IAC1B,MAAM,QAAQ;IACd,qBACI;;0BACI,MAAC;yBAAkB;;;2BAAA;;;;;0BACnB,MAAC;2BAAoB;;;2BAAA;;;;;0BACrB,MAAC;yBAAkB;;;2BAAA;;;;;0BACnB,MAAC,mBAAK;0BACN,MAAC,mCAAK,GAAM,KAAK;;;;;AAI7B,qBAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_references.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 860\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nconst I1 = 12;\nconst [I2, {I3, v1: [I4], I5=v2, ...I6}, I7=v3, ...I8] = obj;\nfunction I9() {}\nclass I10 {}\n\nexport const App = component$(({count}) => {\n    console.log(I1, I2, I3, I4, I5, I6, I7, I8, I9);\n    console.log(itsok, v1, v2, v3, obj);\n    return $(() => {\n        return (\n            <I10></I10>\n        )\n    });\n})\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nconst I1 = 12;\nconst [I2, { I3, v1: [I4], I5 = v2, ...I6 }, I7 = v3, ...I8] = obj;\nfunction I9() {}\nclass I10 {\n}\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\nexport { I1 as _auto_I1 };\nexport { I10 as _auto_I10 };\nexport { I2 as _auto_I2 };\nexport { I3 as _auto_I3 };\nexport { I4 as _auto_I4 };\nexport { I5 as _auto_I5 };\nexport { I6 as _auto_I6 };\nexport { I7 as _auto_I7 };\nexport { I8 as _auto_I8 };\nexport { I9 as _auto_I9 };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,MAAM,KAAK;AACX,MAAM,CAAC,IAAI,EAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,KAAG,EAAE,EAAE,GAAG,IAAG,EAAE,KAAG,EAAE,EAAE,GAAG,GAAG,GAAG;AACzD,SAAS,MAAM;AACf,MAAM;AAAK;AAEX,OAAO,MAAM,oBAAM,iHAQjB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { _auto_I1 as I1 } from \"./test\";\nimport { _auto_I2 as I2 } from \"./test\";\nimport { _auto_I3 as I3 } from \"./test\";\nimport { _auto_I4 as I4 } from \"./test\";\nimport { _auto_I5 as I5 } from \"./test\";\nimport { _auto_I6 as I6 } from \"./test\";\nimport { _auto_I7 as I7 } from \"./test\";\nimport { _auto_I8 as I8 } from \"./test\";\nimport { _auto_I9 as I9 } from \"./test\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    console.log(I1, I2, I3, I4, I5, I6, I7, I8, I9);\n    console.log(itsok, v1, v2, v3, obj);\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_1_w0t0o3QMovU\"), \"App_component_1_w0t0o3QMovU\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;yCAQ8B;IAC1B,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;IAC5C,QAAQ,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI;IAC/B;AAKJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    191,\n    381\n  ]\n}\n*/\n============================= test.tsx_App_component_1_w0t0o3QMovU.js (ENTRY POINT)==\n\nimport { _auto_I10 as I10 } from \"./test\";\nimport { _jsxC } from \"@builder.io/qwik\";\nexport const App_component_1_w0t0o3QMovU = ()=>{\n    return /*#__PURE__*/ _jsxC(I10, null, 3, \"u6_0\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;2CAWa;IACL,qBACI,MAAC;AAET\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_1_w0t0o3QMovU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_1\",\n  \"hash\": \"w0t0o3QMovU\",\n  \"canonicalFilename\": \"test.tsx_App_component_1_w0t0o3QMovU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    313,\n    377\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_segment_expr1.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 888\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useStyles$ } from '@builder.io/qwik';\nimport css1 from './global.css';\nimport css2 from './style.css';\n\nexport const App = component$(() => {\n    const style = `${css1}${css2}`;\n    useStyles$(style);\n    const render = () => {\n        return (\n            <div></div>\n        )\n    };\n    return $(render);\n})\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAKA,OAAO,MAAM,oBAAM,iHASjB\\\"}\")\n============================= test.tsx_App_component_useStyles_t35nSa5UV7U.js (ENTRY POINT)==\n\nexport const App_component_useStyles_t35nSa5UV7U = style;\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"mDAOe\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_useStyles_t35nSa5UV7U\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_useStyles\",\n  \"hash\": \"t35nSa5UV7U\",\n  \"canonicalFilename\": \"test.tsx_App_component_useStyles_t35nSa5UV7U\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useStyles$\",\n  \"captures\": false,\n  \"loc\": [\n    219,\n    224\n  ]\n}\n*/\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStylesQrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    useStylesQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_useStyles_t35nSa5UV7U\"), \"App_component_useStyles_t35nSa5UV7U\"));\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_1_w0t0o3QMovU\"), \"App_component_1_w0t0o3QMovU\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAK8B;IAE1B;IAMA;AACJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    160,\n    335\n  ]\n}\n*/\n============================= test.tsx_App_component_1_w0t0o3QMovU.js (ENTRY POINT)==\n\nexport const App_component_1_w0t0o3QMovU = render;\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"2CAaa\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_1_w0t0o3QMovU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_1\",\n  \"hash\": \"w0t0o3QMovU\",\n  \"canonicalFilename\": \"test.tsx_App_component_1_w0t0o3QMovU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    325,\n    331\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[\n  {\n    \"category\": \"error\",\n    \"code\": \"C03\",\n    \"file\": \"test.tsx\",\n    \"message\": \"Qrl($) scope is not a function, but it's capturing local identifiers: style\",\n    \"highlights\": [\n      {\n        \"lo\": 219,\n        \"hi\": 224,\n        \"startLine\": 8,\n        \"startCol\": 16,\n        \"endLine\": 8,\n        \"endCol\": 20\n      }\n    ],\n    \"suggestions\": null,\n    \"scope\": \"optimizer\"\n  },\n  {\n    \"category\": \"error\",\n    \"code\": \"C03\",\n    \"file\": \"test.tsx\",\n    \"message\": \"Qrl($) scope is not a function, but it's capturing local identifiers: render\",\n    \"highlights\": [\n      {\n        \"lo\": 325,\n        \"hi\": 331,\n        \"startLine\": 14,\n        \"startCol\": 14,\n        \"endLine\": 14,\n        \"endCol\": 19\n      }\n    ],\n    \"suggestions\": null,\n    \"scope\": \"optimizer\"\n  }\n]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_issue_33443.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2937\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const Issue3742 = component$(({description = '', other}: any) => {\n    const counter = useSignal(0);\n    return (\n      <div\n        title={(description && 'description' in other) ? `Hello ${counter.value}` : `Bye ${counter.value}`}\n      >\n        Issue3742\n        <button onClick$={() => counter.value++}>\n          Increment\n        </button>\n      </div>\n    )\n  });\n  \n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { useSignal } from '@builder.io/qwik';\nconst Issue3742_component_div_button_onClick_a504K2BCEXg = ()=>{\n    const [counter] = useLexicalScope();\n    return counter.value++;\n};\nconst Issue3742_component_svSy0PlWTAw = (props)=>{\n    const counter = useSignal(0);\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        title: _fnSignal((p0, p1)=>(p1.description ?? '') && 'description' in p1.other ? `Hello ${p0.value}` : `Bye ${p0.value}`, [\n            counter,\n            props\n        ], '(p1.description??\"\")&&\"description\"in p1.other?`Hello ${p0.value}`:`Bye ${p0.value}`')\n    }, [\n        \"Issue3742\",\n        /*#__PURE__*/ _jsxQ(\"button\", null, {\n            onClick$: /*#__PURE__*/ inlinedQrl(Issue3742_component_div_button_onClick_a504K2BCEXg, \"Issue3742_component_div_button_onClick_a504K2BCEXg\", [\n                counter\n            ])\n        }, \"Increment\", 3, null)\n    ], 3, \"u6_0\");\n};\nexport const Issue3742 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(Issue3742_component_svSy0PlWTAw, \"Issue3742_component_svSy0PlWTAw\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;AACA,SAAqB,SAAS,QAAQ,mBAAmB;2DAS/B;;WAAM,QAAQ,KAAK;;wCAPT;IAChC,MAAM,UAAU,UAAU;IAC1B,qBACE,MAAC;QACC,KAAK,sBAAE,AAAC,IAJsB,eAAc,OAIrB,oBAJyB,QAIC,CAAC,MAAM,EAAE,GAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,GAAQ,KAAK,EAAE;;;;;QACnG;sBAEC,MAAC;YAAO,QAAQ;;;WAAyB;;AAK/C;AAZF,OAAO,MAAM,0BAAY,2GAYpB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_issue_4438.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2727\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    const toggle = useSignal(false);\n    return (\n        <>\n            <div data-nu={toggle.value ? $localize`singular` : 'plural'}></div>\n            <div>{toggle.value ? $localize`singular` : $localize`plural`}</div>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { useSignal } from '@builder.io/qwik';\nconst App_component_ckEPmXZlub0 = ()=>{\n    const toggle = useSignal(false);\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", {\n                \"data-nu\": toggle.value ? $localize`singular` : 'plural'\n            }, null, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, toggle.value ? $localize`singular` : $localize`plural`, 1, null)\n        ]\n    }, 1, \"u6_0\");\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(App_component_ckEPmXZlub0, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;AACA,SAAqB,SAAS,QAAQ,mBAAmB;kCAE3B;IAC1B,MAAM,SAAS,UAAU;IACzB,qBACI;;0BACI,MAAC;gBAAI,WAAS,OAAO,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG;;0BACnD,MAAC,mBAAK,OAAO,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;;;AAGxE;AARA,OAAO,MAAM,oBAAM,+FAQhB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1033\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, h, Fragment } from '@builder.io/qwik';\n\nexport const Lightweight = (props) => {\n    return (\n        <div>\n            <>\n                <div/>\n                <button {...props}/>\n            </>\n        </div>\n    )\n};\n\nexport const Foo = component$((props) => {\n    return $(() => {\n        return (\n            <div>\n                <>\n                    <div class=\"class\"/>\n                    <div class=\"class\"></div>\n                    <div class=\"class\">12</div>\n                </>\n                <div class=\"class\">\n                    <Lightweight {...props}/>\n                </div>\n                <div class=\"class\">\n                    <div/>\n                    <div/>\n                    <div/>\n                </div>\n                <div class=\"class\">\n                    {children}\n                </div>\n            </div>\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\n============================= test.js ==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxS } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nexport const Lightweight = (props)=>{\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, null),\n            /*#__PURE__*/ _jsxS(\"button\", {\n                ...props\n            }, null, 0, null)\n        ]\n    }, 1, \"u6_0\"), 1, \"u6_1\");\n};\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"), {\n    tagName: \"my-foo\"\n});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;AAGA,OAAO,MAAM,cAAc,CAAC;IACxB,qBACI,MAAC,iCACG;;0BACI,MAAC;0BACD,MAAC;gBAAQ,GAAG,KAAK;;;;AAIjC,EAAE;AAEF,OAAO,MAAM,oBAAM,iHAuBhB;IACC,SAAS;AACb,GAAG\\\"}\")\n============================= test.tsx_Foo_component_HTDRsvUbLiE.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo_component_HTDRsvUbLiE = (props)=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_1_DvU6FitWglY\"), \"Foo_component_1_DvU6FitWglY\", [\n        props\n    ]);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAc8B,CAAC;IAC3B;;;AAsBJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    279,\n    895\n  ]\n}\n*/\n============================= test.tsx_Foo_component_1_DvU6FitWglY.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { Lightweight } from \"./test\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const Foo_component_1_DvU6FitWglY = ()=>{\n    const [props] = useLexicalScope();\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n        /*#__PURE__*/ _jsxC(_Fragment, {\n            children: [\n                /*#__PURE__*/ _jsxQ(\"div\", null, {\n                    class: \"class\"\n                }, null, 3, null),\n                /*#__PURE__*/ _jsxQ(\"div\", null, {\n                    class: \"class\"\n                }, null, 3, null),\n                /*#__PURE__*/ _jsxQ(\"div\", null, {\n                    class: \"class\"\n                }, \"12\", 3, null)\n            ]\n        }, 3, \"u6_2\"),\n        /*#__PURE__*/ _jsxQ(\"div\", null, {\n            class: \"class\"\n        }, /*#__PURE__*/ _jsxC(Lightweight, {\n            ...props\n        }, 0, \"u6_3\"), 1, null),\n        /*#__PURE__*/ _jsxQ(\"div\", null, {\n            class: \"class\"\n        }, [\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, null)\n        ], 3, null),\n        /*#__PURE__*/ _jsxQ(\"div\", null, {\n            class: \"class\"\n        }, children, 3, null)\n    ], 1, \"u6_4\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;2CAea;;IACL,qBACI,MAAC;sBACG;;8BACI,MAAC;oBAAI,OAAM;;8BACX,MAAC;oBAAI,OAAM;;8BACX,MAAC;oBAAI,OAAM;mBAAQ;;;sBAEvB,MAAC;YAAI,OAAM;yBACP,MAAC;YAAa,GAAG,KAAK;;sBAE1B,MAAC;YAAI,OAAM;;0BACP,MAAC;0BACD,MAAC;0BACD,MAAC;;sBAEL,MAAC;YAAI,OAAM;WACN\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_1_DvU6FitWglY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_1\",\n  \"hash\": \"DvU6FitWglY\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_1_DvU6FitWglY\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_HTDRsvUbLiE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    305,\n    891\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_import_source.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1323\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\n/* @jsxImportSource react */\n\nimport { qwikify$ } from './qwikfy';\n\nexport const App = () => (\n    <div onClick$={()=>console.log('App')}></div>\n);\n\nexport const App2 = qwikify$(() => (\n    <div onClick$={()=>console.log('App2')}></div>\n));\n\n============================= test.js ==\n\n/* @jsxImportSource react */ import { qwikifyQrl } from \"./qwikfy\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const App = ()=>/*#__PURE__*/ _jsx(\"div\", {\n        onClick$: ()=>console.log('App')\n    });\nexport const App2 = qwikifyQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App2_qwikify_RKJW7oCMdS4.js\"), \"App2_qwikify_RKJW7oCMdS4\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"AACA,0BAA0B;;;AAI1B,OAAO,MAAM,MAAM,kBACf,KAAC;QAAI,UAAU,IAAI,QAAQ,GAAG,CAAC;OACjC;AAEF,OAAO,MAAM,OAAO,gHAEjB\\\"}\")\n============================= test.tsx_App2_qwikify_RKJW7oCMdS4.js (ENTRY POINT)==\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const App2_qwikify_RKJW7oCMdS4 = ()=>/*#__PURE__*/ _jsx(\"div\", {\n        onClick$: ()=>console.log('App2')\n    });\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";wCAS6B,kBACzB,KAAC;QAAI,UAAU,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App2_qwikify_RKJW7oCMdS4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App2_qwikify\",\n  \"hash\": \"RKJW7oCMdS4\",\n  \"canonicalFilename\": \"test.tsx_App2_qwikify_RKJW7oCMdS4\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"qwikify$\",\n  \"captures\": false,\n  \"loc\": [\n    180,\n    240\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_keyed.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2329\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <>\n            <Cmp key=\"stuff\"></Cmp>\n            <Cmp></Cmp>\n            <Cmp prop=\"23\"></Cmp>\n            <Cmp prop=\"23\" key={props.stuff}></Cmp>\n            <p key={props.stuff}>Hello Qwik</p>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0.js\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,oHAUhB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxC(Cmp, null, 3, \"stuff\"),\n            /*#__PURE__*/ _jsxC(Cmp, null, 3, \"u6_0\"),\n            /*#__PURE__*/ _jsxC(Cmp, {\n                prop: \"23\",\n                [_IMMUTABLE]: {\n                    prop: _IMMUTABLE\n                }\n            }, 3, \"u6_1\"),\n            /*#__PURE__*/ _jsxC(Cmp, {\n                prop: \"23\",\n                [_IMMUTABLE]: {\n                    prop: _IMMUTABLE\n                }\n            }, 3, props.stuff),\n            /*#__PURE__*/ _jsxQ(\"p\", null, null, \"Hello Qwik\", 3, props.stuff)\n        ]\n    }, 1, \"u6_2\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;yCAG8B,CAAC;IAC3B,qBACI;;0BACI,MAAC,cAAQ;0BACT,MAAC;0BACD,MAAC;gBAAI,MAAK;;oBAAL,IAAI;;;0BACT,MAAC;gBAAI,MAAK;;oBAAL,IAAI;;kBAAW,MAAM,KAAK;0BAC/B,MAAC,iBAAoB,iBAAb,MAAM,KAAK;;;AAG/B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    90,\n    348\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_keyed_dev.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2355\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <>\n            <Cmp key=\"stuff\"></Cmp>\n            <Cmp></Cmp>\n            <Cmp prop=\"23\"></Cmp>\n            <Cmp prop=\"23\" key={props.stuff}></Cmp>\n            <p key={props.stuff}>Hello Qwik</p>\n        </>\n    );\n});\n\n============================= project/index.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrlDEV } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrlDEV(()=>import(\"./index.tsx_App_component_KGLYFBhvJc0.js\"), \"App_component_KGLYFBhvJc0\", {\n    file: \"/src/project/project/index.tsx\",\n    lo: 90,\n    hi: 348,\n    displayName: \"index.tsx_App_component\"\n}));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/src/project/project/index.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM;;;;;IAUhB\\\"}\")\n============================= project/index.tsx_App_component_KGLYFBhvJc0.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_KGLYFBhvJc0 = (props)=>{\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxC(Cmp, null, 3, \"stuff\", {\n                fileName: \"project/index.tsx\",\n                lineNumber: 7,\n                columnNumber: 13\n            }),\n            /*#__PURE__*/ _jsxC(Cmp, null, 3, \"Q6_0\", {\n                fileName: \"project/index.tsx\",\n                lineNumber: 8,\n                columnNumber: 13\n            }),\n            /*#__PURE__*/ _jsxC(Cmp, {\n                prop: \"23\",\n                [_IMMUTABLE]: {\n                    prop: _IMMUTABLE\n                }\n            }, 3, \"Q6_1\", {\n                fileName: \"project/index.tsx\",\n                lineNumber: 9,\n                columnNumber: 13\n            }),\n            /*#__PURE__*/ _jsxC(Cmp, {\n                prop: \"23\",\n                [_IMMUTABLE]: {\n                    prop: _IMMUTABLE\n                }\n            }, 3, props.stuff, {\n                fileName: \"project/index.tsx\",\n                lineNumber: 10,\n                columnNumber: 13\n            }),\n            /*#__PURE__*/ _jsxQ(\"p\", null, null, \"Hello Qwik\", 3, props.stuff, {\n                fileName: \"project/index.tsx\",\n                lineNumber: 11,\n                columnNumber: 13\n            })\n        ]\n    }, 1, \"Q6_2\", {\n        fileName: \"project/index.tsx\",\n        lineNumber: 6,\n        columnNumber: 9\n    });\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/src/project/project/index.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;yCAG8B,CAAC;IAC3B,qBACI;;0BACI,MAAC,cAAQ;;;;;0BACT,MAAC;;;;;0BACD,MAAC;gBAAI,MAAK;;oBAAL,IAAI;;;;;;;0BACT,MAAC;gBAAI,MAAK;;oBAAL,IAAI;;kBAAW,MAAM,KAAK;;;;;0BAC/B,MAAC,iBAAoB,iBAAb,MAAM,KAAK;;;;;;;;;;;AAG/B\\\"}\")\n/*\n{\n  \"origin\": \"project/index.tsx\",\n  \"name\": \"App_component_KGLYFBhvJc0\",\n  \"entry\": null,\n  \"displayName\": \"index.tsx_App_component\",\n  \"hash\": \"KGLYFBhvJc0\",\n  \"canonicalFilename\": \"index.tsx_App_component_KGLYFBhvJc0\",\n  \"path\": \"project\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    90,\n    348\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_listeners.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1084\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n\n    return $(() => {\n        const handler = $(() => console.log('reused'));\n        return (\n            <div\n                onClick$={()=>console.log('onClick$')}\n                onDocumentScroll$={()=>console.log('onDocumentScroll')}\n                onDocumentScroll$={()=>console.log('onWindowScroll')}\n\n                on-cLick$={()=>console.log('on-cLick$')}\n                onDocument-sCroll$={()=>console.log('onDocument-sCroll')}\n                onDocument-scroLL$={()=>console.log('onDocument-scroLL')}\n\n                host:onClick$={()=>console.log('host:onClick$')}\n                host:onDocumentScroll$={()=>console.log('host:onDocument:scroll')}\n                host:onDocumentScroll$={()=>console.log('host:onWindow:scroll')}\n\n                onKeyup$={handler}\n                onDocument:keyup$={handler}\n                onWindow:keyup$={handler}\n\n                custom$={()=>console.log('custom')}\n            />\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\n============================= test.tsx_Foo_component_div_host_onDocumentScroll_Zip7mifsjRY.js (ENTRY POINT)==\n\nexport const Foo_component_div_host_onDocumentScroll_Zip7mifsjRY = ()=>console.log('host:onDocument:scroll');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"mEAkBwC,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_host_onDocumentScroll_Zip7mifsjRY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_host_onDocumentScroll\",\n  \"hash\": \"Zip7mifsjRY\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_host_onDocumentScroll_Zip7mifsjRY\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"host:onDocumentScroll$\",\n  \"captures\": false,\n  \"loc\": [\n    712,\n    753\n  ]\n}\n*/\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"), {\n    tagName: \"my-foo\"\n});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHA0BhB;IACC,SAAS;AACb,GAAG\\\"}\")\n============================= test.tsx_Foo_component_HTDRsvUbLiE.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo_component_HTDRsvUbLiE = ()=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_1_DvU6FitWglY\"), \"Foo_component_1_DvU6FitWglY\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAG8B;IAE1B;AAwBJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    83,\n    1045\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_host_onClick_cPEH970JbEY.js (ENTRY POINT)==\n\nexport const Foo_component_div_host_onClick_cPEH970JbEY = ()=>console.log('host:onClick$');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"0DAiB+B,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_host_onClick_cPEH970JbEY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_host_onClick\",\n  \"hash\": \"cPEH970JbEY\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_host_onClick_cPEH970JbEY\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"host:onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    638,\n    670\n  ]\n}\n*/\n============================= test.tsx_Foo_component_1_DvU6FitWglY.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo_component_1_DvU6FitWglY = ()=>{\n    const handler = /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_handler_H10xZtD0e7w\"), \"Foo_component_handler_H10xZtD0e7w\");\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_onClick_M48DYiidSJw\"), \"Foo_component_div_onClick_M48DYiidSJw\"),\n        onDocumentScroll$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_onDocumentScroll_rwFFtFiVuKc\"), \"Foo_component_div_onDocumentScroll_rwFFtFiVuKc\"),\n        onDocumentScroll$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_onDocumentScroll_1_CwneoGpmTZI\"), \"Foo_component_div_onDocumentScroll_1_CwneoGpmTZI\"),\n        \"on-cLick$\": /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_on_cLick_IoAsJW8vYJc\"), \"Foo_component_div_on_cLick_IoAsJW8vYJc\"),\n        \"onDocument-sCroll$\": /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_onDocument_sCroll_5VNik61PZOM\"), \"Foo_component_div_onDocument_sCroll_5VNik61PZOM\"),\n        \"onDocument-scroLL$\": /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_onDocument_scroLL_1q0Sgr8te3g\"), \"Foo_component_div_onDocument_scroLL_1q0Sgr8te3g\"),\n        \"host:onClick$\": /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_host_onClick_cPEH970JbEY\"), \"Foo_component_div_host_onClick_cPEH970JbEY\"),\n        \"host:onDocumentScroll$\": /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_host_onDocumentScroll_Zip7mifsjRY\"), \"Foo_component_div_host_onDocumentScroll_Zip7mifsjRY\"),\n        \"host:onDocumentScroll$\": /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg\"), \"Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg\"),\n        onKeyup$: handler,\n        \"onDocument:keyup$\": handler,\n        \"onWindow:keyup$\": handler,\n        custom$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_custom_pyHnxab17ms\"), \"Foo_component_div_custom_pyHnxab17ms\")\n    }, null, 3, \"u6_0\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;2CAKa;IACL,MAAM;IACN,qBACI,MAAC;QACG,QAAQ;QACR,iBAAiB;QACjB,iBAAiB;QAEjB,WAAS;QACT,oBAAkB;QAClB,oBAAkB;QAPtB,eAkBE;QAlBF,wBAkBE;QAlBF,wBAkBE;QALE,UAAU;QAbd,qBAcuB;QAdvB,mBAeqB;QAEjB,OAAO;;AAGnB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_1_DvU6FitWglY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_1\",\n  \"hash\": \"DvU6FitWglY\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_1_DvU6FitWglY\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_HTDRsvUbLiE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    105,\n    1041\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg.js (ENTRY POINT)==\n\nexport const Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg = ()=>console.log('host:onWindow:scroll');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"qEAmBwC,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_host_onDocumentScroll_1\",\n  \"hash\": \"Em1LspK7JVg\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"host:onDocumentScroll$\",\n  \"captures\": false,\n  \"loc\": [\n    795,\n    834\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_custom_pyHnxab17ms.js (ENTRY POINT)==\n\nexport const Foo_component_div_custom_pyHnxab17ms = ()=>console.log('custom');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"oDAyByB,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_custom_pyHnxab17ms\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_custom\",\n  \"hash\": \"pyHnxab17ms\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_custom_pyHnxab17ms\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"custom$\",\n  \"captures\": false,\n  \"loc\": [\n    984,\n    1009\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_onDocument_scroLL_1q0Sgr8te3g.js (ENTRY POINT)==\n\nexport const Foo_component_div_onDocument_scroLL_1q0Sgr8te3g = ()=>console.log('onDocument-scroLL');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"+DAeoC,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_onDocument_scroLL_1q0Sgr8te3g\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_onDocument_scroLL\",\n  \"hash\": \"1q0Sgr8te3g\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_onDocument_scroLL_1q0Sgr8te3g\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onDocument-scroLL$\",\n  \"captures\": false,\n  \"loc\": [\n    568,\n    604\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_onDocumentScroll_1_CwneoGpmTZI.js (ENTRY POINT)==\n\nexport const Foo_component_div_onDocumentScroll_1_CwneoGpmTZI = ()=>console.log('onWindowScroll');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"gEAWmC,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_onDocumentScroll_1_CwneoGpmTZI\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_onDocumentScroll_1\",\n  \"hash\": \"CwneoGpmTZI\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_onDocumentScroll_1_CwneoGpmTZI\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onDocumentScroll$\",\n  \"captures\": false,\n  \"loc\": [\n    365,\n    398\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_on_cLick_IoAsJW8vYJc.js (ENTRY POINT)==\n\nexport const Foo_component_div_on_cLick_IoAsJW8vYJc = ()=>console.log('on-cLick$');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"sDAa2B,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_on_cLick_IoAsJW8vYJc\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_on_cLick\",\n  \"hash\": \"IoAsJW8vYJc\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_on_cLick_IoAsJW8vYJc\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"on-cLick$\",\n  \"captures\": false,\n  \"loc\": [\n    428,\n    456\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_onClick_M48DYiidSJw.js (ENTRY POINT)==\n\nexport const Foo_component_div_onClick_M48DYiidSJw = ()=>console.log('onClick$');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"qDAS0B,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_onClick_M48DYiidSJw\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_onClick\",\n  \"hash\": \"M48DYiidSJw\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_onClick_M48DYiidSJw\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    229,\n    256\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_onDocumentScroll_rwFFtFiVuKc.js (ENTRY POINT)==\n\nexport const Foo_component_div_onDocumentScroll_rwFFtFiVuKc = ()=>console.log('onDocumentScroll');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"8DAUmC,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_onDocumentScroll_rwFFtFiVuKc\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_onDocumentScroll\",\n  \"hash\": \"rwFFtFiVuKc\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_onDocumentScroll_rwFFtFiVuKc\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onDocumentScroll$\",\n  \"captures\": false,\n  \"loc\": [\n    293,\n    328\n  ]\n}\n*/\n============================= test.tsx_Foo_component_handler_H10xZtD0e7w.js (ENTRY POINT)==\n\nexport const Foo_component_handler_H10xZtD0e7w = ()=>console.log('reused');\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"iDAM0B,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_handler_H10xZtD0e7w\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_handler\",\n  \"hash\": \"H10xZtD0e7w\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_handler_H10xZtD0e7w\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    139,\n    166\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_onDocument_sCroll_5VNik61PZOM.js (ENTRY POINT)==\n\nexport const Foo_component_div_onDocument_sCroll_5VNik61PZOM = ()=>console.log('onDocument-sCroll');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"+DAcoC,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_onDocument_sCroll_5VNik61PZOM\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_onDocument_sCroll\",\n  \"hash\": \"5VNik61PZOM\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_onDocument_sCroll_5VNik61PZOM\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_1_DvU6FitWglY\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onDocument-sCroll$\",\n  \"captures\": false,\n  \"loc\": [\n    494,\n    530\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_lightweight_functional.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 826\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(({color}) => {\n    return (\n        <div>\n            <Button {...props} />\n            <ButtonArrow {...props} />\n        </div>\n    );\n}, {\n    tagName: \"my-foo\",\n});\n\nexport function Button({text, color}) {\n    return (\n        <button onColor$={color} onClick$={()=>console.log(text, color)}>{text}</button>\n    );\n}\n\nexport const ButtonArrow = ({text, color}) => {\n    return (\n        <button onColor$={color} onClick$={()=>console.log(text, color)}>{text}</button>\n    );\n}\n\n============================= test.tsx_Foo_component_HTDRsvUbLiE.tsx (ENTRY POINT)==\n\nimport { Button } from \"./test\";\nimport { ButtonArrow } from \"./test\";\nexport const Foo_component_HTDRsvUbLiE = (props1)=>{\n    return <div>\n            <Button {...props}/>\n            <ButtonArrow {...props}/>\n        </div>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAG8B;IAC1B,QACK,IAAI;YACD,CAAC,QAAQ,GAAG,KAAK,GAAI;YACrB,CAAC,aAAa,GAAG,KAAK,GAAI;QAC9B,EAAE;AAEV\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    83,\n    221\n  ]\n}\n*/\n============================= test.tsx_ButtonArrow_button_onClick_9npo43fIGik.tsx (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const ButtonArrow_button_onClick_9npo43fIGik = ()=>{\n    const [color, text] = useLexicalScope();\n    return console.log(text, color);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";sDAsB2C;;WAAI,QAAQ,GAAG,CAAC,MAAM\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"ButtonArrow_button_onClick_9npo43fIGik\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_ButtonArrow_button_onClick\",\n  \"hash\": \"9npo43fIGik\",\n  \"canonicalFilename\": \"test.tsx_ButtonArrow_button_onClick_9npo43fIGik\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    509,\n    537\n  ]\n}\n*/\n============================= test.tsx_Button_button_onClick_NsM0JYV00Jw.tsx (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const Button_button_onClick_NsM0JYV00Jw = ()=>{\n    const [color, text] = useLexicalScope();\n    return console.log(text, color);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";iDAgB2C;;WAAI,QAAQ,GAAG,CAAC,MAAM\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Button_button_onClick_NsM0JYV00Jw\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Button_button_onClick\",\n  \"hash\": \"NsM0JYV00Jw\",\n  \"canonicalFilename\": \"test.tsx_Button_button_onClick_NsM0JYV00Jw\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    349,\n    377\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"), {\n    tagName: \"my-foo\"\n});\nexport function Button({ text, color }) {\n    return <button onColor$={color} onClick$={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Button_button_onClick_NsM0JYV00Jw\"), \"Button_button_onClick_NsM0JYV00Jw\", [\n        color,\n        text\n    ])}>{text}</button>;\n}\nexport const ButtonArrow = ({ text, color })=>{\n    return <button onColor$={color} onClick$={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_ButtonArrow_button_onClick_9npo43fIGik\"), \"ButtonArrow_button_onClick_9npo43fIGik\", [\n        color,\n        text\n    ])}>{text}</button>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAOhB;IACC,SAAS;AACb,GAAG;AAEH,OAAO,SAAS,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC;IAChC,QACK,OAAO,UAAU,OAAO;;;SAAyC,OAAO;AAEjF;AAEA,OAAO,MAAM,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC;IACrC,QACK,OAAO,UAAU,OAAO;;;SAAyC,OAAO;AAEjF,EAAC\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_manual_chunks.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1602\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useTask$, useStore, useStyles$ } from '@builder.io/qwik';\nimport mongo from 'mongodb';\nimport redis from 'redis';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n        redis.set(state.text);\n    });\n\n    return (\n        <div onClick$={() => console.log('parent')}>\n            {state.text}\n        </div>\n    );\n});\n\nexport const Child = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n    });\n\n    return (\n        <div onClick$={() => console.log('child')}>\n            {state.text}\n        </div>\n    );\n});\n\n============================= test.tsx_Parent_component_useTask_gDH1EtUWqBU.js ==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport mongo from \"mongodb\";\nimport redis from \"redis\";\nexport const Parent_component_useTask_gDH1EtUWqBU = async ()=>{\n    const [state] = useLexicalScope();\n    state.text = await mongo.users();\n    redis.set(state.text);\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;oDAWa;;IACL,MAAM,IAAI,GAAG,MAAM,MAAM,KAAK;IAC9B,MAAM,GAAG,CAAC,MAAM,IAAI\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_useTask_gDH1EtUWqBU\",\n  \"entry\": \"test.tsx_entry_Parent\",\n  \"displayName\": \"test.tsx_Parent_component_useTask\",\n  \"hash\": \"gDH1EtUWqBU\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_useTask_gDH1EtUWqBU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_0TaiDayHrlo\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": true,\n  \"loc\": [\n    273,\n    365\n  ]\n}\n*/\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Parent = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_0TaiDayHrlo\"), \"Parent_component_0TaiDayHrlo\"));\nexport const Child = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_9GyF01GDKqw\"), \"Child_component_9GyF01GDKqw\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAKA,OAAO,MAAM,uBAAS,uHAgBnB;AAEH,OAAO,MAAM,sBAAQ,qHAelB\\\"}\")\n============================= test.tsx_Child_component_useTask_Oh4n7ZeqJkU.js ==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport mongo from \"mongodb\";\nexport const Child_component_useTask_Oh4n7ZeqJkU = async ()=>{\n    const [state] = useLexicalScope();\n    state.text = await mongo.users();\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;mDA6Ba;;IACL,MAAM,IAAI,GAAG,MAAM,MAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_useTask_Oh4n7ZeqJkU\",\n  \"entry\": \"test.tsx_entry_Child\",\n  \"displayName\": \"test.tsx_Child_component_useTask\",\n  \"hash\": \"Oh4n7ZeqJkU\",\n  \"canonicalFilename\": \"test.tsx_Child_component_useTask_Oh4n7ZeqJkU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Child_component_9GyF01GDKqw\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": true,\n  \"loc\": [\n    621,\n    682\n  ]\n}\n*/\n============================= test.tsx_Parent_component_0TaiDayHrlo.js ==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nexport const Parent_component_0TaiDayHrlo = ()=>{\n    const state = useStore({\n        text: ''\n    });\n    // Double count watch\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_useTask_gDH1EtUWqBU\"), \"Parent_component_useTask_gDH1EtUWqBU\", [\n        state\n    ]));\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_div_onClick_C5XE49Nqd3A\"), \"Parent_component_div_onClick_C5XE49Nqd3A\")\n    }, _fnSignal((p0)=>p0.text, [\n        state\n    ], \"p0.text\"), 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;4CAKiC;IAC7B,MAAM,QAAQ,SAAS;QACnB,MAAM;IACV;IAEA,qBAAqB;IACrB;;;IAKA,qBACI,MAAC;QAAI,QAAQ;uBACR,GAAM,IAAI;;;AAGvB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_0TaiDayHrlo\",\n  \"entry\": \"test.tsx_entry_Parent\",\n  \"displayName\": \"test.tsx_Parent_component\",\n  \"hash\": \"0TaiDayHrlo\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_0TaiDayHrlo\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    171,\n    483\n  ]\n}\n*/\n============================= test.tsx_Parent_component_div_onClick_C5XE49Nqd3A.js (ENTRY POINT)==\n\nexport const Parent_component_div_onClick_C5XE49Nqd3A = ()=>console.log('parent');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"wDAiBuB,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_div_onClick_C5XE49Nqd3A\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component_div_onClick\",\n  \"hash\": \"C5XE49Nqd3A\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_div_onClick_C5XE49Nqd3A\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_0TaiDayHrlo\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    405,\n    432\n  ]\n}\n*/\n============================= test.tsx_Child_component_9GyF01GDKqw.js ==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nexport const Child_component_9GyF01GDKqw = ()=>{\n    const state = useStore({\n        text: ''\n    });\n    // Double count watch\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_useTask_Oh4n7ZeqJkU\"), \"Child_component_useTask_Oh4n7ZeqJkU\", [\n        state\n    ]));\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_div_onClick_elliVSnAiOQ\"), \"Child_component_div_onClick_elliVSnAiOQ\")\n    }, _fnSignal((p0)=>p0.text, [\n        state\n    ], \"p0.text\"), 3, \"u6_1\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;2CAuBgC;IAC5B,MAAM,QAAQ,SAAS;QACnB,MAAM;IACV;IAEA,qBAAqB;IACrB;;;IAIA,qBACI,MAAC;QAAI,QAAQ;uBACR,GAAM,IAAI;;;AAGvB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_9GyF01GDKqw\",\n  \"entry\": \"test.tsx_entry_Child\",\n  \"displayName\": \"test.tsx_Child_component\",\n  \"hash\": \"9GyF01GDKqw\",\n  \"canonicalFilename\": \"test.tsx_Child_component_9GyF01GDKqw\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    519,\n    799\n  ]\n}\n*/\n============================= test.tsx_Child_component_div_onClick_elliVSnAiOQ.js (ENTRY POINT)==\n\nexport const Child_component_div_onClick_elliVSnAiOQ = ()=>console.log('child');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"uDAkCuB,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_div_onClick_elliVSnAiOQ\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Child_component_div_onClick\",\n  \"hash\": \"elliVSnAiOQ\",\n  \"canonicalFilename\": \"test.tsx_Child_component_div_onClick_elliVSnAiOQ\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Child_component_9GyF01GDKqw\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    722,\n    748\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_missing_custom_inlined_functions.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1232\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ as Component, $ as onRender, useStore, wrap, useEffect } from '@builder.io/qwik';\n\n\nexport const useMemo$ = (qrt) => {\n    useEffect(qrt);\n};\n\nexport const App = component$((props) => {\n    const state = useStore({count: 0});\n    useMemo$(() => {\n        console.log(state.count);\n    });\n    return $(() => (\n        <div>{state.count}</div>\n    ));\n});\n\n============================= test.js ==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { useStore, useEffect } from '@builder.io/qwik';\nexport const useMemo$ = (qrt)=>{\n    useEffect(qrt);\n};\nexport const App = component$((props)=>{\n    const state = useStore({\n        count: 0\n    });\n    useMemo$(()=>{\n        console.log(state.count);\n    });\n    return $(()=>/*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.count, [\n            state\n        ], \"p0.count\"), 3, \"u6_0\"));\n});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AACA,SAAiD,QAAQ,EAAQ,SAAS,QAAQ,mBAAmB;AAGrG,OAAO,MAAM,WAAW,CAAC;IACrB,UAAU;AACd,EAAE;AAEF,OAAO,MAAM,MAAM,WAAW,CAAC;IAC3B,MAAM,QAAQ,SAAS;QAAC,OAAO;IAAC;IAChC,SAAS;QACL,QAAQ,GAAG,CAAC,MAAM,KAAK;IAC3B;IACA,OAAO,EAAE,kBACL,MAAC,mCAAK,GAAM,KAAK;;;AAEzB,GAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[\n  {\n    \"category\": \"error\",\n    \"code\": \"C05\",\n    \"file\": \"test.tsx\",\n    \"message\": \"Found 'useMemo$' but did not find the corresponding 'useMemoQrl' exported in the same file. Please check that it is exported and spelled correctly\",\n    \"highlights\": [\n      {\n        \"lo\": 252,\n        \"hi\": 260,\n        \"startLine\": 11,\n        \"startCol\": 5,\n        \"endLine\": 11,\n        \"endCol\": 12\n      }\n    ],\n    \"suggestions\": null,\n    \"scope\": \"optimizer\"\n  }\n]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_multi_capture.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 415\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(({foo}) => {\n    const arg0 = 20;\n    return $(() => {\n        const fn = ({aaa}) => aaa;\n        return (\n            <div>\n              {foo}{fn()}{arg0}\n            </div>\n        )\n    });\n})\n\nexport const Bar = component$(({bar}) => {\n    return $(() => {\n        return (\n            <div>\n              {bar}\n            </div>\n        )\n    });\n})\n\n============================= test.tsx_Foo_component_HTDRsvUbLiE.jsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo_component_HTDRsvUbLiE = (props)=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_1_DvU6FitWglY\"), \"Foo_component_1_DvU6FitWglY\", [\n        props\n    ]);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAG8B;IAE1B;;;AAQJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"jsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    83,\n    278\n  ]\n}\n*/\n============================= test.jsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"));\nexport const Bar = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Bar_component_L80pS8Hxf1Y\"), \"Bar_component_L80pS8Hxf1Y\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAUjB;AAEF,OAAO,MAAM,oBAAM,iHAQjB\\\"}\")\n============================= test.tsx_Bar_component_L80pS8Hxf1Y.jsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Bar_component_L80pS8Hxf1Y = (props)=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Bar_component_1_0xSyNSnVu3k\"), \"Bar_component_1_0xSyNSnVu3k\", [\n        props\n    ]);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAe8B;IAC1B;;;AAOJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Bar_component_L80pS8Hxf1Y\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Bar_component\",\n  \"hash\": \"L80pS8Hxf1Y\",\n  \"canonicalFilename\": \"test.tsx_Bar_component_L80pS8Hxf1Y\",\n  \"path\": \"\",\n  \"extension\": \"jsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    311,\n    438\n  ]\n}\n*/\n============================= test.tsx_Foo_component_1_DvU6FitWglY.jsx (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const Foo_component_1_DvU6FitWglY = ()=>{\n    const [props] = useLexicalScope();\n    const fn = ({ aaa })=>aaa;\n    return <div>\n              {props.foo}{fn()}{20}\n            </div>;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";2CAKa;;IACL,MAAM,KAAK,CAAC,EAAC,GAAG,EAAC,GAAK;IACtB,QACK,IAAI;cACH,OANkB,KAMZ,MALH,GAKc;YACnB,EAAE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_1_DvU6FitWglY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_1\",\n  \"hash\": \"DvU6FitWglY\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_1_DvU6FitWglY\",\n  \"path\": \"\",\n  \"extension\": \"jsx\",\n  \"parent\": \"Foo_component_HTDRsvUbLiE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    130,\n    274\n  ]\n}\n*/\n============================= test.tsx_Bar_component_1_0xSyNSnVu3k.jsx (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const Bar_component_1_0xSyNSnVu3k = ()=>{\n    const [props] = useLexicalScope();\n    return <div>\n              {props.bar}\n            </div>;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";2CAgBa;;IACL,QACK,IAAI;cACH,OAJkB,IAIb;YACP,EAAE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Bar_component_1_0xSyNSnVu3k\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Bar_component_1\",\n  \"hash\": \"0xSyNSnVu3k\",\n  \"canonicalFilename\": \"test.tsx_Bar_component_1_0xSyNSnVu3k\",\n  \"path\": \"\",\n  \"extension\": \"jsx\",\n  \"parent\": \"Bar_component_L80pS8Hxf1Y\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    337,\n    434\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_mutable_children.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2384\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, Slot, Fragment } from '@builder.io/qwik';\nimport Image from './image.jpg?jsx';\n\nexport function Fn1(props: Stuff) {\n    return (\n        <>\n            <div>{prop < 2 ? <p>1</p> : <Stuff>2</Stuff>}</div>\n        </>\n    );\n}\n\nexport function Fn2(props: Stuff) {\n    return (\n        <div>{prop.value && <Stuff></Stuff>}<div></div></div>\n    );\n}\n\nexport function Fn3(props: Stuff) {\n    if (prop.value) {\n        return (\n            <Stuff></Stuff>\n        );\n    }\n    return (\n        <div></div>\n    );\n}\n\nexport function Fn4(props: Stuff) {\n    if (prop.value) {\n        return (\n            <div></div>\n        );\n    }\n    return (\n        <Stuff></Stuff>\n    );\n}\n\nexport const Arrow = (props: Stuff) => <div>{prop < 2 ? <p>1</p> : <Stuff>2</Stuff>}</div>;\n\nexport const AppDynamic1 = component$((props: Stuff) => {\n    return (\n        <>\n            <div>{prop < 2 ? <p>1</p> : <Stuff>2</Stuff>}</div>\n        </>\n    );\n});\nexport const AppDynamic2 = component$((props: Stuff) => {\n    return (\n        <div>{prop.value && <Stuff></Stuff>}<div></div></div>\n    );\n});\n\nexport const AppDynamic3 = component$((props: Stuff) => {\n    if (prop.value) {\n        return (\n            <Stuff></Stuff>\n        );\n    }\n    return (\n        <div></div>\n    );\n});\n\nexport const AppDynamic4 = component$((props: Stuff) => {\n    if (prop.value) {\n        return (\n            <div></div>\n        );\n    }\n    return (\n        <Stuff></Stuff>\n    );\n});\n\nexport const AppStatic = component$((props: Stuff) => {\n    return (\n        <>\n            <div>Static {f ? 1 : 3}</div>\n            <div>{prop < 2 ? <p>1</p> : <p>2</p>}</div>\n\n            <div>{prop.value && <div></div>}</div>\n            <div>{prop.value && <Fragment><Slot></Slot></Fragment>}</div>\n            <div>{prop.value && <><div></div></>}</div>\n            <div>{prop.value && <Image/>}</div>\n            <div>Static {f ? 1 : 3}</div>\n            <div>Static</div>\n            <div>Static {props.value}</div>\n            <div>Static {stuff()}</div>\n            <div>Static {stuff()}</div>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxBranch } from \"@builder.io/qwik\";\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { Slot, Fragment } from '@builder.io/qwik';\nimport Image from './image.jpg?jsx';\nexport function Fn1(props) {\n    _jsxBranch();\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: /*#__PURE__*/ _jsxQ(\"div\", null, null, prop < 2 ? /*#__PURE__*/ _jsxQ(\"p\", null, null, \"1\", 3, \"u6_0\") : /*#__PURE__*/ _jsxC(Stuff, {\n            children: \"2\"\n        }, 3, \"u6_1\"), 1, null)\n    }, 1, \"u6_2\");\n}\nexport function Fn2(props) {\n    _jsxBranch();\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n        prop.value && /*#__PURE__*/ _jsxC(Stuff, null, 3, \"u6_3\"),\n        /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, null)\n    ], 1, \"u6_4\");\n}\nexport function Fn3(props) {\n    _jsxBranch();\n    if (prop.value) return /*#__PURE__*/ _jsxC(Stuff, null, 3, \"u6_5\");\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_6\");\n}\nexport function Fn4(props) {\n    _jsxBranch();\n    if (prop.value) return /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_7\");\n    return /*#__PURE__*/ _jsxC(Stuff, null, 3, \"u6_8\");\n}\nexport const Arrow = (props)=>/*#__PURE__*/ _jsxBranch(/*#__PURE__*/ _jsxQ(\"div\", null, null, prop < 2 ? /*#__PURE__*/ _jsxQ(\"p\", null, null, \"1\", 3, \"u6_9\") : /*#__PURE__*/ _jsxC(Stuff, {\n        children: \"2\"\n    }, 3, \"u6_10\"), 1, \"u6_11\"));\nconst AppDynamic1_component_R00UJ05gbes = (props)=>{\n    _jsxBranch();\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: /*#__PURE__*/ _jsxQ(\"div\", null, null, prop < 2 ? /*#__PURE__*/ _jsxQ(\"p\", null, null, \"1\", 3, \"u6_12\") : /*#__PURE__*/ _jsxC(Stuff, {\n            children: \"2\"\n        }, 3, \"u6_13\"), 1, null)\n    }, 1, \"u6_14\");\n};\nexport const AppDynamic1 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(AppDynamic1_component_R00UJ05gbes, \"AppDynamic1_component_R00UJ05gbes\"));\nconst AppDynamic2_component_3EY2zm0v00A = (props)=>{\n    _jsxBranch();\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n        prop.value && /*#__PURE__*/ _jsxC(Stuff, null, 3, \"u6_15\"),\n        /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, null)\n    ], 1, \"u6_16\");\n};\nexport const AppDynamic2 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(AppDynamic2_component_3EY2zm0v00A, \"AppDynamic2_component_3EY2zm0v00A\"));\nconst AppDynamic3_component_FVq83NlbTDQ = (props)=>{\n    _jsxBranch();\n    if (prop.value) return /*#__PURE__*/ _jsxC(Stuff, null, 3, \"u6_17\");\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_18\");\n};\nexport const AppDynamic3 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(AppDynamic3_component_FVq83NlbTDQ, \"AppDynamic3_component_FVq83NlbTDQ\"));\nconst AppDynamic4_component_IO0yr8UvWEI = (props)=>{\n    _jsxBranch();\n    if (prop.value) return /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_19\");\n    return /*#__PURE__*/ _jsxC(Stuff, null, 3, \"u6_20\");\n};\nexport const AppDynamic4 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(AppDynamic4_component_IO0yr8UvWEI, \"AppDynamic4_component_IO0yr8UvWEI\"));\nconst AppStatic_component_gYRXqF3G5nE = (props)=>{\n    _jsxBranch();\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"Static \",\n                f ? 1 : 3\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, prop < 2 ? /*#__PURE__*/ _jsxQ(\"p\", null, null, \"1\", 3, \"u6_21\") : /*#__PURE__*/ _jsxQ(\"p\", null, null, \"2\", 3, null), 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, prop.value && /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_22\"), 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, prop.value && /*#__PURE__*/ _jsxC(Fragment, {\n                children: /*#__PURE__*/ _jsxC(Slot, null, 3, \"u6_23\")\n            }, 1, \"u6_24\"), 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, prop.value && /*#__PURE__*/ _jsxC(_Fragment, {\n                children: /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, null)\n            }, 3, \"u6_25\"), 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, prop.value && /*#__PURE__*/ _jsxC(Image, null, 3, \"u6_26\"), 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"Static \",\n                f ? 1 : 3\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, \"Static\", 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"Static \",\n                _fnSignal((p0)=>p0.value, [\n                    props\n                ], \"p0.value\")\n            ], 3, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"Static \",\n                stuff()\n            ], 1, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                \"Static \",\n                stuff()\n            ], 1, null)\n        ]\n    }, 1, \"u6_27\");\n};\nexport const AppStatic = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(AppStatic_component_gYRXqF3G5nE, \"AppStatic_component_gYRXqF3G5nE\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;AACA,SAA+B,IAAI,EAAE,QAAQ,QAAQ,mBAAmB;AACxE,OAAO,WAAW,kBAAkB;AAEpC,OAAO,SAAS,IAAI,KAAY;;IAC5B,qBACI;kBACI,cAAA,MAAC,mBAAK,OAAO,kBAAI,MAAC,iBAAE,gCAAQ,MAAC;sBAAM;;;AAG/C;AAEA,OAAO,SAAS,IAAI,KAAY;;IAC5B,qBACI,MAAC;QAAK,KAAK,KAAK,kBAAI,MAAC;sBAAe,MAAC;;AAE7C;AAEA,OAAO,SAAS,IAAI,KAAY;;IAC5B,IAAI,KAAK,KAAK,EACV,qBACI,MAAC;IAGT,qBACI,MAAC;AAET;AAEA,OAAO,SAAS,IAAI,KAAY;;IAC5B,IAAI,KAAK,KAAK,EACV,qBACI,MAAC;IAGT,qBACI,MAAC;AAET;AAEA,OAAO,MAAM,QAAQ,CAAC,+CAAiB,MAAC,mBAAK,OAAO,kBAAI,MAAC,iBAAE,gCAAQ,MAAC;kBAAM;iCAAiB;0CAErD,CAAC;;IACnC,qBACI;kBACI,cAAA,MAAC,mBAAK,OAAO,kBAAI,MAAC,iBAAE,iCAAQ,MAAC;sBAAM;;;AAG/C;AANA,OAAO,MAAM,4BAAc,+GAMxB;0CACmC,CAAC;;IACnC,qBACI,MAAC;QAAK,KAAK,KAAK,kBAAI,MAAC;sBAAe,MAAC;;AAE7C;AAJA,OAAO,MAAM,4BAAc,+GAIxB;0CAEmC,CAAC;;IACnC,IAAI,KAAK,KAAK,EACV,qBACI,MAAC;IAGT,qBACI,MAAC;AAET;AATA,OAAO,MAAM,4BAAc,+GASxB;0CAEmC,CAAC;;IACnC,IAAI,KAAK,KAAK,EACV,qBACI,MAAC;IAGT,qBACI,MAAC;AAET;AATA,OAAO,MAAM,4BAAc,+GASxB;wCAEiC,CAAC;;IACjC,qBACI;;0BACI,MAAC;gBAAI;gBAAQ,IAAI,IAAI;;0BACrB,MAAC,mBAAK,OAAO,kBAAI,MAAC,iBAAE,iCAAQ,MAAC,iBAAE;0BAE/B,MAAC,mBAAK,KAAK,KAAK,kBAAI,MAAC;0BACrB,MAAC,mBAAK,KAAK,KAAK,kBAAI,MAAC;0BAAS,cAAA,MAAC;;0BAC/B,MAAC,mBAAK,KAAK,KAAK,kBAAI;0BAAE,cAAA,MAAC;;0BACvB,MAAC,mBAAK,KAAK,KAAK,kBAAI,MAAC;0BACrB,MAAC;gBAAI;gBAAQ,IAAI,IAAI;;0BACrB,MAAC,mBAAI;0BACL,MAAC;gBAAI;gCAAQ,GAAM,KAAK;;;;0BACxB,MAAC;gBAAI;gBAAQ;;0BACb,MAAC;gBAAI;gBAAQ;;;;AAGzB;AAjBA,OAAO,MAAM,0BAAY,2GAiBtB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_noop_dev_mode.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3510\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore, serverStuff$, $ } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    const stuff = useStore();\n    serverStuff$(async () => {\n        // should be removed but keep scope\n        console.log(stuff.count)\n    })\n    serverStuff$(async () => {\n        // should be removed\n    })\n\n    return (\n        <Cmp>\n            <p class=\"stuff\" \n                shouldRemove$={() => stuff.count}\n                onClick$={() => console.log('warn')}\n            >\n                Hello Qwik\n            </p>\n        </Cmp>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrlDEV } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrlDEV(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\", {\n    file: \"/hello/from/dev/test.tsx\",\n    lo: 107,\n    hi: 569,\n    displayName: \"test.tsx_App_component\"\n}));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM;;;;;IAoBhB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _noopQrlDEV } from \"@builder.io/qwik\";\nimport { serverStuffQrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    const stuff = useStore();\n    serverStuffQrl(/*#__PURE__*/ _noopQrlDEV(\"App_component_serverStuff_ebyHaP15ytQ\", {\n        file: \"/hello/from/dev/test.tsx\",\n        lo: 0,\n        hi: 0,\n        displayName: \"test.tsx_App_component_serverStuff\"\n    }, [\n        stuff\n    ]));\n    serverStuffQrl(/*#__PURE__*/ _noopQrlDEV(\"App_component_serverStuff_1_PQCqO0ANabY\", {\n        file: \"/hello/from/dev/test.tsx\",\n        lo: 0,\n        hi: 0,\n        displayName: \"test.tsx_App_component_serverStuff_1\"\n    }));\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\",\n            shouldRemove$: /*#__PURE__*/ _noopQrlDEV(\"App_component_Cmp_p_shouldRemove_uU0MG0jvQD4\", {\n                file: \"/hello/from/dev/test.tsx\",\n                lo: 0,\n                hi: 0,\n                displayName: \"test.tsx_App_component_Cmp_p_shouldRemove\"\n            }, [\n                stuff\n            ]),\n            onClick$: /*#__PURE__*/ _noopQrlDEV(\"App_component_Cmp_p_onClick_vuXzfUTkpto\", {\n                file: \"/hello/from/dev/test.tsx\",\n                lo: 0,\n                hi: 0,\n                displayName: \"test.tsx_App_component_Cmp_p_onClick\"\n            })\n        }, \"Hello Qwik\", 3, null, {\n            fileName: \"/hello/from/dev/test.tsx\",\n            lineNumber: 16,\n            columnNumber: 13\n        })\n    }, 3, \"u6_0\", {\n        fileName: \"/hello/from/dev/test.tsx\",\n        lineNumber: 15,\n        columnNumber: 9\n    });\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;yCAG8B;IAC1B,MAAM,QAAQ;IACd;;;;;;;;IAIA;;;;;;IAIA,qBACI,MAAC;kBACG,cAAA,MAAC;YAAE,OAAM;YACL,aAAa;;;;;;;;YACb,QAAQ;;;;;;WACX;;;;;;;;;;AAKb\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    107,\n    569\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_of_synchronous_qrl.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3482\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\n        import { sync$, component$ } from \"@builder.io/qwik\";\n\n        export default component$(() => {\n        return (\n            <>\n                <input onClick$={sync$(function(event, target) {\n                    // comment should be removed\n                    event.preventDefault();\n                })}/>\n                <input onClick$={sync$((event, target) => {\n                    event.preventDefault();\n                })}/>\n                <input onClick$={sync$((event, target) => event.preventDefault())}/>\n            </>\n        );\n        });\n        \n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_LUXeXe0DQrg\"), \"test_component_LUXeXe0DQrg\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGQ,6BAAe,mHAaZ\\\"}\")\n============================= test.tsx_test_component_LUXeXe0DQrg.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _qrlSync } from \"@builder.io/qwik\";\nexport const test_component_LUXeXe0DQrg = ()=>{\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"input\", {\n                onClick$: _qrlSync(function(event, target) {\n                    // comment should be removed\n                    event.preventDefault();\n                }, \"function(event,target){event.preventDefault();}\")\n            }, null, null, 2, null),\n            /*#__PURE__*/ _jsxQ(\"input\", {\n                onClick$: _qrlSync((event, target)=>{\n                    event.preventDefault();\n                }, \"(event,target)=>{event.preventDefault();}\")\n            }, null, null, 2, null),\n            /*#__PURE__*/ _jsxQ(\"input\", {\n                onClick$: _qrlSync((event, target)=>event.preventDefault(), \"(event,target)=>event.preventDefault()\")\n            }, null, null, 2, null)\n        ]\n    }, 1, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;0CAGkC;IAC1B,qBACI;;0BACI,MAAC;gBAAM,QAAQ,WAAQ,SAAS,KAAK,EAAE,MAAM;oBACzC,4BAA4B;oBAC5B,MAAM,cAAc;gBACxB;;0BACA,MAAC;gBAAM,QAAQ,WAAQ,CAAC,OAAO;oBAC3B,MAAM,cAAc;gBACxB;;0BACA,MAAC;gBAAM,QAAQ,WAAQ,CAAC,OAAO,SAAW,MAAM,cAAc;;;;AAGtE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_LUXeXe0DQrg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component\",\n  \"hash\": \"LUXeXe0DQrg\",\n  \"canonicalFilename\": \"test.tsx_test_component_LUXeXe0DQrg\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    99,\n    566\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_optimization_issue_3542.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 658\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport const AtomStatus = component$(({ctx,atom})=>{\n    let status = atom.status;\n    if(!atom.real) {\n        status=\"WILL-VANISH\"\n    } else if (JSON.stringify(atom.atom)==JSON.stringify(atom.real)) {\n        status=\"WTFED\"\n    }\n    return (\n        <span title={atom.ID} onClick$={(ev)=>atomStatusClick(ctx,ev,[atom])} class={[\"atom\",status,ctx.store[atom.ID]?\"selected\":null]}>\n        </span>\n    );\n})\n\n============================= test.jsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nexport const AtomStatus = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n    let status = props.atom.status;\n    if (!props.atom.real) status = \"WILL-VANISH\";\n    else if (JSON.stringify(props.atom.atom) == JSON.stringify(props.atom.real)) status = \"WTFED\";\n    return <span title={props.atom.ID} onClick$={/*#__PURE__*/ inlinedQrl((ev)=>{\n        const [props] = useLexicalScope();\n        return atomStatusClick(props.ctx, ev, [\n            props.atom\n        ]);\n    }, \"AtomStatus_component_span_onClick_Owf5fKaOlF0\", [\n        props\n    ])} class={[\n        \"atom\",\n        status,\n        props.ctx.store[props.atom.ID] ? \"selected\" : null\n    ]}>\n        </span>;\n}, \"AtomStatus_component_hdwpoUtydSA\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;AAGA,OAAO,MAAM,2BAAa,sCAAW;IACjC,IAAI,SAAS,MAD0B,KACrB,MAAM;IACxB,IAAG,CAAC,MAFmC,KAE9B,IAAI,EACT,SAAO;SACJ,IAAI,KAAK,SAAS,CAAC,MAJa,KAIR,IAAI,KAAG,KAAK,SAAS,CAAC,MAJd,KAImB,IAAI,GAC1D,SAAO;IAEX,QACK,KAAK,OAAO,MARsB,KAQjB,EAAE,EAAE,mCAAU,CAAC;;eAAK,sBARP,KAQ2B,IAAG;kBAR1B;SAQgC;;;QAAG,OAAO;QAAC;QAAO;QAAO,MAR7D,IAQiE,KAAK,CAAC,MARnE,KAQwE,EAAE,CAAC,GAAC,aAAW;KAAK,EAAE;QACjI,EAAE;AAEV,wCAAE\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_optimization_issue_3561.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 596\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport const Issue3561 = component$(() => {\n    const props = useStore({\n      product: {\n        currentVariant: {\n          variantImage: 'image',\n          variantNumber: 'number',\n          setContents: 'contents',\n        },\n      },\n    });\n    const {\n      currentVariant: { variantImage, variantNumber, setContents } = {},\n    } = props.product;\n\n    console.log(variantImage, variantNumber, setContents)\n\n    return <p></p>;\n  });\n\n============================= test.jsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nexport const Issue3561 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    const props = useStore({\n        product: {\n            currentVariant: {\n                variantImage: 'image',\n                variantNumber: 'number',\n                setContents: 'contents'\n            }\n        }\n    });\n    const { currentVariant: { variantImage, variantNumber, setContents } = {} } = props.product;\n    console.log(variantImage, variantNumber, setContents);\n    return <p></p>;\n}, \"Issue3561_component_hHTw654BZB8\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,0BAAY,sCAAW;IAChC,MAAM,QAAQ,SAAS;QACrB,SAAS;YACP,gBAAgB;gBACd,cAAc;gBACd,eAAe;gBACf,aAAa;YACf;QACF;IACF;IACA,MAAM,EACJ,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC,EAClE,GAAG,MAAM,OAAO;IAEjB,QAAQ,GAAG,CAAC,cAAc,eAAe;IAEzC,QAAQ,IAAI;AACd,uCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_optimization_issue_3795.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 686\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport const Issue3795 = component$(() => {\n    let base = \"foo\";\n    const firstAssignment = base;\n    base += \"bar\";\n    const secondAssignment = base;\n    return (\n      <div id='issue-3795-result'>{firstAssignment} {secondAssignment}</div>\n    )\n  });\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nexport const Issue3795 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    let base = \"foo\";\n    const firstAssignment = base;\n    base += \"bar\";\n    const secondAssignment = base;\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        id: \"issue-3795-result\"\n    }, [\n        firstAssignment,\n        \" \",\n        secondAssignment\n    ], 1, \"u6_0\");\n}, \"Issue3795_component_wsE8beycatI\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;AAGA,OAAO,MAAM,0BAAY,sCAAW;IAChC,IAAI,OAAO;IACX,MAAM,kBAAkB;IACxB,QAAQ;IACR,MAAM,mBAAmB;IACzB,qBACE,MAAC;QAAI,IAAG;;QAAqB;QAAgB;QAAE;;AAEnD,uCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_optimization_issue_4386.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 630\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport const FOO_MAPPING = {\n    A: 1,\n    B: 2,\n    C: 3,\n  };\n\n  export default component$(() => {\n    const key = 'A';\n    const value = FOO_MAPPING[key];\n\n    return <>{value}</>;\n  });\n\n============================= test.jsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nexport const FOO_MAPPING = {\n    A: 1,\n    B: 2,\n    C: 3\n};\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    return <>{FOO_MAPPING['A']}</>;\n}, \"test_component_LUXeXe0DQrg\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,cAAc;IACvB,GAAG;IACH,GAAG;IACH,GAAG;AACL,EAAE;AAEF,6BAAe,sCAAW;IAIxB,UAFc,WAAW,CADb,IACkB;AAGhC,kCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_parsed_inlined_qrls.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1504\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { componentQrl, inlinedQrl, useStore, jsxs, jsx, useLexicalScope } from '@builder.io/qwik';\n\nexport const App = /*#__PURE__*/ componentQrl(inlinedQrl(()=>{\n    useStyles$(inlinedQrl(STYLES, \"STYLES_odz7dfdfdM\"));\n    useStyles$(inlinedQrl(STYLES, \"STYLES_odzdfdfdM\"));\n\n    const store = useStore({\n        count: 0\n    });\n    return /*#__PURE__*/ jsxs(\"div\", {\n        children: [\n            /*#__PURE__*/ jsxs(\"p\", {\n                children: [\n                    \"Count: \",\n                    store.count\n                ]\n            }),\n            /*#__PURE__*/ jsx(\"p\", {\n                children: /*#__PURE__*/ jsx(\"button\", {\n                    onClick$: inlinedQrl(()=>{\n                        const [store] = useLexicalScope();\n                        return store.count++;\n                    }, \"App_component_div_p_button_onClick_odz7eidI4GM\", [\n                        store\n                    ]),\n                    children: \"Click\"\n                })\n            })\n        ]\n    });\n}, \"App_component_Fh88JClhbC0\"));\n\nexport const STYLES = \".red { color: red; }\";\n\n\n============================= test.tsx ==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { componentQrl, inlinedQrl, useStore, useLexicalScope } from '@builder.io/qwik';\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    useStyles$(/*#__PURE__*/ inlinedQrl(STYLES, \"s_odz7dfdfdM\"));\n    useStyles$(/*#__PURE__*/ inlinedQrl(STYLES, \"s_odzdfdfdM\"));\n    const store = useStore({\n        count: 0\n    });\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n        /*#__PURE__*/ _jsxQ(\"p\", null, null, [\n            \"Count: \",\n            _fnSignal((p0)=>p0.count, [\n                store\n            ], \"p0.count\")\n        ], 3, null),\n        /*#__PURE__*/ _jsxQ(\"p\", null, null, /*#__PURE__*/ _jsxQ(\"button\", {\n            onClick$: /*#__PURE__*/ inlinedQrl(()=>{\n                const [store] = useLexicalScope();\n                return store.count++;\n            }, \"s_odz7eidI4GM\", [\n                store\n            ])\n        }, null, \"Click\", 2, null), 1, null)\n    ], 1, \"u6_0\");\n}, \"s_Fh88JClhbC0\"));\nexport const STYLES = \".red { color: red; }\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AACA,SAAS,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAa,eAAe,QAAQ,mBAAmB;AAElG,OAAO,MAAM,MAAM,WAAW,GAAG,sCAAwB;IACrD,oCAAsB;IACtB,oCAAsB;IAEtB,MAAM,QAAQ,SAAS;QACnB,OAAO;IACX;IACA,OAAO,WAAW,GAAG,MAAK,mBACZ;QACN,WAAW,GAAG,MAAK,iBACL;YACN;4BACA,GAAM,KAAK;;;SACd;QAEL,WAAW,GAAG,MAAI,iBACJ,WAAW,GAAG,MAAI;YACxB,QAAQ,2BAAa;gBACjB,MAAM,CAAC,MAAM,GAAG;gBAChB,OAAO,MAAM,KAAK;YACtB;;;iBAGU;KAGrB;AAET,qBAAiC;AAEjC,OAAO,MAAM,SAAS,uBAAuB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_preserve_filenames.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2569\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\",\n            onClick$: /*#__PURE__*/ inlinedQrl(()=>console.log('warn'), \"App_component_Cmp_p_onClick_vuXzfUTkpto\")\n        }, \"Hello Qwik\", 3, null)\n    }, 3, \"u6_0\");\n}, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;AAGA,OAAO,MAAM,oBAAM,sCAAW,CAAC;IAC3B,qBACI,MAAC;kBACG,cAAA,MAAC;YAAE,OAAM;YAAQ,QAAQ,2BAAE,IAAM,QAAQ,GAAG,CAAC;WAAS;;AAGlE,iCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_preserve_filenames_segments.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2593\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    foo();\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\nexport const foo = () => console.log('foo');\n\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0.js\"), \"App_component_ckEPmXZlub0\"));\nexport const foo = ()=>console.log('foo');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,oHAOhB;AAEH,OAAO,MAAM,MAAM,IAAM,QAAQ,GAAG,CAAC,OAAO\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { foo } from \"./test.tsx\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    foo();\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\",\n            onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto.js\"), \"App_component_Cmp_p_onClick_vuXzfUTkpto\")\n        }, \"Hello Qwik\", 3, null)\n    }, 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;yCAG8B,CAAC;IAC3B;IACA,qBACI,MAAC;kBACG,cAAA,MAAC;YAAE,OAAM;YAAQ,QAAQ;WAA6B;;AAGlE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    90,\n    252\n  ]\n}\n*/\n============================= test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto.js (ENTRY POINT)==\n\nexport const App_component_Cmp_p_onClick_vuXzfUTkpto = ()=>console.log('warn');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"uDAOuC,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_Cmp_p_onClick_vuXzfUTkpto\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_Cmp_p_onClick\",\n  \"hash\": \"vuXzfUTkpto\",\n  \"canonicalFilename\": \"test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    187,\n    212\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_prod_node.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1347\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n    return (\n        <div>\n            <div onClick$={() => console.log('first')}/>\n            <div onClick$={() => console.log('second')}/>\n            <div onClick$={() => console.log('third')}/>\n        </div>\n    );\n});\n\n============================= test.tsx_Foo_component_HTDRsvUbLiE.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const s_HTDRsvUbLiE = ()=>{\n    return <div>\n            <div onClick$={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_div_onClick_9DcJc0uJDDo\"), \"s_9DcJc0uJDDo\")}/>\n            <div onClick$={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_div_onClick_1_RjQdy8I0MXc\"), \"s_RjQdy8I0MXc\")}/>\n            <div onClick$={/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_div_onClick_2_w9ptFRBVK1E\"), \"s_w9ptFRBVK1E\")}/>\n        </div>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";6BAG8B;IAC1B,QACK,IAAI;YACD,CAAC,IAAI,mHAAuC;YAC5C,CAAC,IAAI,qHAAwC;YAC7C,CAAC,IAAI,qHAAuC;QAChD,EAAE;AAEV\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"s_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    80,\n    310\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_div_onClick_9DcJc0uJDDo.tsx (ENTRY POINT)==\n\nexport const s_9DcJc0uJDDo = ()=>console.log('first');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"6BAM2B,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"s_9DcJc0uJDDo\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_div_onClick\",\n  \"hash\": \"9DcJc0uJDDo\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_div_onClick_9DcJc0uJDDo\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"s_HTDRsvUbLiE\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    142,\n    168\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_div_onClick_2_w9ptFRBVK1E.tsx (ENTRY POINT)==\n\nexport const s_w9ptFRBVK1E = ()=>console.log('third');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"6BAQ2B,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"s_w9ptFRBVK1E\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_div_onClick_2\",\n  \"hash\": \"w9ptFRBVK1E\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_div_onClick_2_w9ptFRBVK1E\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"s_HTDRsvUbLiE\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    257,\n    283\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_div_onClick_1_RjQdy8I0MXc.tsx (ENTRY POINT)==\n\nexport const s_RjQdy8I0MXc = ()=>console.log('second');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"6BAO2B,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"s_RjQdy8I0MXc\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_div_onClick_1\",\n  \"hash\": \"RjQdy8I0MXc\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_div_onClick_1_RjQdy8I0MXc\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"s_HTDRsvUbLiE\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    199,\n    226\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"s_HTDRsvUbLiE\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,qGAQhB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_props_optimization.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 515\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useTask$ } from '@builder.io/qwik';\nimport { CONST } from 'const';\nexport const Works = component$(({\n    count,\n    some = 1+2,\n    hello = CONST,\n    stuff: hey,\n    stuffDefault: hey2 = 123,\n    ...rest}) => {\n    console.log(hey, some);\n    useTask$(({track}) => {\n        track(() => count);\n        console.log(count, rest, hey, some, hey2);\n    });\n    return (\n        <div some={some} params={{ some }} class={count} {...rest} override>{count}</div>\n    );\n});\n\nexport const NoWorks2 = component$(({count, stuff: {hey}}) => {\n    console.log(hey);\n    useTask$(({track}) => {\n        track(() => count);\n        console.log(count);\n    });\n    return (\n        <div class={count}>{count}</div>\n    );\n});\n\nexport const NoWorks3 = component$(({count, stuff = hola()}) => {\n    console.log(stuff);\n    useTask$(({track}) => {\n        track(() => count);\n        console.log(count);\n    });\n    return (\n        <div class={count}>{count}</div>\n    );\n});\n\n============================= test.js ==\n\nimport { _restProps } from \"@builder.io/qwik\";\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { _jsxS } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const Works = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n    const rest = _restProps(props, [\n        \"count\",\n        \"some\",\n        \"hello\",\n        \"stuff\",\n        \"stuffDefault\"\n    ]);\n    console.log(props.stuff, props.some ?? 3);\n    useTaskQrl(/*#__PURE__*/ inlinedQrl(({ track })=>{\n        const [props, rest] = useLexicalScope();\n        track(()=>props.count);\n        console.log(props.count, rest, props.stuff, props.some ?? 3, props.stuffDefault ?? 123);\n    }, \"Works_component_useTask_pjo5U5Ikll0\", [\n        props,\n        rest\n    ]));\n    return /*#__PURE__*/ _jsxS(\"div\", {\n        get some () {\n            return props.some ?? 3;\n        },\n        get params () {\n            return {\n                some: props.some ?? 3\n            };\n        },\n        get class () {\n            return props.count;\n        },\n        ...rest,\n        override: true,\n        children: _fnSignal((p0)=>p0.count, [\n            props\n        ], \"p0.count\")\n    }, {\n        some: _fnSignal((p0)=>p0.some ?? 3, [\n            props\n        ], \"p0.some??1+2\"),\n        params: _fnSignal((p0)=>({\n                some: p0.some ?? 3\n            }), [\n            props\n        ], \"{some:p0.some??1+2}\"),\n        class: _fnSignal((p0)=>p0.count, [\n            props\n        ], \"p0.count\"),\n        override: _IMMUTABLE\n    }, 0, \"u6_0\");\n}, \"Works_component_t45qL4vNGv0\"));\nexport const NoWorks2 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(({ count, stuff: { hey } })=>{\n    console.log(hey);\n    useTaskQrl(/*#__PURE__*/ inlinedQrl(({ track })=>{\n        const [count] = useLexicalScope();\n        track(()=>count);\n        console.log(count);\n    }, \"NoWorks2_component_useTask_lXiqwbxxjq0\", [\n        count\n    ]));\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        class: count\n    }, null, count, 1, \"u6_1\");\n}, \"NoWorks2_component_JPD9t2HyEKg\"));\nexport const NoWorks3 = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(({ count, stuff = hola() })=>{\n    console.log(stuff);\n    useTaskQrl(/*#__PURE__*/ inlinedQrl(({ track })=>{\n        const [count] = useLexicalScope();\n        track(()=>count);\n        console.log(count);\n    }, \"NoWorks3_component_useTask_3cQGU0s1VwU\", [\n        count\n    ]));\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        class: count\n    }, null, count, 1, \"u6_2\");\n}, \"NoWorks3_component_fc13h5yYn14\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;AAGA,OAAO,MAAM,sBAAQ,sCAAW;;;;;;;;IAO5B,QAAQ,GAAG,OAHX,aAFA,QAAO;IAMP,oCAAS,CAAC,EAAC,KAAK,EAAC;;QACb,MAAM,UARV;QASI,QAAQ,GAAG,OATf,OASuB,YANvB,aAFA,QAAO,SAGP,gBAAqB;;;;;IAOrB,qBACI,MAAC;YAAI;yBAXT,QAAO;;YAWc;mBAAQ;gBAAE,IAAI,QAXnC,QAAO;YAW6B;;YAAG;yBAZvC;;QAYsD,GAAG,IAAI;QAAE,QAAQ;qCAZvE;;;;QAYS,IAAI,qBAXb,QAAO;;;QAWc,MAAM,kBAAE,CAAA;gBAAE,IAAI,KAXnC,QAAO;YAW6B,CAAA;;;QAAG,KAAK,qBAZ5C;;;QAY+D,QAAQ;;AAE3E,mCAAG;AAEH,OAAO,MAAM,yBAAW,sCAAW,CAAC,EAAC,KAAK,EAAE,OAAO,EAAC,GAAG,EAAC,EAAC;IACrD,QAAQ,GAAG,CAAC;IACZ,oCAAS,CAAC,EAAC,KAAK,EAAC;;QACb,MAAM,IAAM;QACZ,QAAQ,GAAG,CAAC;;;;IAEhB,qBACI,MAAC;QAAI,OAAO;aAAQ;AAE5B,sCAAG;AAEH,OAAO,MAAM,yBAAW,sCAAW,CAAC,EAAC,KAAK,EAAE,QAAQ,MAAM,EAAC;IACvD,QAAQ,GAAG,CAAC;IACZ,oCAAS,CAAC,EAAC,KAAK,EAAC;;QACb,MAAM,IAAM;QACZ,QAAQ,GAAG,CAAC;;;;IAEhB,qBACI,MAAC;QAAI,OAAO;aAAQ;AAE5B,sCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_qwik_conflict.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1127\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useStyles } from '@builder.io/qwik';\nimport { qrl } from '@builder.io/qwik/what';\n\nexport const hW = 12;\nexport const handleWatch = 42;\n\nconst componentQrl = () => console.log('not this', qrl());\n\ncomponentQrl();\nexport const Foo = component$(() => {\n    useStyles$('thing');\n    const qwik = hW + handleWatch;\n    console.log(qwik);\n    const qrl = 23;\n    return (\n        <div onClick$={()=> console.log(qrl)}/>\n    )\n}, {\n    tagName: \"my-foo\",\n});\n\nexport const Root = component$(() => {\n    useStyles($('thing'));\n    return $(() => {\n        return (\n            <div/>\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { qrl as qrl1 } from '@builder.io/qwik/what';\nexport const hW = 12;\nexport const handleWatch = 42;\nconst componentQrl1 = ()=>console.log('not this', qrl1());\ncomponentQrl1();\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"), {\n    tagName: \"my-foo\"\n});\nexport const Root = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Root_component_royhjYaCbYE\"), \"Root_component_royhjYaCbYE\"), {\n    tagName: \"my-foo\"\n});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEA,SAAS,OAAA,IAAG,QAAQ,wBAAwB;AAE5C,OAAO,MAAM,KAAK,GAAG;AACrB,OAAO,MAAM,cAAc,GAAG;AAE9B,MAAM,gBAAe,IAAM,QAAQ,GAAG,CAAC,YAAY;AAEnD;AACA,OAAO,MAAM,oBAAM,iHAQhB;IACC,SAAS;AACb,GAAG;AAEH,OAAO,MAAM,qBAAO,mHAOjB;IACC,SAAS;AACb,GAAG\\\"}\")\n============================= test.tsx_Foo_component_HTDRsvUbLiE.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { hW } from \"./test\";\nimport { handleWatch } from \"./test\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo_component_HTDRsvUbLiE = ()=>{\n    useStyles$('thing');\n    const qwik = hW + handleWatch;\n    console.log(qwik);\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_div_onClick_M48DYiidSJw\"), \"Foo_component_div_onClick_M48DYiidSJw\")\n    }, null, 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;yCAU8B;IAC1B,WAAW;IACX,MAAM,OAAO,KAAK;IAClB,QAAQ,GAAG,CAAC;IAEZ,qBACI,MAAC;QAAI,QAAQ;;AAErB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    269,\n    448\n  ]\n}\n*/\n============================= test.tsx_Root_component_useStyles_u5DkUxGrGnU.js (ENTRY POINT)==\n\nexport const Root_component_useStyles_u5DkUxGrGnU = 'thing';\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"oDAuBgB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Root_component_useStyles_u5DkUxGrGnU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Root_component_useStyles\",\n  \"hash\": \"u5DkUxGrGnU\",\n  \"canonicalFilename\": \"test.tsx_Root_component_useStyles_u5DkUxGrGnU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Root_component_royhjYaCbYE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    535,\n    542\n  ]\n}\n*/\n============================= test.tsx_Root_component_royhjYaCbYE.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStyles } from \"@builder.io/qwik\";\nexport const Root_component_royhjYaCbYE = ()=>{\n    useStyles(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Root_component_useStyles_u5DkUxGrGnU\"), \"Root_component_useStyles_u5DkUxGrGnU\"));\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Root_component_1_cBpQNYDUHI4\"), \"Root_component_1_cBpQNYDUHI4\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;0CAsB+B;IAC3B;IACA;AAKJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Root_component_royhjYaCbYE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Root_component\",\n  \"hash\": \"royhjYaCbYE\",\n  \"canonicalFilename\": \"test.tsx_Root_component_royhjYaCbYE\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    511,\n    622\n  ]\n}\n*/\n============================= test.tsx_Root_component_1_cBpQNYDUHI4.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const Root_component_1_cBpQNYDUHI4 = ()=>{\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"u6_1\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";4CAwBa;IACL,qBACI,MAAC;AAET\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Root_component_1_cBpQNYDUHI4\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Root_component_1\",\n  \"hash\": \"cBpQNYDUHI4\",\n  \"canonicalFilename\": \"test.tsx_Root_component_1_cBpQNYDUHI4\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Root_component_royhjYaCbYE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    559,\n    618\n  ]\n}\n*/\n============================= test.tsx_Foo_component_div_onClick_M48DYiidSJw.js (ENTRY POINT)==\n\nexport const Foo_component_div_onClick_M48DYiidSJw = ()=>console.log(23);\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"qDAgBuB,IAAK,QAAQ,GAAG,CAFvB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_div_onClick_M48DYiidSJw\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_div_onClick\",\n  \"hash\": \"M48DYiidSJw\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_div_onClick_M48DYiidSJw\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Foo_component_HTDRsvUbLiE\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    416,\n    437\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_qwik_react.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3008\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { componentQrl, inlinedQrl, useLexicalScope, useHostElement, useStore, useTaskQrl, noSerialize, SkipRerender, implicit$FirstArg } from '@builder.io/qwik';\nimport { jsx, Fragment } from '@builder.io/qwik/jsx-runtime';\nimport { isBrowser, isServer } from '@builder.io/qwik/build';\n\nfunction qwikifyQrl(reactCmpQrl) {\n    return /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{\n        const [reactCmpQrl] = useLexicalScope();\n        const hostElement = useHostElement();\n        const store = useStore({});\n        let run;\n        if (props['client:visible']) run = 'visible';\n        else if (props['client:load'] || props['client:only']) run = 'load';\n        useTaskQrl(inlinedQrl(async (track)=>{\n            const [hostElement, props, reactCmpQrl, store] = useLexicalScope();\n            track(props);\n            if (isBrowser) {\n                if (store.data) store.data.root.render(store.data.client.Main(store.data.cmp, filterProps(props)));\n                else {\n                    const [Cmp, client] = await Promise.all([\n                        reactCmpQrl.resolve(),\n                        import('./client-f762f78c.js')\n                    ]);\n                    let root;\n                    if (hostElement.childElementCount > 0) root = client.hydrateRoot(hostElement, client.Main(Cmp, filterProps(props), store.event));\n                    else {\n                        root = client.createRoot(hostElement);\n                        root.render(client.Main(Cmp, filterProps(props)));\n                    }\n                    store.data = noSerialize({\n                        client,\n                        cmp: Cmp,\n                        root\n                    });\n                }\n            }\n        }, \"qwikifyQrl_component_useWatch_x04JC5xeP1U\", [\n            hostElement,\n            props,\n            reactCmpQrl,\n            store\n        ]), {\n            run\n        });\n        if (isServer && !props['client:only']) {\n            const jsx$1 = Promise.all([\n                reactCmpQrl.resolve(),\n                import('./server-9ac6caad.js')\n            ]).then(([Cmp, server])=>{\n                const html = server.render(Cmp, filterProps(props));\n                return /*#__PURE__*/ jsx(Host, {\n                    dangerouslySetInnerHTML: html,\n                    [_IMMUTABLE]: [\n                        \"dangerouslySetInnerHTML\"\n                    ]\n                });\n            });\n            return /*#__PURE__*/ jsx(Fragment, {\n                children: jsx$1\n            });\n        }\n        return /*#__PURE__*/ jsx(Host, {\n            children: /*#__PURE__*/ jsx(SkipRerender, {})\n        });\n    }, \"qwikifyQrl_component_zH94hIe0Ick\", [\n        reactCmpQrl\n    ]), {\n        tagName: 'qwik-wrap'\n    });\n}\nconst filterProps = (props)=>{\n    const obj = {};\n    Object.keys(props).forEach((key)=>{\n        if (!key.startsWith('client:')) obj[key] = props[key];\n    });\n    return obj;\n};\nconst qwikify$ = implicit$FirstArg(qwikifyQrl);\n\nasync function renderToString(rootNode, opts) {\n    const mod = await import('./server-9ac6caad.js');\n    const result = await mod.renderToString(rootNode, opts);\n    const styles = mod.getGlobalStyleTag(result.html);\n    const finalHtml = styles + result.html;\n    return {\n        ...result,\n        html: finalHtml\n    };\n}\n\nexport { qwikify$, qwikifyQrl, renderToString };\n        \n============================= ../node_modules/@builder.io/qwik-react/index.qwik.mjs_qwikifyQrl_component_useWatch_x04JC5xeP1U.mjs (ENTRY POINT)==\n\nimport { _auto_filterProps as filterProps } from \"./index.qwik.mjs\";\nimport { isBrowser } from \"@builder.io/qwik/build\";\nimport { noSerialize } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const qwikifyQrl_component_useWatch_x04JC5xeP1U = async (track)=>{\n    const [hostElement, props, reactCmpQrl, store] = useLexicalScope();\n    track(props);\n    if (isBrowser) {\n        if (store.data) store.data.root.render(store.data.client.Main(store.data.cmp, filterProps(props)));\n        else {\n            const [Cmp, client] = await Promise.all([\n                reactCmpQrl.resolve(),\n                import('./client-f762f78c.js')\n            ]);\n            let root;\n            if (hostElement.childElementCount > 0) root = client.hydrateRoot(hostElement, client.Main(Cmp, filterProps(props), store.event));\n            else {\n                root = client.createRoot(hostElement);\n                root.render(client.Main(Cmp, filterProps(props)));\n            }\n            store.data = noSerialize({\n                client,\n                cmp: Cmp,\n                root\n            });\n        }\n    }\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-react/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;yDAa8B,OAAO;IACzB,MAAM,CAAC,aAAa,OAAO,aAAa,MAAM,GAAG;IACjD,MAAM;IACN,IAAI;QACA,IAAI,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,YAAY;aACrF;YACD,MAAM,CAAC,KAAK,OAAO,GAAG,MAAM,QAAQ,GAAG,CAAC;gBACpC,YAAY,OAAO;gBACnB,MAAM,CAAC;aACV;YACD,IAAI;YACJ,IAAI,YAAY,iBAAiB,GAAG,GAAG,OAAO,OAAO,WAAW,CAAC,aAAa,OAAO,IAAI,CAAC,KAAK,YAAY,QAAQ,MAAM,KAAK;iBACzH;gBACD,OAAO,OAAO,UAAU,CAAC;gBACzB,KAAK,MAAM,CAAC,OAAO,IAAI,CAAC,KAAK,YAAY;YAC7C;YACA,MAAM,IAAI,GAAG,YAAY;gBACrB;gBACA,KAAK;gBACL;YACJ;QACJ;;AAER\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-react/index.qwik.mjs\",\n  \"name\": \"qwikifyQrl_component_useWatch_x04JC5xeP1U\",\n  \"entry\": null,\n  \"displayName\": \"index.qwik.mjs_qwikifyQrl_component_useWatch\",\n  \"hash\": \"x04JC5xeP1U\",\n  \"canonicalFilename\": \"index.qwik.mjs_qwikifyQrl_component_useWatch_x04JC5xeP1U\",\n  \"path\": \"../node_modules/@builder.io/qwik-react\",\n  \"extension\": \"mjs\",\n  \"parent\": \"qwikifyQrl_component_zH94hIe0Ick\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": true,\n  \"loc\": [\n    693,\n    1746\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-react/index.qwik.mjs_qwikifyQrl_component_zH94hIe0Ick.mjs (ENTRY POINT)==\n\nimport { Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { SkipRerender } from \"@builder.io/qwik\";\nimport { _jsxBranch } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _auto_filterProps as filterProps } from \"./index.qwik.mjs\";\nimport { isServer } from \"@builder.io/qwik/build\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useHostElement } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nexport const qwikifyQrl_component_zH94hIe0Ick = (props)=>{\n    _jsxBranch();\n    const [reactCmpQrl] = useLexicalScope();\n    const hostElement = useHostElement();\n    const store = useStore({});\n    let run;\n    if (props['client:visible']) run = 'visible';\n    else if (props['client:load'] || props['client:only']) run = 'load';\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_qwikifyQrl_component_useWatch_x04JC5xeP1U.mjs\"), \"qwikifyQrl_component_useWatch_x04JC5xeP1U\", [\n        hostElement,\n        props,\n        reactCmpQrl,\n        store\n    ]), {\n        run\n    });\n    if (isServer && !props['client:only']) {\n        const jsx$1 = Promise.all([\n            reactCmpQrl.resolve(),\n            import('./server-9ac6caad.js')\n        ]).then(([Cmp, server])=>{\n            const html = server.render(Cmp, filterProps(props));\n            return /*#__PURE__*/ _jsxC(Host, {\n                dangerouslySetInnerHTML: html,\n                [_IMMUTABLE]: [\n                    \"dangerouslySetInnerHTML\"\n                ]\n            }, 3, \"mR_0\");\n        });\n        return /*#__PURE__*/ _jsxC(Fragment, {\n            children: jsx$1\n        }, 1, \"mR_1\");\n    }\n    return /*#__PURE__*/ _jsxC(Host, {\n        children: /*#__PURE__*/ _jsxC(SkipRerender, null, 3, \"mR_2\")\n    }, 1, \"mR_3\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-react/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;;gDAMiD,CAAC;;IAC1C,MAAM,CAAC,YAAY,GAAG;IACtB,MAAM,cAAc;IACpB,MAAM,QAAQ,SAAS,CAAC;IACxB,IAAI;IACJ,IAAI,KAAK,CAAC,iBAAiB,EAAE,MAAM;SAC9B,IAAI,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,EAAE,MAAM;IAC7D;;;;;QA4BI;QACA;IACJ;IACA,IAAI,YAAY,CAAC,KAAK,CAAC,cAAc,EAAE;QACnC,MAAM,QAAQ,QAAQ,GAAG,CAAC;YACtB,YAAY,OAAO;YACnB,MAAM,CAAC;SACV,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO;YAClB,MAAM,OAAO,OAAO,MAAM,CAAC,KAAK,YAAY;YAC5C,OAAO,WAAW,GAAG,MAAI;gBACrB,yBAAyB;gBACzB,CAAC,WAAW,EAAE;oBACV;iBACH;;QAET;QACA,OAAO,WAAW,GAAG,MAAI;YACrB,UAAU;;IAElB;IACA,OAAO,WAAW,GAAG,MAAI;QACrB,UAAU,WAAW,GAAG,MAAI;;AAEpC\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-react/index.qwik.mjs\",\n  \"name\": \"qwikifyQrl_component_zH94hIe0Ick\",\n  \"entry\": null,\n  \"displayName\": \"index.qwik.mjs_qwikifyQrl_component\",\n  \"hash\": \"zH94hIe0Ick\",\n  \"canonicalFilename\": \"index.qwik.mjs_qwikifyQrl_component_zH94hIe0Ick\",\n  \"path\": \"../node_modules/@builder.io/qwik-react\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": true,\n  \"loc\": [\n    373,\n    2674\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-react/index.qwik.mjs ==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { componentQrl, implicit$FirstArg } from '@builder.io/qwik';\nfunction qwikifyQrl(reactCmpQrl) {\n    return /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_qwikifyQrl_component_zH94hIe0Ick.mjs\"), \"qwikifyQrl_component_zH94hIe0Ick\", [\n        reactCmpQrl\n    ]), {\n        tagName: 'qwik-wrap'\n    });\n}\nconst filterProps = (props)=>{\n    const obj = {};\n    Object.keys(props).forEach((key)=>{\n        if (!key.startsWith('client:')) obj[key] = props[key];\n    });\n    return obj;\n};\nconst qwikify$ = implicit$FirstArg(qwikifyQrl);\nasync function renderToString(rootNode, opts) {\n    const mod = await import('./server-9ac6caad.js');\n    const result = await mod.renderToString(rootNode, opts);\n    const styles = mod.getGlobalStyleTag(result.html);\n    const finalHtml = styles + result.html;\n    return {\n        ...result,\n        html: finalHtml\n    };\n}\nexport { qwikify$, qwikifyQrl, renderToString };\nexport { filterProps as _auto_filterProps };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-react/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";AACA,SAAS,YAAY,EAAgG,iBAAiB,QAAQ,mBAAmB;AAIjK,SAAS,WAAW,WAAW;IAC3B,OAAO,WAAW,GAAG;;QA4DjB;QACA,SAAS;IACb;AACJ;AACA,MAAM,cAAc,CAAC;IACjB,MAAM,MAAM,CAAC;IACb,OAAO,IAAI,CAAC,OAAO,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,UAAU,CAAC,YAAY,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;IACzD;IACA,OAAO;AACX;AACA,MAAM,WAAW,kBAAkB;AAEnC,eAAe,eAAe,QAAQ,EAAE,IAAI;IACxC,MAAM,MAAM,MAAM,MAAM,CAAC;IACzB,MAAM,SAAS,MAAM,IAAI,cAAc,CAAC,UAAU;IAClD,MAAM,SAAS,IAAI,iBAAiB,CAAC,OAAO,IAAI;IAChD,MAAM,YAAY,SAAS,OAAO,IAAI;IACtC,OAAO;QACH,GAAG,MAAM;QACT,MAAM;IACV;AACJ;AAEA,SAAS,QAAQ,EAAE,UAAU,EAAE,cAAc,GAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_qwik_react_inline.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3111\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { componentQrl, inlinedQrl, useLexicalScope, useHostElement, useStore, useTaskQrl, noSerialize, SkipRerender, implicit$FirstArg } from '@builder.io/qwik';\nimport { jsx, Fragment } from '@builder.io/qwik/jsx-runtime';\nimport { isBrowser, isServer } from '@builder.io/qwik/build';\n\nfunction qwikifyQrl(reactCmpQrl) {\n    return /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{\n        const [reactCmpQrl] = useLexicalScope();\n        const hostElement = useHostElement();\n        const store = useStore({});\n        let run;\n        if (props['client:visible']) run = 'visible';\n        else if (props['client:load'] || props['client:only']) run = 'load';\n        useTaskQrl(inlinedQrl(async (track)=>{\n            const [hostElement, props, reactCmpQrl, store] = useLexicalScope();\n            track(props);\n            if (isBrowser) {\n                if (store.data) store.data.root.render(store.data.client.Main(store.data.cmp, filterProps(props)));\n                else {\n                    const [Cmp, client] = await Promise.all([\n                        reactCmpQrl.resolve(),\n                        import('./client-f762f78c.js')\n                    ]);\n                    let root;\n                    if (hostElement.childElementCount > 0) root = client.hydrateRoot(hostElement, client.Main(Cmp, filterProps(props), store.event));\n                    else {\n                        root = client.createRoot(hostElement);\n                        root.render(client.Main(Cmp, filterProps(props)));\n                    }\n                    store.data = noSerialize({\n                        client,\n                        cmp: Cmp,\n                        root\n                    });\n                }\n            }\n        }, \"qwikifyQrl_component_useWatch_x04JC5xeP1U\", [\n            hostElement,\n            props,\n            reactCmpQrl,\n            store\n        ]), {\n            run\n        });\n        if (isServer && !props['client:only']) {\n            const jsx$1 = Promise.all([\n                reactCmpQrl.resolve(),\n                import('./server-9ac6caad.js')\n            ]).then(([Cmp, server])=>{\n                const html = server.render(Cmp, filterProps(props));\n                return /*#__PURE__*/ jsx(Host, {\n                    dangerouslySetInnerHTML: html,\n                    [_IMMUTABLE]: [\n                        \"dangerouslySetInnerHTML\"\n                    ]\n                });\n            });\n            return /*#__PURE__*/ jsx(Fragment, {\n                children: jsx$1\n            });\n        }\n        return /*#__PURE__*/ jsx(Host, {\n            children: /*#__PURE__*/ jsx(SkipRerender, {})\n        });\n    }, \"qwikifyQrl_component_zH94hIe0Ick\", [\n        reactCmpQrl\n    ]), {\n        tagName: 'qwik-wrap'\n    });\n}\nconst filterProps = (props)=>{\n    const obj = {};\n    Object.keys(props).forEach((key)=>{\n        if (!key.startsWith('client:')) obj[key] = props[key];\n    });\n    return obj;\n};\nconst qwikify$ = implicit$FirstArg(qwikifyQrl);\n\nasync function renderToString(rootNode, opts) {\n    const mod = await import('./server-9ac6caad.js');\n    const result = await mod.renderToString(rootNode, opts);\n    const styles = mod.getGlobalStyleTag(result.html);\n    const finalHtml = styles + result.html;\n    return {\n        ...result,\n        html: finalHtml\n    };\n}\n\nexport { qwikify$, qwikifyQrl, renderToString };\n        \n============================= ../node_modules/@builder.io/qwik-react/index.qwik.mjs ==\n\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxBranch } from \"@builder.io/qwik\";\nimport { componentQrl, inlinedQrl, useLexicalScope, useHostElement, useStore, useTaskQrl, noSerialize, SkipRerender, implicit$FirstArg } from '@builder.io/qwik';\nimport { Fragment } from '@builder.io/qwik/jsx-runtime';\nimport { isBrowser, isServer } from '@builder.io/qwik/build';\nfunction qwikifyQrl(reactCmpQrl) {\n    return /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n        _jsxBranch();\n        const [reactCmpQrl] = useLexicalScope();\n        const hostElement = useHostElement();\n        const store = useStore({});\n        let run;\n        if (props['client:visible']) run = 'visible';\n        else if (props['client:load'] || props['client:only']) run = 'load';\n        useTaskQrl(/*#__PURE__*/ inlinedQrl(async (track)=>{\n            const [hostElement, props, reactCmpQrl, store] = useLexicalScope();\n            track(props);\n            if (isBrowser) {\n                if (store.data) store.data.root.render(store.data.client.Main(store.data.cmp, filterProps(props)));\n                else {\n                    const [Cmp, client] = await Promise.all([\n                        reactCmpQrl.resolve(),\n                        import('./client-f762f78c.js')\n                    ]);\n                    let root;\n                    if (hostElement.childElementCount > 0) root = client.hydrateRoot(hostElement, client.Main(Cmp, filterProps(props), store.event));\n                    else {\n                        root = client.createRoot(hostElement);\n                        root.render(client.Main(Cmp, filterProps(props)));\n                    }\n                    store.data = noSerialize({\n                        client,\n                        cmp: Cmp,\n                        root\n                    });\n                }\n            }\n        }, \"qwikifyQrl_component_useWatch_x04JC5xeP1U\", [\n            hostElement,\n            props,\n            reactCmpQrl,\n            store\n        ]), {\n            run\n        });\n        if (isServer && !props['client:only']) {\n            const jsx$1 = Promise.all([\n                reactCmpQrl.resolve(),\n                import('./server-9ac6caad.js')\n            ]).then(([Cmp, server])=>{\n                const html = server.render(Cmp, filterProps(props));\n                return /*#__PURE__*/ _jsxC(Host, {\n                    dangerouslySetInnerHTML: html,\n                    [_IMMUTABLE]: [\n                        \"dangerouslySetInnerHTML\"\n                    ]\n                }, 3, \"mR_0\");\n            });\n            return /*#__PURE__*/ _jsxC(Fragment, {\n                children: jsx$1\n            }, 1, \"mR_1\");\n        }\n        return /*#__PURE__*/ _jsxC(Host, {\n            children: /*#__PURE__*/ _jsxC(SkipRerender, null, 3, \"mR_2\")\n        }, 1, \"mR_3\");\n    }, \"qwikifyQrl_component_zH94hIe0Ick\", [\n        reactCmpQrl\n    ]), {\n        tagName: 'qwik-wrap'\n    });\n}\nconst filterProps = (props)=>{\n    const obj = {};\n    Object.keys(props).forEach((key)=>{\n        if (!key.startsWith('client:')) obj[key] = props[key];\n    });\n    return obj;\n};\nconst qwikify$ = implicit$FirstArg(qwikifyQrl);\nasync function renderToString(rootNode, opts) {\n    const mod = await import('./server-9ac6caad.js');\n    const result = await mod.renderToString(rootNode, opts);\n    const styles = mod.getGlobalStyleTag(result.html);\n    const finalHtml = styles + result.html;\n    return {\n        ...result,\n        html: finalHtml\n    };\n}\nexport { qwikify$, qwikifyQrl, renderToString };\nexport { filterProps as _auto_filterProps };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-react/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AACA,SAAS,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,QAAQ,mBAAmB;AACjK,SAAc,QAAQ,QAAQ,+BAA+B;AAC7D,SAAS,SAAS,EAAE,QAAQ,QAAQ,yBAAyB;AAE7D,SAAS,WAAW,WAAW;IAC3B,OAAO,WAAW,GAAG,sCAAwB,CAAC;;QAC1C,MAAM,CAAC,YAAY,GAAG;QACtB,MAAM,cAAc;QACpB,MAAM,QAAQ,SAAS,CAAC;QACxB,IAAI;QACJ,IAAI,KAAK,CAAC,iBAAiB,EAAE,MAAM;aAC9B,IAAI,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,EAAE,MAAM;QAC7D,oCAAsB,OAAO;YACzB,MAAM,CAAC,aAAa,OAAO,aAAa,MAAM,GAAG;YACjD,MAAM;YACN,IAAI;gBACA,IAAI,MAAM,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,YAAY;qBACrF;oBACD,MAAM,CAAC,KAAK,OAAO,GAAG,MAAM,QAAQ,GAAG,CAAC;wBACpC,YAAY,OAAO;wBACnB,MAAM,CAAC;qBACV;oBACD,IAAI;oBACJ,IAAI,YAAY,iBAAiB,GAAG,GAAG,OAAO,OAAO,WAAW,CAAC,aAAa,OAAO,IAAI,CAAC,KAAK,YAAY,QAAQ,MAAM,KAAK;yBACzH;wBACD,OAAO,OAAO,UAAU,CAAC;wBACzB,KAAK,MAAM,CAAC,OAAO,IAAI,CAAC,KAAK,YAAY;oBAC7C;oBACA,MAAM,IAAI,GAAG,YAAY;wBACrB;wBACA,KAAK;wBACL;oBACJ;gBACJ;;QAER;;;;;YAKI;YACA;QACJ;QACA,IAAI,YAAY,CAAC,KAAK,CAAC,cAAc,EAAE;YACnC,MAAM,QAAQ,QAAQ,GAAG,CAAC;gBACtB,YAAY,OAAO;gBACnB,MAAM,CAAC;aACV,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO;gBAClB,MAAM,OAAO,OAAO,MAAM,CAAC,KAAK,YAAY;gBAC5C,OAAO,WAAW,GAAG,MAAI;oBACrB,yBAAyB;oBACzB,CAAC,WAAW,EAAE;wBACV;qBACH;;YAET;YACA,OAAO,WAAW,GAAG,MAAI;gBACrB,UAAU;;QAElB;QACA,OAAO,WAAW,GAAG,MAAI;YACrB,UAAU,WAAW,GAAG,MAAI;;IAEpC;;QAEI;QACA,SAAS;IACb;AACJ;AACA,MAAM,cAAc,CAAC;IACjB,MAAM,MAAM,CAAC;IACb,OAAO,IAAI,CAAC,OAAO,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,UAAU,CAAC,YAAY,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;IACzD;IACA,OAAO;AACX;AACA,MAAM,WAAW,kBAAkB;AAEnC,eAAe,eAAe,QAAQ,EAAE,IAAI;IACxC,MAAM,MAAM,MAAM,MAAM,CAAC;IACzB,MAAM,SAAS,MAAM,IAAI,cAAc,CAAC,UAAU;IAClD,MAAM,SAAS,IAAI,iBAAiB,CAAC,OAAO,IAAI;IAChD,MAAM,YAAY,SAAS,OAAO,IAAI;IACtC,OAAO;QACH,GAAG,MAAM;QACT,MAAM;IACV;AACJ;AAEA,SAAS,QAAQ,EAAE,UAAU,EAAE,cAAc,GAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_qwik_sdk_inline.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3214\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\nimport {\n  createContextId,\n  componentQrl,\n  inlinedQrl,\n  _jsxBranch,\n  useOnDocument,\n  eventQrl,\n  useContext,\n  _jsxC,\n  SkipRender,\n  withLocale,\n  _deserializeData,\n  noSerialize,\n  useServerData,\n  useStylesQrl,\n  useStore,\n  _weakSerialize,\n  useSignal,\n  useLexicalScope,\n  _getContextElement,\n  useContextProvider,\n  useTaskQrl,\n  Slot,\n  getLocale,\n  untrack,\n  _jsxS,\n  _jsxQ,\n  _wrapSignal,\n  implicit$FirstArg,\n  _serializeData,\n  _restProps,\n  _fnSignal,\n} from '@builder.io/qwik';\nimport { isBrowser, isServer, isDev } from '@builder.io/qwik/build';\nimport * as qwikCity from '@qwik-city-plan';\nimport swRegister from '@qwik-city-sw-register';\nimport { z } from 'zod';\nimport { z as z2 } from 'zod';\nconst RouteStateContext = /* @__PURE__ */ createContextId('qc-s');\nconst ContentContext = /* @__PURE__ */ createContextId('qc-c');\nconst ContentInternalContext = /* @__PURE__ */ createContextId('qc-ic');\nconst DocumentHeadContext = /* @__PURE__ */ createContextId('qc-h');\nconst RouteLocationContext = /* @__PURE__ */ createContextId('qc-l');\nconst RouteNavigateContext = /* @__PURE__ */ createContextId('qc-n');\nconst RouteActionContext = /* @__PURE__ */ createContextId('qc-a');\nconst RouterOutlet = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl(() => {\n    _jsxBranch();\n    useOnDocument(\n      'qinit',\n      eventQrl(\n        /* @__PURE__ */ inlinedQrl(() => {\n          const POPSTATE_FALLBACK_INITIALIZED = '_qCityPopstateFallback';\n          const CLIENT_HISTORY_INITIALIZED = '_qCityHistory';\n          if (!window[POPSTATE_FALLBACK_INITIALIZED]) {\n            window[POPSTATE_FALLBACK_INITIALIZED] = () => {\n              if (!window[CLIENT_HISTORY_INITIALIZED]) location.reload();\n            };\n            setTimeout(() => {\n              addEventListener('popstate', window[POPSTATE_FALLBACK_INITIALIZED]);\n            }, 0);\n          }\n        }, 'RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc')\n      )\n    );\n    const context = useContext(ContentInternalContext);\n    if (context.value && context.value.length > 0) {\n      const contentsLen = context.value.length;\n      let cmp = null;\n      for (let i = contentsLen - 1; i >= 0; i--)\n        cmp = _jsxC(\n          context.value[i].default,\n          {\n            children: cmp,\n          },\n          1,\n          'k8_0'\n        );\n      return cmp;\n    }\n    return SkipRender;\n  }, 'RouterOutlet_component_AKetNByE5TM')\n);\nconst MODULE_CACHE = /* @__PURE__ */ new WeakMap();\nconst CLIENT_DATA_CACHE = /* @__PURE__ */ new Map();\nconst QACTION_KEY = 'qaction';\nconst toPath = (url) => url.pathname + url.search + url.hash;\nconst toUrl = (url, baseUrl) => new URL(url, baseUrl.href);\nconst isSameOrigin = (a, b) => a.origin === b.origin;\nconst isSamePath = (a, b) => a.pathname + a.search === b.pathname + b.search;\nconst isSamePathname = (a, b) => a.pathname === b.pathname;\nconst isSameOriginDifferentPathname = (a, b) => isSameOrigin(a, b) && !isSamePath(a, b);\nconst getClientDataPath = (pathname, pageSearch, action) => {\n  let search = pageSearch ?? '';\n  if (action) search += (search ? '&' : '?') + QACTION_KEY + '=' + encodeURIComponent(action.id);\n  return pathname + (pathname.endsWith('/') ? '' : '/') + 'q-data.json' + search;\n};\nconst getClientNavPath = (props, baseUrl) => {\n  const href = props.href;\n  if (typeof href === 'string' && href.trim() !== '' && typeof props.target !== 'string')\n    try {\n      const linkUrl = toUrl(href, baseUrl.url);\n      const currentUrl = toUrl('', baseUrl.url);\n      if (isSameOrigin(linkUrl, currentUrl)) return toPath(linkUrl);\n    } catch (e) {\n      console.error(e);\n    }\n  else if (props.reload) return toPath(toUrl('', baseUrl.url));\n  return null;\n};\nconst getPrefetchDataset = (props, clientNavPath, currentLoc) => {\n  if (props.prefetch === true && clientNavPath) {\n    const prefetchUrl = toUrl(clientNavPath, currentLoc.url);\n    if (!isSamePathname(prefetchUrl, toUrl('', currentLoc.url))) return '';\n  }\n  return null;\n};\nconst clientNavigate = (win, newUrl, routeNavigate) => {\n  const currentUrl = win.location;\n  if (isSameOriginDifferentPathname(currentUrl, newUrl)) {\n    handleScroll(win, currentUrl, newUrl);\n    win.history.pushState('', '', toPath(newUrl));\n  }\n  if (!win._qCityHistory) {\n    win._qCityHistory = 1;\n    win.addEventListener('popstate', () => {\n      const currentUrl2 = win.location;\n      const previousUrl = toUrl(routeNavigate.value, currentUrl2);\n      if (isSameOriginDifferentPathname(currentUrl2, previousUrl)) {\n        handleScroll(win, previousUrl, currentUrl2);\n        routeNavigate.value = toPath(new URL(currentUrl2.href));\n      }\n    });\n    win.removeEventListener('popstate', win._qCityPopstateFallback);\n  }\n};\nconst handleScroll = async (win, previousUrl, newUrl) => {\n  const doc = win.document;\n  const newHash = newUrl.hash;\n  if (isSamePath(previousUrl, newUrl)) {\n    if (previousUrl.hash !== newHash) {\n      await domWait();\n      if (newHash) scrollToHashId(doc, newHash);\n      else win.scrollTo(0, 0);\n    }\n  } else {\n    if (newHash)\n      for (let i = 0; i < 24; i++) {\n        await domWait();\n        if (scrollToHashId(doc, newHash)) break;\n      }\n    else {\n      await domWait();\n      win.scrollTo(0, 0);\n    }\n  }\n};\nconst domWait = () => new Promise((resolve) => setTimeout(resolve, 12));\nconst scrollToHashId = (doc, hash) => {\n  const elmId = hash.slice(1);\n  const elm = doc.getElementById(elmId);\n  if (elm) elm.scrollIntoView();\n  return elm;\n};\nconst dispatchPrefetchEvent = (prefetchData) => {\n  if (typeof document !== 'undefined')\n    document.dispatchEvent(\n      new CustomEvent('qprefetch', {\n        detail: prefetchData,\n      })\n    );\n};\nconst resolveHead = (endpoint, routeLocation, contentModules, locale) => {\n  const head = createDocumentHead();\n  const getData = (loaderOrAction) => {\n    const id = loaderOrAction.__id;\n    if (loaderOrAction.__brand === 'server_loader') {\n      if (!(id in endpoint.loaders))\n        throw new Error(\n          'You can not get the returned data of a loader that has not been executed for this request.'\n        );\n    }\n    const data = endpoint.loaders[id];\n    if (data instanceof Promise)\n      throw new Error('Loaders returning a function can not be referred to in the head function.');\n    return data;\n  };\n  const headProps = {\n    head,\n    withLocale: (fn) => withLocale(locale, fn),\n    resolveValue: getData,\n    ...routeLocation,\n  };\n  for (let i = contentModules.length - 1; i >= 0; i--) {\n    const contentModuleHead = contentModules[i] && contentModules[i].head;\n    if (contentModuleHead) {\n      if (typeof contentModuleHead === 'function')\n        resolveDocumentHead(\n          head,\n          withLocale(locale, () => contentModuleHead(headProps))\n        );\n      else if (typeof contentModuleHead === 'object') resolveDocumentHead(head, contentModuleHead);\n    }\n  }\n  return headProps.head;\n};\nconst resolveDocumentHead = (resolvedHead, updatedHead) => {\n  if (typeof updatedHead.title === 'string') resolvedHead.title = updatedHead.title;\n  mergeArray(resolvedHead.meta, updatedHead.meta);\n  mergeArray(resolvedHead.links, updatedHead.links);\n  mergeArray(resolvedHead.styles, updatedHead.styles);\n  Object.assign(resolvedHead.frontmatter, updatedHead.frontmatter);\n};\nconst mergeArray = (existingArr, newArr) => {\n  if (Array.isArray(newArr))\n    for (const newItem of newArr) {\n      if (typeof newItem.key === 'string') {\n        const existingIndex = existingArr.findIndex((i) => i.key === newItem.key);\n        if (existingIndex > -1) {\n          existingArr[existingIndex] = newItem;\n          continue;\n        }\n      }\n      existingArr.push(newItem);\n    }\n};\nconst createDocumentHead = () => ({\n  title: '',\n  meta: [],\n  links: [],\n  styles: [],\n  frontmatter: {},\n});\nconst loadRoute = async (routes, menus, cacheModules, pathname) => {\n  if (Array.isArray(routes))\n    for (const route of routes) {\n      const match = route[0].exec(pathname);\n      if (match) {\n        const loaders = route[1];\n        const params = getPathParams(route[2], match);\n        const routeBundleNames = route[4];\n        const mods = new Array(loaders.length);\n        const pendingLoads = [];\n        const menuLoader = getMenuLoader(menus, pathname);\n        let menu = void 0;\n        loaders.forEach((moduleLoader, i) => {\n          loadModule(\n            moduleLoader,\n            pendingLoads,\n            (routeModule) => (mods[i] = routeModule),\n            cacheModules\n          );\n        });\n        loadModule(\n          menuLoader,\n          pendingLoads,\n          (menuModule) => (menu = menuModule?.default),\n          cacheModules\n        );\n        if (pendingLoads.length > 0) await Promise.all(pendingLoads);\n        return [params, mods, menu, routeBundleNames];\n      }\n    }\n  return null;\n};\nconst loadModule = (moduleLoader, pendingLoads, moduleSetter, cacheModules) => {\n  if (typeof moduleLoader === 'function') {\n    const loadedModule = MODULE_CACHE.get(moduleLoader);\n    if (loadedModule) moduleSetter(loadedModule);\n    else {\n      const l = moduleLoader();\n      if (typeof l.then === 'function')\n        pendingLoads.push(\n          l.then((loadedModule2) => {\n            if (cacheModules !== false) MODULE_CACHE.set(moduleLoader, loadedModule2);\n            moduleSetter(loadedModule2);\n          })\n        );\n      else if (l) moduleSetter(l);\n    }\n  }\n};\nconst getMenuLoader = (menus, pathname) => {\n  if (menus) {\n    pathname = pathname.endsWith('/') ? pathname : pathname + '/';\n    const menu = menus.find(\n      (m) => m[0] === pathname || pathname.startsWith(m[0] + (pathname.endsWith('/') ? '' : '/'))\n    );\n    if (menu) return menu[1];\n  }\n};\nconst getPathParams = (paramNames, match) => {\n  const params = {};\n  if (paramNames)\n    for (let i = 0; i < paramNames.length; i++) {\n      const param = match?.[i + 1] ?? '';\n      const v = param.endsWith('/') ? param.slice(0, -1) : param;\n      params[paramNames[i]] = decodeURIComponent(v);\n    }\n  return params;\n};\nconst loadClientData = async (url, element, clearCache, action) => {\n  const pagePathname = url.pathname;\n  const pageSearch = url.search;\n  const clientDataPath = getClientDataPath(pagePathname, pageSearch, action);\n  let qData = void 0;\n  if (!action) qData = CLIENT_DATA_CACHE.get(clientDataPath);\n  dispatchPrefetchEvent({\n    links: [pagePathname],\n  });\n  if (!qData) {\n    const options = getFetchOptions(action);\n    if (action) action.data = void 0;\n    qData = fetch(clientDataPath, options).then((rsp) => {\n      const redirectedURL = new URL(rsp.url);\n      if (redirectedURL.origin !== location.origin || !isQDataJson(redirectedURL.pathname)) {\n        location.href = redirectedURL.href;\n        return;\n      }\n      if ((rsp.headers.get('content-type') || '').includes('json'))\n        return rsp.text().then((text) => {\n          const clientData = _deserializeData(text, element);\n          if (!clientData) {\n            location.href = url.href;\n            return;\n          }\n          if (clearCache) CLIENT_DATA_CACHE.delete(clientDataPath);\n          if (clientData.redirect) location.href = clientData.redirect;\n          else if (action) {\n            const actionData = clientData.loaders[action.id];\n            action.resolve({\n              status: rsp.status,\n              result: actionData,\n            });\n          }\n          return clientData;\n        });\n      else {\n        location.href = url.href;\n        return void 0;\n      }\n    });\n    if (!action) CLIENT_DATA_CACHE.set(clientDataPath, qData);\n  }\n  return qData.then((v) => {\n    if (!v) CLIENT_DATA_CACHE.delete(clientDataPath);\n    return v;\n  });\n};\nconst getFetchOptions = (action) => {\n  const actionData = action?.data;\n  if (!actionData) return void 0;\n  if (actionData instanceof FormData)\n    return {\n      method: 'POST',\n      body: actionData,\n    };\n  else\n    return {\n      method: 'POST',\n      body: JSON.stringify(actionData),\n      headers: {\n        'Content-Type': 'application/json, charset=UTF-8',\n      },\n    };\n};\nconst isQDataJson = (pathname) => {\n  return pathname.endsWith(QDATA_JSON);\n};\nconst QDATA_JSON = '/q-data.json';\nconst useContent = () => useContext(ContentContext);\nconst useDocumentHead = () => useContext(DocumentHeadContext);\nconst useLocation = () => useContext(RouteLocationContext);\nconst useNavigate = () => useContext(RouteNavigateContext);\nconst useAction = () => useContext(RouteActionContext);\nconst useQwikCityEnv = () => noSerialize(useServerData('qwikcity'));\nconst QwikCityProvider = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    useStylesQrl(\n      /* @__PURE__ */ inlinedQrl(\n        `:root{view-transition-name: none}`,\n        'QwikCityProvider_component_useStyles_RPDJAz33WLA'\n      )\n    );\n    const env = useQwikCityEnv();\n    if (!env?.params) throw new Error(`Missing Qwik City Env Data`);\n    const urlEnv = useServerData('url');\n    if (!urlEnv) throw new Error(`Missing Qwik URL Env Data`);\n    const url = new URL(urlEnv);\n    const routeLocation = useStore(\n      {\n        url,\n        params: env.params,\n        isNavigating: false,\n      },\n      {\n        deep: false,\n      }\n    );\n    const loaderState = _weakSerialize(\n      useStore(env.response.loaders, {\n        deep: false,\n      })\n    );\n    const navPath = useSignal(toPath(url));\n    const documentHead = useStore(createDocumentHead);\n    const content = useStore({\n      headings: void 0,\n      menu: void 0,\n    });\n    const contentInternal = useSignal();\n    const currentActionId = env.response.action;\n    const currentAction = currentActionId ? env.response.loaders[currentActionId] : void 0;\n    const actionState = useSignal(\n      currentAction\n        ? {\n            id: currentActionId,\n            data: env.response.formData,\n            output: {\n              result: currentAction,\n              status: env.response.status,\n            },\n          }\n        : void 0\n    );\n    const goto = eventQrl(\n      /* @__PURE__ */ inlinedQrl(\n        async (path, forceReload) => {\n          const [actionState2, navPath2, routeLocation2] = useLexicalScope();\n          if (path === void 0) {\n            path = navPath2.value;\n            navPath2.value = '';\n          } else if (forceReload) navPath2.value = '';\n          const resolvedURL = new URL(path, routeLocation2.url);\n          path = toPath(resolvedURL);\n          if (!forceReload && navPath2.value === path) return;\n          navPath2.value = path;\n          if (isBrowser) {\n            loadClientData(resolvedURL, _getContextElement());\n            loadRoute(qwikCity.routes, qwikCity.menus, qwikCity.cacheModules, resolvedURL.pathname);\n          }\n          actionState2.value = void 0;\n          routeLocation2.isNavigating = true;\n        },\n        'QwikCityProvider_component_goto_event_cBcjROynRVg',\n        [actionState, navPath, routeLocation]\n      )\n    );\n    useContextProvider(ContentContext, content);\n    useContextProvider(ContentInternalContext, contentInternal);\n    useContextProvider(DocumentHeadContext, documentHead);\n    useContextProvider(RouteLocationContext, routeLocation);\n    useContextProvider(RouteNavigateContext, goto);\n    useContextProvider(RouteStateContext, loaderState);\n    useContextProvider(RouteActionContext, actionState);\n    useTaskQrl(\n      /* @__PURE__ */ inlinedQrl(\n        ({ track }) => {\n          const [\n            actionState2,\n            content2,\n            contentInternal2,\n            documentHead2,\n            env2,\n            loaderState2,\n            navPath2,\n            props2,\n            routeLocation2,\n            url2,\n          ] = useLexicalScope();\n          async function run() {\n            const [path, action] = track(() => [navPath2.value, actionState2.value]);\n            const locale = getLocale('');\n            let trackUrl;\n            let clientPageData;\n            let loadedRoute = null;\n            if (isServer) {\n              trackUrl = new URL(path, routeLocation2.url);\n              loadedRoute = env2.loadedRoute;\n              clientPageData = env2.response;\n            } else {\n              trackUrl = new URL(path, location);\n              if (trackUrl.pathname.endsWith('/')) {\n                if (!qwikCity.trailingSlash) trackUrl.pathname = trackUrl.pathname.slice(0, -1);\n              } else if (qwikCity.trailingSlash) trackUrl.pathname += '/';\n              let loadRoutePromise = loadRoute(\n                qwikCity.routes,\n                qwikCity.menus,\n                qwikCity.cacheModules,\n                trackUrl.pathname\n              );\n              const element = _getContextElement();\n              const pageData = (clientPageData = await loadClientData(\n                trackUrl,\n                element,\n                true,\n                action\n              ));\n              if (!pageData) {\n                navPath2.untrackedValue = toPath(trackUrl);\n                return;\n              }\n              const newHref = pageData.href;\n              const newURL = new URL(newHref, trackUrl.href);\n              if (newURL.pathname !== trackUrl.pathname) {\n                trackUrl = newURL;\n                loadRoutePromise = loadRoute(\n                  qwikCity.routes,\n                  qwikCity.menus,\n                  qwikCity.cacheModules,\n                  trackUrl.pathname\n                );\n              }\n              loadedRoute = await loadRoutePromise;\n            }\n            if (loadedRoute) {\n              const [params, mods, menu] = loadedRoute;\n              const contentModules = mods;\n              const pageModule = contentModules[contentModules.length - 1];\n              routeLocation2.url = trackUrl;\n              routeLocation2.params = {\n                ...params,\n              };\n              navPath2.untrackedValue = toPath(trackUrl);\n              const resolvedHead = resolveHead(\n                clientPageData,\n                routeLocation2,\n                contentModules,\n                locale\n              );\n              content2.headings = pageModule.headings;\n              content2.menu = menu;\n              contentInternal2.value = noSerialize(contentModules);\n              documentHead2.links = resolvedHead.links;\n              documentHead2.meta = resolvedHead.meta;\n              documentHead2.styles = resolvedHead.styles;\n              documentHead2.title = resolvedHead.title;\n              documentHead2.frontmatter = resolvedHead.frontmatter;\n              if (isBrowser) {\n                if (\n                  (props2.viewTransition ?? true) &&\n                  isSameOriginDifferentPathname(window.location, url2)\n                )\n                  document.__q_view_transition__ = true;\n                const loaders = clientPageData?.loaders;\n                if (loaders) Object.assign(loaderState2, loaders);\n                CLIENT_DATA_CACHE.clear();\n                clientNavigate(window, trackUrl, navPath2);\n                routeLocation2.isNavigating = false;\n              }\n            }\n          }\n          const promise = run();\n          if (isServer) return promise;\n          else return;\n        },\n        'QwikCityProvider_component_useTask_02wMImzEAbk',\n        [\n          actionState,\n          content,\n          contentInternal,\n          documentHead,\n          env,\n          loaderState,\n          navPath,\n          props,\n          routeLocation,\n          url,\n        ]\n      )\n    );\n    return /* @__PURE__ */ _jsxC(Slot, null, 3, 'qY_0');\n  }, 'QwikCityProvider_component_TxCFOy819ag')\n);\nconst QwikCityMockProvider = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    const urlEnv = props.url ?? 'http://localhost/';\n    const url = new URL(urlEnv);\n    const routeLocation = useStore(\n      {\n        url,\n        params: props.params ?? {},\n        isNavigating: false,\n      },\n      {\n        deep: false,\n      }\n    );\n    const loaderState = useSignal({});\n    const goto = /* @__PURE__ */ inlinedQrl(async (path) => {\n      throw new Error('Not implemented');\n    }, 'QwikCityMockProvider_component_goto_BUbtvTyvVRE');\n    const documentHead = useStore(createDocumentHead, {\n      deep: false,\n    });\n    const content = useStore(\n      {\n        headings: void 0,\n        menu: void 0,\n      },\n      {\n        deep: false,\n      }\n    );\n    const contentInternal = useSignal();\n    useContextProvider(ContentContext, content);\n    useContextProvider(ContentInternalContext, contentInternal);\n    useContextProvider(DocumentHeadContext, documentHead);\n    useContextProvider(RouteLocationContext, routeLocation);\n    useContextProvider(RouteNavigateContext, goto);\n    useContextProvider(RouteStateContext, loaderState);\n    return /* @__PURE__ */ _jsxC(Slot, null, 3, 'qY_1');\n  }, 'QwikCityMockProvider_component_WmYC5H00wtI')\n);\nconst Link = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    const nav = useNavigate();\n    const loc = useLocation();\n    const linkProps = {\n      ...props,\n    };\n    const clientNavPath = untrack(() => getClientNavPath(linkProps, loc));\n    const prefetchDataset = untrack(() => getPrefetchDataset(props, clientNavPath, loc));\n    const reload = !!linkProps.reload;\n    linkProps['preventdefault:click'] = !!clientNavPath;\n    linkProps.href = clientNavPath || props.href;\n    const event = eventQrl(\n      /* @__PURE__ */ inlinedQrl(\n        (ev, elm) => prefetchLinkResources(elm, ev.type === 'qvisible'),\n        'Link_component_event_event_5g4B0Gd1Wck'\n      )\n    );\n    return /* @__PURE__ */ _jsxS(\n      'a',\n      {\n        ...linkProps,\n        'data-prefetch': prefetchDataset,\n        children: /* @__PURE__ */ _jsxC(Slot, null, 3, 'AD_0'),\n        onClick$: /* @__PURE__ */ inlinedQrl(\n          (_, elm) => {\n            const [nav2, reload2] = useLexicalScope();\n            if (elm.href) nav2(elm.href, reload2);\n          },\n          'Link_component_a_onClick_kzjavhDI3L0',\n          [nav, reload]\n        ),\n        onMouseOver$: event,\n        onFocus$: event,\n        onQVisible$: event,\n      },\n      null,\n      0,\n      'AD_1'\n    );\n  }, 'Link_component_8gdLBszqbaM')\n);\nconst prefetchLinkResources = (elm, isOnVisible) => {\n  if (elm && elm.href && elm.hasAttribute('data-prefetch')) {\n    if (!windowInnerWidth) windowInnerWidth = innerWidth;\n    if (!isOnVisible || (isOnVisible && windowInnerWidth < 520))\n      loadClientData(new URL(elm.href), elm);\n  }\n};\nlet windowInnerWidth = 0;\nconst ServiceWorkerRegister = (props) =>\n  _jsxQ(\n    'script',\n    {\n      nonce: _wrapSignal(props, 'nonce'),\n    },\n    {\n      dangerouslySetInnerHTML: swRegister,\n    },\n    null,\n    3,\n    '1Z_0'\n  );\nconst routeActionQrl = (actionQrl, ...rest) => {\n  const { id, validators } = getValidators(rest, actionQrl);\n  function action() {\n    const loc = useLocation();\n    const currentAction = useAction();\n    const initialState = {\n      actionPath: `?${QACTION_KEY}=${id}`,\n      isRunning: false,\n      status: void 0,\n      value: void 0,\n      formData: void 0,\n    };\n    const state = useStore(() => {\n      const value = currentAction.value;\n      if (value && value?.id === id) {\n        const data = value.data;\n        if (data instanceof FormData) initialState.formData = data;\n        if (value.output) {\n          const { status, result } = value.output;\n          initialState.status = status;\n          initialState.value = result;\n        }\n      }\n      return initialState;\n    });\n    const submit = /* @__PURE__ */ inlinedQrl(\n      (input = {}) => {\n        const [currentAction2, id2, loc2, state2] = useLexicalScope();\n        if (isServer)\n          throw new Error(`Actions can not be invoked within the server during SSR.\nAction.run() can only be called on the browser, for example when a user clicks a button, or submits a form.`);\n        let data;\n        let form;\n        if (input instanceof SubmitEvent) {\n          form = input.target;\n          data = new FormData(form);\n          if (\n            (input.submitter instanceof HTMLInputElement ||\n              input.submitter instanceof HTMLButtonElement) &&\n            input.submitter.name\n          ) {\n            if (input.submitter.name) data.append(input.submitter.name, input.submitter.value);\n          }\n        } else data = input;\n        return new Promise((resolve) => {\n          if (data instanceof FormData) state2.formData = data;\n          state2.isRunning = true;\n          loc2.isNavigating = true;\n          currentAction2.value = {\n            data,\n            id: id2,\n            resolve: noSerialize(resolve),\n          };\n        }).then(({ result, status }) => {\n          state2.isRunning = false;\n          state2.status = status;\n          state2.value = result;\n          if (form) {\n            if (form.getAttribute('data-spa-reset') === 'true') form.reset();\n            const detail = {\n              status,\n              value: result,\n            };\n            form.dispatchEvent(\n              new CustomEvent('submitcompleted', {\n                bubbles: false,\n                cancelable: false,\n                composed: false,\n                detail,\n              })\n            );\n          }\n          return {\n            status,\n            value: result,\n          };\n        });\n      },\n      'routeActionQrl_action_submit_A5bZC7WO00A',\n      [currentAction, id, loc, state]\n    );\n    initialState.submit = submit;\n    return state;\n  }\n  action.__brand = 'server_action';\n  action.__validators = validators;\n  action.__qrl = actionQrl;\n  action.__id = id;\n  Object.freeze(action);\n  return action;\n};\nconst globalActionQrl = (actionQrl, ...rest) => {\n  const action = routeActionQrl(actionQrl, ...rest);\n  if (isServer) {\n    if (typeof globalThis._qwikActionsMap === 'undefined')\n      globalThis._qwikActionsMap = /* @__PURE__ */ new Map();\n    globalThis._qwikActionsMap.set(action.__id, action);\n  }\n  return action;\n};\nconst routeAction$ = /* @__PURE__ */ implicit$FirstArg(routeActionQrl);\nconst globalAction$ = /* @__PURE__ */ implicit$FirstArg(globalActionQrl);\nconst routeLoaderQrl = (loaderQrl, ...rest) => {\n  const { id, validators } = getValidators(rest, loaderQrl);\n  function loader() {\n    return useContext(RouteStateContext, (state) => {\n      if (!(id in state))\n        throw new Error(`Loader (${id}) was used in a path where the 'loader$' was not declared.\n    This is likely because the used loader was not exported in a layout.tsx or index.tsx file of the existing route.\n    For more information check: https://qwik.dev/qwikcity/route-loader/`);\n      return _wrapSignal(state, id);\n    });\n  }\n  loader.__brand = 'server_loader';\n  loader.__qrl = loaderQrl;\n  loader.__validators = validators;\n  loader.__id = id;\n  Object.freeze(loader);\n  return loader;\n};\nconst routeLoader$ = /* @__PURE__ */ implicit$FirstArg(routeLoaderQrl);\nconst validatorQrl = (validator) => {\n  if (isServer)\n    return {\n      validate: validator,\n    };\n  return void 0;\n};\nconst validator$ = /* @__PURE__ */ implicit$FirstArg(validatorQrl);\nconst zodQrl = (qrl) => {\n  if (isServer) {\n    const schema = qrl.resolve().then((obj) => {\n      if (typeof obj === 'function') obj = obj(z);\n      if (obj instanceof z.Schema) return obj;\n      else return z.object(obj);\n    });\n    return {\n      async validate(ev, inputData) {\n        const data = inputData ?? (await ev.parseBody());\n        const result = await (await schema).safeParseAsync(data);\n        if (result.success) return result;\n        else {\n          if (isDev)\n            console.error(\n              '\\nVALIDATION ERROR\\naction$() zod validated failed',\n              '\\n  - Issues:',\n              result.error.issues\n            );\n          return {\n            success: false,\n            status: 400,\n            error: result.error.flatten(),\n          };\n        }\n      },\n    };\n  }\n  return void 0;\n};\nconst zod$ = /* @__PURE__ */ implicit$FirstArg(zodQrl);\nconst serverQrl = (qrl) => {\n  if (isServer) {\n    const captured = qrl.getCaptured();\n    if (captured && captured.length > 0 && !_getContextElement())\n      throw new Error('For security reasons, we cannot serialize QRLs that capture lexical scope.');\n  }\n  function stuff() {\n    return /* @__PURE__ */ inlinedQrl(\n      async (...args) => {\n        const [qrl2] = useLexicalScope();\n        if (isServer) {\n          const requestEvent = useQwikCityEnv()?.ev;\n          return qrl2.apply(requestEvent, args);\n        } else {\n          const ctxElm = _getContextElement();\n          const filtered = args.map((arg) => {\n            if (arg instanceof SubmitEvent && arg.target instanceof HTMLFormElement)\n              return new FormData(arg.target);\n            else if (arg instanceof Event) return null;\n            else if (arg instanceof Node) return null;\n            return arg;\n          });\n          const hash = qrl2.getHash();\n          const path = `?qfunc=${qrl2.getHash()}`;\n          const body = await _serializeData([qrl2, ...filtered], false);\n          const res = await fetch(path, {\n            method: 'POST',\n            headers: {\n              'Content-Type': 'application/qwik-json',\n              'X-QRL': hash,\n            },\n            body,\n          });\n          const contentType = res.headers.get('Content-Type');\n          if (res.ok && contentType === 'text/event-stream') {\n            const { writable, readable } = getSSETransformer();\n            res.body?.pipeTo(writable);\n            return streamAsyncIterator(readable, ctxElm ?? document.documentElement);\n          } else if (contentType === 'application/qwik-json') {\n            const str = await res.text();\n            const obj = await _deserializeData(str, ctxElm ?? document.documentElement);\n            if (res.status === 500) throw obj;\n            return obj;\n          }\n        }\n      },\n      'serverQrl_stuff_wOIPfiQ04l4',\n      [qrl]\n    );\n  }\n  return stuff();\n};\nconst server$ = /* @__PURE__ */ implicit$FirstArg(serverQrl);\nconst getValidators = (rest, qrl) => {\n  let id;\n  const validators = [];\n  if (rest.length === 1) {\n    const options = rest[0];\n    if (options && typeof options === 'object') {\n      if ('validate' in options) validators.push(options);\n      else {\n        id = options.id;\n        if (options.validation) validators.push(...options.validation);\n      }\n    }\n  } else if (rest.length > 1) validators.push(...rest.filter((v) => !!v));\n  if (typeof id === 'string') {\n    if (isDev) {\n      if (!/^[\\w/.-]+$/.test(id))\n        throw new Error(`Invalid id: ${id}, id can only contain [a-zA-Z0-9_.-]`);\n    }\n    id = `id_${id}`;\n  } else id = qrl.getHash();\n  return {\n    validators: validators.reverse(),\n    id,\n  };\n};\nconst getSSETransformer = () => {\n  let currentLine = '';\n  const encoder = new TextDecoder();\n  const transformer = new TransformStream({\n    transform(chunk, controller) {\n      const lines = encoder.decode(chunk).split('\\n\\n');\n      for (let i = 0; i < lines.length - 1; i++) {\n        const line = currentLine + lines[i];\n        if (line.length === 0) {\n          controller.terminate();\n          break;\n        } else {\n          controller.enqueue(parseEvent(line));\n          currentLine = '';\n        }\n      }\n      currentLine += lines[lines.length - 1];\n    },\n  });\n  return transformer;\n};\nconst parseEvent = (message) => {\n  const lines = message.split('\\n');\n  const event = {\n    data: '',\n  };\n  let data = '';\n  for (const line of lines)\n    if (line.startsWith('data: ')) data += line.slice(6) + '\\n';\n    else {\n      const [key, value] = line.split(':');\n      if (typeof key === 'string' && typeof value === 'string') event[key] = value.trim();\n    }\n  event.data = data;\n  return event;\n};\nasync function* streamAsyncIterator(stream, ctxElm) {\n  const reader = stream.getReader();\n  try {\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) return;\n      const obj = await _deserializeData(value.data, ctxElm);\n      yield obj;\n    }\n  } finally {\n    reader.releaseLock();\n  }\n}\nconst Form = ({ action, spaReset, reloadDocument, onSubmit$, ...rest }, key) => {\n  _jsxBranch();\n  if (action)\n    return _jsxS(\n      'form',\n      {\n        ...rest,\n        action: _wrapSignal(action, 'actionPath'),\n        'preventdefault:submit': !reloadDocument,\n        ['data-spa-reset']: spaReset ? 'true' : void 0,\n        onSubmit$: [!reloadDocument ? action.submit : void 0, onSubmit$],\n      },\n      {\n        method: 'post',\n      },\n      0,\n      key\n    );\n  else\n    return /* @__PURE__ */ _jsxC(\n      GetForm,\n      {\n        spaReset,\n        reloadDocument,\n        onSubmit$,\n        ...rest,\n      },\n      0,\n      key\n    );\n};\nconst GetForm = /* @__PURE__ */ componentQrl(\n  /* @__PURE__ */ inlinedQrl((props) => {\n    const rest = _restProps(props, ['action', 'spaReset', 'reloadDocument', 'onSubmit$']);\n    const nav = useNavigate();\n    return /* @__PURE__ */ _jsxS(\n      'form',\n      {\n        ...rest,\n        children: /* @__PURE__ */ _jsxC(Slot, null, 3, 'BC_0'),\n        onSubmit$: /* @__PURE__ */ inlinedQrl(\n          async (_, form) => {\n            const [nav2] = useLexicalScope();\n            const formData = new FormData(form);\n            const params = new URLSearchParams();\n            formData.forEach((value, key) => {\n              if (typeof value === 'string') params.append(key, value);\n            });\n            nav2('?' + params.toString(), true).then(() => {\n              if (form.getAttribute('data-spa-reset') === 'true') form.reset();\n              form.dispatchEvent(\n                new CustomEvent('submitcompleted', {\n                  bubbles: false,\n                  cancelable: false,\n                  composed: false,\n                  detail: {\n                    status: 200,\n                  },\n                })\n              );\n            });\n          },\n          'GetForm_component_form_onSubmit_p9MSze0ojs4',\n          [nav]\n        ),\n      },\n      {\n        action: 'get',\n        'preventdefault:submit': _fnSignal(\n          (p0) => !p0.reloadDocument,\n          [props],\n          '!p0.reloadDocument'\n        ),\n        'data-spa-reset': _fnSignal(\n          (p0) => (p0.spaReset ? 'true' : void 0),\n          [props],\n          'p0.spaReset?\"true\":undefined'\n        ),\n      },\n      0,\n      'BC_1'\n    );\n  }, 'GetForm_component_Nk9PlpjQm9Y')\n);\nexport {\n  Form,\n  Link,\n  QwikCityMockProvider,\n  QwikCityProvider,\n  RouterOutlet,\n  ServiceWorkerRegister,\n  globalAction$,\n  globalActionQrl,\n  routeAction$,\n  routeActionQrl,\n  routeLoader$,\n  routeLoaderQrl,\n  server$,\n  serverQrl,\n  useContent,\n  useDocumentHead,\n  useLocation,\n  useNavigate,\n  validator$,\n  validatorQrl,\n  z2 as z,\n  zod$,\n  zodQrl,\n};\n\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc.mjs (ENTRY POINT)==\n\nexport const RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc = ()=>{\n    const POPSTATE_FALLBACK_INITIALIZED = '_qCityPopstateFallback';\n    const CLIENT_HISTORY_INITIALIZED = '_qCityHistory';\n    if (!window[POPSTATE_FALLBACK_INITIALIZED]) {\n        window[POPSTATE_FALLBACK_INITIALIZED] = ()=>{\n            if (!window[CLIENT_HISTORY_INITIALIZED]) location.reload();\n        };\n        setTimeout(()=>{\n            addEventListener('popstate', window[POPSTATE_FALLBACK_INITIALIZED]);\n        }, 0);\n    }\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"sEAmDmC;IACzB,MAAM,gCAAgC;IACtC,MAAM,6BAA6B;IACnC,IAAI,CAAC,MAAM,CAAC,8BAA8B,EAAE;QAC1C,MAAM,CAAC,8BAA8B,GAAG;YACtC,IAAI,CAAC,MAAM,CAAC,2BAA2B,EAAE,SAAS,MAAM;QAC1D;QACA,WAAW;YACT,iBAAiB,YAAY,MAAM,CAAC,8BAA8B;QACpE,GAAG;IACL;AACF\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc\",\n  \"entry\": null,\n  \"displayName\": \"index.qwik.mjs_RouterOutlet_component_useOnDocument_event\",\n  \"hash\": \"KnNE9eL0qfc\",\n  \"canonicalFilename\": \"index.qwik.mjs_RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"RouterOutlet_component_AKetNByE5TM\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"event$\",\n  \"captures\": false,\n  \"loc\": [\n    1390,\n    1893\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_RouterOutlet_component_AKetNByE5TM.mjs ==\n\nimport { _auto_ContentInternalContext as ContentInternalContext } from \"./index.qwik.mjs\";\nimport { SkipRender } from \"@builder.io/qwik\";\nimport { _jsxBranch } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { eventQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useContext } from \"@builder.io/qwik\";\nimport { useOnDocument } from \"@builder.io/qwik\";\nexport const RouterOutlet_component_AKetNByE5TM = ()=>{\n    _jsxBranch();\n    useOnDocument('qinit', eventQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc.mjs\"), \"RouterOutlet_component_useOnDocument_event_KnNE9eL0qfc\")));\n    const context = useContext(ContentInternalContext);\n    if (context.value && context.value.length > 0) {\n        const contentsLen = context.value.length;\n        let cmp = null;\n        for(let i = contentsLen - 1; i >= 0; i--)cmp = _jsxC(context.value[i].default, {\n            children: cmp\n        }, 1, 'k8_0');\n        return cmp;\n    }\n    return SkipRender;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;kDA8C6B;IACzB;IACA,cACE,SACA;IAeF,MAAM,UAAU,WAAW;IAC3B,IAAI,QAAQ,KAAK,IAAI,QAAQ,KAAK,CAAC,MAAM,GAAG,GAAG;QAC7C,MAAM,cAAc,QAAQ,KAAK,CAAC,MAAM;QACxC,IAAI,MAAM;QACV,IAAK,IAAI,IAAI,cAAc,GAAG,KAAK,GAAG,IACpC,MAAM,MACJ,QAAQ,KAAK,CAAC,EAAE,CAAC,OAAO,EACxB;YACE,UAAU;QACZ,GACA,GACA;QAEJ,OAAO;IACT;IACA,OAAO;AACT\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"RouterOutlet_component_AKetNByE5TM\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_RouterOutlet\",\n  \"displayName\": \"index.qwik.mjs_RouterOutlet_component\",\n  \"hash\": \"AKetNByE5TM\",\n  \"canonicalFilename\": \"index.qwik.mjs_RouterOutlet_component_AKetNByE5TM\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    1279,\n    2396\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_QwikCityProvider_component_useStyles_RPDJAz33WLA.mjs ==\n\nexport const QwikCityProvider_component_useStyles_RPDJAz33WLA = `:root{view-transition-name: none}`;\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"gEA4XQ,CAAC,iCAAiC,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"QwikCityProvider_component_useStyles_RPDJAz33WLA\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_QwikCityProvider\",\n  \"displayName\": \"index.qwik.mjs_QwikCityProvider_component_useStyles\",\n  \"hash\": \"RPDJAz33WLA\",\n  \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_useStyles_RPDJAz33WLA\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"QwikCityProvider_component_TxCFOy819ag\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useStyles$\",\n  \"captures\": false,\n  \"loc\": [\n    12723,\n    12758\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_QwikCityProvider_component_goto_event_cBcjROynRVg.mjs ==\n\nimport { _getContextElement } from \"@builder.io/qwik\";\nimport { isBrowser } from \"@builder.io/qwik/build\";\nimport { _auto_loadClientData as loadClientData } from \"./index.qwik.mjs\";\nimport { _auto_loadRoute as loadRoute } from \"./index.qwik.mjs\";\nimport * as qwikCity from \"@qwik-city-plan\";\nimport { _auto_toPath as toPath } from \"./index.qwik.mjs\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const QwikCityProvider_component_goto_event_cBcjROynRVg = async (path, forceReload)=>{\n    const [actionState2, navPath2, routeLocation2] = useLexicalScope();\n    if (path === void 0) {\n        path = navPath2.value;\n        navPath2.value = '';\n    } else if (forceReload) navPath2.value = '';\n    const resolvedURL = new URL(path, routeLocation2.url);\n    path = toPath(resolvedURL);\n    if (!forceReload && navPath2.value === path) return;\n    navPath2.value = path;\n    if (isBrowser) {\n        loadClientData(resolvedURL, _getContextElement());\n        loadRoute(qwikCity.routes, qwikCity.menus, qwikCity.cacheModules, resolvedURL.pathname);\n    }\n    actionState2.value = void 0;\n    routeLocation2.isNavigating = true;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;iEA2aQ,OAAO,MAAM;IACX,MAAM,CAAC,cAAc,UAAU,eAAe,GAAG;IACjD,IAAI,SAAS,KAAK,GAAG;QACnB,OAAO,SAAS,KAAK;QACrB,SAAS,KAAK,GAAG;IACnB,OAAO,IAAI,aAAa,SAAS,KAAK,GAAG;IACzC,MAAM,cAAc,IAAI,IAAI,MAAM,eAAe,GAAG;IACpD,OAAO,OAAO;IACd,IAAI,CAAC,eAAe,SAAS,KAAK,KAAK,MAAM;IAC7C,SAAS,KAAK,GAAG;IACjB,IAAI,WAAW;QACb,eAAe,aAAa;QAC5B,UAAU,SAAS,MAAM,EAAE,SAAS,KAAK,EAAE,SAAS,YAAY,EAAE,YAAY,QAAQ;IACxF;IACA,aAAa,KAAK,GAAG,KAAK;IAC1B,eAAe,YAAY,GAAG;AAChC\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"QwikCityProvider_component_goto_event_cBcjROynRVg\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_QwikCityProvider\",\n  \"displayName\": \"index.qwik.mjs_QwikCityProvider_component_goto_event\",\n  \"hash\": \"cBcjROynRVg\",\n  \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_goto_event_cBcjROynRVg\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"QwikCityProvider_component_TxCFOy819ag\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"event$\",\n  \"captures\": true,\n  \"loc\": [\n    14084,\n    14845\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_QwikCityProvider_component_useTask_02wMImzEAbk.mjs ==\n\nimport { _auto_CLIENT_DATA_CACHE as CLIENT_DATA_CACHE } from \"./index.qwik.mjs\";\nimport { _getContextElement } from \"@builder.io/qwik\";\nimport { _auto_clientNavigate as clientNavigate } from \"./index.qwik.mjs\";\nimport { getLocale } from \"@builder.io/qwik\";\nimport { isBrowser } from \"@builder.io/qwik/build\";\nimport { _auto_isSameOriginDifferentPathname as isSameOriginDifferentPathname } from \"./index.qwik.mjs\";\nimport { isServer } from \"@builder.io/qwik/build\";\nimport { _auto_loadClientData as loadClientData } from \"./index.qwik.mjs\";\nimport { _auto_loadRoute as loadRoute } from \"./index.qwik.mjs\";\nimport { noSerialize } from \"@builder.io/qwik\";\nimport * as qwikCity from \"@qwik-city-plan\";\nimport { _auto_resolveHead as resolveHead } from \"./index.qwik.mjs\";\nimport { _auto_toPath as toPath } from \"./index.qwik.mjs\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const QwikCityProvider_component_useTask_02wMImzEAbk = ({ track })=>{\n    const [actionState2, content2, contentInternal2, documentHead2, env2, loaderState2, navPath2, props2, routeLocation2, url2] = useLexicalScope();\n    async function run() {\n        const [path, action] = track(()=>[\n                navPath2.value,\n                actionState2.value\n            ]);\n        const locale = getLocale('');\n        let trackUrl;\n        let clientPageData;\n        let loadedRoute = null;\n        if (isServer) {\n            trackUrl = new URL(path, routeLocation2.url);\n            loadedRoute = env2.loadedRoute;\n            clientPageData = env2.response;\n        } else {\n            trackUrl = new URL(path, location);\n            if (trackUrl.pathname.endsWith('/')) {\n                if (!qwikCity.trailingSlash) trackUrl.pathname = trackUrl.pathname.slice(0, -1);\n            } else if (qwikCity.trailingSlash) trackUrl.pathname += '/';\n            let loadRoutePromise = loadRoute(qwikCity.routes, qwikCity.menus, qwikCity.cacheModules, trackUrl.pathname);\n            const element = _getContextElement();\n            const pageData = clientPageData = await loadClientData(trackUrl, element, true, action);\n            if (!pageData) {\n                navPath2.untrackedValue = toPath(trackUrl);\n                return;\n            }\n            const newHref = pageData.href;\n            const newURL = new URL(newHref, trackUrl.href);\n            if (newURL.pathname !== trackUrl.pathname) {\n                trackUrl = newURL;\n                loadRoutePromise = loadRoute(qwikCity.routes, qwikCity.menus, qwikCity.cacheModules, trackUrl.pathname);\n            }\n            loadedRoute = await loadRoutePromise;\n        }\n        if (loadedRoute) {\n            const [params, mods, menu] = loadedRoute;\n            const contentModules = mods;\n            const pageModule = contentModules[contentModules.length - 1];\n            routeLocation2.url = trackUrl;\n            routeLocation2.params = {\n                ...params\n            };\n            navPath2.untrackedValue = toPath(trackUrl);\n            const resolvedHead = resolveHead(clientPageData, routeLocation2, contentModules, locale);\n            content2.headings = pageModule.headings;\n            content2.menu = menu;\n            contentInternal2.value = noSerialize(contentModules);\n            documentHead2.links = resolvedHead.links;\n            documentHead2.meta = resolvedHead.meta;\n            documentHead2.styles = resolvedHead.styles;\n            documentHead2.title = resolvedHead.title;\n            documentHead2.frontmatter = resolvedHead.frontmatter;\n            if (isBrowser) {\n                if ((props2.viewTransition ?? true) && isSameOriginDifferentPathname(window.location, url2)) document.__q_view_transition__ = true;\n                const loaders = clientPageData?.loaders;\n                if (loaders) Object.assign(loaderState2, loaders);\n                CLIENT_DATA_CACHE.clear();\n                clientNavigate(window, trackUrl, navPath2);\n                routeLocation2.isNavigating = false;\n            }\n        }\n    }\n    const promise = run();\n    if (isServer) return promise;\n    else return;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;;;;;8DAycQ,CAAC,EAAE,KAAK,EAAE;IACR,MAAM,CACJ,cACA,UACA,kBACA,eACA,MACA,cACA,UACA,QACA,gBACA,KACD,GAAG;IACJ,eAAe;QACb,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,IAAM;gBAAC,SAAS,KAAK;gBAAE,aAAa,KAAK;aAAC;QACvE,MAAM,SAAS,UAAU;QACzB,IAAI;QACJ,IAAI;QACJ,IAAI,cAAc;QAClB,IAAI,UAAU;YACZ,WAAW,IAAI,IAAI,MAAM,eAAe,GAAG;YAC3C,cAAc,KAAK,WAAW;YAC9B,iBAAiB,KAAK,QAAQ;QAChC,OAAO;YACL,WAAW,IAAI,IAAI,MAAM;YACzB,IAAI,SAAS,QAAQ,CAAC,QAAQ,CAAC,MAC7B;gBAAA,IAAI,CAAC,SAAS,aAAa,EAAE,SAAS,QAAQ,GAAG,SAAS,QAAQ,CAAC,KAAK,CAAC,GAAG;YAAG,OAC1E,IAAI,SAAS,aAAa,EAAE,SAAS,QAAQ,IAAI;YACxD,IAAI,mBAAmB,UACrB,SAAS,MAAM,EACf,SAAS,KAAK,EACd,SAAS,YAAY,EACrB,SAAS,QAAQ;YAEnB,MAAM,UAAU;YAChB,MAAM,WAAY,iBAAiB,MAAM,eACvC,UACA,SACA,MACA;YAEF,IAAI,CAAC,UAAU;gBACb,SAAS,cAAc,GAAG,OAAO;gBACjC;YACF;YACA,MAAM,UAAU,SAAS,IAAI;YAC7B,MAAM,SAAS,IAAI,IAAI,SAAS,SAAS,IAAI;YAC7C,IAAI,OAAO,QAAQ,KAAK,SAAS,QAAQ,EAAE;gBACzC,WAAW;gBACX,mBAAmB,UACjB,SAAS,MAAM,EACf,SAAS,KAAK,EACd,SAAS,YAAY,EACrB,SAAS,QAAQ;YAErB;YACA,cAAc,MAAM;QACtB;QACA,IAAI,aAAa;YACf,MAAM,CAAC,QAAQ,MAAM,KAAK,GAAG;YAC7B,MAAM,iBAAiB;YACvB,MAAM,aAAa,cAAc,CAAC,eAAe,MAAM,GAAG,EAAE;YAC5D,eAAe,GAAG,GAAG;YACrB,eAAe,MAAM,GAAG;gBACtB,GAAG,MAAM;YACX;YACA,SAAS,cAAc,GAAG,OAAO;YACjC,MAAM,eAAe,YACnB,gBACA,gBACA,gBACA;YAEF,SAAS,QAAQ,GAAG,WAAW,QAAQ;YACvC,SAAS,IAAI,GAAG;YAChB,iBAAiB,KAAK,GAAG,YAAY;YACrC,cAAc,KAAK,GAAG,aAAa,KAAK;YACxC,cAAc,IAAI,GAAG,aAAa,IAAI;YACtC,cAAc,MAAM,GAAG,aAAa,MAAM;YAC1C,cAAc,KAAK,GAAG,aAAa,KAAK;YACxC,cAAc,WAAW,GAAG,aAAa,WAAW;YACpD,IAAI,WAAW;gBACb,IACE,CAAC,OAAO,cAAc,IAAI,IAAI,KAC9B,8BAA8B,OAAO,QAAQ,EAAE,OAE/C,SAAS,qBAAqB,GAAG;gBACnC,MAAM,UAAU,gBAAgB;gBAChC,IAAI,SAAS,OAAO,MAAM,CAAC,cAAc;gBACzC,kBAAkB,KAAK;gBACvB,eAAe,QAAQ,UAAU;gBACjC,eAAe,YAAY,GAAG;YAChC;QACF;IACF;IACA,MAAM,UAAU;IAChB,IAAI,UAAU,OAAO;SAChB;AACP\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"QwikCityProvider_component_useTask_02wMImzEAbk\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_QwikCityProvider\",\n  \"displayName\": \"index.qwik.mjs_QwikCityProvider_component_useTask\",\n  \"hash\": \"02wMImzEAbk\",\n  \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_useTask_02wMImzEAbk\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"QwikCityProvider_component_TxCFOy819ag\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": true,\n  \"loc\": [\n    15426,\n    19233\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_QwikCityProvider_component_TxCFOy819ag.mjs ==\n\nimport { _auto_ContentContext as ContentContext } from \"./index.qwik.mjs\";\nimport { _auto_ContentInternalContext as ContentInternalContext } from \"./index.qwik.mjs\";\nimport { _auto_DocumentHeadContext as DocumentHeadContext } from \"./index.qwik.mjs\";\nimport { _auto_RouteActionContext as RouteActionContext } from \"./index.qwik.mjs\";\nimport { _auto_RouteLocationContext as RouteLocationContext } from \"./index.qwik.mjs\";\nimport { _auto_RouteNavigateContext as RouteNavigateContext } from \"./index.qwik.mjs\";\nimport { _auto_RouteStateContext as RouteStateContext } from \"./index.qwik.mjs\";\nimport { Slot } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _weakSerialize } from \"@builder.io/qwik\";\nimport { _auto_createDocumentHead as createDocumentHead } from \"./index.qwik.mjs\";\nimport { eventQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { _auto_toPath as toPath } from \"./index.qwik.mjs\";\nimport { useContextProvider } from \"@builder.io/qwik\";\nimport { _auto_useQwikCityEnv as useQwikCityEnv } from \"./index.qwik.mjs\";\nimport { useServerData } from \"@builder.io/qwik\";\nimport { useSignal } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nimport { useStylesQrl } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nexport const QwikCityProvider_component_TxCFOy819ag = (props)=>{\n    useStylesQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_QwikCityProvider_component_useStyles_RPDJAz33WLA.mjs\"), \"QwikCityProvider_component_useStyles_RPDJAz33WLA\"));\n    const env = useQwikCityEnv();\n    if (!env?.params) throw new Error(`Missing Qwik City Env Data`);\n    const urlEnv = useServerData('url');\n    if (!urlEnv) throw new Error(`Missing Qwik URL Env Data`);\n    const url = new URL(urlEnv);\n    const routeLocation = useStore({\n        url,\n        params: env.params,\n        isNavigating: false\n    }, {\n        deep: false\n    });\n    const loaderState = _weakSerialize(useStore(env.response.loaders, {\n        deep: false\n    }));\n    const navPath = useSignal(toPath(url));\n    const documentHead = useStore(createDocumentHead);\n    const content = useStore({\n        headings: void 0,\n        menu: void 0\n    });\n    const contentInternal = useSignal();\n    const currentActionId = env.response.action;\n    const currentAction = currentActionId ? env.response.loaders[currentActionId] : void 0;\n    const actionState = useSignal(currentAction ? {\n        id: currentActionId,\n        data: env.response.formData,\n        output: {\n            result: currentAction,\n            status: env.response.status\n        }\n    } : void 0);\n    const goto = eventQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_QwikCityProvider_component_goto_event_cBcjROynRVg.mjs\"), \"QwikCityProvider_component_goto_event_cBcjROynRVg\", [\n        actionState,\n        navPath,\n        routeLocation\n    ]));\n    useContextProvider(ContentContext, content);\n    useContextProvider(ContentInternalContext, contentInternal);\n    useContextProvider(DocumentHeadContext, documentHead);\n    useContextProvider(RouteLocationContext, routeLocation);\n    useContextProvider(RouteNavigateContext, goto);\n    useContextProvider(RouteStateContext, loaderState);\n    useContextProvider(RouteActionContext, actionState);\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_QwikCityProvider_component_useTask_02wMImzEAbk.mjs\"), \"QwikCityProvider_component_useTask_02wMImzEAbk\", [\n        actionState,\n        content,\n        contentInternal,\n        documentHead,\n        env,\n        loaderState,\n        navPath,\n        props,\n        routeLocation,\n        url\n    ]));\n    return /* @__PURE__ */ _jsxC(Slot, null, 3, 'qY_0');\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;;;;;;;;;;;;sDAyX6B,CAAC;IAC1B;IAMA,MAAM,MAAM;IACZ,IAAI,CAAC,KAAK,QAAQ,MAAM,IAAI,MAAM,CAAC,0BAA0B,CAAC;IAC9D,MAAM,SAAS,cAAc;IAC7B,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,CAAC,yBAAyB,CAAC;IACxD,MAAM,MAAM,IAAI,IAAI;IACpB,MAAM,gBAAgB,SACpB;QACE;QACA,QAAQ,IAAI,MAAM;QAClB,cAAc;IAChB,GACA;QACE,MAAM;IACR;IAEF,MAAM,cAAc,eAClB,SAAS,IAAI,QAAQ,CAAC,OAAO,EAAE;QAC7B,MAAM;IACR;IAEF,MAAM,UAAU,UAAU,OAAO;IACjC,MAAM,eAAe,SAAS;IAC9B,MAAM,UAAU,SAAS;QACvB,UAAU,KAAK;QACf,MAAM,KAAK;IACb;IACA,MAAM,kBAAkB;IACxB,MAAM,kBAAkB,IAAI,QAAQ,CAAC,MAAM;IAC3C,MAAM,gBAAgB,kBAAkB,IAAI,QAAQ,CAAC,OAAO,CAAC,gBAAgB,GAAG,KAAK;IACrF,MAAM,cAAc,UAClB,gBACI;QACE,IAAI;QACJ,MAAM,IAAI,QAAQ,CAAC,QAAQ;QAC3B,QAAQ;YACN,QAAQ;YACR,QAAQ,IAAI,QAAQ,CAAC,MAAM;QAC7B;IACF,IACA,KAAK;IAEX,MAAM,OAAO;;;;;IAuBb,mBAAmB,gBAAgB;IACnC,mBAAmB,wBAAwB;IAC3C,mBAAmB,qBAAqB;IACxC,mBAAmB,sBAAsB;IACzC,mBAAmB,sBAAsB;IACzC,mBAAmB,mBAAmB;IACtC,mBAAmB,oBAAoB;IACvC;;;;;;;;;;;;IAoHA,OAAO,aAAa,GAAG,MAAM,MAAM,MAAM,GAAG;AAC9C\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"QwikCityProvider_component_TxCFOy819ag\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_QwikCityProvider\",\n  \"displayName\": \"index.qwik.mjs_QwikCityProvider_component\",\n  \"hash\": \"TxCFOy819ag\",\n  \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_TxCFOy819ag\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    12650,\n    19595\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_QwikCityMockProvider_component_goto_BUbtvTyvVRE.mjs ==\n\nexport const QwikCityMockProvider_component_goto_BUbtvTyvVRE = async (path)=>{\n    throw new Error('Not implemented');\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"+DA6kB4C,OAAO;IAC7C,MAAM,IAAI,MAAM;AAClB\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"QwikCityMockProvider_component_goto_BUbtvTyvVRE\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_QwikCityMockProvider\",\n  \"displayName\": \"index.qwik.mjs_QwikCityMockProvider_component_goto\",\n  \"hash\": \"BUbtvTyvVRE\",\n  \"canonicalFilename\": \"index.qwik.mjs_QwikCityMockProvider_component_goto_BUbtvTyvVRE\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"QwikCityMockProvider_component_WmYC5H00wtI\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"goto\",\n  \"captures\": false,\n  \"loc\": [\n    20087,\n    20152\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_QwikCityMockProvider_component_WmYC5H00wtI.mjs ==\n\nimport { _auto_ContentContext as ContentContext } from \"./index.qwik.mjs\";\nimport { _auto_ContentInternalContext as ContentInternalContext } from \"./index.qwik.mjs\";\nimport { _auto_DocumentHeadContext as DocumentHeadContext } from \"./index.qwik.mjs\";\nimport { _auto_RouteLocationContext as RouteLocationContext } from \"./index.qwik.mjs\";\nimport { _auto_RouteNavigateContext as RouteNavigateContext } from \"./index.qwik.mjs\";\nimport { _auto_RouteStateContext as RouteStateContext } from \"./index.qwik.mjs\";\nimport { Slot } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _auto_createDocumentHead as createDocumentHead } from \"./index.qwik.mjs\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useContextProvider } from \"@builder.io/qwik\";\nimport { useSignal } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const QwikCityMockProvider_component_WmYC5H00wtI = (props)=>{\n    const urlEnv = props.url ?? 'http://localhost/';\n    const url = new URL(urlEnv);\n    const routeLocation = useStore({\n        url,\n        params: props.params ?? {},\n        isNavigating: false\n    }, {\n        deep: false\n    });\n    const loaderState = useSignal({});\n    const goto = /*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_QwikCityMockProvider_component_goto_BUbtvTyvVRE.mjs\"), \"QwikCityMockProvider_component_goto_BUbtvTyvVRE\");\n    const documentHead = useStore(createDocumentHead, {\n        deep: false\n    });\n    const content = useStore({\n        headings: void 0,\n        menu: void 0\n    }, {\n        deep: false\n    });\n    const contentInternal = useSignal();\n    useContextProvider(ContentContext, content);\n    useContextProvider(ContentInternalContext, contentInternal);\n    useContextProvider(DocumentHeadContext, documentHead);\n    useContextProvider(RouteLocationContext, routeLocation);\n    useContextProvider(RouteNavigateContext, goto);\n    useContextProvider(RouteStateContext, loaderState);\n    return /* @__PURE__ */ _jsxC(Slot, null, 3, 'qY_1');\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;;;;0DA+jB6B,CAAC;IAC1B,MAAM,SAAS,MAAM,GAAG,IAAI;IAC5B,MAAM,MAAM,IAAI,IAAI;IACpB,MAAM,gBAAgB,SACpB;QACE;QACA,QAAQ,MAAM,MAAM,IAAI,CAAC;QACzB,cAAc;IAChB,GACA;QACE,MAAM;IACR;IAEF,MAAM,cAAc,UAAU,CAAC;IAC/B,MAAM;IAGN,MAAM,eAAe,SAAS,oBAAoB;QAChD,MAAM;IACR;IACA,MAAM,UAAU,SACd;QACE,UAAU,KAAK;QACf,MAAM,KAAK;IACb,GACA;QACE,MAAM;IACR;IAEF,MAAM,kBAAkB;IACxB,mBAAmB,gBAAgB;IACnC,mBAAmB,wBAAwB;IAC3C,mBAAmB,qBAAqB;IACxC,mBAAmB,sBAAsB;IACzC,mBAAmB,sBAAsB;IACzC,mBAAmB,mBAAmB;IACtC,OAAO,aAAa,GAAG,MAAM,MAAM,MAAM,GAAG;AAC9C\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"QwikCityMockProvider_component_WmYC5H00wtI\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_QwikCityMockProvider\",\n  \"displayName\": \"index.qwik.mjs_QwikCityMockProvider_component\",\n  \"hash\": \"WmYC5H00wtI\",\n  \"canonicalFilename\": \"index.qwik.mjs_QwikCityMockProvider_component_WmYC5H00wtI\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    19730,\n    20871\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_Link_component_event_event_5g4B0Gd1Wck.mjs (ENTRY POINT)==\n\nimport { _auto_prefetchLinkResources as prefetchLinkResources } from \"./index.qwik.mjs\";\nexport const Link_component_event_event_5g4B0Gd1Wck = (ev, elm)=>prefetchLinkResources(elm, ev.type === 'qvisible');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";sDAonBQ,CAAC,IAAI,MAAQ,sBAAsB,KAAK,GAAG,IAAI,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"Link_component_event_event_5g4B0Gd1Wck\",\n  \"entry\": null,\n  \"displayName\": \"index.qwik.mjs_Link_component_event_event\",\n  \"hash\": \"5g4B0Gd1Wck\",\n  \"canonicalFilename\": \"index.qwik.mjs_Link_component_event_event_5g4B0Gd1Wck\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"Link_component_8gdLBszqbaM\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"event$\",\n  \"captures\": false,\n  \"loc\": [\n    21497,\n    21560\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_Link_component_a_onClick_kzjavhDI3L0.mjs ==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const Link_component_a_onClick_kzjavhDI3L0 = (_, elm)=>{\n    const [nav2, reload2] = useLexicalScope();\n    if (elm.href) nav2(elm.href, reload2);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";oDA+nBU,CAAC,GAAG;IACF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACxB,IAAI,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE;AAC/B\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"Link_component_a_onClick_kzjavhDI3L0\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_Link\",\n  \"displayName\": \"index.qwik.mjs_Link_component_a_onClick\",\n  \"hash\": \"kzjavhDI3L0\",\n  \"canonicalFilename\": \"index.qwik.mjs_Link_component_a_onClick_kzjavhDI3L0\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"Link_component_8gdLBszqbaM\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"_jsxS\",\n  \"captures\": true,\n  \"loc\": [\n    21863,\n    21994\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_Link_component_8gdLBszqbaM.mjs ==\n\nimport { Slot } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxS } from \"@builder.io/qwik\";\nimport { eventQrl } from \"@builder.io/qwik\";\nimport { _auto_getClientNavPath as getClientNavPath } from \"./index.qwik.mjs\";\nimport { _auto_getPrefetchDataset as getPrefetchDataset } from \"./index.qwik.mjs\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { untrack } from \"@builder.io/qwik\";\nimport { useLocation } from \"./index.qwik.mjs\";\nimport { useNavigate } from \"./index.qwik.mjs\";\nexport const Link_component_8gdLBszqbaM = (props)=>{\n    const nav = useNavigate();\n    const loc = useLocation();\n    const linkProps = {\n        ...props\n    };\n    const clientNavPath = untrack(()=>getClientNavPath(linkProps, loc));\n    const prefetchDataset = untrack(()=>getPrefetchDataset(props, clientNavPath, loc));\n    const reload = !!linkProps.reload;\n    linkProps['preventdefault:click'] = !!clientNavPath;\n    linkProps.href = clientNavPath || props.href;\n    const event = eventQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_Link_component_event_event_5g4B0Gd1Wck.mjs\"), \"Link_component_event_event_5g4B0Gd1Wck\"));\n    return /* @__PURE__ */ _jsxS('a', {\n        ...linkProps,\n        'data-prefetch': prefetchDataset,\n        children: /* @__PURE__ */ _jsxC(Slot, null, 3, 'AD_0'),\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_Link_component_a_onClick_kzjavhDI3L0.mjs\"), \"Link_component_a_onClick_kzjavhDI3L0\", [\n            nav,\n            reload\n        ]),\n        onMouseOver$: event,\n        onFocus$: event,\n        onQVisible$: event\n    }, null, 0, 'AD_1');\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;0CAumB6B,CAAC;IAC1B,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,YAAY;QAChB,GAAG,KAAK;IACV;IACA,MAAM,gBAAgB,QAAQ,IAAM,iBAAiB,WAAW;IAChE,MAAM,kBAAkB,QAAQ,IAAM,mBAAmB,OAAO,eAAe;IAC/E,MAAM,SAAS,CAAC,CAAC,UAAU,MAAM;IACjC,SAAS,CAAC,uBAAuB,GAAG,CAAC,CAAC;IACtC,UAAU,IAAI,GAAG,iBAAiB,MAAM,IAAI;IAC5C,MAAM,QAAQ;IAMd,OAAO,aAAa,GAAG,MACrB,KACA;QACE,GAAG,SAAS;QACZ,iBAAiB;QACjB,UAAU,aAAa,GAAG,MAAM,MAAM,MAAM,GAAG;QAC/C,QAAQ;;;;QAQR,cAAc;QACd,UAAU;QACV,aAAa;IACf,GACA,MACA,GACA;AAEJ\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"Link_component_8gdLBszqbaM\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_Link\",\n  \"displayName\": \"index.qwik.mjs_Link_component\",\n  \"hash\": \"8gdLBszqbaM\",\n  \"canonicalFilename\": \"index.qwik.mjs_Link_component_8gdLBszqbaM\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    20994,\n    22216\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_routeActionQrl_action_submit_A5bZC7WO00A.mjs ==\n\nimport { isServer } from \"@builder.io/qwik/build\";\nimport { noSerialize } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const routeActionQrl_action_submit_A5bZC7WO00A = (input = {})=>{\n    const [currentAction2, id2, loc2, state2] = useLexicalScope();\n    if (isServer) throw new Error(`Actions can not be invoked within the server during SSR.\nAction.run() can only be called on the browser, for example when a user clicks a button, or submits a form.`);\n    let data;\n    let form;\n    if (input instanceof SubmitEvent) {\n        form = input.target;\n        data = new FormData(form);\n        if ((input.submitter instanceof HTMLInputElement || input.submitter instanceof HTMLButtonElement) && input.submitter.name) {\n            if (input.submitter.name) data.append(input.submitter.name, input.submitter.value);\n        }\n    } else data = input;\n    return new Promise((resolve)=>{\n        if (data instanceof FormData) state2.formData = data;\n        state2.isRunning = true;\n        loc2.isNavigating = true;\n        currentAction2.value = {\n            data,\n            id: id2,\n            resolve: noSerialize(resolve)\n        };\n    }).then(({ result, status })=>{\n        state2.isRunning = false;\n        state2.status = status;\n        state2.value = result;\n        if (form) {\n            if (form.getAttribute('data-spa-reset') === 'true') form.reset();\n            const detail = {\n                status,\n                value: result\n            };\n            form.dispatchEvent(new CustomEvent('submitcompleted', {\n                bubbles: false,\n                cancelable: false,\n                composed: false,\n                detail\n            }));\n        }\n        return {\n            status,\n            value: result\n        };\n    });\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;wDA+rBM,CAAC,QAAQ,CAAC,CAAC;IACT,MAAM,CAAC,gBAAgB,KAAK,MAAM,OAAO,GAAG;IAC5C,IAAI,UACF,MAAM,IAAI,MAAM,CAAC;2GACgF,CAAC;IACpG,IAAI;IACJ,IAAI;IACJ,IAAI,iBAAiB,aAAa;QAChC,OAAO,MAAM,MAAM;QACnB,OAAO,IAAI,SAAS;QACpB,IACE,CAAC,MAAM,SAAS,YAAY,oBAC1B,MAAM,SAAS,YAAY,iBAAiB,KAC9C,MAAM,SAAS,CAAC,IAAI,EAEpB;YAAA,IAAI,MAAM,SAAS,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC,MAAM,SAAS,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC,KAAK;QAAC;IAEtF,OAAO,OAAO;IACd,OAAO,IAAI,QAAQ,CAAC;QAClB,IAAI,gBAAgB,UAAU,OAAO,QAAQ,GAAG;QAChD,OAAO,SAAS,GAAG;QACnB,KAAK,YAAY,GAAG;QACpB,eAAe,KAAK,GAAG;YACrB;YACA,IAAI;YACJ,SAAS,YAAY;QACvB;IACF,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;QACzB,OAAO,SAAS,GAAG;QACnB,OAAO,MAAM,GAAG;QAChB,OAAO,KAAK,GAAG;QACf,IAAI,MAAM;YACR,IAAI,KAAK,YAAY,CAAC,sBAAsB,QAAQ,KAAK,KAAK;YAC9D,MAAM,SAAS;gBACb;gBACA,OAAO;YACT;YACA,KAAK,aAAa,CAChB,IAAI,YAAY,mBAAmB;gBACjC,SAAS;gBACT,YAAY;gBACZ,UAAU;gBACV;YACF;QAEJ;QACA,OAAO;YACL;YACA,OAAO;QACT;IACF;AACF\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"routeActionQrl_action_submit_A5bZC7WO00A\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_routeActionQrl\",\n  \"displayName\": \"index.qwik.mjs_routeActionQrl_action_submit\",\n  \"hash\": \"A5bZC7WO00A\",\n  \"canonicalFilename\": \"index.qwik.mjs_routeActionQrl_action_submit_A5bZC7WO00A\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"submit\",\n  \"captures\": true,\n  \"loc\": [\n    23627,\n    25399\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_serverQrl_stuff_wOIPfiQ04l4.mjs ==\n\nimport { _deserializeData } from \"@builder.io/qwik\";\nimport { _getContextElement } from \"@builder.io/qwik\";\nimport { _serializeData } from \"@builder.io/qwik\";\nimport { _auto_getSSETransformer as getSSETransformer } from \"./index.qwik.mjs\";\nimport { isServer } from \"@builder.io/qwik/build\";\nimport { _auto_streamAsyncIterator as streamAsyncIterator } from \"./index.qwik.mjs\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { _auto_useQwikCityEnv as useQwikCityEnv } from \"./index.qwik.mjs\";\nexport const serverQrl_stuff_wOIPfiQ04l4 = async (...args)=>{\n    const [qrl2] = useLexicalScope();\n    if (isServer) {\n        const requestEvent = useQwikCityEnv()?.ev;\n        return qrl2.apply(requestEvent, args);\n    } else {\n        const ctxElm = _getContextElement();\n        const filtered = args.map((arg)=>{\n            if (arg instanceof SubmitEvent && arg.target instanceof HTMLFormElement) return new FormData(arg.target);\n            else if (arg instanceof Event) return null;\n            else if (arg instanceof Node) return null;\n            return arg;\n        });\n        const hash = qrl2.getHash();\n        const path = `?qfunc=${qrl2.getHash()}`;\n        const body = await _serializeData([\n            qrl2,\n            ...filtered\n        ], false);\n        const res = await fetch(path, {\n            method: 'POST',\n            headers: {\n                'Content-Type': 'application/qwik-json',\n                'X-QRL': hash\n            },\n            body\n        });\n        const contentType = res.headers.get('Content-Type');\n        if (res.ok && contentType === 'text/event-stream') {\n            const { writable, readable } = getSSETransformer();\n            res.body?.pipeTo(writable);\n            return streamAsyncIterator(readable, ctxElm ?? document.documentElement);\n        } else if (contentType === 'application/qwik-json') {\n            const str = await res.text();\n            const obj = await _deserializeData(str, ctxElm ?? document.documentElement);\n            if (res.status === 500) throw obj;\n            return obj;\n        }\n    }\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;2CA60BM,OAAO,GAAG;IACR,MAAM,CAAC,KAAK,GAAG;IACf,IAAI,UAAU;QACZ,MAAM,eAAe,kBAAkB;QACvC,OAAO,KAAK,KAAK,CAAC,cAAc;IAClC,OAAO;QACL,MAAM,SAAS;QACf,MAAM,WAAW,KAAK,GAAG,CAAC,CAAC;YACzB,IAAI,eAAe,eAAe,IAAI,MAAM,YAAY,iBACtD,OAAO,IAAI,SAAS,IAAI,MAAM;iBAC3B,IAAI,eAAe,OAAO,OAAO;iBACjC,IAAI,eAAe,MAAM,OAAO;YACrC,OAAO;QACT;QACA,MAAM,OAAO,KAAK,OAAO;QACzB,MAAM,OAAO,CAAC,OAAO,EAAE,KAAK,OAAO,IAAI;QACvC,MAAM,OAAO,MAAM,eAAe;YAAC;eAAS;SAAS,EAAE;QACvD,MAAM,MAAM,MAAM,MAAM,MAAM;YAC5B,QAAQ;YACR,SAAS;gBACP,gBAAgB;gBAChB,SAAS;YACX;YACA;QACF;QACA,MAAM,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC;QACpC,IAAI,IAAI,EAAE,IAAI,gBAAgB,qBAAqB;YACjD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG;YAC/B,IAAI,IAAI,EAAE,OAAO;YACjB,OAAO,oBAAoB,UAAU,UAAU,SAAS,eAAe;QACzE,OAAO,IAAI,gBAAgB,yBAAyB;YAClD,MAAM,MAAM,MAAM,IAAI,IAAI;YAC1B,MAAM,MAAM,MAAM,iBAAiB,KAAK,UAAU,SAAS,eAAe;YAC1E,IAAI,IAAI,MAAM,KAAK,KAAK,MAAM;YAC9B,OAAO;QACT;IACF;AACF\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"serverQrl_stuff_wOIPfiQ04l4\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_serverQrl\",\n  \"displayName\": \"index.qwik.mjs_serverQrl_stuff\",\n  \"hash\": \"wOIPfiQ04l4\",\n  \"canonicalFilename\": \"index.qwik.mjs_serverQrl_stuff_wOIPfiQ04l4\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"stuff\",\n  \"captures\": true,\n  \"loc\": [\n    28381,\n    29960\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_GetForm_component_form_onSubmit_p9MSze0ojs4.mjs ==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const GetForm_component_form_onSubmit_p9MSze0ojs4 = async (_, form)=>{\n    const [nav2] = useLexicalScope();\n    const formData = new FormData(form);\n    const params = new URLSearchParams();\n    formData.forEach((value, key)=>{\n        if (typeof value === 'string') params.append(key, value);\n    });\n    nav2('?' + params.toString(), true).then(()=>{\n        if (form.getAttribute('data-spa-reset') === 'true') form.reset();\n        form.dispatchEvent(new CustomEvent('submitcompleted', {\n            bubbles: false,\n            cancelable: false,\n            composed: false,\n            detail: {\n                status: 200\n            }\n        }));\n    });\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";2DA6+BU,OAAO,GAAG;IACR,MAAM,CAAC,KAAK,GAAG;IACf,MAAM,WAAW,IAAI,SAAS;IAC9B,MAAM,SAAS,IAAI;IACnB,SAAS,OAAO,CAAC,CAAC,OAAO;QACvB,IAAI,OAAO,UAAU,UAAU,OAAO,MAAM,CAAC,KAAK;IACpD;IACA,KAAK,MAAM,OAAO,QAAQ,IAAI,MAAM,IAAI,CAAC;QACvC,IAAI,KAAK,YAAY,CAAC,sBAAsB,QAAQ,KAAK,KAAK;QAC9D,KAAK,aAAa,CAChB,IAAI,YAAY,mBAAmB;YACjC,SAAS;YACT,YAAY;YACZ,UAAU;YACV,QAAQ;gBACN,QAAQ;YACV;QACF;IAEJ;AACF\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"GetForm_component_form_onSubmit_p9MSze0ojs4\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_GetForm\",\n  \"displayName\": \"index.qwik.mjs_GetForm_component_form_onSubmit\",\n  \"hash\": \"p9MSze0ojs4\",\n  \"canonicalFilename\": \"index.qwik.mjs_GetForm_component_form_onSubmit_p9MSze0ojs4\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": \"GetForm_component_Nk9PlpjQm9Y\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"_jsxS\",\n  \"captures\": true,\n  \"loc\": [\n    33229,\n    34009\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs_GetForm_component_Nk9PlpjQm9Y.mjs ==\n\nimport { Slot } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxS } from \"@builder.io/qwik\";\nimport { _restProps } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useNavigate } from \"./index.qwik.mjs\";\nexport const GetForm_component_Nk9PlpjQm9Y = (props)=>{\n    const rest = _restProps(props, [\n        'action',\n        'spaReset',\n        'reloadDocument',\n        'onSubmit$'\n    ]);\n    const nav = useNavigate();\n    return /* @__PURE__ */ _jsxS('form', {\n        ...rest,\n        children: /* @__PURE__ */ _jsxC(Slot, null, 3, 'BC_0'),\n        onSubmit$: /*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_GetForm_component_form_onSubmit_p9MSze0ojs4.mjs\"), \"GetForm_component_form_onSubmit_p9MSze0ojs4\", [\n            nav\n        ])\n    }, {\n        action: 'get',\n        'preventdefault:submit': _fnSignal((p0)=>!p0.reloadDocument, [\n            props\n        ], '!p0.reloadDocument'),\n        'data-spa-reset': _fnSignal((p0)=>p0.spaReset ? 'true' : void 0, [\n            props\n        ], 'p0.spaReset?\"true\":undefined')\n    }, 0, 'BC_1');\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;6CAo+B6B,CAAC;IAC1B,MAAM,OAAO,WAAW,OAAO;QAAC;QAAU;QAAY;QAAkB;KAAY;IACpF,MAAM,MAAM;IACZ,OAAO,aAAa,GAAG,MACrB,QACA;QACE,GAAG,IAAI;QACP,UAAU,aAAa,GAAG,MAAM,MAAM,MAAM,GAAG;QAC/C,SAAS;;;IAyBX,GACA;QACE,QAAQ;QACR,yBAAyB,UACvB,CAAC,KAAO,CAAC,GAAG,cAAc,EAC1B;YAAC;SAAM,EACP;QAEF,kBAAkB,UAChB,CAAC,KAAQ,GAAG,QAAQ,GAAG,SAAS,KAAK,GACrC;YAAC;SAAM,EACP;IAEJ,GACA,GACA;AAEJ\\\"}\")\n/*\n{\n  \"origin\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\",\n  \"name\": \"GetForm_component_Nk9PlpjQm9Y\",\n  \"entry\": \"../node_modules/@builder.io/qwik-city/index.qwik.mjs_entry_GetForm\",\n  \"displayName\": \"index.qwik.mjs_GetForm_component\",\n  \"hash\": \"Nk9PlpjQm9Y\",\n  \"canonicalFilename\": \"index.qwik.mjs_GetForm_component_Nk9PlpjQm9Y\",\n  \"path\": \"../node_modules/@builder.io/qwik-city\",\n  \"extension\": \"mjs\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    32900,\n    34478\n  ]\n}\n*/\n============================= ../node_modules/@builder.io/qwik-city/index.qwik.mjs ==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { createContextId, componentQrl, _jsxBranch, useContext, _jsxC, withLocale, _deserializeData, noSerialize, useServerData, useStore, _getContextElement, _jsxS, _jsxQ, _wrapSignal, implicit$FirstArg } from '@builder.io/qwik';\nimport { isServer, isDev } from '@builder.io/qwik/build';\nimport swRegister from '@qwik-city-sw-register';\nimport { z } from 'zod';\nimport { z as z2 } from 'zod';\nconst RouteStateContext = /* @__PURE__ */ createContextId('qc-s');\nconst ContentContext = /* @__PURE__ */ createContextId('qc-c');\nconst ContentInternalContext = /* @__PURE__ */ createContextId('qc-ic');\nconst DocumentHeadContext = /* @__PURE__ */ createContextId('qc-h');\nconst RouteLocationContext = /* @__PURE__ */ createContextId('qc-l');\nconst RouteNavigateContext = /* @__PURE__ */ createContextId('qc-n');\nconst RouteActionContext = /* @__PURE__ */ createContextId('qc-a');\nconst RouterOutlet = /* @__PURE__ */ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_RouterOutlet_component_AKetNByE5TM.mjs\"), \"RouterOutlet_component_AKetNByE5TM\"));\nconst MODULE_CACHE = /* @__PURE__ */ new WeakMap();\nconst CLIENT_DATA_CACHE = /* @__PURE__ */ new Map();\nconst QACTION_KEY = 'qaction';\nconst toPath = (url)=>url.pathname + url.search + url.hash;\nconst toUrl = (url, baseUrl)=>new URL(url, baseUrl.href);\nconst isSameOrigin = (a, b)=>a.origin === b.origin;\nconst isSamePath = (a, b)=>a.pathname + a.search === b.pathname + b.search;\nconst isSamePathname = (a, b)=>a.pathname === b.pathname;\nconst isSameOriginDifferentPathname = (a, b)=>isSameOrigin(a, b) && !isSamePath(a, b);\nconst getClientDataPath = (pathname, pageSearch, action)=>{\n    let search = pageSearch ?? '';\n    if (action) search += (search ? '&' : '?') + QACTION_KEY + '=' + encodeURIComponent(action.id);\n    return pathname + (pathname.endsWith('/') ? '' : '/') + 'q-data.json' + search;\n};\nconst getClientNavPath = (props, baseUrl)=>{\n    const href = props.href;\n    if (typeof href === 'string' && href.trim() !== '' && typeof props.target !== 'string') try {\n        const linkUrl = toUrl(href, baseUrl.url);\n        const currentUrl = toUrl('', baseUrl.url);\n        if (isSameOrigin(linkUrl, currentUrl)) return toPath(linkUrl);\n    } catch (e) {\n        console.error(e);\n    }\n    else if (props.reload) return toPath(toUrl('', baseUrl.url));\n    return null;\n};\nconst getPrefetchDataset = (props, clientNavPath, currentLoc)=>{\n    if (props.prefetch === true && clientNavPath) {\n        const prefetchUrl = toUrl(clientNavPath, currentLoc.url);\n        if (!isSamePathname(prefetchUrl, toUrl('', currentLoc.url))) return '';\n    }\n    return null;\n};\nconst clientNavigate = (win, newUrl, routeNavigate)=>{\n    const currentUrl = win.location;\n    if (isSameOriginDifferentPathname(currentUrl, newUrl)) {\n        handleScroll(win, currentUrl, newUrl);\n        win.history.pushState('', '', toPath(newUrl));\n    }\n    if (!win._qCityHistory) {\n        win._qCityHistory = 1;\n        win.addEventListener('popstate', ()=>{\n            const currentUrl2 = win.location;\n            const previousUrl = toUrl(routeNavigate.value, currentUrl2);\n            if (isSameOriginDifferentPathname(currentUrl2, previousUrl)) {\n                handleScroll(win, previousUrl, currentUrl2);\n                routeNavigate.value = toPath(new URL(currentUrl2.href));\n            }\n        });\n        win.removeEventListener('popstate', win._qCityPopstateFallback);\n    }\n};\nconst handleScroll = async (win, previousUrl, newUrl)=>{\n    const doc = win.document;\n    const newHash = newUrl.hash;\n    if (isSamePath(previousUrl, newUrl)) {\n        if (previousUrl.hash !== newHash) {\n            await domWait();\n            if (newHash) scrollToHashId(doc, newHash);\n            else win.scrollTo(0, 0);\n        }\n    } else {\n        if (newHash) for(let i = 0; i < 24; i++){\n            await domWait();\n            if (scrollToHashId(doc, newHash)) break;\n        }\n        else {\n            await domWait();\n            win.scrollTo(0, 0);\n        }\n    }\n};\nconst domWait = ()=>new Promise((resolve)=>setTimeout(resolve, 12));\nconst scrollToHashId = (doc, hash)=>{\n    const elmId = hash.slice(1);\n    const elm = doc.getElementById(elmId);\n    if (elm) elm.scrollIntoView();\n    return elm;\n};\nconst dispatchPrefetchEvent = (prefetchData)=>{\n    if (typeof document !== 'undefined') document.dispatchEvent(new CustomEvent('qprefetch', {\n        detail: prefetchData\n    }));\n};\nconst resolveHead = (endpoint, routeLocation, contentModules, locale)=>{\n    const head = createDocumentHead();\n    const getData = (loaderOrAction)=>{\n        const id = loaderOrAction.__id;\n        if (loaderOrAction.__brand === 'server_loader') {\n            if (!(id in endpoint.loaders)) throw new Error('You can not get the returned data of a loader that has not been executed for this request.');\n        }\n        const data = endpoint.loaders[id];\n        if (data instanceof Promise) throw new Error('Loaders returning a function can not be referred to in the head function.');\n        return data;\n    };\n    const headProps = {\n        head,\n        withLocale: (fn)=>withLocale(locale, fn),\n        resolveValue: getData,\n        ...routeLocation\n    };\n    for(let i = contentModules.length - 1; i >= 0; i--){\n        const contentModuleHead = contentModules[i] && contentModules[i].head;\n        if (contentModuleHead) {\n            if (typeof contentModuleHead === 'function') resolveDocumentHead(head, withLocale(locale, ()=>contentModuleHead(headProps)));\n            else if (typeof contentModuleHead === 'object') resolveDocumentHead(head, contentModuleHead);\n        }\n    }\n    return headProps.head;\n};\nconst resolveDocumentHead = (resolvedHead, updatedHead)=>{\n    if (typeof updatedHead.title === 'string') resolvedHead.title = updatedHead.title;\n    mergeArray(resolvedHead.meta, updatedHead.meta);\n    mergeArray(resolvedHead.links, updatedHead.links);\n    mergeArray(resolvedHead.styles, updatedHead.styles);\n    Object.assign(resolvedHead.frontmatter, updatedHead.frontmatter);\n};\nconst mergeArray = (existingArr, newArr)=>{\n    if (Array.isArray(newArr)) for (const newItem of newArr){\n        if (typeof newItem.key === 'string') {\n            const existingIndex = existingArr.findIndex((i)=>i.key === newItem.key);\n            if (existingIndex > -1) {\n                existingArr[existingIndex] = newItem;\n                continue;\n            }\n        }\n        existingArr.push(newItem);\n    }\n};\nconst createDocumentHead = ()=>({\n        title: '',\n        meta: [],\n        links: [],\n        styles: [],\n        frontmatter: {}\n    });\nconst loadRoute = async (routes, menus, cacheModules, pathname)=>{\n    if (Array.isArray(routes)) for (const route of routes){\n        const match = route[0].exec(pathname);\n        if (match) {\n            const loaders = route[1];\n            const params = getPathParams(route[2], match);\n            const routeBundleNames = route[4];\n            const mods = new Array(loaders.length);\n            const pendingLoads = [];\n            const menuLoader = getMenuLoader(menus, pathname);\n            let menu = void 0;\n            loaders.forEach((moduleLoader, i)=>{\n                loadModule(moduleLoader, pendingLoads, (routeModule)=>mods[i] = routeModule, cacheModules);\n            });\n            loadModule(menuLoader, pendingLoads, (menuModule)=>menu = menuModule?.default, cacheModules);\n            if (pendingLoads.length > 0) await Promise.all(pendingLoads);\n            return [\n                params,\n                mods,\n                menu,\n                routeBundleNames\n            ];\n        }\n    }\n    return null;\n};\nconst loadModule = (moduleLoader, pendingLoads, moduleSetter, cacheModules)=>{\n    if (typeof moduleLoader === 'function') {\n        const loadedModule = MODULE_CACHE.get(moduleLoader);\n        if (loadedModule) moduleSetter(loadedModule);\n        else {\n            const l = moduleLoader();\n            if (typeof l.then === 'function') pendingLoads.push(l.then((loadedModule2)=>{\n                if (cacheModules !== false) MODULE_CACHE.set(moduleLoader, loadedModule2);\n                moduleSetter(loadedModule2);\n            }));\n            else if (l) moduleSetter(l);\n        }\n    }\n};\nconst getMenuLoader = (menus, pathname)=>{\n    if (menus) {\n        pathname = pathname.endsWith('/') ? pathname : pathname + '/';\n        const menu = menus.find((m)=>m[0] === pathname || pathname.startsWith(m[0] + (pathname.endsWith('/') ? '' : '/')));\n        if (menu) return menu[1];\n    }\n};\nconst getPathParams = (paramNames, match)=>{\n    const params = {};\n    if (paramNames) for(let i = 0; i < paramNames.length; i++){\n        const param = match?.[i + 1] ?? '';\n        const v = param.endsWith('/') ? param.slice(0, -1) : param;\n        params[paramNames[i]] = decodeURIComponent(v);\n    }\n    return params;\n};\nconst loadClientData = async (url, element, clearCache, action)=>{\n    const pagePathname = url.pathname;\n    const pageSearch = url.search;\n    const clientDataPath = getClientDataPath(pagePathname, pageSearch, action);\n    let qData = void 0;\n    if (!action) qData = CLIENT_DATA_CACHE.get(clientDataPath);\n    dispatchPrefetchEvent({\n        links: [\n            pagePathname\n        ]\n    });\n    if (!qData) {\n        const options = getFetchOptions(action);\n        if (action) action.data = void 0;\n        qData = fetch(clientDataPath, options).then((rsp)=>{\n            const redirectedURL = new URL(rsp.url);\n            if (redirectedURL.origin !== location.origin || !isQDataJson(redirectedURL.pathname)) {\n                location.href = redirectedURL.href;\n                return;\n            }\n            if ((rsp.headers.get('content-type') || '').includes('json')) return rsp.text().then((text)=>{\n                const clientData = _deserializeData(text, element);\n                if (!clientData) {\n                    location.href = url.href;\n                    return;\n                }\n                if (clearCache) CLIENT_DATA_CACHE.delete(clientDataPath);\n                if (clientData.redirect) location.href = clientData.redirect;\n                else if (action) {\n                    const actionData = clientData.loaders[action.id];\n                    action.resolve({\n                        status: rsp.status,\n                        result: actionData\n                    });\n                }\n                return clientData;\n            });\n            else {\n                location.href = url.href;\n                return void 0;\n            }\n        });\n        if (!action) CLIENT_DATA_CACHE.set(clientDataPath, qData);\n    }\n    return qData.then((v)=>{\n        if (!v) CLIENT_DATA_CACHE.delete(clientDataPath);\n        return v;\n    });\n};\nconst getFetchOptions = (action)=>{\n    const actionData = action?.data;\n    if (!actionData) return void 0;\n    if (actionData instanceof FormData) return {\n        method: 'POST',\n        body: actionData\n    };\n    else return {\n        method: 'POST',\n        body: JSON.stringify(actionData),\n        headers: {\n            'Content-Type': 'application/json, charset=UTF-8'\n        }\n    };\n};\nconst isQDataJson = (pathname)=>{\n    return pathname.endsWith(QDATA_JSON);\n};\nconst QDATA_JSON = '/q-data.json';\nconst useContent = ()=>useContext(ContentContext);\nconst useDocumentHead = ()=>useContext(DocumentHeadContext);\nconst useLocation = ()=>useContext(RouteLocationContext);\nconst useNavigate = ()=>useContext(RouteNavigateContext);\nconst useAction = ()=>useContext(RouteActionContext);\nconst useQwikCityEnv = ()=>noSerialize(useServerData('qwikcity'));\nconst QwikCityProvider = /* @__PURE__ */ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_QwikCityProvider_component_TxCFOy819ag.mjs\"), \"QwikCityProvider_component_TxCFOy819ag\"));\nconst QwikCityMockProvider = /* @__PURE__ */ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_QwikCityMockProvider_component_WmYC5H00wtI.mjs\"), \"QwikCityMockProvider_component_WmYC5H00wtI\"));\nconst Link = /* @__PURE__ */ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_Link_component_8gdLBszqbaM.mjs\"), \"Link_component_8gdLBszqbaM\"));\nconst prefetchLinkResources = (elm, isOnVisible)=>{\n    if (elm && elm.href && elm.hasAttribute('data-prefetch')) {\n        if (!windowInnerWidth) windowInnerWidth = innerWidth;\n        if (!isOnVisible || isOnVisible && windowInnerWidth < 520) loadClientData(new URL(elm.href), elm);\n    }\n};\nlet windowInnerWidth = 0;\nconst ServiceWorkerRegister = (props)=>_jsxQ('script', {\n        nonce: _wrapSignal(props, 'nonce')\n    }, {\n        dangerouslySetInnerHTML: swRegister\n    }, null, 3, '1Z_0');\nconst routeActionQrl = (actionQrl, ...rest)=>{\n    const { id, validators } = getValidators(rest, actionQrl);\n    function action() {\n        const loc = useLocation();\n        const currentAction = useAction();\n        const initialState = {\n            actionPath: `?${QACTION_KEY}=${id}`,\n            isRunning: false,\n            status: void 0,\n            value: void 0,\n            formData: void 0\n        };\n        const state = useStore(()=>{\n            const value = currentAction.value;\n            if (value && value?.id === id) {\n                const data = value.data;\n                if (data instanceof FormData) initialState.formData = data;\n                if (value.output) {\n                    const { status, result } = value.output;\n                    initialState.status = status;\n                    initialState.value = result;\n                }\n            }\n            return initialState;\n        });\n        const submit = /*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_routeActionQrl_action_submit_A5bZC7WO00A.mjs\"), \"routeActionQrl_action_submit_A5bZC7WO00A\", [\n            currentAction,\n            id,\n            loc,\n            state\n        ]);\n        initialState.submit = submit;\n        return state;\n    }\n    action.__brand = 'server_action';\n    action.__validators = validators;\n    action.__qrl = actionQrl;\n    action.__id = id;\n    Object.freeze(action);\n    return action;\n};\nconst globalActionQrl = (actionQrl, ...rest)=>{\n    const action = routeActionQrl(actionQrl, ...rest);\n    if (isServer) {\n        if (typeof globalThis._qwikActionsMap === 'undefined') globalThis._qwikActionsMap = /* @__PURE__ */ new Map();\n        globalThis._qwikActionsMap.set(action.__id, action);\n    }\n    return action;\n};\nconst routeAction$ = /* @__PURE__ */ implicit$FirstArg(routeActionQrl);\nconst globalAction$ = /* @__PURE__ */ implicit$FirstArg(globalActionQrl);\nconst routeLoaderQrl = (loaderQrl, ...rest)=>{\n    const { id, validators } = getValidators(rest, loaderQrl);\n    function loader() {\n        return useContext(RouteStateContext, (state)=>{\n            if (!(id in state)) throw new Error(`Loader (${id}) was used in a path where the 'loader$' was not declared.\n    This is likely because the used loader was not exported in a layout.tsx or index.tsx file of the existing route.\n    For more information check: https://qwik.dev/qwikcity/route-loader/`);\n            return _wrapSignal(state, id);\n        });\n    }\n    loader.__brand = 'server_loader';\n    loader.__qrl = loaderQrl;\n    loader.__validators = validators;\n    loader.__id = id;\n    Object.freeze(loader);\n    return loader;\n};\nconst routeLoader$ = /* @__PURE__ */ implicit$FirstArg(routeLoaderQrl);\nconst validatorQrl = (validator)=>{\n    if (isServer) return {\n        validate: validator\n    };\n    return void 0;\n};\nconst validator$ = /* @__PURE__ */ implicit$FirstArg(validatorQrl);\nconst zodQrl = (qrl)=>{\n    if (isServer) {\n        const schema = qrl.resolve().then((obj)=>{\n            if (typeof obj === 'function') obj = obj(z);\n            if (obj instanceof z.Schema) return obj;\n            else return z.object(obj);\n        });\n        return {\n            async validate (ev, inputData) {\n                const data = inputData ?? await ev.parseBody();\n                const result = await (await schema).safeParseAsync(data);\n                if (result.success) return result;\n                else {\n                    if (isDev) console.error('\\nVALIDATION ERROR\\naction$() zod validated failed', '\\n  - Issues:', result.error.issues);\n                    return {\n                        success: false,\n                        status: 400,\n                        error: result.error.flatten()\n                    };\n                }\n            }\n        };\n    }\n    return void 0;\n};\nconst zod$ = /* @__PURE__ */ implicit$FirstArg(zodQrl);\nconst serverQrl = (qrl1)=>{\n    if (isServer) {\n        const captured = qrl1.getCaptured();\n        if (captured && captured.length > 0 && !_getContextElement()) throw new Error('For security reasons, we cannot serialize QRLs that capture lexical scope.');\n    }\n    function stuff() {\n        return /*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_serverQrl_stuff_wOIPfiQ04l4.mjs\"), \"serverQrl_stuff_wOIPfiQ04l4\", [\n            qrl1\n        ]);\n    }\n    return stuff();\n};\nconst server$ = /* @__PURE__ */ implicit$FirstArg(serverQrl);\nconst getValidators = (rest, qrl)=>{\n    let id;\n    const validators = [];\n    if (rest.length === 1) {\n        const options = rest[0];\n        if (options && typeof options === 'object') {\n            if ('validate' in options) validators.push(options);\n            else {\n                id = options.id;\n                if (options.validation) validators.push(...options.validation);\n            }\n        }\n    } else if (rest.length > 1) validators.push(...rest.filter((v)=>!!v));\n    if (typeof id === 'string') {\n        if (isDev) {\n            if (!/^[\\w/.-]+$/.test(id)) throw new Error(`Invalid id: ${id}, id can only contain [a-zA-Z0-9_.-]`);\n        }\n        id = `id_${id}`;\n    } else id = qrl.getHash();\n    return {\n        validators: validators.reverse(),\n        id\n    };\n};\nconst getSSETransformer = ()=>{\n    let currentLine = '';\n    const encoder = new TextDecoder();\n    const transformer = new TransformStream({\n        transform (chunk, controller) {\n            const lines = encoder.decode(chunk).split('\\n\\n');\n            for(let i = 0; i < lines.length - 1; i++){\n                const line = currentLine + lines[i];\n                if (line.length === 0) {\n                    controller.terminate();\n                    break;\n                } else {\n                    controller.enqueue(parseEvent(line));\n                    currentLine = '';\n                }\n            }\n            currentLine += lines[lines.length - 1];\n        }\n    });\n    return transformer;\n};\nconst parseEvent = (message)=>{\n    const lines = message.split('\\n');\n    const event = {\n        data: ''\n    };\n    let data = '';\n    for (const line of lines)if (line.startsWith('data: ')) data += line.slice(6) + '\\n';\n    else {\n        const [key, value] = line.split(':');\n        if (typeof key === 'string' && typeof value === 'string') event[key] = value.trim();\n    }\n    event.data = data;\n    return event;\n};\nasync function* streamAsyncIterator(stream, ctxElm) {\n    const reader = stream.getReader();\n    try {\n        while(true){\n            const { done, value } = await reader.read();\n            if (done) return;\n            const obj = await _deserializeData(value.data, ctxElm);\n            yield obj;\n        }\n    } finally{\n        reader.releaseLock();\n    }\n}\nconst Form = ({ action, spaReset, reloadDocument, onSubmit$, ...rest }, key)=>{\n    _jsxBranch();\n    if (action) return _jsxS('form', {\n        ...rest,\n        action: _wrapSignal(action, 'actionPath'),\n        'preventdefault:submit': !reloadDocument,\n        ['data-spa-reset']: spaReset ? 'true' : void 0,\n        onSubmit$: [\n            !reloadDocument ? action.submit : void 0,\n            onSubmit$\n        ]\n    }, {\n        method: 'post'\n    }, 0, key);\n    else return /* @__PURE__ */ _jsxC(GetForm, {\n        spaReset,\n        reloadDocument,\n        onSubmit$,\n        ...rest\n    }, 0, key);\n};\nconst GetForm = /* @__PURE__ */ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./index.qwik.mjs_GetForm_component_Nk9PlpjQm9Y.mjs\"), \"GetForm_component_Nk9PlpjQm9Y\"));\nexport { Form, Link, QwikCityMockProvider, QwikCityProvider, RouterOutlet, ServiceWorkerRegister, globalAction$, globalActionQrl, routeAction$, routeActionQrl, routeLoader$, routeLoaderQrl, server$, serverQrl, useContent, useDocumentHead, useLocation, useNavigate, validator$, validatorQrl, z2 as z, zod$, zodQrl };\nexport { CLIENT_DATA_CACHE as _auto_CLIENT_DATA_CACHE };\nexport { ContentContext as _auto_ContentContext };\nexport { ContentInternalContext as _auto_ContentInternalContext };\nexport { DocumentHeadContext as _auto_DocumentHeadContext };\nexport { RouteActionContext as _auto_RouteActionContext };\nexport { RouteLocationContext as _auto_RouteLocationContext };\nexport { RouteNavigateContext as _auto_RouteNavigateContext };\nexport { RouteStateContext as _auto_RouteStateContext };\nexport { clientNavigate as _auto_clientNavigate };\nexport { createDocumentHead as _auto_createDocumentHead };\nexport { getClientNavPath as _auto_getClientNavPath };\nexport { getPrefetchDataset as _auto_getPrefetchDataset };\nexport { getSSETransformer as _auto_getSSETransformer };\nexport { isSameOriginDifferentPathname as _auto_isSameOriginDifferentPathname };\nexport { loadClientData as _auto_loadClientData };\nexport { loadRoute as _auto_loadRoute };\nexport { prefetchLinkResources as _auto_prefetchLinkResources };\nexport { resolveHead as _auto_resolveHead };\nexport { streamAsyncIterator as _auto_streamAsyncIterator };\nexport { toPath as _auto_toPath };\nexport { useQwikCityEnv as _auto_useQwikCityEnv };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/node_modules/@builder.io/qwik-city/index.qwik.mjs\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";AAAA,SACE,eAAe,EACf,YAAY,EAEZ,UAAU,EAGV,UAAU,EACV,KAAK,EAEL,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,aAAa,EAEb,QAAQ,EAIR,kBAAkB,EAMlB,KAAK,EACL,KAAK,EACL,WAAW,EACX,iBAAiB,QAIZ,mBAAmB;AAC1B,SAAoB,QAAQ,EAAE,KAAK,QAAQ,yBAAyB;AAEpE,OAAO,gBAAgB,yBAAyB;AAChD,SAAS,CAAC,QAAQ,MAAM;AACxB,SAAS,KAAK,EAAE,QAAQ,MAAM;AAC9B,MAAM,oBAAoB,aAAa,GAAG,gBAAgB;AAC1D,MAAM,iBAAiB,aAAa,GAAG,gBAAgB;AACvD,MAAM,yBAAyB,aAAa,GAAG,gBAAgB;AAC/D,MAAM,sBAAsB,aAAa,GAAG,gBAAgB;AAC5D,MAAM,uBAAuB,aAAa,GAAG,gBAAgB;AAC7D,MAAM,uBAAuB,aAAa,GAAG,gBAAgB;AAC7D,MAAM,qBAAqB,aAAa,GAAG,gBAAgB;AAC3D,MAAM,eAAe,aAAa,GAAG;AAsCrC,MAAM,eAAe,aAAa,GAAG,IAAI;AACzC,MAAM,oBAAoB,aAAa,GAAG,IAAI;AAC9C,MAAM,cAAc;AACpB,MAAM,SAAS,CAAC,MAAQ,IAAI,QAAQ,GAAG,IAAI,MAAM,GAAG,IAAI,IAAI;AAC5D,MAAM,QAAQ,CAAC,KAAK,UAAY,IAAI,IAAI,KAAK,QAAQ,IAAI;AACzD,MAAM,eAAe,CAAC,GAAG,IAAM,EAAE,MAAM,KAAK,EAAE,MAAM;AACpD,MAAM,aAAa,CAAC,GAAG,IAAM,EAAE,QAAQ,GAAG,EAAE,MAAM,KAAK,EAAE,QAAQ,GAAG,EAAE,MAAM;AAC5E,MAAM,iBAAiB,CAAC,GAAG,IAAM,EAAE,QAAQ,KAAK,EAAE,QAAQ;AAC1D,MAAM,gCAAgC,CAAC,GAAG,IAAM,aAAa,GAAG,MAAM,CAAC,WAAW,GAAG;AACrF,MAAM,oBAAoB,CAAC,UAAU,YAAY;IAC/C,IAAI,SAAS,cAAc;IAC3B,IAAI,QAAQ,UAAU,CAAC,SAAS,MAAM,GAAG,IAAI,cAAc,MAAM,mBAAmB,OAAO,EAAE;IAC7F,OAAO,WAAW,CAAC,SAAS,QAAQ,CAAC,OAAO,KAAK,GAAG,IAAI,gBAAgB;AAC1E;AACA,MAAM,mBAAmB,CAAC,OAAO;IAC/B,MAAM,OAAO,MAAM,IAAI;IACvB,IAAI,OAAO,SAAS,YAAY,KAAK,IAAI,OAAO,MAAM,OAAO,MAAM,MAAM,KAAK,UAC5E,IAAI;QACF,MAAM,UAAU,MAAM,MAAM,QAAQ,GAAG;QACvC,MAAM,aAAa,MAAM,IAAI,QAAQ,GAAG;QACxC,IAAI,aAAa,SAAS,aAAa,OAAO,OAAO;IACvD,EAAE,OAAO,GAAG;QACV,QAAQ,KAAK,CAAC;IAChB;SACG,IAAI,MAAM,MAAM,EAAE,OAAO,OAAO,MAAM,IAAI,QAAQ,GAAG;IAC1D,OAAO;AACT;AACA,MAAM,qBAAqB,CAAC,OAAO,eAAe;IAChD,IAAI,MAAM,QAAQ,KAAK,QAAQ,eAAe;QAC5C,MAAM,cAAc,MAAM,eAAe,WAAW,GAAG;QACvD,IAAI,CAAC,eAAe,aAAa,MAAM,IAAI,WAAW,GAAG,IAAI,OAAO;IACtE;IACA,OAAO;AACT;AACA,MAAM,iBAAiB,CAAC,KAAK,QAAQ;IACnC,MAAM,aAAa,IAAI,QAAQ;IAC/B,IAAI,8BAA8B,YAAY,SAAS;QACrD,aAAa,KAAK,YAAY;QAC9B,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,OAAO;IACvC;IACA,IAAI,CAAC,IAAI,aAAa,EAAE;QACtB,IAAI,aAAa,GAAG;QACpB,IAAI,gBAAgB,CAAC,YAAY;YAC/B,MAAM,cAAc,IAAI,QAAQ;YAChC,MAAM,cAAc,MAAM,cAAc,KAAK,EAAE;YAC/C,IAAI,8BAA8B,aAAa,cAAc;gBAC3D,aAAa,KAAK,aAAa;gBAC/B,cAAc,KAAK,GAAG,OAAO,IAAI,IAAI,YAAY,IAAI;YACvD;QACF;QACA,IAAI,mBAAmB,CAAC,YAAY,IAAI,sBAAsB;IAChE;AACF;AACA,MAAM,eAAe,OAAO,KAAK,aAAa;IAC5C,MAAM,MAAM,IAAI,QAAQ;IACxB,MAAM,UAAU,OAAO,IAAI;IAC3B,IAAI,WAAW,aAAa,SAC1B;QAAA,IAAI,YAAY,IAAI,KAAK,SAAS;YAChC,MAAM;YACN,IAAI,SAAS,eAAe,KAAK;iBAC5B,IAAI,QAAQ,CAAC,GAAG;QACvB;IAAA,OACK;QACL,IAAI,SACF,IAAK,IAAI,IAAI,GAAG,IAAI,IAAI,IAAK;YAC3B,MAAM;YACN,IAAI,eAAe,KAAK,UAAU;QACpC;aACG;YACH,MAAM;YACN,IAAI,QAAQ,CAAC,GAAG;QAClB;IACF;AACF;AACA,MAAM,UAAU,IAAM,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS;AACnE,MAAM,iBAAiB,CAAC,KAAK;IAC3B,MAAM,QAAQ,KAAK,KAAK,CAAC;IACzB,MAAM,MAAM,IAAI,cAAc,CAAC;IAC/B,IAAI,KAAK,IAAI,cAAc;IAC3B,OAAO;AACT;AACA,MAAM,wBAAwB,CAAC;IAC7B,IAAI,OAAO,aAAa,aACtB,SAAS,aAAa,CACpB,IAAI,YAAY,aAAa;QAC3B,QAAQ;IACV;AAEN;AACA,MAAM,cAAc,CAAC,UAAU,eAAe,gBAAgB;IAC5D,MAAM,OAAO;IACb,MAAM,UAAU,CAAC;QACf,MAAM,KAAK,eAAe,IAAI;QAC9B,IAAI,eAAe,OAAO,KAAK,iBAAiB;YAC9C,IAAI,CAAC,CAAC,MAAM,SAAS,OAAO,GAC1B,MAAM,IAAI,MACR;QAEN;QACA,MAAM,OAAO,SAAS,OAAO,CAAC,GAAG;QACjC,IAAI,gBAAgB,SAClB,MAAM,IAAI,MAAM;QAClB,OAAO;IACT;IACA,MAAM,YAAY;QAChB;QACA,YAAY,CAAC,KAAO,WAAW,QAAQ;QACvC,cAAc;QACd,GAAG,aAAa;IAClB;IACA,IAAK,IAAI,IAAI,eAAe,MAAM,GAAG,GAAG,KAAK,GAAG,IAAK;QACnD,MAAM,oBAAoB,cAAc,CAAC,EAAE,IAAI,cAAc,CAAC,EAAE,CAAC,IAAI;QACrE,IAAI,mBAAmB;YACrB,IAAI,OAAO,sBAAsB,YAC/B,oBACE,MACA,WAAW,QAAQ,IAAM,kBAAkB;iBAE1C,IAAI,OAAO,sBAAsB,UAAU,oBAAoB,MAAM;QAC5E;IACF;IACA,OAAO,UAAU,IAAI;AACvB;AACA,MAAM,sBAAsB,CAAC,cAAc;IACzC,IAAI,OAAO,YAAY,KAAK,KAAK,UAAU,aAAa,KAAK,GAAG,YAAY,KAAK;IACjF,WAAW,aAAa,IAAI,EAAE,YAAY,IAAI;IAC9C,WAAW,aAAa,KAAK,EAAE,YAAY,KAAK;IAChD,WAAW,aAAa,MAAM,EAAE,YAAY,MAAM;IAClD,OAAO,MAAM,CAAC,aAAa,WAAW,EAAE,YAAY,WAAW;AACjE;AACA,MAAM,aAAa,CAAC,aAAa;IAC/B,IAAI,MAAM,OAAO,CAAC,SAChB,KAAK,MAAM,WAAW,OAAQ;QAC5B,IAAI,OAAO,QAAQ,GAAG,KAAK,UAAU;YACnC,MAAM,gBAAgB,YAAY,SAAS,CAAC,CAAC,IAAM,EAAE,GAAG,KAAK,QAAQ,GAAG;YACxE,IAAI,gBAAgB,IAAI;gBACtB,WAAW,CAAC,cAAc,GAAG;gBAC7B;YACF;QACF;QACA,YAAY,IAAI,CAAC;IACnB;AACJ;AACA,MAAM,qBAAqB,IAAM,CAAC;QAChC,OAAO;QACP,MAAM,EAAE;QACR,OAAO,EAAE;QACT,QAAQ,EAAE;QACV,aAAa,CAAC;IAChB,CAAC;AACD,MAAM,YAAY,OAAO,QAAQ,OAAO,cAAc;IACpD,IAAI,MAAM,OAAO,CAAC,SAChB,KAAK,MAAM,SAAS,OAAQ;QAC1B,MAAM,QAAQ,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC;QAC5B,IAAI,OAAO;YACT,MAAM,UAAU,KAAK,CAAC,EAAE;YACxB,MAAM,SAAS,cAAc,KAAK,CAAC,EAAE,EAAE;YACvC,MAAM,mBAAmB,KAAK,CAAC,EAAE;YACjC,MAAM,OAAO,IAAI,MAAM,QAAQ,MAAM;YACrC,MAAM,eAAe,EAAE;YACvB,MAAM,aAAa,cAAc,OAAO;YACxC,IAAI,OAAO,KAAK;YAChB,QAAQ,OAAO,CAAC,CAAC,cAAc;gBAC7B,WACE,cACA,cACA,CAAC,cAAiB,IAAI,CAAC,EAAE,GAAG,aAC5B;YAEJ;YACA,WACE,YACA,cACA,CAAC,aAAgB,OAAO,YAAY,SACpC;YAEF,IAAI,aAAa,MAAM,GAAG,GAAG,MAAM,QAAQ,GAAG,CAAC;YAC/C,OAAO;gBAAC;gBAAQ;gBAAM;gBAAM;aAAiB;QAC/C;IACF;IACF,OAAO;AACT;AACA,MAAM,aAAa,CAAC,cAAc,cAAc,cAAc;IAC5D,IAAI,OAAO,iBAAiB,YAAY;QACtC,MAAM,eAAe,aAAa,GAAG,CAAC;QACtC,IAAI,cAAc,aAAa;aAC1B;YACH,MAAM,IAAI;YACV,IAAI,OAAO,EAAE,IAAI,KAAK,YACpB,aAAa,IAAI,CACf,EAAE,IAAI,CAAC,CAAC;gBACN,IAAI,iBAAiB,OAAO,aAAa,GAAG,CAAC,cAAc;gBAC3D,aAAa;YACf;iBAEC,IAAI,GAAG,aAAa;QAC3B;IACF;AACF;AACA,MAAM,gBAAgB,CAAC,OAAO;IAC5B,IAAI,OAAO;QACT,WAAW,SAAS,QAAQ,CAAC,OAAO,WAAW,WAAW;QAC1D,MAAM,OAAO,MAAM,IAAI,CACrB,CAAC,IAAM,CAAC,CAAC,EAAE,KAAK,YAAY,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,QAAQ,CAAC,OAAO,KAAK,GAAG;QAE3F,IAAI,MAAM,OAAO,IAAI,CAAC,EAAE;IAC1B;AACF;AACA,MAAM,gBAAgB,CAAC,YAAY;IACjC,MAAM,SAAS,CAAC;IAChB,IAAI,YACF,IAAK,IAAI,IAAI,GAAG,IAAI,WAAW,MAAM,EAAE,IAAK;QAC1C,MAAM,QAAQ,OAAO,CAAC,IAAI,EAAE,IAAI;QAChC,MAAM,IAAI,MAAM,QAAQ,CAAC,OAAO,MAAM,KAAK,CAAC,GAAG,MAAM;QACrD,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,mBAAmB;IAC7C;IACF,OAAO;AACT;AACA,MAAM,iBAAiB,OAAO,KAAK,SAAS,YAAY;IACtD,MAAM,eAAe,IAAI,QAAQ;IACjC,MAAM,aAAa,IAAI,MAAM;IAC7B,MAAM,iBAAiB,kBAAkB,cAAc,YAAY;IACnE,IAAI,QAAQ,KAAK;IACjB,IAAI,CAAC,QAAQ,QAAQ,kBAAkB,GAAG,CAAC;IAC3C,sBAAsB;QACpB,OAAO;YAAC;SAAa;IACvB;IACA,IAAI,CAAC,OAAO;QACV,MAAM,UAAU,gBAAgB;QAChC,IAAI,QAAQ,OAAO,IAAI,GAAG,KAAK;QAC/B,QAAQ,MAAM,gBAAgB,SAAS,IAAI,CAAC,CAAC;YAC3C,MAAM,gBAAgB,IAAI,IAAI,IAAI,GAAG;YACrC,IAAI,cAAc,MAAM,KAAK,SAAS,MAAM,IAAI,CAAC,YAAY,cAAc,QAAQ,GAAG;gBACpF,SAAS,IAAI,GAAG,cAAc,IAAI;gBAClC;YACF;YACA,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,EAAE,QAAQ,CAAC,SACnD,OAAO,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC;gBACtB,MAAM,aAAa,iBAAiB,MAAM;gBAC1C,IAAI,CAAC,YAAY;oBACf,SAAS,IAAI,GAAG,IAAI,IAAI;oBACxB;gBACF;gBACA,IAAI,YAAY,kBAAkB,MAAM,CAAC;gBACzC,IAAI,WAAW,QAAQ,EAAE,SAAS,IAAI,GAAG,WAAW,QAAQ;qBACvD,IAAI,QAAQ;oBACf,MAAM,aAAa,WAAW,OAAO,CAAC,OAAO,EAAE,CAAC;oBAChD,OAAO,OAAO,CAAC;wBACb,QAAQ,IAAI,MAAM;wBAClB,QAAQ;oBACV;gBACF;gBACA,OAAO;YACT;iBACG;gBACH,SAAS,IAAI,GAAG,IAAI,IAAI;gBACxB,OAAO,KAAK;YACd;QACF;QACA,IAAI,CAAC,QAAQ,kBAAkB,GAAG,CAAC,gBAAgB;IACrD;IACA,OAAO,MAAM,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,kBAAkB,MAAM,CAAC;QACjC,OAAO;IACT;AACF;AACA,MAAM,kBAAkB,CAAC;IACvB,MAAM,aAAa,QAAQ;IAC3B,IAAI,CAAC,YAAY,OAAO,KAAK;IAC7B,IAAI,sBAAsB,UACxB,OAAO;QACL,QAAQ;QACR,MAAM;IACR;SAEA,OAAO;QACL,QAAQ;QACR,MAAM,KAAK,SAAS,CAAC;QACrB,SAAS;YACP,gBAAgB;QAClB;IACF;AACJ;AACA,MAAM,cAAc,CAAC;IACnB,OAAO,SAAS,QAAQ,CAAC;AAC3B;AACA,MAAM,aAAa;AACnB,MAAM,aAAa,IAAM,WAAW;AACpC,MAAM,kBAAkB,IAAM,WAAW;AACzC,MAAM,cAAc,IAAM,WAAW;AACrC,MAAM,cAAc,IAAM,WAAW;AACrC,MAAM,YAAY,IAAM,WAAW;AACnC,MAAM,iBAAiB,IAAM,YAAY,cAAc;AACvD,MAAM,mBAAmB,aAAa,GAAG;AAsMzC,MAAM,uBAAuB,aAAa,GAAG;AAwC7C,MAAM,OAAO,aAAa,GAAG;AA0C7B,MAAM,wBAAwB,CAAC,KAAK;IAClC,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,YAAY,CAAC,kBAAkB;QACxD,IAAI,CAAC,kBAAkB,mBAAmB;QAC1C,IAAI,CAAC,eAAgB,eAAe,mBAAmB,KACrD,eAAe,IAAI,IAAI,IAAI,IAAI,GAAG;IACtC;AACF;AACA,IAAI,mBAAmB;AACvB,MAAM,wBAAwB,CAAC,QAC7B,MACE,UACA;QACE,OAAO,YAAY,OAAO;IAC5B,GACA;QACE,yBAAyB;IAC3B,GACA,MACA,GACA;AAEJ,MAAM,iBAAiB,CAAC,WAAW,GAAG;IACpC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,cAAc,MAAM;IAC/C,SAAS;QACP,MAAM,MAAM;QACZ,MAAM,gBAAgB;QACtB,MAAM,eAAe;YACnB,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,IAAI;YACnC,WAAW;YACX,QAAQ,KAAK;YACb,OAAO,KAAK;YACZ,UAAU,KAAK;QACjB;QACA,MAAM,QAAQ,SAAS;YACrB,MAAM,QAAQ,cAAc,KAAK;YACjC,IAAI,SAAS,OAAO,OAAO,IAAI;gBAC7B,MAAM,OAAO,MAAM,IAAI;gBACvB,IAAI,gBAAgB,UAAU,aAAa,QAAQ,GAAG;gBACtD,IAAI,MAAM,MAAM,EAAE;oBAChB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM;oBACvC,aAAa,MAAM,GAAG;oBACtB,aAAa,KAAK,GAAG;gBACvB;YACF;YACA,OAAO;QACT;QACA,MAAM;;;;;;QAwDN,aAAa,MAAM,GAAG;QACtB,OAAO;IACT;IACA,OAAO,OAAO,GAAG;IACjB,OAAO,YAAY,GAAG;IACtB,OAAO,KAAK,GAAG;IACf,OAAO,IAAI,GAAG;IACd,OAAO,MAAM,CAAC;IACd,OAAO;AACT;AACA,MAAM,kBAAkB,CAAC,WAAW,GAAG;IACrC,MAAM,SAAS,eAAe,cAAc;IAC5C,IAAI,UAAU;QACZ,IAAI,OAAO,WAAW,eAAe,KAAK,aACxC,WAAW,eAAe,GAAG,aAAa,GAAG,IAAI;QACnD,WAAW,eAAe,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE;IAC9C;IACA,OAAO;AACT;AACA,MAAM,eAAe,aAAa,GAAG,kBAAkB;AACvD,MAAM,gBAAgB,aAAa,GAAG,kBAAkB;AACxD,MAAM,iBAAiB,CAAC,WAAW,GAAG;IACpC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,cAAc,MAAM;IAC/C,SAAS;QACP,OAAO,WAAW,mBAAmB,CAAC;YACpC,IAAI,CAAC,CAAC,MAAM,KAAK,GACf,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG;;uEAEiC,CAAC;YAClE,OAAO,YAAY,OAAO;QAC5B;IACF;IACA,OAAO,OAAO,GAAG;IACjB,OAAO,KAAK,GAAG;IACf,OAAO,YAAY,GAAG;IACtB,OAAO,IAAI,GAAG;IACd,OAAO,MAAM,CAAC;IACd,OAAO;AACT;AACA,MAAM,eAAe,aAAa,GAAG,kBAAkB;AACvD,MAAM,eAAe,CAAC;IACpB,IAAI,UACF,OAAO;QACL,UAAU;IACZ;IACF,OAAO,KAAK;AACd;AACA,MAAM,aAAa,aAAa,GAAG,kBAAkB;AACrD,MAAM,SAAS,CAAC;IACd,IAAI,UAAU;QACZ,MAAM,SAAS,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC;YACjC,IAAI,OAAO,QAAQ,YAAY,MAAM,IAAI;YACzC,IAAI,eAAe,EAAE,MAAM,EAAE,OAAO;iBAC/B,OAAO,EAAE,MAAM,CAAC;QACvB;QACA,OAAO;YACL,MAAM,UAAS,EAAE,EAAE,SAAS;gBAC1B,MAAM,OAAO,aAAc,MAAM,GAAG,SAAS;gBAC7C,MAAM,SAAS,MAAM,CAAC,MAAM,MAAM,EAAE,cAAc,CAAC;gBACnD,IAAI,OAAO,OAAO,EAAE,OAAO;qBACtB;oBACH,IAAI,OACF,QAAQ,KAAK,CACX,sDACA,iBACA,OAAO,KAAK,CAAC,MAAM;oBAEvB,OAAO;wBACL,SAAS;wBACT,QAAQ;wBACR,OAAO,OAAO,KAAK,CAAC,OAAO;oBAC7B;gBACF;YACF;QACF;IACF;IACA,OAAO,KAAK;AACd;AACA,MAAM,OAAO,aAAa,GAAG,kBAAkB;AAC/C,MAAM,YAAY,CAAC;IACjB,IAAI,UAAU;QACZ,MAAM,WAAW,KAAI,WAAW;QAChC,IAAI,YAAY,SAAS,MAAM,GAAG,KAAK,CAAC,sBACtC,MAAM,IAAI,MAAM;IACpB;IACA,SAAS;QACP;;;IA0CF;IACA,OAAO;AACT;AACA,MAAM,UAAU,aAAa,GAAG,kBAAkB;AAClD,MAAM,gBAAgB,CAAC,MAAM;IAC3B,IAAI;IACJ,MAAM,aAAa,EAAE;IACrB,IAAI,KAAK,MAAM,KAAK,GAAG;QACrB,MAAM,UAAU,IAAI,CAAC,EAAE;QACvB,IAAI,WAAW,OAAO,YAAY;YAChC,IAAI,cAAc,SAAS,WAAW,IAAI,CAAC;iBACtC;gBACH,KAAK,QAAQ,EAAE;gBACf,IAAI,QAAQ,UAAU,EAAE,WAAW,IAAI,IAAI,QAAQ,UAAU;YAC/D;;IAEJ,OAAO,IAAI,KAAK,MAAM,GAAG,GAAG,WAAW,IAAI,IAAI,KAAK,MAAM,CAAC,CAAC,IAAM,CAAC,CAAC;IACpE,IAAI,OAAO,OAAO,UAAU;QAC1B,IAAI,OAAO;YACT,IAAI,CAAC,aAAa,IAAI,CAAC,KACrB,MAAM,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,oCAAoC,CAAC;QAC3E;QACA,KAAK,CAAC,GAAG,EAAE,IAAI;IACjB,OAAO,KAAK,IAAI,OAAO;IACvB,OAAO;QACL,YAAY,WAAW,OAAO;QAC9B;IACF;AACF;AACA,MAAM,oBAAoB;IACxB,IAAI,cAAc;IAClB,MAAM,UAAU,IAAI;IACpB,MAAM,cAAc,IAAI,gBAAgB;QACtC,WAAU,KAAK,EAAE,UAAU;YACzB,MAAM,QAAQ,QAAQ,MAAM,CAAC,OAAO,KAAK,CAAC;YAC1C,IAAK,IAAI,IAAI,GAAG,IAAI,MAAM,MAAM,GAAG,GAAG,IAAK;gBACzC,MAAM,OAAO,cAAc,KAAK,CAAC,EAAE;gBACnC,IAAI,KAAK,MAAM,KAAK,GAAG;oBACrB,WAAW,SAAS;oBACpB;gBACF,OAAO;oBACL,WAAW,OAAO,CAAC,WAAW;oBAC9B,cAAc;gBAChB;YACF;YACA,eAAe,KAAK,CAAC,MAAM,MAAM,GAAG,EAAE;QACxC;IACF;IACA,OAAO;AACT;AACA,MAAM,aAAa,CAAC;IAClB,MAAM,QAAQ,QAAQ,KAAK,CAAC;IAC5B,MAAM,QAAQ;QACZ,MAAM;IACR;IACA,IAAI,OAAO;IACX,KAAK,MAAM,QAAQ,MACjB,IAAI,KAAK,UAAU,CAAC,WAAW,QAAQ,KAAK,KAAK,CAAC,KAAK;SAClD;QACH,MAAM,CAAC,KAAK,MAAM,GAAG,KAAK,KAAK,CAAC;QAChC,IAAI,OAAO,QAAQ,YAAY,OAAO,UAAU,UAAU,KAAK,CAAC,IAAI,GAAG,MAAM,IAAI;IACnF;IACF,MAAM,IAAI,GAAG;IACb,OAAO;AACT;AACA,gBAAgB,oBAAoB,MAAM,EAAE,MAAM;IAChD,MAAM,SAAS,OAAO,SAAS;IAC/B,IAAI;QACF,MAAO,KAAM;YACX,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,OAAO,IAAI;YACzC,IAAI,MAAM;YACV,MAAM,MAAM,MAAM,iBAAiB,MAAM,IAAI,EAAE;YAC/C,MAAM;QACR;IACF,SAAU;QACR,OAAO,WAAW;IACpB;AACF;AACA,MAAM,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE;IACtE;IACA,IAAI,QACF,OAAO,MACL,QACA;QACE,GAAG,IAAI;QACP,QAAQ,YAAY,QAAQ;QAC5B,yBAAyB,CAAC;QAC1B,CAAC,iBAAiB,EAAE,WAAW,SAAS,KAAK;QAC7C,WAAW;YAAC,CAAC,iBAAiB,OAAO,MAAM,GAAG,KAAK;YAAG;SAAU;IAClE,GACA;QACE,QAAQ;IACV,GACA,GACA;SAGF,OAAO,aAAa,GAAG,MACrB,SACA;QACE;QACA;QACA;QACA,GAAG,IAAI;IACT,GACA,GACA;AAEN;AACA,MAAM,UAAU,aAAa,GAAG;AAqDhC,SACE,IAAI,EACJ,IAAI,EACJ,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,cAAc,EACd,OAAO,EACP,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,MAAM,CAAC,EACP,IAAI,EACJ,MAAM,GACN\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_reg_ctx_name_segments.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 755\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, server$ } from '@builder.io/qwik';\nimport { foo } from './foo';\nexport const Works = component$((props) => {\n    const text = 'hola';\n    return (\n        <>\n        <div onClick$={server$(() => console.log('in server', text))}></div>\n        <div onClick$={() => foo()}></div>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport \"./foo\";\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { serverQrl } from \"@builder.io/qwik\";\nimport { _regSymbol } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _noopQrl } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nexport const Works = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"div\", {\n                onClick$: serverQrl(/*#__PURE__*/ inlinedQrl(/*#__PURE__*/ _regSymbol(()=>console.log('in server', 'hola'), \"gcSPFNpGYgg\"), \"Works_component_Fragment_div_onClick_server_gcSPFNpGYgg\"))\n            }, null, null, 2, null),\n            /*#__PURE__*/ _jsxQ(\"div\", null, {\n                onClick$: /*#__PURE__*/ _noopQrl(\"Works_component_Fragment_div_onClick_nO4DPVZWP7g\")\n            }, null, 3, null)\n        ]\n    }, 1, \"u6_0\");\n}, \"Works_component_t45qL4vNGv0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;AAGA,OAAO,MAAM,sBAAQ,sCAAW,CAAC;IAE7B,qBACI;;0BACA,MAAC;gBAAI,UAAU,4DAAQ,IAAM,QAAQ,GAAG,CAAC,aAHhC;;0BAIT,MAAC;gBAAI,QAAQ;;;;AAGrB,mCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_reg_ctx_name_segments_hoisted.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 802\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, server$, useStyle$ } from '@builder.io/qwik';\n\nexport const Works = component$((props) => {\n    useStyle$(STYLES);\n    const text = 'hola';\n    return (\n        <div onClick$={server$(() => console.log('in server', text))}></div>\n    );\n});\n\nconst STYLES = '.class {}';\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { useStyleQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { serverQrl } from \"@builder.io/qwik\";\nimport { _regSymbol } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nconst Works_component_div_onClick_server_OsNoEFc5SM4 = /*#__PURE__*/ _regSymbol(()=>console.log('in server', 'hola'), \"OsNoEFc5SM4\");\nconst Works_component_t45qL4vNGv0 = (props)=>{\n    useStyleQrl(/*#__PURE__*/ inlinedQrl(STYLES, \"Works_component_useStyle_i40UL9JyQpg\"));\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        onClick$: serverQrl(/*#__PURE__*/ inlinedQrl(Works_component_div_onClick_server_OsNoEFc5SM4, \"Works_component_div_onClick_server_OsNoEFc5SM4\"))\n    }, null, null, 2, \"u6_0\");\n};\nexport const Works = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(Works_component_t45qL4vNGv0, \"Works_component_t45qL4vNGv0\"));\nconst STYLES = '.class {}';\nexport { STYLES as _auto_STYLES };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;gFAO+B,IAAM,QAAQ,GAAG,CAAC,aAFhC;oCAFe,CAAC;IAC7B,qCAAU;IAEV,qBACI,MAAC;QAAI,UAAU;;AAEvB;AANA,OAAO,MAAM,sBAAQ,mGAMlB;AAEH,MAAM,SAAS\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_reg_ctx_name_segments_inlined.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 781\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, server$ } from '@builder.io/qwik';\nexport const Works = component$((props) => {\n    const text = 'hola';\n    return (\n        <div onClick$={server$(() => console.log('in server', text))}></div>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { serverQrl } from \"@builder.io/qwik\";\nimport { _regSymbol } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const Works = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        onClick$: serverQrl(/*#__PURE__*/ inlinedQrl(/*#__PURE__*/ _regSymbol(()=>console.log('in server', 'hola'), \"OsNoEFc5SM4\"), \"Works_component_div_onClick_server_OsNoEFc5SM4\"))\n    }, null, null, 2, \"u6_0\");\n}, \"Works_component_t45qL4vNGv0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;AAEA,OAAO,MAAM,sBAAQ,sCAAW,CAAC;IAE7B,qBACI,MAAC;QAAI,UAAU,4DAAQ,IAAM,QAAQ,GAAG,CAAC,aAFhC;;AAIjB,mCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_renamed_exports.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 964\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ as Component, $ as onRender, useStore } from '@builder.io/qwik';\n\nexport const App = Component((props) => {\n    const state = useStore({thing: 0});\n\n    return onRender(() => (\n        <div>{state.thing}</div>\n    ));\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_Component_NuXFTHRjvXE\"), \"App_Component_NuXFTHRjvXE\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAMhB\\\"}\")\n============================= test.tsx_App_Component_1_A08tXHb9pEk.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_Component_1_A08tXHb9pEk = ()=>{\n    const [state] = useLexicalScope();\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.thing, [\n        state\n    ], \"p0.thing\"), 3, \"u6_0\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;2CAMoB;;yBACZ,MAAC,mCAAK,GAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_Component_1_A08tXHb9pEk\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_Component_1\",\n  \"hash\": \"A08tXHb9pEk\",\n  \"canonicalFilename\": \"test.tsx_App_Component_1_A08tXHb9pEk\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"App_Component_NuXFTHRjvXE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    191,\n    237\n  ]\n}\n*/\n============================= test.tsx_App_Component_NuXFTHRjvXE.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const App_Component_NuXFTHRjvXE = (props)=>{\n    const state = useStore({\n        thing: 0\n    });\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_Component_1_A08tXHb9pEk\"), \"App_Component_1_A08tXHb9pEk\", [\n        state\n    ]);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAG6B,CAAC;IAC1B,MAAM,QAAQ,SAAS;QAAC,OAAO;IAAC;IAEhC;;;AAGJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_Component_NuXFTHRjvXE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_Component\",\n  \"hash\": \"NuXFTHRjvXE\",\n  \"canonicalFilename\": \"test.tsx_App_Component_NuXFTHRjvXE\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    117,\n    241\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_server_auth.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1767\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport GitHub from '@auth/core/providers/github'\nimport Facebook from 'next-auth/providers/facebook'\nimport Google from 'next-auth/providers/google'\nimport {serverAuth$, auth$} from '@auth/qwik';\n\nexport const { onRequest, logout, getSession, signup } = serverAuth$({\n    providers: [\n    GitHub({\n        clientId: process.env.GITHUB_ID,\n        clientSecret: process.env.GITHUB_SECRET\n    }),\n    Facebook({\n        clientId: import.meta.env.FACEBOOK_ID,\n        clientSecret: import.meta.env.FACEBOOK_SECRET\n    }),\n    Google({\n        clientId: process.env.GOOGLE_ID,\n        clientSecret: process.env.GOOGLE_SECRET\n    })\n    ]\n});\n\nexport const { onRequest, logout, getSession, signup } = auth$({\n    providers: [\n    GitHub({\n        clientId: process.env.GITHUB_ID,\n        clientSecret: process.env.GITHUB_SECRET\n    }),\n    Facebook({\n        clientId: process.env.FACEBOOK_ID,\n        clientSecret: process.env.FACEBOOK_SECRET\n    }),\n    Google({\n        clientId: process.env.GOOGLE_ID,\n        clientSecret: process.env.GOOGLE_SECRET\n    })\n    ]\n});\n\n============================= test.js ==\n\nimport { serverAuthQrl } from \"@auth/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { authQrl } from \"@auth/qwik\";\nexport const { onRequest, logout, getSession, signup } = serverAuthQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_serverAuth_qVqpX2a0p9Y\"), \"serverAuth_qVqpX2a0p9Y\"));\nexport const { onRequest, logout, getSession, signup } = authQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_auth_GU0aY5QCETY\"), \"auth_GU0aY5QCETY\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;AAMA,OAAO,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,4GAetD;AAEH,OAAO,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,0FAetD\\\"}\")\n============================= test.tsx_auth_GU0aY5QCETY.js (ENTRY POINT)==\n\nimport Facebook from \"next-auth/providers/facebook\";\nimport GitHub from \"@auth/core/providers/github\";\nimport Google from \"next-auth/providers/google\";\nexport const auth_GU0aY5QCETY = {\n    providers: [\n        GitHub({\n            clientId: process.env.GITHUB_ID,\n            clientSecret: process.env.GITHUB_SECRET\n        }),\n        Facebook({\n            clientId: process.env.FACEBOOK_ID,\n            clientSecret: process.env.FACEBOOK_SECRET\n        }),\n        Google({\n            clientId: process.env.GOOGLE_ID,\n            clientSecret: process.env.GOOGLE_SECRET\n        })\n    ]\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;gCAuB+D;IAC3D,WAAW;QACX,OAAO;YACH,UAAU,QAAQ,GAAG,CAAC,SAAS;YAC/B,cAAc,QAAQ,GAAG,CAAC,aAAa;QAC3C;QACA,SAAS;YACL,UAAU,QAAQ,GAAG,CAAC,WAAW;YACjC,cAAc,QAAQ,GAAG,CAAC,eAAe;QAC7C;QACA,OAAO;YACH,UAAU,QAAQ,GAAG,CAAC,SAAS;YAC/B,cAAc,QAAQ,GAAG,CAAC,aAAa;QAC3C;KACC;AACL\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"auth_GU0aY5QCETY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_auth\",\n  \"hash\": \"GU0aY5QCETY\",\n  \"canonicalFilename\": \"test.tsx_auth_GU0aY5QCETY\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"auth$\",\n  \"captures\": false,\n  \"loc\": [\n    704,\n    1065\n  ]\n}\n*/\n============================= test.tsx_serverAuth_qVqpX2a0p9Y.js (ENTRY POINT)==\n\nimport Facebook from \"next-auth/providers/facebook\";\nimport GitHub from \"@auth/core/providers/github\";\nimport Google from \"next-auth/providers/google\";\nexport const serverAuth_qVqpX2a0p9Y = {\n    providers: [\n        GitHub({\n            clientId: process.env.GITHUB_ID,\n            clientSecret: process.env.GITHUB_SECRET\n        }),\n        Facebook({\n            clientId: import.meta.env.FACEBOOK_ID,\n            clientSecret: import.meta.env.FACEBOOK_SECRET\n        }),\n        Google({\n            clientId: process.env.GOOGLE_ID,\n            clientSecret: process.env.GOOGLE_SECRET\n        })\n    ]\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;sCAMqE;IACjE,WAAW;QACX,OAAO;YACH,UAAU,QAAQ,GAAG,CAAC,SAAS;YAC/B,cAAc,QAAQ,GAAG,CAAC,aAAa;QAC3C;QACA,SAAS;YACL,UAAU,YAAY,GAAG,CAAC,WAAW;YACrC,cAAc,YAAY,GAAG,CAAC,eAAe;QACjD;QACA,OAAO;YACH,UAAU,QAAQ,GAAG,CAAC,SAAS;YAC/B,cAAc,QAAQ,GAAG,CAAC,aAAa;QAC3C;KACC;AACL\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"serverAuth_qVqpX2a0p9Y\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_serverAuth\",\n  \"hash\": \"qVqpX2a0p9Y\",\n  \"canonicalFilename\": \"test.tsx_serverAuth_qVqpX2a0p9Y\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"serverAuth$\",\n  \"captures\": false,\n  \"loc\": [\n    268,\n    637\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_skip_transform.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1260\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ as Component, $ as onRender } from '@builder.io/qwik';\n\nexport const handler = $(()=>console.log('hola'));\n\nexport const App = component$((props) => {\n    useStyles$('hola');\n    return $(() => (\n        <div>{state.thing}</div>\n    ));\n});\n\n============================= test.js ==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const handler = $(()=>console.log('hola'));\nexport const App = component$((props)=>{\n    useStyles$('hola');\n    return $(()=>/*#__PURE__*/ _jsxQ(\"div\", null, null, state.thing, 3, \"u6_0\"));\n});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";AAGA,OAAO,MAAM,UAAU,EAAE,IAAI,QAAQ,GAAG,CAAC,SAAS;AAElD,OAAO,MAAM,MAAM,WAAW,CAAC;IAC3B,WAAW;IACX,OAAO,EAAE,kBACL,MAAC,mBAAK,MAAM,KAAK;AAEzB,GAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_spread_jsx.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2255\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\nimport { useDocumentHead, useLocation } from '@builder.io/qwik-city';\n\n/**\n * The RouterHead component is placed inside of the document `<head>` element.\n */\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n\n      {head.meta.map((m) => (\n        <meta {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link {...l} key={l.key} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style {...s.props} dangerouslySetInnerHTML={s.style} key={s.key} />\n      ))}\n    </>\n  );\n});\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\n/**\n * The RouterHead component is placed inside of the document `<head>` element.\n */ export const RouterHead = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_RouterHead_component_DPA76mgIou0\"), \"RouterHead_component_DPA76mgIou0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAIA;;CAEC,GACD,OAAO,MAAM,2BAAa,+HAyBvB\\\"}\")\n============================= test.tsx_RouterHead_component_DPA76mgIou0.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { createElement as _createElement } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _jsxS } from \"@builder.io/qwik\";\nimport { useDocumentHead } from \"@builder.io/qwik-city\";\nimport { useLocation } from \"@builder.io/qwik-city\";\nexport const RouterHead_component_DPA76mgIou0 = ()=>{\n    const head = useDocumentHead();\n    const loc = useLocation();\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"title\", null, null, head.title, 1, null),\n            /*#__PURE__*/ _jsxQ(\"link\", null, {\n                rel: \"canonical\",\n                href: _fnSignal((p0)=>p0.href, [\n                    loc\n                ], \"p0.href\")\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"meta\", null, {\n                name: \"viewport\",\n                content: \"width=device-width, initial-scale=1.0\"\n            }, null, 3, null),\n            /*#__PURE__*/ _jsxQ(\"link\", null, {\n                rel: \"icon\",\n                type: \"image/svg+xml\",\n                href: \"/favicon.svg\"\n            }, null, 3, null),\n            head.meta.map((m)=>/*#__PURE__*/ _jsxS(\"meta\", {\n                    ...m\n                }, null, 0, \"u6_0\")),\n            head.links.map((l)=>/*#__PURE__*/ _createElement(\"link\", {\n                    ...l,\n                    key: l.key\n                })),\n            head.styles.map((s)=>/*#__PURE__*/ _createElement(\"style\", {\n                    ...s.props,\n                    dangerouslySetInnerHTML: s.style,\n                    key: s.key\n                }))\n        ]\n    }, 1, \"u6_1\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;gDAOqC;IACnC,MAAM,OAAO;IACb,MAAM,MAAM;IAEZ,qBACE;;0BACE,MAAC,qBAAO,KAAK,KAAK;0BAElB,MAAC;gBAAK,KAAI;gBAAY,IAAI,kBAAE,GAAI,IAAI;;;;0BACpC,MAAC;gBAAK,MAAK;gBAAW,SAAQ;;0BAC9B,MAAC;gBAAK,KAAI;gBAAO,MAAK;gBAAgB,MAAK;;YAE1C,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,kBACd,MAAC;oBAAM,GAAG,CAAC;;YAGZ,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,kBACf,eAAC;oBAAM,GAAG,CAAC;oBAAE,KAAK,EAAE,GAAG;;YAGxB,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,kBAChB,eAAC;oBAAO,GAAG,EAAE,KAAK;oBAAE,yBAAyB,EAAE,KAAK;oBAAE,KAAK,EAAE,GAAG;;;;AAIxE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"RouterHead_component_DPA76mgIou0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_RouterHead_component\",\n  \"hash\": \"DPA76mgIou0\",\n  \"canonicalFilename\": \"test.tsx_RouterHead_component_DPA76mgIou0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    244,\n    839\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_strip_client_code.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1818\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useClientMount$, useStore, useTask$ } from '@builder.io/qwik';\nimport mongo from 'mongodb';\nimport redis from 'redis';\nimport threejs from 'threejs';\nimport { a } from './keep';\nimport { b } from '../keep2';\nimport { c } from '../../remove';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useClientMount$(async () => {\n        state.text = await mongo.users();\n        redis.set(state.text, a, b, c);\n    });\n\n    useTask$(() => {\n        // Code\n    });\n\n    return (\n        <div\n            shouldRemove$={() => state.text}\n            onClick$={() => console.log('parent', state, threejs)}\n        >\n            <Div\n                onClick$={() => console.log('keep')}\n                render$={() => state.text}\n            />\n            {state.text}\n        </div>\n    );\n});\n\n============================= components/component.js ==\n\nimport \"./keep\";\nimport \"../keep2\";\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { useClientMountQrl } from \"@builder.io/qwik\";\nimport { _noopQrl } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _IMMUTABLE } from \"@builder.io/qwik\";\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { useStore } from '@builder.io/qwik';\nexport const Parent = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    const state = useStore({\n        text: ''\n    });\n    // Double count watch\n    useClientMountQrl(/*#__PURE__*/ _noopQrl(\"Parent_component_useClientMount_Yn2kIDABoYw\", [\n        state\n    ]));\n    useTaskQrl(/*#__PURE__*/ inlinedQrl(()=>{\n    // Code\n    }, \"Parent_component_useTask_ngmvcygWux8\"));\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        shouldRemove$: /*#__PURE__*/ _noopQrl(\"Parent_component_div_shouldRemove_EBj69wTX1do\", [\n            state\n        ]),\n        onClick$: /*#__PURE__*/ _noopQrl(\"Parent_component_div_onClick_0PioS4FByUg\", [\n            state\n        ])\n    }, [\n        /*#__PURE__*/ _jsxC(Div, {\n            onClick$: /*#__PURE__*/ inlinedQrl(()=>console.log('keep'), \"Parent_component_div_Div_onClick_kgowuto5dR0\"),\n            render$: /*#__PURE__*/ inlinedQrl(()=>{\n                const [state] = useLexicalScope();\n                return state.text;\n            }, \"Parent_component_div_Div_render_CkMybN6xzQk\", [\n                state\n            ]),\n            [_IMMUTABLE]: {\n                onClick$: _IMMUTABLE,\n                render$: _IMMUTABLE\n            }\n        }, 3, \"7R_0\"),\n        _fnSignal((p0)=>p0.text, [\n            state\n        ], \"p0.text\")\n    ], 1, \"7R_1\");\n}, \"Parent_component_t6Wy3C0Q0XM\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/components/component.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;;;;;AACA,SAAsC,QAAQ,QAAkB,mBAAmB;AAQnF,OAAO,MAAM,uBAAS,sCAAW;IAC7B,MAAM,QAAQ,SAAS;QACnB,MAAM;IACV;IAEA,qBAAqB;IACrB;;;IAKA,oCAAS;IACL,OAAO;IACX;IAEA,qBACI,MAAC;QACG,aAAa;;;QACb,QAAQ;;;;sBAER,MAAC;YACG,QAAQ,2BAAE,IAAM,QAAQ,GAAG,CAAC;YAC5B,OAAO,2BAAE;;uBAAM,MAAM,IAAI;;;;;gBADzB,QAAQ;gBACR,OAAO;;;wBAEV,GAAM,IAAI;;;;AAGvB,oCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_strip_exports_unused.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1657\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\nimport mongodb from 'mongodb';\n\nexport const onGet = () => {\n    const data = mongodb.collection.whatever;\n    return {\n        body: {\n        data\n        }\n    }\n};\n\nexport default component$(()=> {\n    return <div>cmp</div>\n});\n\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const onGet = ()=>{\n    throw \"Symbol removed by Qwik Optimizer, it can not be called from current platform\";\n};\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_LUXeXe0DQrg\"), \"test_component_LUXeXe0DQrg\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;aAIa;;;AASb,6BAAe,mHAEZ\\\"}\")\n============================= test.tsx_test_component_LUXeXe0DQrg.tsx (ENTRY POINT)==\n\nexport const test_component_LUXeXe0DQrg = ()=>{\n    return <div>cmp</div>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"0CAa0B;IACtB,QAAQ,IAAI,GAAG,EAAE;AACrB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_LUXeXe0DQrg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component\",\n  \"hash\": \"LUXeXe0DQrg\",\n  \"canonicalFilename\": \"test.tsx_test_component_LUXeXe0DQrg\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    244,\n    278\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_strip_exports_used.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1683\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useResource$ } from '@builder.io/qwik';\nimport mongodb from 'mongodb';\n\nexport const onGet = () => {\n    const data = mongodb.collection.whatever;\n    return {\n        body: {\n        data\n        }\n    }\n};\n\nexport default component$(()=> {\n    useResource$(() => {\n        return onGet();\n    })\n    return <div>cmp</div>\n});\n\n============================= test.tsx_test_component_useResource_4a8wVY7wh38.tsx (ENTRY POINT)==\n\nimport { onGet } from \"./test\";\nexport const test_component_useResource_4a8wVY7wh38 = ()=>{\n    return onGet();\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";sDAciB;IACT,OAAO;AACX\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_useResource_4a8wVY7wh38\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component_useResource\",\n  \"hash\": \"4a8wVY7wh38\",\n  \"canonicalFilename\": \"test.tsx_test_component_useResource_4a8wVY7wh38\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"test_component_LUXeXe0DQrg\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useResource$\",\n  \"captures\": false,\n  \"loc\": [\n    282,\n    319\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const onGet = ()=>{\n    throw \"Symbol removed by Qwik Optimizer, it can not be called from current platform\";\n};\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_LUXeXe0DQrg\"), \"test_component_LUXeXe0DQrg\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;aAIa;;;AASb,6BAAe,mHAKZ\\\"}\")\n============================= test.tsx_test_component_LUXeXe0DQrg.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useResourceQrl } from \"@builder.io/qwik\";\nexport const test_component_LUXeXe0DQrg = ()=>{\n    useResourceQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_useResource_4a8wVY7wh38\"), \"test_component_useResource_4a8wVY7wh38\"));\n    return <div>cmp</div>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;0CAa0B;IACtB;IAGA,QAAQ,IAAI,GAAG,EAAE;AACrB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_LUXeXe0DQrg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component\",\n  \"hash\": \"LUXeXe0DQrg\",\n  \"canonicalFilename\": \"test.tsx_test_component_LUXeXe0DQrg\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    258,\n    348\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_strip_server_code.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1712\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, serverLoader$, serverStuff$, $, client$, useStore, useTask$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik/build';\nimport mongo from 'mongodb';\nimport redis from 'redis';\nimport { handler } from 'serverless';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        if (!isServer) return;\n        state.text = await mongo.users();\n        redis.set(state.text);\n    });\n\n    serverStuff$(async () => {\n        // should be removed too\n        const a = $(() => {\n            // from $(), should not be removed\n        });\n        const b = client$(() => {\n            // from clien$(), should not be removed\n        });\n        return [a,b];\n    })\n\n    serverLoader$(handler);\n\n    useTask$(() => {\n        // Code\n    });\n\n    return (\n        <div onClick$={() => console.log('parent')}>\n            {state.text}\n        </div>\n    );\n});\n\n============================= test.tsx_Parent_component_useTask_gDH1EtUWqBU.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { isServer } from \"@builder.io/qwik/build\";\nimport mongo from \"mongodb\";\nimport redis from \"redis\";\nexport const Parent_component_useTask_gDH1EtUWqBU = async ()=>{\n    const [state] = useLexicalScope();\n    if (!isServer) return;\n    state.text = await mongo.users();\n    redis.set(state.text);\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;oDAaa;;IACL,IAAI,CAAC,UAAU;IACf,MAAM,IAAI,GAAG,MAAM,MAAM,KAAK;IAC9B,MAAM,GAAG,CAAC,MAAM,IAAI\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_useTask_gDH1EtUWqBU\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component_useTask\",\n  \"hash\": \"gDH1EtUWqBU\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_useTask_gDH1EtUWqBU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_0TaiDayHrlo\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": true,\n  \"loc\": [\n    391,\n    514\n  ]\n}\n*/\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Parent = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_0TaiDayHrlo\"), \"Parent_component_0TaiDayHrlo\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAOA,OAAO,MAAM,uBAAS,uHAkCnB\\\"}\")\n============================= test.tsx_Parent_component_serverStuff_a_2ca3HLDC7yc.js (ENTRY POINT)==\n\nexport const Parent_component_serverStuff_a_2ca3HLDC7yc = ()=>{\n// from $(), should not be removed\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"0DAqBoB;AACR,kCAAkC;AACtC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_serverStuff_a_2ca3HLDC7yc\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component_serverStuff_a\",\n  \"hash\": \"2ca3HLDC7yc\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_serverStuff_a_2ca3HLDC7yc\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_serverStuff_r1qAHX7Opp0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    602,\n    666\n  ]\n}\n*/\n============================= test.tsx_Parent_component_serverStuff_b_client_v9qawr2Inkk.js (ENTRY POINT)==\n\nexport const Parent_component_serverStuff_b_client_v9qawr2Inkk = ()=>{\n// from clien$(), should not be removed\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"iEAwB0B;AACd,uCAAuC;AAC3C\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_serverStuff_b_client_v9qawr2Inkk\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component_serverStuff_b_client\",\n  \"hash\": \"v9qawr2Inkk\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_serverStuff_b_client_v9qawr2Inkk\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_serverStuff_r1qAHX7Opp0\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"client$\",\n  \"captures\": false,\n  \"loc\": [\n    695,\n    764\n  ]\n}\n*/\n============================= test.tsx_Parent_component_0TaiDayHrlo.js (ENTRY POINT)==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _noopQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { serverLoaderQrl } from \"@builder.io/qwik\";\nimport { serverStuffQrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nexport const Parent_component_0TaiDayHrlo = ()=>{\n    const state = useStore({\n        text: ''\n    });\n    // Double count watch\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_useTask_gDH1EtUWqBU\"), \"Parent_component_useTask_gDH1EtUWqBU\", [\n        state\n    ]));\n    serverStuffQrl(/*#__PURE__*/ _noopQrl(\"Parent_component_serverStuff_r1qAHX7Opp0\"));\n    serverLoaderQrl(/*#__PURE__*/ _noopQrl(\"Parent_component_serverLoader_k1L0DiPQV1I\"));\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_useTask_1_P8oRQhHsurk\"), \"Parent_component_useTask_1_P8oRQhHsurk\"));\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_div_onClick_C5XE49Nqd3A\"), \"Parent_component_div_onClick_C5XE49Nqd3A\")\n    }, _fnSignal((p0)=>p0.text, [\n        state\n    ], \"p0.text\"), 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;;;4CAOiC;IAC7B,MAAM,QAAQ,SAAS;QACnB,MAAM;IACV;IAEA,qBAAqB;IACrB;;;IAMA;IAWA;IAEA;IAIA,qBACI,MAAC;QAAI,QAAQ;uBACR,GAAM,IAAI;;;AAGvB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_0TaiDayHrlo\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component\",\n  \"hash\": \"0TaiDayHrlo\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_0TaiDayHrlo\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    289,\n    986\n  ]\n}\n*/\n============================= test.tsx_Parent_component_div_onClick_C5XE49Nqd3A.js (ENTRY POINT)==\n\nexport const Parent_component_div_onClick_C5XE49Nqd3A = ()=>console.log('parent');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"wDAqCuB,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_div_onClick_C5XE49Nqd3A\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component_div_onClick\",\n  \"hash\": \"C5XE49Nqd3A\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_div_onClick_C5XE49Nqd3A\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_0TaiDayHrlo\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    908,\n    935\n  ]\n}\n*/\n============================= test.tsx_Parent_component_useTask_1_P8oRQhHsurk.js (ENTRY POINT)==\n\nexport const Parent_component_useTask_1_P8oRQhHsurk = ()=>{\n// Code\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"sDAgCa;AACL,OAAO;AACX\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_useTask_1_P8oRQhHsurk\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component_useTask_1\",\n  \"hash\": \"P8oRQhHsurk\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_useTask_1_P8oRQhHsurk\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_0TaiDayHrlo\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": false,\n  \"loc\": [\n    839,\n    868\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_transpile_jsx_only.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2233\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\n============================= test.tsx_App_component_ckEPmXZlub0.ts (ENTRY POINT)==\n\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = (props)=>{\n    return /*#__PURE__*/ _jsxC(Cmp, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\",\n            onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto.ts\"), \"App_component_Cmp_p_onClick_vuXzfUTkpto\")\n        }, \"Hello Qwik\", 3, null)\n    }, 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;yCAG8B,CAAC;IAC3B,qBACI,MAAC;kBACG,cAAA,MAAC;YAAE,OAAM;YAAQ,QAAQ;WAA6B;;AAGlE\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"ts\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    90,\n    234\n  ]\n}\n*/\n============================= test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto.ts (ENTRY POINT)==\n\nexport const App_component_Cmp_p_onClick_vuXzfUTkpto = ()=>console.log('warn');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"uDAMuC,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_Cmp_p_onClick_vuXzfUTkpto\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component_Cmp_p_onClick\",\n  \"hash\": \"vuXzfUTkpto\",\n  \"canonicalFilename\": \"test.tsx_App_component_Cmp_p_onClick_vuXzfUTkpto\",\n  \"path\": \"\",\n  \"extension\": \"ts\",\n  \"parent\": \"App_component_ckEPmXZlub0\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    169,\n    194\n  ]\n}\n*/\n============================= test.ts ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0.ts\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,oHAMhB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_transpile_ts_only.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2514\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\n============================= test.jsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n    return <Cmp>\n            <p class=\"stuff\" onClick$={/*#__PURE__*/ inlinedQrl(()=>console.log('warn'), \"App_component_Cmp_p_onClick_vuXzfUTkpto\")}>Hello Qwik</p>\n        </Cmp>;\n}, \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,sCAAW,CAAC;IAC3B,QACK,IAAI;YACD,CAAC,EAAE,MAAM,QAAQ,mCAAU,IAAM,QAAQ,GAAG,CAAC,qDAAS,UAAU,EAAE,EAAE;QACxE,EAAE;AAEV,iCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_ts_enums.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2142\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport enum Thing {\n    A,\n    B\n}\n\nexport const App = component$(() => {\n    console.log(Thing.A);\n    return (\n        <>\n            <p class=\"stuff\">Hello Qwik</p>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport var Thing = /*#__PURE__*/ function(Thing) {\n    Thing[Thing[\"A\"] = 0] = \"A\";\n    Thing[Thing[\"B\"] = 1] = \"B\";\n    return Thing;\n}({});\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,IAAA,AAAK,+BAAA;;;WAAA;MAGX;AAED,OAAO,MAAM,oBAAM,iHAOhB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    console.log(0);\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\"\n        }, \"Hello Qwik\", 3, null)\n    }, 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;yCAQ8B;IAC1B,QAAQ,GAAG;IACX,qBACI;kBACI,cAAA,MAAC;YAAE,OAAM;WAAQ;;AAG7B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    126,\n    248\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_ts_enums_issue_1341.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2087\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nenum Thing {\n    A,\n    B\n}\n\nexport const App = component$(() => {\n    console.log(Thing.A);\n    return (\n        <>\n            <p class=\"stuff\">Hello Qwik</p>\n        </>\n    );\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\n/*#__PURE__*/ (function(Thing) {\n    Thing[Thing[\"A\"] = 0] = \"A\";\n    Thing[Thing[\"B\"] = 1] = \"B\";\n    return Thing;\n})({});\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;wBAGK;;;WAAA;;AAKL,OAAO,MAAM,oBAAM,iHAOhB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    console.log(0);\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: /*#__PURE__*/ _jsxQ(\"p\", null, {\n            class: \"stuff\"\n        }, \"Hello Qwik\", 3, null)\n    }, 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;yCAQ8B;IAC1B,QAAQ,GAAG;IACX,qBACI;kBACI,cAAA,MAAC;YAAE,OAAM;WAAQ;;AAG7B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    119,\n    241\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_ts_enums_no_transpile.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2114\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport enum Thing {\n    A,\n    B\n}\n\nexport const App = component$(() => {\n    console.log(Thing.A);\n    return (\n        <>\n            <p class=\"stuff\">Hello Qwik</p>\n        </>\n    );\n});\n\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport enum Thing {\n    A,\n    B\n}\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,YAAY;IACR;IACA;;AAGJ,OAAO,MAAM,oBAAM,iHAOhB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.tsx (ENTRY POINT)==\n\nimport { Thing } from \"./test\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    console.log(Thing.A);\n    return <>\n            <p class=\"stuff\">Hello Qwik</p>\n        </>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAQ8B;IAC1B,QAAQ,GAAG,CAAC,MAAM,CAAC;IACnB,SACM;YACE,CAAC,EAAE,MAAM,QAAQ,UAAU,EAAE,EAAE;QACnC;AAER\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    126,\n    248\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_use_client_effect.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1369\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useBrowserVisibleTask$, useStore, useStyles$ } from '@builder.io/qwik';\n\nexport const Child = component$(() => {\n    const state = useStore({\n        count: 0\n    });\n\n    // Double count watch\n    useBrowserVisibleTask$(() => {\n        const timer = setInterval(() => {\n        state.count++;\n        }, 1000);\n        return () => {\n        clearInterval(timer);\n        }\n    });\n\n    return (\n        <div>\n        {state.count}\n    </div>\n    );\n});\n\n\n============================= test.tsx_Child_component_useBrowserVisibleTask_0IGFPOyJmQA.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const Child_component_useBrowserVisibleTask_0IGFPOyJmQA = ()=>{\n    const [state] = useLexicalScope();\n    const timer = setInterval(()=>{\n        state.count++;\n    }, 1000);\n    return ()=>{\n        clearInterval(timer);\n    };\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";iEAS2B;;IACnB,MAAM,QAAQ,YAAY;QAC1B,MAAM,KAAK;IACX,GAAG;IACH,OAAO;QACP,cAAc;IACd\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_useBrowserVisibleTask_0IGFPOyJmQA\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Child_component_useBrowserVisibleTask\",\n  \"hash\": \"0IGFPOyJmQA\",\n  \"canonicalFilename\": \"test.tsx_Child_component_useBrowserVisibleTask_0IGFPOyJmQA\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Child_component_9GyF01GDKqw\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useBrowserVisibleTask$\",\n  \"captures\": true,\n  \"loc\": [\n    244,\n    403\n  ]\n}\n*/\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Child = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_9GyF01GDKqw\"), \"Child_component_9GyF01GDKqw\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,sBAAQ,qHAoBlB\\\"}\")\n============================= test.tsx_Child_component_9GyF01GDKqw.js (ENTRY POINT)==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useBrowserVisibleTaskQrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const Child_component_9GyF01GDKqw = ()=>{\n    const state = useStore({\n        count: 0\n    });\n    // Double count watch\n    useBrowserVisibleTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_useBrowserVisibleTask_0IGFPOyJmQA\"), \"Child_component_useBrowserVisibleTask_0IGFPOyJmQA\", [\n        state\n    ]));\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, _fnSignal((p0)=>p0.count, [\n        state\n    ], \"p0.count\"), 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;2CAGgC;IAC5B,MAAM,QAAQ,SAAS;QACnB,OAAO;IACX;IAEA,qBAAqB;IACrB;;;IASA,qBACI,MAAC,mCACA,GAAM,KAAK;;;AAGpB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_9GyF01GDKqw\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Child_component\",\n  \"hash\": \"9GyF01GDKqw\",\n  \"canonicalFilename\": \"test.tsx_Child_component_9GyF01GDKqw\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    128,\n    475\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_use_optimization.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 568\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useTask$ } from '@builder.io/qwik';\nimport { CONST } from 'const';\nexport const Works = component$((props) => {\n    const {countNested} = useStore({value:{count:0}}).value;\n    const countNested2 = countNested;\n    const {hello} = countNested2;\n    const bye = hello.bye;\n    const {ciao} = bye.italian;\n\n\n    return (\n        <div ciao={ciao} >{foo}</div>\n    );\n});\n\n============================= test.jsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { inlinedQrl } from \"@builder.io/qwik\";\nexport const Works = /*#__PURE__*/ componentQrl(/*#__PURE__*/ inlinedQrl((props)=>{\n    const store = useStore({\n        value: {\n            count: 0\n        }\n    });\n    return <div ciao={store.value.countNested.hello.bye.italian.ciao}>{foo}</div>;\n}, \"Works_component_t45qL4vNGv0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,sBAAQ,sCAAW,CAAC;IAC7B,MAAM,QAAgB,SAAS;QAAC,OAAM;YAAC,OAAM;QAAC;IAAC;IAO/C,QACK,IAAI,MAJM,AADH,MAHsC,MAA3C,YAEA,MACW,GAAG,CACF,OAAO,CAAnB,OAIgB,MAAM;AAEjC,mCAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_use_server_mount.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1551\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, useTask$, useStore, useStyles$ } from '@builder.io/qwik';\nimport mongo from 'mongodb';\nimport redis from 'redis';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n        redis.set(state.text);\n    });\n\n    return (\n        <div onClick$={() => console.log('parent')}>\n            {state.text}\n        </div>\n    );\n});\n\nexport const Child = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n    });\n\n    return (\n        <div onClick$={() => console.log('child')}>\n            {state.text}\n        </div>\n    );\n});\n\n============================= test.tsx_Parent_component_useTask_gDH1EtUWqBU.js ==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport mongo from \"mongodb\";\nimport redis from \"redis\";\nexport const Parent_component_useTask_gDH1EtUWqBU = async ()=>{\n    const [state] = useLexicalScope();\n    state.text = await mongo.users();\n    redis.set(state.text);\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;oDAWa;;IACL,MAAM,IAAI,GAAG,MAAM,MAAM,KAAK;IAC9B,MAAM,GAAG,CAAC,MAAM,IAAI\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_useTask_gDH1EtUWqBU\",\n  \"entry\": \"test.tsx_entry_Parent\",\n  \"displayName\": \"test.tsx_Parent_component_useTask\",\n  \"hash\": \"gDH1EtUWqBU\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_useTask_gDH1EtUWqBU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_0TaiDayHrlo\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": true,\n  \"loc\": [\n    273,\n    365\n  ]\n}\n*/\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Parent = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_0TaiDayHrlo\"), \"Parent_component_0TaiDayHrlo\"));\nexport const Child = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_9GyF01GDKqw\"), \"Child_component_9GyF01GDKqw\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAKA,OAAO,MAAM,uBAAS,uHAgBnB;AAEH,OAAO,MAAM,sBAAQ,qHAelB\\\"}\")\n============================= test.tsx_Child_component_useTask_Oh4n7ZeqJkU.js ==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport mongo from \"mongodb\";\nexport const Child_component_useTask_Oh4n7ZeqJkU = async ()=>{\n    const [state] = useLexicalScope();\n    state.text = await mongo.users();\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;mDA6Ba;;IACL,MAAM,IAAI,GAAG,MAAM,MAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_useTask_Oh4n7ZeqJkU\",\n  \"entry\": \"test.tsx_entry_Child\",\n  \"displayName\": \"test.tsx_Child_component_useTask\",\n  \"hash\": \"Oh4n7ZeqJkU\",\n  \"canonicalFilename\": \"test.tsx_Child_component_useTask_Oh4n7ZeqJkU\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Child_component_9GyF01GDKqw\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useTask$\",\n  \"captures\": true,\n  \"loc\": [\n    621,\n    682\n  ]\n}\n*/\n============================= test.tsx_Parent_component_0TaiDayHrlo.js ==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nexport const Parent_component_0TaiDayHrlo = ()=>{\n    const state = useStore({\n        text: ''\n    });\n    // Double count watch\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_useTask_gDH1EtUWqBU\"), \"Parent_component_useTask_gDH1EtUWqBU\", [\n        state\n    ]));\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Parent_component_div_onClick_C5XE49Nqd3A\"), \"Parent_component_div_onClick_C5XE49Nqd3A\")\n    }, _fnSignal((p0)=>p0.text, [\n        state\n    ], \"p0.text\"), 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;4CAKiC;IAC7B,MAAM,QAAQ,SAAS;QACnB,MAAM;IACV;IAEA,qBAAqB;IACrB;;;IAKA,qBACI,MAAC;QAAI,QAAQ;uBACR,GAAM,IAAI;;;AAGvB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_0TaiDayHrlo\",\n  \"entry\": \"test.tsx_entry_Parent\",\n  \"displayName\": \"test.tsx_Parent_component\",\n  \"hash\": \"0TaiDayHrlo\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_0TaiDayHrlo\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    171,\n    483\n  ]\n}\n*/\n============================= test.tsx_Parent_component_div_onClick_C5XE49Nqd3A.js (ENTRY POINT)==\n\nexport const Parent_component_div_onClick_C5XE49Nqd3A = ()=>console.log('parent');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"wDAiBuB,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Parent_component_div_onClick_C5XE49Nqd3A\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Parent_component_div_onClick\",\n  \"hash\": \"C5XE49Nqd3A\",\n  \"canonicalFilename\": \"test.tsx_Parent_component_div_onClick_C5XE49Nqd3A\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Parent_component_0TaiDayHrlo\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    405,\n    432\n  ]\n}\n*/\n============================= test.tsx_Child_component_9GyF01GDKqw.js ==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nimport { useTaskQrl } from \"@builder.io/qwik\";\nexport const Child_component_9GyF01GDKqw = ()=>{\n    const state = useStore({\n        text: ''\n    });\n    // Double count watch\n    useTaskQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_useTask_Oh4n7ZeqJkU\"), \"Child_component_useTask_Oh4n7ZeqJkU\", [\n        state\n    ]));\n    return /*#__PURE__*/ _jsxQ(\"div\", null, {\n        onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Child_component_div_onClick_elliVSnAiOQ\"), \"Child_component_div_onClick_elliVSnAiOQ\")\n    }, _fnSignal((p0)=>p0.text, [\n        state\n    ], \"p0.text\"), 3, \"u6_1\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;2CAuBgC;IAC5B,MAAM,QAAQ,SAAS;QACnB,MAAM;IACV;IAEA,qBAAqB;IACrB;;;IAIA,qBACI,MAAC;QAAI,QAAQ;uBACR,GAAM,IAAI;;;AAGvB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_9GyF01GDKqw\",\n  \"entry\": \"test.tsx_entry_Child\",\n  \"displayName\": \"test.tsx_Child_component\",\n  \"hash\": \"9GyF01GDKqw\",\n  \"canonicalFilename\": \"test.tsx_Child_component_9GyF01GDKqw\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    519,\n    799\n  ]\n}\n*/\n============================= test.tsx_Child_component_div_onClick_elliVSnAiOQ.js (ENTRY POINT)==\n\nexport const Child_component_div_onClick_elliVSnAiOQ = ()=>console.log('child');\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"uDAkCuB,IAAM,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Child_component_div_onClick_elliVSnAiOQ\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Child_component_div_onClick\",\n  \"hash\": \"elliVSnAiOQ\",\n  \"canonicalFilename\": \"test.tsx_Child_component_div_onClick_elliVSnAiOQ\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Child_component_9GyF01GDKqw\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": false,\n  \"loc\": [\n    722,\n    748\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_with_style.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 495\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$, useStyles$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n    useStyles$('.class {}');\n    return (\n        <div class=\"class\"/>\n    );\n}, {\n    tagName: \"my-foo\",\n});\n\n============================= test.tsx_Foo_component_useStyles_pV9TSCBIhw8.tsx (ENTRY POINT)==\n\nexport const Foo_component_useStyles_pV9TSCBIhw8 = '.class {}';\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"mDAIe\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_useStyles_pV9TSCBIhw8\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_useStyles\",\n  \"hash\": \"pV9TSCBIhw8\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_useStyles_pV9TSCBIhw8\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"Foo_component_HTDRsvUbLiE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"useStyles$\",\n  \"captures\": false,\n  \"loc\": [\n    118,\n    129\n  ]\n}\n*/\n============================= test.tsx_Foo_component_HTDRsvUbLiE.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStylesQrl } from \"@builder.io/qwik\";\nexport const Foo_component_HTDRsvUbLiE = ()=>{\n    useStylesQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_useStyles_pV9TSCBIhw8\"), \"Foo_component_useStyles_pV9TSCBIhw8\"));\n    return <div class=\"class\"/>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;yCAG8B;IAC1B;IACA,QACK,IAAI,MAAM;AAEnB\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    95,\n    182\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"), {\n    tagName: \"my-foo\"\n});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAKhB;IACC,SAAS;AACb,GAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_with_tagname.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 473\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n    return $(() => {\n        return (\n            <div>\n            </div>\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\n============================= test.tsx_Foo_component_HTDRsvUbLiE.tsx (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo_component_HTDRsvUbLiE = ()=>{\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_1_DvU6FitWglY\"), \"Foo_component_1_DvU6FitWglY\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAG8B;IAC1B;AAMJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_HTDRsvUbLiE\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component\",\n  \"hash\": \"HTDRsvUbLiE\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_HTDRsvUbLiE\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    83,\n    185\n  ]\n}\n*/\n============================= test.tsx_Foo_component_1_DvU6FitWglY.tsx (ENTRY POINT)==\n\nexport const Foo_component_1_DvU6FitWglY = ()=>{\n    return <div>\n            </div>;\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"2CAIa;IACL,QACK,IAAI;YACL,EAAE;AAEV\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Foo_component_1_DvU6FitWglY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Foo_component_1\",\n  \"hash\": \"DvU6FitWglY\",\n  \"canonicalFilename\": \"test.tsx_Foo_component_1_DvU6FitWglY\",\n  \"path\": \"\",\n  \"extension\": \"tsx\",\n  \"parent\": \"Foo_component_HTDRsvUbLiE\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    104,\n    181\n  ]\n}\n*/\n============================= test.tsx ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Foo = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Foo_component_HTDRsvUbLiE\"), \"Foo_component_HTDRsvUbLiE\"), {\n    tagName: \"my-foo\"\n});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAOhB;IACC,SAAS;AACb,GAAG\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__impure_template_fns.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3574\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\n\t\timport { component$, useSignal } from '@builder.io/qwik';\n\t\tconst useFoo = (count) => {\n\t\t\tconst tag = (s) => {\n\t\t\t\tconst value = typeof s === \"string\" ? s : s[0];\n\t\t\t\treturn `${value}-${count.value}`;\n\t\t\t}\n\t\t\treturn tag;\n\t\t}\n\n\t\texport default component$(() => {\n\t\t\tconst count = useSignal(0);\n\t\t\tconst foo = useFoo(count);\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<p>{foo(\"test\")}</p>\n\t\t\t\t\t<p>{foo`test`}</p>\n\t\t\t\t\t<button onClick$={() => count.value++}>Count up</button>\n\t\t\t\t</>\n\t\t\t);\n\t\t});\n\t\t\n============================= test.tsx_test_component_LUXeXe0DQrg.ts (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { _auto_useFoo as useFoo } from \"./test\";\nimport { useSignal } from \"@builder.io/qwik\";\nexport const test_component_LUXeXe0DQrg = ()=>{\n    const count = useSignal(0);\n    const foo = useFoo(count);\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"p\", null, null, foo(\"test\"), 1, null),\n            /*#__PURE__*/ _jsxQ(\"p\", null, null, foo`test`, 1, null),\n            /*#__PURE__*/ _jsxQ(\"button\", null, {\n                onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_Fragment_button_onClick_eF3QEzgQWcY\"), \"test_component_Fragment_button_onClick_eF3QEzgQWcY\", [\n                    count\n                ])\n            }, \"Count up\", 3, null)\n        ]\n    }, 1, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;0CAU4B;IACzB,MAAM,QAAQ,UAAU;IACxB,MAAM,MAAM,OAAO;IACnB,qBACC;;0BACC,MAAC,iBAAG,IAAI;0BACR,MAAC,iBAAG,GAAG,CAAC,IAAI,CAAC;0BACb,MAAC;gBAAO,QAAQ;;;eAAuB;;;AAG1C\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_LUXeXe0DQrg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component\",\n  \"hash\": \"LUXeXe0DQrg\",\n  \"canonicalFilename\": \"test.tsx_test_component_LUXeXe0DQrg\",\n  \"path\": \"\",\n  \"extension\": \"ts\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    259,\n    476\n  ]\n}\n*/\n============================= test.tsx_test_component_Fragment_button_onClick_eF3QEzgQWcY.ts (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const test_component_Fragment_button_onClick_eF3QEzgQWcY = ()=>{\n    const [count] = useLexicalScope();\n    return count.value++;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";kEAiBuB;;WAAM,MAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_Fragment_button_onClick_eF3QEzgQWcY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component_Fragment_button_onClick\",\n  \"hash\": \"eF3QEzgQWcY\",\n  \"canonicalFilename\": \"test.tsx_test_component_Fragment_button_onClick_eF3QEzgQWcY\",\n  \"path\": \"\",\n  \"extension\": \"ts\",\n  \"parent\": \"test_component_LUXeXe0DQrg\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    420,\n    439\n  ]\n}\n*/\n============================= test.ts ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nconst useFoo = (count)=>{\n    const tag = (s)=>{\n        const value = typeof s === \"string\" ? s : s[0];\n        return `${value}-${count.value}`;\n    };\n    return tag;\n};\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_LUXeXe0DQrg\"), \"test_component_LUXeXe0DQrg\"));\nexport { useFoo as _auto_useFoo };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEE,MAAM,SAAS,CAAC;IACf,MAAM,MAAM,CAAC;QACZ,MAAM,QAAQ,OAAO,MAAM,WAAW,IAAI,CAAC,CAAC,EAAE;QAC9C,OAAO,GAAG,MAAM,CAAC,EAAE,MAAM,KAAK,EAAE;IACjC;IACA,OAAO;AACR;AAEA,6BAAe,mHAUZ\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__issue_117.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1020\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nexport const cache = patternCache[cacheKey] || (patternCache[cacheKey]={});\n\n============================= project/test.tsx ==\n\nexport const cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/project/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"AACA,OAAO,MAAM,QAAQ,YAAY,CAAC,SAAS,IAAI,CAAC,YAAY,CAAC,SAAS,GAAC,CAAC,CAAC,EAAE\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__issue_150.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1870\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$, $ } from '@builder.io/qwik';\nimport { hola } from 'sdfds';\n\nexport const Greeter = component$(() => {\n    const stuff = useStore();\n    return $(() => {\n        return (\n            <div\n                class={{\n                    'foo': true,\n                    'bar': stuff.condition,\n                    'baz': hola ? 'true' : 'false',\n                }}\n            />\n        )\n    });\n});\n\nconst d = $(()=>console.log('thing'));\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Greeter = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Greeter_component_n7HuG2hhU0Q\"), \"Greeter_component_n7HuG2hhU0Q\"));\n/*#__PURE__*/ qrl(()=>import(\"./test.tsx_d_wKNFJEIQVUA\"), \"d_wKNFJEIQVUA\");\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAIA,OAAO,MAAM,wBAAU,yHAapB\\\"}\")\n============================= test.tsx_d_wKNFJEIQVUA.js (ENTRY POINT)==\n\nexport const d_wKNFJEIQVUA = ()=>console.log('thing');\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"6BAmBY,IAAI,QAAQ,GAAG,CAAC\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"d_wKNFJEIQVUA\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_d\",\n  \"hash\": \"wKNFJEIQVUA\",\n  \"canonicalFilename\": \"test.tsx_d_wKNFJEIQVUA\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": false,\n  \"loc\": [\n    433,\n    457\n  ]\n}\n*/\n============================= test.tsx_Greeter_component_1_krCndSwhX4U.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { hola } from \"sdfds\";\nexport const Greeter_component_1_krCndSwhX4U = ()=>{\n    const [stuff] = useLexicalScope();\n    return /*#__PURE__*/ _jsxQ(\"div\", {\n        class: {\n            'foo': true,\n            'bar': stuff.condition,\n            'baz': hola ? 'true' : 'false'\n        }\n    }, null, null, 3, \"u6_0\");\n};\nexport { _hW } from \"@builder.io/qwik\";\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;+CAMa;;IACL,qBACI,MAAC;QACG,OAAO;YACH,OAAO;YACP,OAAO,MAAM,SAAS;YACtB,OAAO,OAAO,SAAS;QAC3B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Greeter_component_1_krCndSwhX4U\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Greeter_component_1\",\n  \"hash\": \"krCndSwhX4U\",\n  \"canonicalFilename\": \"test.tsx_Greeter_component_1_krCndSwhX4U\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"Greeter_component_n7HuG2hhU0Q\",\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"$\",\n  \"captures\": true,\n  \"loc\": [\n    168,\n    413\n  ]\n}\n*/\n============================= test.tsx_Greeter_component_n7HuG2hhU0Q.js (ENTRY POINT)==\n\nimport { qrl } from \"@builder.io/qwik\";\nexport const Greeter_component_n7HuG2hhU0Q = ()=>{\n    const stuff = useStore();\n    return /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Greeter_component_1_krCndSwhX4U\"), \"Greeter_component_1_krCndSwhX4U\", [\n        stuff\n    ]);\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";6CAIkC;IAC9B,MAAM,QAAQ;IACd;;;AAWJ\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Greeter_component_n7HuG2hhU0Q\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Greeter_component\",\n  \"hash\": \"n7HuG2hhU0Q\",\n  \"canonicalFilename\": \"test.tsx_Greeter_component_n7HuG2hhU0Q\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    117,\n    417\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__issue_476.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1978\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { Counter } from \"./counter.tsx\";\n\nexport const Root = () => {\n    return (\n        <html>\n            <head>\n                <meta charset=\"utf-8\" />\n                <title>Qwik Blank App</title>\n            </head>\n            <body>\n                <Counter initial={3} />\n            </body>\n        </html>\n    );\n};\n\n============================= test.tsx ==\n\nimport { Counter } from \"./counter.tsx\";\nexport const Root = ()=>{\n    return <html>\n            <head>\n                <meta charset=\"utf-8\"/>\n                <title>Qwik Blank App</title>\n            </head>\n            <body>\n                <Counter initial={3}/>\n            </body>\n        </html>;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"AACA,SAAS,OAAO,QAAQ,gBAAgB;AAExC,OAAO,MAAM,OAAO;IAChB,QACK,KAAK;YACF,CAAC,KAAK;gBACF,CAAC,KAAK,QAAQ,SAAU;gBACxB,CAAC,MAAM,cAAc,EAAE,MAAM;YACjC,EAAE,KAAK;YACP,CAAC,KAAK;gBACF,CAAC,QAAQ,SAAS,IAAK;YAC3B,EAAE,KAAK;QACX,EAAE;AAEV,EAAE\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__issue_5008.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3454\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\n        import { component$, useStore } from \"@builder.io/qwik\";\n\n        export default component$(() => {\n        const store = useStore([{ value: 0 }]);\n        return (\n            <>\n            <button onClick$={() => store[0].value++}>+1</button>\n            {store.map(function (v, idx) {\n                return <div key={\"fn_\" + idx}>Function: {v.value}</div>;\n            })}\n            {store.map((v, idx) => (\n                <div key={\"arrow_\" + idx}>Arrow: {v.value}</div>\n            ))}\n            </>\n        );\n        });\n        \n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport default /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_LUXeXe0DQrg\"), \"test_component_LUXeXe0DQrg\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGQ,6BAAe,mHAaZ\\\"}\")\n============================= test.tsx_test_component_LUXeXe0DQrg.js (ENTRY POINT)==\n\nimport { Fragment as _Fragment } from \"@builder.io/qwik/jsx-runtime\";\nimport { _jsxC } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { _wrapSignal } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { useStore } from \"@builder.io/qwik\";\nexport const test_component_LUXeXe0DQrg = ()=>{\n    const store = useStore([\n        {\n            value: 0\n        }\n    ]);\n    return /*#__PURE__*/ _jsxC(_Fragment, {\n        children: [\n            /*#__PURE__*/ _jsxQ(\"button\", null, {\n                onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_test_component_Fragment_button_onClick_eF3QEzgQWcY\"), \"test_component_Fragment_button_onClick_eF3QEzgQWcY\", [\n                    store\n                ])\n            }, \"+1\", 3, null),\n            store.map(function(v, idx) {\n                return /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                    \"Function: \",\n                    _wrapSignal(v, \"value\")\n                ], 1, \"fn_\" + idx);\n            }),\n            store.map((v, idx)=>/*#__PURE__*/ _jsxQ(\"div\", null, null, [\n                    \"Arrow: \",\n                    _wrapSignal(v, \"value\")\n                ], 1, \"arrow_\" + idx))\n        ]\n    }, 1, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;;;;0CAGkC;IAC1B,MAAM,QAAQ,SAAS;QAAC;YAAE,OAAO;QAAE;KAAE;IACrC,qBACI;;0BACA,MAAC;gBAAO,QAAQ;;;eAA0B;YACzC,MAAM,GAAG,CAAC,SAAU,CAAC,EAAE,GAAG;gBACvB,qBAAO,MAAC;oBAAsB;gCAAW;sBAAxB,QAAQ;YAC7B;YACC,MAAM,GAAG,CAAC,CAAC,GAAG,oBACX,MAAC;oBAAyB;gCAAQ;sBAAxB,WAAW;;;AAI7B\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_LUXeXe0DQrg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component\",\n  \"hash\": \"LUXeXe0DQrg\",\n  \"canonicalFilename\": \"test.tsx_test_component_LUXeXe0DQrg\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    102,\n    542\n  ]\n}\n*/\n============================= test.tsx_test_component_Fragment_button_onClick_eF3QEzgQWcY.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const test_component_Fragment_button_onClick_eF3QEzgQWcY = ()=>{\n    const [store] = useLexicalScope();\n    return store[0].value++;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";kEAO8B;;WAAM,KAAK,CAAC,EAAE,CAAC,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"test_component_Fragment_button_onClick_eF3QEzgQWcY\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_test_component_Fragment_button_onClick\",\n  \"hash\": \"eF3QEzgQWcY\",\n  \"canonicalFilename\": \"test.tsx_test_component_Fragment_button_onClick_eF3QEzgQWcY\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": \"test_component_LUXeXe0DQrg\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    220,\n    242\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__issue_964.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2005\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    console.log(function*(lo: any, t: any) {\n    console.log(yield (yield lo)(t.href).then((r) => r.json()));\n    });\n\n    return <p>Hello Qwik</p>;\n});\n\n============================= test.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_App_component_ckEPmXZlub0\"), \"App_component_ckEPmXZlub0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAGA,OAAO,MAAM,oBAAM,iHAMhB\\\"}\")\n============================= test.tsx_App_component_ckEPmXZlub0.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const App_component_ckEPmXZlub0 = ()=>{\n    console.log(function*(lo, t) {\n        console.log((yield (yield lo)(t.href).then((r)=>r.json())));\n    });\n    return /*#__PURE__*/ _jsxQ(\"p\", null, null, \"Hello Qwik\", 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";yCAG8B;IAC1B,QAAQ,GAAG,CAAC,UAAU,EAAO,EAAE,CAAM;QACrC,QAAQ,GAAG,CAAC,CAAA,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,IAAM,EAAE,IAAI,GAAE;IACzD;IAEA,qBAAO,MAAC,iBAAE;AACd\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"App_component_ckEPmXZlub0\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_App_component\",\n  \"hash\": \"ckEPmXZlub0\",\n  \"canonicalFilename\": \"test.tsx_App_component_ckEPmXZlub0\",\n  \"path\": \"\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    80,\n    238\n  ]\n}\n*/\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__lib_mode_fn_signal.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3549\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\n    import { component$ } from '@builder.io/qwik';\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <div>\n      <p>Count: {count.value}</p>\n      <p>\n        <button onClick$={() => count.value++}>Increment</button>\n      </p>\n    </div>\n  );\n});\n\n============================= test.tsx_Counter_component_zTmRHlL09Gg.ts (ENTRY POINT)==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Counter_component_zTmRHlL09Gg = ()=>{\n    const count = useSignal(0);\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n        /*#__PURE__*/ _jsxQ(\"p\", null, null, [\n            \"Count: \",\n            _fnSignal((p0)=>p0.value, [\n                count\n            ], \"p0.value\")\n        ], 3, null),\n        /*#__PURE__*/ _jsxQ(\"p\", null, null, /*#__PURE__*/ _jsxQ(\"button\", null, {\n            onClick$: /*#__PURE__*/ qrl(()=>import(\"./test.tsx_Counter_component_div_p_button_onClick_Kqq00U8qaIM\"), \"Counter_component_div_p_button_onClick_Kqq00U8qaIM\", [\n                count\n            ])\n        }, \"Increment\", 3, null), 3, null)\n    ], 3, \"u6_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;;6CAEkC;IAChC,MAAM,QAAQ,UAAU;IAExB,qBACE,MAAC;sBACC,MAAC;YAAE;4BAAQ,GAAM,KAAK;;;;sBACtB,MAAC,+BACC,MAAC;YAAO,QAAQ;;;WAAuB;;AAI/C\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Counter_component_zTmRHlL09Gg\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Counter_component\",\n  \"hash\": \"zTmRHlL09Gg\",\n  \"canonicalFilename\": \"test.tsx_Counter_component_zTmRHlL09Gg\",\n  \"path\": \"\",\n  \"extension\": \"ts\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    87,\n    285\n  ]\n}\n*/\n============================= test.tsx_Counter_component_div_p_button_onClick_Kqq00U8qaIM.ts (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const Counter_component_div_p_button_onClick_Kqq00U8qaIM = ()=>{\n    const [count] = useLexicalScope();\n    return count.value++;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";kEAS0B;;WAAM,MAAM,KAAK\\\"}\")\n/*\n{\n  \"origin\": \"test.tsx\",\n  \"name\": \"Counter_component_div_p_button_onClick_Kqq00U8qaIM\",\n  \"entry\": null,\n  \"displayName\": \"test.tsx_Counter_component_div_p_button_onClick\",\n  \"hash\": \"Kqq00U8qaIM\",\n  \"canonicalFilename\": \"test.tsx_Counter_component_div_p_button_onClick_Kqq00U8qaIM\",\n  \"path\": \"\",\n  \"extension\": \"ts\",\n  \"parent\": \"Counter_component_zTmRHlL09Gg\",\n  \"ctxKind\": \"eventHandler\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    217,\n    236\n  ]\n}\n*/\n============================= test.ts ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Counter = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./test.tsx_Counter_component_zTmRHlL09Gg\"), \"Counter_component_zTmRHlL09Gg\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEA,OAAO,MAAM,wBAAU,yHAWpB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__relative_paths.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 3305\nexpression: output\nsnapshot_kind: text\n---\n============================= ../../node_modules/dep/dist/lib.mjs_App_component_div_p_button_onClick_8dWUa0cJAr4.js (ENTRY POINT)==\n\nimport { useLexicalScope } from \"@builder.io/qwik\";\nexport const App_component_div_p_button_onClick_8dWUa0cJAr4 = ()=>{\n    const [store] = useLexicalScope();\n    return store.count++;\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"node_modules/dep/dist/lib.mjs\\\"],\\\"sourceRoot\\\":\\\"/path/to/app/\\\",\\\"names\\\":[],\\\"mappings\\\":\\\";8DAuByC;IACjB,MAAM,CAAC,MAAM,GAAG;IAChB,OAAO,MAAM,KAAK;AACtB\\\"}\")\n/*\n{\n  \"origin\": \"../../node_modules/dep/dist/lib.mjs\",\n  \"name\": \"App_component_div_p_button_onClick_8dWUa0cJAr4\",\n  \"entry\": null,\n  \"displayName\": \"lib.mjs_App_component_div_p_button_onClick\",\n  \"hash\": \"8dWUa0cJAr4\",\n  \"canonicalFilename\": \"lib.mjs_App_component_div_p_button_onClick_8dWUa0cJAr4\",\n  \"path\": \"../../node_modules/dep/dist\",\n  \"extension\": \"js\",\n  \"parent\": \"App_component_AkbU84a8zes\",\n  \"ctxKind\": \"jSXProp\",\n  \"ctxName\": \"onClick$\",\n  \"captures\": true,\n  \"loc\": [\n    706,\n    838\n  ]\n}\n*/\n============================= ../../node_modules/dep/dist/lib.mjs_App_component_AkbU84a8zes.js (ENTRY POINT)==\n\nimport { _fnSignal } from \"@builder.io/qwik\";\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nimport { _auto_useData as useData } from \"./lib.mjs\";\nexport const App_component_AkbU84a8zes = ()=>{\n    const store = useData();\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, [\n        /*#__PURE__*/ _jsxQ(\"p\", null, null, [\n            \"Count: \",\n            _fnSignal((p0)=>p0.count, [\n                store\n            ], \"p0.count\")\n        ], 3, null),\n        /*#__PURE__*/ _jsxQ(\"p\", null, null, /*#__PURE__*/ _jsxQ(\"button\", {\n            onClick$: /*#__PURE__*/ qrl(()=>import(\"./lib.mjs_App_component_div_p_button_onClick_8dWUa0cJAr4.js\"), \"App_component_div_p_button_onClick_8dWUa0cJAr4\", [\n                store\n            ])\n        }, null, \"Click\", 2, null), 1, null)\n    ], 1, \"70_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"node_modules/dep/dist/lib.mjs\\\"],\\\"sourceRoot\\\":\\\"/path/to/app/\\\",\\\"names\\\":[],\\\"mappings\\\":\\\";;;;yCAWyD;IACrD,MAAM,QAAQ;IACd,OAAO,WAAW,GAAG,MAAK,mBACZ;QACN,WAAW,GAAG,MAAK,iBACL;YACN;4BACA,GAAM,KAAK;;;SACd;QAEL,WAAW,GAAG,MAAI,iBACJ,WAAW,GAAG,MAAI;YACxB,QAAQ;;;iBAME;KAGrB;AAET\\\"}\")\n/*\n{\n  \"origin\": \"../../node_modules/dep/dist/lib.mjs\",\n  \"name\": \"App_component_AkbU84a8zes\",\n  \"entry\": null,\n  \"displayName\": \"lib.mjs_App_component\",\n  \"hash\": \"AkbU84a8zes\",\n  \"canonicalFilename\": \"lib.mjs_App_component_AkbU84a8zes\",\n  \"path\": \"../../node_modules/dep/dist\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    315,\n    1037\n  ]\n}\n*/\n============================= ../../node_modules/dep/dist/lib.mjs ==\n\nimport { qrl } from \"@builder.io/qwik\";\nimport { componentQrl, useStore } from \"@builder.io/qwik\";\nconst useData = ()=>{\n    return useStore({\n        count: 0\n    });\n};\nexport const App = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./lib.mjs_App_component_AkbU84a8zes.js\"), \"App_component_AkbU84a8zes\"));\nexport { useData as _auto_useData };\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"node_modules/dep/dist/lib.mjs\\\"],\\\"sourceRoot\\\":\\\"/path/to/app/\\\",\\\"names\\\":[],\\\"mappings\\\":\\\";AACA,SAAS,YAAY,EAAc,QAAQ,QAAyB,mBAAmB;AAIvF,MAAM,UAAU;IACZ,OAAO,SAAS;QACZ,OAAO;IACX;AACJ;AAEA,OAAO,MAAM,MAAM,WAAW,GAAG,mHAuBA\\\"}\")\n============================= components/main.tsx_Local_component_jJ0v28bs0p8.js (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nimport { state } from \"./sibling\";\nexport const Local_component_jJ0v28bs0p8 = ()=>{\n    return /*#__PURE__*/ _jsxQ(\"div\", null, null, state, 3, \"zp_0\");\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"src/thing/components/main.tsx\\\"],\\\"sourceRoot\\\":\\\"/path/to/app/\\\",\\\"names\\\":[],\\\"mappings\\\":\\\";;2CAIgC;IAC5B,qBACI,MAAC,mBAAK;AAEd\\\"}\")\n/*\n{\n  \"origin\": \"components/main.tsx\",\n  \"name\": \"Local_component_jJ0v28bs0p8\",\n  \"entry\": null,\n  \"displayName\": \"main.tsx_Local_component\",\n  \"hash\": \"jJ0v28bs0p8\",\n  \"canonicalFilename\": \"main.tsx_Local_component_jJ0v28bs0p8\",\n  \"path\": \"components\",\n  \"extension\": \"js\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    120,\n    175\n  ]\n}\n*/\n============================= components/main.js ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Local = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./main.tsx_Local_component_jJ0v28bs0p8.js\"), \"Local_component_jJ0v28bs0p8\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"src/thing/components/main.tsx\\\"],\\\"sourceRoot\\\":\\\"/path/to/app/\\\",\\\"names\\\":[],\\\"mappings\\\":\\\";;AAIA,OAAO,MAAM,sBAAQ,wHAIlB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__special_jsx.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 2169\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\n// don't transpile jsx with non-plain-object props\nimport { jsx } from '@builder.io/qwik';\n\nexport const App = () => {\n    const props = {}\n    return jsx('div', props, 'Hello Qwik');\n}\n\n============================= test.tsx ==\n\n// don't transpile jsx with non-plain-object props\nimport { jsx } from '@builder.io/qwik';\nexport const App = ()=>{\n    const props = {};\n    return jsx('div', props, 'Hello Qwik');\n};\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"/user/qwik/src/test.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\"AACA,kDAAkD;AAClD,SAAS,GAAG,QAAQ,mBAAmB;AAEvC,OAAO,MAAM,MAAM;IACf,MAAM,QAAQ,CAAC;IACf,OAAO,IAAI,OAAO,OAAO;AAC7B,EAAC\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__support_windows_paths.snap",
    "content": "---\nsource: packages/qwik/src/optimizer/core/src/test.rs\nassertion_line: 1950\nexpression: output\nsnapshot_kind: text\n---\n==INPUT==\n\n\nimport { component$ } from '@builder.io/qwik';\nexport const Greeter = component$(() => <div/>)\n\n============================= components/apps/apps.tsx_Greeter_component_0jjOvx068y0.ts (ENTRY POINT)==\n\nimport { _jsxQ } from \"@builder.io/qwik\";\nexport const Greeter_component_0jjOvx068y0 = ()=>/*#__PURE__*/ _jsxQ(\"div\", null, null, null, 3, \"KD_0\");\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"C:\\\\\\\\users\\\\\\\\apps/components/apps/apps.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";6CAEkC,kBAAM,MAAC\\\"}\")\n/*\n{\n  \"origin\": \"components/apps/apps.tsx\",\n  \"name\": \"Greeter_component_0jjOvx068y0\",\n  \"entry\": null,\n  \"displayName\": \"apps.tsx_Greeter_component\",\n  \"hash\": \"0jjOvx068y0\",\n  \"canonicalFilename\": \"apps.tsx_Greeter_component_0jjOvx068y0\",\n  \"path\": \"components/apps\",\n  \"extension\": \"ts\",\n  \"parent\": null,\n  \"ctxKind\": \"function\",\n  \"ctxName\": \"component$\",\n  \"captures\": false,\n  \"loc\": [\n    83,\n    95\n  ]\n}\n*/\n============================= components/apps/apps.ts ==\n\nimport { componentQrl } from \"@builder.io/qwik\";\nimport { qrl } from \"@builder.io/qwik\";\nexport const Greeter = /*#__PURE__*/ componentQrl(/*#__PURE__*/ qrl(()=>import(\"./apps.tsx_Greeter_component_0jjOvx068y0\"), \"Greeter_component_0jjOvx068y0\"));\n\n\nSome(\"{\\\"version\\\":3,\\\"sources\\\":[\\\"C:\\\\\\\\users\\\\\\\\apps/components/apps/apps.tsx\\\"],\\\"names\\\":[],\\\"mappings\\\":\\\";;AAEA,OAAO,MAAM,wBAAU,yHAAwB\\\"}\")\n== DIAGNOSTICS ==\n\n[]\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/test.rs",
    "content": "#![allow(unused_must_use)]\n\nuse super::*;\nuse serde_json::to_string_pretty;\n\nmacro_rules! snapshot_res {\n\t($res: expr, $prefix: expr) => {\n\t\tmatch $res {\n\t\t\tOk(v) => {\n\t\t\t\tlet mut output: String = $prefix;\n\n\t\t\t\tfor module in &v.modules {\n\t\t\t\t\tlet is_entry = if module.is_entry { \"(ENTRY POINT)\" } else { \"\" };\n\t\t\t\t\toutput += format!(\n\t\t\t\t\t\t\"\\n============================= {} {}==\\n\\n{}\\n\\n{:?}\",\n\t\t\t\t\t\tmodule.path, is_entry, module.code, module.map\n\t\t\t\t\t)\n\t\t\t\t\t.as_str();\n\t\t\t\t\tif let Some(segment) = &module.segment {\n\t\t\t\t\t\tlet segment = to_string_pretty(&segment).unwrap();\n\t\t\t\t\t\toutput += &format!(\"\\n/*\\n{}\\n*/\", segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toutput += format!(\n\t\t\t\t\t\"\\n== DIAGNOSTICS ==\\n\\n{}\",\n\t\t\t\t\tto_string_pretty(&v.diagnostics).unwrap()\n\t\t\t\t)\n\t\t\t\t.as_str();\n\t\t\t\tinsta::assert_snapshot!(output);\n\t\t\t}\n\t\t\tErr(err) => {\n\t\t\t\tinsta::assert_snapshot!(err);\n\t\t\t}\n\t\t}\n\t};\n}\n\nmacro_rules! test_input {\n\t($input: expr) => {{\n\t\tlet input = $input;\n\t\tlet code = input.code.to_string();\n\t\tlet snapshot = input.snapshot;\n\t\tlet res = test_input_fn(input);\n\t\tif snapshot {\n\t\t\tsnapshot_res!(&res, format!(\"==INPUT==\\n\\n{}\", code.to_string()));\n\t\t}\n\t\tres\n\t}};\n}\n\nfn test_input_fn(input: TestInput) -> Result<TransformOutput, anyhow::Error> {\n\tlet strip_exports: Option<Vec<JsWord>> = input\n\t\t.strip_exports\n\t\t.map(|v| v.into_iter().map(|s| JsWord::from(s)).collect());\n\tlet reg_ctx_name: Option<Vec<JsWord>> = input\n\t\t.reg_ctx_name\n\t\t.map(|v| v.into_iter().map(|s| JsWord::from(s)).collect());\n\tlet strip_ctx_name: Option<Vec<JsWord>> = input\n\t\t.strip_ctx_name\n\t\t.map(|v| v.into_iter().map(|s| JsWord::from(s)).collect());\n\n\ttransform_modules(TransformModulesOptions {\n\t\tsrc_dir: input.src_dir,\n\t\troot_dir: input.root_dir,\n\t\tinput: vec![TransformModuleInput {\n\t\t\tcode: input.code.clone(),\n\t\t\tpath: input.filename,\n\t\t\tdev_path: input.dev_path,\n\t\t}],\n\t\tsource_maps: true,\n\t\tminify: input.minify,\n\t\ttranspile_ts: input.transpile_ts,\n\t\ttranspile_jsx: input.transpile_jsx,\n\t\tpreserve_filenames: input.preserve_filenames,\n\t\texplicit_extensions: input.explicit_extensions,\n\t\tentry_strategy: input.entry_strategy,\n\t\tmode: input.mode,\n\t\tscope: input.scope,\n\t\tcore_module: input.core_module,\n\t\tstrip_exports,\n\t\tstrip_ctx_name,\n\t\treg_ctx_name,\n\t\tstrip_event_handlers: input.strip_event_handlers,\n\t\tis_server: input.is_server,\n\t\t// filler to maintain line offsets\n\t})\n}\n\n#[test]\nfn example_1() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component, onRender } from '@builder.io/qwik';\n\nexport const renderHeader = $(() => {\n    return (\n        <div onClick={$((ctx) => console.log(ctx))}/>\n    );\n});\nconst renderHeader = component($(() => {\n  console.log(\"mount\");\n  return render;\n}));\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_2() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nexport const Header = component$(() => {\n    console.log(\"mount\");\n    return (\n        <div onClick={$((ctx) => console.log(ctx))}/>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_3() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nexport const App = () => {\n    const Header = component$(() => {\n        console.log(\"mount\");\n        return (\n            <div onClick={$((ctx) => console.log(ctx))}/>\n        );\n    });\n    return Header;\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_4() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nexport function App() {\n    const Header = component$(() => {\n        console.log(\"mount\");\n        return (\n            <div onClick={$((ctx) => console.log(ctx))}/>\n        );\n    });\n    return Header;\n}\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_5() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nexport const Header = component$(() => {\n    return (\n        <>\n            <div onClick={(ctx) => console.log(\"1\")}/>\n            <div onClick={$((ctx) => console.log(\"2\"))}/>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_6() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nexport const sym1 = $((ctx) => console.log(\"1\"));\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_7() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Header = component$(() => {\n    console.log(\"mount\");\n    return (\n        <div onClick={$((ctx) => console.log(ctx))}/>\n    );\n  });\n\nconst App = component$(() => {\n    return (\n        <Header/>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_8() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Header = component$(() => {\n    return $((hola) => {\n        const hola = this;\n        const {something, styff} = hola;\n        const hello = hola.nothere.stuff[global];\n        return (\n            <Header/>\n        );\n    });\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_9() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nconst Header = $((decl1, {decl2}, [decl3]) => {\n    const {decl4, key: decl5} = this;\n    let [decl6, ...decl7] = stuff;\n    const decl8 = 1, decl9;\n    function decl10(decl11, {decl12}, [decl13]) {}\n    class decl14 {\n        method(decl15, {decl16}, [decl17]) {}\n    }\n    try{}catch(decl18){}\n    try{}catch({decl19}){}\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_10() {\n\ttest_input!(TestInput {\n\t\tfilename: \"project/test.tsx\".to_string(),\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nconst Header = $((decl1, {decl2}, [decl3]) => {\n\n    const hola = ident1.no;\n    ident2;\n    const a = ident1 + ident3;\n    const b = ident1 + ident3;\n    ident4(ident5, [ident6], {ident7}, {key: ident8});\n    class Some {\n        prop = ident9;\n        method() {\n            return ident10;\n        }\n    }\n\n    return (\n        <div onClick={(ident11) => ident11 + ident12} required={false}/>\n    )\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_11() {\n\ttest_input!(TestInput {\n\t\tfilename: \"project/test.tsx\".to_string(),\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nimport {foo, bar as bbar} from \"../state\";\nimport * as dep2 from \"dep2\";\nimport dep3 from \"dep3/something\";\n\nexport const Header = component$(() => {\n    return (\n        <Header onClick={$((ev) => dep3(ev))}>\n            {dep2.stuff()}{bbar()}\n        </Header>\n    );\n});\n\nexport const App = component$(() => {\n    return (\n        <Header>{foo()}</Header>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Single,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_functional_component() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useStore } from '@builder.io/qwik';\nconst Header = component$(() => {\n    const thing = useStore();\n    const {foo, bar} = foo();\n\n    return (\n        <div>{thing}</div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tminify: MinifyMode::None,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_functional_component_2() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useStore } from '@builder.io/qwik';\nexport const useCounter = () => {\n    return useStore({count: 0});\n}\n\nexport const STEP = 1;\n\nexport const App = component$((props) => {\n    const state = useCounter();\n    const thing = useStore({thing: 0});\n    const STEP_2 = 2;\n\n    const count2 = state.count * 2;\n    return (\n        <div onClick$={() => state.count+=count2 }>\n            <span>{state.count}</span>\n            {buttons.map(btn => (\n                <button\n                    onClick$={() => state.count += btn.offset + thing + STEP + STEP_2 + props.step}\n                >\n                    {btn.name}\n                </button>\n            ))}\n\n        </div>\n\n    );\n})\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_functional_component_capture_props() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(({count, rest: [I2, {I3, v1: [I4], I5=v2, ...I6}, I7=v3, ...I8]}) => {\n    const state = useStore({count: 0});\n    const {rest: [C2, {C3, v1: [C4], C5=v2, ...C6}, C7=v3, ...C8]} = foo();\n    return $(() => {\n        return (\n            <div onClick$={() => state.count += count + total }>\n                {I2}{I3}{I4}{I5}{I6}{I7}{I8}\n                {C2}{C3}{C4}{C5}{C6}{C7}{C8}\n                {v1}{v2}{v3}\n            </div>\n        )\n    });\n})\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_multi_capture() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(({foo}) => {\n    const arg0 = 20;\n    return $(() => {\n        const fn = ({aaa}) => aaa;\n        return (\n            <div>\n              {foo}{fn()}{arg0}\n            </div>\n        )\n    });\n})\n\nexport const Bar = component$(({bar}) => {\n    return $(() => {\n        return (\n            <div>\n              {bar}\n            </div>\n        )\n    });\n})\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_dead_code() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\nimport { deps } from 'deps';\n\nexport const Foo = component$(({foo}) => {\n    useMount$(() => {\n        if (false) {\n            deps();\n        }\n    });\n    return (\n        <div />\n    );\n})\n\"#\n\t\t.to_string(),\n\t\tminify: MinifyMode::Simplify,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_with_tagname() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n    return $(() => {\n        return (\n            <div>\n            </div>\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_with_style() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useStyles$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n    useStyles$('.class {}');\n    return (\n        <div class=\"class\"/>\n    );\n}, {\n    tagName: \"my-foo\",\n});\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_props_optimization() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useTask$ } from '@builder.io/qwik';\nimport { CONST } from 'const';\nexport const Works = component$(({\n    count,\n    some = 1+2,\n    hello = CONST,\n    stuff: hey,\n    stuffDefault: hey2 = 123,\n    ...rest}) => {\n    console.log(hey, some);\n    useTask$(({track}) => {\n        track(() => count);\n        console.log(count, rest, hey, some, hey2);\n    });\n    return (\n        <div some={some} params={{ some }} class={count} {...rest} override>{count}</div>\n    );\n});\n\nexport const NoWorks2 = component$(({count, stuff: {hey}}) => {\n    console.log(hey);\n    useTask$(({track}) => {\n        track(() => count);\n        console.log(count);\n    });\n    return (\n        <div class={count}>{count}</div>\n    );\n});\n\nexport const NoWorks3 = component$(({count, stuff = hola()}) => {\n    console.log(stuff);\n    useTask$(({track}) => {\n        track(() => count);\n        console.log(count);\n    });\n    return (\n        <div class={count}>{count}</div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_use_optimization() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useTask$ } from '@builder.io/qwik';\nimport { CONST } from 'const';\nexport const Works = component$((props) => {\n    const {countNested} = useStore({value:{count:0}}).value;\n    const countNested2 = countNested;\n    const {hello} = countNested2;\n    const bye = hello.bye;\n    const {ciao} = bye.italian;\n\n\n    return (\n        <div ciao={ciao} >{foo}</div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: false,\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\tis_server: Some(false),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_optimization_issue_3561() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport const Issue3561 = component$(() => {\n    const props = useStore({\n      product: {\n        currentVariant: {\n          variantImage: 'image',\n          variantNumber: 'number',\n          setContents: 'contents',\n        },\n      },\n    });\n    const {\n      currentVariant: { variantImage, variantNumber, setContents } = {},\n    } = props.product;\n\n    console.log(variantImage, variantNumber, setContents)\n\n    return <p></p>;\n  });\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: false,\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\tis_server: Some(false),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_optimization_issue_4386() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport const FOO_MAPPING = {\n    A: 1,\n    B: 2,\n    C: 3,\n  };\n\n  export default component$(() => {\n    const key = 'A';\n    const value = FOO_MAPPING[key];\n\n    return <>{value}</>;\n  });\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: false,\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\tis_server: Some(false),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_optimization_issue_3542() {\n\ttest_input!(TestInput {\n        code: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport const AtomStatus = component$(({ctx,atom})=>{\n    let status = atom.status;\n    if(!atom.real) {\n        status=\"WILL-VANISH\"\n    } else if (JSON.stringify(atom.atom)==JSON.stringify(atom.real)) {\n        status=\"WTFED\"\n    }\n    return (\n        <span title={atom.ID} onClick$={(ev)=>atomStatusClick(ctx,ev,[atom])} class={[\"atom\",status,ctx.store[atom.ID]?\"selected\":null]}>\n        </span>\n    );\n})\n\"#\n        .to_string(),\n        transpile_jsx: false,\n        entry_strategy: EntryStrategy::Inline,\n        transpile_ts: true,\n        is_server: Some(false),\n        ..TestInput::default()\n    });\n}\n\n#[test]\nfn example_optimization_issue_3795() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport const Issue3795 = component$(() => {\n    let base = \"foo\";\n    const firstAssignment = base;\n    base += \"bar\";\n    const secondAssignment = base;\n    return (\n      <div id='issue-3795-result'>{firstAssignment} {secondAssignment}</div>\n    )\n  });\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tis_server: Some(false),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_drop_side_effects() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\nimport { server$ } from '@builder.io/qwik-city';\nimport { clientSupabase } from 'supabase';\nimport { Client } from 'openai';\nimport { secret } from './secret';\nimport { sideEffect } from './secret';\n\nconst supabase = clientSupabase();\nconst dfd = new Client(secret);\n\n(function() {\n    console.log('run');\n  })();\n  (() => {\n    console.log('run');\n  })();\n\nsideEffect();\n\nexport const api = server$(() => {\n    supabase.from('ffg').do(dfd);\n});\n\nexport default component$(() => {\n    return (\n      <button onClick$={() => await api()}></button>\n    )\n  });\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Segment,\n\t\tstrip_ctx_name: Some(vec![\"server\".into()]),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tis_server: Some(false),\n\t\tmode: EmitMode::Dev,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_reg_ctx_name_segments() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, server$ } from '@builder.io/qwik';\nimport { foo } from './foo';\nexport const Works = component$((props) => {\n    const text = 'hola';\n    return (\n        <>\n        <div onClick$={server$(() => console.log('in server', text))}></div>\n        <div onClick$={() => foo()}></div>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\treg_ctx_name: Some(vec![\"server\".into()]),\n\t\tstrip_event_handlers: true,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_reg_ctx_name_segments_inlined() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, server$ } from '@builder.io/qwik';\nexport const Works = component$((props) => {\n    const text = 'hola';\n    return (\n        <div onClick$={server$(() => console.log('in server', text))}></div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\treg_ctx_name: Some(vec![\"server\".into()]),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_reg_ctx_name_segments_hoisted() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, server$, useStyle$ } from '@builder.io/qwik';\n\nexport const Works = component$((props) => {\n    useStyle$(STYLES);\n    const text = 'hola';\n    return (\n        <div onClick$={server$(() => console.log('in server', text))}></div>\n    );\n});\n\nconst STYLES = '.class {}';\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\treg_ctx_name: Some(vec![\"server\".into()]),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n#[test]\nfn example_lightweight_functional() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(({color}) => {\n    return (\n        <div>\n            <Button {...props} />\n            <ButtonArrow {...props} />\n        </div>\n    );\n}, {\n    tagName: \"my-foo\",\n});\n\nexport function Button({text, color}) {\n    return (\n        <button onColor$={color} onClick$={()=>console.log(text, color)}>{text}</button>\n    );\n}\n\nexport const ButtonArrow = ({text, color}) => {\n    return (\n        <button onColor$={color} onClick$={()=>console.log(text, color)}>{text}</button>\n    );\n}\n\"#\n\t\t.to_string(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_invalid_references() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nconst I1 = 12;\nconst [I2, {I3, v1: [I4], I5=v2, ...I6}, I7=v3, ...I8] = obj;\nfunction I9() {}\nclass I10 {}\n\nexport const App = component$(({count}) => {\n    console.log(I1, I2, I3, I4, I5, I6, I7, I8, I9);\n    console.log(itsok, v1, v2, v3, obj);\n    return $(() => {\n        return (\n            <I10></I10>\n        )\n    });\n})\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_invalid_segment_expr1() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useStyles$ } from '@builder.io/qwik';\nimport css1 from './global.css';\nimport css2 from './style.css';\n\nexport const App = component$(() => {\n    const style = `${css1}${css2}`;\n    useStyles$(style);\n    const render = () => {\n        return (\n            <div></div>\n        )\n    };\n    return $(render);\n})\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_capture_imports() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStyles$ } from '@builder.io/qwik';\nimport css1 from './global.css';\nimport css2 from './style.css';\nimport css3 from './style.css';\n\nexport const App = component$(() => {\n    useStyles$(`${css1}${css2}`);\n    useStyles$(css3);\n})\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_capturing_fn_class() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    function hola() {\n      console.log('hola');\n    }\n    class Thing {}\n    class Other {}\n\n    return $(() => {\n      hola();\n      new Thing();\n      return (\n          <div></div>\n      )\n    });\n})\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_renamed_exports() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ as Component, $ as onRender, useStore } from '@builder.io/qwik';\n\nexport const App = Component((props) => {\n    const state = useStore({thing: 0});\n\n    return onRender(() => (\n        <div>{state.thing}</div>\n    ));\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_exports() {\n\ttest_input!(TestInput {\n\t\tfilename: \"project/test.tsx\".to_string(),\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const [a, {b, v1: [c], d=v2, ...e}, f=v3, ...g] = obj;\n\nconst exp1 = 1;\nconst internal = 2;\nexport {exp1, internal as expr2};\n\nexport function foo() { }\nexport class bar {}\n\nexport default function DefaultFn() {}\n\nexport const Header = component$(() => {\n    return $(() => (\n        <Footer>\n            <div>{a}{b}{c}{d}{e}{f}{exp1}{internal}{foo}{bar}{DefaultFn}</div>\n            <div>{v1}{v2}{v3}{obj}</div>\n        </Footer>\n    ))\n});\n\nexport const Footer = component$();\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn issue_117() {\n\ttest_input!(TestInput {\n\t\tfilename: \"project/test.tsx\".to_string(),\n\t\tcode: r#\"\nexport const cache = patternCache[cacheKey] || (patternCache[cacheKey]={});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Single,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_jsx() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, h, Fragment } from '@builder.io/qwik';\n\nexport const Lightweight = (props) => {\n    return (\n        <div>\n            <>\n                <div/>\n                <button {...props}/>\n            </>\n        </div>\n    )\n};\n\nexport const Foo = component$((props) => {\n    return $(() => {\n        return (\n            <div>\n                <>\n                    <div class=\"class\"/>\n                    <div class=\"class\"></div>\n                    <div class=\"class\">12</div>\n                </>\n                <div class=\"class\">\n                    <Lightweight {...props}/>\n                </div>\n                <div class=\"class\">\n                    <div/>\n                    <div/>\n                    <div/>\n                </div>\n                <div class=\"class\">\n                    {children}\n                </div>\n            </div>\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_jsx_listeners() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n\n    return $(() => {\n        const handler = $(() => console.log('reused'));\n        return (\n            <div\n                onClick$={()=>console.log('onClick$')}\n                onDocumentScroll$={()=>console.log('onDocumentScroll')}\n                onDocumentScroll$={()=>console.log('onWindowScroll')}\n\n                on-cLick$={()=>console.log('on-cLick$')}\n                onDocument-sCroll$={()=>console.log('onDocument-sCroll')}\n                onDocument-scroLL$={()=>console.log('onDocument-scroLL')}\n\n                host:onClick$={()=>console.log('host:onClick$')}\n                host:onDocumentScroll$={()=>console.log('host:onDocument:scroll')}\n                host:onDocumentScroll$={()=>console.log('host:onWindow:scroll')}\n\n                onKeyup$={handler}\n                onDocument:keyup$={handler}\n                onWindow:keyup$={handler}\n\n                custom$={()=>console.log('custom')}\n            />\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_qwik_conflict() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { $, component$, useStyles } from '@builder.io/qwik';\nimport { qrl } from '@builder.io/qwik/what';\n\nexport const hW = 12;\nexport const handleWatch = 42;\n\nconst componentQrl = () => console.log('not this', qrl());\n\ncomponentQrl();\nexport const Foo = component$(() => {\n    useStyles$('thing');\n    const qwik = hW + handleWatch;\n    console.log(qwik);\n    const qrl = 23;\n    return (\n        <div onClick$={()=> console.log(qrl)}/>\n    )\n}, {\n    tagName: \"my-foo\",\n});\n\nexport const Root = component$(() => {\n    useStyles($('thing'));\n    return $(() => {\n        return (\n            <div/>\n        )\n    });\n}, {\n    tagName: \"my-foo\",\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_fix_dynamic_import() {\n\ttest_input!(TestInput {\n\t\tfilename: \"project/folder/test.tsx\".to_string(),\n\t\tcode: r#\"\nimport { $, component$ } from '@builder.io/qwik';\nimport thing from \"../state\";\n\nexport function foo() {\n    return import(\"../foo/state2\")\n}\n\nexport const Header = component$(() => {\n    return (\n        <div>\n            {import(\"../folder/state3\")}\n            {thing}\n        </div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Single,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_custom_inlined_functions() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, $, useStore, wrap, useEffect } from '@builder.io/qwik';\n\nexport const useMemoQrl = (qrt) => {\n    useEffect(qrt);\n};\n\nexport const useMemo$ = wrap(useMemoQrl);\n\nexport const App = component$((props) => {\n    const state = useStore({count: 0});\n    useMemo$(() => {\n        console.log(state.count);\n    });\n    return $(() => (\n        <div>{state.count}</div>\n    ));\n});\n\nexport const Lightweight = (props) => {\n    useMemo$(() => {\n        console.log(state.count);\n    });\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_missing_custom_inlined_functions() {\n\ttest_input!(TestInput {\n        code: r#\"\nimport { component$ as Component, $ as onRender, useStore, wrap, useEffect } from '@builder.io/qwik';\n\n\nexport const useMemo$ = (qrt) => {\n    useEffect(qrt);\n};\n\nexport const App = component$((props) => {\n    const state = useStore({count: 0});\n    useMemo$(() => {\n        console.log(state.count);\n    });\n    return $(() => (\n        <div>{state.count}</div>\n    ));\n});\n\"#\n        .to_string(),\n        transpile_ts: true,\n        transpile_jsx: true,\n        ..TestInput::default()\n    });\n}\n\n#[test]\nfn example_skip_transform() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ as Component, $ as onRender } from '@builder.io/qwik';\n\nexport const handler = $(()=>console.log('hola'));\n\nexport const App = component$((props) => {\n    useStyles$('hola');\n    return $(() => (\n        <div>{state.thing}</div>\n    ));\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_explicit_ext_transpile() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, $, useStyles$ } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    useStyles$('hola');\n    return $(() => (\n        <div></div>\n    ));\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_explicit_ext_no_transpile() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, $, useStyles$ } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    useStyles$('hola');\n    return $(() => (\n        <div></div>\n    ));\n});\n\"#\n\t\t.to_string(),\n\t\texplicit_extensions: true,\n\t\tentry_strategy: EntryStrategy::Single,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_jsx_import_source() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\n/* @jsxImportSource react */\n\nimport { qwikify$ } from './qwikfy';\n\nexport const App = () => (\n    <div onClick$={()=>console.log('App')}></div>\n);\n\nexport const App2 = qwikify$(() => (\n    <div onClick$={()=>console.log('App2')}></div>\n));\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_prod_node() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport const Foo = component$(() => {\n    return (\n        <div>\n            <div onClick$={() => console.log('first')}/>\n            <div onClick$={() => console.log('second')}/>\n            <div onClick$={() => console.log('third')}/>\n        </div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tmode: EmitMode::Prod,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_use_client_effect() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useBrowserVisibleTask$, useStore, useStyles$ } from '@builder.io/qwik';\n\nexport const Child = component$(() => {\n    const state = useStore({\n        count: 0\n    });\n\n    // Double count watch\n    useBrowserVisibleTask$(() => {\n        const timer = setInterval(() => {\n        state.count++;\n        }, 1000);\n        return () => {\n        clearInterval(timer);\n        }\n    });\n\n    return (\n        <div>\n        {state.count}\n    </div>\n    );\n});\n\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_inlined_entry_strategy() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useBrowserVisibleTask$, useStore, useStyles$ } from '@builder.io/qwik';\nimport { thing } from './sibling';\nimport mongodb from 'mongodb';\n\nexport const Child = component$(() => {\n\n    useStyles$('somestring');\n    const state = useStore({\n        count: 0\n    });\n\n    // Double count watch\n    useBrowserVisibleTask$(() => {\n        state.count = thing.doStuff() + import(\"./sibling\");\n    });\n\n    return (\n        <div onClick$={() => console.log(mongodb)}>\n        </div>\n    );\n});\n\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_default_export() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\nimport { sibling } from './sibling';\n\nexport default component$(() => {\n    return (\n        <div onClick$={() => console.log(mongodb, sibling)}>\n        </div>\n    );\n});\n\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tfilename: \"src/routes/_repl/[id]/[[...slug]].tsx\".into(),\n\t\tentry_strategy: EntryStrategy::Smart,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_default_export_index() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n    return (\n        <div onClick$={() => console.log(mongodb)}>\n        </div>\n    );\n});\n\n\"#\n\t\t.to_string(),\n\t\tfilename: \"src/components/mongo/index.tsx\".into(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_default_export_invalid_ident() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n    return (\n        <div onClick$={() => console.log(mongodb)}>\n        </div>\n    );\n});\n\n\"#\n\t\t.to_string(),\n\t\tfilename: \"src/components/mongo/404.tsx\".into(),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_parsed_inlined_qrls() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { componentQrl, inlinedQrl, useStore, jsxs, jsx, useLexicalScope } from '@builder.io/qwik';\n\nexport const App = /*#__PURE__*/ componentQrl(inlinedQrl(()=>{\n    useStyles$(inlinedQrl(STYLES, \"STYLES_odz7dfdfdM\"));\n    useStyles$(inlinedQrl(STYLES, \"STYLES_odzdfdfdM\"));\n\n    const store = useStore({\n        count: 0\n    });\n    return /*#__PURE__*/ jsxs(\"div\", {\n        children: [\n            /*#__PURE__*/ jsxs(\"p\", {\n                children: [\n                    \"Count: \",\n                    store.count\n                ]\n            }),\n            /*#__PURE__*/ jsx(\"p\", {\n                children: /*#__PURE__*/ jsx(\"button\", {\n                    onClick$: inlinedQrl(()=>{\n                        const [store] = useLexicalScope();\n                        return store.count++;\n                    }, \"App_component_div_p_button_onClick_odz7eidI4GM\", [\n                        store\n                    ]),\n                    children: \"Click\"\n                })\n            })\n        ]\n    });\n}, \"App_component_Fh88JClhbC0\"));\n\nexport const STYLES = \".red { color: red; }\";\n\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\tmode: EmitMode::Prod,\n\t\ttranspile_ts: false,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_use_server_mount() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useTask$, useStore, useStyles$ } from '@builder.io/qwik';\nimport mongo from 'mongodb';\nimport redis from 'redis';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n        redis.set(state.text);\n    });\n\n    return (\n        <div onClick$={() => console.log('parent')}>\n            {state.text}\n        </div>\n    );\n});\n\nexport const Child = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n    });\n\n    return (\n        <div onClick$={() => console.log('child')}>\n            {state.text}\n        </div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tentry_strategy: EntryStrategy::Smart,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_manual_chunks() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useTask$, useStore, useStyles$ } from '@builder.io/qwik';\nimport mongo from 'mongodb';\nimport redis from 'redis';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n        redis.set(state.text);\n    });\n\n    return (\n        <div onClick$={() => console.log('parent')}>\n            {state.text}\n        </div>\n    );\n});\n\nexport const Child = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        state.text = await mongo.users();\n    });\n\n    return (\n        <div onClick$={() => console.log('child')}>\n            {state.text}\n        </div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\t// filler to maintain line offsets\n\t\t// this is a test for manual chunks\n\t\t// which are no longer used in the optimizer\n\t\t//\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tentry_strategy: EntryStrategy::Smart,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_strip_exports_unused() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\nimport mongodb from 'mongodb';\n\nexport const onGet = () => {\n    const data = mongodb.collection.whatever;\n    return {\n        body: {\n        data\n        }\n    }\n};\n\nexport default component$(()=> {\n    return <div>cmp</div>\n});\n\"#\n\t\t.to_string(),\n\t\tstrip_exports: Some(vec![\"onGet\".into()]),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_strip_exports_used() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useResource$ } from '@builder.io/qwik';\nimport mongodb from 'mongodb';\n\nexport const onGet = () => {\n    const data = mongodb.collection.whatever;\n    return {\n        body: {\n        data\n        }\n    }\n};\n\nexport default component$(()=> {\n    useResource$(() => {\n        return onGet();\n    })\n    return <div>cmp</div>\n});\n\"#\n\t\t.to_string(),\n\t\tstrip_exports: Some(vec![\"onGet\".into()]),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_strip_server_code() {\n\ttest_input!(TestInput {\n        code: r#\"\nimport { component$, serverLoader$, serverStuff$, $, client$, useStore, useTask$ } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik/build';\nimport mongo from 'mongodb';\nimport redis from 'redis';\nimport { handler } from 'serverless';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useTask$(async () => {\n        if (!isServer) return;\n        state.text = await mongo.users();\n        redis.set(state.text);\n    });\n\n    serverStuff$(async () => {\n        // should be removed too\n        const a = $(() => {\n            // from $(), should not be removed\n        });\n        const b = client$(() => {\n            // from clien$(), should not be removed\n        });\n        return [a,b];\n    })\n\n    serverLoader$(handler);\n\n    useTask$(() => {\n        // Code\n    });\n\n    return (\n        <div onClick$={() => console.log('parent')}>\n            {state.text}\n        </div>\n    );\n});\n\"#\n        .to_string(),\n        transpile_ts: true,\n        transpile_jsx: true,\n        entry_strategy: EntryStrategy::Segment,\n        strip_ctx_name: Some(vec![\"server\".into()]),\n        ..TestInput::default()\n    });\n}\n\n#[test]\nfn example_server_auth() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport GitHub from '@auth/core/providers/github'\nimport Facebook from 'next-auth/providers/facebook'\nimport Google from 'next-auth/providers/google'\nimport {serverAuth$, auth$} from '@auth/qwik';\n\nexport const { onRequest, logout, getSession, signup } = serverAuth$({\n    providers: [\n    GitHub({\n        clientId: process.env.GITHUB_ID,\n        clientSecret: process.env.GITHUB_SECRET\n    }),\n    Facebook({\n        clientId: import.meta.env.FACEBOOK_ID,\n        clientSecret: import.meta.env.FACEBOOK_SECRET\n    }),\n    Google({\n        clientId: process.env.GOOGLE_ID,\n        clientSecret: process.env.GOOGLE_SECRET\n    })\n    ]\n});\n\nexport const { onRequest, logout, getSession, signup } = auth$({\n    providers: [\n    GitHub({\n        clientId: process.env.GITHUB_ID,\n        clientSecret: process.env.GITHUB_SECRET\n    }),\n    Facebook({\n        clientId: process.env.FACEBOOK_ID,\n        clientSecret: process.env.FACEBOOK_SECRET\n    }),\n    Google({\n        clientId: process.env.GOOGLE_ID,\n        clientSecret: process.env.GOOGLE_SECRET\n    })\n    ]\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tentry_strategy: EntryStrategy::Segment,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_strip_client_code() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useClientMount$, useStore, useTask$ } from '@builder.io/qwik';\nimport mongo from 'mongodb';\nimport redis from 'redis';\nimport threejs from 'threejs';\nimport { a } from './keep';\nimport { b } from '../keep2';\nimport { c } from '../../remove';\n\nexport const Parent = component$(() => {\n    const state = useStore({\n        text: ''\n    });\n\n    // Double count watch\n    useClientMount$(async () => {\n        state.text = await mongo.users();\n        redis.set(state.text, a, b, c);\n    });\n\n    useTask$(() => {\n        // Code\n    });\n\n    return (\n        <div\n            shouldRemove$={() => state.text}\n            onClick$={() => console.log('parent', state, threejs)}\n        >\n            <Div\n                onClick$={() => console.log('keep')}\n                render$={() => state.text}\n            />\n            {state.text}\n        </div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tfilename: \"components/component.tsx\".into(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\tstrip_ctx_name: Some(vec![\"useClientMount$\".into()]),\n\t\tstrip_event_handlers: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn issue_150() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, $ } from '@builder.io/qwik';\nimport { hola } from 'sdfds';\n\nexport const Greeter = component$(() => {\n    const stuff = useStore();\n    return $(() => {\n        return (\n            <div\n                class={{\n                    'foo': true,\n                    'bar': stuff.condition,\n                    'baz': hola ? 'true' : 'false',\n                }}\n            />\n        )\n    });\n});\n\nconst d = $(()=>console.log('thing'));\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_input_bind() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, $ } from '@builder.io/qwik';\n\nexport const Greeter = component$(() => {\n    const value = useSignal(0);\n    const checked = useSignal(false);\n    const stuff = useSignal();\n    return (\n        <>\n            <input bind:value={value} />\n            <input bind:checked={checked} />\n            <input bind:stuff={stuff} />\n            <div>{value}</div>\n            <div>{value.value}</div>\n        </>\n\n    )\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tmode: EmitMode::Prod,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_import_assertion() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, $ } from '@builder.io/qwik';\nimport json from \"./foo.json\" assert { type: \"json\" };\n\nexport const Greeter = component$(() => {\n    return json;\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn support_windows_paths() {\n\tlet res = test_input!(TestInput {\n\t\tfilename: r\"components\\apps\\apps.tsx\".to_string(),\n\t\tsrc_dir: r\"C:\\users\\apps\".to_string(),\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\nexport const Greeter = component$(() => <div/>)\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\tis_server: Some(false),\n\t\tentry_strategy: EntryStrategy::Segment,\n\t\t..TestInput::default()\n\t})\n\t.unwrap();\n\t// verify that none of the modules have a path that contains backslashes\n\tfor module in res.modules {\n\t\tassert!(!module.path.contains('\\\\'));\n\t}\n}\n// filler to retain assertion line numbers\n//\n//\n//\n//\n//\n\n#[test]\nfn issue_476() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { Counter } from \"./counter.tsx\";\n\nexport const Root = () => {\n    return (\n        <html>\n            <head>\n                <meta charset=\"utf-8\" />\n                <title>Qwik Blank App</title>\n            </head>\n            <body>\n                <Counter initial={3} />\n            </body>\n        </html>\n    );\n};\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: false,\n\t\ttranspile_jsx: false,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn issue_964() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    console.log(function*(lo: any, t: any) {\n    console.log(yield (yield lo)(t.href).then((r) => r.json()));\n    });\n\n    return <p>Hello Qwik</p>;\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_immutable_analysis() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, $ } from '@builder.io/qwik';\nimport importedValue from 'v';\nimport styles from './styles.module.css';\n\nexport const App = component$((props) => {\n    const {Model} = props;\n    const state = useStore({count: 0});\n    const remove = $((id: number) => {\n        const d = state.data;\n        d.splice(\n          d.findIndex((d) => d.id === id),\n          1\n        )\n      });\n    return (\n        <>\n            <p class=\"stuff\" onClick$={props.onClick$}>Hello Qwik</p>\n            <Div\n                class={styles.foo}\n                document={window.document}\n                onClick$={props.onClick$}\n                onEvent$={() => console.log('stuff')}\n                transparent$={() => {console.log('stuff')}}\n                immutable1=\"stuff\"\n                immutable2={{\n                    foo: 'bar',\n                    baz: importedValue ? true : false,\n                }}\n                immutable3={2}\n                immutable4$={(ev) => console.log(state.count)}\n                immutable5={[1, 2, importedValue, null, {}]}\n            >\n                <p>Hello Qwik</p>\n            </Div>\n            [].map(() => (\n                <Model\n                    class={state}\n                    remove$={remove}\n                    mutable1={{\n                        foo: 'bar',\n                        baz: state.count ? true : false,\n                    }}\n                    mutable2={(() => console.log(state.count))()}\n                    mutable3={[1, 2, state, null, {}]}\n                />\n            ));\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_ts_enums_issue_1341() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nenum Thing {\n    A,\n    B\n}\n\nexport const App = component$(() => {\n    console.log(Thing.A);\n    return (\n        <>\n            <p class=\"stuff\">Hello Qwik</p>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_ts_enums_no_transpile() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport enum Thing {\n    A,\n    B\n}\n\nexport const App = component$(() => {\n    console.log(Thing.A);\n    return (\n        <>\n            <p class=\"stuff\">Hello Qwik</p>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: false,\n\t\ttranspile_jsx: false,\n\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_ts_enums() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport enum Thing {\n    A,\n    B\n}\n\nexport const App = component$(() => {\n    console.log(Thing.A);\n    return (\n        <>\n            <p class=\"stuff\">Hello Qwik</p>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn special_jsx() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\n// don't transpile jsx with non-plain-object props\nimport { jsx } from '@builder.io/qwik';\n\nexport const App = () => {\n    const props = {}\n    return jsx('div', props, 'Hello Qwik');\n}\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: false,\n\t\ttranspile_jsx: false,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_dev_mode() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tmode: EmitMode::Dev,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_dev_mode_inlined() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tmode: EmitMode::Dev,\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_transpile_jsx_only() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: false,\n\t\ttranspile_jsx: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_spread_jsx() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\nimport { useDocumentHead, useLocation } from '@builder.io/qwik-city';\n\n/**\n * The RouterHead component is placed inside of the document `<head>` element.\n */\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n\n      {head.meta.map((m) => (\n        <meta {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link {...l} key={l.key} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style {...s.props} dangerouslySetInnerHTML={s.style} key={s.key} />\n      ))}\n    </>\n  );\n});\"#\n\t\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_export_issue() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nconst App = component$(() => {\n    return (\n        <div>hola</div>\n    );\n});\n\n\nexport const Root = component$((props: Stuff) => {\n    return (\n        <App/>\n    );\n});\n\nconst Other = 12;\nexport { Other as App };\n\nexport default App;\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_jsx_keyed() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <>\n            <Cmp key=\"stuff\"></Cmp>\n            <Cmp></Cmp>\n            <Cmp prop=\"23\"></Cmp>\n            <Cmp prop=\"23\" key={props.stuff}></Cmp>\n            <p key={props.stuff}>Hello Qwik</p>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_jsx_keyed_dev() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <>\n            <Cmp key=\"stuff\"></Cmp>\n            <Cmp></Cmp>\n            <Cmp prop=\"23\"></Cmp>\n            <Cmp prop=\"23\" key={props.stuff}></Cmp>\n            <p key={props.stuff}>Hello Qwik</p>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tfilename: \"project/index.tsx\".into(),\n\t\tsrc_dir: \"/src/project\".into(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tmode: EmitMode::Dev,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_mutable_children() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, Slot, Fragment } from '@builder.io/qwik';\nimport Image from './image.jpg?jsx';\n\nexport function Fn1(props: Stuff) {\n    return (\n        <>\n            <div>{prop < 2 ? <p>1</p> : <Stuff>2</Stuff>}</div>\n        </>\n    );\n}\n\nexport function Fn2(props: Stuff) {\n    return (\n        <div>{prop.value && <Stuff></Stuff>}<div></div></div>\n    );\n}\n\nexport function Fn3(props: Stuff) {\n    if (prop.value) {\n        return (\n            <Stuff></Stuff>\n        );\n    }\n    return (\n        <div></div>\n    );\n}\n\nexport function Fn4(props: Stuff) {\n    if (prop.value) {\n        return (\n            <div></div>\n        );\n    }\n    return (\n        <Stuff></Stuff>\n    );\n}\n\nexport const Arrow = (props: Stuff) => <div>{prop < 2 ? <p>1</p> : <Stuff>2</Stuff>}</div>;\n\nexport const AppDynamic1 = component$((props: Stuff) => {\n    return (\n        <>\n            <div>{prop < 2 ? <p>1</p> : <Stuff>2</Stuff>}</div>\n        </>\n    );\n});\nexport const AppDynamic2 = component$((props: Stuff) => {\n    return (\n        <div>{prop.value && <Stuff></Stuff>}<div></div></div>\n    );\n});\n\nexport const AppDynamic3 = component$((props: Stuff) => {\n    if (prop.value) {\n        return (\n            <Stuff></Stuff>\n        );\n    }\n    return (\n        <div></div>\n    );\n});\n\nexport const AppDynamic4 = component$((props: Stuff) => {\n    if (prop.value) {\n        return (\n            <div></div>\n        );\n    }\n    return (\n        <Stuff></Stuff>\n    );\n});\n\nexport const AppStatic = component$((props: Stuff) => {\n    return (\n        <>\n            <div>Static {f ? 1 : 3}</div>\n            <div>{prop < 2 ? <p>1</p> : <p>2</p>}</div>\n\n            <div>{prop.value && <div></div>}</div>\n            <div>{prop.value && <Fragment><Slot></Slot></Fragment>}</div>\n            <div>{prop.value && <><div></div></>}</div>\n            <div>{prop.value && <Image/>}</div>\n            <div>Static {f ? 1 : 3}</div>\n            <div>Static</div>\n            <div>Static {props.value}</div>\n            <div>Static {stuff()}</div>\n            <div>Static {stuff()}</div>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_immutable_function_components() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, Slot } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <div>\n            <Slot/>\n        </div>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n#[test]\nfn example_transpile_ts_only() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: false,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_class_name() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$ } from '@builder.io/qwik';\n\nexport const App2 = component$(() => {\n    const signal = useSignal();\n    const computed = signal.value + 'foo';\n    return (\n        <>\n            <div className=\"hola\"></div>\n            <div className={signal.value}></div>\n            <div className={signal}></div>\n            <div className={computed}></div>\n\n            <Foo className=\"hola\"></Foo>\n            <Foo className={signal.value}></Foo>\n            <Foo className={signal}></Foo>\n            <Foo className={computed}></Foo>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_preserve_filenames() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props) => {\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Inline,\n\t\ttranspile_ts: false,\n\t\ttranspile_jsx: true,\n\t\tpreserve_filenames: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_preserve_filenames_segments() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$((props: Stuff) => {\n    foo();\n    return (\n        <Cmp>\n            <p class=\"stuff\" onClick$={() => console.log('warn')}>Hello Qwik</p>\n        </Cmp>\n    );\n});\n\nexport const foo = () => console.log('foo');\n\"#\n\t\t.to_string(),\n\t\tentry_strategy: EntryStrategy::Segment,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tpreserve_filenames: true,\n\t\texplicit_extensions: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_build_server() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, isDev, isServer as isServer2 } from '@builder.io/qwik';\nimport { isServer, isBrowser as isb } from '@builder.io/qwik/build';\nimport { mongodb } from 'mondodb';\nimport { threejs } from 'threejs';\n\nimport L from 'leaflet';\n\nexport const functionThatNeedsWindow = () => {\n  if (isb) {\n    console.log('l', L);\n    console.log('hey');\n    window.alert('hey');\n  }\n};\n\nexport const App = component$(() => {\n    useMount$(() => {\n        if (isServer) {\n            console.log('server', mongodb());\n        }\n        if (isb) {\n            console.log('browser', new threejs());\n        }\n    });\n    return (\n        <Cmp>\n            {isServer2 && <p>server</p>}\n            {isb && <p>server</p>}\n        </Cmp>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tis_server: Some(true),\n\t\tmode: EmitMode::Prod,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_derived_signals_div() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\nimport styles from './styles.module.css';\n\nexport const App = component$((props) => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    const count = props.counter.count;\n\n    return (\n        <div\n            class={{\n                even: count % 2 === 0,\n                odd: count % 2 === 1,\n                stable0: true,\n                hidden: false,\n            }}\n            staticClass={styles.foo}\n            staticDocument={window.document}\n            staticText=\"text\"\n            staticText2={`text`}\n            staticNumber={1}\n            staticBoolean={true}\n            staticExpr={`text${12}`}\n            staticExpr2={typeof `text${12}` === 'string' ? 12 : 43}\n\n            signal={signal}\n            signalValue={signal.value}\n            signalComputedValue={12 + signal.value}\n\n            store={store.address.city.name}\n            storeComputed={store.address.city.name ? 'true' : 'false'}\n\n            dep={dep}\n            depAccess={dep.thing}\n            depComputed={dep.thing + 'stuff'}\n\n            global={globalThing}\n            globalAccess={globalThing.thing}\n            globalComputed={globalThing.thing + 'stuff'}\n\n\n            noInline={signal.value()}\n            noInline2={signal.value + unknown()}\n            noInline3={mutable(signal)}\n            noInline4={signal.value + dep}\n        />\n\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\ttranspile_ts: true,\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_issue_4438() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    const toggle = useSignal(false);\n    return (\n        <>\n            <div data-nu={toggle.value ? $localize`singular` : 'plural'}></div>\n            <div>{toggle.value ? $localize`singular` : $localize`plural`}</div>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\ttranspile_ts: true,\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_derived_signals_children() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\n\nexport const TextContent = component$((props) => {\n    return (\n        <>\n            <div>data-nu: {props['data-nu']}</div>\n            <div>class: {props.class}</div>\n        </>\n    );\n});\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <>\n            <div>text</div>\n            <div>{`text`}</div>\n            <div>{1}</div>\n            <div>{true}</div>\n            <div>{`text${12}`}</div>\n            <div>{typeof `text${12}` === 'string' ? 12 : 43}</div>\n            <div>{signal}</div>\n            <div>{signal.value}</div>\n            <div>{12 + signal.value}</div>\n            <div>{store.address.city.name}</div>\n            <div>{store.address.city.name ? 'true' : 'false'}</div>\n            <div>{dep}</div>\n            <div>{dep.thing}</div>\n            <div>{dep.thing + 'stuff'}</div>\n            <div>{globalThing}</div>\n            <div>{globalThing.thing}</div>\n            <div>{globalThing.thing + 'stuff'}</div>\n            <div>{signal.value()}</div>\n            <div>{signal.value + unknown()}</div>\n            <div>{mutable(signal)}</div>\n            <div>{signal.value + dep}</div>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\ttranspile_ts: true,\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_derived_signals_multiple_children() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <>\n            <div>First text</div>\n            <div>First {`text`}</div>\n            <div>First {1}</div>\n            <div>First {true}</div>\n            <div>First {`text${12}`}</div>\n            <div>First {typeof `text${12}` === 'string' ? 12 : 43}</div>\n            <div>First {signal}</div>\n            <div>First {signal.value}</div>\n            <div>First {12 + signal.value}</div>\n            <div>First {store.address.city.name}</div>\n            <div>First {store.address.city.name ? 'true' : 'false'}</div>\n            <div>First {dep}</div>\n            <div>First {dep.thing}</div>\n            <div>First {dep.thing + 'stuff'}</div>\n            <div>First {globalThing}</div>\n            <div>First {globalThing.thing}</div>\n            <div>First {globalThing.thing + 'stuff'}</div>\n            <div>First {signal.value()}</div>\n            <div>First {signal.value + unknown()}</div>\n            <div>First {mutable(signal)}</div>\n            <div>First {signal.value + dep}</div>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\ttranspile_ts: true,\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_derived_signals_complext_children() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <>\n            <ul id=\"issue-2800-result\">\n                {Object.entries(store).map(([key, value]) => (\n                <li>\n                    {key} - {value}\n                </li>\n                ))}\n            </ul>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\ttranspile_ts: true,\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_derived_signals_cmp() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, mutable } from '@builder.io/qwik';\n\nimport {dep} from './file';\nimport {Cmp} from './cmp';\n\nexport const App = component$(() => {\n    const signal = useSignal(0);\n    const store = useStore({});\n    return (\n        <Cmp\n            staticText=\"text\"\n            staticText2={`text`}\n            staticNumber={1}\n            staticBoolean={true}\n            staticExpr={`text${12}`}\n            staticExpr2={typeof `text${12}` === 'string' ? 12 : 43}\n\n            signal={signal}\n            signalValue={signal.value}\n            signalComputedValue={12 + signal.value}\n\n            store={store.address.city.name}\n            storeComputed={store.address.city.name ? 'true' : 'false'}\n\n            dep={dep}\n            depAccess={dep.thing}\n            depComputed={dep.thing + 'stuff'}\n\n            global={globalThing}\n            globalAccess={globalThing.thing}\n            globalComputed={globalThing.thing + 'stuff'}\n\n\n            noInline={signal.value()}\n            noInline2={signal.value + unknown()}\n            noInline3={mutable(signal)}\n            noInline4={signal.value + dep}\n        />\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\ttranspile_ts: true,\n\t\tentry_strategy: EntryStrategy::Hoist,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_issue_33443() {\n\ttest_input!(TestInput {\n        code: r#\"\nimport { component$, useSignal } from '@builder.io/qwik';\n\nexport const Issue3742 = component$(({description = '', other}: any) => {\n    const counter = useSignal(0);\n    return (\n      <div\n        title={(description && 'description' in other) ? `Hello ${counter.value}` : `Bye ${counter.value}`}\n      >\n        Issue3742\n        <button onClick$={() => counter.value++}>\n          Increment\n        </button>\n      </div>\n    )\n  });\n  \"#\n        .to_string(),\n        transpile_jsx: true,\n        transpile_ts: true,\n        entry_strategy: EntryStrategy::Hoist,\n        ..TestInput::default()\n    });\n}\n#[test]\nfn example_getter_generation() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    const store = useStore({\n        count: 0,\n        stuff: 0,\n        nested: {\n            count: 0\n        }\n    });\n    const signal = useSignal(0);\n    return (\n        <Cmp\n            prop={'true' + 1 ? 'true' : ''}\n            count={store.count}\n            nested={store.nested.count}\n            signal={signal}\n            store={store.stuff + 12}\n            value={signal.formData?.get('username')}\n        >\n        </Cmp>\n    );\n});\n\nexport const Cmp = component$((props) => {\n    return (\n        <>\n            <p data-value={props.count}>{props.nested.count}</p>\n            <p>Value {props.count}<span></span></p>\n        </>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_qwik_react() {\n\ttest_input!(TestInput {\n        code: r#\"\nimport { componentQrl, inlinedQrl, useLexicalScope, useHostElement, useStore, useTaskQrl, noSerialize, SkipRerender, implicit$FirstArg } from '@builder.io/qwik';\nimport { jsx, Fragment } from '@builder.io/qwik/jsx-runtime';\nimport { isBrowser, isServer } from '@builder.io/qwik/build';\n\nfunction qwikifyQrl(reactCmpQrl) {\n    return /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{\n        const [reactCmpQrl] = useLexicalScope();\n        const hostElement = useHostElement();\n        const store = useStore({});\n        let run;\n        if (props['client:visible']) run = 'visible';\n        else if (props['client:load'] || props['client:only']) run = 'load';\n        useTaskQrl(inlinedQrl(async (track)=>{\n            const [hostElement, props, reactCmpQrl, store] = useLexicalScope();\n            track(props);\n            if (isBrowser) {\n                if (store.data) store.data.root.render(store.data.client.Main(store.data.cmp, filterProps(props)));\n                else {\n                    const [Cmp, client] = await Promise.all([\n                        reactCmpQrl.resolve(),\n                        import('./client-f762f78c.js')\n                    ]);\n                    let root;\n                    if (hostElement.childElementCount > 0) root = client.hydrateRoot(hostElement, client.Main(Cmp, filterProps(props), store.event));\n                    else {\n                        root = client.createRoot(hostElement);\n                        root.render(client.Main(Cmp, filterProps(props)));\n                    }\n                    store.data = noSerialize({\n                        client,\n                        cmp: Cmp,\n                        root\n                    });\n                }\n            }\n        }, \"qwikifyQrl_component_useWatch_x04JC5xeP1U\", [\n            hostElement,\n            props,\n            reactCmpQrl,\n            store\n        ]), {\n            run\n        });\n        if (isServer && !props['client:only']) {\n            const jsx$1 = Promise.all([\n                reactCmpQrl.resolve(),\n                import('./server-9ac6caad.js')\n            ]).then(([Cmp, server])=>{\n                const html = server.render(Cmp, filterProps(props));\n                return /*#__PURE__*/ jsx(Host, {\n                    dangerouslySetInnerHTML: html,\n                    [_IMMUTABLE]: [\n                        \"dangerouslySetInnerHTML\"\n                    ]\n                });\n            });\n            return /*#__PURE__*/ jsx(Fragment, {\n                children: jsx$1\n            });\n        }\n        return /*#__PURE__*/ jsx(Host, {\n            children: /*#__PURE__*/ jsx(SkipRerender, {})\n        });\n    }, \"qwikifyQrl_component_zH94hIe0Ick\", [\n        reactCmpQrl\n    ]), {\n        tagName: 'qwik-wrap'\n    });\n}\nconst filterProps = (props)=>{\n    const obj = {};\n    Object.keys(props).forEach((key)=>{\n        if (!key.startsWith('client:')) obj[key] = props[key];\n    });\n    return obj;\n};\nconst qwikify$ = implicit$FirstArg(qwikifyQrl);\n\nasync function renderToString(rootNode, opts) {\n    const mod = await import('./server-9ac6caad.js');\n    const result = await mod.renderToString(rootNode, opts);\n    const styles = mod.getGlobalStyleTag(result.html);\n    const finalHtml = styles + result.html;\n    return {\n        ...result,\n        html: finalHtml\n    };\n}\n\nexport { qwikify$, qwikifyQrl, renderToString };\n        \"#\n        .to_string(),\n        filename: \"../node_modules/@builder.io/qwik-react/index.qwik.mjs\".to_string(),\n        entry_strategy: EntryStrategy::Segment,\n        explicit_extensions: true,\n        ..TestInput::default()\n    });\n}\n\n#[test]\nfn example_qwik_react_inline() {\n\ttest_input!(TestInput {\n        code: r#\"\nimport { componentQrl, inlinedQrl, useLexicalScope, useHostElement, useStore, useTaskQrl, noSerialize, SkipRerender, implicit$FirstArg } from '@builder.io/qwik';\nimport { jsx, Fragment } from '@builder.io/qwik/jsx-runtime';\nimport { isBrowser, isServer } from '@builder.io/qwik/build';\n\nfunction qwikifyQrl(reactCmpQrl) {\n    return /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{\n        const [reactCmpQrl] = useLexicalScope();\n        const hostElement = useHostElement();\n        const store = useStore({});\n        let run;\n        if (props['client:visible']) run = 'visible';\n        else if (props['client:load'] || props['client:only']) run = 'load';\n        useTaskQrl(inlinedQrl(async (track)=>{\n            const [hostElement, props, reactCmpQrl, store] = useLexicalScope();\n            track(props);\n            if (isBrowser) {\n                if (store.data) store.data.root.render(store.data.client.Main(store.data.cmp, filterProps(props)));\n                else {\n                    const [Cmp, client] = await Promise.all([\n                        reactCmpQrl.resolve(),\n                        import('./client-f762f78c.js')\n                    ]);\n                    let root;\n                    if (hostElement.childElementCount > 0) root = client.hydrateRoot(hostElement, client.Main(Cmp, filterProps(props), store.event));\n                    else {\n                        root = client.createRoot(hostElement);\n                        root.render(client.Main(Cmp, filterProps(props)));\n                    }\n                    store.data = noSerialize({\n                        client,\n                        cmp: Cmp,\n                        root\n                    });\n                }\n            }\n        }, \"qwikifyQrl_component_useWatch_x04JC5xeP1U\", [\n            hostElement,\n            props,\n            reactCmpQrl,\n            store\n        ]), {\n            run\n        });\n        if (isServer && !props['client:only']) {\n            const jsx$1 = Promise.all([\n                reactCmpQrl.resolve(),\n                import('./server-9ac6caad.js')\n            ]).then(([Cmp, server])=>{\n                const html = server.render(Cmp, filterProps(props));\n                return /*#__PURE__*/ jsx(Host, {\n                    dangerouslySetInnerHTML: html,\n                    [_IMMUTABLE]: [\n                        \"dangerouslySetInnerHTML\"\n                    ]\n                });\n            });\n            return /*#__PURE__*/ jsx(Fragment, {\n                children: jsx$1\n            });\n        }\n        return /*#__PURE__*/ jsx(Host, {\n            children: /*#__PURE__*/ jsx(SkipRerender, {})\n        });\n    }, \"qwikifyQrl_component_zH94hIe0Ick\", [\n        reactCmpQrl\n    ]), {\n        tagName: 'qwik-wrap'\n    });\n}\nconst filterProps = (props)=>{\n    const obj = {};\n    Object.keys(props).forEach((key)=>{\n        if (!key.startsWith('client:')) obj[key] = props[key];\n    });\n    return obj;\n};\nconst qwikify$ = implicit$FirstArg(qwikifyQrl);\n\nasync function renderToString(rootNode, opts) {\n    const mod = await import('./server-9ac6caad.js');\n    const result = await mod.renderToString(rootNode, opts);\n    const styles = mod.getGlobalStyleTag(result.html);\n    const finalHtml = styles + result.html;\n    return {\n        ...result,\n        html: finalHtml\n    };\n}\n\nexport { qwikify$, qwikifyQrl, renderToString };\n        \"#\n        .to_string(),\n        filename: \"../node_modules/@builder.io/qwik-react/index.qwik.mjs\".to_string(),\n        entry_strategy: EntryStrategy::Inline,\n        explicit_extensions: true,\n        ..TestInput::default()\n    });\n}\n\n#[test]\nfn example_qwik_sdk_inline() {\n\ttest_input!(TestInput {\n\t\tcode: include_str!(\"fixtures/index.qwik.mjs\").to_string(),\n\t\tfilename: \"../node_modules/@builder.io/qwik-city/index.qwik.mjs\".to_string(),\n\t\tentry_strategy: EntryStrategy::Smart,\n\t\texplicit_extensions: true,\n\t\t// mode: EmitMode::Prod,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn relative_paths() {\n\tlet dep = r#\"\nimport { componentQrl, inlinedQrl, useStore, useLexicalScope } from \"@builder.io/qwik\";\nimport { jsx, jsxs } from \"@builder.io/qwik/jsx-runtime\";\nimport { state } from './sibling';\n\nconst useData = () => {\n    return useStore({\n        count: 0\n    });\n}\n\nexport const App = /*#__PURE__*/ componentQrl(inlinedQrl(()=>{\n    const store = useData();\n    return /*#__PURE__*/ jsxs(\"div\", {\n        children: [\n            /*#__PURE__*/ jsxs(\"p\", {\n                children: [\n                    \"Count: \",\n                    store.count\n                ]\n            }),\n            /*#__PURE__*/ jsx(\"p\", {\n                children: /*#__PURE__*/ jsx(\"button\", {\n                    onClick$: inlinedQrl(()=>{\n                        const [store] = useLexicalScope();\n                        return store.count++;\n                    }, \"App_component_div_p_button_onClick_8dWUa0cJAr4\", [\n                        store\n                    ]),\n                    children: \"Click\"\n                })\n            })\n        ]\n    });\n}, \"App_component_AkbU84a8zes\"));\n\n\"#;\n\tlet code = r#\"\nimport { component$, $ } from '@builder.io/qwik';\nimport { state } from './sibling';\n\nexport const Local = component$(() => {\n    return (\n        <div>{state}</div>\n    )\n});\n\"#;\n\tlet res = transform_modules(TransformModulesOptions {\n\t\tsrc_dir: \"/path/to/app/src/thing\".into(),\n\t\troot_dir: Some(\"/path/to/app/\".into()),\n\t\tinput: vec![\n\t\t\tTransformModuleInput {\n\t\t\t\tcode: dep.into(),\n\t\t\t\tpath: \"../../node_modules/dep/dist/lib.mjs\".into(),\n\t\t\t\tdev_path: None,\n\t\t\t},\n\t\t\tTransformModuleInput {\n\t\t\t\tcode: code.into(),\n\t\t\t\tpath: \"components/main.tsx\".into(),\n\t\t\t\tdev_path: None,\n\t\t\t},\n\t\t],\n\t\tsource_maps: true,\n\t\tminify: MinifyMode::Simplify,\n\t\texplicit_extensions: true,\n\t\tmode: EmitMode::Test,\n\t\t// filler to maintain line offsets\n\t\tentry_strategy: EntryStrategy::Segment,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tpreserve_filenames: false,\n\t\tcore_module: None,\n\t\tscope: None,\n\t\tstrip_exports: None,\n\t\tstrip_ctx_name: None,\n\t\tstrip_event_handlers: false,\n\t\treg_ctx_name: None,\n\t\tis_server: None,\n\t});\n\tsnapshot_res!(&res, \"\".into());\n}\n#[test]\nfn consistent_hashes() {\n\tlet code = r#\"\nimport { component$, $ } from '@builder.io/qwik';\nimport mongo from 'mongodb';\n\nexport const Greeter = component$(() => {\n    // Double count watch\n    useTask$(async () => {\n        await mongo.users();\n    });\n    return (\n        <div>\n            <div onClick$={() => {}}/>\n            <div onClick$={() => {}}/>\n            <div onClick$={() => {}}/>\n        </div>\n    )\n});\n\n\"#;\n\tlet options = vec![\n\t\t(EmitMode::Test, EntryStrategy::Segment, true),\n\t\t(EmitMode::Test, EntryStrategy::Single, true),\n\t\t(EmitMode::Test, EntryStrategy::Component, true),\n\t\t// (EmitMode::Test, EntryStrategy::Inline, true),\n\t\t(EmitMode::Prod, EntryStrategy::Segment, true),\n\t\t(EmitMode::Prod, EntryStrategy::Single, true),\n\t\t(EmitMode::Prod, EntryStrategy::Component, true),\n\t\t// (EmitMode::Prod, EntryStrategy::Inline, true),\n\t\t(EmitMode::Dev, EntryStrategy::Segment, true),\n\t\t(EmitMode::Dev, EntryStrategy::Single, true),\n\t\t(EmitMode::Dev, EntryStrategy::Component, true),\n\t\t// (EmitMode::Dev, EntryStrategy::Inline, true),\n\t\t(EmitMode::Test, EntryStrategy::Segment, false),\n\t\t(EmitMode::Test, EntryStrategy::Single, false),\n\t\t(EmitMode::Test, EntryStrategy::Component, false),\n\t\t// (EmitMode::Test, EntryStrategy::Inline, false),\n\t\t(EmitMode::Prod, EntryStrategy::Segment, false),\n\t\t(EmitMode::Prod, EntryStrategy::Single, false),\n\t\t(EmitMode::Prod, EntryStrategy::Component, false),\n\t\t// (EmitMode::Prod, EntryStrategy::Inline, false),\n\t\t(EmitMode::Dev, EntryStrategy::Segment, false),\n\t\t(EmitMode::Dev, EntryStrategy::Single, false),\n\t\t(EmitMode::Dev, EntryStrategy::Component, false),\n\t\t// (EmitMode::Dev, EntryStrategy::Inline, false),\n\t];\n\n\tlet res = transform_modules(TransformModulesOptions {\n\t\tsrc_dir: \"./thing\".into(),\n\t\tinput: vec![\n\t\t\tTransformModuleInput {\n\t\t\t\tcode: code.into(),\n\t\t\t\tpath: \"main.tsx\".into(),\n\t\t\t\tdev_path: None,\n\t\t\t},\n\t\t\tTransformModuleInput {\n\t\t\t\tcode: code.into(),\n\t\t\t\tpath: \"components/main.tsx\".into(),\n\t\t\t\tdev_path: None,\n\t\t\t},\n\t\t],\n\t\tsource_maps: true,\n\t\tminify: MinifyMode::Simplify,\n\t\troot_dir: None,\n\t\texplicit_extensions: true,\n\t\tmode: EmitMode::Test,\n\t\t// filler to maintain line offsets\n\t\tentry_strategy: EntryStrategy::Segment,\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tpreserve_filenames: false,\n\t\tscope: None,\n\t\tcore_module: None,\n\t\treg_ctx_name: None,\n\t\tstrip_exports: None,\n\t\tstrip_ctx_name: None,\n\t\tstrip_event_handlers: false,\n\t\tis_server: None,\n\t});\n\tlet ref_segments: Vec<_> = res\n\t\t.unwrap()\n\t\t.modules\n\t\t.into_iter()\n\t\t.flat_map(|module| module.segment)\n\t\t.collect();\n\n\tfor (i, option) in options.into_iter().enumerate() {\n\t\tlet res = transform_modules(TransformModulesOptions {\n\t\t\tsrc_dir: \"./thing\".into(),\n\t\t\tinput: vec![\n\t\t\t\tTransformModuleInput {\n\t\t\t\t\tcode: code.into(),\n\t\t\t\t\tpath: \"main.tsx\".into(),\n\t\t\t\t\tdev_path: None,\n\t\t\t\t},\n\t\t\t\tTransformModuleInput {\n\t\t\t\t\tcode: code.into(),\n\t\t\t\t\tpath: \"components/main.tsx\".into(),\n\t\t\t\t\tdev_path: None,\n\t\t\t\t},\n\t\t\t],\n\t\t\troot_dir: None,\n\t\t\tsource_maps: false,\n\t\t\tminify: MinifyMode::Simplify,\n\t\t\texplicit_extensions: true,\n\t\t\tmode: option.0,\n\t\t\t// filler to maintain line offsets\n\t\t\tentry_strategy: option.1,\n\t\t\ttranspile_ts: option.2,\n\t\t\ttranspile_jsx: option.2,\n\t\t\tpreserve_filenames: false,\n\t\t\tscope: None,\n\t\t\tcore_module: None,\n\t\t\tstrip_exports: None,\n\t\t\tstrip_ctx_name: None,\n\t\t\tstrip_event_handlers: false,\n\t\t\treg_ctx_name: None,\n\t\t\tis_server: None,\n\t\t});\n\n\t\tlet segments: Vec<_> = res\n\t\t\t.unwrap()\n\t\t\t.modules\n\t\t\t.into_iter()\n\t\t\t.flat_map(|module| module.segment)\n\t\t\t.collect();\n\n\t\tassert_eq!(segments.len(), ref_segments.len());\n\n\t\tfor (a, b) in segments.iter().zip(ref_segments.iter()) {\n\t\t\tassert_eq!(\n\t\t\t\tget_hash(a.name.as_ref()),\n\t\t\t\tget_hash(b.name.as_ref()),\n\t\t\t\t\"INDEX: {}\\n\\n{:#?}\\n\\n{:#?}\\n\\n{:#?}\\n\\n{:#?}\",\n\t\t\t\ti,\n\t\t\t\ta,\n\t\t\t\tb,\n\t\t\t\tsegments,\n\t\t\t\tref_segments\n\t\t\t);\n\t\t}\n\t}\n}\n\n#[test]\nfn issue_5008() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\n        import { component$, useStore } from \"@builder.io/qwik\";\n\n        export default component$(() => {\n        const store = useStore([{ value: 0 }]);\n        return (\n            <>\n            <button onClick$={() => store[0].value++}>+1</button>\n            {store.map(function (v, idx) {\n                return <div key={\"fn_\" + idx}>Function: {v.value}</div>;\n            })}\n            {store.map((v, idx) => (\n                <div key={\"arrow_\" + idx}>Arrow: {v.value}</div>\n            ))}\n            </>\n        );\n        });\n        \"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_of_synchronous_qrl() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\n        import { sync$, component$ } from \"@builder.io/qwik\";\n\n        export default component$(() => {\n        return (\n            <>\n                <input onClick$={sync$(function(event, target) {\n                    // comment should be removed\n                    event.preventDefault();\n                })}/>\n                <input onClick$={sync$((event, target) => {\n                    event.preventDefault();\n                })}/>\n                <input onClick$={sync$((event, target) => event.preventDefault())}/>\n            </>\n        );\n        });\n        \"#\n\t\t.to_string(),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn example_noop_dev_mode() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\nimport { component$, useStore, serverStuff$, $ } from '@builder.io/qwik';\n\nexport const App = component$(() => {\n    const stuff = useStore();\n    serverStuff$(async () => {\n        // should be removed but keep scope\n        console.log(stuff.count)\n    })\n    serverStuff$(async () => {\n        // should be removed\n    })\n\n    return (\n        <Cmp>\n            <p class=\"stuff\" \n                shouldRemove$={() => stuff.count}\n                onClick$={() => console.log('warn')}\n            >\n                Hello Qwik\n            </p>\n        </Cmp>\n    );\n});\n\"#\n\t\t.to_string(),\n\t\tmode: EmitMode::Dev,\n\t\tdev_path: Some(\"/hello/from/dev/test.tsx\".into()),\n\t\ttranspile_ts: true,\n\t\ttranspile_jsx: true,\n\t\tstrip_event_handlers: true,\n\t\tstrip_ctx_name: Some(vec![\"server\".into()]),\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn lib_mode_fn_signal() {\n\ttest_input!(TestInput {\n\t\tcode: r#\"\n    import { component$ } from '@builder.io/qwik';\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <div>\n      <p>Count: {count.value}</p>\n      <p>\n        <button onClick$={() => count.value++}>Increment</button>\n      </p>\n    </div>\n  );\n});\n\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n#[test]\nfn impure_template_fns() {\n\t// Should not mark the template function as static\n\ttest_input!(TestInput {\n\t\tcode: r#\"\n\t\timport { component$, useSignal } from '@builder.io/qwik';\n\t\tconst useFoo = (count) => {\n\t\t\tconst tag = (s) => {\n\t\t\t\tconst value = typeof s === \"string\" ? s : s[0];\n\t\t\t\treturn `${value}-${count.value}`;\n\t\t\t}\n\t\t\treturn tag;\n\t\t}\n\n\t\texport default component$(() => {\n\t\t\tconst count = useSignal(0);\n\t\t\tconst foo = useFoo(count);\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<p>{foo(\"test\")}</p>\n\t\t\t\t\t<p>{foo`test`}</p>\n\t\t\t\t\t<button onClick$={() => count.value++}>Count up</button>\n\t\t\t\t</>\n\t\t\t);\n\t\t});\n\t\t\"#\n\t\t.to_string(),\n\t\ttranspile_jsx: true,\n\t\t..TestInput::default()\n\t});\n}\n\n// TODO(misko): Make this test work by implementing strict serialization.\n// #[test]\n// fn example_of_synchronous_qrl_that_cant_be_serialized() {\n//     test_input!(TestInput {\n//         code: r#\"\n//         import { sync$, component$ } from \"@builder.io/qwik\";\n\n//         export default component$(() => {\n//         return (\n//             <input onClick$={sync$(function(event, target) {\n//                 console.log(component$);\n//             })}/>\n//         );\n//         });\n//         \"#\n//         .to_string(),\n//         transpile_ts: true,\n//         transpile_jsx: true,\n//         ..TestInput::default()\n//     });\n// }\n\nfn get_hash(name: &str) -> String {\n\tname.split('_').last().unwrap().into()\n}\n\nstruct TestInput {\n\tpub code: String,\n\tpub filename: String,\n\tpub dev_path: Option<String>,\n\tpub src_dir: String,\n\tpub root_dir: Option<String>,\n\tpub entry_strategy: EntryStrategy,\n\tpub minify: MinifyMode,\n\tpub transpile_ts: bool,\n\tpub transpile_jsx: bool,\n\tpub preserve_filenames: bool,\n\tpub explicit_extensions: bool,\n\tpub snapshot: bool,\n\tpub mode: EmitMode,\n\tpub core_module: Option<String>,\n\tpub scope: Option<String>,\n\tpub strip_exports: Option<Vec<String>>,\n\tpub reg_ctx_name: Option<Vec<String>>,\n\tpub strip_ctx_name: Option<Vec<String>>,\n\tpub strip_event_handlers: bool,\n\tpub is_server: Option<bool>,\n}\n\nimpl TestInput {\n\tpub fn default() -> Self {\n\t\tSelf {\n\t\t\tfilename: \"test.tsx\".to_string(),\n\t\t\tdev_path: None,\n\t\t\tsrc_dir: \"/user/qwik/src/\".to_string(),\n\t\t\troot_dir: None,\n\t\t\tcode: \"/user/qwik/src/\".to_string(),\n\t\t\tentry_strategy: EntryStrategy::Segment,\n\t\t\tminify: MinifyMode::Simplify,\n\t\t\ttranspile_ts: false,\n\t\t\ttranspile_jsx: false,\n\t\t\tpreserve_filenames: false,\n\t\t\texplicit_extensions: false,\n\t\t\tsnapshot: true,\n\t\t\tmode: EmitMode::Test,\n\t\t\tscope: None,\n\t\t\tcore_module: None,\n\t\t\treg_ctx_name: None,\n\t\t\tstrip_exports: None,\n\t\t\tstrip_ctx_name: None,\n\t\t\tstrip_event_handlers: false,\n\t\t\tis_server: None,\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/transform.rs",
    "content": "use crate::code_move::transform_function_expr;\nuse crate::collector::{\n\tcollect_from_pat, new_ident_from_id, GlobalCollect, Id, IdentCollector, ImportKind,\n};\nuse crate::entry_strategy::EntryPolicy;\nuse crate::has_branches::{is_conditional_jsx, is_conditional_jsx_block};\nuse crate::inlined_fn::{convert_inlined_fn, render_expr};\nuse crate::is_immutable::is_immutable_expr;\nuse crate::parse::{EmitMode, PathData};\nuse crate::words::*;\nuse crate::{errors, EntryStrategy};\nuse base64::Engine;\nuse path_slash::PathExt;\nuse serde::{Deserialize, Serialize};\nuse std::collections::hash_map::DefaultHasher;\nuse std::collections::{BTreeMap, HashMap, HashSet};\nuse std::fmt::Write as _;\nuse std::hash::Hash;\nuse std::hash::Hasher; // import without risk of name clashing\nuse std::iter;\nuse std::str;\nuse swc_atoms::{js_word, JsWord};\nuse swc_common::comments::{Comments, SingleThreadedComments};\nuse swc_common::SyntaxContext;\nuse swc_common::{errors::HANDLER, sync::Lrc, SourceMap, Span, Spanned, DUMMY_SP};\nuse swc_ecmascript::ast::{self};\nuse swc_ecmascript::utils::{private_ident, quote_ident, ExprFactory};\nuse swc_ecmascript::visit::{noop_fold_type, Fold, FoldWith, VisitWith};\n\nmacro_rules! id {\n\t($ident: expr) => {\n\t\t($ident.sym.clone(), $ident.ctxt)\n\t};\n}\n\nmacro_rules! id_eq {\n\t($ident: expr, $cid: expr) => {\n\t\tif let Some(cid) = $cid {\n\t\t\tcid.0 == $ident.sym && cid.1 == $ident.ctxt\n\t\t} else {\n\t\t\tfalse\n\t\t}\n\t};\n}\n\n#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]\n#[serde(rename_all = \"camelCase\")]\npub enum SegmentKind {\n\tFunction,\n\tEventHandler,\n\tJSXProp,\n}\n\n#[derive(Debug, Clone)]\npub struct Segment {\n\tpub entry: Option<JsWord>,\n\tpub canonical_filename: JsWord,\n\tpub name: JsWord,\n\tpub expr: Box<ast::Expr>,\n\tpub data: SegmentData,\n\tpub hash: u64,\n\tpub span: Span,\n}\n\n#[derive(Debug, Clone)]\npub struct SegmentData {\n\tpub extension: JsWord,\n\tpub local_idents: Vec<Id>,\n\tpub scoped_idents: Vec<Id>,\n\tpub parent_segment: Option<JsWord>,\n\tpub ctx_kind: SegmentKind,\n\tpub ctx_name: JsWord,\n\tpub origin: JsWord,\n\tpub path: JsWord,\n\tpub display_name: JsWord,\n\tpub hash: JsWord,\n\tpub need_transform: bool,\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]\npub enum IdentType {\n\tVar(bool),\n\tFn,\n\tClass,\n}\n\npub type IdPlusType = (Id, IdentType);\n\n#[allow(clippy::module_name_repetitions)]\npub struct QwikTransform<'a> {\n\tpub segments: Vec<Segment>,\n\tpub options: QwikTransformOptions<'a>,\n\n\tsegment_names: HashMap<String, u32>,\n\t// extra_top_items: BTreeMap<Id, ast::ModuleItem>,\n\textra_bottom_items: BTreeMap<Id, ast::ModuleItem>,\n\tstack_ctxt: Vec<String>,\n\tdecl_stack: Vec<Vec<IdPlusType>>,\n\tin_component: bool,\n\tmarker_functions: HashMap<Id, JsWord>,\n\tjsx_functions: HashSet<Id>,\n\timmutable_function_cmp: HashSet<Id>,\n\tqcomponent_fn: Option<Id>,\n\tqsegment_fn: Option<Id>,\n\tinlined_qrl_fn: Option<Id>,\n\tsync_qrl_fn: Option<Id>,\n\th_fn: Option<Id>,\n\tfragment_fn: Option<Id>,\n\n\tjsx_mutable: bool,\n\n\tsegment_stack: Vec<JsWord>,\n\tfile_hash: u64,\n\tjsx_key_counter: u32,\n\troot_jsx_mode: bool,\n}\n\npub struct QwikTransformOptions<'a> {\n\tpub path_data: &'a PathData,\n\tpub dev_path: Option<&'a str>,\n\tpub entry_policy: &'a dyn EntryPolicy,\n\tpub extension: JsWord,\n\tpub core_module: JsWord,\n\tpub explicit_extensions: bool,\n\tpub comments: Option<&'a SingleThreadedComments>,\n\tpub global_collect: GlobalCollect,\n\tpub scope: Option<&'a String>,\n\tpub mode: EmitMode,\n\tpub entry_strategy: EntryStrategy,\n\tpub reg_ctx_name: Option<&'a [JsWord]>,\n\tpub strip_ctx_name: Option<&'a [JsWord]>,\n\tpub strip_event_handlers: bool,\n\tpub is_server: bool,\n\tpub cm: Lrc<SourceMap>,\n}\n\nfn convert_qrl_word(id: &JsWord) -> Option<JsWord> {\n\tlet ident_name = id.as_ref();\n\tlet has_signal = ident_name.ends_with(QRL_SUFFIX);\n\tif has_signal {\n\t\tlet new_specifier = [&ident_name[0..ident_name.len() - 1], LONG_SUFFIX].concat();\n\t\tSome(JsWord::from(new_specifier))\n\t} else {\n\t\tNone\n\t}\n}\nimpl<'a> QwikTransform<'a> {\n\tpub fn new(options: QwikTransformOptions<'a>) -> Self {\n\t\tlet mut marker_functions = HashMap::new();\n\t\tfor (id, import) in options.global_collect.imports.iter() {\n\t\t\tif import.kind == ImportKind::Named && import.specifier.ends_with(QRL_SUFFIX) {\n\t\t\t\tmarker_functions.insert(id.clone(), import.specifier.clone());\n\t\t\t}\n\t\t}\n\n\t\tfor id in options.global_collect.exports.keys() {\n\t\t\tif id.0.ends_with(QRL_SUFFIX) {\n\t\t\t\tmarker_functions.insert(id.clone(), id.0.clone());\n\t\t\t}\n\t\t}\n\n\t\tlet mut hasher = DefaultHasher::new();\n\t\tlet local_file_name = options.path_data.rel_path.to_slash_lossy();\n\t\tif let Some(scope) = options.scope {\n\t\t\thasher.write(scope.as_bytes());\n\t\t}\n\t\thasher.write(local_file_name.as_bytes());\n\n\t\tlet jsx_functions = options\n\t\t\t.global_collect\n\t\t\t.imports\n\t\t\t.iter()\n\t\t\t.flat_map(|(id, import)| {\n\t\t\t\tmatch (\n\t\t\t\t\timport.kind,\n\t\t\t\t\timport.source.as_ref(),\n\t\t\t\t\timport.specifier.as_ref(),\n\t\t\t\t) {\n\t\t\t\t\t(ImportKind::Named, \"@builder.io/qwik\", \"jsx\") => Some(id.clone()),\n\t\t\t\t\t(ImportKind::Named, \"@builder.io/qwik\", \"jsxs\") => Some(id.clone()),\n\t\t\t\t\t(ImportKind::Named, \"@builder.io/qwik\", \"jsxDEV\") => Some(id.clone()),\n\t\t\t\t\t(ImportKind::Named, \"@builder.io/qwik/jsx-runtime\", _) => Some(id.clone()),\n\t\t\t\t\t(ImportKind::Named, \"@builder.io/qwik/jsx-dev-runtime\", _) => Some(id.clone()),\n\t\t\t\t\t_ => None,\n\t\t\t\t}\n\t\t\t})\n\t\t\t.collect();\n\n\t\tlet immutable_function_cmp = options\n\t\t\t.global_collect\n\t\t\t.imports\n\t\t\t.iter()\n\t\t\t.flat_map(|(id, import)| {\n\t\t\t\tmatch (\n\t\t\t\t\timport.kind,\n\t\t\t\t\timport.source.as_ref(),\n\t\t\t\t\timport.specifier.as_ref(),\n\t\t\t\t) {\n\t\t\t\t\t(\n\t\t\t\t\t\tImportKind::Named,\n\t\t\t\t\t\t\"@builder.io/qwik/jsx-runtime\" | \"@builder.io/qwik/jsx-dev-runtime\",\n\t\t\t\t\t\t\"Fragment\",\n\t\t\t\t\t) => Some(id.clone()),\n\t\t\t\t\t(\n\t\t\t\t\t\tImportKind::Named,\n\t\t\t\t\t\t\"@builder.io/qwik\",\n\t\t\t\t\t\t\"Fragment\" | \"RenderOnce\" | \"HTMLFragment\",\n\t\t\t\t\t) => Some(id.clone()),\n\t\t\t\t\t(ImportKind::Named, \"@builder.io/qwik-city\", \"Link\") => Some(id.clone()),\n\t\t\t\t\t(_, source, _) => {\n\t\t\t\t\t\tif source.ends_with(\"?jsx\") || source.ends_with(\".md\") {\n\t\t\t\t\t\t\tSome(id.clone())\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.collect();\n\t\tQwikTransform {\n\t\t\tfile_hash: hasher.finish(),\n\t\t\tjsx_key_counter: 0,\n\t\t\tstack_ctxt: Vec::with_capacity(16),\n\t\t\tdecl_stack: Vec::with_capacity(32),\n\t\t\tin_component: false,\n\t\t\tsegments: Vec::with_capacity(16),\n\t\t\tsegment_stack: Vec::with_capacity(16),\n\t\t\t// extra_top_items: BTreeMap::new(),\n\t\t\textra_bottom_items: BTreeMap::new(),\n\n\t\t\tsegment_names: HashMap::new(),\n\t\t\tqcomponent_fn: options\n\t\t\t\t.global_collect\n\t\t\t\t.get_imported_local(&QCOMPONENT, &options.core_module),\n\t\t\tsync_qrl_fn: options\n\t\t\t\t.global_collect\n\t\t\t\t.get_imported_local(&Q_SYNC, &options.core_module),\n\t\t\tqsegment_fn: options\n\t\t\t\t.global_collect\n\t\t\t\t.get_imported_local(&QSEGMENT, &options.core_module),\n\t\t\tinlined_qrl_fn: options\n\t\t\t\t.global_collect\n\t\t\t\t.get_imported_local(&_INLINED_QRL, &options.core_module),\n\t\t\th_fn: options\n\t\t\t\t.global_collect\n\t\t\t\t.get_imported_local(&H, &options.core_module),\n\t\t\tfragment_fn: options\n\t\t\t\t.global_collect\n\t\t\t\t.get_imported_local(&FRAGMENT, &options.core_module),\n\t\t\tmarker_functions,\n\t\t\tjsx_functions,\n\t\t\timmutable_function_cmp,\n\t\t\troot_jsx_mode: true,\n\t\t\tjsx_mutable: false,\n\t\t\toptions,\n\t\t}\n\t}\n\n\tconst fn is_inline(&self) -> bool {\n\t\tmatches!(\n\t\t\tself.options.entry_strategy,\n\t\t\tEntryStrategy::Inline | EntryStrategy::Hoist\n\t\t)\n\t}\n\n\tfn get_dev_location(&self, span: Span) -> ast::ExprOrSpread {\n\t\tlet loc = self.options.cm.lookup_char_pos(span.lo);\n\t\tlet file_name = self\n\t\t\t.options\n\t\t\t.dev_path\n\t\t\t.map(|p| p.to_string())\n\t\t\t.unwrap_or_else(|| self.options.path_data.rel_path.to_slash_lossy().to_string());\n\t\tast::ExprOrSpread {\n\t\t\tspread: None,\n\t\t\texpr: Box::new(ast::Expr::Object(ast::ObjectLit {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\tprops: vec![\n\t\t\t\t\tast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\tkey: ast::PropName::Ident(quote_ident!(\"fileName\")),\n\t\t\t\t\t\tvalue: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t\tvalue: file_name.into(),\n\t\t\t\t\t\t}))),\n\t\t\t\t\t}))),\n\t\t\t\t\tast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\tkey: ast::PropName::Ident(quote_ident!(\"lineNumber\")),\n\t\t\t\t\t\tvalue: loc.line.into(),\n\t\t\t\t\t}))),\n\t\t\t\t\tast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\tkey: ast::PropName::Ident(quote_ident!(\"columnNumber\")),\n\t\t\t\t\t\tvalue: (loc.col.0 + 1).into(),\n\t\t\t\t\t}))),\n\t\t\t\t],\n\t\t\t})),\n\t\t}\n\t}\n\n\tfn register_context_name(\n\t\t&mut self,\n\t\tcustom_symbol: Option<JsWord>,\n\t) -> (JsWord, JsWord, JsWord, u64) {\n\t\tif let Some(custom_symbol) = custom_symbol {\n\t\t\treturn (\n\t\t\t\tcustom_symbol.clone(),\n\t\t\t\tcustom_symbol.clone(),\n\t\t\t\tcustom_symbol,\n\t\t\t\t0,\n\t\t\t);\n\t\t}\n\t\tlet mut display_name = self.stack_ctxt.join(\"_\");\n\t\tif self.stack_ctxt.is_empty() {\n\t\t\tdisplay_name += \"s_\";\n\t\t}\n\t\tdisplay_name = escape_sym(&display_name);\n\t\tlet first_char = display_name.chars().next();\n\t\tif first_char.is_some_and(|c| c.is_ascii_digit()) {\n\t\t\tdisplay_name = format!(\"_{}\", display_name);\n\t\t}\n\t\tlet index = match self.segment_names.get_mut(&display_name) {\n\t\t\tSome(count) => {\n\t\t\t\t*count += 1;\n\t\t\t\t*count\n\t\t\t}\n\t\t\tNone => 0,\n\t\t};\n\t\tif index == 0 {\n\t\t\tself.segment_names.insert(display_name.clone(), 0);\n\t\t} else {\n\t\t\twrite!(display_name, \"_{}\", index).unwrap();\n\t\t}\n\t\tlet mut hasher = DefaultHasher::new();\n\t\tlet local_file_name = self.options.path_data.rel_path.to_slash_lossy();\n\t\tif let Some(scope) = self.options.scope {\n\t\t\thasher.write(scope.as_bytes());\n\t\t}\n\t\thasher.write(local_file_name.as_bytes());\n\t\thasher.write(display_name.as_bytes());\n\t\tlet hash = hasher.finish();\n\t\tlet hash64 = base64(hash);\n\n\t\tlet symbol_name = if matches!(self.options.mode, EmitMode::Dev | EmitMode::Test) {\n\t\t\tformat!(\"{}_{}\", display_name, hash64)\n\t\t} else {\n\t\t\tformat!(\"s_{}\", hash64)\n\t\t};\n\t\tdisplay_name = format!(\"{}_{}\", &self.options.path_data.file_name, display_name);\n\t\t(\n\t\t\tJsWord::from(symbol_name),\n\t\t\tJsWord::from(display_name),\n\t\t\tJsWord::from(hash64),\n\t\t\thash,\n\t\t)\n\t}\n\n\t/** Parse inlinedQrl() (from library code) */\n\tfn handle_inlined_qsegment(&mut self, mut node: ast::CallExpr) -> ast::CallExpr {\n\t\tnode.args.reverse();\n\n\t\tlet last_stack = self\n\t\t\t.stack_ctxt\n\t\t\t.last()\n\t\t\t.map_or_else(|| QSEGMENT.clone(), |last| JsWord::from(last.as_str()));\n\n\t\tlet ctx_name = if last_stack.ends_with(\"Qrl\") {\n\t\t\tJsWord::from(format!(\"{}$\", last_stack.trim_end_matches(\"Qrl\")))\n\t\t} else {\n\t\t\tlast_stack\n\t\t};\n\t\tlet ctx_kind = if ctx_name.starts_with(\"on\") {\n\t\t\tSegmentKind::JSXProp\n\t\t} else {\n\t\t\tSegmentKind::Function\n\t\t};\n\t\tlet first_arg = node\n\t\t\t.args\n\t\t\t.pop()\n\t\t\t.expect(\"inlinedQrl() should always have the first argument\");\n\n\t\tlet second_arg = node\n\t\t\t.args\n\t\t\t.pop()\n\t\t\t.expect(\"inlinedQrl() should always have the second argument\");\n\n\t\tlet third_arg = node.args.pop();\n\t\tlet span = first_arg.span();\n\n\t\tlet (symbol_name, display_name, hash) = {\n\t\t\tlet symbol_name = match *second_arg.expr {\n\t\t\t\tast::Expr::Lit(ast::Lit::Str(string)) => string.value,\n\t\t\t\t_ => panic!(\"dfd\"),\n\t\t\t};\n\t\t\tparse_symbol_name(\n\t\t\t\tsymbol_name,\n\t\t\t\tmatches!(self.options.mode, EmitMode::Dev | EmitMode::Test),\n\t\t\t\t&self.options.path_data.file_name,\n\t\t\t)\n\t\t};\n\n\t\tself.segment_stack.push(symbol_name.clone());\n\t\tlet folded = *first_arg.expr.fold_with(self);\n\t\tself.segment_stack.pop();\n\n\t\tlet scoped_idents = {\n\t\t\tthird_arg.map_or_else(Vec::new, |scoped| {\n\t\t\t\tlet list: Vec<Id> = match &*scoped.expr {\n\t\t\t\t\tast::Expr::Array(array) => array\n\t\t\t\t\t\t.elems\n\t\t\t\t\t\t.iter()\n\t\t\t\t\t\t.flat_map(|item| match &*item.as_ref().unwrap().expr {\n\t\t\t\t\t\t\tast::Expr::Ident(ident) => Some(id!(ident)),\n\t\t\t\t\t\t\t_ => None,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.collect(),\n\t\t\t\t\t_ => vec![],\n\t\t\t\t};\n\t\t\t\tlist\n\t\t\t})\n\t\t};\n\t\tlet local_idents = self.get_local_idents(&folded);\n\t\tlet segment_data = SegmentData {\n\t\t\textension: self.options.extension.clone(),\n\t\t\tlocal_idents,\n\t\t\tscoped_idents,\n\t\t\tparent_segment: self.segment_stack.last().cloned(),\n\t\t\tctx_kind,\n\t\t\tctx_name,\n\t\t\torigin: self.options.path_data.rel_path.to_slash_lossy().into(),\n\t\t\tpath: self.options.path_data.rel_dir.to_slash_lossy().into(),\n\t\t\tdisplay_name,\n\t\t\tneed_transform: false,\n\t\t\thash,\n\t\t};\n\t\tlet should_emit = self.should_emit_segment(&segment_data);\n\t\tif should_emit {\n\t\t\tfor id in &segment_data.local_idents {\n\t\t\t\tif !self.options.global_collect.exports.contains_key(id)\n\t\t\t\t\t&& self.options.global_collect.root.contains_key(id)\n\t\t\t\t{\n\t\t\t\t\tself.ensure_export(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !should_emit {\n\t\t\tself.create_noop_qrl(&symbol_name, segment_data)\n\t\t} else if self.is_inline() {\n\t\t\tlet folded = if self.should_reg_segment(&segment_data.ctx_name) {\n\t\t\t\tast::Expr::Call(self.create_internal_call(\n\t\t\t\t\t&_REG_SYMBOL,\n\t\t\t\t\tvec![\n\t\t\t\t\t\tfolded,\n\t\t\t\t\t\tast::Expr::Lit(ast::Lit::Str(ast::Str::from(segment_data.hash.clone()))),\n\t\t\t\t\t],\n\t\t\t\t\ttrue,\n\t\t\t\t))\n\t\t\t} else {\n\t\t\t\tfolded\n\t\t\t};\n\t\t\tself.create_inline_qrl(segment_data, folded, symbol_name, span)\n\t\t} else {\n\t\t\tself.create_segment(segment_data, folded, symbol_name, span, 0)\n\t\t}\n\t}\n\n\tfn handle_qsegment(&mut self, node: ast::CallExpr) -> ast::CallExpr {\n\t\tlet mut node = node;\n\t\tnode.args.reverse();\n\n\t\tif let Some(ast::ExprOrSpread {\n\t\t\texpr: first_arg, ..\n\t\t}) = node.args.pop()\n\t\t{\n\t\t\tlet custom_symbol = if let Some(ast::ExprOrSpread {\n\t\t\t\texpr: second_arg, ..\n\t\t\t}) = node.args.pop()\n\t\t\t{\n\t\t\t\tif let ast::Expr::Lit(ast::Lit::Str(second_arg)) = *second_arg {\n\t\t\t\t\tSome(second_arg.value)\n\t\t\t\t} else {\n\t\t\t\t\tNone\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tNone\n\t\t\t};\n\n\t\t\tself.create_synthetic_qsegment(\n\t\t\t\t*first_arg,\n\t\t\t\tSegmentKind::Function,\n\t\t\t\tQSEGMENT.clone(),\n\t\t\t\tcustom_symbol,\n\t\t\t)\n\t\t} else {\n\t\t\tnode\n\t\t}\n\t}\n\n\tfn handle_sync_qrl(&mut self, mut node: ast::CallExpr) -> ast::CallExpr {\n\t\tif let Some(ast::ExprOrSpread {\n\t\t\texpr: first_arg, ..\n\t\t}) = node.args.pop()\n\t\t{\n\t\t\tmatch *first_arg {\n\t\t\t\tast::Expr::Arrow(..) | ast::Expr::Fn(..) => {\n\t\t\t\t\tlet serialize = render_expr(first_arg.as_ref());\n\t\t\t\t\tlet new_callee = self.ensure_core_import(&_QRL_SYNC);\n\t\t\t\t\tast::CallExpr {\n\t\t\t\t\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(\n\t\t\t\t\t\t\t&new_callee,\n\t\t\t\t\t\t)))),\n\t\t\t\t\t\targs: vec![\n\t\t\t\t\t\t\tast::ExprOrSpread {\n\t\t\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\t\t\texpr: first_arg,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t// string serialized version of first argument\n\t\t\t\t\t\t\tast::ExprOrSpread {\n\t\t\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\t\t\texpr: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\tvalue: serialize.into(),\n\t\t\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t\t\t}))),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_ => node,\n\t\t\t}\n\t\t} else {\n\t\t\tnode\n\t\t}\n\t}\n\n\t/** Converts inline expressions into QRLs. Returns (expr?, true) if succeeded. */\n\tfn create_synthetic_qqsegment(\n\t\t&mut self,\n\t\tfirst_arg: ast::Expr,\n\t\taccept_call_expr: bool,\n\t) -> (Option<ast::Expr>, bool) {\n\t\t// Collect descendent idents\n\t\tlet descendent_idents = {\n\t\t\tlet mut collector = IdentCollector::new();\n\t\t\tfirst_arg.visit_with(&mut collector);\n\t\t\tcollector.get_words()\n\t\t};\n\n\t\tlet (decl_collect, invalid_decl): (_, Vec<_>) = self\n\t\t\t.decl_stack\n\t\t\t.iter()\n\t\t\t.flat_map(|v| v.iter())\n\t\t\t.cloned()\n\t\t\t.partition(|(_, t)| matches!(t, IdentType::Var(true)));\n\n\t\tlet folded = first_arg;\n\n\t\tlet mut set: HashSet<Id> = HashSet::new();\n\t\tlet mut contains_side_effect = false;\n\t\tfor ident in &descendent_idents {\n\t\t\tif self.options.global_collect.is_global(ident) {\n\t\t\t\tcontains_side_effect = true;\n\t\t\t} else if invalid_decl.iter().any(|entry| entry.0 == *ident) {\n\t\t\t\treturn (None, false);\n\t\t\t} else if decl_collect.iter().any(|entry| entry.0 == *ident) {\n\t\t\t\tset.insert(ident.clone());\n\t\t\t} else if ident.0.starts_with('$') {\n\t\t\t\t// TODO: remove, this is a workaround for $localize to work\n\t\t\t\treturn (None, false);\n\t\t\t}\n\t\t}\n\t\tlet mut scoped_idents: Vec<Id> = set.into_iter().collect();\n\n\t\tif contains_side_effect {\n\t\t\treturn (None, scoped_idents.is_empty());\n\t\t}\n\t\tscoped_idents.sort();\n\n\t\tlet serialize_fn = self.options.is_server;\n\t\tlet (scoped_idents, _) = compute_scoped_idents(&descendent_idents, &decl_collect);\n\t\tlet inlined_fn = self.ensure_core_import(&_INLINED_FN);\n\t\tconvert_inlined_fn(\n\t\t\tfolded,\n\t\t\tscoped_idents,\n\t\t\t&inlined_fn,\n\t\t\taccept_call_expr,\n\t\t\tserialize_fn,\n\t\t)\n\t}\n\n\tfn create_synthetic_qsegment(\n\t\t&mut self,\n\t\tfirst_arg: ast::Expr,\n\t\tctx_kind: SegmentKind,\n\t\tctx_name: JsWord,\n\t\tcustom_symbol: Option<JsWord>,\n\t) -> ast::CallExpr {\n\t\tself._create_synthetic_qsegment(first_arg, ctx_kind, ctx_name, custom_symbol)\n\t\t\t.0\n\t}\n\n\tfn _create_synthetic_qsegment(\n\t\t&mut self,\n\t\tfirst_arg: ast::Expr,\n\t\tctx_kind: SegmentKind,\n\t\tctx_name: JsWord,\n\t\tcustom_symbol: Option<JsWord>,\n\t) -> (ast::CallExpr, bool) {\n\t\tlet can_capture = can_capture_scope(&first_arg);\n\t\tlet first_arg_span = first_arg.span();\n\n\t\tlet (symbol_name, display_name, hash, segment_hash) =\n\t\t\tself.register_context_name(custom_symbol);\n\n\t\t// Collect descendent idents\n\t\tlet descendent_idents = {\n\t\t\tlet mut collector = IdentCollector::new();\n\t\t\tfirst_arg.visit_with(&mut collector);\n\t\t\tcollector.get_words()\n\t\t};\n\n\t\tlet (decl_collect, invalid_decl): (_, Vec<_>) = self\n\t\t\t.decl_stack\n\t\t\t.iter()\n\t\t\t.flat_map(|v| v.iter())\n\t\t\t.cloned()\n\t\t\t.partition(|(_, t)| matches!(t, IdentType::Var(_)));\n\n\t\tself.segment_stack.push(symbol_name.clone());\n\t\tlet span = first_arg.span();\n\t\tlet folded = first_arg.fold_with(self);\n\t\tself.segment_stack.pop();\n\n\t\t// Collect local idents\n\t\tlet local_idents = self.get_local_idents(&folded);\n\n\t\tlet (mut scoped_idents, immutable) =\n\t\t\tcompute_scoped_idents(&descendent_idents, &decl_collect);\n\t\tif !can_capture && !scoped_idents.is_empty() {\n\t\t\tHANDLER.with(|handler| {\n\t\t\t\tlet ids: Vec<_> = scoped_idents.iter().map(|id| id.0.as_ref()).collect();\n\t\t\t\thandler\n\t\t\t\t\t.struct_span_err_with_code(\n\t\t\t\t\t\tfirst_arg_span,\n\t\t\t\t\t\t&format!(\"Qrl($) scope is not a function, but it's capturing local identifiers: {}\", ids.join(\", \")),\n\t\t\t\t\t\terrors::get_diagnostic_id(errors::Error::CanNotCapture),\n\t\t\t\t\t)\n\t\t\t\t\t.emit();\n\t\t\t});\n\t\t\tscoped_idents = vec![];\n\t\t}\n\t\tlet segment_data = SegmentData {\n\t\t\textension: self.options.extension.clone(),\n\t\t\tlocal_idents,\n\t\t\tscoped_idents,\n\t\t\tparent_segment: self.segment_stack.last().cloned(),\n\t\t\tctx_kind,\n\t\t\tctx_name,\n\t\t\torigin: self.options.path_data.rel_path.to_slash_lossy().into(),\n\t\t\tpath: self.options.path_data.rel_dir.to_slash_lossy().into(),\n\t\t\tdisplay_name,\n\t\t\tneed_transform: true,\n\t\t\thash,\n\t\t};\n\t\tlet should_emit = self.should_emit_segment(&segment_data);\n\t\tif should_emit {\n\t\t\tfor id in &segment_data.local_idents {\n\t\t\t\tif !self.options.global_collect.exports.contains_key(id) {\n\t\t\t\t\tif self.options.global_collect.root.contains_key(id) {\n\t\t\t\t\t\tself.ensure_export(id);\n\t\t\t\t\t}\n\t\t\t\t\tif invalid_decl.iter().any(|entry| entry.0 == *id) {\n\t\t\t\t\t\tHANDLER.with(|handler| {\n\t\t\t\t\t\t\thandler\n\t\t\t\t\t\t\t\t.struct_err_with_code(\n\t\t\t\t\t\t\t\t\t&format!(\n\t\t\t\t\t\t\t\t\t\t\"Reference to identifier '{}' can not be used inside a Qrl($) scope because it's a function\",\n\t\t\t\t\t\t\t\t\t\tid.0\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\terrors::get_diagnostic_id(errors::Error::FunctionReference),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.emit();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !should_emit {\n\t\t\t(self.create_noop_qrl(&symbol_name, segment_data), immutable)\n\t\t} else if self.is_inline() {\n\t\t\tlet folded = if !segment_data.scoped_idents.is_empty() {\n\t\t\t\tlet new_local = self.ensure_core_import(&USE_LEXICAL_SCOPE);\n\t\t\t\ttransform_function_expr(folded, &new_local, &segment_data.scoped_idents)\n\t\t\t} else {\n\t\t\t\tfolded\n\t\t\t};\n\t\t\tlet folded = if self.should_reg_segment(&segment_data.ctx_name) {\n\t\t\t\tast::Expr::Call(self.create_internal_call(\n\t\t\t\t\t&_REG_SYMBOL,\n\t\t\t\t\tvec![\n\t\t\t\t\t\tfolded,\n\t\t\t\t\t\tast::Expr::Lit(ast::Lit::Str(ast::Str::from(segment_data.hash.clone()))),\n\t\t\t\t\t],\n\t\t\t\t\ttrue,\n\t\t\t\t))\n\t\t\t} else {\n\t\t\t\tfolded\n\t\t\t};\n\t\t\t(\n\t\t\t\tself.create_inline_qrl(segment_data, folded, symbol_name, span),\n\t\t\t\timmutable,\n\t\t\t)\n\t\t} else {\n\t\t\t(\n\t\t\t\tself.create_segment(segment_data, folded, symbol_name, span, segment_hash),\n\t\t\t\timmutable,\n\t\t\t)\n\t\t}\n\t}\n\n\tfn get_local_idents(&self, expr: &ast::Expr) -> Vec<Id> {\n\t\tlet mut collector = IdentCollector::new();\n\t\texpr.visit_with(&mut collector);\n\n\t\tlet use_h = collector.use_h;\n\t\tlet use_fragment = collector.use_fragment;\n\n\t\tlet mut idents = collector.get_words();\n\t\tif use_h {\n\t\t\tif let Some(id) = &self.h_fn {\n\t\t\t\tidents.push(id.clone());\n\t\t\t}\n\t\t}\n\t\tif use_fragment {\n\t\t\tif let Some(id) = &self.fragment_fn {\n\t\t\t\tidents.push(id.clone());\n\t\t\t}\n\t\t}\n\t\tidents\n\t}\n\n\t/// Removes `expr` from the AST and moves it to a separate import.\n\t/// These import are then grouped into entry files depending on strategy, which is used to\n\t/// determine the chunks for bundling.\n\tfn create_segment(\n\t\t&mut self,\n\t\tsegment_data: SegmentData,\n\t\texpr: ast::Expr,\n\t\tsymbol_name: JsWord,\n\t\tspan: Span,\n\t\tsegment_hash: u64,\n\t) -> ast::CallExpr {\n\t\tlet canonical_filename = get_canonical_filename(&segment_data.display_name, &symbol_name);\n\n\t\t// We import from the segment file directly but store the entry for later chunking by the bundler\n\t\tlet entry = self\n\t\t\t.options\n\t\t\t.entry_policy\n\t\t\t.get_entry_for_sym(&self.stack_ctxt, &segment_data);\n\n\t\tlet mut import_path = [\"./\", &canonical_filename].concat();\n\t\tif self.options.explicit_extensions {\n\t\t\timport_path.push('.');\n\t\t\timport_path.push_str(&self.options.extension);\n\t\t}\n\t\tlet import_expr = self.create_qrl(import_path.into(), &symbol_name, &segment_data, &span);\n\t\tself.segments.push(Segment {\n\t\t\tentry,\n\t\t\tspan,\n\t\t\tcanonical_filename,\n\t\t\tname: symbol_name,\n\t\t\tdata: segment_data,\n\t\t\texpr: Box::new(expr),\n\t\t\thash: segment_hash,\n\t\t});\n\t\timport_expr\n\t}\n\n\t// transforms `jsx(type, props, key)` into the internal versions\n\t// the jsx transform already converted `<div>` into `jsx('div', {}, key)`\n\tfn handle_jsx(&mut self, mut node: ast::CallExpr) -> ast::CallExpr {\n\t\t// if the props aren't an object literal, leave unchanged\n\t\tmatch &*node.args[1].expr {\n\t\t\tast::Expr::Object(_) => {}\n\t\t\t_ => return node,\n\t\t}\n\t\tlet node_type = node.args.remove(0);\n\t\tlet node_props = node.args.remove(0);\n\t\tlet (name_token, is_fn, is_text_only) = match &*node_type.expr {\n\t\t\tast::Expr::Lit(ast::Lit::Str(str)) => {\n\t\t\t\tself.stack_ctxt.push(str.value.to_string());\n\t\t\t\t(true, false, is_text_only(&str.value))\n\t\t\t}\n\t\t\tast::Expr::Ident(ident) => {\n\t\t\t\tself.stack_ctxt.push(ident.sym.to_string());\n\t\t\t\tif !self.immutable_function_cmp.contains(&id!(ident)) {\n\t\t\t\t\tself.jsx_mutable = true;\n\t\t\t\t}\n\t\t\t\t(true, true, false)\n\t\t\t}\n\t\t\t_ => {\n\t\t\t\tself.jsx_mutable = true;\n\t\t\t\t(false, true, false)\n\t\t\t}\n\t\t};\n\t\tlet should_emit_key = is_fn || self.root_jsx_mode;\n\t\tself.root_jsx_mode = false;\n\n\t\tlet (dynamic_props, mutable_props, immutable_props, children, flags) =\n\t\t\tself.handle_jsx_props_obj(node_props, is_fn, is_text_only);\n\n\t\tlet key = if node.args.len() == 1 {\n\t\t\tnode.args.remove(0)\n\t\t} else if should_emit_key {\n\t\t\tlet new_key = format!(\"{}_{}\", &base64(self.file_hash)[0..2], self.jsx_key_counter);\n\t\t\tself.jsx_key_counter += 1;\n\t\t\tast::ExprOrSpread {\n\t\t\t\tspread: None,\n\t\t\t\texpr: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: new_key.into(),\n\t\t\t\t\traw: None,\n\t\t\t\t}))),\n\t\t\t}\n\t\t} else {\n\t\t\tget_null_arg()\n\t\t};\n\n\t\tlet (jsx_func, mut args) = if is_fn {\n\t\t\t(\n\t\t\t\tself.ensure_core_import(&_JSX_C),\n\t\t\t\tvec![node_type, mutable_props, flags, key],\n\t\t\t)\n\t\t} else if dynamic_props {\n\t\t\t(\n\t\t\t\tself.ensure_core_import(&_JSX_S),\n\t\t\t\tvec![node_type, mutable_props, immutable_props, flags, key],\n\t\t\t)\n\t\t} else {\n\t\t\t(\n\t\t\t\tself.ensure_core_import(&_JSX_Q),\n\t\t\t\tvec![\n\t\t\t\t\tnode_type,\n\t\t\t\t\tmutable_props,\n\t\t\t\t\timmutable_props,\n\t\t\t\t\tchildren,\n\t\t\t\t\tflags,\n\t\t\t\t\tkey,\n\t\t\t\t],\n\t\t\t)\n\t\t};\n\t\tif self.options.mode == EmitMode::Dev {\n\t\t\targs.push(self.get_dev_location(node.span));\n\t\t}\n\n\t\tif name_token {\n\t\t\tself.stack_ctxt.pop();\n\t\t}\n\t\tast::CallExpr {\n\t\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(&jsx_func)))),\n\t\t\targs,\n\t\t\t..node\n\t\t}\n\t}\n\n\tfn handle_jsx_value(\n\t\t&mut self,\n\t\tctx_name: JsWord,\n\t\tvalue: Option<ast::JSXAttrValue>,\n\t) -> Option<ast::JSXAttrValue> {\n\t\tif let Some(ast::JSXAttrValue::JSXExprContainer(container)) = value {\n\t\t\tif let ast::JSXExpr::Expr(expr) = container.expr {\n\t\t\t\tlet is_fn = matches!(*expr, ast::Expr::Arrow(_) | ast::Expr::Fn(_));\n\t\t\t\tif is_fn {\n\t\t\t\t\tSome(ast::JSXAttrValue::JSXExprContainer(ast::JSXExprContainer {\n\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\texpr: ast::JSXExpr::Expr(Box::new(ast::Expr::Call(\n\t\t\t\t\t\t\tself.create_synthetic_qsegment(\n\t\t\t\t\t\t\t\t*expr,\n\t\t\t\t\t\t\t\tSegmentKind::JSXProp,\n\t\t\t\t\t\t\t\tctx_name,\n\t\t\t\t\t\t\t\tNone,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t))),\n\t\t\t\t\t}))\n\t\t\t\t} else {\n\t\t\t\t\tSome(ast::JSXAttrValue::JSXExprContainer(ast::JSXExprContainer {\n\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\texpr: ast::JSXExpr::Expr(expr),\n\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSome(ast::JSXAttrValue::JSXExprContainer(container))\n\t\t\t}\n\t\t} else {\n\t\t\tvalue\n\t\t}\n\t}\n\n\tpub fn ensure_import(&mut self, new_specifier: &JsWord, source: &JsWord) -> Id {\n\t\tself.options.global_collect.import(new_specifier, source)\n\t}\n\n\tpub fn ensure_core_import(&mut self, new_specifier: &JsWord) -> Id {\n\t\tself.options\n\t\t\t.global_collect\n\t\t\t.import(new_specifier, &self.options.core_module)\n\t}\n\n\tfn ensure_export(&mut self, id: &Id) {\n\t\tlet exported_name: Option<JsWord> = Some(format!(\"_auto_{}\", id.0).into());\n\t\tif self\n\t\t\t.options\n\t\t\t.global_collect\n\t\t\t.add_export(id.clone(), exported_name.clone())\n\t\t{\n\t\t\tself.extra_bottom_items\n\t\t\t\t.insert(id.clone(), create_synthetic_named_export(id, exported_name));\n\t\t}\n\t}\n\n\tfn create_qrl(\n\t\t&mut self,\n\t\tpath: JsWord,\n\t\tsymbol: &str,\n\t\tsegment_data: &SegmentData,\n\t\tspan: &Span,\n\t) -> ast::CallExpr {\n\t\tlet mut args = vec![\n\t\t\tast::Expr::Arrow(ast::ArrowExpr {\n\t\t\t\tbody: Box::new(ast::BlockStmtOrExpr::Expr(Box::new(ast::Expr::Call(\n\t\t\t\t\tast::CallExpr {\n\t\t\t\t\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(ast::Ident::new(\n\t\t\t\t\t\t\tjs_word!(\"import\"),\n\t\t\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\t\t\tDefault::default(),\n\t\t\t\t\t\t)))),\n\t\t\t\t\t\targs: vec![ast::ExprOrSpread {\n\t\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\t\texpr: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\tvalue: path,\n\t\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t\t}))),\n\t\t\t\t\t\t}],\n\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t},\n\t\t\t\t)))),\n\t\t\t\t..Default::default()\n\t\t\t}),\n\t\t\tast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\tvalue: symbol.into(),\n\t\t\t\traw: None,\n\t\t\t})),\n\t\t];\n\t\tlet fn_callee = if self.options.mode == EmitMode::Dev {\n\t\t\targs.push(get_qrl_dev_obj(\n\t\t\t\tJsWord::from(\n\t\t\t\t\tself.options\n\t\t\t\t\t\t.dev_path\n\t\t\t\t\t\t.unwrap_or(&self.options.path_data.abs_path.to_slash_lossy()),\n\t\t\t\t),\n\t\t\t\tsegment_data,\n\t\t\t\tspan,\n\t\t\t));\n\t\t\t_QRL_DEV.clone()\n\t\t} else {\n\t\t\t_QRL.clone()\n\t\t};\n\n\t\t// Injects state\n\t\tif !segment_data.scoped_idents.is_empty() {\n\t\t\targs.push(ast::Expr::Array(ast::ArrayLit {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\telems: segment_data\n\t\t\t\t\t.scoped_idents\n\t\t\t\t\t.iter()\n\t\t\t\t\t.map(|id| {\n\t\t\t\t\t\tSome(ast::ExprOrSpread {\n\t\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\t\texpr: Box::new(ast::Expr::Ident(new_ident_from_id(id))),\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t\t.collect(),\n\t\t\t}))\n\t\t}\n\n\t\tself.create_internal_call(&fn_callee, args, true)\n\t}\n\n\tfn create_inline_qrl(\n\t\t&mut self,\n\t\tsegment_data: SegmentData,\n\t\texpr: ast::Expr,\n\t\tsymbol_name: JsWord,\n\t\tspan: Span,\n\t) -> ast::CallExpr {\n\t\tlet should_inline = matches!(self.options.entry_strategy, EntryStrategy::Inline)\n\t\t\t|| matches!(expr, ast::Expr::Ident(_));\n\t\tlet inlined_expr = if should_inline {\n\t\t\texpr\n\t\t} else {\n\t\t\tlet new_ident = private_ident!(symbol_name.clone());\n\t\t\tself.segments.push(Segment {\n\t\t\t\tentry: None,\n\t\t\t\tspan,\n\t\t\t\tcanonical_filename: get_canonical_filename(\n\t\t\t\t\t&segment_data.display_name,\n\t\t\t\t\t&symbol_name,\n\t\t\t\t),\n\t\t\t\tname: symbol_name.clone(),\n\t\t\t\tdata: segment_data.clone(),\n\t\t\t\texpr: Box::new(expr),\n\t\t\t\thash: new_ident.ctxt.as_u32() as u64,\n\t\t\t});\n\t\t\tast::Expr::Ident(new_ident)\n\t\t};\n\n\t\tlet mut args = vec![\n\t\t\tinlined_expr,\n\t\t\tast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\tvalue: symbol_name,\n\t\t\t\traw: None,\n\t\t\t})),\n\t\t];\n\n\t\tlet fn_callee = if self.options.mode == EmitMode::Dev {\n\t\t\targs.push(get_qrl_dev_obj(\n\t\t\t\tJsWord::from(\n\t\t\t\t\tself.options\n\t\t\t\t\t\t.dev_path\n\t\t\t\t\t\t.unwrap_or(&self.options.path_data.abs_path.to_slash_lossy()),\n\t\t\t\t),\n\t\t\t\t&segment_data,\n\t\t\t\t&span,\n\t\t\t));\n\t\t\t_INLINED_QRL_DEV.clone()\n\t\t} else {\n\t\t\t_INLINED_QRL.clone()\n\t\t};\n\n\t\t// Injects state\n\t\tif !segment_data.scoped_idents.is_empty() {\n\t\t\targs.push(ast::Expr::Array(ast::ArrayLit {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\telems: segment_data\n\t\t\t\t\t.scoped_idents\n\t\t\t\t\t.iter()\n\t\t\t\t\t.map(|id| {\n\t\t\t\t\t\tSome(ast::ExprOrSpread {\n\t\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\t\texpr: Box::new(ast::Expr::Ident(new_ident_from_id(id))),\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t\t.collect(),\n\t\t\t}))\n\t\t}\n\n\t\tself.create_internal_call(&fn_callee, args, true)\n\t}\n\n\tpub fn create_internal_call(\n\t\t&mut self,\n\t\tfn_name: &JsWord,\n\t\texprs: Vec<ast::Expr>,\n\t\tpure: bool,\n\t) -> ast::CallExpr {\n\t\tlet local = self.ensure_core_import(fn_name);\n\t\tlet span = if pure {\n\t\t\tif let Some(comments) = self.options.comments {\n\t\t\t\tlet span = Span::dummy_with_cmt();\n\t\t\t\tcomments.add_pure_comment(span.lo);\n\t\t\t\tspan\n\t\t\t} else {\n\t\t\t\tDUMMY_SP\n\t\t\t}\n\t\t} else {\n\t\t\tDUMMY_SP\n\t\t};\n\t\tast::CallExpr {\n\t\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(&local)))),\n\t\t\tspan,\n\t\t\targs: exprs\n\t\t\t\t.into_iter()\n\t\t\t\t.map(|expr| ast::ExprOrSpread {\n\t\t\t\t\tspread: None,\n\t\t\t\t\texpr: Box::new(expr),\n\t\t\t\t})\n\t\t\t\t.collect(),\n\t\t\t..Default::default()\n\t\t}\n\t}\n\n\t/// This transforms the props of a `jsx(type, {...props}, key)` call\n\tfn handle_jsx_props_obj(\n\t\t&mut self,\n\t\texpr: ast::ExprOrSpread,\n\t\tis_fn: bool,\n\t\tis_text_only: bool,\n\t) -> (\n\t\tbool,\n\t\tast::ExprOrSpread,\n\t\tast::ExprOrSpread,\n\t\tast::ExprOrSpread,\n\t\tast::ExprOrSpread,\n\t) {\n\t\tlet (dynamic_props, mut mutable_props, mut immutable_props, children, flags) =\n\t\t\tself.internal_handle_jsx_props_obj(expr, is_fn, is_text_only);\n\n\t\t// For functions, put the immutable props under the \"_IMMUTABLE\" prop\n\t\tif is_fn && !immutable_props.is_empty() {\n\t\t\tmutable_props.push(ast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(\n\t\t\t\tast::KeyValueProp {\n\t\t\t\t\tkey: ast::PropName::Computed(ast::ComputedPropName {\n\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\texpr: Box::new(ast::Expr::Ident(new_ident_from_id(\n\t\t\t\t\t\t\t&self.ensure_core_import(&_IMMUTABLE),\n\t\t\t\t\t\t))),\n\t\t\t\t\t}),\n\t\t\t\t\tvalue: Box::new(ast::Expr::Object(ast::ObjectLit {\n\t\t\t\t\t\tprops: std::mem::take(&mut immutable_props),\n\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t})),\n\t\t\t\t},\n\t\t\t))))\n\t\t}\n\n\t\tlet mutable = if mutable_props.is_empty() {\n\t\t\tget_null_arg()\n\t\t} else {\n\t\t\tself.jsx_mutable = true;\n\t\t\tast::ExprOrSpread {\n\t\t\t\tspread: None,\n\t\t\t\texpr: Box::new(ast::Expr::Object(ast::ObjectLit {\n\t\t\t\t\tprops: mutable_props,\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t})),\n\t\t\t}\n\t\t};\n\t\tlet immutable_props = if immutable_props.is_empty() {\n\t\t\tget_null_arg()\n\t\t} else {\n\t\t\tast::ExprOrSpread {\n\t\t\t\tspread: None,\n\t\t\t\texpr: Box::new(ast::Expr::Object(ast::ObjectLit {\n\t\t\t\t\tprops: immutable_props,\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t})),\n\t\t\t}\n\t\t};\n\n\t\tlet children = if let Some(children) = children {\n\t\t\tast::ExprOrSpread {\n\t\t\t\tspread: None,\n\t\t\t\texpr: children,\n\t\t\t}\n\t\t} else {\n\t\t\tget_null_arg()\n\t\t};\n\n\t\tlet flags = ast::ExprOrSpread {\n\t\t\tspread: None,\n\t\t\texpr: Box::new(ast::Expr::Lit(ast::Lit::Num(ast::Number {\n\t\t\t\tvalue: flags as f64,\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\traw: None,\n\t\t\t}))),\n\t\t};\n\t\t(dynamic_props, mutable, immutable_props, children, flags)\n\t}\n\n\t#[allow(clippy::cognitive_complexity)]\n\tfn internal_handle_jsx_props_obj(\n\t\t&mut self,\n\t\texpr: ast::ExprOrSpread,\n\t\tis_fn: bool,\n\t\tis_text_only: bool,\n\t) -> (\n\t\tbool,\n\t\tVec<ast::PropOrSpread>,\n\t\tVec<ast::PropOrSpread>,\n\t\tOption<Box<ast::Expr>>,\n\t\tu32,\n\t) {\n\t\tmatch expr {\n\t\t\tast::ExprOrSpread {\n\t\t\t\texpr: box ast::Expr::Object(object),\n\t\t\t\t..\n\t\t\t} => {\n\t\t\t\tlet mut mutable_props = vec![];\n\t\t\t\tlet mut immutable_props = vec![];\n\t\t\t\tlet mut children = None;\n\t\t\t\tlet mut static_listeners = true;\n\t\t\t\tlet mut static_subtree = true;\n\t\t\t\tlet mut event_handlers = vec![];\n\t\t\t\tlet immutable_idents: Vec<_> = self\n\t\t\t\t\t.decl_stack\n\t\t\t\t\t.iter()\n\t\t\t\t\t.flat_map(|v| v.iter())\n\t\t\t\t\t.filter(|(_, t)| matches!(t, IdentType::Var(true)))\n\t\t\t\t\t.cloned()\n\t\t\t\t\t.collect();\n\n\t\t\t\tlet dynamic_props = object\n\t\t\t\t\t.props\n\t\t\t\t\t.iter()\n\t\t\t\t\t.any(|prop| !matches!(prop, ast::PropOrSpread::Prop(_)));\n\n\t\t\t\tfor prop in object.props {\n\t\t\t\t\tlet mut name_token = false;\n\t\t\t\t\tmatch prop {\n\t\t\t\t\t\tast::PropOrSpread::Prop(box ast::Prop::KeyValue(ref node)) => {\n\t\t\t\t\t\t\tlet key_word = match node.key {\n\t\t\t\t\t\t\t\tast::PropName::Ident(ref ident) => Some(ident.sym.clone()),\n\t\t\t\t\t\t\t\tast::PropName::Str(ref s) => Some(s.value.clone()),\n\t\t\t\t\t\t\t\t_ => None,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif let Some(key_word) = key_word {\n\t\t\t\t\t\t\t\tlet is_children = key_word == *CHILDREN;\n\t\t\t\t\t\t\t\tif !is_children {\n\t\t\t\t\t\t\t\t\tself.stack_ctxt.push(key_word.to_string());\n\t\t\t\t\t\t\t\t\tname_token = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif is_children {\n\t\t\t\t\t\t\t\t\tlet prev = self.jsx_mutable;\n\t\t\t\t\t\t\t\t\tself.jsx_mutable = false;\n\t\t\t\t\t\t\t\t\tlet folded = node.value.clone();\n\t\t\t\t\t\t\t\t\tlet transformed_children = if let Some(new_children) =\n\t\t\t\t\t\t\t\t\t\tself.convert_children(&folded, &immutable_idents)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif is_text_only {\n\t\t\t\t\t\t\t\t\t\t\tself.jsx_mutable = true;\n\t\t\t\t\t\t\t\t\t\t\tfolded.fold_with(self)\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tBox::new(new_children.fold_with(self))\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfolded.fold_with(self)\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif self.jsx_mutable {\n\t\t\t\t\t\t\t\t\t\tstatic_subtree = false;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tself.jsx_mutable = prev;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif is_fn || dynamic_props {\n\t\t\t\t\t\t\t\t\t\t// self.jsx_mutable = true;\n\t\t\t\t\t\t\t\t\t\t// static_subtree = false;\n\t\t\t\t\t\t\t\t\t\tmutable_props.push(ast::PropOrSpread::Prop(Box::new(\n\t\t\t\t\t\t\t\t\t\t\tast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\t\tkey: node.key.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: transformed_children,\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tchildren = Some(transformed_children);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if !is_fn && key_word.starts_with(\"bind:\") {\n\t\t\t\t\t\t\t\t\tlet folded = node.value.clone().fold_with(self);\n\t\t\t\t\t\t\t\t\tlet prop_name: JsWord = key_word[5..].into();\n\t\t\t\t\t\t\t\t\timmutable_props.push(ast::PropOrSpread::Prop(Box::new(\n\t\t\t\t\t\t\t\t\t\tast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\tkey: ast::PropName::Str(ast::Str {\n\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: prop_name.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\tvalue: folded.clone(),\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t\t\tlet elm = private_ident!(\"elm\");\n\t\t\t\t\t\t\t\t\tlet arrow_fn = ast::Expr::Arrow(ast::ArrowExpr {\n\t\t\t\t\t\t\t\t\t\tparams: vec![\n\t\t\t\t\t\t\t\t\t\t\tast::Pat::Ident(ast::BindingIdent::from(\n\t\t\t\t\t\t\t\t\t\t\t\tast::Ident::new(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"_\".into(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\tSyntaxContext::empty(),\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\tast::Pat::Ident(ast::BindingIdent::from(elm.clone())),\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tbody: Box::new(ast::BlockStmtOrExpr::Expr(Box::new(\n\t\t\t\t\t\t\t\t\t\t\tast::Expr::Assign(ast::AssignExpr {\n\t\t\t\t\t\t\t\t\t\t\t\tleft: ast::AssignTarget::Simple(\n\t\t\t\t\t\t\t\t\t\t\t\t\tast::SimpleAssignTarget::Member(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::MemberExpr {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tobj: folded.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprop: ast::MemberProp::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::IdentName::new(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\".into(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\top: ast::AssignOp::Assign,\n\t\t\t\t\t\t\t\t\t\t\t\tright: Box::new(ast::Expr::Cond(ast::CondExpr {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttest: Box::new(ast::Expr::Bin(ast::BinExpr {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: Box::new(ast::Expr::Member(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::MemberExpr {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tobj: Box::new(ast::Expr::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telm.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprop: ast::MemberProp::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::IdentName::new(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\".into(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\top: ast::BinaryOp::EqEq,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tright: Box::new(ast::Expr::Lit(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::Lit::Str(ast::Str {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: \"number\".into(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcons: Box::new(ast::Expr::Member(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::MemberExpr {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tobj: Box::new(ast::Expr::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telm.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprop: ast::MemberProp::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::IdentName::new(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"valueAsNumber\".into(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\talt: Box::new(ast::Expr::Member(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::MemberExpr {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tobj: Box::new(ast::Expr::Ident(elm)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprop: ast::MemberProp::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::IdentName::new(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprop_name, DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t))),\n\t\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tlet event_handler = JsWord::from(match key_word.as_ref() {\n\t\t\t\t\t\t\t\t\t\t\"bind:value\" => \"onInput$\",\n\t\t\t\t\t\t\t\t\t\t\"bind:checked\" => \"onInput$\",\n\t\t\t\t\t\t\t\t\t\t_ => \"onChange$\",\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tlet (converted_expr, immutable) = self\n\t\t\t\t\t\t\t\t\t\t._create_synthetic_qsegment(\n\t\t\t\t\t\t\t\t\t\t\tarrow_fn,\n\t\t\t\t\t\t\t\t\t\t\tSegmentKind::EventHandler,\n\t\t\t\t\t\t\t\t\t\t\tevent_handler.clone(),\n\t\t\t\t\t\t\t\t\t\t\tNone,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tif !immutable {\n\t\t\t\t\t\t\t\t\t\tstatic_listeners = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlet converted_prop = ast::PropOrSpread::Prop(Box::new(\n\t\t\t\t\t\t\t\t\t\tast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\tvalue: Box::new(ast::Expr::Call(converted_expr)),\n\t\t\t\t\t\t\t\t\t\t\tkey: ast::PropName::Str(ast::Str {\n\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: event_handler,\n\t\t\t\t\t\t\t\t\t\t\t\traw: None,\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\tevent_handlers.push(converted_prop);\n\t\t\t\t\t\t\t\t} else if !is_fn && (key_word == *REF || key_word == *QSLOT) {\n\t\t\t\t\t\t\t\t\t// skip\n\t\t\t\t\t\t\t\t\tmutable_props.push(prop.fold_with(self));\n\t\t\t\t\t\t\t\t} else if convert_qrl_word(&key_word).is_some() {\n\t\t\t\t\t\t\t\t\tif matches!(*node.value, ast::Expr::Arrow(_) | ast::Expr::Fn(_))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlet (converted_expr, immutable) = self\n\t\t\t\t\t\t\t\t\t\t\t._create_synthetic_qsegment(\n\t\t\t\t\t\t\t\t\t\t\t\t*node.value.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\tif is_fn {\n\t\t\t\t\t\t\t\t\t\t\t\t\tSegmentKind::JSXProp\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tSegmentKind::EventHandler\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\tkey_word.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\tNone,\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tlet converted_prop = ast::PropOrSpread::Prop(Box::new(\n\t\t\t\t\t\t\t\t\t\t\tast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: Box::new(ast::Expr::Call(converted_expr)),\n\t\t\t\t\t\t\t\t\t\t\t\tkey: node.key.clone(),\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t\tif is_fn {\n\t\t\t\t\t\t\t\t\t\t\tif immutable {\n\t\t\t\t\t\t\t\t\t\t\t\timmutable_props.push(ast::PropOrSpread::Prop(\n\t\t\t\t\t\t\t\t\t\t\t\t\tBox::new(ast::Prop::KeyValue(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey: node.key.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: Box::new(ast::Expr::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew_ident_from_id(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&self.ensure_core_import(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&_IMMUTABLE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tmutable_props.push(converted_prop.fold_with(self));\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif !immutable {\n\t\t\t\t\t\t\t\t\t\t\t\tstatic_listeners = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tevent_handlers.push(converted_prop.fold_with(self));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlet immutable_prop = is_immutable_expr(\n\t\t\t\t\t\t\t\t\t\t\t&node.value,\n\t\t\t\t\t\t\t\t\t\t\t&self.options.global_collect,\n\t\t\t\t\t\t\t\t\t\t\tSome(&immutable_idents),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif !immutable_prop {\n\t\t\t\t\t\t\t\t\t\t\tstatic_listeners = false;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif is_fn {\n\t\t\t\t\t\t\t\t\t\t\tif immutable_prop {\n\t\t\t\t\t\t\t\t\t\t\t\timmutable_props.push(ast::PropOrSpread::Prop(\n\t\t\t\t\t\t\t\t\t\t\t\t\tBox::new(ast::Prop::KeyValue(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey: node.key.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: Box::new(ast::Expr::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew_ident_from_id(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&self.ensure_core_import(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&_IMMUTABLE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tmutable_props.push(prop.fold_with(self));\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tevent_handlers.push(prop.fold_with(self));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if is_immutable_expr(\n\t\t\t\t\t\t\t\t\t&node.value,\n\t\t\t\t\t\t\t\t\t&self.options.global_collect,\n\t\t\t\t\t\t\t\t\tSome(&immutable_idents),\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tif is_fn || dynamic_props {\n\t\t\t\t\t\t\t\t\t\timmutable_props.push(ast::PropOrSpread::Prop(Box::new(\n\t\t\t\t\t\t\t\t\t\t\tast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\t\tkey: node.key.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: Box::new(ast::Expr::Ident(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnew_ident_from_id(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&self.ensure_core_import(&_IMMUTABLE),\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t\t\t\tmutable_props.push(prop.fold_with(self));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\timmutable_props.push(prop.fold_with(self));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if let Some((getter, is_immutable)) =\n\t\t\t\t\t\t\t\t\tself.convert_to_getter(&node.value, is_fn)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlet key = node.key.clone();\n\t\t\t\t\t\t\t\t\tif is_fn || dynamic_props {\n\t\t\t\t\t\t\t\t\t\tmutable_props.push(ast::PropOrSpread::Prop(Box::new(\n\t\t\t\t\t\t\t\t\t\t\tast::Prop::Getter(ast::GetterProp {\n\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\ttype_ann: None,\n\t\t\t\t\t\t\t\t\t\t\t\tkey: key.clone(),\n\t\t\t\t\t\t\t\t\t\t\t\tbody: Some(ast::BlockStmt {\n\t\t\t\t\t\t\t\t\t\t\t\t\tstmts: vec![ast::Stmt::Return(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tast::ReturnStmt {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\targ: Some(node.value.clone()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t)],\n\t\t\t\t\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlet entry = ast::PropOrSpread::Prop(Box::new(\n\t\t\t\t\t\t\t\t\t\tast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\t\t\tvalue: Box::new(getter),\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\tif is_fn || is_immutable {\n\t\t\t\t\t\t\t\t\t\timmutable_props.push(entry);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tmutable_props.push(entry);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tmutable_props.push(prop.fold_with(self));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmutable_props.push(prop.fold_with(self));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprop => {\n\t\t\t\t\t\t\tstatic_listeners = false;\n\t\t\t\t\t\t\tstatic_subtree = false;\n\t\t\t\t\t\t\tmutable_props.push(prop.fold_with(self));\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tif name_token {\n\t\t\t\t\t\tself.stack_ctxt.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet mut flags = 0;\n\t\t\t\tif static_listeners {\n\t\t\t\t\tflags |= 1 << 0;\n\t\t\t\t\timmutable_props.extend(event_handlers);\n\t\t\t\t} else {\n\t\t\t\t\tmutable_props.extend(event_handlers);\n\t\t\t\t}\n\n\t\t\t\tif static_subtree {\n\t\t\t\t\tflags |= 1 << 1;\n\t\t\t\t}\n\t\t\t\t(\n\t\t\t\t\tdynamic_props,\n\t\t\t\t\tmutable_props,\n\t\t\t\t\timmutable_props,\n\t\t\t\t\tchildren,\n\t\t\t\t\tflags,\n\t\t\t\t)\n\t\t\t}\n\t\t\t_ => (true, vec![], vec![], None, 0),\n\t\t}\n\t}\n\n\tfn convert_children(\n\t\t&mut self,\n\t\texpr: &ast::Expr,\n\t\timmutable_idents: &Vec<IdPlusType>,\n\t) -> Option<ast::Expr> {\n\t\tmatch expr {\n\t\t\tast::Expr::Call(call_expr) => {\n\t\t\t\tmatch &call_expr.callee {\n\t\t\t\t\tast::Callee::Expr(box ast::Expr::Ident(ident)) => {\n\t\t\t\t\t\tif !self.jsx_functions.contains(&id!(ident)) {\n\t\t\t\t\t\t\tself.jsx_mutable = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t_ => {\n\t\t\t\t\t\tself.jsx_mutable = true;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tNone\n\t\t\t}\n\t\t\t// tagged template functions can also be mutable\n\t\t\tast::Expr::TaggedTpl(_) => {\n\t\t\t\t// We don't export template functions so no need to check\n\t\t\t\tself.jsx_mutable = true;\n\t\t\t\tNone\n\t\t\t}\n\t\t\tast::Expr::Array(array) => Some(ast::Expr::Array(ast::ArrayLit {\n\t\t\t\tspan: array.span,\n\t\t\t\telems: array\n\t\t\t\t\t.elems\n\t\t\t\t\t.iter()\n\t\t\t\t\t.map(|e| {\n\t\t\t\t\t\tif let Some(e) = e {\n\t\t\t\t\t\t\tif let Some(new) =\n\t\t\t\t\t\t\t\tself.convert_to_signal_item(&e.expr, immutable_idents)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSome(ast::ExprOrSpread {\n\t\t\t\t\t\t\t\t\tspread: e.spread,\n\t\t\t\t\t\t\t\t\texpr: Box::new(new),\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSome(e.clone())\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.collect(),\n\t\t\t})),\n\t\t\texpr => self.convert_to_signal_item(expr, immutable_idents),\n\t\t}\n\t}\n\n\t/* Convert an expression to a QRL or a getter. Returns (expr, isImmutable) */\n\tfn convert_to_getter(&mut self, expr: &ast::Expr, is_fn: bool) -> Option<(ast::Expr, bool)> {\n\t\tlet inlined = self.create_synthetic_qqsegment(expr.clone(), true);\n\t\tif let Some(expr) = inlined.0 {\n\t\t\treturn Some((expr, inlined.1));\n\t\t}\n\t\tif inlined.1 {\n\t\t\treturn if is_fn {\n\t\t\t\tSome((\n\t\t\t\t\tast::Expr::Ident(new_ident_from_id(&self.ensure_core_import(&_IMMUTABLE))),\n\t\t\t\t\ttrue,\n\t\t\t\t))\n\t\t\t} else {\n\t\t\t\tSome((expr.clone(), true))\n\t\t\t};\n\t\t}\n\t\tif let ast::Expr::Member(member) = expr {\n\t\t\tlet prop_sym = prop_to_string(&member.prop);\n\t\t\tif let Some(prop_sym) = prop_sym {\n\t\t\t\tlet id = if is_fn {\n\t\t\t\t\tself.ensure_core_import(&_WRAP_PROP)\n\t\t\t\t} else {\n\t\t\t\t\tself.ensure_core_import(&_WRAP_SIGNAL)\n\t\t\t\t};\n\t\t\t\treturn Some((make_wrap(&id, member.obj.clone(), prop_sym), false));\n\t\t\t}\n\t\t}\n\t\tNone\n\t}\n\n\tfn convert_to_signal_item(\n\t\t&mut self,\n\t\texpr: &ast::Expr,\n\t\timmutable_idents: &Vec<IdPlusType>,\n\t) -> Option<ast::Expr> {\n\t\tif let ast::Expr::Call(call_expr) = expr {\n\t\t\tmatch &call_expr.callee {\n\t\t\t\tast::Callee::Expr(box ast::Expr::Ident(ident)) => {\n\t\t\t\t\tif !self.jsx_functions.contains(&id!(ident)) {\n\t\t\t\t\t\tself.jsx_mutable = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_ => {\n\t\t\t\t\tself.jsx_mutable = true;\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn None;\n\t\t}\n\t\tif is_immutable_expr(expr, &self.options.global_collect, Some(immutable_idents)) {\n\t\t\treturn None;\n\t\t}\n\t\tlet (inlined_expr, immutable) = self.create_synthetic_qqsegment(expr.clone(), false);\n\t\tif !immutable {\n\t\t\tself.jsx_mutable = true;\n\t\t}\n\t\tif inlined_expr.is_some() {\n\t\t\treturn inlined_expr;\n\t\t} else if immutable {\n\t\t\treturn None;\n\t\t}\n\t\tif let ast::Expr::Member(member) = expr {\n\t\t\tlet prop_sym = prop_to_string(&member.prop);\n\t\t\tif let Some(prop_sym) = prop_sym {\n\t\t\t\tlet id = self.ensure_core_import(&_WRAP_SIGNAL);\n\t\t\t\treturn Some(make_wrap(&id, member.obj.clone(), prop_sym));\n\t\t\t}\n\t\t}\n\t\t// let inlined = self.create_synthetic_qqsegment(expr.clone(), false);\n\t\t// if let Some((expr, _)) = inlined {\n\t\t//     return Some(expr);\n\t\t// }\n\t\tNone\n\t}\n\n\tfn should_reg_segment(&self, ctx_name: &str) -> bool {\n\t\tif let Some(strip_ctx_name) = self.options.reg_ctx_name {\n\t\t\tif strip_ctx_name\n\t\t\t\t.iter()\n\t\t\t\t.any(|v| ctx_name.starts_with(v.as_ref()))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tfalse\n\t}\n\n\tfn should_emit_segment(&self, segment_data: &SegmentData) -> bool {\n\t\tif let Some(strip_ctx_name) = self.options.strip_ctx_name {\n\t\t\tif strip_ctx_name\n\t\t\t\t.iter()\n\t\t\t\t.any(|v| segment_data.ctx_name.starts_with(v.as_ref()))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif self.options.strip_event_handlers && segment_data.ctx_kind == SegmentKind::EventHandler {\n\t\t\treturn false;\n\t\t}\n\t\ttrue\n\t}\n\n\tfn create_noop_qrl(\n\t\t&mut self,\n\t\tsymbol_name: &swc_atoms::JsWord,\n\t\tsegment_data: SegmentData,\n\t) -> ast::CallExpr {\n\t\tlet mut args = vec![ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\tspan: DUMMY_SP,\n\t\t\tvalue: symbol_name.clone(),\n\t\t\traw: None,\n\t\t}))];\n\n\t\tlet mut fn_name: &JsWord = &_NOOP_QRL;\n\t\tif self.options.mode == EmitMode::Dev {\n\t\t\targs.push(get_qrl_dev_obj(\n\t\t\t\tJsWord::from(\n\t\t\t\t\tself.options\n\t\t\t\t\t\t.dev_path\n\t\t\t\t\t\t.unwrap_or(&self.options.path_data.abs_path.to_slash_lossy()),\n\t\t\t\t),\n\t\t\t\t&segment_data,\n\t\t\t\t&DUMMY_SP,\n\t\t\t));\n\t\t\tfn_name = &_NOOP_QRL_DEV;\n\t\t};\n\n\t\t// Injects state\n\t\tif !segment_data.scoped_idents.is_empty() {\n\t\t\targs.push(ast::Expr::Array(ast::ArrayLit {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\telems: segment_data\n\t\t\t\t\t.scoped_idents\n\t\t\t\t\t.iter()\n\t\t\t\t\t.map(|id| {\n\t\t\t\t\t\tSome(ast::ExprOrSpread {\n\t\t\t\t\t\t\tspread: None,\n\t\t\t\t\t\t\texpr: Box::new(ast::Expr::Ident(new_ident_from_id(id))),\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t\t.collect(),\n\t\t\t}))\n\t\t}\n\t\tself.create_internal_call(fn_name, args, true)\n\t}\n}\n\nimpl<'a> Fold for QwikTransform<'a> {\n\tnoop_fold_type!();\n\n\tfn fold_module(&mut self, node: ast::Module) -> ast::Module {\n\t\tlet mut body = Vec::with_capacity(node.body.len() + 10);\n\t\tlet mut module_body = node\n\t\t\t.body\n\t\t\t.into_iter()\n\t\t\t.flat_map(|i| {\n\t\t\t\tlet module_item = i.fold_with(self);\n\t\t\t\tlet output: Vec<_> = if matches!(self.options.entry_strategy, EntryStrategy::Hoist)\n\t\t\t\t{\n\t\t\t\t\tself.segments\n\t\t\t\t\t\t.drain(..)\n\t\t\t\t\t\t.map(|segment| {\n\t\t\t\t\t\t\tlet id = (\n\t\t\t\t\t\t\t\tsegment.name.clone(),\n\t\t\t\t\t\t\t\tSyntaxContext::from_u32(segment.hash as u32),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tast::ModuleItem::Stmt(ast::Stmt::Decl(ast::Decl::Var(Box::new(\n\t\t\t\t\t\t\t\tast::VarDecl {\n\t\t\t\t\t\t\t\t\tkind: ast::VarDeclKind::Const,\n\t\t\t\t\t\t\t\t\tdecls: vec![ast::VarDeclarator {\n\t\t\t\t\t\t\t\t\t\tname: ast::Pat::Ident(ast::BindingIdent::from(\n\t\t\t\t\t\t\t\t\t\t\tnew_ident_from_id(&id),\n\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\tinit: Some(segment.expr),\n\t\t\t\t\t\t\t\t\t\tdefinite: false,\n\t\t\t\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\t\t..Default::default()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t))))\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.chain(iter::once(module_item))\n\t\t\t\t\t\t.collect()\n\t\t\t\t} else {\n\t\t\t\t\tvec![module_item]\n\t\t\t\t};\n\t\t\t\toutput\n\t\t\t})\n\t\t\t.collect();\n\n\t\tbody.extend(\n\t\t\tself.options\n\t\t\t\t.global_collect\n\t\t\t\t.synthetic\n\t\t\t\t.iter()\n\t\t\t\t.map(|(new_local, import)| {\n\t\t\t\t\tcreate_synthetic_named_import(new_local, &import.source)\n\t\t\t\t}),\n\t\t);\n\t\t// body.extend(self.extra_top_items.values().cloned());\n\t\tbody.append(&mut module_body);\n\t\tbody.extend(self.extra_bottom_items.values().cloned());\n\n\t\tast::Module { body, ..node }\n\t}\n\n\t// Variable tracking\n\tfn fold_var_decl(&mut self, node: ast::VarDecl) -> ast::VarDecl {\n\t\tif let Some(current_scope) = self.decl_stack.last_mut() {\n\t\t\tfor decl in &node.decls {\n\t\t\t\tlet mut identifiers = Vec::with_capacity(node.decls.len() + 2);\n\t\t\t\tcollect_from_pat(&decl.name, &mut identifiers);\n\t\t\t\tlet ident_type = if node.kind == ast::VarDeclKind::Const\n\t\t\t\t\t&& matches!(decl.name, ast::Pat::Ident(_))\n\t\t\t\t\t&& is_return_static(&decl.init)\n\t\t\t\t{\n\t\t\t\t\tIdentType::Var(true)\n\t\t\t\t} else {\n\t\t\t\t\tIdentType::Var(false)\n\t\t\t\t};\n\t\t\t\tcurrent_scope.extend(identifiers.into_iter().map(|(id, _)| (id, ident_type)));\n\t\t\t}\n\t\t}\n\t\tnode.fold_children_with(self)\n\t}\n\n\tfn fold_var_declarator(&mut self, node: ast::VarDeclarator) -> ast::VarDeclarator {\n\t\tlet stacked = if let ast::Pat::Ident(ref ident) = node.name {\n\t\t\tself.stack_ctxt.push(ident.id.sym.to_string());\n\t\t\ttrue\n\t\t} else {\n\t\t\tfalse\n\t\t};\n\t\tlet o = node.fold_children_with(self);\n\t\tif stacked {\n\t\t\tself.stack_ctxt.pop();\n\t\t}\n\t\to\n\t}\n\n\tfn fold_fn_decl(&mut self, node: ast::FnDecl) -> ast::FnDecl {\n\t\tif let Some(current_scope) = self.decl_stack.last_mut() {\n\t\t\tcurrent_scope.push((id!(node.ident), IdentType::Fn));\n\t\t}\n\t\tself.stack_ctxt.push(node.ident.sym.to_string());\n\n\t\tlet o = node.fold_children_with(self);\n\t\tself.stack_ctxt.pop();\n\t\to\n\t}\n\n\tfn fold_function(&mut self, node: ast::Function) -> ast::Function {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\n\t\tlet prev_jsx_mutable = self.jsx_mutable;\n\t\tself.jsx_mutable = false;\n\n\t\tlet is_component = self.in_component;\n\t\tself.in_component = false;\n\t\tlet is_condition = is_conditional_jsx_block(\n\t\t\tnode.body.as_ref().unwrap(),\n\t\t\t&self.jsx_functions,\n\t\t\t&self.immutable_function_cmp,\n\t\t);\n\t\tlet current_scope = self\n\t\t\t.decl_stack\n\t\t\t.last_mut()\n\t\t\t.expect(\"Declaration stack empty!\");\n\n\t\tfor param in &node.params {\n\t\t\tlet mut identifiers = vec![];\n\t\t\tcollect_from_pat(&param.pat, &mut identifiers);\n\t\t\tlet is_constant = is_component && matches!(param.pat, ast::Pat::Ident(_));\n\t\t\tcurrent_scope.extend(\n\t\t\t\tidentifiers\n\t\t\t\t\t.into_iter()\n\t\t\t\t\t.map(|(id, _)| (id, IdentType::Var(is_constant))),\n\t\t\t);\n\t\t}\n\t\tlet mut o = node.fold_children_with(self);\n\t\tif is_condition {\n\t\t\tif let Some(body) = &mut o.body {\n\t\t\t\tbody.stmts.insert(\n\t\t\t\t\t0,\n\t\t\t\t\tast::Stmt::Expr(ast::ExprStmt {\n\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\texpr: Box::new(ast::Expr::Call(self.create_internal_call(\n\t\t\t\t\t\t\t&_JSX_BRANCH,\n\t\t\t\t\t\t\tvec![],\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t))),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tself.root_jsx_mode = prev;\n\t\tself.jsx_mutable = prev_jsx_mutable;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_arrow_expr(&mut self, node: ast::ArrowExpr) -> ast::ArrowExpr {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\n\t\tlet prev_jsx_mutable = self.jsx_mutable;\n\t\tself.jsx_mutable = false;\n\n\t\tlet is_component = self.in_component;\n\t\tself.in_component = false;\n\t\tlet is_condition = is_conditional_jsx(\n\t\t\t&node.body,\n\t\t\t&self.jsx_functions,\n\t\t\t&self.immutable_function_cmp,\n\t\t);\n\t\tlet current_scope = self\n\t\t\t.decl_stack\n\t\t\t.last_mut()\n\t\t\t.expect(\"Declaration stack empty!\");\n\t\tfor param in &node.params {\n\t\t\tlet mut identifiers = vec![];\n\t\t\tcollect_from_pat(param, &mut identifiers);\n\t\t\tlet is_constant = is_component && matches!(param, ast::Pat::Ident(_));\n\t\t\tcurrent_scope.extend(\n\t\t\t\tidentifiers\n\t\t\t\t\t.into_iter()\n\t\t\t\t\t.map(|(id, _)| (id, IdentType::Var(is_constant))),\n\t\t\t);\n\t\t}\n\n\t\tlet mut o = node.fold_children_with(self);\n\t\tif is_condition {\n\t\t\tmatch &mut o.body {\n\t\t\t\tbox ast::BlockStmtOrExpr::BlockStmt(block) => {\n\t\t\t\t\tblock.stmts.insert(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tast::Stmt::Expr(ast::ExprStmt {\n\t\t\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\t\t\texpr: Box::new(ast::Expr::Call(self.create_internal_call(\n\t\t\t\t\t\t\t\t&_JSX_BRANCH,\n\t\t\t\t\t\t\t\tvec![],\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t))),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbox ast::BlockStmtOrExpr::Expr(expr) => {\n\t\t\t\t\t*expr = Box::new(ast::Expr::Call(self.create_internal_call(\n\t\t\t\t\t\t&_JSX_BRANCH,\n\t\t\t\t\t\tvec![*expr.to_owned()],\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tself.root_jsx_mode = prev;\n\t\tself.jsx_mutable = prev_jsx_mutable;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_for_stmt(&mut self, node: ast::ForStmt) -> ast::ForStmt {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tself.in_component = false;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_for_in_stmt(&mut self, node: ast::ForInStmt) -> ast::ForInStmt {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tself.in_component = false;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_for_of_stmt(&mut self, node: ast::ForOfStmt) -> ast::ForOfStmt {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_bin_expr(&mut self, node: ast::BinExpr) -> ast::BinExpr {\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\to\n\t}\n\n\tfn fold_cond_expr(&mut self, node: ast::CondExpr) -> ast::CondExpr {\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\to\n\t}\n\n\tfn fold_if_stmt(&mut self, node: ast::IfStmt) -> ast::IfStmt {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tself.in_component = false;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_block_stmt(&mut self, node: ast::BlockStmt) -> ast::BlockStmt {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_while_stmt(&mut self, node: ast::WhileStmt) -> ast::WhileStmt {\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tself.in_component = false;\n\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_class_decl(&mut self, node: ast::ClassDecl) -> ast::ClassDecl {\n\t\tif let Some(current_scope) = self.decl_stack.last_mut() {\n\t\t\tcurrent_scope.push((id!(node.ident), IdentType::Class));\n\t\t}\n\n\t\tself.stack_ctxt.push(node.ident.sym.to_string());\n\t\tself.decl_stack.push(vec![]);\n\t\tlet prev = self.root_jsx_mode;\n\t\tself.root_jsx_mode = true;\n\t\tself.in_component = false;\n\t\tlet o = node.fold_children_with(self);\n\t\tself.root_jsx_mode = prev;\n\t\tself.stack_ctxt.pop();\n\t\tself.decl_stack.pop();\n\n\t\to\n\t}\n\n\tfn fold_jsx_element(&mut self, node: ast::JSXElement) -> ast::JSXElement {\n\t\tlet stacked = if let ast::JSXElementName::Ident(ref ident) = node.opening.name {\n\t\t\tself.stack_ctxt.push(ident.sym.to_string());\n\t\t\ttrue\n\t\t} else {\n\t\t\tfalse\n\t\t};\n\t\tlet o = node.fold_children_with(self);\n\t\tif stacked {\n\t\t\tself.stack_ctxt.pop();\n\t\t}\n\t\to\n\t}\n\n\tfn fold_export_default_expr(&mut self, node: ast::ExportDefaultExpr) -> ast::ExportDefaultExpr {\n\t\tlet mut filename = self.options.path_data.file_stem.clone();\n\t\tif filename == \"index\" {\n\t\t\tif let Some(foldername) = self\n\t\t\t\t.options\n\t\t\t\t.path_data\n\t\t\t\t.rel_dir\n\t\t\t\t.file_name()\n\t\t\t\t.and_then(|s| s.to_str())\n\t\t\t{\n\t\t\t\tfilename = foldername.to_string();\n\t\t\t}\n\t\t}\n\t\tself.stack_ctxt.push(filename);\n\t\tlet o = node.fold_children_with(self);\n\t\tself.stack_ctxt.pop();\n\n\t\to\n\t}\n\n\tfn fold_jsx_attr(&mut self, node: ast::JSXAttr) -> ast::JSXAttr {\n\t\tlet node = match node.name {\n\t\t\tast::JSXAttrName::Ident(ref ident) => {\n\t\t\t\tlet new_word = convert_qrl_word(&ident.sym);\n\t\t\t\tself.stack_ctxt.push(ident.sym.to_string());\n\n\t\t\t\tif new_word.is_some() {\n\t\t\t\t\tast::JSXAttr {\n\t\t\t\t\t\tvalue: self.handle_jsx_value(ident.sym.clone(), node.value),\n\t\t\t\t\t\t..node\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnode\n\t\t\t\t}\n\t\t\t}\n\t\t\tast::JSXAttrName::JSXNamespacedName(ref namespaced) => {\n\t\t\t\tlet new_word = convert_qrl_word(&namespaced.name.sym);\n\t\t\t\tlet ident_name = [\n\t\t\t\t\tnamespaced.ns.sym.as_ref(),\n\t\t\t\t\t\"-\",\n\t\t\t\t\tnamespaced.name.sym.as_ref(),\n\t\t\t\t]\n\t\t\t\t.concat();\n\t\t\t\tself.stack_ctxt.push(ident_name.clone());\n\t\t\t\tif new_word.is_some() {\n\t\t\t\t\tast::JSXAttr {\n\t\t\t\t\t\tvalue: self.handle_jsx_value(JsWord::from(ident_name), node.value),\n\t\t\t\t\t\t..node\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnode\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet o = node.fold_children_with(self);\n\t\tself.stack_ctxt.pop();\n\t\to\n\t}\n\n\t// Convert function calls, including those ending in `$`\n\tfn fold_call_expr(&mut self, node: ast::CallExpr) -> ast::CallExpr {\n\t\tlet mut name_token = false;\n\t\tlet mut replace_callee = None;\n\t\tlet mut ctx_name: JsWord = QSEGMENT.clone();\n\n\t\tif let ast::Callee::Expr(box ast::Expr::Ident(ident)) = &node.callee {\n\t\t\tif id_eq!(ident, &self.sync_qrl_fn) {\n\t\t\t\treturn self.handle_sync_qrl(node);\n\t\t\t} else if id_eq!(ident, &self.qsegment_fn) {\n\t\t\t\tif let Some(comments) = self.options.comments {\n\t\t\t\t\tcomments.add_pure_comment(ident.span.lo);\n\t\t\t\t}\n\t\t\t\treturn self.handle_qsegment(node);\n\t\t\t} else if self.jsx_functions.contains(&id!(ident)) {\n\t\t\t\treturn self.handle_jsx(node);\n\t\t\t} else if id_eq!(ident, &self.inlined_qrl_fn) {\n\t\t\t\treturn self.handle_inlined_qsegment(node);\n\t\t\t} else if let Some(specifier) = self.marker_functions.get(&id!(ident)) {\n\t\t\t\tself.stack_ctxt.push(ident.sym.to_string());\n\t\t\t\tctx_name = specifier.clone();\n\t\t\t\tname_token = true;\n\n\t\t\t\tif id_eq!(ident, &self.qcomponent_fn) {\n\t\t\t\t\tself.in_component = true;\n\t\t\t\t\tif let Some(comments) = self.options.comments {\n\t\t\t\t\t\tcomments.add_pure_comment(node.span.lo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet global_collect = &mut self.options.global_collect;\n\t\t\t\tif let Some(import) = global_collect.imports.get(&id!(ident)).cloned() {\n\t\t\t\t\tlet new_specifier =\n\t\t\t\t\t\tconvert_qrl_word(&import.specifier).expect(\"Specifier ends with $\");\n\t\t\t\t\tlet new_local = self.ensure_import(&new_specifier, &import.source);\n\t\t\t\t\treplace_callee = Some(new_ident_from_id(&new_local).as_callee());\n\t\t\t\t} else {\n\t\t\t\t\tlet new_specifier =\n\t\t\t\t\t\tconvert_qrl_word(&ident.sym).expect(\"Specifier ends with $\");\n\t\t\t\t\tglobal_collect\n\t\t\t\t\t\t\t.exports\n\t\t\t\t\t\t\t.keys()\n\t\t\t\t\t\t\t.find(|id| id.0 == new_specifier)\n\t\t\t\t\t\t\t.map_or_else(\n\t\t\t\t\t\t\t\t|| {\n\t\t\t\t\t\t\t\t\tHANDLER.with(|handler| {\n\t\t\t\t\t\t\t\t\t\thandler\n\t\t\t\t\t\t\t\t\t\t\t.struct_span_err_with_code(\n\t\t\t\t\t\t\t\t\t\t\t\tident.span,\n\t\t\t\t\t\t\t\t\t\t\t\t&format!(\"Found '{}' but did not find the corresponding '{}' exported in the same file. Please check that it is exported and spelled correctly\", &ident.sym, &new_specifier),\n\t\t\t\t\t\t\t\t\t\t\t\terrors::get_diagnostic_id(errors::Error::MissingQrlImplementation),\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t.emit();\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t|new_local| {\n\t\t\t\t\t\t\t\t\treplace_callee = Some(new_ident_from_id(new_local).as_callee());\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tself.stack_ctxt.push(ident.sym.to_string());\n\t\t\t\tname_token = true;\n\t\t\t}\n\t\t}\n\n\t\tlet convert_qrl = replace_callee.is_some();\n\t\tlet callee = if let Some(callee) = replace_callee {\n\t\t\tcallee\n\t\t} else {\n\t\t\tnode.callee\n\t\t};\n\t\tlet callee = callee.fold_with(self);\n\t\tlet args: Vec<ast::ExprOrSpread> = node\n\t\t\t.args\n\t\t\t.into_iter()\n\t\t\t.enumerate()\n\t\t\t.map(|(i, arg)| {\n\t\t\t\tif convert_qrl && i == 0 {\n\t\t\t\t\tast::ExprOrSpread {\n\t\t\t\t\t\texpr: Box::new(ast::Expr::Call(self.create_synthetic_qsegment(\n\t\t\t\t\t\t\t*arg.expr,\n\t\t\t\t\t\t\tSegmentKind::Function,\n\t\t\t\t\t\t\tctx_name.clone(),\n\t\t\t\t\t\t\tNone,\n\t\t\t\t\t\t)))\n\t\t\t\t\t\t.fold_with(self),\n\t\t\t\t\t\t..arg\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\targ.fold_with(self)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.collect();\n\n\t\tif name_token {\n\t\t\tself.stack_ctxt.pop();\n\t\t}\n\t\tself.in_component = false;\n\t\tast::CallExpr {\n\t\t\tcallee,\n\t\t\targs,\n\t\t\t..node\n\t\t}\n\t}\n}\n\npub fn add_handle_watch(body: &mut Vec<ast::ModuleItem>, core_module: &JsWord) {\n\tbody.push(ast::ModuleItem::ModuleDecl(ast::ModuleDecl::ExportNamed(\n\t\tast::NamedExport {\n\t\t\tsrc: Some(Box::new(ast::Str {\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t\tvalue: core_module.clone(),\n\t\t\t\traw: None,\n\t\t\t})),\n\t\t\tspan: DUMMY_SP,\n\t\t\twith: None,\n\t\t\ttype_only: false,\n\t\t\tspecifiers: vec![ast::ExportSpecifier::Named(ast::ExportNamedSpecifier {\n\t\t\t\torig: ast::ModuleExportName::Ident(ast::Ident::new(\n\t\t\t\t\tHANDLE_WATCH.clone(),\n\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\tDefault::default(),\n\t\t\t\t)),\n\t\t\t\texported: None,\n\t\t\t\tis_type_only: false,\n\t\t\t\tspan: DUMMY_SP,\n\t\t\t})],\n\t\t},\n\t)));\n}\n\npub fn create_synthetic_named_export(local: &Id, exported: Option<JsWord>) -> ast::ModuleItem {\n\tast::ModuleItem::ModuleDecl(ast::ModuleDecl::ExportNamed(ast::NamedExport {\n\t\tspan: DUMMY_SP,\n\t\ttype_only: false,\n\t\twith: None,\n\t\tspecifiers: vec![ast::ExportSpecifier::Named(ast::ExportNamedSpecifier {\n\t\t\tspan: DUMMY_SP,\n\t\t\tis_type_only: false,\n\t\t\torig: ast::ModuleExportName::Ident(new_ident_from_id(local)),\n\t\t\texported: exported.map(|name| {\n\t\t\t\tast::ModuleExportName::Ident(ast::Ident::new(\n\t\t\t\t\tname,\n\t\t\t\t\tDUMMY_SP,\n\t\t\t\t\tSyntaxContext::empty(),\n\t\t\t\t))\n\t\t\t}),\n\t\t})],\n\t\tsrc: None,\n\t}))\n}\n\npub fn create_synthetic_named_import(local: &Id, src: &JsWord) -> ast::ModuleItem {\n\tast::ModuleItem::ModuleDecl(ast::ModuleDecl::Import(ast::ImportDecl {\n\t\tphase: Default::default(),\n\t\tspan: DUMMY_SP,\n\t\tsrc: Box::new(ast::Str {\n\t\t\tspan: DUMMY_SP,\n\t\t\tvalue: src.clone(),\n\t\t\traw: None,\n\t\t}),\n\t\twith: None,\n\t\ttype_only: false,\n\t\tspecifiers: vec![ast::ImportSpecifier::Named(ast::ImportNamedSpecifier {\n\t\t\tis_type_only: false,\n\t\t\tspan: DUMMY_SP,\n\t\t\tlocal: new_ident_from_id(local),\n\t\t\timported: None,\n\t\t})],\n\t}))\n}\n\nfn escape_sym(str: &str) -> String {\n\tstr.chars()\n\t\t.flat_map(|x| match x {\n\t\t\t'A'..='Z' | 'a'..='z' | '0'..='9' => Some(x),\n\t\t\t_ => Some('_'),\n\t\t})\n\t\t// trim and squash underscores\n\t\t.fold((String::new(), None), |(mut acc, prev), x| {\n\t\t\tif x == '_' {\n\t\t\t\tif prev.is_none() {\n\t\t\t\t\t(acc, None)\n\t\t\t\t} else {\n\t\t\t\t\t(acc, Some('_'))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif prev == Some('_') {\n\t\t\t\t\tacc.push('_');\n\t\t\t\t}\n\t\t\t\tacc.push(x);\n\t\t\t\t(acc, Some(x))\n\t\t\t}\n\t\t})\n\t\t.0\n}\n\nconst fn can_capture_scope(expr: &ast::Expr) -> bool {\n\tmatches!(expr, &ast::Expr::Fn(_) | &ast::Expr::Arrow(_))\n}\n\nfn base64(nu: u64) -> String {\n\tbase64::engine::general_purpose::URL_SAFE_NO_PAD\n\t\t.encode(nu.to_le_bytes())\n\t\t.replace(['-', '_'], \"0\")\n}\n\nfn compute_scoped_idents(all_idents: &[Id], all_decl: &[IdPlusType]) -> (Vec<Id>, bool) {\n\tlet mut set: HashSet<Id> = HashSet::new();\n\tlet mut immutable = true;\n\tfor ident in all_idents {\n\t\tif let Some(item) = all_decl.iter().find(|item| item.0 == *ident) {\n\t\t\tset.insert(ident.clone());\n\t\t\tif !matches!(item.1, IdentType::Var(true)) {\n\t\t\t\timmutable = false;\n\t\t\t}\n\t\t}\n\t}\n\tlet mut output: Vec<Id> = set.into_iter().collect();\n\toutput.sort();\n\t(output, immutable)\n}\n\nfn get_canonical_filename(display_name: &JsWord, symbol_name: &JsWord) -> JsWord {\n\tlet hash = symbol_name.split('_').next_back().unwrap();\n\tJsWord::from(format!(\"{}_{}\", display_name, hash))\n}\n\nfn parse_symbol_name(\n\tsymbol_name: JsWord,\n\tdev: bool,\n\tfile_name: &String,\n) -> (JsWord, JsWord, JsWord) {\n\tlet mut splitter = symbol_name.rsplitn(2, '_');\n\tlet hash = splitter\n\t\t.next()\n\t\t.expect(\"symbol_name always need to have a segment\");\n\tlet display_name = format!(\"{}_{}\", file_name, splitter.next().unwrap_or(hash));\n\n\tlet s_n = if dev {\n\t\tsymbol_name.clone()\n\t} else {\n\t\tJsWord::from(format!(\"s_{}\", hash))\n\t};\n\t(s_n, display_name.into(), hash.into())\n}\n\nfn get_qrl_dev_obj(abs_path: JsWord, segment: &SegmentData, span: &Span) -> ast::Expr {\n\tast::Expr::Object(ast::ObjectLit {\n\t\tspan: DUMMY_SP,\n\t\tprops: vec![\n\t\t\tast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\tkey: ast::PropName::Ident(ast::IdentName::new(js_word!(\"file\"), DUMMY_SP)),\n\t\t\t\tvalue: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: abs_path,\n\t\t\t\t\traw: None,\n\t\t\t\t}))),\n\t\t\t}))),\n\t\t\tast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\tkey: ast::PropName::Ident(ast::IdentName::new(JsWord::from(\"lo\"), DUMMY_SP)),\n\t\t\t\tvalue: Box::new(ast::Expr::Lit(ast::Lit::Num(ast::Number {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: span.lo().0 as f64,\n\t\t\t\t\traw: None,\n\t\t\t\t}))),\n\t\t\t}))),\n\t\t\tast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\tkey: ast::PropName::Ident(ast::IdentName::new(JsWord::from(\"hi\"), DUMMY_SP)),\n\t\t\t\tvalue: Box::new(ast::Expr::Lit(ast::Lit::Num(ast::Number {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: span.hi().0 as f64,\n\t\t\t\t\traw: None,\n\t\t\t\t}))),\n\t\t\t}))),\n\t\t\tast::PropOrSpread::Prop(Box::new(ast::Prop::KeyValue(ast::KeyValueProp {\n\t\t\t\tkey: ast::PropName::Ident(ast::IdentName::new(\n\t\t\t\t\tJsWord::from(\"displayName\"),\n\t\t\t\t\tDUMMY_SP,\n\t\t\t\t)),\n\t\t\t\tvalue: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {\n\t\t\t\t\tspan: DUMMY_SP,\n\t\t\t\t\tvalue: segment.display_name.clone(),\n\t\t\t\t\traw: None,\n\t\t\t\t}))),\n\t\t\t}))),\n\t\t],\n\t})\n}\n\nfn prop_to_string(prop: &ast::MemberProp) -> Option<JsWord> {\n\tmatch prop {\n\t\tast::MemberProp::Ident(ident) => Some(ident.sym.clone()),\n\t\tast::MemberProp::Computed(ast::ComputedPropName {\n\t\t\texpr: box ast::Expr::Lit(ast::Lit::Str(str)),\n\t\t\t..\n\t\t}) => Some(str.value.clone()),\n\t\t_ => None,\n\t}\n}\n\nfn is_return_static(expr: &Option<Box<ast::Expr>>) -> bool {\n\tmatch expr {\n\t\tSome(box ast::Expr::Call(ast::CallExpr {\n\t\t\tcallee: ast::Callee::Expr(box ast::Expr::Ident(ident)),\n\t\t\t..\n\t\t})) => ident.sym.ends_with('$') || ident.sym.ends_with(\"Qrl\") || ident.sym.starts_with(\"use\"),\n\t\tSome(_) => false,\n\t\tNone => true,\n\t}\n}\n\nfn make_wrap(method: &Id, obj: Box<ast::Expr>, prop: JsWord) -> ast::Expr {\n\tast::Expr::Call(ast::CallExpr {\n\t\tcallee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(method)))),\n\t\targs: vec![\n\t\t\tast::ExprOrSpread::from(obj),\n\t\t\tast::ExprOrSpread::from(Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str::from(\n\t\t\t\tprop,\n\t\t\t))))),\n\t\t],\n\t\t..Default::default()\n\t})\n}\n\nfn get_null_arg() -> ast::ExprOrSpread {\n\tast::ExprOrSpread {\n\t\tspread: None,\n\t\texpr: Box::new(ast::Expr::Lit(ast::Lit::Null(ast::Null { span: DUMMY_SP }))),\n\t}\n}\n\nfn is_text_only(node: &str) -> bool {\n\tmatches!(\n\t\tnode,\n\t\t\"text\" | \"textarea\" | \"title\" | \"option\" | \"script\" | \"style\" | \"noscript\"\n\t)\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/utils.rs",
    "content": "use serde::{Deserialize, Serialize};\nuse std::cmp::Ordering;\nuse swc_atoms::JsWord;\n\n#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]\n#[serde(rename_all = \"camelCase\")]\npub struct SourceLocation {\n\tlo: usize,\n\thi: usize,\n\tstart_line: usize,\n\tstart_col: usize,\n\tend_line: usize,\n\tend_col: usize,\n}\n\nimpl SourceLocation {\n\tpub fn from(source_map: &swc_common::SourceMap, span: swc_common::Span) -> Self {\n\t\tlet start = source_map.lookup_char_pos(span.lo);\n\t\tlet end = source_map.lookup_char_pos(span.hi);\n\t\t// - SWC's columns are exclusive, ours are inclusive (column - 1)\n\t\t// - SWC has 0-based columns, ours are 1-based (column + 1)\n\t\t// = +-0\n\n\t\tSelf {\n\t\t\tlo: span.lo.0 as usize,\n\t\t\thi: span.hi.0 as usize,\n\t\t\tstart_line: start.line,\n\t\t\tstart_col: start.col_display + 1,\n\t\t\tend_line: end.line,\n\t\t\tend_col: end.col_display,\n\t\t}\n\t}\n}\n\nimpl PartialOrd for SourceLocation {\n\tfn partial_cmp(&self, other: &Self) -> Option<Ordering> {\n\t\tmatch self.start_line.cmp(&other.start_line) {\n\t\t\tOrdering::Equal => self.start_col.partial_cmp(&other.start_col),\n\t\t\to => Some(o),\n\t\t}\n\t}\n}\n\n#[derive(Serialize, Deserialize, Debug)]\n#[serde(rename_all = \"camelCase\")]\npub struct Diagnostic {\n\tpub category: DiagnosticCategory,\n\tpub code: Option<String>,\n\tpub file: JsWord,\n\tpub message: String,\n\tpub highlights: Option<Vec<SourceLocation>>,\n\tpub suggestions: Option<Vec<String>>,\n\tpub scope: DiagnosticScope,\n}\n\n#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]\n#[serde(rename_all = \"camelCase\")]\npub enum DiagnosticCategory {\n\t/// Fails the build with an error.\n\tError,\n\t/// Logs a warning, but the build does not fail.\n\tWarning,\n\t/// An error if this is source code in the project, or a warning if in node_modules.\n\tSourceError,\n}\n\n#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]\n#[serde(rename_all = \"camelCase\")]\npub enum DiagnosticScope {\n\tOptimizer,\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/core/src/words.rs",
    "content": "use lazy_static::lazy_static;\nuse swc_atoms::JsWord;\n\npub const QRL_SUFFIX: char = '$';\npub const LONG_SUFFIX: &str = \"Qrl\";\n\nlazy_static! {\n\tpub static ref REF: JsWord = JsWord::from(\"ref\");\n\tpub static ref QSLOT: JsWord = JsWord::from(\"q:slot\");\n\tpub static ref CHILDREN: JsWord = JsWord::from(\"children\");\n\tpub static ref HANDLE_WATCH: JsWord = JsWord::from(\"_hW\");\n\tpub static ref _QRL: JsWord = JsWord::from(\"qrl\");\n\tpub static ref _QRL_DEV: JsWord = JsWord::from(\"qrlDEV\");\n\tpub static ref _INLINED_QRL: JsWord = JsWord::from(\"inlinedQrl\");\n\tpub static ref _INLINED_QRL_DEV: JsWord = JsWord::from(\"inlinedQrlDEV\");\n\tpub static ref _NOOP_QRL: JsWord = JsWord::from(\"_noopQrl\");\n\tpub static ref _NOOP_QRL_DEV: JsWord = JsWord::from(\"_noopQrlDEV\");\n\tpub static ref _REST_PROPS: JsWord = JsWord::from(\"_restProps\");\n\tpub static ref QSEGMENT: JsWord = JsWord::from(\"$\");\n\tpub static ref Q_SYNC: JsWord = JsWord::from(\"sync$\");\n\tpub static ref QWIK_INTERNAL: JsWord = JsWord::from(\"qwik\");\n\tpub static ref BUILDER_IO_QWIK: JsWord = JsWord::from(\"@builder.io/qwik\");\n\tpub static ref BUILDER_IO_QWIK_BUILD: JsWord = JsWord::from(\"@builder.io/qwik/build\");\n\tpub static ref BUILDER_IO_QWIK_JSX: JsWord = JsWord::from(\"@builder.io/qwik/jsx-runtime\");\n\tpub static ref BUILDER_IO_QWIK_JSX_DEV: JsWord =\n\t\tJsWord::from(\"@builder.io/qwik/jsx-dev-runtime\");\n\tpub static ref QCOMPONENT: JsWord = JsWord::from(\"component$\");\n\tpub static ref USE_LEXICAL_SCOPE: JsWord = JsWord::from(\"useLexicalScope\");\n\tpub static ref H: JsWord = JsWord::from(\"h\");\n\tpub static ref FRAGMENT: JsWord = JsWord::from(\"Fragment\");\n\tpub static ref _IMMUTABLE: JsWord = JsWord::from(\"_IMMUTABLE\");\n\tpub static ref _INLINED_FN: JsWord = JsWord::from(\"_fnSignal\");\n\tpub static ref IS_SERVER: JsWord = JsWord::from(\"isServer\");\n\tpub static ref IS_BROWSER: JsWord = JsWord::from(\"isBrowser\");\n\tpub static ref IS_DEV: JsWord = JsWord::from(\"isDev\");\n\tpub static ref COMPONENT: JsWord = JsWord::from(\"component$\");\n\tpub static ref _REG_SYMBOL: JsWord = JsWord::from(\"_regSymbol\");\n\tpub static ref _JSX_BRANCH: JsWord = JsWord::from(\"_jsxBranch\");\n\tpub static ref _QRL_SYNC: JsWord = JsWord::from(\"_qrlSync\");\n\tpub static ref _WRAP_PROP: JsWord = JsWord::from(\"_wrapProp\");\n\tpub static ref _WRAP_SIGNAL: JsWord = JsWord::from(\"_wrapSignal\");\n\tpub static ref _JSX_Q: JsWord = JsWord::from(\"_jsxQ\");\n\tpub static ref _JSX_S: JsWord = JsWord::from(\"_jsxS\");\n\tpub static ref _JSX_C: JsWord = JsWord::from(\"_jsxC\");\n\tpub static ref JSX: JsWord = JsWord::from(\"jsx\");\n\tpub static ref JSXS: JsWord = JsWord::from(\"jsxs\");\n\tpub static ref JSX_DEV: JsWord = JsWord::from(\"jsxDEV\");\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/index.ts",
    "content": "export { createOptimizer } from './optimizer';\nexport { versions } from './versions';\n\nexport type {\n  ComponentEntryStrategy,\n  Diagnostic,\n  DiagnosticCategory,\n  EntryStrategy,\n  GlobalInjections,\n  SegmentAnalysis as HookAnalysis,\n  SegmentEntryStrategy as HookEntryStrategy,\n  InlineEntryStrategy,\n  MinifyMode,\n  Optimizer,\n  OptimizerOptions,\n  OptimizerSystem,\n  Path,\n  QwikAsset,\n  QwikBundle,\n  QwikBundleGraph,\n  QwikManifest,\n  ServerQwikManifest,\n  QwikSymbol,\n  ResolvedManifest,\n  SegmentAnalysis,\n  SegmentEntryStrategy,\n  SingleEntryStrategy,\n  SmartEntryStrategy,\n  SourceLocation,\n  SourceMapsOption,\n  SymbolMapper,\n  SymbolMapperFn,\n  SystemEnvironment,\n  TransformFsOptions,\n  TransformModule,\n  TransformModuleInput,\n  TransformModulesOptions,\n  TransformOptions,\n  TransformOutput,\n  TranspileOption,\n} from './types';\n\nexport type { ExperimentalFeatures, QwikBuildMode, QwikBuildTarget } from './plugins/plugin';\nexport type { QwikRollupPluginOptions } from './plugins/rollup';\nexport type {\n  QwikViteDevResponse,\n  QwikVitePlugin,\n  QwikVitePluginApi,\n  QwikVitePluginOptions,\n} from './plugins/vite';\n\nexport type { BundleGraphAdder } from './plugins/bundle-graph';\n\nexport { qwikRollup } from './plugins/rollup';\nexport { qwikVite } from './plugins/vite';\nexport { symbolMapper } from './plugins/vite-dev-server';\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/manifest.ts",
    "content": "import type { Rollup } from 'vite';\nimport { type NormalizedQwikPluginOptions } from './plugins/plugin';\nimport type { GlobalInjections, Path, QwikBundle, QwikManifest, SegmentAnalysis } from './types';\n\n// This is just the initial prioritization of the symbols and entries\n// at build time so there's less work during each SSR. However, SSR should\n// still further optimize the priorities depending on the user/document.\n// This also helps ensure a stable q-manifest.json file.\n\nfunction prioritizeSymbolNames(manifest: QwikManifest) {\n  const symbols = manifest.symbols;\n\n  return Object.keys(symbols).sort((symbolNameA, symbolNameB) => {\n    const a = symbols[symbolNameA];\n    const b = symbols[symbolNameB];\n\n    // events should sort highest\n    if (a.ctxKind === 'eventHandler' && b.ctxKind !== 'eventHandler') {\n      return -1;\n    }\n    if (a.ctxKind !== 'eventHandler' && b.ctxKind === 'eventHandler') {\n      return 1;\n    }\n\n    if (a.ctxKind === 'eventHandler' && b.ctxKind === 'eventHandler') {\n      // both are an event handler\n      const aIndex = EVENT_PRIORITY.indexOf(a.ctxName.toLowerCase());\n      const bIndex = EVENT_PRIORITY.indexOf(b.ctxName.toLowerCase());\n\n      if (aIndex > -1 && bIndex > -1) {\n        // both symbols have an event with a priority\n        if (aIndex < bIndex) {\n          return -1;\n        }\n        if (aIndex > bIndex) {\n          return 1;\n        }\n      } else {\n        if (aIndex > -1) {\n          // just symbol \"a\" has an event with a priority\n          return -1;\n        }\n        if (bIndex > -1) {\n          // just symbol \"b\" has an event with a priority\n          return 1;\n        }\n      }\n    } else if (a.ctxKind === 'function' && b.ctxKind === 'function') {\n      // both are a function\n      const aIndex = FUNCTION_PRIORITY.indexOf(a.ctxName.toLowerCase());\n      const bIndex = FUNCTION_PRIORITY.indexOf(b.ctxName.toLowerCase());\n\n      if (aIndex > -1 && bIndex > -1) {\n        // both symbols have a function with a priority\n        if (aIndex < bIndex) {\n          return -1;\n        }\n        if (aIndex > bIndex) {\n          return 1;\n        }\n      } else {\n        if (aIndex > -1) {\n          // just symbol \"a\" has a function with a priority\n          return -1;\n        }\n        if (bIndex > -1) {\n          // just symbol \"b\" has a function with a priority\n          return 1;\n        }\n      }\n    }\n\n    // symbols with no \"parent\" have a higher priority\n    if (!a.parent && b.parent) {\n      return -1;\n    }\n    if (a.parent && !b.parent) {\n      return 1;\n    }\n\n    // idk, they're pretty darn similar, just sort by the symbol name\n    if (a.hash < b.hash) {\n      return -1;\n    }\n    if (a.hash > b.hash) {\n      return 1;\n    }\n    return 0;\n  });\n}\n\n// User triggered events should have priority\nconst EVENT_PRIORITY = /*#__PURE__*/ (() =>\n  [\n    // Click Events\n    'click',\n    'dblclick',\n    'contextmenu',\n    'auxclick',\n\n    // Pointer Events\n    'pointerdown',\n    'pointerup',\n    'pointermove',\n    'pointerover',\n    'pointerenter',\n    'pointerleave',\n    'pointerout',\n    'pointercancel',\n    'gotpointercapture',\n    'lostpointercapture',\n\n    // Touch Events\n    'touchstart',\n    'touchend',\n    'touchmove',\n    'touchcancel',\n\n    // Mouse Events\n    'mousedown',\n    'mouseup',\n    'mousemove',\n    'mouseenter',\n    'mouseleave',\n    'mouseover',\n    'mouseout',\n    'wheel',\n\n    // Gesture Events\n    'gesturestart',\n    'gesturechange',\n    'gestureend',\n\n    // Keyboard Events\n    'keydown',\n    'keyup',\n    'keypress',\n\n    // Input/Change Events\n    'input',\n    'change',\n    'search',\n    'invalid',\n    'beforeinput',\n    'select',\n\n    // Focus/Blur Events\n    'focusin',\n    'focusout',\n    'focus',\n    'blur',\n\n    // Form Events\n    'submit',\n    'reset',\n\n    // Scroll Events\n    'scroll',\n  ].map((n) => `on${n.toLowerCase()}$`))();\n\nconst FUNCTION_PRIORITY = /*#__PURE__*/ (() =>\n  ['useTask$', 'useVisibleTask$', 'component$', 'useStyles$', 'useStylesScoped$'].map((n) =>\n    n.toLowerCase()\n  ))();\n\nfunction sortBundleNames(manifest: QwikManifest) {\n  // this doesn't really matter at build time\n  // but standardizing the order helps make this file stable\n  return Object.keys(manifest.bundles).sort(sortAlphabetical);\n}\n\nfunction updateSortAndPriorities(manifest: QwikManifest) {\n  const prioritizedSymbolNames = prioritizeSymbolNames(manifest);\n  const prioritizedSymbols: QwikManifest['symbols'] = {};\n  const prioritizedMapping: QwikManifest['mapping'] = {};\n\n  for (const symbolName of prioritizedSymbolNames) {\n    prioritizedSymbols[symbolName] = manifest.symbols[symbolName];\n    prioritizedMapping[symbolName] = manifest.mapping[symbolName];\n  }\n\n  const sortedBundleNames = sortBundleNames(manifest);\n  const sortedBundles: { [fileName: string]: QwikBundle } = {};\n  for (const bundleName of sortedBundleNames) {\n    sortedBundles[bundleName] = manifest.bundles[bundleName];\n    const bundle = manifest.bundles[bundleName];\n    if (Array.isArray(bundle.imports)) {\n      bundle.imports.sort(sortAlphabetical);\n    }\n    if (Array.isArray(bundle.dynamicImports)) {\n      bundle.dynamicImports.sort(sortAlphabetical);\n    }\n    const symbols: string[] = [];\n    for (const symbolName of prioritizedSymbolNames) {\n      if (bundleName === prioritizedMapping[symbolName]) {\n        symbols.push(symbolName);\n      }\n    }\n    if (symbols.length > 0) {\n      symbols.sort(sortAlphabetical);\n      bundle.symbols = symbols;\n    }\n  }\n\n  manifest.symbols = prioritizedSymbols;\n  manifest.mapping = prioritizedMapping;\n  manifest.bundles = sortedBundles;\n\n  return manifest;\n}\n\nfunction sortAlphabetical(a: string, b: string) {\n  a = a.toLocaleLowerCase();\n  b = b.toLocaleLowerCase();\n  if (a < b) {\n    return -1;\n  }\n  if (a > b) {\n    return 1;\n  }\n  return 0;\n}\n\nexport function getValidManifest(manifest: QwikManifest | undefined | null) {\n  if (\n    manifest != null &&\n    manifest.mapping != null &&\n    typeof manifest.mapping === 'object' &&\n    manifest.symbols != null &&\n    typeof manifest.symbols === 'object' &&\n    manifest.bundles != null &&\n    typeof manifest.bundles === 'object'\n  ) {\n    return manifest;\n  }\n  return undefined;\n}\n\nconst getBundleInteractivity = (bundle: QwikBundle, manifest: QwikManifest) => {\n  let maxScore = 0;\n  if (bundle.symbols) {\n    for (const symbolName of bundle.symbols) {\n      let score = 1;\n      const symbol = manifest.symbols[symbolName];\n      if (symbol) {\n        if (symbol.ctxKind === 'function') {\n          if (/(component|useStyles|useStylesScoped)/i.test(symbol.ctxName)) {\n            score += 1;\n          } else if (/(useComputed|useTask|useVisibleTask|useOn)/i.test(symbol.ctxName)) {\n            score += 2;\n          }\n        } else {\n          score += 1;\n          if (/(click|mouse|pointer|touch|key|scroll|gesture|wheel)/i.test(symbol.ctxName)) {\n            score += 3;\n          }\n        }\n      }\n      maxScore = Math.max(maxScore, score);\n    }\n  }\n  return maxScore;\n};\n\n/**\n * Computes the total size of each bundle based on its dependencies. Written by ChatGPT ;) - it's\n * harder than you think to total nodes in a directed cyclic graph\n */\nexport function computeTotals(graph: QwikManifest['bundles']): void {\n  // 1) Prepare Tarjan's structures\n  let index = 0;\n  const stack: string[] = [];\n  const sccList: string[][] = [];\n\n  // Maps for Tarjan\n  const idx = new Map<string, number>(); // node -> index\n  const low = new Map<string, number>(); // node -> low-link\n  const onStack = new Set<string>();\n\n  function strongConnect(v: string) {\n    idx.set(v, index);\n    low.set(v, index);\n    index++;\n    stack.push(v);\n    onStack.add(v);\n\n    // Explore children\n    const children = graph[v].imports || [];\n    for (const w of children) {\n      if (!idx.has(w)) {\n        strongConnect(w);\n        low.set(v, Math.min(low.get(v)!, low.get(w)!));\n      } else if (onStack.has(w)) {\n        low.set(v, Math.min(low.get(v)!, idx.get(w)!));\n      }\n    }\n\n    // If v is a root node, pop stack to form an SCC\n    if (low.get(v) === idx.get(v)) {\n      const comp: string[] = [];\n      let x: string;\n      do {\n        x = stack.pop()!;\n        onStack.delete(x);\n        comp.push(x);\n      } while (x !== v);\n      sccList.push(comp);\n    }\n  }\n\n  // Run Tarjan over all nodes\n  for (const v of Object.keys(graph)) {\n    if (!idx.has(v)) {\n      strongConnect(v);\n    }\n  }\n\n  // 2) Build DAG of SCCs\n  // sccIndex: which SCC a node belongs to\n  const sccIndex = new Map<string, number>();\n  sccList.forEach((comp, i) => {\n    for (const v of comp) {\n      sccIndex.set(v, i);\n    }\n  });\n\n  // Create adjacency for the SCC graph\n  const sccDAG: Set<number>[] = Array.from({ length: sccList.length }, () => new Set());\n  for (const v of Object.keys(graph)) {\n    const i = sccIndex.get(v)!;\n    for (const w of graph[v].imports || []) {\n      const j = sccIndex.get(w)!;\n      if (i !== j) {\n        sccDAG[i].add(j);\n      }\n    }\n  }\n\n  // 3) Topological sort the SCC DAG\n  const visited = new Set<number>();\n  const order: number[] = [];\n\n  function dfsSCC(u: number) {\n    visited.add(u);\n    for (const v of sccDAG[u]) {\n      if (!visited.has(v)) {\n        dfsSCC(v);\n      }\n    }\n    order.push(u);\n  }\n\n  for (let i = 0; i < sccList.length; i++) {\n    if (!visited.has(i)) {\n      dfsSCC(i);\n    }\n  }\n  order.reverse(); // Now it's a topological order\n\n  // 4) Compute totals from bottom to top\n  const sccTotals = new Array<number>(sccList.length).fill(0);\n\n  // First compute the sum of 'size' in each SCC\n  for (let i = 0; i < sccList.length; i++) {\n    let sumSize = 0;\n    for (const nodeId of sccList[i]) {\n      sumSize += graph[nodeId].size;\n    }\n    sccTotals[i] = sumSize;\n  }\n\n  // Then add child totals in topological order (reversed)\n  for (let k = order.length - 1; k >= 0; k--) {\n    const sccId = order[k];\n    let total = sccTotals[sccId];\n    for (const child of sccDAG[sccId]) {\n      total += sccTotals[child];\n    }\n    sccTotals[sccId] = total;\n  }\n\n  // 5) Assign computed totals back to each node in the original graph\n  for (let i = 0; i < sccList.length; i++) {\n    const total = sccTotals[i];\n    for (const nodeId of sccList[i]) {\n      graph[nodeId].total = total;\n    }\n  }\n}\n\nconst preloaderRegex = /[/\\\\]qwik[/\\\\]dist[/\\\\]preloader\\.[cm]js$/;\nconst coreRegex = /[/\\\\]qwik[/\\\\]dist[/\\\\]core\\.[^/]*js$/;\nconst qwikLoaderRegex = /[/\\\\]qwik[/\\\\]dist[/\\\\]qwikloader(\\.debug)?\\.[^/]*js$/;\nexport function generateManifestFromBundles(\n  path: Path,\n  segments: SegmentAnalysis[],\n  injections: GlobalInjections[],\n  outputBundles: Rollup.OutputBundle,\n  opts: NormalizedQwikPluginOptions,\n  debug: (...args: any[]) => void,\n  canonPath: (p: string) => string\n) {\n  // Note that this will be the order of the JSON file\n  const manifest: QwikManifest = {\n    version: '1',\n    manifestHash: '',\n    options: {\n      target: opts.target,\n      buildMode: opts.buildMode,\n      // don't copy the insights stuff\n      entryStrategy: opts.entryStrategy && { type: opts.entryStrategy.type },\n    },\n    core: undefined,\n    preloader: undefined,\n    bundleGraphAsset: undefined,\n    injections,\n    mapping: {},\n    bundles: {},\n    assets: {},\n    symbols: {},\n    bundleGraph: undefined,\n  };\n\n  const getBundleName = (name: string) => {\n    const bundle = outputBundles[name];\n    if (!bundle) {\n      console.warn(`Client manifest generation: skipping external import \"${name}\"`);\n      return;\n    }\n    return canonPath(bundle.fileName);\n  };\n\n  let coreBundleName: string | undefined;\n  let preloaderBundleName: string | undefined;\n  for (const outputBundle of Object.values(outputBundles)) {\n    const bundleFileName = getBundleName(outputBundle.fileName);\n    if (outputBundle.name === 'core') {\n      coreBundleName = bundleFileName;\n    }\n    if (outputBundle.name === 'preloader') {\n      preloaderBundleName = bundleFileName;\n    }\n  }\n  // We need to find our QRL exports\n  const qrlNames = new Set(segments.map((h) => h.name));\n  for (const outputBundle of Object.values(outputBundles)) {\n    if (outputBundle.type === 'asset') {\n      // we don't record map files as assets\n      if (!outputBundle.fileName.endsWith('js.map')) {\n        manifest.assets![outputBundle.fileName] = {\n          name: outputBundle.names[0],\n          size: outputBundle.source.length,\n        };\n      }\n      continue;\n    }\n    const bundleFileName = canonPath(outputBundle.fileName);\n\n    const size = outputBundle.code.length;\n    const bundle: QwikBundle = {\n      size,\n      total: -1,\n    };\n\n    for (const symbol of outputBundle.exports) {\n      if (qrlNames.has(symbol)) {\n        // When not minifying we see both the entry and the segment file\n        // The segment file will only have 1 export, we want the entry\n        if (!manifest.mapping[symbol] || outputBundle.exports.length !== 1) {\n          manifest.mapping[symbol] = bundleFileName;\n        }\n      }\n    }\n\n    const bundleImports = outputBundle.imports\n      // Tree shaking might remove imports\n      .filter((i) => outputBundle.code.includes(path.basename(i)))\n      .map((i) => getBundleName(i))\n      .filter((i) => i !== preloaderBundleName && i !== coreBundleName)\n      .filter(Boolean) as string[];\n    if (bundleImports.length > 0) {\n      bundle.imports = bundleImports;\n    }\n    const bundleDynamicImports = outputBundle.dynamicImports\n      .filter((i) => outputBundle.code.includes(path.basename(i)))\n      .map((i) => getBundleName(i))\n      .filter(Boolean) as string[];\n    if (bundleDynamicImports.length > 0) {\n      bundle.dynamicImports = bundleDynamicImports;\n    }\n\n    // It can happen that our modules end up in facades, not nice but needs handling\n    if (outputBundle.facadeModuleId) {\n      if (preloaderRegex.test(outputBundle.facadeModuleId)) {\n        manifest.preloader = bundleFileName;\n      } else if (coreRegex.test(outputBundle.facadeModuleId)) {\n        manifest.core = bundleFileName;\n      } else if (qwikLoaderRegex.test(outputBundle.facadeModuleId)) {\n        manifest.qwikLoader = bundleFileName;\n      }\n    }\n    // Rollup doesn't provide the moduleIds in the outputBundle but Vite does\n    const ids = outputBundle.moduleIds || Object.keys(outputBundle.modules);\n    const modulePaths = ids\n      .filter((m) => !m.startsWith(`\\u0000`))\n      .map((m) => path.relative(opts.rootDir, m));\n    if (modulePaths.length > 0) {\n      bundle.origins = modulePaths;\n      // keep these if statements separate so that weird bundling still works\n      if (!manifest.preloader && modulePaths.some((m) => preloaderRegex.test(m))) {\n        manifest.preloader = bundleFileName;\n      }\n      if (!manifest.core && modulePaths.some((m) => coreRegex.test(m))) {\n        manifest.core = bundleFileName;\n      }\n      if (!manifest.qwikLoader && modulePaths.some((m) => qwikLoaderRegex.test(m))) {\n        manifest.qwikLoader = bundleFileName;\n      }\n    }\n\n    manifest.bundles[bundleFileName] = bundle;\n  }\n\n  for (const segment of segments) {\n    const symbol = segment.name;\n    const bundle = manifest.mapping[symbol];\n    if (!bundle) {\n      debug(`Note: qrl ${segment.name} is not in the bundle, likely tree shaken`, manifest);\n      continue;\n    }\n    (manifest.bundles[bundle].symbols ||= []).push(symbol);\n    manifest.symbols[symbol] = {\n      displayName: segment.displayName,\n      hash: segment.hash,\n      ctxKind: segment.ctxKind,\n      ctxName: segment.ctxName,\n      captures: segment.captures,\n      canonicalFilename: segment.canonicalFilename,\n      parent: segment.parent,\n      origin: segment.origin,\n      loc: segment.loc,\n    };\n  }\n\n  for (const bundle of Object.values(manifest.bundles)) {\n    const interactivityScore = getBundleInteractivity(bundle, manifest);\n    bundle.interactivity = interactivityScore;\n  }\n\n  computeTotals(manifest.bundles);\n\n  // To inspect the bundles, uncomment the following lines\n  // import('node:fs').then((fs) =>\n  //   fs.writeFileSync(\n  //     'output-bundles.json',\n  //     JSON.stringify(\n  //       {\n  //         segments,\n  //         bundles: Object.fromEntries(\n  //           Object.entries(outputBundles).map(([n, b]) => [\n  //             n,\n  //             {\n  //               ...b,\n  //               code: 'code' in b ? b.code.slice(0, 5000) : undefined,\n  //               map: 'map' in b ? `<removed>` : undefined,\n  //               source: 'source' in b ? `<removed ${b.source.length} bytes>` : undefined,\n  //               modules:\n  //                 'modules' in b\n  //                   ? Object.fromEntries(\n  //                       Object.entries(b.modules).map(([k, v]) => [\n  //                         k,\n  //                         {\n  //                           ...v,\n  //                           code:\n  //                             'code' in v ? `<removed ${v.code?.length || 0} bytes>` : undefined,\n  //                         },\n  //                       ])\n  //                     )\n  //                   : undefined,\n  //             },\n  //           ])\n  //         ),\n  //       },\n  //       null,\n  //       '\\t'\n  //     ).replaceAll(process.cwd(), '')\n  //   )\n  // );\n\n  return updateSortAndPriorities(manifest);\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/optimizer.ts",
    "content": "import {\n  getPlatformInputFiles,\n  getSystem,\n  loadPlatformBinding,\n  type PlatformBinding,\n} from './platform';\nimport type {\n  TransformModulesOptions,\n  TransformFsOptions,\n  Optimizer,\n  OptimizerSystem,\n  OptimizerOptions,\n} from './types';\n\n/** @public */\nexport const createOptimizer = async (optimizerOptions: OptimizerOptions = {}) => {\n  const sys = optimizerOptions?.sys || (await getSystem());\n  const binding = optimizerOptions?.binding || (await loadPlatformBinding(sys));\n\n  const optimizer: Optimizer = {\n    async transformModules(opts: TransformModulesOptions) {\n      return transformModulesSync(binding, opts);\n    },\n    transformModulesSync(opts: TransformModulesOptions) {\n      return transformModulesSync(binding, opts);\n    },\n    async transformFs(opts: TransformFsOptions) {\n      return transformFsAsync(sys, binding, opts);\n    },\n    transformFsSync(opts: TransformFsOptions) {\n      return transformFsSync(binding, opts);\n    },\n    sys,\n  };\n\n  return optimizer;\n};\n\n/** Transforms the input code string, does not access the file system. */\nconst transformModulesSync = (binding: PlatformBinding, opts: TransformModulesOptions) => {\n  return binding.transform_modules(convertOptions(opts));\n};\n\nconst transformFsSync = (binding: PlatformBinding, opts: TransformFsOptions) => {\n  if (binding.transform_fs) {\n    return binding.transform_fs(convertOptions(opts));\n  }\n  throw new Error('Not implemented');\n};\n\nconst transformFsAsync = async (\n  sys: OptimizerSystem,\n  binding: PlatformBinding,\n  fsOpts: TransformFsOptions\n) => {\n  if (binding.transform_fs && !sys.getInputFiles) {\n    return binding.transform_fs(convertOptions(fsOpts));\n  }\n\n  const getInputFiles = await getPlatformInputFiles(sys);\n\n  if (getInputFiles) {\n    const input = await getInputFiles(fsOpts.srcDir);\n    for (const root of fsOpts.vendorRoots) {\n      const rootFiles = await getInputFiles(root);\n      input.push(...rootFiles);\n    }\n    input.forEach((file) => {\n      file.path = sys.path.relative(fsOpts.srcDir, file.path);\n    });\n    const modulesOpts: Required<TransformModulesOptions> = {\n      srcDir: fsOpts.srcDir,\n      rootDir: fsOpts.rootDir!,\n      entryStrategy: fsOpts.entryStrategy!,\n      minify: fsOpts.minify!,\n      sourceMaps: !!fsOpts.sourceMaps,\n      transpileTs: fsOpts.transpileTs!,\n      transpileJsx: fsOpts.transpileJsx!,\n      explicitExtensions: fsOpts.explicitExtensions!,\n      preserveFilenames: fsOpts.preserveFilenames!,\n      mode: fsOpts.mode!,\n      scope: fsOpts.scope!,\n      input,\n      regCtxName: fsOpts.regCtxName!,\n      stripEventHandlers: fsOpts.stripEventHandlers!,\n      stripCtxName: fsOpts.stripCtxName!,\n      stripExports: fsOpts.stripExports!,\n      isServer: fsOpts.isServer!,\n    };\n    return binding.transform_modules(convertOptions(modulesOpts));\n  }\n\n  throw new Error('Not implemented');\n};\n\nconst convertOptions = (opts: any) => {\n  const output: any = {\n    minify: 'simplify',\n    sourceMaps: false,\n    transpileTs: false,\n    transpileJsx: false,\n    preserveFilenames: false,\n    explicitExtensions: false,\n    mode: 'lib',\n    manualChunks: undefined,\n    scope: undefined,\n    regCtxName: undefined,\n    stripEventHandlers: false,\n    rootDir: undefined,\n    stripExports: undefined,\n    stripCtxName: undefined,\n    isServer: undefined,\n  };\n  Object.entries(opts).forEach(([key, value]) => {\n    if (value != null) {\n      output[key] = value;\n    }\n  });\n  output.entryStrategy = opts.entryStrategy?.type ?? 'smart';\n  output.manualChunks = opts.entryStrategy?.manual ?? undefined;\n  return output;\n};\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/path.ts",
    "content": "// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nexport function createPath(opts: { cwd?: () => string } = {}): Path {\n  function assertPath(path: any) {\n    if (typeof path !== 'string') {\n      throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n    }\n  }\n\n  // Resolves . and .. elements in a path with directory names\n  function normalizeStringPosix(path: string, allowAboveRoot: boolean): string {\n    let res = '';\n    let lastSegmentLength = 0;\n    let lastSlash = -1;\n    let dots = 0;\n    let code;\n    for (let i = 0; i <= path.length; ++i) {\n      if (i < path.length) {\n        code = path.charCodeAt(i);\n      } else if (code === 47 /*/*/) {\n        break;\n      } else {\n        code = 47 /*/*/;\n      }\n      if (code === 47 /*/*/) {\n        if (lastSlash === i - 1 || dots === 1) {\n          // NOOP\n        } else if (lastSlash !== i - 1 && dots === 2) {\n          if (\n            res.length < 2 ||\n            lastSegmentLength !== 2 ||\n            res.charCodeAt(res.length - 1) !== 46 /*.*/ ||\n            res.charCodeAt(res.length - 2) !== 46 /*.*/\n          ) {\n            if (res.length > 2) {\n              const lastSlashIndex = res.lastIndexOf('/');\n              if (lastSlashIndex !== res.length - 1) {\n                if (lastSlashIndex === -1) {\n                  res = '';\n                  lastSegmentLength = 0;\n                } else {\n                  res = res.slice(0, lastSlashIndex);\n                  lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n                }\n                lastSlash = i;\n                dots = 0;\n                continue;\n              }\n            } else if (res.length === 2 || res.length === 1) {\n              res = '';\n              lastSegmentLength = 0;\n              lastSlash = i;\n              dots = 0;\n              continue;\n            }\n          }\n          if (allowAboveRoot) {\n            if (res.length > 0) {\n              res += '/..';\n            } else {\n              res = '..';\n            }\n            lastSegmentLength = 2;\n          }\n        } else {\n          if (res.length > 0) {\n            res += '/' + path.slice(lastSlash + 1, i);\n          } else {\n            res = path.slice(lastSlash + 1, i);\n          }\n          lastSegmentLength = i - lastSlash - 1;\n        }\n        lastSlash = i;\n        dots = 0;\n      } else if (code === 46 /*.*/ && dots !== -1) {\n        ++dots;\n      } else {\n        dots = -1;\n      }\n    }\n    return res;\n  }\n\n  function _format(sep: string, pathObject: any) {\n    const dir = pathObject.dir || pathObject.root;\n    const base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n    if (!dir) {\n      return base;\n    }\n    if (dir === pathObject.root) {\n      return dir + base;\n    }\n    return dir + sep + base;\n  }\n\n  // path.resolve([from ...], to)\n  const resolve = function resolve(...paths: string[]) {\n    let resolvedPath = '';\n    let resolvedAbsolute = false;\n    let cwd;\n\n    for (let i = paths.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n      let path;\n      if (i >= 0) {\n        path = paths[i];\n      } else {\n        if (cwd === undefined) {\n          if (opts && typeof opts.cwd === 'function') {\n            cwd = opts.cwd();\n          } else if (typeof process !== 'undefined' && typeof process.cwd === 'function') {\n            cwd = process.cwd();\n          } else {\n            cwd = '/';\n          }\n        }\n        path = cwd;\n      }\n\n      assertPath(path);\n\n      // Skip empty entries\n      if (path.length === 0) {\n        continue;\n      }\n\n      resolvedPath = path + '/' + resolvedPath;\n      resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n    }\n\n    // At this point the path should be resolved to a full absolute path, but\n    // handle relative paths to be safe (might happen when process.cwd() fails)\n\n    // Normalize the path\n    resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n    if (resolvedAbsolute) {\n      if (resolvedPath.length > 0) {\n        return '/' + resolvedPath;\n      } else {\n        return '/';\n      }\n    } else if (resolvedPath.length > 0) {\n      return resolvedPath;\n    } else {\n      return '.';\n    }\n  };\n\n  const normalize = function normalize(path: string) {\n    assertPath(path);\n\n    if (path.length === 0) {\n      return '.';\n    }\n\n    const isAbsolute = path.charCodeAt(0) === 47; /*/*/\n    const trailingSeparator = path.charCodeAt(path.length - 1) === 47; /*/*/\n\n    // Normalize the path\n    path = normalizeStringPosix(path, !isAbsolute);\n\n    if (path.length === 0 && !isAbsolute) {\n      path = '.';\n    }\n    if (path.length > 0 && trailingSeparator) {\n      path += '/';\n    }\n\n    if (isAbsolute) {\n      return '/' + path;\n    }\n    return path;\n  };\n\n  const isAbsolute = function isAbsolute(path: string) {\n    assertPath(path);\n    return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n  };\n\n  const join = function join(...paths: string[]) {\n    if (paths.length === 0) {\n      return '.';\n    }\n    let joined;\n    for (let i = 0; i < paths.length; ++i) {\n      const arg = paths[i];\n      assertPath(arg);\n      if (arg.length > 0) {\n        if (joined === undefined) {\n          joined = arg;\n        } else {\n          joined += '/' + arg;\n        }\n      }\n    }\n    if (joined === undefined) {\n      return '.';\n    }\n    return normalize(joined);\n  };\n\n  const relative = function relative(from: string, to: string) {\n    assertPath(from);\n    assertPath(to);\n\n    if (from === to) {\n      return '';\n    }\n\n    from = resolve(from);\n    to = resolve(to);\n\n    if (from === to) {\n      return '';\n    }\n\n    // Trim any leading backslashes\n    let fromStart = 1;\n    for (; fromStart < from.length; ++fromStart) {\n      if (from.charCodeAt(fromStart) !== 47 /*/*/) {\n        break;\n      }\n    }\n    const fromEnd = from.length;\n    const fromLen = fromEnd - fromStart;\n\n    // Trim any leading backslashes\n    let toStart = 1;\n    for (; toStart < to.length; ++toStart) {\n      if (to.charCodeAt(toStart) !== 47 /*/*/) {\n        break;\n      }\n    }\n    const toEnd = to.length;\n    const toLen = toEnd - toStart;\n\n    // Compare paths to find the longest common path from root\n    const length = fromLen < toLen ? fromLen : toLen;\n    let lastCommonSep = -1;\n    let i = 0;\n    for (; i <= length; ++i) {\n      if (i === length) {\n        if (toLen > length) {\n          if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n            // We get here if `from` is the exact base path for `to`.\n            // For example: from='/foo/bar'; to='/foo/bar/baz'\n            return to.slice(toStart + i + 1);\n          } else if (i === 0) {\n            // We get here if `from` is the root\n            // For example: from='/'; to='/foo'\n            return to.slice(toStart + i);\n          }\n        } else if (fromLen > length) {\n          if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n            // We get here if `to` is the exact base path for `from`.\n            // For example: from='/foo/bar/baz'; to='/foo/bar'\n            lastCommonSep = i;\n          } else if (i === 0) {\n            // We get here if `to` is the root.\n            // For example: from='/foo'; to='/'\n            lastCommonSep = 0;\n          }\n        }\n        break;\n      }\n      const fromCode = from.charCodeAt(fromStart + i);\n      const toCode = to.charCodeAt(toStart + i);\n      if (fromCode !== toCode) {\n        break;\n      } else if (fromCode === 47 /*/*/) {\n        lastCommonSep = i;\n      }\n    }\n\n    let out = '';\n    // Generate the relative path based on the path difference between `to`\n    // and `from`\n    for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n      if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n        if (out.length === 0) {\n          out += '..';\n        } else {\n          out += '/..';\n        }\n      }\n    }\n\n    // Lastly, append the rest of the destination (`to`) path that comes after\n    // the common path parts\n    if (out.length > 0) {\n      return out + to.slice(toStart + lastCommonSep);\n    } else {\n      toStart += lastCommonSep;\n      if (to.charCodeAt(toStart) === 47 /*/*/) {\n        ++toStart;\n      }\n      return to.slice(toStart);\n    }\n  };\n\n  const dirname = function dirname(path: string) {\n    assertPath(path);\n    if (path.length === 0) {\n      return '.';\n    }\n    let code = path.charCodeAt(0);\n    const hasRoot = code === 47; /*/*/\n    let end = -1;\n    let matchedSlash = true;\n    for (let i = path.length - 1; i >= 1; --i) {\n      code = path.charCodeAt(i);\n      if (code === 47 /*/*/) {\n        if (!matchedSlash) {\n          end = i;\n          break;\n        }\n      } else {\n        // We saw the first non-path separator\n        matchedSlash = false;\n      }\n    }\n\n    if (end === -1) {\n      return hasRoot ? '/' : '.';\n    }\n    if (hasRoot && end === 1) {\n      return '//';\n    }\n    return path.slice(0, end);\n  };\n\n  const basename = function basename(path: string, ext: string) {\n    if (ext !== undefined && typeof ext !== 'string') {\n      throw new TypeError('\"ext\" argument must be a string');\n    }\n    assertPath(path);\n\n    let start = 0;\n    let end = -1;\n    let matchedSlash = true;\n    let i;\n\n    if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n      if (ext.length === path.length && ext === path) {\n        return '';\n      }\n      let extIdx = ext.length - 1;\n      let firstNonSlashEnd = -1;\n      for (i = path.length - 1; i >= 0; --i) {\n        const code = path.charCodeAt(i);\n        if (code === 47 /*/*/) {\n          // If we reached a path separator that was not part of a set of path\n          // separators at the end of the string, stop now\n          if (!matchedSlash) {\n            start = i + 1;\n            break;\n          }\n        } else {\n          if (firstNonSlashEnd === -1) {\n            // We saw the first non-path separator, remember this index in case\n            // we need it if the extension ends up not matching\n            matchedSlash = false;\n            firstNonSlashEnd = i + 1;\n          }\n          if (extIdx >= 0) {\n            // Try to match the explicit extension\n            if (code === ext.charCodeAt(extIdx)) {\n              if (--extIdx === -1) {\n                // We matched the extension, so mark this as the end of our path\n                // component\n                end = i;\n              }\n            } else {\n              // Extension does not match, so our result is the entire path\n              // component\n              extIdx = -1;\n              end = firstNonSlashEnd;\n            }\n          }\n        }\n      }\n\n      if (start === end) {\n        end = firstNonSlashEnd;\n      } else if (end === -1) {\n        end = path.length;\n      }\n      return path.slice(start, end);\n    } else {\n      for (i = path.length - 1; i >= 0; --i) {\n        if (path.charCodeAt(i) === 47 /*/*/) {\n          // If we reached a path separator that was not part of a set of path\n          // separators at the end of the string, stop now\n          if (!matchedSlash) {\n            start = i + 1;\n            break;\n          }\n        } else if (end === -1) {\n          // We saw the first non-path separator, mark this as the end of our\n          // path component\n          matchedSlash = false;\n          end = i + 1;\n        }\n      }\n\n      if (end === -1) {\n        return '';\n      }\n      return path.slice(start, end);\n    }\n  };\n\n  const extname = function extname(path: string) {\n    assertPath(path);\n    let startDot = -1;\n    let startPart = 0;\n    let end = -1;\n    let matchedSlash = true;\n    // Track the state of characters (if any) we see before our first dot and\n    // after any path separator we find\n    let preDotState = 0;\n    for (let i = path.length - 1; i >= 0; --i) {\n      const code = path.charCodeAt(i);\n      if (code === 47 /*/*/) {\n        // If we reached a path separator that was not part of a set of path\n        // separators at the end of the string, stop now\n        if (!matchedSlash) {\n          startPart = i + 1;\n          break;\n        }\n        continue;\n      }\n      if (end === -1) {\n        // We saw the first non-path separator, mark this as the end of our\n        // extension\n        matchedSlash = false;\n        end = i + 1;\n      }\n      if (code === 46 /*.*/) {\n        // If this is our first dot, mark it as the start of our extension\n        if (startDot === -1) {\n          startDot = i;\n        } else if (preDotState !== 1) {\n          preDotState = 1;\n        }\n      } else if (startDot !== -1) {\n        // We saw a non-dot and non-path separator before our dot, so we should\n        // have a good chance at having a non-empty extension\n        preDotState = -1;\n      }\n    }\n\n    if (\n      startDot === -1 ||\n      end === -1 ||\n      // We saw a non-dot character immediately before the dot\n      preDotState === 0 ||\n      // The (right-most) trimmed path component is exactly '..'\n      (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)\n    ) {\n      return '';\n    }\n    return path.slice(startDot, end);\n  };\n\n  const format = function format(pathObject: FormatInputPathObject) {\n    if (pathObject === null || typeof pathObject !== 'object') {\n      throw new TypeError(\n        'The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject\n      );\n    }\n    return _format('/', pathObject);\n  };\n\n  const parse = function parse(path: string): ParsedPath {\n    assertPath(path);\n\n    const ret = {\n      root: '',\n      dir: '',\n      base: '',\n      ext: '',\n      name: '',\n    };\n    if (path.length === 0) {\n      return ret;\n    }\n    let code = path.charCodeAt(0);\n    let start;\n    const isAbsolute = code === 47; /*/*/\n    if (isAbsolute) {\n      ret.root = '/';\n      start = 1;\n    } else {\n      start = 0;\n    }\n    let startDot = -1;\n    let startPart = 0;\n    let end = -1;\n    let matchedSlash = true;\n    let i = path.length - 1;\n\n    // Track the state of characters (if any) we see before our first dot and\n    // after any path separator we find\n    let preDotState = 0;\n\n    // Get non-dir info\n    for (; i >= start; --i) {\n      code = path.charCodeAt(i);\n      if (code === 47 /*/*/) {\n        // If we reached a path separator that was not part of a set of path\n        // separators at the end of the string, stop now\n        if (!matchedSlash) {\n          startPart = i + 1;\n          break;\n        }\n        continue;\n      }\n      if (end === -1) {\n        // We saw the first non-path separator, mark this as the end of our\n        // extension\n        matchedSlash = false;\n        end = i + 1;\n      }\n      if (code === 46 /*.*/) {\n        // If this is our first dot, mark it as the start of our extension\n        if (startDot === -1) {\n          startDot = i;\n        } else if (preDotState !== 1) {\n          preDotState = 1;\n        }\n      } else if (startDot !== -1) {\n        // We saw a non-dot and non-path separator before our dot, so we should\n        // have a good chance at having a non-empty extension\n        preDotState = -1;\n      }\n    }\n\n    if (\n      startDot === -1 ||\n      end === -1 ||\n      // We saw a non-dot character immediately before the dot\n      preDotState === 0 ||\n      // The (right-most) trimmed path component is exactly '..'\n      (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)\n    ) {\n      if (end !== -1) {\n        if (startPart === 0 && isAbsolute) {\n          ret.base = ret.name = path.slice(1, end);\n        } else {\n          ret.base = ret.name = path.slice(startPart, end);\n        }\n      }\n    } else {\n      if (startPart === 0 && isAbsolute) {\n        ret.name = path.slice(1, startDot);\n        ret.base = path.slice(1, end);\n      } else {\n        ret.name = path.slice(startPart, startDot);\n        ret.base = path.slice(startPart, end);\n      }\n      ret.ext = path.slice(startDot, end);\n    }\n\n    if (startPart > 0) {\n      ret.dir = path.slice(0, startPart - 1);\n    } else if (isAbsolute) {\n      ret.dir = '/';\n    }\n\n    return ret;\n  };\n\n  const sep = '/';\n  const delimiter = ':';\n\n  return {\n    relative,\n    resolve,\n    parse,\n    format,\n    join,\n    isAbsolute,\n    basename,\n    normalize,\n    dirname,\n    extname,\n    delimiter,\n    sep,\n    win32: null,\n    posix: {\n      relative,\n      resolve,\n      parse,\n      format,\n      join,\n      isAbsolute,\n      basename,\n      normalize,\n      dirname,\n      extname,\n      delimiter,\n      sep,\n      win32: null,\n      posix: null as any,\n    },\n  };\n}\n\nexport interface ParsedPath {\n  /** The root of the path such as '/' or 'c:' */\n  root: string;\n  /** The full directory path such as '/home/user/dir' or 'c:\\path\\dir' */\n  dir: string;\n  /** The file name including extension (if any) such as 'index.html' */\n  base: string;\n  /** The file extension (if any) such as '.html' */\n  ext: string;\n  /** The file name without extension (if any) such as 'index' */\n  name: string;\n}\n\nexport type FormatInputPathObject = Partial<ParsedPath>;\n\nexport interface Path {\n  resolve(...pathSegments: string[]): string;\n  normalize(path: string): string;\n  isAbsolute(path: string): boolean;\n  join(...paths: string[]): string;\n  relative(from: string, to: string): string;\n  dirname(path: string): string;\n  basename(path: string, ext?: string): string;\n  extname(path: string): string;\n  format(pathObject: FormatInputPathObject): string;\n  parse(path: string): ParsedPath;\n  readonly sep: string;\n  readonly delimiter: string;\n  readonly win32: null;\n  readonly posix: Path;\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/platform.ts",
    "content": "import type {\n  OptimizerSystem,\n  SystemEnvironment,\n  TransformModuleInput,\n  TransformOutput,\n} from './types';\nimport { createPath } from './path';\nimport { QWIK_BINDING_MAP } from './qwik-binding-map';\nimport { versions } from './versions';\n\nexport async function getSystem() {\n  const sysEnv = getEnv();\n\n  const sys: OptimizerSystem = {\n    dynamicImport: (path) => {\n      throw new Error(\n        `Qwik Optimizer sys.dynamicImport() not implemented, trying to import: \"${path}\"`\n      );\n    },\n    strictDynamicImport: (path) => {\n      throw new Error(\n        `Qwik Optimizer sys.strictDynamicImport() not implemented, trying to import: \"${path}\"`\n      );\n    },\n    path: null as any,\n    cwd: () => '/',\n    os: 'unknown',\n    env: sysEnv,\n  };\n\n  sys.path = createPath(sys);\n\n  if (globalThis.IS_ESM) {\n    sys.strictDynamicImport = sys.dynamicImport = (path) => import(path);\n  }\n\n  if (globalThis.IS_CJS) {\n    if (sysEnv === 'node' || sysEnv === 'bun') {\n      // using this api object as a way to ensure bundlers\n      // do not try to inline or rewrite require()\n      sys.dynamicImport = (path) => require(path);\n      sys.strictDynamicImport = (path) => import(path);\n\n      if (typeof TextEncoder === 'undefined') {\n        // TextEncoder/TextDecoder needs to be on the global scope for the WASM file\n        // https://nodejs.org/api/util.html#class-utiltextdecoder\n        const nodeUtil: typeof import('util') = await sys.dynamicImport('node:util');\n        globalThis.TextEncoder = nodeUtil.TextEncoder;\n        globalThis.TextDecoder = nodeUtil.TextDecoder;\n      }\n    } else if (sysEnv === 'webworker' || sysEnv === 'browsermain') {\n      sys.strictDynamicImport = (path) => import(path);\n      sys.dynamicImport = async (path: string) => {\n        const cjsRsp = await fetch(path);\n        const cjsCode = await cjsRsp.text();\n        const cjsModule: any = { exports: {} };\n        // eslint-disable-next-line no-new-func\n        const cjsRun = new Function('module', 'exports', cjsCode);\n        cjsRun(cjsModule, cjsModule.exports);\n        return cjsModule.exports;\n      };\n    }\n  }\n  if (sysEnv !== 'webworker' && sysEnv !== 'browsermain') {\n    try {\n      sys.path = await sys.dynamicImport('node:path');\n      sys.cwd = () => process.cwd();\n      sys.os = process.platform;\n    } catch {\n      // ignore\n    }\n  }\n\n  return sys;\n}\n\nexport const getPlatformInputFiles = async (sys: OptimizerSystem) => {\n  if (typeof sys.getInputFiles === 'function') {\n    return sys.getInputFiles;\n  }\n\n  if (sys.env === 'node') {\n    const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n\n    return async (rootDir: string) => {\n      const getChildFilePaths = async (dir: string): Promise<string[]> => {\n        const stats = await fs.promises.stat(dir);\n        const flatted: string[] = [];\n        if (stats.isDirectory()) {\n          const dirItems = await fs.promises.readdir(dir);\n\n          const files = await Promise.all(\n            dirItems.map(async (subdir: any) => {\n              const resolvedPath = sys.path.resolve(dir, subdir);\n              const stats = await fs.promises.stat(resolvedPath);\n              return stats.isDirectory() ? getChildFilePaths(resolvedPath) : [resolvedPath];\n            })\n          );\n          for (const file of files) {\n            flatted.push(...file);\n          }\n        } else {\n          flatted.push(dir);\n        }\n        return flatted.filter((a) => sys.path.extname(a).toLowerCase() in extensions);\n      };\n\n      const filePaths = await getChildFilePaths(rootDir);\n\n      const inputs = (\n        await Promise.all(\n          filePaths.map(async (filePath) => {\n            const input: TransformModuleInput = {\n              code: await fs.promises.readFile(filePath, 'utf8'),\n              path: filePath,\n            };\n            return input;\n          })\n        )\n      ).sort((a, b) => {\n        if (a.path < b.path) {\n          return -1;\n        }\n        if (a.path > b.path) {\n          return 1;\n        }\n        return 0;\n      });\n\n      return inputs;\n    };\n  }\n\n  return null;\n};\n\nexport async function loadPlatformBinding(sys: OptimizerSystem) {\n  const sysEnv = getEnv();\n\n  // Try native build\n  if (sysEnv === 'node' || sysEnv === 'bun') {\n    // Node.js\n    const platform = (QWIK_BINDING_MAP as any)[process.platform];\n    if (platform) {\n      const triples = platform[process.arch];\n      if (triples) {\n        for (const triple of triples) {\n          // Node.js - Native Binding\n          try {\n            if (globalThis.IS_ESM) {\n              const module = await sys.dynamicImport('node:module');\n              const mod = module.default.createRequire(import.meta.url)(\n                `../bindings/${triple.platformArchABI}`\n              );\n              return mod;\n            }\n            const mod = await sys.dynamicImport(`../bindings/${triple.platformArchABI}`);\n            return mod;\n          } catch (e) {\n            console.warn(\n              `Unable to load native binding ${triple.platformArchABI}. Falling back to wasm build.`,\n              (e as Error)?.message\n            );\n          }\n        }\n      }\n    }\n  }\n\n  if (globalThis.IS_CJS) {\n    // CJS WASM\n\n    if (sysEnv === 'node' || sysEnv === 'bun') {\n      // CJS WASM Node.js\n      const wasmPath = sys.path.join(__dirname, '..', 'bindings', 'qwik_wasm_bg.wasm');\n      const mod = await sys.dynamicImport(`../bindings/qwik.wasm.cjs`);\n      const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n\n      return new Promise<Buffer>((resolve, reject) => {\n        fs.readFile(wasmPath, (err, buf) => {\n          if (err != null) {\n            reject(err);\n          } else {\n            resolve(buf);\n          }\n        });\n      })\n        .then((buf) => WebAssembly.compile(buf))\n        .then((wasm) => mod.default(wasm))\n        .then(() => mod);\n    }\n\n    if (sysEnv === 'webworker' || sysEnv === 'browsermain') {\n      // CJS WASM Browser\n      let version = versions.qwik;\n      const cachedCjsCode = `qwikWasmCjs${version}`;\n      const cachedWasmRsp = `qwikWasmRsp${version}`;\n\n      let cjsCode: string = (globalThis as any)[cachedCjsCode];\n      let wasmRsp: Response = (globalThis as any)[cachedWasmRsp];\n\n      if (!cjsCode || !wasmRsp) {\n        version = versions.qwik.split('-dev')[0];\n        const cdnUrl = `https://cdn.jsdelivr.net/npm/@builder.io/qwik@${version}/bindings/`;\n        const cjsModuleUrl = new URL(`./qwik.wasm.cjs`, cdnUrl).href;\n        const wasmUrl = new URL(`./qwik_wasm_bg.wasm`, cdnUrl).href;\n\n        const rsps = await Promise.all([fetch(cjsModuleUrl), fetch(wasmUrl)]);\n\n        for (const rsp of rsps) {\n          if (!rsp.ok) {\n            throw new Error(`Unable to fetch Qwik WASM binding from ${rsp.url}`);\n          }\n        }\n\n        const cjsRsp = rsps[0];\n        (globalThis as any)[cachedCjsCode] = cjsCode = await cjsRsp.text();\n        (globalThis as any)[cachedWasmRsp] = wasmRsp = rsps[1];\n      }\n\n      const cjsModule: any = { exports: {} };\n      // eslint-disable-next-line no-new-func\n      const cjsRun = new Function('module', 'exports', cjsCode);\n      cjsRun(cjsModule, cjsModule.exports);\n      const mod = cjsModule.exports;\n\n      // init\n      await mod.default(wasmRsp.clone());\n\n      return mod;\n    }\n  }\n\n  if (globalThis.IS_ESM) {\n    if (sysEnv === 'node' || sysEnv === 'bun') {\n      // CJS WASM Node.js\n      const url: typeof import('url') = await sys.dynamicImport('node:url');\n      const __dirname = sys.path.dirname(url.fileURLToPath(import.meta.url));\n      const wasmPath = sys.path.join(__dirname, '..', 'bindings', 'qwik_wasm_bg.wasm');\n      const mod = await sys.dynamicImport(`../bindings/qwik.wasm.mjs`);\n      const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n\n      return new Promise<Buffer>((resolve, reject) => {\n        fs.readFile(wasmPath, (err, buf) => {\n          if (err != null) {\n            reject(err);\n          } else {\n            resolve(buf);\n          }\n        });\n      })\n        .then((buf) => WebAssembly.compile(buf))\n        .then((wasm) => mod.default(wasm))\n        .then(() => mod);\n    } else {\n      const module = await sys.dynamicImport(`../bindings/qwik.wasm.mjs`);\n      await module.default();\n      return module;\n    }\n  }\n\n  throw new Error(`Platform not supported`);\n}\n\nexport interface PlatformBinding {\n  transform_fs?: (opts: any) => TransformOutput;\n  transform_modules: (opts: any) => TransformOutput;\n}\n\nconst getEnv = (): SystemEnvironment => {\n  if (typeof Deno !== 'undefined') {\n    return 'deno';\n  }\n\n  if (typeof Bun !== 'undefined') {\n    return 'bun';\n  }\n\n  if (\n    typeof process !== 'undefined' &&\n    typeof global !== 'undefined' &&\n    process.versions &&\n    process.versions.node\n  ) {\n    return 'node';\n  }\n\n  if (\n    typeof self !== 'undefined' &&\n    typeof location !== 'undefined' &&\n    typeof navigator !== 'undefined' &&\n    typeof fetch === 'function' &&\n    typeof WorkerGlobalScope === 'function' &&\n    typeof (self as any).importScripts === 'function'\n  ) {\n    return 'webworker';\n  }\n\n  if (\n    typeof window !== 'undefined' &&\n    typeof document !== 'undefined' &&\n    typeof location !== 'undefined' &&\n    typeof navigator !== 'undefined' &&\n    typeof Window === 'function' &&\n    typeof fetch === 'function'\n  ) {\n    return 'browsermain';\n  }\n\n  return 'unknown';\n};\n\nconst extensions: { [ext: string]: boolean } = {\n  '.js': true,\n  '.ts': true,\n  '.tsx': true,\n  '.jsx': true,\n  '.mjs': true,\n};\n\ndeclare const globalThis: { IS_CJS: boolean; IS_ESM: boolean; [key: string]: any };\ndeclare const WorkerGlobalScope: any;\ndeclare const Deno: any;\ndeclare const Bun: any;\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/bundle-graph.ts",
    "content": "import type { QwikBundle, QwikBundleGraph, QwikManifest } from '../types';\n\nconst minimumSpeed = 300; // kbps\n// size that takes 0.5 seconds to download at minimumSpeed\nconst slowSize = 0.5 / ((minimumSpeed * 1024) / 8);\n\n/**\n * A function that returns a map of bundle names to their dependencies.\n *\n * @public\n */\nexport type BundleGraphAdder = (\n  manifest: QwikManifest\n) => Record<string, { imports?: string[]; dynamicImports?: string[] }>;\n\nconst getSymbolHash = (symbolName: string) => {\n  const index = symbolName.lastIndexOf('_');\n  if (index > -1) {\n    return symbolName.slice(index + 1);\n  }\n  return symbolName;\n};\n\n/**\n * This creates a compact array of dependencies for each bundle. It also contains the symbols. The\n * format is:\n *\n * ```\n *   [...(bundleName: string, ...directImports: index[], ...dynamicImports: [-1, ...index[]] | [])]\n * ```\n *\n * (index is the position of the dependency in the bundleGraph array)\n *\n * This format allows any string to denote a set of dependencies, which is useful for symbols and\n * SPA paths.\n */\nexport function convertManifestToBundleGraph(\n  manifest: QwikManifest,\n  bundleGraphAdders?: Set<BundleGraphAdder>\n): QwikBundleGraph {\n  const bundleGraph: QwikBundleGraph = [];\n  if (!manifest.bundles) {\n    return [];\n  }\n  // All known chunks and symbols\n  const graph = { ...manifest.bundles };\n  for (const [symbol, bundleName] of Object.entries(manifest.mapping)) {\n    const hash = getSymbolHash(symbol);\n    if (hash) {\n      /**\n       * We use dynamic imports so that we will get probabilities for the bundle when preloading the\n       * symbol. We still confirm load at 100% probability with the bundle name.\n       */\n      graph[hash] = { dynamicImports: [bundleName] } as QwikBundle;\n    }\n  }\n  // Routes etc\n  if (bundleGraphAdders) {\n    const combined = { ...manifest, bundles: graph };\n    for (const adder of bundleGraphAdders) {\n      const result = adder(combined);\n      if (result) {\n        Object.assign(graph, result);\n      }\n    }\n  }\n\n  // Filter out external and non-segment dynamic imports\n  for (const bundleName of Object.keys(graph)) {\n    const bundle = graph[bundleName];\n    const imports = bundle.imports?.filter((dep) => graph[dep]) || [];\n    const dynamicImports =\n      bundle.dynamicImports?.filter(\n        // we only want to include dynamic imports that belong to the app\n        // e.g. not all languages supported by shiki\n        (dep) =>\n          graph[dep] &&\n          // either there are qrls\n          (graph[dep].symbols ||\n            // or it's a dynamic import from the app source\n            graph[dep].origins?.some((o) => !o.includes('node_modules')))\n      ) || [];\n\n    /**\n     * Overwrite so we don't mutate the given objects. Be sure to copy all properties we use during\n     * and after the conversion.\n     */\n    graph[bundleName] = {\n      ...bundle,\n      imports,\n      dynamicImports,\n    };\n  }\n\n  // Remove unused bundles\n  const notUsed = new Set(Object.keys(graph));\n  for (const bundleName of Object.keys(graph)) {\n    for (const dep of graph[bundleName].imports!) {\n      notUsed.delete(dep);\n    }\n    for (const dep of graph[bundleName].dynamicImports!) {\n      notUsed.delete(dep);\n    }\n  }\n  for (const bundleName of notUsed) {\n    const bundle = graph[bundleName];\n    if (!bundle.imports?.length && !bundle.dynamicImports?.length) {\n      delete graph[bundleName];\n    }\n  }\n\n  const names = Object.keys(graph);\n  const map = new Map<string, { index: number; deps: Set<string> }>();\n  const clearTransitiveDeps = (\n    parentDeps: Set<string>,\n    bundleName: string,\n    seen: Set<string> = new Set()\n  ) => {\n    const bundle = graph[bundleName];\n    for (const dep of bundle.imports!) {\n      if (parentDeps.has(dep)) {\n        parentDeps.delete(dep);\n      }\n      if (!seen.has(dep)) {\n        seen.add(dep);\n        clearTransitiveDeps(parentDeps, dep, seen);\n      }\n    }\n  };\n\n  /**\n   * First pass to collect minimal dependency lists and allocate space for dependencies. Minimal\n   * means that if one of your dependencies depends on another of your dependencies, there's no need\n   * to add that other dependency.\n   */\n  for (const bundleName of names) {\n    const bundle = graph[bundleName];\n    // external dependencies are not included in `graph`\n    const deps = new Set(bundle.imports!);\n    for (const depName of deps) {\n      clearTransitiveDeps(deps, depName);\n    }\n    const dynDeps = new Set(bundle.dynamicImports!);\n    const depProbability = new Map<string, number>();\n    for (const depName of dynDeps) {\n      clearTransitiveDeps(dynDeps, depName);\n      const dep = graph[depName];\n\n      // Calculate the probability of the dependency\n      // Start with a 50% chance\n      let probability = 0.5;\n      // Add a 8% chance for each interactivity point (max 40%)\n      probability += (dep.interactivity || 0) * 0.08;\n\n      // If the dependency has a segment from the same parent, it's more likely to be loaded\n      if (bundle.origins && dep.origins) {\n        for (const origin of bundle.origins) {\n          if (dep.origins.some((o) => o.startsWith(origin))) {\n            // Add a 25% chance\n            probability += 0.25;\n            break;\n          }\n        }\n      }\n\n      // If the dependency is a likely big import graph, it should be loaded earlier so it doesn't get blocked by smaller files, but when unlikely it should be loaded later so it doesn't block other files\n      if (dep.total > slowSize) {\n        probability += probability > 0.5 ? 0.02 : -0.02;\n      }\n      // OTOH, if the dependency is small, load it sooner since it won't block much\n      if (dep.total < 1000) {\n        probability += 0.15;\n      }\n\n      depProbability.set(depName, Math.min(probability, 0.99));\n    }\n\n    if (dynDeps.size > 0) {\n      const sorted = Array.from(dynDeps).sort(\n        (a, b) => depProbability.get(b)! - depProbability.get(a)!\n      );\n      let lastProbability = -1;\n      // We rely on the Set keeping the items in order, everything after this is dynamic\n      for (const depName of sorted) {\n        if (depProbability.get(depName)! !== lastProbability) {\n          lastProbability = depProbability.get(depName)!;\n          deps.add(-Math.round(lastProbability * 10) as any as string);\n        }\n        deps.add(depName);\n      }\n    }\n    const index = bundleGraph.length;\n    bundleGraph.push(bundleName);\n    // allocate space for the dependency indices\n    for (let i = 0; i < deps.size; i++) {\n      bundleGraph.push(null!);\n    }\n    map.set(bundleName, { index, deps });\n  }\n\n  // Second pass to set the dependency indices\n  for (const bundleName of names) {\n    const bundle = map.get(bundleName)!;\n    // eslint-disable-next-line prefer-const\n    let { index, deps } = bundle;\n    index++;\n    for (const depName of deps) {\n      if (typeof depName === 'number') {\n        // negative number means dynamic import\n        bundleGraph[index++] = depName;\n        continue;\n      }\n      const dep = map.get(depName)!;\n      const depIndex = dep.index;\n      bundleGraph[index++] = depIndex;\n    }\n  }\n\n  return bundleGraph;\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/bundle-graph.unit.ts",
    "content": "import { type QwikBundle, type QwikManifest } from '@builder.io/qwik/optimizer';\nimport path from 'node:path';\nimport { describe, expect, test } from 'vitest';\nimport { generateManifestFromBundles } from '../manifest';\nimport { convertManifestToBundleGraph } from './bundle-graph';\n// You can generate this file by uncommenting the writing code in manifest.ts, building, running `pnpm build.client` in the starters/apps/preload-test dir and moving the output\nimport outputBundles from './fixture-output-bundles.json';\n\ndescribe('convertManifestToBundleGraph', () => {\n  const size = 0,\n    total = 0;\n  const fakeManifest = {\n    bundles: {\n      'app.js': { size, total, imports: ['static-dep.js', '@external-dep'] },\n      'static-dep.js': {\n        size,\n        total,\n        dynamicImports: ['@other', 'transitive-dep.js', 'dynamic-dep.js', 'no-symbols.js'],\n      },\n      'dynamic-dep.js': {\n        size,\n        total,\n        imports: ['static-dep.js', 'transitive-dep.js', '@external-dep'],\n        dynamicImports: ['has-a-symbol.js', 'boring-dep.js', 'no-symbols.js'],\n        origins: ['dynamic-dep.js'],\n        symbols: ['sym1'],\n      },\n      'transitive-dep.js': { size, total, symbols: ['sym4'] },\n      'not-used.js': { size, total },\n      'has-a-symbol.js': {\n        size,\n        total,\n        dynamicImports: ['large-file.js'],\n        symbols: ['sym2'],\n        origins: ['dynamic-dep.js_handleClick_sym2.js'],\n      },\n      'no-symbols.js': { size, total },\n      'boring-dep.js': { size, total, symbols: ['sym5'], origins: ['boring-dep.js'] },\n      'large-file.js': { size: 100000, total: 100000, symbols: ['sym3'] },\n    } as Record<string, QwikBundle>,\n    mapping: { sym1: 'dynamic-dep.js', sym2: 'has-a-symbol.js', sym3: 'large-file.js' },\n    symbols: {},\n    preloader: 'no-symbols.js',\n    manifestHash: '123',\n    version: '1.0.0',\n  } as QwikManifest;\n\n  test('trivial example', () => {\n    expect(convertManifestToBundleGraph(fakeManifest)).toEqual([\n      'app.js', // 0\n      2,\n      'static-dep.js', // 2\n      -7,\n      5,\n      // doesn't list 13 because it's also statically imported by dynamic-dep.js\n      'dynamic-dep.js', // 5\n      2,\n      12,\n      -9,\n      13,\n      -7,\n      16,\n      'transitive-dep.js', // 12\n      'has-a-symbol.js', // 13\n      -5,\n      17,\n      'boring-dep.js', // 16\n      'large-file.js', // 17\n      'sym1', // 18\n      -7,\n      5,\n      'sym2', // 21\n      -7,\n      13,\n      'sym3', // 24\n      -5,\n      17,\n    ]);\n  });\n\n  test('empty', () => {\n    expect(convertManifestToBundleGraph({} as any)).toEqual([]);\n  });\n\n  test('simple file set', () => {\n    const manifest = {\n      bundles: {\n        'a.js': { size, total, imports: ['b.js'], dynamicImports: ['c.js'] },\n        'b.js': { size, total, dynamicImports: ['c.js'] },\n        'c.js': { size, total, symbols: ['sym1'] },\n      } as Record<string, QwikBundle>,\n      mapping: {},\n    } as QwikManifest;\n    expect(convertManifestToBundleGraph(manifest)).toEqual([\n      'a.js', // 0\n      4,\n      -7,\n      7,\n      'b.js', // 4\n      -7,\n      7,\n      'c.js', // 7\n    ]);\n  });\n\n  test('adder', () => {\n    expect(\n      convertManifestToBundleGraph(\n        fakeManifest,\n        new Set([\n          (manifest) => {\n            return {\n              // Remove dynamic imports from dynamic-dep.js\n              'dynamic-dep.js': { ...manifest.bundles['dynamic-dep.js'], dynamicImports: [] },\n            };\n          },\n          (_manifest) => {\n            return {\n              // Add a route\n              'dashboard/': {\n                imports: ['static-dep.js'],\n                dynamicImports: ['transitive-dep.js'],\n              },\n            };\n          },\n        ])\n      )\n    ).toEqual([\n      'app.js', // 0\n      2,\n      'static-dep.js', // 2\n      -7,\n      5,\n      'dynamic-dep.js', // 5\n      2,\n      8,\n      'transitive-dep.js', // 8\n      'has-a-symbol.js', // 9\n      -5,\n      12,\n      'large-file.js', // 12\n      'sym1', // 13\n      -7,\n      5,\n      'sym2', // 16\n      -7,\n      9,\n      'sym3', // 19\n      -5,\n      12,\n      'dashboard/', // 22\n      2,\n      -7,\n      8,\n    ]);\n  });\n\n  test(`works`, () => {\n    const manifest = generateManifestFromBundles(\n      path as any,\n      outputBundles.segments as any,\n      [],\n      outputBundles.bundles as any,\n      { rootDir: '/', outDir: '/' } as any,\n      console.error,\n      (p) => path.relative('build', p)\n    );\n\n    // Interactivity scores\n    expect(\n      Object.fromEntries(\n        Object.entries(manifest.bundles).map(([k, v]) => [\n          k,\n          `${v.interactivity} (${v.size}/${v.total})`,\n        ])\n      )\n    ).toMatchInlineSnapshot(`\n      {\n        \"@qwik-city-plan.js\": \"0 (4886/7301)\",\n        \"core.js\": \"0 (4954/4954)\",\n        \"index.js\": \"0 (1001/8370)\",\n        \"index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\": \"2 (4954/12323)\",\n        \"index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\": \"1 (4954/9908)\",\n        \"index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\": \"1 (598/5552)\",\n        \"index.qwik.mjs_GetForm_component_amqstTwiNo0.js\": \"2 (4954/24646)\",\n        \"index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\": \"1 (730/5684)\",\n        \"index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\": \"1 (4954/9908)\",\n        \"index.qwik.mjs_Link_component_bp3n7NtzXfs.js\": \"2 (3091/22783)\",\n        \"index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\": \"1 (957/5911)\",\n        \"index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\": \"1 (4954/24646)\",\n        \"index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\": \"2 (4954/24646)\",\n        \"index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\": \"1 (4954/9908)\",\n        \"index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\": \"2 (3792/23484)\",\n        \"index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\": \"1 (4954/31947)\",\n        \"index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\": \"1 (4954/24646)\",\n        \"index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\": \"2 (4954/4954)\",\n        \"index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\": \"3 (4954/31947)\",\n        \"index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\": \"2 (2944/22636)\",\n        \"index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\": \"1 (4954/9908)\",\n        \"index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\": \"1 (4954/24646)\",\n        \"index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\": \"1 (4954/4954)\",\n        \"index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\": \"3 (628/5582)\",\n        \"index.tsx_about_component_m7u9ARcfDGU.js\": \"2 (2305/9674)\",\n        \"index.tsx_about_component_useStyles_WOcPLNnm2is.js\": \"2 (1135/1135)\",\n        \"index.tsx_form_component_ds9jIPT1g9s.js\": \"2 (4886/45200)\",\n        \"index.tsx_form_component_useStyles_0pasaG6nmEA.js\": \"2 (2158/2158)\",\n        \"index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\": \"5 (4886/9840)\",\n        \"index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\": \"1 (4886/20625)\",\n        \"index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\": \"2 (4886/4886)\",\n        \"index.tsx_routes_component_useTask_99K9SAWjPFQ.js\": \"3 (902/5856)\",\n        \"index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\": \"3 (935/16674)\",\n        \"index.tsx_routes_component_vG0UuU4cNCg.js\": \"2 (4886/12255)\",\n        \"index2.js\": \"0 (771/8140)\",\n        \"index3.js\": \"0 (930/20622)\",\n        \"layout.js\": \"0 (4886/12255)\",\n        \"layout.tsx_layout_component_SHtFir1Ia94.js\": \"2 (2598/22290)\",\n        \"layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\": \"2 (4226/9180)\",\n        \"layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\": \"2 (1207/1207)\",\n        \"preload-helper.js\": \"0 (2415/2415)\",\n        \"preloader.js\": \"0 (4954/4954)\",\n        \"qwik-city.js\": \"0 (4954/12323)\",\n        \"root.js\": \"0 (4886/12255)\",\n        \"root.tsx_root_component_9PcKHFjikV0.js\": \"2 (4886/24578)\",\n        \"router-head.tsx_RouterHead_component_dAo05yeFq1I.js\": \"2 (4886/24578)\",\n        \"src-vendor-lib-helper.ts.js\": \"0 (4886/4886)\",\n        \"src-vendor-lib-libA.ts.js\": \"0 (465/5351)\",\n        \"src-vendor-lib-libB.ts.js\": \"0 (4886/9772)\",\n      }\n    `);\n\n    expect(convertManifestToBundleGraph(manifest)).toMatchInlineSnapshot(`\n      [\n        \"@qwik-city-plan.js\",\n        130,\n        -5,\n        8,\n        108,\n        113,\n        117,\n        \"core.js\",\n        \"index.js\",\n        7,\n        130,\n        -9,\n        96,\n        -5,\n        146,\n        148,\n        \"index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\",\n        7,\n        \"index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\",\n        7,\n        130,\n        -6,\n        16,\n        \"index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\",\n        7,\n        \"index.qwik.mjs_GetForm_component_amqstTwiNo0.js\",\n        131,\n        -6,\n        30,\n        32,\n        \"index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\",\n        7,\n        \"index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\",\n        7,\n        \"index.qwik.mjs_Link_component_bp3n7NtzXfs.js\",\n        131,\n        -6,\n        39,\n        41,\n        \"index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\",\n        7,\n        \"index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\",\n        131,\n        \"index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\",\n        131,\n        -6,\n        47,\n        \"index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\",\n        7,\n        \"index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\",\n        0,\n        131,\n        \"index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\",\n        131,\n        -8,\n        64,\n        -7,\n        63,\n        -6,\n        49,\n        61,\n        \"index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\",\n        131,\n        \"index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\",\n        \"index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\",\n        0,\n        131,\n        \"index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\",\n        7,\n        \"index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\",\n        131,\n        \"index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\",\n        131,\n        \"index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\",\n        \"index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\",\n        7,\n        \"index.tsx_about_component_m7u9ARcfDGU.js\",\n        7,\n        130,\n        -7,\n        81,\n        \"index.tsx_about_component_useStyles_WOcPLNnm2is.js\",\n        \"index.tsx_form_component_ds9jIPT1g9s.js\",\n        113,\n        -7,\n        86,\n        \"index.tsx_form_component_useStyles_0pasaG6nmEA.js\",\n        \"index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\",\n        7,\n        \"index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\",\n        8,\n        \"index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\",\n        \"index.tsx_routes_component_useTask_99K9SAWjPFQ.js\",\n        7,\n        \"index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\",\n        8,\n        \"index.tsx_routes_component_vG0UuU4cNCg.js\",\n        7,\n        130,\n        -9,\n        87,\n        -8,\n        92,\n        94,\n        -7,\n        91,\n        -6,\n        89,\n        \"index2.js\",\n        7,\n        130,\n        -9,\n        76,\n        \"index3.js\",\n        131,\n        -9,\n        82,\n        \"layout.js\",\n        7,\n        130,\n        -9,\n        124,\n        \"layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\",\n        7,\n        \"layout.tsx_layout_component_SHtFir1Ia94.js\",\n        131,\n        -7,\n        122,\n        129,\n        \"layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\",\n        \"preload-helper.js\",\n        \"qwik-city.js\",\n        7,\n        130,\n        \"root.js\",\n        7,\n        130,\n        -9,\n        139,\n        \"root.tsx_root_component_9PcKHFjikV0.js\",\n        131,\n        -9,\n        143,\n        \"router-head.tsx_RouterHead_component_dAo05yeFq1I.js\",\n        131,\n        \"src-vendor-lib-helper.ts.js\",\n        \"src-vendor-lib-libA.ts.js\",\n        145,\n        \"src-vendor-lib-libB.ts.js\",\n        145,\n        \"BjxcCeNQ9ak\",\n        -9,\n        87,\n        \"eevMxFvmCM8\",\n        -7,\n        122,\n        \"99K9SAWjPFQ\",\n        -8,\n        92,\n        \"n397ZlNS8UY\",\n        -8,\n        64,\n        \"0OaA1Rw0yxk\",\n        -8,\n        74,\n        \"HEFxKy9cwuk\",\n        -8,\n        94,\n        \"4XSnxjzQSYM\",\n        -7,\n        43,\n        \"9PcKHFjikV0\",\n        -7,\n        139,\n        \"KRtEZRf6Xh8\",\n        -7,\n        69,\n        \"OzSZb6UyaCs\",\n        -7,\n        52,\n        \"SHtFir1Ia94\",\n        -7,\n        124,\n        \"VJVmS9CcP1U\",\n        -7,\n        18,\n        \"amqstTwiNo0\",\n        -7,\n        25,\n        \"bp3n7NtzXfs\",\n        -7,\n        34,\n        \"dAo05yeFq1I\",\n        -7,\n        143,\n        \"ds9jIPT1g9s\",\n        -7,\n        82,\n        \"m7u9ARcfDGU\",\n        -7,\n        76,\n        \"vG0UuU4cNCg\",\n        -7,\n        96,\n        \"0pasaG6nmEA\",\n        -7,\n        86,\n        \"Iyy38y0K3Hw\",\n        -7,\n        91,\n        \"MOLFIZOhXmE\",\n        -7,\n        129,\n        \"OC53PuG02nc\",\n        -7,\n        63,\n        \"WOcPLNnm2is\",\n        -7,\n        81,\n        \"AaY04hL3w3A\",\n        -6,\n        71,\n        \"EMGw8L1tB9Y\",\n        -6,\n        73,\n        \"WcRKLKMW88U\",\n        -6,\n        67,\n        \"p0qDGZV34Qs\",\n        -6,\n        23,\n        \"0s3bilOgUys\",\n        -6,\n        16,\n        \"8hsX2DP6YsI\",\n        -6,\n        30,\n        \"FpLYno2MZMA\",\n        -6,\n        41,\n        \"IDVXhQLfmNQ\",\n        -6,\n        49,\n        \"OBdjRsvd4IY\",\n        -6,\n        32,\n        \"cTkWSVfU9vo\",\n        -6,\n        47,\n        \"ep3t0fF0SDA\",\n        -6,\n        89,\n        \"gZBt5yIBEB4\",\n        -6,\n        39,\n        \"zQJLLuPn6rA\",\n        -6,\n        61,\n      ]\n    `);\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/click-to-component.html",
    "content": "<style>\n  #qwik-inspector-overlay {\n    position: fixed;\n    background: rgba(24, 182, 246, 0.27);\n    pointer-events: none;\n    box-sizing: border-box;\n    border: 2px solid rgba(172, 126, 244, 0.46);\n    border-radius: 4px;\n    contain: strict;\n    cursor: pointer;\n    z-index: 999999;\n  }\n\n  #qwik-inspector-info-popup {\n    position: fixed;\n    bottom: 10px;\n    right: 10px;\n    font-family: monospace;\n    background: #000000c2;\n    color: white;\n    padding: 10px 20px;\n    border-radius: 8px;\n    box-shadow:\n      0 20px 25px -5px rgb(0 0 0 / 34%),\n      0 8px 10px -6px rgb(0 0 0 / 24%);\n    backdrop-filter: blur(4px);\n    -webkit-animation: fadeOut 0.3s 3s ease-in-out forwards;\n    animation: fadeOut 0.3s 3s ease-in-out forwards;\n    z-index: 999999;\n    contain: layout;\n  }\n\n  #qwik-inspector-info-popup p {\n    margin: 0px;\n  }\n\n  @-webkit-keyframes fadeOut {\n    0% {\n      opacity: 1;\n    }\n\n    100% {\n      opacity: 0;\n    }\n  }\n\n  @keyframes fadeOut {\n    0% {\n      opacity: 1;\n    }\n\n    100% {\n      opacity: 0;\n      visibility: hidden;\n    }\n  }\n</style>\n<div id=\"qwik-inspector-info-popup\" aria-hidden=\"true\">Click-to-Source</div>\n<script>\n  (function () {\n    const inspectAttribute = 'data-qwik-inspector';\n    const hotKeys = globalThis.qwikdevtools.hotKeys;\n    const srcDir = globalThis.qwikdevtools.srcDir;\n    document.querySelector('#qwik-inspector-info-popup').textContent =\n      `Click-to-Source: ${hotKeys.join(' + ')}`;\n    console.debug(\n      '%c🔍 Qwik Click-To-Source',\n      'background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;',\n      `Hold-press the '${hotKeys.join(' + ')}' key${\n        (hotKeys.length > 1 && 's') || ''\n      } and click a component to jump directly to the source code in your IDE!`\n    );\n    window.__qwik_inspector_state = {\n      pressedKeys: new Set(),\n    };\n    const origin = 'http://local.local';\n    const body = document.body;\n    const overlay = document.createElement('div');\n    overlay.id = 'qwik-inspector-overlay';\n    overlay.setAttribute('aria-hidden', 'true');\n    body.appendChild(overlay);\n\n    function findContainer(el) {\n      if (el && el instanceof Element) {\n        return el.closest(`[${inspectAttribute}]`);\n      }\n      return null;\n    }\n\n    document.addEventListener(\n      'keydown',\n      (event) => {\n        window.__qwik_inspector_state.pressedKeys.add(event.code);\n        updateOverlay();\n      },\n      { capture: true }\n    );\n\n    document.addEventListener(\n      'keyup',\n      (event) => {\n        window.__qwik_inspector_state.pressedKeys.delete(event.code);\n        updateOverlay();\n      },\n      { capture: true }\n    );\n\n    window.addEventListener(\n      'blur',\n      (event) => {\n        window.__qwik_inspector_state.pressedKeys.clear();\n        updateOverlay();\n      },\n      { capture: true }\n    );\n\n    document.addEventListener(\n      'mouseover',\n      (event) => {\n        const target = findContainer(event.target);\n        if (target) {\n          window.__qwik_inspector_state.hoveredElement = target;\n        } else {\n          window.__qwik_inspector_state.hoveredElement = undefined;\n        }\n        updateOverlay();\n      },\n      { capture: true }\n    );\n\n    document.addEventListener(\n      'click',\n      (event) => {\n        if (isActive()) {\n          window.__qwik_inspector_state.pressedKeys.clear();\n          const target = findContainer(event.target);\n          if (target) {\n            event.preventDefault();\n            event.stopPropagation();\n            const inspectUrl = target.getAttribute(inspectAttribute);\n            if (inspectUrl !== 'false') {\n              body.style.setProperty('cursor', 'progress');\n              const match = inspectUrl.match(/^(.*?)(:\\d+(:\\d+)?)?$/);\n              if (match) {\n                const [, filePath, location] = match;\n                fetch(`${filePath}?editor${location}`).then(() => {\n                  body.style.removeProperty('cursor');\n                });\n              }\n            }\n          }\n        }\n      },\n      { capture: true }\n    );\n\n    document.addEventListener(\n      'contextmenu',\n      (event) => {\n        if (isActive()) {\n          window.__qwik_inspector_state.pressedKeys.clear();\n          const target = findContainer(event.target);\n          if (target) {\n            event.preventDefault();\n          }\n        }\n      },\n      { capture: true }\n    );\n\n    function updateOverlay() {\n      const hoverElement = window.__qwik_inspector_state.hoveredElement;\n      if (hoverElement && isActive()) {\n        const rect = hoverElement.getBoundingClientRect();\n        overlay.style.setProperty('height', rect.height + 'px');\n        overlay.style.setProperty('width', rect.width + 'px');\n        overlay.style.setProperty('top', rect.top + 'px');\n        overlay.style.setProperty('left', rect.left + 'px');\n        overlay.style.setProperty('visibility', 'visible');\n        body.style.setProperty('cursor', 'pointer');\n      } else {\n        overlay.style.setProperty('height', '0px');\n        overlay.style.setProperty('width', '0px');\n        overlay.style.setProperty('visibility', 'hidden');\n        body.style.removeProperty('cursor');\n      }\n    }\n\n    function checkKeysArePressed() {\n      const activeKeys = Array.from(window.__qwik_inspector_state.pressedKeys).map((key) =>\n        key ? key.replace(/(Left|Right)$/g, '') : undefined\n      );\n      return hotKeys.every((key) => activeKeys.includes(key));\n    }\n\n    function isActive() {\n      return checkKeysArePressed();\n    }\n    window.addEventListener('resize', updateOverlay);\n    document.addEventListener('scroll', updateOverlay);\n  })();\n</script>\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/error-host.html",
    "content": "<script>\n  document.addEventListener('qerror', (ev) => {\n    const ErrorOverlay = customElements.get('vite-error-overlay');\n    if (!ErrorOverlay) {\n      return;\n    }\n    const err = ev.detail.error;\n    const overlay = new ErrorOverlay(err);\n    document.body.appendChild(overlay);\n  });\n</script>\n<script>\n  /**\n   * Usage:\n   *\n   * <errored-host></errored-host>\n   */\n  class ErroredHost extends HTMLElement {\n    get _root() {\n      return this.shadowRoot || this;\n    }\n\n    constructor() {\n      super();\n      const self = this;\n\n      this.state = {};\n      if (!this.props) {\n        this.props = {};\n      }\n\n      this.componentProps = ['children', 'error'];\n\n      // used to keep track of all nodes created by show/for\n      this.nodesToDestroy = [];\n      // batch updates\n      this.pendingUpdate = false;\n\n      this.attachShadow({ mode: 'open' });\n    }\n\n    destroyAnyNodes() {\n      // destroy current view template refs before rendering again\n      this.nodesToDestroy.forEach((el) => el.remove());\n      this.nodesToDestroy = [];\n    }\n\n    connectedCallback() {\n      this.getAttributeNames().forEach((attr) => {\n        const jsVar = attr.replace(/-/g, '');\n        const regexp = new RegExp(jsVar, 'i');\n        this.componentProps.forEach((prop) => {\n          if (regexp.test(prop)) {\n            const attrValue = this.getAttribute(attr);\n            if (this.props[prop] !== attrValue) {\n              this.props[prop] = attrValue;\n            }\n          }\n        });\n      });\n\n      this._root.innerHTML = `\n\n        <template data-el=\"show-errored-host\">\n        <div class=\"error\">\n          <template data-el=\"div-errored-host-2\">\n            <!-- String(props.error) -->\n          </template>\n        </div>\n        </template>\n\n        <div class=\"arrow\">👇 Uncaught error happened here 👇\n          <span class=\"dev-tools\">DevTools: Cmd+Alt+I</span>\n        </div>\n        <div class=\"div\">\n          <slot></slot>\n        </div>\n\n        <style>\n          .error {\n            border-radius: 5px 5px 0px 0;\n            background: black;\n            color: white;\n            font-family: monospace;\n            font-size: 12px;\n            margin: 0;\n            padding: 10px;\n          }\n          .arrow {\n            background: #f47e81;\n            color: black;\n            font-size: 14px;\n            padding: 10px;\n            text-align: center;\n            font-family: sans-serif;\n          }\n          .dev-tools {\n            background: red;\n            padding: 2px 5px;\n            border-radius: 3px;\n            font-weight: 800;\n          }\n          .div {\n            outline: 5px solid red;\n            border-radius: 10px;\n          }\n        </style>`;\n      this.pendingUpdate = true;\n\n      this.render();\n      this.onMount();\n      this.pendingUpdate = false;\n      this.update();\n    }\n\n    showContent(el) {\n      // https://developer.mozilla.org/en-US/docs/Web/API/HTMLTemplateElement/content\n      // grabs the content of a node that is between <template> tags\n      // iterates through child nodes to register all content including text elements\n      // attaches the content after the template\n\n      const elementFragment = el.content.cloneNode(true);\n      const children = Array.from(elementFragment.childNodes);\n      children.forEach((child) => {\n        if (el?.scope) {\n          child.scope = el.scope;\n        }\n        if (el?.context) {\n          child.context = el.context;\n        }\n        this.nodesToDestroy.push(child);\n      });\n      el.after(elementFragment);\n    }\n\n    onMount() {}\n\n    onUpdate() {}\n\n    update() {\n      if (this.pendingUpdate === true) {\n        return;\n      }\n      this.pendingUpdate = true;\n      this.render();\n      this.onUpdate();\n      this.pendingUpdate = false;\n    }\n\n    render() {\n      // re-rendering needs to ensure that all nodes generated by for/show are refreshed\n      this.destroyAnyNodes();\n      this.updateBindings();\n    }\n\n    updateBindings() {\n      this._root.querySelectorAll(\"[data-el='show-errored-host']\").forEach((el) => {\n        const whenCondition = this.props.error;\n        if (whenCondition) {\n          this.showContent(el);\n        }\n      });\n\n      this._root.querySelectorAll(\"[data-el='div-errored-host-2']\").forEach((el) => {\n        this.renderTextNode(el, String(this.props.error));\n      });\n    }\n\n    // Helper to render content\n    renderTextNode(el, text) {\n      const textNode = document.createTextNode(text);\n      if (el?.scope) {\n        textNode.scope = el.scope;\n      }\n      if (el?.context) {\n        textNode.context = el.context;\n      }\n      el.after(textNode);\n      this.nodesToDestroy.push(el.nextSibling);\n    }\n  }\n\n  customElements.define('errored-host', ErroredHost);\n</script>\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/eslint-plugin.ts",
    "content": "import type { Rollup } from 'vite';\nimport type { ESLint, Linter } from 'eslint';\nimport type { OptimizerSystem } from '../types';\n\nexport interface QwikLinter {\n  lint(ctx: Rollup.PluginContext, code: string, id: string): void;\n}\n\nexport async function createLinter(\n  sys: OptimizerSystem,\n  rootDir: string,\n  tsconfigFileNames: string[]\n): Promise<QwikLinter> {\n  const module: typeof import('eslint') = await sys.dynamicImport('eslint');\n\n  let eslint = new module.ESLint({ cache: true }) as ESLint;\n  const eslintConfig = await eslint.calculateConfigForFile('no-real-file.tsx');\n  const invalidEslintConfig = eslintConfig.parser === null;\n\n  if (invalidEslintConfig) {\n    const options: ESLint.Options = {\n      cache: true,\n\n      overrideConfig: {\n        languageOptions: {\n          parserOptions: {\n            tsconfigRootDir: rootDir,\n            project: tsconfigFileNames,\n            ecmaVersion: 2021,\n            sourceType: 'module',\n            ecmaFeatures: {\n              jsx: true,\n            },\n          },\n        },\n      },\n    };\n    eslint = new module.ESLint(options) as ESLint;\n  }\n\n  return {\n    async lint(ctx: Rollup.PluginContext, code: string, id: string) {\n      try {\n        const filePath = parseRequest(id);\n        if (await eslint.isPathIgnored(filePath)) {\n          return null;\n        }\n        const report = await eslint.lintText(code, {\n          filePath,\n        });\n\n        report.forEach((file) => {\n          for (const message of file.messages) {\n            if (message.ruleId != null && !message.ruleId.startsWith('qwik/')) {\n              continue;\n            }\n            const err = createRollupError(file.filePath, message);\n            ctx.warn(err);\n          }\n        });\n      } catch (err) {\n        console.warn(err);\n      }\n    },\n  };\n}\n\nfunction parseRequest(id: string) {\n  return id.split('?', 2)[0];\n}\n\nfunction createRollupError(id: string, reportMessage: Linter.LintMessage) {\n  const err: Rollup.RollupError = Object.assign(new Error(reportMessage.message), {\n    id,\n    plugin: 'vite-plugin-eslint',\n    loc: {\n      file: id,\n      column: reportMessage.column,\n      line: reportMessage.line,\n    },\n    stack: '',\n  });\n  return err;\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/fixture-output-bundles.json",
    "content": "{\n  \"segments\": [\n    {\n      \"origin\": \"root.tsx\",\n      \"name\": \"s_9PcKHFjikV0\",\n      \"entry\": \"root.tsx_entry_root\",\n      \"displayName\": \"root.tsx_root_component\",\n      \"hash\": \"9PcKHFjikV0\",\n      \"canonicalFilename\": \"root.tsx_root_component_9PcKHFjikV0\",\n      \"path\": \"\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [238, 675]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_p0qDGZV34Qs\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_Form\",\n      \"displayName\": \"index.qwik.mjs_Form_form_onSubmit\",\n      \"hash\": \"p0qDGZV34Qs\",\n      \"canonicalFilename\": \"index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [58110, 58224]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_0OaA1Rw0yxk\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_usePreventNavigateQrl\",\n      \"displayName\": \"index.qwik.mjs_usePreventNavigateQrl_useVisibleTask\",\n      \"hash\": \"0OaA1Rw0yxk\",\n      \"canonicalFilename\": \"index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useVisibleTask$\",\n      \"captures\": true,\n      \"loc\": [22543, 22571]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_gZBt5yIBEB4\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_Link\",\n      \"displayName\": \"index.qwik.mjs_Link_component_handleClick\",\n      \"hash\": \"gZBt5yIBEB4\",\n      \"canonicalFilename\": \"index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_bp3n7NtzXfs\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [40963, 41389]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_KRtEZRf6Xh8\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_RouterOutlet\",\n      \"displayName\": \"index.qwik.mjs_RouterOutlet_component\",\n      \"hash\": \"KRtEZRf6Xh8\",\n      \"canonicalFilename\": \"index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [7100, 8254]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_0s3bilOgUys\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_ErrorBoundary\",\n      \"displayName\": \"index.qwik.mjs_ErrorBoundary_component_useOnWindow\",\n      \"hash\": \"0s3bilOgUys\",\n      \"canonicalFilename\": \"index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_VJVmS9CcP1U\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [57415, 57462]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_OzSZb6UyaCs\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_QwikCityProvider\",\n      \"displayName\": \"index.qwik.mjs_QwikCityProvider_component\",\n      \"hash\": \"OzSZb6UyaCs\",\n      \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [23979, 38218]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_n397ZlNS8UY\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_QwikCityProvider\",\n      \"displayName\": \"index.qwik.mjs_QwikCityProvider_component_useTask\",\n      \"hash\": \"n397ZlNS8UY\",\n      \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_OzSZb6UyaCs\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useTask$\",\n      \"captures\": true,\n      \"loc\": [28796, 38172]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_VJVmS9CcP1U\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_ErrorBoundary\",\n      \"displayName\": \"index.qwik.mjs_ErrorBoundary_component\",\n      \"hash\": \"VJVmS9CcP1U\",\n      \"canonicalFilename\": \"index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [57339, 57653]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_AaY04hL3w3A\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_serverQrl\",\n      \"displayName\": \"index.qwik.mjs_serverQrl_rpc\",\n      \"hash\": \"AaY04hL3w3A\",\n      \"canonicalFilename\": \"index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [52759, 55831]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_OC53PuG02nc\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_QwikCityProvider\",\n      \"displayName\": \"index.qwik.mjs_QwikCityProvider_component_useStyles\",\n      \"hash\": \"OC53PuG02nc\",\n      \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_OzSZb6UyaCs\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useStyles$\",\n      \"captures\": false,\n      \"loc\": [24005, 24039]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_4XSnxjzQSYM\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_QwikCityMockProvider\",\n      \"displayName\": \"index.qwik.mjs_QwikCityMockProvider_component\",\n      \"hash\": \"4XSnxjzQSYM\",\n      \"canonicalFilename\": \"index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [38420, 39625]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_OBdjRsvd4IY\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_GetForm\",\n      \"displayName\": \"index.qwik.mjs_GetForm_component_form_onSubmit\",\n      \"hash\": \"OBdjRsvd4IY\",\n      \"canonicalFilename\": \"index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_amqstTwiNo0\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [59343, 59723]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_amqstTwiNo0\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_GetForm\",\n      \"displayName\": \"index.qwik.mjs_GetForm_component\",\n      \"hash\": \"amqstTwiNo0\",\n      \"canonicalFilename\": \"index.qwik.mjs_GetForm_component_amqstTwiNo0\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [58979, 60132]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_zQJLLuPn6rA\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_QwikCityProvider\",\n      \"displayName\": \"index.qwik.mjs_QwikCityProvider_component_registerPreventNav\",\n      \"hash\": \"zQJLLuPn6rA\",\n      \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_OzSZb6UyaCs\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": false,\n      \"loc\": [25296, 26173]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_FpLYno2MZMA\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_Link\",\n      \"displayName\": \"index.qwik.mjs_Link_component_handlePrefetch\",\n      \"hash\": \"FpLYno2MZMA\",\n      \"canonicalFilename\": \"index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_bp3n7NtzXfs\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": false,\n      \"loc\": [40364, 40713]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_8hsX2DP6YsI\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_GetForm\",\n      \"displayName\": \"index.qwik.mjs_GetForm_component_form_onSubmit_1\",\n      \"hash\": \"8hsX2DP6YsI\",\n      \"canonicalFilename\": \"index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_amqstTwiNo0\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": false,\n      \"loc\": [59734, 60070]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_WcRKLKMW88U\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_routeActionQrl\",\n      \"displayName\": \"index.qwik.mjs_routeActionQrl_action_submit\",\n      \"hash\": \"WcRKLKMW88U\",\n      \"canonicalFilename\": \"index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [44681, 46326]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_IDVXhQLfmNQ\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_QwikCityProvider\",\n      \"displayName\": \"index.qwik.mjs_QwikCityProvider_component_goto\",\n      \"hash\": \"IDVXhQLfmNQ\",\n      \"canonicalFilename\": \"index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_OzSZb6UyaCs\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [26193, 28267]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_EMGw8L1tB9Y\",\n      \"entry\": null,\n      \"displayName\": \"index.qwik.mjs_spaInit_event\",\n      \"hash\": \"EMGw8L1tB9Y\",\n      \"canonicalFilename\": \"index.qwik.mjs_spaInit_event_EMGw8L1tB9Y\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"event$\",\n      \"captures\": false,\n      \"loc\": [1402, 7065]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_cTkWSVfU9vo\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_QwikCityMockProvider\",\n      \"displayName\": \"index.qwik.mjs_QwikCityMockProvider_component_goto\",\n      \"hash\": \"cTkWSVfU9vo\",\n      \"canonicalFilename\": \"index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": \"s_4XSnxjzQSYM\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": false,\n      \"loc\": [38810, 38888]\n    },\n    {\n      \"origin\": \"../../../../packages/qwik-city/lib/index.qwik.mjs\",\n      \"name\": \"s_bp3n7NtzXfs\",\n      \"entry\": \"../../../../packages/qwik-city/lib/index.qwik.mjs_entry_Link\",\n      \"displayName\": \"index.qwik.mjs_Link_component\",\n      \"hash\": \"bp3n7NtzXfs\",\n      \"canonicalFilename\": \"index.qwik.mjs_Link_component_bp3n7NtzXfs\",\n      \"path\": \"../../../../packages/qwik-city/lib\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [39652, 41942]\n    },\n    {\n      \"origin\": \"components/router-head/router-head.tsx\",\n      \"name\": \"s_dAo05yeFq1I\",\n      \"entry\": \"components/router-head/router-head.tsx_entry_RouterHead\",\n      \"displayName\": \"router-head.tsx_RouterHead_component\",\n      \"hash\": \"dAo05yeFq1I\",\n      \"canonicalFilename\": \"router-head.tsx_RouterHead_component_dAo05yeFq1I\",\n      \"path\": \"components/router-head\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [243, 1134]\n    },\n    {\n      \"origin\": \"routes/about/index.tsx\",\n      \"name\": \"s_WOcPLNnm2is\",\n      \"entry\": \"routes/about/index.tsx_entry_about\",\n      \"displayName\": \"index.tsx_about_component_useStyles\",\n      \"hash\": \"WOcPLNnm2is\",\n      \"canonicalFilename\": \"index.tsx_about_component_useStyles_WOcPLNnm2is\",\n      \"path\": \"routes/about\",\n      \"extension\": \"js\",\n      \"parent\": \"s_m7u9ARcfDGU\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useStyles$\",\n      \"captures\": false,\n      \"loc\": [167, 766]\n    },\n    {\n      \"origin\": \"routes/about/index.tsx\",\n      \"name\": \"s_m7u9ARcfDGU\",\n      \"entry\": \"routes/about/index.tsx_entry_about\",\n      \"displayName\": \"index.tsx_about_component\",\n      \"hash\": \"m7u9ARcfDGU\",\n      \"canonicalFilename\": \"index.tsx_about_component_m7u9ARcfDGU\",\n      \"path\": \"routes/about\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [146, 1688]\n    },\n    {\n      \"origin\": \"routes/layout.tsx\",\n      \"name\": \"s_MOLFIZOhXmE\",\n      \"entry\": \"routes/layout.tsx_entry_layout\",\n      \"displayName\": \"layout.tsx_layout_component_useStyles\",\n      \"hash\": \"MOLFIZOhXmE\",\n      \"canonicalFilename\": \"layout.tsx_layout_component_useStyles_MOLFIZOhXmE\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": \"s_SHtFir1Ia94\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useStyles$\",\n      \"captures\": false,\n      \"loc\": [190, 957]\n    },\n    {\n      \"origin\": \"routes/layout.tsx\",\n      \"name\": \"s_eevMxFvmCM8\",\n      \"entry\": \"routes/layout.tsx_entry_layout\",\n      \"displayName\": \"layout.tsx_layout_component_div_header_div_label_input_bind_checked\",\n      \"hash\": \"eevMxFvmCM8\",\n      \"canonicalFilename\": \"layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": \"s_SHtFir1Ia94\",\n      \"ctxKind\": \"eventHandler\",\n      \"ctxName\": \"onInput$\",\n      \"captures\": true,\n      \"loc\": [0, 0]\n    },\n    {\n      \"origin\": \"routes/layout.tsx\",\n      \"name\": \"s_SHtFir1Ia94\",\n      \"entry\": \"routes/layout.tsx_entry_layout\",\n      \"displayName\": \"layout.tsx_layout_component\",\n      \"hash\": \"SHtFir1Ia94\",\n      \"canonicalFilename\": \"layout.tsx_layout_component_SHtFir1Ia94\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [169, 1737]\n    },\n    {\n      \"origin\": \"routes/index.tsx\",\n      \"name\": \"s_vG0UuU4cNCg\",\n      \"entry\": \"routes/index.tsx_entry_routes\",\n      \"displayName\": \"index.tsx_routes_component\",\n      \"hash\": \"vG0UuU4cNCg\",\n      \"canonicalFilename\": \"index.tsx_routes_component_vG0UuU4cNCg\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [395, 1763]\n    },\n    {\n      \"origin\": \"routes/index.tsx\",\n      \"name\": \"s_ep3t0fF0SDA\",\n      \"entry\": \"routes/index.tsx_entry_routes\",\n      \"displayName\": \"index.tsx_routes_component_handleClick\",\n      \"hash\": \"ep3t0fF0SDA\",\n      \"canonicalFilename\": \"index.tsx_routes_component_handleClick_ep3t0fF0SDA\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": \"s_vG0UuU4cNCg\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"$\",\n      \"captures\": true,\n      \"loc\": [956, 1095]\n    },\n    {\n      \"origin\": \"routes/index.tsx\",\n      \"name\": \"s_99K9SAWjPFQ\",\n      \"entry\": \"routes/index.tsx_entry_routes\",\n      \"displayName\": \"index.tsx_routes_component_useTask\",\n      \"hash\": \"99K9SAWjPFQ\",\n      \"canonicalFilename\": \"index.tsx_routes_component_useTask_99K9SAWjPFQ\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": \"s_vG0UuU4cNCg\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useTask$\",\n      \"captures\": true,\n      \"loc\": [876, 927]\n    },\n    {\n      \"origin\": \"routes/index.tsx\",\n      \"name\": \"s_Iyy38y0K3Hw\",\n      \"entry\": \"routes/index.tsx_entry_routes\",\n      \"displayName\": \"index.tsx_routes_component_useStyles\",\n      \"hash\": \"Iyy38y0K3Hw\",\n      \"canonicalFilename\": \"index.tsx_routes_component_useStyles_Iyy38y0K3Hw\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": \"s_vG0UuU4cNCg\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useStyles$\",\n      \"captures\": false,\n      \"loc\": [416, 645]\n    },\n    {\n      \"origin\": \"routes/index.tsx\",\n      \"name\": \"s_BjxcCeNQ9ak\",\n      \"entry\": \"routes/index.tsx_entry_routes\",\n      \"displayName\": \"index.tsx_routes_component_div_button_onClick\",\n      \"hash\": \"BjxcCeNQ9ak\",\n      \"canonicalFilename\": \"index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": \"s_vG0UuU4cNCg\",\n      \"ctxKind\": \"eventHandler\",\n      \"ctxName\": \"onClick$\",\n      \"captures\": true,\n      \"loc\": [1706, 1725]\n    },\n    {\n      \"origin\": \"routes/index.tsx\",\n      \"name\": \"s_HEFxKy9cwuk\",\n      \"entry\": \"routes/index.tsx_entry_routes\",\n      \"displayName\": \"index.tsx_routes_component_useVisibleTask\",\n      \"hash\": \"HEFxKy9cwuk\",\n      \"canonicalFilename\": \"index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk\",\n      \"path\": \"routes\",\n      \"extension\": \"js\",\n      \"parent\": \"s_vG0UuU4cNCg\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useVisibleTask$\",\n      \"captures\": true,\n      \"loc\": [731, 861]\n    },\n    {\n      \"origin\": \"routes/form/index.tsx\",\n      \"name\": \"s_0pasaG6nmEA\",\n      \"entry\": \"routes/form/index.tsx_entry_form\",\n      \"displayName\": \"index.tsx_form_component_useStyles\",\n      \"hash\": \"0pasaG6nmEA\",\n      \"canonicalFilename\": \"index.tsx_form_component_useStyles_0pasaG6nmEA\",\n      \"path\": \"routes/form\",\n      \"extension\": \"js\",\n      \"parent\": \"s_ds9jIPT1g9s\",\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"useStyles$\",\n      \"captures\": false,\n      \"loc\": [445, 2071]\n    },\n    {\n      \"origin\": \"routes/form/index.tsx\",\n      \"name\": \"s_ds9jIPT1g9s\",\n      \"entry\": \"routes/form/index.tsx_entry_form\",\n      \"displayName\": \"index.tsx_form_component\",\n      \"hash\": \"ds9jIPT1g9s\",\n      \"canonicalFilename\": \"index.tsx_form_component_ds9jIPT1g9s\",\n      \"path\": \"routes/form\",\n      \"extension\": \"js\",\n      \"parent\": null,\n      \"ctxKind\": \"function\",\n      \"ctxName\": \"component$\",\n      \"captures\": false,\n      \"loc\": [424, 3240]\n    }\n  ],\n  \"bundles\": {\n    \"build/root.js\": {\n      \"exports\": [\"default\"],\n      \"facadeModuleId\": \"/src/root.tsx\",\n      \"isDynamicEntry\": false,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/global.css\", \"/src/root.tsx\"],\n      \"name\": \"root\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/root.tsx_root_component_9PcKHFjikV0.js\"],\n      \"fileName\": \"build/root.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"c\", \"q\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/global.css\": {\n          \"code\": \"<removed 0 bytes>\",\n          \"originalLength\": 0,\n          \"removedExports\": [],\n          \"renderedExports\": [],\n          \"renderedLength\": 0\n        },\n        \"/src/root.tsx\": {\n          \"code\": \"<removed 47088 bytes>\",\n          \"originalLength\": 677,\n          \"removedExports\": [],\n          \"renderedExports\": [\"default\"],\n          \"renderedLength\": 47088\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { c as componentQrl, q as qrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/root.tsx\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/root.tsx\\\");\\nconst root = /* @__PURE__ */ componentQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./root.tsx_root_component_9PcKHFjikV0.js\\\"), true ? [] : void 0), \\\"s_9PcKHFjikV0\\\"));\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"Iw+aD0bt09LeKb23hnLMCtEbnhz54bG6HTbCjdohhBYLmNJUrITYo1ipOYzZDcphGSq3DubWQUh5bZ6KNzz4cg==sMLgP12JN/TNBNOzF5hKUNhCNuKIPaMjvU8uu7iCFJXGlqIQsPXTP/GRM1VwRUpTif2vanQVwyl1MU2EqRfOlQ==Uj2AvdwDdE6PPiO+uHfo4MbCnPYHiDwEmhQT4MiOQjvIjFDniUSqoq5iA51VVzmw/SEjQdQHK5XuiePFcr2Z6A==S1PNA/kzp8f0S4cD7HbDLk8EF0oiwue/uZC3R0wo/Ce12O61v/xQ9U+ZviJeOwkqx9D9Ytpxsd0it7TBn72Q4Q==/2fVMhl4yFRzH6xErcCshEXN2MkNoTNNniBQvzZf9rkafxVyjpPtqj8HPCScUqUmH3AgK4+9BCSEx0UGiFA0zQ==02pofPVCZT/nNRAIqsCEfdNF1iJtvnsNjbxWrpFEM+xWHVVuJWrQ38P1U85wkd2Gvo6+OMuwdkemQ8fhXqK9uw==tcrwGWX2OZQJJ/wOgJfTSUpaFOFDr+c7+BTHOoIM+gY5+RU7QdpqARvUnhYUsBuhn9eC22TOJJqmXeHdvfJi7Q==5kCMwHtPwjSXKVSfmZbiohwljlSwOP5wSC3qfMyZU8av/DIMbTWD6a7Ap7ENqVtI+bMyAalSZmnH0yvUIXkP9A==SWf7F70EUZjcEMFzFnjJHGiOISp5tdKoWYDHOudg2jDOJJxzHnfCGy8GuwXInastxu+vbiZdRwv0+CozKTUFmQ==k6ho73MLsYMj2ATchfbu+jzRycpoOJEgnmcyrob4NFrZVBQHKDXPOWegAPhkEkxPWcwSdAgadhkbAhskuosDdg==gyZjSPnvYmUOgr8cgVQJGzNY8BrFX3algThMj1QqQR9MQ+bhDB6iaFNMk7dk0gwYwqAmtko3NDb7KR2LsAF54w==wNfe3sYI3d/eCv4WeIa8ujowogU3JIqhRLzsiijCK2MeWjVMA77EckAeOQ7excGrPu9pzPyH5rOOSZsz2QKeUg==HzQTha/PcEr1szsCDk2ylhgMHz8xZIsR6dcVT4M7dkUOAv/fJmcDhPZZKVclxORBcJty/NUKH0/ONt/TPAuffg==3a7nWNoXIV7tOdfqO54gNJiCIv9VJBYUIJ5x1/zaDgKYcU2lobmaVEXfVgRbXNS0yHeg4fC/ZM/dMjb2RJkziA==dYWsk4EPWa4OQoWacn0C8P9Tvk2UB4np0fo2VELLkkijiUma+h8aVhIg6jIR9xxr1qXWgHx3Ap7maE8YD3PRVw==V+EdXgR56oQW3hH0Y7QgFHz4aXH0NGClcVGgFlPrrQwjojjHDYKnklPLnx/n5DFo0kik+mzBtw2N1j+2SwGYfw==YFqrVt29c4Vkkmc2KCb6p+PECaygIzNt528XqSemp4SLiZl9gO7ck+B2cX4ghrGACy8PaxoNsbO00UP55yvYWw==A/UddQYcyoJ0UL2p4Cu89PLAIX68Y3QP00PFlqMNPbpK0JMWz4QUERfvW/Wp31yvRS5D8PDWe0tsyA4pzODjYw==V/ZcodrIADYK1o4THF4nwXOGXRVQvxjmOH6PRd4BmY2poHN2SNr3ykAiJdL2XjBaD4lTgqrzFbNc8lVxIwcfIg==04cRwXZVmXfTAULOl7ZsCRlh2bPgzLavZjQArTOkkJj6wFWsxlBi6dmEQyUsruDbUUcGKUFut+Bh2gDjFaSSEw==UPAqmxx2WWViHvg1z0EyKvcP+L+Ravkew4H4EAZ4J8OoNLsHVVZafY34mUujtI0mJNfBtwbQw4fXbDa0VLFWTQ==8Rc7C0Mdrf4IomzZT4I/oxuC1rfGSqml0BXqYDKKbdWVgLBELWUQprVU5pGcynJlIpbeWCM2FtjQJPEhFmq6ew==mUV8aAvkxRfWzyEMlVSB+wQFDwOuetf77ooxsp1Iw1l972bIugS57+mDTpWxYesox6XCF2sIr21c1jKB8a3IYQ==wxP/IXL9c1zbss8wO/io28ksXhUJZWJKavkaL5xywPDY9HLnxNQu3sljOVIHU4+OnCfxKNz734vTCL2nGI3BmA==H6Z57WSi/VgZmevj8/GkMTzylG9HyXGUMgV2Wh/3UasbksL7gYqhw/lAI15p33/1WermVAo9yP93mQSl6wdiZw==XdYsKh/zs11zrfiVfXR5GxB4/NRlOUxnzAx/vJBu+L1GVJ5eH4vzd4FnpiZDmjBQAgfpy7Car+dPc7j8Y7pFlQ==TFrFpPRDPw8qXXlcXYm7zTdjbfk4W8uemWzDSYXfAKs6jCnVuUwjSJoybswfUzmaXGNz04HKP7x/Oq5Mtnl/KA==JH9dc+fuqunINX6VjHOSxaHqNUWFYjO0Qfggbr581a7fSrmDPZudjVl/O0gSnjbX3XJpH7FlSP8MawL49n/+fw==fM3lHwgaW0ehUnbRqXFTht2P7PHk3j/KT3VBpUD3P/nEOjhmE9eeTiFs7d8wY5w+eAMFn0fXyy0Y5oPq+sia+A==e3D3KPyraOWNb2xDg1tE4osxQMY/RLkvJ+mv1BUYggLx9mdKeJebiElFy7oswNtlYe3gOLWh4P9pgxzoSniknQ==kGhxqIvQLAXcqK3m4URgqSviQCl9oEE8ht8KBo8hACv1GM43o7FI3lvl4A3cN4OioDqTzgClUVH6S4YqspML0Q==fWwbpw82Gr/vipfB+l/UZ396M1l781Zgka4hEOhlfBi9odRoVor8mRPpz5jFWb5nZr36l7kyckvhhcszRViNkw==rwX/15XcnOTO9prUbTKwhIz2HzbT0iCHTYpfWbtUvEJu2PdVO8S+Kld9EdKhLV9P0mtcnOLCRrwdG/nVbah2lw==kNJq2pj95v9YgEZAkZZZ3NR+h7hciQQBS0AaKivLtYonzxzVpg+2LxD58zlIAGPjOZw8/MIsFsi85J7ZiY5tlQ==N4NBbTtTQn/7l0say8Gch6xBsOQcuHrgfExYsZ6v9bGS/dUcBqKLCpt0xRsB505xdpGoH4okjDIm80ztFBWqrg==AlNyk+iJk5tT3VF3MlYDW2fM53SENhan6FlZSu+Pco7hkRUF6GlEo9JpG717OH/NOoEido4vXde51O/8yhA+1w==i6dXSJuPlD1TN4kqITiU5s6fVKEBmJHVHBkDosaNUR+06QqT3U4Pu+MF4d92ceOd+VErJEh3cPbe8w5EMY+KbA==RkQygwCN3ZFsqXVejvS5YJUcns5/0fHXjB3OZxQ3WyAawykabA2CFaRtsbrrTK77NCs6yKqUktuvgAD63xU2mw==JlQ8rn5E3BLaDJt8ZJ/BFX0RBeSjI0nr5mW33eDlX5EsbQF370Rjya7WIqStuoq/U7o3XJbIyl114/wOKO6Y6g==aaap7jjKfAf7fcma4vvbmLWNUVAO6M7iAP88vOwPpXXSn+sEOHAv8XmBR7lecWumCSYTmTHyupH3lyozJToFVg==B8lJgPC8dcyhX6orFXc/yUOp4jb7do0kBf0MtOCbFbOzQx3SpTmJQPxuHLAp0s4SUYkjaHLJ3Gxv+SdbuQ/rgA==mg62d2bS01Prsfi9WLKMkUvwymVIZO47CdN4s31qNYlDnKMGN/hBmmoqU/ZVbf3BDpSXu7gdzn73EAuQ7+SsDQ==R2EWy1jIV4DiP0/GhUPEPnhj+ZnGWq7VDApOpHfYpT35U2RQbSJ3FzcZVCMQMXxRag4FD/hFQ4oNsUfPXN2h3g==0bOMlhegCGwCWZgFFWBCAA5oLpgoL0ApoQZGAGwFWlVdHpAV4bNGOrwq5NL9dkEuh0kSNV+jIlbv5iyz+nnikw==F4AxZWSbbtXaTPiWRgIpuAtA/7ZN6h7RJNnqi8BGB2zScq0apXIx5bUGCAWBEcaIVXnSoLeloW2jmUVR1bV9SA==4oQf870GcyRnhywn3RQ10LgMSSJd0v2wI192Qx8RTZfQNTKzv/3QxvnpVA+m7irH7Dd8O0W4iX+6Gjbq39yWRg==CHRkuSso1vEE0xr+Fsi+FhKMxpNspHaHVqN/tnQ+yICFQPhi+1ProPiXpyB2w3QqhiYASyF684jIOgyfs4SDgQ==41EJmqjtknusVo5QItLYxyRWpmojGti/w9Gg2KZEbL1tfjU3Z/S9tytj/hg8D1KFILMIr5iSoLC0Sbq+b2Z2PQ==ruli+Zs4J8tXMLhTmeS/zQDdBV+bj3NL+Z5V0a4cOf2e3XTPowTW97Mghq7yNirwGEVLTrJCzhx+CVUbzmPd1g==j2XrTkVvkoyIKixrP25GZmUCw+nVv5dbr0fxGwHP2/+87Fsi8bZ8USvUuzbd\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/root.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/src-vendor-lib-helper.ts.js\": {\n      \"exports\": [\"h\"],\n      \"facadeModuleId\": null,\n      \"isDynamicEntry\": false,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/vendor-lib/helper.ts\"],\n      \"name\": \"/src/vendor-lib/helper.ts\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/src-vendor-lib-helper.ts.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"/src/vendor-lib/helper.ts\": {\n          \"code\": \"<removed 49353 bytes>\",\n          \"originalLength\": 115,\n          \"removedExports\": [],\n          \"renderedExports\": [\"helper\"],\n          \"renderedLength\": 49353\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"/src/vendor-lib/helper.ts\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/vendor-lib/helper.ts\\\");\\nconst helper = () => {\\n  return \\\"Helper function called\\\";\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"Qt/S0qsVPFS16zQo4QZoneD/1OAoOb14R9otWWdkNjrS65bEmqsxA4rbTQ6u42GhZC1Khc4iTUjqDP3fE7FhQA==jYFCDJQOPv8Z+AzPnojWBW+XGQnwyqPDd63T0E/Q3dwNiWX2SIrObNK15nRkkUg60uQorBlkbvo5YgvZHoM1nA==9Si5DvpLTpBb5eKwPZ0CEqv523wGJffc8l9nEUE4dtgVrUFP33L/mxwjsGJVJ+ouofs07+d8k1V99UFSojxwOg==TVLcx7R7A1bONlLSfE6kWHl52clCWarw0OHR5qb0IpedW4yoIRlOKePOz2fXqbBUTbBznkqKCcqEV5M9inGNLw==+L7Kd71mXC1quR/KYfEyoOcQlwgPXXRlU1Gz6A72xhomP4zStbNcWupAz/fljU7LNc/MBS+YS6yq6KbvCrsDxQ==AnRsIqOCNnJbvkfdiW6YWJXYVywrVxM3cPoOpCpJuDdSIiMG/EyathBZxfNlzjKeRCLijBYLa46a4XSJFctRMQ==7BwJmZQidAa7GDMBn5fMq/GFHh3k58karA13gccsFAJqOk9ZeqjM5Huyr1Y7Mw0uYb3/1azLdQ0jHMFucj/7Wg==3BLkDd4JsiB9iqNxv3b9VDqbV5gTwMnroyH+OnkR+awKIO5Zt+wWy8ddXRRxYlO+j4bw3rjRhWVKo7ckdn6Y5A==Ydmv7j2CyiVykZjFOpwrfA4XLIT6WyTk70nNAHwyhK5vkcmEuGti++VfQ4GQpBMzhzhifO8KVR70bKiYA413+A==h/D+eNFeLHqXHncNcbsk2fgSoTX7idam0cZG0i/rvD8ddvu0ZmNPYr4Z8WIwxeWj1KrVo0KKiBNNtaWz7fXh7Q==C41BLjasCx0BcO3xCsgzeRE0t+kPyBrbU4MBFJoQ86qbVGj3izw2CiTB13dBNFdi0IUvDAyatHYgr3Xj4tI3mw==8TbVWK6BkD4dNOHVMMTB8X6ilEcrul/C2RysOuXyR9EQ1TEf8x5O628BPOtW/pM0//kFjRSjMAVnaY14LkzAhQ==z9lwsz7LcO+pfc4TU+ROZoPXpmZ00t2G3UPbCY6nZcmgN57X/Bt9cwHfahfql1AB8YHLOo4/Klaf8W/smAkr5A==vhZxVyWFeSJZWZmopcrQfKRhSo2zXLbfagl4kl3q2QI8atlYOT1YPTUVhP03csD3j/Tkh7945Z0kPq7jHeyLwg==kS1LE2+IgJJtarB1koAyjjxgOxRDFH+1zx4pFYETFh7dNSmr2kCrGHqzzULEbtBPFy5vDoT2R68dVFkKlKJfjg==7x+xwgmii266sWU9Je4/MBeWegHLMmttL0LHbzDwtOa8NM9IWCUgRiTcAkTgxI89sfPTc7i/UrEEh7CHDq9eng==iptEkXhHbx4qXT2le/vegdjlOYlxvJyS1YksWAlQfTWGDbSTr1yYOZgPK1KoyXnFAgzhhWqmmXWqqamOoMeOow==+tKeYdGlcAhFVzchlLdr74KcW92lIPuUu/fJ9FjbV97+4Kf47UizY9u4I7RQleuWFafiilY6fwpxXM3U6z1L+w==PgkIZrczbelS82m1xWRqICDmYAejmN2bpfG7jodyAAppbe1XofqGMtiZNjWaf5U4+7K5EDFTLLs5/sy2ifIucw==9y4F6YdF6F4tjXTC2+lNX+PhzAVGpqIdfThgKui1W32IMw1islgGAU5+2mnhNK21M+ve9Uw6Bi1I1p36dgha9A==1MwTnVR2sw/Yp11/RFdByZmhu+h/a+9kLrI35v8gqAHkAkCKWyw2040UwfhQ4F+xICfRVSg9dGo1nsvEe5hG0A==3aXegQ76B1IoTslIUTgJYPTThKHbOffuEJrKALhKj4ckiF0f5xyZKoUgorKPJfExAhwf8Rc2GQ5A+4HuacO5qw==tZRmSIMjOAPZbym1PFc1se33x1m8SVOh4/BGsnA5BTtRRpaKt6DbWnhuYj8q06s8+RqspK/b9HpcWX6sE+9jMA==+C3Fg+aGlt1POHY0S5b4ZIQU4Uq79fadTJ7wKvE8k4T3GIuckwoyPq3asEUeYczu9UbQ4VDnav1qwLXz7/9wwg==ruGFpYdYJRxZF4Ts01pS7SxttaGY6/KT8rVd52/V6qyOhDOxadWVZvNANbxFzT8+iytj0olhfPekANAFLqMo2g==7aIsQZ3hFruZ7CYLHXNCQbl7kq8puARvUr1+E4ukV/EEDbkgsUhJTVXjFBowLsb47eULfSUek2QEBvP1sDb+Hg==1tn9kUZffRawFAyY1Ma2fsvYWUL/BFhgz9OaNa3+WbKLA/QeUvkl2m4a82gueVZ9qjBGBU75X0DtStel4Br8iA==NlU7HLmZnrkX8Ubo1magd6LRl00qtqFMzd7buijSwE1tkPAy2hOB0F5IgLLRS4vgs1wTkNIsl1XQJI1GxkDpPA==r7MQUKM8sShX6Q9e5rUeRZbqmcJo13GKtSaVT8F5fJa7rjhny+AFve93a5vjlIJV/WpZhYt4yQAQKRm0eb9twQ==oWmVmNqFNszFun1VJiUAux8q3SI+PmusobbBVauQOCSH8+ZdIe2roEmumuET8UjN81ldHOwdIvhRikH+067dJQ==EVRRN2SBwzuUpkBaQ+VsFw7Hk6Zp+9wMVtNDZ/hh15x730YyG+lTudENhWzeEYsujl/Ef6GHc0Q49GJfChBRGg==f5X8tUVxpD/Z6IEm44xg+8fizyCYKn0dvbjfS1cQp2WcdAfJIQHHsSIdEsL4rO2Wt/3sDlMcQeCoaSNUCCrCfA==ruu3YiPcITXtzvy0r4/nj96BpqP5vtw72RdKdnEDkfWyxjOvQEB8uNiGGh8+Dw6xMdz/85GpziNG+ofv7Efycg==1NbC8h4Ld5SHDPwC4vDK74SCRKQmzcEiygpCuulycoX24f/sGp9OYsZpJPLugRzPNQimarIJhClsTsoRk0zQWQ==YIvNvEoWVLZEKHov9reKZ1R/1aCwonM/F4/OuODOzeJWg0oe/o1zCotIGUg4HI7s4L6QvFyZ1PXTQJsXKvIFfw==PZ+LOvQ+eNm/ZDvyB6wzwzkGr1RCh8tFEbWhswMXqA8GjI3falsnIlU0Dvh/CTf91khvL/P8SjQog5kn88EvCg==588LF+VAVORVJ9DqaYcTFaS9CaGAUug10XfO/MoKtSN6w1GPiVjALHmsO75PvBj1I2UkOoLeahF8zpeCKZpJzw==fuWbGHHX2UaWETLmCw1z3/h8HVV2W/1u6l5nQ5lbAJwc/K0960aXf9qf8RPMpHv3L9jWgWls22EATmUcFT4Big==+GhVaMCO1eLNSRBKP7FHNQX86+hV3cjPgpoHJcI+49MB4VEZj2BpJE23zPIlpFbl/fMPYIM6AKJz1Jv1f2gbGw==TnlVaY2xhp+wAbtuNxWlhI19A3kQctGztk+oFmkVEMpeN/ELJCDFpimKgG22gLd2uX0CPmvXNOYJKXsQ7a93kQ==/5z7ruWlV9LQHfON9+hQQLznnsNmHt6tl4IYG8iH59mhfu2VyrygGGzQ9Yh9OjtLurjmstmdRlHCO51oJ4oOhw==UchUKni2OBBp6wL3MAE3Hhj/tKdDxiz17kBI0H9Bo3a0zSJnGhrqAlFmjrtcdivkazzCthNyDJVTgBdXYh6KKA==w8+GuJu2Mhm/eQzLGjmb8k6tF/nbHarijDd4pRHYr68vBGHn9K2KQhD982UJseVaUqGgdlGP2qdRASWvyk+I5A==nEno46JE/sxRFpqgDX2RDMoPmTTJddtgQOxaDxuhzf0ziK1YGgYF9H88X5/xVGLgBFb+vIF0ym3Cw746czaGUw==RQg2iSEQVTGp0o+EeF3IGxK1fogbarB3414EOfRTJpZ/hhLiJEMJTspnEvtVAMxW7dqbH/izy6mOhEoMZp2B/g==MsMk6mtVXZTW5Viapkd4h8bust0gIP3tH9UcyebzPGLM0fsiZNkIPTytk0SRYmUR7sCMVKo7ZThMi/Y/0VRFfA==xgnVDIne5kLax4m0o8bUknQPtRRgtjeKsJyobfFDEvHO5cyzNdfiNZh9mrfcDo6Aemmx16C588XRnUVZbAp+XQ==+qLgG0nO8FvSA/BfzCxISAAb9hKCNOVigkqGC3M3z74I3oBDnSTkEGYZ4H/Hi/viSbHzsAb+5Hpe7VO5DzrcmA==WRwjyouyoThaKulqQ4pyy3SFBVFo0J21KKjdGqiz63zpWKJTNfSvmgEmmgJJyac17u6dNWpvmipgDHRtitVXvA==47fzisQD3Pn63DOZkxNKHbif5btXWIiZuFvEesZ3v9mLjfINycTlN9gLcwoSUjqB9p0DL+J3oMzQgFSIEwaDyA==B3PeiKMFcPys/7vaCyW/6PLhZX606S7N+4xd9LC3nJCcudLgdlI6DPzGxnMSZ3An8CWCHeKx0Y52mU2kHq+WkQ==8GNrMC+ju8uNzByBAxgiZwJGWmOj+pItxXC8eNnTumgi7BJeggWsntV8Hk/+X8jYb38Hw8vDwmdR5r4kpkzy4A==rKRusbljvhCSZKtdBtf7ctm9KRiWf+E\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/src-vendor-lib-helper.ts.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/src-vendor-lib-libA.ts.js\": {\n      \"exports\": [\"getMessage\"],\n      \"facadeModuleId\": \"/src/vendor-lib/libA.ts\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/vendor-lib/libA.ts\"],\n      \"name\": \"/src/vendor-lib/libA.ts\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/src-vendor-lib-libA.ts.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/src-vendor-lib-helper.ts.js\": [\"h\"]\n      },\n      \"imports\": [\"build/src-vendor-lib-helper.ts.js\"],\n      \"modules\": {\n        \"/src/vendor-lib/libA.ts\": {\n          \"code\": \"<removed 426 bytes>\",\n          \"originalLength\": 149,\n          \"removedExports\": [],\n          \"renderedExports\": [\"getMessage\"],\n          \"renderedLength\": 426\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { h as helper } from \\\"./src-vendor-lib-helper.ts.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/vendor-lib/libA.ts\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/vendor-lib/libA.ts\\\");\\nconst getMessage = () => {\\n  return `Message from LibA: ${helper()}`;\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"gaItPpIA6WW4cLZy9ZnddZNqpOSy9U7Wmh+DI6Wb/Sp+PTRJRadQgzVoyEKQ0fWeeR02gc8JLPdnIWbJGt5YaQ==\\\");\\nexport {\\n  getMessage\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/src-vendor-lib-libA.ts.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/src-vendor-lib-libB.ts.js\": {\n      \"exports\": [\"getMessage\"],\n      \"facadeModuleId\": \"/src/vendor-lib/libB.ts\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/vendor-lib/libB.ts\"],\n      \"name\": \"/src/vendor-lib/libB.ts\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/src-vendor-lib-libB.ts.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/src-vendor-lib-helper.ts.js\": [\"h\"]\n      },\n      \"imports\": [\"build/src-vendor-lib-helper.ts.js\"],\n      \"modules\": {\n        \"/src/vendor-lib/libB.ts\": {\n          \"code\": \"<removed 25066 bytes>\",\n          \"originalLength\": 149,\n          \"removedExports\": [],\n          \"renderedExports\": [\"getMessage\"],\n          \"renderedLength\": 25066\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { h as helper } from \\\"./src-vendor-lib-helper.ts.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/vendor-lib/libB.ts\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/vendor-lib/libB.ts\\\");\\nconst getMessage = () => {\\n  return `Message from LibB: ${helper()}`;\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"7anchBsC2ObrMyHY0W5oIEJFSPQEOHO3II45CJ5su0PP7TwuWvxtStUvok5xsuQ+I9gvQPFgFShdTmRQparvbA==Gkm+3O/UDwYGu2snruuE8JCqk8v/hUxWC5SssVtUkP+8gIuEYajH722x+cuoIqCBy0VLCCr3goM2LkBN2CVxoQ==ivZ83ta2Hn/bh8Ua1Cd3J+PA0oZHIrBcGadkCpCzbTbgNEpWwFUOI2r2cfpUCNb/BBiJs0maBqc88BrE9vUrZg==MLc+ImXso2oX515hAkwr/kYWT336Jo7hwxPOH4lZE5E5X5d1U9JFSTqLZ4lIQNJaMV2viZi22c1FKwZ7SIqxMQ==sP5TSIdodQaiZN3wBT/fs/1ufzYKAuJF/milL6RgpBNhads28AEepSc/4cpNjTW65CotvYdOrZYPO3PuBA/zLg==iswQ2n2JIstTmCIAUZd2W552JsJauAIErbj9DzrWha+ewrQQVUvFzKMjEo34D3R8mzOTViQOE7Luo4WsrEDdlg==MVjTpWEKT3QNgVCCHVQcVh1dksxtn+0wMCDk2MdMoiMzKDtT8o8lzZ3o6cEYdiqRMnXUvOhkwZ7PX1XZ1rVQkw==hAQLmLKV9k6LfFCL7fzJ8PQNTzZtfppFIj7KBGDOLRxERPK3EH8ObMBxzuD3TEqXuMlFAYVRjTdY8qVswLa7Mw==vIcoGcPSpkO0h7Blh2TIOlCuUMUX96dVqeWMLHhbPFy2EAyqM73Ab40b3RGVot5TSnF2XkkbxD6/D518MjnSSA==kBvbGRUZuZUIQwKRNzaCSoeubYJmMgSLRN8ZWmoI7Z70fPkXvkBIFdHBQG3DwhdG5O7e1oHHUNFLXiTF9v71BQ==hBblbBDVJuMAWEZml1bbfbGhTMTD1TXOIByNQCgNEgDpKO//7ZXmvEI/d/hIaLtIaL5h5M4K3VHaioCvhxqzrw==80FREGul74N37MdWcEEfKNW0hsAYPk/qF3IdOPZJP4nQ6G2bPhNVSdlfsVMJrKow0xrEkWOm4bzNq0z4Je0jcA==vbBuYYeQDmSnelmE+IHq5tfIvBWkuVx3Ze9iF5ahp2xF3nSwLfA3uQpLVAzdWq8TO79iHTdTgjacOZa7UtJLbQ==9/zFj+g52P20GwD4n0b0uknFdZoMXji9bSqPcnqBEVs5EM/YNECVmoW6UQ5+dx93PDRmFRVIZucGingtT7UA2A==aYhXw8cJjPaQbvDOtZseQmjiIxzm1ln3RyVLEIHNbvEhGK59U2QliaBrmDj1yR4D7YgC2KEvZQw1gHDlvmlhSg==odcMjKojglcgEn/hH1Q2l23wlGf4AWXZekaUNdR8JuiNMW5VYencNVN/6/1LZHzRiBBFKCAxWxjIHS49EkxowQ==nHuKjm8s2q0/GlmM5zBvcKIf6ly4BN2grDXkvRm9LC107iETvBZZbBNjL25Kad5OZrcxcL263QMf4u59ISlOrQ==VlDCcsmxCZIbLwao7uiGdaAbFek5oBKqR7Kq3xUF47hyff4Gfxmvsr9uWwm5O1QYuhYBJhTnJHaBj1h5faYmEA==vNSTPpe0thG6Mn0N9qAp/mpd+EG2e5LPssWv0tX0busGFWgmda+CDLlClo/QwoUdiKTmolA+se4x/7DKM6Phog==MIHe66ygVPWQd7T/woB5E5EbvP49fzX+PDCfJiq50GBaK9Jlf9usIQ6rkASCa2YUgrXjhNBsr2RpzhmidwGtPA==r5aWrSABy+ucEF8ANLMsFJ8w3uuK+FfMYLbgf3XSsvBldjMK1Cwxsv3vQHNCQOi9R4JLj2iBGrRT5rwtJuH1gA==lXSTJElW2E2sPxKewi1V2Z1R2gEoF1hyyjH+jdf+8gxqxRldjzlSBvwDQIojA3PDkTB2Dtqt0kjGLWO76f3a3A==1Mpnzk5yPev3GSkysDpoJC16h4KHZcQ0CTmvy6r+tVQiN0N6jeiA6v/CxLqWJPWAeVdrFIw2qiyL7kYrRz+VQQ==FlDYGJcNc+aML/zVMuCprhQb4B4PMK3faZz75pFdFWPhSgzSKTSASCWJ9W4y2WNaNKp40ghxWVAoi0MDFR9mEQ==LswtzrhlI8OYrcxLdM2+RPcBM+8xm/6d2elm2nrLV3M+EnwIGfprFV0srCbCXWxPhF5vf+rP+O9GedVCJ6PVag==U7RLMCmP0cmbh2cj3SpDN1JbYN4gzRZr0xhsjuLmdiwALDS/cwczRWhwf+M3N8meOYA48LBg0iAcw8kk0DUR7Q==tM3HeFjer8AXMCa9n4j5JYIs+tGCLS95U52+rs5g/oMDq7VM0/3cTgeSt3enNCNTcQxADgpoM0F1w841uf7wzA==3YOOcbQxYXYjwui9hT8KU45XLsJNqOju+owwOLECfQ7FA1u7At1B50UGE6iaVlQQncBZlovApTw/p0i3vF/pog==47+dNOdggacCiDdya2KXWebMuz3VMJEbHTi2YXd9oV7+55ESaW8NOwdJarJqrWdwbYshGMuFJ1pSfTWzWLdtyw==VugWAFL2deKAnFxwq34ywrGFYTbO3PV8vglm9AVr6uEwSuXnMEo1bjzWmNLTOtDahU+f1tF9ZPlBpQqJQVuoGw==5j5P+3Jhh6krmpSW012inrffNuy/t173hHCKvlTqbEDjmP9EZ5rJHe8x0zeScwOGZ1VuR51vnyllTreBz3PD3A==d9+WgKwC4eHGwuT3WVQ6Bg3TfRaAJrSFzabXByDJ0ENg9lLPRZC/jFBwP/5wW2LfSZTOsOv0nHOBDbrLesPmJA==2DwXLKqJL7EAT/KxQdRFtLjP6vwsm3ba9Go6UmQxCOt20I5YYEBM75RBJlEc7m5yS5UyYC2bepgLwZl2RwUTaw==aLuJs0kLi+TzR5ayP3TrWH++/cvm10AsEFwA9Hlf4HkkwbKa7QvP4M+onoUEqzxZd5Sgp4xZG16hZjD1HQSi8Q==4rXgVvNNEYmXCWHimRkPgB2WsJA+Za3wrNQLrXh1SLrc9wZpX2lI97YqMP9bbPPabMMfRfgAstuWx6CFcWkJ7w==Em8mE9Q5AQ+rT2SCxIclwLDtMmFjz/zvg0Cj8otrfv8C8SzkVrjbReE9vgL1D1clBuP4CYycGxqnn/icFdoiaQ==bnuF2i81u2WYgt1D11nNiMbCdajuS30+qR8uKKfwLp/ChHKHdPnl4ALlhWUdrCfcWqkIMQVel+cZVuGZdp+HRw==h06G3ByGiNJUQ/T78NDVtrZwHQQ2KYjaCWXUotJSMEjEUkYKC17GGLEy+xkg+LRzujygRn7TzYGJCKoVlX6oYg==nxMZjpHR1C21RsOWvlhf/T+DDXqD1quP+b3hlyq6mZ6c+SX3aYp0ZyklFZMGyKVmNSlc3fnKzQLzD8+Ql7bgWw==QcXcVD178G0DBgMFoJtufKpHt1wGyi3XIE46hDFIRTEuDyRGp/kBAY1kYag5QhrJ6XRlc8FkyIDjL5OKQRP/XA==tOSyVWL3dUcl3sCPjfjl8z59HQ1ivXr3/+b6PTDJdRcm/X7c3hLVWnPK//8bgUUcex/w5YCs4OCY8mKTarwuYQ==wIJd2mfFEwTHKXrokQZFPyA3TQWlmdqQeH/969AS5n9TNBqfZN89fgLRTCkce2yAgnQkecoEzaMIW+U2LxaQ6A==VwtJzKDr+wo/AhfqkMrIxbsSS5LqW7hu/lyUjHZGmsD0yKkvqZYvnNX8zz8en/V0GHtw2JKefODmUBT44UGweA==D8dmkKrv2G3SuU7nsI8iy3u1aBhrx9PCfQnG5qxWq67iIt2mDE0V3KCe3YcxpITJZ5RQdk03HWeuSm/O0/lugQ==DUe/LXbWJt50FgP9MiqBO7MZ2mBYZwEs2QPVZjtEQJG5a9wbvwAHJidh/3Qy0TvPQaCTWPGG67yUY6UrHDU+yw==m4ZSZbX5XtE4fdUfFPgnW33tqirOyN0j3ntIzFxoTsNrwGQCUbSKKeY8xWc6/GLGaQr7lOq18DHF0z+eYUhQeA==q/TIdu/1LXn7cQF3+ZFtJgkjnEzitdTPjmkjYVRhw9dLVkodAOQbOh7z/R91xeeQ7LHL/9U8A6KFpa3qVYDcIA==X9NE/KCYuOWcUjpf4rP256YnhV4QNu5FlNlMwu6pdwXSllinndig4esOLvoDAaP1iBpfpUzXlx7TlJ8dzyLfVg==4AiugPm25saBZcnHZNlSxwH8VQTBIMUA6LGvBwPqVJYEHuUUmTA9bRHXPWiYWVjUxaSYKOAkNpiob6Durns1Bw==X6KubEhaU/5zjMjRS0u4aq+oueUFQI7A2PVN8FMZmNB8hlbWBqWVyQybWPu3HOsdBQuXo4V2ELpa4uM5FKSD3Q==dTF4ZgJOlUHqVK6CsLxWNvUzzdoBV2KG4o7oZ56xp7s0YGhLJ1LSPVsZsWYWj6XGExVjzr4ikxLdOmAMySOi3A==NnxCskU+orQbm0UNg9W0SVER2zQ49+32NbY96nBnxGxKZrDWBy\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/src-vendor-lib-libB.ts.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/preloader.js\": {\n      \"exports\": [\"i\", \"l\", \"p\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik/dist/preloader.mjs\",\n      \"isDynamicEntry\": false,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"@builder.io/qwik/build\", \"/qwik/packages/qwik/dist/preloader.mjs\"],\n      \"name\": \"preloader\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/preloader.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"@builder.io/qwik/build\": {\n          \"code\": \"<removed 49 bytes>\",\n          \"originalLength\": 116,\n          \"removedExports\": [\"isBrowser\", \"isDev\"],\n          \"renderedExports\": [\"isServer\"],\n          \"renderedLength\": 49\n        },\n        \"/qwik/packages/qwik/dist/preloader.mjs\": {\n          \"code\": \"<removed 16731 bytes>\",\n          \"originalLength\": 2839,\n          \"removedExports\": [],\n          \"renderedExports\": [\"l\", \"p\"],\n          \"renderedLength\": 16731\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconst isServer = false;\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik/dist/preloader.mjs\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik/dist/preloader.mjs\\\");\\nvar BundleImportState = ((e) => (e[e.None = 0] = \\\"None\\\", e[e.Low = 1] = \\\"Low\\\", e[e.Queued = 2] = \\\"Queued\\\", e[e.Loading = 3] = \\\"Loading\\\", e[e.Loaded = 4] = \\\"Loaded\\\", e))(BundleImportState || {});\\nconst bundles = /* @__PURE__ */ new Map();\\nlet gotBundleGraph = false;\\nconst high = [], low = [];\\nlet highCount = 0, lowCount = 0;\\nconst loadStart = Date.now(), log = (...e) => {\\n  console.log(`PL ${Date.now() - loadStart}> hi ${highCount}/${high.length} lo ${lowCount}/${low.length}`, ...e);\\n};\\nlet base;\\nconst doc = document, checkLoaded = (e) => 4 === e.o || (3 === e.o && e.l.every((e2) => bundles.get(e2).o >= 3) ? (e.o = 4, true) : void 0), trigger = () => {\\n  for (; high.length; ) {\\n    const e = high.pop();\\n    preloadOne(e, true);\\n  }\\n  for (; highCount + lowCount < 6 && low.length; ) {\\n    const e = low.pop();\\n    preloadOne(e);\\n  }\\n  if (!high.length && !low.length) {\\n    const e = [...bundles.values()].filter((e2) => e2.o >= 3), o = e.reduce((e2, o2) => e2 + o2.t, 0), l = e.reduce((e2, o2) => e2 + o2.u, 0);\\n    log(`done ${e.length} total: ${o}ms waited, ${l}ms loaded`);\\n  }\\n}, rel = doc.createElement(\\\"link\\\").relList.supports(\\\"modulepreload\\\") ? \\\"modulepreload\\\" : \\\"preload\\\", preloadOne = (e, o) => {\\n  if (!checkLoaded(e)) {\\n    if (e.o < 3) {\\n      const l = Date.now();\\n      if (e.t = l - e.i, e.o = 3, e.h) {\\n        log(`load ${o ? \\\"high\\\" : \\\"low\\\"} after ${e.t}ms`, e.p);\\n        const r = doc.createElement(\\\"link\\\");\\n        r.href = e.h, r.rel = rel, o ? highCount++ : lowCount++, r.as = \\\"script\\\", r.onload = r.onerror = () => {\\n          const n = Date.now();\\n          e.u = n - l, log(`DONE ${e.$ ? \\\"high\\\" : \\\"low\\\"} ${n - l}ms`, e.p), r.remove(), o ? highCount-- : lowCount--, trigger();\\n        }, doc.head.appendChild(r);\\n      }\\n    }\\n    e.$ || (e.$ = o), preload(e.l, o), preload(e.B);\\n  }\\n}, makeBundle = (e, o, l) => {\\n  const r = e.endsWith(\\\".js\\\") ? new URL(`${base}${e}`, doc.baseURI).toString() : null;\\n  return { p: e, h: r, o: 0, l: o, B: l, $: false, i: Date.now(), t: 0, u: 0 };\\n}, ensureBundle = (e, o) => {\\n  let l = bundles.get(e);\\n  if (!l) {\\n    if (gotBundleGraph) return;\\n    l = makeBundle(e, [], []), bundles.set(e, l);\\n  }\\n  if (!checkLoaded(l)) return o.includes(l) ? void 0 : l;\\n}, parseBundleGraph = (e) => {\\n  log(`parseBundleGraph ${e.length >> 10}kB`);\\n  const o = JSON.parse(e);\\n  let l = 0;\\n  const r = [...bundles.values()].filter((e2) => e2.o >= 3 && e2.$).reverse();\\n  for (; l < o.length; ) {\\n    const e2 = o[l++], r2 = [], n = [];\\n    let d, t = r2;\\n    for (; d = o[l], \\\"number\\\" == typeof d; ) -1 === d ? t = n : t.push(o[d]), l++;\\n    if (bundles.has(e2)) {\\n      const o2 = bundles.get(e2);\\n      o2.l = r2, o2.B = n;\\n    } else bundles.set(e2, makeBundle(e2, r2, n));\\n  }\\n  log(`parseBundleGraph done ${bundles.size} bundles, will process ${r.length} bundles`), gotBundleGraph = true;\\n  for (const e2 of r) preload(e2.l, true), preload(e2.B);\\n}, preload = (e, o) => {\\n  if (!base || !e.length) return;\\n  const l = o ? high : low;\\n  if (Array.isArray(e)) {\\n    const o2 = e.map((e2) => ensureBundle(e2, l)).filter(Boolean);\\n    if (!o2.length) return;\\n    l.push(...o2.reverse());\\n  } else {\\n    const o2 = ensureBundle(e, l);\\n    if (!o2) return;\\n    l.push(o2);\\n  }\\n  log(\\\"queue \\\" + (o ? \\\"high\\\" : \\\"low\\\"), e), trigger();\\n}, loadBundleGraph = (e, o) => {\\n  !base && (base = e, fetch(`${e}q-bundle-graph-${o}.json`).then((e2) => e2.text()).then((e2) => parseBundleGraph(e2)).catch(console.warn));\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"821rIqpXvbBXSzURRvqCa4rVC6mSV8OCZWULCxL074qffNSdNfoiD+fXyoptcPewnewMuakxi3RR99+9UCzr8g==FZSy7UIoOJ1CGsnzofgAdAB4vfR/N1j5s4WNrF+rv9u+2+abNRM3pXcCVaw5BInTtj2e59VqUNCAAY7fJ5c+NA==uRDetltA3HzeUzTslhvVu7JEichFfojov29DmSod9e3gzcSh1tEG18mA32FpmrpJ6rrJEgHFa1N+1FmE4xLddg==dcUMG84Y+66tm6e13EB8wNrfRaTGAUsyDitvgUzB2gdi2HxgUBcd5b2X/lRY65ASejfDhWGCbNI98Wn8eAZB8g==wxT6Jf7Yt70guP3jgqEqsezgKpaKzaeitWaKUed47bEAqIluBS27j5txmTcKnkAH+7z3pzcVbgI/qco66SsBbA==rjLTgRL8grdFwRVm8ggDaAGNVNUjlV06MmSiFSWNUjgqWyJBgAGYFAUlZ1esm23T7MQ9HhPb9NYzgb7g+D2zZg==TAX+f1Um6OF7jiM+hkE20MtDE9gldPrh/q0AkluDBnkZwZSn9uJln83zfj6uig89ApegK1QZO02p3grMqvek6Q==VOzyHmBVFW8oy7XQKBoMxAq7JJu4DkAk64QRDZjFgzwuuR3n6dwHS6z2TAyNykgoOBOy3Q5JpZ2o7q9S05BKtg==w+fA5oyN9fWcR+4mPPCmeqcaZ5ZcWPjp+IPbd/4Kc+OKmDxyS7byJWtgDhCxB2tYzus8+6X/iuIN+wl/JUVzPw==smB4pyoQsyPHAaf3kAttRvou+/UQdiREu2SKHIi2Dh6+sqrjttPvnqksUACRKY6JjckWNJEdZAqPuumw9WliSw==27L3VptYMUW/nIuszO+N43vmuggreVEt2LjpKI0MCf8s4bhgv9boan9+I0kGhhVu1eY4qw+Rcu0ON1F5dsizcQ==v38VEFXGbzEHgEvxINwi8cUE1JgDPCfqPUFAHiwBbHXXgD+9lfSSAw2Xku/WQX7b3pAb6xmBh2izf4l2cqgqiA==1ufHYFu81UjAk2R4kn9tfrWzdIqr6GSMZZQxGBZvAMPZ+J7zz+/YweYOPDJTA6R1PmqaigQVfap/fUBqSh6WqQ==SN5Mq12kXeU/RkwwF+uoho72X+ZWFwa0bbrVxTAVsDPRJ+NjqxcJ40Vygqni7NHKjFH05fn88pFIUYj\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/preloader.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/root.tsx_root_component_9PcKHFjikV0.js\": {\n      \"exports\": [\"s_9PcKHFjikV0\"],\n      \"facadeModuleId\": \"/src/root.tsx_root_component_9PcKHFjikV0.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/src/components/router-head/router-head.tsx\",\n        \"/src/root.tsx_root_component_9PcKHFjikV0.js\"\n      ],\n      \"name\": \"root.tsx_root_component_9PcKHFjikV0\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\"],\n      \"fileName\": \"build/root.tsx_root_component_9PcKHFjikV0.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/qwik-city.js\": [\"R\", \"Q\"],\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"c\", \"q\", \"_\", \"a\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/qwik-city.js\",\n        \"build/preload-helper.js\",\n        \"build/core.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/src/components/router-head/router-head.tsx\": {\n          \"code\": \"<removed 14343 bytes>\",\n          \"originalLength\": 1136,\n          \"removedExports\": [],\n          \"renderedExports\": [\"RouterHead\"],\n          \"renderedLength\": 14343\n        },\n        \"/src/root.tsx_root_component_9PcKHFjikV0.js\": {\n          \"code\": \"<removed 3712 bytes>\",\n          \"originalLength\": 1037,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_9PcKHFjikV0\"],\n          \"renderedLength\": 3712\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a, _b;\\nimport { R as RouterOutlet, Q as QwikCityProvider } from \\\"./qwik-city.js\\\";\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { c as componentQrl, q as qrl, _ as _jsxC, a as _jsxQ } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/components/router-head/router-head.tsx\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/components/router-head/router-head.tsx\\\");\\nconst RouterHead = /* @__PURE__ */ componentQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./router-head.tsx_RouterHead_component_dAo05yeFq1I.js\\\"), true ? [] : void 0), \\\"s_dAo05yeFq1I\\\"));\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"9JhdgmUnyvKRU463dATo/SoOJxRYY9JZVaZZJOzwYZp8kz3kzJ09H73qqhHlGZCZZKltCFAPRNy1wNLle5VYeg==XxfVm3RZ2kCrQovaJGBUv17HUAgn9QqU3mJ6/Cpq6+zy9s6jsP6/jFImQcfve8JiNDZ16eu0/IUDOJFPj//SHA==MI+9W0QTTOSwhrOEhzYrAG70j8zV7zN3sBzjjHMDGg4RkdsvwSn4Oj5MZV/mL4QUmVbly9lPw5vKhbd5I3Lrgg==q4pRdWvsW7KbXE8Azx9ZX7fLmBk/xFEnxxzc/71QyBeGtXwB1mqfa1whnj+auqcgHlW6wx5MILcT7L5SFkjN5Q==sVEKGcY8JDSunqcfRVarPEBFUUQPDRPPZ6P8ZJChw/Dz4hEiupA6pkP5b8wGOOQjIBWzDRvzNCn3mAW7GYRgXg==nrBPDFNqO5PLDCyZwXkMYgbjssRSCGsKu6+gnAd5W6r/SK2hxYld2lGZBNPAosQMIE8WPdwvn6YtPiFr0z6x6g==0PKyv9omety4zn89uEq6aEaInS0b8dpnq8fGRLP9uZO0qUFrh0sTs0P4kC+Az5wuBpvJMaFlpIknOS7OAWMtWw==SqYkj5p87ZDW+pdPekWZdLzVs0T9cNGOyD2oafuEPu0tIphLeteJm0vlLtvgqkTdYhd77HKsbf7pBynAUVMs5A==XTPla0nfq9ejtNgYdbgHvu/8zQ8mLcmQdr0KZVh57n6lp0EZUj+xdqbOF0PpxA/R7PMUqdPTqe/LqI4YplL5Vg==buv8kUnD3PYmBTjfn4W/KlW2lPZIsBE5ZdoMszmtJjEP/7o6DrXlqEDARJMkqJfM+xMec4iRuaHlnDKut5t2bg==5P2Z1fB2kT3rANkR6XRnJ76Jd/qMMfTIHI8Y2ZSc1W2sSXQ7CUlerpW2mj+WiR3o6UmTJupomEQ2w0pfWs9WYQ==x8xMJSTJJmOIgGhbcOi9+goNNy2O+1ncC/uuHWvtEa2cnixZygBiilNhUe5lo8wkO9rCLxCAReZSoloTwA3r+w==26QjkCjs97KRbBdNKGZJJwOGigTdIUGYCmbhWMKSaZThp1+lIyWUFWNit6ablmHN8RTBe4RumTeoGn2NB6g2KQ==nn0oXF6jk69EQDnjP5B14WUQe6ECWp8MQayXUnLtrHNbdfA9nu9Ent4G0E4IAVl5mMZvAZQFT/KgDMkGlRhojg==Nx+Hlxh9BFXuex6Nmo5rrmsO4M9EJVaGRibIgJbDSYaGE+sPrs2k/ruWdAF5yTEzRMXza+f8+afNOA7epAtCLA==AZv8TTp7aSPgw/6L8hvQLHSKiHoWUWoE9kXGt5tGCuSFbk5VExjAVVJLm4cagG3r6egVjoRBYrSt2NwZ3b3HOw==3TGa6mmAC+OHNhCL4y8Opxv7IxH3GRzdL0OYt9DbVmsnD8WT9/Wufcw01EEse4KFMzHhwgjHaUG1RQGv8cNvfQ==57226fH579CFnXq4btem7JBf6dGuroTvvM80VzwDg5SK/HkLmVpxAo0pdxGqBVr+NUhWwEyhLKeIHbPAh+ZM2g==q58mX4lLEOueLo9c1Sow0x0+6XHlhIQyFOIuU1nibvIiND9xdP+ZS5Ib2oKQ/PWWedED54WpGW6DeIMqhaL7ig==KggTZ+EkmRtpzQAU0ZgyB/G53WmBwYZHmDmUtwgFc5fE8k4zXXoiTnjcG9h6XV8vKUnuEqtVBWBWXf6FURW1cg==Wtyc8l6kReLyzeYsy/jjZaSJeptAP8jdzi7U9VeonclbHL6Ut7rW5KX4tMQkfl/4YD6WX2LJR15GeUtmYRQi3Q==Hnzd1wNZRPii6Z21/UeQRPuxqT07JaR68d9OxrZ3ED0t+AGj+t6xjspEcnQ5BHVz1JCPlLQQJTRKXVck6Dz5dA==NNYs9SaFCF3WUr7P+cE2gJN5Z8tUKXk41AXRfMclIZMVI96iJ3j40IMzEF3Abb9WOgwC6sBJLJVs+dvahhouJA==qRcEhEDVzqVs0z9FVpin2DqyCigfCdE0g0heGENmLb0dnl2FLLE6ui2v8HUvk1eO4d67vkHAtUW3ioR8z073fA==gQVzoH5U6Cgdt3+QI6O/g9AJXX4L5VlPExr73RyPNr88RwW3prBwVXY7dOyG/HsHpsiCSvdmzYJbG7kvaGyY8Q==7H9yNwyw7q2KwlSd9umti70iKLT7grUot9hClYt64ptew1aMPjJpC0x7JSaZ8gzvLQdrrZR/MI2SMifoVGxyYg==Hd9l1T3wNy76vUXgxDpx01fMYm0EFNEAS5EHWQm0bR1UMNtCGV6TyWIS4yu13WqpsOpVcE6hkuaX2KjrE8FNOg==c/L4fmPd70W6mvfMyYoD2aYPgO1xUrJkxBG3dYSXuC4GykRL1DWE18RamLd4G56eZIR+43yZp9Fa1cA+5BYkZw==74MNve2b5vVjEdkGY3MvAeOQNLyrfTdWS2NQ+KF+SCzS+fLiBPlJ3zpBNjvKV/4xBVRpQfpJXpfy47aoh3QGvw==W183+ZQ+M+Pbs4pdRIzt/jv78yw/VcNtULOkUe/EFs42X/YZnFxRko/EOqnzUTKMio2QKQuq4RQ+9EvxTV4AJQ==9cC9k1bQUA7Y2SjRYsABtW7bMvlupW9ixOQzdd7Ol50q+SKSCl96nhbUCUwouWmuKsNmYTxQ3M6rlOkJoViHtw==JkMbKPDIhapOB08U2LJgde+NEPHygILTPfpjbC51bqe6eoUnCWWqZVWOU3QGIsLhu2dUiNj8Vw+EbbLGshQI5A==tHPMSufZpzal2d8agQ0clUH0F2+r+zIRpLMk10vmsK77Jo+aee0DZ0y0IQ/5zjAiZ2Lh6l68DnrtgZbbKSxXmQ==rzIfF2gvUXyjG+IbuDQyhpRrllBaKYjXTyybrWGJrpnw938/jk+fKYxv+zoczn3DdhW9oc+CcK51IrqmFr/80A==zWmoFYFo3a/GjjxxYs9f/lnjsQ51ituCx7NDsc0pLyyX280bO3MbbQkD4+rC0Koj6kETFF4TsT32k6omKUApgQ==pxOUwzD+nrFVANvpC8/QgD8M437GL1MFuVeTTKeu54QAtJ+FFD8HRD1vxyiCjngTlFlOAFrv/dt7TnPuhmIiJw==y3bV+mhG8x3uZF+vcx02vcnOoAtVJhDpO1XyExoqM2sKKnIpaxp/tT+3D7ae4YqjFFWBdtTienx3hXINNqfh1A==LfmR7Xne5v+EYEkKHj9VzgkTSNcRZiR0L3p3M6O6BBBuL+sTX5fPy9UfrXqcKKdcNDozaokLiwLeRVSz/VD6HA==z3sBn0ZBNrAwqtv7AliQ56rOvlPhWC4W5wsAjcklVQSLEBBteBnALmQGW8fNoY9P2hI2MBfGLQa4TiiAjCAMzw==SwBX0WuwKB2P5HBH9YccuWq6xjMSqfPMf+Lv3wwYa481jJzhZFHR2os6Ndq9j1QqoM0ZouU+dbdHz6Y82+R7Sg==FI6531S7kZe0ihUtVf+25EqP3oJBm3HbNUlCDwYirldZL+t5pJsRWt1dnx9wKf1ahOeu6SGVriV0qSTMHmAAlg==q5Kj3+op1MiCufWZcVBGp+EZeiOenHbS+D3GvSEYM/9rEChmbaVDTWOZv1BFFVsAa3f7jPw9eajRxzCScnvZZQ==wH6wnE4kDqI61WHSClrdUz2Xd//dazK5TX8dWg0yPg0IK3jh4HPTXzOLorV2l1DR5ZrS4RcL1YIq1QT7PKc8xA==g1imEiA4orW830q1OzZVY9Ta+9Z0zkEisXAdhFyKGs5vz8qbYGowZEsrRnOn9vs4pW/XZMHnLEOeH5uWIh4v6A==X0bbqaT0Pyv7dor1T4hGWqhfOmN+V4K0m5b3Qh+0LOkwEoq3X88sIcnzdYysVxk1fed2PYnq7l6cUWVozaJbCw==G5bG2vHgatUZNVfMBZKxKjNOfVumloyG6mgXWauiPYxGneQ9Bo2sg/gcIWm7VqKrDvybHrvRcrofsHLmFvhfCA==dTswVm+wfTx/Pwtq2c4XcwptGi4qmF1hmhq4xKwsBndXY+TqGkPsEEXw61KmbcB2wAhmA2GcnGGYS2iDOOq0qg==wCtpx4+2NgTop2EfZL1w9aCNCJGMiDpPtYzl0lzuGhWV8j/CzmquoA\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/root.tsx_root_component_9PcKHFjikV0.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/preload-helper.js\": {\n      \"exports\": [\"_\"],\n      \"facadeModuleId\": null,\n      \"isDynamicEntry\": false,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"\\u0000vite/preload-helper.js\"],\n      \"name\": \"preload-helper\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/preload-helper.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"\\u0000vite/preload-helper.js\": {\n          \"code\": \"<removed 2279 bytes>\",\n          \"originalLength\": 2271,\n          \"removedExports\": [],\n          \"renderedExports\": [\"__vitePreload\"],\n          \"renderedLength\": 2279\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"\\\\0vite/preload-helper.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"\\\\0vite/preload-helper.js\\\");\\nconst scriptRel = function detectScriptRel() {\\n  const relList = typeof document !== \\\"undefined\\\" && document.createElement(\\\"link\\\").relList;\\n  return relList && relList.supports && relList.supports(\\\"modulepreload\\\") ? \\\"modulepreload\\\" : \\\"preload\\\";\\n}();\\nconst assetsURL = function(dep) {\\n  return \\\"/\\\" + dep;\\n};\\nconst seen = {};\\nconst __vitePreload = function preload(baseModule, deps, importerUrl) {\\n  let promise = Promise.resolve();\\n  if (deps && deps.length > 0) {\\n    document.getElementsByTagName(\\\"link\\\");\\n    const cspNonceMeta = document.querySelector(\\n      \\\"meta[property=csp-nonce]\\\"\\n    );\\n    const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute(\\\"nonce\\\"));\\n    promise = Promise.all(\\n      deps.map((dep) => {\\n        dep = assetsURL(dep);\\n        if (dep in seen) return;\\n        seen[dep] = true;\\n        const isCss = dep.endsWith(\\\".css\\\");\\n        const cssSelector = isCss ? '[rel=\\\"stylesheet\\\"]' : \\\"\\\";\\n        if (document.querySelector(`link[href=\\\"${dep}\\\"]${cssSelector}`)) {\\n          return;\\n        }\\n        const link = document.createElement(\\\"link\\\");\\n        link.rel = isCss ? \\\"stylesheet\\\" : scriptRel;\\n        if (!isCss) {\\n          link.as = \\\"script\\\";\\n          link.crossOrigin = \\\"\\\";\\n        }\\n        link.href = dep;\\n        if (cspNonce) {\\n          link.setAttribute(\\\"nonce\\\", cspNonce);\\n        }\\n        document.head.appendChild(link);\\n        if (isCss) {\\n          return new Promise((res, rej) => {\\n            link.addEventListener(\\\"load\\\", res);\\n            link.addEventListener(\\n              \\\"error\\\",\\n              () => rej(new Error(`Unable to preload CSS for ${dep}`))\\n            );\\n          });\\n        }\\n      })\\n    );\\n  }\\n  return promise.then(() => baseModule()).catch((err) => {\\n    const e = new Event(\\\"vite:preloadError\\\", { cancelable: true });\\n    e.payload = err;\\n    window.dispatchEvent(e);\\n    if (!e.defaultPrevented) {\\n      throw err;\\n    }\\n  });\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"qQ5FQH592ZMJM7B1od3IgysH7RfqiGGdpURgoZyKPaIJLg69swMpgxQbMqasP7j0Rdv0IzjqMh0uNdVaQyLgew==zDeuOWWWnzw1BuF3lakADami2WrzJILOhPNozyIsnc/Ndi8ZBAnOq7RCwLaGqbQwLwiGbY8RSsxRDcsfd5d24g==\\\");\\nexport {\\n  __vitePreload as _\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/preload-helper.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/core.js\": {\n      \"exports\": [\n        \"A\",\n        \"B\",\n        \"C\",\n        \"D\",\n        \"E\",\n        \"F\",\n        \"G\",\n        \"H\",\n        \"I\",\n        \"J\",\n        \"S\",\n        \"_\",\n        \"a\",\n        \"b\",\n        \"c\",\n        \"d\",\n        \"e\",\n        \"f\",\n        \"g\",\n        \"h\",\n        \"i\",\n        \"j\",\n        \"k\",\n        \"l\",\n        \"m\",\n        \"n\",\n        \"o\",\n        \"p\",\n        \"q\",\n        \"r\",\n        \"s\",\n        \"t\",\n        \"u\",\n        \"v\",\n        \"w\",\n        \"x\",\n        \"y\",\n        \"z\"\n      ],\n      \"facadeModuleId\": null,\n      \"isDynamicEntry\": false,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/qwik/packages/qwik/dist/core.mjs\", \"/qwik/packages/qwik/dist/core.prod.mjs\"],\n      \"name\": \"core.prod\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/core.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preloader.js\": [\"l\", \"p\", \"i\"]\n      },\n      \"imports\": [\"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik/dist/core.mjs\": {\n          \"code\": \"<removed 159615 bytes>\",\n          \"originalLength\": 255024,\n          \"removedExports\": [\n            \"HTMLFragment\",\n            \"PrefetchGraph\",\n            \"PrefetchServiceWorker\",\n            \"RenderOnce\",\n            \"Resource\",\n            \"SSRComment\",\n            \"SSRHint\",\n            \"SSRRaw\",\n            \"SSRStream\",\n            \"SSRStreamBlock\",\n            \"_getContextEvent\",\n            \"_noopQrlDEV\",\n            \"_pauseFromContexts\",\n            \"_regSymbol\",\n            \"_renderSSR\",\n            \"_verifySerializable\",\n            \"component$\",\n            \"createComputed$\",\n            \"createComputedQrl\",\n            \"createElement\",\n            \"event$\",\n            \"h\",\n            \"implicit$FirstArg\",\n            \"inlinedQrl\",\n            \"inlinedQrlDEV\",\n            \"isBrowser\",\n            \"isDev\",\n            \"jsx\",\n            \"jsxDEV\",\n            \"jsxs\",\n            \"qrlDEV\",\n            \"render\",\n            \"setPlatform\",\n            \"sync$\",\n            \"useComputed$\",\n            \"useComputedQrl\",\n            \"useId\",\n            \"useResource$\",\n            \"useResourceQrl\",\n            \"useStyles$\",\n            \"useStylesScoped$\",\n            \"useStylesScopedQrl\",\n            \"useTask$\",\n            \"useVisibleTask$\",\n            \"version\"\n          ],\n          \"renderedExports\": [\n            \"$\",\n            \"Fragment\",\n            \"SkipRender\",\n            \"Slot\",\n            \"_IMMUTABLE\",\n            \"_deserializeData\",\n            \"_fnSignal\",\n            \"_getContextElement\",\n            \"_hW\",\n            \"_jsxBranch\",\n            \"_jsxC\",\n            \"_jsxQ\",\n            \"_jsxS\",\n            \"_noopQrl\",\n            \"_qrlSync\",\n            \"_restProps\",\n            \"_serializeData\",\n            \"_waitUntilRendered\",\n            \"_weakSerialize\",\n            \"_wrapProp\",\n            \"_wrapSignal\",\n            \"componentQrl\",\n            \"createContextId\",\n            \"createSignal\",\n            \"eventQrl\",\n            \"getLocale\",\n            \"getPlatform\",\n            \"isServer\",\n            \"isSignal\",\n            \"noSerialize\",\n            \"qrl\",\n            \"untrack\",\n            \"unwrapStore\",\n            \"useConstant\",\n            \"useContext\",\n            \"useContextProvider\",\n            \"useErrorBoundary\",\n            \"useLexicalScope\",\n            \"useOn\",\n            \"useOnDocument\",\n            \"useOnWindow\",\n            \"useServerData\",\n            \"useSignal\",\n            \"useStore\",\n            \"useStylesQrl\",\n            \"useTaskQrl\",\n            \"useVisibleTaskQrl\",\n            \"withLocale\"\n          ],\n          \"renderedLength\": 159615\n        },\n        \"/qwik/packages/qwik/dist/core.prod.mjs\": {\n          \"code\": \"<removed 2427 bytes>\",\n          \"originalLength\": 28,\n          \"removedExports\": [],\n          \"renderedExports\": [],\n          \"renderedLength\": 2427\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a, _b2;\\nimport { l as loadBundleGraph, p as preload, i as isServer } from \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik/dist/core.mjs\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik/dist/core.mjs\\\");\\nvar __defProp = Object.defineProperty;\\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\\nvar __publicField = (obj, key, value) => {\\n  __defNormalProp(obj, typeof key !== \\\"symbol\\\" ? key + \\\"\\\" : key, value);\\n  return value;\\n};\\nvar qDev = false;\\nvar qDynamicPlatform = globalThis.qDynamicPlatform !== false;\\nvar qRuntimeQrl = globalThis.qRuntimeQrl === true;\\nvar seal = (obj) => {\\n};\\nvar isNode = (value) => {\\n  return value && typeof value.nodeType === \\\"number\\\";\\n};\\nvar isDocument = (value) => {\\n  return value.nodeType === 9;\\n};\\nvar isElement = (value) => {\\n  return value.nodeType === 1;\\n};\\nvar isQwikElement = (value) => {\\n  const nodeType = value.nodeType;\\n  return nodeType === 1 || nodeType === 111;\\n};\\nvar isNodeElement = (value) => {\\n  const nodeType = value.nodeType;\\n  return nodeType === 1 || nodeType === 111 || nodeType === 3;\\n};\\nvar isVirtualElement = (value) => {\\n  return value.nodeType === 111;\\n};\\nvar isText = (value) => {\\n  return value.nodeType === 3;\\n};\\nvar isComment = (value) => {\\n  return value.nodeType === 8;\\n};\\nvar STYLE = \\\"\\\";\\nvar logError = (message, ...optionalParams) => {\\n  return createAndLogError(false, message, ...optionalParams);\\n};\\nvar throwErrorAndStop = (message, ...optionalParams) => {\\n  const error = createAndLogError(false, message, ...optionalParams);\\n  debugger;\\n  throw error;\\n};\\nvar logErrorAndStop = (message, ...optionalParams) => {\\n  const err = createAndLogError(true, message, ...optionalParams);\\n  debugger;\\n  return err;\\n};\\nvar logOnceWarn = (message, ...optionalParams) => {\\n};\\nvar logWarn = (message, ...optionalParams) => {\\n};\\nvar logDebug = (message, ...optionalParams) => {\\n};\\nvar printParams = (optionalParams) => {\\n  return optionalParams;\\n};\\nvar createAndLogError = (asyncThrow, message, ...optionalParams) => {\\n  const err = message instanceof Error ? message : new Error(message);\\n  console.error(\\\"%cQWIK ERROR\\\", STYLE, err.message, ...printParams(optionalParams), err.stack);\\n  asyncThrow && true && setTimeout(() => {\\n    throw err;\\n  }, 0);\\n  return err;\\n};\\nfunction assertDefined(value, text, ...parts) {\\n}\\nfunction assertEqual(value1, value2, text, ...parts) {\\n}\\nfunction assertFail(text, ...parts) {\\n}\\nfunction assertTrue(value1, text, ...parts) {\\n}\\nfunction assertNumber(value1, text, ...parts) {\\n}\\nfunction assertString(value1, text, ...parts) {\\n}\\nfunction assertQwikElement(el) {\\n}\\nvar codeToText = (code, ...parts) => {\\n  {\\n    return `Code(${code}) https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/core/error/error.ts#L${8 + code}`;\\n  }\\n};\\nvar QError_stringifyClassOrStyle = 0;\\nvar QError_verifySerializable = 3;\\nvar QError_setProperty = 6;\\nvar QError_qrlIsNotFunction = 10;\\nvar QError_unknownTypeArgument = 12;\\nvar QError_notFoundContext = 13;\\nvar QError_useMethodOutsideContext = 14;\\nvar QError_immutableProps = 17;\\nvar QError_useInvokeContext = 20;\\nvar QError_invalidJsxNodeType = 25;\\nvar QError_trackUseStore = 26;\\nvar QError_missingObjectId = 27;\\nvar QError_qrlMissingContainer = 30;\\nvar QError_qrlMissingChunk = 31;\\nvar QError_invalidRefValue = 32;\\nvar qError = (code, ...parts) => {\\n  const text = codeToText(code, ...parts);\\n  return logErrorAndStop(text, ...parts);\\n};\\nvar createPlatform = () => {\\n  return {\\n    isServer,\\n    importSymbol(containerEl, url, symbolName) {\\n      if (!url) {\\n        throw qError(QError_qrlMissingChunk, symbolName);\\n      }\\n      if (!containerEl) {\\n        throw qError(QError_qrlMissingContainer, url, symbolName);\\n      }\\n      const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url).toString();\\n      const urlCopy = new URL(urlDoc);\\n      urlCopy.hash = \\\"\\\";\\n      const importURL = urlCopy.href;\\n      return import(\\n        /* @vite-ignore */\\n        importURL\\n      ).then((mod) => {\\n        return mod[symbolName];\\n      });\\n    },\\n    raf: (fn) => {\\n      return new Promise((resolve) => {\\n        requestAnimationFrame(() => {\\n          resolve(fn());\\n        });\\n      });\\n    },\\n    nextTick: (fn) => {\\n      return new Promise((resolve) => {\\n        setTimeout(() => {\\n          resolve(fn());\\n        });\\n      });\\n    },\\n    chunkForSymbol(symbolName, chunk) {\\n      return [symbolName, chunk ?? \\\"_\\\"];\\n    }\\n  };\\n};\\nvar toUrl = (doc, containerEl, url) => {\\n  const baseURI = doc.baseURI;\\n  const base = new URL(containerEl.getAttribute(\\\"q:base\\\") ?? baseURI, baseURI);\\n  return new URL(url, base);\\n};\\nvar _platform = /* @__PURE__ */ createPlatform();\\nvar getPlatform = () => {\\n  return _platform;\\n};\\nvar isServerPlatform = () => {\\n  if (qDynamicPlatform) {\\n    return _platform.isServer;\\n  }\\n  return false;\\n};\\nvar isSerializableObject = (\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/core.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\": {\n      \"exports\": [\"s_dAo05yeFq1I\"],\n      \"facadeModuleId\": \"/src/components/router-head/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/src/components/router-head/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\"\n      ],\n      \"name\": \"router-head.tsx_RouterHead_component_dAo05yeFq1I\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"_\", \"a\", \"A\", \"z\", \"F\"],\n        \"build/qwik-city.js\": [\"L\", \"H\"],\n        \"build/preloader.js\": [],\n        \"build/preload-helper.js\": []\n      },\n      \"imports\": [\n        \"build/core.js\",\n        \"build/qwik-city.js\",\n        \"build/preloader.js\",\n        \"build/preload-helper.js\"\n      ],\n      \"modules\": {\n        \"/src/components/router-head/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\": {\n          \"code\": \"<removed 34304 bytes>\",\n          \"originalLength\": 1815,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_dAo05yeFq1I\"],\n          \"renderedLength\": 34304\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as _jsxC, a as _jsxQ, A as _fnSignal, z as _jsxS, F as Fragment } from \\\"./core.js\\\";\\nimport { L as useDocumentHead, H as useLocation } from \\\"./qwik-city.js\\\";\\nimport \\\"./preloader.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/components/router-head/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/components/router-head/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\\\");\\nconst s_dAo05yeFq1I = () => {\\n  const head = useDocumentHead();\\n  const loc = useLocation();\\n  return /* @__PURE__ */ _jsxC(Fragment, {\\n    children: [\\n      /* @__PURE__ */ _jsxQ(\\\"title\\\", null, null, head.title, 1, null),\\n      /* @__PURE__ */ _jsxQ(\\\"link\\\", null, {\\n        rel: \\\"canonical\\\",\\n        href: _fnSignal((p0) => p0.url.href, [\\n          loc\\n        ])\\n      }, null, 3, null),\\n      /* @__PURE__ */ _jsxQ(\\\"meta\\\", null, {\\n        name: \\\"viewport\\\",\\n        content: \\\"width=device-width, initial-scale=1.0\\\"\\n      }, null, 3, null),\\n      head.meta.map((m) => /* @__PURE__ */ _jsxS(\\\"meta\\\", {\\n        ...m\\n      }, null, 0, m.key)),\\n      head.links.map((l) => /* @__PURE__ */ _jsxS(\\\"link\\\", {\\n        ...l\\n      }, null, 0, l.key)),\\n      head.styles.map((s) => {\\n        var _a2;\\n        return /* @__PURE__ */ _jsxS(\\\"style\\\", {\\n          ...s.props,\\n          ...((_a2 = s.props) == null ? void 0 : _a2.dangerouslySetInnerHTML) ? {} : {\\n            dangerouslySetInnerHTML: s.style\\n          }\\n        }, null, 0, s.key);\\n      }),\\n      head.scripts.map((s) => {\\n        var _a2;\\n        return /* @__PURE__ */ _jsxS(\\\"script\\\", {\\n          ...s.props,\\n          ...((_a2 = s.props) == null ? void 0 : _a2.dangerouslySetInnerHTML) ? {} : {\\n            dangerouslySetInnerHTML: s.script\\n          }\\n        }, null, 0, s.key);\\n      })\\n    ]\\n  }, 1, \\\"r0_0\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"2heiE2ewDXMnoNkpMltxMYcJn2QW1ofCKWkr7XdqVHbZ/fp7BMFfouOzKeTjC3x6aP7RP7MqYHJOajWQDaTGOA==v88cmTFIZnxnFOvMdnc0HZP6VRAxb9PXTai6aza8QZnGMvsYit85wuDHPJZPcLDr2jl51nPejCotcy0eMRO14w==uNN7IZFpURHtCtwZT/KWK1JK2v/rCPjTVAwHfEjVQRlBfiNx5z2He2jscB4vEpKrRiBWD1aSTWZ1wME0vR1tbg==gtxh9TG5Im6U4af13LO/pvmVcCED2SVl7Dn4uaJSwlOkjlrcZOpu528oJw0dpIYeERNJUOuinUfZzsBcTzKPxg==p0OlqM3l2ooKvQ124GC1HnZ37W02OS4x9CtYbw67JlfV3Wl/aTBTgj5wsdKfSNnJDlY0GynPGZc8d4cv0EH0ow==tXbV7gSpBHfLCx4Y49ypfnTGGidhYpYqypAXXF/38jBqR0SZPRlv77SgEw4O5dcWn+7Zcv697RPEXlYe7wOMEQ==c59ThnPfbA7hileV19M8EeRDyKtL5QZXg0OGFX1/4w9RlD2sz3UF8XCovRiX1V2OnA8AjysdujPM1guhdnkjRQ==IY2yTP8aT4qIcw+Gi3ya2mBlZQp+nEGng0SWsxBwOa8x4432e9543o3Upwe3kYbdnNQ2rqgtMK8KmeDvyeph0Q==JTXapfd/sNXQCVrBsLjALGoj4enuIPqzHtamyLWdmJLqi211DDztviegoREyOlSTJiU7KlrOdNB63oeWdG06jA==ydwm8BDOj1wOZIIiZdJfOQHHCBTCtuU5oj/4AZOGeK5xJBFKT3Uuj+kTp98/d8iQQDKvOtPWPChmBHX0cI70OA==6cMXr5bHUqgXhGZH+Y0JBLF8qjxP6l8KKg7Ma744nqO6dkBaNsoQxppCJZQH9tzFNDJSFkos7Qn6J82eMHpvUQ==WZRp1agTbuaxKwj3O7UJ4qUGGEnbC2gnhyX+4bq12qQRQiQjXXAN+wjGpx2Io3hPzbV1JdUR5n8jsOFEjaU3JA==DagmRh/BQXg43YAH1BoEM+3mimHuq2sSEULRwz6c/cg4xRZp7u5knzIuN57w4EjEuGgevOgSdOLRaE+tpwL3xw==qnoYK0VFGmwudAGTx6hWpIbqTGljFMXuqAReE0uwSj13r/MubhK4NhgFQX49BcgBDz6ywUdcmbty3oagmyfB7Q==A5LZL0ssKWkri9SWfHegpsTDSeA6sEe3q/yZFg/3aWk4bCUul10AzRgC0kfg6VkAyJ5qyXVxHtCRkkM1ZHnDVQ==3GLntd8jqf+cNmxXDMGbCJ4UEMefvo/T0WKY/ia+fjfuPQsAuZbgH8r3DfIbDnq6qyLHr4jvvS3ONN1dsw5qYg==J7/GfH2t0r1qOEpIS+zO6OR/lNDo9P2ya6OtFUGFJAdkh4xbETBGUdWyJBO9heEtATTTYPSZeyuqYazlZVJBMQ==BymYNQbGm5TBLbciAq/UQWodcgI0lDqomf1kHVO4SkdSlDXUKUJgX5/xc2ChuVdIMbSuearOKlPSYrIA0mo7bw==MwmQg2oZ0z1IQ6NYqwmICvuShQozUJfKYo3Dh53uUaeflqlLI1tN/Mzambs1fhUSN0rDGUCDUSigKPpkF/ylWw==7kL0lY0y8t9BF/RIWG4mUjtr+3aoVs5o9jhEJWmIlrKi5PK1mZhmWMvj/x2+TyZGKOTSWft8hMaycZ+jneIN8A==MY15qPcRo3Jqvf3M+uR/ts9uw1EmVqtnDDFyZcAgIsrdQRVTSSANhVHxKdFpDiiVmIXdzWHPiyxXqwkmQLsI4Q==eynRHIF9Xu6a5++zzqFxU8G0QjOI98YTpkS7RLpxFj9qZ4Ue4ztmhDmODHeWEwwn87oJfd9aHyYWnHrbZD5qMQ==yx2tKGe0d2pe5+UkG0PkX8tjtd1ETytA4GLoECNvdDaDbtoIKSBydTgOtZSVn9glTBALv19sv/cOE8uaYUeSuA==zbkyDJdEqZdQlB3M4AGJEhy0pA/cVamviEV/+iw+sxglpCecBVbAiwlMxZIaqeIiROJ/dJ4mxnsU/o1zCIiB/A==zp/ly7jB+Ax+4FAKEvmiJqsNLKnHtHTE6lZK0kmY96Ck1M82TdHtN1O4tgexZStgRR9dj0bB0qB2/YojINr0tw==lHaHxsh+rf7KQkLgpHdOVWeuP9IWDOuAP5v3mRnc7LkQ5EYftxUUNPQFH5syHc0oWQ9w+9W2d27Fc+tH/hDVPw==QS+z6ydwcrLgMojl8BuM+uqXdj2zxIgFcVDrz+D3z/odfqDZGGzpz1PHZiNPVL3LoCQw8j41KxZdp3mFiRGp1g==KMZukSp+AenaqJdInNhMYLNhxBTYBlQ29nUce2QEy1aCUQQJ6bJoGPzF75WA9wWGSQsZSxTTQ0rUGNYRmgoOfg==G0dgQ4koPIyjEPPOeXx8F8AxKg7arFTnEbxTOgoQzlri8wv0sfWA19sfgZ4okU3bO5p4v29GzOi4wTS9XQrvcQ==PS6oyNh9KQPKSuLwNYkDOKQWdMfFBbO+XPmlo+io+bNbHUXyucJcbeCCReNmSxdNEQMfEczse8ACdMVW7ez4vg==AorbSHhmPAY6+u+ptJXN+lSIwZBdw40NiRYlNXB79+W9k4fJc/98kgAy/DG4zEr8QMMamqXyEW0sp6Nrujq+mA==jRmozK9ueGPzRKEcLM35mjbvKFZgjgplAtVEfk9nKPIqY6nxfFgPIgIludW72Jp6cIioy7XcYGcOwlbwDdLNgA==nSL9Frk4vaMO0EBWphZjNI81e4Cw3tWTNaRZL94papMBlVa3ngfVQxWfoiGtzcGy7rOtWnYTcJTvMs+cHNWksw==eKeoR8IYXEyQ27OHTkjkMp+hpZQK8eyD9GTroBSdHT9Vj8W0/0BxPx4t9DesoYc6\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/router-head.tsx_RouterHead_component_dAo05yeFq1I.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/qwik-city.js\": {\n      \"exports\": [\n        \"A\",\n        \"B\",\n        \"C\",\n        \"D\",\n        \"E\",\n        \"F\",\n        \"G\",\n        \"H\",\n        \"I\",\n        \"J\",\n        \"K\",\n        \"L\",\n        \"M\",\n        \"N\",\n        \"O\",\n        \"Q\",\n        \"R\",\n        \"a\",\n        \"b\",\n        \"c\",\n        \"d\",\n        \"e\",\n        \"f\",\n        \"g\",\n        \"h\",\n        \"i\",\n        \"j\",\n        \"k\",\n        \"l\",\n        \"m\",\n        \"n\",\n        \"o\",\n        \"p\",\n        \"q\",\n        \"r\",\n        \"s\",\n        \"t\",\n        \"u\",\n        \"v\",\n        \"w\",\n        \"x\",\n        \"y\",\n        \"z\"\n      ],\n      \"facadeModuleId\": null,\n      \"isDynamicEntry\": false,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/preloader-DnBPyedC.js\",\n        \"/@qwik-city-sw-register\",\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs\"\n      ],\n      \"name\": \"index.qwik\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\n        \"build/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\",\n        \"build/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\",\n        \"build/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\",\n        \"build/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\",\n        \"build/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\",\n        \"build/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\",\n        \"build/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\"\n      ],\n      \"fileName\": \"build/qwik-city.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"f\", \"i\", \"q\", \"E\", \"e\", \"z\", \"G\", \"_\", \"c\", \"x\", \"H\", \"r\", \"d\", \"I\", \"B\"]\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/preloader-DnBPyedC.js\": {\n          \"code\": \"<removed 22144 bytes>\",\n          \"originalLength\": 4294,\n          \"removedExports\": [\"l\", \"p\"],\n          \"renderedExports\": [],\n          \"renderedLength\": 22144\n        },\n        \"/@qwik-city-sw-register\": {\n          \"code\": \"<removed 264 bytes>\",\n          \"originalLength\": 194,\n          \"removedExports\": [\"default\"],\n          \"renderedExports\": [],\n          \"renderedLength\": 264\n        },\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs\": {\n          \"code\": \"<removed 22892 bytes>\",\n          \"originalLength\": 60672,\n          \"removedExports\": [\n            \"ErrorBoundary\",\n            \"QwikCityMockProvider\",\n            \"ServiceWorkerRegister\",\n            \"globalAction$\",\n            \"globalActionQrl\",\n            \"routeAction$\",\n            \"routeLoader$\",\n            \"routeLoaderQrl\",\n            \"server$\",\n            \"serverQrl\",\n            \"useContent\",\n            \"usePreventNavigate$\",\n            \"usePreventNavigateQrl\",\n            \"valibot$\",\n            \"valibotQrl\",\n            \"validator$\",\n            \"validatorQrl\",\n            \"z\",\n            \"zod$\",\n            \"zodQrl\",\n            \"_auto_deepFreeze\"\n          ],\n          \"renderedExports\": [\n            \"Form\",\n            \"Link\",\n            \"QWIK_CITY_SCROLLER\",\n            \"QwikCityProvider\",\n            \"RouterOutlet\",\n            \"routeActionQrl\",\n            \"useDocumentHead\",\n            \"useLocation\",\n            \"useNavigate\",\n            \"_auto_CLIENT_DATA_CACHE\",\n            \"_auto_ContentContext\",\n            \"_auto_ContentInternalContext\",\n            \"_auto_DocumentHeadContext\",\n            \"_auto_QDATA_KEY\",\n            \"_auto_QFN_KEY\",\n            \"_auto_RouteActionContext\",\n            \"_auto_RouteInternalContext\",\n            \"_auto_RouteLocationContext\",\n            \"_auto_RouteNavigateContext\",\n            \"_auto_RoutePreventNavigateContext\",\n            \"_auto_RouteStateContext\",\n            \"_auto_clientNavigate\",\n            \"_auto_createDocumentHead\",\n            \"_auto_currentScrollState\",\n            \"_auto_deserializeStream\",\n            \"_auto_getClientNavPath\",\n            \"_auto_getContainer\",\n            \"_auto_getScrollHistory\",\n            \"_auto_internalState\",\n            \"_auto_isSameOrigin\",\n            \"_auto_isSamePath\",\n            \"_auto_loadClientData\",\n            \"_auto_loadRoute\",\n            \"_auto_prefetchSymbols\",\n            \"_auto_preventNav\",\n            \"_auto_resolveHead\",\n            \"_auto_restoreScroll\",\n            \"_auto_saveScrollHistory\",\n            \"_auto_shouldPrefetchData\",\n            \"_auto_shouldPrefetchSymbols\",\n            \"_auto_spaInit\",\n            \"_auto_toUrl\",\n            \"_auto_useQwikCityEnv\"\n          ],\n          \"renderedLength\": 22892\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a, _b, _c;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { f as useContext, i as useStore, q as qrl, E as createContextId, e as _jsxBranch, z as _jsxS, G as _wrapSignal, _ as _jsxC, c as componentQrl, x as _deserializeData, H as eventQrl, r as noSerialize, d as useServerData, I as withLocale, B as _IMMUTABLE } from \\\"./core.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/preloader-DnBPyedC.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/preloader-DnBPyedC.js\\\");\\nvar BundleImportState = ((e) => {\\n  e[e[\\\"None\\\"] = 0] = \\\"None\\\";\\n  e[e[\\\"Low\\\"] = 1] = \\\"Low\\\";\\n  e[e[\\\"Queued\\\"] = 2] = \\\"Queued\\\";\\n  e[e[\\\"Loading\\\"] = 3] = \\\"Loading\\\";\\n  e[e[\\\"Loaded\\\"] = 4] = \\\"Loaded\\\";\\n  return e;\\n})(BundleImportState || {});\\nconst doc = document;\\nconst modulePreloadStr = \\\"modulepreload\\\";\\nconst preloadStr = \\\"preload\\\";\\ndoc.createElement(\\\"link\\\").relList.supports(modulePreloadStr) ? modulePreloadStr : preloadStr;\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"3vRGrJ7m4H3LPJiHyXrOpuhles+pyvA1GyPeR3eR8qQAdbpIv0DlHK7eyFg8FO46ool66wYZKOrFMJvbvL71hg==LzCRMJvgGX0H3g9yBP3Z4dM61WnXeUX6BwAozmZUiMGuI1XCl9SeVNRO1aEKyUcubJ27+aeWcKebX7QWcvc0GA==REvcZ/QBktVIAEF4ZnCsZjwxq1RkfnEN6TM/00TYZdqB3vj2Bs3TA8WNuSoF80a+zgRq1bAUSg5y63SmGPzZ5A==zPhWMk/g9M83vb58SWMf6y47yVjv2VfGy67pV9LG4KZGg1bYoc05g2vJ30yWUTUpcbglC0FWRid632stCFGm4A==1NOaZzOQ9F/xb9I0WrTZmOKGqnQHzKB636+vX3UfeQ/uU/qAr9cRZAinFENQL8UPdFsjHbk8MAHN9/pfI8aJUQ==ixnteFu6zDHQXSVOd7KHoP5s5rXE70NvEmeon7d93saQNmR4ulTZTzTZ9QFQeR3Qq6vU3tMEIvfQ5dS9N+DqfA==tdJ+bNzGVaz1+lQD4ksl5QYek9Gl+IMqn0ZkKTdO8Ce+b7aMulH2+RNIos16MmoQvPL9hPMef5fLWC5lhpz3Xg==ZHhMcqqdzjmnG/QKfF4nh0vZ98WcQIbV7dCXBYQb7bKr3xd0wvvYyB9/MotygXXIXWLZ+osx0ym1e3A56F0L5Q==59Nxg25WN/nbNxUNL0Zi90VhJR0i2aJ8gwxcLp/CnloUgjTcBgQdwsAC0YMaipFK2W3+pDdAaUfeL9f/ql58Tw==ZMeopBYlyEqgmIhK/mWft41ZHIuyt6GYBBs7WWZG9wJ0Cx+qLQeFn2DF+51NtfHToeDIWcFrepY0eEW8Lkm21A==IYoJIitQ8Q4vbm1/95R0NqYQPTsBBhIF2q5UCbw4Ky+NNyiS7V92sSo1o3JFilCFrZyZwc5j8LJBOKFnjzoJxQ==Or57x0t7sb321jOR4rjFyh28Xd9uHHlHIDXqjuBBgfcOG0/EEG8jN8DHvkIPqaSIAEB36nZDHoT23OoSwH4rEg==oecE1Ax/XWiCPEwOfX1wYrC9yqZTj6xdW/ZSp+zAuVMA2sUMklCJ+pbIzjO/724R7P459hKJgX0Ql5cY+XAdAA==/+m/RMIfjiPsJa4qOld5la7sppyl93kjoZ6xxKNn9872m/joL4Tfv7lUoOxn2zM55VPKOv1wuD3z+9ECOwxcQA==bZgt9IMd5VtbkfkeWx8nb2lh6i8vyXWUyyJg/QCEc6oQvK0yxNABIIepidELQynI3990fSXFmk3Z0z0u4WGuQg==UVp0vd079TFKQnenNeglcupRUUt4vLrI1eS0BzMhKUCFpBJTl8MEZseuD6MK5p8zMLE0TBBERTvb5IKNYKqXbg==F4KAEZU8YFhCgvGU059Y9BpbX59uaUjhsqtXNKyWf94eHSisFf608Hfo0qRIR3y2jpPI7AbszBVxehrzdu2pfw==iq++SmEyIqKIn4MYKhdCGGMPEnK3YBIwFJ/1UgzaB32YkPcGtBfmwd9nhgOltWC/dv3pW0ju7efH4yYo4EU+Aw==mMX98d2OqcmR5GQHpBXcUGXFPrf+qABStTB30C83J2Hg4Q3LTbSQU2fvsQimJFikQrULDYey5ih389tFH+pwkA==5HmUA29JL0vX6CoYq40LcDuwPEWvejSY0V+j+v/fV5FxwU0zQxVI3XQNp/K4mCUW55nY9M0oxhckHc2Um5lHOg==v6kNzo2oJUVI8cL/dnZo7HomfIUwooIpciiLtfSclpbpmgMv1YC7CMTN8wy+ZcR8kX7teB/tqKaOMpZrPS/p+w==6nWCzuqhoASVqm6wZQ7S5LNGcM6rYlyJWctOfhvIFE1k90YMt1twOkYVVse5PKzq8P92mrF6zjVOg5sRLAKVkA==8P3ie+/aL2ZxnuwQbKAvySda2COMdbx71tuslurgkaXmk7AtiFKrtkMBsXHYtMdYjMNuc/GOPkSctF/bdzNmUg==FyjLfv85bqAN8Vt2R7+GjCJ8gS89GrGqU6g7Pz8dkxJa2aDkEeBWNN+yBa8j7L/PKsJPv7KjRZkEz/I2uiCWww==cTJWLydG7hfN+OLEysBdSKUs0Jijrj0MEISZKeMN/WA2iiA7toIBF6YHrACsrDWcFRVdEQ5VoKuRJxZJ4KBMLQ==dr36XLFX3+av1wq/s4sjXZT1RdovQfzFZWhaAG9oLSHW5Kg3gUUmTdtTUVPc+8hpUCzn1ZyjDu2r+1Bk0+MdFg==40UdFe0QMsdJB4yq+Sy99642I8BFrc4QrcHc2sk57q6t4a9AQ5fvOGKPIrR5L43lOfdQsP0QOr38u2xyPneaDg==+Mu9NaqswAg5Gi23Hr5qlIpQCN0UCwGZlqu8QGsWUtTOwAqOzqBxov4j655GVWtsU8dQV+0Q5F74PLJ+GEfP0w==/BTFActRM+DzDltv/AEZ7L7Iai7S0Xpa8eSAwG8UE9ezyJfftWV2t/gICElX05ec8d81/fjuoj1Ns2YeLZxzwQ==4mnZea7+KC11mhltqavNp9MeruW9ArPxnck59DM24hu0GRpUW5cXYPfJzbcxDCIPu7hYSEK6WeZXnWYMgGeLWg==z9wfyBm1CjRLjRxznhgeFUx9oKeALbaaVEySkBc5sMhaWxDAQL4NXUh69UqsaMr9qmdWv0EmJ/wfmc3065jSdw==nABqT4nqWG0ovM/0Hj5QcFehHUfI8P4Xid0IllbinSma/ZXCr4odSgzaHHWrudkDgKiMgpE1WXNLVIbrryHMsA==CrHr29yltSEtP0WUMxir/ujON5ypHUWxHWeaY/VWEK4W4xK59o0vHZkoRtZHjJs1UOVu8l2W236EGxJ3AwhxbQ==CluU8Sfx3vW2BUUPBZxSLQRW6zu7uoUhIchEPc0G431AvAqj3aiSMzWE4TUHURdRI/dl3oyPg945qWZPzsqjkA==Qinc5XWyDZg+iMYexV6MMxye+91/+GzMsM3lXJI+hnKiRhzVs6ZTXpPRgLWUIjYqHvQORfYVEGGDCdc3ag2kBQ==Ajx12D7SG/34Kn70cgbeJmDmYcgR50anTjsiKOaOfE6eC7MySYOMFv9gv3Qs6Ao8O061+gvZNMofR8D2mTS92A==iIDjmmnyrdgXB90jHquuLeeQwvizowDi13yJQxBXYJlsSC1BqV31GB8UN7f76N6DCFZW5d1yfrfVR29a7wklTg==3jXOwTW6lxY4/jlm6CF5jNZW/op55v/5sKFnyks4tOdgMBEo8DPetn+AHRxwG9U/nLYUCt+gAiFN1fTW5wDrkQ==OAuJRcPWqmAtrPqobMuq2RuBB9Ho1Rhgf34YP1p+V205aiJiw2QEXWU0A4/A6VRtXWbdUXeL4oOmaJxw3QQ6dw==f55p6UHy3JrE6x81ic/qh/zmJMF/oWshGqiR28r+i1h9K7x0V5WYOJ8RopDn9EMsD8GqjNeGENZuO/XV3EkUQw==zGN5E4zAjCGhNcwNytgi+n2WnLh7gZkMo63AucKa9YKdiKVjvQd8MIXvF+buLPCV21aOxWvsioEx+lCuoQtz5w==BQpYHtjgH0sKX5YSBC9jvkkZ/MlteweoEsZTRZ5NaO5+QvKKr5CUUsBYU1Vhn4Zg7DMGhJbjxdIHx6Fi8+gcMw==hNHkLamD2W2GPD96eRozvHC/e+y8e9eA9rUqoLzF2zVsC4unGdzXktVRmOrFoxNKzBIAOSVh//n9b/LPC5gh0g==axKD4qPqIWM0KCuyUsOq83dECo5ixYQeHmZh/6VxeHGCmzl1j/Sv1Azf6uAWiP0GPPp7aTMBG++10YJ8F5qnkQ==KN1qBtPcCpaeWmUgk0fplFQThw2xMRQ2B+XkHLXCbZjS2kBz\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/qwik-city.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\": {\n      \"exports\": [\"_hW\", \"s_p0qDGZV34Qs\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\"\n      ],\n      \"name\": \"index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\": {\n          \"code\": \"<removed 433 bytes>\",\n          \"originalLength\": 227,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_p0qDGZV34Qs\"],\n          \"renderedLength\": 433\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\\\");\\nconst s_p0qDGZV34Qs = (evt) => {\\n  const [action] = useLexicalScope();\\n  if (!action.submitted) return action.submit(evt);\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  b as _hW,\\n  s_p0qDGZV34Qs\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_Form_form_onSubmit_p0qDGZV34Qs.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\": {\n      \"exports\": [\"_hW\", \"s_0OaA1Rw0yxk\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\",\n      \"isDynamicEntry\": false,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\"\n      ],\n      \"name\": \"index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\": {\n          \"code\": \"<removed 463 bytes>\",\n          \"originalLength\": 221,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_0OaA1Rw0yxk\"],\n          \"renderedLength\": 463\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\\\");\\nconst s_0OaA1Rw0yxk = () => {\\n  const [fn, registerPreventNav] = useLexicalScope();\\n  return registerPreventNav(fn);\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  b as _hW,\\n  s_0OaA1Rw0yxk\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_usePreventNavigateQrl_useVisibleTask_0OaA1Rw0yxk.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\": {\n      \"exports\": [\"_hW\", \"s_gZBt5yIBEB4\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\"\n      ],\n      \"name\": \"index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\": {\n          \"code\": \"<removed 864 bytes>\",\n          \"originalLength\": 642,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_gZBt5yIBEB4\"],\n          \"renderedLength\": 864\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\\\");\\nconst s_gZBt5yIBEB4 = async (event, elm) => {\\n  const [nav, reload, replaceState, scroll] = useLexicalScope();\\n  if (event.defaultPrevented) {\\n    if (elm.hasAttribute(\\\"q:nbs\\\")) await nav(location.href, {\\n      type: \\\"popstate\\\"\\n    });\\n    else if (elm.href) {\\n      elm.setAttribute(\\\"aria-pressed\\\", \\\"true\\\");\\n      await nav(elm.href, {\\n        forceReload: reload,\\n        replaceState,\\n        scroll\\n      });\\n      elm.removeAttribute(\\\"aria-pressed\\\");\\n    }\\n  }\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  b as _hW,\\n  s_gZBt5yIBEB4\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\": {\n      \"exports\": [\"s_KRtEZRf6Xh8\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\"\n      ],\n      \"name\": \"index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/qwik-city.js\": [\"C\", \"s\"],\n        \"build/core.js\": [\"d\", \"e\", \"f\", \"_\", \"a\", \"g\", \"F\", \"S\"],\n        \"build/preload-helper.js\": [],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/preload-helper.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\": {\n          \"code\": \"<removed 2776 bytes>\",\n          \"originalLength\": 2119,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_KRtEZRf6Xh8\"],\n          \"renderedLength\": 2776\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { C as ContentInternalContext, s as spaInit } from \\\"./qwik-city.js\\\";\\nimport { d as useServerData, e as _jsxBranch, f as useContext, _ as _jsxC, a as _jsxQ, g as _qrlSync, F as Fragment, S as SkipRender } from \\\"./core.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\\\");\\nconst s_KRtEZRf6Xh8 = () => {\\n  const serverData = useServerData(\\\"containerAttributes\\\");\\n  if (!serverData) throw new Error(\\\"PrefetchServiceWorker component must be rendered on the server.\\\");\\n  _jsxBranch();\\n  const context = useContext(ContentInternalContext);\\n  if (context.value && context.value.length > 0) {\\n    const contentsLen = context.value.length;\\n    let cmp = null;\\n    for (let i = contentsLen - 1; i >= 0; i--) if (context.value[i].default) cmp = _jsxC(context.value[i].default, {\\n      children: cmp\\n    }, 1, \\\"uY_0\\\");\\n    return /* @__PURE__ */ _jsxC(Fragment, {\\n      children: [\\n        cmp,\\n        /* @__PURE__ */ _jsxQ(\\\"script\\\", {\\n          \\\"document:onQCInit$\\\": spaInit,\\n          \\\"document:onQInit$\\\": _qrlSync(() => {\\n            ((w, h) => {\\n              var _a2;\\n              if (!w._qcs && h.scrollRestoration === \\\"manual\\\") {\\n                w._qcs = true;\\n                const s = (_a2 = h.state) == null ? void 0 : _a2._qCityScroll;\\n                if (s) w.scrollTo(s.x, s.y);\\n                document.dispatchEvent(new Event(\\\"qcinit\\\"));\\n              }\\n            })(window, history);\\n          }, '()=>{((w,h)=>{if(!w._qcs&&h.scrollRestoration===\\\"manual\\\"){w._qcs=true;const s=h.state?._qCityScroll;if(s){w.scrollTo(s.x,s.y);}document.dispatchEvent(new Event(\\\"qcinit\\\"));}})(window,history);}')\\n        }, null, null, 2, \\\"uY_1\\\")\\n      ]\\n    }, 1, \\\"uY_2\\\");\\n  }\\n  return SkipRender;\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"ixcXlBqovoOHTe1baR/O46mqLGFINz4JJRJwCI+iRDW7OhPpwaOjEv/66A4kM7/KER9oZruaaD6Rk7QM7w4uhQ==6UZqSn5J0z0VLfWSBFI/r3GpPjfX/I+E7f4lhUwuWtz8/5GrVMWYa0tcPpditsNxgrAgCtkSxI09a10MxIdNYA==8C0TbYM59PAFAPZ54kSkrpecv/l+/BECil1sMkj9J+nSt/DKrh0ZKBviqFDwACDr/2jeF5S/rD9CzhnXZTvQoA==8p+OKgJtsEbkS8x6t5RrM7DwsHhBNl84JKrOzYFuxl5EmzUnkMHCqvFYaOd2mRY6lUKRIRlNrWjxFICNchMRWA==TTeBQvrM4R7+ynOyboFuBg87+uxig5MRW8Icf5Chw+Le6v9ajFuHYxcP8GOroV/AfzPnEe8dNJg3QG93FlAlkA==BAW5B636FDXU6na8cLEhSGdSO9meD4HD65f2qvxhjorAD91VIv8euNsNPVne9mMpfEDDQfsbMLta77G6YR8cKQ==8J/QEMLpwLy8smrZM3ujFhoOUqi396o4Zjt+qPa4Y1ZgGlCOly7NEm2aEmJ2auTLNMqbI1y2ecwPG+us8oAlGQ==p8iJn+lKNOIJDoSZqqWD0rfR5bCn565Nkaw96mhbhWapbLp29K5OE2lpo9/InzqYXgm0oBgVziEifLVPHXc2/Q==Lj3kXj1rAOryHTQxVvH3peqHmjKnfz4rTcXFweZQFL1Jv8nAt/xriBcrS+S7p2gR6jA7ZpI34wEyDuPyjivRKA==aDSWE7y7nvazPivXva8gtOxxttSD+q70MmYD4Kxypsxaqy/sjDzGaZhkzc5Sw73asCx5AXZcIHZaxbIi5reEtg==\\\");\\nexport {\\n  s_KRtEZRf6Xh8\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_RouterOutlet_component_KRtEZRf6Xh8.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\": {\n      \"exports\": [\"_hW\", \"s_0s3bilOgUys\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\"\n      ],\n      \"name\": \"index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\": {\n          \"code\": \"<removed 25174 bytes>\",\n          \"originalLength\": 206,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_0s3bilOgUys\"],\n          \"renderedLength\": 25174\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\\\");\\nconst s_0s3bilOgUys = (e) => {\\n  const [store2] = useLexicalScope();\\n  store2.error = e.detail.error;\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"Bnl8dv0BUTAVkrUP7WY3GYLiwQNmxUTGbUxf9C9bVy66HmEfFchHMSI2cN01zYHaTDD7qenxX9PS1GcCuEGsOQ==MHZajRJDgG8EDXt56PEk/kByVIrMuaG2isvTccm7hWzinZuphR2aVOuwsnIA9JB5yS/2T9yoBv5UhSd2suRS3A==gEWouRcRlmoAz1c1b+qBtsSBAFFcX+r4DbRz5/ytcH/jiTVxZchDGpHL3xndSzGuTy/dLHRS9XKZY0IAxijISA==paeQhCB2O3x6oxCHbH4Z11N4BSAbB0rF7Rti5wvBUzp1t3LS/C7KMGV2eyl8dbkDKM6BSH+oLCSXmpdsOs9Niw==vNuFkw1hwWYYLLwnb3KMC9hWm4Or1ZtHjZX++1MbamwKRhm+Vm9sJTJr/IgeiVL0i7/MlkgiwgfOec6Tsjc+1g==UCkACwoNCLcw9XqZmSliINm4p21/raauRJJkS6UmMq7/dESGQO/GspP0MEzvU8QMJkoFmOGjTEWucsT0+y/HOg==v9Xwp2eHmKPV33aURf+DRTQ9e3Dfb+muk+xskmIr9I+2KLh3+lWWnMk40TeNq7PSx7fGj5PPLuSYE6+WKsEhLg==pWxTsUVzeHgcn0p9UF1mEnDk3x+uFhSpcjrwyqo/9ogzf0VXna6nXRmrRPoHo2PqzMSpJbtEou+wgb4ivRxPfQ==STBA/+pyAXwUDcp+PRyGCEuv1zzLyu64QI1Xi/ii4dwXd9RRqZD0b/NEOLEUMx6rZjdp94w5N0ePV8kVXie9Bg==cMIal+U/tu2xJ+tri7sXAnw5YGjUjIwtRgRNJtePgopCHy5R5OC9+DNTex4vQweMnBzWdP53c3Qqes6V2BdYrw==8lV+fqJ+Vl/vU/qhX35Bm4SIpGHx1fmvPyYcSGdKEPli3sPE/i+YK9iCuEGH4QqaR702vJGtqSaf3RsCIRlzsw==vT9UuEyvhJgK9Gq++mj6tWMnlucKKktd8Z/1+tunZr/RPeoFM1JYK+45P1SmKoj4vrgGswInkuEjFR0S0BhYqw==DR+tijutN1BmbfuCTSShTc95fWkCO13E19CLpExXYEbmGRTwWVfUwDn1+A2VVpRtK1rmtPz6z1wnCHeFROx8OA==qleyJQyYbKn3rAmxb09uky99N59MI1asMOyk8IJS/ylZVyCsmcY4A5NaRiefeEZdiZCDp382eiL1KBkVTgneUA==IE3DFxZrpkYG6vmoW967SWagAma8G5koXhlZ4Ay2PVguDdsE1S/zIRdfitX+w0/mCGKECbzyxBwmFwR7IydlHw==d7plA1w7nv+fiV09sjaGekpxxOV0oKh9Fqc1hA6f1zlWBG9h9nJ3msGW+0SlxYKmXCmGUmQNxW27BzOv7/+edw==zvgcTtmFdb2Uf5CaUC/OfpaKEC1tkhrfHAYWic0Y61D6tZ6SjngjqMsLGorBYcNT8wJca4+6dCz2P6CcOC30jA==b1dbHPIAGnjbfheNJ1ON2TcfjILpCDTB52B/DSL56o6U/+MV2Gf7zWF2bYXvdUzZ5ws0jlLtjEQUOWgWtWc9xw==PwQUIRAsaVRASpVU1Q4PnpFpzcMwKk+wRkGcaau9gFyYhLSBMNvunHDYuczyOZotKy848nQT9a7v+J1L4B3NVw==L07mYFVKN+ElO7iF/MlPe6TXuEMrB/fBa5JdQDqzvUWItSi26gaPoo4oo6jEDE7C/Rn35PKCqNlcwEpkWdmvtQ==q3k2ER4HOuElEo7QEeMDeDxa54HDoMbewo+TvHidgT7t3RFn2bQwrwAMhtIPT1HlUBnvsGhfYLyPGXXmBnXvqw==+8VfrOCHG6cpNJ5aEeC5SaID7xahX2A2KVVAQYqqlN44TcpIjk6VrKPzPFX0g3ot923Fn/LMi0p8YWlTCBck0Q==mltqFiIzzkhiD0Zhjb/EFZjWnqi1FzwU1twh1p31OTWYTZUpi4t2rsuGzJK+HsyenlRQWY16vTg/6y+AKB9GZw==DCjAQKgrzNyYrc42iqXZI3Gr0FLNEQav9FQNzG/UY5+fxlv2r450buuguu6GOFyZv/x8ZwWCGzw8OSIvgRE/zw==7mO0NhgYMQhRXSyhXyTzB0xAaPna1Kr2oKy86KvmHf40rQ45dDFTZ4xLx8wuoDpn/Q4MN1bSfEcEnTjzFCH6Cw==eVzeJqihb+n7Kp3zpuPSFNHZX1Z8gi/koA8P6jjVz0uVfiuIWsS/u9dIUCIdreUaS0nV3ZlGWEH0RCqnk7arIg==SyyZLvG02xB5YkHC9Y41eX2ZXE+Y9TLWMCYiqRk9Y7siIkxWE4nWPS5L3lJLLWb6LiZxzgEXLeRSlfTeTIFTpA==zUbWe12hspO4hxpgo6oTqzTNXaWcZPeEtMdkMZyqDhEEjs8fmn/CqXKC6JLRGQzz9+ioReufi02T2ni77HIpRQ==QWXrNL730nVA5D/Y6LmBQcrRfI6K0sIknozg3FDMRFBQNnSw9utgNClPuFNXZJXrusRG3eGCAnPqS9YKoG8KgA==GryZ79zjDapAiBIxfMS+OYGitS9v5130ABvMJyqb9Bz+8p9Fbfk4owOSa4Eoc7gkfduYb2Go8USWY+pLrmcK9w==ugWlvj8I/501nC5QqvJyFeJxtwLu32xcc7tb7oVAFoxnUcS2HExKEusfGvVsEcx7FjZZ2RpbmmpLHHj5zit81w==AvgSN7emzJWwk8WNJQxlkIv6NNW4k2hW0nLfG5s64ZZC8xh5zdk7wjx9ssN4brzldxaEe84NFOLC3Us4tIoXkA==eEZjNrgYl+m8XNkoA9O74ajOGrsdVU9Xoo9cKSXhehPq2EYp8hWxQ+BUZ2JWtWdNpbqklY7e5tFlBTD3YJ1PvA==LHpqNQ2+pjMlOmFghV9BoSsNHy3owmgLQmdEWctEFQTdrfts5pkdcZME+jAXSxLUYZbRXXy330ur3D4aoXX3WA==iw5aOsVF+kIuHpJ53VxW6PX+Ej1mqvEwECyyWbQHhYgbbIUPWm6uqgiBDmzgkJ5l/Ut2DoLAj/tcyeonrkNI+w==cHcnF1E3oIF0jsJHlsh1e7nVdy2r3V8YSmT2vEd85FxeAWqWlWmaW0dtO/OhsypGmvBfbI9BNpsHMb6I3uwjNg==fH8FmUSmI4cfoq6TmCuT/G/mJZRROApuCX2rP/fR0wixLR2VkrLBz+Gf8/dRNt0cP6Pv1UVC/b5p+oseQ/HE+Q==ZnZcDdw36Y6eiVMTKfZOgRAxn2B+WfqFro8lzmfrWN8gA4q+MTPfIsJoZCdKogZUPMVmNB+Eevkzqre6ni/TGQ==CysX8UjsNY/YUVy5bjAQICeLxabp1D0GvO8/js+2DYlUO4o8ND9QPT9XI72A9it4CIlqMIfe+7oS6bgLRnLMfA==ldget7yj/RWfqKRDq0IelCD9uMiHlOhAUzk2ASodq5qdmfi6PBOaPEsn+4rTud567kGLIqH9p9jIbCXnDnDOSg==uL5ROztYpNpFm8ofEi9iWd9czZiQaAWc4jnERT4f1Szb8RpenUsyhxWhCxP+7/eODdG+Wk2zCtdAfSksRYL0aw==dBrblUIpYtAptaLe50yIlha/Bmvkt4KtVMeLaIj5Lz4ARc1ONr2srkGtUbglT0dGj065s8Jgd8Uw0ALdXaKl8A==CVCxyA1/itaxTJqKojKbglLS5xe9zyF4h32q6nmGjD7Ij+4EFAO/Ifrcotl70dTvBhiSGLxcrRLD/vrm7xOraA==mrTuqUFNxQvfpJTQ3/8CkUhi/6+rXYYjVr4sQ0ODKtBWDwM2NyVdLl2lyikhfUNduK0JnJXPuZgoSgNrvZQXsQ==B4dhbnwTwhv1zkqQjPtjo6JypDK7LlYBwMZMO0oROr6guQKJVx3lk+jJVL//NOM5mm5ZhfLjYRahu8VH5Bcegg==0RyqePrv1QvYLCSBesMZixrZ/huo2sN9LzeNxVYfxpTa7ghNuz5iC0R91zQ5MrqumqQmEd8AGqlXOVgxDoIkNQ==g0nQ8l8Fn1Os3avnLhpK+GZR1Sxt8iGf1pw6zGkFppD5BAYx/p7C3zF8AqAdmbr1FLpQqUW4RGLHFw8GezVv7w==2YyrJ31I7pJ1JXjj/GFcLPtvZX/Ao9t6JJhrbhOFKpBJTe8rzl5KfU9DX6G1P02uihbEUhAzA076wPhOxhsFoQ==g/AntfnQkmDO5rik2SUJjR1Ql5dRYIqdnbv8yBcfzcWRxFNEI7NeFj8ufmJp3qxkIB40xpqbgj6bsVMPuGQODw==/RQBCQS3wI8LmUW71WbWp4rLQ9gOclqvORoVd1rhjF5ybsh9TcCHRk0nTwiV8r/vd4k4RMe4Vw0\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\": {\n      \"exports\": [\"s_OzSZb6UyaCs\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\"\n      ],\n      \"name\": \"index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\n        \"build/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\",\n        \"build/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\",\n        \"build/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\",\n        \"build/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\"\n      ],\n      \"fileName\": \"build/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/qwik-city.js\": [\"u\", \"c\", \"a\", \"C\", \"D\", \"b\", \"d\", \"e\", \"f\", \"g\", \"h\"],\n        \"build/core.js\": [\"h\", \"d\", \"i\", \"j\", \"k\", \"l\", \"m\", \"q\", \"_\", \"n\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/preload-helper.js\",\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\": {\n          \"code\": \"<removed 3411 bytes>\",\n          \"originalLength\": 4242,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_OzSZb6UyaCs\"],\n          \"renderedLength\": 3411\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { u as useQwikCityEnv, c as createDocumentHead, a as ContentContext, C as ContentInternalContext, D as DocumentHeadContext, b as RouteLocationContext, d as RouteNavigateContext, e as RouteStateContext, f as RouteActionContext, g as RouteInternalContext, h as RoutePreventNavigateContext } from \\\"./qwik-city.js\\\";\\nimport { h as useStylesQrl, d as useServerData, i as useStore, j as _weakSerialize, k as useSignal, l as useContextProvider, m as useTaskQrl, q as qrl, _ as _jsxC, n as Slot } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\\\");\\nconst s_OzSZb6UyaCs = (props) => {\\n  useStylesQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\\\"), true ? [] : void 0), \\\"s_OC53PuG02nc\\\"));\\n  const env = useQwikCityEnv();\\n  if (!(env == null ? void 0 : env.params)) throw new Error(`Missing Qwik City Env Data for help visit https://github.com/QwikDev/qwik/issues/6237`);\\n  const urlEnv = useServerData(\\\"url\\\");\\n  if (!urlEnv) throw new Error(`Missing Qwik URL Env Data`);\\n  const url = new URL(urlEnv);\\n  const routeLocation = useStore({\\n    url,\\n    params: env.params,\\n    isNavigating: false,\\n    prevUrl: void 0\\n  }, {\\n    deep: false\\n  });\\n  const navResolver = {};\\n  const loaderState = _weakSerialize(useStore(env.response.loaders, {\\n    deep: false\\n  }));\\n  const routeInternal = useSignal({\\n    type: \\\"initial\\\",\\n    dest: url,\\n    forceReload: false,\\n    replaceState: false,\\n    scroll: true\\n  });\\n  const documentHead = useStore(createDocumentHead);\\n  const content = useStore({\\n    headings: void 0,\\n    menu: void 0\\n  });\\n  const contentInternal = useSignal();\\n  const currentActionId = env.response.action;\\n  const currentAction = currentActionId ? env.response.loaders[currentActionId] : void 0;\\n  const actionState = useSignal(currentAction ? {\\n    id: currentActionId,\\n    data: env.response.formData,\\n    output: {\\n      result: currentAction,\\n      status: env.response.status\\n    }\\n  } : void 0);\\n  const registerPreventNav = /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\\\"), true ? [] : void 0), \\\"s_zQJLLuPn6rA\\\");\\n  const goto = /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\\\"), true ? [] : void 0), \\\"s_IDVXhQLfmNQ\\\", [\\n    actionState,\\n    navResolver,\\n    routeInternal,\\n    routeLocation\\n  ]);\\n  useContextProvider(ContentContext, content);\\n  useContextProvider(ContentInternalContext, contentInternal);\\n  useContextProvider(DocumentHeadContext, documentHead);\\n  useContextProvider(RouteLocationContext, routeLocation);\\n  useContextProvider(RouteNavigateContext, goto);\\n  useContextProvider(RouteStateContext, loaderState);\\n  useContextProvider(RouteActionContext, actionState);\\n  useContextProvider(RouteInternalContext, routeInternal);\\n  useContextProvider(RoutePreventNavigateContext, registerPreventNav);\\n  useTaskQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\\\"), true ? [] : void 0), \\\"s_n397ZlNS8UY\\\", [\\n    actionState,\\n    content,\\n    contentInternal,\\n    documentHead,\\n    env,\\n    goto,\\n    loaderState,\\n    navResolver,\\n    props,\\n    routeInternal,\\n    routeLocation\\n  ]));\\n  return /* @__PURE__ */ _jsxC(Slot, null, 3, \\\"uY_3\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  s_OzSZb6UyaCs\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_QwikCityProvider_component_OzSZb6UyaCs.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\": {\n      \"exports\": [\"s_OC53PuG02nc\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\"\n      ],\n      \"name\": \"index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\": {\n          \"code\": \"<removed 9822 bytes>\",\n          \"originalLength\": 65,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_OC53PuG02nc\"],\n          \"renderedLength\": 9822\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\\\");\\nconst s_OC53PuG02nc = `:root{view-transition-name:none}`;\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"2MBGrmDRf08exH06a02qXuAr5BJMerNtMtuIjUgfY2iCkmjOU5yFS3W0UZXQALYSWFswybKasbR/dEiO5MgT6Q==lTvI3SBsp5qpsOGTAqaJms+ek95SvmIjouTSUgGFEGQAZ9TJRxzZ10UCX5jR57QVMb2Jx3dk0IpUt0my5R2zSA==MrEjke+OsiMTbyTclw0KsEgYMAs/kAjmb47wgpVXLrspmoMJGXAX4Lcl9LBab+ExLuUWk2Q0JX0HmjadbQtScQ==r2tV3cTLb2Ro0hPZbeqGdq6z2GzlmzSJJWQk3J8kyG+VLSh14IVQx2lfNb7sBkrMyX+qGdnqUPqTsfNv40HFNA==adfV5b8nKGOp4FkIV04zE7B8jTQG///xzc5C1EtQ/611Sb8tZI+rwr1HFTqQWgU455MtCCWREtQsv6RFDtWepQ==wKw3iPbq/+dnIabbWDXlXqlOq07CRTfMfo+b5ekeuSNlr5E8L61ec13oiW58dh9/MuCd5UA3sw2u4zSpcXeWeA==Gp+BweuLlI+mi94CZ0574wLTEYYaTFgQTXsxw+eKi8nOuPErsKU1RSU179MdVIjsJUxVrg/wxt/yojboHCzPgg==oe44xiJMtoEV6XAlK6XlJLfCloyrAWavpKw40C2bP63OPIKgZIgWS9CoZ+Fxv8BlSWPLS0+lSNx7URqwipXF2g==6kWzBgfi4xEA8YI5JOr/fKLrQL1Xz/hgmPZm013MjCbcvytAvxF0ZJKJFC5JApTN5eMVuk6kYI3RkcUvwnAYWw==Mb83XuqhXZMX2651e1lU4BMlPwXlbJ8/0NUMRmb/WSZCpYstOeFpqDK5S3iAn6h/eFGLEK9M8NzDXj+DjC3IGw==7juoadil7wKatOx/QiaSraxWepX8FgS5YapQ3tLQwvGcFpDbpIrnP4JJsj6pEwjBXXDXtQirgxQDOghRfIgbhQ==PFBtSskz4xsl09+z6tb1HaJYQG/w5aKVXxKsEa6+RqFECTXiv1FyPFGD24J8zVg57OaTUZr7ZZGYpj0JwUAbnA==OlHrALlE4mAAL8sXcT1WtDrF85q1VsgKAKd/E1OuaLThKOnMU5UW5fYmWBQDs+okk2JMXu9u17XXBRVp1NPiRA==UjEtYDF1pXKlMXaPY6TIqBbe14Jz2DCj2BH6elKr72TV9L9+HXvEmtDmly9KSxJEX7IKlPEaGiJl8YqJDHmq3A==GdpACfYpht6nQaHWe3Cmxo/rLfa7u7DqfCeU63uj4U6hUyTumIwEa0pcAkNenCFx7v44/gB94BFl9ZaJvPnfdw==kmAS5vKLeOdltm6iqb97kUuQFBkoMARis3xVUfrvJ3G9WlU5pGyAxZHP+R696BBJKfotwKjpUzS19NTYnKEprg==vOiPa1VwSuGk0nSOA7TKPpqHaokpXTJbkvXGJk/7e0hd1kcqX7iFP1Mj5lON+FbgSNJ46o8L+hQtozTb1xIOpQ==PCEcqgD/amUpZ207+qIlz8n7OSA/d94j+xIj5vJxCLvF4oE6WzA0afDP520ep1T96T18ml3fqdKGpX0pwnP1yg==YCrACZW8G0jco1eNyMjh9Ir7PqNus298NclrtA1uFQ627GOgmy46W5e3K2cTJf8UNAkQ9ufet8JryXBFIthdjw==xZXjtFtJHF2FISnuCG7t48H4D30unA6HxTpJMDoeQBMv6HlB8daMZF/rNFBzE4EkM4eB6oHbn0CjAp+nfsrIww==hKM5u1KOm19Vt9Tq0NKNN8AZ8D7ZA1BkfmSJl3latvnZ2cSHGva5lJLPt4Ze2EuAYVRBnB5LH6iae88pL/1lUg==tSLLXXSKeutMXS2bTzeUzyRja/mlI0ZZc9EQZ3GBHGg/HFZq4KCD6Lv0CxtfWHdv1LJp180KaaQBltayC3LbGA==QrNqRNZcXCBb/P6vy8R7QsHHqK7k7A3Bs/139zBJt44mgbkH9jCzi622rkjZCSHmPUDjkTW3nlCLZerhbTTg5w==n4GjdKaFO04bPfStjmO6quQxHjBbSN8iImb+q8duwOWRFkUJsUuw9oABSAft39ozb6hghdyJSCT6S1tr7W2sBQ==IQJcERc8sh82YVbljMORX9ypYt1VTt+ZcbG2Cqs58KlMhtxhbApkZp+yr9Et7a2NwYtcAx0BcTA8U85RZr41vg==eEnBU1CuwnWu9ngkhv4Bl6buDfVbeZa3WZZaQUXzIANPwX2YY6upfdTgzaNN/8/coE/Efm3/MnzKwVY/wOzMuw==v/k2Eg8oVVvukBZadNTAiBzYeD3G50vPEP2AYo4tvskYtnrNisMn4IU1HjLHdx6/xv+b3se/tELThrZwvxeQsw==fa3t2Tp265ERoNRFlNrtwyKXLokqZPHuLDSJOpdhpgnDfFMPsEsm0xES0xrch8d/pyzsPmQo2zFfBaCrWbuB6A==gCm0YFF56HayiOj6Um6Y12GJSgohTXZkv2Im4VNt2J9T6OwCJhpcDiKTTFpI5AoBAPdQ89o1kfuwYHTIkSkGrA==zrfvYmkcT4b5w3mmpokjSWgPL/OgMqldRWc/PzNzfJlfEXd381qITdDWjTflpwi2rQUJ4DIBDttZQdKTeI1U1A==5Mn+8z5lrRN49QhC4ffrz0tGzZOZPtInaSDBYc+DiQesKWK6X3h4tc6URXiAvjpa/ZwlOlaahCB18NfeAwMlwg==xGvRKxQMikBcclbHuoYNhgoXJlsqDy+ryNB4zCMqwTeBXqzv2lP27QeFFg+RO/vqP6XLA+kIOxwRNdFLPaPuuQ==nN4jXHNBurzoTXPmFYb9g39b9voJybTEa+eUzvSGM+jyNpAmjUUABmcfrlzBzLpP4+MX0aKBY3MeO5zGI+/t1A==LAzAraKdA8gnjFh2lbuGuYh+d5VLiDcDE1WWSmVe/zEv1txbdV3/c5Xy/6px2r74pHC8R2G95qhGHcFxOcGSFQ==0lPqAoNrVvS1agHLhDGCjFRC/B0T6g5nnrV+rhNECeTvYSRpZ5bMKWr5xYno0mejj7c0U9eZwvdejMg9F//tvg==1slcSd8Kk+WKBWHJ3QR7wpyLNg9hcU7OcsXEduz9D32U92VUb00ZIVbIujakQTIUoTdGTRxCoS9OE/ufPeJ9cg==nO63rGj12uQtzHJgn9n3UAxQDVcE3wRn6UX2yUFV4G/aiXuSst+18zCKj2a8cWGt0r3QpTvniUeVqyHDzbB/Fg==22A/c4ukBOpMQgU23dZhUR/u9OzjyDALLId+3h+rXcH2wxdUnUjIWGcfWN+zZCOJjm9D/ukfzHNalbNj8166xg==ITaph3wLMBNKm4spZP+JdQ5wyI/ESaF94InmsSHBLoNQfkNxmWOptHAckpWvpvoADwJo0Nn0MFnFT9u2OcD3oA==dNxQwkf0+fsA7SEP7SycaQ03QQWHm7z2CmjFUGKd3hnfdWLmGhd1VV7pjFSK7XoFXgDDab2YOZJllGAKKKwOXA==J7pBcmY84JYRtuuQKKRfC5+yz2inpYaf5UKfidtgJ5QYV56NaFJlC2RIG4tr6zsfAEETruqpZCsNAw9sYtoHuw==g+L3/njJNAjSJt1qCg3jvlNc1PtfzP68p2UblGRDNzRjnVoHEPocSYSmETJvFymZSX9u3LnaCVXU7f6SWBFnww==hw7P3qMtRR82OOHcm7o/PlNTPpHrg6gdTscXEnDj5reB2auJ85Qx1RtasjodtgB0Z3S5TcffTCJIZWPIUiiu+g==b7XqOBEfDbr2VOA416MzC649bXbArHjVsngANIFTSOvmiQH6FNFNEuaUsFhG/uRm+ZRGbRBgmav2BIDPjM74IQ==FUUwtXWU1fz9eK9LqSKz/bk9qcVTN99C6zEDQqH23Pzof9nul/q99BAwoVQ5TUtTa3dZH6n0GfCjrsRiqZzqYA==hGuH44yzpj7CNGm3fiA/JV3I2bP/clD8X5og3d5Zw1jpq7c30PExC9ebWRFHR1xwb/HZjVKsf5UqVIz+1DG5vw==lK/jjHeSiSdHM8e34lUX5l4cVB0OpohXilSoV19c64cUC6OYjmuB/e0ITlZ0Xqeux/Ecpd/ZUz569RhD4nSdCQ==XFEIPhcSX9hroC07ZMIv5bpDmtBaN68sz7mx9PhaM4hS9vHK3zWJD+U4Ej2LCCgTrHCYUhin2cCPkikHiSe9Hg==Js/q8ISd6I1ytUKQqjmNUgkBxdklr3FAekeOZih1i1gXASciKdyZ0L7KZpDaoJPFDDj1i7mtxfLk6W/SQwY9sA==RPfr13PeSuhfIN3yEMeqNAZDz+avyTQzacfwkE1lX3Z1PaR0TUU600BJEKxjvYcR5avvQOAX66BVi1F8HaIOEw==11WXLbVfqUPe6BCynbVHeqSUQW5bBBZn1xhCXZGNtJnIgMT/dzhQEXKYbk6aoi5A98SOKjGDjx5+SDuGsYELCA==ciQkkfk7Ixp7dndX6RwsWlEiVXhaEgw5TqEu2DKD9Wvw3pKkXe\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_QwikCityProvider_component_useStyles_OC53PuG02nc.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\": {\n      \"exports\": [\"_hW\", \"s_zQJLLuPn6rA\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\"\n      ],\n      \"name\": \"index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/qwik-city.js\": [\"B\", \"E\"],\n        \"build/core.js\": [\"b\"],\n        \"build/preload-helper.js\": [],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/preload-helper.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\": {\n          \"code\": \"<removed 38290 bytes>\",\n          \"originalLength\": 1070,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_zQJLLuPn6rA\"],\n          \"renderedLength\": 38290\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { B as preventNav, E as internalState } from \\\"./qwik-city.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\\\");\\nconst s_zQJLLuPn6rA = (fn$) => {\\n  preventNav.$handler$ || (preventNav.$handler$ = (event) => {\\n    internalState.navCount++;\\n    if (!preventNav.$cbs$) return;\\n    const prevents = [\\n      ...preventNav.$cbs$.values()\\n    ].map((cb) => cb.resolved ? cb.resolved() : cb());\\n    if (prevents.some(Boolean)) {\\n      event.preventDefault();\\n      event.returnValue = true;\\n    }\\n  });\\n  (preventNav.$cbs$ || (preventNav.$cbs$ = /* @__PURE__ */ new Set())).add(fn$);\\n  fn$.resolve();\\n  window.addEventListener(\\\"beforeunload\\\", preventNav.$handler$);\\n  return () => {\\n    if (preventNav.$cbs$) {\\n      preventNav.$cbs$.delete(fn$);\\n      if (!preventNav.$cbs$.size) {\\n        preventNav.$cbs$ = void 0;\\n        window.removeEventListener(\\\"beforeunload\\\", preventNav.$handler$);\\n      }\\n    }\\n  };\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"j0Z+enwBjRets81TH8jlFftorzh9rbyGi5w7GpDNv9UqG2GNGh6r8zdvzD5DqD/4gJlHB9zc2HELHQTnywJsDQ==Id6AC6Xq4OK07bZRXfcp/k08umfW0ziC9wSXleru4SXcsVfVdoL/COPqlApjl5nZaMa7SSIxTeyTpr7e4ZnjHQ==4DXxH+wic+w9DhtK6rmskbebVmYiianA5X/fQ0duxlmqT2ECGi6842xwR9fpbedpC0/m1AplWhR1PXxWIfTkFw==VQHkojWigSbFnZu49BjOAMKXx5Wqp/x4wWjVyGyRE4u7agJfdbLXQFmRZUq86P7/+XcjTuBTY4h1ngyzOw2AuA==engvn4tkK590XI9gxxuxKY15mNPBE8yGnS4D04z+VQUWMPdljMGgsK0OnnhIB8CHCb1CKTVA/DbHRw2z1bSqMQ==8Vx21anIRErZn2cZGQIJEh3v0cPrzwt+V9UnJEBDz1p+uYeC81Hgz+uZXNmzRzheGjkNkI58h+zHiPwi/ldvpg==PhDZXXNbQSU174zsyYTfQzBvaXNV84QDQuEXg5gIwaGzE/8tv8Zpv6GjLLrrDNaDgTqZyE6WCTA/xiFC1+TvpQ==d8W1+h2/fg3TgeynwBARq8pfF/1rU1/EOahLmBtGBhlfReibB7xcSpSWcYX8o0l669uTX7d473J54zQMg1i3Fw==FfehYlAxHNKg4cIOpJQhHTlhEt4VTt6Z+PSSeN42UXg+Jp9eQxj6rlqAPWzN4ux2fHh3muKA/uCxkQD60U69Mw==jbuiFEPac8YGUM8g38gi8tCok7szKMIjn6pzsOYnb0uQmITrmiDRLBGeNrxJQuFYPNnqJJ4K8nL7JJcgcSgcRQ==mzWMPCbwIw1oNnCHgrzRKhii4SZ6ursE0UE8832dOEmkU91sZBqtgSK3xTgJK6AXXyPGFLQX4Nnx0qrrkTyFDQ==vGjXFoGpum5tdwy+BecWKr+/TMjKNwSSNdUL3rFlmvfYp53H0QKj9lilU6ROVWjpXbI66WbTFzcC/Sq5cnZ2OQ==VopCSvuP/BkYMvduxgx3Ad4mZBHEml45nfRRZXb3jkQD56RlK/o7qQEmLBzIOB8p9e+U0eDvUmINmSPpQNLo7w==wTGvIU8PRoDEGXWX2mvz8cqdcwVhZ7oBBlyJJftx5VGMk9HLTjBNpnOSHw9TcSu4anWSXYOX4RJ5ZVhV15DmSQ==3afJWQqikpxvs9sZ85UQfxiunzdDPbe4aM4Kikur55kOIgBpV+3hxkJZdjRkFcx3ygH7fmHAN9fWIzlK25ZoDQ==8z+rwjZrQRBf13nbzF0J4lvSICl4YtxSEoTMxgSpaQKA+nHNUGsWs7dv0pwYp3fBCIUYB6sZvFusgpPtm3KalQ==R+b0+qD+z8k9ihu2Pd62TAr4LcLOO72MYS0UMU/wMn+2Lm5iwmp7CVb999q79xkN0yEIgQJAVY7RlgVbecbbZg==v5MhPX7FAyzoPsj6ADuRZrxHmiODW7tAsrzL8TlSd3EVHsajO18RkI5i0LaVr/WaJQ4TSz8lss0YQEj2crb71Q==nxMPUg/vABuO8+2s5p6r2ja8luKnmOv6U5qIbePfWfHJGq50291J10liIZ+7dWprHCZuQcOHKFGkcb0OnGJYPg==7nl3u9kuUvKQLO5oIlvY+1elkVMzOToctGqMMdHWWNWPkm9zN/Vo+qJycEqUOrnjVmit6Qo979IVW2VULPtVxQ==0TZIio1OIvawEju7xm+nxpwjuHpAyW/2GtkEVE62lMM0QKeOFnRyrNBDhcUFJxGwnkeCOJHWc6hTFuiOPqH2cw==RSeWOdBJp3fxwJ3SpPlMuy9KqPWBtCTCXCRRG8Acutb1mXbTd2X9kyI7CyCVtsod+SLtMx9iJr2ChXkdt40mSg==7QbzETbldlD4Dhm2s5IaZjABafr4XkhBAVHFm70lV+/4mINU60BKsDI3Yn7WV1N/uL2BuYCymaCn4RdrrGTMFQ==Rh8MdhVzQzwPP5jl6QI6lYUvfooX5uusQPdADxbb/VmMbRLxDfttfm6zbfQv7EVwirC02LWqREJ6bx28FGy8vg==UsyZZQQ+zIO1dqOYnaGu4HAco7G7OONbBpqlhqSs4wXdqdMPrwdWNf+KIW0Mh6wPiepEBKP/fFECGIgaVhkJaA==4Br05rMizL4ja6C9cjGZd34Vr1ikwgkT/IeoDJAp7i2465wDTpN1bPej7AhZnTctbwxUWjyO350XRWsvmauung==ip90MgPtnOK4h6ThOxpVXTD67fcg5nXw7cZq92XpIhgRkIZV/vaRI9iPAFm78z23+XJ3KBSzc5Rd5qxG+OUm+w==9RtfDiwpE3XAv7syfWGz+nl5jJntvppqV4tnGclvpeMQlTG4FtjRpi/UmcN3kwSPh3H8NDG8E6OI4BwIWVnuvw==ORhR+ID1yWl9IaV9PqZQcelD6KVUsjv1QtJatVCjgfGeITL4ziDX2LmB8L+t9teNUdRMkM4MihdGTPz/9l9m7A==z7OM02FMcnxm390ou52AzlM3pifFJa14IbOsygCcp9haymMNW24OW4v3fgKOcGwUNL6UFEZ5NQcMWOfwQTB+Ew==RZQwTu4kcFH/bqsPWvZ98aNHFh39H0YUzqMvEF8AxDOL7LJYB6DMmypweSq/OKwhvkhV6VTphPUiUYcg7U0LRw==bne4QlpsXiMSdGojIfqk10tRW6w1ygES5kik/orzwf3pwGG2aCTLlqGOPs1Lxx8+G3Dxw4bgRX8rxC92xERj7w==TFQC5slj9wAhitEdofurbzZgJQKmRMibYPM94OsVpuP9KAoN6xidRcBOJIqWWj1rUJ7a6G1O2YdpgE+HaCu5OQ==to2toreB4hwl4tldN4uA034B84CA1s7sTrDwrKINlpiIPzn8uRXa7pF52eJ2WGa+kCiIYA09MNWFKroPtDJUXA==ePKZLIJj+R0Aj/MxvqZKQxHJ2H54dtteSH6ErZg99nHUHFFIGU+zUUgv7Iz1bsRRMK5Cj/Psttq+v0cZ+VBAcw==tCgtjq5DjuKppi4gVcPzYB/YAkC9lFd1L7aEWUgpMABX7aQHFyuE1kVHxxPkamsIffGOPqWhCG72qPt9SRea0Q==eDdo1jQafVO7+VpjlgWWik64479tip9N8Hr6Dvg4CwqrsXu+Ep9lskND16wF2sb/jh9X4VhlsoVSjCherFEYFA==4M1HhiMmPf/gr5NJz9Hzw2yGkl8FAPNOjRTgFvf69ngv/EZZ5SIPTPThvQOkgZkAPCps3lhL18fcc3PFUXrPZQ==qXPkWcvWdkdaXRtcEme6YghKbbsd2dG4+387t1oKRCxSsbQRxsfBAq5L5Hretq6PHtmxrpFedwQumaHxA16tjQ==Nw8GokRWouNqlXj7LZI/TIODECF1rXSSbGjUrVd98QdyJvBkjybZmU13S6eQoU+F0J9m5jgKWW8uevYDXP3gDg==ASm0U9dAziW5D2/hqPs1Bz8pgSH/tEkfKDbxBhdT3d14dTH3hu1GN7q+f8SDdfRyz4FUo9XHF8e7488KBTYKqw==FviUQl5gYnL9EORAnFwPK\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_QwikCityProvider_component_registerPreventNav_zQJLLuPn6rA.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\": {\n      \"exports\": [\"_hW\", \"s_IDVXhQLfmNQ\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\"\n      ],\n      \"name\": \"index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"p\", \"b\"],\n        \"build/qwik-city.js\": [\"G\", \"B\", \"j\", \"p\", \"E\", \"m\", \"n\", \"k\", \"i\", \"l\"],\n        \"build/@qwik-city-plan.js\": [\"c\", \"m\", \"r\"],\n        \"build/preloader.js\": [],\n        \"build/preload-helper.js\": []\n      },\n      \"imports\": [\n        \"build/core.js\",\n        \"build/qwik-city.js\",\n        \"build/@qwik-city-plan.js\",\n        \"build/preloader.js\",\n        \"build/preload-helper.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\": {\n          \"code\": \"<removed 11786 bytes>\",\n          \"originalLength\": 2947,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_IDVXhQLfmNQ\"],\n          \"renderedLength\": 11786\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope, p as _getContextElement } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport { G as toUrl, B as preventNav, j as isSamePath, p as isSameOrigin, E as internalState, m as QWIK_CITY_SCROLLER, n as restoreScroll, k as getScrollHistory, i as loadClientData, l as loadRoute } from \\\"./qwik-city.js\\\";\\nimport { c as cacheModules, m as menus, r as routes } from \\\"./@qwik-city-plan.js\\\";\\nimport \\\"./preloader.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\\\");\\nconst s_IDVXhQLfmNQ = async (path, opt) => {\\n  const [actionState, navResolver, routeInternal, routeLocation] = useLexicalScope();\\n  const { type = \\\"link\\\", forceReload = path === void 0, replaceState = false, scroll = true } = typeof opt === \\\"object\\\" ? opt : {\\n    forceReload: opt\\n  };\\n  internalState.navCount++;\\n  const lastDest = routeInternal.value.dest;\\n  const dest = path === void 0 ? lastDest : typeof path === \\\"number\\\" ? path : toUrl(path, routeLocation.url);\\n  if (preventNav.$cbs$ && (forceReload || typeof dest === \\\"number\\\" || !isSamePath(dest, lastDest) || !isSameOrigin(dest, lastDest))) {\\n    const ourNavId = internalState.navCount;\\n    const prevents = await Promise.all([\\n      ...preventNav.$cbs$.values()\\n    ].map((cb) => cb(dest)));\\n    if (ourNavId !== internalState.navCount || prevents.some(Boolean)) {\\n      if (ourNavId === internalState.navCount && type === \\\"popstate\\\") history.pushState(null, \\\"\\\", lastDest);\\n      return;\\n    }\\n  }\\n  if (typeof dest === \\\"number\\\") {\\n    history.go(dest);\\n    return;\\n  }\\n  if (!isSameOrigin(dest, lastDest)) {\\n    location.href = dest.href;\\n    return;\\n  }\\n  if (!forceReload && isSamePath(dest, lastDest)) {\\n    {\\n      if (type === \\\"link\\\" && dest.href !== location.href) history.pushState(null, \\\"\\\", dest);\\n      const scroller = document.getElementById(QWIK_CITY_SCROLLER) ?? document.documentElement;\\n      restoreScroll(type, dest, new URL(location.href), scroller, getScrollHistory());\\n      if (type === \\\"popstate\\\") window._qCityScrollEnabled = true;\\n    }\\n    return;\\n  }\\n  routeInternal.value = {\\n    type,\\n    dest,\\n    forceReload,\\n    replaceState,\\n    scroll\\n  };\\n  loadClientData(dest, _getContextElement());\\n  loadRoute(routes, menus, cacheModules, dest.pathname);\\n  actionState.value = void 0;\\n  routeLocation.isNavigating = true;\\n  return new Promise((resolve) => {\\n    navResolver.r = resolve;\\n  });\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"bHxC7hLiJvrhOzOq7m0DNnJLTHf37hO+hFsb+kfliTdLQ1JufvCCqjuSV231DVLJpF3dQoOECZ8cxRGNqLwhnQ==VpdInLoX0o9qLPhVz1rUp1W4GK4nMdHo1kJotuQDdbtgTR5kd+gWEzLIv2IAuJi0fiXhfKh6c3EuB3MBj6UdfA==qnwLQckDIzsODkfufHShkSPa5f1NLghGDPcvdIQ/0sfla+PVBslaf0e/Weggw47QOerqsYEMNWlt4i6OVTlW/A==AokN4lJjrfmywO+hS78YnKHKwAqFpxj7l9utiQDfpeuho3YWao5gR22GNZWvPG/UxANAF+9ZRTeXw42rsthyVA==lmVSqa8gVNSqQa8iqMHDD6d51Xgyp1WL/XhTVo82KKYeeeeofAiWPKWEs4Jpdsk7Sn/l3BZCV5EEGaL6lb4E9w==Rh+MyoUWMwP8h5WvJfHaCFYzgdR/e4kya5ACojUf7naf55Gu2IkwJoMerp/3+w5EMXdXL+K/Qtnoc8ghESOzoQ==pHkiZMNVEIDxtlcVIGwFpH5xmB5CnoZkuDH+nwTOLuQL74+SJDQR435zmVl4xhSfAkaldTSWu/MqYs9IVfvwVw==MBAbRLgzL/r/0qoTx+cPg6S2w93Lb29NHZRygiM1ZN7mpNl6mWbsQSnDTVCs+EljgQSxZDYSLh+QbdEg0aBdEw==3BSnzalBDRDxX2M8y+2HcI4qp+aqHkh0djcK7Uf5pP7pmcRFrLcV1hIJrrt29yRrWLTgOa4jIBvvpfoC4ZlrUQ==2tSf8JpC6sciCEXmsydCOJFCG2qcbDbYn5P25os6pbuMxvk9B+C6s43MtDmhmtdb0v8NySUXObF58FSQyJJUBg==bwbR/EdYPRDb7kP+byAGd681yK1rRu3pXi/VOcnKhkQYffMg9FSxL0xS98052J/RseFSsYe2SZ2QrVLx1h7D2g==tZZhKs0oIrT4I8I0NCN0PnMpddEENgW3XOB54338bZNTavTyxdP9+dGWkLT0DN1r4SVIWauyIyPu0Ef4sVGySA==wPQpF2Grr9seFYDV6/L21CQlNjE1HV1hUVd/29+JdEKxqznMAifG38erJAGfG1x2g+qyqlHVPkn18vwHapvesw==d/1WntXEKPuCCTAFVg3yvrA/T2nmmR8IliEOCa0cC3+04DAYgl6ernre7Em2r4QdYNQcs/XXy5yYnQcuCu2vmw==Ek9fTbCVTe1xqwDdXsWmxaek3U/2H4g/frzJqJDzAFUFr2ySK2ac5NAdunnCLr52c+6cCSwuZxFjox9/GkHtSQ==NNVW6sOKzz8HuoD4jy+hhH3ldc3rzIdIcY83BnKhDryBB06DujXKMxGfqsZJ6Dqvq/NGhprJcZG+E6NM47GTPg==s8gwK/kmsBEbHSKBZANKG20hBRpmQUUm5nHNydXpF8jnG6xN1IIvf+O9bzD0HqvyyQIQZdjbbr+MkV05UDa85A==ZxnUwSC3z1egK7h8t27bOawr3RpeWdcd1W8KZVbruMYJFBa7/1WGNmlpMA/8LWN1ePlbBRU+v8GlSmIDJo6lVg==A1GfOwjvDwAfu72SYU1XebOsPoakHNhUx493OLjeceZUWdujaJF5vriUdsfBmCL+h3x6VJHkIDMwOusohNw0HA==b27hfIXsqjF1c9kLGR/L9AsfQ2owRRPQEGq6LfY08DfOJxA9WrWg1oP3keenmgUezP7t0pXtII6YRS9lYroa9Q==gkS26YbOCylFk7C7rLfXIKOQ6dKU7W+oEXbUbKg/X6p7H5UlkdoGiiMqATc9fjIORlCpV9UGzDtUfh3MoLTypg==t5HzniYFx2Rnb82DMG3d2OgEute5Zx7bR/o/9tucYXuJBufJQ2uAv3UQ53k6he9r0blSYWv8M0K2OizH91OWaw==IBBqJYZnZF8vRVhweb/RZn4AqaoOM/w/IYNFIYbF98O2GXUlkql0fcxPkNYDchGOZGFAT6j2AUd+CBOzTNWzIw==xku7tmG7jIw0h6uUyJTRWQpKf1mQ+7Jf/8wJJAvMMBGzASQ8CKT6v25ZlfgIpkMphbKU9Ew7VGBM/IPk0BSYHg==r32dkX86guYZWuDstqowNw5l2E6Dk0zMvzuiySWSBCEQsPEMrOke84cQODIzYBUPSNYnV6M02WxsFGeYlAJ+ig==sfG6DJSoHPgnRY/G8Z6JuSOW1cHmONS+i6akW2ZAvTFzYSvQhP3p0K6O\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_QwikCityProvider_component_goto_IDVXhQLfmNQ.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\": {\n      \"exports\": [\"_hW\", \"s_n397ZlNS8UY\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\"\n      ],\n      \"name\": \"index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"o\", \"p\", \"r\", \"s\", \"b\"],\n        \"build/qwik-city.js\": [\n          \"l\",\n          \"i\",\n          \"j\",\n          \"r\",\n          \"k\",\n          \"m\",\n          \"n\",\n          \"o\",\n          \"p\",\n          \"q\",\n          \"t\",\n          \"s\",\n          \"v\",\n          \"w\"\n        ],\n        \"build/@qwik-city-plan.js\": [\"c\", \"m\", \"r\"],\n        \"build/preloader.js\": [],\n        \"build/preload-helper.js\": []\n      },\n      \"imports\": [\n        \"build/core.js\",\n        \"build/qwik-city.js\",\n        \"build/@qwik-city-plan.js\",\n        \"build/preloader.js\",\n        \"build/preload-helper.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\": {\n          \"code\": \"<removed 10162 bytes>\",\n          \"originalLength\": 11284,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_n397ZlNS8UY\"],\n          \"renderedLength\": 10162\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope, o as getLocale, p as _getContextElement, r as noSerialize, s as _waitUntilRendered } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport { l as loadRoute, i as loadClientData, j as isSamePath, r as resolveHead, k as getScrollHistory, m as QWIK_CITY_SCROLLER, n as restoreScroll, o as CLIENT_DATA_CACHE, p as isSameOrigin, q as saveScrollHistory, t as currentScrollState, s as spaInit, v as clientNavigate, w as getContainer } from \\\"./qwik-city.js\\\";\\nimport { c as cacheModules, m as menus, r as routes } from \\\"./@qwik-city-plan.js\\\";\\nimport \\\"./preloader.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\\\");\\nconst s_n397ZlNS8UY = ({ track }) => {\\n  const [actionState, content, contentInternal, documentHead, env, goto, loaderState, navResolver, props, routeInternal, routeLocation] = useLexicalScope();\\n  async function run() {\\n    var _a2;\\n    const [navigation, action] = track(() => [\\n      routeInternal.value,\\n      actionState.value\\n    ]);\\n    const locale = getLocale(\\\"\\\");\\n    const prevUrl = routeLocation.url;\\n    const navType = action ? \\\"form\\\" : navigation.type;\\n    const replaceState = navigation.replaceState;\\n    let trackUrl;\\n    let clientPageData;\\n    let loadedRoute = null;\\n    let elm;\\n    {\\n      trackUrl = new URL(navigation.dest, location);\\n      if (trackUrl.pathname.endsWith(\\\"/\\\")) ;\\n      else trackUrl.pathname += \\\"/\\\";\\n      let loadRoutePromise = loadRoute(routes, menus, cacheModules, trackUrl.pathname);\\n      elm = _getContextElement();\\n      const pageData = clientPageData = await loadClientData(trackUrl, elm, {\\n        action,\\n        clearCache: true\\n      });\\n      if (!pageData) {\\n        routeInternal.untrackedValue = {\\n          type: navType,\\n          dest: trackUrl\\n        };\\n        return;\\n      }\\n      const newHref = pageData.href;\\n      const newURL = new URL(newHref, trackUrl);\\n      if (!isSamePath(newURL, trackUrl)) {\\n        trackUrl = newURL;\\n        loadRoutePromise = loadRoute(routes, menus, cacheModules, trackUrl.pathname);\\n      }\\n      try {\\n        loadedRoute = await loadRoutePromise;\\n      } catch (e) {\\n        window.location.href = newHref;\\n        return;\\n      }\\n    }\\n    if (loadedRoute) {\\n      const [routeName, params, mods, menu] = loadedRoute;\\n      const contentModules = mods;\\n      const pageModule = contentModules[contentModules.length - 1];\\n      const isRedirect = navType === \\\"form\\\" && !isSamePath(trackUrl, prevUrl);\\n      if (navigation.dest.search && !isRedirect) trackUrl.search = navigation.dest.search;\\n      if (!isSamePath(trackUrl, prevUrl)) routeLocation.prevUrl = prevUrl;\\n      routeLocation.url = trackUrl;\\n      routeLocation.params = {\\n        ...params\\n      };\\n      routeInternal.untrackedValue = {\\n        type: navType,\\n        dest: trackUrl\\n      };\\n      const resolvedHead = resolveHead(clientPageData, routeLocation, contentModules, locale);\\n      content.headings = pageModule.headings;\\n      content.menu = menu;\\n      contentInternal.value = noSerialize(contentModules);\\n      documentHead.links = resolvedHead.links;\\n      documentHead.meta = resolvedHead.meta;\\n      documentHead.styles = resolvedHead.styles;\\n      documentHead.scripts = resolvedHead.scripts;\\n      documentHead.title = resolvedHead.title;\\n      documentHead.frontmatter = resolvedHead.frontmatter;\\n      {\\n        if (props.viewTransition !== false) document.__q_view_transition__ = true;\\n        let scrollState;\\n        if (navType === \\\"popstate\\\") scrollState = getScrollHistory();\\n        const scroller = document.getElementById(QWIK_CITY_SCROLLER) ?? document.documentElement;\\n        if (navigation.scroll && (!navigation.forceReload || !isSamePath(trackUrl, prevUrl)) && (navType === \\\"link\\\" || navType === \\\"popstate\\\") || isRedirect) document.__q_scroll_restore__ = () => restoreScroll(navType, trackUrl, prevUrl, scroller, scrollState);\\n        const loaders = clientPageData == null ? void 0 : clientPageData.loaders;\\n        const win = window;\\n        if (loaders) Object.assign(loaderState, loaders);\\n        CLIENT_DATA_CACHE.clear();\\n        if (!win._qCitySPA) {\\n          win._qCitySPA = true;\\n          history.scrollRestoration = \\\"manual\\\";\\n          win.addEventListener(\\\"popstate\\\", () => {\\n            win._qCityScrollEnabled = false;\\n            clearTimeout(win._qCityScrollDebounce);\\n            goto(location.href, {\\n              type: \\\"popstate\\\"\\n            });\\n          });\\n          win.removeEventListener(\\\"popstate\\\", win._qCityInitPopstate);\\n          win._qCityInitPopstate = void 0;\\n          if (!win._qCityHistoryPatch) {\\n            win._qCityHistoryPatch = true;\\n            const pushState = history.pushState;\\n            co\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_QwikCityProvider_component_useTask_n397ZlNS8UY.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/@qwik-city-plan.js\": {\n      \"exports\": [\"c\", \"m\", \"r\"],\n      \"facadeModuleId\": null,\n      \"isDynamicEntry\": false,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/@qwik-city-plan\"],\n      \"name\": \"@qwik-city-plan\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/layout.js\", \"build/index.js\", \"build/index2.js\", \"build/index3.js\"],\n      \"fileName\": \"build/@qwik-city-plan.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"]\n      },\n      \"imports\": [\"build/preload-helper.js\"],\n      \"modules\": {\n        \"/@qwik-city-plan\": {\n          \"code\": \"<removed 9122 bytes>\",\n          \"originalLength\": 891,\n          \"removedExports\": [],\n          \"renderedExports\": [\n            \"serverPlugins\",\n            \"routes\",\n            \"menus\",\n            \"trailingSlash\",\n            \"basePathname\",\n            \"cacheModules\",\n            \"default\"\n          ],\n          \"renderedLength\": 9122\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/@qwik-city-plan\\\");\\n;\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/@qwik-city-plan\\\");\\nconst serverPlugins = [];\\nconst Layout = () => __vitePreload(() => import(\\\"./layout.js\\\"), true ? [] : void 0);\\nconst routes = [\\n  [\\\"/\\\", [Layout, () => __vitePreload(() => import(\\\"./index.js\\\"), true ? [] : void 0)]],\\n  [\\\"about/\\\", [Layout, () => __vitePreload(() => import(\\\"./index2.js\\\"), true ? [] : void 0)]],\\n  [\\\"form/\\\", [Layout, () => __vitePreload(() => import(\\\"./index3.js\\\"), true ? [] : void 0)]]\\n];\\nconst menus = [];\\nconst trailingSlash = true;\\nconst basePathname = \\\"/\\\";\\nconst cacheModules = true;\\nconst _qwikCityPlan = { routes, serverPlugins, menus, trailingSlash, basePathname, cacheModules };\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"G/4ORRb61cfesL5zue430f+SWvoJAcAMuVH2QgJuPVErhWBSHhCFLrukE+Fjc422bXWaUWiJ4G2eYnVBHVAdlw==oqwEpJuUL/ISL2lxP18vvCUaJkywo0msYfcijRHXz0UBsP0XMeVVYHWLRIdg5s9JTmSqogtanKPAnHJBYqLYFw==U7Zidb6Vd9dNKQ4TpVBsEeo9N23RBLUT3nhYIzqhgiy0rtM+1medSSAtZ+6OYf6dTVo6PwsUw9V4ucoIbxoy1w==lwRpm2VRrfWT0WUVjcacCbi0sl6xAbdi27OTAgQilCAa/V+IlCQF0AWT0h6kLWLe9c2Ix1xjqxd+CR3EfKc76A==3mIZIHw/k/hsD9Bdky2qVPoQSsaseOiLZft6/dQfDtyHwDfmrpW6hbzwbeclLgy9cPYNkvkPimGUGQOtzOc+og==ff+7P2fGx3ADK2KKbUrgjWg4grMn0CfQEYku1BkpxfXD3haIc7BVDHN9BMGZtlOG9/Of/lPFw4Ld+jWZioU0dA==yMIYXcyl9h/7356F8Isu5taV2GhKGyqP0sgzWAzul/4mwan/mQ6kobqXZQ0n3TCCdNIl8y6RVpO2OSAMYKIehQ==OvvNjdcYUKWgh5T53QAnBupjF793ISyuVLQEw/5Nxzc+JccC+nyq3GMVX55h7k3MY2lFWeAn0wpWlG26DHOR0Q==Y3LCnqUey31cYVYA1TumobNalW25iiaMWnDIs7O2JbCrF7rbGuhIHX6UQU6vqWAWQUTZtXT2IyOFkRCcv1vc5A==NjlLYZmQLMTHhOaAHLzdZYsjkP0bgvwfEQ9nJAx2Te9oVEtRe+LFiQkkpSUwlX1DYWzpJiRdlypIP+9mdc7L4g==xkz2KMV1L9f/WJTM3W8evXg0jUCuO3vARwnJa0RZFqiT/SeoN4hb3oWPw86nngc7ttHmTPUtLrIJvKlJLnYMoA==wg03DU5vMagUDcCk7hNO4oLy8PAWuX5Ol0P5GrgRlVC4qRiNCeKmLD6Z+qJAnppothslb2ICrMMvui1Ks/khWg==CuFzAf65/n03BU4MaRuZIMFdW2njDLbNVWegOSfVL+QU3tFuiSBEsL2ASyiyEqNIeev48+XE15vm2fEIC/Quow==HxErOqFdcC4c/f0oYX+m3jrCsIvWM3sSeo0C+9ZqHyiirI0ODAD6O9lx+lP/ZUahXAUBhLuRcepmiN0kkfmr3w==t/kJRE0GvAOPQgWwVWPTRs252LsIWzzJ8ostI/Y7jZIjbXg67SLx93dH6IgvdyXk9LdyYsSvYuMEMPyVfZ3mdg==XuTd2TQftfNzWjVXgZsKIEfpXAFh/UE5WxIOG+Zw2LNmHsArGbZ7FhDjkI75bTn/ExGmu5uL149JFk77AmvfDA==wMzBvSu/VepM4VXpMTXNX/FZDUI1ILg+hn31cx9uVxLBDILDAzfCmJ2lEqbtSe6pSgWclHHh3I6j1sPqabVbPA==7X1cWwyJWRo2YstbkxnU6YIVyN/PrS7FXMWejSznstf07Biwq16mCzkG1BSBAOwd4mW/Alxndd0yJRPgO9JBWQ==g6aif/6eikoW7hNlPxe8yu+MyBFHApgMyYIIXFoLK8q4f1i5RhkoNyQMgxbCJYn4Em3XgSvnQARzSdvOrfaPFg==9KhS2XMbp8cYYoyg7PtoZDS//kovTrs3CwfA1fHVBdGjhlHJFnyPUz+iID3nLFysMd4SwOnC1xfgQ9Dmxllraw==fYS5tWOzRFOHm9Vt72kENjjOhj75QGN6NgNaSQZJdcmpUP0/2nAY93aNLN29Imbalr7FBpNk5f1lX/xKuemNpQ==V4gR9b2szvLP06Edf163Cg06prXD+bQnswK/LB+MIbQAa04q4VTGONUM8vodYVa+WZsAZS9+ibkAoNrtWFwIlQ==hbcb8pZeHRFAf/GFF69n534nGL2thh3/n/+mHNaR+fSgQr0nh1Ijxj6AjpDMmlWywMCyDIdyi7nN6jqLdbL85Q==PDZcULXtlaMMSI/DTVFOl/xJgiPyPJpISwh3b+bRmaFDjlVNDHfZAM9x6cc5jYC+4lABkbrSDGHK+GHq1Le+/w==N39Yv1vbYNvHs+ReHYXyKUg1V1+4mshpFnQugYk5zGRG2PNp4BXHBtTmVRN1IcQ3MyGoWpTmCGQf0f3YJzA9Wg==rz7YWqR6vtsUlI2fLTxVwLs6OrbhdINEogq553OsAoRVGUIKslhoiLjw5E0+TowXeS3xF20hazCEZWncf88HbQ==PGa5gbBoElEkcAh/dHONHeQ6D7AyScpS/jgIE3kVQsPaimb6UHwVkXn1mX31R5iB15DcruWnEz/UoG/gTe303Q==u8ZHI2xioCQoblHQbqHZdjS9YmUBfKfp7zJ838I2+Uc8RwIopPBj/UUIlucEhMZnbk9pCAwqq05f4hvIz3kiNg==fFySYyy+C/C3widRmXeoZqmf8ts5r+TckAlg5BFR0foV1+m8Y7fa02nOVou2+FIYdszvSmSru21XShen5+wkZw==svHRfYwwH7jE0asln6cNBFdjwaYHIly3qiDK2455Td33LquTklp2PHs93xtvxzzqQrAO9p32fA2kNSdVUIRHRg==c6yzXapvAX4vWJ3vUzkHv8jkAhkf9UXcPQ8oyoUbD6QlZ49C8NyUXI/uT9G93UPo7Ng9VHl5c5GmIwDvsR2ijg==xbzoDbsgfphHgArXBeJ13y9MKjuz4G92uCa2LjkB98WZ/uFgJ1EaMifog+cyM9Ss8TU9u+6BAy3gbXFlXu5yjg==5gpGSSJWN2q/E4QevW+oVSelk3HVWwzwHiqDEwpuWGSI35HQlgSaayLLi+6yYwfBTePvLMCCf8TXq/yj+mvX9Q==1DYhMN2mMurhHiUkX0OIhKfFCurwVhQvXwIGyQlskuDJAROL7fNpjNNeQrPTo2RNpM+XbzG5BUGFZvYh5AG5rg==xC8+C4lSK/hUyDl3pfOKV0K425l94TmRZZZFtN1yFK8zvTk26BJSSx3MHO2nFOHMAwHiaE3+wZh+mckhdSNFOw==bjaZcRJq9giYPEZYI1rvM1f86TLNGgLeFr7dGm2n586ntDpE1w5/jtNts+QfCIGocS2OXwCtFb39XT7cpFHajA==lPMfOaLT4BoFeUh+DRJx5DZZdPXGQaQNpEolkpgoLvMXBZ2mraWcuPuNyPY+4tcLv/X7oaeH40a9lfkvnyB3WQ==+hHXvDKa/qBFIJjJCtE4TWCmAsTxTOcQSHT06RWhNOMvHGJ8gPCDMd00h5MVrMc4/zku5gXg9vuzI0b8mI4V2Q==NsLqXCUYCXHktk0nP4rfu4/fp/7+cIDvSHj1CClRNHQlTwW51OYdWB2WI+YchnrRcE7Degs2dlzXoMSIk8bOSQ==7wIhq9P1nb2TmGAnMAxNV6Z40pdzMqyhMSnRxVtZw1SD5iswxMchsn9hU+AJ2Zh3kRRrKWgORbRMfrveQuXcPQ==GilPq9DJv0T/nUhhbsncuQ/ReN1ztuKNdMCg9ZSkyd1q8adM7kDR7R0PBYKsF+ycDyDHiN6qFh2VpGXcMtwP7Q==leobx+ARey2Jt4+58Btytpi597rG9D/NogY3GkWlSW0t6+h83bPrdHbJAKr2GfcKS1hxKvGp/yEa7+xmr7aYZA==EOzx43B2fZvTtJSGCqU78Fi5JxALmRa2ifQ8zQOUyYj2TefyprAsIXMaGCCYB2nhtzZAjQ8q7yltwIFoGeLjTg==Aj6uJy0a36HSH0VBtDrQTcZKVkhEhpv2KnuGpMjKEcAfS9sP8+DXELOesWqYJ5EqOG/lzzWgkLNeU/GpR2etlw==9W6F5hLa8bizKCDqc798anuV+rTvZzylpqFD/rk2Fykc7oH70TpLUPcv4lXhtYXvHhHpYZbayHAmRl3ienejyQ==DEGEZ5xpLN0+LLznUQXtAo610zIga2/R65auXO7Fj8QphKRr9Fa6MZ4hGvYFiyi\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/@qwik-city-plan.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\": {\n      \"exports\": [\"s_VJVmS9CcP1U\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\",\n      \"isDynamicEntry\": false,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\"\n      ],\n      \"name\": \"index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\"],\n      \"fileName\": \"build/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"e\", \"t\", \"v\", \"_\", \"F\", \"n\", \"q\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\": {\n          \"code\": \"<removed 18888 bytes>\",\n          \"originalLength\": 804,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_VJVmS9CcP1U\"],\n          \"renderedLength\": 18888\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { e as _jsxBranch, t as useErrorBoundary, v as useOnWindow, _ as _jsxC, F as Fragment, n as Slot, q as qrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\\\");\\nconst s_VJVmS9CcP1U = (props) => {\\n  _jsxBranch();\\n  const store2 = useErrorBoundary();\\n  useOnWindow(\\\"qerror\\\", /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_ErrorBoundary_component_useOnWindow_0s3bilOgUys.js\\\"), true ? [] : void 0), \\\"s_0s3bilOgUys\\\", [\\n    store2\\n  ]));\\n  if (store2.error && props.fallback$) return /* @__PURE__ */ _jsxC(Fragment, {\\n    children: props.fallback$(store2.error)\\n  }, 1, \\\"uY_8\\\");\\n  return /* @__PURE__ */ _jsxC(Slot, null, 3, \\\"uY_9\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"4WJOXVcCa3fqYhepZgOc6coCyvHVuyt5ASuTEz4yezdI9irNg7RcVmPxq2NDA2O37hMrchIlAHWNjaVecYMmNw==nhyDJOta9C28D1zEMOS4iXhwM6OA1QeL7qJACK+j4s+WBEQA83mPXYP8Zm5ZmCuSJ3yDk2v9HNElbGI4jfJG/g==gQSV1/FyOdQqkp8TtqmPjjdQynHROKVnkEkWx5AwQHZgZMAn43pMa6/yJvpUMC5bM3oWXz70vVG3pXPMlNHXtg==JQazn6K1hxNejnRbJwZ9hVnNDX6K+jVhkgPnUvnCQaZ71OqOqXlRT47qLbw1hal1m7F43Yid9zu9fcI0F1vEhg==/s8kV5Ej18oj11+Gw3V/vPS6QYliSYF80yANLiiCsEQfZQh0g8XnPkrdWWsLDg9PIJ0SEjbWy6qDKwOUXqeq9g==bBfhmG8CulQgw+PgBZh1dKQWASNNt5KGNhxyu8NYMKtQYJIfvKoszmU7yTXW0/vrdTNh2XhDkfrz2FEWuec6Ow==p9CFflf91jceLETpafo2s468yIRfjic0vDTIdVsQvC9JRgG134vm/ZPUZTdQgkhpTjr41eX8zFd24pqtXFDCsw==VhiGW4e+Oi5mJvRZqEFLOt1I1DToUEfQq4hLEjmzycQUi4RUDW7VzwFnmk/eBg56lxY4q9aSY+tJPdU5XeIQug==Ghbfxax3i2+YhBOSwuUAgLTwe365kYd4coh75q1OSX3NGBF625qzMNNKz0sVqCIfi6Svyj2BO+RDJdb/C8LPuQ==A9NNNsi66qS7n3Jbepyl18BeN27u5HpqjfXGlleiBvBGbkLYNX3DCaWQHeBf78efwuBsdkwH/YlyFtxpioFT1g==34NMox0fZXJIPr4yM+fUeJ6ts1zawI0Qi6VwMW+LLdSUQvMGBcJTbERuV9FyE/gFhzPtzNp4iKHNYDI2ZGaMZQ==7HbES6mfdzPAOgFR3AwyMU7cdMP21APn1pSmGo9ceYweh2aiWMla+zyae/BtkosGXxkoaDjPatuCcvsxaufERg==tYxbiFLCJ1Lkv7ywy5h1PtUW8RrNSlWv2xTg2Y0jX/sa4CRpS8BPECrVytZ7A3bUqxrokJd3AtNslHJ0StwVEA==jmkvEb/C6C/+O8ey8kY7lCzljhODgkQxnwsmGr71Xj85xwarDK2aXsaxy7tpGEhPTrr1i4we/RjE9owaX6nFWw==bdL2/6i4jRIsHH2y1o4b0W6aZh4xyTgkCH/sj3/36RdYdyVABqof9dgnESuqfR4rN453L+vXTaDpaGp1b8PP6w==o+xZbhql7fDtv2WZRdIqK4TyEAs+XKi5+9QHVVbCwcYSZGkibVMVQl0qENHuv+dILZyAjL/Pp1/97huc6U91yg==QYHR8u2uP97HssUhG4DDUui0/bRC+8QQqbBoclhSNgHE+fBVx8HXdDTQl4S9i2AK0psu5d/JKFyyBVnAVqSreQ==pJ5UqB0Go1g1Ir/6lU+PEH5eI1OpC2rvBfYMczSWQGyxTmHHCz0Lr62qnJbSWwWnZnU64rk2nUIl1UJ32dKxhA==IEOgL/GFCiE2C5EGH8C8kYADVxH5uhTaI0NFURf53MaRzGMfFpYTDniGS3DFXGLbmgk2tu0D/DcGRi8supGJOg==V+fzWC0efZOrlN4711KWEThyj0Z3JWPnMXu8j1zW9hjbOe/3VL+FRJ2YIxp3L6pt4H63VRD6pp/3DODa3q/CAg==2eCQ7F6AfuTZoV71n7Oyfx6zd6m/ndlpIeEhRvq7rLoh5YnuTSoYyCUmnZmJiSHWdBBaLHs3Ukd9IqzeXh9tXA==RwckEguL1A7fHgdmLFa10h9oSiDk/gpRc6smCBvSZBiMptmYdRCgPvO4NRP5sI9pv0BN8CwBR1kQCJ+FhF4gwg==0dwrUxja7qXHW4yrSuJt+tVj+vyaV1s+3E77EE/Lxe9BNMqM1yB0crkkMjzpmo+aQanLE77E+UagqgYWeUx8mQ==RwuQqlGNBydWAANngrdRxavttC1sctuKFFbORADK8wrBPh8QYRpPX3jRFbxhoV/8LQ95YZ6xbde1nHzob38gMg==lYMl0erU3HPr6YTkilFeoOYEAscEO5/Cet0Wh7yXEyFD0z+8zuuEou35tX9hDaaVKBsYJgGYPt8VEUQ65eK6YA==wElmZIwxXRRGXSMuGuMIeRiCdC1UXUXcdq+sWPwWIuwjzXkctVxVeO5rn+fjQakuW0JNIEd8jYM/GEHunZby1w==achrcHGmyNCyWBcboEtcxNsIgoG6D/65HQ9VBmR37tjXbupaSjribCQ4cFPpnTyiIXNUmeL3bMWRn7Jvy3whFg==QSG2HEWsvXTUf4U4UiMWWnBitJXQYMdjNuLBo420UM/QXWCN58hlIF8J3R04nFfjBMBx0fRtqryl58TQ572PwQ==uZkyjNrSKmmxwwVYy5MOno1jGpJYHNZK/7wKMJd3mwQ3SGqCuNYlG+sQk/ZjnVeqKFO/pYc3ooBN6HVrFFz/OQ==2l04YrqNLdPDGGDxLIOdqWqhKoaBRw2tsd26PA9LVN1UUOXRDPX76oMDJGQzfC7KK2KY5sG7LNFdo0HHYxqXrg==iR30BxPQhGNRB8f5qjgvfc7ySczw1UUnnQGT0BgNaHD9JzW8oFKwdL0/nfZUqFkHG5SPHh66adnxclX5pQLQXA==nJHRnfXEWYVClXjKG45VAeAAtKrisYov5LwimJ5XNk2VXtFJ2xiFUUq7msZ8m13c/OW6qv/IkU1lBPz24H1zyw==D3XNTqd7+0oSvbsPyIeQtaF5sTOOGXYihX8YDIOvGvjjVL2V0is6GkdouNHphOleUzWeDK3Gc9x7shUloWKPcw==nXjHlw3MiXxAbAUALCSRPcakFi1QwpVMvmSV8A0w8GcMhc72eakjUKe3DqtWWGrHYXUGAQgaGiEjYOmE/68d2w==dccIYmESuuLsPiezSvcFGxfkpf6okptnqvmkUlOQSxkZ28JumZ1JLR2z56C6r+rtGMKvRudsuHI38Gc2lJRfDg==QkqyQ31LZ0bq6fxKWNFFhEpE0831tgtn8TUI/nB2vw3ireL8wY0U/bZIH45BKxgK9Cr2HP1ljy+KvkcReJVeUg==6YTgCzg69gvS2XoNeaaGeoQE0qg7P6k8aZQG3EJp+ik2fVI7e4Ez1hpmks2oCbvKzYGpHQpOmty6Mb+7kftl9Q==ZxD/4/qEZI+hQn1r+narFhUFHFVEjBJEyHejG6Ec40JiBY7a80XKPfGqXrj/AAt3xqS18sunAA75yORraz+9Ag==fnQIJ/WaPLvtNz9sZUq2L2tdSW+GYfQxPDmzXai7TC63D6yVYW7t6FkgoljCo5xdhKGKMCmIUJKbq5VwmfnCVw==25oDbq0SQG07S6J2Unp4ya9jzkTXVefvWHm/izKm31d2NTBYo82H9O0kmTJrOSzHAWCYdWuKu0/G4xAwsLTs8Q==hMZXrg7UuDhQGseJHIdKnDgQghx6BZKKXrU4W1ZaQgiRNOxZFuKnc/9jNghV/60iqzXvHElZix8rFlPD2LjXBQ==j1N0KVO1T4qzm2GxhBZ4Dl9lU1ppGzLdTqwzqvvU+QOHVUSVHYIDhW2cv8O4rNGc43KoKKuOotQXD2jy7/asaA==b2YbqF9nSkvfbjsRn19fb8qYMsrz/pBG+iTaV5fpq77HE4KkRlysZ4HC8o/LSa7OqA0llhrN0rDUtWIkUdq09Q==yUOLcWlk+hQEQQCN0j9qQpZnatJ2vEbI2F+6MpFEgYoKn+bxFaf+p/zUgDt/aGMn+g4KJ2xPkE9oh7wE/zdpKA==fkOQN32QWFMDmNtsSxhAl3rtxS50UgxCstkfwBn\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_ErrorBoundary_component_VJVmS9CcP1U.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\": {\n      \"exports\": [\"_hW\", \"s_AaY04hL3w3A\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\",\n      \"isDynamicEntry\": false,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/qwik/packages/qwik-city/lib/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\"],\n      \"name\": \"index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"p\", \"w\", \"x\", \"b\"],\n        \"build/qwik-city.js\": [\"x\", \"y\", \"z\"],\n        \"build/preloader.js\": [],\n        \"build/preload-helper.js\": []\n      },\n      \"imports\": [\n        \"build/core.js\",\n        \"build/qwik-city.js\",\n        \"build/preloader.js\",\n        \"build/preload-helper.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\": {\n          \"code\": \"<removed 11027 bytes>\",\n          \"originalLength\": 2932,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_AaY04hL3w3A\"],\n          \"renderedLength\": 11027\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope, p as _getContextElement, w as _serializeData, x as _deserializeData } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport { x as QFN_KEY, y as deserializeStream, z as QDATA_KEY } from \\\"./qwik-city.js\\\";\\nimport \\\"./preloader.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\\\");\\nconst s_AaY04hL3w3A = async function(...args) {\\n  const [fetchOptions, headers, method, origin, qrl] = useLexicalScope();\\n  const abortSignal = args.length > 0 && args[0] instanceof AbortSignal ? args.shift() : void 0;\\n  {\\n    const ctxElm = _getContextElement();\\n    const filteredArgs = args.map((arg) => {\\n      if (arg instanceof SubmitEvent && arg.target instanceof HTMLFormElement) return new FormData(arg.target);\\n      else if (arg instanceof Event) return null;\\n      else if (arg instanceof Node) return null;\\n      return arg;\\n    });\\n    const qrlHash = qrl.getHash();\\n    let query = \\\"\\\";\\n    const config = {\\n      ...fetchOptions,\\n      method,\\n      headers: {\\n        ...headers,\\n        \\\"Content-Type\\\": \\\"application/qwik-json\\\",\\n        Accept: \\\"application/json, application/qwik-json, text/qwik-json-stream, text/plain\\\",\\n        // Required so we don't call accidentally\\n        \\\"X-QRL\\\": qrlHash\\n      },\\n      signal: abortSignal\\n    };\\n    const body = await _serializeData([\\n      qrl,\\n      ...filteredArgs\\n    ]);\\n    if (method === \\\"GET\\\") query += `&${QDATA_KEY}=${encodeURIComponent(body)}`;\\n    else config.body = body;\\n    const res = await fetch(`${origin}?${QFN_KEY}=${qrlHash}${query}`, config);\\n    const contentType = res.headers.get(\\\"Content-Type\\\");\\n    if (res.ok && contentType === \\\"text/qwik-json-stream\\\" && res.body) return async function* () {\\n      try {\\n        for await (const result of deserializeStream(res.body, ctxElm ?? document.documentElement, abortSignal)) yield result;\\n      } finally {\\n        if (!(abortSignal == null ? void 0 : abortSignal.aborted)) await res.body.cancel();\\n      }\\n    }();\\n    else if (contentType === \\\"application/qwik-json\\\") {\\n      const str = await res.text();\\n      const obj = await _deserializeData(str, ctxElm ?? document.documentElement);\\n      if (res.status >= 400) throw obj;\\n      return obj;\\n    } else if (contentType === \\\"application/json\\\") {\\n      const obj = await res.json();\\n      if (res.status >= 400) throw obj;\\n      return obj;\\n    } else if (contentType === \\\"text/plain\\\" || contentType === \\\"text/html\\\") {\\n      const str = await res.text();\\n      if (res.status >= 400) throw str;\\n      return str;\\n    }\\n  }\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"ArQ8v0m/NAp2IPXQb9gToqSLDFcK9Av+yjKQTyIJeNRvwOvjwSaQLZ+qi3NZ/ZD3mlkCd2PUR3GtwYGBmxO9IA==5iLi6k1AUYiK6M7KYIm/QL1D2e3K6Bmu1Rcw6P9/BDbN2Mco1iHXktqa7DtNLHL2f4MBoVThIMzIPjRI+Zk+MA==fBoXvGh3Ri/zOr5wStZGgDF8cYJlDRYdTlmgrPWX9j4U5UHFpryRskYsLrxuGs5yTEX9CG8i7KVDKgIX45PFug==NSYZlyxxLgOIGYGbRlkuSWNx+gMPQKjc4ACAfaeTWf90MGCBh8FMs1Fv9f7qTmXVM0g7GFVtu/tASsyRtP2t4A==GRhQaicc51z7PhHcl0ut1fSdMr1SR5lGjbIkSnjmXZ+1ctiGKo8nm7+8KFGHfS268i15Fm+cKi+Ph89xXPxA4w==EwsHC/GIHTwY1y+cs6z8cIkfSHQoIj2jhTdqgXJBruDwvwmkrTVLs33NO1e966Bhsl9xIaEENEo440xHgqhuAA==0IpeusNCAjnUSkz5rwE4Huvhz6mZVY0fnue1grlQG2EiPfFLi4Qj3/Nh3Zemt0tGiQ8hw0Yx7kGT5IjaUm/S8w==NIOd/QjqmZGliGJ+ivXD43t2CLi8lD3VgFw4VLX61z16cW1X6Zp0lDe/DZOMWQVHKhI8vDT5wHOt0FtybgcuGg==z8FKrYBnl786SrSJIlQKlWMkyujFo1xxTxZ8bdAccpp4D92fz5Ua8GOrQALfj5XULxhyCZ73MgCUHP1kq6au8w==ysMrq9pH9SFxX/+8CJIGX02URxVaHg8Bpx5MbD4dojfXYwagimlnqJo9+j3C1XsJhVIFniQDl2eb9Gv/1QUAQg==3IxrVBTjcIESM5cJWodqiFz3sZkf2g1lLyVWEo8KzC8r65uAcTs+t/CHD2rQFxVonW8GwO5e4dIkhwKgT294PQ==7iIdNgijRH9Al6V3aXAlDwG1ZJ7HoxTroDAJV9bDznb4UH8OXpg2Tgux1nH1WyRLvor7FHveWHGNC47xXxgjyw==w40iwirRqK42p2YYIOOjPXpjddoLAIfQfNwkccI9zfKeVML8X1Di/RnE03RKeidxEacXx1iWO+S0Y4dXtqJeBA==xSacNJPYI8CVgvdcM+zlvWOkyzcSNbtOlIJSypaZeqQVEracuVT0DOlfYXzMy/NnSgvkCk6Eb88IWINhT98N7g==ccFeXghbi4riXDyG8DEKPAnjV6Bs8wEIbq6PzDmFG2rHaOGgyabETGIS6R0OGspjB4/oG0O9HtU2cjdnltFtmg==3QYBbRs6HEToERT0JIuJ4Yv08dSjv46t87KdBKaZOaApL459WHNG3PhallPsuwrD6RjfH9/6+8fHFbo7DLOtbw==JFQ5XN/c++l54ae9qPJOegMem8BLjegeP5KNHoZN4DCAaB1D1haegG3T4vx/fVRbZQ/bdiiwnEhJHI7vj++lmw==KE6Z+Cd05lbriwL8m6FtTYOboCxxf63UsSNnyN+3vjBn00psEfT1A05QpUzTGVo21jKrloQg3uhhaPb9MPWsgQ==vsBw54xPaoONqLtXK+1u6mRm0A6cqmqT2oT0Ial5N0YBFskO54DuQzB7FsJQomKV69d68wKHx+BJ3CO5rqVbkA==gYpXEMTVwSVHk/ScA01/RZX8YnOFthxya1yHlx3N6/PCvAqWILBft9t5942zXUJ260mYrw7r1AhTq9dT7eFeFQ==VC0YKegDnPCOJrGojuNsQesFxZIlIvEPkfA9i/Iri1tyRWrLXngHPXKkGEuZ3JghSUH3BD+PtPrgeFT3JDpuZg==dg4JcckguhUZ67rvpgKhCQlh/Dy2aJTmidh1VvVSd6u93PHUQPxKx2HakHa01b6tcoQJhBAscypabCstgH5dwQ==DZNQoSjJD/dXTJfjUn/n6RTLZrMkndKUrEiClKh6dULyZQPAX4MGku3aKVYDmvtQooers10EcBa87slw+libVQ==iAmAmCi3uAWPfYvi4trN75WLvB7BMXkjMHE2ettI3aahPb/mR6ULoSi/MMZMloWWRYU0KaS6/0WOao0r4RSDTA==pwa/wvcfE9DAok2OTg9NEbsvK\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_serverQrl_rpc_AaY04hL3w3A.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\": {\n      \"exports\": [\"s_4XSnxjzQSYM\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\",\n      \"isDynamicEntry\": false,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\"\n      ],\n      \"name\": \"index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\"],\n      \"fileName\": \"build/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/qwik-city.js\": [\"c\", \"a\", \"C\", \"D\", \"b\", \"d\", \"e\", \"f\", \"g\"],\n        \"build/core.js\": [\"i\", \"k\", \"q\", \"l\", \"_\", \"n\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/preload-helper.js\",\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\": {\n          \"code\": \"<removed 5371 bytes>\",\n          \"originalLength\": 2405,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_4XSnxjzQSYM\"],\n          \"renderedLength\": 5371\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { c as createDocumentHead, a as ContentContext, C as ContentInternalContext, D as DocumentHeadContext, b as RouteLocationContext, d as RouteNavigateContext, e as RouteStateContext, f as RouteActionContext, g as RouteInternalContext } from \\\"./qwik-city.js\\\";\\nimport { i as useStore, k as useSignal, q as qrl, l as useContextProvider, _ as _jsxC, n as Slot } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\\\");\\nconst s_4XSnxjzQSYM = (props) => {\\n  const urlEnv = props.url ?? \\\"http://localhost/\\\";\\n  const url = new URL(urlEnv);\\n  const routeLocation = useStore({\\n    url,\\n    params: props.params ?? {},\\n    isNavigating: false,\\n    prevUrl: void 0\\n  }, {\\n    deep: false\\n  });\\n  const loaderState = useSignal({});\\n  const routeInternal = useSignal({\\n    type: \\\"initial\\\",\\n    dest: url\\n  });\\n  const goto = props.goto ?? /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\\\"), true ? [] : void 0), \\\"s_cTkWSVfU9vo\\\");\\n  const documentHead = useStore(createDocumentHead, {\\n    deep: false\\n  });\\n  const content = useStore({\\n    headings: void 0,\\n    menu: void 0\\n  }, {\\n    deep: false\\n  });\\n  const contentInternal = useSignal();\\n  const actionState = useSignal();\\n  useContextProvider(ContentContext, content);\\n  useContextProvider(ContentInternalContext, contentInternal);\\n  useContextProvider(DocumentHeadContext, documentHead);\\n  useContextProvider(RouteLocationContext, routeLocation);\\n  useContextProvider(RouteNavigateContext, goto);\\n  useContextProvider(RouteStateContext, loaderState);\\n  useContextProvider(RouteActionContext, actionState);\\n  useContextProvider(RouteInternalContext, routeInternal);\\n  return /* @__PURE__ */ _jsxC(Slot, null, 3, \\\"uY_4\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"2eiWjNQ3lQyIzGT7epyLoxtbRHX9NnBXnq6UtdtGRfNPYy55yjGFSBhNQ1QidKyjTWNBrNxuILKYSY3HXTjjdA==gPCEVB3wVsVt14Ymi9ymyI2tagTigCJqV+XLmcPAbhYcOxYnRQjHdklTaG1AcIwv7C/IUIGVIaN1G+Zm8pEFug==wAXuaH6Tkd8JEJF0TzCgjnwueK9GWSGYjOklQBmTfRsZSIAaQGi/QYiQbGXLsqMXlE+E0tPI0HJBhAFMv579dQ==1BHIJD0AFoJ7/aYdKRVIbfBcnQ86J38PL7gVVnm9Ii+mhqHnwuoWzOEzQ2pQIGKWRykunMKprvPtOEp4gdcIjA==Jr5OGuJ5rpzfTeDGHyQAL/J/olLyWs1D6DVPN0GMh3fd95ZBlj3b2HDU0aKVSDHgoAwuPX/Dk0GFQLOVoOI9zw==10X/bpfekev+sUWPLfCYVf8lwZh7dWYBk5stiQ42+9eUhkplnA+Nb4Qs5pFHfPoiHlUodfhI8fJjakQpKZeukw==0hyikZ4wSDGCt+0wr1OFeoOAc+5bjXggAoD9HFxTumaG2Ph1HTGePjsK4lpd3FFlgLJnfd2wQAxEOOIIDswJlw==Tr4I+J3FN87zk2Ob6CpRatVQLiWYKuKX9XF5EyVL+GpbcMszD0UBX6uZ7ErMZK9W7TlhNj0AXDPgkw1SY+gC3Q==b8A6BxUaVgX6MdP57KZ+vJSPG50KXanqG31ZukKnjBNU5OC/Sl6yWXJFiyqDIXfjDULVcBAw3zV7+zytDXuUPw==ayXExqSwp37io0kDmSXJbqmE4OI1OmaJf/g3+oXT8nWDvntYT8/76yVoqNiW7ABdJot0kC2RbbHYmwWQgFvEyg==YhO3GH7mwF5CcNbmq0avUuNPtjevcol0jJY8kgxI57zFvYIVxsBQpxxnVXhL4q9cBItc1iKlD0NzTi1NZWtGzA==vo6Jfz2xCTFF/FEAlntAwltBl3eIqsKQ3k+Yh6wymxwzWFkOgmewJejXwMg7ys2FH1WfHLl+sAmuKLVkXHHnew==HG5qqgKQbx+RIQ42veFrnlHElvKhKUVsF2URhegnNBOXZ+IMIaeYwfCs57Jhh6CLdLqXGj59Kmg0UnCBmlubVg==VCXE5U02SxBMt39Qec5zm1zK/S4B04BZ3Dt5pf1oDRnV9QQ+zWCyilG1ZjIR71PyuTRPXjsDpzWyL3i7A8luIw==et4tnUiVc4MXup1yxQSOtVaBflGqUvmuC4xf1RH61DglTJm+LCRjWDLFsvXgVUXioddjK12T6uB3lmSfEEBCmw==Iklz5TTMGZ0U8HahRs7UdTSIbFJYGjbdXLGGYoajppEuBpSjUlNwoBJIhc3BjUS1A1HU9HMbAiTEA08lHlhUYw==myK8BN6N9nipWVQCEaevOUkoC3mGLsuwEqZ5NliYNmP0+vJDxIabARxz1zVL1M0N0SoK2HgHS3MJGFSr7Npb4Q==NjM6+RcXZE2IWbq7PbBdfFOQ6A+zk0xOXPWgc7th100VcwrZpcZQ6bv2im4kaCt2ECtLHoGB/7niW4xWlQZ7lg==ayg6bUozfNQDY/KnwGtJl+MfdLG/d+kKW8w6ob37B/UutwuDIcOL+SA+R3PocV+NBmfOrtPNvPdwATCf+KFE9w==sxp1QBXjx4P4uEuM85MxX6EjkPpn/8w3MEnxtdPbD2Rm0bVZIw3Qdvjec6kW84WKVWuFpuX1Z2ZOkJBLBMOIrw==Hc65lkJDdgXk+ONC3CP1oEbWnjvWwq5bJGqxFGKYhD6yqJqa2zuXXhhmphNNlk0DfhCifgZGkbfeCKU14eecnw==yiX5rGePm4vT0qGKZ8suQ+zWj/pCotwJU14Kd5RR/kuH9cjM8ksmUyw3cZwNSFHIh3zeFtXcnTtUOxI6o80sYg==zFOtv0Z/Iq6+j2LWIJsrs/T1qYm890BXn6E8Hlp1hKkehf16XpvdHWJr59+ii79Zus2FSOiv86hEv2+1esBTIQ==dPOXNrRpm1Av5mCle4QZTBaNj7HgO4qlOohU/PndvHLhd8Nla9PqhPvYE1xK8JF0YdHcYm0e4zrepTQUTgGG6g==z/PvsxXVT8BYsYJGVX31eOWkukKvJUNw6fQk+OMU6cJYg9Kz3WrWLN+w/2CmzWGhwOiyDVMHRIMpYFgH2cIzgA==6Df1kgCXBw/yCNqxjGY73MJfXKl5+PHpO5M+9H492V4ysdouriMlm2bUt2kJNzx3HTd94YgsQzrHD/jw9O6mgQ==kaT6bkwO1XXRQdJ0mnmhurbizqg/o+xw0HZSXIrLr5J+67/r2S2R9+RGalFxuwVUg2UVpIUDVuJ+MaN8dmwHjw==fuSqE0lo3sxx6vCUanuthmKqJ79oGf4e40B7kwfXKZPq0OZjI1yScuesxt9krL0EXAbbsRZzzChTm/0KQeFDNw==o+ATXAVHHbA8hPTyRdvbZKEhyv/1kxz/oMFPTRF0JukjBSJhNQV/ncuBgYk3UYmFdPm6//0Xt6VrGoiszznrZw==rlUJJZP1YBWMGpjhWWoDIoeOGctiHW4pUHpU03C9j8LLquLqahAREj/26S+IJb56iUU81GORXQgPyo69FiwtKQ==7U+KlQk7NSz1IoOo6aJ8KJpCNgHvNJw0kAtcrBLYRVFyVsjEHs1PLMNzj3qDTTWmDmNVNziW+Q6q0rcmx8lTRA==h9VumruIQACV7HOiQD3icN1WTC4oahRfX8wZBIdVw9TJBjkjXF+PwvNkI2ynP4bvHAXHZqxJrr0s7kMdctyK7Q==jXz34\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_QwikCityMockProvider_component_4XSnxjzQSYM.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\": {\n      \"exports\": [\"_hW\", \"s_cTkWSVfU9vo\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\"\n      ],\n      \"name\": \"index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\": {\n          \"code\": \"<removed 14260 bytes>\",\n          \"originalLength\": 145,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_cTkWSVfU9vo\"],\n          \"renderedLength\": 14260\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\\\");\\nconst s_cTkWSVfU9vo = async () => {\\n  console.warn(\\\"QwikCityMockProvider: goto not provided\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"h6rsIX2/FD+/O8Jo1cv31sGOhVuAURY2A4vuOF9at4Mp8XrdPDu5pvasXfhTcHwY6XEixvzsDp/X9GiLO8a/0w==dl1jOsMN/pm7parPeRd2gaxAAuUsVfRlKG7L4d2q0LxY0CUQfJPMQ5rZLSLetUkz8LikrfqF+EEua+LzH4TzVA==blZipYgZOr5qJubOR4HegRp/Yw8oFZNz35cJR4aa//K9g5scFC+KAo2t9+flv9UDeO4yL70vrcggVSBWVYEJxA==QEzH9Aw5rS8VG3qEIZfWi9pkSM5MvuUPZlE8TQms5FpZGG1N38oto2ti8tgwTz6PxBUYaaap7BOJ+cJvNom9nA==R79H+FxttEP1sEcElJ8YwLJ+GWD1CQBi9OuPjy70EU3bOxci7tqp5MlQxC52I8jy0cnypdYPn0GYDUpWWKlgeQ==AtMOIRPM9cmsqZoWdZ9b2J7l05IcIJpktiEclkde8P23z4PUbO5JpwHsn90hzVkAuY6GhSmF8XKzG8nTYMYxTA==WhCXVCKmsX7+TjKj7GU2OC1vrXCFFU6d+6th/pv5OwIrePkEmms4ldS/TSUUzfJumBJ+P5wsuKXjguahdILxGw==vQW2KlobHh3KqVtRHW5PkawUFUlTq/eKwr6OH5i30+zifi5SdxJikO8HFod/Y26LSmPZ2Xi3Etl1nlMbQ763DA==P/7FHK5itNfP4PNfpwpPiGsEUOKJTra0Wzmbqi9ERPs+UARW23Ae9YVNt4nSB5t8OgiPBdgtcax2PCHf4SJCGQ==ahzJsOChQHaRFHEfEGfzU45SvTfEU0oa5aCJbYlmrJr8ZHTEFY+iVmxXp9CMCsB0vx1Gm2iZsCEMadWRVE4tIA==s9ZFX85ZV91C2pfqIZ+xfLWyWqYPCbc5TY7ZjmlmRO7tJnN71zxbVK20MtPRl9PoKqbC1nxuaydUmZWRMo/8qA==1LfZ2rrTYdyiWJ8P/3liMkGdhKpDbJkus0LlptRUCHmoIT6fyKqbk/64j1+RqlghwZzSNP7MFZU4SJWQQPL0Yw==kDwFckFXDxOHWca5AYW4KB4QjhgS6I4ZB4zY5p8vMtN6ioxQhztcHjc7ebTOdZT5TUGvGJ2lVYSbx+WGPmFxPg==sgf0aOaJDoQa8McZiQ1HRRmTmKol7cmQeJklB4ihBPSnHs30jZrfRqDC77FJYfXC+2pI0bbzaOpyOKheXqBZWQ==DnZJb6uU/1DunDn4KiTYhk0XTCGrn8rpm8mvcpdYD5na0JhiL9o0BdAJPlHWc/XrvKzG+/i9VXRJ0xqFRxQtYA==K5IsRYbhGNQt3UBZg2jT8YRbQyfkwBx5xnLFr32ePlJilUQIuoMm9+FQrnw0NZKeTk29lDEyWs3GcFPBaOb8oA==+2GV9xInwuRKWzeos7VjdPMeoD76jikH+3j6qwOqVdzbgu1UNCB4PVBxPQ+iHWSfHrJax4LhwE0qmCWDvojtfA==sEh9upPE0LqA9zm6hX0c26y8nLQVWNo66PctQVSEZgA4PmqtaSyCzoxPVoPopsKxgiUs9GkMiczYs2J8+p+QVQ==uYECFKMYnQug0cdVwJfsHtKnACgNHjrTjeCH93wOhAMcvkjjF2qev3wEOSeULOdh/qYg0JQpfKjl9C42EuWvTw==wzN+YAjtthyc4M5FHW/Tm78wt1HJJ6Tabt5AXM2guCYLnflUwKWfmGc8JbhGsudL9vUM9aXjZKJgBnv7Mq/F+g==DA64h3ZyQwcbyWrku3P06C2+96FSU9/QIlTn0LE1y2shTFi8X/GdvujHN0O3vOtTyf0HuqmFndMsbL3yw51iAg==tl/dX0IiLeNWxplfcM2XUDH5Cr6ffaZ766g5Qj8DdY3+Y84WaYiXRi4L6QWjEVJ6YFXpdEV93OAbN7fdlvjypA==KFc4ri7kyDbiv/2gRrW0UXnXQ/Ya+hGKmp21Aipbq8PW8dHrLC0JwBdlvz1NUypI3N55hZuQ9q7/RzaU95VA7A==Dj+vkVYLLpftrx6QocH2R6zsYp7UE5js940xh8UK2a0FtBBaKRNKnnYW2namXvbqT4zLiPWXsMwPQy4PfTcAPA==6+lDIpBIFoX/JUQ61VI0EMemrKe/uUMKDrj2izahsSEgDjIm6gb0pNjaxQyRsZF1302k04s6sp/AxzIK+mWbkA==jEs85wE4i19ivARA2BidtoDskZqiLg3Ar7Yqv9piJ1Zi++vnZ0mty3S4VV6wfPPzDGrfJo8jOdwlfeKzf0nLcw==Mk5FPZGQ344y2AUCGcIr06+NgACIoz4iAcQq5E9iVFvPEYo6mAJJvmplj2RyUlEeHYmOBOOPhGISjXw340K4oQ==F11em4Sjdb8dQC3j6bJjkw/0J49NJjNzbMAFVm3b2AzOD762zrYjhckOfgNyKqC9UTj6oGnfvLFuUnz9tnc0Hg==AqH9KoT3NgrDxO2FFNnNf4XR7qnJll7Q1eyAFz5vSIYBAtjiokhsOauTjI4j06VosfYNBV53cmN0gZ0Mxk1zqg==hGkfq+QQ2hCmLoToEtBjT6d0dhYGm5HmKdXc3+WS5UaD3h/BaHm+LNaEn7sA/6pP4zwrwXQusKDaT2rfIIhM5g==vggFWxaVUh2KX1DEjfAhSgrx/+n3CXsOelrOTiC0QIW7g6rD3WFSPDbBCjE3PI9rUy2QF8Jzuu6PJ+plYEGyHg==dqdDXCA8xW6ebKcAXoGhc48IOHY9gzbel5RZc6hvAhHl8p7jiQAgZEcrjrT3QWbdkAUQ74uR3Xtala3rCF975Q==uDpZBkFCKbO95LcsQPhZUUrHn3TWjeCUvarrAmDN6AK7RF5iecuLJHC5w4LG5hD22eWV34/Dky4hMfzgFVcuxA==zgr/FnJ20kgwZnw97xprgbMnikjPRBDkhaq5n9d88vwOiW9UQCKTGoY68rpmWyyEFhnPl0OVc/xtp7L/1MHPVQ==P4UjrbLKUP7lzdyNgbPZmZ1Ae3jTREd+3GpqW4l7xBaaVkkWoi18HSeuoDJ7rAHVKhHmvmHSJN76kndPHNqAvg==nGHcSzzttwBbG4txxgDVHtQBRyarp7AwFyO7wvxIe/OdsuzmMD7kcDrtxAQzczRNLnF2u86h0GgPjrrzai6K8A==7fm1Fq8S+9ew1V+bhKSMw5Xvkx5IiqHesZ18oujCwuDI81W5jDEMGmLGxnfi8oean/cTZ8CWe+9tVNml7BN3Og==20VUKvrULF2q5wrZCF4itSYQYLx/mwSi3dGM4eE+tigE6QPxVAcaa6M/n4NdqK/iRAvcjn9v0VSkWnGP+VSKRw==DrH9r3PDyfmhOI9Adc46dsUn0Pyr64OrnWjQmJMkwr5Z4jJznOwdtGf9yOnySEY853CoWMPuAF0BeFNlvdPjfQ==k5D38QTJdWUS8Cw1T/kcHMvwL6kDS1wf8PyqnApGJClFVNAUQSDfbyllNEjHXMoVI3JxM7eDSOXsLrgzra2NlA==78eI7c7sPOY/FuyT/eEti11dGsdku66vqXfkhdTvCOZBwH5thrRt+DJe5oRHwJsGM22xQ5EREFSqThaZ2VNdwA==tTx/qKgZDy9DVqN3ELYFpWuB8FVH7Ybc01mvKMtbWpUHJwhnHoDjUBVNRhHyBZgfTmj7rzF7n9HMQH/brdvEfg==FCk6nKz+YCZgxZB/lS82fWNoxWW5+PRAe5f2Wmnhgdcut5cO+cGJXpNFmpBCxzyvtnhbCvv+mj0JhWo/BE7j2g==002ZtAT9JbHEeRDJ2d7Yib495TviFipaSI/4d89bcgk4n/oziG753B6tK9BBYHo3cm0UsfPZwGgJ6w7giS3ptQ==GYq5DkXq7KkzzzWwgm3yyh2agfbnIyEW4AMK8jUnQ9BhbS7SYOz4dfW7dMoFw2Hx8KtjCqdmRl6IQNhc8b593A==CH5GtgqRnetjV+um0QpmW15qtO2EpN4cloKCOR96rVzPCWKHVLr4iz2fbnJKyoafPumP32KvzWOK7I8wr/IfCA==/TkcWHIJa5jTX3KPnkFNEZOMLEAbzzxxWaNpq/z/fbfhbXxkN5DJZSsMIDVpX2I6NsgSDdu6hMcArPTTyIbPlw==+E4ffL2dph3cDazdIvUMTNkNmQF6CivKP4jOCCeVFv6cpUtK3NSH1WEW6MZW4AsIFmJhpylqUtfGKv0yMN3XhA==uuulT3joB5yLaFDpBVgLPsaUUi7aOxP/P+HhFADWMBMKvSmse+t+MK2xx7uE8iavwXebePjJeYuImC/99Mfq9w==An7jiW5rLfpBAsllWyteFZFB2cjoO3MD+1afHWchQumSQSHneZuNzlxeHrgGh3Pl6eBxcfRM18yT9CfsH6iqvg==QOIsQWdBCLNnGtS6pQLpewf7abgG7LjeipKaSurhA8Q4\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_QwikCityMockProvider_component_goto_cTkWSVfU9vo.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\": {\n      \"exports\": [\"_hW\", \"s_OBdjRsvd4IY\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\"\n      ],\n      \"name\": \"index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\": {\n          \"code\": \"<removed 11442 bytes>\",\n          \"originalLength\": 474,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_OBdjRsvd4IY\"],\n          \"renderedLength\": 11442\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\\\");\\nconst s_OBdjRsvd4IY = async (_evt, form) => {\\n  const [nav] = useLexicalScope();\\n  const formData = new FormData(form);\\n  const params = new URLSearchParams();\\n  formData.forEach((value, key) => {\\n    if (typeof value === \\\"string\\\") params.append(key, value);\\n  });\\n  await nav(\\\"?\\\" + params.toString(), {\\n    type: \\\"form\\\",\\n    forceReload: true\\n  });\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"fdIpxmI7VpIDd7i9pMddOHAWTmrdqj0ElWwPkZxcxTP2r9fWzePNrvAOXDQDbE7f+eGKnkxbRCVXyIVSpbSLnA==JToime4L8mgf+cWu5qbReRI0pwrz58nX6Txe7PS9NJybU50D9hoeBY9TIjp8RFbZ0HfWlQgHIEvOT2cbHp9yOg==YNuiLYc/PxGcc0rtzb0/xFNuNUX0spXD+7FG/f5vCFGN1T2WnDAfx8trk4d2Bb1pIKLsxmUpPYpFnrhrj804LA==u76+boBZehAeQJaJHd7zvA3vTb0XEE64SB3NVdoZUvAYVcNYp2ZfYOKw9KnlZMz5AlK6M05hwnHHdEveSlWQZA==ZnneGPC88/xoANTrmSvCNPcBS+dJlcEudzFHaEwCOvKQZQ09GJTJhN4fHXp7Lau/YxRbnPB4ODLQI7rA8Zn5QA==y74q8CzbTKqSAKMCIRh45ye6y6QwRvXkNR9z5RjfPOUoK4BtsutA/216tOvUxXK+D6iLCRVwXamzBeVKtaDX+w==K0taTvguFGfjzASV5dAA/ErGKJhkFXCHzVIKRS7xq4L4+MAbpl3UYbEIIL11LXZFwoX9RVOP4x69EapaJutxSA==M7THY7RtdVxigu9D66lB+nNLY0UBobsnYC2LP16gstytg722ospAR6N0pRd0kxVyjJW4yWrXKBirmLUMNj3H7Q==y8s+8ZbGqgaMlVgp4PoNxurYGgxvsP/5SRUvq0p0bBOBOBLgEFRFesH8Ae4XYuaxBbRVlX292cCoblzmkpFuuA==ZaSxcoUSDAYgIxAgGDDGP4PVrkrERPHnaNYMKr9DWCon4BmdAPrMgIxZAuqqwLlHuz8Z2UGRaFB4dA0hf59lPQ==Irqax3RWQkBvtXb34iGfD93XlYp5ssAqA7giKRSxm3Nua3sbsw6ZTIzsoCYFaSyLemVKN+n7Nfa2CtPqWweexg==pjwQp4A8jV6+pWhquczUeb4DsfOTHyCAoF6hVQi0TjDwRoIbCTAfWiFFrHs7HOPBsh5Wo3VRTHQaYXMwliawTg==R2ZodaTwd3pfbyJgTIaN423Jg7ysJ63VMAvI0dwVkvAbsz06httFz9/y2FwLLy4MRLJMI7qXD7JXknWJcQORvg==7tWee2huy0wkxsr9ioiaMxTUcMQgASRS3/m4aEfNMJ+3RVnP7K4UKMhw+2+0I472dyGENZx3ibWatuBAUyLXzQ==pqVxGkSb4sC4rFPT32m0SM4FBpDhz5K0gM4gKkUmnX8ySCxValFV5Mwx+M9pY/n0Jxocf8uq/pzAg3wElRa1JA==OA7xO4qOXS/gSy/h2KwaJjGHDimg5oLimtXQ9fKE0XXD2L/J1y/h9Arpl8X/fwICzbPSm/bTtAq2nYGfQas2uw==9p/H1KbKxJvj3V9SP4A1Y2tEbTwisfz6hp2/10r3TCgYqxnkqmktZlwAuaVr1eIHqyK3b47K1deJTilg0R9C0Q==QTo8+gX3sJ3FUI9eZOJPDzRBWqtAOH/IicTX/gGptkDZEjTAAMVF2GbBd6I2oatsPZwwkVBOXR+xTmdl5aKgLw==cplPbPqHX1DKfKsNt9ASE5ZQFOjWOU2V3IxramXfoSsE6qx+Ul/ZPRbOSREqBonREaL5LxIKa0c3hNTgsPOP0g==YGHbPOSfsAjGHgMjhlkjYfu5nwVLoYneebbhJEy4leaW8vbTdTgbKyOdu5eRwOT9rNNp0hgUHqa8FQOq/cbj0Q==M0vsWOMrBEmxIDSg3BYgrAnaPbw8v3dTfPqZgcyAAKLCKQ+NUT4CUwVS7RElETs6GD+QwoCUvkNiRvuYOfkB5A==7JuG+yeKzSOPR+37gg04HcBub93VNNf/J8DUx4hngXjI4V38Hb5gDcjFv+WFbx/WNyyjysDWMaJof/utSAm28A==icWim9+1B1f6D9dq0yxKwNwhHFdFDrDsPU3kicyBEZARNEsPAw4KVDm6IpafJu2Qt4s9mV7YHTWH+rzF9kMy1Q==HvTf0zzaNqss5AX5izOG5Zr97EgZbRwNGslGcsEmVBP3duGXSOAQdqBqf2WSE+o1SclRD8RqiFD9tMFwXKppyA==D5PSw+cbAHhWo4AKhctVWWYnlGjFoHADAQqBvxkoN+y0OUrx6iX0PUOx7yN+pbGTgGyzTqxjyMcMPfdHMAU9MA==WPYgP3AHpmj4CFa1jIlq7JoIQGhrI8hc4Ow38pwlN2WmpeV0F62r3zlyA33TeI2tf0q56XA/AsPCe7Cc7dNlIw==NSTzhWCBzOwaiQRO4ZVFnKb+IsusBiJZDrRpN8PerGqKFOebzwDn+/nLDMA6P51zgFw0+ZDXwyNM1nvJpsvtqg==hbpEOz2JNldWzf9QA7SAiVRYknfWDNN0PvOovR9QBdsWFep324//szADSbsbKRyLgT1vHKtSpBGbwYbSfOY1IA==rgBBRhU5fppTBSy9SjBRxDvycd05xrg/Z4yB303Pod/EgVnRTf1ypHI7exRJKmQAKuIRofr0O3iIU4nbzByQTA==k/y3A0O9Cl64sJChz9WTo6kIqBfU/FNQpLx47s+hio3u79imRrJKnNJMUE6W5o5kuci4/j9NWLYm/4HGsnB8hg==Bia8BA6XgOwfQBVO0L7M1/y6I2mYJBgtb4gUbT9MApWt1Uq0yB64RVdIckLzxu5ROtfnMa+9rlANPA5Nwf/mIQ==Ixsz1w5faGytM0NIBOorNDvYSlREVcFendhf5j7RFM10p8XoYlwU+0iqAlcB7rUrRH58oSKOqOA1L69nYVm9eg==yHp+kM8EQpyf3VE2EHRgniQOU9yg/V8KUYp1S6egvHrzq1UbOzME/xVSmUzgnC/yw1y6z31bvfxTHvX+/1X76A==J5gDizS/xZIln0cQUqA+H9rAbG96PPfXy6QPvB5HbZcdm7f3jsSkZPXmSl/aEhpsvmBrRQ/I9M6uDTuBY3jo2Q==b4qBznipc6fgepuSWRpa3aRI0pmJbC+0U3VEOOja8wQPcJXowNrCRbOP13eg6Y41JOkeN6Omm/4asmjCsSE+Jg==m+ucSCCj19Ek+rxsZCRbmt3axwCbsHXMekGvQ/TqDh5HS+zFVqLibX7b2GC6wFRDleM5+ANdVZbF4UGwMsEglA==HyEcI8JXor5oaKIFFdhEps8UOZb5odVL4g6CuVAJWLZ8CnbssG4s7D5DACiWF97x1wk1kuX8qQKYsj8eKIldfA==KTSLRPSxe8mS0mlwTfGuhFk+OUu+ENrC8DzVzxq93AJuyYXnDW1NcWQlfMQ/QCM11GoUak19xfv0SuvoIwfSuQ==BjjTRrL+BXu1SMgvMqI0QCT2OCUVtvKHh2tVYTHeK7hHouj/0QYXqetW0zu/mTMY2FEHEzV+EtB7Z51+xZ1ajQ==tYg0oL+WBLEmdB7YxUiPxO3iZYQ/dxjtWtyRcFr5+dpJ0twqTWby+GGpH5uxw+mFyy/zW2GNEOk+kypRcRtDkA==I3WLaOjBj23EcJthlYEhJDqJ+oHv79sA1oOUkzFHnvXynn8HwTk6PUINMNEKyyQTi9cB2yXA+PNUyb8Okid3wA==z/OIK1OEDZW1+3EOjChbk9lt2P/A17HeaBEafQik5GCRKReCa1mhoM5RhBOJ43RA1fynGiY/58HgOhVWUM3PRg==v3C6fZAihe+xNdKYkmzy9kbMdUB4aa0Uq7pL/qpTTmduET5K3zYjqaWVBc/loQ6QaHM8ONSVtFd368ExES+lmQ==+4QxsQCjoXh17nmW/Bp3Xu+V6jnnUoOdlKBBeyKjt5UgnxUL3QO/mClqmsV76lVVyriHUaah/621CNk2UxJ3hw==8gRbmwlYR3AcOyUVFN7M4Qbcm3uua8utfkg9bBacAhk8WPbF0UKJ4vHlDq46X0Wwrn4pqslrydRLyzbwtQBuug==TJfvuKHwZ5eAFqaYCMIGFhyGs/lRbS8pwqj1vMB7kuKO/bp78Xc3iPWxWqiZK57gq25SYuEfM2Cqpk7notVqyQ==ab9kN9caJ6doXAY8EEfY+2vYA9Ek6ePhZAEXVkxeLamyYkovtwVsfaqed5MM8ZiaT9qpp2VHF2uJwOeI8w9Ozg==2lAIzFc82No\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\": {\n      \"exports\": [\"s_amqstTwiNo0\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\"],\n      \"name\": \"index.qwik.mjs_GetForm_component_amqstTwiNo0\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\n        \"build/index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\",\n        \"build/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\"\n      ],\n      \"fileName\": \"build/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"y\", \"z\", \"A\", \"B\", \"q\", \"_\", \"n\"],\n        \"build/qwik-city.js\": [\"A\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/preload-helper.js\",\n        \"build/core.js\",\n        \"build/qwik-city.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\": {\n          \"code\": \"<removed 9675 bytes>\",\n          \"originalLength\": 1596,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_amqstTwiNo0\"],\n          \"renderedLength\": 9675\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { y as _restProps, z as _jsxS, A as _fnSignal, B as _IMMUTABLE, q as qrl, _ as _jsxC, n as Slot } from \\\"./core.js\\\";\\nimport { A as useNavigate } from \\\"./qwik-city.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\\\");\\nconst s_amqstTwiNo0 = (props) => {\\n  const rest = _restProps(props, [\\n    \\\"action\\\",\\n    \\\"spaReset\\\",\\n    \\\"reloadDocument\\\",\\n    \\\"onSubmit$\\\"\\n  ]);\\n  const nav = useNavigate();\\n  return /* @__PURE__ */ _jsxS(\\\"form\\\", {\\n    action: \\\"get\\\",\\n    get \\\"preventdefault:submit\\\"() {\\n      return !props.reloadDocument;\\n    },\\n    get \\\"data-spa-reset\\\"() {\\n      return props.spaReset ? \\\"true\\\" : void 0;\\n    },\\n    ...rest,\\n    children: /* @__PURE__ */ _jsxC(Slot, null, 3, \\\"uY_10\\\"),\\n    onSubmit$: [\\n      ...Array.isArray(props.onSubmit$) ? props.onSubmit$ : [\\n        props.onSubmit$\\n      ],\\n      /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_GetForm_component_form_onSubmit_OBdjRsvd4IY.js\\\"), true ? [] : void 0), \\\"s_OBdjRsvd4IY\\\", [\\n        nav\\n      ]),\\n      /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\\\"), true ? [] : void 0), \\\"s_8hsX2DP6YsI\\\")\\n    ]\\n  }, {\\n    action: _IMMUTABLE,\\n    \\\"preventdefault:submit\\\": _fnSignal((p0) => !p0.reloadDocument, [\\n      props\\n    ]),\\n    \\\"data-spa-reset\\\": _fnSignal((p0) => p0.spaReset ? \\\"true\\\" : void 0, [\\n      props\\n    ])\\n  }, 0, \\\"uY_11\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"LRJgxhePQqnxUA7pacyk/TAAdfqd7K39y7gT4rrJiPnY53TQdrnMjTueafJrzzus4yM962gJhidv2QXGibdpfg==L4JzMzCX30fDyFvlClBqjCfldDvfSOtR7LCqG3TtBn5AqKVb0aDalVYjBiwH/wxL0pT+u1I1NMo0vyCB8rwtjg==869z+GnuRwQ+NZlkC0zBzhtOcxQcdOfn+s4bV+ux3+S1K5ZeXPakUgccImMKKSPpZokfbFFR1oR8bHX2W1hVAA==s5utwkCMH1mt9k8P0fUjh6j6ZJtNrgbbEiSsQag05TyHTXDMkllowilQpd1C12XtbYUydV4c8wVfOkw1fPc+3g==BvgxhOLNhJBQtyTPyHwStGK/q6t8jVhsL+n6ucrjjd3GrDVDNAt0QK7IQ2K0Bn8/BjfhjDlponkfpL2PYzl7CA==3gJtyMGDY3s7xf373u2n/xA38qsLtdujTHTUwwa/Ra6+FwY7jAFIjKOSVuxKXSSJdtxbd8kCzZT/uIfQobEQ4g==GyKKs92Ermux+6DqJ1J+aa3In8oQlmblWXXu18b05U6KJkffK8HBkK9FBsriSNaAIFAo4EEbS3ARlzBz9mgzvQ==rizYflrFjF0ye7OkVpRcirs46IBh3ks9CedDd7hkjdIK56ljs3U0p69yBMQvWlMcv35vylQH+b5QrcArRFhtHQ==24aJDpIEiMIH3p/bx6VtwnZztlCdY3ngOq4E6G4DRo76cQBD9PWyCiPZbKAClz9H8wnNzGManeeB77DSYC0Z6A==cLH4+4t5tyV8ak7UAplMNccjMBl3K6oNK0oAGYQiYGQ6Cxrd5d9Qn9npbSwotFH0nZkeUrCptBCbV3WAGVd5jQ==KnmEN9FyvY1SRgIiAFtXiUaW45RnaqZbwiebxht+YNTUyR3c8NF1y2qduwBeGLJDsUnOFMkd8hQhwF2y1kqlww==tWUZcleLaWB4boZgMr8NpkKk+o/pOrORCwpUWHoC9/fS5EvKKt0tZiNkg8TEb0/S+gCpr8Lc7hoBpiEC9WQuZw==i+jkkcuMooBRnhXYatLLoR+4zLTkA5ZhIHC0nJLtTq7UrKwkn/MyUsGCwgWID8QNUTCfi1P7iZkeLF3xZabTWQ==efNvdaxeoNXttvBwvg8/0ShbWqYh6Ij3PHvs900iPBBvAO7g5IJ9dKxGX9uHPB9HiIX0btSwOGskOTCXfFwEMg==xG4hY6HiqBgmPbdUXqnsIuB5wULvlVqXPyjQUmdYccbpWH8MgJ2oDQJ93CVHMXyGpjes39TtxxzB43yyWpHTGQ==0AAiWNE1pVAoSe1ARHXtg6+afue7uaPzOyV5oFufEsaz5At1F1Dc9gSz8qkM1/yBiT8LZ1IM0H1ALSbqB9AmqQ==Dkn0h2Ap8Y26VA2U4xDsF06p2E8iFTTJNlKdKXQwE4CkprwgitgyZfbRJklbOuFVbk8dc0IXag7xD1hn/YxW5A==aI1hIdYvqLEdbgTE5yTF6f44dR1IdhbLayMowy6tgF3xItzsv3FAkR3bMwpGMyF34S4lW1wgiwCqGojO47emiQ==ysGe3fFuT/BX6iYwrFnwerNGSDVYkZKdveHxe7Aywq8sjuvim5rGPp9Tv54tr5mIKbZBMPyATRWsg+rfpOvG9g==TFSDIZQugWtUUagbO2PTNb6C8EVOoJOVyoHnSw7yTUO/LTZLdP19YHMtsQC0pxlYZI6Oe9IaVuujnEIP5j58gA==LDJ6XPICgHzaGYhYsazJbJ1XrLPAnpwyBE5i2WbdkrKlKP3Md6O2AGBguKAnO6dZ2uZb99LxFaqfWf61ba/xAA==61TS638Lh3gzJjnBdj5Mac0hNxPNAkOZe3SWUuoTNcKMi6Qt0uouQhhjF2tdzK8Twqsmifw9zY+So/59e+kQ1g==IDwpmhX9ujaMtIdvkhX+kiRQaOswK00ffLg3tOQenf7PrIr9z7Bq6eNFxsQhoYVJ9uVKeOCkH/j2fYv73yUo7A==GzC8qub5/ShVufb9ctwelr7TTVK7wRXSQ92Y/oKTKesy0YQjA1Y1gi+neMeokLIZBLbJC0FEa/Dn9O8l4nBzhw==e1Vm9IWORLqPYG/ldk0ZdL5SQ4UBa2GoFC7G1j0YYXHuBZWGpCI9T5LuqcMsihPrLsUvJLM97GeRFHKEz5B8pg==9Tla6qvten0pDIzvlJ0dHJtpR6Dzmdhf8qDhUsEbWNx37vFoyVey0hRyuvTRTVQB5rRwhYSt1hpPK5mvvjcQGw==oQsgr9yCeDcXnM392zm41nWb/wDtjs0h8qVMjclmwQsp4B+wYWxvyTvfKxZZ3nH2WyFSOkzPUwNFrpSaiv411g==FidA2ivj/qIU+gLO3dhYFH7ek+whj/+JIm3HopfwztoPAVQNz61F2t1RiUOfJMtM6R782Gu2VtFn/Vrx5njSSg==3Dc0tlcFeNSoDHE24ajvoDISHCxa+muyRSuIuQrRgrNBUnD39H/4yIG40Us+FRAfpxqbfuiAMrAMyCQHszxyBQ==RbhuXPVk2TQ9hjQuVaU/g0MQ8LHgS91ke3PkEpuqJF3fs3f4/O72x5aeZT43woq/ycxCxI+mCMHo8Ig6zHxAMg==F9XkKoorJczZ9NwT34HOAL9hLuLHL9KoviZbj1jqH498ZU5U+766p/JfoDkZ0MKoRf5ZhulW4kc3GTanph3jSw==jrEP8d0RJSsps5xqGa4EkTiedKJODg7auYaCBWgGZHGc9TOWoKUgdFi44KiLLxbu+hoqlwNQQD+SVWnt66q/nQ==Wv0qtY0O3JcPawDB9ZdC/GiJR17rfIQUZfU6oaWIp5slSjPBrlzhqoHP8gb3oWmDjy2ao8dusjHs3cey9wFoyg==tqFHwex1lwjsa+hmbPq7PYPDqpqPGQRE6ti5ZWSzLR99VwNMaoJ/dyPx3CH+zWRDPLzTxJYObOeNT0QHiRl0Cw==/geQ4xBvql9M5fr3gpazcoCLGvQe8A6yxLuDD2/qoSKnvmMuiyes/NIo3l1AqXnp9LK+pjOJsHTFliZ9aqqauA==gn+eQd4a+Zs/2uIICrf2h3MF7wGNqNvef9EngvM5TTLWf7D3jXSGi05Tmue+dCX0lfh3wRkh0Vp9ZGcBC781Yw==4/PSFjLSGMyW8cDAI7ZC1HA5N+9hEfyWB\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_GetForm_component_amqstTwiNo0.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\": {\n      \"exports\": [\"_hW\", \"s_8hsX2DP6YsI\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\"\n      ],\n      \"name\": \"index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\": {\n          \"code\": \"<removed 650 bytes>\",\n          \"originalLength\": 355,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_8hsX2DP6YsI\"],\n          \"renderedLength\": 650\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\\\");\\nconst s_8hsX2DP6YsI = (_evt, form) => {\\n  if (form.getAttribute(\\\"data-spa-reset\\\") === \\\"true\\\") form.reset();\\n  form.dispatchEvent(new CustomEvent(\\\"submitcompleted\\\", {\\n    bubbles: false,\\n    cancelable: false,\\n    composed: false,\\n    detail: {\\n      status: 200\\n    }\\n  }));\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  b as _hW,\\n  s_8hsX2DP6YsI\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_GetForm_component_form_onSubmit_1_8hsX2DP6YsI.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\": {\n      \"exports\": [\"_hW\", \"s_FpLYno2MZMA\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\"\n      ],\n      \"name\": \"index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/qwik-city.js\": [\"F\", \"i\"],\n        \"build/core.js\": [\"b\"],\n        \"build/preload-helper.js\": [],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/preload-helper.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\": {\n          \"code\": \"<removed 7450 bytes>\",\n          \"originalLength\": 546,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_FpLYno2MZMA\"],\n          \"renderedLength\": 7450\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { F as prefetchSymbols, i as loadClientData } from \\\"./qwik-city.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\\\");\\nconst s_FpLYno2MZMA = (_, elm) => {\\n  var _a2;\\n  if ((_a2 = navigator.connection) == null ? void 0 : _a2.saveData) return;\\n  if (elm && elm.href) {\\n    const url = new URL(elm.href);\\n    prefetchSymbols(url.pathname);\\n    if (elm.hasAttribute(\\\"data-prefetch\\\")) loadClientData(url, elm, {\\n      prefetchSymbols: false,\\n      isPrefetch: true\\n    });\\n  }\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"CI6DZG+iZCKEZqTnXgsdCQgxZoojdAQxhAMi3buexNUOaQZOuLouwSVV7A4T4ARXqRPFWJOJtmZl1/MM8v9vrQ==pCJAsn60Orm1yc5upaVhyLjWdlFRoTBLdTrLvyQgOBMRqTcJu0hBqBd8urCy2ARq7uwveLlh8CxeDdWGMNy1Gg==sRn3ruWNBFKdWcgDVKXYCn/jR81LtrzqAGDpLaZeRjkRELOLY8XdkpboI4vOTBUhexHjTnhPQp+Ig+Gtq34amw==xpHu9OZ3Wc3ESLMNq3tD14lYfBtnIIKT1XR8boo1sA1y6Ci/KFbqSee7U1NVvsVdvEM3kBSC6g8XCG0gJfVbmw==V1o2uMgI5HumLHCuQBeO5jzyNnacIez5soAw4suLWXkqE6vGiJmUJgyzmBUcH/PSd4ZbeTcvS/sFAxV9g+gCTQ==a+T/4hIbIv5DCFIa1oHYUGKXXxjYWwRJfG4cQCJHLkrIcmly7m39p1GM3R70XNH/4n99HevwNL4khbmSAK5a9w==ZDxAb8eJmLJVhbVyw1iLkP0SJQPi27Xu1nedHiC/j599NQPQEfYxNvyEw7KINcmrCrpistJKm8w89uw7yqLLGQ==nVQJkq4+v4iA6VJizoIGwfVysyEefGdpZuEcZOnvdKgumt4GMzX0HBQtzjTFQgWEw+Z7O6wKMy7B/AiJz7xseA==CclymcgdX3f7wYfkUf3lmAqH+Nh93BoC1gRPvuynzZyDNbeeff8gpuE2iK7tYZuJkzWv77dhXfmERLuQhNLy0g==98U+MQlzirdHx/po5IGW828LGMW8I7lwm4nMpol20liPDwcV29qySh+QvqaENWJjNEaJFhNHt55ArZUQ4OqZBA==H1mgVUD22n4KQ2pYabUI4+gPo9Ryv+C8dhmUN17sfhW+gVg+VbAA3qYpry3Gftmtc2vg+aCncA3syes4/cRQ/g==/CQeEvgHSY5Qp+8YoIEENd8pqFyNcaVIr1Z7PmRRbGEoIZBNacJZNloMO+tD639myewGFlqDl2j3a2oC9eTvGQ==Ri+sbNrCMuNbBOWSLr7oiWrfCHKip4Cjvv9uIJqRVIjxRtfnX0dKYmVzWRB0vX55oCP5AU4ehUm0cxRZGULbBw==lKyR/9oSxG/QNCb6S7vMCLdDb4he34t4gh1c+RQcWqduZMiDaiBMu5GCDmm0vNESHW05ApqlNe3l66R2ROs5Aw==Woe/YY4ihWpzh/XBCPaCHHCi3TuCdN5EK/kM3Xdf6OnmUgKQQoOd8ivZ/Had0tELSTXi5Q77gvxVHyMq6ahMRA==hwy4z+AcWsL1zTLjU1T3QsBZuqZdHitT5WBWjip+B/0Zx/wkgpc6qFLLfHe9rKUHlFkowqq3WKUTsE+rdUWmIA==Mlyzwf7IrKF4kaaP5ixDslJFwM8t4cNcKzwAa65tSpqAHgfBnSVOvNrmdHo8fC++/RW6PDMtdkgHkebR3//8ZA==dMDZT1TpUb3SZN2oRq6Je4MciBXk1hqKkFnOPI/813vHQeZ7BRKZlrkXjZxQsEAXN18oROWvZU09r6yuqiOEiw==u4lJVeb2hAfmgNdpmGt+C8eOfUwcwV7Fpt4JtzNJKhC53iE0ya0GmuCG0z/5SNOL6Ppc6MJtA2Zd9vkHuIniSA==1daSQytOmfYId4yJh4grZVi0ygiTE0MO3ul5CyAHQz9hd0M1iyR0Jqukx3p1VznwlhoSAwmM/vM8Tzd5hXmCzw==lb45BYUWWmihh/Ovlx6yVKcYnQR+5W8I59xloBdTETo66OVYrtS3CbNUzT3CQt4uMOlffLM8Z3zRVFTJIBud1Q==/vZ2a99GXn+lTFAjsR21e68JMrXmnAy31d56w1595c5RfgaCD9NuCdGTxORWEQXLQ/h/Ic6RAs3+BXU+sznTJg==RP7OtvtCXF7+oBQYG2hEA5QS/JeJ8Qf34lsdiVZqe5rWyGfI47sEEokCXDs47u7q37GLxbmrMBKly/ZOsmmNfw==P0kabNgkfCRBuoBKR7t4aHeXrIZtnHjkDoc6HL+ExNdTZxuTLsKukfWb5jTuzMSK96DcbAHyfMpt1GwUy/nSMw==5mR74Suc1Pa2XYo6wkorLkXw2ky2j0lffWuEz1/cxOsHTnq1aJga7T/CGQGAelvDx/ERcYwq/LEoA3VEWdMU/w==z431SQcDD8fBEy0/LxFVP8VcggqjkFZ3vnKQJ9rPrtvP++PPxOXbIVwyoPPCXQaH/C1LS+/DUs6R4Fos1TDYEg==8ARzo8MU9T0la3SvXP/nreOtaYIBUHF/jBCy1GQnd6wYozq5CUIjd5TZNj9B6+YxfYcN19QHojn7EBsQc7o/RQ==WGH+rdm5PKPha88wFP3qNb2rIR15rT6mc6EzamY+XII0OJUlsGzAn8rdFqOnghdF7k8eDlrRWy0tELtdFIN6uA==QCiiibsF1UWw5BOOVKUBdtIu4apHc2cGwpxTQJxQkApZlsHg3bizlaaTFzudSZd0OS6WW88wxeibe/o+9IcESQ==v1ouWz3GZRmxWnTeGTVnrSdPAj2cr1qlrLikujysurcVcJM8gxg/mMfI7iNOI8cQEk5e1yNFQy2CMWzmUwr2PA==E10Pdj8MAUClJVfX5V8N9ZpLTNw7BMKA6tZISj9b+zA5DdDlXfUii59URaYq7ctJq683aBQdt28RnIJbYnfalg==ilKDDzbEPKz6MLHLlefVVENJnrEwNVl0GCF/8+50iISS1foI4iodKWuWSyJCtQi9wmfqe40Uh9GrE3Zq8YIrSg==tOC4sFSw2/3qeqr+44BKL/UW1PhijDsTDdqW9+ehG/lO1h7mqKXwSe0ubtxTbIrzT5wZjaAAsoJY03PmcT8iYQ==1THylg4tVur87HBXcVV7/7ZzPhwnGzffYklGOkz+/1h9LMQVapbG6ZspJTHSbxjRMxwqO7UqepQ2AFV2r5O0dA==7YiBuRGfisAj8wCUsILDcsDiVJn44tHH99VnByz0Xa3wlNMIQlR2080ES1rsGbnPX1r2/faF3rcpY/qIi03IlA==t874i/W2Ezvd5Wptv2PY982/F5iihqetj7ErzR3aEF7hL15f620XJJwztRcLiC20Fu597g3BdZ362bK6ky/G/Q==0VyOsK9TW8bFr6xZ05FTc1ZfGsnZXQoLgdc/fny3OMdudhEbiDWCUOBYWF4mf3idSa3GY4SBrR/zaUnmDFmueg==D/RN3kbzCm6O6h8JJ74wTPK8k3q+pIXdY7+EbvoWacHDmdhfT+erlADJ/1SABr6SOKk/N6E7szIBn/Ziiwh5HA==TNBMUdR5DmuPXKp9OcActfasGMsOjQcVciyhB0h0eWmM9+D7FQRXt5wcqs0Ah/nY26qRtViovvg3dRFwnjTbzQ==39TAWjmrXfRIAQjcAXszNjWVtfTAdm5CQY+jXMC+GRGZtyb748w5cKSeGvUSBF0InHld+A2vgXelmY7NjvYj0Q==U6MIjVo8RIUkbwIYw2Lj+kH3nmCJzoi8KvORSwQKGOtr1/wobnoW7CePSaz9QebKAqCqjzOkAeR/ef6wIlUN4Q==VTDrw46l3+mPM8EQS/rXURqmXPOMJqFp5yyDdSaTPkKgLG3cAablYoT+awFEucue5Fgqe+j25Y0dJmZKGCB13A==6tvdF6LX0cxGHzC/TL5QooU2sXLS8csF4JeIntypRv3cbAEQA6UYQLSbYUmMSGs272+R2lvSLrO7cgL9tgkaBw==inDOrsiVHV6UIy2lNPAY0/TsSoHY2hKq3Ax6wWyM1Hng3hFIQhVkL2I1atyduOWUx/U+18uEMDLLT/Wr4w33uA==EELen92ROJGhHqBxwYN4NgeX7Tv3QbjI05mcPYsYh3Da6i7cUw5WWbHvyI+r0tcZUWc4oiQ++uWjtPn9j/MyWQ==l4Llm6AK+ON5pcyQMSYAFv/OqNLZd+SpU84wPZT7w/tUX+mCqHuCEgNRFUNX4Zn4ZeMPI5zILzp8uZLvmZa3Ng==nFoEQ3rD5rRHWeKeE27jf2vatU0wtpVwzgjHPHU+d/eB\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\": {\n      \"exports\": [\"_hW\", \"s_WcRKLKMW88U\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\"\n      ],\n      \"name\": \"index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"r\", \"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\": {\n          \"code\": \"<removed 13204 bytes>\",\n          \"originalLength\": 1586,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_WcRKLKMW88U\"],\n          \"renderedLength\": 13204\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope, r as noSerialize } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\\\");\\nconst s_WcRKLKMW88U = (input = {}) => {\\n  const [currentAction, id, loc, state] = useLexicalScope();\\n  let data;\\n  let form;\\n  if (input instanceof SubmitEvent) {\\n    form = input.target;\\n    data = new FormData(form);\\n    if ((input.submitter instanceof HTMLInputElement || input.submitter instanceof HTMLButtonElement) && input.submitter.name) {\\n      if (input.submitter.name) data.append(input.submitter.name, input.submitter.value);\\n    }\\n  } else data = input;\\n  return new Promise((resolve) => {\\n    if (data instanceof FormData) state.formData = data;\\n    state.submitted = true;\\n    state.isRunning = true;\\n    loc.isNavigating = true;\\n    currentAction.value = {\\n      data,\\n      id,\\n      resolve: noSerialize(resolve)\\n    };\\n  }).then(({ result, status }) => {\\n    state.isRunning = false;\\n    state.status = status;\\n    state.value = result;\\n    if (form) {\\n      if (form.getAttribute(\\\"data-spa-reset\\\") === \\\"true\\\") form.reset();\\n      const detail = {\\n        status,\\n        value: result\\n      };\\n      form.dispatchEvent(new CustomEvent(\\\"submitcompleted\\\", {\\n        bubbles: false,\\n        cancelable: false,\\n        composed: false,\\n        detail\\n      }));\\n    }\\n    return {\\n      status,\\n      value: result\\n    };\\n  });\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"wpgG2UGK9JxDoPrviwpGABTh+cAiBQIMHlnlUpUGAdJ8BfjpMIbH7ZIe6VW5N+2fXI8ew+tIG1bxYIRa5O522g==t4EH3T9i0Pj6rCyyQirE9d4OwyqHBVTUmy30xCxlxVdOM5pmrrIGIs2ba/YAk955QVkaiG1/GKKs/N8aRR4XGg==zqKp3SdcGrN0tVnF7rssj4/clb3nsPK280XCzFRgGa/NODfXaenPQxIRC5WvLGNV7INGDy4YOU+yyTaOZVHnQw==ixc0q+fBcmHHqZkLGc0RpNdQN3gSq0ZHjsTgLB8PZ2h+b3TKYq78aeZs5/JlffzJJW2b2vUBG/I0Hszfn9kP6Q==hmmQWG7mHSxuhRyANpTwTsi9rH+Uv57ETy9XoDMmjwjEoR2DZz3toagIYTh5Yn/Zs84VJ+2FOtQ/j6El+M5xxQ==2mmBMH9flB+I5Hn9hhO9MY4EgzO0/0a0qlgnnBWv/+pfCDFN0XBujnCANS4m94kW0jiL8yA+APFxLjvlqDBndQ==RUXxk+PSRgtMb3hICjrIFsfLrnGkkhycyurUssLCXEf1pkNVDk3LdXO0EC7pZiWTqVtOTyYDP6ICijfb4r70Bw==RexO+ygOOqAIR4Ygd0gLY76jrBUsSPmfit1h8mW+RGpTC0Qp8YJzdMb6jpdnnGxbhX5R+0Wg8npgHx0MF3ImGg==vlFvIDfh5L0q+94MFW4tkBlMnP/QEhYtYjvmiQilPPGrF7bohZbpCcOxM9EnpkJodXYKSlpwgHKbiF+SbylS6A==Tdgm8WILAWU8kVcFDmHYeEOIriMJIK9CrXweCpjkaqw2ft9UDskYLOKD3wyNyPhu827GxJ5EZAD9hJCI52QsdQ==U8JnOGI7c/QB2NFIeINRIAELi0tgAQyCuKrcM/QFwFVca+AQf11F7bd+9hXbpeLfpVfKyVzgdmpU0O1Iz+X/0g==OQUc9vVPUEkfcU2ZOjZRjVKvUClmuwfHQwfK559oil+VbAPEfyx0Q1N2Gtd21hCW/3Kr7ih/+xdezgOy5+0aFg==Rg0a78ktuGcSmSsl0mxZtTOz/wOfZh9XG+fHeraXOrK9yaBPdA92wSNj3l5xOhRu5PpnLEBnM/Qe/XJaFLILKA==z2s2vpYLOl1t0rRwGPPJwfEFqUE2tZ1mAG+oOEJL0/QXVFT/ayb49uo6ukIOElmX0eTiobZaJTUVoQ8xq9I8GQ==/ZLlCH4cycbbqErYKIFSiQmPcfr+FYbH7+xkUNmhodYBkLKweI82NiGkO7ak7ZhXBnQ9uWAGZRkNAOOsfJ7Odw==lAJ1dL174YEq/cPo3r4EGmAS3YA08kNUVphJmqfN8aiHKa/aA2LWVQL433WDMdA2oZB8JXon1NfuUHLjQmiWlw==2n9Nui8A9Frs7OJPEep2bk40qgXNRq7cF0X5hPfJH9nTwe1iJmPVNhPW3u9baEtRfmwdMSV1Y+B2DfrJOfPbNA==yS3DKuCaoXmk0adnmRQ6YiHz3a5LaSb43D+QeMFfCeBI/yJC1DoW/836UrfDo6STfl4k3wrQ4wZU66lbi+oQcA==LBSVOyNB+U+jIzLAOrcrmInc8gc8FouFYtsdwUpK3WKqumgkksOtoJbu8d0+aFWitxdZJwDTDCiO9zvWYVKLxw==JYJWZrOtWEO7p1eJMCMJquXE+PX7ozXWURTt/4LyMSZ0JSl3D8G3EW+OJI3QUfA0WlHOtRd9jLpYN40KEMny3w==Mq6Qa3wur3vyJm3qHSiUYlIkriIWyLNYsluUBHHmhN+Sv60uhvgwTFqevxVZtX39P7/7106XrgpXy5hIxyjYJg==0C+PC9qPhbwFP8xauEK1mNlPSfcQq+sD31Zi3LNxMSaEafDZUBcBYdbDwv8FThSX+VTcPsUhqJDb+7J6tAYkjg==SBMzjpMB+zhTyWN0YNSCVq2mL4gnaSKaA3i9NkoXeoTj84V6Hc17QsEmha08jFC2T7EfHydsYwvjluY0WYKitQ==0kSH9du9MFfQVk1Kt53nvJNMb1j3zeM2EIEm+o8Q165AOmknEDDDeYbl2Uw6D7wTm9jcdDx0nk3tw21e5s2Paw==plUpBl8zCeQDCZpdrfgBNmTLXkJg4ZX/y+oKOHZPUBTIVn7zcmtvM23zjso8/BRu7ss7xLdhQH7Onj6C+vfkww==BmTEmE3JuRSM0r0vmaOWn/jk8UYrw/LUG7jIsia41k6rButEt02EeSrP+jfiXCQuEAEQZK7zHLKZ8QUW4TkomA==VZe/+54g4etNbHiFZ9vvv44Wa7mADh6zah2yAnmphYMZCJx0Dr7zc/tI/a8tu4THhX48emlV28D11Rj53uKHJg==o3orPO2Z4l3n2X0NvByAr1MnntXVBlrx/GzLsPqwSjYmlvRq6BOdpEPxjHW/8+wTguX1cPqruR7rX5h9k0pLCA==UFN1LuO8xXzXgHfcHPEcprNBrb4kVauXszr/V/Co8ddXakMOlDR7im/c27JC5ntOJ5ZmfxoaeKhaBoKLbFOSQA==1MCo5ESkyQ5zVwiGwN6ycm7GrDnWFNeTmQk6Kb23xWmoxrhVXl3r8200ZVCMjwqIPUFv8wsJAfJiOTX9Vhqsnw==Sce5qpg0oJDBidRzfZ6nsVnoqoISlOKs3edgKJpzhVJUv/bWgFYv2ZcnK36ea+Ul52ymDXg0fDnj82Wdk/cfrQ==j2XBGFaQla/WoRaGbegWrWBaCsj+tS9r00yqjavfQF9fy5WnFd/kh88CO3KrLS2Zuaz7cTB37uWn3WiOttAvHQ==UWzaK7beKAFVb2Gjyardco0n1uYxRa6TikRSrqldTr16sL5rYLike+6T+oesBoDt13bbjS9UL0PNS02kacx2pQ==cy5EoFjzs6P/K87VUKfJmUsfv9Er5iHbSGQCP3xRDrOZOHx+WkzWNNLqThHmCjXNUBVCQL5iFsE7U9+kl4D/9A==ggd6xR6W08LTiFX2/aqgQDzGqvVYgZmC4MrauDbCXKqJihjYkL7UX203Mezjydk92C8XILX+qQKHmzRG0CAGEg==T/b5sPE75ArfrLAt4JlZfTkblNXsWD9e9vMmCKAQ6b2C0O5SBJ0E+JvBjfRwsGq/x3yKhK2lDPKkvmOb4T1d6g==iDSkpbS+bzfGLF58fWq0EKxFU+5pXyMeZ/nACWkJQmkXPrhKOOOUEjDnD0RJJ2uhwzokILpm3\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_routeActionQrl_action_submit_WcRKLKMW88U.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/layout.js\": {\n      \"exports\": [\"default\", \"head\"],\n      \"facadeModuleId\": \"/src/routes/layout.tsx\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/layout.tsx\"],\n      \"name\": \"layout\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/layout.tsx_layout_component_SHtFir1Ia94.js\"],\n      \"fileName\": \"build/layout.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"c\", \"q\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/layout.tsx\": {\n          \"code\": \"<removed 11604 bytes>\",\n          \"originalLength\": 1806,\n          \"removedExports\": [],\n          \"renderedExports\": [\"default\", \"head\"],\n          \"renderedLength\": 11604\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { c as componentQrl, q as qrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/layout.tsx\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/layout.tsx\\\");\\nconst layout = /* @__PURE__ */ componentQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./layout.tsx_layout_component_SHtFir1Ia94.js\\\"), true ? [] : void 0), \\\"s_SHtFir1Ia94\\\"));\\nconst head = {\\n  title: \\\"Preloader Test\\\"\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"qQSsTjmQWnXgN9GU24m98wTSN25cqiUSsFPUBvw72PC0rgemWDuQ6e08XjqBXZQitZfZel6kEKiHxs9PQ0TdGA==2K5KXBZq3tOEFUFvkgDi/i2aGaUGXWrfOjsGfQKoI/ekA0mFB+ZBXxeDXvkSyHJVwIOETL4Gkxz6bwXDPSlEmA==UXJbMSc60VFwEoHRqpv5sHf+VDxVJTXfN2NPjlRXgvDlM85+1TjbtmmRDmzTMfaGj6w90Uc3mpZRZ+d55ClGHA==+DkNAPU2HQmHL5WX9pxFTn3yllv5NzHvOneJLm7uNvnS7FMrZx+inCjxvou7YbxeXSbf7CjGQYJSxl83h4Lx6g==K7IR/hJSJ/pajcH0glqGDfGemZvzgtRrU9h9KBkFs8DOXskAMkzFd+HO9Sv+n98E+/NAFBHL7iYLV1pxQ/XP/g==ZrUHQZqPg/7CiGMs20lU+1DffeG/NFGZxcWaa+Y/1AxRXk2bDVSBVtA4Q11+4SccFx43rUpVwyTsm4Gy9Ww8uA==gZV1CGLXrR8yORLi0a+ZYRZPI9RBK4RlNA8ZtXf60kLs6SfJSKpjTMbeNgUEBEsW32OSRrjzhOGNMUehFYEXLw==ufc/Smy413XuEyZPHyu4aMZPLRIBKWyDV5YHMQTFOmdjP17dsw9cIY336hIgK5wnOWoaQ/aFe3a4BTnnd1gKIQ==HTOT/5I+ML20pRlUVmX4+lPA55n8KJ8pExx1ToMA59bg5KkvRE+doOw2tZ75CmzNP13GmfxwNx/XoqOkH2tIwg==NfXXgjizb0I/psdXKM0Dr1Wd5i8RCkyF77sPEE9ZV2/aQIhi5boDo9NKZaUKLRfhF1J+kBphoEn/JtRPJYZevQ==UnMdBTVDyIaioEnjr6aI6mjM6cIjoGtGiALnrTqvL9AfZ0egslILtc8FttCmjV6PhcY4wSc8PjmBkSnlZkQMyQ==HYeMSwd/IRCAfu9T8xouW4cBIvjD86sU4Urcj7uAKjovf03Mh8HlagCsjmOyPgm3vIb6/1g5AZ8ppUHQ6LYSAg==pu13RFpHkcNKk/Of61LWiiCsHi28hNhC2ESVVcNTae4gCpZeqwtR+Xi1W/qHKmLTqIQQvQVieynWahLW9q0x6w==Tfc2psL/BUP/MoFwPFLJGm+2wYsAAKKBGQbmVtLZj4SkK4my1AOPMOGlaARjR0LLW2DwMtCTaOoqsj1YnCId+Q==HGhI15prkizlOAbu+SfVMHWblR/WFLL3tkOKG9pJyP3oK/rtyEHIY0tIB5sdnaQkVERYXC7xpqBAgo1CjgQkPA==fiy52YEKKtw/7C4xV25841IgX/+P1jAT8ucYVUW7vChXmK5zpbJryI+tYSeP+VZfZR06NBhe4xsioCmVsTL2Ww==h6MQ3V7JmLAFKtbTJJjslFtZwbeP2SqkNmkVl6eUpzymGtFCwmAiQFYqLUNpfHdn41/QG2atd411FmgYD+LrUw==8iKked8DprQ1fMkA3aYuZ1jFlueRDTmuOFyW+ayO801zRWqbQmoi7ZxgMJCrsn/gJdBmqapUdzFdVBJqSPTVcg==PSkllRQIxqKqrSK0PtJ1YEDa2JUdL77RJg0MXVsXlFf4aXDPmCNgrM7i6M/8YZ/ByEpo8E6+Ut5o94HxIdwoDg==KzH4N33mHJhiF7knfHbp878toDZlGmskxeXm4cL1BDt5kPAV2NbD+IFWL/nVRKXqTu3CqnyRdr9Fk6CnFcfoLQ==Vt83n8GNY29auepi805R1qInrbK3+24p+GzkP/S0A54ruWMjR/p4ujk3cx7pclAZTgDA+RMsFjqcgVJ4V3buZA==zXZagyVby6fdV8wEoU3a3CTBo6VINAnxV5MB/3mqNrjTFwWHFaUS5Xqdcxixntt32UmfE+2TFrT9uMq1EnQ5eA==h0L8ZmX1PTLIw3nLcxjBUgHQa0GLqAaOzfR8PlUM1Qbt2v46m7s6ATBjtjLKm09wOMZ+EdMldeqqHXfEDnlDaA==+Rdc3sDyclpMsaQX5XfkD6qKHxOmig5B/oRzyyuhYH7Zr3VV7D/CA1kkSxu560gvU6anBHXP6qKSnYi6xTyReQ==Opf0vWAd8ftUxOwlVibon1Xwhjc1s6+fzj9m01YUZn6knH4LoVF1HC+UEfy30tY/pUpi+iKLKeDaZsF8CS/DyA==L/JWEuyR+qrCIU04wE8gBoKDcaa5T/HvHqBj/7RFuV4OgGctTRsOvlkpK1Z0vY/1SxL2KDz3bsm4t6jx6pdVcg==he69Tz/4+sFB/np2cCDlQsAy6F29SaiibKya48YRmOxRpBURaIZ7xHtIcUt9FSVIyzfL3jnIjwK6P2uD5EAUXQ==ic9hnwhTZVmTwcckaza1x8/BMFDxgx4gOhOgXbuzY5Ei8PPqsxpl6LTbWbhabZgCgHOTVd2fxYhtjVzoxqYZbQ==4b8RmSJGS8f61iqrWF9HfhBWLdVvknmLZt6lULgwn4FU4nZKlQ/Kfo5ohZ1pTH+TeJEhMBc3E9UEQ+jHj2WSrQ==Y853FxaVJkhjC9nQyJswkuX56O/5DtN6W6hbZX0pbrryNLOnZXvMa/GESJ2i2PlW7INjZQtf/5+satpA8F0Xxw==HjO1oHnaTdtICh9HvXdHRirvdgRPCna5RB4v1Lktl9PquxEKluXYD/2DlkcW0hx6ENXE7izJJH+W9gilH1f9jQ==rMo5SVL81KDnPkqRpynFQEF0hoRSaI6UQxSEchnl7t+UJWbfH05uQDIEHNaIrOChD/CdfSaywzeydHHfBa74Mw==wPYUDbCoHGp5YVUikbXFuulUacZuYXVDgGd0yvcOJoGnZZN6fDhaP+T4N30qEDKjYc/lcjZLFnBpPkJBnEdp8g==jhcs7a2rIp1Ey/sWfaDLP+Kw4WXxJ4iv8XoMn5G9Uo2eS68dsjn+vUyP7dLNYC6evBOLu6XRtdfiXUNXQJKiQg==Phu4tk/HSV2PFPz5PEeugDimX8AYVpwEIJCdYmT5lljzO9suw/w0zDiIUjUPw9dAF+Bxoe8vsDXtFv/WE8iY0A==xBCFog4785Ed53ug7QLSWLkrQW7aT/Nig8u9Yfppo0ZHg6uPJPbwb0zRn3bmMJreBlWUVTQ12OpkvyfP3qZjig==LLkSqAewomtoU3ZPaJRnAE+5pyeNBOSI7DPnfI3XQrtDPdGkepJ/sNCH/EvoylRL5LNiBKavxkeANaFM8Avv3Q==/iuBL2vjIenQ86J2CO9r3qTeRk+SHnnMDVZAp5Xz/Q944aYwhgve4syqyiAWaheAss+eEdHpizVV1/5NUCMWLQ==UKAK0Bi9lqh2DKx63v5xDcVjquUm5+BUk4EHptNS09/oc39e1FctAtM+A2ojMlRqusFqCjj0ZaAe2DLVKl61aA==RycG0K2mCCX5EFnea6l7nxR9vTkEual9F3riSqULL9y3bWHt9xhzpVms3JBLxTC8kHRMry7INX6VRyCGsuLIkw==VR3qEhaRphx2gCZUaxzaVbJLoSWGw5URFXcd++vCwWOYK3hcdjxt/QozhAf3VzPRq5dzHxBhF8tR9UT8zi96kQ==wbKBl9E9IVTrHjg71iwaqIQSt0r4nTBQrctpSvg9Etv1/jut8C0EAvT0uTus7OLkmb9rgjFlN5XJHU14Y+l4fQ==CnULfEkt1KBrOU0/HdnT4gLn6HWhp4VjApS0x1L9fBeY2K0Qvwx2qdH0HUF/HUmk7K45lssc5t+bculIMzAHaQ==ZJy0wYkMx06bvd+8DcR94uz+SLgZEyQLWfAQs4FEFaeWF1pRiqXdHauraaR0EsHUC7ZT7eBXE7MvFhazbzHJog==Oq4qQIW5Nht+dIAHVCU0A4srP9si0ziFirZQc3nzKWqYVY4pUChPvBzoMf+Sv7OYFPqhDsszneH7zhM1IClKTA==/wqeTJnpnJN8RD3AvlEM3FYE1UV03xn/cl8wC7ogN/x60uggxH8iP15y8FvhakQ1Zq2RSoP6gXszEP4mweEupw==f7V5za8S1txnB8/ZvHWeuQ8E86vgtDhq7lC6BkqkVflsL4ifXbxC0Vx8UmJJBlQM4Z/1hvuJ+WwAc9Oyf+oPhA==rmywuACn/wfWRmxqiiwWEaok56ODhZG4NE/9id8oQOcIIx5R6wpUG6pADONIpGKz9diQJloNj56SNVWw9oeLOQ==r6//m/o6QOgkXDeR6nUohI4HtJRaYSkPXPj7ekAaS6zRYzirTwGgw4Nm3J+2A4XudEUosyMvAnBj4TgL\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/layout.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.js\": {\n      \"exports\": [\"_auto_getLibA\", \"_auto_getLibB\", \"default\", \"head\"],\n      \"facadeModuleId\": \"/src/routes/index.tsx\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/index.tsx\"],\n      \"name\": \"index\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\n        \"build/src-vendor-lib-libA.ts.js\",\n        \"build/src-vendor-lib-libB.ts.js\",\n        \"build/index.tsx_routes_component_vG0UuU4cNCg.js\"\n      ],\n      \"fileName\": \"build/index.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"c\", \"q\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/index.tsx\": {\n          \"code\": \"<removed 882 bytes>\",\n          \"originalLength\": 1954,\n          \"removedExports\": [],\n          \"renderedExports\": [\"default\", \"head\", \"_auto_getLibA\", \"_auto_getLibB\"],\n          \"renderedLength\": 882\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { c as componentQrl, q as qrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/index.tsx\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/index.tsx\\\");\\nconst getLibA = () => __vitePreload(() => import(\\\"./src-vendor-lib-libA.ts.js\\\"), true ? [] : void 0);\\nconst getLibB = () => __vitePreload(() => import(\\\"./src-vendor-lib-libB.ts.js\\\"), true ? [] : void 0);\\nconst index = /* @__PURE__ */ componentQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_routes_component_vG0UuU4cNCg.js\\\"), true ? [] : void 0), \\\"s_vG0UuU4cNCg\\\"));\\nconst head = {\\n  title: \\\"Home - Preloader Test\\\",\\n  meta: [\\n    {\\n      name: \\\"description\\\",\\n      content: \\\"Welcome to the Preloader Test application\\\"\\n    }\\n  ]\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  getLibA as _auto_getLibA,\\n  getLibB as _auto_getLibB,\\n  index as default,\\n  head\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index2.js\": {\n      \"exports\": [\"default\", \"head\"],\n      \"facadeModuleId\": \"/src/routes/about/index.tsx\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/about/index.tsx\"],\n      \"name\": \"index\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/index.tsx_about_component_m7u9ARcfDGU.js\"],\n      \"fileName\": \"build/index2.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"c\", \"q\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/about/index.tsx\": {\n          \"code\": \"<removed 662 bytes>\",\n          \"originalLength\": 1898,\n          \"removedExports\": [],\n          \"renderedExports\": [\"default\", \"head\"],\n          \"renderedLength\": 662\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { c as componentQrl, q as qrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/about/index.tsx\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/about/index.tsx\\\");\\nconst index = /* @__PURE__ */ componentQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_about_component_m7u9ARcfDGU.js\\\"), true ? [] : void 0), \\\"s_m7u9ARcfDGU\\\"));\\nconst head = {\\n  title: \\\"About - Preloader Test\\\",\\n  meta: [\\n    {\\n      name: \\\"description\\\",\\n      content: \\\"Learn about the Preloader Test application and its features\\\"\\n    }\\n  ]\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  index as default,\\n  head\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index2.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index3.js\": {\n      \"exports\": [\"default\", \"head\", \"useFormAction\"],\n      \"facadeModuleId\": \"/src/routes/form/index.tsx\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": false,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/form/index.tsx\"],\n      \"name\": \"index\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/index.tsx_form_component_ds9jIPT1g9s.js\"],\n      \"fileName\": \"build/index3.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/qwik-city.js\": [\"O\"],\n        \"build/core.js\": [\"c\", \"q\", \"J\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/preload-helper.js\",\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/src/routes/form/index.tsx\": {\n          \"code\": \"<removed 735 bytes>\",\n          \"originalLength\": 3445,\n          \"removedExports\": [],\n          \"renderedExports\": [\"useFormAction\", \"default\", \"head\"],\n          \"renderedLength\": 735\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { O as routeActionQrl } from \\\"./qwik-city.js\\\";\\nimport { c as componentQrl, q as qrl, J as _noopQrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/form/index.tsx\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/form/index.tsx\\\");\\nconst useFormAction = routeActionQrl(/* @__PURE__ */ _noopQrl(\\\"s_DHfw8GZWF6Q\\\"));\\nconst index = /* @__PURE__ */ componentQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_form_component_ds9jIPT1g9s.js\\\"), true ? [] : void 0), \\\"s_ds9jIPT1g9s\\\"));\\nconst head = {\\n  title: \\\"Contact Form - Preloader Test\\\",\\n  meta: [\\n    {\\n      name: \\\"description\\\",\\n      content: \\\"Contact form for the Preloader Test application\\\"\\n    }\\n  ]\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  index as default,\\n  head,\\n  useFormAction\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index3.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\": {\n      \"exports\": [\"s_EMGw8L1tB9Y\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/qwik/packages/qwik-city/lib/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\"],\n      \"name\": \"index.qwik.mjs_spaInit_event_EMGw8L1tB9Y\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\": {\n          \"code\": \"<removed 6295 bytes>\",\n          \"originalLength\": 5912,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_EMGw8L1tB9Y\"],\n          \"renderedLength\": 6295\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\\\");\\nconst s_EMGw8L1tB9Y = (_, el) => {\\n  const win = window;\\n  const spa = \\\"_qCitySPA\\\";\\n  const initPopstate = \\\"_qCityInitPopstate\\\";\\n  const initAnchors = \\\"_qCityInitAnchors\\\";\\n  const initVisibility = \\\"_qCityInitVisibility\\\";\\n  const initScroll = \\\"_qCityInitScroll\\\";\\n  if (!win[spa] && !win[initPopstate] && !win[initAnchors] && !win[initVisibility] && !win[initScroll]) {\\n    const currentPath = location.pathname + location.search;\\n    const historyPatch = \\\"_qCityHistoryPatch\\\";\\n    const bootstrap = \\\"_qCityBootstrap\\\";\\n    const scrollEnabled = \\\"_qCityScrollEnabled\\\";\\n    const debounceTimeout = \\\"_qCityScrollDebounce\\\";\\n    const scrollHistory = \\\"_qCityScroll\\\";\\n    const checkAndScroll = (scrollState) => {\\n      if (scrollState) win.scrollTo(scrollState.x, scrollState.y);\\n    };\\n    const currentScrollState2 = () => {\\n      const elm = document.documentElement;\\n      return {\\n        x: elm.scrollLeft,\\n        y: elm.scrollTop,\\n        w: Math.max(elm.scrollWidth, elm.clientWidth),\\n        h: Math.max(elm.scrollHeight, elm.clientHeight)\\n      };\\n    };\\n    const saveScrollState = (scrollState) => {\\n      const state = history.state || {};\\n      state[scrollHistory] = scrollState || currentScrollState2();\\n      history.replaceState(state, \\\"\\\");\\n    };\\n    saveScrollState();\\n    win[initPopstate] = () => {\\n      var _a2, _b;\\n      if (win[spa]) return;\\n      win[scrollEnabled] = false;\\n      clearTimeout(win[debounceTimeout]);\\n      if (currentPath !== location.pathname + location.search) {\\n        const getContainer2 = (el2) => el2.closest(\\\"[q\\\\\\\\:container]\\\");\\n        const link = (_a2 = getContainer2(el)) == null ? void 0 : _a2.querySelector(\\\"a[q\\\\\\\\:link]\\\");\\n        if (link) {\\n          const container = getContainer2(link);\\n          const bootstrapLink = link.cloneNode();\\n          bootstrapLink.setAttribute(\\\"q:nbs\\\", \\\"\\\");\\n          bootstrapLink.style.display = \\\"none\\\";\\n          container.appendChild(bootstrapLink);\\n          win[bootstrap] = bootstrapLink;\\n          bootstrapLink.click();\\n        } else location.reload();\\n      } else if (history.scrollRestoration === \\\"manual\\\") {\\n        const scrollState = (_b = history.state) == null ? void 0 : _b[scrollHistory];\\n        checkAndScroll(scrollState);\\n        win[scrollEnabled] = true;\\n      }\\n    };\\n    if (!win[historyPatch]) {\\n      win[historyPatch] = true;\\n      const pushState = history.pushState;\\n      const replaceState = history.replaceState;\\n      const prepareState = (state) => {\\n        if (state === null || typeof state === \\\"undefined\\\") state = {};\\n        else if ((state == null ? void 0 : state.constructor) !== Object) state = {\\n          _data: state\\n        };\\n        state._qCityScroll = state._qCityScroll || currentScrollState2();\\n        return state;\\n      };\\n      history.pushState = (state, title, url) => {\\n        state = prepareState(state);\\n        return pushState.call(history, state, title, url);\\n      };\\n      history.replaceState = (state, title, url) => {\\n        state = prepareState(state);\\n        return replaceState.call(history, state, title, url);\\n      };\\n    }\\n    win[initAnchors] = (event) => {\\n      if (win[spa] || event.defaultPrevented) return;\\n      const target = event.target.closest(\\\"a[href]\\\");\\n      if (target && !target.hasAttribute(\\\"preventdefault:click\\\")) {\\n        const href = target.getAttribute(\\\"href\\\");\\n        const prev = new URL(location.href);\\n        const dest = new URL(href, prev);\\n        const sameOrigin = dest.origin === prev.origin;\\n        const samePath = dest.pathname + dest.search === prev.pathname + prev.search;\\n        if (sameOrigin && samePath) {\\n          event.preventDefault();\\n          if (dest.href !== prev.href) history.pushState(null, \\\"\\\", dest);\\n          if (!dest.hash) {\\n            if (dest.href.endsWith(\\\"#\\\")) window.scrollTo(0, 0);\\n            else {\\n              win[scrollEnabled] = false;\\n              clearTimeout(win[debounceTimeout]);\\n              saveScrollState({\\n                ...currentScrollState2(),\\n                x: 0,\\n                y: 0\\n              });\\n              location.reload();\\n            }\\n          } else {\\n            const elmId = dest.hash.slice(1);\\n            const elm = document.getElementById(elmId);\\n            if (elm) elm.scrollIntoView();\\n          }\\n        }\\n      }\\n    };\\n    win[initVisibility] = () => {\\n      if (!win[spa] && win[scrollEnabled] && document.visibilityState === \\\"hidden\\\") saveScrollState();\\n    };\\n    win[initScroll] = () => {\\n      if (win[spa] || !win[scrollEnabled]) return;\\n      clearTimeout(win[debounceTimeout]);\\n      win[debounceTimeout] = setTimeout(() => {\\n        saveScrollState();\\n        win[debounceTimeout] = void 0;\\n      }, 20\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_spaInit_event_EMGw8L1tB9Y.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\": {\n      \"exports\": [\"s_bp3n7NtzXfs\"],\n      \"facadeModuleId\": \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\"],\n      \"name\": \"index.qwik.mjs_Link_component_bp3n7NtzXfs\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\n        \"build/index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\",\n        \"build/index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\"\n      ],\n      \"fileName\": \"build/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"C\", \"g\", \"z\", \"q\", \"_\", \"n\"],\n        \"build/qwik-city.js\": [\"A\", \"H\", \"I\", \"J\", \"K\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/preload-helper.js\",\n        \"build/core.js\",\n        \"build/qwik-city.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\": {\n          \"code\": \"<removed 2914 bytes>\",\n          \"originalLength\": 2657,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_bp3n7NtzXfs\"],\n          \"renderedLength\": 2914\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { C as untrack, g as _qrlSync, z as _jsxS, q as qrl, _ as _jsxC, n as Slot } from \\\"./core.js\\\";\\nimport { A as useNavigate, H as useLocation, I as getClientNavPath, J as shouldPrefetchData, K as shouldPrefetchSymbols } from \\\"./qwik-city.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/qwik/packages/qwik-city/lib/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\\\");\\nconst s_bp3n7NtzXfs = (props) => {\\n  const nav = useNavigate();\\n  const loc = useLocation();\\n  const { onClick$, prefetch: prefetchProp, reload, replaceState, scroll, ...linkProps } = /* @__PURE__ */ (() => props)();\\n  const clientNavPath = untrack(() => getClientNavPath({\\n    ...linkProps,\\n    reload\\n  }, loc));\\n  linkProps.href = clientNavPath || props.href;\\n  const prefetchData = untrack(() => !!clientNavPath && prefetchProp !== false && prefetchProp !== \\\"js\\\" && shouldPrefetchData(clientNavPath, loc) || void 0);\\n  const prefetch = untrack(() => prefetchData || !!clientNavPath && prefetchProp !== false && shouldPrefetchSymbols(clientNavPath, loc));\\n  const handlePrefetch = prefetch ? /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_Link_component_handlePrefetch_FpLYno2MZMA.js\\\"), true ? [] : void 0), \\\"s_FpLYno2MZMA\\\") : void 0;\\n  const preventDefault = clientNavPath ? _qrlSync((event, target) => {\\n    if (!(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) event.preventDefault();\\n  }, \\\"(event,target)=>{if(!(event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)){event.preventDefault();}}\\\") : void 0;\\n  const handleClick = clientNavPath ? /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.qwik.mjs_Link_component_handleClick_gZBt5yIBEB4.js\\\"), true ? [] : void 0), \\\"s_gZBt5yIBEB4\\\", [\\n    nav,\\n    reload,\\n    replaceState,\\n    scroll\\n  ]) : void 0;\\n  return /* @__PURE__ */ _jsxS(\\\"a\\\", {\\n    \\\"q:link\\\": !!clientNavPath,\\n    ...linkProps,\\n    \\\"data-prefetch\\\": prefetchData,\\n    children: /* @__PURE__ */ _jsxC(Slot, null, 3, \\\"uY_5\\\"),\\n    onClick$: [\\n      preventDefault,\\n      onClick$,\\n      handleClick\\n    ],\\n    onMouseOver$: [\\n      linkProps.onMouseOver$,\\n      handlePrefetch\\n    ],\\n    onFocus$: [\\n      linkProps.onFocus$,\\n      handlePrefetch\\n    ],\\n    // Don't prefetch on visible in dev mode\\n    onQVisible$: [\\n      linkProps.onQVisible$,\\n      handlePrefetch\\n    ]\\n  }, null, 0, \\\"uY_6\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"JwJKyrm6PEVQJuWMTvfX2SGfU8+sG8LomOtJTDL6JmzmILXlZjzgbZ2HWLwA1f2+qzO0PA86qadGcxObZ9iiNw==e1brRJCDN88YxpOKW7IVk8JMGAZzyNjx7Xo1rudCjDdEEUCE0IIAQybuSVBxQ/zD9zYNbEiuwB936lwU4w95mA==xvhgULy3vpxrgfiFkijJ12WxcK8rlLs/VzDqyHEmFq6u49/Pq5UeXVCRsuk/YCZCwJTRVOcYMair6G4afMmC0A==sPoYRQb5WvSFJHIdHmW3/BpMX8US/LQ6bENz8kYlWs8iGVXNNNlTrL8jRWwzzwDGKNgSJDFdOf7YYAQciLWfgw==j03ohuASU/ba4I5+YWq7VVUKBLJqeoJdlqmHXTsCY6O/VRbT6nPl63Lgj59js2nLklrkqTe817LrdcACD+gJGA==\\\");\\nexport {\\n  s_bp3n7NtzXfs\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.qwik.mjs_Link_component_bp3n7NtzXfs.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_about_component_useStyles_WOcPLNnm2is.js\": {\n      \"exports\": [\"s_WOcPLNnm2is\"],\n      \"facadeModuleId\": \"/src/routes/about/index.tsx_about_component_useStyles_WOcPLNnm2is.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/about/index.tsx_about_component_useStyles_WOcPLNnm2is.js\"],\n      \"name\": \"index.tsx_about_component_useStyles_WOcPLNnm2is\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.tsx_about_component_useStyles_WOcPLNnm2is.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"/src/routes/about/index.tsx_about_component_useStyles_WOcPLNnm2is.js\": {\n          \"code\": \"<removed 1161 bytes>\",\n          \"originalLength\": 630,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_WOcPLNnm2is\"],\n          \"renderedLength\": 1161\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/about/index.tsx_about_component_useStyles_WOcPLNnm2is.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/about/index.tsx_about_component_useStyles_WOcPLNnm2is.js\\\");\\nconst s_WOcPLNnm2is = `\\n    .about-container {\\n      max-width: 42rem;\\n      margin: 0 auto;\\n    }\\n\\n    .title {\\n      font-size: 1.875rem;\\n      font-weight: bold;\\n      margin-bottom: 1rem;\\n    }\\n\\n    .content {\\n      font-size: 1rem;\\n      line-height: 1.5;\\n    }\\n\\n    .paragraph {\\n      margin-bottom: 1rem;\\n    }\\n\\n    .subtitle {\\n      font-size: 1.5rem;\\n      font-weight: bold;\\n      margin-top: 1.5rem;\\n      margin-bottom: 0.75rem;\\n    }\\n\\n    .feature-list {\\n      list-style-type: disc;\\n      padding-left: 1.25rem;\\n      margin-bottom: 1rem;\\n    }\\n\\n    .feature-list li {\\n      margin-bottom: 0.5rem;\\n    }\\n  `;\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"FtfbHwMeTmFiKXow0vTDqaw9XjTU5KOKqUIMTFd+H7zVzY3PHCnrtOKJZ/Qam/F0XFiwAY5EDJVZQ35bUAKQ6A==/thkvVusR+DfFxowti/MeYNco9A0jfNkmoN44yVbSirZ7T0r1VNX+j0oR4cZTC5XqgErTvKErms2Xu1x2dS+mA==\\\");\\nexport {\\n  s_WOcPLNnm2is\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_about_component_useStyles_WOcPLNnm2is.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_about_component_m7u9ARcfDGU.js\": {\n      \"exports\": [\"s_m7u9ARcfDGU\"],\n      \"facadeModuleId\": \"/src/routes/about/index.tsx_about_component_m7u9ARcfDGU.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/about/index.tsx_about_component_m7u9ARcfDGU.js\"],\n      \"name\": \"index.tsx_about_component_m7u9ARcfDGU\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/index.tsx_about_component_useStyles_WOcPLNnm2is.js\"],\n      \"fileName\": \"build/index.tsx_about_component_m7u9ARcfDGU.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"h\", \"a\", \"q\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/about/index.tsx_about_component_m7u9ARcfDGU.js\": {\n          \"code\": \"<removed 2329 bytes>\",\n          \"originalLength\": 1804,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_m7u9ARcfDGU\"],\n          \"renderedLength\": 2329\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { h as useStylesQrl, a as _jsxQ, q as qrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/about/index.tsx_about_component_m7u9ARcfDGU.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/about/index.tsx_about_component_m7u9ARcfDGU.js\\\");\\nconst s_m7u9ARcfDGU = () => {\\n  useStylesQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_about_component_useStyles_WOcPLNnm2is.js\\\"), true ? [] : void 0), \\\"s_WOcPLNnm2is\\\"));\\n  return /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n    class: \\\"about-container\\\"\\n  }, [\\n    /* @__PURE__ */ _jsxQ(\\\"h1\\\", null, {\\n      class: \\\"title\\\"\\n    }, \\\"About Preloader Test\\\", 3, null),\\n    /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n      class: \\\"content\\\"\\n    }, [\\n      /* @__PURE__ */ _jsxQ(\\\"p\\\", null, {\\n        class: \\\"paragraph\\\"\\n      }, \\\"This application demonstrates the preloading capabilities of Qwik. It shows how Qwik can efficiently load only the necessary JavaScript code when needed, resulting in faster page loads and better performance.\\\", 3, null),\\n      /* @__PURE__ */ _jsxQ(\\\"h2\\\", null, {\\n        class: \\\"subtitle\\\"\\n      }, \\\"Features\\\", 3, null),\\n      /* @__PURE__ */ _jsxQ(\\\"ul\\\", null, {\\n        class: \\\"feature-list\\\"\\n      }, [\\n        /* @__PURE__ */ _jsxQ(\\\"li\\\", null, null, \\\"Route-based code splitting\\\", 3, null),\\n        /* @__PURE__ */ _jsxQ(\\\"li\\\", null, null, \\\"Form handling with validation\\\", 3, null),\\n        /* @__PURE__ */ _jsxQ(\\\"li\\\", null, null, \\\"Toggle between native links and Qwik Link components\\\", 3, null),\\n        /* @__PURE__ */ _jsxQ(\\\"li\\\", null, null, \\\"Responsive design with CSS\\\", 3, null)\\n      ], 3, null),\\n      /* @__PURE__ */ _jsxQ(\\\"p\\\", null, {\\n        class: \\\"paragraph\\\"\\n      }, \\\"Feel free to explore the different pages and observe how Qwik handles navigation and form interactions efficiently.\\\", 3, null)\\n    ], 3, null)\\n  ], 3, \\\"xE_0\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"IxPSpht6t+WQ4/2aAWkqh+GfDKpcrBNALlm5TYjJQYjQGXxtWUJrRSF+jn9Xu8NoM9t/OAiBz4nfdKQHbdoGNA==xWEQyoPjB1xdKy9uPlkf0HsMHIh2kAh1PLkmZvVlakE+AzlV0bvfkj1hJzxIHGvHoyNJDrmXxfsfG5y1h/HS3Q==rF74crDYflEZLdFYh5jL2llFram8sad0u6JeXTJ+DgWHqHbpKR1WnNnbvyGzrMw+4OC5uLpYApqJFp9MSCBnRQ==\\\");\\nexport {\\n  s_m7u9ARcfDGU\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_about_component_m7u9ARcfDGU.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\": {\n      \"exports\": [\"s_MOLFIZOhXmE\"],\n      \"facadeModuleId\": \"/src/routes/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\"],\n      \"name\": \"layout.tsx_layout_component_useStyles_MOLFIZOhXmE\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"/src/routes/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\": {\n          \"code\": \"<removed 1233 bytes>\",\n          \"originalLength\": 798,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_MOLFIZOhXmE\"],\n          \"renderedLength\": 1233\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\\\");\\nconst s_MOLFIZOhXmE = `\\n    .layout {\\n      min-height: 100vh;\\n      display: flex;\\n      flex-direction: column;\\n    }\\n    \\n    .header {\\n      background-color: #1f2937;\\n      color: white;\\n      padding: 1rem;\\n    }\\n\\n    .container {\\n      max-width: 1200px;\\n      margin: 0 auto;\\n      padding: 0 1rem;\\n    }\\n\\n    .nav-container {\\n      display: flex;\\n      justify-content: space-between;\\n      align-items: center;\\n    }\\n\\n    .nav {\\n      display: flex;\\n      gap: 1rem;\\n    }\\n\\n    .nav a {\\n      color: white;\\n      text-decoration: none;\\n    }\\n\\n    .nav a:hover {\\n      color: #d1d5db;\\n    }\\n\\n    .toggle-label {\\n      display: flex;\\n      align-items: center;\\n      gap: 0.5rem;\\n    }\\n\\n    .toggle-text {\\n      font-size: 0.875rem;\\n    }\\n\\n    .main {\\n      flex-grow: 1;\\n    }\\n  `;\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"hMvLkKpni0W2DXlQUzeGxVLgQtn/ZWVNuZ/ib2RSr4jyXqTTarE5k6p2oaI/Gpdh5l607OXwAa8wuROHj79aRQ==\\\");\\nexport {\\n  s_MOLFIZOhXmE\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\": {\n      \"exports\": [\"s_eevMxFvmCM8\"],\n      \"facadeModuleId\": \"/src/routes/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\n        \"/src/routes/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\"\n      ],\n      \"name\": \"layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\": {\n          \"code\": \"<removed 4172 bytes>\",\n          \"originalLength\": 216,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_eevMxFvmCM8\"],\n          \"renderedLength\": 4172\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\\\");\\nconst s_eevMxFvmCM8 = (_, elm) => {\\n  const [isSPA] = useLexicalScope();\\n  return isSPA.value = elm.type == \\\"number\\\" ? elm.valueAsNumber : elm.checked;\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"CF3/swXhRJEIiouslPvdjfVTqY6OjyJh0KHcBSDMzdMtdZxLX9gnEKx9QFzyEAtvgW6a/3HZSalGcnZvZMpl/g==TQ3Ek98xt7mLx/8u/EQsWg5yjVdl4r/2o37NHyWiYKkdGs2tlpKyRDEAKRy5vJ6EY47F/TdEuiTHK1LMA9g+mg==stoI/hbx4+1iBr0AYtnaHgum8/IjGph9RbEqm2QtPw40nMIBBI7OPZEJmD2pNGZHKyUnTxYLPOu+mU8Y3Obp9A==xmWcBXMWpCv82fL8UzhuglJWL5jQd+WGXGb9NVup7tQKEdRT9QckUXs80KIh3P9heqU75vxdAyHy00PJYDX/gQ==FyShB6khhLViYhcPhtXbb6Ao8+398G3HyYnnIkkuCnGZ32HrAlM+AD8RVMXf0+n23JAAUjO4j3jZycfeXHfYgg==ekzD2aIr56T/IBIxHmyeKqy7q2+90K7/RS+JqnYdZxTKa6dqDWL12dwqUUsnJkPT3brjsQW/WsWmZn8F7TMrrQ==tYyHuj2wxlZixYzLTVHOrKsoJ0wrdR4YZLxzagJxkc5gcH0YC6J5swPJk11UCAHmkZhyAMNsHuo63ZPl17a1wQ==/1bDgf8fpWQaBrx28fhK7AUGmXO6EDDwkZLvD/Om+p4PiDXzIj3KN50YvhzDyU3tCIJl7sf+frVuM32f/1+Rcg==i42TaJG09vxKQ2hwHK+gUjoyaj3VzYY1boUpDuJyxKiLJhNuvraNJaX9O7XymyRpk7RSzYkihWxcMSiyP7Rupw==wwvmQWnmebfm47abGfk30gzz2vxaYe7e+2+Psajn/l7tTtXp1tqgDVEjGWFGV+LgZyW3JLzOUnqqVPq+jlOcKw==uaycFwKv++pA3nTpfHa/tf6u2/thrOl95JlNaC6FzlFWANXMpb4aVHyWrEFTFkRuPmMvvXgzDea5HQ0tX3zXoQ==FEfUdlGjLzXBpr+KuAEJDrgGNUfKblF4k2/0f1mchbFEGVbx50HXT5MfalcnN8t1WHpPf2V187PRa7+DgKVIYQ==sT3HLVYtva1/+UI1WJQal891JYQA0WDkbiMWNMBeno8K9WjytAlgZbj2c0HBRkSR2iPOxgOKxM7pRu9vLjMjSg==yZR151EOaxQnTj7zfTGBQcN19cBgw8CX7N8qaD7qYk11L9mrG8DCN1Nvv+iR/wCvE7WWGOcnapeufecTm4ND+Q==zR5SCQHREkC4XYgkTI8PtIVKZoWexhszA/GK9SxDbehhEZ2ZGs/dcGg0PmYgbQVvmFUmIydbdMICq+lK6O5w8w==utAS5dAQJ8iV2utKZylfrJdAApnd00Ts8hI2BL3XJworss0UoV/ir7rkQDWH2Ze2IiulaotYrRSBReij/SnE7Q==J47pcZbQ8z9FP/CtGcvGPbZxlb5WemQZXHbHzOkN4TTbMoOM8fwsJwY7T267qL2BKhwZeWQM5SGfYd6ZyGdbWA==IQb+8ppmkVEPVct3yQWmRMf3Ja4IDjot3k7bppYnaMYRqNcNlupaTWz5Of1lnbEO/cvXsV47sh1VHy5dpC6QYQ==UOPs3GpfIDmVARJj2oRrVVNpqEhUIhSPTrbYYFkTupiH+wupl6z8RLl8E2tVoUwSJhozbwTS95WKoVg2W7w+oA==zfjTaiWSjkGYtqqs7VG80dhgcyFLOjumSCII1eP/DBgVqvwek8M/QR4n2trnByMIbnh4EZ6ESxKTVwhzq5NDQQ==NRbsLGD7JRmfBH02qqEaTjvrVGR5uAV3tib2VbYwNYinuzz79dtEi98GSr16fUSX1OElHYap2ezbwEBuVA7Y4g==k87oU8/PjOwj0NxrlxUtj4RMZARmFiAkESmBKeGQPaPBV22izWZv0CNb6yRO6a25lGhNQIlUXYQ9eQgXIV4aFw==ySjfIqAbeVCt4G9HQHukqIv0k7wrbCWXZeR3XpRzzbXstUuJ2fMpYqnNnodiFEhKaTjCNnFNt26yMBlwBOhUNg==LFQ7bdk7+HPV8llRrjjvvfP0ycWdJBvaLGnOzlWxlitqwLW3eHInLTi9kTCAIErB4v0oytfdCfMi0ZlBqJO8Ow==WJllvqfV7kkjskGC3O1iM0GOIq/4KNKuz0sU/UOIf62UTZhJXHSCdA3PtUWL34OpYpvCRbvzpc5H20Gth3VGTw==nUQ2hZNBqqVH95hSG2Ai4p9iuI67cRrm15sIguy4s1J2sqZOhb/r/Pz/dmrDiPXYWMRVgSApj3jrnUfNykzOUw==IDiJeYZ1w0xyhAjL9d821rEIgcV0CwyKw9b2NF/6dXpguV0JtCQnXAbTaGqiEpTjFNc1E1NQn5ExRk3VT9icMA==fH1b140h1qaTAUsHzK3N+o/qesu4KyTb5VWjExlKQiJWuT7p4HSDVI5EuuDFX4NlMNn2ZrYl3WlYGSzFxju11Q==xEyXrUkLZlFHtP+YLy9YFiT1IRyn6DTRnW9JkeOdAROdc+imolUSN7Yzf3c0j8BDccXCdBdCE2bnUL2Uqb388g==SzB6A/wm45+LuRdy5A6teOaqXWdFemNK2tJW8cnQYq9l+q+WuJQfK8fLPEZg2sEIaiJkDBmNSPkCL3vxPwuqVA==b4OEMuyMgPn+6iPCg1jbPRmE8OcQcO98NxKdeXoaHytP5LlhTKrhj6m336vB3ei5Jc6w3PFzWYnPObHy+U5zTg==7x+bJSqomcmEbRCnaIkthSstoV96FytDMrHcjFxeE+vWIGzUe1Ca7F7u17+oxxsGJEvXrRQBziXYlFuEzPROwQ==ZWO3828orRO0VNaozlejJ7Lkm9dGCtyqZmahO/YNSYVsC+sXZhdE+SqhvAKzli1NBxK2QikcTfG48hI2nOJSRA==A1AaIF+aX8ZW1S/ycLFyC5t8A3fVG8ajxGmF2n5lX3mKuAh2cJM4Qa6xM/SuIh/n8ZeqpXbNW1raEaROT/ffng==XIx+i4240LAUuMRaT1Uykgg880996k3N1OFToKPUIbZEuPIN0SiQjGi1lEqfeS9B40LxV7Xkgpima4LNeoB14Q==uAlmTAV4UIXu0DBIfL3Nvr5U5QLpkCdGeegLfqezf6fnKeN5lMPVR53bhJzT7qlQ4AZ1fLPGKDVN0KjYJiohVw==9tXz/feQb40uLj/9Rb1rL7ZizWHHnPyOZgZfutTln1qZX1OOhiVyKz48sX/z5Xil7tKcFpRdZkvU4nNVEIqrqQ==WiCKKZ3bkdz57YshXYw3eM8gwP2/hPs6uXWAWIIO/RBkBs/wHYSIbxl3eM4nAEguu2ZB0CDla81/A3ZlM/Q9Ig==kdDgx7dUZXrY5duGWTakvyJTVmaDdSa/8KQ0p9iBQwqutZeSUTrEsro53EKZgbumgHbrrV7X7OC/UTOIsiMH3A==xeF+pGforrXsfrpu7oG5Xp+hRncF2C852As/O+ZsDCx67gASRtw9ho8yIVqshhxjQvVHHsRdpWEFxzfwfaADDQ==C0y+6pmzNbNtvqPJvCFEWXxpRthMbCg/h7hkv0rqAAVhilrJT9tbf/zheu0qZ4eiJrhM+MBBjxo9HlBLuEUxvQ==\\\");\\nexport {\\n  s_eevMxFvmCM8\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/layout.tsx_layout_component_SHtFir1Ia94.js\": {\n      \"exports\": [\"s_SHtFir1Ia94\"],\n      \"facadeModuleId\": \"/src/routes/layout.tsx_layout_component_SHtFir1Ia94.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/layout.tsx_layout_component_SHtFir1Ia94.js\"],\n      \"name\": \"layout.tsx_layout_component_SHtFir1Ia94\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\n        \"build/layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\",\n        \"build/layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\"\n      ],\n      \"fileName\": \"build/layout.tsx_layout_component_SHtFir1Ia94.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/qwik-city.js\": [\"M\"],\n        \"build/core.js\": [\"h\", \"k\", \"a\", \"_\", \"B\", \"q\", \"n\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/preload-helper.js\",\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/src/routes/layout.tsx_layout_component_SHtFir1Ia94.js\": {\n          \"code\": \"<removed 2817 bytes>\",\n          \"originalLength\": 2722,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_SHtFir1Ia94\"],\n          \"renderedLength\": 2817\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { M as Link } from \\\"./qwik-city.js\\\";\\nimport { h as useStylesQrl, k as useSignal, a as _jsxQ, _ as _jsxC, B as _IMMUTABLE, q as qrl, n as Slot } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/layout.tsx_layout_component_SHtFir1Ia94.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/layout.tsx_layout_component_SHtFir1Ia94.js\\\");\\nconst s_SHtFir1Ia94 = () => {\\n  useStylesQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./layout.tsx_layout_component_useStyles_MOLFIZOhXmE.js\\\"), true ? [] : void 0), \\\"s_MOLFIZOhXmE\\\"));\\n  const isSPA = useSignal(false);\\n  const LinkCmp = isSPA.value ? Link : \\\"a\\\";\\n  return /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n    class: \\\"layout\\\"\\n  }, [\\n    /* @__PURE__ */ _jsxQ(\\\"header\\\", null, {\\n      class: \\\"header\\\"\\n    }, /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n      class: \\\"container nav-container\\\"\\n    }, [\\n      /* @__PURE__ */ _jsxQ(\\\"nav\\\", null, {\\n        class: \\\"nav\\\"\\n      }, [\\n        /* @__PURE__ */ _jsxC(LinkCmp, {\\n          href: \\\"/\\\",\\n          children: \\\"Home\\\",\\n          [_IMMUTABLE]: {\\n            href: _IMMUTABLE\\n          }\\n        }, 3, \\\"rW_0\\\"),\\n        /* @__PURE__ */ _jsxC(LinkCmp, {\\n          href: \\\"/form\\\",\\n          children: \\\"Form\\\",\\n          [_IMMUTABLE]: {\\n            href: _IMMUTABLE\\n          }\\n        }, 3, \\\"rW_1\\\"),\\n        /* @__PURE__ */ _jsxC(LinkCmp, {\\n          href: \\\"/about\\\",\\n          children: \\\"About\\\",\\n          [_IMMUTABLE]: {\\n            href: _IMMUTABLE\\n          }\\n        }, 3, \\\"rW_2\\\")\\n      ], 1, null),\\n      /* @__PURE__ */ _jsxQ(\\\"label\\\", null, {\\n        class: \\\"toggle-label\\\"\\n      }, [\\n        /* @__PURE__ */ _jsxQ(\\\"input\\\", null, {\\n          type: \\\"checkbox\\\",\\n          \\\"checked\\\": isSPA,\\n          \\\"onInput$\\\": /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./layout.tsx_layout_component_div_header_div_label_input_bind_checked_eevMxFvmCM8.js\\\"), true ? [] : void 0), \\\"s_eevMxFvmCM8\\\", [\\n            isSPA\\n          ])\\n        }, null, 3, null),\\n        /* @__PURE__ */ _jsxQ(\\\"span\\\", null, {\\n          class: \\\"toggle-text\\\"\\n        }, \\\"Use SPA links\\\", 3, null)\\n      ], 3, null)\\n    ], 1, null), 1, null),\\n    /* @__PURE__ */ _jsxQ(\\\"main\\\", null, {\\n      class: \\\"main container\\\"\\n    }, /* @__PURE__ */ _jsxC(Slot, null, 3, \\\"rW_3\\\"), 1, null),\\n    /* @__PURE__ */ _jsxC(Link, {\\n      href: \\\"/\\\",\\n      [_IMMUTABLE]: {\\n        href: _IMMUTABLE\\n      }\\n    }, 3, \\\"rW_4\\\")\\n  ], 1, \\\"rW_5\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"\\\");\\nexport {\\n  s_SHtFir1Ia94\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/layout.tsx_layout_component_SHtFir1Ia94.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_routes_component_vG0UuU4cNCg.js\": {\n      \"exports\": [\"s_vG0UuU4cNCg\"],\n      \"facadeModuleId\": \"/src/routes/index.tsx_routes_component_vG0UuU4cNCg.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/index.tsx_routes_component_vG0UuU4cNCg.js\"],\n      \"name\": \"index.tsx_routes_component_vG0UuU4cNCg\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\n        \"build/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\",\n        \"build/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\",\n        \"build/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\",\n        \"build/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\",\n        \"build/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\"\n      ],\n      \"fileName\": \"build/index.tsx_routes_component_vG0UuU4cNCg.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/core.js\": [\"h\", \"k\", \"D\", \"m\", \"a\", \"A\", \"q\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/preload-helper.js\", \"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/index.tsx_routes_component_vG0UuU4cNCg.js\": {\n          \"code\": \"<removed 66719 bytes>\",\n          \"originalLength\": 2341,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_vG0UuU4cNCg\"],\n          \"renderedLength\": 66719\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { h as useStylesQrl, k as useSignal, D as useVisibleTaskQrl, m as useTaskQrl, a as _jsxQ, A as _fnSignal, q as qrl } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/index.tsx_routes_component_vG0UuU4cNCg.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/index.tsx_routes_component_vG0UuU4cNCg.js\\\");\\nconst s_vG0UuU4cNCg = () => {\\n  useStylesQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\\\"), true ? [] : void 0), \\\"s_Iyy38y0K3Hw\\\"));\\n  const count = useSignal(0);\\n  const message = useSignal(\\\"\\\");\\n  useVisibleTaskQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\\\"), true ? [] : void 0), \\\"s_HEFxKy9cwuk\\\", [\\n    count,\\n    message\\n  ]));\\n  useTaskQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_routes_component_useTask_99K9SAWjPFQ.js\\\"), true ? [] : void 0), \\\"s_99K9SAWjPFQ\\\", [\\n    message\\n  ]));\\n  const handleClick$ = /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\\\"), true ? [] : void 0), \\\"s_ep3t0fF0SDA\\\", [\\n    count,\\n    message\\n  ]);\\n  return /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n    class: \\\"home-container\\\"\\n  }, [\\n    /* @__PURE__ */ _jsxQ(\\\"h1\\\", null, {\\n      class: \\\"title\\\"\\n    }, \\\"Welcome to Preloader Test\\\", 3, null),\\n    /* @__PURE__ */ _jsxQ(\\\"p\\\", null, {\\n      class: \\\"paragraph\\\"\\n    }, \\\"This is a test application to demonstrate preloading capabilities in Qwik.\\\", 3, null),\\n    /* @__PURE__ */ _jsxQ(\\\"p\\\", null, {\\n      class: \\\"paragraph\\\"\\n    }, \\\"Navigate to the Form page to try out the form functionality, or visit the About page to learn more.\\\", 3, null),\\n    /* @__PURE__ */ _jsxQ(\\\"p\\\", null, null, [\\n      \\\"Count: \\\",\\n      _fnSignal((p0) => p0.value, [\\n        count\\n      ])\\n    ], 3, null),\\n    /* @__PURE__ */ _jsxQ(\\\"p\\\", null, null, [\\n      \\\"Message: \\\",\\n      _fnSignal((p0) => p0.value, [\\n        message\\n      ])\\n    ], 3, null),\\n    /* @__PURE__ */ _jsxQ(\\\"button\\\", null, {\\n      onClick$: handleClick$\\n    }, \\\"Increment\\\", 3, null),\\n    /* @__PURE__ */ _jsxQ(\\\"button\\\", null, {\\n      onClick$: /* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\\\"), true ? [] : void 0), \\\"s_BjxcCeNQ9ak\\\", [\\n        count\\n      ])\\n    }, \\\"Decrement\\\", 3, null)\\n  ], 3, \\\"B7_0\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"RO3ohxhcpAk08MTYZo7NTpPbpUHgpvw20+rSpp2qbJfE+ipaEZlHQPjNnHKt++VH2z8e0E2ObHgn6lhd9vqWwg==u3yjKnng6i39pAg+04FgAN2m7WUdkOK9YB9SsqDULsh7PmEWiLbGmsc8rwOazFzE1XKMLoFnK6D+MNTULitIDQ==wDK44qqsj3pKScymOc76IPq0uoQIv4hNB+6315VQfW9MwdRHrvza6T5gOHAEb/jXttv/02k3JmgevZ2MdqKCKw==/Xdq0WH2QNakDa0xQM+Qth/DsaTr+45x5v/fuPK775iAMOSpit7vcP47QdOhwqZFVzHtZGGnXwkkjad/lv5GfA==I1jZAeJCFUyW9qxdAe4kDu/NKuXUEE7ANFTK45RL0nrKBSyYfjdW57Mg3Uxmda57pEQK13oP0PZBj7uHspERMQ==YqBEml3jCSsl8aB9zbDs9V+ZNIUigphV0tItnEDQJXuXVS3u/Mdb7uTny0ZaPytgaPdCRuz1mPrLoGj5C6leFA==J4AxSEQ0azvjQkdE65yD5Cg+ltdfuwRGB7O52uOK+SxJZJU3dNILOglsHD3D+G+G0QCgZ55lhCIBTj7YcgNh6A==a+1yHBndD7RngZ5qSCBUuDxLzTTDpsIRmAaZbf6RbUR4N7XOfk7iaFeoYBvqysdNLYFYbJO2oZWJV8UwOGh2Lg==NiyiPzc6DcMYQW+u+z3oZW2juIF4yRPcr85rb+P4bFmQb9D7hXcdRH0o2zHSjlsxvDOdRa7YA0StYa8lHR/X2Q==0Duk7N1MtQTkzuerKykuD2nqDteaGUXScSRuHzgxeWXURVE8GIOPvPWINRVImjg4eIWBtwPN/LjKVENXr52YWA==5yCKfzOwTYmnWvIiB9hqoQIzBjjRLlDfVvZz5vhYvnIy6nnWWDlOy/Zm9kT3Hdn0+ro2aaiV8nyqi3MvADavbg==+6jWbJ+D/h3EL1VqnZx3RF1ChlOb0m3PV1xYP+1LEbRncr2usPFzj8gcfH7/fb4I/MCdeh6pxi9bikItEwIp3A==YehTeh6uTyjQ8MGVqhP9H+Zpoy5qqypMpNjOdv6DiWbbVbhnEM4t5nWTtWbYF0QyT9fWNeLq/pJFNBhG9OExng==XA9bBlV6Bi21jz4O9SHQQwQHts5Emq9CzCvQWfBjDuyf2IwH3xb6h1dHEtBEIxKEnWO9A2P/CZtNCpk/YzU7ZA==EMhrIahtF90bSs+lfgKLBOGDilwCsrXcL7hxfuk9suEILpxCpABNrrp1kQqwaarE2NMyeWnEjXXnUpq4O63XRQ==rYh6PTjFGh1NSFwsnZway83hWSmsvqy7EcB3NJSJZZcjSv5y0/qn6WdAMNiv7AvZqmdIKRMDcglqMsd7TPtQfw==Yh+y3HcOd2Khotdv7P0x78Dy6h66PJdE/lPcrIVjPJvht3xuCi/eu3IQ81THIx/AZP5Yew5CTXc/4MI+67kkOw==8raZJpBSiTInkkzyTyfLJULNs92cvdzZKFTu7DlUBwCkRqpk7Z+S5TMIrOelYzM/qV0eMiyAapbWLCKAO6MQcw==r2YTlSGMSjNNSQcmpBKCpaSo1HGorOBdD2V5kHBBGfDF59j5foeyMjZswoJ2wjKAhO9re0aagy9y9aC20An/cw==cAoB7CSp83qq6dGFmIziizIaIN9MFW5wtE8m+zkMHFgpn61Jkliy5naTDvJW6FYsn0HX0GG7mpxzK9PyvQPeYg==5h6BarmmAlhVAqsyPr86r6d+V7rqvOwoH2rqegpoG1HbETVW7j5dJ8m8vla31pJuGcfuOyQAwZtcgIICh5xbBA==axWGcB6JOPWHVmBLfHWz7935RlmfpeGkV+921CD9yr83K7totWXLvpwLS/B8wsdG9YmOxJ7kP340Zgs9mIgH+A==h9OqHQOzZ8DXJ6T0FE6OfbX7vutJBOBBNSzqfWH3Fs7FGzcymYi1LCrpGCQQGVQ5fTZf9uLfE/4qC/frFx9I9Q==5fDLexZky/GGOXuWtezOPKBCZwLQiaMFgzkUcCFs7QLb4yn5wxc8N43qmctduSJenowvaz8IrQ0Qn+Vsonl+Sw==+kElAOVi+g4+c1l3SVWfG+WdI9drdrVdRZX4KDTfiW2RVxPWl6AzdRqfNs+ScpRe5sHcbXQMhUC4Uvc9SYqifw==pxM1N6OFha9rel+qBcSD1l6XYWD4ih1XbZQ+cFmqL7x5Tz1gxrjlifNtmVCUKnLEIHf8KwhvgW7onfng6AGPrQ==o37EGhIPteIy53aHd8yHJQCQuoYhMiX0RkMHc0yzJi\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_routes_component_vG0UuU4cNCg.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\": {\n      \"exports\": [\"s_Iyy38y0K3Hw\"],\n      \"facadeModuleId\": \"/src/routes/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\"],\n      \"name\": \"index.tsx_routes_component_useStyles_Iyy38y0K3Hw\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"/src/routes/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\": {\n          \"code\": \"<removed 31405 bytes>\",\n          \"originalLength\": 260,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_Iyy38y0K3Hw\"],\n          \"renderedLength\": 31405\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\\\");\\nconst s_Iyy38y0K3Hw = `\\n    .home-container {\\n      max-width: 42rem;\\n      margin: 0 auto;\\n    }\\n\\n    .title {\\n      font-size: 1.875rem;\\n      font-weight: bold;\\n      margin-bottom: 1rem;\\n    }\\n\\n    .paragraph {\\n      margin-bottom: 1rem;\\n    }\\n  `;\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"mlI6OBWpPPUMhv8ozuVm2y4+AsltrTPkKSiejU2UHeMuGr/B7wF2IPZKWdH8imGFZTij4G7HKQ9VC8EueYMdfQ==0OC/eCcmaAcA6LGVfARlGJ8uu7w77RGpsq+V+uGwYnOy0duGdPYqmtqxYEIljysbiwJkchCWHZtFxjh3cpVmDw==+naeT8gzg/C0UuSyMyUG/TkRqkMtXzvbYTifaX8ZnVb/+1HLTbLtjI4Ub0sgPcYXiH8XEZPGMFuPvgFNwdTGEA==y/yBc8/Qvx1bM96lap6imOyEICtMlIfqtlf3azAu6dOHF9cRiY69+1XGpk2nSmU6hfL7ETq1dD6kRuWE19l69A==RhajFSYjayWqyfSyHivqxtGaUzovfHv1lPB9w7kjl+UVnpXqt2SzP1RzlX3wlXGy8gRIWgDpauiy9Bro9tktxw==+jAFRNZFKQm+vJY+qeyGpk47WYJPZHdX53RJiHzAZdDx8IhmHqSbyOL+Z2cZa6EvWJUBw+D7kw00aLp1cAAgKQ==aYUC3UyLInykteQsE8tx3QEo4YzC5E9Y5hmyU5yFFpoHqLtYTkODWVR7QXjOPAqk/jgpa6qlbKOb2TatzvfX+g==w4fs9mA5iqbfL7YbbW6BUSqEr1Kucxn6Zs2YkD+eIEHL99FvNDlXSa5mneaqI2p+26HIFShHn1vgzdGQ2SllJg==JFeERBD3KsyZH0WIvgvJ+B/6uaT/uwTMBix9t/WOry6rWHTmhAN2fybbLLVJmeRzoJkwN7pfPU8cglAIuWZ6sA==/2UY+z0mSRy13LtCXxLUnOxd0EtdgiR0veGS9n4/bHKcLId61VF1JmOOMqHmF96kR0Jpi1bw9mCYHn6DL7xRpQ==a/6ghSZyqpHujpsdkPlOA2PyqUBq4Bg9SHlhE/dmjgLpYlb2SZWCMCWkESX2QlM6GT5yb/i49cs/yhZxpCEVCQ==WBTL+bQxdzpkjb0I6zgHXE6+IzZxJ55d5s1odVfOSsrHGmaB0X7hHSSdAjcPg7Qhd4ATJCkG12GiCaaH4OjInw==SAahXoLWCxIHUj7l+7UraylFHazyJ7kpl3Kf7FAR8nJ4AZUZf/AGCwT8f+Ws/byIUrcUlhap16+4DA7hlVEU9g==ntqeamW9ZVF3CrCmYSTqFlMkQTngF10DbQtVR0jKQR53WOV/zvdcbJDhmYlsFKvGVeh8RMZTIaxlLTvmbgYWpg==/E3DplYtY/FulIN4E+ngBzG1RbC2mUIsykrgT2lj/JpjZe1/u6OTiacaKdWoU3tSRMaxqv5kqEo8SJo65veNMQ==+Ye9wSDombbD6k6hLLq6ybf7q/liGfdgO48hMdJ+Hxxh/kwDLcZmnuYGOSHZDwvbkNvQWFkWVlgHgVw5PJL9LA==b0ffdRrIbgXj1+ljfe/kQVM9f3XVDMP4d2gWpr4sqz1sdzv1o+otTYB1QJtnkhH7ik1SA8Pino79Mf96ouoMmg==xd4XARH+i0oyUr5m3ysw9JsOiWqMyhUXG2BC5GgE3WdqOEznEFyE57NwJdjHCgJs0v07YRQA7E5+nCSPgtUGow==CgX4Is5U2MPK34JmNMjjtrwWBxSZwfc/BQguVaF5LgxgM5XNZ0rv9bdMStcUGFyaz8bHPKkWOAWGaAaMjkQcvg==JLO4CWa0mOChk5bB7GzYU5o1YOgqwOtQDdSf1eIk0QC+THpQB15x1gvRwkytRArRcwVkowfgcvPhI89T3rHbLw==qWTGAa4t7feQzJdqPhHkvQlAS6mvcMi1gac5lzRDGXLmU/lGkkMLFcxDc4Ek/VUCio9nK5wiYjq46sFYl2U66g==pKwPPIRkayTkK6QwRKx1gWQA6j/6+GsvKRxU36bQWy7iLOXvLLwx+YH+o2klukvkfKEwErdkHOXVEu0jNGAnYA==8RNFfDI5cceytuHXGTI4Ng0HGxagsAlnZZf/mfUVXuveRJZv+fuEmeIrR91j774Zbk94XbO8whU7Zuahr8BnjQ==IRHmo9iqHnADlOmPsBmMqb09OHpwRWjOSOFYssXy+aHif02d5w9zSkRljiG43632ZR4dy3PfNZ/aSX0BxT16dA==pfXHZkvMWujxtbqnV/JImaOP+5YFSHxTDwsMCwpaqtv+wyBENInNN5Jhd3OBOA7YyS0Ys9/d4sd0iXc41PhfkQ==24rGZNwzsEXwe1H2d8v0ZHLH2ZpGhy6jVUWylcasbO3nDoEQWw86DOVdsdmyhbpbQApAVTekFjPA2blin9TTxw==3K0g+a6WJtR8rbZ0Z3tDV8TMfN/QJECwiA6MmhkyOz59t6xBUpyWpYsPywwhI6MNrufpT8HBdfHENxZ8gXl+hw==lDbAFSRQt5PhadH9I0hZ4AHou4P0OhyH7CGhbY3LB3/fkAMU9vvZfjEKFFk7Fa6HwFkna1A4t6HANNTqyfHtXw==QHDM70zCWUbpz7fxLOtCG1yl+fIVCm4gbDXo/tJN/S7nbVjb4BNXibGc4PDNRZp4hNHp3dAqHvNR1Qe0KpFsPQ==89HbRtcOLs3DIdiAnVPKgLAAsdsTu6yehPx/ncx4eDva1BfcVDe3Al5xEdmLTH0MwpHIWddnJ/4KBW9wT/lFuw==hznLhB/0kY0bYr0FCv8Jb6feEPT/p6PmxyxUi2aon8tUz295BHgSlM4kMxC6y7j91MN5jD5unCXC7mWCWlnb6Q==R8qyeDZHVh9h3Lx2yyNuAt5y4zwv0UVzX4oVhs6HVe8zKIQN9Bc3731xatcf2Ez4iPvXEKtr5pxBO9U2wzw/5Q==hObvkIuwi5x52tb3mOQamcyhedaYWM9ulmMhWAOMMEwKiJd5aOoeKm8Lco8ZWyoXy4QpntwDXpUTECn1yNPjAg==u4fpAHIyZi7Igu3aKtL7GaCL9qFX9DaWKmqcOrUC2g15EnZNcAZ4sPPj/NdeXKtBIkullOH4wDHCyMLQ+KQWDQ==kdhAO2CIP8giBjCmFKIpE6I2kKBVBh7T3oe5Lvb7ib0auvYkz6xA8zIYiMFqCunI7bkUTEpNbn9hlKiR5cSdYg==JVn3DY/hCvSoSD4zco/33Rs8Y4jAtDz92yYDvT/86SK9XZAMTdYRJmYFXFWMA02j2fuehxw3eakj+3ZBaUAWeQ==260GfvGyCQlc0EWrG+HyWKqkCGkN4outLRuAHYjLjcmIF5dCPmfZGzmCWKa6KrTuiid6G4G1D2Xh5+SIXdLOdQ==yqGcTMoXIL6Bjy3n/VP6BXrmrS2pRjOoO2JfnT3U6lJwBxWzAk/ujdj0qsSu8RTrdh0lza6ow67fRKe4hFydwg==WcKgc1txRcZn1BKGQXxIJDWvpwulUGBfCK0BVH81siDUs0W5TXRoWbgQyUiQaYbnIPXVNWifWuE2G8a0586VJQ==b59fEpL9zy1G2ENBT1z6NJuTue6H+6OA11XKB6PvEQ+M/hx51qyHHhqFXI+ebdLSxclwpFQkjD+x2yyNkEHXwg==SdMVIMPOb5+nDHdXXWnQnmnoYHTobUYYtcVK59O81Ai4PksnxP6sB9sak5wviegZfngd5J6j2+5uvSJctwD/zQ==Jkrygam5V1cKHAIdZW220QW22WrlxUsS/TvmQC0BUd1i4bCbtTW+Yxp7e9tNcq5BK+2Z1YnxOARncPKg3S0IrQ==STqoh0bszMWWDTKuzit5opw/hSYugguqLAVb598WI4MvX+bd05rYlew9IAAE5xjPrTwrW3RfNiqsrUmi9nochw==XygMYJgJzfiBPs6mmF3ndRYMaQGF3HCPQWEQAh3rdbQ2mRCa+cCrs0oVjbsAWv5TIB9+v6nbT1EERZ1Wptz4hg==LZAq0eODxsE4T2STzEpvQzJDqSYCyetjPThuITGmAX2V0Ijx39enZSbGV58OHKE/4Qyb9yJHb1GD070gz1OEGg==cDpb2i0A+ErXbw2Fj+3gK5Y/r1cpo/3kaLq1wngUBrgw8eC+w0nWQG/vFIK4Z0AK3vauVK8W70At8kNLe7Xxbw==gk8zedOmwRUQoM68su34GuyljbnWD22nY2JFB+iR/0CEvflhsAEGD7Hxmw0is9Qf3R2BYFkxSJf6m6k9+SNJ8A==jwHXlvV54v8jBY72XGpwqYFlhs5Meo4vKDoTO8VgAvWp08oAnyJcOrf1PpCBDRRZ90SGAZtXgQB3eq5MiWODPQ==GIZHE8ScFHEvKXuJbFHGaVOIwpKxT+Yx0J34pKUOKKK2FSJJmYPNn5/NaSo/Js31rXA5MGguDwotZxTI4Hq0Ug==dk42G2XrKlWhzEPAKje3pL8myVp\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_routes_component_useStyles_Iyy38y0K3Hw.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\": {\n      \"exports\": [\"_hW\", \"s_HEFxKy9cwuk\"],\n      \"facadeModuleId\": \"/src/routes/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\"],\n      \"name\": \"index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/index.js\": [\"_auto_getLibA\", \"_auto_getLibB\"],\n        \"build/preloader.js\": [],\n        \"build/preload-helper.js\": []\n      },\n      \"imports\": [\n        \"build/core.js\",\n        \"build/index.js\",\n        \"build/preloader.js\",\n        \"build/preload-helper.js\"\n      ],\n      \"modules\": {\n        \"/src/routes/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\": {\n          \"code\": \"<removed 729 bytes>\",\n          \"originalLength\": 409,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_HEFxKy9cwuk\"],\n          \"renderedLength\": 729\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport { _auto_getLibA as getLibA, _auto_getLibB as getLibB } from \\\"./index.js\\\";\\nimport \\\"./preloader.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\\\");\\nconst s_HEFxKy9cwuk = async ({ track }) => {\\n  const [count, message] = useLexicalScope();\\n  const lib = track(count) & 1 ? getLibA() : getLibB();\\n  message.value = (await lib).getMessage();\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"IFKcWqmqjf3Gy4OtmnQp3bbPFrSEbE0IyhP5xstHl5dOIaTj6Vuj2dJmlRDjrsmiq5Db39OuWFHtHGgk4ffEYA==Xar5U+Rk2qkpSRZCc164uM4N3Fe0tnZj5aZ4Qm548Kll17eim89XoDIaM3RUnZ9vQPnx1J8ucmuixXzUSFvYDg==\\\");\\nexport {\\n  b as _hW,\\n  s_HEFxKy9cwuk\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_routes_component_useVisibleTask_HEFxKy9cwuk.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\": {\n      \"exports\": [\"_hW\", \"s_99K9SAWjPFQ\"],\n      \"facadeModuleId\": \"/src/routes/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\"],\n      \"name\": \"index.tsx_routes_component_useTask_99K9SAWjPFQ\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\": {\n          \"code\": \"<removed 805 bytes>\",\n          \"originalLength\": 211,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_99K9SAWjPFQ\"],\n          \"renderedLength\": 805\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\\\");\\nconst s_99K9SAWjPFQ = async () => {\\n  const [message] = useLexicalScope();\\n  message.value = \\\"loading...\\\";\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"LakPU94z6vuQAnXVp2wmxeB6YCQ7KUxPaLAbuBa5e85HnlUmLoOFNKPi3RxbdbMs29ryIyNbdvN4cxwZjtn2Fw==lsGz6dvB5yUK4JWV5BKyy9xAew1rjyff89JMM0gGbyTfJ+pSGKbrGo7m/ZhtUUFYoDSa+i72hMHj05n/f3PfPQ==2NxFBFYoXcUCRo+dFFQU/JJBRe6tbEod8kCBcSwIl1HjnGqswD406KQCHGeUq+GcsWH6BJvHBqEukJSNXvDIWQ==/wf84imxMluLsSs7PLYcUnkemdcRyf7Zv16k84PDDf+0c14vnr+gc0LDjNWEbvLBCqY92QiXTnJwWtjHuwlQ1Q==\\\");\\nexport {\\n  b as _hW,\\n  s_99K9SAWjPFQ\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_routes_component_useTask_99K9SAWjPFQ.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\": {\n      \"exports\": [\"_hW\", \"s_ep3t0fF0SDA\"],\n      \"facadeModuleId\": \"/src/routes/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\"],\n      \"name\": \"index.tsx_routes_component_handleClick_ep3t0fF0SDA\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\", \"b\"],\n        \"build/index.js\": [\"_auto_getLibA\", \"_auto_getLibB\"],\n        \"build/preloader.js\": [],\n        \"build/preload-helper.js\": []\n      },\n      \"imports\": [\n        \"build/core.js\",\n        \"build/index.js\",\n        \"build/preloader.js\",\n        \"build/preload-helper.js\"\n      ],\n      \"modules\": {\n        \"/src/routes/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\": {\n          \"code\": \"<removed 12348 bytes>\",\n          \"originalLength\": 418,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_ep3t0fF0SDA\"],\n          \"renderedLength\": 12348\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport { b } from \\\"./core.js\\\";\\nimport { _auto_getLibA as getLibA, _auto_getLibB as getLibB } from \\\"./index.js\\\";\\nimport \\\"./preloader.js\\\";\\nimport \\\"./preload-helper.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\\\");\\nconst s_ep3t0fF0SDA = async () => {\\n  const [count, message] = useLexicalScope();\\n  count.value++;\\n  const lib = await (count.value & 1 ? getLibA() : getLibB());\\n  message.value = lib.getMessage();\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"dClPgcB77wBjI9zRh/l9fYHb/YfmpEYIYAHh/HlR2338qqnsM2ajN9i6ks+GjWNCD9qVEbFQfV/oUOFh8LlI5A==4f94jtG0zZ1WwvUce2C2fXarDcaJqYmx/PSlfT+IFq6iy9/RNQ/5oIrdVikmZiAUZfj6h1ai4m7qxYmie2Lhvg==JaNuihiP8Yl8Nv9x7XL4IhUIwHdKa2xezV2HXLk20q40//AbLNeKYhoCu7Fm21TS1VZT+vPzNbgublcg4ZVt7w==+kvxQ1nPDSdFC/EN238xi9k6SCCUoa7FSqL4SnH6lDr1eCjkwH/06bOoxL+e2gOf1hYel3hPAbpSRzvkH7WVKA==tz2XZ/OKSNobH+wXsYLpIewwVAj04P2hThrV0QLs/eJplTALw4gA7IsHRUegV8vq44o3urpUgIxz9YQywaLDJQ==bl4EaLNvMGUnjf5D1VYwdnMhMbaM1SSawWWr+RslXapj7fzLiwwUF6bpeMyNlNiE+xHSJ5JULfjd1N2puOv6wA==QjkRZWV4hynLMb5wPtzN5co9egqCEu3JCh3fPezz3JQhwuBsSI2L4hKistDfWvcU5Ktob2MHyy58cCXijarbrg==j9XfoF9IeuNCI5Iw3l01cm/KLOh82aLE/W/cqteU0Fe0E7a0GHwgXor5wLxx31l7bqrcEPNJqKkfrIlhEQ7FTQ==1K8CGX0Q3c5ZcWg+E6sznYXu6ayjgyJ8370zqI5qayZGx1Yehn02jTz6jEZG+SjW9olrYEP+vvDCODJYwSRF/Q==cRo56hjtVYhGdYFaEKno+W0vb2cKP8fdS+LA4vLem2cN6CoJsjMfALbQfSxHy5aIW6r+TM/hRlypazh5+Zs3nA==QRe61jDaR4sDRjKXCsmaHCNa2oNdBcz9GLk5HrKGYoKMSVUfh2MdvwEE/1lq7Z1SFWefTLI5deadfLLM77mdeA==p395ApwKs0wQ+Ch1A9A1jZId3jBNOSoFROFBwVfYcC5fv5EG5DPZZiaFm0UwMFHAXpCT/S9pxrsxk/U6yx7kug==Rq8UGRObPvTEAkfkrqt6XojLCDfEWvaSO04hCRArF5eN9lpUzyFhwfBiqLZZtoJc50V6QqqrGzHcPKJ6OXRpDQ==zkhQdJBxwDas9Xxn3UgEnNsD24smSZGGzsJSOAwpbLgjTlcxgz74Qx3rg51xnM0dG9dVkN1Xtiviru+HQTfk8g==pmCeZB4hf9sfa3O6cOpFO8bwEB3CVqSa/ivEKyLumU5cKqx20P1odcnm6IeccnGo489JJ5Xfu+NSc2dSOG3a/g==FZ9QUFZQnut4Qn/hgg3lI76f0zaiQfnWrX4RAXYvWLtZifl6QnIVOTOiD58kVq8teP2XmeNfpB9UKkXRIAwsQw==HQoaw7dSWGpxO9f7oAl30qaOVklkBO9MD6ibBlI40Pn78VNy/cOUC2Yerqkw24Ku/JBIQhjB6cid3lqCvYhoNw==tbJYKdTmA5vWa2n6PTlnhPurczZf2FJCzOS4M5CrWaexkQj+tvjHJ8Lo+dwcssmPY4wCxcdFGPl5LnhGouLlTQ==F92GVKGi35kT6p83vjJctT2ZajxRSVJlMaENezCI9p43HUo/3QrD4B6Tqq+czHf4iLQxb6nNzl9UZ+MkT/zUYQ==3U08CZ2crD8ees1fx1W0XhO+MMwrcCKgMlf3y9WQsAAtFJxhvJ8pjykDb/sNAcgX7ruikTIsbfQSotNlz9JRog==SZXMH0s8R+UHEADuxvFi1+oMn6s7TKZmE5/BJ0hrb0xEusKAAu0k92IKj3Tyk472nq8GX8ZdowRmlsTkvtcB7g==56PyxWxfBaMbyFUb22VO4Nsw4rKH61zsyMGR3MHPbfQhrjrxwxShnPHgFBglZjhGfz8fKhyQlagZLczFoh6N2w==Zh+UOoU3cd5BKaEKzBMyqbf4kpolVoN11y3uXuUqif79OSUAit0JXvz28iPHHCyt20/Q5MfFqJR1EYYafq6CxA==yrzfNZ710pAIdi66FEU2D8jKS6phQrYuua/wdHOsFQqG4cE7gjgjoWD5KCzBnZnz1vhlhuj9uVRAlKoCVQInfA==Bktd8g/3cE5R+ciqmJVdbft34ZoHSJUFSP4LTTgDIYD+b5aVkJLkwI7JEPcQLFI0T0ilXhFPEDVsnOgcZst9KA==0VjHASWlYmLpjHvZqVkufMJGFQ0mKCAcOn3467P6YLzwK3j9ksqZ4E4RS1xe/NAEVPEtiU3Dy5VlMwMeB+IuHQ==Ks8OILqr93r+QeZOZeg2Pf6XuxDQCYcedrTXFrM788jnIp8YgRwla48xI7BmLIWUrAvSgWDAXR16yCwqZhemUw==qEBnG45CSZHeciG5cCU1FwoQ9CIbbOf6ycMEp9UbdWmabOrID3KbAfNdKXPa5atGvPOpSHyX4gppAyYOxxX7RQ==ukOXyM16xntm4mZIfpfcCsiheWs0NB9MSoJf62NWDNYOisH33rHbLUkOo9oLdkFaTuoZm6iPFjMfVAbd9UvcmA==OTZyNn69Jyj/F/20CNLCZDuGSbzou+z4JnAU540gLhWsMSIAy2pqwJQuhIE67RcqQsCCGPmN0S1YzKcNHSZJYQ==WApq+rR38mVJignQ7VtHwi8M7ORWY6yJkuw7BIEy+WLStTzy5no3ofwvmubcQhgpcCAmaGxnlU9FTVBj3O/1qQ==i2nTTy1HizQvrG81zEuN5mS2sPlnfim1FbSTaHBnBFVIGmbL058teAcgvwjsNlB9Iuh90rz0Xg9YPfdsFigUuQ==fUlEIxf2n51sWd5Rdk/ycZefPS3abm2vSYikmPgU4x3RS84HuKr3fB6c7fKkDZSsLiWLgPWTOfLo6IimdViOww==Fykh9/JQ2pjziOGOBYZdOmZhPc/UfI7Wm05lprLS9Krx+KL45cqVKGwOPRFs+Ruyy7NgYcWNWQYMeO7sx367ew==wW29oe1NYzE7cQYHdg/nBBb7vopTVthCCiMHGBYBEqaQYF5eEm9yZDiUtvYps0b1/El9sYVXfk2JB+g4SDLoTw==398cnC0bNUKCTArSoJGHTYWyfPxau7cy2ishg/HJQOsFb5FPzdk5Io+fcXhKFoBnKW92v9GNuPqzLXwpUgN3OA==j8ilbGaa2vfGylYb7eGkeUhdQSiC0C9jSLZ15QsnIHcxtxG00nL8HkHtdsvkZkEYDlDKynBVK8ywU9nT76w+lw==WDlNWTkeShOd2m/R++eZj8BS59HmeDX8nfE2apS1p2fcd81JkSS7JDfY/1rqfJsl7S2hHbhcDk09iHDuN/fdag==7twqDbY0gurjXg+L111Gh9D8N0pI9cTjxVaUqrqWF0MWKrILh4XmtemgKir4m1iD8nVclr1NmrshsJQ/PIlQgQ==wo2meVrwfos5l+SrrTa1Wjw0TtEcH+GJNrcGefxwEK7fwKgTAMK6ajGfmX7pyQKHF8wqHWKilmOwGnSvHvK0OA==5zja+jw42+u8Kknc2+12I2yFlNeFcS1zgIbeT1KeuSM8K+kSob/ttSV2f0c7ya6oWLW1XNh+MlK/bTTukOqIwg==Q3b2wUwYpBu62xGVGR4j97nCu1wo9K3psybX8SqgSWna79FiLAboyG1xCRbySbeeqqFM4H3r9oA+O1bFxGx9kg==sQvy4fk0cl1BQxFjEX/ea+ZxyxmPnw//pkWHJ7RNAD2FrFYTAhC+N2yRInZZsBzb53DZ1RMj+OHcYiFKu6z/sg==G3z2bZfk9tNRxbq5V0WUZXzIbDEKrp03ExEGf92P3jIJmX85zmrastlh7hcVGZUaw/QofPqV4tqtWC3AArDDZw==YCAxlII1bQPq0y0tExX8z0jJ31SBiTHBlmuKwkTxKlByu42ccVi0Zf52RphNbq3eHpoq8OBTiUSuaQSskyMMDg==IIKes1LibMh/Oa/HlvjavzFpas+GTWKSmGajCIY50ewuDS1b9uzK622ziQikxSbaVflVxPhAgJGSyPuSsH888Q==VF3t2qGvyeLuG45RsYvbO0MgkH5z+O6ajLdK/m4dNHTaXPj0v/2Mg666LiaWo9LWgdbhj9EI7c8Vx075dn0WRw==VRqtZ9FmDdjdEZS3592p/xyId/FC7vhldV\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_routes_component_handleClick_ep3t0fF0SDA.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\": {\n      \"exports\": [\"s_BjxcCeNQ9ak\"],\n      \"facadeModuleId\": \"/src/routes/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\"],\n      \"name\": \"index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/core.js\": [\"u\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\"build/core.js\", \"build/preloader.js\"],\n      \"modules\": {\n        \"/src/routes/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\": {\n          \"code\": \"<removed 5387 bytes>\",\n          \"originalLength\": 155,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_BjxcCeNQ9ak\"],\n          \"renderedLength\": 5387\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { u as useLexicalScope } from \\\"./core.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\\\");\\nconst s_BjxcCeNQ9ak = () => {\\n  const [count] = useLexicalScope();\\n  return count.value--;\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"8zjWCE+i3ue9ct+YfjDt/82LMneRNOvB2MoNm2FFjRq8GbOFvM4sSqWXWKE8tO7yZgRRGZ/bKGifb9/q9ZIxcA==mSCqohJHnhSqVXJmS4OtehpjJE/03kgOEyyMKWORdV5KCNIRJZClFhtJRc8qp1aSua29dbldIbv6yNgHUvX9gw==nx7VjwuFmJvH4WhvjJtfkJWu3aUPxEMP9iRyAgodfRTJ2WhYEnTj4hM5rZOngsOWZygmPt+V3MN2JxXexMjcsA==NpjHEE53gu7KFc8KGNW0CQMwIZ60NBkENWCGGX6O5f2fz9T9HTcpNtgI1dWT0YDfanKXw7l9Rmz1dZvXhQMPgA==3Vhnet5kcDu3icHsoAWoEtJNnWgd2/o11s0L7Vthw+jw4Rbge9NNsKYm8qAgSF6gbrCOm8P++8pJYZD2SELucA==/yx2gJ/wmK6bKaT/Sa2AhXEIoEYbeBMxtsevZjse9al7x/qU8OmKum2QBXVwNWYWLe4kw/b92ppJ6ghHmDAixA==HUWiNEGIqSMMpNPuYDeeQ22T1sIEyesLoeD0Hzyhn/Hr1wujogqvXUvVg40tnzgMqXpg/LpD+uf3G/Dyau6ROQ==85OUussTgsVvvAce/ItHLuOdRDpfVrEmlnuebnKFem2MnOOpsN1mp9uM/Sr58IkZEERyElAPKyM7RU4RzHrY2g==fDHE4WdatvjAn4l/qacdy23pgKZ7UBhVPmBzte6OSK2CvDEpyYioj/c+aXxXgnPDs07ZsezRldtS2eX8kFH6Gw==Shf/0011Rc5jZ6oGlQFpc6IH0oZUAWVkf+J1JcGH5ptSUkxf0RgXMqeU76Sj9cLW4wHMBPE0XE0YtYu4puPB0g==cltTQx3gudG6ngndOcIq3Km/dDcmR6x+xmR1Nv6i5sBl2jw8Hf97QmBNjS5R6yYVWu/RN1YxBxSz4PxyUNdzqg==boHbtcvnSvzUxlCVsYbe+6OfeNmqC1uYqHtA1EFMFLWnFtgIfSzF7Vvk22i0OTl48NH3VE4VtUfvweNkMZQYhQ==9bIUhYzImOrE5EB+nidff8w6/5kCYwt3DY4E0G8lQ2tcGOBwIwBZrLFz+KWGi3JDDCAoUyUBo/x7fVDa8vazTg==Eehfuv2Eh62pijOsbwojWduDe9kBEgeidBFQbWnTC9lzpC8aKVUDaCC3n50S+nEft5v6FI6NnqeUD+Mb/UU+Hw==t/HGtey7G+LRzOgu2ItAPXKVrdnLSLXCJ3ak8XfaFRqyLs74FpRM8KzGbJzFPlRK2vLW7T7DrtPtJ+YQjn5jMA==JCtZpolJGdLCGg0dOc9tgtWMoenGRvBlf9BIwohrTxPQWS77ymHJ6lxuassYZfG3rcHyAR1LsbkTqUjP1Fo4fg==FRfKqKKc6aAoDMxqzBH2Knub2czfeIyaoQQ6Cxy6bnZ28hJp/eSTRrZz0ZBKar+XDyM3cTUGul8cN4n0rXkKUQ==s6JxSJEdWKNqXtLTxXJBMpF64itg/Bkl2UMfTzuYsWuqFW6fJHqn0RkDm7Nu474sqC5o8Ic8W3hhWROnXhCwRg==PNXZB7x0zaossFuHs4t9dM2QPdGDUgBW85zAAfqxt8AWkfwv2PPYJBzVtbx7gdLBlieIcxosdtxxmxTFJFBFpQ==LmfyXIua9pv1n5ni5Two54AgXhfFAZCFNM5xG7dlcktwBuGYajDocXYKMN9+/w/QVNq8PT6tZtVQE1CJU6Kyrg==j3D2D1OKEE5baffP+X2yCOygVQd7pggw3n46dxaQQOYTDTGmzThQZvqXG+O5lmpVokVJNHBCnzWif2OwSUK94w==3VSapPyuFUwCfxkW69DCyyhPtYIrXfs58l39yezMNcV68JRfJMWGhk7qS61CYRBSf0xnmHcnC5rAEU+TaRbW7w==/1tkKHyVd/SAk3bnfFFWLiKmojAB8vqVgti1GUx7/Ne53tAgx5x7msBlOVxP+x8JEaXK0+ir0atVdf+26VpjaA==Of/hVIcDM8KoLC35I8JPFpxUgqg10Uj6TP7ASBHK+XkUpjbz4ly/iJppIjvZDMLG/B76KqstMUcvEdAH/DOPkg==j+48uoe5nPChGxga2xvc26Er3X8ANElynr8euicPeVZi1okxSyRfNmddNQSzldt7t8H/bBgbzJAtKmOhGqE17g==8gWSf4+8t4K1XIiF8jXmtcTS/ZMbSjPowJM3FNAUqDf5CN0Y9/5nB/iZO06rGcHjUuwugRtIFVkAMALwKKkscw==0BYSVYmPl9cqQSim3HjX0Kldeo6pJ9NKBKI78bBaWk5m1MDehgL1EhaSXkBF74p8BfBVwVqMrcsxuhRz8xN3Xw==GlOl9ogihelOTMQdyeLC8piT5kCrftt91l8yaMlNYhK8QyY8bKUwCB4stQJoQyJVC32W0juDpqOqwsViKO98Uw==u3KE1UiB3gyVACbuT7pwICwrZqAMDr4WFwtawi2jKwrjt3PBRUgPB83MOBHRFLYH/GZr3o+EIQYcDtk1iDIlAg==ONp/pxKnCiINTe+QuIFgS2GM4j+E11qbaTjuJDU/DZfrBD6L/7Slmgc+yuXXMltY77kD8uA/DzByws8JBWd0KQ==agDsE1sNULYw3UhC+imNVQ0JdrAjIBU7bfTjdyi0z2V2W4gZKolCD5dJrQw3Jq1c43NHQquD7N/kxa4iyUy+Cw==qveIHAQ1cyc8N+wsGcJxBvJ4o9+St7xXCwcaVAlXMsm90aKcgKgN83lBT7ZhDjg0dWlrGCLpb+Zp86Y/lwxExQ==IX874TIYOCuccmvIp5BqXtqQ8mM/tQTbMDfeRvtkmJuBB4b8RkrJL0RVofZPbRQ6ExU6gPONTJI4xwUE2xiPQg==VLQbBlnRTveH5I26CHS3brVWx5fCYtNTbbnK1HJ1pxDNS+q2ZqhZHbgY96rrsa7R8oAajmenJISG1Vds1AB4gQ==VN2hNVErCjvDcUWldX0xPADHNXjVPdtnZKT1EYfaL4X23ewnPK5BvJm2eM3ZjW9cFj+ZP+q/p0s1afAEzvxkIg==cYNAsWf9zOfTZZ/xEKosNn/Ta1XnOFfKmQ1u/4pcDmyFl7y6w3+DPEqXLzBIp2+HnGp4y8LCvElwj2rXiPXDDw==bwZ6Jw6k6E89u57uo+lqa9YLhkkWdt8/9p9VJSlx7xj+FA1LaaxLR0jzW+9HKg1c8oa9v0s737wWDYTheg6Wfw==jLRf7uyNhWWi5P2D5CXXI72n6S+pt2CWQj+phSX/ClYqs8AW10C5cPNzNVTJTxb0/q/L+IfuD6qHscKYGGvv+A==qtX0/RpG9mrVmSqntrTiVnm0H7VsllcMEz/9m82NSDu+aw9EQLXz8bhsLDhcrowcsukrj6vkgN1LUWbXIYQc/Q==cdMJNRXtaEb8I3oRNHvPlR9IpKaeZnWW3/IAmqU6svi2WLrz2+eQWO2HKIY4HAfvtrQpscoj1C7DVc2l1NEy0g==2Etr3/Ad61SSWvAu6R5iDcBa/CDfFNdlAJ7IwzHKvddABSmcYb68CRMtLP+WMoPpXXpnCy/dJHrF2UQZqQLUbg==Nh+eFV2chH3D/GDqWI7JF2NO3XCUeEu3zCr7x/IxV1glZPepfBp4U5SDEaNJPRKxxz5xkpKcBG3gb/TmnCpoTQ==4tvLA6rj3/hIfsr17j7pJmgvx7IUrhOktJ64aPhIzkWscwnNIQs6CqIP114xGs0f7/EpFjK7FRBIUV0yyekcEA==jNk2UbKSyYVNwEque9gm5OGQZ4h6sPmUCEm/CsZWKt0rTdmNi4sfUIdaXRnlAA6ylTCYfXBRrv6aESc+K23mZQ==32t760LEwzjfoszEprnwQOuU/Vvyk1vyxda3v36cIxDc/9pgMzxIp8YMGNeRDIr8Sv11Un9srWeRvKXd/wmAFg==Ec/mRXqb56ADy5IRRx8nngses7dBvlPzKJ2vq62pYhGYBOyL9UyKDZrQ5D8Xa+lLPlHZKm6UE6XTnh/KHzbjbA==ivJH2I9watiV+Whpj7iShdbUn0l4xvrRip5v1vAWhqELx6pAV++xeL5baJoA37X2yQKb/DNzHZxd8XPADkT/eQ==oxoig/hpip47dza/BlqQUAhT6tjsr5sO/DB5jY7GMgKCY9IYuCyD1Qp9FAFkCqTQQerKXnW2h4HVnv23HFxSMA==V8FGw0UniHYDgndbqSnxlGaENsHPLpzCDEQyA4LSqPWAkABZK9ZUnm6i2l4EH5h1t4DhD0wpZnJxB/V2AtVtMg==Py0jH+Hnu9QVmya/Bm/ZgwE3SIpzgPSVdpkfEjl66GxK/fnNTcNX7pVlAm8Xsqm2suUQaz4XuMHQRAk5fjhwvg==YFUFy\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_routes_component_div_button_onClick_BjxcCeNQ9ak.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_form_component_useStyles_0pasaG6nmEA.js\": {\n      \"exports\": [\"s_0pasaG6nmEA\"],\n      \"facadeModuleId\": \"/src/routes/form/index.tsx_form_component_useStyles_0pasaG6nmEA.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/form/index.tsx_form_component_useStyles_0pasaG6nmEA.js\"],\n      \"name\": \"index.tsx_form_component_useStyles_0pasaG6nmEA\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [],\n      \"fileName\": \"build/index.tsx_form_component_useStyles_0pasaG6nmEA.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {},\n      \"imports\": [],\n      \"modules\": {\n        \"/src/routes/form/index.tsx_form_component_useStyles_0pasaG6nmEA.js\": {\n          \"code\": \"<removed 2184 bytes>\",\n          \"originalLength\": 1657,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_0pasaG6nmEA\"],\n          \"renderedLength\": 2184\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/form/index.tsx_form_component_useStyles_0pasaG6nmEA.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/form/index.tsx_form_component_useStyles_0pasaG6nmEA.js\\\");\\nconst s_0pasaG6nmEA = `\\n    .form-container {\\n      max-width: 42rem;\\n      margin: 0 auto;\\n    }\\n\\n    .title {\\n      font-size: 1.875rem;\\n      font-weight: bold;\\n      margin-bottom: 1rem;\\n    }\\n\\n    .success-message {\\n      background-color: #dcfce7;\\n      border: 1px solid #86efac;\\n      color: #15803d;\\n      padding: 0.75rem 1rem;\\n      border-radius: 0.375rem;\\n      margin-bottom: 1rem;\\n    }\\n\\n    .form {\\n      display: flex;\\n      flex-direction: column;\\n      gap: 1rem;\\n    }\\n\\n    .form-group {\\n      display: flex;\\n      flex-direction: column;\\n    }\\n\\n    .label {\\n      display: block;\\n      font-size: 0.875rem;\\n      font-weight: 500;\\n      color: #374151;\\n      margin-bottom: 0.25rem;\\n    }\\n\\n    .input,\\n    .textarea {\\n      width: 100%;\\n      padding: 0.5rem;\\n      border: 1px solid #d1d5db;\\n      border-radius: 0.375rem;\\n      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\\n    }\\n\\n    .input:focus,\\n    .textarea:focus {\\n      outline: none;\\n      border-color: #3b82f6;\\n      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);\\n    }\\n\\n    .textarea {\\n      min-height: 6rem;\\n    }\\n\\n    .submit-button {\\n      display: inline-flex;\\n      justify-content: center;\\n      padding: 0.5rem 1rem;\\n      font-size: 0.875rem;\\n      font-weight: 500;\\n      color: white;\\n      background-color: #2563eb;\\n      border: none;\\n      border-radius: 0.375rem;\\n      cursor: pointer;\\n      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\\n      align-self: flex-start;\\n    }\\n\\n    .submit-button:hover {\\n      background-color: #1d4ed8;\\n    }\\n\\n    .submit-button:focus {\\n      outline: none;\\n      box-shadow: 0 0 0 2px white, 0 0 0 4px #2563eb;\\n    }\\n  `;\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"0ghf+nnFfGhn9lmN4sYVCTo8Nd/kWTki7QjDoHILwYTVXUfcRldGNYVpsbvoCce13PIZO4oR0bLyZddpR/8ySA==w+Gpd0aFBoKMrbTj/QiWG+xPYzqJebHUzNv3GC2qF8MU1K1sVVZ0ZiGY5CI97p5ZlYnsFuu3GQMq93Z1QBFBLQ==\\\");\\nexport {\\n  s_0pasaG6nmEA\\n};\\n\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_form_component_useStyles_0pasaG6nmEA.js\",\n      \"sourcemapFileName\": null\n    },\n    \"build/index.tsx_form_component_ds9jIPT1g9s.js\": {\n      \"exports\": [\"s_ds9jIPT1g9s\"],\n      \"facadeModuleId\": \"/src/routes/form/index.tsx_form_component_ds9jIPT1g9s.js\",\n      \"isDynamicEntry\": true,\n      \"isEntry\": true,\n      \"isImplicitEntry\": false,\n      \"moduleIds\": [\"/src/routes/form/index.tsx_form_component_ds9jIPT1g9s.js\"],\n      \"name\": \"index.tsx_form_component_ds9jIPT1g9s\",\n      \"type\": \"chunk\",\n      \"dynamicImports\": [\"build/index.tsx_form_component_useStyles_0pasaG6nmEA.js\"],\n      \"fileName\": \"build/index.tsx_form_component_ds9jIPT1g9s.js\",\n      \"implicitlyLoadedBefore\": [],\n      \"importedBindings\": {\n        \"build/preload-helper.js\": [\"_\"],\n        \"build/qwik-city.js\": [\"N\"],\n        \"build/core.js\": [\"e\", \"h\", \"a\", \"_\", \"B\", \"q\"],\n        \"build/index3.js\": [\"useFormAction\"],\n        \"build/preloader.js\": []\n      },\n      \"imports\": [\n        \"build/preload-helper.js\",\n        \"build/qwik-city.js\",\n        \"build/core.js\",\n        \"build/index3.js\",\n        \"build/preloader.js\"\n      ],\n      \"modules\": {\n        \"/src/routes/form/index.tsx_form_component_ds9jIPT1g9s.js\": {\n          \"code\": \"<removed 64262 bytes>\",\n          \"originalLength\": 3160,\n          \"removedExports\": [],\n          \"renderedExports\": [\"s_ds9jIPT1g9s\"],\n          \"renderedLength\": 64262\n        }\n      },\n      \"referencedFiles\": [],\n      \"viteMetadata\": {\n        \"importedAssets\": {},\n        \"importedCss\": {}\n      },\n      \"code\": \"var _a;\\nimport { _ as __vitePreload } from \\\"./preload-helper.js\\\";\\nimport { N as Form } from \\\"./qwik-city.js\\\";\\nimport { e as _jsxBranch, h as useStylesQrl, a as _jsxQ, _ as _jsxC, B as _IMMUTABLE, q as qrl } from \\\"./core.js\\\";\\nimport { useFormAction } from \\\"./index3.js\\\";\\nimport \\\"./preloader.js\\\";\\nconsole.log(\\\">>> running\\\", \\\"/src/routes/form/index.tsx_form_component_ds9jIPT1g9s.js\\\");\\n(globalThis._loaded || (globalThis._loaded = [])).push(\\\"/src/routes/form/index.tsx_form_component_ds9jIPT1g9s.js\\\");\\nconst s_ds9jIPT1g9s = () => {\\n  var _a2;\\n  _jsxBranch();\\n  useStylesQrl(/* @__PURE__ */ qrl(() => __vitePreload(() => import(\\\"./index.tsx_form_component_useStyles_0pasaG6nmEA.js\\\"), true ? [] : void 0), \\\"s_0pasaG6nmEA\\\"));\\n  const action = useFormAction();\\n  return /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n    class: \\\"form-container\\\"\\n  }, [\\n    /* @__PURE__ */ _jsxQ(\\\"h1\\\", null, {\\n      class: \\\"title\\\"\\n    }, \\\"Contact Form\\\", 3, null),\\n    ((_a2 = action.value) == null ? void 0 : _a2.success) ? /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n      class: \\\"success-message\\\"\\n    }, \\\"Thank you for your submission!\\\", 3, \\\"sc_0\\\") : /* @__PURE__ */ _jsxC(Form, {\\n      action,\\n      class: \\\"form\\\",\\n      children: [\\n        /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n          class: \\\"form-group\\\"\\n        }, [\\n          /* @__PURE__ */ _jsxQ(\\\"label\\\", null, {\\n            for: \\\"name\\\",\\n            class: \\\"label\\\"\\n          }, \\\"Name\\\", 3, null),\\n          /* @__PURE__ */ _jsxQ(\\\"input\\\", null, {\\n            id: \\\"name\\\",\\n            name: \\\"name\\\",\\n            type: \\\"text\\\",\\n            class: \\\"input\\\",\\n            required: true\\n          }, null, 3, null)\\n        ], 3, null),\\n        /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n          class: \\\"form-group\\\"\\n        }, [\\n          /* @__PURE__ */ _jsxQ(\\\"label\\\", null, {\\n            for: \\\"email\\\",\\n            class: \\\"label\\\"\\n          }, \\\"Email\\\", 3, null),\\n          /* @__PURE__ */ _jsxQ(\\\"input\\\", null, {\\n            id: \\\"email\\\",\\n            name: \\\"email\\\",\\n            type: \\\"email\\\",\\n            class: \\\"input\\\",\\n            required: true\\n          }, null, 3, null)\\n        ], 3, null),\\n        /* @__PURE__ */ _jsxQ(\\\"div\\\", null, {\\n          class: \\\"form-group\\\"\\n        }, [\\n          /* @__PURE__ */ _jsxQ(\\\"label\\\", null, {\\n            for: \\\"message\\\",\\n            class: \\\"label\\\"\\n          }, \\\"Message\\\", 3, null),\\n          /* @__PURE__ */ _jsxQ(\\\"textarea\\\", null, {\\n            id: \\\"message\\\",\\n            name: \\\"message\\\",\\n            class: \\\"textarea\\\",\\n            required: true\\n          }, null, 3, null)\\n        ], 3, null),\\n        /* @__PURE__ */ _jsxQ(\\\"button\\\", null, {\\n          type: \\\"submit\\\",\\n          class: \\\"submit-button\\\"\\n        }, \\\"Submit\\\", 3, null)\\n      ],\\n      [_IMMUTABLE]: {\\n        action: _IMMUTABLE,\\n        class: _IMMUTABLE\\n      }\\n    }, 3, \\\"sc_1\\\")\\n  ], 1, \\\"sc_2\\\");\\n};\\n(_a = globalThis._fakeBulk) == null ? void 0 : _a.call(globalThis, \\\"nSAoVof+4jTD4WZso0ofXRXry5PtcAebYCfkZe/hLcCpzLnG0lSv7yh5p/77oAiARcWTYiJlnDz6FQPAzu53rg==QVqI/osX13ngRwEXcHENtuN4uoDN7gBgmdzwbFbxIzqXwNSQX8v+tl217vVWX5XpS3tLTgl6EUHGwZ0P0pZvYQ==0/GnOUDyFYqjtXpNiGKRZ71Vcslah4Lg+MUW396BkpbL3hrFrQvvb5Azy/JAnum4pLwXN5PQna3pl8Xo/QNSag==K/HUVLc/a4EG/x23XTh9dxAR4pSyaKZSsjzP0WBJfIOZ/PE1a51WYJ1W3mMcDeduuF5ygqz4EfaaBKiHch0p5w==OYr8n1nV/wnKgNkAcMCON1xISs8XTVy/8aUKowetIgWTsnJJr2rF86a2fmhZbYphA/UPjfYl4jcN0BrzuKDvtg==WEuloRy5Duk09KzWCfYfv4uLVtHqyLhGhknfNraAno9+sGYP+Mqor1hZS30C6mI6sJAlwr5HTC8uX7sM0dfJTA==KO5MJWUhSRijj97HZs5b/tHEWkg0KWu4ESYHEcd53Kv1+jcYliXpNjmZush2RA0IbQ1WcGqaQhh7RcqybS2bNg==punHw7nUy1KpICt9JCLJQUhhrXnNqOqhFKJTD9GyXBiKgDf5qHVfF5Rhe3sJIJTxhAfQc1KrwhPDIiyp6jSPXA==M9yO715EQq2sNo5B9/Rs/+ashZL/RH9qMZt+YAKib95om495zi+r6r52EqNTZeDAmPOkFEEdEKGOZ1/bh7dpyQ==74DG5er9f4u9z+Otye9PV2v93crD1IRJnC6aI6wA5OBckIoqe/MVTTdrpl44m0j/TPpJ0KEmhCJ+RW1mRR7oEg==dIw90guHlQtHDzctX92w9Xo0gRK4qN/8beRYmrmi4xqztoJnDaL9JYqzMYfk557+J284ul3V81/x89q4sr409w==5hRJlk4mjUdObzH07Zc1W9c4jf8ZtZ2gQdRIGMmGQgW+b1g/zWK5mveB1715nRjD0zE9Z0CTbGvcMHT1uUvHmQ==boqe5X51ZNPN95+jf/1qPrO+fFIezjshJOzwaIxXuuegvfiCFF/MKQLeNhGXA2odkEo3edU8abJc4UAK2aDUjw==R7CCIn6xwqIvnuYP6acDV3f2mUErqRzvh+sB9IQ6ymKGckW5GNwj5DeQ/7O71O2GEwUBgbcxXn/0tsPwXOB70g==rXDl5hErxIvCiUajwyS+TSZ5yR4W0yO6zNN29kzai+nL+wTD0zNakl0njAyYX6FVG/xKcm7q+6IUDy4v2J6GmQ==QRDdGl+mFIbPX5IWF3y0mp2CUDb3vl5hslQnZJsmwNX4wH9EGKsLLNR6OE1smFrVBnpq7IJMQ+DqjM2BlrdF1w==5LO/Vpm44dxZ/gpSuXwJzQR9ssGNEvfoejHkx7tbRmLxzQfDLENcAlwjKxKsreq5arsIl9FKlBopgsEj49p16A==h0xzmxfVxD9E0IJiTS+Da7+u5Au7e9bl67W6s8C/rquebDjZNHD6eZMF7CWJoGyFp7fZ1hnjfI+IXYw74Sx/Fw==tVo9Dd3+BUp7K1oh9s3WoDam1aRIuT/r973Dg+W2aBVRBR5/suXhvnSjtJcEa2TKAE+0I0gIf/0xuTcifYh6VA==Zfk0VZRQC9zH3BA0RiVCrvemEv2PgBgyRrbzdP4IVZ6qyexyfgG2mD0sy0Oaaf6lZaAI4YKAPgGMeAmmitQ/Xw==Gzvt3BZcyKnmiyGCmjWW7PY3rjkiAbzulwU7lAK2HvvKeFH4ol+RswcldW6uL+2WUFahThpYt/7+HOQEjGoXtA==b6zYE3Nfk3ofaczkjLYQaY7HWCdcVnuA9bmNAU8olca/xMH9iwiG6LW/gGIAXgnXLX6sTIDgeNLQ2JUiEvr3uQ==1zvVQVv5JxDN1SqD7cXnDaWstm65EaYXkkBpeirwzD4Znt7CrS3SJ1XUVGwJBifcoucY0bl6XEJq\",\n      \"map\": \"<removed>\",\n      \"preliminaryFileName\": \"build/index.tsx_form_component_ds9jIPT1g9s.js\",\n      \"sourcemapFileName\": null\n    },\n    \"q-manifest.json\": {\n      \"fileName\": \"q-manifest.json\",\n      \"names\": [],\n      \"needsCodeReference\": false,\n      \"originalFileName\": null,\n      \"originalFileNames\": [],\n      \"source\": \"<removed 38935 bytes>\",\n      \"type\": \"asset\"\n    },\n    \"build/q-bundle-graph-3c2vzr.json\": {\n      \"fileName\": \"build/q-bundle-graph-3c2vzr.json\",\n      \"names\": [],\n      \"needsCodeReference\": false,\n      \"originalFileName\": null,\n      \"originalFileNames\": [],\n      \"source\": \"<removed 3270 bytes>\",\n      \"type\": \"asset\"\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/image-size-runtime.html",
    "content": "<style>\n  [data-qwik-cls] {\n    outline: 2px solid red;\n  }\n  [data-qwik-cls]::after {\n    position: absolute;\n    font-size: 12px;\n    content: 'CLS ' attr(data-qwik-cls);\n    font-family: monospace;\n    font-weight: bold;\n    background: red;\n    color: white;\n    margin: -2px;\n    padding: 1px;\n    line-height: 1;\n    pointer-events: none;\n  }\n  #qwik-image-warning-container {\n    position: absolute !important;\n    top: 0 !important;\n    left: 0 !important;\n    width: 0 !important;\n    overflow: visible !important;\n    height: 0 !important;\n    pointer-events: none !important;\n    contain: size layout style content;\n    z-index: 1;\n  }\n</style>\n<template id=\"qwik-image-warning-template\">\n  <style>\n    :host {\n      position: absolute;\n      border: 1px solid red;\n      pointer-events: none;\n      z-index: 1;\n      contain: layout size;\n    }\n\n    #icon {\n      border: 0;\n      margin: 5px;\n      color: black;\n      max-width: 100%;\n      width: 20px;\n      background: yellow;\n      border-radius: 100%;\n      height: 20px;\n      padding: 3px;\n      pointer-events: all;\n      cursor: pointer;\n    }\n\n    #icon svg {\n      width: 100%;\n      height: auto;\n      pointer-events: none;\n    }\n\n    dialog {\n      padding: 0;\n      border: 0;\n      margin: 0 5px;\n      background: #ffffe8;\n      color: black;\n      width: 250px;\n      font-size: 11px;\n      position: absolute;\n      inset-inline-start: unset;\n      inset-inline-end: unset;\n      border-radius: 5px;\n      pointer-events: all;\n      overflow: hidden;\n      box-shadow: 0px -2px 20px 0px #0000002e;\n      z-index: 10000;\n    }\n\n    .top {\n      bottom: calc(100% + 5px);\n    }\n    .bottom {\n      top: 40px;\n    }\n    .right {\n      inset-inline-start: 0;\n      inset-inline-end: unset;\n    }\n    .left {\n      inset-inline-start: unset;\n      inset-inline-end: calc(100% - 40px);\n    }\n\n    .content {\n      padding: 5px;\n    }\n\n    #loc {\n      background: #2e3801;\n      color: #d2d2d2;\n      font-family: monospace;\n      padding: 3px 5px;\n      pointer-events: all;\n      margin: 0;\n      border: 0;\n      cursor: pointer;\n      font-size: 11px;\n      width: calc(100% - 24px);\n      text-overflow: ellipsis;\n      overflow: hidden;\n      display: block;\n      direction: rtl;\n      text-align: right;\n    }\n    #loc:hover {\n      background: #3a4a01;\n    }\n\n    pre {\n      background: #f1fb8e;\n      padding: 5px;\n      margin: 5px 0;\n      border-radius: 3px;\n      user-select: none;\n    }\n\n    pre span {\n      user-select: all;\n    }\n\n    a {\n      text-decoration: underline;\n    }\n\n    #close {\n      border: 0;\n      width: 25px;\n      height: 25px;\n      position: absolute;\n      right: 0;\n      top: 0;\n      background: #ffe14f;\n      color: black;\n      font-weight: 900;\n      padding: 0;\n      margin: 0;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      line-height: 1;\n      cursor: pointer;\n    }\n    #close:hover {\n      background: #ffeb6f;\n    }\n\n    #action-btn {\n      border: 2px solid #18ae00;\n      padding: 2px 4px;\n      background: #50ff50;\n      border-radius: 5px;\n      color: #0c5500;\n      font-weight: 800;\n      font-size: 10px;\n      cursor: pointer;\n    }\n\n    p {\n      margin: 5px 0;\n    }\n\n    h2 {\n      font-weight: 900;\n      margin: 10px 0;\n    }\n  </style>\n  <button id=\"icon\" type=\"button\" aria-label=\"Open image dev dialog\">\n    <svg width=\"32\" height=\"32\" viewBox=\"0 0 24 24\">\n      <path\n        fill=\"currentColor\"\n        d=\"M2.725 21q-.275 0-.5-.138t-.35-.362q-.125-.225-.138-.488t.138-.512l9.25-16q.15-.25.388-.375T12 3q.25 0 .488.125t.387.375l9.25 16q.15.25.138.513t-.138.487q-.125.225-.35.363t-.5.137H2.725ZM12 18q.425 0 .713-.288T13 17q0-.425-.288-.713T12 16q-.425 0-.713.288T11 17q0 .425.288.713T12 18Zm0-3q.425 0 .713-.288T13 14v-3q0-.425-.288-.713T12 10q-.425 0-.713.288T11 11v3q0 .425.288.713T12 15Z\"\n      />\n    </svg>\n  </button>\n  <dialog>\n    <form method=\"dialog\">\n      <button id=\"close\" type=\"submit\" aria-label=\"Close\">X</button>\n    </form>\n    <button id=\"loc\"></button>\n    <div class=\"content\">\n      <h2 id=\"title\"></h2>\n      <p id=\"message\"></p>\n      <p class=\"action-container\"></p>\n    </div>\n  </dialog>\n</template>\n<div id=\"qwik-image-warning-container\"></div>\n<script>\n  (function () {\n    function getPositionClasses(target) {\n      const { x, y } = target.getBoundingClientRect();\n      const windowWidth = window.innerWidth;\n      let horizontal = 'right';\n      let vertical = 'bottom';\n      if (x > windowWidth - 260) {\n        horizontal = 'left';\n      }\n      return `${vertical} ${horizontal}`;\n    }\n    class ImageWarning extends HTMLElement {\n      #actionFn = null;\n      constructor() {\n        super();\n        this.attachShadow({ mode: 'open' });\n        this.shadowRoot.appendChild(\n          document.importNode(document.getElementById('qwik-image-warning-template').content, true)\n        );\n        const dialog = this.shadowRoot.querySelector('dialog');\n\n        this.shadowRoot.addEventListener('click', async (ev) => {\n          const target = ev.target;\n          if (target.nodeName === 'BUTTON') {\n            if (target.id === 'action-btn') {\n              if (this.#actionFn) {\n                this.#actionFn();\n                dialog.close();\n              }\n            } else if (target.id === 'icon') {\n              if (dialog.open) {\n                dialog.close();\n              } else {\n                dialog.className = getPositionClasses(target);\n                dialog.show();\n              }\n            } else if (target.id === 'loc' && target.dataset.url) {\n              globalThis.qwikOpenInEditor(target.dataset.url);\n            }\n          }\n        });\n      }\n\n      set loc(value) {\n        const anchor = this.shadowRoot.querySelector('#loc');\n        anchor.textContent = value;\n        if (globalThis.qwikOpenInEditor) {\n          anchor.dataset.url = value;\n        }\n      }\n\n      set header(value) {\n        this.shadowRoot.querySelector('#title').textContent = value;\n      }\n\n      set message(value) {\n        this.shadowRoot.querySelector('#message').innerHTML = value;\n      }\n\n      set actionFn(value) {\n        this.#actionFn = value;\n      }\n      set actionName(value) {\n        if (value) {\n          this.shadowRoot.querySelector('.action-container').innerHTML =\n            `<button id=\"action-btn\" type=\"button\">${value}</button>`;\n        }\n      }\n    }\n    customElements.define('image-warning', ImageWarning);\n\n    const shiftsMap = new Map();\n    const visibleNodes = new Map();\n    const imageContainer = document.querySelector('#qwik-image-warning-container');\n    let skip = false;\n\n    async function _getInfo(originalSrc) {\n      // Put all supported protocols here, see also packages/qwik/src/optimizer/src/plugins/image-size-server.ts\n      if (!/^(https?|file|capacitor):/.test(originalSrc)) {\n        return undefined;\n      }\n      const url = new URL('/__image_info', location.href);\n      url.searchParams.set('url', originalSrc);\n      const res = await fetch(url);\n      if (res.ok) {\n        return await res.json();\n      } else {\n        return null;\n      }\n    }\n\n    const map = new Map();\n    function getInfo(originalSrc) {\n      let p = map.get(originalSrc);\n      if (typeof p === 'undefined') {\n        p = _getInfo(originalSrc);\n        map.set(originalSrc, p);\n      }\n      return p;\n    }\n    function isDefinedUnit(value) {\n      return value.endsWith('px');\n    }\n    async function doImg(node) {\n      const scrollX = window.scrollX;\n      const scrollY = window.scrollY;\n      const rect = node.getBoundingClientRect();\n      const originalSrc = node.currentSrc;\n      const info = await getInfo(originalSrc);\n      let overlay = visibleNodes.get(node);\n      const wideScreen = window.innerWidth > 500;\n      if (info && wideScreen) {\n        let layoutInvalidation = false;\n        const loc = node.getAttribute('data-qwik-inspector');\n        const browserArea = rect.width * rect.height;\n        if (!node.hasAttribute('width') || !node.hasAttribute('height')) {\n          skip = true;\n          const computedStyles = getComputedStyle(node);\n          const hasAspect = computedStyles.getPropertyValue('aspect-ratio').toString() !== 'auto';\n          const hasWidth = isDefinedUnit(computedStyles.getPropertyValue('width').toString());\n          const hasHeight = isDefinedUnit(computedStyles.getPropertyValue('height').toString());\n          const isAbsolute = computedStyles.getPropertyValue('position').toString() === 'absolute';\n          layoutInvalidation =\n            browserArea > 1000 && !isAbsolute && !hasAspect && (!hasWidth || !hasHeight);\n        }\n        const realArea = info.width && info.height;\n        const threshholdArea = realArea * 0.5;\n        const tooBig = browserArea < threshholdArea && info.type !== 'svg';\n        skip = false;\n        if (layoutInvalidation || tooBig) {\n          if (!overlay) {\n            overlay = document.createElement('image-warning');\n            imageContainer.appendChild(overlay);\n            visibleNodes.set(node, overlay);\n          }\n          overlay.style.top = rect.top + scrollY + 'px';\n          overlay.style.left = rect.left + scrollX + 'px';\n          overlay.style.width = rect.width + 'px';\n          overlay.style.height = rect.height + 'px';\n          overlay.info = info;\n          overlay.loc = loc;\n          if (layoutInvalidation) {\n            const clipBoard = `width=\"${info.width}\" height=\"${info.height}\"`;\n            overlay.header = 'Perf: layout shift';\n            overlay.message = `Image\\'s size is unknown until it\\'s loaded, <a href=\"https://web.dev/cls/\" target=\"_blank\" rel=\"noopener noreferrer\">causing layout shift</a>.</p><p>To solve this problem set the width/height in the img tag:</p><pre>&lt;img <span>${clipBoard}</span></pre>`;\n            const uniqueLoc =\n              document.querySelectorAll('[data-qwik-inspector=\"' + loc + '\"]').length === 1;\n            if (loc) {\n              if (uniqueLoc) {\n                overlay.actionName = 'Auto fix';\n                overlay.actionFn = async () => {\n                  const url = new URL('/__image_fix', location.href);\n                  url.searchParams.set('loc', loc);\n                  url.searchParams.set('width', info.width);\n                  url.searchParams.set('height', info.height);\n                  if (!node.srcset) {\n                    url.searchParams.set('src', node.currentSrc);\n                    url.searchParams.set('currentHref', location.href);\n                  }\n                  await fetch(url, {\n                    method: 'POST',\n                  });\n                };\n              } else {\n                overlay.actionName = 'Open in editor';\n                overlay.actionFn = async () => {\n                  await navigator.clipboard.writeText(clipBoard);\n                  globalThis.qwikOpenInEditor(loc);\n                };\n              }\n            }\n          } else if (tooBig) {\n            overlay.header = 'Perf: properly size image';\n            overlay.message = `The image is too big, <a href=\"https://developer.chrome.com/en/docs/lighthouse/performance/uses-responsive-images/\" target=\"_blank\" rel=\"noopener noreferrer\">hurting performance</a>, it should be resized to the size it\\'s displayed at. The image dimensions are ${info.width} x ${info.height} but it\\'s displayed at ${rect.width}x${rect.height}.</p>`;\n          }\n          return;\n        }\n      }\n\n      if (overlay) {\n        overlay.remove();\n        visibleNodes.delete(node);\n      }\n    }\n\n    async function updateImg(node) {\n      const overlay = visibleNodes.get(node);\n      if (!node.isConnected) {\n        if (overlay) {\n          overlay.remove();\n          visibleNodes.delete(node);\n        }\n      } else if (node.complete) {\n        doImg(node);\n      }\n    }\n\n    const resizeObserver = new ResizeObserver((entries) => {\n      if (!skip) {\n        for (const entry of entries) {\n          updateImg(entry.target);\n        }\n      }\n    });\n\n    const observer = new MutationObserver((entry) => {\n      for (const mutation of entry) {\n        for (const node of mutation.addedNodes) {\n          if (node.nodeName === 'IMG') {\n            resizeObserver.observe(node);\n          } else if (node.nodeType === 1) {\n            node.querySelectorAll('img').forEach((img) => {\n              resizeObserver.observe(img);\n            });\n          }\n        }\n        for (const node of mutation.removedNodes) {\n          if (node.nodeName === 'IMG') {\n            updateImg(node);\n            resizeObserver.unobserve(node);\n          } else if (node.nodeType === 1) {\n            node.querySelectorAll('img').forEach((img) => {\n              updateImg(img);\n              resizeObserver.unobserve(img);\n            });\n          }\n        }\n      }\n    });\n    let perfObserver;\n    let DCLS = 0;\n    const activate = () => {\n      setTimeout(() => {\n        if (perfObserver) {\n          perfObserver.disconnect();\n          if (DCLS > 0.005) {\n            console.error('Detected Layout Shift during page load', DCLS);\n          }\n        }\n        observer.observe(document.body, {\n          childList: true,\n          subtree: true,\n        });\n        document.body.querySelectorAll('img').forEach((node) => {\n          resizeObserver.observe(node);\n        });\n      }, 100);\n    };\n    if (document.readyState === 'complete') {\n      activate();\n    } else {\n      window.addEventListener('load', activate);\n    }\n    const pageAccessedByReload =\n      performance?.navigation.type === 1 ||\n      performance\n        .getEntriesByType('navigation')\n        .map((nav) => nav.type)\n        .includes('reload');\n    if (typeof PerformanceObserver !== 'undefined' && !pageAccessedByReload) {\n      const shiftsMap = new Map();\n      perfObserver = new PerformanceObserver((list) => {\n        list.getEntries().forEach((entry) => {\n          if (entry.hadRecentInput) {\n            return; // Ignore shifts after recent input.\n          }\n          if (entry.value > 0.006) {\n            for (const source of entry.sources) {\n              if (\n                source.node &&\n                source.node.nodeType === 1 &&\n                source.node.nodeName !== 'IMAGE-WARNING'\n              ) {\n                source.node.setAttribute('data-qwik-cls', Number(entry.value).toFixed(3));\n              }\n            }\n          }\n          DCLS += entry.value;\n        });\n      });\n      perfObserver.observe({ type: 'layout-shift', buffered: true });\n    }\n  })();\n</script>\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/image-size-server.ts",
    "content": "import bmp_1 from 'image-size/dist/types/bmp.js';\nimport cur_1 from 'image-size/dist/types/cur.js';\nimport dds_1 from 'image-size/dist/types/dds.js';\nimport gif_1 from 'image-size/dist/types/gif.js';\nimport icns_1 from 'image-size/dist/types/icns.js';\nimport ico_1 from 'image-size/dist/types/ico.js';\nimport j2c_1 from 'image-size/dist/types/j2c.js';\nimport jp2_1 from 'image-size/dist/types/jp2.js';\nimport jpg_1 from 'image-size/dist/types/jpg.js';\nimport ktx_1 from 'image-size/dist/types/ktx.js';\nimport png_1 from 'image-size/dist/types/png.js';\nimport pnm_1 from 'image-size/dist/types/pnm.js';\nimport psd_1 from 'image-size/dist/types/psd.js';\nimport svg_1 from 'image-size/dist/types/svg.js';\nimport tga_1 from 'image-size/dist/types/tga.js';\nimport webp_1 from 'image-size/dist/types/webp.js';\nimport heif_1 from 'image-size/dist/types/heif.js';\n\nimport type { Connect } from 'vite';\nimport type { OptimizerSystem } from '../types';\nimport { formatError } from './vite-utils';\n\n// This map helps avoid validating for every single image type\nconst firstBytes: Record<number, keyof typeof types> = {\n  0x38: 'psd',\n  0x42: 'bmp',\n  0x44: 'dds',\n  0x47: 'gif',\n  0x52: 'webp',\n  0x69: 'icns',\n  0x89: 'png',\n  0xff: 'jpg',\n};\n\n// Put in order of most common to least common\nconst types = {\n  webp: webp_1.WEBP,\n  jpg: jpg_1.JPG,\n  png: png_1.PNG,\n  svg: svg_1.SVG,\n  gif: gif_1.GIF,\n  avif: heif_1.HEIF,\n  bmp: bmp_1.BMP,\n  cur: cur_1.CUR,\n  dds: dds_1.DDS,\n  icns: icns_1.ICNS,\n  ico: ico_1.ICO,\n  j2c: j2c_1.J2C,\n  jp2: jp2_1.JP2,\n  ktx: ktx_1.KTX,\n  pnm: pnm_1.PNM,\n  psd: psd_1.PSD,\n  tga: tga_1.TGA,\n};\n\nconst keys = Object.keys(types) as (keyof typeof types)[];\n\nfunction detector(buffer: Buffer): keyof typeof types | undefined {\n  const byte = buffer[0];\n  const type = firstBytes[byte];\n  if (type && types[type].validate(buffer)) {\n    return type;\n  }\n  return keys.find((key) => types[key].validate(buffer));\n}\n\nfunction lookup(buffer: Buffer) {\n  // detect the file type, don't rely on the extension\n  const type = detector(buffer);\n  if (typeof type !== 'undefined') {\n    // find an appropriate handler for this file type\n    const size = types[type].calculate(buffer);\n    if (size !== undefined) {\n      size.type = type;\n      return size;\n    }\n  }\n}\nexport async function getInfoForSrc(src: string) {\n  // Put all supported protocols here\n  if (!/^(https?|file|capacitor):/.test(src)) {\n    return undefined;\n  }\n  try {\n    const res = await fetch(src, {\n      headers: { Accept: 'image/*,*/*' },\n    });\n    if (!res.ok) {\n      console.error('can not fetch', src);\n      return undefined;\n    }\n    const buffer = await res.arrayBuffer();\n    const size = lookup(Buffer.from(buffer));\n    if (size) {\n      return {\n        width: size.width,\n        height: size.height,\n        type: size.type,\n        size: buffer.byteLength,\n      };\n    }\n  } catch (err) {\n    console.error(err);\n    return undefined;\n  }\n}\n\nexport const getImageSizeServer = (\n  sys: OptimizerSystem,\n  rootDir: string,\n  srcDir: string\n): Connect.NextHandleFunction => {\n  return async (req, res, next) => {\n    try {\n      const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n      const path: typeof import('path') = await sys.dynamicImport('node:path');\n\n      let url;\n      try {\n        url = new URL(req.url!, 'http://localhost:3000/');\n      } catch {\n        res.statusCode = 404;\n        res.end();\n        return;\n      }\n      if (req.method === 'GET' && url.pathname === '/__image_info') {\n        const imageURL = url.searchParams.get('url');\n        res.setHeader('content-type', 'application/json');\n        if (imageURL) {\n          const info = await getInfoForSrc(imageURL);\n          res.setHeader('cache-control', 'public, max-age=31536000, immutable');\n          if (!info) {\n            res.statusCode = 404;\n          } else {\n            res.write(JSON.stringify(info));\n          }\n        } else {\n          res.statusCode = 500;\n          const info = { message: 'error' };\n          res.write(JSON.stringify(info));\n        }\n        res.end();\n        return;\n      } else if (req.method === 'POST' && url.pathname === '/__image_fix') {\n        const loc = url.searchParams.get('loc') as string;\n        const width = url.searchParams.get('width');\n        const height = url.searchParams.get('height');\n        const src = url.searchParams.get('src') as string;\n        const currentHref = url.searchParams.get('currentHref') as string;\n\n        const locParts = loc.split(':');\n        const column = parseInt(locParts[locParts.length - 1], 10) - 1;\n        let line = parseInt(locParts[locParts.length - 2], 10) - 1;\n        const filePath = path.resolve(srcDir, locParts.slice(0, locParts.length - 2).join(':'));\n        const extension = path.extname(filePath).toLowerCase();\n        const buffer = fs.readFileSync(filePath);\n        let text = buffer.toString('utf-8');\n\n        let offset = 0;\n        for (; offset < text.length; offset++) {\n          if (line === 0) {\n            offset += column;\n            break;\n          } else if (text[offset] === '\\n') {\n            line--;\n            continue;\n          }\n        }\n\n        if (text.slice(offset, offset + 4) !== '<img') {\n          console.error(\n            'Could not apply auto fix, because it was not possible to find the original <img> tag'\n          );\n          res.statusCode = 500;\n          return;\n        }\n\n        const end = text.indexOf('>', offset) + 1;\n        if (end < offset) {\n          console.error(\n            'Could not apply auto fix, because it was not possible to find the original <img> tag'\n          );\n          res.statusCode = 500;\n          return;\n        }\n\n        const extensionSupportsImport = ['.ts', '.tsx', '.js', '.jsx', '.mdx'].includes(extension);\n        let imgTag = text.slice(offset, end);\n        if (src && currentHref && extensionSupportsImport) {\n          const urlSrc = new URL(src);\n          const urlCurrent = new URL(currentHref);\n          if (urlSrc.origin === urlCurrent.origin) {\n            const publicImagePath = path.join(rootDir, 'public', urlSrc.pathname);\n            const rootImagePath = path.join(rootDir, urlSrc.pathname);\n            let relativeLocation: string;\n            if (fs.existsSync(publicImagePath)) {\n              const mediaSrc = path.join(srcDir, 'media', path.dirname(urlSrc.pathname));\n              await fs.promises.mkdir(mediaSrc, { recursive: true });\n              await fs.promises.copyFile(\n                publicImagePath,\n                path.join(srcDir, 'media', urlSrc.pathname)\n              );\n              relativeLocation = '~/media' + urlSrc.pathname;\n            } else if (fs.existsSync(rootImagePath)) {\n              relativeLocation = urlSrc.pathname.replace('/src/', '~/');\n            } else {\n              return;\n            }\n            const importIdent = imgImportName(urlSrc.pathname);\n            const importSrc = `${relativeLocation}?jsx`;\n            imgTag = imgTag.replace(/^<img/, `<${importIdent}`);\n            imgTag = imgTag.replace(/\\bwidth=(({[^}]*})|('[^']*')|(\"[^\"]*\"))\\s*/, ``);\n            imgTag = imgTag.replace(/\\bheight=(({[^}]*})|('[^']*')|(\"[^\"]*\"))\\s*/, ``);\n            imgTag = imgTag.replace(/\\bsrc=(({[^}]*})|('[^']*')|(\"[^\"]*\"))\\s*/, ``);\n\n            let insertImport = 0;\n            if (extension === '.mdx' && text.startsWith('---')) {\n              insertImport = text.indexOf('---', 4) + 3;\n              if (insertImport === -1) {\n                return;\n              }\n            }\n            const newImport = `\\nimport ${importIdent} from '${importSrc}';`;\n            text = `${text.slice(0, insertImport)}${newImport}${text.slice(\n              insertImport,\n              offset\n            )}${imgTag}${text.slice(end)}`;\n            fs.writeFileSync(filePath, text);\n            return;\n          }\n        }\n\n        imgTag = imgTag.replace(/\\bwidth=(({[^}]*})|('[^']*')|(\"[^\"]*\"))/, `width=\"${width}\"`);\n        imgTag = imgTag.replace(/\\bheight=(({[^}]*})|('[^']*')|(\"[^\"]*\"))/, `height=\"${height}\"`);\n        if (!imgTag.includes('height=')) {\n          imgTag = imgTag.replace(/<img/, `<img height=\"${height}\"`);\n        }\n        if (!imgTag.includes('width=')) {\n          imgTag = imgTag.replace(/<img/, `<img width=\"${width}\"`);\n        }\n        text = text.slice(0, offset) + imgTag + text.slice(end);\n        fs.writeFileSync(filePath, text);\n      } else {\n        next();\n      }\n    } catch (e) {\n      if (e instanceof Error) {\n        await formatError(sys, e);\n      }\n      next(e);\n    }\n  };\n};\n\nfunction imgImportName(value: string) {\n  const dot = value.lastIndexOf('.');\n  const slash = value.lastIndexOf('/');\n  value = value.substring(slash + 1, dot);\n  return `Img${toPascalCase(value)}`;\n}\n\nfunction toPascalCase(string: string) {\n  return `${string}`\n    .toLowerCase()\n    .replace(new RegExp(/[-_]+/, 'g'), ' ')\n    .replace(new RegExp(/[^\\w\\s]/, 'g'), '')\n    .replace(new RegExp(/\\s+(.)(\\w*)/, 'g'), ($1, $2, $3) => `${$2.toUpperCase() + $3}`)\n    .replace(new RegExp(/\\w/), (s) => s.toUpperCase());\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/perf-warning.html",
    "content": "<script>\n  if (!window.__qwikViteLog) {\n    window.__qwikViteLog = true;\n    console.debug(\n      '%c⭐️ Qwik Dev SSR Mode',\n      'background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;',\n      \"App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'\"\n    );\n  }\n</script>\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/plugin.ts",
    "content": "import type { ManualChunksOption } from 'rollup';\nimport type { HmrContext, Plugin, Rollup, ViteDevServer } from 'vite';\nimport type { BundleGraphAdder } from '..';\nimport { hashCode } from '../../../core/util/hash_code';\nimport { generateManifestFromBundles, getValidManifest } from '../manifest';\nimport { createOptimizer } from '../optimizer';\nimport type {\n  Diagnostic,\n  EntryStrategy,\n  GlobalInjections,\n  Optimizer,\n  OptimizerOptions,\n  OptimizerSystem,\n  QwikManifest,\n  SegmentAnalysis,\n  ServerQwikManifest,\n  SmartEntryStrategy,\n  TransformModule,\n  TransformModuleInput,\n  TransformModulesOptions,\n  TransformOutput,\n} from '../types';\nimport { convertManifestToBundleGraph } from './bundle-graph';\nimport { createLinter, type QwikLinter } from './eslint-plugin';\nimport { isWin, parseId } from './vite-utils';\n\nconst REG_CTX_NAME = ['server'];\n\nconst SERVER_STRIP_EXPORTS = [\n  'onGet',\n  'onPost',\n  'onPut',\n  'onRequest',\n  'onDelete',\n  'onHead',\n  'onOptions',\n  'onPatch',\n  'onStaticGenerate',\n];\n\nconst SERVER_STRIP_CTX_NAME = [\n  'useServer',\n  'route',\n  'server',\n  'action$',\n  'loader$',\n  'zod$',\n  'validator$',\n  'globalAction$',\n];\nconst CLIENT_STRIP_CTX_NAME = [\n  'useClient',\n  'useBrowser',\n  'useVisibleTask',\n  'client',\n  'browser',\n  'event$',\n];\n\n/**\n * Use `__EXPERIMENTAL__.x` to check if feature `x` is enabled. It will be replaced with `true` or\n * `false` via an exact string replacement.\n *\n * Add experimental features to this enum definition.\n *\n * @alpha\n */\nexport enum ExperimentalFeatures {\n  /** Enable the usePreventNavigate hook */\n  preventNavigate = 'preventNavigate',\n  /** Enable the Valibot form validation */\n  valibot = 'valibot',\n  /** Disable SPA navigation handler in Qwik City */\n  noSPA = 'noSPA',\n  /** Enable request.rewrite() */\n  enableRequestRewrite = 'enableRequestRewrite',\n}\n\nexport interface QwikPackages {\n  id: string;\n  path: string;\n}\n\nexport function createQwikPlugin(optimizerOptions: OptimizerOptions = {}) {\n  const id = `${Math.round(Math.random() * 899) + 100}`;\n\n  const clientResults = new Map<string, TransformOutput>();\n  const clientTransformedOutputs = new Map<string, [TransformModule, string]>();\n\n  const serverTransformedOutputs = new Map<string, [TransformModule, string]>();\n  const parentIds = new Map<string, string>();\n\n  let internalOptimizer: Optimizer | null = null;\n  let linter: QwikLinter | undefined = undefined;\n  let diagnosticsCallback: (\n    d: Diagnostic[],\n    optimizer: Optimizer,\n    srcDir: string\n  ) => void = () => {};\n\n  const opts: NormalizedQwikPluginOptions = {\n    csr: false,\n    target: 'client',\n    buildMode: 'development',\n    debug: false,\n    rootDir: null as any,\n    tsconfigFileNames: ['./tsconfig.json'],\n    input: null as any,\n    outDir: '',\n    assetsDir: null as any,\n    resolveQwikBuild: true,\n    entryStrategy: null as any,\n    srcDir: null as any,\n    srcInputs: null as any,\n    sourcemap: !!optimizerOptions.sourcemap,\n    manifestInput: null,\n    manifestOutput: null,\n    transformedModuleOutput: null,\n    scope: null,\n    devTools: {\n      imageDevTools: true,\n      clickToSource: ['Alt'],\n    },\n    inlineStylesUpToBytes: 20000,\n    lint: false,\n    experimental: undefined,\n  };\n\n  let lazyNormalizePath: (id: string) => string;\n  const init = async () => {\n    if (!internalOptimizer) {\n      internalOptimizer = await createOptimizer(optimizerOptions);\n      lazyNormalizePath = makeNormalizePath(internalOptimizer.sys);\n    }\n  };\n\n  const getOptimizer = () => {\n    if (!internalOptimizer) {\n      throw new Error(`Qwik plugin has not been initialized`);\n    }\n    return internalOptimizer;\n  };\n\n  const getSys = () => {\n    const optimizer = getOptimizer();\n    return optimizer.sys;\n  };\n\n  const getPath = () => {\n    const optimizer = getOptimizer();\n    return optimizer.sys.path;\n  };\n\n  let devServer: ViteDevServer | undefined;\n  const configureServer = (server: ViteDevServer) => {\n    devServer = server;\n  };\n\n  /** Note that as a side-effect this updates the internal plugin `opts` */\n  const normalizeOptions = (inputOpts?: QwikPluginOptions) => {\n    const updatedOpts: QwikPluginOptions = Object.assign({}, inputOpts);\n\n    const optimizer = getOptimizer();\n    const path = optimizer.sys.path;\n\n    opts.debug = !!updatedOpts.debug;\n\n    if (updatedOpts.assetsDir) {\n      opts.assetsDir = updatedOpts.assetsDir;\n    }\n\n    if (\n      updatedOpts.target === 'ssr' ||\n      updatedOpts.target === 'client' ||\n      updatedOpts.target === 'lib' ||\n      updatedOpts.target === 'test'\n    ) {\n      opts.target = updatedOpts.target;\n    } else {\n      opts.target ||= 'client';\n    }\n\n    if (opts.target === 'lib') {\n      opts.buildMode = 'development';\n    } else if (updatedOpts.buildMode === 'production' || updatedOpts.buildMode === 'development') {\n      opts.buildMode = updatedOpts.buildMode;\n    } else {\n      opts.buildMode ||= 'development';\n    }\n\n    if (updatedOpts.entryStrategy && typeof updatedOpts.entryStrategy === 'object') {\n      opts.entryStrategy = { ...updatedOpts.entryStrategy };\n    }\n    if (!opts.entryStrategy) {\n      if (opts.target === 'ssr' || opts.target === 'test') {\n        opts.entryStrategy = { type: 'hoist' };\n      } else if (opts.target === 'lib') {\n        opts.entryStrategy = { type: 'inline' };\n      } else {\n        if (opts.buildMode === 'production') {\n          opts.entryStrategy = { type: 'smart' };\n        } else {\n          opts.entryStrategy = { type: 'segment' };\n        }\n      }\n    }\n\n    if (typeof updatedOpts.rootDir === 'string') {\n      opts.rootDir = updatedOpts.rootDir;\n    }\n    if (typeof opts.rootDir !== 'string') {\n      opts.rootDir ||= optimizer.sys.cwd();\n    }\n    opts.rootDir = normalizePath(path.resolve(optimizer.sys.cwd(), opts.rootDir));\n    let srcDir = normalizePath(path.resolve(opts.rootDir, SRC_DIR_DEFAULT));\n    if (typeof updatedOpts.srcDir === 'string') {\n      opts.srcDir = normalizePath(path.resolve(opts.rootDir, updatedOpts.srcDir));\n      srcDir = opts.srcDir;\n      opts.srcInputs = null;\n    } else if (Array.isArray(updatedOpts.srcInputs)) {\n      opts.srcInputs = [...updatedOpts.srcInputs];\n      opts.srcDir = null;\n    } else {\n      opts.srcDir ||= srcDir;\n    }\n\n    if (Array.isArray(updatedOpts.tsconfigFileNames) && updatedOpts.tsconfigFileNames.length > 0) {\n      opts.tsconfigFileNames = updatedOpts.tsconfigFileNames;\n    }\n\n    if (Array.isArray(opts.srcInputs)) {\n      opts.srcInputs.forEach((i) => {\n        i.path = normalizePath(path.resolve(opts.rootDir, i.path));\n      });\n    } else if (typeof opts.srcDir === 'string') {\n      opts.srcDir = normalizePath(path.resolve(opts.rootDir, normalizePath(opts.srcDir)));\n    }\n\n    if (!updatedOpts.csr) {\n      if (Array.isArray(updatedOpts.input)) {\n        opts.input = [...updatedOpts.input];\n      } else if (typeof updatedOpts.input === 'string') {\n        opts.input = [updatedOpts.input];\n      } else {\n        if (opts.target === 'ssr') {\n          // ssr input default\n          opts.input ||= [path.resolve(srcDir, 'entry.ssr')];\n        } else if (opts.target === 'client') {\n          // client input default\n          opts.input ||= [path.resolve(srcDir, 'root')];\n        } else if (opts.target === 'lib') {\n          if (typeof updatedOpts.input === 'object') {\n            for (const key in updatedOpts.input) {\n              const resolvedPaths: { [key: string]: string } = {};\n              if (Object.hasOwnProperty.call(updatedOpts.input, key)) {\n                const relativePath = updatedOpts.input[key];\n                const absolutePath = path.resolve(opts.rootDir, relativePath);\n                resolvedPaths[key] = absolutePath;\n              }\n\n              opts.input = { ...opts.input, ...resolvedPaths };\n            }\n          } else {\n            // lib input default\n            opts.input ||= [path.resolve(srcDir, 'index.ts')];\n          }\n        } else {\n          opts.input ||= [];\n        }\n      }\n      if (Array.isArray(opts.input)) {\n        opts.input = opts.input.reduce((inputs, i) => {\n          let input = i;\n          if (!i.startsWith('@') && !i.startsWith('~') && !i.startsWith('#')) {\n            input = normalizePath(path.resolve(opts.rootDir, i));\n          }\n          if (!inputs.includes(input)) {\n            inputs.push(input);\n          }\n          return inputs;\n        }, [] as string[]);\n      }\n\n      if (typeof updatedOpts.outDir === 'string') {\n        opts.outDir = normalizePath(path.resolve(opts.rootDir, normalizePath(updatedOpts.outDir)));\n      } else if (!opts.outDir) {\n        if (opts.target === 'ssr') {\n          opts.outDir = normalizePath(path.resolve(opts.rootDir, SSR_OUT_DIR));\n        } else if (opts.target === 'lib') {\n          opts.outDir = normalizePath(path.resolve(opts.rootDir, LIB_OUT_DIR));\n        } else {\n          opts.outDir = normalizePath(path.resolve(opts.rootDir, CLIENT_OUT_DIR));\n        }\n      }\n    }\n\n    if (typeof updatedOpts.manifestOutput === 'function') {\n      opts.manifestOutput = updatedOpts.manifestOutput;\n    }\n\n    const clientManifest = getValidManifest(updatedOpts.manifestInput);\n    if (clientManifest) {\n      opts.manifestInput = clientManifest;\n    }\n\n    if (typeof updatedOpts.transformedModuleOutput === 'function') {\n      opts.transformedModuleOutput = updatedOpts.transformedModuleOutput;\n    }\n\n    if (updatedOpts.scope !== undefined) {\n      opts.scope = updatedOpts.scope;\n    }\n\n    if (typeof updatedOpts.resolveQwikBuild === 'boolean') {\n      opts.resolveQwikBuild = updatedOpts.resolveQwikBuild;\n    }\n\n    if (typeof updatedOpts.devTools === 'object') {\n      if ('imageDevTools' in updatedOpts.devTools) {\n        opts.devTools.imageDevTools = updatedOpts.devTools.imageDevTools;\n      }\n\n      if ('clickToSource' in updatedOpts.devTools) {\n        opts.devTools.clickToSource = updatedOpts.devTools.clickToSource;\n      }\n    }\n    opts.csr = !!updatedOpts.csr;\n\n    if ('inlineStylesUpToBytes' in optimizerOptions) {\n      if (typeof optimizerOptions.inlineStylesUpToBytes === 'number') {\n        opts.inlineStylesUpToBytes = optimizerOptions.inlineStylesUpToBytes;\n      } else if (typeof opts.inlineStylesUpToBytes !== 'number' || opts.inlineStylesUpToBytes < 0) {\n        opts.inlineStylesUpToBytes = 0;\n      }\n    }\n\n    if (typeof updatedOpts.lint === 'boolean') {\n      opts.lint = updatedOpts.lint;\n    }\n\n    if ('experimental' in updatedOpts) {\n      opts.experimental = undefined;\n      for (const feature of updatedOpts.experimental ?? []) {\n        if (!ExperimentalFeatures[feature as ExperimentalFeatures]) {\n          console.error(`Qwik plugin: Unknown experimental feature: ${feature}`);\n        } else {\n          (opts.experimental ||= {} as any)[feature] = true;\n        }\n      }\n    }\n\n    return { ...opts };\n  };\n\n  let hasValidatedSource = false;\n\n  const validateSource = async (resolver: (id: string) => Promise<unknown | undefined>) => {\n    if (!hasValidatedSource) {\n      hasValidatedSource = true;\n\n      const sys = getSys();\n      if (sys.env === 'node') {\n        const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n        if (!fs.existsSync(opts.rootDir)) {\n          throw new Error(`Qwik rootDir \"${opts.rootDir}\" not found.`);\n        }\n        if (typeof opts.srcDir === 'string' && !fs.existsSync(opts.srcDir)) {\n          throw new Error(`Qwik srcDir \"${opts.srcDir}\" not found.`);\n        }\n        for (const [_, input] of Object.entries(opts.input || {})) {\n          const resolved = await resolver(input);\n          if (!resolved) {\n            throw new Error(`Qwik input \"${input}\" not found.`);\n          }\n        }\n      }\n    }\n  };\n\n  let optimizer: Optimizer;\n  const buildStart = async (_ctx: Rollup.PluginContext) => {\n    debug(`buildStart()`, opts.buildMode, opts.scope, opts.target, opts.rootDir, opts.srcDir);\n    optimizer = getOptimizer();\n    if (optimizer.sys.env === 'node' && opts.target === 'ssr' && opts.lint) {\n      try {\n        linter = await createLinter(optimizer.sys, opts.rootDir, opts.tsconfigFileNames);\n      } catch {\n        // Nothing\n      }\n    }\n\n    const path = getPath();\n\n    if (Array.isArray(opts.srcInputs)) {\n      optimizer.sys.getInputFiles = async (rootDir) =>\n        opts.srcInputs!.map((i) => {\n          const relInput: TransformModuleInput = {\n            path: normalizePath(path.relative(rootDir, i.path)),\n            code: i.code,\n          };\n          return relInput;\n        });\n      debug(`buildStart() opts.srcInputs (${opts.srcInputs.length} files)`);\n    }\n\n    debug(`transformedOutputs.clear()`);\n    clientTransformedOutputs.clear();\n    serverTransformedOutputs.clear();\n\n    if (opts.target === 'client') {\n      const ql = await _ctx.resolve('@builder.io/qwik/qwikloader.js', undefined, {\n        skipSelf: true,\n      });\n      if (ql) {\n        _ctx.emitFile({\n          id: ql.id,\n          type: 'chunk',\n          preserveSignature: 'allow-extension',\n        });\n      }\n    }\n  };\n\n  const getIsServer = (viteOpts?: { ssr?: boolean }) => {\n    return devServer ? !!viteOpts?.ssr : opts.target === 'ssr' || opts.target === 'test';\n  };\n\n  let resolveIdCount = 0;\n  let doNotEdit = false;\n  /**\n   * This resolves virtual names and QRL segments/entries. All the rest falls through. We must\n   * always return a value for QRL segments because they don't exist on disk.\n   *\n   * Note: During development, the QRL filenames will be of the form\n   * `${parentUrl}_${name}_${hash}.js`, and we might get requests for QRLs from the client before\n   * the parent was built. That means we need to recover the parent from the URL and then in the\n   * `load()` phase ensure it is built first.\n   */\n  const resolveId = async (\n    ctx: Rollup.PluginContext,\n    id: string,\n    importerId: string | undefined,\n    resolveOpts?: Parameters<Extract<Plugin['resolveId'], Function>>[2]\n  ) => {\n    if (id.startsWith('\\0')) {\n      return;\n    }\n\n    // Intercept requests to open in editor\n    const editMatch = devServer && /^(.*)\\?editor(:(\\d+)(:\\d+)?)?$/.exec(id);\n    if (editMatch) {\n      // Throttle so we don't open multiple times on re-resolve\n      if (!doNotEdit) {\n        doNotEdit = true;\n        setTimeout(() => (doNotEdit = false), 500);\n\n        const [, origId, location] = editMatch;\n        // Find the actual file on disk by asking vite to resolve it\n        const resolved = await ctx.resolve(origId, importerId);\n        if (resolved) {\n          const file = devServer!.moduleGraph.getModuleById(resolved.id)?.file;\n          if (file) {\n            const path = `${file}${location}`;\n            try {\n              console.warn(`Opening in editor: ${path}`);\n              const launchEditor = (await import('launch-editor')).default;\n              launchEditor(path);\n            } catch (e: any) {\n              console.error(`Failed to open editor: ${e.message}`);\n            }\n          }\n        }\n      }\n      return { id: `\\0editor` };\n    }\n\n    const count = resolveIdCount++;\n    const isServer = getIsServer(resolveOpts);\n    debug(`resolveId(${count})`, `begin ${id} | ${isServer ? 'server' : 'client'} | ${importerId}`);\n\n    const parsedImporterId = importerId && parseId(importerId);\n    importerId = parsedImporterId && normalizePath(parsedImporterId.pathId);\n\n    // Relative paths must be resolved vs the importer\n    if (id.startsWith('.') && parsedImporterId) {\n      const path = getPath();\n      const importerDir = path.dirname(parsedImporterId.pathId);\n      if (importerDir) {\n        id = path.resolve(importerDir, id);\n      }\n    }\n\n    // Split query, remove windows path encoding etc\n    const parsedId = parseId(id);\n    const pathId = normalizePath(parsedId.pathId);\n\n    let result: Rollup.ResolveIdResult;\n\n    /** At this point, the request has been normalized. */\n\n    if (\n      /**\n       * Check if we know the QRL. During regular builds, we'll encounter and build parents before\n       * their QRLs, so this will always match.\n       */\n      parentIds.get(pathId)\n    ) {\n      debug(`resolveId(${count}) Resolved already known ${pathId}`);\n      result = {\n        id: pathId + parsedId.query,\n        moduleSideEffects: false,\n      };\n    } else if (\n      /**\n       * Now the requests we handle are for one of the virtual modules, or a QRL segment that hasn't\n       * been transformed yet.\n       */\n\n      // We test with endsWith because the dev server adds the base pathname\n      pathId.endsWith(QWIK_BUILD_ID)\n    ) {\n      if (opts.resolveQwikBuild) {\n        debug(`resolveId(${count})`, 'Resolved', QWIK_BUILD_ID);\n        result = {\n          id: QWIK_BUILD_ID,\n          moduleSideEffects: false,\n        };\n      }\n    } else if (pathId.endsWith(QWIK_CLIENT_MANIFEST_ID)) {\n      debug(`resolveId(${count})`, 'Resolved', QWIK_CLIENT_MANIFEST_ID);\n      result = {\n        id: QWIK_CLIENT_MANIFEST_ID,\n        moduleSideEffects: false,\n      };\n    } else if (!devServer && !isServer && pathId.endsWith(QWIK_PRELOADER_ID)) {\n      debug(`resolveId(${count})`, 'Resolved', QWIK_PRELOADER_ID);\n      const preloader = await ctx.resolve(QWIK_PRELOADER_ID, importerId, {\n        skipSelf: true,\n      });\n      if (preloader) {\n        ctx.emitFile({\n          id: preloader.id,\n          type: 'chunk',\n          preserveSignature: 'allow-extension',\n        });\n        return preloader;\n      }\n    } else {\n      const qrlMatch = /^(?<parent>.*\\.[mc]?[jt]sx?)_(?<name>[^/]+)\\.js(?<query>$|\\?.*$)/.exec(id)\n        ?.groups as { parent: string; name: string; query: string } | undefined;\n\n      /**\n       * If this looks like a dev qrl filename, it doesn't matter who imports, we have the parentId\n       * embedded.\n       */\n      if (qrlMatch) {\n        const { parent, name, query } = qrlMatch;\n\n        const resolvedParent = await ctx.resolve(parent, importerId, { skipSelf: true });\n        if (resolvedParent) {\n          // Vite likes to add ?v=1234... to the end of the id\n          const parentId = resolvedParent.id.split('?')[0];\n          /**\n           * A request possibly from the browser. It could be our own QRL request or an import URL\n           * generated by vite. In any case, only Vite fully knows how to resolve it. Therefore, we\n           * must recombine the resolved parent path with the QRL name.\n           */\n          const isDevUrl = devServer && importerId?.endsWith('.html');\n          const resolvedId = isDevUrl ? `${parentId}_${name}.js` : pathId;\n          debug(`resolveId(${count})`, `resolved to QRL ${name} of ${parentId}`);\n          // Save for lookup by load()\n          parentIds.set(resolvedId, parentId);\n          result = {\n            id: resolvedId + query,\n            // QRL segments can't have side effects. Probably never useful, but it's here for consistency\n            moduleSideEffects: false,\n          };\n        } else {\n          console.error(`resolveId(${count})`, `QRL parent ${parent} does not exist!`);\n        }\n      } else if (importerId) {\n        /**\n         * When we get here it's neither a virtual module nor a QRL segment. However, Rollup can ask\n         * us to resolve imports from QRL segments. It seems like importers need to exist on disk\n         * for this to work automatically, so for segments we resolve via the parent instead.\n         *\n         * Note that when a this happens, the segment was already resolved and transformed, so we\n         * know about it.\n         */\n        const importerParentId = parentIds.get(importerId);\n        if (importerParentId) {\n          debug(`resolveId(${count}) end`, `resolving via ${importerParentId}`);\n          // This returns a promise that we can't await because of deadlocking\n          return ctx.resolve(id, importerParentId, { skipSelf: true });\n        }\n      }\n    }\n\n    debug(`resolveId(${count}) end`, (result as any)?.id || result);\n    return result;\n  };\n\n  let loadCount = 0;\n  const load = async (\n    ctx: Rollup.PluginContext,\n    id: string,\n    loadOpts?: Parameters<Extract<Plugin['load'], Function>>[1]\n  ): Promise<Rollup.LoadResult> => {\n    if (id === '\\0editor') {\n      // This doesn't get used, but we need to return something\n      return '\"opening in editor\"';\n    }\n    if (id.startsWith('\\0') || id.startsWith('/@fs/')) {\n      return;\n    }\n    const count = loadCount++;\n    const isServer = getIsServer(loadOpts);\n\n    // Virtual modules\n    if (opts.resolveQwikBuild && id === QWIK_BUILD_ID) {\n      debug(`load(${count})`, QWIK_BUILD_ID, opts.buildMode);\n      return {\n        moduleSideEffects: false,\n        code: getQwikBuildModule(isServer, opts.target),\n      };\n    }\n    if (id === QWIK_CLIENT_MANIFEST_ID) {\n      debug(`load(${count})`, QWIK_CLIENT_MANIFEST_ID, opts.buildMode);\n      return {\n        moduleSideEffects: false,\n        code: await getQwikServerManifestModule(isServer),\n      };\n    }\n\n    // QRL segments\n    const parsedId = parseId(id);\n    id = normalizePath(parsedId.pathId);\n    const outputs = isServer ? serverTransformedOutputs : clientTransformedOutputs;\n    if (devServer && !outputs.has(id)) {\n      // in dev mode, it could be that the id is a QRL segment that wasn't transformed yet\n      const parentId = parentIds.get(id);\n      if (parentId) {\n        const parentModule = devServer.moduleGraph.getModuleById(parentId);\n        if (parentModule) {\n          // building here via ctx.load doesn't seem to work (no transform), instead we use the devserver directly\n          debug(`load(${count})`, 'transforming QRL parent', parentId);\n          // We need to encode it as an absolute path\n          await devServer.transformRequest(parentModule.url);\n          // The QRL segment should exist now\n          if (!outputs.has(id)) {\n            debug(`load(${count})`, `QRL segment ${id} not found in ${parentId}`);\n            return null;\n          }\n        } else {\n          console.error(`load(${count})`, `${parentModule} does not exist!`);\n        }\n      }\n    }\n\n    const transformedModule = outputs.get(id);\n\n    if (transformedModule) {\n      debug(`load(${count})`, 'Found', id);\n      const { code, map, segment } = transformedModule[0];\n      return { code, map, meta: { segment } };\n    }\n\n    debug(`load(${count})`, 'Not a QRL or virtual module', id);\n    return null;\n  };\n\n  let transformCount = 0;\n  const transform = async function (\n    ctx: Rollup.PluginContext,\n    code: string,\n    id: string,\n    transformOpts = {} as Parameters<Extract<Plugin['transform'], Function>>[2]\n  ): Promise<Rollup.TransformResult> {\n    if (id.startsWith('\\0')) {\n      return;\n    }\n    const count = transformCount++;\n    const isServer = getIsServer(transformOpts);\n    const currentOutputs = isServer ? serverTransformedOutputs : clientTransformedOutputs;\n    if (currentOutputs.has(id)) {\n      // This is a QRL segment, and we don't need to process it any further\n      return;\n    }\n\n    const optimizer = getOptimizer();\n    const path = getPath();\n\n    const { pathId } = parseId(id);\n    const parsedPathId = path.parse(pathId);\n    const dir = parsedPathId.dir;\n    const base = parsedPathId.base;\n    const ext = parsedPathId.ext.toLowerCase();\n    if (ext in TRANSFORM_EXTS || TRANSFORM_REGEX.test(pathId)) {\n      /** Strip client|server code from qwik server|client, but not in lib/test */\n      const strip = opts.target === 'client' || opts.target === 'ssr';\n      debug(\n        `transform(${count})`,\n        `Transforming ${id} (for: ${isServer ? 'server' : 'client'}${strip ? ', strip' : ''})`\n      );\n\n      const mode =\n        opts.target === 'lib' ? 'lib' : opts.buildMode === 'development' ? 'dev' : 'prod';\n\n      if (mode !== 'lib') {\n        // this messes a bit with the source map, but it's ok for if statements\n        code = code.replaceAll(/__EXPERIMENTAL__\\.(\\w+)/g, (_, feature) => {\n          if (opts.experimental?.[feature as ExperimentalFeatures]) {\n            return 'true';\n          }\n          return 'false';\n        });\n      }\n\n      let filePath = base;\n      if (opts.srcDir) {\n        filePath = path.relative(opts.srcDir, pathId);\n      }\n      filePath = normalizePath(filePath);\n      const srcDir = opts.srcDir ? opts.srcDir : normalizePath(dir);\n      const entryStrategy: EntryStrategy = opts.entryStrategy;\n      let devPath: string | undefined;\n      if (devServer) {\n        devPath = devServer.moduleGraph.getModuleById(pathId)?.url;\n      }\n      const transformOpts: TransformModulesOptions = {\n        input: [{ code, path: filePath, devPath }],\n        entryStrategy: isServer ? { type: 'hoist' } : entryStrategy,\n        minify: 'simplify',\n        // Always enable sourcemaps in dev for click-to-source\n        sourceMaps: opts.sourcemap || 'development' === opts.buildMode,\n        transpileTs: true,\n        transpileJsx: true,\n        explicitExtensions: true,\n        preserveFilenames: true,\n        srcDir,\n        rootDir: opts.rootDir,\n        mode,\n        scope: opts.scope || undefined,\n        isServer,\n      };\n\n      if (strip) {\n        if (isServer) {\n          transformOpts.stripCtxName = CLIENT_STRIP_CTX_NAME;\n          transformOpts.stripEventHandlers = true;\n          transformOpts.regCtxName = REG_CTX_NAME;\n        } else {\n          transformOpts.stripCtxName = SERVER_STRIP_CTX_NAME;\n          transformOpts.stripExports = SERVER_STRIP_EXPORTS;\n        }\n      }\n\n      // TODO use a worker pool or make this async\n      const newOutput = optimizer.transformModulesSync(transformOpts);\n      const module = newOutput.modules.find((mod) => !isAdditionalFile(mod))!;\n\n      // uncomment to show transform results\n      // debug({ isServer, strip }, transformOpts, newOutput);\n      diagnosticsCallback(newOutput.diagnostics, optimizer, srcDir);\n\n      if (isServer) {\n        if (newOutput.diagnostics.length === 0 && linter) {\n          linter.lint(ctx, code, id);\n        }\n      } else {\n        clientResults.set(id, newOutput);\n      }\n      const deps = new Set<string>();\n      for (const mod of newOutput.modules) {\n        if (mod !== module) {\n          const key = normalizePath(path.join(srcDir, mod.path));\n          debug(`transform(${count})`, `segment ${key}`, mod.segment!.displayName);\n          parentIds.set(key, id);\n          currentOutputs.set(key, [mod, id]);\n          deps.add(key);\n          if (opts.target === 'client' && !devServer) {\n            // rollup must be told about all entry points\n            ctx.emitFile({\n              id: key,\n              type: 'chunk',\n              preserveSignature: 'allow-extension',\n            });\n          }\n        }\n      }\n\n      // Force loading generated submodules into Rollup cache so later\n      // unchanged imports are not missing in our internal transform cache\n      // This can happen in the repl when the plugin is re-initialized\n      // and possibly in other places\n      // NOTE: this should be Promise.all to avoid deadlocks\n      await Promise.all([...deps.values()].map((id) => ctx.load({ id })));\n\n      ctx.addWatchFile(id);\n\n      return {\n        code: module.code,\n        map: module.map,\n        meta: {\n          segment: module.segment,\n          qwikdeps: Array.from(deps),\n        },\n      };\n    }\n\n    debug(`transform(${count})`, 'Not transforming', id);\n\n    return null;\n  };\n\n  type OutputAnalyzer = {\n    addInjection: (b: GlobalInjections) => void;\n    generateManifest: (extra?: Partial<QwikManifest>) => Promise<QwikManifest>;\n    canonPath: (p: string) => string;\n  };\n\n  const createOutputAnalyzer = (rollupBundle: Rollup.OutputBundle) => {\n    const injections: GlobalInjections[] = [];\n\n    const outputAnalyzer: OutputAnalyzer = {\n      addInjection: (b: GlobalInjections) => injections.push(b),\n    } as Partial<OutputAnalyzer> as OutputAnalyzer;\n\n    outputAnalyzer.generateManifest = async (extra?: Partial<QwikManifest>) => {\n      const optimizer = getOptimizer();\n      const path = optimizer.sys.path;\n\n      const buildPath = path.resolve(opts.rootDir, opts.outDir, 'build');\n      const canonPath = (p: string) =>\n        path.relative(buildPath, path.resolve(opts.rootDir, opts.outDir, p));\n      outputAnalyzer.canonPath = canonPath;\n\n      const segments = Array.from(clientResults.values())\n        .flatMap((r) => r.modules)\n        .map((mod) => mod.segment)\n        .filter((h) => !!h) as SegmentAnalysis[];\n\n      const manifest = generateManifestFromBundles(\n        path,\n        segments,\n        injections,\n        rollupBundle,\n        opts,\n        debug,\n        canonPath\n      );\n      if (extra) {\n        Object.assign(manifest, extra);\n      }\n\n      for (const symbol of Object.values(manifest.symbols)) {\n        if (symbol.origin) {\n          symbol.origin = normalizePath(symbol.origin);\n        }\n      }\n\n      for (const bundle of Object.values(manifest.bundles)) {\n        if (bundle.origins) {\n          bundle.origins = bundle.origins.sort();\n        }\n      }\n\n      manifest.manifestHash = hashCode(JSON.stringify(manifest));\n\n      return manifest;\n    };\n\n    return outputAnalyzer;\n  };\n\n  const getOptions = () => opts;\n\n  const getTransformedOutputs = () => {\n    return Array.from(clientTransformedOutputs.values()).map((t) => {\n      return t[0];\n    });\n  };\n\n  const debug = (...str: any[]) => {\n    if (opts.debug) {\n      // eslint-disable-next-line no-console\n      console.debug(`[QWIK PLUGIN: ${id}]`, ...str);\n    }\n  };\n\n  const log = (...str: any[]) => {\n    // eslint-disable-next-line no-console\n    console.log(`[QWIK PLUGIN: ${id}]`, ...str);\n  };\n\n  const onDiagnostics = (cb: (d: Diagnostic[], optimizer: Optimizer, srcDir: string) => void) => {\n    diagnosticsCallback = cb;\n  };\n\n  const normalizePath = (id: string) => lazyNormalizePath(id);\n\n  function getQwikBuildModule(isServer: boolean, _target: QwikBuildTarget) {\n    const isDev = opts.buildMode === 'development';\n    return `// @builder.io/qwik/build\nexport const isServer = ${JSON.stringify(isServer)};\nexport const isBrowser = ${JSON.stringify(!isServer)};\nexport const isDev = ${JSON.stringify(isDev)};\n`;\n  }\n\n  async function getQwikServerManifestModule(isServer: boolean) {\n    const manifest = isServer ? opts.manifestInput : null;\n    let serverManifest: ServerQwikManifest | null = null;\n    if (manifest?.manifestHash) {\n      serverManifest = {\n        manifestHash: manifest.manifestHash,\n        core: manifest.core,\n        preloader: manifest.preloader,\n        qwikLoader: manifest.qwikLoader,\n        bundleGraphAsset: manifest.bundleGraphAsset,\n        injections: manifest.injections,\n        mapping: manifest.mapping,\n        bundleGraph: manifest.bundleGraph,\n      };\n    }\n    return `// @qwik-client-manifest\nexport const manifest = ${JSON.stringify(serverManifest)};\\n`;\n  }\n\n  function setSourceMapSupport(sourcemap: boolean) {\n    opts.sourcemap = sourcemap;\n  }\n\n  // Only used in Vite dev mode\n  function handleHotUpdate(ctx: HmrContext) {\n    debug('handleHotUpdate()', ctx.file);\n\n    for (const mod of ctx.modules) {\n      const { id } = mod;\n      if (id) {\n        debug('handleHotUpdate()', `invalidate ${id}`);\n        clientResults.delete(id);\n        for (const outputs of [clientTransformedOutputs, serverTransformedOutputs]) {\n          for (const [key, [_, parentId]] of outputs) {\n            if (parentId === id) {\n              debug('handleHotUpdate()', `invalidate ${id} segment ${key}`);\n              outputs.delete(key);\n              const mod = ctx.server.moduleGraph.getModuleById(key);\n              if (mod) {\n                ctx.server.moduleGraph.invalidateModule(mod);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  const manualChunks: ManualChunksOption = (id: string, { getModuleInfo }) => {\n    if (opts.target === 'client') {\n      if (\n        // The preloader has to stay in a separate chunk if it's a client build\n        // the vite preload helper must be included to prevent breaking circular dependencies\n        id.endsWith('@builder.io/qwik/build') ||\n        /[/\\\\]qwik[/\\\\]dist[/\\\\]preloader\\.[cm]js$/.test(id) ||\n        id === '\\0vite/preload-helper.js'\n      ) {\n        return 'qwik-preloader';\n      } else if (/qwik[\\\\/]dist[\\\\/]qwikloader\\.js$/.test(id)) {\n        return 'qwik-loader';\n      }\n    }\n\n    const module = getModuleInfo(id);\n    if (module) {\n      const segment = module.meta.segment as SegmentAnalysis | undefined;\n      if (segment) {\n        if (['qwikify$', 'useVisibleTask$'].includes(segment.ctxName)) {\n          return null;\n        }\n\n        const { hash } = segment;\n\n        // We use the manual entry strategy to group segments together based on their common entry or Qwik Insights provided hash\n        const chunkName =\n          (opts.entryStrategy as SmartEntryStrategy).manual?.[hash] || segment.entry;\n        if (chunkName) {\n          // we group related segments together based on their common entry or Qwik Insights provided hash\n          // This not only applies to source files, but also qwik libraries files that are imported through node_modules\n          return chunkName;\n        }\n      }\n    }\n\n    // The rest is non-qwik code. We let rollup handle it.\n    return null;\n  };\n\n  async function generateManifest(\n    ctx: Rollup.PluginContext,\n    rollupBundle: Rollup.OutputBundle,\n    bundleGraphAdders?: Set<BundleGraphAdder>,\n    manifestExtra?: Partial<QwikManifest>\n  ) {\n    const outputAnalyzer = createOutputAnalyzer(rollupBundle);\n    const manifest = await outputAnalyzer.generateManifest(manifestExtra);\n\n    manifest.platform = {\n      ...manifestExtra?.platform,\n      rollup: ctx.meta?.rollupVersion || '',\n      env: optimizer.sys.env,\n      os: optimizer.sys.os,\n    };\n    if (optimizer.sys.env === 'node') {\n      manifest.platform!.node = process.versions.node;\n    }\n\n    const bundleGraph = convertManifestToBundleGraph(manifest, bundleGraphAdders);\n    const bgAsset = ctx.emitFile({\n      type: 'asset',\n      name: 'bundle-graph.json',\n      source: JSON.stringify(bundleGraph),\n    });\n    const bgPath = ctx.getFileName(bgAsset);\n    manifest.bundleGraphAsset = bgPath;\n    // we already generated the assets list so we need to update it\n    manifest.assets![bgPath] = {\n      name: 'bundle-graph.json',\n      size: bundleGraph.length,\n    };\n\n    const manifestStr = JSON.stringify(manifest, null, '\\t');\n    ctx.emitFile({\n      fileName: Q_MANIFEST_FILENAME,\n      type: 'asset',\n      source: manifestStr,\n    });\n\n    if (typeof opts.manifestOutput === 'function') {\n      await opts.manifestOutput(manifest);\n    }\n\n    if (typeof opts.transformedModuleOutput === 'function') {\n      await opts.transformedModuleOutput(getTransformedOutputs());\n    }\n\n    // TODO get rid of this with the vite environment api\n    return manifestStr;\n  }\n\n  return {\n    buildStart,\n    createOutputAnalyzer,\n    getQwikBuildModule,\n    getOptimizer,\n    getOptions,\n    getPath,\n    getSys,\n    getTransformedOutputs,\n    init,\n    load,\n    debug,\n    log,\n    normalizeOptions,\n    normalizePath,\n    onDiagnostics,\n    resolveId,\n    transform,\n    validateSource,\n    setSourceMapSupport,\n    configureServer,\n    handleHotUpdate,\n    manualChunks,\n    generateManifest,\n  };\n}\n\n/** Convert windows backslashes to forward slashes */\nexport const makeNormalizePath = (sys: OptimizerSystem) => (id: string) => {\n  if (typeof id === 'string') {\n    if (isWin(sys.os)) {\n      // MIT https://github.com/sindresorhus/slash/blob/main/license\n      // Convert Windows backslash paths to slash paths: foo\\\\bar ➔ foo/bar\n      const isExtendedLengthPath = /^\\\\\\\\\\?\\\\/.test(id);\n      if (!isExtendedLengthPath) {\n        const hasNonAscii = /[^\\u0000-\\u0080]+/.test(id); // eslint-disable-line no-control-regex\n        if (!hasNonAscii) {\n          id = id.replace(/\\\\/g, '/');\n        }\n      }\n      // windows normalize\n      return sys.path.posix.normalize(id);\n    }\n    // posix normalize\n    return sys.path.normalize(id);\n  }\n  return id;\n};\n\nfunction isAdditionalFile(mod: TransformModule) {\n  return mod.isEntry || mod.segment;\n}\n\nconst TRANSFORM_EXTS = {\n  '.jsx': true,\n  '.ts': true,\n  '.tsx': true,\n} as const;\n\n/**\n * Any file that matches this needs to be processed by Qwik to extract QRL segments etc. Used in\n * libraries.\n *\n * @internal\n */\nexport const TRANSFORM_REGEX = /\\.qwik\\.[mc]?js$/;\n\nexport const QWIK_CORE_ID = '@builder.io/qwik';\n\nexport const QWIK_BUILD_ID = '@builder.io/qwik/build';\n\nexport const QWIK_JSX_RUNTIME_ID = '@builder.io/qwik/jsx-runtime';\n\nexport const QWIK_JSX_DEV_RUNTIME_ID = '@builder.io/qwik/jsx-dev-runtime';\n\nexport const QWIK_CORE_SERVER = '@builder.io/qwik/server';\n\nexport const QWIK_CLIENT_MANIFEST_ID = '@qwik-client-manifest';\n\nexport const QWIK_PRELOADER_ID = '@builder.io/qwik/preloader';\n\nexport const SRC_DIR_DEFAULT = 'src';\n\nexport const CLIENT_OUT_DIR = 'dist';\n\nexport const SSR_OUT_DIR = 'server';\n\nconst LIB_OUT_DIR = 'lib';\n\nexport const Q_MANIFEST_FILENAME = 'q-manifest.json';\n\nexport interface QwikPluginDevTools {\n  imageDevTools?: boolean | true;\n  clickToSource?: string[] | false;\n}\n\nexport interface QwikPluginOptions {\n  csr?: boolean;\n  buildMode?: QwikBuildMode;\n  debug?: boolean;\n  entryStrategy?: EntryStrategy;\n  rootDir?: string;\n  tsconfigFileNames?: string[];\n  /** @deprecated No longer used */\n  vendorRoots?: string[];\n  manifestOutput?: ((manifest: QwikManifest) => Promise<void> | void) | null;\n  manifestInput?: QwikManifest | null;\n  input?: string[] | string | { [entry: string]: string };\n  outDir?: string;\n  assetsDir?: string;\n  srcDir?: string | null;\n  scope?: string | null;\n  srcInputs?: TransformModuleInput[] | null;\n  sourcemap?: boolean;\n  resolveQwikBuild?: boolean;\n  target?: QwikBuildTarget;\n  transformedModuleOutput?:\n    | ((transformedModules: TransformModule[]) => Promise<void> | void)\n    | null;\n  devTools?: QwikPluginDevTools;\n  /**\n   * Inline styles up to a certain size (in bytes) instead of using a separate file.\n   *\n   * Default: 20kb (20,000bytes)\n   */\n  inlineStylesUpToBytes?: number;\n  /**\n   * Run eslint on the source files for the ssr build or dev server. This can slow down startup on\n   * large projects. Defaults to `true`\n   */\n  lint?: boolean;\n  /**\n   * Experimental features. These can come and go in patch releases, and their API is not guaranteed\n   * to be stable between releases.\n   */\n  experimental?: (keyof typeof ExperimentalFeatures)[];\n}\n\nexport interface NormalizedQwikPluginOptions\n  extends Omit<Required<QwikPluginOptions>, 'vendorRoots' | 'experimental'> {\n  input: string[] | { [entry: string]: string };\n  experimental?: Record<keyof typeof ExperimentalFeatures, boolean>;\n}\n\nexport type QwikPlugin = ReturnType<typeof createQwikPlugin>;\n\n/** @public */\nexport type QwikBuildTarget = 'client' | 'ssr' | 'lib' | 'test';\n\n/** @public */\nexport type QwikBuildMode = 'production' | 'development';\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/plugin.unit.ts",
    "content": "import path, { resolve } from 'node:path';\nimport { assert, describe, expect, test } from 'vitest';\nimport type { QwikManifest } from '../types';\nimport { ExperimentalFeatures, createQwikPlugin } from './plugin';\nimport { normalizePath } from '../../../testing/util';\nimport { qwikVite } from './vite';\n\nconst cwd = process.cwd();\n\ntest('types', () => () => {\n  qwikVite({ csr: true });\n  qwikVite({ csr: false, ssr: {} });\n});\n\ntest('defaults', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions();\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'segment' });\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.rootDir, normalizePath(cwd));\n  assert.deepEqual(opts.tsconfigFileNames, ['./tsconfig.json']);\n  assert.deepEqual(opts.input, [normalizePath(resolve(cwd, 'src', 'root'))]);\n  assert.deepEqual(opts.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(opts.manifestInput, null);\n  assert.deepEqual(opts.manifestOutput, null);\n  assert.deepEqual(opts.srcDir, normalizePath(resolve(cwd, 'src')));\n  assert.deepEqual(opts.srcInputs, null);\n});\n\ntest('defaults (buildMode: production)', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ buildMode: 'production' });\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(opts.entryStrategy, { type: 'smart' });\n  assert.deepEqual(opts.resolveQwikBuild, true);\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.rootDir, normalizePath(cwd));\n  assert.deepEqual(opts.tsconfigFileNames, ['./tsconfig.json']);\n  assert.deepEqual(opts.input, [normalizePath(resolve(cwd, 'src', 'root'))]);\n  assert.deepEqual(opts.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(opts.manifestInput, null);\n  assert.deepEqual(opts.manifestOutput, null);\n  assert.deepEqual(opts.srcDir, normalizePath(resolve(cwd, 'src')));\n  assert.deepEqual(opts.srcInputs, null);\n  assert.deepEqual(opts.entryStrategy, { type: 'smart' });\n});\n\ntest('defaults (target: ssr)', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ target: 'ssr' });\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'hoist' });\n  assert.deepEqual(opts.resolveQwikBuild, true);\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.rootDir, normalizePath(cwd));\n  assert.deepEqual(opts.tsconfigFileNames, ['./tsconfig.json']);\n  assert.deepEqual(opts.input, [normalizePath(resolve(cwd, 'src', 'entry.ssr'))]);\n  assert.deepEqual(opts.outDir, normalizePath(resolve(cwd, 'server')));\n  assert.deepEqual(opts.manifestInput, null);\n  assert.deepEqual(opts.manifestOutput, null);\n  assert.deepEqual(opts.srcDir, normalizePath(resolve(cwd, 'src')));\n  assert.deepEqual(opts.srcInputs, null);\n});\n\ntest('defaults (buildMode: production, target: ssr)', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ buildMode: 'production', target: 'ssr' });\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(opts.entryStrategy, { type: 'hoist' });\n  assert.deepEqual(opts.resolveQwikBuild, true);\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.rootDir, normalizePath(cwd));\n  assert.deepEqual(opts.tsconfigFileNames, ['./tsconfig.json']);\n  assert.deepEqual(opts.input, [normalizePath(resolve(cwd, 'src', 'entry.ssr'))]);\n  assert.deepEqual(opts.outDir, normalizePath(resolve(cwd, 'server')));\n  assert.deepEqual(opts.manifestInput, null);\n  assert.deepEqual(opts.manifestOutput, null);\n  assert.deepEqual(opts.srcDir, normalizePath(resolve(cwd, 'src')));\n  assert.deepEqual(opts.srcInputs, null);\n});\n\ntest('debug true', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ debug: true });\n  assert.deepEqual(opts.debug, true);\n});\n\ntest('csr', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ csr: true });\n  assert.deepEqual(opts.outDir, '');\n});\n\ntest('override entryStrategy', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({\n    entryStrategy: { type: 'component' },\n    buildMode: 'production',\n  });\n  assert.deepEqual(opts.entryStrategy.type, 'component');\n});\n\ntest('entryStrategy, smart', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({\n    entryStrategy: { type: 'smart' },\n  });\n  assert.deepEqual(opts.entryStrategy.type, 'smart');\n});\n\ntest('entryStrategy, segment no forceFullBuild', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ entryStrategy: { type: 'segment' } });\n  assert.deepEqual(opts.entryStrategy.type, 'segment');\n});\n\ntest('entryStrategy, segment and srcInputs', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({\n    entryStrategy: { type: 'segment' },\n    srcInputs: [],\n  });\n  assert.deepEqual(opts.entryStrategy.type, 'segment');\n});\n\ntest('rootDir, abs path', async () => {\n  const plugin = await mockPlugin();\n  const customRoot = normalizePath(resolve(cwd, 'abs-path'));\n  const opts = plugin.normalizeOptions({ rootDir: customRoot });\n  assert.deepEqual(opts.rootDir, customRoot);\n});\n\ntest('rootDir, rel path', async () => {\n  const plugin = await mockPlugin();\n  const customRoot = 'rel-path';\n  const opts = plugin.normalizeOptions({ rootDir: customRoot });\n  assert.deepEqual(opts.rootDir, normalizePath(resolve(cwd, customRoot)));\n});\n\ntest('tsconfigFileNames', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({\n    tsconfigFileNames: ['./tsconfig.json', './tsconfig.app.json'],\n  });\n  assert.deepEqual(opts.tsconfigFileNames, ['./tsconfig.json', './tsconfig.app.json']);\n});\n\ntest('tsconfigFileNames, empty array fallback to default', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({\n    tsconfigFileNames: [],\n  });\n  assert.deepEqual(opts.tsconfigFileNames, ['./tsconfig.json']);\n});\n\ntest('input string', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ input: 'src/cmps/main.tsx' });\n  assert.deepEqual(opts.input, [normalizePath(resolve(cwd, 'src', 'cmps', 'main.tsx'))]);\n});\n\ntest('input array', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({\n    input: ['src/cmps/a.tsx', 'src/cmps/b.tsx'],\n  });\n  assert.deepEqual(opts.input, [\n    normalizePath(resolve(cwd, 'src', 'cmps', 'a.tsx')),\n    normalizePath(resolve(cwd, 'src', 'cmps', 'b.tsx')),\n  ]);\n});\n\ntest('outDir', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ outDir: 'out' });\n  assert.deepEqual(opts.outDir, normalizePath(resolve(cwd, 'out')));\n});\n\ntest('manifestOutput', async () => {\n  const plugin = await mockPlugin();\n  const manifestOutput = () => {};\n  const opts = plugin.normalizeOptions({ manifestOutput });\n  assert.deepEqual(opts.manifestOutput, manifestOutput);\n});\n\ntest('manifestInput', async () => {\n  const plugin = await mockPlugin();\n  const manifestInput: QwikManifest = {\n    manifestHash: '',\n    mapping: {},\n    symbols: {},\n    bundles: {},\n    version: '1',\n  };\n  const opts = plugin.normalizeOptions({ manifestInput });\n  assert.deepEqual(opts.manifestInput, manifestInput);\n});\n\ntest('resolveQwikBuild true', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ resolveQwikBuild: true });\n  assert.deepEqual(opts.resolveQwikBuild, true);\n});\n\ntest('resolveQwikBuild false', async () => {\n  const plugin = await mockPlugin();\n  const opts = plugin.normalizeOptions({ resolveQwikBuild: false });\n  assert.deepEqual(opts.resolveQwikBuild, false);\n});\n\ntest('experimental[]', async () => {\n  const plugin = await mockPlugin();\n  const flag = Object.values(ExperimentalFeatures)[0];\n  if (!flag) {\n    // we can't test this without a flag\n    return;\n  }\n  const opts = plugin.normalizeOptions({ experimental: [flag] });\n  assert.deepEqual(opts.experimental, { [flag]: true } as any);\n});\n\ndescribe('resolveId', () => {\n  test('qrls', async () => {\n    const plugin = await mockPlugin();\n    expect(await plugin.resolveId(null!, 'foo', undefined)).toBeFalsy();\n    const ctx = { resolve: async () => ({ id: 'Yey' }) } as any;\n    await expect(\n      plugin.resolveId(\n        ctx,\n        '/root/src/routes/layout.tsx_layout_component_usetask_1_7xk04rim0vu.js',\n        undefined\n      )\n    ).resolves.toHaveProperty(\n      'id',\n      '/root/src/routes/layout.tsx_layout_component_usetask_1_7xk04rim0vu.js'\n    );\n    expect(\n      await plugin.resolveId(ctx, '/root/src/routes/layout.tsx_s_7xk04rim0vu.js', undefined)\n    ).toHaveProperty('id', '/root/src/routes/layout.tsx_s_7xk04rim0vu.js');\n    expect(await plugin.resolveId(null!, './foo', '/root/src/routes/layout.tsx')).toBeFalsy();\n    expect(\n      await plugin.resolveId(\n        ctx,\n        './layout.tsx_layout_component_usetask_1_7xk04rim0vu.js',\n        '/root/src/routes/layout.tsx'\n      )\n    ).toHaveProperty('id', '/root/src/routes/layout.tsx_layout_component_usetask_1_7xk04rim0vu.js');\n    // this uses the already populated id we created above\n    expect(\n      await plugin.resolveId(\n        {\n          resolve: (id: string, importer: string) => {\n            expect(id).toBe('/root/src/routes/foo');\n            expect(importer).toBe('Yey');\n            return { id: 'hi' };\n          },\n        } as any,\n        './foo',\n        '/root/src/routes/layout.tsx_layout_component_usetask_1_7xk04rim0vu.js'\n      )\n    ).toEqual({ id: 'hi' });\n  });\n  test('win32', async () => {\n    const plugin = await mockPlugin('win32');\n    expect(\n      await plugin.resolveId(\n        {\n          resolve: async () => ({\n            id: 'Yey',\n          }),\n        } as any,\n        'C:\\\\src\\\\routes\\\\layout.tsx_s_7xk04rim0vu.js',\n        undefined\n      )\n    ).toHaveProperty('id', 'C:/src/routes/layout.tsx_s_7xk04rim0vu.js');\n  });\n  test('libs', async () => {\n    const plugin = await mockPlugin();\n    expect(await plugin.resolveId(null!, '@builder.io/qwik/build', undefined)).toHaveProperty(\n      'id',\n      '@builder.io/qwik/build'\n    );\n    expect(await plugin.resolveId(null!, '/@builder.io/qwik/build', undefined)).toHaveProperty(\n      'id',\n      '@builder.io/qwik/build'\n    );\n    expect(await plugin.resolveId(null!, '@qwik-client-manifest', '/foo/bar')).toHaveProperty(\n      'id',\n      '@qwik-client-manifest'\n    );\n  });\n});\n\nasync function mockPlugin(os = process.platform) {\n  const plugin = createQwikPlugin({\n    sys: {\n      cwd: () => process.cwd(),\n      env: 'node',\n      os,\n      dynamicImport: async (path) => import(path),\n      strictDynamicImport: async (path) => import(path),\n      path: path as any,\n    },\n    binding: { mockBinding: true },\n  });\n  await plugin.init();\n  return plugin;\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/rollup.ts",
    "content": "import type { Rollup } from 'vite';\nimport type {\n  Diagnostic,\n  EntryStrategy,\n  Optimizer,\n  OptimizerOptions,\n  QwikManifest,\n  TransformModule,\n  TransformModuleInput,\n} from '../types';\nimport {\n  createQwikPlugin,\n  type ExperimentalFeatures,\n  type NormalizedQwikPluginOptions,\n  type QwikBuildMode,\n  type QwikBuildTarget,\n  type QwikPlugin,\n  type QwikPluginOptions,\n} from './plugin';\nimport { findDepPkgJsonPath } from './utils';\n\ntype QwikRollupPluginApi = {\n  getOptimizer: () => Optimizer;\n  getOptions: () => NormalizedQwikPluginOptions;\n};\n\n/** @public */\nexport function qwikRollup(qwikRollupOpts: QwikRollupPluginOptions = {}): any {\n  const qwikPlugin = createQwikPlugin(qwikRollupOpts.optimizerOptions);\n\n  const rollupPlugin: QwikRollupPlugin = {\n    name: 'rollup-plugin-qwik',\n\n    api: {\n      getOptimizer: () => qwikPlugin.getOptimizer(),\n      getOptions: () => qwikPlugin.getOptions(),\n    },\n\n    async options(inputOpts) {\n      await qwikPlugin.init();\n\n      const origOnwarn = inputOpts.onwarn;\n      inputOpts.onwarn = (warning, warn) => {\n        if (warning.plugin === 'typescript' && warning.message.includes('outputToFilesystem')) {\n          return;\n        }\n        origOnwarn ? origOnwarn(warning, warn) : warn(warning);\n      };\n\n      const pluginOpts: QwikPluginOptions = {\n        csr: qwikRollupOpts.csr,\n        target: qwikRollupOpts.target,\n        buildMode: qwikRollupOpts.buildMode,\n        debug: qwikRollupOpts.debug,\n        entryStrategy: qwikRollupOpts.entryStrategy,\n        rootDir: qwikRollupOpts.rootDir,\n        srcDir: qwikRollupOpts.srcDir,\n        srcInputs: qwikRollupOpts.srcInputs,\n        input: inputOpts.input as string,\n        resolveQwikBuild: true,\n        manifestOutput: qwikRollupOpts.manifestOutput,\n        manifestInput: qwikRollupOpts.manifestInput,\n        transformedModuleOutput: qwikRollupOpts.transformedModuleOutput,\n        inlineStylesUpToBytes: qwikRollupOpts.optimizerOptions?.inlineStylesUpToBytes,\n        lint: qwikRollupOpts.lint,\n        experimental: qwikRollupOpts.experimental,\n      };\n\n      const opts = qwikPlugin.normalizeOptions(pluginOpts);\n\n      if (!inputOpts.input) {\n        inputOpts.input = opts.input;\n      }\n\n      return inputOpts;\n    },\n\n    outputOptions(rollupOutputOpts) {\n      return normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOpts, false) as any;\n    },\n\n    async buildStart() {\n      qwikPlugin.onDiagnostics((diagnostics, optimizer, srcDir) => {\n        diagnostics.forEach((d) => {\n          const id = qwikPlugin.normalizePath(optimizer.sys.path.join(srcDir, d.file));\n          if (d.category === 'error') {\n            this.error(createRollupError(id, d));\n          } else {\n            this.warn(createRollupError(id, d));\n          }\n        });\n      });\n\n      await qwikPlugin.buildStart(this);\n    },\n\n    resolveId(id, importer) {\n      if (id.startsWith('\\0')) {\n        return null;\n      }\n      return qwikPlugin.resolveId(this, id, importer);\n    },\n\n    load(id) {\n      if (id.startsWith('\\0')) {\n        return null;\n      }\n      return qwikPlugin.load(this, id);\n    },\n\n    transform(code, id) {\n      if (id.startsWith('\\0')) {\n        return null;\n      }\n      return qwikPlugin.transform(this, code, id);\n    },\n\n    async generateBundle(_, rollupBundle) {\n      const opts = qwikPlugin.getOptions();\n\n      if (opts.target === 'client') {\n        await qwikPlugin.generateManifest(this, rollupBundle);\n      }\n    },\n  };\n\n  return rollupPlugin;\n}\n\nexport async function normalizeRollupOutputOptions(\n  qwikPlugin: QwikPlugin,\n  rollupOutputOpts: Rollup.OutputOptions | Rollup.OutputOptions[] | undefined,\n  useAssetsDir: boolean,\n  outDir?: string\n): Promise<Rollup.OutputOptions | Rollup.OutputOptions[]> {\n  if (Array.isArray(rollupOutputOpts)) {\n    // make sure at least one output is present in every case\n    if (!rollupOutputOpts.length) {\n      rollupOutputOpts.push({});\n    }\n\n    return await Promise.all(\n      rollupOutputOpts.map(async (outputOptsObj) => ({\n        ...(await normalizeRollupOutputOptionsObject(qwikPlugin, outputOptsObj, useAssetsDir)),\n        dir: outDir || outputOptsObj.dir,\n      }))\n    );\n  }\n\n  return {\n    ...(await normalizeRollupOutputOptionsObject(qwikPlugin, rollupOutputOpts, useAssetsDir)),\n    dir: outDir || rollupOutputOpts?.dir,\n  };\n}\n\nexport async function normalizeRollupOutputOptionsObject(\n  qwikPlugin: QwikPlugin,\n  rollupOutputOptsObj: Rollup.OutputOptions | undefined,\n  useAssetsDir: boolean\n): Promise<Rollup.OutputOptions> {\n  const outputOpts: Rollup.OutputOptions = { ...rollupOutputOptsObj };\n  const opts = qwikPlugin.getOptions();\n  const optimizer = qwikPlugin.getOptimizer();\n  const manualChunks = qwikPlugin.manualChunks;\n  if (opts.target === 'client') {\n    // client output\n    if (!outputOpts.assetFileNames) {\n      // SEO likes readable asset names\n      const assetFileNames = 'assets/[hash]-[name].[ext]';\n      outputOpts.assetFileNames = useAssetsDir\n        ? `${opts.assetsDir}/${assetFileNames}`\n        : assetFileNames;\n    }\n\n    let fileName: string | ((chunkInfo: Rollup.PreRenderedChunk) => string) | undefined;\n    if (opts.buildMode === 'production' && !opts.debug) {\n      fileName = 'build/q-[hash].js';\n    } else {\n      // Friendlier names in dev or preview with debug mode\n      fileName = (chunkInfo) => {\n        if (\n          chunkInfo.moduleIds?.some(\n            (id) => id.endsWith('core.prod.mjs') || id.endsWith('core.min.mjs')\n          )\n        ) {\n          return 'build/core.js';\n        }\n        if (chunkInfo.moduleIds?.some((id) => id.endsWith('qwik-city/lib/index.qwik.mjs'))) {\n          return 'build/qwik-city.js';\n        }\n\n        // The chunk name can often be a path. We sanitize it to use dashes instead of slashes, to keep the same folder structure as without debug:true.\n        // Besides, Rollup doesn't accept absolute or relative paths as inputs for the [name] placeholder for the same reason.\n        const path = optimizer.sys.path;\n        const relativePath = path.relative(optimizer.sys.cwd(), chunkInfo.name);\n        const sanitized = relativePath\n          .replace(/^(\\.\\.\\/)+/, '')\n          .replace(/^\\/+/, '')\n          .replace(/\\//g, '-');\n        return `build/${sanitized}.js`;\n      };\n    }\n    // client development/debug output\n    const getFilePath = (fileNamePattern: string | ((info: Rollup.PreRenderedChunk) => string)) =>\n      typeof fileNamePattern === 'string'\n        ? useAssetsDir\n          ? `${opts.assetsDir}/${fileNamePattern}`\n          : fileNamePattern\n        : useAssetsDir\n          ? (chunkInfo: Rollup.PreRenderedChunk) =>\n              `${opts.assetsDir}/${fileNamePattern(chunkInfo)}`\n          : (chunkInfo: Rollup.PreRenderedChunk) => fileNamePattern(chunkInfo);\n\n    if (!outputOpts.entryFileNames) {\n      outputOpts.entryFileNames = getFilePath(fileName);\n    }\n    if (!outputOpts.chunkFileNames) {\n      outputOpts.chunkFileNames = getFilePath(fileName);\n    }\n  } else if (opts.buildMode === 'production') {\n    // server production output\n    // everything in same dir so './@qwik-city...' imports work from entry and chunks\n    if (!outputOpts.chunkFileNames) {\n      outputOpts.chunkFileNames = 'q-[hash].js';\n    }\n  }\n  // all other cases, like lib output\n  if (!outputOpts.assetFileNames) {\n    outputOpts.assetFileNames = 'assets/[hash]-[name].[ext]';\n  }\n\n  if (opts.target === 'client') {\n    // client should always be es\n    outputOpts.format = 'es';\n    const prevManualChunks = outputOpts.manualChunks;\n    if (prevManualChunks && typeof prevManualChunks !== 'function') {\n      throw new Error('manualChunks must be a function');\n    }\n    // Casts bridge Rollup vs Rolldown ManualChunkMeta type differences\n    type ManualChunkFn = (id: string, meta: unknown) => string | void | null;\n    outputOpts.manualChunks = prevManualChunks\n      ? (id, meta) =>\n          (prevManualChunks as ManualChunkFn)(id, meta) || (manualChunks as ManualChunkFn)(id, meta)\n      : (manualChunks as Rollup.OutputOptions['manualChunks']);\n  }\n\n  if (!outputOpts.dir) {\n    outputOpts.dir = opts.outDir;\n  }\n\n  if (outputOpts.format === 'cjs' && typeof outputOpts.exports !== 'string') {\n    outputOpts.exports = 'auto';\n  }\n\n  /**\n   * Transitive imports must not be hoisted. Otherwise, the bundle-graph static imports will be\n   * incorrect; leading to over-preloading.\n   */\n  outputOpts.hoistTransitiveImports = false;\n\n  // V2 official release TODO: remove below checks and just keep `outputOpts.onlyExplicitManualChunks = true;`\n  const userPkgJsonPath = await findDepPkgJsonPath(optimizer.sys, 'rollup', optimizer.sys.cwd());\n  if (userPkgJsonPath) {\n    try {\n      const fs: typeof import('fs') = await optimizer.sys.dynamicImport('node:fs');\n      const pkgJsonStr = await fs.promises.readFile(userPkgJsonPath, 'utf-8');\n      const pkgJson = JSON.parse(pkgJsonStr);\n      const version = String(pkgJson?.version || '');\n      const [major, minor, patch] = version.split('.').map((n: string) => parseInt(n, 10)) as [\n        number,\n        number,\n        number,\n      ];\n      const isGte452 =\n        Number.isFinite(major) &&\n        (major > 4 || (major === 4 && (minor > 52 || (minor === 52 && (patch || 0) >= 0))));\n      if (isGte452) {\n        (\n          outputOpts as Rollup.OutputOptions & { onlyExplicitManualChunks?: boolean }\n        ).onlyExplicitManualChunks = true;\n      } else {\n        console.warn(\n          `⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${version}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \\`outputOpts.onlyExplicitManualChunks\\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`\n        );\n      }\n    } catch {\n      // If we cannot determine the installed Rollup version, avoid warning\n    }\n  }\n\n  return outputOpts;\n}\n\nexport function createRollupError(id: string, diagnostic: Diagnostic) {\n  const loc = diagnostic.highlights[0] ?? {};\n  const err: Rollup.RollupError = Object.assign(new Error(diagnostic.message), {\n    id,\n    plugin: 'qwik',\n    loc: {\n      column: loc.startCol,\n      line: loc.startLine,\n    },\n    stack: '',\n  });\n  return err;\n}\n\n/** @public */\nexport interface QwikRollupPluginOptions {\n  csr?: boolean;\n  /**\n   * Build `production` or `development`.\n   *\n   * Default `development`\n   */\n  buildMode?: QwikBuildMode;\n  /**\n   * Target `client` or `ssr`.\n   *\n   * Default `client`\n   */\n  target?: QwikBuildTarget;\n  /**\n   * Prints verbose Qwik plugin debug logs.\n   *\n   * Default `false`\n   */\n  debug?: boolean;\n  /**\n   * The Qwik entry strategy to use while building for production. During development the type is\n   * always `segment`.\n   *\n   * Default `{ type: \"smart\" }`)\n   */\n  entryStrategy?: EntryStrategy;\n  /**\n   * The source directory to find all the Qwik components. Since Qwik does not have a single input,\n   * the `srcDir` is used to recursively find Qwik files.\n   *\n   * Default `src`\n   */\n  srcDir?: string;\n  /**\n   * Alternative to `srcDir`, where `srcInputs` is able to provide the files manually. This option\n   * is useful for an environment without a file system, such as a webworker.\n   *\n   * Default: `null`\n   */\n  srcInputs?: TransformModuleInput[] | null;\n  /**\n   * The root of the application, which is commonly the same directory as `package.json` and\n   * `rollup.config.js`.\n   *\n   * Default `process.cwd()`\n   */\n  rootDir?: string;\n  /**\n   * The client build will create a manifest and this hook is called with the generated build data.\n   *\n   * Default `undefined`\n   */\n  manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;\n  /**\n   * The SSR build requires the manifest generated during the client build. The `manifestInput`\n   * option can be used to manually provide a manifest.\n   *\n   * Default `undefined`\n   */\n  manifestInput?: QwikManifest;\n  optimizerOptions?: OptimizerOptions;\n  /**\n   * Hook that's called after the build and provides all of the transformed modules that were used\n   * before bundling.\n   */\n  transformedModuleOutput?:\n    | ((transformedModules: TransformModule[]) => Promise<void> | void)\n    | null;\n  /**\n   * Run eslint on the source files for the ssr build or dev server. This can slow down startup on\n   * large projects. Defaults to `true`\n   */\n  lint?: boolean;\n  /**\n   * Experimental features. These can come and go in patch releases, and their API is not guaranteed\n   * to be stable between releases.\n   */\n  experimental?: (keyof typeof ExperimentalFeatures)[];\n}\nexport { ExperimentalFeatures } from './plugin';\ntype P<T> = Rollup.Plugin<T> & { api: T };\nexport interface QwikRollupPlugin extends P<QwikRollupPluginApi> {}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/rollup.unit.ts",
    "content": "import path, { resolve } from 'node:path';\nimport { qwikRollup } from './rollup';\nimport type { Rollup } from 'vite';\nimport type { OptimizerOptions } from '../types';\nimport type { NormalizedQwikPluginOptions } from './plugin';\nimport { assert, test } from 'vitest';\nimport { normalizePath } from '../../../testing/util';\n\nconst cwd = process.cwd();\n\nfunction mockOptimizerOptions(): OptimizerOptions {\n  return {\n    sys: {\n      cwd: () => process.cwd(),\n      env: 'node',\n      os: process.platform,\n      dynamicImport: async (path) => import(path),\n      strictDynamicImport: async (path) => import(path),\n      path: path as any,\n    },\n    binding: { mockBinding: true },\n  };\n}\n\ntest('rollup default input options, client', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = qwikRollup(initOpts);\n  const rollupInputOpts: Rollup.InputOptions = await plugin.options!({});\n\n  assert.deepEqual(typeof rollupInputOpts.onwarn, 'function');\n  assert.deepEqual(rollupInputOpts.input, [normalizePath(resolve(cwd, 'src', 'root'))]);\n});\n\ntest('rollup default input options, ssr', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'ssr',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  const rollupInputOpts: Rollup.InputOptions = await plugin.options!({});\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n\n  assert.deepEqual(typeof rollupInputOpts.onwarn, 'function');\n  assert.deepEqual(rollupInputOpts.treeshake, undefined);\n  assert.deepEqual(rollupInputOpts.input, [normalizePath(resolve(cwd, 'src', 'entry.ssr'))]);\n  assert.deepEqual(opts.input, [normalizePath(resolve(cwd, 'src', 'entry.ssr'))]);\n});\n\ntest('rollup default set input options, ssr', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'ssr',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  const rollupInputOpts: Rollup.InputOptions = await plugin.options!({\n    input: normalizePath(resolve(cwd, 'src', 'my.ssr.tsx')),\n  });\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n\n  assert.deepEqual(typeof rollupInputOpts.onwarn, 'function');\n  assert.deepEqual(rollupInputOpts.treeshake, undefined);\n  assert.deepEqual(rollupInputOpts.input, normalizePath(resolve(cwd, 'src', 'my.ssr.tsx')));\n  assert.deepEqual(opts.input, [normalizePath(resolve(cwd, 'src', 'my.ssr.tsx'))]);\n});\n\ntest('rollup default output options, client', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n  const rollupOutputOpts: Rollup.OutputOptions = await plugin.outputOptions!({});\n\n  assert.deepEqual(rollupOutputOpts.dir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(rollupOutputOpts.format, 'es');\n});\n\ntest('rollup default output options, ssr', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'ssr',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n  const rollupOutputOpts: Rollup.OutputOptions = await plugin.outputOptions!({\n    format: 'cjs',\n  });\n\n  assert.deepEqual(rollupOutputOpts.dir, normalizePath(resolve(cwd, 'server')));\n  assert.deepEqual(rollupOutputOpts.exports, 'auto');\n});\n\ntest('rollup input, default', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'segment' });\n  assert.deepEqual(opts.rootDir, normalizePath(cwd));\n  assert.deepEqual(opts.srcDir, normalizePath(resolve(cwd, 'src')));\n});\n\ntest('rollup input, client default', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'client',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'segment' });\n});\n\ntest('rollup input, client/production default', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'client',\n    buildMode: 'production',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(opts.entryStrategy, { type: 'smart' });\n});\n\ntest('rollup input, ssr/development default', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'ssr',\n    buildMode: 'development',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'hoist' });\n});\n\ntest('rollup input, ssr/production default', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'ssr',\n    buildMode: 'production',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(opts.entryStrategy, { type: 'hoist' });\n});\n\ntest('rollup input, lib/production default', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'lib',\n    buildMode: 'production',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n  assert.deepEqual(opts.target, 'lib');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'inline' });\n});\n\ntest('rollup input, forceFullBuild true', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    target: 'ssr',\n    buildMode: 'development',\n  } as any;\n  const plugin = qwikRollup(initOpts);\n  await plugin.options!({});\n\n  const opts: NormalizedQwikPluginOptions = plugin.api.getOptions();\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'hoist' });\n});\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/utils.ts",
    "content": "import type { OptimizerSystem } from '../types';\n\nexport async function findDepPkgJsonPath(sys: OptimizerSystem, dep: string, parent: string) {\n  const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n  let root = parent;\n  while (root) {\n    const pkg = sys.path.join(root, 'node_modules', dep, 'package.json');\n    try {\n      await fs.promises.access(pkg);\n      // use 'node:fs' version to match 'vite:resolve' and avoid realpath.native quirk\n      // https://github.com/sveltejs/vite-plugin-svelte/issues/525#issuecomment-1355551264\n      return fs.promises.realpath(pkg);\n    } catch {\n      //empty\n    }\n    const nextRoot = sys.path.dirname(root);\n    if (nextRoot === root) {\n      break;\n    }\n    root = nextRoot;\n  }\n  return undefined;\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts",
    "content": "/* eslint-disable no-console */\nimport type { Render, RenderToStreamOptions } from '@builder.io/qwik/server';\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport { magenta } from 'kleur/colors';\n\nimport type { Connect, ViteDevServer } from 'vite';\nimport { SYNC_QRL } from '../../../core/qrl/qrl-class';\nimport type {\n  OptimizerSystem,\n  Path,\n  ServerQwikManifest,\n  SymbolMapper,\n  SymbolMapperFn,\n} from '../types';\nimport clickToComponent from './click-to-component.html?raw';\nimport errorHost from './error-host.html?raw';\nimport imageDevTools from './image-size-runtime.html?raw';\nimport perfWarning from './perf-warning.html?raw';\nimport { type NormalizedQwikPluginOptions } from './plugin';\nimport type { QwikViteDevResponse } from './vite';\nimport { VITE_ERROR_OVERLAY_STYLES } from './vite-error';\nimport { formatError, parseId } from './vite-utils';\n\nfunction getOrigin(req: IncomingMessage) {\n  const { PROTOCOL_HEADER, HOST_HEADER } = process.env;\n  const headers = req.headers;\n  const protocol =\n    (PROTOCOL_HEADER && headers[PROTOCOL_HEADER.toLowerCase()]) ||\n    ((req.socket as any).encrypted || (req.connection as any).encrypted ? 'https' : 'http');\n  const host =\n    (HOST_HEADER && headers[HOST_HEADER.toLowerCase()]) || headers[':authority'] || headers['host'];\n\n  return `${protocol}://${host}`;\n}\n\nfunction createSymbolMapper(base: string): SymbolMapperFn {\n  return (\n    symbolName: string,\n    _mapper: SymbolMapper | undefined,\n    parent: string | undefined\n  ): [string, string] => {\n    if (symbolName === SYNC_QRL) {\n      return [symbolName, ''];\n    }\n    if (!parent) {\n      console.error(\n        'qwik vite-dev-server symbolMapper: unknown qrl requested without parent:',\n        symbolName\n      );\n      return [symbolName, `${base}${symbolName}.js`];\n    }\n    // In dev mode, the `parent` is the Vite URL for the parent, not the real absolute path.\n    // It is always absolute but when on Windows that's without a /\n    const qrlFile = `${base}${parent.startsWith('/') ? parent.slice(1) : parent}_${symbolName}.js`;\n    return [symbolName, qrlFile];\n  };\n}\n\nlet lazySymbolMapper: ReturnType<typeof createSymbolMapper> | null = null;\n/**\n * @alpha\n *   For a given symbol (QRL such as `onKeydown$`) the server needs to know which bundle the symbol is in.\n *\n *   Normally this is provided by Qwik's `q-manifest` . But `q-manifest` only exists after a full client build.\n *\n *   This would be a problem in dev mode. So in dev mode the symbol is mapped to the expected URL using the symbolMapper function below. For Vite the given path is fixed for a given symbol.\n */\nexport let symbolMapper: ReturnType<typeof createSymbolMapper> = (symbolName, mapper, parent) => {\n  // This is a fallback in case the symbolMapper is copied early\n  if (lazySymbolMapper) {\n    return lazySymbolMapper(symbolName, mapper, parent);\n  }\n  throw new Error('symbolMapper not initialized');\n};\n\nexport async function configureDevServer(\n  base: string,\n  server: ViteDevServer,\n  opts: NormalizedQwikPluginOptions,\n  sys: OptimizerSystem,\n  path: Path,\n  isClientDevOnly: boolean,\n  clientDevInput: string | undefined,\n  devSsrServer: boolean\n) {\n  symbolMapper = lazySymbolMapper = createSymbolMapper(base);\n  if (!devSsrServer) {\n    // we just needed the symbolMapper\n    return;\n  }\n  const hasQwikCity = server.config.plugins?.some(\n    (plugin) => plugin.name === 'vite-plugin-qwik-city'\n  );\n\n  // to maintain css importers after HMR\n  const cssImportedByCSS = new Set<string>();\n\n  // qwik middleware injected BEFORE vite internal middlewares\n  server.middlewares.use(async (req, res, next) => {\n    try {\n      const { ORIGIN } = process.env;\n      const domain = ORIGIN ?? getOrigin(req);\n      const url = new URL(req.originalUrl!, domain);\n\n      if (shouldSsrRender(req, url)) {\n        const { _qwikEnvData } = res as QwikViteDevResponse;\n        if (!_qwikEnvData && hasQwikCity) {\n          console.error(`not SSR rendering ${url} because Qwik City Env data did not populate`);\n          res.statusCode ||= 404;\n          res.setHeader('Content-Type', 'text/plain');\n          res.writeHead(res.statusCode);\n          res.end('Not a SSR URL according to Qwik City');\n          return;\n        }\n        const serverData: Record<string, any> = {\n          ..._qwikEnvData,\n          url: url.href,\n        };\n\n        const status = typeof res.statusCode === 'number' ? res.statusCode : 200;\n        if (isClientDevOnly) {\n          const relPath = path.relative(opts.rootDir, clientDevInput!);\n          const entryUrl = '/' + relPath.replace(/\\\\/g, '/');\n\n          let html = getViteDevIndexHtml(entryUrl, serverData);\n          html = await server.transformIndexHtml(url.pathname, html);\n\n          res.setHeader('Content-Type', 'text/html; charset=utf-8');\n          res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0');\n          res.setHeader('Access-Control-Allow-Origin', '*');\n          res.setHeader('X-Powered-By', 'Qwik Vite Dev Server');\n          res.writeHead(status);\n\n          res.end(html);\n          return;\n        }\n\n        const firstInput = opts.input && Object.values(opts.input)[0];\n        const ssrModule = await server.ssrLoadModule(firstInput);\n\n        const render: Render = ssrModule.default ?? ssrModule.render;\n\n        if (typeof render === 'function') {\n          const manifest: ServerQwikManifest = {\n            manifestHash: '',\n            mapping: {},\n            injections: [],\n          };\n\n          const added = new Set();\n          const CSS_EXTENSIONS = ['.css', '.scss', '.sass', '.less', '.styl', '.stylus'];\n          const JS_EXTENSIONS = /\\.[mc]?[tj]sx?$/;\n\n          Array.from(server.moduleGraph.fileToModulesMap.entries()).forEach((entry) => {\n            entry[1].forEach((v) => {\n              const segment = v.info?.meta?.segment;\n              let url = v.url;\n              if (v.lastHMRTimestamp) {\n                url += `?t=${v.lastHMRTimestamp}`;\n              }\n              if (segment) {\n                manifest.mapping[segment.name] = relativeURL(url, opts.rootDir);\n              }\n\n              const { pathId, query } = parseId(v.url);\n\n              if (query === '' && CSS_EXTENSIONS.some((ext) => pathId.endsWith(ext))) {\n                const isEntryCSS = v.importers.size === 0;\n                const hasCSSImporter = Array.from(v.importers).some((importer) => {\n                  const importerPath = (importer as typeof v).url || (importer as typeof v).file;\n\n                  const isCSS =\n                    importerPath && CSS_EXTENSIONS.some((ext) => importerPath.endsWith(ext));\n\n                  if (isCSS && v.url) {\n                    cssImportedByCSS.add(v.url);\n                  }\n\n                  return isCSS;\n                });\n\n                const hasJSImporter = Array.from(v.importers).some((importer) => {\n                  const importerPath = (importer as typeof v).url || (importer as typeof v).file;\n                  return importerPath && JS_EXTENSIONS.test(importerPath);\n                });\n\n                if (\n                  (isEntryCSS || hasJSImporter) &&\n                  !hasCSSImporter &&\n                  !cssImportedByCSS.has(v.url) &&\n                  !added.has(v.url)\n                ) {\n                  added.add(v.url);\n                  manifest.injections!.push({\n                    tag: 'link',\n                    location: 'head',\n                    attributes: {\n                      rel: 'stylesheet',\n                      href: toDevServerHref(base, url),\n                    },\n                  });\n                }\n              }\n            });\n          });\n\n          const renderOpts: RenderToStreamOptions = {\n            debug: true,\n            locale: serverData.locale,\n            stream: res,\n            snapshot: !isClientDevOnly,\n            manifest: isClientDevOnly ? undefined : manifest,\n            symbolMapper: isClientDevOnly ? undefined : symbolMapper,\n            serverData,\n            containerAttributes: { ...serverData.containerAttributes },\n          };\n\n          res.setHeader('Content-Type', 'text/html; charset=utf-8');\n          res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0');\n          res.setHeader('Access-Control-Allow-Origin', '*');\n          res.setHeader('X-Powered-By', 'Qwik Vite Dev Server');\n          res.writeHead(status);\n\n          const result = await render(renderOpts);\n\n          // End stream\n          if ('html' in result) {\n            res.write((result as any).html);\n          }\n\n          // Sometimes new CSS files are added after the initial render\n          Array.from(server.moduleGraph.fileToModulesMap.entries()).forEach((entry) => {\n            entry[1].forEach((v) => {\n              const { pathId, query } = parseId(v.url);\n              if (\n                !added.has(v.url) &&\n                query === '' &&\n                CSS_EXTENSIONS.some((ext) => pathId.endsWith(ext))\n              ) {\n                const isEntryCSS = v.importers.size === 0;\n                const hasCSSImporter = Array.from(v.importers).some((importer) => {\n                  const importerPath = (importer as typeof v).url || (importer as typeof v).file;\n\n                  const isCSS =\n                    importerPath && CSS_EXTENSIONS.some((ext) => importerPath.endsWith(ext));\n\n                  if (isCSS && v.url) {\n                    cssImportedByCSS.add(v.url);\n                  }\n\n                  return isCSS;\n                });\n\n                const hasJSImporter = Array.from(v.importers).some((importer) => {\n                  const importerPath = (importer as typeof v).url || (importer as typeof v).file;\n                  return importerPath && JS_EXTENSIONS.test(importerPath);\n                });\n\n                if (\n                  (isEntryCSS || hasJSImporter) &&\n                  !hasCSSImporter &&\n                  !cssImportedByCSS.has(v.url)\n                ) {\n                  res.write(`<link rel=\"stylesheet\" href=\"${toDevServerHref(base, v.url)}\">`);\n                  added.add(v.url);\n                }\n              }\n            });\n          });\n\n          res.write(\n            END_SSR_SCRIPT(opts, opts.srcDir ? opts.srcDir : path.join(opts.rootDir, 'src'))\n          );\n          res.end();\n        } else {\n          next();\n        }\n      } else {\n        next();\n      }\n    } catch (e: any) {\n      if (e instanceof Error) {\n        server.ssrFixStacktrace(e);\n        await formatError(sys, e);\n      }\n      next(e);\n    } finally {\n      if (typeof (res as QwikViteDevResponse)._qwikRenderResolve === 'function') {\n        (res as QwikViteDevResponse)._qwikRenderResolve!();\n      }\n    }\n  });\n\n  server.middlewares.use(function (err: any, _req: any, res: ServerResponse, next: any) {\n    if (!res.writableEnded) {\n      res.write(`<style>${VITE_ERROR_OVERLAY_STYLES}</style>`);\n    }\n    return next(err);\n  });\n\n  setTimeout(() => {\n    console.log(\n      `\\n  🚧 ${magenta('Please note that development mode is slower than production.')}`\n    );\n  }, 1000);\n}\n\nexport async function configurePreviewServer(\n  middlewares: Connect.Server,\n  ssrOutDir: string,\n  sys: OptimizerSystem,\n  path: Path\n) {\n  const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n  const url: typeof import('url') = await sys.dynamicImport('node:url');\n\n  const entryPreviewPaths = ['mjs', 'cjs', 'js'].map((ext) =>\n    path.join(ssrOutDir, `entry.preview.${ext}`)\n  );\n\n  const entryPreviewModulePath = entryPreviewPaths.find((p) => fs.existsSync(p));\n  if (!entryPreviewModulePath) {\n    return invalidPreviewMessage(\n      middlewares,\n      `Unable to find output \"${ssrOutDir}/entry.preview\" module.\\n\\nPlease ensure \"src/entry.preview.tsx\" has been built before the \"preview\" command.`\n    );\n  }\n\n  try {\n    const entryPreviewImportPath = url.pathToFileURL(entryPreviewModulePath).href;\n    const previewModuleImport = await sys.strictDynamicImport(entryPreviewImportPath);\n\n    let previewMiddleware: Connect.HandleFunction | null = null;\n    let preview404Middleware: Connect.HandleFunction | null = null;\n\n    if (previewModuleImport.default) {\n      if (typeof previewModuleImport.default === 'function') {\n        previewMiddleware = previewModuleImport.default;\n      } else if (typeof previewModuleImport.default === 'object') {\n        previewMiddleware = previewModuleImport.default.router;\n        preview404Middleware = previewModuleImport.default.notFound;\n      }\n    }\n\n    if (typeof previewMiddleware !== 'function') {\n      return invalidPreviewMessage(\n        middlewares,\n        `Entry preview module \"${entryPreviewModulePath}\" does not export a default middleware function`\n      );\n    }\n\n    middlewares.use(previewMiddleware);\n\n    if (typeof preview404Middleware === 'function') {\n      middlewares.use(preview404Middleware);\n    }\n  } catch (e) {\n    return invalidPreviewMessage(middlewares, String(e));\n  }\n}\n\nfunction invalidPreviewMessage(middlewares: Connect.Server, msg: string) {\n  console.log(`\\n❌ ${msg}\\n`);\n\n  middlewares.use((_, res) => {\n    res.writeHead(400, {\n      'Content-Type': 'text/plain',\n    });\n    res.end(msg);\n  });\n}\n\nconst CYPRESS_DEV_SERVER_PATH = '/__cypress/src';\nconst FS_PREFIX = `/@fs/`;\nconst VALID_ID_PREFIX = `/@id/`;\nconst VITE_PUBLIC_PATH = `/@vite/`;\nconst internalPrefixes = [FS_PREFIX, VALID_ID_PREFIX, VITE_PUBLIC_PATH];\nconst InternalPrefixRE = new RegExp(\n  `^(${CYPRESS_DEV_SERVER_PATH})?(?:${internalPrefixes.join('|')})`\n);\n\nconst shouldSsrRender = (req: IncomingMessage, url: URL) => {\n  const pathname = url.pathname;\n  if (/\\.[\\w?=&]+$/.test(pathname) && !pathname.endsWith('.html')) {\n    // has extension\n    return false;\n  }\n  if (pathname.includes('_-vite-ping')) {\n    return false;\n  }\n  if (pathname.includes('__open-in-editor')) {\n    return false;\n  }\n  if (pathname.includes('?editor:')) {\n    return false;\n  }\n  if (url.searchParams.has('html-proxy')) {\n    return false;\n  }\n  if (url.searchParams.get('ssr') === 'false') {\n    return false;\n  }\n  if (InternalPrefixRE.test(url.pathname)) {\n    return false;\n  }\n  if (pathname.includes('@builder.io/qwik/build')) {\n    return false;\n  }\n  const acceptHeader = req.headers.accept || '';\n  const accepts = acceptHeader.split(',').map((accept) => accept.split(';')[0]);\n  if (accepts.length == 1 && accepts.includes('*/*')) {\n    // special case for curl where the default is `*/*` with no additional headers\n    return true;\n  }\n\n  if (!accepts.includes('text/html')) {\n    return false;\n  }\n  return true;\n};\n\ndeclare global {\n  interface Window {\n    __qwik_inspector_state: {\n      pressedKeys: string[];\n      hoveredElement?: EventTarget | null;\n    };\n  }\n}\n\nfunction relativeURL(url: string, base: string) {\n  if (url.startsWith(base)) {\n    url = url.slice(base.length);\n    if (!url.startsWith('/')) {\n      url = '/' + url;\n    }\n  }\n  return url;\n}\n\n/** Converts a Vite module graph URL to a dev server href for `<link>` tags. */\nexport function toDevServerHref(base: string, url: string): string {\n  if (url.startsWith('/')) {\n    return `${base}${url.slice(1)}`;\n  }\n  // Virtual modules need the /@id/ prefix; strip the \\0 Rollup convention prefix\n  const cleanUrl = url.startsWith('\\0') ? url.slice(1) : url;\n  return `${base}${VALID_ID_PREFIX.slice(1)}${cleanUrl}`;\n}\n\nconst DEV_QWIK_INSPECTOR = (opts: NormalizedQwikPluginOptions['devTools'], srcDir: string) => {\n  const qwikdevtools = {\n    hotKeys: opts.clickToSource ?? [],\n    srcDir: new URL(srcDir + '/', 'http://local.local').href,\n  };\n  return (\n    `<script>\n      globalThis.qwikdevtools = ${JSON.stringify(qwikdevtools)};\n    </script>` +\n    (opts.imageDevTools ? imageDevTools : '') +\n    (opts.clickToSource ? clickToComponent : '')\n  );\n};\n\nconst END_SSR_SCRIPT = (opts: NormalizedQwikPluginOptions, srcDir: string) => `\n<style>${VITE_ERROR_OVERLAY_STYLES}</style>\n<script type=\"module\" src=\"/@vite/client\"></script>\n${errorHost}\n${perfWarning}\n${DEV_QWIK_INSPECTOR(opts.devTools, srcDir)}\n`;\n\nfunction getViteDevIndexHtml(entryUrl: string, serverData: Record<string, any>) {\n  return `<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n  </head>\n  <body>\n    <script type=\"module\">\n    async function main() {\n      const mod = await import(\"${entryUrl}?${VITE_DEV_CLIENT_QS}=\");\n      if (mod.default) {\n        const serverData = JSON.parse(${JSON.stringify(JSON.stringify(serverData))})\n        mod.default({\n          serverData,\n        });\n      }\n    }\n    main();\n    </script>\n    ${errorHost}\n  </body>\n</html>`;\n}\n\nexport const VITE_DEV_CLIENT_QS = `qwik-vite-dev-client`;\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/vite-dev-server.unit.ts",
    "content": "import { describe, expect, test } from 'vitest';\nimport { toDevServerHref } from './vite-dev-server';\n\ndescribe('toDevServerHref', () => {\n  test('normal CSS file with base /', () => {\n    expect(toDevServerHref('/', '/src/styles.css')).toBe('/src/styles.css');\n  });\n\n  test('normal CSS file with custom base', () => {\n    expect(toDevServerHref('/my-app/', '/src/styles.css')).toBe('/my-app/src/styles.css');\n  });\n\n  test('normal CSS file with HMR timestamp', () => {\n    expect(toDevServerHref('/', '/src/styles.css?t=1234567890')).toBe(\n      '/src/styles.css?t=1234567890'\n    );\n  });\n\n  test('virtual CSS module with base /', () => {\n    expect(toDevServerHref('/', 'virtual:my-plugin:foo.css')).toBe(\n      '/@id/virtual:my-plugin:foo.css'\n    );\n  });\n\n  test('virtual CSS module with custom base', () => {\n    expect(toDevServerHref('/my-app/', 'virtual:my-plugin:foo.css')).toBe(\n      '/my-app/@id/virtual:my-plugin:foo.css'\n    );\n  });\n\n  test('virtual CSS module with \\\\0 prefix', () => {\n    expect(toDevServerHref('/', '\\0virtual:my-plugin:foo.css')).toBe(\n      '/@id/virtual:my-plugin:foo.css'\n    );\n  });\n\n  test('virtual CSS module with \\\\0 prefix and custom base', () => {\n    expect(toDevServerHref('/my-app/', '\\0virtual:my-plugin:foo.css')).toBe(\n      '/my-app/@id/virtual:my-plugin:foo.css'\n    );\n  });\n\n  test('virtual CSS module with path-like ID', () => {\n    expect(toDevServerHref('/', 'virtual:my-plugin:/src/routes/index.tsx.css')).toBe(\n      '/@id/virtual:my-plugin:/src/routes/index.tsx.css'\n    );\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/vite-error.ts",
    "content": "export const VITE_ERROR_OVERLAY_STYLES = `\nvite-error-overlay {\n  --color-bright: rgba(255, 255, 255, 0.8);\n  --color-yellow: rgba(255,246,85,0.8);\n  --qwik-dark-blue: #006ce9;\n  --qwik-light-blue: #3ec2f7;\n  --qwik-light-purple: #ac7ff4;\n  --qwik-dark-purple: #713fc2;\n  --yellow: #fff;                   /* override vite yellow */\n  --purple: var(--color-bright);    /* override vite purple */\n  --red: var(--qwik-light-blue);    /* override vite red */\n\n  --vertical-box-spacing: 15px;\n  --box-padding: 20px;\n  --box-margin: 0 0 var(--vertical-box-spacing) 0;\n  --box-background: rgba(0, 0, 0, 0.5);\n  --box-border-radius: 8px;\n}\n\nvite-error-overlay::part(backdrop) {\n  background: rgb(2 11 17 / 60%);\n}\n\nvite-error-overlay::part(window) {\n  background: transparent;\n  border: none;\n  box-shadow: none;\n  box-sizing: border-box;\n  margin: 50px auto;\n  max-width: 1200px;\n  padding: var(--box-padding);\n  width: 90%;\n}\n\nvite-error-overlay::part(message) {\n  display: flex;\n  flex-direction: column;\n  font-size: 1.6rem;\n  line-height: 1.7;\n  margin-bottom: 30px;\n}\n\nvite-error-overlay::part(plugin) {\n  font-size: 0.8rem;\n  font-weight: 100;\n}\n\nvite-error-overlay::part(file),\nvite-error-overlay::part(frame),\nvite-error-overlay::part(stack),\nvite-error-overlay::part(tip) {\n  background: var(--box-background);\n  border-left: 5px solid transparent;\n  border-radius: var(--box-border-radius);\n  margin: var(--box-margin);\n  min-height: 50px;\n  padding: var(--box-padding);\n  position: relative;\n}\n\nvite-error-overlay::part(file) {\n  border-left-color: rgb(25 182 246);\n  color: var(--color-bright);\n}\n\nvite-error-overlay::part(frame) {\n  border-left-color: var(--color-yellow);\n  color: var(--color-yellow);\n}\n\nvite-error-overlay::part(stack) {\n  border-left-color: #FF5722;\n}\n\n\nvite-error-overlay::part(tip) {\n  border-top: none;\n  border-left-color: rgb(172, 127, 244);\n}\n\nvite-error-overlay::part(file):before,\nvite-error-overlay::part(frame):before,\nvite-error-overlay::part(stack):before {\n  border-bottom: 1px solid #222;\n  color: var(--color-bright);\n  display: block;\n  margin-bottom: 15px;\n  padding-bottom: 5px;\n  padding-left: 30px; /* space for icon */\n  font-size: .8rem;\n}\n\nvite-error-overlay::part(file):before {\n  content: 'File';\n}\n\nvite-error-overlay::part(frame):before {\n  content: 'Frame';\n}\n\nvite-error-overlay::part(stack):before {\n  content: 'Stack Trace';\n}\n\nvite-error-overlay::part(file):after,\nvite-error-overlay::part(frame):after,\nvite-error-overlay::part(stack):after {\n  content: '';\n  display: block;\n  height: 20px;\n  position: absolute;\n  left: var(--box-padding);\n  top: var(--box-padding);\n  width: 20px;\n}\n\nvite-error-overlay::part(file):after {\n  background-image: url(\"data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EFile-Generic%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='File-Generic'%3E%3Crect id='Rectangle' fill-rule='nonzero' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3Cpath d='M4 5 C4 3.89543 4.89543 3 6 3 L15.1716 3 C15.702 3 16.2107 3.21071 16.5858 3.58579 L19.4142 6.41421 C19.7893 6.78929 20 7.29799 20 7.82843 L20 19 C20 20.1046 19.1046 21 18 21 L6 21 C4.89543 21 4 20.1046 4 19 L4 5 Z' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M15 4 L15 6 C15 7.10457 15.8954 8 17 8 L19 8' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E\");\n}\n\nvite-error-overlay::part(frame):after {\n  background-image: url(\"data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6602 2.84952H19.1516C20.2555 2.84952 21.1504 3.74444 21.1504 4.84839V8.3398' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M2.84949 8.33981L2.84949 4.8484C2.84949 3.74446 3.74441 2.84953 4.84836 2.84953L8.33977 2.84953' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M21.1505 15.6602L21.1505 19.1516C21.1505 20.2555 20.2556 21.1505 19.1516 21.1505L15.6602 21.1505' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M8.33984 21.1505L4.84843 21.1505C3.74449 21.1505 2.84956 20.2555 2.84956 19.1516L2.84956 15.6602' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3C/svg%3E\");\n}\n\nvite-error-overlay::part(stack):after {\n  background-image: url(\"data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.78 20H9.78C7.98 20 4.58 19.09 4.58 15.64C4.58 12.19 7.98 11.28 9.78 11.28H14.22C14.37 11.28 17.92 11.23 17.92 8.42C17.92 5.61 14.37 5.56 14.22 5.56H9.22C9.02109 5.56 8.83032 5.48098 8.68967 5.34033C8.54902 5.19968 8.47 5.00891 8.47 4.81C8.47 4.61109 8.54902 4.42032 8.68967 4.27967C8.83032 4.13902 9.02109 4.06 9.22 4.06H14.22C16.02 4.06 19.42 4.97 19.42 8.42C19.42 11.87 16.02 12.78 14.22 12.78H9.78C9.63 12.78 6.08 12.83 6.08 15.64C6.08 18.45 9.63 18.5 9.78 18.5H14.78C14.9789 18.5 15.1697 18.579 15.3103 18.7197C15.451 18.8603 15.53 19.0511 15.53 19.25C15.53 19.4489 15.451 19.6397 15.3103 19.7803C15.1697 19.921 14.9789 20 14.78 20Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M6.44 8.31C5.74314 8.30407 5.06363 8.09202 4.48708 7.70056C3.91054 7.30909 3.46276 6.75573 3.20018 6.11021C2.93759 5.46469 2.87195 4.75589 3.01153 4.07312C3.1511 3.39036 3.48965 2.76418 3.9845 2.2735C4.47935 1.78281 5.10837 1.44958 5.79229 1.31579C6.47622 1.182 7.18444 1.25363 7.82771 1.52167C8.47099 1.78971 9.02054 2.24215 9.40711 2.82199C9.79368 3.40182 9.99998 4.08311 10 4.78C10 5.2461 9.90773 5.70759 9.72846 6.13783C9.54919 6.56808 9.28648 6.95856 8.95551 7.28675C8.62453 7.61494 8.23184 7.87433 7.80009 8.04995C7.36834 8.22558 6.90609 8.31396 6.44 8.31ZM6.44 2.75C6.04444 2.75 5.65776 2.86729 5.32886 3.08706C4.99996 3.30682 4.74362 3.61918 4.59224 3.98463C4.44087 4.35008 4.40126 4.75221 4.47843 5.14018C4.5556 5.52814 4.74609 5.8845 5.02579 6.16421C5.3055 6.44391 5.66186 6.6344 6.04982 6.71157C6.43779 6.78874 6.83992 6.74913 7.20537 6.59776C7.57082 6.44638 7.88318 6.19003 8.10294 5.86114C8.32271 5.53224 8.44 5.14556 8.44 4.75C8.44 4.48735 8.38827 4.22728 8.28776 3.98463C8.18725 3.74198 8.03993 3.5215 7.85422 3.33578C7.6685 3.15007 7.44802 3.00275 7.20537 2.90224C6.96272 2.80173 6.70265 2.75 6.44 2.75Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M17.56 22.75C16.8614 22.752 16.1779 22.5466 15.5961 22.1599C15.0143 21.7733 14.5603 21.2227 14.2916 20.5778C14.0229 19.933 13.9515 19.2229 14.0866 18.5375C14.2217 17.8521 14.5571 17.2221 15.0504 16.7275C15.5437 16.2328 16.1726 15.8956 16.8577 15.7586C17.5427 15.6215 18.253 15.6909 18.8986 15.9577C19.5442 16.2246 20.0961 16.6771 20.4844 17.2578C20.8727 17.8385 21.08 18.5214 21.08 19.22C21.08 20.1545 20.7095 21.0508 20.0496 21.7125C19.3898 22.3743 18.4945 22.7473 17.56 22.75ZM17.56 17.19C17.1644 17.19 16.7778 17.3073 16.4489 17.5271C16.12 17.7468 15.8636 18.0592 15.7122 18.4246C15.5609 18.7901 15.5213 19.1922 15.5984 19.5802C15.6756 19.9681 15.8661 20.3245 16.1458 20.6042C16.4255 20.8839 16.7819 21.0744 17.1698 21.1516C17.5578 21.2287 17.9599 21.1891 18.3254 21.0377C18.6908 20.8864 19.0032 20.63 19.2229 20.3011C19.4427 19.9722 19.56 19.5856 19.56 19.19C19.56 18.6596 19.3493 18.1508 18.9742 17.7758C18.5991 17.4007 18.0904 17.19 17.56 17.19Z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E\");\n}\n\nvite-error-overlay::part(tip):before {\n  content: \"Not sure how to solve this? Visit https://qwik.dev or connect with the community on Discord.\";\n  display: block;\n  margin-bottom: 1em;\n}\n`;\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/vite-utils.ts",
    "content": "import type { OptimizerSystem } from '../types';\n\nexport async function formatError(sys: OptimizerSystem, e: Error) {\n  const err = e as any;\n  let loc = err.loc;\n\n  if (!err.frame && !err.plugin) {\n    if (!loc) {\n      loc = findLocation(err);\n    }\n    if (loc) {\n      err.loc = loc;\n      if (loc.file) {\n        const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n        const { normalizePath }: typeof import('vite') = await sys.dynamicImport('vite');\n        err.id = normalizePath(err.loc.file);\n        try {\n          const code = fs.readFileSync(err.loc.file, 'utf-8');\n          err.frame = generateCodeFrame(code, err.loc);\n        } catch {\n          // nothing\n        }\n      }\n    }\n  }\n  return e;\n}\n\nexport interface Loc {\n  file: string;\n  line: number | undefined;\n  column: number | undefined;\n}\n\nexport const findLocation = (e: Error): Loc | undefined => {\n  const stack = e.stack;\n  if (typeof stack === 'string') {\n    const lines = stack\n      .split('\\n')\n      .filter((l) => !l.includes('/node_modules/') && !l.includes('(node:'));\n\n    for (let i = 1; i < lines.length; i++) {\n      const line = lines[i].replace('file:///', '/');\n      if (/^\\s+at/.test(line)) {\n        const start = line.indexOf('/');\n        const end = line.lastIndexOf(')', start);\n        if (start > 0) {\n          const path = line.slice(start, end);\n          const parts = path.split(':');\n          const nu0 = safeParseInt(parts[parts.length - 1]);\n          const nu1 = safeParseInt(parts[parts.length - 2]);\n          if (typeof nu0 === 'number' && typeof nu1 === 'number') {\n            parts.length -= 2;\n            return {\n              file: parts.join(':'),\n              line: nu1,\n              column: nu0,\n            };\n          } else if (typeof nu0 === 'number') {\n            parts.length -= 1;\n            return {\n              file: parts.join(':'),\n              line: nu0,\n              column: undefined,\n            };\n          } else {\n            return {\n              file: parts.join(':'),\n              line: undefined,\n              column: undefined,\n            };\n          }\n        }\n      }\n    }\n  }\n  return undefined;\n};\n\nconst safeParseInt = (nu: string) => {\n  try {\n    return parseInt(nu, 10);\n  } catch {\n    return undefined;\n  }\n};\n\nconst splitRE = /\\r?\\n/;\nconst range: number = 2;\n\nexport function posToNumber(\n  source: string,\n  pos: number | { line: number; column: number; lo: number }\n): number {\n  if (typeof pos === 'number') {\n    return pos;\n  }\n  if (pos.lo != null) {\n    return pos.lo;\n  }\n  const lines = source.split(splitRE);\n  const { line, column } = pos;\n  let start = 0;\n  for (let i = 0; i < line - 1 && i < lines.length; i++) {\n    start += lines[i].length + 1;\n  }\n  return start + column;\n}\n\nexport function generateCodeFrame(\n  source: string,\n  start: number | { line: number; column: number; lo: number } = 0,\n  end?: number\n): string {\n  start = posToNumber(source, start);\n  end = end || start;\n  const lines = source.split(splitRE);\n  let count = 0;\n  const res: string[] = [];\n  for (let i = 0; i < lines.length; i++) {\n    count += lines[i].length + 1;\n    if (count >= start) {\n      for (let j = i - range; j <= i + range || end > count; j++) {\n        if (j < 0 || j >= lines.length) {\n          continue;\n        }\n        const line = j + 1;\n        res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}|  ${lines[j]}`);\n        const lineLength = lines[j].length;\n        if (j === i) {\n          // push underline\n          const pad = Math.max(start - (count - lineLength) + 1, 0);\n          const length = Math.max(1, end > count ? lineLength - pad : end - start);\n          res.push(`   |  ` + ' '.repeat(pad) + '^'.repeat(length));\n        } else if (j > i) {\n          if (end > count) {\n            const length = Math.max(Math.min(end - count, lineLength), 1);\n            res.push(`   |  ` + '^'.repeat(length));\n          }\n          count += lineLength + 1;\n        }\n      }\n      break;\n    }\n  }\n  return res.join('\\n');\n}\n\nexport function isWin(os: string): boolean {\n  return os === 'win32';\n}\n\nexport function parseId(originalId: string) {\n  const [pathId, query] = originalId.split('?');\n  const queryStr = query || '';\n  return {\n    originalId,\n    pathId,\n    query: queryStr ? `?${query}` : '',\n    params: new URLSearchParams(queryStr),\n  };\n}\n\nexport const getSymbolHash = (symbolName: string) =>\n  /_([a-zA-Z0-9]+)($|\\.js($|\\?))/.exec(symbolName)?.[1];\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/vite.ts",
    "content": "import type { UserConfig, ViteDevServer, Plugin as VitePlugin, BuildOptions } from 'vite';\nimport { QWIK_LOADER_DEFAULT_DEBUG, QWIK_LOADER_DEFAULT_MINIFIED } from '../scripts';\nimport type {\n  EntryStrategy,\n  GlobalInjections,\n  Optimizer,\n  OptimizerOptions,\n  OptimizerSystem,\n  QwikManifest,\n  SystemEnvironment,\n  TransformModule,\n} from '../types';\nimport { type BundleGraphAdder } from './bundle-graph';\nimport { getImageSizeServer } from './image-size-server';\nimport {\n  CLIENT_OUT_DIR,\n  QWIK_BUILD_ID,\n  QWIK_CLIENT_MANIFEST_ID,\n  QWIK_CORE_ID,\n  QWIK_CORE_SERVER,\n  QWIK_JSX_DEV_RUNTIME_ID,\n  QWIK_JSX_RUNTIME_ID,\n  SSR_OUT_DIR,\n  TRANSFORM_REGEX,\n  createQwikPlugin,\n  type ExperimentalFeatures,\n  type NormalizedQwikPluginOptions,\n  type QwikBuildMode,\n  type QwikBuildTarget,\n  type QwikPackages,\n  type QwikPluginOptions,\n} from './plugin';\nimport { createRollupError, normalizeRollupOutputOptions } from './rollup';\nimport { VITE_DEV_CLIENT_QS, configureDevServer, configurePreviewServer } from './vite-dev-server';\nimport { parseId } from './vite-utils';\nimport { findDepPkgJsonPath } from './utils';\n\nconst DEDUPE = [QWIK_CORE_ID, QWIK_JSX_RUNTIME_ID, QWIK_JSX_DEV_RUNTIME_ID];\n\nconst STYLING = ['.css', '.scss', '.sass', '.less', '.styl', '.stylus'];\nconst FONTS = ['.woff', '.woff2', '.ttf'];\n\n/**\n * Workaround to make the api be defined in the type.\n *\n * @internal\n */\ntype P<T> = VitePlugin<T> & { api: T; config: Extract<VitePlugin<T>['config'], Function> };\n\n/**\n * The types for Vite/Rollup don't allow us to be too specific about the return type. The correct\n * return type is `[QwikVitePlugin, VitePlugin<never>]`, and if you search the plugin by name you'll\n * get the `QwikVitePlugin`.\n *\n * @public\n */\nexport function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {\n  let isClientDevOnly = false;\n  let clientDevInput: undefined | string = undefined;\n  let tmpClientManifestPath: undefined | string = undefined;\n  let viteCommand: 'build' | 'serve' = 'serve';\n  let manifestInput: QwikManifest | null = null;\n  let clientOutDir: string | null = null;\n  let basePathname: string = '/';\n  let clientPublicOutDir: string | null = null;\n  let viteAssetsDir: string | undefined;\n  let srcDir: string | null = null;\n  let rootDir: string | null = null;\n\n  let ssrOutDir: string | null = null;\n  const fileFilter: QwikVitePluginOptions['fileFilter'] = qwikViteOpts.fileFilter\n    ? (id, type) => TRANSFORM_REGEX.test(id) || qwikViteOpts.fileFilter!(id, type)\n    : () => true;\n  const disableFontPreload = qwikViteOpts.disableFontPreload ?? false;\n  const injections: GlobalInjections[] = [];\n  const qwikPlugin = createQwikPlugin(qwikViteOpts.optimizerOptions);\n\n  const bundleGraphAdders = new Set<BundleGraphAdder>();\n\n  const api: QwikVitePluginApi = {\n    getOptimizer: () => qwikPlugin.getOptimizer(),\n    getOptions: () => qwikPlugin.getOptions(),\n    getManifest: () => manifestInput,\n    getRootDir: () => qwikPlugin.getOptions().rootDir,\n    getClientOutDir: () => clientOutDir,\n    getClientPublicOutDir: () => clientPublicOutDir,\n    getAssetsDir: () => viteAssetsDir,\n    registerBundleGraphAdder: (adder: BundleGraphAdder) => bundleGraphAdders.add(adder),\n  };\n\n  // We provide two plugins to Vite. The first plugin is the main plugin that handles all the\n  // Vite hooks. The second plugin is a post plugin that is called after the build has finished.\n  // The post plugin is used to generate the Qwik manifest file that is used during SSR to\n  // generate QRLs for event handlers.\n  const vitePluginPre: P<QwikVitePluginApi> = {\n    name: 'vite-plugin-qwik',\n    enforce: 'pre',\n    api,\n\n    async config(viteConfig, viteEnv) {\n      await qwikPlugin.init();\n\n      const sys = qwikPlugin.getSys();\n      const path = qwikPlugin.getPath();\n\n      let target: QwikBuildTarget;\n      if (viteConfig.build?.ssr || viteEnv.mode === 'ssr') {\n        target = 'ssr';\n      } else if (viteEnv.mode === 'lib') {\n        target = 'lib';\n      } else if (viteEnv.mode === 'test') {\n        target = 'test';\n      } else {\n        target = 'client';\n      }\n\n      let buildMode: QwikBuildMode;\n      if (viteEnv.mode === 'production') {\n        buildMode = 'production';\n      } else if (viteEnv.mode === 'development') {\n        buildMode = 'development';\n      } else if (viteCommand === 'build' && target === 'client') {\n        // build (production)\n        buildMode = 'production';\n      } else {\n        // serve (development)\n        buildMode = 'development';\n      }\n\n      viteCommand = viteEnv.command;\n      isClientDevOnly = viteCommand === 'serve' && viteEnv.mode !== 'ssr';\n\n      qwikPlugin.debug(`vite config(), command: ${viteCommand}, env.mode: ${viteEnv.mode}`);\n\n      if (viteCommand === 'serve') {\n        qwikViteOpts.entryStrategy = { type: 'segment' };\n      } else {\n        if (target === 'ssr') {\n          qwikViteOpts.entryStrategy = { type: 'hoist' };\n        } else if (target === 'lib') {\n          qwikViteOpts.entryStrategy = { type: 'inline' };\n        }\n      }\n\n      const shouldFindVendors =\n        !qwikViteOpts.disableVendorScan && (target !== 'lib' || viteCommand === 'serve');\n      viteAssetsDir = viteConfig.build?.assetsDir;\n      const useAssetsDir = target === 'client' && !!viteAssetsDir && viteAssetsDir !== '_astro';\n      const pluginOpts: QwikPluginOptions = {\n        target,\n        buildMode,\n        csr: qwikViteOpts.csr,\n        debug: qwikViteOpts.debug,\n        entryStrategy: qwikViteOpts.entryStrategy,\n        srcDir: qwikViteOpts.srcDir,\n        rootDir: viteConfig.root,\n        tsconfigFileNames: qwikViteOpts.tsconfigFileNames,\n        resolveQwikBuild: true,\n        transformedModuleOutput: qwikViteOpts.transformedModuleOutput,\n        outDir: viteConfig.build?.outDir,\n        assetsDir: useAssetsDir ? viteAssetsDir : undefined,\n        devTools: qwikViteOpts.devTools,\n        sourcemap: !!viteConfig.build?.sourcemap,\n        lint: qwikViteOpts.lint,\n        experimental: qwikViteOpts.experimental,\n      };\n      if (!qwikViteOpts.csr) {\n        if (target === 'ssr') {\n          // ssr\n          if (typeof viteConfig.build?.ssr === 'string') {\n            // from --ssr flag user config\n            // entry.server.ts (express/cloudflare/netlify)\n            pluginOpts.input = viteConfig.build.ssr;\n          } else if (typeof qwikViteOpts.ssr?.input === 'string') {\n            // entry.ssr.tsx input (exports render())\n            pluginOpts.input = qwikViteOpts.ssr.input;\n          }\n\n          if (qwikViteOpts.ssr?.outDir) {\n            pluginOpts.outDir = qwikViteOpts.ssr.outDir;\n          }\n          pluginOpts.manifestInput = qwikViteOpts.ssr?.manifestInput;\n        } else if (target === 'client') {\n          // client\n          pluginOpts.input = qwikViteOpts.client?.input;\n          if (qwikViteOpts.client?.outDir) {\n            pluginOpts.outDir = qwikViteOpts.client.outDir;\n          }\n          pluginOpts.manifestOutput = qwikViteOpts.client?.manifestOutput;\n        } else {\n          if (typeof viteConfig.build?.lib === 'object') {\n            pluginOpts.input = viteConfig.build?.lib.entry;\n          }\n        }\n        if (hasNodeCompat(sys.env)) {\n          const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n\n          try {\n            const rootDir = pluginOpts.rootDir ?? sys.cwd();\n            const packageJsonPath = sys.path.join(rootDir, 'package.json');\n            const pkgString = await fs.promises.readFile(packageJsonPath, 'utf-8');\n\n            try {\n              const data = JSON.parse(pkgString);\n\n              if (typeof data.name === 'string') {\n                pluginOpts.scope = data.name;\n              }\n            } catch (e) {\n              console.error(e);\n            }\n          } catch {\n            // error reading package.json from Node.js fs, ok to ignore\n          }\n\n          // In a Node.js environment, create a path to a q-manifest.json file within the\n          // OS tmp directory. This path should always be the same for both client and ssr.\n          // Client build will write to this path, and SSR will read from it. For this reason,\n          // the Client build should always start and finish before the SSR build.\n          const nodeOs: typeof import('os') = await sys.dynamicImport('node:os');\n\n          // Additionally, we add a suffix to scope the file to the current application so that\n          // different applications can be run in parallel without generating conflicts.\n          const scopeSuffix = pluginOpts.scope ? `-${pluginOpts.scope.replace(/\\//g, '--')}` : '';\n\n          tmpClientManifestPath = path.join(\n            nodeOs.tmpdir(),\n            `vite-plugin-qwik-q-manifest${scopeSuffix}.json`\n          );\n\n          if (target === 'ssr' && !pluginOpts.manifestInput) {\n            // This is a SSR build so we should load the client build's manifest\n            // so it can be used as the manifestInput of the SSR build\n            try {\n              const clientManifestStr = await fs.promises.readFile(tmpClientManifestPath, 'utf-8');\n              pluginOpts.manifestInput = JSON.parse(clientManifestStr);\n            } catch {\n              // ignore\n            }\n          }\n        }\n      }\n\n      const opts = qwikPlugin.normalizeOptions(pluginOpts);\n      manifestInput = pluginOpts.manifestInput || null;\n      srcDir = opts.srcDir;\n      rootDir = opts.rootDir;\n\n      if (!qwikViteOpts.csr) {\n        clientOutDir = qwikPlugin.normalizePath(\n          sys.path.resolve(opts.rootDir, qwikViteOpts.client?.outDir || CLIENT_OUT_DIR)\n        );\n\n        clientPublicOutDir = viteConfig.base\n          ? path.join(clientOutDir, viteConfig.base)\n          : clientOutDir;\n\n        ssrOutDir = qwikPlugin.normalizePath(\n          sys.path.resolve(opts.rootDir, qwikViteOpts.ssr?.outDir || SSR_OUT_DIR)\n        );\n\n        if (typeof qwikViteOpts.client?.devInput === 'string') {\n          clientDevInput = path.resolve(opts.rootDir, qwikViteOpts.client.devInput);\n        } else {\n          if (opts.srcDir) {\n            clientDevInput = path.resolve(opts.srcDir, CLIENT_DEV_INPUT);\n          } else {\n            clientDevInput = path.resolve(opts.rootDir, 'src', CLIENT_DEV_INPUT);\n          }\n        }\n        clientDevInput = qwikPlugin.normalizePath(clientDevInput);\n      }\n\n      const vendorRoots = shouldFindVendors ? await findQwikRoots(sys, sys.cwd()) : [];\n      const vendorIds = vendorRoots.map((v) => v.id);\n      const isDevelopment = buildMode === 'development';\n      const qDevKey = 'globalThis.qDev';\n      const qTestKey = 'globalThis.qTest';\n      const qInspectorKey = 'globalThis.qInspector';\n      const qSerializeKey = 'globalThis.qSerialize';\n      const qDev = viteConfig?.define?.[qDevKey] ?? isDevelopment;\n      const qInspector = viteConfig?.define?.[qInspectorKey] ?? isDevelopment;\n      const qSerialize = viteConfig?.define?.[qSerializeKey] ?? isDevelopment;\n\n      const updatedViteConfig: UserConfig = {\n        ssr: {\n          noExternal: [QWIK_CORE_ID, QWIK_CORE_SERVER, QWIK_BUILD_ID, ...vendorIds],\n        },\n        envPrefix: ['VITE_', 'PUBLIC_'],\n        resolve: {\n          dedupe: [...DEDUPE, ...vendorIds],\n          conditions: buildMode === 'production' && target === 'client' ? ['min'] : [],\n        },\n        esbuild:\n          viteCommand === 'serve'\n            ? false\n            : {\n                logLevel: 'error',\n                jsx: 'automatic',\n              },\n        optimizeDeps: {\n          exclude: [\n            '@vite/client',\n            '@vite/env',\n            'node-fetch',\n            'undici',\n            QWIK_CORE_ID,\n            QWIK_CORE_SERVER,\n            QWIK_JSX_RUNTIME_ID,\n            QWIK_JSX_DEV_RUNTIME_ID,\n            QWIK_BUILD_ID,\n            QWIK_CLIENT_MANIFEST_ID,\n            ...vendorIds,\n          ],\n        },\n        build: {\n          modulePreload: false,\n          dynamicImportVarsOptions: {\n            exclude: [/./],\n          },\n          rollupOptions: {\n            /**\n             * This is a workaround to have predictable chunk hashes between builds. It doesn't seem\n             * to impact the build time.\n             * https://github.com/QwikDev/qwik/issues/7226#issuecomment-2647122505\n             */\n            maxParallelFileOps: 1,\n            // temporary fix for rolldown-vite types\n          } as BuildOptions['rollupOptions'],\n        },\n        define: {\n          [qDevKey]: qDev,\n          [qInspectorKey]: qInspector,\n          [qSerializeKey]: qSerialize,\n          [qTestKey]: JSON.stringify(process.env.NODE_ENV === 'test'),\n        },\n      };\n\n      if (!qwikViteOpts.csr) {\n        const buildOutputDir =\n          target === 'client' && viteConfig.base\n            ? path.join(opts.outDir, viteConfig.base)\n            : opts.outDir;\n\n        updatedViteConfig.build!.cssCodeSplit = false;\n        updatedViteConfig.build!.outDir = buildOutputDir;\n        const origOnwarn = updatedViteConfig.build!.rollupOptions?.onwarn;\n        updatedViteConfig.build!.rollupOptions = {\n          input: opts.input,\n          output: await normalizeRollupOutputOptions(\n            qwikPlugin,\n            viteConfig.build?.rollupOptions?.output,\n            useAssetsDir,\n            buildOutputDir\n          ),\n          preserveEntrySignatures: 'exports-only',\n          onwarn: (warning, warn) => {\n            if (warning.plugin === 'typescript' && warning.message.includes('outputToFilesystem')) {\n              return;\n            }\n            origOnwarn ? origOnwarn(warning, warn) : warn(warning);\n          },\n        };\n\n        if (opts.target === 'ssr') {\n          // SSR Build\n          if (viteCommand === 'build') {\n            updatedViteConfig.publicDir = false;\n            updatedViteConfig.build!.ssr = true;\n            if (viteConfig.build?.minify == null && buildMode === 'production') {\n              updatedViteConfig.build!.minify = 'esbuild';\n            }\n          }\n        } else if (opts.target === 'client') {\n          // Client Build\n          if (isClientDevOnly && !opts.csr) {\n            updatedViteConfig.build!.rollupOptions!.input = clientDevInput;\n          }\n        } else if (opts.target === 'lib') {\n          // Library Build\n          updatedViteConfig.build!.minify = false;\n          updatedViteConfig.build!.rollupOptions.external = [\n            QWIK_CORE_ID,\n            QWIK_CORE_SERVER,\n            QWIK_JSX_RUNTIME_ID,\n            QWIK_JSX_DEV_RUNTIME_ID,\n            QWIK_BUILD_ID,\n            QWIK_CLIENT_MANIFEST_ID,\n          ];\n        } else {\n          // Test Build\n          updatedViteConfig.define = {\n            [qDevKey]: true,\n            [qTestKey]: true,\n            [qInspectorKey]: false,\n          };\n        }\n\n        (globalThis as any).qDev = qDev;\n        (globalThis as any).qTest = true;\n        (globalThis as any).qInspector = qInspector;\n      }\n\n      return updatedViteConfig;\n    },\n\n    async configResolved(config) {\n      basePathname = config.base;\n      if (!(basePathname.startsWith('/') && basePathname.endsWith('/'))) {\n        // TODO v2: make this an error\n        console.error(\n          `warning: vite's config.base must begin and end with /. This will be an error in v2. If you have a valid use case, please open an issue.`\n        );\n        if (!basePathname.endsWith('/')) {\n          basePathname += '/';\n        }\n      }\n      const useSourcemap = !!config.build.sourcemap;\n      if (useSourcemap && qwikViteOpts.optimizerOptions?.sourcemap === undefined) {\n        qwikPlugin.setSourceMapSupport(true);\n      }\n      // Ensure that the final settings are applied\n      qwikPlugin.normalizeOptions(qwikViteOpts);\n    },\n\n    async buildStart() {\n      // Using vite.resolveId to check file if exist\n      // for example input might be virtual file\n      const resolver = this.resolve.bind(this);\n      await qwikPlugin.validateSource(resolver);\n\n      qwikPlugin.onDiagnostics((diagnostics, optimizer, srcDir) => {\n        diagnostics.forEach((d) => {\n          const id = qwikPlugin.normalizePath(optimizer.sys.path.join(srcDir, d.file));\n          if (d.category === 'error') {\n            this.error(createRollupError(id, d));\n          } else {\n            this.warn(createRollupError(id, d));\n          }\n        });\n      });\n\n      await qwikPlugin.buildStart(this);\n    },\n\n    resolveId(id, importer, resolveIdOpts) {\n      if (id.startsWith('\\0') || !fileFilter(id, 'resolveId')) {\n        return null;\n      }\n      if (isClientDevOnly && id === VITE_CLIENT_MODULE) {\n        return id;\n      }\n      return qwikPlugin.resolveId(this, id, importer, resolveIdOpts);\n    },\n\n    load(id, loadOpts) {\n      if (id.startsWith('\\0') || !fileFilter(id, 'load')) {\n        return null;\n      }\n\n      id = qwikPlugin.normalizePath(id);\n      const opts = qwikPlugin.getOptions();\n\n      if (isClientDevOnly && id === VITE_CLIENT_MODULE) {\n        return getViteDevModule(opts);\n      }\n      if (viteCommand === 'serve' && id.endsWith(QWIK_CLIENT_MANIFEST_ID)) {\n        return {\n          code: 'export const manifest = undefined;',\n        };\n      }\n      return qwikPlugin.load(this, id, loadOpts);\n    },\n\n    transform(code, id, transformOpts) {\n      if (id.startsWith('\\0') || !fileFilter(id, 'transform') || id.includes('?raw')) {\n        return null;\n      }\n\n      if (isClientDevOnly) {\n        const parsedId = parseId(id);\n        if (parsedId.params.has(VITE_DEV_CLIENT_QS)) {\n          code = updateEntryDev(code);\n        }\n      }\n      return qwikPlugin.transform(this, code, id, transformOpts);\n    },\n  } as const satisfies VitePlugin<QwikVitePluginApi>;\n\n  const vitePluginPost: VitePlugin<never> = {\n    name: 'vite-plugin-qwik-post',\n    enforce: 'post',\n\n    generateBundle: {\n      order: 'post',\n      async handler(_, rollupBundle) {\n        const opts = qwikPlugin.getOptions();\n\n        if (opts.target === 'client') {\n          // client build\n\n          for (const [fileName, b] of Object.entries(rollupBundle)) {\n            if (b.type === 'asset') {\n              const baseFilename = basePathname + fileName;\n              if (STYLING.some((ext) => fileName.endsWith(ext))) {\n                if (typeof b.source === 'string' && b.source.length < opts.inlineStylesUpToBytes) {\n                  injections.push({\n                    tag: 'style',\n                    location: 'head',\n                    attributes: {\n                      'data-src': baseFilename,\n                      dangerouslySetInnerHTML: b.source,\n                    },\n                  });\n                } else {\n                  injections.push({\n                    tag: 'link',\n                    location: 'head',\n                    attributes: {\n                      rel: 'stylesheet',\n                      href: baseFilename,\n                    },\n                  });\n                }\n              } else {\n                const selectedFont = FONTS.find((ext) => fileName.endsWith(ext));\n                if (selectedFont && !disableFontPreload) {\n                  injections.unshift({\n                    tag: 'link',\n                    location: 'head',\n                    attributes: {\n                      rel: 'preload',\n                      href: baseFilename,\n                      as: 'font',\n                      type: `font/${selectedFont.slice(1)}`,\n                      crossorigin: '',\n                    },\n                  });\n                }\n              }\n            }\n          }\n\n          const clientManifestStr = await qwikPlugin.generateManifest(\n            this,\n            rollupBundle,\n            bundleGraphAdders,\n            {\n              injections,\n              platform: { vite: '' },\n            }\n          );\n\n          const sys = qwikPlugin.getSys();\n          if (tmpClientManifestPath && hasNodeCompat(sys.env)) {\n            // Client build should write the manifest to a tmp dir\n            const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n            await fs.promises.writeFile(tmpClientManifestPath, clientManifestStr);\n          }\n        }\n      },\n    },\n\n    async writeBundle(_, rollupBundle) {\n      const opts = qwikPlugin.getOptions();\n      if (opts.target === 'ssr') {\n        // ssr build\n\n        const sys = qwikPlugin.getSys();\n        if (hasNodeCompat(sys.env)) {\n          const outputs = Object.keys(rollupBundle);\n\n          // In order to simplify executing the server script with a common script\n          // always ensure there's a plain .js file.\n          // For example, if only a .mjs was generated, also\n          // create the .js file that just calls the .mjs file\n          const patchModuleFormat = async (bundeName: string) => {\n            try {\n              const bundleFileName = sys.path.basename(bundeName);\n              const ext = sys.path.extname(bundleFileName);\n              const isEntryFile =\n                bundleFileName.startsWith('entry.') || bundleFileName.startsWith('entry_');\n              if (\n                isEntryFile &&\n                !bundleFileName.includes('preview') &&\n                (ext === '.mjs' || ext === '.cjs')\n              ) {\n                const extlessName = sys.path.basename(bundleFileName, ext);\n                const js = `${extlessName}.js`;\n                const moduleName = extlessName + ext;\n\n                const hasJsScript = outputs.some((f) => sys.path.basename(f) === js);\n                if (!hasJsScript) {\n                  // didn't generate a .js script\n                  // create a .js file that just import()s their script\n                  const bundleOutDir = sys.path.dirname(bundeName);\n                  const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n\n                  const folder = sys.path.join(opts.outDir, bundleOutDir);\n                  await fs.promises.mkdir(folder, { recursive: true });\n                  await fs.promises.writeFile(\n                    sys.path.join(folder, js),\n                    `export * from \"./${moduleName}\";`\n                  );\n                }\n              }\n            } catch (e) {\n              console.error('patchModuleFormat', e);\n            }\n          };\n\n          await Promise.all(outputs.map(patchModuleFormat));\n        }\n      }\n    },\n\n    configureServer(server: ViteDevServer) {\n      qwikPlugin.configureServer(server);\n      const devSsrServer = 'devSsrServer' in qwikViteOpts ? !!qwikViteOpts.devSsrServer : true;\n      const imageDevTools =\n        qwikViteOpts.devTools && 'imageDevTools' in qwikViteOpts.devTools\n          ? qwikViteOpts.devTools.imageDevTools\n          : true;\n\n      if (imageDevTools) {\n        server.middlewares.use(getImageSizeServer(qwikPlugin.getSys(), rootDir!, srcDir!));\n      }\n\n      if (!qwikViteOpts.csr) {\n        const plugin = async () => {\n          const opts = qwikPlugin.getOptions();\n          const sys = qwikPlugin.getSys();\n          const path = qwikPlugin.getPath();\n          await configureDevServer(\n            basePathname,\n            server,\n            opts,\n            sys,\n            path,\n            isClientDevOnly,\n            clientDevInput,\n            devSsrServer\n          );\n        };\n        const isNEW = (globalThis as any).__qwikCityNew === true;\n        if (isNEW) {\n          return plugin;\n        } else {\n          return plugin();\n        }\n      }\n    },\n\n    configurePreviewServer(server) {\n      return async () => {\n        const sys = qwikPlugin.getSys();\n        const path = qwikPlugin.getPath();\n        await configurePreviewServer(server.middlewares, ssrOutDir!, sys, path);\n      };\n    },\n\n    handleHotUpdate(ctx) {\n      qwikPlugin.handleHotUpdate(ctx);\n\n      // Tell the client to reload the page if any modules were used in ssr or client\n      // this needs to be refined\n      if (ctx.modules.length) {\n        ctx.server.hot.send({\n          type: 'full-reload',\n        });\n      }\n    },\n\n    onLog(level, log) {\n      if (log.plugin == ('vite-plugin-qwik' satisfies QwikVitePlugin['name'])) {\n        const color = LOG_COLOR[level] || ANSI_COLOR.White;\n        const frames = (log.frame || '')\n          .split('\\n')\n          .map(\n            (line) =>\n              (line.match(/^\\s*\\^\\s*$/) ? ANSI_COLOR.BrightWhite : ANSI_COLOR.BrightBlack) + line\n          );\n        // eslint-disable-next-line no-console\n        console[level](\n          `${color}%s\\n${ANSI_COLOR.BrightWhite}%s\\n%s${ANSI_COLOR.RESET}`,\n          `[${log.plugin}](${level}): ${log.message}\\n`,\n          `  ${log?.loc?.file}:${log?.loc?.line}:${log?.loc?.column}\\n`,\n          `  ${frames.join('\\n  ')}\\n`\n        );\n        return false;\n      }\n    },\n  } as const satisfies VitePlugin<QwikVitePluginApi>;\n\n  return [vitePluginPre, vitePluginPost];\n}\n\nconst ANSI_COLOR = {\n  Black: '\\x1b[30m',\n  Red: '\\x1b[31m',\n  Green: '\\x1b[32m',\n  Yellow: '\\x1b[33m',\n  Blue: '\\x1b[34m',\n  Magenta: '\\x1b[35m',\n  Cyan: '\\x1b[36m',\n  White: '\\x1b[37m',\n  BrightBlack: '\\x1b[90m',\n  BrightRed: '\\x1b[91m',\n  BrightGreen: '\\x1b[92m',\n  BrightYellow: '\\x1b[93m',\n  BrightBlue: '\\x1b[94m',\n  BrightMagenta: '\\x1b[95m',\n  BrightCyan: '\\x1b[96m',\n  BrightWhite: '\\x1b[97m',\n  RESET: '\\x1b[0m',\n};\n\nconst LOG_COLOR = {\n  warn: ANSI_COLOR.Yellow,\n  info: ANSI_COLOR.Cyan,\n  debug: ANSI_COLOR.BrightBlack,\n};\n\nfunction updateEntryDev(code: string) {\n  code = code.replace(/[\"']@builder.io\\/qwik[\"']/g, `'${VITE_CLIENT_MODULE}'`);\n  return code;\n}\n\nfunction getViteDevModule(opts: NormalizedQwikPluginOptions) {\n  const qwikLoader = JSON.stringify(\n    opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED\n  );\n\n  return `// Qwik Vite Dev Module\nimport { render as qwikRender } from '@builder.io/qwik';\n\nexport async function render(document, rootNode, opts) {\n\n  await qwikRender(document, rootNode, opts);\n\n  let qwikLoader = document.getElementById('qwikloader');\n  if (!qwikLoader) {\n    qwikLoader = document.createElement('script');\n    qwikLoader.id = 'qwikloader';\n    qwikLoader.innerHTML = ${qwikLoader};\n    const parent = document.head ?? document.body ?? document.documentElement;\n    parent.appendChild(qwikLoader);\n  }\n\n  if (!window.__qwikViteLog) {\n    window.__qwikViteLog = true;\n    console.debug(\"%c⭐️ Qwik Client Mode\",\"background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;\",\"Do not use this mode in production!\\\\n - No portion of the application is pre-rendered on the server\\\\n - All of the application is running eagerly in the browser\\\\n - Optimizer/Serialization/Deserialization code is not exercised!\");\n  }\n}`;\n}\n\nconst findQwikRoots = async (\n  sys: OptimizerSystem,\n  packageJsonDir: string\n): Promise<QwikPackages[]> => {\n  const paths = new Map<string, string>();\n  if (hasNodeCompat(sys.env)) {\n    const fs: typeof import('fs') = await sys.dynamicImport('node:fs');\n    let prevPackageJsonDir: string | undefined;\n    do {\n      try {\n        const data = await fs.promises.readFile(sys.path.join(packageJsonDir, 'package.json'), {\n          encoding: 'utf-8',\n        });\n\n        try {\n          const packageJson = JSON.parse(data);\n          const dependencies = packageJson['dependencies'];\n          const devDependencies = packageJson['devDependencies'];\n\n          const packages: string[] = [];\n          if (typeof dependencies === 'object') {\n            packages.push(...Object.keys(dependencies));\n          }\n          if (typeof devDependencies === 'object') {\n            packages.push(...Object.keys(devDependencies));\n          }\n\n          const basedir = sys.cwd();\n          await Promise.all(\n            packages.map(async (id) => {\n              const pkgJsonPath = await findDepPkgJsonPath(sys, id, basedir);\n              if (pkgJsonPath) {\n                const pkgJsonContent = await fs.promises.readFile(pkgJsonPath, 'utf-8');\n                const pkgJson = JSON.parse(pkgJsonContent);\n                const qwikPath = pkgJson['qwik'];\n                if (!qwikPath) {\n                  return;\n                }\n                // Support multiple paths\n                const allPaths = Array.isArray(qwikPath) ? qwikPath : [qwikPath];\n                for (const p of allPaths) {\n                  paths.set(\n                    await fs.promises.realpath(sys.path.resolve(sys.path.dirname(pkgJsonPath), p)),\n                    id\n                  );\n                }\n              }\n            })\n          );\n        } catch (e) {\n          console.error(e);\n        }\n      } catch {\n        // ignore errors if package.json not found\n      }\n      prevPackageJsonDir = packageJsonDir;\n      packageJsonDir = sys.path.dirname(packageJsonDir);\n    } while (packageJsonDir !== prevPackageJsonDir);\n  }\n  return Array.from(paths).map(([path, id]) => ({ path, id }));\n};\n\nexport const isNotNullable = <T>(v: T): v is NonNullable<T> => {\n  return v != null;\n};\n\n/** Whether the runtime supports Node standard library APIs (node:fs, node:os, etc.). */\nconst hasNodeCompat = (env: SystemEnvironment) => env === 'node' || env === 'bun' || env === 'deno';\n\nconst VITE_CLIENT_MODULE = `@builder.io/qwik/vite-client`;\nconst CLIENT_DEV_INPUT = 'entry.dev';\n\ninterface QwikVitePluginCommonOptions {\n  /**\n   * Prints verbose Qwik plugin debug logs.\n   *\n   * Default `false`\n   */\n  debug?: boolean;\n  /**\n   * The Qwik entry strategy to use while building for production. During development the type is\n   * always `segment`.\n   *\n   * Default `{ type: \"smart\" }`)\n   */\n  entryStrategy?: EntryStrategy;\n  /**\n   * The source directory to find all the Qwik components. Since Qwik does not have a single input,\n   * the `srcDir` is used to recursively find Qwik files.\n   *\n   * Default `src`\n   */\n  srcDir?: string;\n  /**\n   * List of tsconfig.json files to use for ESLint warnings during development.\n   *\n   * Default `['tsconfig.json']`\n   */\n  tsconfigFileNames?: string[];\n  /**\n   * List of directories to recursively search for Qwik components or Vendors.\n   *\n   * Default `[]`\n   *\n   * @deprecated No longer used. Instead, any imported file with `.qwik.` in the name is processed.\n   */\n  vendorRoots?: string[];\n  /**\n   * Disables the automatic vendor roots scan. This is useful when you want to manually specify the\n   * vendor roots.\n   */\n  disableVendorScan?: boolean;\n  /**\n   * Options for the Qwik optimizer.\n   *\n   * Default `undefined`\n   */\n  optimizerOptions?: OptimizerOptions;\n  /**\n   * Hook that's called after the build and provides all of the transformed modules that were used\n   * before bundling.\n   */\n  transformedModuleOutput?:\n    | ((transformedModules: TransformModule[]) => Promise<void> | void)\n    | null;\n  devTools?: {\n    /**\n     * Validates image sizes for CLS issues during development. In case of issues, provides you with\n     * a correct image size resolutions. If set to `false`, image dev tool will be disabled.\n     *\n     * Default `true`\n     */\n    imageDevTools?: boolean | true;\n    /**\n     * Press-hold the defined keys to enable qwik dev inspector. By default the behavior is\n     * activated by pressing the left or right `Alt` key. If set to `false`, qwik dev inspector will\n     * be disabled.\n     *\n     * Valid values are `KeyboardEvent.code` values. Please note that the 'Left' and 'Right'\n     * suffixes are ignored.\n     */\n    clickToSource?: string[] | false;\n  };\n  /**\n   * Predicate function to filter out files from the optimizer. hook for resolveId, load, and\n   * transform\n   */\n  fileFilter?: (id: string, hook: string) => boolean;\n  /**\n   * Run eslint on the source files for the ssr build or dev server. This can slow down startup on\n   * large projects. Defaults to `true`\n   */\n  lint?: boolean;\n  /**\n   * Experimental features. These can come and go in patch releases, and their API is not guaranteed\n   * to be stable between releases\n   */\n  experimental?: (keyof typeof ExperimentalFeatures)[];\n\n  /**\n   * Disables automatic preloading of font assets (WOFF/WOFF2/TTF) found in the build output. When\n   * enabled, the plugin will not add `<link rel=\"preload\">` tags for font files in the document\n   * head.\n   *\n   * Disabling may impact Cumulative Layout Shift (CLS) metrics.\n   */\n  disableFontPreload?: boolean;\n}\n\ninterface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {\n  /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */\n  csr: true;\n  client?: never;\n  devSsrServer?: never;\n  ssr?: never;\n}\n\ninterface QwikVitePluginSSROptions extends QwikVitePluginCommonOptions {\n  /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */\n  csr?: false | undefined;\n  client?: {\n    /**\n     * The entry point for the client builds. This would be the application's root component\n     * typically.\n     *\n     * Default `src/components/app/app.tsx`\n     */\n    input?: string[] | string;\n    /**\n     * Entry input for client-side only development with hot-module reloading. This is for Vite\n     * development only and does not use SSR.\n     *\n     * Default `src/entry.dev.tsx`\n     */\n    devInput?: string;\n    /**\n     * Output directory for the client build.\n     *\n     * Default `dist`\n     */\n    outDir?: string;\n    /**\n     * The client build will create a manifest and this hook is called with the generated build\n     * data.\n     *\n     * Default `undefined`\n     */\n    manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;\n  };\n\n  /**\n   * Qwik is SSR first framework. This means that Qwik requires either SSR or SSG. In dev mode the\n   * dev SSR server is responsible for rendering and pausing the application on the server.\n   *\n   * Under normal circumstances this should be on, unless you have your own SSR server which you\n   * would like to use instead and wish to disable this one.\n   *\n   * Default: true\n   */\n  devSsrServer?: boolean;\n\n  /** Controls the SSR behavior. */\n  ssr?: {\n    /**\n     * The entry point for the SSR renderer. This file should export a `render()` function. This\n     * entry point and `render()` export function is also used for Vite's SSR development and\n     * Node.js debug mode.\n     *\n     * Default `src/entry.ssr.tsx`\n     */\n    input?: string;\n    /**\n     * Output directory for the server build.\n     *\n     * Default `server`\n     */\n    outDir?: string;\n    /**\n     * The SSR build requires the manifest generated during the client build. By default, this\n     * plugin will wire the client manifest to the ssr build. However, the `manifestInput` option\n     * can be used to manually provide a manifest.\n     *\n     * Default `undefined`\n     */\n    manifestInput?: QwikManifest;\n  };\n}\n\ninterface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {\n  /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */\n  csr: true;\n}\n\n/** @public */\nexport type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;\nexport { ExperimentalFeatures } from './plugin';\n\n/** @public */\nexport interface QwikVitePluginApi {\n  getOptimizer: () => Optimizer | null;\n  getOptions: () => NormalizedQwikPluginOptions;\n  getManifest: () => QwikManifest | null;\n  getRootDir: () => string | null;\n  getClientOutDir: () => string | null;\n  getClientPublicOutDir: () => string | null;\n  getAssetsDir: () => string | undefined;\n  registerBundleGraphAdder: (adder: BundleGraphAdder) => void;\n}\n\n/**\n * This is the type of the \"pre\" Qwik Vite plugin. `qwikVite` actually returns a tuple of two\n * plugins, but after Vite flattens them, you can find the plugin by name.\n *\n * @public\n */\nexport type QwikVitePlugin = P<QwikVitePluginApi> & {\n  name: 'vite-plugin-qwik';\n};\n\n/** @public */\nexport interface QwikViteDevResponse {\n  _qwikEnvData?: Record<string, any>;\n  _qwikRenderResolve?: () => void;\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/plugins/vite.unit.ts",
    "content": "import path, { resolve } from 'node:path';\nimport type { Rollup } from 'vite';\nimport { assert, test } from 'vitest';\nimport { normalizePath } from '../../../testing/util';\nimport type { OptimizerOptions } from '../types';\nimport { qwikVite, type QwikVitePlugin, type QwikVitePluginOptions } from './vite';\n\nconst cwd = process.cwd();\n\nconst chunkInfoMocks = [\n  {\n    exports: [''],\n    name: 'chunk.tsx',\n    facadeModuleId: 'chunk.tsx',\n    moduleIds: ['chunk.tsx'],\n  },\n  {\n    exports: [''],\n    name: cwd + '/app/chunk.tsx',\n    facadeModuleId: cwd + '/app/chunk.tsx',\n    moduleIds: [cwd + '/app/chunk.tsx'],\n  },\n] as Rollup.PreRenderedChunk[];\n\nfunction mockOptimizerOptions(env: 'node' | 'deno' = 'node'): OptimizerOptions {\n  return {\n    sys: {\n      cwd: () => process.cwd(),\n      env,\n      os: process.platform,\n      dynamicImport: async (path) => import(path),\n      strictDynamicImport: async (path) => import(path),\n      path: path as any,\n    },\n    binding: { mockBinding: true },\n  };\n}\n\nconst includeDeps = undefined;\nconst noExternal = [\n  '@builder.io/qwik',\n  '@builder.io/qwik/server',\n  '@builder.io/qwik/build',\n  '@builder.io/qwik-city',\n];\n\nconst excludeDeps = [\n  '@vite/client',\n  '@vite/env',\n  'node-fetch',\n  'undici',\n  '@builder.io/qwik',\n  '@builder.io/qwik/server',\n  '@builder.io/qwik/jsx-runtime',\n  '@builder.io/qwik/jsx-dev-runtime',\n  '@builder.io/qwik/build',\n  '@qwik-client-manifest',\n  '@builder.io/qwik-city',\n];\n\nconst getPlugin = (opts: QwikVitePluginOptions | undefined) =>\n  (qwikVite(opts) as any)[0] as QwikVitePlugin;\n\n// undefined for Vite 5 - 6, an object for Vite 7\nconst configHookPluginContext = undefined as any;\n\ntest('command: serve, mode: development', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c = (await plugin.config.call(\n    configHookPluginContext,\n    {},\n    { command: 'serve', mode: 'development' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  const outputOptions = rollupOptions.output as Rollup.OutputOptions;\n  const chunkFileNames = outputOptions.chunkFileNames as (\n    chunkInfo: Rollup.PreRenderedChunk\n  ) => string;\n  const entryFileNames = outputOptions.entryFileNames as (\n    chunkInfo: Rollup.PreRenderedChunk\n  ) => string;\n\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'segment' });\n  assert.deepEqual(opts.debug, false);\n\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(rollupOptions.input, normalizePath(resolve(cwd, 'src', 'entry.dev')));\n\n  assert.deepEqual(outputOptions.assetFileNames, 'assets/[hash]-[name].[ext]');\n  assert.deepEqual(chunkFileNames(chunkInfoMocks[0]), `build/chunk.tsx.js`);\n  assert.deepEqual(entryFileNames(chunkInfoMocks[0]), `build/chunk.tsx.js`);\n  assert.deepEqual(chunkFileNames(chunkInfoMocks[1]), 'build/app-chunk.tsx.js');\n  assert.deepEqual(entryFileNames(chunkInfoMocks[1]), 'build/app-chunk.tsx.js');\n  assert.deepEqual(outputOptions.format, 'es');\n\n  assert.deepEqual(build.dynamicImportVarsOptions?.exclude, [/./]);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(c.optimizeDeps?.include, includeDeps);\n  assert.deepEqual(c.optimizeDeps?.exclude, excludeDeps);\n\n  assert.deepEqual(c.esbuild, false);\n  assert.deepEqual(c.ssr, {\n    noExternal,\n  });\n});\n\ntest('command: serve, mode: production', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c = (await plugin.config.call(\n    configHookPluginContext,\n    {},\n    { command: 'serve', mode: 'production' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  const outputOptions = rollupOptions.output as Rollup.OutputOptions;\n\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(opts.entryStrategy, { type: 'segment' });\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(rollupOptions.input, normalizePath(resolve(cwd, 'src', 'entry.dev')));\n  assert.deepEqual(outputOptions.assetFileNames, 'assets/[hash]-[name].[ext]');\n  assert.deepEqual(outputOptions.chunkFileNames, 'build/q-[hash].js');\n  assert.deepEqual(outputOptions.entryFileNames, 'build/q-[hash].js');\n  assert.deepEqual(outputOptions.format, 'es');\n\n  assert.deepEqual(build.dynamicImportVarsOptions?.exclude, [/./]);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(c.optimizeDeps?.include, includeDeps);\n  assert.deepEqual(c.optimizeDeps?.exclude, excludeDeps);\n  assert.deepEqual(c.esbuild, false);\n  assert.deepEqual(c.ssr, {\n    noExternal,\n  });\n});\n\ntest('command: build, mode: development', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c = (await plugin.config.call(\n    configHookPluginContext,\n    {},\n    { command: 'build', mode: 'development' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  const outputOptions = rollupOptions.output as Rollup.OutputOptions;\n  const chunkFileNames = outputOptions.chunkFileNames as (\n    chunkInfo: Rollup.PreRenderedChunk\n  ) => string;\n  const entryFileNames = outputOptions.entryFileNames as (\n    chunkInfo: Rollup.PreRenderedChunk\n  ) => string;\n\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'segment' });\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n\n  assert.deepEqual(plugin.enforce, 'pre');\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'root'))]);\n\n  assert.deepEqual(outputOptions.assetFileNames, 'assets/[hash]-[name].[ext]');\n  assert.deepEqual(chunkFileNames(chunkInfoMocks[0]), `build/chunk.tsx.js`);\n  assert.deepEqual(entryFileNames(chunkInfoMocks[0]), `build/chunk.tsx.js`);\n  assert.deepEqual(chunkFileNames(chunkInfoMocks[1]), 'build/app-chunk.tsx.js');\n  assert.deepEqual(entryFileNames(chunkInfoMocks[1]), 'build/app-chunk.tsx.js');\n\n  assert.deepEqual(build.dynamicImportVarsOptions?.exclude, [/./]);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(c.optimizeDeps?.include, includeDeps);\n  assert.deepEqual(c.optimizeDeps?.exclude, excludeDeps);\n  assert.deepEqual(c.esbuild, {\n    logLevel: 'error',\n    jsx: 'automatic',\n  });\n  assert.deepEqual(c.ssr, {\n    noExternal,\n  });\n});\n\ntest('command: build, mode: production', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c = (await plugin.config.call(\n    configHookPluginContext,\n    {},\n    { command: 'build', mode: 'production' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  const outputOptions = rollupOptions.output as Rollup.OutputOptions;\n\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(opts.entryStrategy, { type: 'smart' });\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n\n  assert.deepEqual(plugin.enforce, 'pre');\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'root'))]);\n\n  assert.deepEqual(outputOptions.assetFileNames, 'assets/[hash]-[name].[ext]');\n  assert.deepEqual(outputOptions.chunkFileNames, 'build/q-[hash].js');\n  assert.deepEqual(outputOptions.entryFileNames, 'build/q-[hash].js');\n\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(build.dynamicImportVarsOptions?.exclude, [/./]);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(c.optimizeDeps?.include, includeDeps);\n  assert.deepEqual(c.optimizeDeps?.exclude, excludeDeps);\n  assert.deepEqual(c.esbuild, {\n    logLevel: 'error',\n    jsx: 'automatic',\n  });\n  assert.deepEqual(c.ssr, {\n    noExternal,\n  });\n});\n\ntest('command: build, --mode production (client)', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    client: {\n      devInput: resolve(cwd, 'src', 'dev.entry.tsx'),\n      outDir: resolve(cwd, 'client-dist'),\n    },\n  };\n\n  const plugin = getPlugin(initOpts);\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    {},\n    { command: 'build', mode: 'production' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  assert.deepEqual(opts.resolveQwikBuild, true);\n\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'root'))]);\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'client-dist')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n});\n\ntest('command: build, --ssr entry.server.tsx', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c = (await plugin.config.call(\n    configHookPluginContext,\n    { build: { ssr: resolve(cwd, 'src', 'entry.server.tsx') } },\n    { command: 'build', mode: '' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  const outputOptions = rollupOptions.output as Rollup.OutputOptions;\n\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'hoist' });\n  assert.deepEqual(opts.debug, false);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n\n  assert.deepEqual(plugin.enforce, 'pre');\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'server')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'entry.server.tsx'))]);\n\n  assert.deepEqual(outputOptions.assetFileNames, 'assets/[hash]-[name].[ext]');\n  assert.deepEqual(outputOptions.chunkFileNames, undefined);\n  assert.deepEqual(outputOptions.entryFileNames, undefined);\n\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'server')));\n  assert.deepEqual(build.dynamicImportVarsOptions?.exclude, [/./]);\n  assert.deepEqual(build.ssr, true);\n  assert.deepEqual(c.optimizeDeps?.include, includeDeps);\n  assert.deepEqual(c.optimizeDeps?.exclude, excludeDeps);\n  assert.deepEqual(c.esbuild, {\n    logLevel: 'error',\n    jsx: 'automatic',\n  });\n  assert.deepEqual(c.publicDir, false);\n});\n\ntest('command: serve, --mode ssr', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    ssr: {\n      input: resolve(cwd, 'src', 'renderz.tsx'),\n      outDir: resolve(cwd, 'ssr-dist'),\n    },\n  };\n  const plugin = getPlugin(initOpts);\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    { build: { emptyOutDir: true } },\n    { command: 'serve', mode: 'ssr' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(build.minify, undefined);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'renderz.tsx'))]);\n  assert.deepEqual(c.build.outDir, normalizePath(resolve(cwd, 'ssr-dist')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(c.publicDir, undefined);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n});\n\ntest('command: serve, --mode ssr with build.assetsDir', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n    ssr: {\n      input: resolve(cwd, 'src', 'renderz.tsx'),\n      outDir: resolve(cwd, 'ssr-dist'),\n    },\n  };\n  const plugin = getPlugin(initOpts);\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    { build: { emptyOutDir: true, assetsDir: 'my-assets-dir' } },\n    { command: 'serve', mode: 'ssr' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(build.minify, undefined);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'renderz.tsx'))]);\n  assert.deepEqual(c.build.outDir, normalizePath(resolve(cwd, 'ssr-dist')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(c.publicDir, undefined);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n});\n\ntest('should use the dist/ fallback with client target', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    { build: { assetsDir: 'my-assets-dir/' } },\n    { command: 'serve', mode: 'development' }\n  ))!;\n\n  assert.equal(c.build.outDir, normalizePath(resolve(cwd, `dist`)));\n});\n\ntest('should use build.outDir config with client target', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    { build: { outDir: 'my-dist/', assetsDir: 'my-assets-dir' } },\n    { command: 'serve', mode: 'development' }\n  ))!;\n\n  assert.equal(c.build.outDir, normalizePath(resolve(cwd, `my-dist`)));\n});\n\ntest('should use build.outDir config when assetsDir is _astro', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n\n  const plugin = getPlugin(initOpts);\n\n  // Astro sets a build.assetsDir of _astro, but we don't want to change that\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    { build: { assetsDir: '_astro' } },\n    { command: 'serve', mode: 'development' }\n  ))!;\n\n  assert.equal(c.build.outDir, normalizePath(resolve(cwd, `dist/`)));\n});\n\ntest('command: build, mode: production (deno)', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions('deno'),\n  };\n  const plugin = getPlugin(initOpts);\n  const c = (await plugin.config.call(\n    configHookPluginContext,\n    {},\n    { command: 'build', mode: 'production' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n\n  assert.deepEqual(opts.target, 'client');\n  assert.deepEqual(opts.buildMode, 'production');\n  assert.deepEqual(opts.resolveQwikBuild, true);\n\n  // Deno should produce the same config shape as Node\n  const build = c.build!;\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'dist')));\n  assert.deepEqual(build.dynamicImportVarsOptions?.exclude, [/./]);\n  assert.deepEqual(build.ssr, undefined);\n});\n\ntest('command: build, --ssr entry.server.tsx (deno)', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions('deno'),\n  };\n  const plugin = getPlugin(initOpts);\n  const c = (await plugin.config.call(\n    configHookPluginContext,\n    { build: { ssr: resolve(cwd, 'src', 'entry.server.tsx') } },\n    { command: 'build', mode: '' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n\n  assert.deepEqual(opts.target, 'ssr');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(opts.entryStrategy, { type: 'hoist' });\n\n  const build = c.build!;\n  assert.deepEqual(build.outDir, normalizePath(resolve(cwd, 'server')));\n  assert.deepEqual(build.ssr, true);\n  assert.deepEqual(c.publicDir, false);\n});\n\ntest('command: build, --mode lib', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    {\n      build: {\n        lib: {\n          entry: './src/index.ts',\n          formats: ['es', 'cjs'],\n        },\n      },\n    },\n    { command: 'build', mode: 'lib' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  const outputOptions = rollupOptions.output as Rollup.OutputOptions;\n\n  assert.deepEqual(opts.target, 'lib');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(build.minify, false);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'index.ts'))]);\n\n  assert.deepEqual(outputOptions.assetFileNames, 'assets/[hash]-[name].[ext]');\n  assert.deepEqual(outputOptions.chunkFileNames, undefined);\n\n  assert.deepEqual(c.build.outDir, normalizePath(resolve(cwd, 'lib')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n});\n\ntest('command: build, --mode lib with multiple outputs', async () => {\n  const initOpts = {\n    optimizerOptions: mockOptimizerOptions(),\n  };\n  const plugin = getPlugin(initOpts);\n  const c: any = (await plugin.config.call(\n    configHookPluginContext,\n    {\n      build: {\n        lib: {\n          entry: './src/index.ts',\n        },\n        rollupOptions: {\n          output: [\n            {\n              format: 'es',\n              entryFileNames: 'index.esm.js',\n            },\n            {\n              format: 'es',\n              entryFileNames: 'index.mjs',\n            },\n            {\n              format: 'cjs',\n              entryFileNames: 'index.cjs.js',\n            },\n            {\n              format: 'cjs',\n              entryFileNames: 'index.cjs',\n            },\n          ],\n        },\n      },\n    },\n    { command: 'build', mode: 'lib' }\n  ))!;\n  const opts = await plugin.api?.getOptions();\n  const build = c.build!;\n  const rollupOptions = build!.rollupOptions!;\n  const outputOptions = rollupOptions.output as Rollup.OutputOptions[];\n\n  assert.deepEqual(opts.target, 'lib');\n  assert.deepEqual(opts.buildMode, 'development');\n  assert.deepEqual(build.minify, false);\n  assert.deepEqual(build.ssr, undefined);\n  assert.deepEqual(rollupOptions.input, [normalizePath(resolve(cwd, 'src', 'index.ts'))]);\n\n  assert.ok(Array.isArray(outputOptions));\n  assert.lengthOf(outputOptions, 4);\n\n  outputOptions.forEach((outputOptionsObj) => {\n    assert.deepEqual(outputOptionsObj.assetFileNames, 'assets/[hash]-[name].[ext]');\n    assert.deepEqual(outputOptionsObj.chunkFileNames, undefined);\n  });\n\n  assert.deepEqual(c.build.outDir, normalizePath(resolve(cwd, 'lib')));\n  assert.deepEqual(build.emptyOutDir, undefined);\n  assert.deepEqual(opts.resolveQwikBuild, true);\n});\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/qwik-binding-map.ts",
    "content": "// AUTO-GENERATED IN OPTIMIZER BUILD SCRIPT\n// created from data provided by @napi-rs/triples\n\n// prettier-ignore\nexport const QWIK_BINDING_MAP = {\n  \"darwin\": {\n    \"arm64\": [\n      {\n        \"platform\": \"darwin\",\n        \"arch\": \"arm64\",\n        \"abi\": null,\n        \"platformArchABI\": \"qwik.darwin-arm64.node\"\n      }\n    ],\n    \"x64\": [\n      {\n        \"platform\": \"darwin\",\n        \"arch\": \"x64\",\n        \"abi\": null,\n        \"platformArchABI\": \"qwik.darwin-x64.node\"\n      }\n    ]\n  },\n  \"win32\": {\n    \"x64\": [\n      {\n        \"platform\": \"win32\",\n        \"arch\": \"x64\",\n        \"abi\": \"msvc\",\n        \"platformArchABI\": \"qwik.win32-x64-msvc.node\"\n      }\n    ]\n  },\n  \"linux\": {\n    \"x64\": [\n      {\n        \"platform\": \"linux\",\n        \"arch\": \"x64\",\n        \"abi\": \"gnu\",\n        \"platformArchABI\": \"qwik.linux-x64-gnu.node\"\n      }\n    ]\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/qwik.optimizer.api.md",
    "content": "## API Report File for \"@builder.io/qwik\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { Plugin as Plugin_2 } from 'vite';\n\n// @public\nexport type BundleGraphAdder = (manifest: QwikManifest) => Record<string, {\n    imports?: string[];\n    dynamicImports?: string[];\n}>;\n\n// @public (undocumented)\nexport interface ComponentEntryStrategy {\n    // (undocumented)\n    manual?: Record<string, string>;\n    // (undocumented)\n    type: 'component';\n}\n\n// @public (undocumented)\nexport const createOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>;\n\n// @public (undocumented)\nexport interface Diagnostic {\n    // (undocumented)\n    category: DiagnosticCategory;\n    // (undocumented)\n    code: string | null;\n    // (undocumented)\n    file: string;\n    // (undocumented)\n    highlights: SourceLocation[];\n    // (undocumented)\n    message: string;\n    // (undocumented)\n    scope: string;\n    // (undocumented)\n    suggestions: string[] | null;\n}\n\n// @public (undocumented)\nexport type DiagnosticCategory = 'error' | 'warning' | 'sourceError';\n\n// Warning: (ae-forgotten-export) The symbol \"HoistEntryStrategy\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"HookEntryStrategy_2\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type EntryStrategy = InlineEntryStrategy | HoistEntryStrategy | SingleEntryStrategy | HookEntryStrategy_2 | SegmentEntryStrategy | ComponentEntryStrategy | SmartEntryStrategy;\n\n// @alpha\nexport enum ExperimentalFeatures {\n    enableRequestRewrite = \"enableRequestRewrite\",\n    noSPA = \"noSPA\",\n    preventNavigate = \"preventNavigate\",\n    valibot = \"valibot\"\n}\n\n// @public (undocumented)\nexport interface GlobalInjections {\n    // (undocumented)\n    attributes?: {\n        [key: string]: string;\n    };\n    // (undocumented)\n    location: 'head' | 'body';\n    // (undocumented)\n    tag: string;\n}\n\n// @public (undocumented)\nexport interface InlineEntryStrategy {\n    // (undocumented)\n    type: 'inline';\n}\n\n// @public (undocumented)\nexport type MinifyMode = 'simplify' | 'none';\n\n// @public (undocumented)\nexport interface Optimizer {\n    sys: OptimizerSystem;\n    transformFs(opts: TransformFsOptions): Promise<TransformOutput>;\n    transformFsSync(opts: TransformFsOptions): TransformOutput;\n    transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;\n    transformModulesSync(opts: TransformModulesOptions): TransformOutput;\n}\n\n// @public (undocumented)\nexport interface OptimizerOptions {\n    // (undocumented)\n    binding?: any;\n    inlineStylesUpToBytes?: number;\n    sourcemap?: boolean;\n    // (undocumented)\n    sys?: OptimizerSystem;\n}\n\n// @public (undocumented)\nexport interface OptimizerSystem {\n    // (undocumented)\n    cwd: () => string;\n    // (undocumented)\n    dynamicImport: (path: string) => Promise<any>;\n    // (undocumented)\n    env: SystemEnvironment;\n    // (undocumented)\n    getInputFiles?: (rootDir: string) => Promise<TransformModuleInput[]>;\n    // (undocumented)\n    os: string;\n    // (undocumented)\n    path: Path;\n    // (undocumented)\n    strictDynamicImport: (path: string) => Promise<any>;\n}\n\n// @public (undocumented)\nexport interface Path {\n    // (undocumented)\n    basename(path: string, ext?: string): string;\n    // (undocumented)\n    readonly delimiter: string;\n    // (undocumented)\n    dirname(path: string): string;\n    // (undocumented)\n    extname(path: string): string;\n    // (undocumented)\n    format(pathObject: {\n        root: string;\n        dir: string;\n        base: string;\n        ext: string;\n        name: string;\n    }): string;\n    // (undocumented)\n    isAbsolute(path: string): boolean;\n    // (undocumented)\n    join(...paths: string[]): string;\n    // (undocumented)\n    normalize(path: string): string;\n    // (undocumented)\n    parse(path: string): {\n        root: string;\n        dir: string;\n        base: string;\n        ext: string;\n        name: string;\n    };\n    // (undocumented)\n    readonly posix: Path;\n    // (undocumented)\n    relative(from: string, to: string): string;\n    // (undocumented)\n    resolve(...paths: string[]): string;\n    // (undocumented)\n    readonly sep: string;\n    // (undocumented)\n    readonly win32: null;\n}\n\n// @public (undocumented)\nexport interface QwikAsset {\n    name: string | undefined;\n    size: number;\n}\n\n// @public (undocumented)\nexport type QwikBuildMode = 'production' | 'development';\n\n// @public (undocumented)\nexport type QwikBuildTarget = 'client' | 'ssr' | 'lib' | 'test';\n\n// @public (undocumented)\nexport interface QwikBundle {\n    dynamicImports?: string[];\n    imports?: string[];\n    interactivity?: number;\n    origins?: string[];\n    size: number;\n    symbols?: string[];\n    total: number;\n}\n\n// @public\nexport type QwikBundleGraph = Array<string | number>;\n\n// @public\nexport interface QwikManifest {\n    assets?: {\n        [fileName: string]: QwikAsset;\n    };\n    bundleGraph?: QwikBundleGraph;\n    bundleGraphAsset?: string;\n    bundles: {\n        [fileName: string]: QwikBundle;\n    };\n    core?: string;\n    injections?: GlobalInjections[];\n    manifestHash: string;\n    mapping: {\n        [symbolName: string]: string;\n    };\n    options?: {\n        target?: string;\n        buildMode?: string;\n        entryStrategy?: {\n            type: EntryStrategy['type'];\n        };\n    };\n    platform?: {\n        [name: string]: string;\n    };\n    preloader?: string;\n    qwikLoader?: string;\n    symbols: {\n        [symbolName: string]: QwikSymbol;\n    };\n    version: string;\n}\n\n// @public (undocumented)\nexport function qwikRollup(qwikRollupOpts?: QwikRollupPluginOptions): any;\n\n// @public (undocumented)\nexport interface QwikRollupPluginOptions {\n    buildMode?: QwikBuildMode;\n    // (undocumented)\n    csr?: boolean;\n    debug?: boolean;\n    entryStrategy?: EntryStrategy;\n    // Warning: (ae-incompatible-release-tags) The symbol \"experimental\" is marked as @public, but its signature references \"ExperimentalFeatures\" which is marked as @alpha\n    experimental?: (keyof typeof ExperimentalFeatures)[];\n    lint?: boolean;\n    manifestInput?: QwikManifest;\n    manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;\n    // (undocumented)\n    optimizerOptions?: OptimizerOptions;\n    rootDir?: string;\n    srcDir?: string;\n    srcInputs?: TransformModuleInput[] | null;\n    target?: QwikBuildTarget;\n    transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;\n}\n\n// @public (undocumented)\nexport interface QwikSymbol {\n    // (undocumented)\n    canonicalFilename: string;\n    // (undocumented)\n    captures: boolean;\n    // (undocumented)\n    ctxKind: 'function' | 'eventHandler';\n    // (undocumented)\n    ctxName: string;\n    // (undocumented)\n    displayName: string;\n    // (undocumented)\n    hash: string;\n    // (undocumented)\n    loc: [number, number];\n    // (undocumented)\n    origin: string;\n    // (undocumented)\n    parent: string | null;\n}\n\n// @public\nexport function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;\n\n// @public (undocumented)\nexport interface QwikViteDevResponse {\n    // (undocumented)\n    _qwikEnvData?: Record<string, any>;\n    // (undocumented)\n    _qwikRenderResolve?: () => void;\n}\n\n// Warning: (ae-forgotten-export) The symbol \"P\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport type QwikVitePlugin = P<QwikVitePluginApi> & {\n    name: 'vite-plugin-qwik';\n};\n\n// @public (undocumented)\nexport interface QwikVitePluginApi {\n    // (undocumented)\n    getAssetsDir: () => string | undefined;\n    // (undocumented)\n    getClientOutDir: () => string | null;\n    // (undocumented)\n    getClientPublicOutDir: () => string | null;\n    // (undocumented)\n    getManifest: () => QwikManifest | null;\n    // (undocumented)\n    getOptimizer: () => Optimizer | null;\n    // Warning: (ae-forgotten-export) The symbol \"NormalizedQwikPluginOptions\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    getOptions: () => NormalizedQwikPluginOptions;\n    // (undocumented)\n    getRootDir: () => string | null;\n    // (undocumented)\n    registerBundleGraphAdder: (adder: BundleGraphAdder) => void;\n}\n\n// Warning: (ae-forgotten-export) The symbol \"QwikVitePluginCSROptions\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"QwikVitePluginSSROptions\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;\n\n// @public (undocumented)\nexport interface ResolvedManifest {\n    // (undocumented)\n    injections: GlobalInjections[];\n    // (undocumented)\n    manifest: ServerQwikManifest;\n    // (undocumented)\n    mapper: SymbolMapper;\n}\n\n// @public (undocumented)\ninterface SegmentAnalysis {\n    // (undocumented)\n    canonicalFilename: string;\n    // (undocumented)\n    captures: boolean;\n    // (undocumented)\n    ctxKind: 'eventHandler' | 'function';\n    // (undocumented)\n    ctxName: string;\n    // (undocumented)\n    displayName: string;\n    // (undocumented)\n    entry: string | null;\n    // (undocumented)\n    extension: string;\n    // (undocumented)\n    hash: string;\n    // (undocumented)\n    loc: [number, number];\n    // (undocumented)\n    name: string;\n    // (undocumented)\n    origin: string;\n    // (undocumented)\n    parent: string | null;\n}\nexport { SegmentAnalysis as HookAnalysis }\nexport { SegmentAnalysis }\n\n// @public (undocumented)\ninterface SegmentEntryStrategy {\n    // (undocumented)\n    manual?: Record<string, string>;\n    // (undocumented)\n    type: 'segment';\n}\nexport { SegmentEntryStrategy as HookEntryStrategy }\nexport { SegmentEntryStrategy }\n\n// @public\nexport type ServerQwikManifest = Pick<QwikManifest, 'manifestHash' | 'injections' | 'bundleGraph' | 'bundleGraphAsset' | 'mapping' | 'preloader' | 'core' | 'qwikLoader'>;\n\n// @public (undocumented)\nexport interface SingleEntryStrategy {\n    // (undocumented)\n    manual?: Record<string, string>;\n    // (undocumented)\n    type: 'single';\n}\n\n// @public (undocumented)\nexport interface SmartEntryStrategy {\n    // (undocumented)\n    manual?: Record<string, string>;\n    // (undocumented)\n    type: 'smart';\n}\n\n// @public (undocumented)\nexport interface SourceLocation {\n    // (undocumented)\n    endCol: number;\n    // (undocumented)\n    endLine: number;\n    // (undocumented)\n    hi: number;\n    // (undocumented)\n    lo: number;\n    // (undocumented)\n    startCol: number;\n    // (undocumented)\n    startLine: number;\n}\n\n// @public (undocumented)\nexport type SourceMapsOption = 'external' | 'inline' | undefined | null;\n\n// @public (undocumented)\nexport type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;\n\n// Warning: (ae-forgotten-export) The symbol \"createSymbolMapper\" needs to be exported by the entry point index.d.ts\n//\n// @alpha\nexport let symbolMapper: ReturnType<typeof createSymbolMapper>;\n\n// @public (undocumented)\nexport type SymbolMapperFn = (symbolName: string, mapper: SymbolMapper | undefined, parent?: string) => readonly [symbol: string, chunk: string] | undefined;\n\n// @public (undocumented)\nexport type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown';\n\n// @public (undocumented)\nexport interface TransformFsOptions extends TransformOptions {\n    // (undocumented)\n    vendorRoots: string[];\n}\n\n// @public (undocumented)\nexport interface TransformModule {\n    // (undocumented)\n    code: string;\n    // (undocumented)\n    isEntry: boolean;\n    // (undocumented)\n    map: string | null;\n    // (undocumented)\n    origPath: string | null;\n    // (undocumented)\n    path: string;\n    // (undocumented)\n    segment: SegmentAnalysis | null;\n}\n\n// @public (undocumented)\nexport interface TransformModuleInput {\n    // (undocumented)\n    code: string;\n    // (undocumented)\n    devPath?: string;\n    // (undocumented)\n    path: string;\n}\n\n// @public (undocumented)\nexport interface TransformModulesOptions extends TransformOptions {\n    // (undocumented)\n    input: TransformModuleInput[];\n}\n\n// @public (undocumented)\nexport interface TransformOptions {\n    // (undocumented)\n    entryStrategy?: EntryStrategy;\n    // (undocumented)\n    explicitExtensions?: boolean;\n    // (undocumented)\n    isServer?: boolean;\n    // (undocumented)\n    minify?: MinifyMode;\n    // Warning: (ae-forgotten-export) The symbol \"EmitMode\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    mode?: EmitMode;\n    // (undocumented)\n    preserveFilenames?: boolean;\n    // (undocumented)\n    regCtxName?: string[];\n    // (undocumented)\n    rootDir?: string;\n    // (undocumented)\n    scope?: string;\n    // (undocumented)\n    sourceMaps?: boolean;\n    // (undocumented)\n    srcDir: string;\n    // (undocumented)\n    stripCtxName?: string[];\n    // (undocumented)\n    stripEventHandlers?: boolean;\n    // (undocumented)\n    stripExports?: string[];\n    // (undocumented)\n    transpileJsx?: boolean;\n    // (undocumented)\n    transpileTs?: boolean;\n}\n\n// @public (undocumented)\nexport interface TransformOutput {\n    // (undocumented)\n    diagnostics: Diagnostic[];\n    // (undocumented)\n    isJsx: boolean;\n    // (undocumented)\n    isTypeScript: boolean;\n    // (undocumented)\n    modules: TransformModule[];\n}\n\n// @public (undocumented)\nexport type TranspileOption = boolean | undefined | null;\n\n// @public (undocumented)\nexport const versions: {\n    qwik: string;\n};\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/scripts.ts",
    "content": "export const QWIK_LOADER_DEFAULT_MINIFIED: string = (globalThis as any)\n  .QWIK_LOADER_DEFAULT_MINIFIED;\nexport const QWIK_LOADER_DEFAULT_DEBUG: string = (globalThis as any).QWIK_LOADER_DEFAULT_DEBUG;\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/types.ts",
    "content": "/** @public */\nexport interface Optimizer {\n  /** Transforms the input code string, does not access the file system. */\n  transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;\n\n  /** Transforms the input code string, does not access the file system. */\n  transformModulesSync(opts: TransformModulesOptions): TransformOutput;\n\n  /** Transforms the directory from the file system. */\n  transformFs(opts: TransformFsOptions): Promise<TransformOutput>;\n\n  /** Transforms the directory from the file system. */\n  transformFsSync(opts: TransformFsOptions): TransformOutput;\n\n  /** Optimizer system use. This can be updated with a custom file system. */\n  sys: OptimizerSystem;\n}\n\n/** @public */\nexport interface OptimizerOptions {\n  sys?: OptimizerSystem;\n  binding?: any;\n  /** Inline the global styles if they're smaller than this */\n  inlineStylesUpToBytes?: number;\n  /** Enable sourcemaps */\n  sourcemap?: boolean;\n}\n\n/** @public */\nexport interface OptimizerSystem {\n  cwd: () => string;\n  env: SystemEnvironment;\n  os: string;\n  dynamicImport: (path: string) => Promise<any>;\n  strictDynamicImport: (path: string) => Promise<any>;\n  getInputFiles?: (rootDir: string) => Promise<TransformModuleInput[]>;\n  path: Path;\n}\n\n/** @public */\nexport type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown';\n\n// OPTIONS ***************\n\n/** @public */\nexport type SourceMapsOption = 'external' | 'inline' | undefined | null;\n\n/** @public */\nexport type TranspileOption = boolean | undefined | null;\n\n/** @public */\nexport interface TransformOptions {\n  srcDir: string;\n  rootDir?: string;\n  entryStrategy?: EntryStrategy;\n  minify?: MinifyMode;\n  sourceMaps?: boolean;\n  transpileTs?: boolean;\n  transpileJsx?: boolean;\n  preserveFilenames?: boolean;\n  explicitExtensions?: boolean;\n  mode?: EmitMode;\n  scope?: string;\n  stripExports?: string[];\n  regCtxName?: string[];\n  stripCtxName?: string[];\n  stripEventHandlers?: boolean;\n  isServer?: boolean;\n}\n\n/** @public */\nexport interface TransformModulesOptions extends TransformOptions {\n  input: TransformModuleInput[];\n}\n\n/** @public */\nexport interface TransformFsOptions extends TransformOptions {\n  vendorRoots: string[];\n}\n\n// OPTION INPUTS ***************\n\n/** @public */\nexport interface TransformModuleInput {\n  path: string;\n  devPath?: string;\n  code: string;\n}\n\n// RESULT ***************\n\n/** @public */\nexport interface TransformOutput {\n  modules: TransformModule[];\n  diagnostics: Diagnostic[];\n  isTypeScript: boolean;\n  isJsx: boolean;\n}\n\n/** @public */\nexport interface SegmentAnalysis {\n  origin: string;\n  name: string;\n  entry: string | null;\n  displayName: string;\n  hash: string;\n  canonicalFilename: string;\n  extension: string;\n  parent: string | null;\n  ctxKind: 'eventHandler' | 'function';\n  ctxName: string;\n  captures: boolean;\n  loc: [number, number];\n}\n\n// RESULT OUTPUT ***************\n\n/** @public */\nexport interface TransformModule {\n  path: string;\n  isEntry: boolean;\n  code: string;\n  map: string | null;\n  segment: SegmentAnalysis | null;\n  origPath: string | null;\n}\n\n// DIAGNOSTICS ***************\n\n/** @public */\nexport interface Diagnostic {\n  scope: string;\n  category: DiagnosticCategory;\n  code: string | null;\n  file: string;\n  message: string;\n  highlights: SourceLocation[];\n  suggestions: string[] | null;\n}\n\n/** @public */\nexport interface SourceLocation {\n  hi: number;\n  lo: number;\n  startLine: number;\n  startCol: number;\n  endLine: number;\n  endCol: number;\n}\n\n/** @public */\nexport type DiagnosticCategory = 'error' | 'warning' | 'sourceError';\n\n// ENTRY STRATEGY ***************\n\n/** @public */\nexport type EntryStrategy =\n  | InlineEntryStrategy\n  | HoistEntryStrategy\n  | SingleEntryStrategy\n  | HookEntryStrategy\n  | SegmentEntryStrategy\n  | ComponentEntryStrategy\n  | SmartEntryStrategy;\n\n/** @public */\nexport type MinifyMode = 'simplify' | 'none';\n\n/** @public */\nexport type EmitMode = 'dev' | 'prod' | 'lib';\n\n/** @public */\nexport interface InlineEntryStrategy {\n  type: 'inline';\n}\n\n/** @public */\nexport interface HoistEntryStrategy {\n  type: 'hoist';\n}\n\n/** @deprecated Use SegmentStrategy instead */\nexport interface HookEntryStrategy {\n  type: 'hook';\n  manual?: Record<string, string>;\n}\n\n/** @public */\nexport interface SegmentEntryStrategy {\n  type: 'segment';\n  manual?: Record<string, string>;\n}\n\n/** @public */\nexport interface SingleEntryStrategy {\n  type: 'single';\n  manual?: Record<string, string>;\n}\n\n/** @public */\nexport interface ComponentEntryStrategy {\n  type: 'component';\n  manual?: Record<string, string>;\n}\n\n/** @public */\nexport interface SmartEntryStrategy {\n  type: 'smart';\n  manual?: Record<string, string>;\n}\n\n/**\n * The metadata of the build. One of its uses is storing where QRL symbols are located.\n *\n * @public\n */\nexport interface QwikManifest {\n  /** Content hash of the manifest, if this changes, the code changed */\n  manifestHash: string;\n  /** QRL symbols */\n  symbols: { [symbolName: string]: QwikSymbol };\n  /** Where QRLs are located. The key is the symbol name, the value is the bundle fileName */\n  mapping: { [symbolName: string]: string };\n  /**\n   * All code bundles, used to know the import graph. The key is the bundle fileName relative to\n   * \"build/\"\n   */\n  bundles: { [fileName: string]: QwikBundle };\n  /** All assets. The key is the fileName relative to the rootDir */\n  assets?: { [fileName: string]: QwikAsset };\n  /** All bundles in a compact graph format with probabilities */\n  bundleGraph?: QwikBundleGraph;\n  /** The bundle graph fileName */\n  bundleGraphAsset?: string;\n  /** The preloader bundle fileName */\n  preloader?: string;\n  /** The Qwik core bundle fileName */\n  core?: string;\n  /** The Qwik loader bundle fileName */\n  qwikLoader?: string;\n  /** CSS etc to inject in the document head */\n  injections?: GlobalInjections[];\n  /** The version of the manifest */\n  version: string;\n  /** The options used to build the manifest */\n  options?: {\n    target?: string;\n    buildMode?: string;\n    entryStrategy?: { type: EntryStrategy['type'] };\n  };\n  /** The platform used to build the manifest */\n  platform?: { [name: string]: string };\n}\n/**\n * The manifest values that are needed for SSR.\n *\n * @public\n */\nexport type ServerQwikManifest = Pick<\n  QwikManifest,\n  | 'manifestHash'\n  | 'injections'\n  | 'bundleGraph'\n  | 'bundleGraphAsset'\n  | 'mapping'\n  | 'preloader'\n  | 'core'\n  | 'qwikLoader'\n>;\n\n/**\n * Bundle graph.\n *\n * Format: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, //\n * Depends on 'bundle-c.js' 'bundle-c.js', ]\n *\n * @public\n */\nexport type QwikBundleGraph = Array<string | number>;\n\n/** @public */\nexport type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;\n\n/** @public */\nexport type SymbolMapperFn = (\n  symbolName: string,\n  mapper: SymbolMapper | undefined,\n  parent?: string\n) => readonly [symbol: string, chunk: string] | undefined;\n\n/** @public */\nexport interface QwikSymbol {\n  origin: string;\n  displayName: string;\n  hash: string;\n  canonicalFilename: string;\n  ctxKind: 'function' | 'eventHandler';\n  ctxName: string;\n  captures: boolean;\n  parent: string | null;\n  loc: [number, number];\n}\n\n/** @public */\nexport interface QwikBundle {\n  /** Size of the bundle */\n  size: number;\n  /** Total size of this bundle's static import graph */\n  total: number;\n  /** Interactivity score of the bundle */\n  interactivity?: number;\n  /** Symbols in the bundle */\n  symbols?: string[];\n  /** Direct imports */\n  imports?: string[];\n  /** Dynamic imports */\n  dynamicImports?: string[];\n  /** Source files of the bundle */\n  origins?: string[];\n}\n\n/** @public */\nexport interface QwikAsset {\n  /** Name of the asset */\n  name: string | undefined;\n  /** Size of the asset */\n  size: number;\n}\n\n/** @public */\nexport interface GlobalInjections {\n  tag: string;\n  attributes?: { [key: string]: string };\n  location: 'head' | 'body';\n}\n\n// PATH UTIL  ***************\n\n/** @public */\nexport interface Path {\n  resolve(...paths: string[]): string;\n  normalize(path: string): string;\n  isAbsolute(path: string): boolean;\n  join(...paths: string[]): string;\n  relative(from: string, to: string): string;\n  dirname(path: string): string;\n  basename(path: string, ext?: string): string;\n  extname(path: string): string;\n  format(pathObject: {\n    root: string;\n    dir: string;\n    base: string;\n    ext: string;\n    name: string;\n  }): string;\n  parse(path: string): {\n    root: string;\n    dir: string;\n    base: string;\n    ext: string;\n    name: string;\n  };\n  readonly sep: string;\n  readonly delimiter: string;\n  readonly win32: null;\n  readonly posix: Path;\n}\n\n/** @public */\nexport interface ResolvedManifest {\n  mapper: SymbolMapper;\n  manifest: ServerQwikManifest;\n  injections: GlobalInjections[];\n}\n"
  },
  {
    "path": "packages/qwik/src/optimizer/src/versions.ts",
    "content": "/** @public */\nexport const versions = {\n  qwik: (globalThis as any).QWIK_VERSION as string,\n};\n"
  },
  {
    "path": "packages/qwik/src/qwikloader.ts",
    "content": "import type {\n  QwikErrorEvent,\n  QwikSymbolEvent,\n  QwikVisibleEvent,\n} from './core/render/jsx/types/jsx-qwik-events';\nimport type { QContainerElement } from './core/container/container';\nimport type { QContext } from './core/state/context';\n\ntype qWindow = Window & {\n  qwikevents: {\n    events: Set<string>;\n    roots: Set<Node>;\n    push: (...e: (string | (EventTarget & ParentNode))[]) => void;\n  };\n};\n\n/**\n * Set up event listening for browser.\n *\n * Determine all the browser events and set up global listeners for them. If browser triggers event\n * search for the lazy load URL and `import()` it.\n *\n * @param doc - Document to use for setting up global listeners, and to determine all the browser\n *   supported events.\n */\nconst doc = document as Document & { __q_context__?: [Element, Event, URL] | 0 };\nconst win = window as unknown as qWindow;\nconst events = new Set<string>();\nconst roots = new Set<EventTarget & ParentNode>([doc]);\n\nlet hasInitialized: number;\n\nconst nativeQuerySelectorAll = (root: ParentNode, selector: string) =>\n  Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query: string) => {\n  const elements: Element[] = [];\n  roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n  return elements;\n};\nconst findShadowRoots = (fragment: EventTarget & ParentNode) => {\n  processEventOrNode(fragment);\n  nativeQuerySelectorAll(fragment, '[q\\\\:shadowroot]').forEach((parent) => {\n    const shadowRoot = parent.shadowRoot;\n    shadowRoot && findShadowRoots(shadowRoot);\n  });\n};\n\nconst isPromise = (promise: Promise<any>) => promise && typeof promise.then === 'function';\n\nconst broadcast = (infix: string, ev: Event, type = ev.type) => {\n  querySelectorAll('[on' + infix + '\\\\:' + type + ']').forEach((el) => {\n    dispatch(el, infix, ev, type);\n  });\n};\n\nconst resolveContainer = (containerEl: QContainerElement) => {\n  if (containerEl._qwikjson_ === undefined) {\n    const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n    let script = parentJSON.lastElementChild;\n    while (script) {\n      if (script.tagName === 'SCRIPT' && script.getAttribute('type') === 'qwik/json') {\n        containerEl._qwikjson_ = JSON.parse(\n          script.textContent!.replace(/\\\\x3C(\\/?script)/gi, '<$1')\n        );\n        break;\n      }\n      script = script.previousElementSibling;\n    }\n  }\n};\n\nconst createEvent = <T extends CustomEvent = any>(eventName: string, detail?: T['detail']) =>\n  new CustomEvent(eventName, {\n    detail,\n  }) as T;\n\nconst dispatch = async (\n  element: Element & { _qc_?: QContext | undefined },\n  onPrefix: string,\n  ev: Event,\n  eventName = ev.type\n) => {\n  const attrName = 'on' + onPrefix + ':' + eventName;\n  if (element.hasAttribute('preventdefault:' + eventName)) {\n    ev.preventDefault();\n  }\n  if (element.hasAttribute('stoppropagation:' + eventName)) {\n    ev.stopPropagation();\n  }\n  const ctx = element._qc_;\n  const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n  if (relevantListeners && relevantListeners.length > 0) {\n    for (const listener of relevantListeners) {\n      // listener[1] holds the QRL\n      const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n      const cancelBubble = ev.cancelBubble;\n      if (isPromise(results)) {\n        await results;\n      }\n      // forcing async with await resets ev.cancelBubble to false\n      if (cancelBubble) {\n        ev.stopPropagation();\n      }\n    }\n    return;\n  }\n  const attrValue = element.getAttribute(attrName);\n  if (attrValue) {\n    const container = element.closest('[q\\\\:container]')! as QContainerElement;\n    const qBase = container.getAttribute('q:base')!;\n    const qVersion = container.getAttribute('q:version') || 'unknown';\n    const qManifest = container.getAttribute('q:manifest-hash') || 'dev';\n    const base = new URL(qBase, doc.baseURI);\n    for (const qrl of attrValue.split('\\n')) {\n      const url = new URL(qrl, base);\n      const href = url.href;\n      const symbol = url.hash.replace(/^#?([^?[|]*).*$/, '$1') || 'default';\n      const reqTime = performance.now();\n      let handler: undefined | any;\n      let importError: undefined | 'sync' | 'async' | 'no-symbol';\n      let error: undefined | Error;\n      const isSync = qrl.startsWith('#');\n      const eventData: QwikSymbolEvent['detail'] = {\n        qBase,\n        qManifest,\n        qVersion,\n        href,\n        symbol,\n        element,\n        reqTime,\n      };\n      if (isSync) {\n        const hash = container.getAttribute('q:instance')!;\n        handler = ((doc as any)['qFuncs_' + hash] || [])[Number.parseInt(symbol)];\n        if (!handler) {\n          importError = 'sync';\n          error = new Error('sym:' + symbol);\n        }\n      } else {\n        emitEvent<QwikSymbolEvent>('qsymbol', eventData);\n        const uri = url.href.split('#')[0];\n        try {\n          const module = import(/* @vite-ignore */ uri);\n          resolveContainer(container);\n          handler = (await module)[symbol];\n          if (!handler) {\n            importError = 'no-symbol';\n            error = new Error(`${symbol} not in ${uri}`);\n          }\n        } catch (err) {\n          importError ||= 'async';\n          error = err as Error;\n        }\n      }\n      if (!handler) {\n        emitEvent<QwikErrorEvent>('qerror', {\n          importError,\n          error,\n          ...eventData,\n        });\n        console.error(error);\n        // break out of the loop if handler is not found\n        break;\n      }\n      const previousCtx = doc.__q_context__;\n      if (element.isConnected) {\n        try {\n          doc.__q_context__ = [element, ev, url];\n          const results = handler(ev, element);\n          // only await if there is a promise returned\n          if (isPromise(results)) {\n            await results;\n          }\n        } catch (error) {\n          emitEvent<QwikErrorEvent>('qerror', { error, ...eventData });\n        } finally {\n          doc.__q_context__ = previousCtx;\n        }\n      }\n    }\n  }\n};\n\nconst emitEvent = <T extends CustomEvent = any>(eventName: string, detail?: T['detail']) => {\n  doc.dispatchEvent(createEvent<T>(eventName, detail));\n};\n\nconst camelToKebab = (str: string) => str.replace(/([A-Z])/g, (a) => '-' + a.toLowerCase());\n\n/**\n * Event handler responsible for processing browser events.\n *\n * If browser emits an event, the `eventProcessor` walks the DOM tree looking for corresponding\n * `(${event.type})`. If found the event's URL is parsed and `import()`ed.\n *\n * @param ev - Browser event.\n */\nconst processDocumentEvent = async (ev: Event) => {\n  // eslint-disable-next-line prefer-const\n  let type = camelToKebab(ev.type);\n  let element = ev.target as Element | null;\n  broadcast('-document', ev, type);\n\n  while (element && element.getAttribute) {\n    const results = dispatch(element, '', ev, type);\n    let cancelBubble = ev.cancelBubble;\n    if (isPromise(results)) {\n      await results;\n    }\n    // if another async handler stopPropagation\n    cancelBubble ||=\n      cancelBubble || ev.cancelBubble || element.hasAttribute('stoppropagation:' + ev.type);\n    element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n  }\n};\n\nconst processWindowEvent = (ev: Event) => {\n  broadcast('-window', ev, camelToKebab(ev.type));\n};\n\nconst processReadyStateChange = () => {\n  const readyState = doc.readyState;\n  if (!hasInitialized && (readyState == 'interactive' || readyState == 'complete')) {\n    roots.forEach(findShadowRoots);\n    // document is ready\n    hasInitialized = 1;\n\n    emitEvent('qinit');\n    const riC = win.requestIdleCallback ?? win.setTimeout;\n    riC.bind(win)(() => emitEvent('qidle'));\n\n    if (events.has('qvisible')) {\n      const results = querySelectorAll('[on\\\\:qvisible]');\n      const observer = new IntersectionObserver((entries) => {\n        for (const entry of entries) {\n          if (entry.isIntersecting) {\n            observer.unobserve(entry.target);\n            dispatch(entry.target, '', createEvent<QwikVisibleEvent>('qvisible', entry));\n          }\n        }\n      });\n      results.forEach((el) => observer.observe(el));\n    }\n  }\n};\n\nconst addEventListener = (\n  el: EventTarget,\n  eventName: string,\n  handler: (ev: Event) => void,\n  capture = false\n) => {\n  el.addEventListener(eventName, handler, { capture, passive: false });\n};\n\nconst processEventOrNode = (...eventNames: (string | (EventTarget & ParentNode))[]) => {\n  for (const eventNameOrNode of eventNames) {\n    if (typeof eventNameOrNode === 'string') {\n      // If it is string we just add the event to window and each of our roots.\n      if (!events.has(eventNameOrNode)) {\n        roots.forEach((root) =>\n          addEventListener(root, eventNameOrNode, processDocumentEvent, true)\n        );\n        addEventListener(win, eventNameOrNode, processWindowEvent, true);\n        events.add(eventNameOrNode);\n      }\n    } else {\n      // If it is a new root, we also need this root to catch up to all of the events so far.\n      if (!roots.has(eventNameOrNode)) {\n        events.forEach((eventName) =>\n          addEventListener(eventNameOrNode, eventName, processDocumentEvent, true)\n        );\n        roots.add(eventNameOrNode);\n      }\n    }\n  }\n};\n\n// Only the first qwikloader will handle events\nif (!('__q_context__' in doc)) {\n  // Mark qwik-loader presence but falsy\n  doc.__q_context__ = 0;\n  const qwikevents = win.qwikevents;\n  // If `qwikEvents` is an array, process it.\n  if (qwikevents) {\n    if (Array.isArray(qwikevents)) {\n      processEventOrNode(...qwikevents);\n    } else {\n      // Assume that there will probably be click or input listeners\n      processEventOrNode('click', 'input');\n    }\n  }\n  // Now rig up `qwikEvents` so we get notified of new registrations by other containers.\n  win.qwikevents = {\n    events: events,\n    roots: roots,\n    push: processEventOrNode,\n  };\n  addEventListener(doc, 'readystatechange', processReadyStateChange);\n  processReadyStateChange();\n}\n"
  },
  {
    "path": "packages/qwik/src/qwikloader.unit.ts",
    "content": "import { readFileSync } from 'fs';\nimport { expect, test } from 'vitest';\nimport compress from 'brotli/compress.js';\nimport { fileURLToPath } from 'url';\nimport { dirname, resolve } from 'path';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n// Run `pnpm build --qwik --dev` to update\ntest('qwikloader script', () => {\n  let qwikLoader: string = '';\n  try {\n    qwikLoader = readFileSync(resolve(__dirname, '../dist/qwikloader.js'), 'utf-8');\n  } catch {\n    // ignore, we didn't build yet\n  }\n  // This is to ensure we are deliberate about changes to qwikloader.\n  expect(qwikLoader.length).toBeGreaterThan(0);\n  /**\n   * Note that the source length can be shorter by using strings in variables and using those to\n   * dereference objects etc, but that actually results in worse compression\n   */\n  const compressed = compress(Buffer.from(qwikLoader), { mode: 1, quality: 11 });\n  expect([compressed.length, qwikLoader.length]).toMatchInlineSnapshot(`\n    [\n      1417,\n      3100,\n    ]\n  `);\n\n  expect(qwikLoader).toMatchInlineSnapshot(\n    `\"const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),a=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},i=t=>{w(t),s(t,\"[q\\\\\\\\:shadowroot]\").forEach(t=>{const e=t.shadowRoot;e&&i(e)})},c=t=>t&&\"function\"==typeof t.then,l=(t,e,n=e.type)=>{a(\"[on\"+t+\"\\\\\\\\:\"+n+\"]\").forEach(o=>{b(o,t,e,n)})},f=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if(\"SCRIPT\"===n.tagName&&\"qwik/json\"===n.getAttribute(\"type\")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\\\\\x3C(\\\\/?script)/gi,\"<$1\"));break}n=n.previousElementSibling}}},p=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s=\"on\"+n+\":\"+r;e.hasAttribute(\"preventdefault:\"+r)&&o.preventDefault(),e.hasAttribute(\"stoppropagation:\"+r)&&o.stopPropagation();const a=e._qc_,i=a&&a.li.filter(t=>t[0]===s);if(i&&i.length>0){for(const t of i){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s);if(l){const n=e.closest(\"[q\\\\\\\\:container]\"),r=n.getAttribute(\"q:base\"),s=n.getAttribute(\"q:version\")||\"unknown\",a=n.getAttribute(\"q:manifest-hash\")||\"dev\",i=new URL(r,t.baseURI);for(const p of l.split(\"\\\\n\")){const l=new URL(p,i),b=l.href,h=l.hash.replace(/^#?([^?[|]*).*$/,\"$1\")||\"default\",q=performance.now();let _,d,y;const w=p.startsWith(\"#\"),g={qBase:r,qManifest:a,qVersion:s,href:b,symbol:h,element:e,reqTime:q};if(w){const e=n.getAttribute(\"q:instance\");_=(t[\"qFuncs_\"+e]||[])[Number.parseInt(h)],_||(d=\"sync\",y=Error(\"sym:\"+h))}else{u(\"qsymbol\",g);const t=l.href.split(\"#\")[0];try{const e=import(t);f(n),_=(await e)[h],_||(d=\"no-symbol\",y=Error(\\`\\${h} not in \\${t}\\`))}catch(t){d||(d=\"async\"),y=t}}if(!_){u(\"qerror\",{importError:d,error:y,...g}),console.error(y);break}const m=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){u(\"qerror\",{error:t,...g})}finally{t.__q_context__=m}}}},u=(e,n)=>{t.dispatchEvent(p(e,n))},h=t=>t.replace(/([A-Z])/g,t=>\"-\"+t.toLowerCase()),q=async t=>{let e=h(t.type),n=t.target;for(l(\"-document\",t,e);n&&n.getAttribute;){const o=b(n,\"\",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute(\"stoppropagation:\"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},_=t=>{l(\"-window\",t,h(t.type))},d=()=>{const s=t.readyState;if(!r&&(\"interactive\"==s||\"complete\"==s)&&(o.forEach(i),r=1,u(\"qinit\"),(e.requestIdleCallback??e.setTimeout).bind(e)(()=>u(\"qidle\")),n.has(\"qvisible\"))){const t=a(\"[on\\\\\\\\:qvisible]\"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,\"\",p(\"qvisible\",n)))});t.forEach(t=>e.observe(t))}},y=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})},w=(...t)=>{for(const r of t)\"string\"==typeof r?n.has(r)||(o.forEach(t=>y(t,r,q,!0)),y(e,r,_,!0),n.add(r)):o.has(r)||(n.forEach(t=>y(r,t,q,!0)),o.add(r))};if(!(\"__q_context__\"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?w(...r):w(\"click\",\"input\")),e.qwikevents={events:n,roots:o,push:w},y(t,\"readystatechange\",d),d()}\"`\n  );\n});\n"
  },
  {
    "path": "packages/qwik/src/server/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>../../dist-dev/dts-out/packages/qwik/src/server/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik.server\",\n    \"reportFolder\": \"<projectFolder>/src/server/\",\n    \"reportTempFolder\": \"<projectFolder>../../dist-dev/api-extractor/server/\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/dist/server.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>../../dist-dev/api/qwik/server/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/server/index.ts",
    "content": "import { setPlatform } from '@builder.io/qwik';\nimport { createPlatform } from './platform';\nimport type { ResolvedManifest } from '@builder.io/qwik/optimizer';\nimport { resolveManifest } from './render';\nimport type { QwikManifest } from './types';\n\nexport type {\n  PrefetchResource,\n  PrefetchImplementation,\n  PrefetchStrategy,\n  PreloaderOptions,\n  RenderToStringOptions,\n  RenderToStringResult,\n  Render,\n  RenderToStream,\n  RenderToString,\n  RenderOptions,\n  RenderResult,\n  RenderToStreamOptions,\n  SerializeDocumentOptions,\n  RenderToStreamResult,\n  QwikLoaderOptions,\n  StreamingOptions,\n  InOrderAuto,\n  InOrderDisabled,\n  InOrderStreaming,\n  SymbolsToPrefetch,\n} from './types';\nexport { renderToString, renderToStream, resolveManifest } from './render';\nexport { versions } from './utils';\nexport { getQwikLoaderScript, getQwikPrefetchWorkerScript } from './scripts';\n\n/** @public */\nexport async function setServerPlatform(manifest?: Partial<QwikManifest | ResolvedManifest>) {\n  const platform = createPlatform({ manifest }, resolveManifest(manifest));\n  setPlatform(platform);\n}\n"
  },
  {
    "path": "packages/qwik/src/server/platform.ts",
    "content": "import type { SerializeDocumentOptions } from './types';\nimport { setPlatform } from '@builder.io/qwik';\nimport type { ResolvedManifest } from '@builder.io/qwik/optimizer';\nimport type { CorePlatformServer } from '../core/platform/types';\nimport { qError, QError_dynamicImportFailed } from '../core/error/error';\n\ndeclare const require: (module: string) => Record<string, any>;\n\n// Make sure this value is same as value in `qrl-class.ts`\nconst SYNC_QRL = '<sync>';\n\nexport function createPlatform(\n  opts: SerializeDocumentOptions,\n  resolvedManifest: ResolvedManifest | undefined\n) {\n  const mapper = resolvedManifest?.mapper;\n  const mapperFn = opts.symbolMapper\n    ? opts.symbolMapper\n    : (symbolName: string, _chunk: any, parent?: string): readonly [string, string] | undefined => {\n        if (mapper) {\n          const hash = getSymbolHash(symbolName);\n          const result = mapper[hash];\n          if (!result) {\n            if (hash === SYNC_QRL) {\n              return [hash, ''] as const;\n            }\n            const isRegistered = (globalThis as any).__qwik_reg_symbols?.has(hash);\n            if (isRegistered) {\n              return [symbolName, '_'] as const;\n            }\n            if (parent) {\n              // In dev mode, SSR may need to refer to a symbol that wasn't built yet on the client\n              return [symbolName, `${parent}?qrl=${symbolName}`] as const;\n            }\n            console.error('Cannot resolve symbol', symbolName, 'in', mapper, parent);\n          }\n          return result;\n        }\n      };\n\n  const serverPlatform: CorePlatformServer = {\n    isServer: true,\n    async importSymbol(_containerEl, url, symbolName) {\n      const hash = getSymbolHash(symbolName);\n      const regSym = (globalThis as any).__qwik_reg_symbols?.get(hash);\n      if (regSym) {\n        return regSym;\n      }\n      // we never lazy import on the server\n      throw qError(QError_dynamicImportFailed, symbolName);\n    },\n    raf: () => {\n      console.error('server can not rerender');\n      return Promise.resolve();\n    },\n    nextTick: (fn) => {\n      return new Promise((resolve) => {\n        // Do not use process.nextTick, as this will execute at same priority as promises.\n        // We need to execute after promises.\n        setTimeout(() => {\n          resolve(fn());\n        });\n      });\n    },\n    chunkForSymbol(symbolName: string, _chunk, parent) {\n      return mapperFn(symbolName, mapper, parent);\n    },\n  };\n  return serverPlatform;\n}\n\n/** Applies NodeJS specific platform APIs to the passed in document instance. */\nexport async function setServerPlatform(\n  opts: SerializeDocumentOptions,\n  manifest: ResolvedManifest | undefined\n) {\n  const platform = createPlatform(opts, manifest);\n  setPlatform(platform);\n}\n\nexport const getSymbolHash = (symbolName: string) => {\n  const index = symbolName.lastIndexOf('_');\n  if (index > -1) {\n    return symbolName.slice(index + 1);\n  }\n  return symbolName;\n};\n"
  },
  {
    "path": "packages/qwik/src/server/platform.unit.ts",
    "content": "import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest';\nimport { createPlatform, getSymbolHash } from './platform';\n\ndescribe('server platform', () => {\n  beforeEach(() => {\n    // Initialize a fresh Map for each test to avoid pollution\n    (globalThis as any).__qwik_reg_symbols = new Map<string, any>();\n  });\n\n  afterEach(() => {\n    // Clean up global state\n    delete (globalThis as any).__qwik_reg_symbols;\n  });\n\n  describe('importSymbol', () => {\n    test('returns registered symbol without importing', async () => {\n      const platform = createPlatform({}, undefined);\n\n      // Register a mock symbol\n      const symbolName = 'myComponent_abc123';\n      const hash = getSymbolHash(symbolName);\n      const mockFunction = () => 'mock component';\n      (globalThis as any).__qwik_reg_symbols.set(hash, mockFunction);\n\n      // importSymbol should return the registered symbol synchronously\n      const result = await platform.importSymbol(null as any, '', symbolName);\n\n      expect(result).toBe(mockFunction);\n    });\n\n    test('throws error for unregistered symbol without importing', async () => {\n      const platform = createPlatform({}, undefined);\n\n      const symbolName = 'unregisteredSymbol_xyz789';\n\n      // importSymbol should throw qError without attempting any dynamic import\n      await expect(platform.importSymbol(null as any, '', symbolName)).rejects.toThrow();\n\n      let didThrow = false;\n      // Verify it throws with the correct error structure\n      try {\n        await platform.importSymbol(null as any, '', symbolName);\n        expect.unreachable('Should have thrown an error');\n      } catch (e: any) {\n        didThrow = true;\n        // The error should be a QError with code for dynamic import failed\n        expect(e.message).toMatch(/Code\\(\\d+\\)/);\n        expect(e.message).toContain('Dynamic import not found');\n      }\n      expect(didThrow).toBe(true);\n    });\n\n    test('does not call dynamic import', async () => {\n      const platform = createPlatform({}, undefined);\n\n      // Spy on console.error to capture the error log (if any)\n      const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});\n\n      const symbolName = 'testSymbol_test123';\n\n      // Verify that the function throws synchronously without any async import\n      const startTime = Date.now();\n      try {\n        await platform.importSymbol(null as any, '', symbolName);\n      } catch (e) {\n        // Expected to throw\n      }\n      const endTime = Date.now();\n\n      // Should complete nearly instantly (no network/file I/O)\n      // If it took more than 100ms, something is probably doing async work\n      expect(endTime - startTime).toBeLessThan(100);\n\n      consoleErrorSpy.mockRestore();\n    });\n\n    test('works with symbols containing multiple underscores', async () => {\n      const platform = createPlatform({}, undefined);\n\n      const symbolName = 'my_component_with_underscores_abc123';\n      const hash = getSymbolHash(symbolName);\n      const mockFunction = () => 'mock';\n      (globalThis as any).__qwik_reg_symbols.set(hash, mockFunction);\n\n      const result = await platform.importSymbol(null as any, '', symbolName);\n\n      expect(result).toBe(mockFunction);\n    });\n  });\n\n  describe('getSymbolHash', () => {\n    test('extracts hash after last underscore', () => {\n      expect(getSymbolHash('mySymbol_abc123')).toBe('abc123');\n      expect(getSymbolHash('component_with_multiple_underscores_xyz789')).toBe('xyz789');\n    });\n\n    test('returns full name if no underscore present', () => {\n      expect(getSymbolHash('noUnderscore')).toBe('noUnderscore');\n      expect(getSymbolHash('simpleSymbol')).toBe('simpleSymbol');\n    });\n\n    test('handles edge cases', () => {\n      expect(getSymbolHash('_leadingUnderscore')).toBe('leadingUnderscore');\n      expect(getSymbolHash('trailingUnderscore_')).toBe('');\n      expect(getSymbolHash('_')).toBe('');\n    });\n  });\n});\n"
  },
  {
    "path": "packages/qwik/src/server/preload-impl.ts",
    "content": "import { Fragment, jsx, type JSXNode } from '@builder.io/qwik';\nimport type { ResolvedManifest } from '../optimizer/src/types';\nimport { expandBundles } from './preload-strategy';\nimport type { PreloaderOptions, RenderToStreamOptions, SnapshotResult } from './types';\nimport { initPreloader } from '../core/preloader/bundle-graph';\nimport { getPreloadPaths } from './preload-strategy';\n\nconst simplifyPath = (base: string, path: string | null | undefined) => {\n  if (path == null) {\n    return null;\n  }\n  const segments = `${base}${path}`.split('/');\n  const simplified = [];\n  for (const segment of segments) {\n    if (segment === '..' && simplified.length > 0) {\n      simplified.pop();\n    } else {\n      simplified.push(segment);\n    }\n  }\n  return simplified.join('/');\n};\n\nexport const preloaderPre = (\n  base: string,\n  resolvedManifest: ResolvedManifest | undefined,\n  options: PreloaderOptions | false | undefined,\n  beforeContent: JSXNode<string>[],\n  nonce?: string\n) => {\n  const preloaderPath = simplifyPath(base, resolvedManifest?.manifest?.preloader);\n  const bundleGraphPath =\n    (import.meta.env.BASE_URL || '/') + resolvedManifest?.manifest.bundleGraphAsset;\n  if (preloaderPath && bundleGraphPath && options !== false) {\n    // Initialize the SSR preloader\n    const preloaderOpts: Parameters<typeof initPreloader>[1] =\n      typeof options === 'object'\n        ? {\n            debug: options.debug,\n            preloadProbability: options.ssrPreloadProbability,\n          }\n        : undefined;\n    initPreloader(resolvedManifest?.manifest.bundleGraph, preloaderOpts);\n\n    // Add the preloader script to the head\n    const opts: string[] = [];\n    if (options?.debug) {\n      opts.push('d:1');\n    }\n    if (options?.maxIdlePreloads) {\n      opts.push(`P:${options.maxIdlePreloads}`);\n    }\n    if (options?.preloadProbability) {\n      opts.push(`Q:${options.preloadProbability}`);\n    }\n    const optsStr = opts.length ? `,{${opts.join(',')}}` : '';\n\n    const script =\n      `let b=fetch(\"${bundleGraphPath}\");` +\n      `import(\"${preloaderPath}\").then(({l})=>` +\n      `l(${JSON.stringify(base)},b${optsStr})` +\n      `);`;\n\n    beforeContent.push(\n      /**\n       * We add modulepreloads even when the script is at the top because they already fire during\n       * html download\n       */\n      jsx('link', { rel: 'modulepreload', href: preloaderPath, nonce, crossorigin: 'anonymous' }),\n      jsx('link', {\n        rel: 'preload',\n        href: bundleGraphPath,\n        as: 'fetch',\n        crossorigin: 'anonymous',\n        nonce,\n      }),\n      jsx('script', {\n        type: 'module',\n        async: true,\n        dangerouslySetInnerHTML: script,\n        nonce,\n      })\n    );\n  }\n\n  const corePath = simplifyPath(base, resolvedManifest?.manifest.core);\n  if (corePath) {\n    beforeContent.push(jsx('link', { rel: 'modulepreload', href: corePath, nonce }));\n  }\n};\n\nexport const includePreloader = (\n  base: string,\n  resolvedManifest: ResolvedManifest | undefined,\n  options: PreloaderOptions | boolean | undefined,\n  referencedBundles: string[],\n  nonce?: string\n): JSXNode | null => {\n  if (referencedBundles.length === 0 || options === false) {\n    return null;\n  }\n  const { ssrPreloads, ssrPreloadProbability } = normalizePreLoaderOptions(\n    typeof options === 'boolean' ? undefined : options\n  );\n  let allowed = ssrPreloads;\n\n  const nodes: JSXNode[] = [];\n\n  if (import.meta.env.DEV) {\n    // Vite dev server active\n    // in dev, all bundles are absolute paths from the base url, not /build\n    base = import.meta.env.BASE_URL;\n    if (base.endsWith('/')) {\n      base = base.slice(0, -1);\n    }\n  }\n\n  const links = [];\n\n  const manifestHash = resolvedManifest?.manifest.manifestHash;\n  if (allowed) {\n    const preloaderBundle = resolvedManifest?.manifest.preloader;\n    const coreBundle = resolvedManifest?.manifest.core;\n    const expandedBundles = expandBundles(referencedBundles, resolvedManifest);\n    // Keep the same as in getQueue (but *10)\n    let probability = 4;\n    const tenXMinProbability = ssrPreloadProbability * 10;\n    for (const hrefOrProbability of expandedBundles) {\n      if (typeof hrefOrProbability === 'string') {\n        if (probability < tenXMinProbability) {\n          break;\n        }\n        // we already preload the preloader and core bundles\n        if (hrefOrProbability === preloaderBundle || hrefOrProbability === coreBundle) {\n          continue;\n        }\n        links.push(hrefOrProbability);\n        if (--allowed === 0) {\n          break;\n        }\n      } else {\n        probability = hrefOrProbability;\n      }\n    }\n  }\n\n  const preloaderPath = simplifyPath(base, manifestHash && resolvedManifest?.manifest.preloader);\n  const insertLinks = links.length\n    ? /**\n       * We only use modulepreload links because they behave best. Older browsers can rely on the\n       * preloader which does feature detection and which will be available soon after inserting these\n       * links.\n       */\n      `${JSON.stringify(links)}.map((l,e)=>{` +\n      `e=document.createElement('link');` +\n      `e.rel='modulepreload';` +\n      `e.href=${JSON.stringify(base)}+l;` +\n      `document.head.appendChild(e)` +\n      `});`\n    : '';\n  // We are super careful not to interfere with the page loading.\n  let script = insertLinks;\n  if (preloaderPath) {\n    // First we wait for the onload event\n    script +=\n      `window.addEventListener('load',f=>{` +\n      `f=_=>import(\"${preloaderPath}\").then(({p})=>p(${JSON.stringify(referencedBundles)}));` +\n      // then we ask for idle callback\n      `try{requestIdleCallback(f,{timeout:2000})}` +\n      // some browsers don't support requestIdleCallback\n      `catch(e){setTimeout(f,200)}` +\n      `})`;\n  }\n  /**\n   * Uses the preloader chunk to add the `<link>` elements at runtime. This allows core to simply\n   * import the preloader as well and have all the state there, plus it makes it easy to write a\n   * complex implementation.\n   *\n   * Note that we don't preload the preloader or bundlegraph, they are requested after the SSR\n   * preloads because they are not as important. Also the preloader includes the vitePreload\n   * function and will in fact already be in that list.\n   */\n  if (script) {\n    nodes.push(\n      jsx('script', {\n        type: 'module',\n        'q:type': 'preload',\n        /**\n         * This async allows the preloader to be executed before the DOM is fully parsed even though\n         * it's at the bottom of the body\n         */\n        async: true,\n        dangerouslySetInnerHTML: script,\n        nonce,\n      })\n    );\n  }\n\n  if (nodes.length > 0) {\n    return jsx(Fragment, { children: nodes });\n  }\n\n  return null;\n};\n\nexport const preloaderPost = (\n  base: string,\n  snapshotResult: SnapshotResult,\n  opts: RenderToStreamOptions,\n  resolvedManifest: ResolvedManifest | undefined,\n  output: (JSXNode | null)[]\n) => {\n  if (opts.preloader !== false) {\n    // skip prefetch implementation if prefetchStrategy === null\n    const preloadBundles = getPreloadPaths(snapshotResult, opts, resolvedManifest);\n    // If no preloadBundles, there is no reactivity, so no need to include the preloader\n    if (preloadBundles.length > 0) {\n      const result = includePreloader(\n        base,\n        resolvedManifest,\n        opts.preloader,\n        preloadBundles,\n        opts.serverData?.nonce\n      );\n      if (result) {\n        output.push(result);\n      }\n    }\n  }\n};\n\nfunction normalizePreLoaderOptions(\n  input: PreloaderOptions | undefined\n): Required<PreloaderOptions> {\n  return { ...PreLoaderOptionsDefault, ...input };\n}\n\nconst PreLoaderOptionsDefault: Required<PreloaderOptions> = {\n  ssrPreloads: 7,\n  ssrPreloadProbability: 0.5,\n  debug: false,\n  maxIdlePreloads: 25,\n  preloadProbability: 0.35, // deprecated\n};\n"
  },
  {
    "path": "packages/qwik/src/server/preload-strategy.ts",
    "content": "import type { ResolvedManifest } from '@builder.io/qwik/optimizer';\nimport { getQueue, preload, resetQueue } from '../core/preloader/queue';\nimport type { QRLInternal } from '../core/qrl/qrl-class';\nimport { flattenPrefetchResources } from './preload-utils';\nimport type { RenderToStringOptions, SnapshotResult } from './types';\nimport { getPlatform } from '@builder.io/qwik';\nimport { getSymbolHash } from './platform';\n\nconst getBundles = (snapshotResult: SnapshotResult | null) => {\n  const platform = getPlatform();\n  const bundles = (snapshotResult?.qrls as QRLInternal[])\n    ?.map((qrl) => {\n      const symbol = qrl.$refSymbol$ || qrl.$symbol$;\n      const chunk = qrl.$chunk$;\n      const result = platform.chunkForSymbol(symbol, chunk, qrl.dev?.file);\n      if (result) {\n        return result[1];\n      }\n      return chunk;\n    })\n    .filter(Boolean) as string[];\n  return [...new Set(bundles)];\n};\n/** Returns paths to preload relative to the buildBase, with probabilities */\nexport function getPreloadPaths(\n  snapshotResult: SnapshotResult | null,\n  opts: RenderToStringOptions,\n  resolvedManifest: ResolvedManifest | undefined\n): string[] {\n  const prefetchStrategy = opts.prefetchStrategy;\n  if (prefetchStrategy === null) {\n    return [];\n  }\n  if (!resolvedManifest?.manifest.bundleGraph) {\n    return getBundles(snapshotResult);\n  }\n\n  // TODO should we deprecate this?\n  if (typeof prefetchStrategy?.symbolsToPrefetch === 'function') {\n    // call user option symbolsToPrefetch()\n    try {\n      const prefetchResources = prefetchStrategy.symbolsToPrefetch({\n        manifest: resolvedManifest.manifest,\n      });\n      return flattenPrefetchResources(prefetchResources);\n    } catch (e) {\n      console.error('getPrefetchUrls, symbolsToPrefetch()', e);\n    }\n  }\n\n  // If we have a bundle graph, all we need is the symbols\n  const symbols = new Set<string>();\n  for (const qrl of (snapshotResult?.qrls || []) as QRLInternal[]) {\n    const symbol = getSymbolHash(qrl.$refSymbol$ || qrl.$symbol$);\n    if (symbol && symbol.length >= 10) {\n      symbols.add(symbol);\n    }\n  }\n  return [...symbols];\n}\n\nexport const expandBundles = (names: string[], resolvedManifest?: ResolvedManifest) => {\n  if (!resolvedManifest?.manifest.bundleGraph) {\n    return [...new Set(names)];\n  }\n\n  resetQueue();\n\n  let probability = 0.99;\n  // we assume that after 15 symbols, we're beyond the first screenful of content\n  // the preloader will load the rest\n  for (const name of names.slice(0, 15)) {\n    preload(name, probability);\n    // later symbols have less probability\n    probability *= 0.85;\n  }\n\n  return getQueue();\n};\n"
  },
  {
    "path": "packages/qwik/src/server/preload-utils.ts",
    "content": "import type { PrefetchResource } from './types';\n\nexport function flattenPrefetchResources(prefetchResources: PrefetchResource[]) {\n  const urls: string[] = [];\n  const addPrefetchResource = (prefetchResources?: PrefetchResource[]) => {\n    if (prefetchResources) {\n      for (const prefetchResource of prefetchResources) {\n        if (!urls.includes(prefetchResource.url)) {\n          urls.push(prefetchResource.url);\n          if (prefetchResource.imports) {\n            addPrefetchResource(prefetchResource.imports);\n          }\n        }\n      }\n    }\n  };\n\n  addPrefetchResource(prefetchResources);\n  return urls;\n}\n\nexport function getMostReferenced(prefetchResources: PrefetchResource[]) {\n  const common = new Map<string, number>();\n  let total = 0;\n  const addPrefetchResource = (prefetchResources: PrefetchResource[], visited: Set<string>) => {\n    if (prefetchResources) {\n      for (const prefetchResource of prefetchResources) {\n        const count = common.get(prefetchResource.url) || 0;\n        common.set(prefetchResource.url, count + 1);\n        total++;\n\n        if (!visited.has(prefetchResource.url)) {\n          visited.add(prefetchResource.url);\n          addPrefetchResource(prefetchResource.imports, visited);\n        }\n      }\n    }\n  };\n  const visited = new Set<string>();\n  for (const resource of prefetchResources) {\n    visited.clear();\n    addPrefetchResource(resource.imports, visited);\n  }\n  const threshold = (total / common.size) * 2.0;\n  const urls = Array.from(common.entries());\n  urls.sort((a, b) => b[1] - a[1]);\n  return urls\n    .slice(0, 5)\n    .filter((e) => e[1] > threshold)\n    .map((e) => e[0]);\n}\n"
  },
  {
    "path": "packages/qwik/src/server/preload-utils.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { flattenPrefetchResources } from './preload-utils';\n\ntest('flattenPrefetchResources, no imports', () => {\n  const p = [\n    { url: 'a.js', imports: [], priority: false },\n    { url: 'b.js', imports: [], priority: true },\n    { url: 'c.js', imports: [], priority: false },\n  ];\n  assert.deepEqual(flattenPrefetchResources(p), ['a.js', 'b.js', 'c.js']);\n});\n\ntest('flattenPrefetchResources, w/ imports', () => {\n  const p = [\n    {\n      url: 'a.js',\n      imports: [\n        { url: 'x.js', imports: [{ url: 'y.js', imports: [], priority: false }], priority: false },\n        { url: 'y.js', imports: [], priority: false },\n      ],\n      priority: false,\n    },\n    {\n      url: 'b.js',\n      imports: [\n        { url: 'x.js', imports: [{ url: 'y.js', imports: [], priority: false }], priority: false },\n        { url: 'y.js', imports: [], priority: false },\n      ],\n      priority: true,\n    },\n    {\n      url: 'c.js',\n      imports: [\n        {\n          url: 'z.js',\n          imports: [\n            {\n              url: 'x.js',\n              imports: [{ url: 'y.js', imports: [], priority: false }],\n              priority: false,\n            },\n          ],\n          priority: false,\n        },\n      ],\n      priority: false,\n    },\n  ];\n  assert.deepEqual(flattenPrefetchResources(p), ['a.js', 'x.js', 'y.js', 'b.js', 'c.js', 'z.js']);\n});\n"
  },
  {
    "path": "packages/qwik/src/server/preloading.md",
    "content": "# Preloading\n\nWhen a user clicks a button, we want the code to be already there.\nWhen they navigate to a new page, we want this to be as fast as possible.\n\nIf code is missing, the user has to wait for it to load. Then, its static imports also have to load. More waiting, this is a waterfall.\n\nWe could simply downlad all code at start, but on a slow connection or device this can mean that the code that is needed will be loaded last.\n\nWe aim to minimize the time it takes for the code to be loaded and executed. For every interaction, there are some loading strategies that result in the shortest wait for the user. We try to find the best strategy for each case.\n\nUsers will start to notice a latency in UI response from 200ms. At weak mobile speeds, that translates to about 8kB of data, but there's also the 100-500ms latency of 3G to consider.\n\nThe Qwik Docs site has 2.3MB of Brotli-compressed JS. Over a weak mobile connection this easily can take a minute to download. So we need to split the code into bundles.\n\nWe need to balance bundle size versus more bundles increasing latency via HTTP request overhead.\n\n## Strategy\n\n### Waterfall prevention\n\nTo prevent waterfalls, we need to tell the browser which imports will be needed when an import loads. This is the entire static import graph, all the `import` statements from all the bundles that are loaded.\n\nWe can do this because the majority of our imports are QRLs. When a QRL is run, we can use information about the import graph to give the browser the entire list of all imports that need to be loaded.\n\n### Loading code before it is needed\n\nIf we have available bandwidth, we can download code before it is needed. We should determine which code is most likely to be needed, and download it first, as well as its static imports.\n\nTo know which code is most likely to be needed, we can use the bundle scoring system.\n\nWe will err on the side of caution, so if we are not sure, we will preload the bundle. This is better than making the user wait. In the end, all of the code that might be needed for the current page should be preloaded. However, we should make sure that bundles that are more likely to be needed are preloaded first.\n\nHowever, on low-end devices, we may decide to not preload low-likelihood bundles.\n\n### Bundle scoring system\n\nIdeally, we have a function that gets the current DOM, the browser position and the user interaction history and returns the likelihoods of the bundles. Perhaps one day we can use a neural network to do this, but for now we use heuristics.\n\nEach bundle gets some metrics that will be used to score it. The scoring should help us decide which bundles to preload first.\n\n### Metrics\n\n- Interactivity: How much impact to interactivity is there if the bundle is missing?\n  - score 0.0 to 1.0\n  - this is determined at build time\n  - a click handler is very interactive, but the Task that gets executed by the signal that changes might also be important\n  - qwik core and other libraries are not interactive directly, so it gets 0. However, it will get higher probability via its importers.\n- Size: How much code is there to download?\n  - score: number of seconds it takes to download at slow mobile speed, currently set at 200kbps, so 1 second is 200/8 = 25kB\n  - this is determined at build time\n  - heavy bundles that are not interactive should not be preloaded at all, but very interactive bundles should be preloaded before others, so that smaller bundles can download in parallel.\n\n### Likelihood calculation\n\nWe're interested in the probability of a bundle being needed in the next 5 seconds (0.0 to 1.0)\n\n- this is a runtime guess, based on the interactivity of the bundle, for handlers its location on the page, and any the already-loaded bundles that import it\n- Insights can be used to improve this guess with real data, but this is only implemented for Link SPA preloading and bundle bundling.\n- this also changes during execution: importing one bundle can increase the score of another. The extreme case is direct imports, they are then 100% sure to be needed.\n- dependencies get adjustments when importers run. For example, if an importer bundle has a probability of `0.5` and it imports this bundle with a probability of `0.5`, the probability is `0.5 * 0.5 = 0.25`. If another bundle has a probability of `0.25` and imports this bundle with a probability of `0.75`, the probability is `0.25 * 0.75 = 0.1875`. When both importers are present, the total probability is `1 - (1 - 0.5) * (1 - 0.25) = 0.6875`.\n\nGenerally speaking, the probability of a bundle loading because of importers is `1 - (1 - p1) * (1 - p2) * ...` where `p1`, `p2`, ... are the probabilities of each importer not importing this bundle, which is the product of the probabilities of each importer not importing this bundle). Furthermore we have the base probability of the bundle. That can be seen as an importer with a probability of `1`.\n\nSo, for each bundle we keep track of the inverse probability. We start with the 1 - the base probability, and when an importer runs, we multiply with its inverse probability.\n\nThe likelihood score is then derived as follows:\n\n- `score = 0.5 * probability + 0.5 * interactivity`\n\nThis means that a bundle that is both interactive and has a high probability will get a high score, but a bundle that is only interactive or only likely will get a lower score.\n\n### SSR probability\n\nDuring SSR, we discover the QRL segments that are used in the result, both from event handlers and from state (e.g. computed signals). We then use this to calculate the probability of their bundle being needed.\n\nFor event handlers, we can use the type of event for interactivity scoring as well as probability of the handler being called. Visible tasks and computed signal QRLs will have a high probability, onClick handlers will have a medium probability but high interactivity, etc.\n\nWe can then generate a list of bundles in their order of likelihood. We provide this list to the preloader, and anything with a score > 0.8 will get an initial preload tag.\n\nThis will e.g. automatically add the bundle containing Qwik Core as a tag to the result.\n\n## Available techniques in the browser\n\nNote, currently we are only interested in preloading code, not assets. Furthermore, we only target browsers that support ES bundles.\n\nYou can preload a bundle either declaratively or imperatively.\n\n### Declarative\n\nBy declaring a bundle, you tell the browser to expect running the bundle soon. The browser can then decide what to do with it.\n\nThe best way to preload is to use `<link rel=\"bundlepreload\">` tags. This tells the browser to expect running the bundle soon. The browser will then download the bundle in the background, parse it and also download its static imports.\n\nIf the browser does not support this, we can use `<link rel=\"preload\">` tags. This is not as good, because the browser will not parse the code.\n\nAt the time of writing, `bundlepreload` has 93% support and `preload` has 97% support.\n\nNote that once you add a preload tag, you can't control when the browser will download the bundle. Therefore you should not have too many tags at the same time, and the preloader keeps a queue of bundles to preload. The bundles with high likelihood are allowed to have more tags at the same time than the ones with low likelihood.\n\n### Imperative\n\nWe can also simply `fetch` the bundle and discard the response. The browser the hopefully keeps it in cache.\n\nThis is unlikely to be optimal because we don't have the same information as the browser about the currently available resources.\n\nIt is a possible workaround for when devices don't support bundle preloading. We'll use this if we see a need.\n\n## Implementation\n\n### Bundle graph\n\nFor each bundle, we have a list of probabilities for other bundles. We encode these as a list of numbers and call it the **bundle graph**: a positive number is the index of the dependency, and a negative number is the probability times `-10` and applies to the bundles following it. For example, `['foo', 'bar', 'myBundle', 0, -6, 1]` means that the bundles `foo` and `bar` don't import anything, and importing `myBundle` gives a 100% chance to import `foo` (meaning it's a direct import) and a 60% chance to import `bar`.\n\nThis is made at build time. For dynamic imports, we have to guess the probability of the bundle if it is not provided by Insights.\n\nA bundle has many origins. The probability is the highest of the probabilities of the origins.\n\nSome examples of factors influencing the probability:\n\n- a `component$` will be 100% likely to import its own hook qrls\n- ...\n\n### Runtime probability\n\nAll bundles start with no probability, meaning their inverse probability `iP` is `1`.\n\nSuppose we think a bundle has a 60% chance of being needed. This updates its `iP` to `0.4` and all its imports get their `iP` multiplied by `(1 - 0.6 * probability)`.\n\nWhen the bundle gets imported, this changes to 100%, `iP = 0`. This again updates it and all its imports. However, the imports were already adjusted, so the `iP` of the imports is now multiplied by `(1 - 1 * probability)/(1 - 0.6 * probability)`.\n\nIn other words, when you change the `iP` of a bundle, you have to adjust the `iP` of all its imports by `( 1 - (1 - iP)*probability)/(1 - (1 - prevIP)*probability)`.\n\n### SSR\n\nWe have early preloading, by adding `<link rel=\"bundlepreload\">` tags to the SSR response. This should be used only for the bundles that are almost certain to be needed.\n\nThen, we inject a script tag that imports the preloader and passes the list of likely needed bundles to it. This list depends on the SSR result.\n\nNote that the preloader is a small bundle in a separate bundle that is also imported by Qwik itself, so its state is available instantly. Qwik can then request preloading for QRL segments etc. We tell the bundler to make sure to keep the preloader in a separate bundle.\n\nOnce the preloader is loaded, it will start downloading the bundles in the background in order of their score. It also downloads the bundle graph as soon as possible.\n\n### QRL preloading\n\nWhen a QRL is created, we tell the preloader about the symbol having a 60% chance.\nWhen a it is called, we change the probability to 100%.\n\n### Link preloading\n\nWhen a Link is visible and preload is requested, we preload its route destination. The Qwik Router and Insights plugins will have added these to the bundle graph. The scoring could also use the popularity of target page, but this is not implemented yet.\n\n### Actually preloading\n\nWhen a bundle's `iP` is below `1`, we put it in a sorted set. Our first naive implementation will just sort the array of desired bundles by increasing `iP`.\n\nThe lower the `iP`, the more urgent the preload is. For bundles with `iP < 0.05`, we preload all. For the rest, we take the number of active preloads. If `preloadCount < 2 + 20 * (1 - iP)`, we preload it.\n"
  },
  {
    "path": "packages/qwik/src/server/qwik.server.api.md",
    "content": "## API Report File for \"@builder.io/qwik\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { QwikManifest } from '@builder.io/qwik/optimizer';\nimport type { ResolvedManifest } from '@builder.io/qwik/optimizer';\nimport type { ServerQwikManifest } from '@builder.io/qwik/optimizer';\nimport type { SnapshotResult } from '@builder.io/qwik';\nimport type { StreamWriter } from '@builder.io/qwik';\nimport type { SymbolMapperFn } from '@builder.io/qwik/optimizer';\n\n// @public\nexport function getQwikLoaderScript(opts?: {\n    debug?: boolean;\n}): string;\n\n// @public\nexport function getQwikPrefetchWorkerScript(opts?: {\n    debug?: boolean;\n}): string;\n\n// @public (undocumented)\nexport interface InOrderAuto {\n    // (undocumented)\n    maximunChunk?: number;\n    // (undocumented)\n    maximunInitialChunk?: number;\n    // (undocumented)\n    strategy: 'auto';\n}\n\n// @public (undocumented)\nexport interface InOrderDisabled {\n    // (undocumented)\n    strategy: 'disabled';\n}\n\n// Warning: (ae-forgotten-export) The symbol \"InOrderDirect\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;\n\n// @public @deprecated (undocumented)\nexport interface PrefetchImplementation {\n    // @deprecated (undocumented)\n    linkFetchPriority?: 'auto' | 'low' | 'high' | null;\n    // @deprecated (undocumented)\n    linkInsert?: 'js-append' | 'html-append' | null;\n    // @deprecated (undocumented)\n    linkRel?: 'prefetch' | 'preload' | 'modulepreload' | null;\n    // @deprecated (undocumented)\n    prefetchEvent?: 'always' | null;\n    // @deprecated (undocumented)\n    workerFetchInsert?: 'always' | 'no-link-support' | null;\n}\n\n// @public (undocumented)\nexport interface PrefetchResource {\n    // (undocumented)\n    imports: PrefetchResource[];\n    // (undocumented)\n    url: string;\n}\n\n// @public (undocumented)\nexport interface PrefetchStrategy {\n    // (undocumented)\n    implementation?: PrefetchImplementation;\n    // (undocumented)\n    symbolsToPrefetch?: SymbolsToPrefetch;\n}\n\n// @public (undocumented)\nexport interface PreloaderOptions {\n    debug?: boolean;\n    maxIdlePreloads?: number;\n    // @deprecated (undocumented)\n    preloadProbability?: number;\n    ssrPreloadProbability?: number;\n    ssrPreloads?: number;\n}\n\n// @public (undocumented)\nexport type QwikLoaderOptions = 'module' | 'inline' | 'never' | {\n    include?: 'always' | 'never' | 'auto';\n    position?: 'top' | 'bottom';\n};\n\n// @public (undocumented)\nexport type Render = RenderToString | RenderToStream;\n\n// @public (undocumented)\nexport interface RenderOptions extends SerializeDocumentOptions {\n    base?: string | ((options: RenderOptions) => string);\n    // (undocumented)\n    containerAttributes?: Record<string, string>;\n    containerTagName?: string;\n    locale?: string | ((options: RenderOptions) => string);\n    // @deprecated (undocumented)\n    prefetchStrategy?: PrefetchStrategy | null;\n    preloader?: PreloaderOptions | false;\n    qwikLoader?: QwikLoaderOptions;\n    // Warning: (ae-forgotten-export) The symbol \"QwikPrefetchServiceWorkerOptions\" needs to be exported by the entry point index.d.ts\n    //\n    // @deprecated (undocumented)\n    qwikPrefetchServiceWorker?: QwikPrefetchServiceWorkerOptions;\n    // (undocumented)\n    serverData?: Record<string, any>;\n    snapshot?: boolean;\n}\n\n// @public (undocumented)\nexport interface RenderResult {\n    // (undocumented)\n    isStatic: boolean;\n    // (undocumented)\n    manifest?: ServerQwikManifest;\n    // (undocumented)\n    prefetchResources: PrefetchResource[];\n    // (undocumented)\n    snapshotResult: SnapshotResult | undefined;\n}\n\n// @public (undocumented)\nexport type RenderToStream = (opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;\n\n// @public\nexport function renderToStream(rootNode: any, opts: RenderToStreamOptions): Promise<RenderToStreamResult>;\n\n// @public (undocumented)\nexport interface RenderToStreamOptions extends RenderOptions {\n    // (undocumented)\n    stream: StreamWriter;\n    // (undocumented)\n    streaming?: StreamingOptions;\n}\n\n// @public (undocumented)\nexport interface RenderToStreamResult extends RenderResult {\n    // (undocumented)\n    flushes: number;\n    // (undocumented)\n    size: number;\n    // (undocumented)\n    timing: {\n        firstFlush: number;\n        render: number;\n        snapshot: number;\n    };\n}\n\n// @public (undocumented)\nexport type RenderToString = (opts: RenderToStringOptions) => Promise<RenderToStringResult>;\n\n// @public\nexport function renderToString(rootNode: any, opts?: RenderToStringOptions): Promise<RenderToStringResult>;\n\n// @public (undocumented)\nexport interface RenderToStringOptions extends RenderOptions {\n}\n\n// @public (undocumented)\nexport interface RenderToStringResult extends RenderResult {\n    // (undocumented)\n    html: string;\n    // (undocumented)\n    timing: {\n        render: number;\n        snapshot: number;\n    };\n}\n\n// Warning: (ae-forgotten-export) The symbol \"ResolvedManifest_2\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport function resolveManifest(manifest?: Partial<QwikManifest | ResolvedManifest_2> | undefined): ResolvedManifest_2 | undefined;\n\n// @public (undocumented)\nexport interface SerializeDocumentOptions {\n    // (undocumented)\n    debug?: boolean;\n    // (undocumented)\n    manifest?: Partial<QwikManifest | ResolvedManifest>;\n    // (undocumented)\n    symbolMapper?: SymbolMapperFn;\n}\n\n// @public (undocumented)\nexport function setServerPlatform(manifest?: Partial<QwikManifest | ResolvedManifest>): Promise<void>;\n\n// @public (undocumented)\nexport interface StreamingOptions {\n    // (undocumented)\n    inOrder?: InOrderStreaming;\n}\n\n// @public\nexport type SymbolsToPrefetch = 'auto' | ((opts: {\n    manifest: ServerQwikManifest;\n}) => PrefetchResource[]);\n\n// @public (undocumented)\nexport const versions: {\n    readonly qwik: string;\n    readonly qwikDom: string;\n};\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik/src/server/render.ts",
    "content": "import type { SnapshotResult } from '@builder.io/qwik';\nimport { _pauseFromContexts, _renderSSR, Fragment, jsx, type JSXNode } from '@builder.io/qwik';\nimport { isDev } from '@builder.io/qwik';\nimport type { QContext } from '../core/state/context';\nimport { QInstance } from '../core/util/markers';\nimport type { ResolvedManifest, SymbolMapper } from '../optimizer/src/types';\nimport { getSymbolHash, setServerPlatform } from './platform';\nimport { preloaderPre, preloaderPost } from './preload-impl';\nimport { getQwikLoaderScript } from './scripts';\nimport type {\n  QwikManifest,\n  RenderToStreamOptions,\n  RenderToStreamResult,\n  RenderToStringOptions,\n  RenderToStringResult,\n  StreamWriter,\n} from './types';\nimport { createTimer, getBuildBase } from './utils';\nimport { manifest as builtManifest } from '@qwik-client-manifest';\n\nconst DOCTYPE = '<!DOCTYPE html>';\n\nenum QwikLoaderInclude {\n  Module,\n  Inline,\n  Never,\n}\n\n/**\n * Creates a server-side `document`, renders to root node to the document, then serializes the\n * document to a string.\n *\n * @public\n */\nexport async function renderToStream(\n  rootNode: any,\n  opts: RenderToStreamOptions\n): Promise<RenderToStreamResult> {\n  let stream = opts.stream;\n  let bufferSize = 0;\n  let totalSize = 0;\n  let networkFlushes = 0;\n  let firstFlushTime = 0;\n  let buffer: string = '';\n  let snapshotResult: SnapshotResult | undefined;\n  const inOrderStreaming = opts.streaming?.inOrder ?? {\n    strategy: 'auto',\n    maximunInitialChunk: 50000,\n    maximunChunk: 30000,\n  };\n  const containerTagName = opts.containerTagName ?? 'html';\n  const containerAttributes = opts.containerAttributes ?? {};\n  const nativeStream = stream;\n  const firstFlushTimer = createTimer();\n  const buildBase = getBuildBase(opts);\n  const resolvedManifest = resolveManifest(opts.manifest);\n  const nonce = opts.serverData?.nonce;\n  function flush() {\n    if (buffer) {\n      nativeStream.write(buffer);\n      buffer = '';\n      bufferSize = 0;\n      networkFlushes++;\n      if (networkFlushes === 1) {\n        firstFlushTime = firstFlushTimer();\n      }\n    }\n  }\n  function enqueue(chunk: string) {\n    const len = chunk.length;\n    bufferSize += len;\n    totalSize += len;\n    buffer += chunk;\n  }\n  switch (inOrderStreaming.strategy) {\n    case 'disabled':\n      stream = {\n        write: enqueue,\n      };\n      break;\n    case 'direct':\n      stream = nativeStream;\n      break;\n    case 'auto':\n      let count = 0;\n      let forceFlush = false;\n      const minimunChunkSize = inOrderStreaming.maximunChunk ?? 0;\n      const initialChunkSize = inOrderStreaming.maximunInitialChunk ?? 0;\n      stream = {\n        write(chunk) {\n          if (chunk === '<!--qkssr-f-->') {\n            forceFlush ||= true;\n          } else if (chunk === '<!--qkssr-pu-->') {\n            count++;\n          } else if (chunk === '<!--qkssr-po-->') {\n            count--;\n          } else {\n            enqueue(chunk);\n          }\n          const chunkSize = networkFlushes === 0 ? initialChunkSize : minimunChunkSize;\n          if (count === 0 && (forceFlush || bufferSize >= chunkSize)) {\n            forceFlush = false;\n            flush();\n          }\n        },\n      };\n      break;\n  }\n\n  if (containerTagName === 'html') {\n    stream.write(DOCTYPE);\n  } else {\n    stream.write('<!--cq-->');\n  }\n\n  if (!resolvedManifest && !isDev) {\n    console.warn(\n      `Missing client manifest, loading symbols in the client might 404. Please ensure the client build has run and generated the manifest for the server build.`\n    );\n  }\n  await setServerPlatform(opts, resolvedManifest);\n\n  const injections = resolvedManifest?.manifest.injections;\n  const beforeContent = injections\n    ? injections.map((injection) => jsx(injection.tag, injection.attributes ?? {}))\n    : [];\n\n  let includeMode = opts.qwikLoader\n    ? typeof opts.qwikLoader === 'object'\n      ? opts.qwikLoader.include === 'never'\n        ? QwikLoaderInclude.Never\n        : QwikLoaderInclude.Module\n      : opts.qwikLoader === 'inline'\n        ? QwikLoaderInclude.Inline\n        : opts.qwikLoader === 'never'\n          ? QwikLoaderInclude.Never\n          : QwikLoaderInclude.Module\n    : QwikLoaderInclude.Module;\n  const qwikLoaderChunk = resolvedManifest?.manifest.qwikLoader;\n  if (includeMode === QwikLoaderInclude.Module && !qwikLoaderChunk) {\n    includeMode = QwikLoaderInclude.Inline;\n  }\n  if (includeMode === QwikLoaderInclude.Module) {\n    beforeContent.unshift(\n      jsx('link', {\n        rel: 'modulepreload',\n        href: `${buildBase}${qwikLoaderChunk}`,\n        nonce,\n      }),\n      jsx('script', {\n        type: 'module',\n        async: true,\n        src: `${buildBase}${qwikLoaderChunk}`,\n        nonce,\n      })\n    );\n  } else if (includeMode === QwikLoaderInclude.Inline) {\n    // It would be nice to keep track of HTML size and wait 30kB before inlining the script, skipping if ended and not needed.\n    const qwikLoaderScript = getQwikLoaderScript({\n      debug: opts.debug,\n    });\n    beforeContent.unshift(\n      jsx('script', {\n        id: 'qwikloader',\n        // Qwik only works when modules work\n        type: 'module',\n        // Execute asap, don't wait for domcontentloaded\n        async: true,\n        nonce,\n        dangerouslySetInnerHTML: qwikLoaderScript,\n      })\n    );\n  }\n  preloaderPre(buildBase, resolvedManifest, opts.preloader, beforeContent, nonce);\n\n  const renderTimer = createTimer();\n  const renderSymbols: string[] = [];\n  let renderTime = 0;\n  let snapshotTime = 0;\n\n  await _renderSSR(rootNode, {\n    stream,\n    containerTagName,\n    containerAttributes,\n    serverData: opts.serverData,\n    base: buildBase,\n    beforeContent,\n    beforeClose: async (contexts, containerState, _dynamic, textNodes) => {\n      renderTime = renderTimer();\n      const snapshotTimer = createTimer();\n\n      snapshotResult = await _pauseFromContexts(contexts, containerState, undefined, textNodes);\n\n      const children: (JSXNode | null)[] = [];\n\n      preloaderPost(buildBase, snapshotResult, opts, resolvedManifest, children);\n\n      const jsonData = JSON.stringify(snapshotResult.state, undefined, isDev ? '  ' : undefined);\n      children.push(\n        jsx('script', {\n          type: 'qwik/json',\n          dangerouslySetInnerHTML: escapeText(jsonData),\n          nonce,\n        })\n      );\n      if (snapshotResult.funcs.length > 0) {\n        const hash = containerAttributes[QInstance];\n        children.push(\n          jsx('script', {\n            'q:func': 'qwik/json',\n            dangerouslySetInnerHTML: serializeFunctions(hash, snapshotResult.funcs),\n            nonce,\n          })\n        );\n      }\n\n      // We emit the events separately so other qwikloaders can see them\n      const extraListeners = Array.from(containerState.$events$, (s) => JSON.stringify(s));\n      if (extraListeners.length > 0) {\n        const content = `(window.qwikevents||(window.qwikevents=[])).push(${extraListeners.join(',')})`;\n        children.push(\n          jsx('script', {\n            dangerouslySetInnerHTML: content,\n            nonce,\n          })\n        );\n      }\n\n      collectRenderSymbols(renderSymbols, contexts as QContext[]);\n      snapshotTime = snapshotTimer();\n      return jsx(Fragment, { children });\n    },\n    manifestHash: resolvedManifest?.manifest.manifestHash || 'dev' + hash(),\n  });\n\n  // End of container\n  if (containerTagName !== 'html') {\n    stream.write('<!--/cq-->');\n  }\n\n  // Flush remaining chunks in the buffer\n  flush();\n\n  const isDynamic = snapshotResult!.resources.some((r) => r._cache !== Infinity);\n  const result: RenderToStreamResult = {\n    prefetchResources: undefined as any,\n    snapshotResult,\n    flushes: networkFlushes,\n    manifest: resolvedManifest?.manifest,\n    size: totalSize,\n    isStatic: !isDynamic,\n    timing: {\n      render: renderTime,\n      snapshot: snapshotTime,\n      firstFlush: firstFlushTime,\n    },\n  };\n  return result;\n}\n\nfunction hash() {\n  return Math.random().toString(36).slice(2);\n}\n\n/**\n * Creates a server-side `document`, renders to root node to the document, then serializes the\n * document to a string.\n *\n * @public\n */\nexport async function renderToString(\n  rootNode: any,\n  opts: RenderToStringOptions = {}\n): Promise<RenderToStringResult> {\n  const chunks: string[] = [];\n  const stream: StreamWriter = {\n    write(chunk) {\n      chunks.push(chunk);\n    },\n  };\n\n  const result = await renderToStream(rootNode, {\n    base: opts.base,\n    containerAttributes: opts.containerAttributes,\n    containerTagName: opts.containerTagName,\n    locale: opts.locale,\n    manifest: opts.manifest,\n    symbolMapper: opts.symbolMapper,\n    qwikLoader: opts.qwikLoader,\n    serverData: opts.serverData,\n    prefetchStrategy: opts.prefetchStrategy,\n    stream,\n  });\n  return {\n    isStatic: result.isStatic,\n    prefetchResources: result.prefetchResources,\n    timing: result.timing,\n    manifest: result.manifest,\n    snapshotResult: result.snapshotResult,\n    html: chunks.join(''),\n  };\n}\n\n/**\n * Merges a given manifest with the built manifest and provides mappings for symbols.\n *\n * @public\n */\nexport function resolveManifest(\n  manifest?: Partial<QwikManifest | ResolvedManifest> | undefined\n): ResolvedManifest | undefined {\n  const mergedManifest = (manifest ? { ...builtManifest, ...manifest } : builtManifest) as\n    | ResolvedManifest\n    | QwikManifest;\n\n  if (!mergedManifest || 'mapper' in mergedManifest) {\n    return mergedManifest;\n  }\n  if (mergedManifest!.mapping) {\n    const mapper: SymbolMapper = {};\n    Object.entries(mergedManifest.mapping).forEach(([symbol, bundleFilename]) => {\n      mapper[getSymbolHash(symbol)] = [symbol, bundleFilename];\n    });\n    return {\n      mapper,\n      manifest: mergedManifest,\n      injections: mergedManifest.injections || [],\n    };\n  }\n  return undefined;\n}\n\nconst escapeText = (str: string) => {\n  return str.replace(/<(\\/?script)/gi, '\\\\x3C$1');\n};\n\nfunction collectRenderSymbols(renderSymbols: string[], elements: QContext[]) {\n  // TODO: Move to snapshot result\n  for (const ctx of elements) {\n    const symbol = ctx.$componentQrl$?.getSymbol();\n    if (symbol && !renderSymbols.includes(symbol)) {\n      renderSymbols.push(symbol);\n    }\n  }\n}\n\nexport const Q_FUNCS_PREFIX = 'document[\"qFuncs_HASH\"]=';\n\nfunction serializeFunctions(hash: string, funcs: string[]) {\n  return Q_FUNCS_PREFIX.replace('HASH', hash) + `[${funcs.join(',\\n')}]`;\n}\n"
  },
  {
    "path": "packages/qwik/src/server/scripts.ts",
    "content": "const QWIK_LOADER_DEFAULT_MINIFIED: string = (globalThis as any).QWIK_LOADER_DEFAULT_MINIFIED;\nconst QWIK_LOADER_DEFAULT_DEBUG: string = (globalThis as any).QWIK_LOADER_DEFAULT_DEBUG;\n\n/**\n * Provides the `qwikloader.js` file as a string. Useful for tooling to inline the qwikloader script\n * into HTML.\n *\n * @public\n */\nexport function getQwikLoaderScript(opts: { debug?: boolean } = {}) {\n  // default script selector behavior\n  return opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;\n}\n\nconst QWIK_PREFETCH_MINIFIED: string = (globalThis as any).QWIK_PREFETCH_MINIFIED;\nconst QWIK_PREFETCH_DEBUG: string = (globalThis as any).QWIK_PREFETCH_DEBUG;\n\n/**\n * Provides the `qwik-prefetch-service-worker.js` file as a string. Useful for tooling to inline the\n * qwik-prefetch-service-worker script into HTML.\n *\n * @public\n */\nexport function getQwikPrefetchWorkerScript(opts: { debug?: boolean } = {}) {\n  return opts.debug ? QWIK_PREFETCH_DEBUG : QWIK_PREFETCH_MINIFIED;\n}\n"
  },
  {
    "path": "packages/qwik/src/server/server-modules.d.ts",
    "content": "declare module '@qwik-client-manifest' {\n  const manifest: import('.').ServerQwikManifest;\n  export { manifest };\n}\n// MD\ndeclare module '*.md' {\n  const node: import('.').FunctionComponent;\n  export const frontmatter: Record<string, any>;\n  export default node;\n}\n// MDX\ndeclare module '*.mdx' {\n  const node: import('.').FunctionComponent;\n  export const frontmatter: Record<string, any>;\n  export default node;\n}\n// SVG ?jsx\ndeclare module '*.svg?jsx' {\n  const Cmp: import('.').FunctionComponent<import('.').QwikIntrinsicElements['svg']>;\n  export default Cmp;\n}\n// Image ?jsx\ndeclare module '*?jsx' {\n  const Cmp: import('.').FunctionComponent<\n    Omit<import('.').QwikIntrinsicElements['img'], 'src' | 'width' | 'height' | 'srcSet'>\n  >;\n  export default Cmp;\n  export const width: number;\n  export const height: number;\n  export const srcSet: string;\n}\n// Image &jsx\ndeclare module '*&jsx' {\n  const Cmp: import('.').FunctionComponent<\n    Omit<import('.').QwikIntrinsicElements['img'], 'src' | 'width' | 'height' | 'srcSet'>\n  >;\n  export default Cmp;\n  export const width: number;\n  export const height: number;\n  export const srcSet: string;\n}\n"
  },
  {
    "path": "packages/qwik/src/server/types.ts",
    "content": "import type { SnapshotResult, StreamWriter } from '@builder.io/qwik';\nimport type {\n  QwikManifest,\n  ServerQwikManifest,\n  ResolvedManifest,\n  SymbolMapper,\n  SymbolMapperFn,\n} from '@builder.io/qwik/optimizer';\n\n/** @public */\nexport interface SerializeDocumentOptions {\n  manifest?: Partial<QwikManifest | ResolvedManifest>;\n  symbolMapper?: SymbolMapperFn;\n  debug?: boolean;\n}\n\n/** @public */\nexport interface PrefetchStrategy {\n  implementation?: PrefetchImplementation;\n  symbolsToPrefetch?: SymbolsToPrefetch;\n}\n\n/** @public */\nexport interface PreloaderOptions {\n  /**\n   * Maximum number of preload links to add during SSR. These instruct the browser to preload likely\n   * bundles before the preloader script is active. This most likely includes the core and the\n   * preloader script itself. Setting this to 0 will disable all preload links.\n   *\n   * Preload links can delay LCP, which is a Core Web Vital, but it can increase TTI, which is not a\n   * Core Web Vital but more noticeable to the user.\n   *\n   * Defaults to `5`\n   */\n  ssrPreloads?: number;\n  /**\n   * The minimum probability for a bundle to be added as a preload link during SSR.\n   *\n   * Defaults to `0.7` (70% probability)\n   *\n   * This makes sure that the most likely bundles are preloaded ahead of time.\n   */\n  ssrPreloadProbability?: number;\n  /**\n   * Log preloader debug information to the console.\n   *\n   * Defaults to `false`\n   */\n  debug?: boolean;\n  /**\n   * Maximum number of simultaneous preload links that the preloader will maintain. If you set this\n   * higher, the browser will have all JS files in memory sooner, but it will contend with other\n   * resource downloads. Furthermore, if a bundle suddenly becomes more likely, it will have to wait\n   * longer to be preloaded.\n   *\n   * Bundles that reach 100% probability (static imports of other bundles) will always be preloaded\n   * immediately, no limit.\n   *\n   * Defaults to `25`\n   */\n  maxIdlePreloads?: number;\n  /**\n   * @deprecated The minimum probability for a bundle to be added to the preload queue.\n   *\n   *   Defaulted to `0.35` (35% probability).\n   *\n   *   Deprecated because this could cause performance issues with bundles fetched on on click instead\n   *   of being preloaded ahead of time.\n   */\n  preloadProbability?: number;\n}\n\n/** @public @deprecated Use `preloader` instead */\nexport interface PrefetchImplementation {\n  /** @deprecated No longer used. */\n  linkRel?: 'prefetch' | 'preload' | 'modulepreload' | null;\n  /** @deprecated No longer used. */\n  linkFetchPriority?: 'auto' | 'low' | 'high' | null;\n  /** @deprecated No longer used. */\n  linkInsert?: 'js-append' | 'html-append' | null;\n  /** @deprecated No longer used. */\n  workerFetchInsert?: 'always' | 'no-link-support' | null;\n  /** @deprecated No longer used. */\n  prefetchEvent?: 'always' | null;\n}\n\n/**\n * Auto: Prefetch all possible QRLs used by the document. Default\n *\n * @public\n */\nexport type SymbolsToPrefetch =\n  | 'auto'\n  | ((opts: { manifest: ServerQwikManifest }) => PrefetchResource[]);\n\n/** @public */\nexport interface PrefetchResource {\n  url: string;\n  imports: PrefetchResource[];\n}\n\n/** @public */\nexport interface RenderToStreamResult extends RenderResult {\n  flushes: number;\n  size: number;\n  timing: {\n    firstFlush: number;\n    render: number;\n    snapshot: number;\n  };\n}\n\n/** @public */\nexport interface RenderToStringResult extends RenderResult {\n  html: string;\n  timing: {\n    render: number;\n    snapshot: number;\n  };\n}\n\n/** @public */\nexport interface RenderResult {\n  prefetchResources: PrefetchResource[];\n  snapshotResult: SnapshotResult | undefined;\n  isStatic: boolean;\n  manifest?: ServerQwikManifest;\n}\n\n/** @public */\nexport type QwikLoaderOptions =\n  | 'module'\n  | 'inline'\n  | 'never'\n  | {\n      /** @deprecated No longer used. */\n      include?: 'always' | 'never' | 'auto';\n      /** @deprecated No longer used. */\n      position?: 'top' | 'bottom';\n    };\n\n/**\n * @deprecated This is no longer used as the preloading happens automatically in qrl-class.ts.\n * @public\n */\nexport interface QwikPrefetchServiceWorkerOptions {\n  /** @deprecated This is no longer used as the preloading happens automatically in qrl-class.ts. */\n  include?: boolean;\n  /** @deprecated This is no longer used as the preloading happens automatically in qrl-class.ts. */\n  position?: 'top' | 'bottom';\n}\n\n/** @public */\nexport interface RenderOptions extends SerializeDocumentOptions {\n  /** Defaults to `true` */\n  snapshot?: boolean;\n\n  /**\n   * Specifies the root of the JS files of the client build. Setting a base, will cause the render\n   * of the `q:base` attribute in the `q:container` element.\n   */\n  base?: string | ((options: RenderOptions) => string);\n\n  /** Language to use when rendering the document. */\n  locale?: string | ((options: RenderOptions) => string);\n\n  /**\n   * Specifies how the Qwik Loader is included in the document. This enables interactivity and lazy\n   * loading.\n   *\n   * `module`: Use a `<script>` tag to load the Qwik Loader. Subsequent page loads will have the\n   * script cached and instantly running.\n   *\n   * `inline`: This embeds the Qwik Loader script directly in the document. This adds about 3kB\n   * before compression, which typically is reduced to about 1.6kB with gzip.\n   *\n   * `never`: Do not include the Qwik Loader script. This is mostly useful when embedding multiple\n   * containers on the same page.\n   *\n   * Defaults to `module`.\n   *\n   * Note that the Qwik Loader is absolutely required for Qwik to work. There must be an instance of\n   * it loaded for any interactivity to happen.\n   */\n  qwikLoader?: QwikLoaderOptions;\n\n  /** Specifies how preloading is handled. This ensures that code is instantly available when needed. */\n  preloader?: PreloaderOptions | false;\n\n  /** @deprecated Use `preloader` instead */\n  qwikPrefetchServiceWorker?: QwikPrefetchServiceWorkerOptions;\n\n  /** @deprecated Use `preloader` instead */\n  prefetchStrategy?: PrefetchStrategy | null;\n\n  /**\n   * When set, the app is serialized into a fragment. And the returned html is not a complete\n   * document. Defaults to `html`\n   */\n  containerTagName?: string;\n  containerAttributes?: Record<string, string>;\n  serverData?: Record<string, any>;\n}\n\n/** @public */\nexport interface RenderToStringOptions extends RenderOptions {}\n\n/** @public */\nexport interface InOrderAuto {\n  strategy: 'auto';\n  maximunInitialChunk?: number;\n  maximunChunk?: number;\n}\n\n/** @public */\nexport interface InOrderDisabled {\n  strategy: 'disabled';\n}\n\n/** @public */\nexport interface InOrderDirect {\n  strategy: 'direct';\n}\n\n/** @public */\nexport type InOrderStreaming = InOrderAuto | InOrderDisabled | InOrderDirect;\n\n/** @public */\nexport interface StreamingOptions {\n  inOrder?: InOrderStreaming;\n}\n\n/** @public */\nexport interface RenderToStreamOptions extends RenderOptions {\n  stream: StreamWriter;\n  streaming?: StreamingOptions;\n}\n\n/** @public */\nexport type RenderToString = (opts: RenderToStringOptions) => Promise<RenderToStringResult>;\n\n/** @public */\nexport type RenderToStream = (opts: RenderToStreamOptions) => Promise<RenderToStreamResult>;\n\n/** @public */\nexport type Render = RenderToString | RenderToStream;\n\nexport type { QwikManifest, ServerQwikManifest, SnapshotResult, StreamWriter, SymbolMapper };\n"
  },
  {
    "path": "packages/qwik/src/server/utils.ts",
    "content": "import type { RenderToStringOptions } from './types';\n\n/**\n * Utility timer function for performance profiling. Returns a duration of 0 in environments that do\n * not support performance.\n */\nexport function createTimer() {\n  if (typeof performance === 'undefined') {\n    return () => 0;\n  }\n  const start = performance.now();\n  return () => {\n    const end = performance.now();\n    const delta = end - start;\n    return delta / 1000000;\n  };\n}\n\nexport function getBuildBase(opts: RenderToStringOptions) {\n  let base = opts.base;\n  if (typeof opts.base === 'function') {\n    base = opts.base(opts);\n  }\n  if (typeof base === 'string') {\n    if (!base.endsWith('/')) {\n      base += '/';\n    }\n    return base;\n  }\n  return `${import.meta.env.BASE_URL || '/'}build/`;\n}\n\n/** @public */\nexport const versions = {\n  qwik: (globalThis as any).QWIK_VERSION as string,\n  qwikDom: (globalThis as any).QWIK_DOM_VERSION as string,\n} as const;\n"
  },
  {
    "path": "packages/qwik/src/testing/README.md",
    "content": "### @builder.io/qwik/testing\n\n```ts\n//vite.config.ts\nimport { defineConfig } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport { qwikCity } from '@builder.io/qwik-city/vite';\nimport tsconfigPaths from 'vite-tsconfig-paths';\n\nexport default defineConfig(() => {\n  return {\n    plugins: [qwikCity(), qwikVite(), tsconfigPaths()],\n    define: {\n      'globalThis.qTest': true,\n      'globalThis.qDev': true,\n    },\n  };\n});\n```\n\n```jsx\n// card.test.tsx\n\nimport { createDOM } from '@builder.io/qwik/testing';\nimport { test, expect } from 'vitest';\nimport Card from './card.tsx';\n\ntest(`[Card Component]: 🙌 Only render`, async () => {\n  const { screen, render } = await await createDOM();\n  await render(<Card />);\n  expect(screen.outerHTML).toContain('Counter_0');\n});\n\ntest(`[Card Component]: 🙌 Click counter +1 `, async () => {\n  const { screen, render, userEvent } = await await createDOM();\n  await render(<Card />);\n  expect(screen.outerHTML).toContain('Counter_0');\n  await userEvent('button.btn-counter', 'click');\n  expect(screen.outerHTML).toContain('Counter_1');\n});\n```\n"
  },
  {
    "path": "packages/qwik/src/testing/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik/src/testing/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik.testing\",\n    \"reportFolder\": \"<projectFolder>/src/testing/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/testing/\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/dist/testing/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik/testing/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik/src/testing/document.ts",
    "content": "import type { MockDocumentOptions, MockWindow } from './types';\nimport domino from 'domino';\nimport { normalizeUrl } from './util';\n\n/**\n * Create emulated `Document` for server environment. Does not implement the full browser `document`\n * and `window` API. This api may be removed in the future.\n *\n * @public\n */\nexport function createDocument(opts?: MockDocumentOptions) {\n  const doc = domino.createDocument(opts?.html);\n  ensureGlobals(doc, opts);\n  return doc;\n}\n\n/**\n * Create emulated `window` useful for testing.\n *\n * @public\n */\nexport function createWindow(opts: MockDocumentOptions = {}): MockWindow {\n  return createDocument(opts).defaultView!;\n}\n\nexport function ensureGlobals(doc: any, opts?: MockDocumentOptions) {\n  if (doc && doc[QWIK_DOC]) {\n    return doc.defaultView;\n  }\n\n  if (!doc || doc.nodeType !== 9) {\n    throw new Error(`Invalid document`);\n  }\n\n  doc[QWIK_DOC] = true;\n\n  const loc = normalizeUrl(opts?.url);\n\n  Object.defineProperty(doc, 'baseURI', {\n    get: () => loc.href,\n    set: (url: string) => (loc.href = normalizeUrl(url).href),\n  });\n\n  doc.defaultView = {\n    get document() {\n      return doc;\n    },\n    get location() {\n      return loc;\n    },\n    get origin() {\n      return loc.origin;\n    },\n    addEventListener: noop,\n    removeEventListener: noop,\n    history: {\n      pushState: noop,\n      replaceState: noop,\n      go: noop,\n      back: noop,\n      forward: noop,\n    },\n    CustomEvent: class CustomEvent {\n      type: string;\n      constructor(type: string, details: any) {\n        Object.assign(this, details);\n        this.type = type;\n      }\n    },\n  };\n\n  return doc.defaultView;\n}\n\nconst noop = () => {};\n\nconst QWIK_DOC = Symbol();\n"
  },
  {
    "path": "packages/qwik/src/testing/document.unit.ts",
    "content": "import { createDocument, createWindow, ensureGlobals } from './document';\nimport { pathToFileURL } from 'node:url';\nimport { assert, test } from 'vitest';\n\ntest('should create document', () => {\n  const win = createWindow({\n    url: pathToFileURL(__filename),\n  });\n  assert.include(win.document.baseURI, 'file://');\n  assert.include(win.document.baseURI, 'document.unit.ts');\n});\n\ntest('noop history.go()', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.doesNotThrow(() => {\n    glb.history.go(1);\n  });\n});\n\ntest('noop history.back()', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.doesNotThrow(() => {\n    glb.history.back();\n  });\n});\n\ntest('noop history.forward()', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.doesNotThrow(() => {\n    glb.history.forward();\n  });\n});\n\ntest('noop history.replaceState()', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.doesNotThrow(() => {\n    glb.history.replaceState(null, '', '/url');\n  });\n});\n\ntest('noop history.pushState()', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.doesNotThrow(() => {\n    glb.history.pushState(null, '', '/url');\n  });\n});\n\ntest('noop addEventListener', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.doesNotThrow(() => {\n    glb.addEventListener('load', () => {});\n  });\n});\n\ntest('noop removeEventListener', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.doesNotThrow(() => {\n    glb.removeEventListener('load', () => {});\n  });\n});\n\ntest('baseURI', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, { url: 'http://my.qwik.dev/my-path' });\n  assert.equal(glb.document.baseURI, 'http://my.qwik.dev/my-path');\n\n  glb.document.baseURI = 'http://my.qwik.dev/new-path';\n  assert.equal(glb.document.baseURI, 'http://my.qwik.dev/new-path');\n});\n\ntest('location, no options', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.equal(glb.location.pathname, '/');\n\n  glb.location.pathname = '/new-path';\n  assert.equal(glb.location.pathname, '/new-path');\n});\n\ntest('location', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, { url: '/my-path' });\n  assert.equal(glb.location.pathname, '/my-path');\n});\n\ntest('origin, no options', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, {});\n  assert.equal(glb.origin, 'http://document.qwik.dev');\n});\n\ntest('origin', () => {\n  const glb = ensureGlobals({ nodeType: 9 }, { url: '/my-path' });\n  assert.equal(glb.origin, 'http://document.qwik.dev');\n});\n\ntest('invalid document', () => {\n  assert.throws(() => {\n    ensureGlobals({}, {});\n  });\n});\n\ntest('qwik server createDocument()', () => {\n  const doc = createDocument();\n  assert.notEqual(doc.defaultView, undefined);\n  assert.equal(doc.defaultView!.document, doc);\n});\n\ntest('qwik server createWindow()', () => {\n  const win = createWindow();\n  assert.notEqual(win.document.defaultView, undefined);\n  assert.equal(win.document.defaultView, win);\n});\n\ntest('some other document', () => {\n  const doc: any = {\n    nodeType: 9,\n  };\n  ensureGlobals(doc, {});\n  ensureGlobals(doc, {}); // shouldn't reset\n  assert.notEqual(doc.defaultView, undefined);\n  assert.equal(doc.defaultView.document, doc);\n});\n"
  },
  {
    "path": "packages/qwik/src/testing/element-fixture.ts",
    "content": "import { assertDefined } from '../core/error/assert';\nimport type { QRLInternal } from '../core/qrl/qrl-class';\nimport { tryGetContext, type QContext } from '../core/state/context';\nimport { normalizeOnProp } from '../core/state/listeners';\nimport { getWrappingContainer, type PossibleEvents } from '../core/use/use-core';\nimport { fromCamelToKebabCase } from '../core/util/case';\nimport { createWindow } from './document';\nimport { getTestPlatform } from './platform';\nimport type { MockDocument, MockWindow } from './types';\n\n/**\n * Creates a simple DOM structure for testing components.\n *\n * By default `EntityFixture` creates:\n *\n * ```html\n * <host q:view=\"./component_fixture.noop\">\n *   <child></child>\n * </host>\n * ```\n *\n * @public\n */\nexport class ElementFixture {\n  window: MockWindow;\n  document: MockDocument;\n  superParent: HTMLElement;\n  parent: HTMLElement;\n  host: HTMLElement;\n  child: HTMLElement;\n\n  constructor(options: ElementFixtureOptions = {}) {\n    this.window = createWindow();\n    this.document = this.window.document;\n    this.superParent = this.document.createElement('super-parent');\n    this.document.body.appendChild(this.superParent);\n    this.parent = this.document.createElement('parent');\n    this.superParent.appendChild(this.parent);\n    if (options.html) {\n      this.parent.innerHTML = options.html;\n      this.host = this.parent.firstElementChild as HTMLElement;\n      assertDefined(this.host, 'host element must be defined');\n      this.host.querySelectorAll('script[q\\\\:func=\"qwik/json\"]').forEach((script) => {\n        const code = script.textContent;\n        if (code?.match(Q_FUNCS_PREFIX)) {\n          const equal = code.indexOf('=');\n          const qFuncs = eval(code.substring(equal + 1));\n          const container = this.host.closest(QContainerSelector);\n          (container as any as { qFuncs?: Function[] }).qFuncs = qFuncs;\n        }\n      });\n      this.child = null!;\n    } else {\n      this.host = this.document.createElement(options.tagName || 'host');\n      this.child = this.document.createElement('child');\n      this.parent.appendChild(this.host);\n      this.host.appendChild(this.child);\n    }\n  }\n}\n\n/** @public */\nexport interface ElementFixtureOptions {\n  tagName?: string;\n  html?: string;\n}\n\n/**\n * Trigger an event in unit tests on an element.\n *\n * Future deprecation candidate.\n *\n * @param element\n * @param selector\n * @param event\n * @returns\n * @public\n */\nexport async function trigger(\n  root: Element,\n  queryOrElement: string | Element | keyof HTMLElementTagNameMap | null,\n  eventNameCamel: string,\n  eventPayload: any = {}\n): Promise<void> {\n  const elements =\n    typeof queryOrElement === 'string'\n      ? Array.from(root.querySelectorAll(queryOrElement))\n      : [queryOrElement];\n  for (const element of elements) {\n    const kebabEventName = fromCamelToKebabCase(eventNameCamel);\n    const event = root.ownerDocument.createEvent('Event');\n    event.initEvent(kebabEventName, true, true);\n    Object.assign(event, eventPayload);\n    const attrName = 'on:' + kebabEventName;\n    await dispatch(element, attrName, event);\n  }\n  await getTestPlatform().flush();\n}\n\nconst PREVENT_DEFAULT = 'preventdefault:';\nconst STOP_PROPAGATION = 'stoppropagation:';\nconst Q_FUNCS_PREFIX = /document.qdata\\[\"qFuncs_(.+)\"\\]=/;\nconst QContainerSelector = '[q\\\\:container]';\n\n/**\n * Dispatch\n *\n * @param element\n * @param attrName\n * @param event\n */\nexport const dispatch = async (element: Element | null, attrName: string, event: any) => {\n  const preventAttributeName = PREVENT_DEFAULT + event.type;\n  const stopPropagationName = STOP_PROPAGATION + event.type;\n  const collectListeners: { element: Element; qrl: QRLInternal }[] = [];\n  while (element) {\n    const preventDefault = element.hasAttribute(preventAttributeName);\n    const stopPropagation = element.hasAttribute(stopPropagationName);\n    if (preventDefault) {\n      event.preventDefault();\n    }\n    if (stopPropagation) {\n      event.stopPropagation();\n    }\n    const ctx = tryGetContext(element);\n    if (ctx) {\n      for (const li of ctx.li) {\n        if (li[0] === attrName) {\n          // Ensure this is correct event type\n          const qrl = li[1];\n          if (isSyncQrl(qrl)) {\n            qrl(event, element);\n          } else {\n            collectListeners.push({ element, qrl: qrl });\n          }\n        }\n      }\n    }\n    element = element.parentElement;\n  }\n  for (let i = 0; i < collectListeners.length; i++) {\n    const { element, qrl } = collectListeners[i];\n    await (qrl.getFn([element, event], () => element.isConnected) as Function)(event, element);\n  }\n};\nexport function getEvent(elCtx: QContext, prop: string): any {\n  return qPropReadQRL(elCtx, normalizeOnProp(prop));\n}\n\nexport function qPropReadQRL(elCtx: QContext, prop: string): ((event: Event) => void) | null {\n  const allListeners = elCtx.li;\n  const containerEl = getWrappingContainer(elCtx.$element$);\n  assertDefined(containerEl, 'container element must be defined');\n\n  return (event) => {\n    return Promise.all(\n      allListeners\n        .filter((li) => li[0] === prop)\n        .map(([_, qrl]) => {\n          qrl.$setContainer$(containerEl);\n          return qrl(event);\n        })\n    );\n  };\n}\nfunction isSyncQrl(qrl: QRLInternal<(event: PossibleEvents, elem?: Element | undefined) => any>) {\n  return qrl.$chunk$ == '';\n}\n"
  },
  {
    "path": "packages/qwik/src/testing/expect-dom.tsx",
    "content": "import { assert } from 'vitest';\nimport { QSlot } from '../core/util/markers';\nimport { isHtmlElement } from '../core/util/types';\nimport { format } from 'prettier';\n\n/**\n * Returns true if the `node` is `Element` and of the right `tagName`.\n *\n * @private\n * @param node\n */\nexport function isDomElementWithTagName(\n  node: Node | null | undefined,\n  tagName: string\n): node is Element {\n  return isHtmlElement(node) && node.tagName.toUpperCase() == tagName.toUpperCase();\n}\n\n/** @private */\nexport function isTemplateElement(node: Node | null | undefined): node is HTMLTemplateElement {\n  return isDomElementWithTagName(node, 'template');\n}\n\n/** @private */\nexport function isQSLotTemplateElement(node: Node | null | undefined): node is HTMLTemplateElement {\n  return isTemplateElement(node) && node.hasAttribute(QSlot);\n}\n\nexport async function expectDOM(actual: Element, expected: string) {\n  const options = { parser: 'html', htmlWhitespaceSensitivity: 'ignore' as const };\n  assert.equal(await format(actual.outerHTML, options), await format(expected, options));\n}\n"
  },
  {
    "path": "packages/qwik/src/testing/html.ts",
    "content": "export function isTemplate(node: Node | null | undefined): node is HTMLTemplateElement {\n  const tagName = (node && (node as Element).tagName) || '';\n  return tagName.toUpperCase() == 'TEMPLATE';\n}\n\nexport function prettyHtml(element: HTMLElement, prefix: string = ''): any {\n  const lines = [];\n  lines.push(prefix, '<', element.localName);\n  const attrs = element.attributes;\n  for (let i = 0; i < attrs.length; i++) {\n    const attr = attrs[i];\n    lines.push('\\n', prefix, '    ', attr.name, '=\"', attr.value, '\"');\n  }\n  lines.push('>');\n  let child = isTemplate(element) ? element.content.firstChild : element.firstChild;\n  while (child) {\n    if (isElement(child)) {\n      lines.push('\\n', prettyHtml(child, prefix + '  '));\n    } else {\n      lines.push('\\n', prefix, child.textContent);\n    }\n    child = child.nextSibling;\n  }\n  lines.push('\\n', prefix, '</', element.localName, '>');\n  return lines.join('');\n}\n\nexport function isElement(value: any): value is HTMLElement {\n  return isNode(value) && value.nodeType === 1;\n}\n\nexport function isNode(value: any): value is Node {\n  return value && typeof value.nodeType === 'number';\n}\n"
  },
  {
    "path": "packages/qwik/src/testing/index.ts",
    "content": "export { createDOM } from './library';\n"
  },
  {
    "path": "packages/qwik/src/testing/library.ts",
    "content": "import { ElementFixture, trigger } from './element-fixture';\nimport { setTestPlatform } from './platform';\nimport type { JSXOutput } from '@builder.io/qwik';\n\n/**\n * CreatePlatform and CreateDocument\n *\n * @public\n */\nexport const createDOM = async function ({ html }: { html?: string } = {}) {\n  const qwik = await getQwik();\n  setTestPlatform(qwik.setPlatform);\n  const host = new ElementFixture({ html }).host;\n  return {\n    render: function (jsxElement: JSXOutput) {\n      return qwik.render(host, jsxElement);\n    },\n    screen: host,\n    userEvent: async function (\n      queryOrElement: string | Element | keyof HTMLElementTagNameMap | null,\n      eventNameCamel: string | keyof WindowEventMap,\n      eventPayload: any = {}\n    ) {\n      return trigger(host, queryOrElement, eventNameCamel, eventPayload);\n    },\n  };\n};\n\nconst getQwik = async (): Promise<typeof import('@builder.io/qwik')> => {\n  if ((globalThis as any).RUNNER !== false) {\n    return await import('../core/index');\n  } else {\n    return await import('@builder.io/qwik');\n  }\n};\n"
  },
  {
    "path": "packages/qwik/src/testing/platform.ts",
    "content": "import type { TestPlatform } from './types';\nimport { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\n\nfunction createPlatform() {\n  interface Queue<T> {\n    fn: () => Promise<T>;\n    promise: Promise<T>;\n    resolve: (value: T) => void;\n    reject: (value: any) => void;\n  }\n\n  let render: Queue<any> | null = null;\n\n  const moduleCache = new Map<string, { [symbol: string]: any }>();\n  const testPlatform: TestPlatform = {\n    isServer: false,\n    importSymbol(containerEl, url, symbolName) {\n      if (!url) {\n        throw new Error('Missing URL');\n      }\n      if (!containerEl) {\n        throw new Error('Missing Container');\n      }\n      const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url);\n      const importPath = toPath(urlDoc);\n      const mod = moduleCache.get(importPath);\n      if (mod) {\n        if (!mod || !(symbolName in mod)) {\n          throw new Error(`Q-ERROR: missing symbol '${symbolName}' in module '${url}'.`);\n        }\n        return mod[symbolName];\n      }\n      return import(importPath).then((mod) => {\n        moduleCache.set(importPath, mod);\n        if (!mod || !(symbolName in mod)) {\n          throw new Error(`Q-ERROR: missing symbol '${symbolName}' in module '${url}'.`);\n        }\n        return mod[symbolName];\n      });\n    },\n    nextTick: (renderMarked) => {\n      if (!render) {\n        render = {\n          fn: renderMarked,\n          promise: null!,\n          resolve: null!,\n          reject: null!,\n        };\n        render.promise = new Promise((resolve, reject) => {\n          render!.resolve = resolve;\n          render!.reject = reject;\n        });\n      } else if (renderMarked !== render.fn) {\n        // TODO(misko): proper error and test\n        throw new Error('Must be same function');\n      }\n      return render.promise;\n    },\n    raf: (fn) => {\n      return new Promise((resolve) => {\n        // Do not use process.nextTick, as this will execute at same priority as promises.\n        // We need to execute after promises.\n        setTimeout(() => {\n          resolve(fn());\n        });\n      });\n    },\n    flush: async () => {\n      await Promise.resolve();\n      if (render) {\n        try {\n          render.resolve(await render.fn());\n        } catch (e) {\n          render.reject(e);\n        }\n        render = null;\n      }\n    },\n    chunkForSymbol() {\n      return undefined;\n    },\n  };\n  return testPlatform;\n}\n\nexport function setTestPlatform(_setPlatform: Function) {\n  _setPlatform(testPlatform);\n}\n\n/**\n * Convert relative base URI and relative URL into a fully qualified URL.\n *\n * @param base -`QRL`s are relative, and therefore they need a base for resolution.\n *\n *   - `Element` use `base.ownerDocument.baseURI`\n *   - `Document` use `base.baseURI`\n *   - `string` use `base` as is\n *   - `QConfig` use `base.baseURI`\n *\n * @param url - Relative URL\n * @returns Fully qualified URL.\n */\nexport function toUrl(doc: Document, containerEl: Element, url: string | URL): URL {\n  const base = new URL(containerEl?.getAttribute('q:base') ?? doc.baseURI, doc.baseURI);\n  return new URL(url, base);\n}\n\nfunction toPath(url: URL) {\n  const normalizedUrl = new URL(String(url));\n  normalizedUrl.hash = '';\n  normalizedUrl.search = '';\n  const path = fileURLToPath(String(normalizedUrl));\n  const importPaths = [path, ...testExts.map((ext) => path + ext)];\n\n  for (const importPath of importPaths) {\n    if (existsSync(importPath)) {\n      return importPath;\n    }\n  }\n\n  throw new Error(`Unable to find path for import \"${url}\"`);\n}\n\nconst testPlatform = createPlatform();\n\n/** @public */\nexport function getTestPlatform(): TestPlatform {\n  return testPlatform;\n}\n\nconst testExts = ['.ts', '.tsx', '.js', '.cjs', '.mjs', '.jsx'];\n"
  },
  {
    "path": "packages/qwik/src/testing/qwik.testing.api.md",
    "content": "## API Report File for \"@builder.io/qwik\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { JSXOutput } from '@builder.io/qwik';\nimport { RenderResult } from '@builder.io/qwik';\n\n// @public\nexport const createDOM: ({ html }?: {\n    html?: string;\n}) => Promise<{\n    render: (jsxElement: JSXOutput) => Promise<RenderResult>;\n    screen: HTMLElement;\n    userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<void>;\n}>;\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik/src/testing/types.ts",
    "content": "import type { CorePlatform } from '@builder.io/qwik';\n\n/** @public */\nexport interface MockDocument extends Document {}\n\n/** @public */\nexport interface MockWindow extends Window {\n  document: MockDocument;\n}\n\n/**\n * Options when creating a mock Qwik Document object.\n *\n * @public\n */\nexport interface MockDocumentOptions {\n  url?: URL | string;\n  html?: string;\n}\n\n/**\n * Options when creating a mock Qwik Window object.\n *\n * @public\n */\nexport interface MockWindowOptions extends MockDocumentOptions {}\n\n/** @public */\nexport interface TestPlatform extends CorePlatform {\n  flush: () => Promise<void>;\n}\n"
  },
  {
    "path": "packages/qwik/src/testing/util.ts",
    "content": "import { normalize } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\n/** @public */\nexport function toFileUrl(filePath: string) {\n  return pathToFileURL(filePath).href;\n}\n\nexport function normalizePath(path: string) {\n  path = normalize(path);\n\n  // MIT https://github.com/sindresorhus/slash/blob/main/license\n  // Convert Windows backslash paths to slash paths: foo\\\\bar ➔ foo/bar\n  const isExtendedLengthPath = /^\\\\\\\\\\?\\\\/.test(path);\n  const hasNonAscii = /[^\\u0000-\\u0080]+/.test(path); // eslint-disable-line no-control-regex\n\n  if (isExtendedLengthPath || hasNonAscii) {\n    return path;\n  }\n\n  path = path.replace(/\\\\/g, '/');\n  if (path.endsWith('/')) {\n    path = path.slice(0, path.length - 1);\n  }\n  return path;\n}\n\n/**\n * Walks the object graph and replaces any DOM Nodes with their string representation.\n *\n * This is useful when making asserts as DOM nodes show up as text.\n *\n * @param value\n * @returns\n */\nexport function html<T = any>(value: T): T {\n  if (value !== null) {\n    if (Array.isArray(value)) {\n      return value.map(html) as any;\n    } else if (typeof value === 'object') {\n      if (isElement(value)) {\n        return value.outerHTML as any;\n      } else if (isNode(value)) {\n        return value.textContent as any;\n      } else {\n        const obj: any = {};\n        for (const key in value) {\n          if (Object.prototype.hasOwnProperty.call(value, key)) {\n            obj[key] = html(value[key]);\n          }\n        }\n        return obj;\n      }\n    }\n  }\n  return value;\n}\n\nfunction isNode(value: any): value is Node {\n  return 'outerHTML' in value;\n}\n\nfunction isElement(value: any): value is HTMLElement {\n  return isNode(value) && value.nodeType === 1 /*ELEMENT_NODE*/;\n}\n\nexport function normalizeUrl(url: string | URL | undefined | null) {\n  if (url != null) {\n    if (typeof url === 'string') {\n      return new URL(url || '/', BASE_URI);\n    }\n    if (typeof url.href === 'string') {\n      return new URL(url.href || '/', BASE_URI);\n    }\n  }\n  return new URL(BASE_URI);\n}\n\nconst BASE_URI = `http://document.qwik.dev/`;\n\ndeclare const WorkerGlobalScope: any;\n\nconst __globalThis = typeof globalThis !== 'undefined' && globalThis;\nconst __window = typeof window !== 'undefined' && window;\nconst __self =\n  typeof self !== 'undefined' &&\n  typeof WorkerGlobalScope !== 'undefined' &&\n  self instanceof WorkerGlobalScope &&\n  self;\nconst __global = typeof global !== 'undefined' && global;\nexport const platformGlobal: { document: Document | undefined } = (__globalThis ||\n  __global ||\n  __window ||\n  __self) as any;\n"
  },
  {
    "path": "packages/qwik/src/testing/util.unit.ts",
    "content": "import { normalizeUrl } from './util';\nimport { assert, test } from 'vitest';\n\ntest('no url', () => {\n  assert.equal(normalizeUrl(null).href, 'http://document.qwik.dev/');\n  assert.equal(normalizeUrl(undefined).href, 'http://document.qwik.dev/');\n  assert.equal(normalizeUrl('').href, 'http://document.qwik.dev/');\n  assert.equal(normalizeUrl({} as any).href, 'http://document.qwik.dev/');\n});\n\ntest('string, full url', () => {\n  const url = normalizeUrl('https://my.qwik.dev/some-path?query=string#hash');\n  assert.equal(url.pathname, '/some-path');\n  assert.equal(url.hash, '#hash');\n  assert.equal(url.searchParams.get('query'), 'string');\n  assert.equal(url.origin, 'https://my.qwik.dev');\n  assert.equal(url.href, 'https://my.qwik.dev/some-path?query=string#hash');\n});\n\ntest('string, pathname', () => {\n  const url = normalizeUrl('/some-path?query=string#hash');\n  assert.equal(url.pathname, '/some-path');\n  assert.equal(url.hash, '#hash');\n  assert.equal(url.searchParams.get('query'), 'string');\n  assert.equal(url.origin, 'http://document.qwik.dev');\n  assert.equal(url.href, 'http://document.qwik.dev/some-path?query=string#hash');\n});\n"
  },
  {
    "path": "packages/qwik/src/wasm/Cargo.toml",
    "content": "[package]\nauthors = [\"Manu <manu@builder.io>\"]\nname = \"qwik-wasm\"\nversion = \"0.1.0\"\nedition = \"2021\"\nrepository = \"https://github.com/QwikDev/qwik\"\nlicense = \"MIT\"\ndescription = \"Qwik optimizer compiler\"\nkeywords = [\"qwik\", \"swc\", \"javascript\", \"optimizer\", \"compiler\"]\ncategories = [\"development-tools\", \"development-tools::cargo-plugins\"]\n\n[lib]\ncrate-type = [\"cdylib\"]\n\n[dependencies]\njs-sys = \"0.3\"\nqwik-core = { path = \"../optimizer/core\" }\nserde = \"1\"\nserde-wasm-bindgen = \"0.6\"\nwasm-bindgen = \"0.2\"\nparking_lot_core = \"=0.9\"\nconsole_error_panic_hook = { version = \"0.1\", optional = true }\nwee_alloc = { version = \"0.4\" }\ngetrandom = { version = \"0.2\", features = [\"js\"] }\n\n[package.metadata.wasm-pack.profile.release]\nwasm-opt = false\n"
  },
  {
    "path": "packages/qwik/src/wasm/src/lib.rs",
    "content": "#![deny(clippy::all)]\n#![deny(clippy::perf)]\n#![deny(clippy::nursery)]\n\nextern crate wee_alloc;\n\n#[global_allocator]\nstatic ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;\n\nuse js_sys::Error;\nuse qwik_core::TransformModulesOptions;\nuse serde::ser::Serialize;\nuse serde_wasm_bindgen::{from_value, Serializer};\nuse wasm_bindgen::prelude::*;\n\n#[wasm_bindgen]\npub fn transform_modules(config_val: JsValue) -> Result<JsValue, JsValue> {\n\tlet config: TransformModulesOptions = from_value(config_val).map_err(JsValue::from)?;\n\n\tlet result = qwik_core::transform_modules(config)\n\t\t.map_err(|e| Error::from(JsValue::from_str(&e.to_string())))?;\n\n\tlet serializer = Serializer::new().serialize_maps_as_objects(true);\n\tresult.serialize(&serializer).map_err(JsValue::from)\n}\n\n// #[wasm_bindgen]\n// pub fn transform_code(config_val: JsValue) -> Result<JsValue, JsValue> {\n//   let input: String = from_value(config_val).map_err(JsValue::from)?;\n\n//   let result = qwik_core::transform_modules(&TransformModulesOptions {\n//     src_dir: \"/project\".to_string(),\n//     transpile: true,\n//     minify: MinifyMode::Minify,\n//     entry_strategy: EntryStrategy::PerComponent,\n//     source_maps: false,\n//     input: vec![TransformModuleInput {\n//       code: input,\n//       path: \"index.tsx\".to_string(),\n//     }],\n//   })\n//   .map_err(|e| Error::from(JsValue::from_str(&e.to_string())))?;\n\n//   let serializer = Serializer::new().serialize_maps_as_objects(true);\n//   result.serialize(&serializer).map_err(JsValue::from)\n// }\n"
  },
  {
    "path": "packages/qwik/testing.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './dist/testing';\n"
  },
  {
    "path": "packages/qwik/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"paths\": {\n      \"@builder.io/qwik\": [\"packages/qwik/src/core\"],\n      \"@builder.io/qwik/jsx-runtime\": [\"packages/qwik/src/jsx-runtime\"],\n      \"@builder.io/qwik/jsx-dev-runtime\": [\"packages/qwik/src/jsx-runtime\"],\n      \"@builder.io/qwik/build\": [\"packages/qwik/src/build\"],\n      \"@builder.io/qwik/optimizer\": [\"packages/qwik/src/optimizer/src\"],\n      \"@builder.io/qwik/preloader\": [\"packages/qwik/src/preloader\"],\n      \"@builder.io/qwik/server\": [\"packages/qwik/src/server\"],\n      \"@builder.io/qwik/testing\": [\"packages/qwik/src/testing\"],\n      \"@qwik-client-manifest\": [\"packages/qwik/src/server/server-modules.d.ts\"]\n    }\n  },\n  \"include\": [\"src\"],\n  \"exclude\": [\"dist\"]\n}\n"
  },
  {
    "path": "packages/qwik/tsdoc.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json\",\n\n  \"extends\": [\"@microsoft/api-extractor/extends/tsdoc-base.json\"],\n\n  \"tagDefinitions\": [\n    {\n      \"tagName\": \"@file\",\n      \"syntaxKind\": \"block\",\n      \"allowMultiple\": false\n    }\n  ],\n\n  \"supportForTags\": {\n    \"@file\": true\n  }\n}\n"
  },
  {
    "path": "packages/qwik-auth/.npmignore",
    "content": "src\nvite.config.ts"
  },
  {
    "path": "packages/qwik-auth/CHANGELOG.md",
    "content": "# @builder.io/qwik-auth\n\n## 0.2.3\n\n### Patch Changes\n\n- 🛠 update devDependencies and configurations (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7695](https://github.com/QwikDev/qwik/pull/7695))\n"
  },
  {
    "path": "packages/qwik-auth/README.md",
    "content": "# Qwik qwik-auth ⚡️\n\n- Create a component library\n- Vite.js tooling.\n- Prettier code formatter.\n\n## Development Builds\n\n### Client only\n\nDuring development, the index.html is not a result of server-side rendering, but rather the Qwik app is built using client-side JavaScript only. This is ideal for development with Vite and its ability to reload modules quickly and on-demand. However, this mode is only for development and does not showcase \"how\" Qwik works since JavaScript is required to execute, and Vite imports many development modules for the app to work.\n\n```\nnpm run dev\n```\n\n### Server-side Rendering (SSR) and Client\n\nServer-side rendered index.html, with client-side modules prefetched and loaded by the browser. This can be used to test out server-side rendered content during development, but will be slower than the client-only development builds.\n\n```\nnpm run dev.ssr\n```\n\n## Production Builds\n\nA production build should generate the client and server modules by running both client and server build commands.\n\n```\nnpm run build\n```\n\n### Client Modules\n\nProduction build that creates only the client-side modules that are dynamically imported by the browser.\n\n```\nnpm run build.client\n```\n\n### Server Modules\n\nProduction build that creates the server-side render (SSR) module that is used by the server to render the HTML.\n\n```\nnpm run build.server\n```\n\n---\n\n## Related\n\n- [Qwik Docs](https://qwik.dev/docs/)\n- [Qwik on GitHub](https://github.com/QwikDev/qwik)\n- [@QwikDev](https://twitter.com/QwikDev)\n- [Discord](https://qwik.dev/chat)\n- [Vite](https://vitejs.dev/)\n- [Partytown](https://partytown.qwik.dev/)\n- [Mitosis](https://github.com/BuilderIO/mitosis)\n- [Builder.io](https://www.builder.io/)\n"
  },
  {
    "path": "packages/qwik-auth/package.json",
    "content": "{\n  \"name\": \"@builder.io/qwik-auth\",\n  \"description\": \"Qwik Auth is powered by Auth.js, a battle tested library for authentication with 3rd party providers\",\n  \"version\": \"0.2.3\",\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"dependencies\": {\n    \"@auth/core\": \"^0.40.0\"\n  },\n  \"devDependencies\": {\n    \"@auth/core\": \"0.30.0\",\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@builder.io/qwik-city\": \"workspace:^\",\n    \"@types/set-cookie-parser\": \"2.4.10\",\n    \"set-cookie-parser\": \"2.7.1\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./lib/types/index.d.ts\",\n      \"import\": \"./lib/index.qwik.mjs\",\n      \"require\": \"./lib/index.qwik.cjs\"\n    }\n  },\n  \"files\": [\n    \"lib\"\n  ],\n  \"homepage\": \"https://qwik.dev/\",\n  \"keywords\": [\n    \"auth.js\",\n    \"authentication\",\n    \"login\",\n    \"plugin\",\n    \"qwik\",\n    \"ssr\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/qwik-auth\"\n  },\n  \"scripts\": {\n    \"build\": \"vite build --mode lib\"\n  },\n  \"type\": \"module\",\n  \"types\": \"./lib/types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/qwik-auth/src/index.ts",
    "content": "import type { AuthConfig } from '@auth/core';\nimport { Auth, skipCSRFCheck } from '@auth/core';\nimport type { AuthAction, Session } from '@auth/core/types';\nimport { implicit$FirstArg, type QRL } from '@builder.io/qwik';\nimport {\n  globalAction$,\n  routeLoader$,\n  z,\n  zod$,\n  type RequestEvent,\n  type RequestEventCommon,\n} from '@builder.io/qwik-city';\nimport { isServer } from '@builder.io/qwik';\nimport { parseString, splitCookiesString } from 'set-cookie-parser';\n\nexport type GetSessionResult = Promise<{ data: Session | null; cookie: any }>;\nexport type QwikAuthConfig = AuthConfig;\n\nconst actions: AuthAction[] = [\n  'providers',\n  'session',\n  'csrf',\n  'signin',\n  'signout',\n  'callback',\n  'verify-request',\n  'error',\n];\n\nexport function serverAuthQrl(authOptions: QRL<(ev: RequestEventCommon) => QwikAuthConfig>) {\n  const useAuthSignin = globalAction$(\n    async ({ providerId, callbackUrl: deprecated, options, authorizationParams }, req) => {\n      if (deprecated) {\n        console.warn(\n          '\\x1b[33mWARNING: callbackUrl is deprecated - use options.callbackUrl instead\\x1b[0m'\n        );\n      }\n      const { callbackUrl = deprecated ?? defaultCallbackURL(req), ...rest } = options ?? {};\n\n      const isCredentials = providerId === 'credentials';\n\n      const auth = await patchAuthOptions(authOptions, req);\n      const body = new URLSearchParams({ callbackUrl: callbackUrl as string });\n      Object.entries(rest).forEach(([key, value]) => {\n        body.set(key, String(value));\n      });\n\n      const baseSignInUrl = `/api/auth/${isCredentials ? 'callback' : 'signin'}${\n        providerId ? `/${providerId}` : ''\n      }`;\n      const signInUrl = `${baseSignInUrl}?${new URLSearchParams(authorizationParams)}`;\n\n      const data = await authAction(body, req, signInUrl, auth);\n\n      // set authjs.callback-url cookie. Fix for https://github.com/QwikDev/qwik/issues/5227\n      req.cookie.set('authjs.callback-url', callbackUrl, {\n        path: '/',\n      });\n\n      if (data.url) {\n        throw req.redirect(301, data.url);\n      }\n    },\n    zod$({\n      providerId: z.string().optional(),\n      callbackUrl: z.string().optional(),\n      options: z\n        .object({\n          callbackUrl: z.string(),\n        })\n        .passthrough()\n        .partial()\n        .optional(),\n      authorizationParams: z\n        .union([z.string(), z.custom<URLSearchParams>(), z.record(z.string())])\n        .optional(),\n    })\n  );\n\n  const useAuthSignout = globalAction$(\n    async ({ callbackUrl }, req) => {\n      callbackUrl ??= defaultCallbackURL(req);\n      const auth = await patchAuthOptions(authOptions, req);\n      const body = new URLSearchParams({ callbackUrl });\n      await authAction(body, req, `/api/auth/signout`, auth);\n    },\n    zod$({\n      callbackUrl: z.string().optional(),\n    })\n  );\n\n  const useAuthSession = routeLoader$((req) => {\n    return req.sharedMap.get('session') as Session | null;\n  });\n\n  const onRequest = async (req: RequestEvent) => {\n    if (isServer) {\n      const prefix: string = '/api/auth';\n\n      const action = req.url.pathname.slice(prefix.length + 1).split('/')[0] as AuthAction;\n\n      const auth = await patchAuthOptions(authOptions, req);\n      if (actions.includes(action) && req.url.pathname.startsWith(prefix + '/')) {\n        // Casting to `Response` because, something is off with the types in `@auth/core` here:\n        // Without passing `raw`, it should know it's supposed to return a `Response` object, but it doesn't.\n        // https://github.com/nextauthjs/next-auth/blob/a67cfed64d96da1ecfc75f02e7106d9a403012be/packages/core/src/index.ts#L61-L69\n        const res = (await Auth(req.request, auth)) as Response;\n        const cookie = res.headers.get('set-cookie');\n        if (cookie) {\n          req.headers.set('set-cookie', cookie);\n          res.headers.delete('set-cookie');\n          fixCookies(req);\n        }\n        throw req.send(res);\n      } else {\n        const { data, cookie } = await getSessionData(req.request, auth);\n        req.sharedMap.set('session', data);\n        if (cookie) {\n          req.headers.set('set-cookie', cookie);\n          fixCookies(req);\n        }\n      }\n    }\n  };\n\n  return {\n    useAuthSignin,\n    useAuthSignout,\n    useAuthSession,\n    onRequest,\n  };\n}\n\nexport const serverAuth$ = /*#__PURE__*/ implicit$FirstArg(serverAuthQrl);\n\nasync function authAction(\n  body: URLSearchParams | undefined,\n  req: RequestEventCommon,\n  path: string,\n  authOptions: QwikAuthConfig\n) {\n  const request = new Request(new URL(path, req.request.url), {\n    method: req.request.method,\n    headers: req.request.headers,\n    body: body,\n  });\n  request.headers.set('content-type', 'application/x-www-form-urlencoded');\n  // Casting to `Response` because, something is off with the types in `@auth/core` here:\n  // Without passing `raw`, it should know it's supposed to return a `Response` object, but it doesn't.\n  // https://github.com/nextauthjs/next-auth/blob/a67cfed64d96da1ecfc75f02e7106d9a403012be/packages/core/src/index.ts#L61-L69\n  const res = (await Auth(request, {\n    ...authOptions,\n    skipCSRFCheck,\n  })) as Response;\n\n  const cookies: string[] = [];\n  res.headers.forEach((value, key) => {\n    if (key === 'set-cookie') {\n      // while browsers would support setting multiple cookies, the fetch implementation does not, so we join them later.\n      cookies.push(value);\n    } else if (!req.headers.has(key)) {\n      req.headers.set(key, value);\n    }\n  });\n\n  if (cookies.length > 0) {\n    req.headers.set('set-cookie', cookies.join(', '));\n  }\n\n  fixCookies(req);\n\n  try {\n    return await res.json();\n  } catch (error) {\n    return await res.text();\n  }\n}\n\nconst fixCookies = (req: RequestEventCommon) => {\n  req.headers.set('set-cookie', req.headers.get('set-cookie') || '');\n  const cookie = req.headers.get('set-cookie');\n  if (cookie) {\n    req.headers.delete('set-cookie');\n    splitCookiesString(cookie).forEach((cookie) => {\n      const { name, value, ...rest } = parseString(cookie);\n      req.cookie.set(name, value, rest as any);\n    });\n  }\n};\n\nexport const ensureAuthMiddleware = (req: RequestEvent) => {\n  const isLoggedIn = req.sharedMap.has('session');\n  if (!isLoggedIn) {\n    throw req.error(403, 'sfs');\n  }\n};\n\nconst defaultCallbackURL = (req: RequestEventCommon) => {\n  req.url.searchParams.delete('qaction');\n  return req.url.href;\n};\n\nasync function getSessionData(req: Request, options: AuthConfig): GetSessionResult {\n  options.secret ??= process.env.AUTH_SECRET;\n  options.trustHost ??= true;\n\n  const url = new URL('/api/auth/session', req.url);\n  // Casting to `Response` because, something is off with the types in `@auth/core` here:\n  // Without passing `raw`, it should know it's supposed to return a `Response` object, but it doesn't.\n  // https://github.com/nextauthjs/next-auth/blob/a67cfed64d96da1ecfc75f02e7106d9a403012be/packages/core/src/index.ts#L61-L69\n  const response = (await Auth(new Request(url, { headers: req.headers }), options)) as Response;\n\n  const { status = 200 } = response;\n\n  const data = await response.json();\n  const cookie = response.headers.get('set-cookie');\n  if (!data || !Object.keys(data).length) {\n    return { data: null, cookie };\n  }\n  if (status === 200) {\n    return { data, cookie };\n  }\n\n  throw new Error(data.message);\n}\n\nconst patchAuthOptions = async (\n  authOptions: QRL<(ev: RequestEventCommon) => QwikAuthConfig>,\n  req: RequestEventCommon\n) => {\n  const options = await authOptions(req);\n  return { ...options, basePath: '/api/auth' };\n};\n"
  },
  {
    "path": "packages/qwik-auth/vite.config.ts",
    "content": "import { qwikVite } from '@builder.io/qwik/optimizer';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig(() => {\n  return {\n    build: {\n      minify: false,\n      target: 'es2020',\n      outDir: 'lib',\n      lib: {\n        entry: ['./src/index.ts'],\n        formats: ['es', 'cjs'],\n        fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n      rollupOptions: {\n        external: [\n          '@builder.io/qwik',\n          '@builder.io/qwik-city',\n          '@builder.io/qwik/build',\n          '@auth/core',\n        ],\n      },\n    },\n    plugins: [qwikVite()],\n  };\n}) as any;\n"
  },
  {
    "path": "packages/qwik-city/.npmignore",
    "content": "adapters\nbuildtime\nmiddleware\nruntime\nservice-worker\nstatic\nutils\n"
  },
  {
    "path": "packages/qwik-city/CHANGELOG.md",
    "content": "# @builder.io/qwik-city\n\n## 1.19.0\n\n### Minor Changes\n\n- ✨ allow mocking route loaders & actions in `QwikCityMockProvider` (by [@alexismch](https://github.com/alexismch) in [#8102](https://github.com/QwikDev/qwik/pull/8102))\n\n### Patch Changes\n\n- 🐞🩹 qwik-city spa routeStateInternal and routeLocation url origins mismatch (by [@maiieul](https://github.com/maiieul) in [#8234](https://github.com/QwikDev/qwik/pull/8234))\n\n- feat(qwik-city): add getOrigin option to QwikCityBunOptions and QwikCityDenoOptions for improved URL handling (by [@JerryWu1234](https://github.com/JerryWu1234) in [#8251](https://github.com/QwikDev/qwik/pull/8251))\n\n- Make RequestEvents readonly instead of frozen (by [@DustinJSilk](https://github.com/DustinJSilk) in [#8135](https://github.com/QwikDev/qwik/pull/8135))\n\n## 1.18.0\n\n### Patch Changes\n\n- execute cleanup cb for all component tree while calling dispose.cleanup method returned by render fn (by [@sashkashishka](https://github.com/sashkashishka) in [#8164](https://github.com/QwikDev/qwik/pull/8164))\n\n## 1.17.2\n\n### Patch Changes\n\n- 🐞🩹 history behavior in some edge cases has been brought inline with the E2E tests that were accidentally disabled. (the tests can't be disabled any more either) (by [@wmertens](https://github.com/wmertens) in [`206f3e0`](https://github.com/QwikDev/qwik/commit/206f3e07caad5a5736f160c09a618f348896860d))\n\n- 🐞🩹 SPA routing is broken unless origin matches value in in vite.config #8093 (by [@termermc](https://github.com/termermc) in [#8097](https://github.com/QwikDev/qwik/pull/8097))\n\n  If the SSG origin was set to `localhost:3000` and a user visited from `127.0.0.1:3000`, SPA routing would be broken.\n\n  Internally, useNavigate's context provider `goto` checks the new destination with the last route location. If the\n  origin is different, it just does a normal browser navigation. This makes sense; links to other origins cannot use\n  SPA routing. However, the initial route it compares was using an origin that came from the server environment.\n\n  Now, the first navigation will set that initial route to the browser's actual href, eliminating the erroneous\n  origin mismatch for SPA navigations.\n\n- 🐞🩹 `this` in various Qwik-City handlers is now `RequestEvent` again. (by [@wmertens](https://github.com/wmertens) in [#8111](https://github.com/QwikDev/qwik/pull/8111))\n\n## 1.17.1\n\n### Patch Changes\n\n- 🐞🩹 `zod` is now imported as `import * as z from 'zod'`, which vastly improves bundling. The Insights app client code reduced by 12kB. (by [@wmertens](https://github.com/wmertens) in [#8042](https://github.com/QwikDev/qwik/pull/8042))\n\n## 1.17.0\n\n### Patch Changes\n\n- 🐞🩹 SSG sometimes hangs after completion, now we forcibly exit the SSG process when this happens. (by [@wmertens](https://github.com/wmertens) in [#7957](https://github.com/QwikDev/qwik/pull/7957))\n\n- 🐞🩹 return 404 for missing /build/ files. (by [@gioboa](https://github.com/gioboa) in [#7914](https://github.com/QwikDev/qwik/pull/7914))\n\n- 🐞🩹 redirecting internal q-data.json requests will keep the q-data.json suffix so that the client can still fetch the correct one (by [@wmertens](https://github.com/wmertens) in [#7988](https://github.com/QwikDev/qwik/pull/7988))\n\n- 🐞🩹 solve type error when using async \\_resolved function (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7426](https://github.com/QwikDev/qwik/pull/7426))\n\n- 🐞🩹 while prefetching Link data, don't navigate to captive portals (by [@wmertens](https://github.com/wmertens) in [#7988](https://github.com/QwikDev/qwik/pull/7988))\n\n## 1.16.1\n\n### Patch Changes\n\n- 🐞🩹 fix behaviour of checkOrigin: \"lax-proto\" in createQwikCity (by [@asaharan](https://github.com/asaharan) in [#7865](https://github.com/QwikDev/qwik/pull/7865))\n\n- 🛠 Add check-client command to verify bundle freshness (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7517](https://github.com/QwikDev/qwik/pull/7517))\n\n- 🐞🩹 return 404 with invalid URL. (by [@gioboa](https://github.com/gioboa) in [#7902](https://github.com/QwikDev/qwik/pull/7902))\n\n- ✨ All qwik packages are now marked as side effect free in their package.json. This should remove a few unecessary empty imports added by rollup and then not tree-shaken like `import \"./preloader.js\"`. (by [@maiieul](https://github.com/maiieul) in [#7908](https://github.com/QwikDev/qwik/pull/7908))\n\n- ✨ SPA Link navigation now preloads the next route bundles on click with maximum probability, speeding up SPA navigation. (by [@maiieul](https://github.com/maiieul) in [#7849](https://github.com/QwikDev/qwik/pull/7849))\n\n- 🐞🩹 Your service-worker.js won't be unregistered anymore if you added custom logic to it. (by [@maiieul](https://github.com/maiieul) in [#7872](https://github.com/QwikDev/qwik/pull/7872))\n\n  > Note: Qwik 1.14.0 and above now use `<link rel=\"modulepreload\">` by default. If you didn't add custom service-worker logic, you should remove your service-worker.ts file(s) for the `ServiceWorkerRegister` Component to actually unregister the service-worker.js and delete its related cache. Make sure to keep the `ServiceWorkerRegister` Component in your app (without any service-worker.ts file) as long as you want to unregister the service-worker.js for your users.\n\n## 1.16.0\n\n### Minor Changes\n\n- ✨ bump Vite to v7 (by [@gioboa](https://github.com/gioboa) in [#7762](https://github.com/QwikDev/qwik/pull/7762))\n\n### Patch Changes\n\n- 🐞🩹 Keeping the service worker components now properly unregisters them. (by [@maiieul](https://github.com/maiieul) in [#7781](https://github.com/QwikDev/qwik/pull/7781))\n\n- 🐞🩹 redirects no longer take their parent layout's Cache-Control value by default and are instead set to `no-store`. This prevents issues in redirection logic. We might introduce another API to enable caching redirects in the future. (by [@maiieul](https://github.com/maiieul) in [#7811](https://github.com/QwikDev/qwik/pull/7811))\n\n- 🐞🩹 Keeping the service worker components now also removes their associated Cache storage. (by [@maiieul](https://github.com/maiieul) in [#7782](https://github.com/QwikDev/qwik/pull/7782))\n\n## 1.15.0\n\n### Minor Changes\n\n- ✨ Added rewrite() to the RequestEvent object. It works like redirect but does not change the URL, (by [@omerman](https://github.com/omerman) in [#7562](https://github.com/QwikDev/qwik/pull/7562))\n  think of it as an internal redirect.\n\n  Example usage:\n\n  ```ts\n  export const onRequest: RequestHandler = async ({ url, rewrite }) => {\n    if (url.pathname.includes('/articles/the-best-article-in-the-world')) {\n      const artistId = db.getArticleByName('the-best-article-in-the-world');\n\n      // Url will remain /articles/the-best-article-in-the-world, but under the hood,\n      // will render /articles/${artistId}\n      throw rewrite(`/articles/${artistId}`);\n    }\n  };\n  ```\n\n### Patch Changes\n\n- 🐞🩹 Change Content-Type header in qwik requests to respect RFC 7231 (by [@joaomaridalho](https://github.com/joaomaridalho) in [#7690](https://github.com/QwikDev/qwik/pull/7690))\n\n- 🐞🩹 link/useNavigate with query params don't override loader/middleware redirect with query params anymore. (by [@maiieul](https://github.com/maiieul) in [#7733](https://github.com/QwikDev/qwik/pull/7733))\n\n- 🐞🩹 allow cross-protocol requests from the same domain (by [@gioboa](https://github.com/gioboa) in [#7693](https://github.com/QwikDev/qwik/pull/7693))\n\n- 🛠 update devDependencies and configurations (by [@JerryWu1234](https://github.com/JerryWu1234) in [#7695](https://github.com/QwikDev/qwik/pull/7695))\n\n- 🐞🩹 Duplicate ServerError class during dev mode (by [@wmertens](https://github.com/wmertens) in [#7724](https://github.com/QwikDev/qwik/pull/7724))\n\n## 1.14.1\n\n## 1.14.0\n\n### Minor Changes\n\n- 🐞🩹 qwik-city no longer forces `q-data.json` downloads, instead relying on the cache headers. This means that you have to make sure your `q-data.json` is served with `Cache-Control` headers that suit you. That file contains all the information about the route and is read for each qwik-city navigation. By default the data is cached for one hour. (by [@wmertens](https://github.com/wmertens) in [#7537](https://github.com/QwikDev/qwik/pull/7537))\n\n- 🛠 the service workers have been deprecated and replaced with entries that unregister them. If you have it enabled in production, you can remove it after a while once you are sure all your users have the new version. (by [@wmertens](https://github.com/wmertens) in [#7453](https://github.com/QwikDev/qwik/pull/7453))\n\n### Patch Changes\n\n- 🐞🩹 linting errors which were previously being ignored across the monorepo. (by [@better-salmon](https://github.com/better-salmon) in [#7418](https://github.com/QwikDev/qwik/pull/7418))\n\n- 🐞🩹 Link SPA subsequent navigation now properly prefetch the next routes. (by [@maiieul](https://github.com/maiieul) in [#7590](https://github.com/QwikDev/qwik/pull/7590))\n\n- 🐞🩹 SPA Link now handle subsequent onQVisible$ passed as props. (by [@maiieul](https://github.com/maiieul) in [#7612](https://github.com/QwikDev/qwik/pull/7612))\n\n## 1.13.0\n\n### Minor Changes\n\n- 🐞🩹 server$ errors can be caught by @plugin middleware (by [@DustinJSilk](https://github.com/DustinJSilk) in [#7185](https://github.com/QwikDev/qwik/pull/7185))\n\n- refactor: Error types are standardised across server$ functions and routeLoaders (by [@DustinJSilk](https://github.com/DustinJSilk) in [#7185](https://github.com/QwikDev/qwik/pull/7185))\n\n- ✨ 499 is now a valid status code (by [@DustinJSilk](https://github.com/DustinJSilk) in [#7185](https://github.com/QwikDev/qwik/pull/7185))\n\n- 🐞🩹 server$ functions now correctly throw 4xx errors on the client (by [@DustinJSilk](https://github.com/DustinJSilk) in [#7185](https://github.com/QwikDev/qwik/pull/7185))\n\n### Patch Changes\n\n- 🐞🩹 Error boundary `ErrorBoundary` and fix `useErrorBoundary` (by [@damianpumar](https://github.com/damianpumar) in [#7342](https://github.com/QwikDev/qwik/pull/7342))\n\n- 🐞🩹 Write Response object in the send request event even on redirects (by [@nelsonprsousa](https://github.com/nelsonprsousa) in [#7422](https://github.com/QwikDev/qwik/pull/7422))\n\n## 1.12.1\n\n### Patch Changes\n\n- 🐞🩹 MDX content now accepts a prop of type `components` that lets you use your own custom components (by [@double-thinker](https://github.com/double-thinker) in [#7277](https://github.com/QwikDev/qwik/pull/7277))\n\n  To add custom components to your MDX content, you can now do this:\n\n  ```tsx\n  // routes/example/index.tsx\n  import Content from './markdown.mdx';\n  import MyComponent from '../../components/my-component/my-component';\n  import { component$ } from '@builder.io/qwik';\n\n  export default component$(() => <Content components={{ MyComponent }} />);\n  ```\n\n  You can also use props in JS expressions. See https://mdxjs.com/docs/using-mdx/#props\n\n- 🐞🩹 mdx not rendering (by [@shairez](https://github.com/shairez) in [#7168](https://github.com/QwikDev/qwik/pull/7168))\n\n- 📃 added a \"Qwik for Mobile\" guide to build iOS and Android Qwik apps (by [@srapport](https://github.com/srapport) in [#7205](https://github.com/QwikDev/qwik/pull/7205))\n\n- 🐞🩹 some qrls weren't fetched correctly on page load (by [@shairez](https://github.com/shairez) in [#7286](https://github.com/QwikDev/qwik/pull/7286))\n\n## 1.12.0\n\n### Patch Changes\n\n- 🐞🩹 the previous URL now is undefined on first render. (by [@damianpumar](https://github.com/damianpumar) in [#7082](https://github.com/QwikDev/qwik/pull/7082))\n\n- 🐞🩹 server$ functions now correctly throw errors for > 500 error codes (by [@DustinJSilk](https://github.com/DustinJSilk) in [#7078](https://github.com/QwikDev/qwik/pull/7078))\n\n## 1.11.0\n\n## 1.10.0\n\n### Patch Changes\n\n- 🐞🩹 MDX content no longer ignores Layout components. See [the MDX docs](https://mdxjs.com/docs/using-mdx/#layout) for more information. (by [@danielvaijk](https://github.com/danielvaijk) in [#6845](https://github.com/QwikDev/qwik/pull/6845))\n\n- 🐞🩹 SSG errors now show the path that failed (by [@wmertens](https://github.com/wmertens) in [#6998](https://github.com/QwikDev/qwik/pull/6998))\n\n- 🐞🩹 Fixed action redirect regression where searchParams were appended (by [@brandonpittman](https://github.com/brandonpittman) in [#6927](https://github.com/QwikDev/qwik/pull/6927))\n\n- 🐞🩹 Redirect, error, and fail request events no longer forcefully delete user-defined Cache-Control HTTP header value. (by [@nelsonprsousa](https://github.com/nelsonprsousa) in [#6991](https://github.com/QwikDev/qwik/pull/6991))\n\n- 🐞🩹 `vite` is now a peer dependency of `qwik`, `qwik-city`, `qwik-react` and `qwik-labs`, so that there can be no duplicate imports. This should not have consequences, since all apps also directly depend on `vite`. (by [@wmertens](https://github.com/wmertens) in [#6945](https://github.com/QwikDev/qwik/pull/6945))\n\n- 🐞🩹 Fixed MDX layout default export being ignored by transformer. (by [@danielvaijk](https://github.com/danielvaijk) in [#6845](https://github.com/QwikDev/qwik/pull/6845))\n\n- 🐞🩹 Prevent unexpected caching for q-data.json (by [@genki](https://github.com/genki) in [#6808](https://github.com/QwikDev/qwik/pull/6808))\n\n- 🐞🩹 Multiple rewrite routes pointing to the same route is no longer an error. (by [@JerryWu1234](https://github.com/JerryWu1234) in [#6970](https://github.com/QwikDev/qwik/pull/6970))\n\n## 1.9.1\n\n### Patch Changes\n\n- ✨ Experimental feature - `noSPA`. (by [@wmertens](https://github.com/wmertens) in [#6937](https://github.com/QwikDev/qwik/pull/6937))\n  This disables history patching, slightly reducing code size and startup time. Use this when your application is MPA only, meaning you don't use the Link component. To enable this, add it to the `experimental` array of the `qwikVite` plugin (not the `qwikCity` plugin).\n\n## 1.9.0\n\n### Minor Changes\n\n- ✨ **(EXPERIMENTAL)** valibot$ validator and a fix for zod$ types. (by [@fabian-hiller](https://github.com/fabian-hiller) in [#6752](https://github.com/QwikDev/qwik/pull/6752))\n\n  To use it, you need to pass `experimental: ['valibot']` as an option to the `qwikVite` plugin as such:\n\n  ```ts\n  // vite.config.ts\n\n  export default defineConfig(({ command, mode }): UserConfig => {\n    return {\n      plugins: [\n        // ... other plugins like qwikCity() etc\n        qwikVite({\n          experimental: ['valibot']\n          // ... other options\n        }),\n\n      ],\n      // ... rest of the config\n    };\n  }\n\n  ```\n\n- ✨ **(EXPERIMENTAL)** `usePreventNavigate` lets you prevent navigation while your app's state is unsaved. It works asynchronously for SPA navigation and falls back to the browser's default dialogs for other navigations. To use it, add `experimental: ['preventNavigate']` to your `qwikVite` options. (by [@wmertens](https://github.com/wmertens) in [#6825](https://github.com/QwikDev/qwik/pull/6825))\n\n### Patch Changes\n\n- 🐞🩹 added .ico to be detected by isStaticFile (by [@intellix](https://github.com/intellix) in [#6860](https://github.com/QwikDev/qwik/pull/6860))\n\n- 🐞🩹 fixed delays caused from inefficient Service Worker prefetching (buffering) (by [@shairez](https://github.com/shairez) in [#6863](https://github.com/QwikDev/qwik/pull/6863))\n\n## 1.8.0\n\n## 1.7.3\n\n## 1.7.2\n\n### Patch Changes\n\n- - built files are now under dist/ or lib/. All tools that respect package export maps should just work. (by [@wmertens](https://github.com/wmertens) in [#6715](https://github.com/QwikDev/qwik/pull/6715))\n    If you have trouble with Typescript, ensure that you use `moduleResolution: \"Bundler\"` in your `tsconfig.json`.\n  - `@builder.io/qwik` no longer depends on `undici`\n\n- During dev mode, qwik-city will no longer serve files from `dist/`, which are very likely to be stale/incorrect. Furthermore, query parameters are taken into account when serving files (like production servers would do). (by [@wmertens](https://github.com/wmertens) in [#6694](https://github.com/QwikDev/qwik/pull/6694))\n\n- qwik-city is now more careful about redirects after requesting routeLoader data (by [@wmertens](https://github.com/wmertens) in [#6740](https://github.com/QwikDev/qwik/pull/6740))\n\n- strip internal search parameters in canonical URLs (by [@wmertens](https://github.com/wmertens) in [#6694](https://github.com/QwikDev/qwik/pull/6694))\n\n- Support entry.ts routes in dev mode now that dist/ is no longer served, and special-case `repl-sw.js` in the docs. (by [@wmertens](https://github.com/wmertens) in [#6706](https://github.com/QwikDev/qwik/pull/6706))\n"
  },
  {
    "path": "packages/qwik-city/README.md",
    "content": "# Qwik City 🏙\n\nThe meta-framework for [Qwik](https://qwik.dev/).\n\n## Community\n\n- Ping us at [@QwikDev](https://twitter.com/QwikDev)\n- Join our [Discord](https://qwik.dev/chat) community\n\n## Related\n\n- [Qwik](https://qwik.dev/): An open-source framework designed for best possible time to interactive, by focusing on resumability of server-side-rendering of HTML, and fine-grained lazy-loading of code.\n- [Partytown](https://partytown.qwik.dev/): Relocate resource intensive third-party scripts off of the main thread and into a web worker 🎉.\n- [Mitosis](https://github.com/BuilderIO/mitosis): Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and more.\n- [Builder](https://github.com/BuilderIO/builder): Drag and drop page builder and CMS for React, Vue, Angular, and more.\n"
  },
  {
    "path": "packages/qwik-city/adapters/azure-swa/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/azure-swa/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/bun-server/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/bun-server/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/cloud-run/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/cloud-run/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/cloudflare-pages/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/cloudflare-pages/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/deno-server/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/deno-server/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/netlify-edge/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/netlify-edge/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/node-server/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/node-server/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/shared/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/shared/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/static/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/static/vite';\n"
  },
  {
    "path": "packages/qwik-city/adapters/vercel-edge/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../../lib/adapters/vercel-edge/vite';\n"
  },
  {
    "path": "packages/qwik-city/global.d.ts",
    "content": "/* eslint-disable no-var */\n// Globals used by qwik-city, for internal use only\n\ntype RequestEventInternal =\n  import('./middleware/request-handler/request-event').RequestEventInternal;\ntype AsyncStore = import('node:async_hooks').AsyncLocalStorage<RequestEventInternal>;\n\n/** @deprecated Remove this in v2 */\ndeclare var QWIK_MANIFEST: import('@builder.io/qwik/optimizer').QwikManifest | undefined | null;\n\ndeclare var qcAsyncRequestStore: AsyncStore | undefined;\ndeclare var _qwikActionsMap: Map<string, ActionInternal> | undefined;\ndeclare var __qwikCityNew: boolean | undefined;\n\ntype ExperimentalFeatures = import('@builder.io/qwik/optimizer').ExperimentalFeatures;\n\ndeclare var __EXPERIMENTAL__: {\n  [K in ExperimentalFeatures]: boolean;\n};\n"
  },
  {
    "path": "packages/qwik-city/index.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './lib';\n"
  },
  {
    "path": "packages/qwik-city/middleware/aws-lambda.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/aws-lambda';\n"
  },
  {
    "path": "packages/qwik-city/middleware/azure-swa.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/azure-swa';\n"
  },
  {
    "path": "packages/qwik-city/middleware/bun.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/bun';\n"
  },
  {
    "path": "packages/qwik-city/middleware/cloudflare-pages.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/cloudflare-pages';\n"
  },
  {
    "path": "packages/qwik-city/middleware/deno.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/deno';\n"
  },
  {
    "path": "packages/qwik-city/middleware/firebase.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/firebase';\n"
  },
  {
    "path": "packages/qwik-city/middleware/netlify-edge.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/netlify-edge';\n"
  },
  {
    "path": "packages/qwik-city/middleware/node.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/node';\n"
  },
  {
    "path": "packages/qwik-city/middleware/request-handler.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/request-handler';\n"
  },
  {
    "path": "packages/qwik-city/middleware/vercel-edge.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from '../lib/middleware/vercel-edge';\n"
  },
  {
    "path": "packages/qwik-city/modules.d.ts",
    "content": "declare module '@qwik-city-plan' {\n  export const routes: any[];\n  export const menus: any[];\n  export const trailingSlash: boolean;\n  export const basePathname: string;\n  export const cacheModules: boolean;\n  const defaultExport: {\n    routes: any[];\n    menus: any[];\n    trailingSlash: boolean;\n    basePathname: string;\n    cacheModules: boolean;\n  };\n  export default defaultExport;\n}\ndeclare module '@qwik-city-not-found-paths' {\n  function getNotFound(_pathname: string): string;\n  export { getNotFound };\n}\ndeclare module '@qwik-city-static-paths' {\n  function isStaticPath(method: string, url: URL): boolean;\n  export { isStaticPath };\n}\n"
  },
  {
    "path": "packages/qwik-city/package.json",
    "content": "{\n  \"name\": \"@builder.io/qwik-city\",\n  \"description\": \"The meta-framework for Qwik.\",\n  \"version\": \"1.19.0\",\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"dependencies\": {\n    \"@mdx-js/mdx\": \"^3.1.1\",\n    \"@types/mdx\": \"^2.0.13\",\n    \"source-map\": \"^0.7.6\",\n    \"svgo\": \"^3.3.3\",\n    \"undici\": \"*\",\n    \"valibot\": \">=0.36.0 <2\",\n    \"vfile\": \"6.0.3\",\n    \"vite\": \">=5 <8\",\n    \"vite-imagetools\": \"^9.0.0\",\n    \"zod\": \"3.25.48\"\n  },\n  \"devDependencies\": {\n    \"@azure/functions\": \"3.5.1\",\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@microsoft/api-extractor\": \"7.52.10\",\n    \"@netlify/edge-functions\": \"2.17.0\",\n    \"@types/mdast\": \"4.0.4\",\n    \"@types/node\": \"20.19.0\",\n    \"@types/refractor\": \"3.4.1\",\n    \"@types/set-cookie-parser\": \"2.4.10\",\n    \"estree-util-value-to-estree\": \"3.4.0\",\n    \"github-slugger\": \"2.0.0\",\n    \"hast-util-heading-rank\": \"2.1.1\",\n    \"hast-util-to-string\": \"2.0.0\",\n    \"kleur\": \"4.1.5\",\n    \"marked\": \"12.0.2\",\n    \"mdast-util-mdx\": \"3.0.0\",\n    \"refractor\": \"4.8.1\",\n    \"rehype-autolink-headings\": \"7.1.0\",\n    \"remark-frontmatter\": \"5.0.0\",\n    \"remark-gfm\": \"4.0.1\",\n    \"set-cookie-parser\": \"2.7.1\",\n    \"tsm\": \"2.3.0\",\n    \"typescript\": \"5.4.5\",\n    \"unified\": \"11.0.5\",\n    \"unist-util-visit\": \"5.0.0\",\n    \"uvu\": \"0.5.6\",\n    \"vite\": \"7.3.1\",\n    \"yaml\": \"2.6.1\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./lib/index.d.ts\",\n      \"import\": \"./lib/index.qwik.mjs\",\n      \"require\": \"./lib/index.qwik.cjs\"\n    },\n    \"./adapters/azure-swa/vite\": {\n      \"types\": \"./lib/adapters/azure-swa/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/azure-swa/vite/index.mjs\",\n      \"require\": \"./lib/adapters/azure-swa/vite/index.cjs\"\n    },\n    \"./adapters/cloudflare-pages/vite\": {\n      \"types\": \"./lib/adapters/cloudflare-pages/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/cloudflare-pages/vite/index.mjs\",\n      \"require\": \"./lib/adapters/cloudflare-pages/vite/index.cjs\"\n    },\n    \"./adapters/cloud-run/vite\": {\n      \"types\": \"./lib/adapters/cloud-run/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/cloud-run/vite/index.mjs\",\n      \"require\": \"./lib/adapters/cloud-run/vite/index.cjs\"\n    },\n    \"./adapters/bun-server/vite\": {\n      \"types\": \"./lib/adapters/bun-server/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/bun-server/vite/index.mjs\",\n      \"require\": \"./lib/adapters/bun-server/vite/index.cjs\"\n    },\n    \"./adapters/deno-server/vite\": {\n      \"types\": \"./lib/adapters/deno-server/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/deno-server/vite/index.mjs\",\n      \"require\": \"./lib/adapters/deno-server/vite/index.cjs\"\n    },\n    \"./adapters/node-server/vite\": {\n      \"types\": \"./lib/adapters/node-server/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/node-server/vite/index.mjs\",\n      \"require\": \"./lib/adapters/node-server/vite/index.cjs\"\n    },\n    \"./adapters/netlify-edge/vite\": {\n      \"types\": \"./lib/adapters/netlify-edge/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/netlify-edge/vite/index.mjs\",\n      \"require\": \"./lib/adapters/netlify-edge/vite/index.cjs\"\n    },\n    \"./adapters/shared/vite\": {\n      \"types\": \"./lib/adapters/shared/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/shared/vite/index.mjs\",\n      \"require\": \"./lib/adapters/shared/vite/index.cjs\"\n    },\n    \"./adapters/static/vite\": {\n      \"types\": \"./lib/adapters/static/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/static/vite/index.mjs\",\n      \"require\": \"./lib/adapters/static/vite/index.cjs\"\n    },\n    \"./adapters/vercel-edge/vite\": {\n      \"types\": \"./lib/adapters/vercel-edge/vite/index.d.ts\",\n      \"import\": \"./lib/adapters/vercel-edge/vite/index.mjs\",\n      \"require\": \"./lib/adapters/vercel-edge/vite/index.cjs\"\n    },\n    \"./middleware/azure-swa\": {\n      \"types\": \"./lib/middleware/azure-swa/index.d.ts\",\n      \"import\": \"./lib/middleware/azure-swa/index.mjs\"\n    },\n    \"./middleware/aws-lambda\": {\n      \"types\": \"./lib/middleware/aws-lambda/index.d.ts\",\n      \"import\": \"./lib/middleware/aws-lambda/index.mjs\"\n    },\n    \"./middleware/cloudflare-pages\": {\n      \"types\": \"./lib/middleware/cloudflare-pages/index.d.ts\",\n      \"import\": \"./lib/middleware/cloudflare-pages/index.mjs\"\n    },\n    \"./middleware/firebase\": {\n      \"types\": \"./lib/middleware/firebase/index.d.ts\",\n      \"import\": \"./lib/middleware/firebase/index.mjs\"\n    },\n    \"./middleware/deno\": {\n      \"types\": \"./lib/middleware/deno/index.d.ts\",\n      \"import\": \"./lib/middleware/deno/index.mjs\"\n    },\n    \"./middleware/bun\": {\n      \"types\": \"./lib/middleware/bun/index.d.ts\",\n      \"import\": \"./lib/middleware/bun/index.mjs\"\n    },\n    \"./middleware/netlify-edge\": {\n      \"types\": \"./lib/middleware/netlify-edge/index.d.ts\",\n      \"import\": \"./lib/middleware/netlify-edge/index.mjs\"\n    },\n    \"./middleware/node\": {\n      \"types\": \"./lib/middleware/node/index.d.ts\",\n      \"import\": \"./lib/middleware/node/index.mjs\",\n      \"require\": \"./lib/middleware/node/index.cjs\"\n    },\n    \"./middleware/request-handler\": {\n      \"types\": \"./lib/middleware/request-handler/index.d.ts\",\n      \"import\": \"./lib/middleware/request-handler/index.mjs\",\n      \"require\": \"./lib/middleware/request-handler/index.cjs\"\n    },\n    \"./middleware/vercel-edge\": {\n      \"types\": \"./lib/middleware/vercel-edge/index.d.ts\",\n      \"import\": \"./lib/middleware/vercel-edge/index.mjs\"\n    },\n    \"./static\": {\n      \"types\": \"./lib/static/index.d.ts\",\n      \"import\": \"./lib/static/index.mjs\",\n      \"require\": \"./lib/static/index.cjs\"\n    },\n    \"./vite\": {\n      \"types\": \"./lib/vite/index.d.ts\",\n      \"import\": \"./lib/vite/index.mjs\",\n      \"require\": \"./lib/vite/index.cjs\"\n    },\n    \"./service-worker\": {\n      \"types\": \"./service-worker.d.ts\",\n      \"import\": \"./lib/service-worker.mjs\",\n      \"require\": \"./lib/service-worker.cjs\"\n    }\n  },\n  \"files\": [\n    \"adapters\",\n    \"index.d.ts\",\n    \"lib\",\n    \"middleware\",\n    \"modules.d.ts\",\n    \"README.md\",\n    \"service-worker.d.ts\",\n    \"static.d.ts\",\n    \"vite.d.ts\"\n  ],\n  \"homepage\": \"https://qwik.dev/\",\n  \"license\": \"MIT\",\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/qwik-city\"\n  },\n  \"scripts\": {\n    \"build\": \"cd src/runtime && vite build --mode lib\"\n  },\n  \"sideEffects\": false,\n  \"type\": \"module\",\n  \"types\": \"./lib/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/qwik-city/service-worker.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './lib/service-worker';\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/azure-swa/adapter.azure-swa.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\n// @public (undocumented)\nexport function azureSwaAdapter(opts?: AzureSwaAdapterOptions): any;\n\n// @public (undocumented)\nexport interface AzureSwaAdapterOptions extends ServerAdapterOptions {\n}\n\nexport { StaticGenerateRenderOptions }\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/azure-swa/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/azure-swa/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.azure-swa\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/azure-swa/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/azure-swa\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/azure-swa/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/azure-swa/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/azure-swa/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { type ServerAdapterOptions, viteAdapter } from '../../shared/vite';\nimport { join } from 'node:path';\nimport fs from 'node:fs';\n\n/** @public */\nexport function azureSwaAdapter(opts: AzureSwaAdapterOptions = {}): any {\n  const env = process?.env;\n  return viteAdapter({\n    name: 'azure-swa',\n    origin: env?.ORIGIN ?? env?.URL ?? 'https://yoursitename.region.2.azurestaticapps.net',\n    ssg: opts.ssg,\n    cleanStaticGenerated: true,\n\n    async generate({ outputEntries, serverOutDir, clientPublicOutDir }) {\n      const serverPackageJsonPath = join(serverOutDir!, 'package.json');\n      const serverPackageJsonCode = `{\"type\":\"module\"}`;\n      await fs.promises.mkdir(serverOutDir!, { recursive: true });\n      await fs.promises.writeFile(serverPackageJsonPath, serverPackageJsonCode);\n\n      const azureSwaModulePath = outputEntries.find(\n        (entryName) => entryName.indexOf('entry.azure-swa') === 0\n      );\n\n      const funcJsonPath = join(serverOutDir!, 'function.json');\n      const funcJson = JSON.stringify(\n        {\n          bindings: [\n            {\n              authLevel: 'anonymous',\n              type: 'httpTrigger',\n              direction: 'in',\n              name: 'req',\n              methods: [\n                'get',\n                'head',\n                'post',\n                'put',\n                'delete',\n                'connect',\n                'options',\n                'trace',\n                'patch',\n              ],\n            },\n            {\n              type: 'http',\n              direction: 'out',\n              name: '$return',\n            },\n          ],\n          scriptFile: azureSwaModulePath,\n        },\n        null,\n        2\n      );\n      await fs.promises.writeFile(funcJsonPath, funcJson);\n\n      // Azure SWA needs an index.html in the dist folder (otherwise it won't deploy)\n      if (!fs.existsSync(join(clientPublicOutDir, 'index.html'))) {\n        await fs.promises.writeFile(join(clientPublicOutDir, 'index.html'), '');\n      }\n    },\n  });\n}\n\n/** @public */\nexport interface AzureSwaAdapterOptions extends ServerAdapterOptions {}\n\n/** @public */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/bun-server/adapter.bun-server.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\n// @alpha (undocumented)\nexport function bunServerAdapter(opts?: bunServerAdapterOptions): any;\n\n// @alpha (undocumented)\nexport interface bunServerAdapterOptions extends ServerAdapterOptions {\n    // (undocumented)\n    name?: string;\n}\n\nexport { StaticGenerateRenderOptions }\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/bun-server/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/bun-server/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.bun-server\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/bun-server/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/bun-server\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/bun-server/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/bun-server/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/bun-server/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { viteAdapter, type ServerAdapterOptions } from '../../shared/vite';\n\n/** @alpha */\nexport function bunServerAdapter(opts: bunServerAdapterOptions = {}): any {\n  const env = process?.env;\n  return viteAdapter({\n    name: opts.name || 'bun-server',\n    origin: env?.ORIGIN ?? env?.URL ?? 'https://yoursitename.qwik.dev',\n    ssg: opts.ssg,\n    cleanStaticGenerated: true,\n\n    config() {\n      return {\n        ssr: {\n          target: 'node',\n        },\n        build: {\n          ssr: true,\n        },\n        publicDir: false,\n      };\n    },\n  });\n}\n\n/** @alpha */\nexport interface bunServerAdapterOptions extends ServerAdapterOptions {\n  name?: string;\n}\n\n/** @alpha */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/cloud-run/adapter.cloud-run.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\n// @public (undocumented)\nexport function cloudRunAdapter(opts?: CloudRunAdapterOptions): any;\n\n// @public (undocumented)\nexport interface CloudRunAdapterOptions extends ServerAdapterOptions {\n}\n\nexport { StaticGenerateRenderOptions }\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/cloud-run/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/cloud-run/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.cloud-run\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/cloud-run/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/cloud-run\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/cloud-run/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/cloud-run/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/cloud-run/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { type ServerAdapterOptions, viteAdapter } from '../../shared/vite';\n\n/** @public */\nexport function cloudRunAdapter(opts: CloudRunAdapterOptions = {}): any {\n  const env = process?.env;\n  return viteAdapter({\n    name: 'cloud-run',\n    origin: env?.ORIGIN ?? env?.URL ?? 'https://your-app-name.run.app',\n    ssg: opts.ssg,\n    cleanStaticGenerated: true,\n    config() {\n      return {\n        build: {\n          ssr: true,\n        },\n        publicDir: false,\n      };\n    },\n  });\n}\n\n/** @public */\nexport interface CloudRunAdapterOptions extends ServerAdapterOptions {}\n\n/** @public */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/cloudflare-pages/adapter.cloudflare-pages.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\n// @public (undocumented)\nexport function cloudflarePagesAdapter(opts?: CloudflarePagesAdapterOptions): any;\n\n// @public (undocumented)\nexport interface CloudflarePagesAdapterOptions extends ServerAdapterOptions {\n    functionRoutes?: boolean;\n    staticPaths?: string[];\n}\n\nexport { StaticGenerateRenderOptions }\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/cloudflare-pages/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/cloudflare-pages/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.cloudflare-pages\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/cloudflare-pages/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/cloudflare-pages\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/cloudflare-pages/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/cloudflare-pages/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/cloudflare-pages/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { type ServerAdapterOptions, viteAdapter } from '../../shared/vite';\nimport fs from 'node:fs';\nimport { join, relative } from 'node:path';\nimport { normalizePathSlash } from '../../../utils/fs';\n\n/** @public */\nexport function cloudflarePagesAdapter(opts: CloudflarePagesAdapterOptions = {}): any {\n  const env = process?.env;\n  return viteAdapter({\n    name: 'cloudflare-pages',\n    origin: env?.CF_PAGES_URL ?? env?.ORIGIN ?? 'https://your.cloudflare.pages.dev',\n    ssg: opts.ssg,\n    staticPaths: opts.staticPaths,\n    cleanStaticGenerated: true,\n\n    config() {\n      return {\n        resolve: {\n          conditions: ['webworker', 'worker'],\n        },\n        ssr: {\n          target: 'webworker',\n          noExternal: true,\n          external: ['node:async_hooks'],\n        },\n        build: {\n          ssr: true,\n          rollupOptions: {\n            output: {\n              format: 'es',\n              hoistTransitiveImports: false,\n            },\n          },\n        },\n        publicDir: false,\n      };\n    },\n\n    async generate({ clientOutDir, serverOutDir, basePathname, assetsDir }) {\n      const routesJsonPath = join(clientOutDir, '_routes.json');\n      const hasRoutesJson = fs.existsSync(routesJsonPath);\n      if (!hasRoutesJson && opts.functionRoutes !== false) {\n        let pathName = assetsDir ? join(basePathname, assetsDir) : basePathname;\n        if (!pathName.endsWith('/')) {\n          pathName += '/';\n        }\n        const routesJson = {\n          version: 1,\n          include: [basePathname + '*'],\n          exclude: [pathName + 'build/*', pathName + 'assets/*'],\n        };\n        await fs.promises.writeFile(routesJsonPath, JSON.stringify(routesJson, undefined, 2));\n      }\n      // https://developers.cloudflare.com/pages/platform/functions/advanced-mode/\n      const workerJsPath = join(clientOutDir, '_worker.js');\n      const hasWorkerJs = fs.existsSync(workerJsPath);\n      if (!hasWorkerJs) {\n        const importPath = relative(clientOutDir, join(serverOutDir, 'entry.cloudflare-pages'));\n        await fs.promises.writeFile(\n          workerJsPath,\n          `import { fetch } from \"${normalizePathSlash(importPath)}\"; export default { fetch };`\n        );\n      }\n    },\n  });\n}\n\n/** @public */\nexport interface CloudflarePagesAdapterOptions extends ServerAdapterOptions {\n  /**\n   * Determines if the build should generate the function invocation routes `_routes.json` file.\n   *\n   * https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes\n   *\n   * Defaults to `true`.\n   */\n  functionRoutes?: boolean;\n  /**\n   * Manually add pathnames that should be treated as static paths and not SSR. For example, when\n   * these pathnames are requested, their response should come from a static file, rather than a\n   * server-side rendered response.\n   */\n  staticPaths?: string[];\n}\n\n/** @public */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/deno-server/adapter.deno-server.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\n// @alpha (undocumented)\nexport function denoServerAdapter(opts?: DenoServerAdapterOptions): any;\n\n// @alpha (undocumented)\nexport interface DenoServerAdapterOptions extends ServerAdapterOptions {\n    // (undocumented)\n    name?: string;\n}\n\nexport { StaticGenerateRenderOptions }\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/deno-server/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/deno-server/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.deno-server\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/deno-server/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/deno-server\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/deno-server/vite/index.d.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/deno-server/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { viteAdapter, type ServerAdapterOptions } from '../../shared/vite';\n\n/** @alpha */\nexport function denoServerAdapter(opts: DenoServerAdapterOptions = {}): any {\n  const env = process?.env;\n  return viteAdapter({\n    name: opts.name || 'deno-server',\n    origin: env?.ORIGIN ?? env?.URL ?? 'https://yoursitename.qwik.dev',\n    ssg: opts.ssg,\n    cleanStaticGenerated: true,\n\n    config() {\n      return {\n        resolve: {\n          conditions: ['webworker', 'worker'],\n        },\n        ssr: {\n          target: 'webworker',\n          noExternal: true,\n          external: ['node:async_hooks'],\n        },\n        build: {\n          ssr: true,\n          target: 'esnext',\n          rollupOptions: {\n            output: {\n              format: 'es',\n              hoistTransitiveImports: false,\n            },\n          },\n        },\n        publicDir: false,\n      };\n    },\n  });\n}\n\n/** @alpha */\nexport interface DenoServerAdapterOptions extends ServerAdapterOptions {\n  name?: string;\n}\n\n/** @alpha */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/netlify-edge/adapter.netlify-edge.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\n// @public (undocumented)\nexport function netlifyEdgeAdapter(opts?: NetlifyEdgeAdapterOptions): any;\n\n// @public (undocumented)\nexport interface NetlifyEdgeAdapterOptions extends ServerAdapterOptions {\n    excludedPath?: string | string[];\n    functionRoutes?: boolean;\n    staticPaths?: string[];\n}\n\nexport { StaticGenerateRenderOptions }\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/netlify-edge/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/netlify-edge/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.netlify-edge\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/netlify-edge/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/netlify-edge\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/netlify-edge/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/netlify-edge/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/netlify-edge/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { getParentDir, type ServerAdapterOptions, viteAdapter } from '../../shared/vite';\nimport fs, { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { basePathname } from '@qwik-city-plan';\n\n/** @public */\nexport function netlifyEdgeAdapter(opts: NetlifyEdgeAdapterOptions = {}): any {\n  const env = process?.env;\n  return viteAdapter({\n    name: 'netlify-edge',\n    origin: env?.ORIGIN ?? env?.URL ?? 'https://yoursitename.netlify.app',\n    ssg: opts.ssg,\n    staticPaths: opts.staticPaths,\n    cleanStaticGenerated: true,\n\n    config(config) {\n      const outDir = config.build?.outDir || '.netlify/edge-functions/entry.netlify-edge';\n      return {\n        resolve: {\n          conditions: ['webworker', 'worker'],\n        },\n        ssr: {\n          target: 'webworker',\n          noExternal: true,\n          external: ['node:async_hooks'],\n        },\n        build: {\n          ssr: true,\n          outDir,\n          rollupOptions: {\n            output: {\n              format: 'es',\n              hoistTransitiveImports: false,\n            },\n          },\n        },\n        publicDir: false,\n      };\n    },\n\n    async generate({ serverOutDir }) {\n      if (opts.functionRoutes !== false) {\n        // https://docs.netlify.com/edge-functions/create-integration/#generate-declarations\n\n        const excludedPath: string[] = [];\n        if (typeof opts.excludedPath === 'string') {\n          excludedPath.push(opts.excludedPath);\n        } else if (Array.isArray(opts.excludedPath)) {\n          excludedPath.push(...opts.excludedPath);\n        } else {\n          excludedPath.push(\n            '/build/*',\n            '/favicon.ico',\n            '/robots.txt',\n            '/mainifest.json',\n            '/~partytown/*',\n            '/service-worker.js',\n            '/sitemap.xml'\n          );\n        }\n\n        const netlifyEdgeManifest = {\n          functions: [\n            {\n              path: basePathname + '*',\n              function: 'entry.netlify-edge',\n              cache: 'manual',\n              excludedPath,\n            },\n          ],\n          version: 1,\n        };\n\n        const jsPath = join(serverOutDir, 'entry.netlify-edge.js');\n        const mjsPath = join(serverOutDir, 'entry.netlify-edge.mjs');\n\n        if (existsSync(mjsPath)) {\n          await fs.promises.writeFile(\n            jsPath,\n            [\n              `import entry_netlifyEdge from './entry.netlify-edge.mjs';`,\n              `export default entry_netlifyEdge;`,\n            ].join('\\n')\n          );\n        }\n\n        const netlifyEdgeFnsDir = getParentDir(serverOutDir, 'edge-functions');\n        await fs.promises.writeFile(\n          join(netlifyEdgeFnsDir, 'manifest.json'),\n          JSON.stringify(netlifyEdgeManifest, null, 2)\n        );\n      }\n    },\n  });\n}\n\n/** @public */\nexport interface NetlifyEdgeAdapterOptions extends ServerAdapterOptions {\n  /**\n   * Determines if the build should generate the edge functions declarations `manifest.json` file.\n   *\n   * https://docs.netlify.com/edge-functions/declarations/\n   *\n   * Defaults to `true`.\n   */\n  functionRoutes?: boolean;\n  /**\n   * Manually add pathnames that should be treated as static paths and not SSR. For example, when\n   * these pathnames are requested, their response should come from a static file, rather than a\n   * server-side rendered response.\n   */\n  staticPaths?: string[];\n  /**\n   * Manually add path pattern that should be excluded from the edge function routes that are\n   * created by the 'manifest.json' file.\n   *\n   * If not specified, the following paths are excluded by default:\n   *\n   * - /build/*\n   * - /favicon.ico\n   * - /robots.txt\n   * - /mainifest.json\n   * - /~partytown/*\n   * - /service-worker.js\n   * - /sitemap.xml\n   *\n   * https://docs.netlify.com/edge-functions/declarations/#declare-edge-functions-in-netlify-toml\n   */\n  excludedPath?: string | string[];\n}\n\n/** @public */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/node-server/adapter.node-server.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\n// @alpha (undocumented)\nexport function nodeServerAdapter(opts?: NodeServerAdapterOptions): any;\n\n// @alpha (undocumented)\nexport interface NodeServerAdapterOptions extends ServerAdapterOptions {\n    // (undocumented)\n    name?: string;\n}\n\nexport { StaticGenerateRenderOptions }\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/node-server/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/node-server/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.node-server\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/node-server/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/node-server\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/node-server/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/node-server/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/node-server/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { viteAdapter, type ServerAdapterOptions } from '../../shared/vite';\n\n/** @alpha */\nexport function nodeServerAdapter(opts: NodeServerAdapterOptions = {}): any {\n  const env = process?.env;\n  return viteAdapter({\n    name: opts.name || 'node-server',\n    origin: env?.ORIGIN ?? env?.URL ?? 'https://yoursitename.qwik.dev',\n    ssg: opts.ssg,\n    cleanStaticGenerated: true,\n\n    config() {\n      return {\n        ssr: {\n          target: 'node',\n        },\n        build: {\n          ssr: true,\n        },\n        publicDir: false,\n      };\n    },\n  });\n}\n\n/** @alpha */\nexport interface NodeServerAdapterOptions extends ServerAdapterOptions {\n  name?: string;\n}\n\n/** @alpha */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/shared/adapter.shared.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { Plugin as Plugin_2 } from 'vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport type { UserConfig } from 'vite';\n\n// @public (undocumented)\nexport interface AdapterSSGOptions extends Omit<StaticGenerateRenderOptions, 'outDir' | 'origin'> {\n    exclude?: string[];\n    include: string[];\n    origin?: string;\n}\n\n// @public (undocumented)\nexport function getParentDir(startDir: string, dirName: string): string;\n\n// @public (undocumented)\nexport const NOT_FOUND_PATHS_ID = \"@qwik-city-not-found-paths\";\n\n// @public (undocumented)\nexport const RESOLVED_NOT_FOUND_PATHS_ID = \"@qwik-city-not-found-paths.js\";\n\n// @public (undocumented)\nexport const RESOLVED_STATIC_PATHS_ID = \"@qwik-city-static-paths.js\";\n\n// @public (undocumented)\nexport interface ServerAdapterOptions {\n    ssg?: AdapterSSGOptions | null;\n}\n\n// @public (undocumented)\nexport const STATIC_PATHS_ID = \"@qwik-city-static-paths\";\n\n// Warning: (ae-forgotten-export) The symbol \"ViteAdapterPluginOptions\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport function viteAdapter(opts: ViteAdapterPluginOptions): Plugin_2<never>;\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/shared/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/shared/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.shared\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/shared/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/shared\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/shared/vite/index.d.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/shared/vite/index.ts",
    "content": "import type { Plugin, UserConfig } from 'vite';\nimport type { QwikCityPlugin } from '@builder.io/qwik-city/vite';\nimport type { QwikVitePlugin } from '@builder.io/qwik/optimizer';\nimport type {\n  StaticGenerateOptions,\n  StaticGenerateRenderOptions,\n} from '@builder.io/qwik-city/static';\nimport type { BuildRoute } from '../../../buildtime/types';\nimport fs from 'node:fs';\nimport { basename, dirname, join, resolve } from 'node:path';\nimport { postBuild } from './post-build';\n\n/** @public */\nexport function viteAdapter(opts: ViteAdapterPluginOptions) {\n  let qwikCityPlugin: QwikCityPlugin | null = null;\n  let qwikVitePlugin: QwikVitePlugin | null = null;\n  let serverOutDir: string | null = null;\n  let renderModulePath: string | null = null;\n  let qwikCityPlanModulePath: string | null = null;\n  let isSsrBuild = false;\n  let format = 'esm';\n  const outputEntries: string[] = [];\n\n  const plugin: Plugin<never> = {\n    name: `vite-plugin-qwik-city-${opts.name}`,\n    enforce: 'post',\n    apply: 'build',\n\n    config(config) {\n      if (typeof opts.config === 'function') {\n        config = opts.config(config);\n      }\n      config.define = {\n        'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),\n        ...config.define,\n      };\n      return config;\n    },\n\n    configResolved(config) {\n      isSsrBuild = !!config.build.ssr;\n\n      if (isSsrBuild) {\n        qwikCityPlugin = config.plugins.find(\n          (p) => p.name === 'vite-plugin-qwik-city'\n        ) as QwikCityPlugin;\n        if (!qwikCityPlugin) {\n          throw new Error('Missing vite-plugin-qwik-city');\n        }\n        qwikVitePlugin = config.plugins.find(\n          (p) => p.name === 'vite-plugin-qwik'\n        ) as QwikVitePlugin;\n        if (!qwikVitePlugin) {\n          throw new Error('Missing vite-plugin-qwik');\n        }\n        serverOutDir = config.build.outDir;\n\n        if (config.build?.ssr !== true) {\n          throw new Error(\n            `\"build.ssr\" must be set to \"true\" in order to use the \"${opts.name}\" adapter.`\n          );\n        }\n\n        if (!config.build?.rollupOptions?.input) {\n          throw new Error(\n            `\"build.rollupOptions.input\" must be set in order to use the \"${opts.name}\" adapter.`\n          );\n        }\n\n        // @ts-ignore `format` removed in Vite 5\n        if (config.ssr?.format === 'cjs') {\n          format = 'cjs';\n        }\n      }\n    },\n\n    generateBundle(_, bundles) {\n      if (isSsrBuild) {\n        outputEntries.length = 0;\n\n        for (const fileName in bundles) {\n          const chunk = bundles[fileName];\n          if (chunk.type === 'chunk' && chunk.isEntry) {\n            outputEntries.push(fileName);\n\n            if (chunk.name === 'entry.ssr') {\n              renderModulePath = join(serverOutDir!, fileName);\n            } else if (chunk.name === '@qwik-city-plan') {\n              qwikCityPlanModulePath = join(serverOutDir!, fileName);\n            }\n          }\n        }\n\n        if (!renderModulePath) {\n          throw new Error(\n            'Unable to find \"entry.ssr\" entry point. Did you forget to add it to \"build.rollupOptions.input\"?'\n          );\n        }\n\n        if (!qwikCityPlanModulePath) {\n          throw new Error(\n            'Unable to find \"@qwik-city-plan\" entry point. Did you forget to add it to \"build.rollupOptions.input\"?'\n          );\n        }\n      }\n    },\n\n    closeBundle: {\n      sequential: true,\n      async handler() {\n        if (\n          isSsrBuild &&\n          opts.ssg !== null &&\n          serverOutDir &&\n          qwikCityPlugin?.api &&\n          qwikVitePlugin?.api\n        ) {\n          const staticPaths: string[] = opts.staticPaths || [];\n          const routes = qwikCityPlugin.api.getRoutes();\n          const basePathname = qwikCityPlugin.api.getBasePathname();\n          const clientOutDir = qwikVitePlugin.api.getClientOutDir()!;\n          const clientPublicOutDir = qwikVitePlugin.api.getClientPublicOutDir()!;\n          const assetsDir = qwikVitePlugin.api.getAssetsDir();\n\n          const rootDir = qwikVitePlugin.api.getRootDir() ?? undefined;\n          if (renderModulePath && qwikCityPlanModulePath && clientOutDir && clientPublicOutDir) {\n            let ssgOrigin = opts.ssg?.origin ?? opts.origin;\n            if (!ssgOrigin) {\n              ssgOrigin = `https://yoursite.qwik.dev`;\n            }\n            // allow for capacitor:// or http://\n            if (ssgOrigin.length > 0 && !/:\\/\\//.test(ssgOrigin)) {\n              ssgOrigin = `https://${ssgOrigin}`;\n            }\n            if (ssgOrigin.startsWith('//')) {\n              ssgOrigin = `https:${ssgOrigin}`;\n            }\n            try {\n              ssgOrigin = new URL(ssgOrigin).origin;\n            } catch (e) {\n              this.warn(\n                `Invalid \"origin\" option: \"${ssgOrigin}\". Using default origin: \"https://yoursite.qwik.dev\"`\n              );\n              ssgOrigin = `https://yoursite.qwik.dev`;\n            }\n\n            const staticGenerate = await import('../../../static');\n            const generateOpts: StaticGenerateOptions = {\n              maxWorkers: opts.maxWorkers,\n              basePathname,\n              outDir: clientPublicOutDir,\n              rootDir,\n              ...opts.ssg,\n              origin: ssgOrigin,\n              renderModulePath,\n              qwikCityPlanModulePath,\n            };\n\n            const staticGenerateResult = await staticGenerate.generate(generateOpts);\n            if (staticGenerateResult.errors > 0) {\n              const err = new Error(\n                `Error while running SSG from \"${opts.name}\" adapter. At least one path failed to render.`\n              );\n              err.stack = undefined;\n              this.error(err);\n            }\n\n            staticPaths.push(...staticGenerateResult.staticPaths);\n\n            const { staticPathsCode, notFoundPathsCode } = await postBuild(\n              clientPublicOutDir,\n              assetsDir ? join(basePathname, assetsDir) : basePathname,\n              staticPaths,\n              format,\n              !!opts.cleanStaticGenerated\n            );\n\n            await Promise.all([\n              fs.promises.writeFile(join(serverOutDir, RESOLVED_STATIC_PATHS_ID), staticPathsCode),\n              fs.promises.writeFile(\n                join(serverOutDir, RESOLVED_NOT_FOUND_PATHS_ID),\n                notFoundPathsCode\n              ),\n            ]);\n            if (typeof opts.generate === 'function') {\n              await opts.generate({\n                outputEntries,\n                serverOutDir,\n                clientOutDir,\n                clientPublicOutDir,\n                basePathname,\n                routes,\n                assetsDir,\n                warn: (message) => this.warn(message),\n                error: (message) => this.error(message),\n              });\n            }\n            this.warn(\n              `\\n==============================================` +\n                `\\nNote: Make sure that you are serving the built files with proper cache headers.` +\n                `\\nSee https://qwik.dev/docs/deployments/#cache-headers for more information.` +\n                `\\n==============================================`\n            );\n          }\n          if (opts.ssg !== null) {\n            /**\n             * HACK: for some reason the build hangs after SSG. `why-is-node-running` shows 4\n             * culprits:\n             *\n             * ```\n             * There are 4 handle(s) keeping the process running.\n             *\n             * # CustomGC\n             * ./node_modules/.pnpm/lightningcss@1.30.1/node_modules/lightningcss/node/index.js:20 - module.exports = require(`lightningcss-${parts.join('-')}`);\n             *\n             * # CustomGC\n             * ./node_modules/.pnpm/@tailwindcss+oxide@4.1.12/node_modules/@tailwindcss/oxide/index.js:229 - return require('@tailwindcss/oxide-linux-x64-gnu')\n             *\n             * # Timeout\n             * node_modules/.vite-temp/vite.config.timestamp-1755270314169-a2a97ad5233f9.mjs:357\n             * ./node_modules/.pnpm/vite@7.1.2_@types+node@24.3.0_jiti@2.5.1_lightningcss@1.30.1_terser@5.43.1_tsx@4.20.4_yaml@2.8.1/node_modules/vite/dist/node/chunks/dep-CMEinpL-.js:36657 - return (await import(pathToFileURL(tempFileName).href)).default;\n             *\n             * # CustomGC\n             * ./packages/qwik/dist/optimizer.mjs:1328 - const mod2 = module.default.createRequire(import.meta.url)(`../bindings/${triple.platformArchABI}`);\n             * ```\n             *\n             * For now, we'll force exit the process after SSG with some delay.\n             */\n            setTimeout(() => {\n              process.exit(0);\n            }, 5000).unref();\n          }\n        }\n      },\n    },\n  };\n\n  return plugin;\n}\n\n/** @public */\nexport function getParentDir(startDir: string, dirName: string) {\n  const root = resolve('/');\n  let dir = startDir;\n  for (let i = 0; i < 20; i++) {\n    dir = dirname(dir);\n    if (basename(dir) === dirName) {\n      return dir;\n    }\n    if (dir === root) {\n      break;\n    }\n  }\n  throw new Error(`Unable to find \"${dirName}\" directory from \"${startDir}\"`);\n}\n\n/** @public */\ninterface ViteAdapterPluginOptions {\n  name: string;\n  origin: string;\n  staticPaths?: string[];\n  ssg?: AdapterSSGOptions | null;\n  cleanStaticGenerated?: boolean;\n  maxWorkers?: number;\n  config?: (config: UserConfig) => UserConfig;\n  generate?: (generateOpts: {\n    outputEntries: string[];\n    clientOutDir: string;\n    clientPublicOutDir: string;\n    serverOutDir: string;\n    basePathname: string;\n    routes: BuildRoute[];\n    assetsDir?: string;\n    warn: (message: string) => void;\n    error: (message: string) => void;\n  }) => Promise<void>;\n}\n\n/** @public */\nexport interface ServerAdapterOptions {\n  /**\n   * Options the adapter should use when running Static Site Generation (SSG). Defaults the `filter`\n   * to \"auto\" which will attempt to automatically decides if a page can be statically generated and\n   * does not have dynamic data, or if it the page should instead be rendered on the server (SSR).\n   * Setting to `null` will prevent any pages from being statically generated.\n   */\n  ssg?: AdapterSSGOptions | null;\n}\n\n/** @public */\nexport interface AdapterSSGOptions extends Omit<StaticGenerateRenderOptions, 'outDir' | 'origin'> {\n  /** Defines routes that should be static generated. Accepts wildcard behavior. */\n  include: string[];\n  /**\n   * Defines routes that should not be static generated. Accepts wildcard behavior. `exclude` always\n   * take priority over `include`.\n   */\n  exclude?: string[];\n\n  /**\n   * The URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For\n   * example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the\n   * `origin` does not include a `pathname`.\n   *\n   * The `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate\n   * a complete URL rather than just the `pathname`. For example, in order to render a correct\n   * canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.\n   *\n   * If the site also starts with a pathname other than `/`, please use the `basePathname` option in\n   * the Qwik City config options.\n   */\n  origin?: string;\n}\n\n/** @public */\nexport const STATIC_PATHS_ID = '@qwik-city-static-paths';\n\n/** @public */\nexport const RESOLVED_STATIC_PATHS_ID = `${STATIC_PATHS_ID}.js`;\n\n/** @public */\nexport const NOT_FOUND_PATHS_ID = '@qwik-city-not-found-paths';\n\n/** @public */\nexport const RESOLVED_NOT_FOUND_PATHS_ID = `${NOT_FOUND_PATHS_ID}.js`;\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/shared/vite/post-build.ts",
    "content": "import fs from 'node:fs';\nimport { join } from 'node:path';\nimport { getErrorHtml } from '@builder.io/qwik-city/middleware/request-handler';\n\nexport async function postBuild(\n  clientOutDir: string,\n  pathName: string,\n  userStaticPaths: string[],\n  format: string,\n  cleanStatic: boolean\n) {\n  if (pathName && !pathName.endsWith('/')) {\n    pathName += '/';\n  }\n  const ignorePathnames = new Set([pathName + 'build/', pathName + 'assets/']);\n\n  const staticPaths = new Set(userStaticPaths.map(normalizeTrailingSlash));\n  const notFounds: string[][] = [];\n\n  const loadItem = async (fsDir: string, fsName: string, pathname: string) => {\n    pathname = normalizeTrailingSlash(pathname);\n    if (ignorePathnames.has(pathname)) {\n      return;\n    }\n\n    const fsPath = join(fsDir, fsName);\n\n    if (fsName === 'index.html' || fsName === 'q-data.json') {\n      // static index.html file\n      if (!staticPaths.has(pathname) && cleanStatic) {\n        await fs.promises.unlink(fsPath);\n      }\n      return;\n    }\n\n    if (fsName === '404.html') {\n      // static 404.html file\n      const notFoundHtml = await fs.promises.readFile(fsPath, 'utf-8');\n      notFounds.push([pathname, notFoundHtml]);\n      return;\n    }\n\n    const stat = await fs.promises.stat(fsPath);\n    if (stat.isDirectory()) {\n      await loadDir(fsPath, pathname + fsName + '/');\n    } else if (stat.isFile()) {\n      staticPaths.add(pathname + fsName);\n    }\n  };\n\n  const loadDir = async (fsDir: string, pathname: string) => {\n    const itemNames = await fs.promises.readdir(fsDir);\n    await Promise.all(itemNames.map((i) => loadItem(fsDir, i, pathname)));\n  };\n\n  if (fs.existsSync(clientOutDir)) {\n    await loadDir(clientOutDir, pathName);\n  }\n\n  const notFoundPathsCode = createNotFoundPathsModule(pathName, notFounds, format);\n  const staticPathsCode = createStaticPathsModule(pathName, staticPaths, format);\n\n  return {\n    notFoundPathsCode,\n    staticPathsCode,\n  };\n}\n\nfunction normalizeTrailingSlash(pathname: string) {\n  if (!pathname.endsWith('/')) {\n    return pathname + '/';\n  }\n  return pathname;\n}\n\nfunction createNotFoundPathsModule(basePathname: string, notFounds: string[][], format: string) {\n  notFounds.sort((a, b) => {\n    if (a[0].length > b[0].length) {\n      return -1;\n    }\n    if (a[0].length < b[0].length) {\n      return 1;\n    }\n    if (a[0] < b[0]) {\n      return -1;\n    }\n    if (a[0] > b[0]) {\n      return 1;\n    }\n    return 0;\n  });\n\n  if (!notFounds.some((r) => r[0] === basePathname)) {\n    const html = getErrorHtml(404, 'Resource Not Found');\n    notFounds.push([basePathname, html]);\n  }\n\n  const c: string[] = [];\n\n  c.push(`const notFounds = ${JSON.stringify(notFounds, null, 2)};`);\n\n  c.push(`function getNotFound(p) {`);\n  c.push(`  for (const r of notFounds) {`);\n  c.push(`    if (p.startsWith(r[0])) {`);\n  c.push(`      return r[1];`);\n  c.push(`    }`);\n  c.push(`  }`);\n  c.push(`  return \"Resource Not Found\";`);\n  c.push(`}`);\n\n  if (format === 'cjs') {\n    c.push('exports.getNotFound = getNotFound;');\n  } else {\n    c.push('export { getNotFound };');\n  }\n\n  return c.join('\\n');\n}\n\nfunction createStaticPathsModule(basePathname: string, staticPaths: Set<string>, format: string) {\n  const assetsPath = basePathname + 'assets/';\n  const baseBuildPath = basePathname + 'build/';\n\n  const c: string[] = [];\n\n  c.push(\n    `const staticPaths = new Set(${JSON.stringify(\n      Array.from(new Set<string>(staticPaths)).sort()\n    )});`\n  );\n\n  c.push(`function isStaticPath(method, url) {`);\n  c.push(`  if (method.toUpperCase() !== 'GET') {`);\n  c.push(`    return false;`);\n  c.push(`  }`);\n  c.push(`  const p = url.pathname;`);\n  c.push(`  if (p.startsWith(${JSON.stringify(baseBuildPath)})) {`);\n  c.push(`    return true;`);\n  c.push(`  }`);\n  c.push(`  if (p.startsWith(${JSON.stringify(assetsPath)})) {`);\n  c.push(`    return true;`);\n  c.push(`  }`);\n  c.push(`  if (staticPaths.has(p)) {`);\n  c.push(`    return true;`);\n  c.push(`  }`);\n  c.push(`  if (p.endsWith('/q-data.json')) {`);\n  c.push(`    const pWithoutQdata = p.replace(/\\\\/q-data.json$/, '');`);\n  c.push(`    if (staticPaths.has(pWithoutQdata + '/')) {`);\n  c.push(`      return true;`);\n  c.push(`    }`);\n  c.push(`    if (staticPaths.has(pWithoutQdata)) {`);\n  c.push(`      return true;`);\n  c.push(`    }`);\n  c.push(`  }`);\n  c.push(`  return false;`);\n  c.push(`}`);\n\n  if (format === 'cjs') {\n    c.push('exports.isStaticPath = isStaticPath;');\n  } else {\n    c.push('export { isStaticPath };');\n  }\n\n  return c.join('\\n');\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/static/adapter.static.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { StaticGenerateRenderOptions } from '../../../static';\n\n// @public (undocumented)\nexport function staticAdapter(opts: StaticGenerateAdapterOptions): any;\n\n// @public (undocumented)\nexport interface StaticGenerateAdapterOptions extends Omit<StaticGenerateRenderOptions, 'outDir'> {\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/static/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/static/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.static\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/static/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/static\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/static/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/static/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/static/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '../../../static';\nimport { viteAdapter } from '../../shared/vite';\n\n/** @public */\nexport function staticAdapter(opts: StaticGenerateAdapterOptions): any {\n  return viteAdapter({\n    name: 'static-generate',\n    origin: opts.origin,\n    ssg: {\n      include: ['/*'],\n      ...opts,\n    },\n  });\n}\n\n/** @public */\nexport interface StaticGenerateAdapterOptions extends Omit<StaticGenerateRenderOptions, 'outDir'> {}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/vercel-edge/adapter.vercel-edge.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { ServerAdapterOptions } from '../../shared/vite';\nimport type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\n\nexport { StaticGenerateRenderOptions }\n\n// @public (undocumented)\nexport function vercelEdgeAdapter(opts?: VercelEdgeAdapterOptions): any;\n\n// @public (undocumented)\nexport interface VercelEdgeAdapterOptions extends ServerAdapterOptions {\n    outputConfig?: boolean;\n    staticPaths?: string[];\n    target?: 'webworker' | 'node';\n    vcConfigEntryPoint?: string;\n    vcConfigEnvVarsInUse?: string[];\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/vercel-edge/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/adapters/vercel-edge/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"adapter.vercel-edge\",\n    \"reportFolder\": \"<projectFolder>/src/adapters/vercel-edge/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/adapters/vercel-edge\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/adapters/vercel-edge/vite/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/vite/vercel/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/adapters/vercel-edge/vite/index.ts",
    "content": "import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static';\nimport { getParentDir, type ServerAdapterOptions, viteAdapter } from '../../shared/vite';\nimport fs from 'node:fs';\nimport { dirname, join } from 'node:path';\n\n/** @public */\nexport function vercelEdgeAdapter(opts: VercelEdgeAdapterOptions = {}): any {\n  return viteAdapter({\n    name: 'vercel-edge',\n    origin: process?.env?.VERCEL_URL || 'https://yoursitename.vercel.app',\n    ssg: opts.ssg,\n    staticPaths: opts.staticPaths,\n    cleanStaticGenerated: true,\n\n    config(config) {\n      const outDir =\n        config.build?.outDir || join('.vercel', 'output', 'functions', '_qwik-city.func');\n      return {\n        resolve: {\n          conditions:\n            opts.target === 'node'\n              ? ['node', 'import', 'module', 'browser', 'default']\n              : ['edge-light', 'webworker', 'worker', 'browser', 'module', 'main'],\n        },\n        ssr: {\n          target: opts.target === 'node' ? 'node' : 'webworker',\n          noExternal: true,\n        },\n        build: {\n          ssr: true,\n          outDir,\n          rollupOptions: {\n            output: {\n              format: 'es',\n              hoistTransitiveImports: false,\n            },\n          },\n        },\n        publicDir: false,\n      };\n    },\n\n    async generate({ clientPublicOutDir, serverOutDir, basePathname, outputEntries }) {\n      const vercelOutputDir = getParentDir(serverOutDir, 'output');\n\n      if (opts.outputConfig !== false) {\n        // https://vercel.com/docs/build-output-api/v3#features/edge-middleware\n        const vercelOutputConfig = {\n          routes: [\n            { handle: 'filesystem' },\n            {\n              src: basePathname + '.*',\n              dest: '/_qwik-city',\n            },\n          ],\n          version: 3,\n        };\n\n        await fs.promises.writeFile(\n          join(vercelOutputDir, 'config.json'),\n          JSON.stringify(vercelOutputConfig, null, 2)\n        );\n      }\n\n      let entrypoint = opts.vcConfigEntryPoint;\n      if (!entrypoint) {\n        if (outputEntries.some((n) => n === 'entry.vercel-edge.mjs')) {\n          entrypoint = 'entry.vercel-edge.mjs';\n        } else {\n          entrypoint = 'entry.vercel-edge.js';\n        }\n      }\n\n      // https://vercel.com/docs/build-output-api/v3#vercel-primitives/edge-functions/configuration\n      const vcConfigPath = join(serverOutDir, '.vc-config.json');\n      const vcConfig = {\n        runtime: 'edge',\n        entrypoint,\n        envVarsInUse: opts.vcConfigEnvVarsInUse,\n      };\n      await fs.promises.writeFile(vcConfigPath, JSON.stringify(vcConfig, null, 2));\n\n      // vercel places all of the static files into the .vercel/output/static directory\n      // move from the dist directory to vercel's output static directory\n      let vercelStaticDir = join(vercelOutputDir, 'static');\n\n      const basePathnameParts = basePathname.split('/').filter((p) => p.length > 0);\n      if (basePathnameParts.length > 0) {\n        // for vercel we need to add the base path to the static dir\n        vercelStaticDir = join(vercelStaticDir, ...basePathnameParts);\n      }\n\n      // ensure we remove any existing static dir\n      await fs.promises.rm(vercelStaticDir, { recursive: true, force: true });\n\n      // ensure the containing directory exists we're moving the static dir to exists\n      await fs.promises.mkdir(dirname(vercelStaticDir), { recursive: true });\n\n      // move the dist directory to the vercel output static directory location\n      await fs.promises.rename(clientPublicOutDir, vercelStaticDir);\n    },\n  });\n}\n\n/** @public */\nexport interface VercelEdgeAdapterOptions extends ServerAdapterOptions {\n  /**\n   * Determines if the build should auto-generate the `.vercel/output/config.json` config.\n   *\n   * Defaults to `true`.\n   */\n  outputConfig?: boolean;\n  /**\n   * The `entrypoint` property in the `.vc-config.json` file. Indicates the initial file where code\n   * will be executed for the Edge Function.\n   *\n   * Defaults to `entry.vercel-edge.js`.\n   */\n  vcConfigEntryPoint?: string;\n  /**\n   * The `envVarsInUse` property in the `.vc-config.json` file. List of environment variable names\n   * that will be available for the Edge Function to utilize.\n   *\n   * Defaults to `undefined`.\n   */\n  vcConfigEnvVarsInUse?: string[];\n  /**\n   * Manually add pathnames that should be treated as static paths and not SSR. For example, when\n   * these pathnames are requested, their response should come from a static file, rather than a\n   * server-side rendered response.\n   */\n  staticPaths?: string[];\n\n  /**\n   * Define the `target` property in the `ssr` object in the `vite.config.ts` file.\n   *\n   * Defaults to `webworker`.\n   */\n  target?: 'webworker' | 'node';\n}\n\n/** @public */\nexport type { StaticGenerateRenderOptions };\n"
  },
  {
    "path": "packages/qwik-city/src/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"bundledPackages\": [],\n  \"compiler\": {\n    \"overrideTsconfig\": {\n      \"compilerOptions\": {\n        \"target\": \"ES2020\",\n        \"module\": \"ES2020\",\n        \"isolatedModules\": true,\n        \"esModuleInterop\": true,\n        \"skipLibCheck\": true\n      },\n      \"include\": [\"../../dist-dev/dts-out/packages/qwik-city/**/*.d.ts\"]\n    },\n    \"skipLibCheck\": true\n  },\n  \"docModel\": {\n    \"enabled\": false\n  },\n  \"dtsRollup\": {\n    \"enabled\": false\n  },\n  \"tsdocMetadata\": {\n    \"enabled\": false\n  },\n  \"messages\": {\n    \"compilerMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    },\n    \"extractorMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    },\n    \"tsdocMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/build-endpoints.unit.ts",
    "content": "import { equal } from 'uvu/assert';\nimport { testAppSuite } from '../utils/test-suite';\n\nconst test = testAppSuite('Build Endpoints');\n\ntest('endpoint', ({ assertRoute }) => {\n  const r = assertRoute('/api/data.json');\n  equal(r.id, 'CommonApiDataRoute');\n  equal(r.pattern, /^\\/api\\/data\\.json\\/?$/);\n  equal(r.paramNames.length, 0);\n});\n\ntest('endpoint w/ params', ({ assertRoute }) => {\n  const r = assertRoute('/api/[org]/[user].json');\n  equal(r.id, 'CommonApiOrgUserRoute');\n  equal(r.pattern, /^\\/api\\/([^/]+?)\\/([^/]+?)\\.json\\/?$/);\n  equal(r.paramNames.length, 2);\n  equal(r.paramNames[0], 'org');\n  equal(r.paramNames[1], 'user');\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/build-layout.unit.ts",
    "content": "import { assert, testAppSuite } from '../utils/test-suite';\n\nconst test = testAppSuite('Build Layout');\n\ntest('total layouts', ({ ctx: { layouts } }) => {\n  assert.equal(layouts.length, 12, JSON.stringify(layouts, null, 2));\n});\n\ntest('nested named layout', ({ assertLayout }) => {\n  const l = assertLayout('CommonApiLayoutapi');\n  assert.equal(l.layoutType, 'nested');\n  assert.equal(l.layoutName, 'api');\n});\n\ntest('nested layout', ({ assertLayout }) => {\n  const l = assertLayout('CommonAuthLayout');\n  assert.equal(l.layoutType, 'nested');\n  assert.equal(l.layoutName, '');\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/build-menus.unit.ts",
    "content": "import { equal, ok } from 'uvu/assert';\nimport { testAppSuite } from '../utils/test-suite';\n\nconst test = testAppSuite('Build Menu');\n\ntest('menus found', ({ ctx: { menus } }) => {\n  equal(menus.length, 1);\n});\n\ntest('docs menu', ({ ctx: { menus } }) => {\n  const docsMenu = menus.find((r) => r.pathname === '/docs/')!;\n  ok(docsMenu, 'found docs menu');\n  equal(docsMenu.pathname, '/docs/');\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/build-pages-rewrited.unit.ts",
    "content": "import * as assert from 'uvu/assert';\nimport { testAppSuite } from '../utils/test-suite';\n\nconst test = testAppSuite('Build Pages Rewrited', {\n  rewriteRoutes: [\n    {\n      paths: {\n        docs: 'documentazione',\n        'getting-started': 'per-iniziare',\n        'about-us': 'informazioni',\n        products: 'prodotti',\n      },\n    },\n    {\n      prefix: 'it',\n      paths: {\n        docs: 'documentazione',\n        'getting-started': 'per-iniziare',\n        'about-us': 'informazioni',\n        products: 'prodotti',\n      },\n    },\n  ],\n});\n\ntest('translated pathname / with prefix', ({ assertRoute }) => {\n  const r = assertRoute('/it/');\n  assert.equal(r.id, 'CommonRouteIT');\n  assert.equal(r.pathname, '/it/');\n  assert.equal(r.routeName, 'it/');\n  assert.equal(r.pattern, /^\\/it\\/$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.segments[0][0].content, 'it');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/layout.tsx')\n  );\n  assert.ok(r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/index.tsx'));\n});\n\ntest('translated pathname /docs/getting-started with prefix', ({ assertRoute }) => {\n  const r = assertRoute('/it/documentazione/per-iniziare/');\n  assert.equal(r.id, 'DocsGettingstartedRouteIT');\n  assert.equal(r.pathname, '/it/documentazione/per-iniziare/');\n  assert.equal(r.routeName, 'it/documentazione/per-iniziare/');\n  assert.equal(r.pattern, /^\\/it\\/documentazione\\/per-iniziare\\/?/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.segments[0][0].content, 'it');\n  assert.equal(r.segments[1][0].content, 'documentazione');\n  assert.equal(r.segments[2][0].content, 'per-iniziare');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/getting-started/index.md')\n  );\n});\n\ntest('translated pathname /docs/[category]/[id] with prefix', ({ assertRoute }) => {\n  const r = assertRoute('/it/documentazione/[category]/[id]/');\n  assert.equal(r.id, 'DocsCategoryIdRouteIT');\n  assert.equal(r.pathname, '/it/documentazione/[category]/[id]/');\n  assert.equal(r.routeName, 'it/documentazione/[category]/[id]/');\n  assert.equal(r.pattern, /^\\/it\\/documentazione\\/([^/]+?)\\/([^/]+?)\\/?/);\n  assert.equal(r.paramNames[0], 'category');\n  assert.equal(r.paramNames[1], 'id');\n  assert.equal(r.segments[0][0].content, 'it');\n  assert.equal(r.segments[1][0].content, 'documentazione');\n  assert.equal(r.segments[2][0].content, 'category');\n  assert.equal(r.segments[3][0].content, 'id');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/[category]/[id]/index.tsx')\n  );\n});\n\ntest('translated pathname /about-us with prefix', ({ assertRoute }) => {\n  const r = assertRoute('/it/informazioni/');\n  assert.equal(r.id, 'CommonAboutusRouteIT');\n  assert.equal(r.pathname, '/it/informazioni/');\n  assert.equal(r.routeName, 'it/informazioni/');\n  assert.equal(r.pattern, /^\\/it\\/informazioni\\/?/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.segments[0][0].content, 'it');\n  assert.equal(r.segments[1][0].content, 'informazioni');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/about-us/index.tsx')\n  );\n});\n\ntest('translated pathname /products/[id] with prefix', ({ assertRoute }) => {\n  const r = assertRoute('/it/prodotti/[id]/');\n  assert.equal(r.id, 'CommonProductsIdRouteIT');\n  assert.equal(r.pathname, '/it/prodotti/[id]/');\n  assert.equal(r.routeName, 'it/prodotti/[id]/');\n  assert.equal(r.pattern, /^\\/it\\/prodotti\\/([^/]+?)\\/?/);\n  assert.equal(r.paramNames[0], 'id');\n  assert.equal(r.segments[0][0].content, 'it');\n  assert.equal(r.segments[1][0].content, 'prodotti');\n  assert.equal(r.segments[2][0].content, 'id');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/products/[id]/index.tsx')\n  );\n});\n\ntest('translated pathname /docs/getting-started', ({ assertRoute }) => {\n  const r = assertRoute('/documentazione/per-iniziare/');\n  assert.equal(r.id, 'DocsGettingstartedRoute0');\n  assert.equal(r.pathname, '/documentazione/per-iniziare/');\n  assert.equal(r.routeName, 'documentazione/per-iniziare/');\n  assert.equal(r.pattern, /^\\/documentazione\\/per-iniziare\\/?/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.segments[0][0].content, 'documentazione');\n  assert.equal(r.segments[1][0].content, 'per-iniziare');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/getting-started/index.md')\n  );\n});\n\ntest('translated pathname /docs/[category]/[id]', ({ assertRoute }) => {\n  const r = assertRoute('/documentazione/[category]/[id]/');\n  assert.equal(r.id, 'DocsCategoryIdRoute0');\n  assert.equal(r.pathname, '/documentazione/[category]/[id]/');\n  assert.equal(r.routeName, 'documentazione/[category]/[id]/');\n  assert.equal(r.pattern, /^\\/documentazione\\/([^/]+?)\\/([^/]+?)\\/?/);\n  assert.equal(r.paramNames[0], 'category');\n  assert.equal(r.paramNames[1], 'id');\n  assert.equal(r.segments[0][0].content, 'documentazione');\n  assert.equal(r.segments[1][0].content, 'category');\n  assert.equal(r.segments[2][0].content, 'id');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/docs/[category]/[id]/index.tsx')\n  );\n});\n\ntest('translated pathname /about-us', ({ assertRoute }) => {\n  const r = assertRoute('/informazioni/');\n  assert.equal(r.id, 'CommonAboutusRoute0');\n  assert.equal(r.pathname, '/informazioni/');\n  assert.equal(r.routeName, 'informazioni/');\n  assert.equal(r.pattern, /^\\/informazioni\\/?/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.segments[0][0].content, 'informazioni');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/about-us/index.tsx')\n  );\n});\n\ntest('translated pathname /products/[id]', ({ assertRoute }) => {\n  const r = assertRoute('/prodotti/[id]/');\n  assert.equal(r.id, 'CommonProductsIdRoute0');\n  assert.equal(r.pathname, '/prodotti/[id]/');\n  assert.equal(r.routeName, 'prodotti/[id]/');\n  assert.equal(r.pattern, /^\\/prodotti\\/([^/]+?)\\/?/);\n  assert.equal(r.paramNames[0], 'id');\n  assert.equal(r.segments[0][0].content, 'prodotti');\n  assert.equal(r.segments[1][0].content, 'id');\n  assert.equal(r.layouts.length, 2);\n  assert.ok(r.layouts[0].filePath.endsWith('starters/apps/qwikcity-test/src/routes/layout.tsx'));\n  assert.ok(\n    r.layouts[1].filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/layout.tsx')\n  );\n  assert.ok(\n    r.filePath.endsWith('starters/apps/qwikcity-test/src/routes/(common)/products/[id]/index.tsx')\n  );\n});\n\nconst testWithDuplicatedRoutes = testAppSuite('Duplicated segments with multiple prefixes', {\n  rewriteRoutes: [\n    {\n      prefix: 'de',\n      paths: {\n        produkt: 'produkt',\n      },\n    },\n    {\n      prefix: 'no',\n      paths: {\n        produkt: 'produkt',\n      },\n    },\n    {\n      prefix: 'fi',\n      paths: {\n        produkt: 'tuote',\n      },\n    },\n  ],\n});\n\ntestWithDuplicatedRoutes(\n  'Issue #6375: be able to deal with the same translated pathnames with multiple prefixes ',\n  ({ assertRoute }) => {\n    const r = assertRoute('/produkt/');\n\n    assert.equal(r.pathname, '/produkt/');\n  }\n);\n\nconst testSameRoutes = testAppSuite('Same route with undefined prefixes', {\n  rewriteRoutes: [\n    {\n      prefix: undefined,\n      paths: {},\n    },\n    {\n      prefix: undefined,\n      paths: {\n        produkt: 'produkt',\n      },\n    },\n    {\n      prefix: undefined,\n      paths: {\n        produkt: 'produkt',\n      },\n    },\n  ],\n});\n\ntestSameRoutes(\n  'Issue #6799: Bug while using rewrite routes pointing to the same file',\n  ({ assertRoute }) => {\n    const r = assertRoute('/produkt/');\n    assert.equal(r.pathname, '/produkt/');\n  }\n);\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/build-pages.unit.ts",
    "content": "import { assert } from 'vitest';\nimport { testAppSuite } from '../utils/test-suite';\n\nconst test = testAppSuite('Build Pages');\n\ntest('layoutStop file', ({ assertRoute }) => {\n  const r = assertRoute('/mit/');\n  assert.equal(r.id, 'CommonMitRoute');\n  assert.deepEqual(r.pattern, /^\\/mit\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts.length, 0);\n});\n\ntest('pathless directory', ({ assertRoute }) => {\n  const r = assertRoute('/sign-in/');\n  assert.equal(r.id, 'CommonAuthSigninRoute');\n  assert.deepEqual(r.pattern, /^\\/sign-in\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts.length, 3);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts[1].id, 'CommonLayout');\n  assert.equal(r.layouts[2].id, 'CommonAuthLayout');\n});\n\ntest('index file w/ nested named layout, in directory w/ nested named layout', ({\n  assertRoute,\n}) => {\n  const r = assertRoute('/api/');\n  assert.equal(r.id, 'CommonApiIndexapiRoute');\n  assert.deepEqual(r.pattern, /^\\/api\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts[0].layoutName, '');\n  assert.equal(r.layouts[0].layoutType, 'nested');\n  assert.equal(r.layouts[1].id, 'CommonLayout');\n  assert.equal(r.layouts[1].layoutName, '');\n  assert.equal(r.layouts[1].layoutType, 'nested');\n  assert.equal(r.layouts.length, 3);\n});\n\ntest('index file w/out named layout, in directory w/ named layout', ({ assertRoute }) => {\n  const r = assertRoute('/dashboard/');\n  assert.equal(r.id, 'DashboardRoute');\n  assert.deepEqual(r.pattern, /^\\/dashboard\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts[0].layoutType, 'nested');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('index file in directory w/ nested named layout file', ({ assertRoute }) => {\n  const r = assertRoute('/dashboard/profile/');\n  assert.equal(r.id, 'DashboardProfileRoute');\n  assert.deepEqual(r.pattern, /^\\/dashboard\\/profile\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts[0].layoutType, 'nested');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('index file in directory w/ top named layout file', ({ assertRoute }) => {\n  const r = assertRoute('/dashboard/settings/');\n  assert.equal(r.id, 'DashboardSettingsRoute');\n  assert.deepEqual(r.pattern, /^\\/dashboard\\/settings\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts[0].layoutType, 'nested');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('params route, index file w/out named layout, in directory w/ top layout directory', ({\n  assertRoute,\n}) => {\n  const r = assertRoute('/docs/[category]/[id]/');\n  assert.equal(r.id, 'DocsCategoryIdRoute');\n  assert.deepEqual(r.pattern, /^\\/docs\\/([^/]+?)\\/([^/]+?)\\/?$/);\n  assert.equal(r.paramNames.length, 2);\n  assert.equal(r.paramNames[0], 'category');\n  assert.equal(r.paramNames[1], 'id');\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('markdown index file w/out named layout, in directory w/ top layout directory', ({\n  assertRoute,\n}) => {\n  const r = assertRoute('/docs/overview/');\n  assert.equal(r.id, 'DocsOverviewRoute');\n  assert.deepEqual(r.pattern, /^\\/docs\\/overview\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('markdown file w/out named layout, in directory w/ top layout directory', ({\n  assertRoute,\n}) => {\n  const r = assertRoute('/docs/getting-started/');\n  assert.equal(r.id, 'DocsGettingstartedRoute');\n  assert.deepEqual(r.pattern, /^\\/docs\\/getting-started\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('index file w/out named layout, in directory w/ top layout directory', ({ assertRoute }) => {\n  const r = assertRoute('/docs/');\n  assert.equal(r.id, 'DocsRoute');\n  assert.deepEqual(r.pattern, /^\\/docs\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts[0].layoutName, '');\n  assert.equal(r.layouts[0].layoutType, 'nested');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('named file w/out named layout, in directory w/ layout directory', ({ assertRoute }) => {\n  const r = assertRoute('/about-us/');\n  assert.equal(r.id, 'CommonAboutusRoute');\n  assert.deepEqual(r.pattern, /^\\/about-us\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.layouts[0].id, 'Layout');\n  assert.equal(r.layouts[0].layoutType, 'nested');\n  assert.equal(r.layouts.length, 2);\n});\n\ntest('named tsx file', ({ assertRoute }) => {\n  const r = assertRoute('/about-us/');\n  assert.equal(r.id, 'CommonAboutusRoute');\n  assert.deepEqual(r.pattern, /^\\/about-us\\/?$/);\n  assert.equal(r.paramNames.length, 0);\n});\n\ntest('root index', ({ assertRoute }) => {\n  const r = assertRoute('/');\n  assert.equal(r.id, 'CommonRoute');\n  assert.deepEqual(r.pattern, /^\\/$/);\n  assert.equal(r.paramNames.length, 0);\n  assert.equal(r.paramNames.length, 0);\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/build.ts",
    "content": "import { addError, addWarning } from '../utils/format';\nimport { resolveSourceFiles } from './routing/resolve-source-file';\nimport { walkRoutes } from './routing/walk-routes-dir';\nimport { walkServerPlugins } from './routing/walk-server-plugins';\nimport type { BuildContext, BuildRoute, RewriteRouteOption } from './types';\n\nexport async function build(ctx: BuildContext) {\n  try {\n    await updateBuildContext(ctx);\n    validateBuild(ctx);\n  } catch (e) {\n    addError(ctx, e);\n  }\n\n  for (const d of ctx.diagnostics) {\n    if (d.type === 'error') {\n      throw new Error(d.message);\n    } else {\n      console.warn(d.message);\n    }\n  }\n}\n\nexport async function updateBuildContext(ctx: BuildContext) {\n  if (!ctx.activeBuild) {\n    ctx.activeBuild = new Promise<void>((resolve, reject) => {\n      walkServerPlugins(ctx.opts)\n        .then((serverPlugins) => {\n          ctx.serverPlugins = serverPlugins;\n          return walkRoutes(ctx.opts.routesDir);\n        })\n        .then((sourceFiles) => {\n          const resolved = resolveSourceFiles(ctx.opts, sourceFiles);\n          rewriteRoutes(ctx, resolved);\n          ctx.layouts = resolved.layouts;\n          ctx.routes = resolved.routes;\n          ctx.entries = resolved.entries;\n          ctx.serviceWorkers = resolved.serviceWorkers;\n          ctx.menus = resolved.menus;\n          resolve();\n        }, reject)\n        .finally(() => {\n          ctx.activeBuild = null;\n        });\n    });\n  }\n  return ctx.activeBuild;\n}\n\nfunction rewriteRoutes(ctx: BuildContext, resolvedFiles: ReturnType<typeof resolveSourceFiles>) {\n  if (!ctx.opts.rewriteRoutes || !resolvedFiles.routes) {\n    return;\n  }\n\n  const translatedRoutes: BuildRoute[] = [];\n\n  let segmentsToTranslate = ctx.opts.rewriteRoutes.flatMap((rewriteConfig) => {\n    return Object.keys(rewriteConfig.paths || {});\n  });\n\n  segmentsToTranslate = Array.from(new Set(segmentsToTranslate));\n\n  resolvedFiles.routes.forEach((route) => {\n    // always push the original route\n    translatedRoutes.push(route);\n\n    const currentRouteSegments = route.pathname.split('/');\n    const foundSegmentToTranslate = currentRouteSegments.some((segment) =>\n      segmentsToTranslate.includes(segment)\n    );\n\n    if (foundSegmentToTranslate || route.pathname === '/') {\n      ctx.opts.rewriteRoutes.forEach((config, configIndex) => {\n        // In case it is the root route and there is a prefix\n        // we want to create a root with that prefix\n        // if it doesn't have a prefix, we'll skip it so we won't create a duplicate root route\n        if (route.pathname === '/' && !config.prefix) {\n          return;\n        }\n        const routeToPush = translateRoute(route, config, configIndex);\n\n        if (\n          !translatedRoutes.some(\n            (item) =>\n              item.pathname === routeToPush.pathname && item.routeName === routeToPush.routeName\n          )\n        ) {\n          translatedRoutes.push(routeToPush);\n        }\n      });\n    }\n  });\n\n  resolvedFiles.routes = translatedRoutes;\n}\n\nfunction translateRoute(\n  route: BuildRoute,\n  config: RewriteRouteOption,\n  configIndex: number\n): BuildRoute {\n  const replacePath = (part: string) => (config.paths || {})[part] ?? part;\n\n  const pathnamePrefix = config.prefix ? '/' + config.prefix : '';\n  const routeNamePrefix = config.prefix ? config.prefix + '/' : '';\n  const idSuffix = config.prefix?.toUpperCase().replace(/-/g, '');\n  const patternInfix = config.prefix ? [config.prefix] : [];\n\n  // PATH NAME\n  const splittedPathName = route.pathname.split('/');\n  const translatedPathParts = splittedPathName.map(replacePath);\n\n  // ROUTE NAME\n  const splittedRouteName = route.routeName.split('/');\n  const translatedRouteParts = splittedRouteName.map(replacePath);\n\n  // REGEX\n  const splittedPattern = route.pattern.toString().split('\\\\/');\n  const [translatedPatternFirst, ...translatedPatternOthers] = splittedPattern.map(replacePath);\n  const translatedPatternParts = [\n    translatedPatternFirst,\n    ...patternInfix,\n    ...translatedPatternOthers,\n  ];\n  const translatedPatternString = translatedPatternParts.join('\\\\/');\n  const translatedRegExp = translatedPatternString.substring(\n    1,\n    route.pathname === '/' ? translatedPatternString.length - 1 : translatedPatternString.length - 2\n  );\n\n  const translatedSegments = route.segments.map((segment) =>\n    segment.map((item) => ({ ...item, content: replacePath(item.content) }))\n  );\n\n  if (config.prefix) {\n    translatedSegments.splice(0, 0, [\n      {\n        content: config.prefix,\n        dynamic: false,\n        rest: false,\n      },\n    ]);\n  }\n\n  const translatedPath = translatedPathParts.join('/');\n  const translatedRoute = translatedRouteParts.join('/');\n\n  const routeToPush = {\n    ...route,\n    id: route.id + (idSuffix || configIndex),\n    pathname: pathnamePrefix + translatedPath,\n    routeName: routeNamePrefix + (translatedRoute !== '/' ? translatedRoute : ''),\n    pattern: new RegExp(translatedRegExp),\n    segments: translatedSegments,\n  };\n  return routeToPush;\n}\n\nfunction validateBuild(ctx: BuildContext) {\n  const pathnames = Array.from(new Set(ctx.routes.map((r) => r.pathname))).sort();\n\n  for (const pathname of pathnames) {\n    const foundRoutes = ctx.routes.filter((r) => r.pathname === pathname);\n    if (foundRoutes.length > 1) {\n      addError(\n        ctx,\n        `More than one route has been found for pathname \"${pathname}\". Please narrow it down to only one of these:\\n${foundRoutes\n          .map((r) => `  - ${r.filePath}`)\n          .join('\\n')}`\n      );\n    }\n  }\n\n  ctx.layouts\n    .filter((l) => l.layoutType === 'top')\n    .forEach((l) => {\n      addWarning(\n        ctx,\n        `The \"top\" layout feature, which is used by \"${l.filePath}\" has been deprecated and will be removed from future versions. In most cases the \"group\" layout feature can be used in its place: https://qwik.dev/qwikcity/layout/grouped/`\n      );\n    });\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/context.ts",
    "content": "import type { NormalizedPluginOptions, BuildContext, PluginOptions } from './types';\nimport { isAbsolute, resolve } from 'node:path';\nimport { normalizePath } from '../utils/fs';\n\nexport function createBuildContext(\n  rootDir: string,\n  viteBasePath: string,\n  userOpts?: PluginOptions,\n  target?: 'ssr' | 'client'\n) {\n  const ctx: BuildContext = {\n    rootDir: normalizePath(rootDir),\n    opts: normalizeOptions(rootDir, viteBasePath, userOpts),\n    routes: [],\n    serverPlugins: [],\n    layouts: [],\n    entries: [],\n    serviceWorkers: [],\n    menus: [],\n    diagnostics: [],\n    frontmatter: new Map(),\n    target: target || 'ssr',\n    isDevServer: false,\n    isDevServerClientOnly: false,\n    isDirty: true,\n    activeBuild: null,\n  };\n  return ctx;\n}\n\nexport function resetBuildContext(ctx: BuildContext | null) {\n  if (ctx) {\n    ctx.routes.length = 0;\n    ctx.layouts.length = 0;\n    ctx.entries.length = 0;\n    ctx.menus.length = 0;\n    ctx.diagnostics.length = 0;\n    ctx.frontmatter.clear();\n    ctx.isDirty = true;\n  }\n}\n\nfunction normalizeOptions(\n  rootDir: string,\n  viteBasePath: string,\n  userOpts: PluginOptions | undefined\n) {\n  if (!(viteBasePath.startsWith('/') && viteBasePath.endsWith('/'))) {\n    // TODO v2: make this an error\n    console.error(\n      `warning: vite's config.base must begin and end with /. This will be an error in v2. If you have a valid use case, please open an issue.`\n    );\n    if (!viteBasePath.endsWith('/')) {\n      viteBasePath += '/';\n    }\n  }\n  const opts: NormalizedPluginOptions = { ...userOpts } as any;\n\n  if (typeof opts.routesDir !== 'string') {\n    opts.routesDir = resolve(rootDir, 'src', 'routes');\n  } else if (!isAbsolute(opts.routesDir)) {\n    opts.routesDir = resolve(rootDir, opts.routesDir);\n  }\n  opts.routesDir = normalizePath(opts.routesDir);\n\n  if (typeof opts.serverPluginsDir !== 'string') {\n    opts.serverPluginsDir = opts.routesDir;\n  } else if (!isAbsolute(opts.serverPluginsDir)) {\n    opts.serverPluginsDir = resolve(rootDir, opts.serverPluginsDir);\n  }\n  opts.serverPluginsDir = normalizePath(opts.serverPluginsDir);\n\n  if (typeof (opts as any).baseUrl === 'string') {\n    // baseUrl deprecated\n    opts.basePathname = (opts as any).baseUrl;\n  }\n\n  if (typeof opts.basePathname !== 'string') {\n    // opts.basePathname is used internally\n    // but in most cases should be passed in by the vite config \"base\" property\n    opts.basePathname = viteBasePath;\n  }\n  if (!opts.basePathname.endsWith('/')) {\n    // TODO v2: make this an error\n    console.error(\n      `Warning: qwik-city plugin basePathname must end with /. This will be an error in v2`\n    );\n    opts.basePathname += '/';\n  }\n\n  // cleanup basePathname\n  const url = new URL(opts.basePathname, 'https://qwik.dev/');\n  opts.basePathname = url.pathname;\n\n  if (typeof opts.trailingSlash !== 'boolean') {\n    opts.trailingSlash = true;\n  }\n\n  opts.mdx = opts.mdx || {};\n  opts.platform = opts.platform || {};\n\n  return opts;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/frontmatter.ts",
    "content": "import type { Transformer } from 'unified';\nimport type { BuildContext, FrontmatterAttrs } from '../types';\nimport { normalizePath } from '../../utils/fs';\nimport { visit } from 'unist-util-visit';\nimport { parse as parseYaml } from 'yaml';\nimport type { ResolvedDocumentHead } from '../../runtime/src';\nimport type { DocumentMeta, Editable } from '../../runtime/src/types';\n\nexport function parseFrontmatter(ctx: BuildContext): Transformer {\n  return (mdast, vfile) => {\n    const attrs: FrontmatterAttrs = {};\n\n    visit(mdast, 'yaml', (node: any) => {\n      const parsedAttrs = parseFrontmatterAttrs(node.value) as FrontmatterAttrs;\n      for (const k in parsedAttrs) {\n        attrs[k] = parsedAttrs[k];\n      }\n    });\n\n    if (Object.keys(attrs).length > 0) {\n      ctx.frontmatter.set(normalizePath(vfile.path), attrs);\n    }\n  };\n}\n\nexport function parseFrontmatterAttrs(yaml: string) {\n  if (typeof yaml === 'string') {\n    yaml = yaml.trim();\n    if (yaml !== '') {\n      return parseYaml(yaml);\n    }\n  }\n  return null;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name\nconst metaNames: { [attrName: string]: boolean } = {\n  author: true,\n  creator: true,\n  'color-scheme': true,\n  description: true,\n  generator: true,\n  keywords: true,\n  publisher: true,\n  referrer: true,\n  robots: true,\n  'theme-color': true,\n  viewport: true,\n};\n\nexport function frontmatterAttrsToDocumentHead(attrs: FrontmatterAttrs | undefined) {\n  if (attrs != null && typeof attrs === 'object') {\n    const attrNames = Object.keys(attrs);\n    if (attrNames.length > 0) {\n      const head: Editable<Required<ResolvedDocumentHead>> = {\n        title: '',\n        meta: [],\n        styles: [],\n        links: [],\n        scripts: [],\n        frontmatter: {},\n      };\n\n      for (const attrName of attrNames) {\n        const attrValue = attrs[attrName];\n        if (attrValue != null) {\n          if (attrName === 'title') {\n            head.title = attrValue.toString();\n            head.title = head.title.replace(/\\\\@/g, '@');\n          } else if (attrName === 'og' || attrName === 'opengraph') {\n            // set custom open graph property\n            if (typeof attrValue === 'object') {\n              for (const opengraph of Array.isArray(attrValue) ? attrValue : [attrValue]) {\n                if (\n                  opengraph != null &&\n                  typeof opengraph === 'object' &&\n                  !Array.isArray(opengraph)\n                ) {\n                  for (const [property, content] of Object.entries(opengraph)) {\n                    // proxy title & description if value is set to `true`\n                    if ((property === 'title' || property === 'description') && content === true) {\n                      // only proxy property when exists in attrs\n                      if (attrNames.includes(property)) {\n                        (head.meta as DocumentMeta[]).push({\n                          property: `og:${property}`,\n                          content: attrs[property]?.toString(),\n                        });\n                      }\n                    }\n                    // otherwise set custom property and content\n                    else {\n                      (head.meta as DocumentMeta[]).push({\n                        property: `og:${property}`,\n                        content: content?.toString(),\n                      });\n                    }\n                  }\n                }\n              }\n            }\n          } else if (metaNames[attrName]) {\n            (head.meta as DocumentMeta[]).push({\n              name: attrName,\n              content: attrValue.toString(),\n            });\n          } else {\n            (head.frontmatter as Record<string, any>)[attrName] = attrValue;\n          }\n        }\n      }\n      return head;\n    }\n  }\n  return null;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/frontmatter.unit.ts",
    "content": "import { frontmatterAttrsToDocumentHead, parseFrontmatterAttrs } from './frontmatter';\nimport type { FrontmatterAttrs } from '../types';\nimport { assert, test } from 'vitest';\n\ntest('frontmatter, one line', async () => {\n  const yaml = 'title: Some Title';\n  const attrs: FrontmatterAttrs = parseFrontmatterAttrs(yaml);\n  assert.equal(attrs.title, 'Some Title');\n});\n\ntest('frontmatter, colons', async () => {\n  const yaml = 'title: \"Some : Crazy : Title\"';\n  const attrs: FrontmatterAttrs = parseFrontmatterAttrs(yaml);\n  assert.equal(attrs.title, 'Some : Crazy : Title');\n});\n\ntest('frontmatter, multiline string', async () => {\n  const yaml = 'title: >-' + '\\n' + '  Lorem' + '\\n' + '  Ipsum';\n  const attrs: FrontmatterAttrs = parseFrontmatterAttrs(yaml);\n  assert.equal(attrs.title, 'Lorem Ipsum');\n});\n\ntest('frontmatter, list', async () => {\n  const yaml = 'tags:' + '\\n' + '  - tag1' + '\\n' + '  - tag2';\n  const attrs: FrontmatterAttrs = parseFrontmatterAttrs(yaml);\n  assert.deepEqual(attrs.tags, ['tag1', 'tag2']);\n});\n\ntest('frontmatter, inline list', async () => {\n  const yaml = 'tags: [tag1, tag2]';\n  const attrs: FrontmatterAttrs = parseFrontmatterAttrs(yaml);\n  assert.deepEqual(attrs.tags, ['tag1', 'tag2']);\n});\n\ntest('frontmatter, dictionary', async () => {\n  const yaml = 'custom:' + '\\n' + '  author: Me';\n  const attrs: FrontmatterAttrs = parseFrontmatterAttrs(yaml);\n  assert.deepEqual(attrs.custom, { author: 'Me' });\n});\n\ntest('frontmatter, multiple', async () => {\n  const yaml =\n    'title: Some Title' +\n    '\\n' +\n    'description: Some Description' +\n    '\\n' +\n    'contributors:' +\n    '\\n - abc' +\n    '\\n - xyz' +\n    '\\n' +\n    'color-scheme: dark';\n  const attrs: FrontmatterAttrs = parseFrontmatterAttrs(yaml);\n  assert.equal(attrs.title, 'Some Title');\n  assert.equal(attrs.description, 'Some Description');\n  assert.deepEqual(attrs.contributors, ['abc', 'xyz']);\n  assert.equal(attrs['color-scheme'], 'dark');\n});\n\ntest('frontmatter, no attrs head', async () => {\n  const head = frontmatterAttrsToDocumentHead(undefined);\n  assert.equal(head, null);\n});\n\ntest('frontmatter, attrs head title', async () => {\n  const attrs: FrontmatterAttrs = {\n    title: 'My Title',\n  };\n  const head = frontmatterAttrsToDocumentHead(attrs);\n  assert.equal(head!.title, 'My Title');\n  assert.equal(head!.meta.length, 0);\n});\n\ntest('frontmatter, attrs head title w/ yaml escaped \\\\@', async () => {\n  const attrs: FrontmatterAttrs = {\n    title: '\\\\@builder.io/qwik',\n  };\n  const head = frontmatterAttrsToDocumentHead(attrs);\n  assert.equal(head!.title, '@builder.io/qwik');\n});\n\nconst metaNames = [\n  'author',\n  'creator',\n  'color-scheme',\n  'description',\n  'generator',\n  'keywords',\n  'publisher',\n  'referrer',\n  'robots',\n  'theme-color',\n  'viewport',\n];\nfor (const metaName of metaNames) {\n  test(`frontmatter, meta name \"${metaName}\"`, async () => {\n    const attrs: FrontmatterAttrs = {\n      [metaName]: `My ${metaName}`,\n    };\n    const head = frontmatterAttrsToDocumentHead(attrs);\n    assert.equal(head!.title, '');\n    assert.equal(head!.meta.length, 1);\n    assert.equal(head!.meta[0].name, metaName);\n    assert.equal(head!.meta[0].content, `My ${metaName}`);\n  });\n}\n\ntest('frontmatter, opengraph proxy', async () => {\n  const attrs: FrontmatterAttrs = {\n    title: 'My Title',\n    description: 'My Description',\n    og: {\n      title: true,\n      description: true,\n    },\n  };\n  const head = frontmatterAttrsToDocumentHead(attrs);\n  assert.equal(head!.title, 'My Title');\n  assert.equal(head!.meta.length, 3);\n  assert.equal(head!.meta[0].name, 'description');\n  assert.equal(head!.meta[0].content, 'My Description');\n  assert.equal(head!.meta[1].property, 'og:title');\n  assert.equal(head!.meta[1].content, 'My Title');\n  assert.equal(head!.meta[2].property, 'og:description');\n  assert.equal(head!.meta[2].content, 'My Description');\n});\n\ntest('frontmatter, opengraph proxy override', async () => {\n  const attrs: FrontmatterAttrs = {\n    title: 'My Title',\n    og: {\n      title: 'My Another Title',\n      description: true,\n    },\n  };\n  const head = frontmatterAttrsToDocumentHead(attrs);\n  assert.equal(head!.title, 'My Title');\n  assert.equal(head!.meta.length, 1);\n  assert.equal(head!.meta[0].property, 'og:title');\n  assert.equal(head!.meta[0].content, 'My Another Title');\n});\n\ntest('frontmatter, opengraph custom property', async () => {\n  const attrs: FrontmatterAttrs = {\n    title: 'My Title',\n    opengraph: [\n      {\n        image: 'https://example.com/rock.jpg',\n        'image:width': 300,\n        'image:height': 300,\n      },\n      {\n        image: 'https://example.com/rock2.jpg',\n      },\n      {\n        image: 'https://example.com/rock3.jpg',\n        'image:height': 1000,\n      },\n    ],\n  };\n  const head = frontmatterAttrsToDocumentHead(attrs);\n  assert.equal(head!.title, 'My Title');\n  assert.equal(head!.meta.length, 6);\n  assert.equal(head!.meta[0].property, 'og:image');\n  assert.equal(head!.meta[0].content, 'https://example.com/rock.jpg');\n  assert.equal(head!.meta[1].property, 'og:image:width');\n  assert.equal(head!.meta[1].content, '300');\n  assert.equal(head!.meta[2].property, 'og:image:height');\n  assert.equal(head!.meta[2].content, '300');\n  assert.equal(head!.meta[3].property, 'og:image');\n  assert.equal(head!.meta[3].content, 'https://example.com/rock2.jpg');\n  assert.equal(head!.meta[4].property, 'og:image');\n  assert.equal(head!.meta[4].content, 'https://example.com/rock3.jpg');\n  assert.equal(head!.meta[5].property, 'og:image:height');\n  assert.equal(head!.meta[5].content, '1000');\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/markdown-url.ts",
    "content": "import { dirname, join, basename } from 'node:path';\nimport { getSourceFile } from '../routing/source-file';\nimport type { NormalizedPluginOptions } from '../types';\nimport { getExtension, getPathnameFromDirPath, isMarkdownExt, normalizePath } from '../../utils/fs';\nimport { existsSync } from 'node:fs';\nimport { isSameOriginUrl } from '../../utils/pathname';\n\nexport function getMarkdownRelativeUrl(\n  opts: NormalizedPluginOptions,\n  containingFilePath: string,\n  url: string,\n  checkFileExists?: boolean\n) {\n  if (typeof url !== 'string' || !isSameOriginUrl(url)) {\n    return url;\n  }\n\n  const querySplit = url.split('?');\n  const hashSplit = url.split('#');\n  const strippedUrl = url.split('?')[0].split('#')[0];\n  const extension = getExtension(strippedUrl);\n  if (isMarkdownExt(extension)) {\n    const isAbsolute = strippedUrl.startsWith('/');\n    const parts = normalizePath(strippedUrl)\n      .split('/')\n      .filter((p) => p.length > 0);\n\n    const filePath = isAbsolute\n      ? join(opts.routesDir, ...parts)\n      : join(dirname(containingFilePath), ...parts);\n\n    if (checkFileExists && !existsSync(filePath)) {\n      console.warn(\n        `\\nThe link \"${url}\", found within \"${containingFilePath}\" does not have a matching source file.\\n`\n      );\n    }\n\n    const fileName = basename(filePath);\n    const sourceFileName = getSourceFile(fileName);\n    if (sourceFileName) {\n      const mdDirPath = dirname(filePath);\n      let pathname = getPathnameFromDirPath(opts, mdDirPath);\n      if (querySplit.length > 1) {\n        pathname += '?' + querySplit[1];\n      } else if (hashSplit.length > 1) {\n        pathname += '#' + hashSplit[1];\n      }\n      return pathname;\n    }\n  } else if (extension === '') {\n    if (url.endsWith('/')) {\n      if (!opts.trailingSlash) {\n        url = url.slice(0, -1);\n      }\n    } else if (opts.trailingSlash) {\n      url += '/';\n    }\n  }\n\n  return url;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/markdown-url.unit.ts",
    "content": "import { getMarkdownRelativeUrl } from './markdown-url';\nimport type { NormalizedPluginOptions } from '../types';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { assert, test } from 'vitest';\n\nconst routesDir = tmpdir();\nconst serverPluginsDir = tmpdir();\n\nconst menuFilePath = join(routesDir, 'docs', 'menu.md');\n[\n  {\n    href: './getting-started/index.mdx',\n    trailingSlash: false,\n    expect: '/docs/getting-started',\n  },\n  {\n    href: './getting-started/index.mdx?intro',\n    trailingSlash: false,\n    expect: '/docs/getting-started?intro',\n  },\n  {\n    href: './getting-started/index.mdx#intro',\n    trailingSlash: false,\n    expect: '/docs/getting-started#intro',\n  },\n  {\n    href: './getting-started/index.mdx#intro',\n    trailingSlash: true,\n    expect: '/docs/getting-started/#intro',\n  },\n  {\n    href: '/link',\n    trailingSlash: false,\n    expect: '/link',\n  },\n  {\n    href: '/link/',\n    trailingSlash: true,\n    expect: '/link/',\n  },\n  {\n    href: '/link/index.mdx',\n    trailingSlash: false,\n    expect: '/link',\n  },\n  {\n    href: '/link/index.mdx',\n    trailingSlash: true,\n    expect: '/link/',\n  },\n  {\n    href: 'http://builder.io/',\n    expect: 'http://builder.io/',\n  },\n  {\n    href: '#hash',\n    expect: '#hash',\n  },\n  {\n    href: '',\n    expect: '',\n  },\n  {\n    href: './getting-started.txt',\n    expect: './getting-started.txt',\n  },\n].forEach((t) => {\n  test(`getMarkdownRelativeUrl ${t.href}`, () => {\n    const opts: NormalizedPluginOptions = {\n      basePathname: '/',\n      trailingSlash: !!t.trailingSlash,\n      routesDir,\n      serverPluginsDir,\n      mdxPlugins: {\n        remarkGfm: true,\n        rehypeSyntaxHighlight: true,\n        rehypeAutolinkHeadings: true,\n      },\n      mdx: {},\n      platform: {},\n      rewriteRoutes: [],\n    };\n    assert.equal(getMarkdownRelativeUrl(opts, menuFilePath, t.href), t.expect);\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/mdx.ts",
    "content": "import { SourceMapGenerator } from 'source-map';\nimport { rehypePage, rehypeSlug, renameClassname, wrapTableWithDiv } from './rehype';\nimport { rehypeSyntaxHighlight } from './syntax-highlight';\nimport type { BuildContext } from '../types';\nimport { parseFrontmatter } from './frontmatter';\nimport { getExtension } from '../../utils/fs';\nimport type { CompileOptions } from '@mdx-js/mdx';\nimport { createHash } from 'node:crypto';\n\nexport async function createMdxTransformer(ctx: BuildContext): Promise<MdxTransform> {\n  const { compile } = await import('@mdx-js/mdx');\n  const { default: remarkFrontmatter } = await import('remark-frontmatter');\n  const { default: remarkGfm } = await import('remark-gfm');\n  const { default: rehypeAutolinkHeadings } = await import('rehype-autolink-headings');\n\n  const { VFile } = await import('vfile');\n\n  const userMdxOpts = ctx.opts.mdx;\n\n  const userRemarkPlugins = userMdxOpts.remarkPlugins || [];\n  const userRehypePlugins = userMdxOpts.rehypePlugins || [];\n\n  const coreMdxPlugins = ctx.opts.mdxPlugins;\n\n  const coreRemarkPlugins = [];\n\n  if (typeof coreMdxPlugins?.remarkGfm === 'undefined' || coreMdxPlugins.remarkGfm) {\n    coreRemarkPlugins.push(remarkGfm);\n  }\n\n  const coreRehypePlugins = [];\n\n  if (\n    typeof coreMdxPlugins?.rehypeSyntaxHighlight === 'undefined' ||\n    coreMdxPlugins.rehypeSyntaxHighlight\n  ) {\n    coreRehypePlugins.push(rehypeSyntaxHighlight);\n  }\n\n  if (\n    typeof coreMdxPlugins?.rehypeAutolinkHeadings === 'undefined' ||\n    coreMdxPlugins.rehypeAutolinkHeadings\n  ) {\n    coreRehypePlugins.push(rehypeAutolinkHeadings);\n  }\n\n  const options: CompileOptions = {\n    SourceMapGenerator,\n    jsxImportSource: '@builder.io/qwik',\n    ...userMdxOpts,\n    elementAttributeNameCase: 'html',\n    remarkPlugins: [\n      ...userRemarkPlugins,\n      ...coreRemarkPlugins,\n      remarkFrontmatter,\n      [parseFrontmatter, ctx],\n    ],\n    rehypePlugins: [\n      rehypeSlug,\n      ...userRehypePlugins,\n      ...coreRehypePlugins,\n      [rehypePage, ctx],\n      renameClassname,\n      wrapTableWithDiv,\n    ],\n  };\n  return async function (code: string, id: string) {\n    const ext = getExtension(id);\n    if (['.mdx', '.md', '.markdown'].includes(ext)) {\n      const file = new VFile({ value: code, path: id });\n      const compiled = await compile(file, options);\n      const output = String(compiled.value);\n      const hasher = createHash('sha256');\n      const key = hasher\n        .update(output)\n        .digest('base64')\n        .slice(0, 8)\n        .replace('+', '-')\n        .replace('/', '_');\n      const addImport = `import { jsx, _jsxC, RenderOnce } from '@builder.io/qwik';\\n`;\n      // the _missingMdxReference call is automatically added by mdxjs\n      const newDefault = `\nfunction _missingMdxReference(id, component, place) {\n  throw new Error(\"${id}: Expected \" + (component ? \"component\" : \"object\") + \" \\`\" + id + \"\\` to be defined: you likely forgot to import, pass, or provide it.\" + (place ? \"\\\\nIt’s referenced in your code at \\`\" + place + \"\\`\" : \"\"));\n}\nconst WrappedMdxContent = (props = {}) => {\n  const content = _jsxC(RenderOnce, {children: _jsxC(_createMdxContent, props, 3, null)}, 3, ${JSON.stringify(key)});\n  if (typeof MDXLayout === 'function'){\n      return jsx(MDXLayout, {children: content});\n  }\n  return content;\n};\nexport default WrappedMdxContent;\n`;\n      const exportIndex = output.lastIndexOf('export default ');\n      if (exportIndex === -1) {\n        throw new Error('Could not find default export in mdx output');\n      }\n      const wrappedOutput = addImport + output.slice(0, exportIndex) + newDefault;\n      return {\n        code: wrappedOutput,\n        map: compiled.map,\n      };\n    }\n  };\n}\n\nexport type MdxTransform = (\n  code: string,\n  id: string\n) => Promise<{ code: string; map: any } | undefined>;\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/mdx.unit.ts",
    "content": "import { describe, expect, test } from 'vitest';\nimport { createMdxTransformer } from './mdx';\n\n// It could be that new MDX versions change the output used for snapshot matching. Change as needed.\ndescribe('mdx', async () => {\n  const ctx = {\n    frontmatter: new Map(),\n    opts: {\n      mdx: {\n        remarkPlugins: [],\n        rehypePlugins: [],\n      },\n      mdxPlugins: {},\n    },\n  };\n\n  const transformer = await createMdxTransformer(ctx as any);\n\n  test('convert flat mdx', async () => {\n    const mdx = `\n# Hello\n<a href=\"http://example.com\">Hello</a>\n<div>World</div>\n`;\n    const result = await transformer(mdx, 'file.mdx');\n\n    expect(result).toMatchInlineSnapshot(`\n      {\n        \"code\": \"import { jsx, _jsxC, RenderOnce } from '@builder.io/qwik';\n      import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from \"@builder.io/qwik/jsx-runtime\";\n      export const headings = [{\n        \"text\": \"Hello\",\n        \"id\": \"hello\",\n        \"level\": 1\n      }];\n      export const frontmatter = undefined;\n      function _createMdxContent(props) {\n        const _components = {\n          a: \"a\",\n          h1: \"h1\",\n          span: \"span\",\n          ...props.components\n        };\n        return _jsxs(_Fragment, {\n          children: [_jsxs(_components.h1, {\n            id: \"hello\",\n            children: [_jsx(_components.a, {\n              \"aria-hidden\": \"true\",\n              tabindex: \"-1\",\n              href: \"#hello\",\n              children: _jsx(_components.span, {\n                class: \"icon icon-link\"\n              })\n            }), \"Hello\"]\n          }), \"\\\\n\", _jsx(\"a\", {\n            href: \"http://example.com\",\n            children: \"Hello\"\n          }), \"\\\\n\", _jsx(\"div\", {\n            children: \"World\"\n          })]\n        });\n      }\n\n      function _missingMdxReference(id, component, place) {\n        throw new Error(\"file.mdx: Expected \" + (component ? \"component\" : \"object\") + \" \\`\" + id + \"\\` to be defined: you likely forgot to import, pass, or provide it.\" + (place ? \"\\\\nIt’s referenced in your code at \\`\" + place + \"\\`\" : \"\"));\n      }\n      const WrappedMdxContent = (props = {}) => {\n        const content = _jsxC(RenderOnce, {children: _jsxC(_createMdxContent, props, 3, null)}, 3, \"eB2HIyA1\");\n        if (typeof MDXLayout === 'function'){\n            return jsx(MDXLayout, {children: content});\n        }\n        return content;\n      };\n      export default WrappedMdxContent;\n      \",\n        \"map\": {\n          \"file\": \"file.mdx\",\n          \"mappings\": \";;;;;;;;;;;;;;;;;;;;;;;;UACE;;;gBAC2B;;gBACxB\",\n          \"names\": [],\n          \"sources\": [\n            \"file.mdx\",\n          ],\n          \"version\": 3,\n        },\n      }\n    `);\n  });\n\n  test('convert layout mdx', async () => {\n    const mdx = `\n# Hello\n\nexport default function Layout({ children: content }) {\n  return <main>{content}</main>;\n}\n\n<a href=\"http://example.com\">Hello</a>\n<div>World</div>\n`;\n    const result = await transformer(mdx, 'file.mdx');\n\n    expect(result).toMatchInlineSnapshot(`\n      {\n        \"code\": \"import { jsx, _jsxC, RenderOnce } from '@builder.io/qwik';\n      import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from \"@builder.io/qwik/jsx-runtime\";\n      export const headings = [{\n        \"text\": \"Hello\",\n        \"id\": \"hello\",\n        \"level\": 1\n      }];\n      export const frontmatter = undefined;\n      const MDXLayout = function Layout({children: content}) {\n        return _jsx(\"main\", {\n          children: content\n        });\n      };\n      function _createMdxContent(props) {\n        const _components = {\n          a: \"a\",\n          h1: \"h1\",\n          span: \"span\",\n          ...props.components\n        };\n        return _jsxs(_Fragment, {\n          children: [_jsxs(_components.h1, {\n            id: \"hello\",\n            children: [_jsx(_components.a, {\n              \"aria-hidden\": \"true\",\n              tabindex: \"-1\",\n              href: \"#hello\",\n              children: _jsx(_components.span, {\n                class: \"icon icon-link\"\n              })\n            }), \"Hello\"]\n          }), \"\\\\n\", \"\\\\n\", _jsx(\"a\", {\n            href: \"http://example.com\",\n            children: \"Hello\"\n          }), \"\\\\n\", _jsx(\"div\", {\n            children: \"World\"\n          })]\n        });\n      }\n\n      function _missingMdxReference(id, component, place) {\n        throw new Error(\"file.mdx: Expected \" + (component ? \"component\" : \"object\") + \" \\`\" + id + \"\\` to be defined: you likely forgot to import, pass, or provide it.\" + (place ? \"\\\\nIt’s referenced in your code at \\`\" + place + \"\\`\" : \"\"));\n      }\n      const WrappedMdxContent = (props = {}) => {\n        const content = _jsxC(RenderOnce, {children: _jsxC(_createMdxContent, props, 3, null)}, 3, \"UdQmQWC3\");\n        if (typeof MDXLayout === 'function'){\n            return jsx(MDXLayout, {children: content});\n        }\n        return content;\n      };\n      export default WrappedMdxContent;\n      \",\n        \"map\": {\n          \"file\": \"file.mdx\",\n          \"mappings\": \";;;;;;;kBAGe,iBAAkBA,UAAUC;cACjC;cAAMA;;;;;;;;;;;;;;;;;;;;UAHd;;;gBAM2B;;gBACxB\",\n          \"names\": [\n            \"children\",\n            \"content\",\n          ],\n          \"sources\": [\n            \"file.mdx\",\n          ],\n          \"version\": 3,\n        },\n      }\n    `);\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/menu.ts",
    "content": "import type { NormalizedPluginOptions, BuildMenu, ParsedMenuItem, RouteSourceFile } from '../types';\nimport { marked } from 'marked';\nimport { createFileId, getMenuPathname } from '../../utils/fs';\nimport { getMarkdownRelativeUrl } from './markdown-url';\n\nexport function createMenu(opts: NormalizedPluginOptions, filePath: string) {\n  const menu: BuildMenu = {\n    pathname: getMenuPathname(opts, filePath),\n    filePath,\n  };\n  return menu;\n}\n\nexport function resolveMenu(opts: NormalizedPluginOptions, menuSourceFile: RouteSourceFile) {\n  return createMenu(opts, menuSourceFile.filePath);\n}\n\nexport async function transformMenu(\n  opts: NormalizedPluginOptions,\n  filePath: string,\n  content: string\n) {\n  const parsedMenu = parseMenu(opts, filePath, content);\n  const id = createFileId(opts.routesDir, filePath);\n  const code = `const ${id} = ${JSON.stringify(parsedMenu, null, 2)};`;\n  return `${code} export default ${id}`;\n}\n\nexport function parseMenu(\n  opts: NormalizedPluginOptions,\n  filePath: string,\n  content: string,\n  checkFileExists = true\n) {\n  const tokens = marked.lexer(content, {});\n  let currentDepth = 0;\n  const stack: ParsedMenuItem[] = [];\n  for (const t of tokens) {\n    if (t.type === 'heading') {\n      const diff = currentDepth - t.depth;\n      if (diff >= 0) {\n        stack.length -= diff + 1;\n      }\n      if (diff < -1) {\n        throw new Error(\n          `Menu hierarchy skipped a level, went from <h${'#'.repeat(\n            currentDepth\n          )}> to <h${'#'.repeat(t.depth)}>, in menu: ${filePath}`\n        );\n      }\n      currentDepth = t.depth;\n      const parentNode = stack[stack.length - 1];\n      for (const h2Token of t.tokens || []) {\n        const lastNode: ParsedMenuItem = {\n          text: '',\n        };\n        if (h2Token.type === 'text') {\n          lastNode.text = h2Token.text;\n        } else if (h2Token.type === 'link') {\n          lastNode.text = h2Token.text;\n          lastNode.href = getMarkdownRelativeUrl(opts, filePath, h2Token.href, checkFileExists);\n        } else {\n          throw new Error(\n            `Headings can only be a text or link. Received \"${h2Token.type}\", value \"${h2Token.raw}\", in menu: ${filePath}`\n          );\n        }\n        if (parentNode) {\n          parentNode.items = parentNode.items || [];\n          parentNode.items.push(lastNode);\n        }\n        stack.push(lastNode);\n      }\n    } else if (t.type === 'list') {\n      const parentNode = stack[stack.length - 1];\n\n      parentNode.items = parentNode.items || [];\n      for (const li of t.items) {\n        if (li.type === 'list_item') {\n          for (const liToken of li.tokens) {\n            if (liToken.type === 'text') {\n              for (const liItem of (liToken as any).tokens) {\n                if (liItem.type === 'text') {\n                  parentNode.items.push({ text: liItem.text });\n                } else if (liItem.type === 'link') {\n                  parentNode.items.push({\n                    text: liItem.text,\n                    href: getMarkdownRelativeUrl(opts, filePath, liItem.href, checkFileExists),\n                  });\n                } else {\n                  throw new Error(\n                    `List items can only be a text or link. Received \"${liItem.type}\", value \"${liItem.raw}\", in menu: ${filePath}`\n                  );\n                }\n              }\n            } else if (liToken.type === 'link') {\n              parentNode.items.push({\n                text: liToken.text,\n                href: getMarkdownRelativeUrl(opts, filePath, liToken.href, checkFileExists),\n              });\n            } else {\n              throw new Error(\n                `List items can only be a text or link. Received \"${liToken.type}\", value \"${liToken.raw}\", in menu: ${filePath}`\n              );\n            }\n          }\n        } else {\n          throw new Error(\n            `Only list items can be used in lists. Received \"${li.type}\", value \"${li.raw}\", in menu: ${filePath}`\n          );\n        }\n      }\n    } else if (t.type === 'space') {\n      continue;\n    } else {\n      throw new Error(\n        `Menu has a \"${t.type}\" with the value \"${t.raw}\". However, only headings and lists can be used in the menu: ${filePath}`\n      );\n    }\n  }\n\n  if (stack.length === 0) {\n    throw new Error(`Menu must start with an h1 in the index: ${filePath}`);\n  }\n  return stack[0];\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/menu.unit.ts",
    "content": "import { join } from 'node:path';\nimport { createMenu, parseMenu } from './menu';\nimport { suite, assert } from '../../utils/test-suite';\n\nconst test = suite();\n\ntest('parse menu.md menu', ({ ctx: { opts } }) => {\n  const filePath = join(opts.routesDir, 'guide', 'menu.md');\n  const content = `\n  # Heading\n\n  ## Section A\n\n  - Text A1\n  - [Link A1](/link-a1)\n\n  ## Section B\n\n  - [Link B1](link-b1/index.mdx)\n  - Text B1\n\n  ## [Section C](http://section-c.com)\n\n  `;\n  const menu = createMenu(opts, filePath);\n  assert.equal(menu.pathname, '/guide/');\n\n  const i = parseMenu(opts, filePath, content, false);\n  assert.equal(i.text, 'Heading');\n\n  assert.equal(i.items![0].text, 'Section A');\n  assert.equal(i.items![0].items?.length, 2);\n  assert.equal(i.items![0].items![0].text, 'Text A1');\n  assert.equal(i.items![0].items![1].text, 'Link A1');\n  assert.equal(i.items![0].items![1].href, '/link-a1/');\n\n  assert.equal(i.items![1].text, 'Section B');\n  assert.equal(i.items![1].items?.length, 2);\n  assert.equal(i.items![1].items![0].text, 'Link B1');\n  assert.equal(i.items![1].items![0].href, '/guide/link-b1/');\n  assert.equal(i.items![1].items![1].text, 'Text B1');\n\n  assert.equal(i.items![2].text, 'Section C');\n  assert.equal(i.items![2].href, 'http://section-c.com');\n  assert.equal(i.items![2].items, undefined);\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/rehype.ts",
    "content": "import type { Transformer } from 'unified';\nimport Slugger from 'github-slugger';\nimport type { Root } from 'mdast';\nimport type { MdxjsEsm } from 'mdast-util-mdx';\nimport { valueToEstree } from 'estree-util-value-to-estree';\nimport { headingRank } from 'hast-util-heading-rank';\nimport { toString } from 'hast-util-to-string';\nimport { visit } from 'unist-util-visit';\nimport type { ContentHeading } from '../../runtime/src';\nimport type { BuildContext, NormalizedPluginOptions } from '../types';\nimport { getExtension, isMarkdownExt, normalizePath } from '../../utils/fs';\nimport { frontmatterAttrsToDocumentHead } from './frontmatter';\nimport { isSameOriginUrl } from '../../utils/pathname';\nimport { getMarkdownRelativeUrl } from './markdown-url';\n\nexport function rehypeSlug(): Transformer {\n  return (ast) => {\n    const mdast = ast as Root;\n    const slugs = new Slugger();\n\n    visit(mdast, 'element', (node: any) => {\n      const level = headingRank(node);\n      if (level && node.properties) {\n        const text = toString(node);\n\n        if (!hasProperty(node, 'id')) {\n          node.properties.id = slugs.slug(text);\n        }\n      }\n    });\n  };\n}\n\nexport function rehypePage(ctx: BuildContext): Transformer {\n  return (ast, vfile) => {\n    const mdast = ast as Root;\n    const sourcePath = normalizePath(vfile.path);\n\n    updateContentLinks(mdast, ctx.opts, sourcePath);\n    exportFrontmatter(ctx, mdast, sourcePath);\n    exportContentHead(ctx, mdast, sourcePath);\n    exportContentHeadings(mdast);\n  };\n}\n\nexport function renameClassname(): Transformer {\n  return (ast) => {\n    const mdast = ast as Root;\n\n    visit(mdast, 'element', (node: any) => {\n      if (node.properties) {\n        if (node.properties.className) {\n          node.properties.class = node.properties.className;\n          node.properties.className = undefined;\n        }\n      }\n    });\n  };\n}\n\nexport function wrapTableWithDiv(): Transformer {\n  return (ast) => {\n    const mdast = ast as Root;\n\n    visit(mdast, 'element', (node: any) => {\n      if (node.tagName === 'table' && !node.done) {\n        const table = { ...node };\n        table.done = true;\n        node.tagName = 'div';\n        node.properties = { className: 'table-wrapper' };\n        node.children = [table];\n      }\n    });\n  };\n}\n\nfunction updateContentLinks(mdast: Root, opts: NormalizedPluginOptions, sourcePath: string) {\n  visit(mdast, 'element', (node: any) => {\n    const tagName = node && node.type === 'element' && node.tagName.toLowerCase();\n    if (tagName === 'a') {\n      const href = ((node.properties && node.properties.href) || '').trim();\n\n      if (isSameOriginUrl(href)) {\n        const ext = getExtension(href);\n\n        if (isMarkdownExt(ext)) {\n          node.properties.href = getMarkdownRelativeUrl(\n            opts,\n            sourcePath,\n            node.properties.href,\n            true\n          );\n        }\n      }\n    }\n  });\n}\n\nfunction exportFrontmatter(ctx: BuildContext, mdast: Root, sourcePath: string) {\n  const attrs = ctx.frontmatter.get(sourcePath);\n  createExport(mdast, 'frontmatter', attrs);\n}\n\nfunction exportContentHead(ctx: BuildContext, mdast: Root, sourcePath: string) {\n  const attrs = ctx.frontmatter.get(sourcePath);\n  const head = frontmatterAttrsToDocumentHead(attrs);\n  if (head) {\n    createExport(mdast, 'head', head);\n  }\n}\n\nfunction exportContentHeadings(mdast: Root) {\n  const headings: ContentHeading[] = [];\n\n  visit(mdast, 'element', (node: any) => {\n    const level = headingRank(node);\n    if (level && node.properties) {\n      if (hasProperty(node, 'id')) {\n        const text = toString(node);\n        headings.push({\n          text,\n          id: node.properties.id,\n          level,\n        });\n      }\n    }\n  });\n\n  if (headings.length > 0) {\n    createExport(mdast, 'headings', headings);\n  }\n}\n\nfunction createExport(mdast: Root, identifierName: string, val: any) {\n  const mdxjsEsm: MdxjsEsm = {\n    type: 'mdxjsEsm',\n    value: '',\n    data: {\n      estree: {\n        type: 'Program',\n        sourceType: 'module',\n        body: [\n          {\n            type: 'ExportNamedDeclaration',\n            source: null,\n            specifiers: [],\n            attributes: [],\n            declaration: {\n              type: 'VariableDeclaration',\n              kind: 'const',\n              declarations: [\n                {\n                  type: 'VariableDeclarator',\n                  id: { type: 'Identifier', name: identifierName },\n                  init: valueToEstree(val),\n                },\n              ],\n            },\n          },\n        ],\n      },\n    },\n  };\n  mdast.children.unshift(mdxjsEsm);\n}\n\nconst own = {}.hasOwnProperty;\nfunction hasProperty(node: any, propName: string) {\n  const value =\n    propName &&\n    node &&\n    typeof node === 'object' &&\n    node.type === 'element' &&\n    node.properties &&\n    own.call(node.properties, propName) &&\n    node.properties[propName];\n  return value != null && value !== false;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/markdown/syntax-highlight.ts",
    "content": "import type { Transformer } from 'unified';\nimport { toString } from 'hast-util-to-string';\nimport { visit } from 'unist-util-visit';\nimport { refractor } from 'refractor';\nimport tsxLang from 'refractor/lang/tsx.js';\n\nexport function rehypeSyntaxHighlight(): Transformer {\n  refractor.register(tsxLang);\n\n  return async (ast) => {\n    visit(ast, 'element', (node: any, _index: number, parent: any) => {\n      if (\n        !parent ||\n        parent.tagName !== 'pre' ||\n        node.tagName !== 'code' ||\n        !Array.isArray(node.properties.className)\n      ) {\n        return;\n      }\n\n      for (let i = 0; i < node.properties.className.length; i++) {\n        const className = node.properties.className[i];\n        const lang = getLanguage(className);\n        if (lang && refractor.registered(lang)) {\n          node.properties.className[i] = 'language-' + lang;\n          syntaxHighlight(node, lang);\n          return;\n        }\n      }\n    });\n  };\n}\n\nfunction syntaxHighlight(node: any, lang: string) {\n  const code = toString(node);\n  const result = refractor.highlight(code, lang);\n  if (result && Array.isArray(node.children)) {\n    node.children = result.children;\n  }\n}\n\nfunction getLanguage(className: string) {\n  if (typeof className === 'string') {\n    className = className.toLowerCase();\n    if (className.startsWith('language-')) {\n      return className.slice(9);\n    }\n  }\n  return null;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/parse-pathname.ts",
    "content": "import type { ParsedPathname, PathnameSegmentPart } from '../types';\n\n/**\n * Adopted from SvelteKit\n *\n * https://github.com/sveltejs/kit/blob/master/LICENSE\n */\nexport function parseRoutePathname(basePathname: string, pathname: string): ParsedPathname {\n  if (pathname === basePathname) {\n    return {\n      pattern: new RegExp('^' + pathname.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&') + '$'),\n      routeName: pathname,\n      paramNames: [],\n      segments: [[{ content: '', dynamic: false, rest: false }]],\n    };\n  }\n\n  pathname = pathname.slice(1);\n\n  const segments = pathname.split('/');\n  const paramNames: string[] = [];\n\n  const pattern = new RegExp(\n    `^${segments\n      .filter((segment) => segment.length > 0)\n      .map((s) => {\n        const segment = decodeURI(s);\n\n        // special case — /[...rest]/ could contain zero segments\n        const catchAll = /^\\[\\.\\.\\.(\\w+)?\\]$/.exec(segment);\n        if (catchAll) {\n          paramNames.push(catchAll[1]);\n          return '(?:/(.*))?';\n        }\n\n        return (\n          '/' +\n          segment\n            .split(DYNAMIC_SEGMENT)\n            .map((content, i) => {\n              if (i % 2) {\n                const rg = PARAM_PATTERN.exec(content);\n                if (rg) {\n                  const [, rest, name] = rg;\n                  paramNames.push(name);\n                  return rest ? '(.*?)' : '([^/]+?)';\n                }\n              }\n\n              return (\n                encodeURI(content)\n                  // allow users to specify characters on the file system in an encoded manner\n                  .normalize()\n                  // We use [ and ] to denote parameters, so users must encode these on the file\n                  // system to match against them. We don't decode all characters since others\n                  // can already be epressed and so that '%' can be easily used directly in filenames\n                  .replace(/%5[Bb]/g, '[')\n                  .replace(/%5[Dd]/g, ']')\n                  // '#', '/', and '?' can only appear in URL path segments in an encoded manner.\n                  // They will not be touched by decodeURI so need to be encoded here, so\n                  // that we can match against them.\n                  // We skip '/' since you can't create a file with it on any OS\n                  .replace(/#/g, '%23')\n                  .replace(/\\?/g, '%3F')\n                  // escape characters that have special meaning in regex\n                  .replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n              );\n            })\n            .join('')\n        );\n      })\n      .join('')}/?$` // always match with and without a trailing slash\n  );\n\n  return {\n    pattern,\n    routeName: pathname,\n    paramNames,\n    segments: segments.map((segment) => {\n      const parts: PathnameSegmentPart[] = [];\n      segment.split(/\\[(.+?)\\]/).map((content, i) => {\n        if (content) {\n          const dynamic = !!(i % 2);\n          parts.push({\n            content,\n            dynamic,\n            rest: dynamic && content.startsWith('...'),\n          });\n        }\n      });\n      return parts;\n    }),\n  };\n}\n\nconst PARAM_PATTERN = /^(\\.\\.\\.)?(\\w+)?$/;\nconst DYNAMIC_SEGMENT = /\\[(.+?)\\]/;\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/parse-pathname.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { parseRoutePathname } from './parse-pathname';\n\n/**\n * Adopted from SvelteKit\n *\n * https://github.com/sveltejs/kit/blob/master/LICENSE\n */\n\nconst tests = {\n  '/': {\n    basePathname: '/',\n    pattern: /^\\/$/,\n    paramNames: [],\n  },\n  '/base.pathname/': {\n    basePathname: '/base.pathname/',\n    pattern: /^\\/base\\.pathname\\/$/,\n    paramNames: [],\n  },\n  '/base/pathname/': {\n    basePathname: '/base/pathname/',\n    pattern: /^\\/base\\/pathname\\/$/,\n    paramNames: [],\n  },\n  '/blog': {\n    basePathname: '/',\n    pattern: /^\\/blog\\/?$/,\n    paramNames: [],\n  },\n  '/base/pathname/blog': {\n    basePathname: '/base/pathname/',\n    pattern: /^\\/base\\/pathname\\/blog\\/?$/,\n    paramNames: [],\n  },\n  '/blog.json': {\n    basePathname: '/',\n    pattern: /^\\/blog\\.json\\/?$/,\n    paramNames: [],\n  },\n  '/blog/[slug]': {\n    basePathname: '/',\n    pattern: /^\\/blog\\/([^/]+?)\\/?$/,\n    paramNames: ['slug'],\n  },\n  '/blog/[slug].json': {\n    basePathname: '/',\n    pattern: /^\\/blog\\/([^/]+?)\\.json\\/?$/,\n    paramNames: ['slug'],\n  },\n  '/[...rest]': {\n    basePathname: '/',\n    pattern: /^(?:\\/(.*))?\\/?$/,\n    paramNames: ['rest'],\n  },\n  '/foo/[...rest]/bar': {\n    basePathname: '/',\n    pattern: /^\\/foo(?:\\/(.*))?\\/bar\\/?$/,\n    paramNames: ['rest'],\n  },\n  '/xyz/abc.dot/': {\n    basePathname: '/',\n    pattern: /^\\/xyz\\/abc\\.dot\\/?$/,\n    paramNames: [],\n  },\n  '/xyz/%D8%B9%D8%B1%D8%A8%D9%8A/': {\n    basePathname: '/',\n    pattern: /^\\/xyz\\/%D8%B9%D8%B1%D8%A8%D9%8A\\/?$/,\n    paramNames: [],\n  },\n  '/xyz/server$/': {\n    basePathname: '/',\n    pattern: /^\\/xyz\\/server\\$\\/?$/,\n    paramNames: [],\n  },\n};\n\nfor (const [key, t] of Object.entries(tests)) {\n  test(`parseRoutePathname: \"${key}\"`, () => {\n    const actual = parseRoutePathname(t.basePathname, key);\n    assert.equal(actual.pattern.toString(), t.pattern.toString());\n    assert.deepEqual(actual.paramNames, t.paramNames);\n  });\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/resolve-source-file.ts",
    "content": "import { dirname } from 'node:path';\nimport { resolveMenu } from '../markdown/menu';\nimport type {\n  BuildEntry,\n  BuildLayout,\n  BuildRoute,\n  BuildServerPlugin,\n  NormalizedPluginOptions,\n  RouteSourceFile,\n} from '../types';\nimport {\n  createFileId,\n  getPathnameFromDirPath,\n  parseRouteIndexName,\n  normalizePath,\n} from '../../utils/fs';\nimport { parseRoutePathname } from './parse-pathname';\nimport { routeSortCompare } from './sort-routes';\n\nexport function resolveSourceFiles(opts: NormalizedPluginOptions, sourceFiles: RouteSourceFile[]) {\n  const layouts = sourceFiles\n    .filter((s) => s.type === 'layout')\n    .map((s) => resolveLayout(opts, s))\n    .sort((a, b) => {\n      return a.id < b.id ? -1 : 1;\n    });\n\n  const routes = sourceFiles\n    .filter((s) => s.type === 'route')\n    .map((s) => resolveRoute(opts, layouts, s))\n    .sort(routeSortCompare);\n\n  const entries = sourceFiles\n    .filter((s) => s.type === 'entry')\n    .map((s) => resolveEntry(opts, s))\n    .sort((a, b) => {\n      return a.chunkFileName < b.chunkFileName ? -1 : 1;\n    });\n\n  const serviceWorkers = sourceFiles\n    .filter((s) => s.type === 'service-worker')\n    .map((p) => resolveServiceWorkerEntry(opts, p))\n    .sort((a, b) => {\n      return a.chunkFileName < b.chunkFileName ? -1 : 1;\n    });\n\n  const menus = sourceFiles\n    .filter((s) => s.type === 'menu')\n    .map((p) => resolveMenu(opts, p))\n    .sort((a, b) => {\n      return a.pathname < b.pathname ? -1 : 1;\n    });\n\n  let inc = 0;\n  const ids = new Set<string>();\n  const uniqueIds = (b: { id: string }[]) => {\n    for (const r of b) {\n      let id = r.id;\n      while (ids.has(id)) {\n        id = `${r.id}_${inc++}`;\n      }\n      r.id = id;\n      ids.add(id);\n    }\n  };\n\n  uniqueIds(layouts);\n  uniqueIds(routes);\n  uniqueIds(entries);\n  uniqueIds(serviceWorkers);\n\n  return { layouts, routes, entries, menus, serviceWorkers };\n}\n\nexport function resolveLayout(opts: NormalizedPluginOptions, layoutSourceFile: RouteSourceFile) {\n  let extlessName = layoutSourceFile.extlessName;\n  const filePath = layoutSourceFile.filePath;\n  const dirPath = layoutSourceFile.dirPath;\n\n  let layoutName: string;\n  let layoutType: 'nested' | 'top';\n\n  if (extlessName.endsWith(LAYOUT_TOP_SUFFIX)) {\n    layoutType = 'top';\n    extlessName = extlessName.slice(0, extlessName.length - 1);\n  } else {\n    layoutType = 'nested';\n  }\n\n  if (extlessName.startsWith(LAYOUT_NAMED_PREFIX)) {\n    layoutName = extlessName.slice(LAYOUT_NAMED_PREFIX.length);\n  } else {\n    layoutName = '';\n  }\n\n  const layout: BuildLayout = {\n    id: createFileId(opts.routesDir, filePath),\n    filePath,\n    dirPath,\n    layoutType,\n    layoutName,\n  };\n\n  return layout;\n}\n\nconst LAYOUT_ID = 'layout';\nconst LAYOUT_NAMED_PREFIX = LAYOUT_ID + '-';\nconst LAYOUT_TOP_SUFFIX = '!';\n\nexport function resolveRoute(\n  opts: NormalizedPluginOptions,\n  appLayouts: BuildLayout[],\n  sourceFile: RouteSourceFile\n) {\n  const filePath = sourceFile.filePath;\n  const layouts: BuildLayout[] = [];\n  const routesDir = opts.routesDir;\n  const { layoutName, layoutStop } = parseRouteIndexName(sourceFile.extlessName);\n  let pathname = getPathnameFromDirPath(opts, sourceFile.dirPath);\n\n  if (sourceFile.extlessName === '404') {\n    pathname += sourceFile.extlessName + '.html';\n  }\n\n  if (!layoutStop) {\n    let currentDir = normalizePath(dirname(filePath));\n    let hasFoundNamedLayout = false;\n    const hasNamedLayout = layoutName !== '';\n\n    for (let i = 0; i < 20; i++) {\n      let layout: BuildLayout | undefined = undefined;\n\n      if (hasNamedLayout && !hasFoundNamedLayout) {\n        layout = appLayouts.find((l) => l.dirPath === currentDir && l.layoutName === layoutName);\n        if (layout) {\n          hasFoundNamedLayout = true;\n        }\n      } else {\n        layout = appLayouts.find((l) => l.dirPath === currentDir && l.layoutName === '');\n      }\n\n      if (layout) {\n        layouts.push(layout);\n        if (layout.layoutType === 'top') {\n          break;\n        }\n      }\n\n      if (currentDir === routesDir) {\n        break;\n      }\n\n      currentDir = normalizePath(dirname(currentDir));\n    }\n  }\n\n  const buildRoute: BuildRoute = {\n    id: createFileId(opts.routesDir, filePath, 'Route'),\n    filePath,\n    pathname,\n    layouts: layouts.reverse(),\n    ext: sourceFile.ext,\n    ...parseRoutePathname(opts.basePathname, pathname),\n  };\n\n  return buildRoute;\n}\n\nexport function resolveServerPlugin(opts: NormalizedPluginOptions, sourceFile: RouteSourceFile) {\n  const filePath = sourceFile.filePath;\n  const buildRoute: BuildServerPlugin = {\n    id: createFileId(opts.serverPluginsDir, filePath, 'Plugin'),\n    filePath,\n    ext: sourceFile.ext,\n  };\n  return buildRoute;\n}\n\nfunction resolveEntry(opts: NormalizedPluginOptions, sourceFile: RouteSourceFile) {\n  const pathname = getPathnameFromDirPath(opts, sourceFile.dirPath);\n  const chunkFileName = pathname.slice(opts.basePathname.length);\n\n  const buildEntry: BuildEntry = {\n    id: createFileId(opts.routesDir, sourceFile.filePath, 'Route'),\n    filePath: sourceFile.filePath,\n    chunkFileName,\n    ...parseRoutePathname(opts.basePathname, pathname),\n  };\n\n  return buildEntry;\n}\n\nfunction resolveServiceWorkerEntry(opts: NormalizedPluginOptions, sourceFile: RouteSourceFile) {\n  const dirPathname = getPathnameFromDirPath(opts, sourceFile.dirPath);\n  const pathname = dirPathname + sourceFile.extlessName + '.js';\n  const chunkFileName = pathname.slice(opts.basePathname.length);\n\n  const buildEntry: BuildEntry = {\n    id: createFileId(opts.routesDir, sourceFile.filePath, 'ServiceWorker'),\n    filePath: sourceFile.filePath,\n    chunkFileName,\n    ...parseRoutePathname(opts.basePathname, pathname),\n  };\n\n  return buildEntry;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/resolve-source-file.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport type { NormalizedPluginOptions, RouteSourceFile } from '../types';\nimport { resolveLayout } from './resolve-source-file';\nimport { getSourceFile } from './source-file';\n\ntest('resolveLayout', () => {\n  const t = [\n    {\n      fileName: 'layout.tsx',\n      expect: {\n        layoutName: '',\n        layoutType: 'nested',\n      },\n    },\n    {\n      fileName: 'layout!.tsx',\n      expect: {\n        layoutName: '',\n        layoutType: 'top',\n      },\n    },\n    {\n      fileName: 'layout-foo.tsx',\n      expect: {\n        layoutName: 'foo',\n        layoutType: 'nested',\n      },\n    },\n    {\n      fileName: 'layout-foo!.tsx',\n      expect: {\n        layoutName: 'foo',\n        layoutType: 'top',\n      },\n    },\n  ];\n\n  t.forEach((c) => {\n    const opts: NormalizedPluginOptions = {\n      routesDir: '',\n      serverPluginsDir: '',\n      basePathname: '/',\n      trailingSlash: false,\n      mdxPlugins: {\n        remarkGfm: true,\n        rehypeSyntaxHighlight: true,\n        rehypeAutolinkHeadings: true,\n      },\n      mdx: {},\n      platform: {},\n      rewriteRoutes: [],\n    };\n    const sourceFile: RouteSourceFile = {\n      ...getSourceFile(c.fileName)!,\n      dirPath: '',\n      dirName: '',\n      filePath: '',\n      fileName: '',\n    };\n    const l = resolveLayout(opts, sourceFile);\n    assert.equal(l.layoutName, c.expect.layoutName, c.fileName);\n    assert.equal(l.layoutType, c.expect.layoutType, c.fileName);\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/sort-routes.ts",
    "content": "import type { BuildRoute } from '../types';\n\nexport function routeSortCompare(a: BuildRoute, b: BuildRoute) {\n  const maxSegments = Math.max(a.segments.length, b.segments.length);\n\n  for (let i = 0; i < maxSegments; i += 1) {\n    const sa = a.segments[i];\n    const sb = b.segments[i];\n\n    // /x < /x/y, but /[...x]/y < /[...x]\n    if (!sa) {\n      return a.pathname.includes('[...') ? 1 : -1;\n    }\n    if (!sb) {\n      return b.pathname.includes('[...') ? -1 : 1;\n    }\n\n    const maxParts = Math.max(sa.length, sb.length);\n    for (let i = 0; i < maxParts; i += 1) {\n      const pa = sa[i];\n      const pb = sb[i];\n\n      // xy < x[y], but [x].json < [x]\n      if (pa === undefined) {\n        return pb.dynamic ? -1 : 1;\n      }\n      if (pb === undefined) {\n        return pa.dynamic ? 1 : -1;\n      }\n\n      // x < [x]\n      if (pa.dynamic !== pb.dynamic) {\n        return pa.dynamic ? 1 : -1;\n      }\n\n      if (pa.dynamic) {\n        // [x] < [...x]\n        if (pa.rest !== pb.rest) {\n          return pa.rest ? 1 : -1;\n        }\n      }\n    }\n  }\n\n  if (a.pathname === b.pathname) {\n    return a.ext > b.ext ? -1 : 1;\n  }\n\n  return a.pathname < b.pathname ? -1 : 1;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/sort-routes.unit.ts",
    "content": "import type { BuildRoute } from '../types';\nimport { createFileId } from '../../utils/fs';\nimport { parseRoutePathname } from './parse-pathname';\nimport { routeSortCompare } from './sort-routes';\nimport { test, assert } from 'vitest';\n\ntest('routeSortCompare', () => {\n  const pathnames = [\n    '/',\n    '/about',\n    '/blog',\n    '/blog/bar',\n    '/blog/foo',\n    '/blog/p[yyy].json',\n    '/blog/p[xxx]',\n    '/blog/p[yyy]',\n    '/blog/p[zzz]',\n    '/blog/[slug]',\n    '/[aaa]',\n    '/[bbb]',\n    '/[ccc]',\n    '/[...rest1]/lmn/[...deep_rest]/xyz',\n    '/[...rest1]/lmn/[...deep_rest]',\n    '/[...rest1]/abc',\n    '/[...rest1]/lmn',\n    '/[...rest2]',\n    '/[...rest]',\n  ];\n\n  const routesSame = [...pathnames].map((p) => route({ pathname: p }));\n  const actualSame = routesSame.sort(routeSortCompare).map((r) => r.pathname);\n  assert.deepEqual(actualSame, pathnames);\n\n  const routesReversed = [...pathnames].reverse().map((p) => route({ pathname: p }));\n  const actualReversed = routesReversed.sort(routeSortCompare).map((r) => r.pathname);\n  assert.deepEqual(actualReversed, pathnames);\n\n  const routesRandom = [...pathnames]\n    .sort(() => Math.random() - 0.5)\n    .map((p) => route({ pathname: p }));\n  const actualRandom = routesRandom.sort(routeSortCompare).map((r) => r.pathname);\n  assert.deepEqual(actualRandom, pathnames);\n});\n\nfunction route(r: TestRoute) {\n  const pathname = r.pathname || '/';\n  const route: BuildRoute = {\n    id: createFileId('', pathname, 'Route'),\n    filePath: pathname,\n    pathname,\n    ext: '.tsx',\n    layouts: [],\n    ...parseRoutePathname('/', pathname),\n  };\n  return route;\n}\n\ninterface TestRoute {\n  paramNames?: string[];\n  pathname?: string;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/source-file.ts",
    "content": "import type { RouteSourceFileName, RouteSourceType } from '../types';\nimport {\n  isModuleExt,\n  isEntryName,\n  isErrorName,\n  isMarkdownExt,\n  isMenuFileName,\n  isPageModuleExt,\n  isServiceWorkerName,\n  getExtension,\n  removeExtension,\n  isIndexModule,\n  isLayoutModule,\n} from '../../utils/fs';\n\nexport function getSourceFile(fileName: string) {\n  const ext = getExtension(fileName);\n  const extlessName = removeExtension(fileName);\n  const isPageModule = isPageModuleExt(ext);\n  const isModule = isModuleExt(ext);\n  const isMarkdown = isMarkdownExt(ext);\n  let type: RouteSourceType | null = null;\n\n  if (\n    (isIndexModule(extlessName) || isErrorName(extlessName)) &&\n    (isPageModule || isModule || isMarkdown)\n  ) {\n    // route page or endpoint\n    // index@layoutname or index! - ts|tsx|js|jsx|md|mdx\n    type = 'route';\n  } else if (isLayoutModule(extlessName) && (isPageModule || isModule)) {\n    // layout-name or layout! - ts|tsx|js|jsx\n    type = 'layout';\n  } else if (isEntryName(extlessName) && isModule) {\n    // entry module - ts|js\n    type = 'entry';\n  } else if (isMenuFileName(fileName)) {\n    // menu.md\n    type = 'menu';\n  } else if (isModule && isServiceWorkerName(extlessName)) {\n    // service-worker.ts|js\n    type = 'service-worker';\n  }\n\n  if (type !== null) {\n    const sourceFileName: RouteSourceFileName = {\n      type,\n      extlessName,\n      ext,\n    };\n    return sourceFileName;\n  }\n\n  return null;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/source-file.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { getSourceFile } from './source-file';\n\n[\n  {\n    fileName: '404.md',\n    expect: {\n      type: 'route',\n      extlessName: '404',\n      ext: '.md',\n    },\n  },\n  {\n    fileName: '404.tsx',\n    expect: {\n      type: 'route',\n      extlessName: '404',\n      ext: '.tsx',\n    },\n  },\n  {\n    fileName: '500.tsx',\n    expect: {\n      type: 'route',\n      extlessName: '500',\n      ext: '.tsx',\n    },\n  },\n  {\n    fileName: 'entry.md',\n    expect: null,\n  },\n  {\n    fileName: 'entry.ts',\n    expect: {\n      type: 'entry',\n      extlessName: 'entry',\n      ext: '.ts',\n    },\n  },\n  {\n    fileName: 'service-worker.ts',\n    expect: {\n      type: 'service-worker',\n      extlessName: 'service-worker',\n      ext: '.ts',\n    },\n  },\n  {\n    fileName: 'service-worker.js',\n    expect: {\n      type: 'service-worker',\n      extlessName: 'service-worker',\n      ext: '.js',\n    },\n  },\n  {\n    fileName: 'service-worker.tsx',\n    expect: null,\n  },\n  {\n    fileName: 'menu.md',\n    expect: {\n      type: 'menu',\n      extlessName: 'menu',\n      ext: '.md',\n    },\n  },\n  {\n    fileName: 'menu.mdx',\n    expect: null,\n  },\n  {\n    fileName: 'menu.tsx',\n    expect: null,\n  },\n  {\n    fileName: 'layout-name!.jsx',\n    expect: {\n      type: 'layout',\n      extlessName: 'layout-name!',\n      ext: '.jsx',\n    },\n  },\n  {\n    fileName: 'layout-name.jsx',\n    expect: {\n      type: 'layout',\n      extlessName: 'layout-name',\n      ext: '.jsx',\n    },\n  },\n  {\n    fileName: 'layout@name.jsx',\n    expect: null,\n  },\n  {\n    fileName: 'layout!.jsx',\n    expect: {\n      type: 'layout',\n      extlessName: 'layout!',\n      ext: '.jsx',\n    },\n  },\n  {\n    fileName: 'layout.jsx',\n    expect: {\n      type: 'layout',\n      extlessName: 'layout',\n      ext: '.jsx',\n    },\n  },\n  {\n    fileName: 'layout!.js',\n    expect: {\n      type: 'layout',\n      extlessName: 'layout!',\n      ext: '.js',\n    },\n  },\n  {\n    fileName: 'layout.js',\n    expect: {\n      type: 'layout',\n      extlessName: 'layout',\n      ext: '.js',\n    },\n  },\n  {\n    fileName: 'layout.css',\n    expect: null,\n  },\n  {\n    fileName: 'index.css',\n    expect: null,\n  },\n  {\n    fileName: 'index.css.ts',\n    expect: null,\n  },\n  {\n    fileName: 'index.scss.ts',\n    expect: null,\n  },\n  {\n    fileName: 'index.tsx.json',\n    expect: null,\n  },\n  {\n    fileName: 'index.mdx',\n    expect: {\n      type: 'route',\n      extlessName: 'index',\n      ext: '.mdx',\n    },\n  },\n  {\n    fileName: 'index.md',\n    expect: {\n      type: 'route',\n      extlessName: 'index',\n      ext: '.md',\n    },\n  },\n  {\n    fileName: 'index.ts',\n    expect: {\n      type: 'route',\n      extlessName: 'index',\n      ext: '.ts',\n    },\n  },\n  {\n    fileName: 'index@layoutname!.tsx',\n    expect: {\n      type: 'route',\n      extlessName: 'index@layoutname!',\n      ext: '.tsx',\n    },\n  },\n  {\n    fileName: 'index@layoutname.tsx',\n    expect: {\n      type: 'route',\n      extlessName: 'index@layoutname',\n      ext: '.tsx',\n    },\n  },\n  {\n    fileName: 'index!.tsx',\n    expect: {\n      type: 'route',\n      extlessName: 'index!',\n      ext: '.tsx',\n    },\n  },\n  {\n    fileName: 'index.tsx',\n    expect: {\n      type: 'route',\n      extlessName: 'index',\n      ext: '.tsx',\n    },\n  },\n  {\n    fileName: 'index.d.ts',\n    expect: null,\n  },\n].forEach((t) => {\n  test(`getSourceFile ${t.fileName}`, () => {\n    const s = getSourceFile(t.fileName);\n    if (s == null || t.expect == null) {\n      assert.equal(s, t.expect, t.fileName);\n    } else {\n      assert.equal(s.type, t.expect.type, t.fileName);\n      assert.equal(s.extlessName, t.expect.extlessName, t.fileName);\n      assert.equal(s.ext, t.expect.ext, t.fileName);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/walk-routes-dir.ts",
    "content": "import fs from 'node:fs';\nimport { basename, join } from 'node:path';\nimport type { RouteSourceFile } from '../types';\nimport { normalizePath } from '../../utils/fs';\nimport { getSourceFile } from './source-file';\n\nexport async function walkRoutes(routesDir: string) {\n  const sourceFiles: RouteSourceFile[] = [];\n  await walkRouteDir(sourceFiles, normalizePath(routesDir), basename(routesDir));\n  return sourceFiles;\n}\n\nasync function walkRouteDir(sourceFiles: RouteSourceFile[], dirPath: string, dirName: string) {\n  const dirItemNames = await fs.promises.readdir(dirPath);\n\n  await Promise.all(\n    dirItemNames.map(async (itemName) => {\n      const itemPath = normalizePath(join(dirPath, itemName));\n\n      const stat = await fs.promises.stat(itemPath);\n      if (stat.isDirectory()) {\n        await walkRouteDir(sourceFiles, itemPath, itemName);\n      } else {\n        const sourceFileName = getSourceFile(itemName);\n        if (sourceFileName !== null) {\n          sourceFiles.push({\n            ...sourceFileName,\n            fileName: itemName,\n            filePath: itemPath,\n            dirName,\n            dirPath,\n          });\n        }\n      }\n    })\n  );\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/routing/walk-server-plugins.ts",
    "content": "import fs from 'node:fs';\nimport { join } from 'node:path';\nimport type { BuildServerPlugin, NormalizedPluginOptions } from '../types';\nimport {\n  createFileId,\n  getExtension,\n  isModuleExt,\n  isPageModuleExt,\n  isPluginModule,\n  normalizePath,\n  removeExtension,\n} from '../../utils/fs';\n\nexport async function walkServerPlugins(opts: NormalizedPluginOptions) {\n  const dirPath = opts.serverPluginsDir;\n  const dirItemNames = await fs.promises.readdir(dirPath);\n  const sourceFiles: BuildServerPlugin[] = [];\n  await Promise.all(\n    dirItemNames.map(async (itemName) => {\n      const itemPath = normalizePath(join(dirPath, itemName));\n      const ext = getExtension(itemName);\n      const extlessName = removeExtension(itemName);\n\n      if ((isModuleExt(ext) || isPageModuleExt(ext)) && isPluginModule(extlessName)) {\n        sourceFiles.push({\n          id: createFileId(opts.serverPluginsDir, itemPath, 'Plugin'),\n          filePath: itemPath,\n          ext,\n        });\n      }\n    })\n  );\n  return sourceFiles;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/generate-entries.ts",
    "content": "import type { BuildContext } from '../types';\n\nexport function createEntries(ctx: BuildContext, c: string[]) {\n  const isClient = ctx.target === 'client';\n\n  const entries = [...ctx.entries, ...ctx.serviceWorkers];\n\n  if (isClient && entries.length > 0) {\n    // this is mainly created as a way to dynamically generate\n    // more build entry files. The \"e\" export would never\n    // actually be used at runtime.\n    c.push(`\\n/** Qwik City Entries Entry */`);\n    c.push(`export const e = () => import(\"@qwik-city-entries\");\\n`);\n  }\n}\n\nexport function generateQwikCityEntries(ctx: BuildContext) {\n  // generate @qwik-city-entries\n  const c: string[] = [];\n\n  const entries = [...ctx.entries, ...ctx.serviceWorkers];\n\n  c.push(`\\n/** Qwik City Entries (${entries.length}) */`);\n  for (let i = 0; i < entries.length; i++) {\n    const entry = entries[i];\n    c.push(`export const ${entry.id} = () => import(${JSON.stringify(entry.filePath)});`);\n  }\n\n  return c.join('\\n') + '\\n';\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/generate-menus.ts",
    "content": "import type { BuildContext } from '../types';\nimport { createFileId } from '../../utils/fs';\nimport { getImportPath } from './utils';\n\nexport function createMenus(ctx: BuildContext, c: string[], esmImports: string[], isSSR: boolean) {\n  c.push(`\\n/** Qwik City Menus (${ctx.menus.length}) */`);\n  c.push(`export const menus = [`);\n\n  const dynamicImports = !isSSR;\n  const routesDir = ctx.opts.routesDir;\n\n  for (const m of ctx.menus) {\n    const importPath = JSON.stringify(getImportPath(m.filePath));\n    if (dynamicImports) {\n      c.push(`  [${JSON.stringify(m.pathname)}, ()=>import(${importPath})],`);\n    } else {\n      const id = createFileId(routesDir, m.filePath);\n      esmImports.push(`import * as ${id} from ${importPath};`);\n      c.push(`  [${JSON.stringify(m.pathname)}, ()=>${id}],`);\n    }\n  }\n\n  c.push(`];`);\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/generate-qwik-city-plan.ts",
    "content": "import type { QwikVitePlugin } from '@builder.io/qwik/optimizer';\nimport type { BuildContext } from '../types';\nimport { createEntries } from './generate-entries';\nimport { createMenus } from './generate-menus';\nimport { createRoutes } from './generate-routes';\nimport { createServerPlugins } from './generate-server-plugins';\n\n/** Generates the Qwik City Plan runtime code */\nexport function generateQwikCityPlan(\n  ctx: BuildContext,\n  qwikPlugin: QwikVitePlugin,\n  isSSR: boolean\n) {\n  const esmImports: string[] = [];\n  const c: string[] = [];\n\n  c.push(`\\n/** Qwik City Plan */`);\n\n  createServerPlugins(ctx, qwikPlugin, c, esmImports, isSSR);\n\n  createRoutes(ctx, qwikPlugin, c, esmImports, isSSR);\n\n  createMenus(ctx, c, esmImports, isSSR);\n\n  createEntries(ctx, c);\n\n  c.push(`export const trailingSlash = ${JSON.stringify(!!ctx.opts.trailingSlash)};`);\n\n  c.push(`export const basePathname = ${JSON.stringify(ctx.opts.basePathname)};`);\n\n  c.push(`export const cacheModules = ${JSON.stringify(!ctx.isDevServer)};`);\n\n  c.push(\n    `export default { routes, serverPlugins, menus, trailingSlash, basePathname, cacheModules };`\n  );\n\n  return esmImports.join('\\n') + c.join('\\n');\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/generate-routes.ts",
    "content": "import type { QwikVitePlugin, QwikManifest } from '@builder.io/qwik/optimizer';\nimport type { BuildContext, BuildRoute } from '../types';\nimport { isModuleExt, isPageExt, removeExtension } from '../../utils/fs';\nimport { getImportPath } from './utils';\n\nexport function createRoutes(\n  ctx: BuildContext,\n  qwikPlugin: QwikVitePlugin,\n  c: string[],\n  esmImports: string[],\n  isSSR: boolean\n) {\n  const includeEndpoints = isSSR;\n  const dynamicImports = ctx.target === 'client';\n\n  if (ctx.layouts.length > 0) {\n    c.push(`\\n/** Qwik City Layouts (${ctx.layouts.length}) */`);\n    for (const layout of ctx.layouts) {\n      const importPath = JSON.stringify(getImportPath(layout.filePath));\n      if (dynamicImports) {\n        c.push(`const ${layout.id} = ()=>import(${importPath});`);\n      } else {\n        esmImports.push(`import * as ${layout.id}_ from ${importPath};`);\n        c.push(`const ${layout.id} = ()=>${layout.id}_;`);\n      }\n    }\n  }\n\n  c.push(`\\n/** Qwik City Routes (${ctx.routes.length}) */`);\n  c.push(`export const routes = [`);\n\n  for (const route of ctx.routes) {\n    const loaders = [];\n\n    if (isPageExt(route.ext)) {\n      // page module or markdown\n      for (const layout of route.layouts) {\n        loaders.push(layout.id);\n      }\n\n      const importPath = getImportPath(route.filePath);\n      if (dynamicImports) {\n        loaders.push(`()=>import(${JSON.stringify(importPath)})`);\n      } else {\n        esmImports.push(`import * as ${route.id} from ${JSON.stringify(importPath)};`);\n        loaders.push(`()=>${route.id}`);\n      }\n    } else if (includeEndpoints && isModuleExt(route.ext)) {\n      // include endpoints, and this is a module\n      const importPath = getImportPath(route.filePath);\n      esmImports.push(`import * as ${route.id} from ${JSON.stringify(importPath)};`);\n      for (const layout of route.layouts) {\n        loaders.push(layout.id);\n      }\n      loaders.push(`()=>${route.id}`);\n    }\n\n    if (loaders.length > 0) {\n      c.push(`  ${createRouteData(qwikPlugin, route, loaders, isSSR)},`);\n    }\n  }\n\n  c.push(`];`);\n}\n\nfunction createRouteData(\n  qwikPlugin: QwikVitePlugin,\n  r: BuildRoute,\n  loaders: string[],\n  isSsr: boolean\n) {\n  const routeName = JSON.stringify(r.routeName);\n  const moduleLoaders = `[ ${loaders.join(', ')} ]`;\n\n  // Use RouteData interface\n\n  if (isSsr) {\n    const originalPathname = JSON.stringify(r.pathname);\n    const clientBundleNames = JSON.stringify(getClientRouteBundleNames(qwikPlugin, r));\n\n    // SSR also adds the originalPathname and clientBundleNames to the RouteData\n    return `[ ${routeName}, ${moduleLoaders}, ${originalPathname}, ${clientBundleNames} ]`;\n  }\n\n  // simple RouteData, only route name and module loaders\n  return `[ ${routeName}, ${moduleLoaders} ]`;\n}\n\nfunction getClientRouteBundleNames(qwikPlugin: QwikVitePlugin, r: BuildRoute) {\n  const bundlesNames: string[] = [];\n\n  // TODO: Remove globalThis that was previously used. Left in for backwards compatibility.\n  const manifest: QwikManifest = globalThis.QWIK_MANIFEST || qwikPlugin.api.getManifest()!;\n  if (manifest) {\n    const manifestBundleNames = Object.keys(manifest.bundles);\n\n    const addRouteFile = (filePath: string) => {\n      filePath = removeExtension(filePath);\n\n      for (const bundleName of manifestBundleNames) {\n        const bundle = manifest.bundles[bundleName];\n        if (bundle.origins) {\n          for (const bundleOrigin of bundle.origins) {\n            const originPath = removeExtension(bundleOrigin);\n            if (filePath.endsWith(originPath)) {\n              if (!bundlesNames.includes(bundleName)) {\n                bundlesNames.push(bundleName);\n              }\n            }\n          }\n        }\n      }\n    };\n\n    for (const layout of r.layouts) {\n      addRouteFile(layout.filePath);\n    }\n    addRouteFile(r.filePath);\n  }\n\n  return bundlesNames;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/generate-server-plugins.ts",
    "content": "import type { QwikVitePlugin } from '@builder.io/qwik/optimizer';\nimport type { BuildContext } from '../types';\nimport { getImportPath } from './utils';\n\nexport function createServerPlugins(\n  ctx: BuildContext,\n  _qwikPlugin: QwikVitePlugin,\n  c: string[],\n  esmImports: string[],\n  isSSR: boolean\n) {\n  c.push(`\\n/** Qwik City ServerPlugins (${ctx.serverPlugins.length}) */`);\n  c.push(`export const serverPlugins = [`);\n  if (isSSR) {\n    for (const file of ctx.serverPlugins) {\n      const importPath = JSON.stringify(getImportPath(file.filePath));\n      esmImports.push(`import * as ${file.id} from ${importPath};`);\n    }\n    for (const file of ctx.serverPlugins) {\n      c.push(`  ${file.id},`);\n    }\n  }\n  c.push(`];`);\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/generate-service-worker.ts",
    "content": "import type { BuildContext } from '../types';\n\nexport function generateServiceWorkerRegister(ctx: BuildContext, swRegister: string) {\n  let swReg: string;\n  let swUrl = '/service-worker.js';\n\n  // Also unregister if the developer removed the service-worker.ts file since Qwik 1.14.0 and above now use modulepreload by default\n  if (ctx.isDevServer || ctx.serviceWorkers.length === 0) {\n    swReg = SW_UNREGISTER;\n  } else {\n    swReg = swRegister;\n\n    const sw = ctx.serviceWorkers.sort((a, b) =>\n      a.chunkFileName.length < b.chunkFileName.length ? -1 : 1\n    )[0];\n    swUrl = ctx.opts.basePathname + sw.chunkFileName;\n  }\n  swReg = swReg.replace('__url', swUrl);\n\n  return `export default ${JSON.stringify(swReg)};`;\n}\n\nconst SW_UNREGISTER = `\n\"serviceWorker\"in navigator&&navigator.serviceWorker.getRegistrations().then(r=>{for(const e of r){const c='__url'.split(\"/\").pop();e.active?.scriptURL.endsWith(c||\"service-worker.js\")&&e.unregister().catch(console.error)}}),\"caches\"in window&&caches.keys().then(r=>{const e=r.find(c=>c.startsWith(\"QwikBuild\"));e&&caches.delete(e).catch(console.error)}).catch(console.error)\n`;\n// Code in SW_UNREGISTER unregisters the service worker and deletes the cache; it is the minified version of the following:\n// (() => {\n//   if ('serviceWorker' in navigator) {\n//     navigator.serviceWorker.getRegistrations().then((regs) => {\n//       for (const reg of regs) {\n//         const url = '__url'.split('/').pop();\n//         if (reg.active?.scriptURL.endsWith(url || 'service-worker.js')) {\n//           reg.unregister().catch(console.error);\n//         }\n//       }\n//     });\n//   }\n//   if ('caches' in window) {\n//     caches\n//       .keys()\n//       .then((names) => {\n//         const cacheName = names.find((name) => name.startsWith('QwikBuild'));\n//         if (cacheName) {\n//           caches.delete(cacheName).catch(console.error);\n//         }\n//       })\n//       .catch(console.error);\n//   }\n// })();\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/sw-register-build.ts",
    "content": "// At build time this becomes a transpiled string version of\n// packages/qwik-city/src/runtime/src/sw-register.ts\n\nexport default '';\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/runtime-generation/utils.ts",
    "content": "export function getImportPath(importPath: string) {\n  const lowerCasePath = importPath.toLowerCase();\n  if (lowerCasePath.endsWith('.tsx') || lowerCasePath.endsWith('.jsx')) {\n    return importPath.slice(0, importPath.length - 4);\n  }\n  if (lowerCasePath.endsWith('.ts')) {\n    return importPath.slice(0, importPath.length - 3);\n  }\n  return importPath;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/types.ts",
    "content": "export interface BuildContext {\n  rootDir: string;\n  opts: NormalizedPluginOptions;\n  routes: BuildRoute[];\n  serverPlugins: BuildServerPlugin[];\n  layouts: BuildLayout[];\n  entries: BuildEntry[];\n  serviceWorkers: BuildEntry[];\n  menus: BuildMenu[];\n  frontmatter: Map<string, FrontmatterAttrs>;\n  diagnostics: Diagnostic[];\n  target: 'ssr' | 'client' | undefined;\n  isDevServer: boolean;\n  isDevServerClientOnly: boolean;\n  isDirty: boolean;\n  activeBuild: Promise<void> | null;\n}\n\nexport type Yaml = string | number | boolean | null | { [attrName: string]: Yaml } | Yaml[];\n\nexport interface FrontmatterAttrs {\n  [attrName: string]: Yaml;\n}\n\nexport interface Diagnostic {\n  type: 'error' | 'warn';\n  message: string;\n}\n\nexport interface RouteSourceFile extends RouteSourceFileName {\n  dirPath: string;\n  dirName: string;\n  filePath: string;\n  fileName: string;\n}\n\nexport interface RouteSourceFileName {\n  type: RouteSourceType;\n  /** Filename without the extension */\n  extlessName: string;\n  /** Just the extension */\n  ext: string;\n}\n\nexport type RouteSourceType = 'route' | 'layout' | 'entry' | 'menu' | 'service-worker';\n\nexport interface BuildRoute extends ParsedPathname {\n  /** Unique id built from its relative file system path */\n  id: string;\n  /** Local file system path */\n  filePath: string;\n  ext: string;\n  /** URL Pathname */\n  pathname: string;\n  layouts: BuildLayout[];\n}\n\nexport interface BuildServerPlugin {\n  /** Unique id built from its relative file system path */\n  id: string;\n  /** Local file system path */\n  filePath: string;\n  ext: string;\n}\n\nexport interface ParsedPathname {\n  routeName: string;\n  pattern: RegExp; // TODO(misko): duplicate information from `routeName` refactor to normalize\n  paramNames: string[]; // TODO(misko): duplicate information from `routeName` refactor to normalizehttps://github.com/QwikDev/qwik/pull/4954\n  segments: PathnameSegment[];\n}\n\nexport type PathnameSegment = PathnameSegmentPart[];\n\nexport interface PathnameSegmentPart {\n  content: string;\n  dynamic: boolean;\n  rest: boolean;\n}\n\nexport interface BuildLayout {\n  filePath: string;\n  dirPath: string;\n  id: string;\n  layoutType: 'top' | 'nested';\n  layoutName: string;\n}\n\nexport interface BuildEntry extends ParsedPathname {\n  id: string;\n  chunkFileName: string;\n  filePath: string;\n}\n\nexport interface BuildMenu {\n  pathname: string;\n  filePath: string;\n}\n\nexport interface ParsedMenuItem {\n  text: string;\n  href?: string;\n  items?: ParsedMenuItem[];\n}\n\n/** @public */\nexport interface RewriteRouteOption {\n  prefix?: string;\n  paths: Record<string, string>;\n}\n\n/** @public */\nexport interface PluginOptions {\n  /** Directory of the `routes`. Defaults to `src/routes`. */\n  routesDir?: string;\n  /** Directory of the `server plugins`. Defaults to `src/server-plugins`. */\n  serverPluginsDir?: string;\n  /**\n   * The base pathname is used to create absolute URL paths up to the `hostname`, and must always\n   * start and end with a `/`. Defaults to `/`.\n   */\n  basePathname?: string;\n  /**\n   * Ensure a trailing slash ends page urls. Defaults to `true`. (Note: Previous versions defaulted\n   * to `false`).\n   */\n  trailingSlash?: boolean;\n  /** Enable or disable MDX plugins included by default in qwik-city. */\n  mdxPlugins?: MdxPlugins;\n  /** MDX Options https://mdxjs.com/ */\n  mdx?: any;\n  /** The platform object which can be used to mock the Cloudflare bindings. */\n  platform?: Record<string, unknown>;\n  /** Configuration to rewrite url paths */\n  rewriteRoutes?: RewriteRouteOption[];\n}\n\nexport interface MdxPlugins {\n  remarkGfm: boolean;\n  rehypeSyntaxHighlight: boolean;\n  rehypeAutolinkHeadings: boolean;\n}\n\nexport interface NormalizedPluginOptions extends Required<PluginOptions> {\n  assetsDir?: string;\n}\n\nexport interface MarkdownAttributes {\n  [name: string]: string;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/buildtime/vite/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik-city.buildtime\",\n    \"reportFolder\": \"<projectFolder>/src/buildtime/vite/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/vite\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/vite/index.d.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/config.ts",
    "content": "// import { basename } from 'node:path';\nimport { type ConfigEnv, mergeConfig, type UserConfigExport } from 'vite';\n\n/** @public */\nexport function extendConfig(\n  baseConfigExport: UserConfigExport,\n  serverConfigExport: UserConfigExport\n) {\n  return async (env: ConfigEnv) => {\n    let resolvedBase = await baseConfigExport;\n    if (typeof resolvedBase === 'function') {\n      resolvedBase = await resolvedBase(env);\n    }\n\n    let resolvedServer = await serverConfigExport;\n    if (typeof resolvedServer === 'function') {\n      resolvedServer = await resolvedServer(env);\n    }\n\n    return mergeConfig(resolvedBase, resolvedServer);\n  };\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/dev-server.ts",
    "content": "import type { QwikViteDevResponse } from '@builder.io/qwik/optimizer';\nimport fs from 'node:fs';\nimport type { ServerResponse } from 'node:http';\nimport { join, resolve } from 'node:path';\nimport type { Connect, ViteDevServer } from 'vite';\nimport { computeOrigin, fromNodeHttp, getUrl } from '../../middleware/node/http';\nimport {\n  checkBrand,\n  resolveRequestHandlers,\n} from '../../middleware/request-handler/resolve-request-handlers';\nimport { getQwikCityServerData } from '../../middleware/request-handler/response-page';\nimport { getRouteMatchPathname, runQwikCity } from '../../middleware/request-handler/user-response';\nimport { matchRoute } from '../../runtime/src/route-matcher';\nimport { getMenuLoader } from '../../runtime/src/routing';\nimport type {\n  ActionInternal,\n  ContentMenu,\n  LoadedRoute,\n  LoaderInternal,\n  MenuData,\n  MenuModule,\n  MenuModuleLoader,\n  PathParams,\n  RebuildRouteInfoInternal,\n  RequestEvent,\n  RouteModule,\n} from '../../runtime/src/types';\nimport { getExtension, normalizePath } from '../../utils/fs';\nimport { updateBuildContext } from '../build';\nimport type { BuildContext, BuildRoute } from '../types';\nimport { formatError } from './format-error';\n\nexport function ssrDevMiddleware(ctx: BuildContext, server: ViteDevServer) {\n  const matchRouteRequest = (pathname: string) => {\n    for (const route of ctx.routes) {\n      let params = matchRoute(route.pathname, pathname);\n      if (params) {\n        return { route, params };\n      }\n\n      if (ctx.opts.trailingSlash && !pathname.endsWith('/')) {\n        params = matchRoute(route.pathname, pathname + '/');\n        if (params) {\n          return { route, params };\n        }\n      }\n    }\n\n    return null;\n  };\n\n  const routePs: Record<string, ReturnType<typeof _resolveRoute>> = {};\n  const _resolveRoute = async (\n    routeModulePaths: WeakMap<RouteModule<unknown>, string>,\n    matchPathname: string\n  ) => {\n    await updateBuildContext(ctx);\n    for (const d of ctx.diagnostics) {\n      if (d.type === 'error') {\n        console.error(d.message);\n      } else {\n        console.warn(d.message);\n      }\n    }\n\n    // use vite to dynamically load each layout/page module in this route's hierarchy\n    const loaderMap = new Map<string, string>();\n    const serverPlugins: RouteModule[] = [];\n    for (const file of ctx.serverPlugins) {\n      const layoutModule = await server.ssrLoadModule(file.filePath);\n      serverPlugins.push(layoutModule);\n      routeModulePaths.set(layoutModule, file.filePath);\n      checkModule(loaderMap, layoutModule, file.filePath);\n    }\n\n    const routeResult = matchRouteRequest(matchPathname);\n    const routeModules: RouteModule[] = [];\n\n    let params: PathParams = {};\n    if (routeResult) {\n      const route = routeResult.route;\n      params = routeResult.params;\n\n      // found a matching route\n      for (const layout of route.layouts) {\n        const layoutModule = await server.ssrLoadModule(layout.filePath);\n        routeModules.push(layoutModule);\n        routeModulePaths.set(layoutModule, layout.filePath);\n        checkModule(loaderMap, layoutModule, layout.filePath);\n      }\n      const endpointModule = await server.ssrLoadModule(route.filePath);\n      routeModules.push(endpointModule);\n      routeModulePaths.set(endpointModule, route.filePath);\n      checkModule(loaderMap, endpointModule, route.filePath);\n    }\n\n    let menu: ContentMenu | undefined = undefined;\n    const menus = ctx.menus.map((buildMenu) => {\n      const menuLoader: MenuModuleLoader = async () => {\n        const m = await server.ssrLoadModule(buildMenu.filePath);\n        const menuModule: MenuModule = {\n          default: m.default,\n        };\n        return menuModule;\n      };\n      const menuData: MenuData = [buildMenu.pathname, menuLoader];\n      return menuData;\n    });\n\n    const menuLoader = getMenuLoader(menus, matchPathname);\n    if (menuLoader) {\n      const menuModule = await menuLoader();\n      menu = menuModule?.default;\n    }\n\n    const loadedRoute = [\n      routeResult ? routeResult.route.pathname : '',\n      params,\n      routeModules,\n      menu,\n      undefined,\n    ] satisfies LoadedRoute;\n    return { serverPlugins, loadedRoute };\n  };\n  const resolveRoute = (\n    routeModulePaths: WeakMap<RouteModule<unknown>, string>,\n    pathname: string\n  ) => {\n    routePs[pathname] ||= _resolveRoute(routeModulePaths, pathname).finally(() => {\n      delete routePs[pathname];\n    });\n    return routePs[pathname];\n  };\n\n  // Preload the modules needed to handle /, so that they load faster on first request.\n  resolveRoute(new WeakMap(), '/').catch((e: unknown) => {\n    if (e instanceof Error) {\n      server.ssrFixStacktrace(e);\n      formatError(e);\n    }\n  });\n\n  return async (req: Connect.IncomingMessage, res: ServerResponse, next: Connect.NextFunction) => {\n    try {\n      const url = getUrl(req, computeOrigin(req));\n\n      if (shouldSkipRequest(url.pathname) || isVitePing(url.pathname, req.headers)) {\n        next();\n        return;\n      }\n      const { pathname, isInternal } = getRouteMatchPathname(url.pathname, ctx.opts.trailingSlash);\n\n      if (!isInternal) {\n        // Normally, entries are served statically, so in dev mode we need to handle them here.\n        const matchRouteName = url.pathname.slice(1);\n        const entry = ctx.entries.find((e) => e.routeName === matchRouteName);\n        if (entry) {\n          const entryContents = await server.transformRequest(\n            `/@fs${entry.filePath.startsWith('/') ? '' : '/'}${entry.filePath}`\n          );\n\n          if (entryContents) {\n            res.setHeader('Content-Type', 'text/javascript');\n            res.end(entryContents.code);\n          } else {\n            next();\n          }\n          return;\n        }\n      }\n\n      const routeModulePaths = new WeakMap<RouteModule, string>();\n      try {\n        const { serverPlugins, loadedRoute } = await resolveRoute(routeModulePaths, pathname);\n\n        const renderFn = async (requestEv: RequestEvent) => {\n          // routeResult && requestEv.sharedMap.set('@routeName', routeResult.route.pathname);\n          if (!isInternal) {\n            const serverData = getQwikCityServerData(requestEv);\n\n            res.statusCode = requestEv.status();\n            requestEv.headers.forEach((value, key) => {\n              res.setHeader(key, value);\n            });\n\n            const cookieHeaders = requestEv.cookie.headers();\n            if (cookieHeaders.length > 0) {\n              res.setHeader('Set-Cookie', cookieHeaders);\n            }\n\n            const serverTiming = requestEv.sharedMap.get('@serverTiming') as\n              | [string, number][]\n              | undefined;\n            if (serverTiming) {\n              res.setHeader(\n                'Server-Timing',\n                serverTiming.map((a) => `${a[0]};dur=${a[1]}`).join(',')\n              );\n            }\n            (res as QwikViteDevResponse)._qwikEnvData = {\n              ...(res as QwikViteDevResponse)._qwikEnvData,\n              ...serverData,\n            };\n\n            const qwikRenderPromise = new Promise<void>((resolve) => {\n              (res as QwikViteDevResponse)._qwikRenderResolve = resolve;\n            });\n\n            next();\n\n            return qwikRenderPromise;\n          }\n        };\n\n        const requestHandlers = resolveRequestHandlers(\n          serverPlugins,\n          loadedRoute,\n          req.method ?? 'GET',\n          false,\n          renderFn,\n          isInternal\n        );\n\n        if (requestHandlers.length > 0) {\n          const serverRequestEv = await fromNodeHttp(url, req, res, 'dev');\n          Object.assign(serverRequestEv.platform, ctx.opts.platform);\n\n          const { _deserializeData, _serializeData, _verifySerializable } =\n            await server.ssrLoadModule('@qwik-serializer');\n          const qwikSerializer = { _deserializeData, _serializeData, _verifySerializable };\n\n          const rebuildRouteInfo: RebuildRouteInfoInternal = async (url: URL) => {\n            const { pathname } = getRouteMatchPathname(url.pathname, ctx.opts.trailingSlash);\n            const { serverPlugins, loadedRoute } = await resolveRoute(routeModulePaths, pathname);\n            const requestHandlers = resolveRequestHandlers(\n              serverPlugins,\n              loadedRoute,\n              req.method ?? 'GET',\n              false,\n              renderFn,\n              isInternal\n            );\n\n            return {\n              loadedRoute,\n              requestHandlers,\n            };\n          };\n\n          const { completion, requestEv } = runQwikCity(\n            serverRequestEv,\n            loadedRoute,\n            requestHandlers,\n            rebuildRouteInfo,\n            ctx.opts.trailingSlash,\n            ctx.opts.basePathname,\n            qwikSerializer\n          );\n          const result = await completion;\n          if (result != null) {\n            throw result;\n          }\n\n          if (requestEv.headersSent || res.headersSent) {\n            return;\n          }\n        } else {\n          // no matching route\n\n          // test if this is a dev service-worker.js request\n          for (const sw of ctx.serviceWorkers) {\n            const match = sw.pattern.exec(req.originalUrl!);\n            if (match) {\n              res.setHeader('Content-Type', 'text/javascript');\n              res.end(DEV_SERVICE_WORKER);\n              return;\n            }\n          }\n        }\n      } catch (e: any) {\n        if (e instanceof Error) {\n          server.ssrFixStacktrace(e);\n          formatError(e);\n        }\n        if (e instanceof Error && (e as any).id === 'DEV_SERIALIZE') {\n          next(formatDevSerializeError(e, routeModulePaths));\n        } else {\n          next(e);\n        }\n        return;\n      }\n\n      // simple test if it's a static file\n      const ext = getExtension(req.originalUrl!);\n      if (STATIC_CONTENT_TYPES[ext]) {\n        // let the static asset middleware handle this\n        next();\n        return;\n      }\n\n      if (req.headers.accept && req.headers.accept.includes('text/html')) {\n        /**\n         * If no route match, but is html request, fast path to 404 otherwise qwik plugin will take\n         * over render without envData causing error\n         */\n        // TODO: after file change, need to manual page refresh to see changes currently\n        //       there's two ways handling HMR for page endpoint with error\n        // 1. Html response inject `import.meta.hot.accept('./pageEndpoint_FILE_URL', () => { location.reload })`\n        // 2. watcher, diff previous & current file content, a bit expensive\n        const html = getUnmatchedRouteHtml(url, ctx);\n        res.statusCode = 404;\n        res.setHeader('Content-Type', 'text/html; charset=utf-8');\n        res.end(html);\n        return;\n      }\n\n      next();\n    } catch (e) {\n      next(e);\n    }\n  };\n}\n\nconst checkModule = (loaderMap: Map<string, string>, routeModule: any, filePath: string) => {\n  for (const loader of Object.values(routeModule)) {\n    if (checkBrand(loader, 'server_action') || checkBrand(loader, 'server_loader')) {\n      checkUniqueLoader(loaderMap, loader as any, filePath);\n    }\n  }\n};\n\nconst checkUniqueLoader = (\n  loaderMap: Map<string, string>,\n  loader: LoaderInternal | ActionInternal,\n  filePath: string\n) => {\n  const prev = loaderMap.get(loader.__id);\n  if (prev) {\n    const type = loader.__brand === 'server_loader' ? 'routeLoader$' : 'routeAction$';\n    throw new Error(\n      `The same ${type} (${loader.__qrl.getSymbol()}) was exported in multiple modules:\n      - ${prev}\n      - ${filePath}`\n    );\n  }\n  loaderMap.set(loader.__id, filePath);\n};\n\nexport function getUnmatchedRouteHtml(url: URL, ctx: BuildContext): string {\n  const blue = '#006ce9';\n  const routesAndDistance = sortRoutesByDistance(ctx.routes, url);\n  return `\n  <html>\n    <head>\n      <meta charset=\"utf-8\">\n      <meta http-equiv=\"Status\" content=\"404\">\n      <title>404 Not Found</title>\n      <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n      <style>\n        body { color: ${blue}; background-color: #fafafa; padding: 30px; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif; }\n        div, p { max-width: 70vw; margin: 60px auto 30px auto; background: white; border-radius: 4px; box-shadow: 0px 0px 50px -20px ${blue}; word-break: break-word; }\n        div { display: flex; flex-direction: column; }\n        strong { display: inline-block; padding: 15px; background: ${blue}; color: white; }\n        span { display: inline-block; padding: 15px; }\n        a { padding: 15px; }\n        a:hover { background-color: rgba(0, 108, 233, 0.125); }\n        .recommended { font-size: 0.8em; font-weight: 700; padding: 10px; }\n      </style>\n    </head>\n    <body>\n      <p><strong>404</strong> <span>${url.pathname} not found.</span></p>\n\n      <div>\n        <strong>Available Routes</strong>\n\n        ${routesAndDistance\n          .map(\n            ([route, distance], i) =>\n              `<a href=\"${route.pathname}\">${route.pathname}${\n                i === 0 && distance < 3\n                  ? '<span class=\"recommended\"> 👈 maybe you meant this?</span>'\n                  : ''\n              } </a>`\n          )\n          .join('')}\n      </div>\n    </body>\n  </html>`;\n}\n\nconst sortRoutesByDistance = (routes: BuildRoute[], url: URL) => {\n  const pathname = url.pathname;\n  const routesWithDistance = routes.map(\n    (route) => [route, levenshteinDistance(pathname, route.pathname)] as const\n  );\n  return routesWithDistance.sort((a, b) => a[1] - b[1]);\n};\n\nconst levenshteinDistance = (s: string, t: string) => {\n  if (!s.endsWith('/')) {\n    s = s + '/';\n  }\n  if (!t.endsWith('/')) {\n    t = t + '/';\n  }\n  const arr = [];\n  for (let i = 0; i <= t.length; i++) {\n    arr[i] = [i];\n    for (let j = 1; j <= s.length; j++) {\n      arr[i][j] =\n        i === 0\n          ? j\n          : Math.min(\n              arr[i - 1][j] + 1,\n              arr[i][j - 1] + 1,\n              arr[i - 1][j - 1] + (s[j - 1] === t[i - 1] ? 0 : 1)\n            );\n    }\n  }\n  return arr[t.length][s.length];\n};\n\n/**\n * Static file server for files written directly to the 'dist' dir.\n *\n * Only handles the simplest cases.\n */\nexport function staticDistMiddleware({ config }: ViteDevServer) {\n  const distDirs = new Set(\n    ['dist', config.build.outDir, config.publicDir].map((d) =>\n      normalizePath(resolve(config.root, d))\n    )\n  );\n\n  return async (req: Connect.IncomingMessage, res: ServerResponse, next: Connect.NextFunction) => {\n    const url = new URL(req.originalUrl!, `http://${req.headers.host}`);\n\n    if (shouldSkipRequest(url.pathname)) {\n      next();\n      return;\n    }\n\n    const relPath = `${url.pathname.slice(1)}${url.search}`;\n\n    const ext = getExtension(relPath);\n    const contentType = STATIC_CONTENT_TYPES[ext];\n    if (!contentType) {\n      next();\n      return;\n    }\n\n    for (const distDir of distDirs) {\n      try {\n        const filePath = join(distDir, relPath);\n        const s = await fs.promises.stat(filePath);\n        if (s.isFile()) {\n          res.writeHead(200, {\n            'Content-Type': contentType,\n            'X-Source-Path': filePath,\n          });\n          fs.createReadStream(filePath).pipe(res);\n          return;\n        }\n      } catch (e) {\n        //\n      }\n    }\n\n    next();\n  };\n}\n\nfunction formatDevSerializeError(err: any, routeModulePaths: WeakMap<RouteModule, string>) {\n  const requestHandler = err.requestHandler;\n\n  if (requestHandler?.name) {\n    let errMessage = `Data returned from the ${requestHandler.name}() endpoint must be serializable `;\n    errMessage += `so it can also be transferred over the network in an HTTP response. `;\n    errMessage += `Please ensure that the data returned from ${requestHandler.name}() is limited to only strings, numbers, booleans, arrays or objects, and does not have any circular references. `;\n    errMessage += `Error: ${err.message}`;\n    err.message = errMessage;\n\n    const endpointModule = err.endpointModule;\n    const filePath = routeModulePaths.get(endpointModule);\n    if (filePath) {\n      try {\n        const code = fs.readFileSync(filePath, 'utf-8');\n        err.plugin = 'vite-plugin-qwik-city';\n        err.id = normalizePath(filePath);\n        err.loc = {\n          file: err.id,\n          line: undefined,\n          column: undefined,\n        };\n        err.stack = '';\n        const lines = code.split('\\n');\n        const line = lines.findIndex((line) => line.includes(requestHandler.name));\n        if (line > -1) {\n          err.loc.line = line + 1;\n        }\n      } catch (e) {\n        // nothing\n      }\n    }\n  }\n  return err;\n}\n\nconst FS_PREFIX = `/@fs/`;\nconst VALID_ID_PREFIX = `/@id/`;\nconst VITE_PUBLIC_PATH = `/@vite/`;\nconst internalPrefixes = [FS_PREFIX, VALID_ID_PREFIX, VITE_PUBLIC_PATH];\nconst InternalPrefixRE = new RegExp(`^(?:${internalPrefixes.join('|')})`);\n\nfunction shouldSkipRequest(pathname: string) {\n  if (pathname.startsWith('/@qwik-city-')) {\n    return true;\n  }\n  if (\n    pathname.includes('__open-in-editor') ||\n    InternalPrefixRE.test(pathname) ||\n    pathname.startsWith('/node_modules/')\n  ) {\n    return true;\n  }\n  if (pathname.includes('favicon')) {\n    return true;\n  }\n  if (pathname.startsWith('/src/') || pathname.startsWith('/@fs/')) {\n    const ext = getExtension(pathname);\n    if (SKIP_SRC_EXTS[ext]) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction isVitePing(url: string, headers: Connect.IncomingMessage['headers']) {\n  return url === '/' && headers.accept === '*/*' && headers['sec-fetch-mode'] === 'no-cors';\n}\n\nconst SKIP_SRC_EXTS: { [ext: string]: boolean } = {\n  '.tsx': true,\n  '.ts': true,\n  '.jsx': true,\n  '.js': true,\n  '.md': true,\n  '.mdx': true,\n  '.css': true,\n  '.scss': true,\n  '.sass': true,\n  '.less': true,\n  '.styl': true,\n  '.stylus': true,\n};\n\nconst STATIC_CONTENT_TYPES: { [ext: string]: string } = {\n  '.js': 'text/javascript',\n  '.mjs': 'text/javascript',\n  '.json': 'application/json',\n  '.css': 'text/css',\n  '.html': 'text/html',\n  '.svg': 'image/svg+xml',\n  '.png': 'image/png',\n  '.gif': 'image/gif',\n  '.jpeg': 'image/jpeg',\n  '.jpg': 'image/jpeg',\n  '.ico': 'image/x-icon',\n};\n\nconst DEV_SERVICE_WORKER = `/* Qwik City Dev Service Worker */\nself.addEventListener('install', () => self.skipWaiting());\nself.addEventListener('activate', (ev) => ev.waitUntil(self.clients.claim()));\n`;\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/format-error.ts",
    "content": "import {\n  findLocation,\n  generateCodeFrame,\n} from '../../../../qwik/src/optimizer/src/plugins/vite-utils';\nimport { normalizePath } from '../../utils/fs';\nimport fs from 'node:fs';\n\nexport function formatError(e: any) {\n  if (e instanceof Error) {\n    const err = e as any;\n    let loc = err.loc;\n    if (!err.frame && !err.plugin) {\n      if (!loc) {\n        loc = findLocation(err);\n      }\n      if (loc) {\n        err.loc = loc;\n        if (loc.file) {\n          err.id = normalizePath(err.loc.file);\n          try {\n            const code = fs.readFileSync(err.loc.file, 'utf-8');\n            err.frame = generateCodeFrame(code, err.loc);\n          } catch {\n            // nothing\n          }\n        }\n      }\n    }\n  }\n  return e;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/get-route-imports.ts",
    "content": "import type { QwikBundle, QwikManifest } from '@builder.io/qwik/optimizer';\nimport { removeExtension } from '../../utils/fs';\nimport type { BuildRoute } from '../types';\nimport { QWIK_CITY_PLAN_ID } from './plugin';\n\nexport function getRouteImports(routes: BuildRoute[], manifest: QwikManifest) {\n  const result: Record<string, { imports?: string[]; dynamicImports?: string[] }> = {};\n  routes.forEach((route) => {\n    const routePath = removeExtension(route.filePath);\n    const layoutPaths = route.layouts\n      ? route.layouts.map((layout) => removeExtension(layout.filePath))\n      : [];\n    const routeAndLayoutPaths = [routePath, ...layoutPaths];\n\n    const bundles = [];\n\n    for (const [bundleName, bundle] of Object.entries(manifest.bundles)) {\n      if (isBundlePartOfRoute(bundle, routeAndLayoutPaths)) {\n        bundles.push(bundleName);\n      }\n    }\n    if (bundles.length > 0) {\n      result[route.routeName] = { dynamicImports: bundles };\n    }\n  });\n  for (const bundleName of Object.keys(manifest.bundles)) {\n    const bundle = manifest.bundles[bundleName];\n    if (bundle.origins?.some((s) => s.endsWith(QWIK_CITY_PLAN_ID))) {\n      result[bundleName] = {\n        ...bundle,\n        dynamicImports: bundle.dynamicImports?.filter((d) =>\n          manifest.bundles[d].origins?.some((s) => s.endsWith('menu.md'))\n        ),\n      };\n      break;\n    }\n  }\n  return result;\n}\n\nfunction isBundlePartOfRoute(bundle: QwikBundle, routeAndLayoutPaths: string[]) {\n  if (!bundle.origins) {\n    return false;\n  }\n  for (const bundleOrigin of bundle.origins) {\n    const originPath = removeExtension(bundleOrigin);\n    return routeAndLayoutPaths.some((path) => path.endsWith(originPath));\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/get-route-imports.unit.ts",
    "content": "import { type QwikBundle, type QwikManifest } from '@builder.io/qwik/optimizer';\nimport { describe, expect, test } from 'vitest';\nimport type { BuildLayout, BuildRoute } from '../types';\nimport { getRouteImports } from './get-route-imports';\n\ndescribe('modifyBundleGraph', () => {\n  test(`GIVEN 2 routes, one with a layout\n        AND a manifest with 3 bundles \n        THEN the bundle graph should contain the routes and their dependencies`, () => {\n    const size = 0;\n    const total = 0;\n    const fakeManifest = {\n      bundles: {\n        'fake-bundle1.js': {\n          size,\n          total,\n          imports: ['fake-bundle-static-dep.js'],\n          origins: ['src/routes/index.tsx'],\n        },\n        'fake-bundle-static-dep.js': {\n          size,\n          total,\n          dynamicImports: ['fake-bundle-dynamic-dep.js'],\n        },\n        'fake-bundle-dynamic-dep.js': { size, total },\n        'fake-bundle-part-of-sub-route.js': {\n          size,\n          total,\n          origins: ['src/routes/subroute/index.tsx', 'src/some/other/component.tsx'],\n        },\n        'fake-bundle-part-of-layout.js': { size, total, origins: ['src/routes/layout.tsx'] },\n        'q-city-plan.js': { size, total, origins: ['@qwik-city-plan'] },\n      } as Record<string, QwikBundle>,\n    } as QwikManifest;\n\n    const fakeRoutes: BuildRoute[] = [\n      {\n        routeName: '/',\n        filePath: '/home/qwik-app/src/routes/index.tsx',\n      },\n      {\n        routeName: '/subroute',\n        filePath: '/home/qwik-app/src/routes/subroute/index.tsx',\n        layouts: [\n          {\n            filePath: '/home/qwik-app/src/routes/layout.tsx',\n          },\n        ] as BuildLayout[],\n      },\n    ] as BuildRoute[];\n\n    const actualResult = getRouteImports(fakeRoutes, fakeManifest);\n    expect(actualResult).toMatchInlineSnapshot(`\n      {\n        \"/\": {\n          \"dynamicImports\": [\n            \"fake-bundle1.js\",\n          ],\n        },\n        \"/subroute\": {\n          \"dynamicImports\": [\n            \"fake-bundle-part-of-sub-route.js\",\n            \"fake-bundle-part-of-layout.js\",\n          ],\n        },\n        \"q-city-plan.js\": {\n          \"dynamicImports\": undefined,\n          \"origins\": [\n            \"@qwik-city-plan\",\n          ],\n          \"size\": 0,\n          \"total\": 0,\n        },\n      }\n    `);\n  });\n\n  test(`GIVEN a mismatch between the bundle graph and the manifest\n        THEN the resulted bundle graph routes should not contain -1 (not found) indices `, () => {\n    const size = 0;\n    const total = 0;\n    const fakeManifest = {\n      bundles: {\n        'fake-bundle1.js': { size, total, origins: ['src/routes/index.tsx'] },\n        // 👇 doesn't exist in the bundle graph for some reason\n        'fake-bundle2.js': { size, total, origins: ['src/routes/index.tsx'] },\n      } as Record<string, QwikBundle>,\n    } as QwikManifest;\n\n    const fakeRoutes: BuildRoute[] = [\n      {\n        routeName: '/',\n        filePath: '/home/qwik-app/src/routes/index.tsx',\n      },\n    ] as BuildRoute[];\n\n    const actualResult = getRouteImports(fakeRoutes, fakeManifest);\n\n    expect(actualResult).toMatchInlineSnapshot(`\n      {\n        \"/\": {\n          \"dynamicImports\": [\n            \"fake-bundle1.js\",\n            \"fake-bundle2.js\",\n          ],\n        },\n      }\n    `);\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/image-jsx.ts",
    "content": "import type { OutputFormat } from 'vite-imagetools';\nimport type { PluginOption } from 'vite';\nimport { optimize } from 'svgo';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { parseId } from '../../../../qwik/src/optimizer/src/plugins/vite-utils';\nimport type { QwikCityVitePluginOptions } from './types';\nimport type { Config as SVGOConfig } from 'svgo';\n\n/** @public */\nexport function imagePlugin(userOpts?: QwikCityVitePluginOptions): PluginOption[] {\n  const supportedExtensions = ['.jpg', '.jpeg', '.png', '.webp', '.gif', '.avif', '.tiff'];\n  return [\n    import('vite-imagetools')\n      .then(({ imagetools }) =>\n        imagetools({\n          exclude: [],\n          extendOutputFormats(builtins) {\n            const jsx: OutputFormat = () => (metadatas) => {\n              const srcSet = metadatas.map((meta) => `${meta.src} ${meta.width}w`).join(', ');\n              let largestImage: any;\n              let largestImageSize = 0;\n              for (let i = 0; i < metadatas.length; i++) {\n                const m = metadatas[i] as any;\n                if (m.width > largestImageSize) {\n                  largestImage = m;\n                  largestImageSize = m.width;\n                }\n              }\n              return {\n                srcSet,\n                width:\n                  largestImage === null || largestImage === void 0 ? void 0 : largestImage.width,\n                height:\n                  largestImage === null || largestImage === void 0 ? void 0 : largestImage.height,\n              };\n            };\n            return {\n              ...builtins,\n              jsx,\n            };\n          },\n          defaultDirectives: (url) => {\n            if (url.searchParams.has('jsx')) {\n              const { jsx, ...params } = Object.fromEntries(url.searchParams.entries());\n              return new URLSearchParams({\n                format: 'webp',\n                quality: '75',\n                w: '200;400;600;800;1200',\n                withoutEnlargement: '',\n                ...userOpts?.imageOptimization?.jsxDirectives,\n                ...params,\n                as: 'jsx',\n              });\n            }\n            return new URLSearchParams();\n          },\n        })\n      )\n      .catch((err) => {\n        console.error('Error loading vite-imagetools, image imports are not available', err);\n        return null;\n      }) as PluginOption,\n    {\n      name: 'qwik-city-image-jsx',\n      load: {\n        order: 'pre',\n        handler: async (id) => {\n          const { params, pathId } = parseId(id);\n          const extension = path.extname(pathId).toLowerCase();\n          if (extension === '.svg' && params.has('jsx')) {\n            const code = await fs.promises.readFile(pathId, 'utf-8');\n            return {\n              code,\n              moduleSideEffects: false,\n            };\n          }\n        },\n      },\n      transform(code, id) {\n        id = id.toLowerCase();\n        const { params, pathId } = parseId(id);\n        if (params.has('jsx')) {\n          const extension = path.extname(pathId).toLowerCase();\n\n          if (supportedExtensions.includes(extension)) {\n            if (!code.includes('srcSet')) {\n              this.error(`Image '${id}' could not be optimized to JSX`);\n            }\n            const index = code.indexOf('export default');\n            return {\n              code:\n                code.slice(0, index) +\n                `\n  import { _jsxQ } from '@builder.io/qwik';\n  const PROPS = {srcSet, width, height};\n  export default function (props, key, _, dev) {\n    return _jsxQ('img', {...{decoding: 'async', loading: 'lazy'}, ...props}, PROPS, undefined, 3, key, dev);\n  }`,\n              map: null,\n            };\n          } else if (extension === '.svg') {\n            const { svgAttributes } = optimizeSvg({ code, path: pathId }, userOpts);\n            return {\n              code: `\n  import { _jsxQ } from '@builder.io/qwik';\n  const PROPS = ${JSON.stringify(svgAttributes)};\n  export default function (props, key, _, dev) {\n    return _jsxQ('svg', props, PROPS, undefined, 3, key, dev);\n  }`,\n              map: null,\n            };\n          }\n        }\n        return null;\n      },\n    },\n  ];\n}\n\nexport function optimizeSvg(\n  { code, path }: { code: string; path: string },\n  userOpts?: QwikCityVitePluginOptions\n) {\n  const svgAttributes: Record<string, string> = {};\n  const prefixIdsConfiguration = userOpts?.imageOptimization?.svgo?.prefixIds;\n  const maybePrefixIdsPlugin: SVGOConfig['plugins'] =\n    prefixIdsConfiguration !== false ? [{ name: 'prefixIds', params: prefixIdsConfiguration }] : [];\n\n  const userPlugins =\n    userOpts?.imageOptimization?.svgo?.plugins?.filter((plugin) => {\n      if (\n        plugin === 'preset-default' ||\n        (typeof plugin === 'object' && plugin.name === 'preset-default')\n      ) {\n        console.warn(\n          `You are trying to use the preset-default SVGO plugin. This plugin is already included by default, you can customize it through the defaultPresetOverrides option.`\n        );\n        return false;\n      }\n\n      if (plugin === 'prefixIds' || (typeof plugin === 'object' && plugin.name === 'prefixIds')) {\n        console.warn(\n          `You are trying to use the preset-default SVGO plugin. This plugin is already included by default, you can customize it through the prefixIds option.`\n        );\n        return false;\n      }\n\n      return true;\n    }) || [];\n\n  const data = optimize(code, {\n    floatPrecision: userOpts?.imageOptimization?.svgo?.floatPrecision,\n    multipass: userOpts?.imageOptimization?.svgo?.multipass,\n    path: path,\n    plugins: [\n      {\n        name: 'preset-default',\n        params: {\n          overrides: {\n            removeViewBox: false,\n            ...userOpts?.imageOptimization?.svgo?.defaultPresetOverrides,\n          },\n        },\n      },\n      {\n        name: 'customPluginName',\n        fn: () => {\n          return {\n            element: {\n              exit: (node) => {\n                if (node.name === 'svg') {\n                  node.name = 'g';\n                  Object.assign(svgAttributes, node.attributes);\n                  node.attributes = {};\n                }\n              },\n            },\n          };\n        },\n      },\n      ...maybePrefixIdsPlugin,\n      ...userPlugins,\n    ],\n  }).data;\n\n  svgAttributes.dangerouslySetInnerHTML = data.slice(3, -4);\n\n  return {\n    data,\n    svgAttributes,\n  };\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/image-jsx.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { optimizeSvg } from './image-jsx';\n\nconst qwikLogoSvg = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 649 201\"><path fill=\"#18B6F6\" d=\"m153.3 186.54-29.35-29.2-.42.07v-.3L61.12 95.37l15.41-14.85-9.06-51.93-42.89 53.2c-7.28 7.36-8.68 19.39-3.4 28.21l26.8 44.49c4.1 6.82 10.54 11.2 19.53 10.88 19.03-.67 27.4-.67 27.4-.67l58.37 21.81.02.02Z\"/><path fill=\"#AC7EF4\" d=\"M167.8 104.72c4.23-8.72 5.74-16.35 1.57-24l-5.93-10.92-3.08-5.6-1.2-2.2-.1.14-16.15-28A22.57 22.57 0 0 0 123.1 22.8l-14.16.4-42.25.11A22.66 22.66 0 0 0 47.31 34.5L21.64 85.48l45.94-57.15 60.27 66.27-10.8 10.93 6.45 51.84.09-.1v.14h-.1l.14.13 5.02 4.9 24.3 23.74c1.03.98 2.68-.2 2-1.42l-15.02-29.57\"/><path fill=\"#fff\" d=\"M127.99 94.43 67.56 28.5l8.59 51.64-15.38 14.92 62.62 62.23-5.64-51.66 10.24-11.17v-.02Z\"/><path fill=\"#000\" stroke=\"#fff\" stroke-linejoin=\"round\" stroke-width=\"3\" d=\"M319.08 188.1c.83 0 1.5-.68 1.5-1.5V61.78a1.5 1.5 0 0 0-1.03-1.43c-12.58-4.07-26.24-6.1-41.15-6.1-15.89 0-27.69 3.7-35.21 11.61l-.01.02c-7.34 7.9-10.8 21.53-10.8 39.7 0 18.12 2.9 31.18 9.08 38.73 6.24 7.58 16.04 11.12 28.9 11.12a45.6 45.6 0 0 0 24.04-6.58v37.75c0 .82.68 1.5 1.5 1.5h23.18Zm-24.7-110.05V124c0 1.83-1.37 3.8-4.4 5.4-2.97 1.57-7.24 2.59-12.16 2.59-7.63 0-12.35-1.95-15.04-5.44-1.36-1.75-2.43-4.37-3.16-8.01-.73-3.63-1.09-8.18-1.09-13.7 0-5.86.41-10.72 1.19-14.61.77-3.9 1.9-6.73 3.27-8.58 2.68-3.62 7.73-5.58 15.4-5.58 5.83 0 11.16.62 16 1.98Zm57.89-21.23h-23.52a1.5 1.5 0 0 0-1.4 2.02c10.56 28.23 20.4 59.2 29.52 93.1a1.5 1.5 0 0 0 1.44 1.1h27.18c.64 0 1.2-.4 1.42-1a553.09 553.09 0 0 0 16.4-54.94c5.8 21.37 10.17 39.52 13 54.72a1.5 1.5 0 0 0 1.48 1.23h27.18a1.5 1.5 0 0 0 1.39-.94 1032.42 1032.42 0 0 0 32.34-93.37 1.5 1.5 0 0 0-1.44-1.92h-22.8a1.5 1.5 0 0 0-1.46 1.13c-4.94 19.41-11.47 40.57-19.74 63.65a683.17 683.17 0 0 0-18.07-63.76 1.5 1.5 0 0 0-1.42-1.02H393.5c-.69 0-1.3.47-1.45 1.15a745.57 745.57 0 0 1-18.45 63.76 795.63 795.63 0 0 0-19.84-63.7 1.5 1.5 0 0 0-1.48-1.21h-.02ZM490 58.34v93.23c0 .83.68 1.5 1.5 1.5h23.18c.83 0 1.5-.67 1.5-1.5V58.34c0-.83-.67-1.5-1.5-1.5h-22.93a1.5 1.5 0 0 0-1.74 1.48v.02Zm-1.63-25.93c0 5.22.7 9.05 3.2 11.46 2.48 2.4 6.33 3 11.44 3 5.1 0 8.96-.6 11.44-3 2.5-2.41 3.2-6.24 3.2-11.46 0-4.7-.71-8.2-3.27-10.39-2.47-2.1-6.3-2.62-11.37-2.62-5.08 0-8.9.52-11.37 2.62-2.56 2.18-3.27 5.69-3.27 10.39Zm135.61 24.41h-26.81c-.5 0-.95.24-1.23.64a669.19 669.19 0 0 1-21.85 29.9c-4.19 5.32-7.48 9.12-9.91 11.48V18c0-.83-.67-1.5-1.5-1.5H539.5c-.83 0-1.5.67-1.5 1.5v133.57c0 .83.67 1.5 1.5 1.5h23.18c.83 0 1.5-.67 1.5-1.5V104.9c.67.57 1.44 1.3 2.32 2.24 1.97 2.1 4.4 5.06 7.36 9.03 5.92 7.92 13.93 19.7 24.78 36.21.28.42.75.68 1.26.68h26.64a1.5 1.5 0 0 0 1.28-2.28c-8.77-14.54-16.69-26.35-23.08-34.98-3.2-4.3-6.03-7.83-8.4-10.5a47.47 47.47 0 0 0-4.28-4.35c3.17-2.84 7.23-7.37 12.18-13.51a566.95 566.95 0 0 0 20.85-28.1 1.5 1.5 0 0 0-1.09-2.53h-.02Z\"/></svg>`;\n\ntest('optimize svg', () => {\n  const { data, svgAttributes } = optimizeSvg({ code: qwikLogoSvg, path: '' });\n  const html = svgAttributes.dangerouslySetInnerHTML;\n\n  assert.isTrue(data.startsWith('<g>') && data.endsWith('</g>'));\n  assert.isDefined(html);\n  assert.isTrue(html.startsWith('<path') && html.endsWith('/>'));\n});\n\nconst svgsFilesWithDefsTag = [\n  {\n    content: `<svg height=\"130\" width=\"500\">\n  <defs>\n    <linearGradient id=\"grad1\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n      <stop offset=\"0%\" style=\"stop-color:rgb(255,255,0);stop-opacity:1\" />\n      <stop offset=\"100%\" style=\"stop-color:rgb(255,0,0);stop-opacity:1\" />\n    </linearGradient>\n  </defs>\n  <ellipse cx=\"100\" cy=\"70\" rx=\"85\" ry=\"55\" fill=\"url(#grad1)\" />\n  <text fill=\"#ffffff\" font-size=\"45\" x=\"50\" y=\"86\">SVG</text>\n</svg>`,\n    path: '/path/to/svg/svg_1.svg',\n  },\n  {\n    content: `<svg height=\"130\" width=\"500\">\n    <defs>\n      <linearGradient id=\"grad1\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n        <stop offset=\"0%\" style=\"stop-color:rgb(120,0,120);stop-opacity:1\" />\n        <stop offset=\"100%\" style=\"stop-color:rgb(120,200,0);stop-opacity:1\" />\n      </linearGradient>\n    </defs>\n    <ellipse cx=\"100\" cy=\"70\" rx=\"85\" ry=\"55\" fill=\"url(#grad1)\" />\n    <text fill=\"#ffffff\" font-size=\"45\" x=\"50\" y=\"86\">SVG</text>\n  </svg>`,\n    path: '/path/to/svg/svg_2.svg',\n  },\n];\n\ntest('optimize svgs by path', () => {\n  const defaultOptimizedSvgs = svgsFilesWithDefsTag.map((file) =>\n    optimizeSvg({ code: file.content, path: file.path })\n  );\n\n  // ids should have different names, because prefixIds plugin is enabled by default\n  assert.isFalse(\n    defaultOptimizedSvgs.some((svg) => svg.data.startsWith('<g><defs><linearGradient id=\"a\"'))\n  );\n});\n\ntest('prefixIds plugin should be disableable', () => {\n  const defaultOptimizedSvgs = svgsFilesWithDefsTag.map((file) =>\n    optimizeSvg(\n      { code: file.content, path: file.path },\n      { imageOptimization: { svgo: { prefixIds: false } } }\n    )\n  );\n\n  // all ids be optimized to \"a\" because prefixIds plugin is disabled\n  assert.isTrue(\n    defaultOptimizedSvgs.every((svg) => svg.data.startsWith('<g><defs><linearGradient id=\"a\"'))\n  );\n});\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/index.ts",
    "content": "export { extendConfig } from './config';\nexport { qwikCity } from './plugin';\nexport type { MdxOptions, QwikCityPlugin, QwikCityVitePluginOptions } from './types';\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/plugin.ts",
    "content": "import type { QwikVitePlugin } from '@builder.io/qwik/optimizer';\nimport swRegister from '@qwik-city-sw-register-build';\nimport fs from 'node:fs';\nimport { basename, extname, join, resolve } from 'node:path';\nimport type { Plugin, PluginOption, Rollup, UserConfig } from 'vite';\nimport { loadEnv } from 'vite';\nimport {\n  NOT_FOUND_PATHS_ID,\n  RESOLVED_NOT_FOUND_PATHS_ID,\n  RESOLVED_STATIC_PATHS_ID,\n  STATIC_PATHS_ID,\n} from '../../adapters/shared/vite';\nimport { postBuild } from '../../adapters/shared/vite/post-build';\nimport { patchGlobalThis } from '../../middleware/node/node-fetch';\nimport { isMenuFileName, normalizePath, removeExtension } from '../../utils/fs';\nimport { build } from '../build';\nimport { createBuildContext, resetBuildContext } from '../context';\nimport { createMdxTransformer, type MdxTransform } from '../markdown/mdx';\nimport { transformMenu } from '../markdown/menu';\nimport { generateQwikCityEntries } from '../runtime-generation/generate-entries';\nimport { generateQwikCityPlan } from '../runtime-generation/generate-qwik-city-plan';\nimport { generateServiceWorkerRegister } from '../runtime-generation/generate-service-worker';\nimport type { BuildContext } from '../types';\nimport { ssrDevMiddleware, staticDistMiddleware } from './dev-server';\nimport { getRouteImports } from './get-route-imports';\nimport { imagePlugin } from './image-jsx';\nimport type { QwikCityPluginApi, QwikCityVitePluginOptions } from './types';\nimport { validatePlugin } from './validate-plugin';\n\n/** @public */\nexport function qwikCity(userOpts?: QwikCityVitePluginOptions): PluginOption[] {\n  return [qwikCityPlugin(userOpts), ...imagePlugin(userOpts)];\n}\n\nfunction qwikCityPlugin(userOpts?: QwikCityVitePluginOptions): any {\n  let ctx: BuildContext | null = null;\n  let mdxTransform: MdxTransform | null = null;\n  let rootDir: string | null = null;\n  let qwikPlugin: QwikVitePlugin | null;\n  let ssrFormat: 'esm' | 'cjs' = 'esm';\n  let outDir: string | null = null;\n\n  // Patch Stream APIs\n  patchGlobalThis();\n\n  globalThis.__qwikCityNew = true;\n\n  const api: QwikCityPluginApi = {\n    getBasePathname: () => ctx?.opts.basePathname ?? '/',\n    getRoutes: () => {\n      return ctx?.routes.slice() ?? [];\n    },\n    getServiceWorkers: () => {\n      return ctx?.serviceWorkers.slice() ?? [];\n    },\n  };\n\n  type P<T> = Plugin<T> & { api: T };\n\n  const plugin: P<QwikCityPluginApi> = {\n    name: 'vite-plugin-qwik-city',\n    enforce: 'pre',\n    api,\n\n    async config() {\n      const updatedViteConfig: UserConfig = {\n        appType: 'custom',\n        optimizeDeps: {\n          exclude: [QWIK_CITY, QWIK_CITY_PLAN_ID, QWIK_CITY_ENTRIES_ID, QWIK_CITY_SW_REGISTER],\n        },\n        ssr: {\n          external: ['node:async_hooks'],\n          noExternal: [\n            QWIK_CITY,\n            QWIK_CITY_PLAN_ID,\n            QWIK_CITY_ENTRIES_ID,\n            QWIK_CITY_SW_REGISTER,\n            // We've had reports of bundling issues with zod\n            'zod',\n          ],\n        },\n      };\n      return updatedViteConfig;\n    },\n\n    async configResolved(config) {\n      Object.assign(process.env, loadEnv(config.mode, process.cwd(), ''));\n      rootDir = resolve(config.root);\n\n      const target = config.build?.ssr || config.mode === 'ssr' ? 'ssr' : 'client';\n\n      ctx = createBuildContext(rootDir!, config.base, userOpts, target);\n\n      ctx.isDevServer = config.command === 'serve' && config.mode !== 'production';\n      ctx.isDevServerClientOnly = ctx.isDevServer && config.mode !== 'ssr';\n\n      await validatePlugin(ctx.opts);\n\n      mdxTransform = await createMdxTransformer(ctx);\n\n      qwikPlugin = config.plugins.find((p) => p.name === 'vite-plugin-qwik') as QwikVitePlugin;\n      if (!qwikPlugin) {\n        throw new Error('Missing vite-plugin-qwik');\n      }\n      qwikPlugin.api.registerBundleGraphAdder?.((manifest) => {\n        return getRouteImports(ctx!.routes, manifest);\n      });\n\n      // @ts-ignore `format` removed in Vite 5\n      if (config.ssr?.format === 'cjs') {\n        ssrFormat = 'cjs';\n      }\n      outDir = config.build?.outDir;\n    },\n\n    configureServer(server) {\n      return () => {\n        if (!ctx) {\n          throw new Error('configureServer: Missing ctx from configResolved');\n        }\n        if (!ctx.isDevServer) {\n          // preview server: serve static files from the dist directory\n          server.middlewares.use(staticDistMiddleware(server));\n        }\n        // qwik city middleware injected BEFORE vite internal middlewares\n        // and BEFORE @builder.io/qwik/optimizer/vite middlewares\n        // handles only known user defined routes\n        server.middlewares.use(ssrDevMiddleware(ctx, server));\n      };\n    },\n\n    buildStart() {\n      resetBuildContext(ctx);\n    },\n\n    resolveId(id) {\n      if (id === QWIK_SERIALIZER) {\n        return join(rootDir!, id);\n      }\n      if (id === QWIK_CITY_PLAN_ID || id === QWIK_CITY_ENTRIES_ID) {\n        return {\n          id: join(rootDir!, id),\n          // user entries added in the routes, like src/routes/service-worker.ts\n          // are added as dynamic imports to the qwik-city-plan as a way to create\n          // a new entry point for the build. Ensure these are not treeshaked.\n          moduleSideEffects: 'no-treeshake',\n        };\n      }\n      if (id === QWIK_CITY_SW_REGISTER) {\n        return join(rootDir!, id);\n      }\n      if (id === STATIC_PATHS_ID) {\n        return {\n          id: './' + RESOLVED_STATIC_PATHS_ID,\n          external: true,\n        };\n      }\n      if (id === NOT_FOUND_PATHS_ID) {\n        return {\n          id: './' + RESOLVED_NOT_FOUND_PATHS_ID,\n          external: true,\n        };\n      }\n      return null;\n    },\n\n    async load(id, opts) {\n      if (ctx) {\n        if (id.endsWith(QWIK_CITY_ENTRIES_ID)) {\n          // @qwik-city-entries\n          return generateQwikCityEntries(ctx);\n        }\n        const isSerializer = id.endsWith(QWIK_SERIALIZER);\n        const isCityPlan = id.endsWith(QWIK_CITY_PLAN_ID);\n        const isSwRegister = id.endsWith(QWIK_CITY_SW_REGISTER);\n\n        if (isSerializer) {\n          return `export {_deserializeData, _serializeData, _verifySerializable} from '@builder.io/qwik'`;\n        }\n        if (isCityPlan || isSwRegister) {\n          if (!ctx.isDevServer && ctx.isDirty) {\n            await build(ctx);\n\n            ctx.isDirty = false;\n            ctx.diagnostics.forEach((d) => {\n              this.warn(d.message);\n            });\n          }\n\n          if (isCityPlan) {\n            // @qwik-city-plan\n            return generateQwikCityPlan(ctx, qwikPlugin!, opts?.ssr ?? false);\n          }\n\n          if (isSwRegister) {\n            // @qwik-city-sw-register\n            return generateServiceWorkerRegister(ctx, swRegister);\n          }\n        }\n      }\n\n      return null;\n    },\n\n    async transform(code, id) {\n      if (id.startsWith('\\0')) {\n        return;\n      }\n      const ext = extname(id).toLowerCase();\n      const isMD = ext === '.md' || ext === '.mdx';\n      if (ctx && isMD) {\n        const fileName = basename(id);\n        if (isMenuFileName(fileName)) {\n          const menuCode = await transformMenu(ctx.opts, id, code);\n          return { code: menuCode, map: null };\n        }\n        if (mdxTransform) {\n          try {\n            const mdxResult = await mdxTransform(code, id);\n            return mdxResult;\n          } catch (e: any) {\n            if (e && typeof e == 'object' && 'position' in e && 'reason' in e) {\n              const column = (e as any).position?.start.column;\n              const line = (e as any).position?.start.line;\n              const err: Rollup.RollupError = Object.assign(new Error(e.reason), {\n                id,\n                plugin: 'qwik-city-mdx',\n                loc: {\n                  column: column,\n                  line: line,\n                },\n                stack: '',\n              });\n              this.error(err);\n            } else if (e instanceof Error) {\n              this.error(e);\n            } else {\n              this.error(String(e));\n            }\n          }\n        }\n      }\n\n      return null;\n    },\n\n    generateBundle(_, bundles) {\n      // client bundles\n      if (ctx?.target === 'client') {\n        const entries = [...ctx.entries, ...ctx.serviceWorkers].map((entry) => {\n          return {\n            chunkFileName: entry.chunkFileName,\n            extensionlessFilePath: removeExtension(entry.filePath),\n          };\n        });\n\n        for (const entry of entries) {\n          for (const fileName in bundles) {\n            const c = bundles[fileName];\n            if (c.type === 'chunk' && c.isDynamicEntry && c.facadeModuleId) {\n              const extensionlessFilePath = removeExtension(normalizePath(c.facadeModuleId));\n              if (entry.extensionlessFilePath === extensionlessFilePath) {\n                c.fileName = entry.chunkFileName;\n                continue;\n              }\n            }\n          }\n        }\n      }\n    },\n\n    closeBundle: {\n      sequential: true,\n      async handler() {\n        if (ctx?.target === 'ssr' && !ctx?.isDevServer) {\n          // ssr build\n          const clientOutDir = qwikPlugin!.api.getClientOutDir();\n\n          if (outDir && clientOutDir) {\n            const assetsDir = qwikPlugin!.api.getAssetsDir();\n            const { staticPathsCode, notFoundPathsCode } = await postBuild(\n              clientOutDir,\n              assetsDir ? join(api.getBasePathname(), assetsDir) : api.getBasePathname(),\n              [],\n              ssrFormat,\n              false\n            );\n\n            await fs.promises.mkdir(outDir, { recursive: true });\n            const serverPackageJsonPath = join(outDir, 'package.json');\n\n            let packageJson = {};\n\n            // we want to keep the content of an existing file:\n            if (fs.existsSync(serverPackageJsonPath)) {\n              const content = await fs.promises.readFile(serverPackageJsonPath, 'utf-8');\n              const contentAsJson = JSON.parse(content);\n              packageJson = {\n                ...contentAsJson,\n              };\n            }\n\n            const ssrFormat2pkgTypeMap = {\n              cjs: 'commonjs',\n              esm: 'module',\n            };\n            packageJson = { ...packageJson, type: ssrFormat2pkgTypeMap[ssrFormat] || 'module' };\n            const serverPackageJsonCode = JSON.stringify(packageJson, null, 2);\n\n            await Promise.all([\n              fs.promises.writeFile(join(outDir, RESOLVED_STATIC_PATHS_ID), staticPathsCode),\n              fs.promises.writeFile(join(outDir, RESOLVED_NOT_FOUND_PATHS_ID), notFoundPathsCode),\n              fs.promises.writeFile(serverPackageJsonPath, serverPackageJsonCode),\n            ]);\n          }\n        }\n      },\n    },\n  };\n\n  return plugin;\n}\n\nconst QWIK_SERIALIZER = '@qwik-serializer';\nexport const QWIK_CITY_PLAN_ID = '@qwik-city-plan';\nconst QWIK_CITY_ENTRIES_ID = '@qwik-city-entries';\nconst QWIK_CITY = '@builder.io/qwik-city';\nconst QWIK_CITY_SW_REGISTER = '@qwik-city-sw-register';\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/qwik-city.buildtime.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { BuiltinsWithOptionalParams } from 'svgo/plugins/plugins-types';\nimport type { CompileOptions } from '@mdx-js/mdx';\nimport type { Config } from 'svgo';\nimport { ConfigEnv } from 'vite';\nimport type { Plugin as Plugin_2 } from 'vite';\nimport type { PluginOption } from 'vite';\nimport { UserConfigExport } from 'vite';\n\n// @public (undocumented)\nexport function extendConfig(baseConfigExport: UserConfigExport, serverConfigExport: UserConfigExport): (env: ConfigEnv) => Promise<Record<string, any>>;\n\n// @public (undocumented)\nexport type MdxOptions = CompileOptions;\n\n// @public (undocumented)\nexport function qwikCity(userOpts?: QwikCityVitePluginOptions): PluginOption[];\n\n// Warning: (ae-forgotten-export) The symbol \"P\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"QwikCityPluginApi\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport interface QwikCityPlugin extends P<QwikCityPluginApi> {\n    // (undocumented)\n    name: 'vite-plugin-qwik-city';\n}\n\n// Warning: (ae-forgotten-export) The symbol \"PluginOptions\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport interface QwikCityVitePluginOptions extends Omit<PluginOptions, 'basePathname'> {\n    // Warning: (ae-forgotten-export) The symbol \"ImageOptimizationOptions\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    imageOptimization?: ImageOptimizationOptions;\n    // (undocumented)\n    mdx?: MdxOptions;\n    // Warning: (ae-forgotten-export) The symbol \"MdxPlugins\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    mdxPlugins?: MdxPlugins;\n    // (undocumented)\n    platform?: Record<string, unknown>;\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/types.ts",
    "content": "import type { CompileOptions } from '@mdx-js/mdx';\nimport type { MdxTransform } from '../markdown/mdx';\nimport type { BuildContext, BuildEntry, BuildRoute, PluginOptions, MdxPlugins } from '../types';\nimport type { Config as SVGOConfig } from 'svgo';\nimport type { BuiltinsWithOptionalParams as SVGOBuiltinPluginsWithOptionalParams } from 'svgo/plugins/plugins-types';\nimport type { Plugin as VitePlugin } from 'vite';\n\n/** @public */\nexport interface ImageOptimizationOptions {\n  jsxDirectives?: {\n    quality?: `${number}`;\n    format?: 'webp' | 'avif' | 'png';\n    w?: string;\n    h?: string;\n    [key: string]: string | undefined;\n  };\n  svgo?: Pick<SVGOConfig, 'floatPrecision' | 'multipass' | 'plugins'> & {\n    defaultPresetOverrides?: SVGOBuiltinPluginsWithOptionalParams['preset-default']['overrides'];\n    prefixIds?: SVGOBuiltinPluginsWithOptionalParams['prefixIds'] | false;\n  };\n  enabled?: boolean | 'only-production';\n}\n\n/** @public */\nexport interface QwikCityVitePluginOptions extends Omit<PluginOptions, 'basePathname'> {\n  mdxPlugins?: MdxPlugins;\n  mdx?: MdxOptions;\n  platform?: Record<string, unknown>;\n  imageOptimization?: ImageOptimizationOptions;\n}\n\n/** @public */\n\nexport type MdxOptions = CompileOptions;\n\nexport interface PluginContext {\n  buildCtx: BuildContext | null;\n  rootDir: string;\n  cityPlanCode: string | null;\n  mdxTransform: MdxTransform | null;\n}\n\ntype P<T> = VitePlugin<T> & { api: T };\n\n/** @public */\nexport interface QwikCityPlugin extends P<QwikCityPluginApi> {\n  name: 'vite-plugin-qwik-city';\n}\n\n/** @public */\nexport interface QwikCityPluginApi {\n  getBasePathname: () => string;\n  getRoutes: () => BuildRoute[];\n  getServiceWorkers: () => BuildEntry[];\n}\n"
  },
  {
    "path": "packages/qwik-city/src/buildtime/vite/validate-plugin.ts",
    "content": "import fs from 'node:fs';\nimport { isAbsolute } from 'node:path';\nimport type { NormalizedPluginOptions } from '../types';\n\nexport async function validatePlugin(opts: NormalizedPluginOptions) {\n  if (typeof opts.routesDir !== 'string') {\n    throw new Error(`qwikCity plugin \"routesDir\" option missing`);\n  }\n\n  if (!isAbsolute(opts.routesDir)) {\n    throw new Error(\n      `qwikCity plugin \"routesDir\" option must be an absolute path: ${opts.routesDir}`\n    );\n  }\n\n  try {\n    const s = await fs.promises.stat(opts.routesDir);\n    if (!s.isDirectory()) {\n      throw new Error(`qwikCity plugin \"routesDir\" option must be a directory: ${opts.routesDir}`);\n    }\n  } catch (e) {\n    throw new Error(`qwikCity plugin \"routesDir\" not found: ${e}`);\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/aws-lambda/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/aws-lambda/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.aws-lambda\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/aws-lambda/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/aws-lambda\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/aws-lambda/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/aws-lambda/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/aws-lambda/index.ts",
    "content": "import { createQwikCity as createQwikCityNode } from '@builder.io/qwik-city/middleware/node';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { QwikCityPlan } from 'packages/qwik-city/src/runtime/src/types';\nimport type { QwikManifest, Render } from 'packages/qwik/src/server/types';\n\ninterface AwsOpt {\n  render: Render;\n  manifest?: QwikManifest;\n  qwikCityPlan: QwikCityPlan;\n}\n\n/** @public */\nexport function createQwikCity(opts: AwsOpt) {\n  try {\n    const { router, staticFile, notFound } = createQwikCityNode({\n      render: opts.render,\n      qwikCityPlan: opts.qwikCityPlan,\n      manifest: opts.manifest,\n      static: {\n        cacheControl: 'public, max-age=31557600',\n      },\n      getOrigin(req) {\n        if (process.env.IS_OFFLINE) {\n          return `http://${req.headers.host}`;\n        }\n        return null;\n      },\n    });\n\n    const fixPath = (pathT: string) => {\n      if (opts.qwikCityPlan.trailingSlash) {\n        const url = new URL(pathT, 'http://aws-qwik.local');\n        if (url.pathname.includes('.', url.pathname.lastIndexOf('/'))) {\n          return pathT;\n        }\n        if (!url.pathname.endsWith('/')) {\n          return url.pathname + '/' + url.search;\n        }\n      }\n      return pathT;\n    };\n\n    const handle = (req: any, res: any) => {\n      req.url = fixPath(req.url);\n      staticFile(req, res, () => {\n        router(req, res, () => {\n          notFound(req, res, () => {});\n        });\n      });\n    };\n\n    return { fixPath, router, staticFile, notFound, handle };\n  } catch (err: any) {\n    throw new Error(err.message);\n  }\n}\n\n/** @public */\nexport interface QwikCityAwsLambdaOptions extends ServerRenderOptions {}\n\n/** @public */\nexport interface PlatformAwsLambda extends Object {}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/aws-lambda/middleware.aws-lambda.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\n/// <reference types=\"node\" />\n\nimport type { EnvGetter } from '@builder.io/qwik-city/middleware/request-handler';\nimport { Http2ServerRequest } from 'http2';\nimport { IncomingMessage } from 'http';\nimport { NodeRequestNextFunction } from '@builder.io/qwik-city/middleware/node';\nimport type { QwikIntrinsicElements } from '@builder.io/qwik';\nimport type { QwikManifest } from '@builder.io/qwik/optimizer';\nimport type { RequestHandler } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ResolvedManifest } from '@builder.io/qwik/optimizer';\nimport type { ResolveSyncValue } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ServerQwikManifest } from '@builder.io/qwik/optimizer';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\nimport { ServerResponse } from 'http';\nimport type { SnapshotResult } from '@builder.io/qwik';\nimport type { StreamWriter } from '@builder.io/qwik';\nimport type { SymbolMapperFn } from '@builder.io/qwik/optimizer';\n\n// Warning: (ae-forgotten-export) The symbol \"AwsOpt\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport function createQwikCity(opts: AwsOpt): {\n    fixPath: (pathT: string) => string;\n    router: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse<IncomingMessage>, next: NodeRequestNextFunction) => Promise<void>;\n    staticFile: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse<IncomingMessage>, next: (e?: any) => void) => Promise<void>;\n    notFound: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse<IncomingMessage>, next: (e: any) => void) => Promise<void>;\n    handle: (req: any, res: any) => void;\n};\n\n// @public (undocumented)\nexport interface PlatformAwsLambda extends Object {\n}\n\n// @public (undocumented)\nexport interface QwikCityAwsLambdaOptions extends ServerRenderOptions {\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/azure-swa/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/azure-swa/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.azure-swa\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/azure-swa/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/azure-swa\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/azure-swa/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/azure-swa/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/azure-swa/index.ts",
    "content": "import type { AzureFunction, Context, HttpRequest } from '@azure/functions';\nimport { setServerPlatform } from '@builder.io/qwik/server';\nimport { requestHandler } from '@builder.io/qwik-city/middleware/request-handler';\nimport type {\n  ServerRenderOptions,\n  ServerRequestEvent,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { getNotFound } from '@qwik-city-not-found-paths';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport { parseString } from 'set-cookie-parser';\nimport { isStaticPath } from '@qwik-city-static-paths';\n\n// @builder.io/qwik-city/middleware/azure-swa\n\ninterface AzureResponse {\n  status: number;\n  headers: { [key: string]: any };\n  body?: string | Uint8Array;\n  cookies?: AzureCookie[];\n}\n\ninterface AzureCookie {\n  /** Cookie name */\n  name: string;\n  /** Cookie value */\n  value: string;\n  /** Specifies allowed hosts to receive the cookie */\n  domain?: string;\n  /** Specifies URL path that must exist in the requested URL */\n  path?: string;\n  /**\n   * NOTE: It is generally recommended that you use maxAge over expires. Sets the cookie to expire\n   * at a specific date instead of when the client closes. This can be a Javascript Date or Unix\n   * time in milliseconds.\n   */\n  expires?: Date | number;\n  /** Sets the cookie to only be sent with an encrypted request */\n  secure?: boolean;\n  /** Sets the cookie to be inaccessible to JavaScript's Document.cookie API */\n  httpOnly?: boolean;\n  /** Can restrict the cookie to not be sent with cross-site requests */\n  sameSite?: string | undefined;\n  /**\n   * Number of seconds until the cookie expires. A zero or negative number will expire the cookie\n   * immediately.\n   */\n  maxAge?: number;\n}\n\n/** @public */\nexport function createQwikCity(opts: QwikCityAzureOptions): AzureFunction {\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  if (opts.manifest) {\n    setServerPlatform(opts.manifest);\n  }\n  async function onAzureSwaRequest(context: Context, req: HttpRequest): Promise<AzureResponse> {\n    try {\n      const url = new URL(req.headers['x-ms-original-url']!);\n      const options: RequestInit = {\n        method: req.method || 'GET',\n        headers: req.headers,\n        body: req.bufferBody || req.rawBody || req.body,\n      };\n\n      const serverRequestEv: ServerRequestEvent<AzureResponse> = {\n        mode: 'server',\n        locale: undefined,\n        url,\n        platform: context,\n        env: {\n          get(key) {\n            return process.env[key];\n          },\n        },\n        request: new Request(url, options),\n        getWritableStream: (status, headers, cookies, resolve) => {\n          const response: AzureResponse = {\n            status,\n            body: new Uint8Array(),\n            headers: {},\n            cookies: cookies.headers().map((header) => parseString(header)),\n          };\n          headers.forEach((value, key) => (response.headers[key] = value));\n          return new WritableStream({\n            write(chunk: Uint8Array) {\n              if (response.body instanceof Uint8Array) {\n                const newBuffer = new Uint8Array(response.body.length + chunk.length);\n                newBuffer.set(response.body);\n                newBuffer.set(chunk, response.body.length);\n                response.body = newBuffer;\n              }\n            },\n            close() {\n              resolve(response);\n            },\n          });\n        },\n\n        getClientConn: () => {\n          return {\n            ip: req.headers['x-forwarded-client-Ip'],\n            country: undefined,\n          };\n        },\n      };\n\n      // send request to qwik city request handler\n      const handledResponse = await requestHandler(serverRequestEv, opts, qwikSerializer);\n      if (handledResponse) {\n        handledResponse.completion.then((err) => {\n          if (err) {\n            console.error(err);\n          }\n        });\n        const response = await handledResponse.response;\n        if (response) {\n          return response;\n        }\n      }\n\n      // qwik city did not have a route for this request\n      // response with 404 for this pathname\n\n      // In the development server, we replace the getNotFound function\n      // For static paths, we assign a static \"Not Found\" message.\n      // This ensures consistency between development and production environments for specific URLs.\n      const notFoundHtml = isStaticPath(req.method || 'GET', url)\n        ? 'Not Found'\n        : getNotFound(url.pathname);\n      return {\n        status: 404,\n        headers: { 'Content-Type': 'text/html; charset=utf-8', 'X-Not-Found': url.pathname },\n        body: notFoundHtml,\n      };\n    } catch (e: any) {\n      console.error(e);\n      return {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8' },\n      };\n    }\n  }\n\n  return onAzureSwaRequest;\n}\n\n/** @public */\nexport interface QwikCityAzureOptions extends ServerRenderOptions {}\n\n/** @public */\nexport interface PlatformAzure extends Partial<Context> {}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/azure-swa/middleware.azure-swa.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { AzureFunction } from '@azure/functions';\nimport type { Context } from '@azure/functions';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityAzureOptions): AzureFunction;\n\n// @public (undocumented)\nexport interface PlatformAzure extends Partial<Context> {\n}\n\n// @public (undocumented)\nexport interface QwikCityAzureOptions extends ServerRenderOptions {\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/bun/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/bun/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.bun\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/bun/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/bun\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/bun/index.d.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/bun/index.ts",
    "content": "/// <reference types=\"bun\" />\nimport type {\n  ServerRenderOptions,\n  ServerRequestEvent,\n  ClientConn,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport {\n  mergeHeadersCookies,\n  requestHandler,\n  _TextEncoderStream_polyfill,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { getNotFound } from '@qwik-city-not-found-paths';\nimport { isStaticPath } from '@qwik-city-static-paths';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport { setServerPlatform } from '@builder.io/qwik/server';\nimport { MIME_TYPES } from '../request-handler/mime-types';\nimport { join, extname } from 'node:path';\n\nfunction getRequestUrl(request: Request, opts: QwikCityBunOptions) {\n  const url = new URL(request.url);\n  const origin = opts.getOrigin?.(request) ?? Bun.env.ORIGIN;\n  if (!origin) {\n    return url;\n  }\n  return new URL(`${url.pathname}${url.search}${url.hash}`, origin);\n}\n\n/** @public */\nexport function createQwikCity(opts: QwikCityBunOptions) {\n  // @builder.io/qwik-city/middleware/bun\n  // still missing from bun: last check was bun version 1.1.8\n  globalThis.TextEncoderStream ||= _TextEncoderStream_polyfill;\n\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  if (opts.manifest) {\n    setServerPlatform(opts.manifest);\n  }\n\n  const staticFolder =\n    opts.static?.root ?? join(Bun.fileURLToPath(import.meta.url), '..', '..', 'dist');\n\n  async function router(request: Request) {\n    try {\n      const url = getRequestUrl(request, opts);\n\n      const serverRequestEv: ServerRequestEvent<Response> = {\n        mode: 'server',\n        locale: undefined,\n        url,\n        env: {\n          get(key) {\n            return Bun.env[key];\n          },\n        },\n        request,\n        getWritableStream: (status, headers, cookies, resolve) => {\n          const { readable, writable } = new TransformStream<Uint8Array>();\n          const response = new Response(readable, {\n            status,\n            headers: mergeHeadersCookies(headers, cookies),\n          });\n          resolve(response);\n          return writable;\n        },\n        platform: {\n          ssr: true,\n        },\n        getClientConn: () => {\n          return opts.getClientConn ? opts.getClientConn(request) : {};\n        },\n      };\n\n      // send request to qwik city request handler\n      const handledResponse = await requestHandler(serverRequestEv, opts, qwikSerializer);\n      if (handledResponse) {\n        handledResponse.completion.then((v) => {\n          if (v) {\n            console.error(v);\n          }\n        });\n        const response = await handledResponse.response;\n        if (response) {\n          // bun fails to redirect if there is a body.\n          // remove the body if there a redirect.\n          const status = response.status;\n          const location = response.headers.get('Location');\n          const isRedirect = status >= 301 && status <= 308 && location;\n          if (isRedirect) {\n            return new Response(null, response);\n          }\n          return response;\n        }\n      }\n\n      // qwik city did not have a route for this request\n      return null;\n    } catch (e: any) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'bun-server' },\n      });\n    }\n  }\n\n  const notFound = async (request: Request) => {\n    try {\n      const url = getRequestUrl(request, opts);\n\n      // In the development server, we replace the getNotFound function\n      // For static paths, we assign a static \"Not Found\" message.\n      // This ensures consistency between development and production environments for specific URLs.\n      const notFoundHtml = isStaticPath(request.method || 'GET', url)\n        ? 'Not Found'\n        : getNotFound(url.pathname);\n      return new Response(notFoundHtml, {\n        status: 404,\n        headers: { 'Content-Type': 'text/html; charset=utf-8', 'X-Not-Found': url.pathname },\n      });\n    } catch (e) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'bun-server' },\n      });\n    }\n  };\n\n  const openStaticFile = async (url: URL) => {\n    const pathname = url.pathname;\n    const fileName = pathname.slice(url.pathname.lastIndexOf('/'));\n    let filePath: string;\n    if (fileName.includes('.')) {\n      filePath = join(staticFolder, pathname);\n    } else if (opts.qwikCityPlan.trailingSlash) {\n      filePath = join(staticFolder, pathname + 'index.html');\n    } else {\n      filePath = join(staticFolder, pathname, 'index.html');\n    }\n    return {\n      filePath,\n      content: Bun.file(filePath),\n    };\n  };\n\n  const staticFile = async (request: Request) => {\n    try {\n      const url = getRequestUrl(request, opts);\n\n      if (isStaticPath(request.method || 'GET', url)) {\n        const { filePath, content } = await openStaticFile(url);\n        // We know that it's in the static folder, but it could still be missing\n        // If we start the stream with a missing file, it will throw a 500 error during the stream\n        if (!(await content.exists())) {\n          return new Response('Not Found', {\n            status: 404,\n            headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Not-Found': url.pathname },\n          });\n        }\n\n        const ext = extname(filePath).replace(/^\\./, '');\n\n        return new Response(await content.stream(), {\n          status: 200,\n          headers: {\n            'content-type': MIME_TYPES[ext] || 'text/plain; charset=utf-8',\n            'Cache-Control': opts.static?.cacheControl || 'max-age=3600',\n          },\n        });\n      }\n\n      return null;\n    } catch (e) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'bun-server' },\n      });\n    }\n  };\n\n  return {\n    router,\n    notFound,\n    staticFile,\n  };\n}\n\n/** @public */\nexport interface QwikCityBunOptions extends ServerRenderOptions {\n  /** Options for serving static files */\n  static?: {\n    /** The root folder for statics files. Defaults to /dist */\n    root?: string;\n    /** Set the Cache-Control header for all static files */\n    cacheControl?: string;\n  };\n\n  /**\n   * Provide a function that computes the origin of the server, used to resolve relative URLs and\n   * validate the request origin against CSRF attacks.\n   *\n   * When not specified, it defaults to the `ORIGIN` environment variable (if set).\n   *\n   * If `ORIGIN` is not set, it's derived from the incoming request, which is not recommended for\n   * production use.\n   */\n  getOrigin?: (request: Request) => string | null;\n\n  /** Provide a function that returns a `ClientConn` for the given request. */\n  getClientConn?: (request: Request) => ClientConn;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/bun/middleware.bun.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { ClientConn } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityBunOptions): {\n    router: (request: Request) => Promise<Response | null>;\n    notFound: (request: Request) => Promise<Response>;\n    staticFile: (request: Request) => Promise<Response | null>;\n};\n\n// @public (undocumented)\nexport interface QwikCityBunOptions extends ServerRenderOptions {\n    getClientConn?: (request: Request) => ClientConn;\n    getOrigin?: (request: Request) => string | null;\n    static?: {\n        root?: string;\n        cacheControl?: string;\n    };\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/cloudflare-pages/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/cloudflare-pages/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.cloudflare-pages\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/cloudflare-pages/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/cloudflare-pages\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/cloudflare-pages/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/cloudflare-pages/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/cloudflare-pages/index.ts",
    "content": "import type {\n  ServerRenderOptions,\n  ServerRequestEvent,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport {\n  mergeHeadersCookies,\n  requestHandler,\n  _TextEncoderStream_polyfill,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { getNotFound } from '@qwik-city-not-found-paths';\nimport { isStaticPath } from '@qwik-city-static-paths';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport { setServerPlatform } from '@builder.io/qwik/server';\n\n// @builder.io/qwik-city/middleware/cloudflare-pages\n\n/** @public */\nexport function createQwikCity(opts: QwikCityCloudflarePagesOptions) {\n  try {\n    // https://developers.cloudflare.com/workers/configuration/compatibility-dates/#streams-constructors\n    // this will throw if CF compatibility_date < 2022-11-30\n    new globalThis.TextEncoderStream();\n  } catch (e) {\n    // @ts-ignore\n    globalThis.TextEncoderStream = _TextEncoderStream_polyfill;\n  }\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  if (opts.manifest) {\n    setServerPlatform(opts.manifest);\n  }\n  async function onCloudflarePagesFetch(\n    request: PlatformCloudflarePages['request'],\n    env: PlatformCloudflarePages['env'] & { ASSETS: { fetch: (req: Request) => Response } },\n    ctx: PlatformCloudflarePages['ctx']\n  ) {\n    try {\n      const url = new URL(request.url);\n\n      if (isStaticPath(request.method, url)) {\n        // known static path, let cloudflare handle it\n        return env.ASSETS.fetch(request);\n      }\n\n      // https://developers.cloudflare.com/workers/runtime-apis/cache/\n      const useCache =\n        url.hostname !== '127.0.0.1' &&\n        url.hostname !== 'localhost' &&\n        url.port === '' &&\n        request.method === 'GET';\n      const cacheKey = new Request(url.href, request);\n      const cache = useCache ? await caches.open('custom:qwikcity') : null;\n      if (cache) {\n        const cachedResponse = await cache.match(cacheKey);\n        if (cachedResponse) {\n          return cachedResponse;\n        }\n      }\n\n      const serverRequestEv: ServerRequestEvent<Response> = {\n        mode: 'server',\n        locale: undefined,\n        url,\n        request,\n        env: {\n          get(key) {\n            return env[key];\n          },\n        },\n        getWritableStream: (status, headers, cookies, resolve) => {\n          const { readable, writable } = new TransformStream<Uint8Array>();\n          const response = new Response(readable, {\n            status,\n            headers: mergeHeadersCookies(headers, cookies),\n          });\n          resolve(response);\n          return writable;\n        },\n        getClientConn: () => {\n          return {\n            ip: request.headers.get('CF-connecting-ip') || '',\n            country: request.headers.get('CF-IPCountry') || '',\n          };\n        },\n        platform: {\n          request,\n          env,\n          ctx,\n        },\n      };\n\n      // send request to qwik city request handler\n      const handledResponse = await requestHandler(serverRequestEv, opts, qwikSerializer);\n      if (handledResponse) {\n        handledResponse.completion.then((v) => {\n          if (v) {\n            console.error(v);\n          }\n        });\n        const response = await handledResponse.response;\n        if (response) {\n          if (response.ok && cache && response.headers.has('Cache-Control')) {\n            // Store the fetched response as cacheKey\n            // Use waitUntil so you can return the response without blocking on\n            // writing to cache\n            ctx.waitUntil(cache.put(cacheKey, response.clone()));\n          }\n          return response;\n        }\n      }\n\n      // qwik city did not have a route for this request\n      // response with 404 for this pathname\n\n      // In the development server, we replace the getNotFound function\n      // For static paths, we assign a static \"Not Found\" message.\n      // This ensures consistency between development and production environments for specific URLs.\n      const notFoundHtml = isStaticPath(request.method || 'GET', url)\n        ? 'Not Found'\n        : getNotFound(url.pathname);\n      return new Response(notFoundHtml, {\n        status: 404,\n        headers: { 'Content-Type': 'text/html; charset=utf-8', 'X-Not-Found': url.pathname },\n      });\n    } catch (e: any) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'cloudflare-pages' },\n      });\n    }\n  }\n\n  return onCloudflarePagesFetch;\n}\n\n/** @public */\nexport interface QwikCityCloudflarePagesOptions extends ServerRenderOptions {}\n\n/** @public */\nexport interface PlatformCloudflarePages {\n  request: Request;\n  env?: Record<string, any>;\n  ctx: { waitUntil: (promise: Promise<any>) => void };\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/cloudflare-pages/middleware.cloudflare-pages.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityCloudflarePagesOptions): (request: PlatformCloudflarePages['request'], env: PlatformCloudflarePages['env'] & {\n    ASSETS: {\n        fetch: (req: Request) => Response;\n    };\n}, ctx: PlatformCloudflarePages['ctx']) => Promise<Response>;\n\n// @public (undocumented)\nexport interface PlatformCloudflarePages {\n    // (undocumented)\n    ctx: {\n        waitUntil: (promise: Promise<any>) => void;\n    };\n    // (undocumented)\n    env?: Record<string, any>;\n    // (undocumented)\n    request: Request;\n}\n\n// @public (undocumented)\nexport interface QwikCityCloudflarePagesOptions extends ServerRenderOptions {\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/deno/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/deno/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.deno\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/deno/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/deno\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/deno/index.d.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/deno/index.ts",
    "content": "import type {\n  ServerRenderOptions,\n  ServerRequestEvent,\n  ClientConn,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport {\n  mergeHeadersCookies,\n  requestHandler,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { getNotFound } from '@qwik-city-not-found-paths';\nimport { isStaticPath } from '@qwik-city-static-paths';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport { setServerPlatform } from '@builder.io/qwik/server';\nimport { MIME_TYPES } from '../request-handler/mime-types';\n// @ts-ignore\nimport { extname, fromFileUrl, join } from 'https://deno.land/std/path/mod.ts';\n\n// @builder.io/qwik-city/middleware/deno\n\n/** @public */\nexport interface NetAddr {\n  transport: 'tcp' | 'udp';\n  hostname: string;\n  port: number;\n}\n\n/** @public */\nexport interface ServeHandlerInfo {\n  remoteAddr: NetAddr;\n}\n\nfunction getRequestUrl(request: Request, opts: QwikCityDenoOptions, info?: ServeHandlerInfo) {\n  const url = new URL(request.url);\n  const origin = opts.getOrigin?.(request, info) ?? Deno.env?.get?.('ORIGIN');\n  if (!origin) {\n    return url;\n  }\n  return new URL(`${url.pathname}${url.search}${url.hash}`, origin);\n}\n\n/** @public */\nexport function createQwikCity(opts: QwikCityDenoOptions) {\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  if (opts.manifest) {\n    setServerPlatform(opts.manifest);\n  }\n\n  const staticFolder = opts.static?.root ?? join(fromFileUrl(import.meta.url), '..', '..', 'dist');\n\n  async function router(request: Request, info: ServeHandlerInfo) {\n    try {\n      const url = getRequestUrl(request, opts, info);\n\n      const serverRequestEv: ServerRequestEvent<Response> = {\n        mode: 'server',\n        locale: undefined,\n        url,\n        // @ts-ignore\n        env: Deno.env,\n        request,\n        getWritableStream: (status, headers, cookies, resolve) => {\n          const { readable, writable } = new TransformStream<Uint8Array>();\n          const response = new Response(readable, {\n            status,\n            headers: mergeHeadersCookies(headers, cookies),\n          });\n          resolve(response);\n          return writable;\n        },\n        platform: {\n          ssr: true,\n        },\n        getClientConn: () => {\n          return opts.getClientConn\n            ? opts.getClientConn(request, info)\n            : {\n                ip: info.remoteAddr.hostname,\n              };\n        },\n      };\n\n      // send request to qwik city request handler\n      const handledResponse = await requestHandler(serverRequestEv, opts, qwikSerializer);\n      if (handledResponse) {\n        handledResponse.completion.then((v) => {\n          if (v) {\n            console.error(v);\n          }\n        });\n        const response = await handledResponse.response;\n        if (response) {\n          return response;\n        }\n      }\n\n      // qwik city did not have a route for this request\n      return null;\n    } catch (e: any) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'deno-server' },\n      });\n    }\n  }\n\n  const notFound = async (request: Request) => {\n    try {\n      const url = getRequestUrl(request, opts);\n\n      // In the development server, we replace the getNotFound function\n      // For static paths, we assign a static \"Not Found\" message.\n      // This ensures consistency between development and production environments for specific URLs.\n      const notFoundHtml = isStaticPath(request.method || 'GET', url)\n        ? 'Not Found'\n        : getNotFound(url.pathname);\n      return new Response(notFoundHtml, {\n        status: 404,\n        headers: { 'Content-Type': 'text/html; charset=utf-8', 'X-Not-Found': url.pathname },\n      });\n    } catch (e) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'deno-server' },\n      });\n    }\n  };\n\n  const openStaticFile = async (url: URL) => {\n    const pathname = url.pathname;\n    const fileName = pathname.slice(url.pathname.lastIndexOf('/'));\n    let filePath: string;\n    if (fileName.includes('.')) {\n      filePath = join(staticFolder, pathname);\n    } else if (opts.qwikCityPlan.trailingSlash) {\n      filePath = join(staticFolder, pathname + 'index.html');\n    } else {\n      filePath = join(staticFolder, pathname, 'index.html');\n    }\n    return {\n      filePath,\n      // @ts-ignore\n      content: await Deno.open(filePath, { read: true }),\n    };\n  };\n\n  const staticFile = async (request: Request) => {\n    try {\n      const url = getRequestUrl(request, opts);\n\n      if (isStaticPath(request.method || 'GET', url)) {\n        const { filePath, content } = await openStaticFile(url);\n        const ext = extname(filePath).replace(/^\\./, '');\n\n        return new Response(content.readable, {\n          status: 200,\n          headers: {\n            'content-type': MIME_TYPES[ext] || 'text/plain; charset=utf-8',\n            'Cache-Control': opts.static?.cacheControl || 'max-age=3600',\n          },\n        });\n      }\n\n      return null;\n    } catch (e) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'deno-server' },\n      });\n    }\n  };\n\n  return {\n    router,\n    notFound,\n    staticFile,\n  };\n}\n\n/** @public */\nexport interface QwikCityDenoOptions extends ServerRenderOptions {\n  /** Options for serving static files */\n  static?: {\n    /** The root folder for statics files. Defaults to /dist */\n    root?: string;\n    /** Set the Cache-Control header for all static files */\n    cacheControl?: string;\n  };\n\n  /**\n   * Provide a function that computes the origin of the server, used to resolve relative URLs and\n   * validate the request origin against CSRF attacks.\n   *\n   * When not specified, it defaults to the `ORIGIN` environment variable (if set).\n   *\n   * If `ORIGIN` is not set, it's derived from the incoming request, which is not recommended for\n   * production use.\n   */\n  getOrigin?: (request: Request, info?: ServeHandlerInfo) => string | null;\n\n  /** Provide a function that returns a `ClientConn` for the given request. */\n  getClientConn?: (request: Request, info: ServeHandlerInfo) => ClientConn;\n}\n\ndeclare const Deno: any;\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/deno/middleware.deno.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { ClientConn } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityDenoOptions): {\n    router: (request: Request, info: ServeHandlerInfo) => Promise<Response | null>;\n    notFound: (request: Request) => Promise<Response>;\n    staticFile: (request: Request) => Promise<Response | null>;\n};\n\n// @public (undocumented)\nexport interface NetAddr {\n    // (undocumented)\n    hostname: string;\n    // (undocumented)\n    port: number;\n    // (undocumented)\n    transport: 'tcp' | 'udp';\n}\n\n// @public (undocumented)\nexport interface QwikCityDenoOptions extends ServerRenderOptions {\n    getClientConn?: (request: Request, info: ServeHandlerInfo) => ClientConn;\n    getOrigin?: (request: Request, info?: ServeHandlerInfo) => string | null;\n    static?: {\n        root?: string;\n        cacheControl?: string;\n    };\n}\n\n// @public (undocumented)\nexport interface ServeHandlerInfo {\n    // (undocumented)\n    remoteAddr: NetAddr;\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/firebase/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/firebase/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.firebase\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/firebase/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/firebase\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/firebase/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/firebase/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/firebase/index.ts",
    "content": "import { createQwikCity as createQwikCityNode } from '@builder.io/qwik-city/middleware/node';\n\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n/** @public */\nexport function createQwikCity(opts: QwikCityFirebaseOptions) {\n  const { staticFile, notFound, router } = createQwikCityNode({\n    render: opts.render,\n    manifest: opts.manifest,\n    qwikCityPlan: opts.qwikCityPlan,\n    static: {\n      cacheControl: 'public, max-age=31557600',\n    },\n    getOrigin(req) {\n      if (process.env.IS_OFFLINE) {\n        return `http://${req.headers.host}`;\n      }\n      return null;\n    },\n  });\n\n  const qwikApp = (req: any, res: any) => {\n    return staticFile(req, res, () => {\n      router(req, res, () => notFound(req, res, () => {}));\n    });\n  };\n\n  return qwikApp;\n}\n\n/** @public */\nexport interface QwikCityFirebaseOptions extends ServerRenderOptions {}\n\n/** @public */\nexport interface PlatformFirebase extends Object {}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/firebase/middleware.firebase.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityFirebaseOptions): (req: any, res: any) => Promise<void>;\n\n// @public (undocumented)\nexport interface PlatformFirebase extends Object {\n}\n\n// @public (undocumented)\nexport interface QwikCityFirebaseOptions extends ServerRenderOptions {\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/netlify-edge/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/netlify-edge/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.netlify-edge\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/netlify-edge/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/netlify-edge\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/netlify-edge/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/netlify-edge/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/netlify-edge/index.ts",
    "content": "import type { Context } from '@netlify/edge-functions';\nimport type {\n  ServerRenderOptions,\n  ServerRequestEvent,\n} from '@builder.io/qwik-city/middleware/request-handler';\n\nimport {\n  mergeHeadersCookies,\n  requestHandler,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { getNotFound } from '@qwik-city-not-found-paths';\nimport { isStaticPath } from '@qwik-city-static-paths';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport { setServerPlatform } from '@builder.io/qwik/server';\n\n// @builder.io/qwik-city/middleware/netlify-edge\n\ndeclare const Deno: any;\n/** @public */\nexport function createQwikCity(opts: QwikCityNetlifyOptions) {\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  if (opts.manifest) {\n    setServerPlatform(opts.manifest);\n  }\n  async function onNetlifyEdgeRequest(request: Request, context: Context) {\n    try {\n      const url = new URL(request.url);\n\n      if (isStaticPath(request.method, url) || url.pathname.startsWith('/.netlify')) {\n        // known static path, let netlify handle it\n        return context.next();\n      }\n\n      const serverRequestEv: ServerRequestEvent<Response> = {\n        mode: 'server',\n        locale: undefined,\n        url,\n        env: Deno.env,\n        request,\n        getWritableStream: (status, headers, cookies, resolve) => {\n          const { readable, writable } = new TransformStream<Uint8Array>();\n          const response = new Response(readable, {\n            status,\n            headers: mergeHeadersCookies(headers, cookies),\n          });\n          resolve(response);\n          return writable;\n        },\n        getClientConn: () => {\n          return {\n            ip: context.ip,\n            country: context.geo.country?.code,\n          };\n        },\n        platform: context,\n      };\n\n      // send request to qwik city request handler\n      const handledResponse = await requestHandler(serverRequestEv, opts, qwikSerializer);\n      if (handledResponse) {\n        handledResponse.completion.then((v) => {\n          if (v) {\n            console.error(v);\n          }\n        });\n        const response = await handledResponse.response;\n        if (response) {\n          return response;\n        }\n      }\n\n      // qwik city did not have a route for this request\n      // response with 404 for this pathname\n\n      // In the development server, we replace the getNotFound function\n      // For static paths, we assign a static \"Not Found\" message.\n      // This ensures consistency between development and production environments for specific URLs.\n      const notFoundHtml = isStaticPath(request.method || 'GET', url)\n        ? 'Not Found'\n        : getNotFound(url.pathname);\n      return new Response(notFoundHtml, {\n        status: 404,\n        headers: { 'Content-Type': 'text/html; charset=utf-8', 'X-Not-Found': url.pathname },\n      });\n    } catch (e: any) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'netlify-edge' },\n      });\n    }\n  }\n\n  return onNetlifyEdgeRequest;\n}\n\n/** @public */\nexport interface QwikCityNetlifyOptions extends ServerRenderOptions {}\n\n/** @public */\nexport interface PlatformNetlify extends Partial<Omit<Context, 'next' | 'cookies'>> {}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/netlify-edge/middleware.netlify-edge.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { Context } from '@netlify/edge-functions';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityNetlifyOptions): (request: Request, context: Context) => Promise<Response>;\n\n// @public (undocumented)\nexport interface PlatformNetlify extends Partial<Omit<Context, 'next' | 'cookies'>> {\n}\n\n// @public (undocumented)\nexport interface QwikCityNetlifyOptions extends ServerRenderOptions {\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/node/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/node/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.node\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/node/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/node\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/node/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/node/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/node/http.ts",
    "content": "import type { IncomingMessage, ServerResponse } from 'node:http';\nimport { Http2ServerRequest } from 'node:http2';\nimport type {\n  ServerRequestMode,\n  ServerRequestEvent,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ClientConn } from '../request-handler/types';\nimport type { QwikCityNodeRequestOptions } from '.';\n\nexport function computeOrigin(\n  req: IncomingMessage | Http2ServerRequest,\n  opts?: QwikCityNodeRequestOptions\n) {\n  return opts?.getOrigin?.(req) ?? opts?.origin ?? process.env.ORIGIN ?? fallbackOrigin(req);\n}\n\nfunction fallbackOrigin(req: IncomingMessage | Http2ServerRequest) {\n  const { PROTOCOL_HEADER, HOST_HEADER } = process.env;\n  const headers = req.headers;\n  const protocol =\n    (PROTOCOL_HEADER && headers[PROTOCOL_HEADER]) ||\n    ((req.socket as any).encrypted || (req.connection as any).encrypted ? 'https' : 'http');\n  const hostHeader = HOST_HEADER ?? (req instanceof Http2ServerRequest ? ':authority' : 'host');\n  const host = headers[hostHeader];\n\n  return `${protocol}://${host}`;\n}\n\nexport function getUrl(req: IncomingMessage | Http2ServerRequest, origin: string) {\n  return normalizeUrl((req as any).originalUrl || req.url || '/', origin);\n}\n\n// when the user refreshes or cancels the stream there will be an error\nfunction isIgnoredError(message = '') {\n  const ignoredErrors = ['The stream has been destroyed', 'write after end'];\n  return ignoredErrors.some((ignored) => message.includes(ignored));\n}\n\n// ensure no HTTP/2-specific headers are being set\nconst invalidHeadersPattern = /^:(method|scheme|authority|path)$/i;\n\nexport function normalizeUrl(url: string, base: string) {\n  // defined in function because of lastIndex gotcha with /g\n  const DOUBLE_SLASH_REG = /\\/\\/|\\\\\\\\/g;\n\n  // do not allow the url to have a relative protocol url\n  // which could bypass of CSRF protections\n  // for example: new URL(\"//attacker.com\", \"https://qwik.build.io\")\n  // would return \"https://attacker.com\" when it should be \"https://qwik.build.io/attacker.com\"\n  return new URL(url.replace(DOUBLE_SLASH_REG, '/'), base);\n}\n\nexport async function fromNodeHttp(\n  url: URL,\n  req: IncomingMessage | Http2ServerRequest,\n  res: ServerResponse,\n  mode: ServerRequestMode,\n  getClientConn?: (req: IncomingMessage | Http2ServerRequest) => ClientConn\n) {\n  const requestHeaders = new Headers();\n  const nodeRequestHeaders = req.headers;\n\n  try {\n    for (const [key, value] of Object.entries(nodeRequestHeaders)) {\n      if (invalidHeadersPattern.test(key)) {\n        continue;\n      }\n      if (typeof value === 'string') {\n        requestHeaders.set(key, value);\n      } else if (Array.isArray(value)) {\n        for (const v of value) {\n          requestHeaders.append(key, v);\n        }\n      }\n    }\n  } catch (err) {\n    console.error(err);\n  }\n\n  const getRequestBody = async function* () {\n    for await (const chunk of req as any) {\n      yield chunk;\n    }\n  };\n\n  const body = req.method === 'HEAD' || req.method === 'GET' ? undefined : getRequestBody();\n  const controller = new AbortController();\n  const options = {\n    method: req.method,\n    headers: requestHeaders,\n    body: body as any,\n    signal: controller.signal,\n    duplex: 'half' as any,\n  };\n  res.on('close', () => {\n    controller.abort();\n  });\n  const serverRequestEv: ServerRequestEvent<boolean> = {\n    mode,\n    url,\n    request: new Request(url.href, options as any),\n    env: {\n      get(key) {\n        return process.env[key];\n      },\n    },\n    getWritableStream: (status, headers, cookies) => {\n      res.statusCode = status;\n\n      try {\n        for (const [key, value] of headers) {\n          if (invalidHeadersPattern.test(key)) {\n            continue;\n          }\n          res.setHeader(key, value);\n        }\n        const cookieHeaders = cookies.headers();\n        if (cookieHeaders.length > 0) {\n          res.setHeader('Set-Cookie', cookieHeaders);\n        }\n      } catch (err) {\n        console.error(err);\n      }\n\n      return new WritableStream<Uint8Array>({\n        write(chunk) {\n          if (res.closed || res.destroyed) {\n            // If the response has already been closed or destroyed (for example the client has disconnected)\n            // then writing into it will cause an error. So just stop writing since no one\n            // is listening.\n            return;\n          }\n          res.write(chunk, (error) => {\n            if (error && !isIgnoredError(error.message)) {\n              console.error(error);\n            }\n          });\n        },\n        close() {\n          res.end();\n        },\n      });\n    },\n    getClientConn: () => {\n      return getClientConn\n        ? getClientConn(req)\n        : {\n            ip: req.socket.remoteAddress,\n          };\n    },\n    platform: {\n      ssr: true,\n      incomingMessage: req,\n      node: process.versions.node,\n\n      // Weirdly needed to make typecheck of insights happy\n    } as QwikCityPlatform,\n    locale: undefined,\n  };\n\n  return serverRequestEv;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/node/http.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { normalizeUrl } from './http';\n\n[\n  {\n    url: '/',\n    base: 'https://qwik.dev',\n    expect: 'https://qwik.dev/',\n  },\n  {\n    url: '/attacker.com',\n    base: 'https://qwik.dev',\n    expect: 'https://qwik.dev/attacker.com',\n  },\n  {\n    url: '//attacker.com',\n    base: 'https://qwik.dev',\n    expect: 'https://qwik.dev/attacker.com',\n  },\n  {\n    url: '\\\\\\\\attacker.com',\n    base: 'https://qwik.dev',\n    expect: 'https://qwik.dev/attacker.com',\n  },\n  {\n    url: '/some-path//attacker.com',\n    base: 'https://qwik.dev',\n    expect: 'https://qwik.dev/some-path/attacker.com',\n  },\n].forEach((t) => {\n  test(`normalizeUrl(${t.url}, ${t.base})`, () => {\n    assert.equal(normalizeUrl(t.url, t.base).href, t.expect);\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/node/index.ts",
    "content": "import type {\n  ServerRenderOptions,\n  ClientConn,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { requestHandler } from '@builder.io/qwik-city/middleware/request-handler';\nimport { setServerPlatform } from '@builder.io/qwik/server';\nimport { getNotFound } from '@qwik-city-not-found-paths';\nimport { isStaticPath } from '@qwik-city-static-paths';\nimport { createReadStream } from 'node:fs';\nimport type { IncomingMessage, ServerResponse } from 'node:http';\nimport { extname, join, basename } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { computeOrigin, fromNodeHttp, getUrl } from './http';\nimport { MIME_TYPES } from '../request-handler/mime-types';\nimport { patchGlobalThis } from './node-fetch';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport type { Http2ServerRequest } from 'node:http2';\n\n// @builder.io/qwik-city/middleware/node\n\n/** @public */\nexport function createQwikCity(opts: QwikCityNodeRequestOptions) {\n  // Patch Stream APIs\n  patchGlobalThis();\n\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  if (opts.manifest) {\n    setServerPlatform(opts.manifest);\n  }\n  const staticFolder =\n    opts.static?.root ?? join(fileURLToPath(import.meta.url), '..', '..', 'dist');\n\n  const router = async (\n    req: IncomingMessage | Http2ServerRequest,\n    res: ServerResponse,\n    next: NodeRequestNextFunction\n  ) => {\n    try {\n      const origin = computeOrigin(req, opts);\n      const serverRequestEv = await fromNodeHttp(\n        getUrl(req, origin),\n        req,\n        res,\n        'server',\n        opts.getClientConn\n      );\n      const handled = await requestHandler(serverRequestEv, opts, qwikSerializer);\n      if (handled) {\n        const err = await handled.completion;\n        if (err) {\n          throw err;\n        }\n        if (handled.requestEv.headersSent) {\n          return;\n        }\n      }\n      next();\n    } catch (e) {\n      console.error(e);\n      next(e);\n    }\n  };\n\n  const notFound = async (\n    req: IncomingMessage | Http2ServerRequest,\n    res: ServerResponse,\n    next: (e: any) => void\n  ) => {\n    try {\n      if (!res.headersSent) {\n        const origin = computeOrigin(req, opts);\n        const url = getUrl(req, origin);\n\n        // In the development server, we replace the getNotFound function\n        // For static paths, we assign a static \"Not Found\" message.\n        // This ensures consistency between development and production environments for specific URLs.\n        const notFoundHtml = isStaticPath(req.method || 'GET', url)\n          ? 'Not Found'\n          : getNotFound(url.pathname);\n        res.writeHead(404, {\n          'Content-Type': 'text/html; charset=utf-8',\n          'X-Not-Found': url.pathname,\n        });\n        res.end(notFoundHtml);\n      }\n    } catch (e) {\n      console.error(e);\n      next(e);\n    }\n  };\n\n  const staticFile = async (\n    req: IncomingMessage | Http2ServerRequest,\n    res: ServerResponse,\n    next: (e?: any) => void\n  ) => {\n    try {\n      const origin = computeOrigin(req, opts);\n      const url = getUrl(req, origin);\n      if (isStaticPath(req.method || 'GET', url)) {\n        const pathname = url.pathname;\n        let filePath: string;\n        if (basename(pathname).includes('.')) {\n          filePath = join(staticFolder, pathname);\n        } else if (opts.qwikCityPlan.trailingSlash) {\n          filePath = join(staticFolder, pathname + 'index.html');\n        } else {\n          filePath = join(staticFolder, pathname, 'index.html');\n        }\n        const ext = extname(filePath).replace(/^\\./, '');\n        const stream = createReadStream(filePath);\n        stream.on('error', next);\n\n        const contentType = MIME_TYPES[ext];\n\n        if (contentType) {\n          res.setHeader('Content-Type', contentType);\n        }\n\n        if (opts.static?.cacheControl) {\n          res.setHeader('Cache-Control', opts.static.cacheControl);\n        }\n\n        stream.pipe(res);\n\n        return;\n      }\n\n      return next();\n    } catch (e) {\n      console.error(e);\n      next(e);\n    }\n  };\n\n  return {\n    router,\n    notFound,\n    staticFile,\n  };\n}\n\n/** @public */\nexport interface PlatformNode {\n  ssr?: true;\n  incomingMessage?: IncomingMessage | Http2ServerRequest;\n  node?: string;\n}\n\n/** @public */\nexport interface QwikCityNodeRequestOptions extends ServerRenderOptions {\n  /** Options for serving static files */\n  static?: {\n    /** The root folder for statics files. Defaults to /dist */\n    root?: string;\n    /** Set the Cache-Control header for all static files */\n    cacheControl?: string;\n  };\n\n  /**\n   * Provide a function that computes the origin of the server, used to resolve relative URLs and\n   * validate the request origin against CSRF attacks.\n   *\n   * When not specified, it defaults to the `ORIGIN` environment variable (if set).\n   *\n   * If `ORIGIN` is not set, it's derived from the incoming request, which is not recommended for\n   * production use. You can specify the `PROTOCOL_HEADER`, `HOST_HEADER` to `X-Forwarded-Proto` and\n   * `X-Forwarded-Host` respectively to override the default behavior.\n   */\n  getOrigin?: (req: IncomingMessage | Http2ServerRequest) => string | null;\n\n  /** Provide a function that returns a `ClientConn` for the given request. */\n  getClientConn?: (req: IncomingMessage | Http2ServerRequest) => ClientConn;\n\n  /** @deprecated Use `getOrigin` instead. */\n  origin?: string;\n}\n\n/** @public */\nexport interface NodeRequestNextFunction {\n  (err?: any): void;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/node/middleware.node.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\n/// <reference types=\"node\" />\n\nimport type { ClientConn } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { Http2ServerRequest } from 'node:http2';\nimport type { IncomingMessage } from 'node:http';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ServerResponse } from 'node:http';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityNodeRequestOptions): {\n    router: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: NodeRequestNextFunction) => Promise<void>;\n    notFound: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: (e: any) => void) => Promise<void>;\n    staticFile: (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: (e?: any) => void) => Promise<void>;\n};\n\n// @public (undocumented)\nexport interface NodeRequestNextFunction {\n    // (undocumented)\n    (err?: any): void;\n}\n\n// @public (undocumented)\nexport interface PlatformNode {\n    // (undocumented)\n    incomingMessage?: IncomingMessage | Http2ServerRequest;\n    // (undocumented)\n    node?: string;\n    // (undocumented)\n    ssr?: true;\n}\n\n// @public (undocumented)\nexport interface QwikCityNodeRequestOptions extends ServerRenderOptions {\n    getClientConn?: (req: IncomingMessage | Http2ServerRequest) => ClientConn;\n    getOrigin?: (req: IncomingMessage | Http2ServerRequest) => string | null;\n    // @deprecated (undocumented)\n    origin?: string;\n    static?: {\n        root?: string;\n        cacheControl?: string;\n    };\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/node/node-fetch.ts",
    "content": "import {\n  TextEncoderStream,\n  TextDecoderStream,\n  WritableStream,\n  ReadableStream,\n} from 'node:stream/web';\nimport { fetch, Headers, Request, Response, FormData } from 'undici';\n\nimport crypto from 'crypto';\n\n// TODO: remove when undici is removed\nexport function patchGlobalThis() {\n  if (\n    typeof global !== 'undefined' &&\n    typeof globalThis.fetch !== 'function' &&\n    typeof process !== 'undefined' &&\n    process.versions.node\n  ) {\n    globalThis.fetch = fetch as any;\n    globalThis.Headers = Headers as any;\n    globalThis.Request = Request as any;\n    globalThis.Response = Response as any;\n    globalThis.FormData = FormData as any;\n  }\n  if (typeof globalThis.TextEncoderStream === 'undefined') {\n    // @ts-ignore\n    globalThis.TextEncoderStream = TextEncoderStream;\n    // @ts-ignore\n    globalThis.TextDecoderStream = TextDecoderStream;\n  }\n  if (typeof globalThis.WritableStream === 'undefined') {\n    globalThis.WritableStream = WritableStream as any;\n    globalThis.ReadableStream = ReadableStream as any;\n  }\n  if (typeof globalThis.crypto === 'undefined') {\n    globalThis.crypto = crypto.webcrypto as any;\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/request-handler/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.request-handler\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/request-handler/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/request-handler\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/request-handler/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/request-handler/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/cache-control.ts",
    "content": "import type { CacheControl } from './types';\n\nexport function createCacheControl(cacheControl: CacheControl) {\n  const controls: string[] = [];\n  if (cacheControl === 'day') {\n    cacheControl = 60 * 60 * 24;\n  } else if (cacheControl === 'week') {\n    cacheControl = 60 * 60 * 24 * 7;\n  } else if (cacheControl === 'month') {\n    cacheControl = 60 * 60 * 24 * 30;\n  } else if (cacheControl === 'year') {\n    cacheControl = 60 * 60 * 24 * 365;\n  } else if (cacheControl === 'private') {\n    cacheControl = {\n      private: true,\n      noCache: true,\n    };\n  } else if (cacheControl === 'immutable') {\n    cacheControl = {\n      public: true,\n      immutable: true,\n      maxAge: 60 * 60 * 24 * 365,\n    };\n  } else if (cacheControl === 'no-cache') {\n    cacheControl = {\n      noCache: true,\n    };\n  }\n\n  if (typeof cacheControl === 'number') {\n    cacheControl = {\n      maxAge: cacheControl,\n      sMaxAge: cacheControl,\n    };\n  }\n\n  if (cacheControl.immutable) {\n    controls.push('immutable');\n  }\n  if (cacheControl.maxAge) {\n    controls.push(`max-age=${cacheControl.maxAge}`);\n  }\n  if (cacheControl.sMaxAge) {\n    controls.push(`s-maxage=${cacheControl.sMaxAge}`);\n  }\n  if (cacheControl.noStore) {\n    controls.push('no-store');\n  }\n  if (cacheControl.noCache) {\n    controls.push('no-cache');\n  }\n  if (cacheControl.private) {\n    controls.push('private');\n  }\n  if (cacheControl.public) {\n    controls.push('public');\n  }\n  if (cacheControl.staleWhileRevalidate) {\n    controls.push(`stale-while-revalidate=${cacheControl.staleWhileRevalidate}`);\n  }\n  if (cacheControl.staleIfError) {\n    controls.push(`stale-if-error=${cacheControl.staleIfError}`);\n  }\n  return controls.join(', ');\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/cookie.ts",
    "content": "import type { Cookie as CookieInterface, CookieOptions, CookieValue } from './types';\n\nconst SAMESITE = {\n  lax: 'Lax',\n  Lax: 'Lax',\n  None: 'None',\n  none: 'None',\n  strict: 'Strict',\n  Strict: 'Strict',\n} as const;\n\nconst UNIT = {\n  seconds: 1,\n  minutes: 1 * 60,\n  hours: 1 * 60 * 60,\n  days: 1 * 60 * 60 * 24,\n  weeks: 1 * 60 * 60 * 24 * 7,\n};\n\nconst createSetCookieValue = (cookieName: string, cookieValue: string, options: CookieOptions) => {\n  const c = [`${cookieName}=${cookieValue}`];\n\n  if (typeof options.domain === 'string') {\n    c.push(`Domain=${options.domain}`);\n  }\n\n  // If both Expires and Max-Age are set, Max-Age has precedence.\n  if (typeof options.maxAge === 'number') {\n    c.push(`Max-Age=${options.maxAge}`);\n  } else if (Array.isArray(options.maxAge)) {\n    c.push(`Max-Age=${options.maxAge[0] * UNIT[options.maxAge[1]]}`);\n  } else if (typeof options.expires === 'number' || typeof options.expires == 'string') {\n    c.push(`Expires=${options.expires}`);\n  } else if (options.expires instanceof Date) {\n    c.push(`Expires=${options.expires.toUTCString()}`);\n  }\n\n  if (options.httpOnly) {\n    c.push('HttpOnly');\n  }\n\n  if (typeof options.path === 'string') {\n    c.push(`Path=${options.path}`);\n  }\n\n  const sameSite = resolveSameSite(options.sameSite);\n  if (sameSite) {\n    c.push(`SameSite=${sameSite}`);\n  }\n\n  if (options.secure) {\n    c.push('Secure');\n  }\n\n  return c.join('; ');\n};\n\nfunction tryDecodeUriComponent(str: string) {\n  try {\n    return decodeURIComponent(str);\n  } catch {\n    return str;\n  }\n}\n\nconst parseCookieString = (cookieString: string | undefined | null) => {\n  const cookie: Record<string, string> = {};\n  if (typeof cookieString === 'string' && cookieString !== '') {\n    const cookieSegments = cookieString.split(';');\n    for (const cookieSegment of cookieSegments) {\n      const separatorIndex = cookieSegment.indexOf('=');\n      if (separatorIndex !== -1) {\n        cookie[tryDecodeUriComponent(cookieSegment.slice(0, separatorIndex).trim())] =\n          tryDecodeUriComponent(cookieSegment.slice(separatorIndex + 1).trim());\n      }\n    }\n  }\n  return cookie;\n};\n\nfunction resolveSameSite(sameSite: CookieOptions['sameSite']) {\n  if (sameSite === true) {\n    return 'Strict';\n  }\n  if (sameSite === false) {\n    return 'None';\n  }\n  if (sameSite) {\n    return SAMESITE[sameSite];\n  }\n  return undefined;\n}\n\nconst REQ_COOKIE = Symbol('request-cookies');\nconst RES_COOKIE = Symbol('response-cookies');\nconst LIVE_COOKIE = Symbol('live-cookies');\n\nexport class Cookie implements CookieInterface {\n  private [REQ_COOKIE]: Record<string, string>;\n  private [RES_COOKIE]: Record<string, string> = {};\n  private [LIVE_COOKIE]: Record<string, string | null> = {};\n  private appendCounter = 0;\n\n  constructor(cookieString?: string | undefined | null) {\n    this[REQ_COOKIE] = parseCookieString(cookieString);\n    this[LIVE_COOKIE] = { ...this[REQ_COOKIE] };\n  }\n\n  get(cookieName: string, live: boolean = true) {\n    const value = this[live ? LIVE_COOKIE : REQ_COOKIE][cookieName];\n    if (!value) {\n      return null;\n    }\n    return {\n      value,\n      json() {\n        return JSON.parse(value);\n      },\n      number() {\n        return Number(value);\n      },\n    };\n  }\n\n  getAll(live: boolean = true) {\n    return Object.keys(this[live ? LIVE_COOKIE : REQ_COOKIE]).reduce(\n      (cookies, cookieName) => {\n        cookies[cookieName] = this.get(cookieName)!;\n        return cookies;\n      },\n      {} as Record<string, CookieValue>\n    );\n  }\n\n  has(cookieName: string, live: boolean = true) {\n    return !!this[live ? LIVE_COOKIE : REQ_COOKIE][cookieName];\n  }\n\n  set(\n    cookieName: string,\n    cookieValue: string | number | Record<string, any>,\n    options: CookieOptions = {}\n  ) {\n    this[LIVE_COOKIE][cookieName] =\n      typeof cookieValue === 'string' ? cookieValue : JSON.stringify(cookieValue);\n\n    const resolvedValue =\n      typeof cookieValue === 'string'\n        ? cookieValue\n        : encodeURIComponent(JSON.stringify(cookieValue));\n    this[RES_COOKIE][cookieName] = createSetCookieValue(cookieName, resolvedValue, options);\n  }\n\n  append(\n    cookieName: string,\n    cookieValue: string | number | Record<string, any>,\n    options: CookieOptions = {}\n  ) {\n    this[LIVE_COOKIE][cookieName] =\n      typeof cookieValue === 'string' ? cookieValue : JSON.stringify(cookieValue);\n\n    const resolvedValue =\n      typeof cookieValue === 'string'\n        ? cookieValue\n        : encodeURIComponent(JSON.stringify(cookieValue));\n    this[RES_COOKIE][++this.appendCounter] = createSetCookieValue(\n      cookieName,\n      resolvedValue,\n      options\n    );\n  }\n\n  delete(name: string, options?: Pick<CookieOptions, 'path' | 'domain' | 'sameSite'>) {\n    this.set(name, 'deleted', { ...options, maxAge: 0 });\n    this[LIVE_COOKIE][name] = null;\n  }\n\n  headers() {\n    return Object.values(this[RES_COOKIE]);\n  }\n}\n\n/** @public */\nexport const mergeHeadersCookies = (headers: Headers, cookies: CookieInterface) => {\n  const cookieHeaders = cookies.headers();\n  if (cookieHeaders.length > 0) {\n    const newHeaders = new Headers(headers);\n    for (const cookie of cookieHeaders) {\n      newHeaders.append('Set-Cookie', cookie);\n    }\n    return newHeaders;\n  }\n  return headers;\n};\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/cookie.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { Cookie } from './cookie';\nimport type { CookieOptions } from './types';\n\nexport interface TestData {\n  key: string;\n  value: string | Record<string, any>;\n  options: CookieOptions;\n  expect: string;\n}\n\ntest('parses cookie', () => {\n  const cookieValues = {\n    a: 'hello=world',\n    b: '25',\n    c: '{\"hello\": \"world\"}',\n    d: '%badencoding',\n  };\n  const cookieString = Object.entries(cookieValues)\n    .reduce((prev: string[], [key, value]) => {\n      return [...prev, `${key}=${value}`];\n    }, [])\n    .join(';');\n  const cookie = new Cookie(cookieString);\n  Object.keys(cookieValues).forEach((key) => {\n    assert.equal(true, cookie.has(key));\n  });\n  Object.entries(cookieValues).forEach(([key, value]) => {\n    assert.equal(cookie.get(key)?.value, value);\n  });\n  assert.equal(Object.keys(cookie.getAll()).length, 4);\n  assert.equal(cookie.getAll().a.value, 'hello=world');\n  assert.equal(cookie.getAll().b.number(), 25);\n  assert.deepEqual(cookie.getAll().c.json(), { hello: 'world' });\n  assert.equal(cookie.getAll().d.value, '%badencoding');\n});\n\ntest('creates correct headers', () => {\n  const data: TestData[] = [\n    { key: 'a', value: '1', options: {}, expect: 'a=1' },\n    { key: 'b', value: '2', options: { sameSite: 'strict' }, expect: 'b=2; SameSite=Strict' },\n    { key: 'c', value: '3', options: { sameSite: 'lax' }, expect: 'c=3; SameSite=Lax' },\n    { key: 'd', value: '4', options: { sameSite: 'none' }, expect: 'd=4; SameSite=None' },\n    { key: 'e', value: '5', options: { httpOnly: true }, expect: 'e=5; HttpOnly' },\n    { key: 'f', value: '6', options: { secure: true }, expect: 'f=6; Secure' },\n    {\n      key: 'g',\n      value: '7',\n      options: { path: '/qwikcity/overview/' },\n      expect: 'g=7; Path=/qwikcity/overview/',\n    },\n    {\n      key: 'h',\n      value: '8',\n      options: { maxAge: [60, 'minutes'] },\n      expect: `h=8; Max-Age=${60 * 60}`,\n    },\n    { key: 'i', value: '9', options: { maxAge: 60 * 60 }, expect: `i=9; Max-Age=${60 * 60}` },\n    {\n      key: 'j',\n      value: '10',\n      options: { domain: 'https://qwik.dev' },\n      expect: 'j=10; Domain=https://qwik.dev',\n    },\n    {\n      key: 'k',\n      value: '11',\n      options: { expires: 'Wed, 21 Oct 2015 07:28:00 GMT' },\n      expect: 'k=11; Expires=Wed, 21 Oct 2015 07:28:00 GMT',\n    },\n    {\n      key: 'l',\n      value: '12',\n      options: { expires: new Date('Wed, 21 Oct 2015 07:28:00 GMT') },\n      expect: 'l=12; Expires=Wed, 21 Oct 2015 07:28:00 GMT',\n    },\n    {\n      key: 'm',\n      value: '13',\n      options: { expires: new Date(0) },\n      expect: 'm=13; Expires=Thu, 01 Jan 1970 00:00:00 GMT',\n    },\n    { key: 'n', value: '14', options: { sameSite: 'Strict' }, expect: 'n=14; SameSite=Strict' },\n    { key: 'o', value: '15', options: { sameSite: 'Lax' }, expect: 'o=15; SameSite=Lax' },\n    { key: 'p', value: '16', options: { sameSite: 'None' }, expect: 'p=16; SameSite=None' },\n  ];\n  const cookie = new Cookie('');\n  const expect = data.map(({ expect }) => expect);\n\n  data.forEach(({ key, value, options }) => {\n    cookie.set(key, value, options);\n  });\n\n  const result = cookie.headers();\n  assert.equal(expect.length, result.length);\n  for (let i = 0; i < expect.length; i++) {\n    const expected = expect[i];\n    const actual = result[i];\n    assert.equal(actual, expected);\n  }\n});\n\ntest('append cookies all keys are present', () => {\n  const data: TestData[] = [\n    { key: 'a', value: '1', options: {}, expect: 'a=1' },\n    { key: 'a', value: '2', options: { sameSite: 'strict' }, expect: 'a=2; SameSite=Strict' },\n    { key: 'a', value: '2', options: { sameSite: 'lax' }, expect: 'a=2; SameSite=Lax' },\n    { key: 'a', value: '2', options: { sameSite: 'none' }, expect: 'a=2; SameSite=None' },\n    { key: 'a', value: '2', options: { httpOnly: true }, expect: 'a=2; HttpOnly' },\n    { key: 'a', value: '6', options: { secure: true }, expect: 'a=6; Secure' },\n    {\n      key: 'a',\n      value: '7',\n      options: { path: '/qwikcity/overview/' },\n      expect: 'a=7; Path=/qwikcity/overview/',\n    },\n    {\n      key: 'a',\n      value: '8',\n      options: { maxAge: [60, 'minutes'] },\n      expect: `a=8; Max-Age=${60 * 60}`,\n    },\n    { key: 'a', value: '9', options: { maxAge: 60 * 60 }, expect: `a=9; Max-Age=${60 * 60}` },\n    {\n      key: 'a',\n      value: '10',\n      options: { domain: 'https://qwik.dev' },\n      expect: 'a=10; Domain=https://qwik.dev',\n    },\n    {\n      key: 'b',\n      value: '1',\n      options: { expires: 'Wed, 21 Oct 2015 07:28:00 GMT' },\n      expect: 'b=1; Expires=Wed, 21 Oct 2015 07:28:00 GMT',\n    },\n    {\n      key: 'b',\n      value: '1',\n      options: { domain: 'https://qwik.dev' },\n      expect: 'b=1; Domain=https://qwik.dev',\n    },\n    {\n      key: 'b',\n      value: '1',\n      options: { expires: new Date(0) },\n      expect: 'b=1; Expires=Thu, 01 Jan 1970 00:00:00 GMT',\n    },\n    { key: 'c', value: '14', options: { sameSite: 'Strict' }, expect: 'c=14; SameSite=Strict' },\n    { key: 'c', value: '15', options: { sameSite: 'Lax' }, expect: 'c=15; SameSite=Lax' },\n    { key: 'd', value: '16', options: { sameSite: 'None' }, expect: 'd=16; SameSite=None' },\n  ];\n  const cookie = new Cookie('');\n  const expect = data.map(({ expect }) => expect);\n\n  data.forEach(({ key, value, options }) => {\n    cookie.append(key, value, options);\n  });\n\n  const result = cookie.headers();\n  assert.equal(expect.length, result.length);\n  for (let i = 0; i < expect.length; i++) {\n    const expected = expect[i];\n    const actual = result[i];\n    assert.equal(actual, expected);\n  }\n});\n\ntest('set cookies only latest key is present', () => {\n  const data: TestData[] = [\n    { key: 'a', value: '1', options: {}, expect: 'a=1' },\n    { key: 'a', value: '2', options: { sameSite: 'strict' }, expect: 'a=2; SameSite=Strict' },\n  ];\n  const cookie = new Cookie('');\n\n  data.forEach(({ key, value, options }) => {\n    cookie.set(key, value, options);\n  });\n\n  const result = cookie.headers();\n  assert.equal(1, result.length);\n  assert.equal(result[0], data[1].expect);\n});\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/error-handler.ts",
    "content": "/** @public */\nexport function getErrorHtml(status: number, e: any) {\n  let message = 'Server Error';\n\n  if (e != null) {\n    if (typeof e.message === 'string') {\n      message = e.message;\n    } else {\n      message = String(e);\n    }\n  }\n\n  return `<html>` + minimalHtmlResponse(status, message) + `</html>`;\n}\n\nexport function minimalHtmlResponse(status: number, message?: string) {\n  if (typeof status !== 'number') {\n    status = 500;\n  }\n  if (typeof message === 'string') {\n    message = escapeHtml(message);\n  } else {\n    message = '';\n  }\n  const width = typeof message === 'string' ? '600px' : '300px';\n  const color = status >= 500 ? COLOR_500 : COLOR_400;\n  return `\n<head>\n  <meta charset=\"utf-8\">\n  <meta http-equiv=\"Status\" content=\"${status}\">\n  <title>${status} ${message}</title>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n  <style>\n    body { color: ${color}; background-color: #fafafa; padding: 30px; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif; }\n    p { max-width: ${width}; margin: 60px auto 30px auto; background: white; border-radius: 4px; box-shadow: 0px 0px 50px -20px ${color}; overflow: hidden; }\n    strong { display: inline-block; padding: 15px; background: ${color}; color: white; }\n    span { display: inline-block; padding: 15px; }\n  </style>\n</head>\n<body><p><strong>${status}</strong> <span>${message}</span></p></body>\n`;\n}\nconst ESCAPE_HTML = /[&<>]/g;\n\nconst escapeHtml = (s: string) => {\n  return s.replace(ESCAPE_HTML, (c) => {\n    switch (c) {\n      case '&':\n        return '&amp;';\n      case '<':\n        return '&lt;';\n      case '>':\n        return '&gt;';\n      default:\n        return '';\n    }\n  });\n};\n\nconst COLOR_400 = '#006ce9';\nconst COLOR_500 = '#713fc2';\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/form-parsing.unit.ts",
    "content": "import { describe, it, expect } from 'vitest';\nimport { formToObj } from './request-event';\n\ndescribe('formToObj', () => {\n  describe('Object prototype pollution', () => {\n    it('blocks __proto__ pollution via dotted notation', () => {\n      delete (Object.prototype as any).polluted;\n\n      const fd = new FormData();\n      fd.append('__proto__.polluted', '1');\n\n      formToObj(fd);\n\n      expect(({} as any).polluted).toBeUndefined();\n\n      delete (Object.prototype as any).polluted;\n    });\n\n    it('blocks __proto__[] pollution via array notation', () => {\n      delete (Object.prototype as any).polluted;\n\n      const fd = new FormData();\n      fd.append('__proto__[]', 'x');\n\n      const res = formToObj(fd);\n\n      expect(({} as any).polluted).toBeUndefined();\n      expect(Object.prototype.hasOwnProperty.call(res, '__proto__')).toBe(false);\n\n      delete (Object.prototype as any).polluted;\n    });\n\n    it('uses Object.create(null) for root object', () => {\n      const fd = new FormData();\n      fd.append('__proto__.polluted', 'yes');\n      fd.append('normal', 'ok');\n\n      const obj = formToObj(fd);\n\n      expect((Object.prototype as any).polluted).toBeUndefined();\n\n      expect((obj as any).polluted).toBeUndefined();\n      expect(Object.prototype.hasOwnProperty.call(obj, '__proto__')).toBe(false);\n\n      expect(obj.normal).toBe('ok');\n\n      expect(Object.getPrototypeOf(obj)).toBeNull();\n    });\n\n    it('blocks constructor pollution attempts', () => {\n      const fd = new FormData();\n      fd.append('constructor.polluted', 'bad');\n      fd.append('safe', 'good');\n\n      const obj = formToObj(fd);\n\n      expect((obj as any).polluted).toBeUndefined();\n      expect(Object.prototype.hasOwnProperty.call(obj, 'constructor')).toBe(false);\n      expect(obj.safe).toBe('good');\n    });\n\n    it('blocks prototype pollution attempts', () => {\n      const fd = new FormData();\n      fd.append('prototype.polluted', 'bad');\n      fd.append('safe', 'good');\n\n      const obj = formToObj(fd);\n\n      expect((obj as any).polluted).toBeUndefined();\n      expect(Object.prototype.hasOwnProperty.call(obj, 'prototype')).toBe(false);\n      expect(obj.safe).toBe('good');\n    });\n\n    it('blocks nested dangerous keys in middle of path', () => {\n      const fd = new FormData();\n      fd.append('user.__proto__.isAdmin', 'true');\n      fd.append('user.name', 'alice');\n\n      const obj = formToObj(fd);\n\n      // The dangerous entry is skipped\n      expect((obj as any).isAdmin).toBeUndefined();\n      expect((Object.prototype as any).isAdmin).toBeUndefined();\n      expect(obj.user?.isAdmin).toBeUndefined();\n\n      // The safe entry is processed normally\n      expect(obj.user?.name).toBe('alice');\n    });\n\n    it('blocks constructor[] array notation', () => {\n      const fd = new FormData();\n      fd.append('constructor[]', 'bad');\n      fd.append('safe', 'good');\n\n      const obj = formToObj(fd);\n\n      expect(Object.prototype.hasOwnProperty.call(obj, 'constructor')).toBe(false);\n      expect(obj.safe).toBe('good');\n    });\n\n    it('blocks prototype[] array notation', () => {\n      const fd = new FormData();\n      fd.append('prototype[]', 'bad');\n      fd.append('safe', 'good');\n\n      const obj = formToObj(fd);\n\n      expect(Object.prototype.hasOwnProperty.call(obj, 'prototype')).toBe(false);\n      expect(obj.safe).toBe('good');\n    });\n\n    it('handles nested objects without creating {} with prototype', () => {\n      const fd = new FormData();\n      fd.append('user.profile.name', 'alice');\n\n      const obj = formToObj(fd);\n\n      expect(Object.getPrototypeOf(obj)).toBeNull();\n      expect(Object.getPrototypeOf(obj.user)).toBeNull();\n      expect(Object.getPrototypeOf(obj.user.profile)).toBeNull();\n      expect(obj.user.profile.name).toBe('alice');\n    });\n  });\n\n  describe('Array parsing', () => {\n    it('creates arrays only for canonical non-negative integer keys', () => {\n      const fd = new FormData();\n      fd.append('items.0', 'apple');\n      fd.append('items.1', 'banana');\n      fd.append('notArray.-1', 'neg');\n      fd.append('alsoNotArray.01', 'leading-zero');\n      fd.append('stillNotArray.1e2', 'scientific');\n\n      const obj = formToObj(fd);\n\n      expect(Array.isArray(obj.items)).toBe(true);\n      expect(obj.items).toEqual(['apple', 'banana']);\n\n      expect(Array.isArray(obj.notArray)).toBe(false);\n      expect(obj.notArray['-1']).toBe('neg');\n\n      expect(Array.isArray(obj.alsoNotArray)).toBe(false);\n      expect(obj.alsoNotArray['01']).toBe('leading-zero');\n\n      expect(Array.isArray(obj.stillNotArray)).toBe(false);\n      expect(obj.stillNotArray['1e2']).toBe('scientific');\n    });\n\n    it('keeps object syntax object-shaped when sibling keys are mixed', () => {\n      const fd = new FormData();\n      fd.append('items.0', 'apple');\n      fd.append('items.1', 'banana');\n      fd.append('items.hello', 'there');\n\n      const obj = formToObj(fd);\n\n      expect(Array.isArray(obj.items)).toBe(false);\n      expect(obj.items[0]).toBe('apple');\n      expect(obj.items[1]).toBe('banana');\n      expect(obj.items.hello).toBe('there');\n    });\n\n    it('ignores non-integer keys on arrays', () => {\n      const fd = new FormData();\n      fd.append('items.0', 'apple');\n      fd.append('items.1', 'banana');\n      fd.append('items.hello', 'there');\n\n      const obj = formToObj(fd);\n\n      expect(Array.isArray(obj.items)).toBe(false);\n      expect(obj.items[0]).toBe('apple');\n      expect(obj.items[1]).toBe('banana');\n      expect(obj.items.hello).toBe('there');\n    });\n\n    it('still supports explicit [] syntax for arrays', () => {\n      const fd = new FormData();\n      fd.append('items[]', 'apple');\n      fd.append('items[]', 'banana');\n\n      const obj = formToObj(fd);\n\n      expect(Array.isArray(obj.items)).toBe(true);\n      expect(obj.items).toEqual(['apple', 'banana']);\n      expect(obj.items.length).toBe(2);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/generated/not-found-paths.ts",
    "content": "/**\n * DO NOT CHANGE THE EXACT VALUE OF `Resource Not Found`, THIS WILL BE REPLACED IN THE CODE LATER,\n * DEPENDING ON RUNTIME (e.g. DEV or PRODUCTION)\n */\nexport function getNotFound(_pathname: string) {\n  return 'Resource Not Found';\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/generated/static-paths.ts",
    "content": "/**\n * Generated function which returns whether a given request past is a static path.\n *\n * @param method\n * @param url\n * @returns\n */\nexport function isStaticPath(method: string, url: URL) {\n  if (method !== 'GET') {\n    return false;\n  }\n  if (url.search !== '') {\n    return false;\n  }\n\n  /**\n   * - Generated values in vite post build\n   *\n   * Const p = url.pathname;\n   *\n   * If (p.startsWith(baseBuildPath)) { return true; }\n   *\n   * If (p.startsWith(assetsPath)) { return true; }\n   *\n   * If (staticPaths.has(p)) { return true; }\n   *\n   * If (p.endsWith('/q-data.json')) { const pWithoutQdata = p.replace(//q-data.json$/, '');\n   *\n   * If (staticPaths.has(pWithoutQdata + '/')) { return true; }\n   *\n   * If (staticPaths.has(pWithoutQdata)) { return true; }\n   */\n\n  return /\\.(jpg|jpeg|png|webp|avif|gif|svg|ico)$/.test(url.pathname);\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/http-status-codes.ts",
    "content": "/**\n * Hypertext Transfer Protocol (HTTP) response status codes.\n *\n * @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}\n */\nexport enum HttpStatus {\n  /**\n   * The server has received the request headers and the client should proceed to send the request\n   * body (in the case of a request for which a body needs to be sent; for example, a POST request).\n   * Sending a large request body to a server after a request has been rejected for inappropriate\n   * headers would be inefficient. To have a server check the request's headers, a client must send\n   * Expect: 100-continue as a header in its initial request and receive a 100 Continue status code\n   * in response before sending the body. The response 417 Expectation Failed indicates the request\n   * should not be continued.\n   */\n  Continue = 100,\n\n  /** The requester has asked the server to switch protocols and the server has agreed to do so. */\n  SwitchingProtocols = 101,\n\n  /**\n   * A WebDAV request may contain many sub-requests involving file operations, requiring a long time\n   * to complete the request. This code indicates that the server has received and is processing the\n   * request, but no response is available yet. This prevents the client from timing out and\n   * assuming the request was lost.\n   */\n  Processing = 102,\n\n  /**\n   * Standard response for successful HTTP requests. The actual response will depend on the request\n   * method used. In a GET request, the response will contain an entity corresponding to the\n   * requested resource. In a POST request, the response will contain an entity describing or\n   * containing the result of the action.\n   */\n  Ok = 200,\n\n  /** The request has been fulfilled, resulting in the creation of a new resource. */\n  Created = 201,\n\n  /**\n   * The request has been accepted for processing, but the processing has not been completed. The\n   * request might or might not be eventually acted upon, and may be disallowed when processing\n   * occurs.\n   */\n  Accepted = 202,\n\n  /**\n   * SINCE HTTP/1.1 The server is a transforming proxy that received a 200 OK from its origin, but\n   * is returning a modified version of the origin's response.\n   */\n  NonAuthoritativeInformation = 203,\n\n  /** The server successfully processed the request and is not returning any content. */\n  NoContent = 204,\n\n  /**\n   * The server successfully processed the request, but is not returning any content. Unlike a 204\n   * response, this response requires that the requester reset the document view.\n   */\n  ResetContent = 205,\n\n  /**\n   * The server is delivering only part of the resource (byte serving) due to a range header sent by\n   * the client. The range header is used by HTTP clients to enable resuming of interrupted\n   * downloads, or split a download into multiple simultaneous streams.\n   */\n  PartialContent = 206,\n\n  /**\n   * The message body that follows is an XML message and can contain a number of separate response\n   * codes, depending on how many sub-requests were made.\n   */\n  MultiStatus = 207,\n\n  /**\n   * The members of a DAV binding have already been enumerated in a preceding part of the\n   * (multistatus) response, and are not being included again.\n   */\n  AlreadyReported = 208,\n\n  /**\n   * The server has fulfilled a request for the resource, and the response is a representation of\n   * the result of one or more instance-manipulations applied to the current instance.\n   */\n  ImUsed = 226,\n\n  /**\n   * Indicates multiple options for the resource from which the client may choose (via agent-driven\n   * content negotiation). For example, this code could be used to present multiple video format\n   * options, to list files with different filename extensions, or to suggest word-sense\n   * disambiguation.\n   */\n  MultipleChoices = 300,\n\n  /** This and all future requests should be directed to the given URI. */\n  MovedPermanently = 301,\n\n  /**\n   * This is an example of industry practice contradicting the standard. The HTTP/1.0 specification\n   * (RFC 1945) required the client to perform a temporary redirect (the original describing phrase\n   * was \"Moved Temporarily\"), but popular browsers implemented 302 with the functionality of a 303\n   * See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two\n   * behaviors. However, some Web applications and frameworks use the 302 status code as if it were\n   * the 303.\n   */\n  Found = 302,\n\n  /**\n   * SINCE HTTP/1.1 The response to the request can be found under another URI using a GET method.\n   * When received in response to a POST (or PUT/DELETE), the client should presume that the server\n   * has received the data and should issue a redirect with a separate GET message.\n   */\n  SeeOther = 303,\n\n  /**\n   * Indicates that the resource has not been modified since the version specified by the request\n   * headers If-Modified-Since or If-None-Match. In such case, there is no need to retransmit the\n   * resource since the client still has a previously-downloaded copy.\n   */\n  NotModified = 304,\n\n  /**\n   * SINCE HTTP/1.1 The requested resource is available only through a proxy, the address for which\n   * is provided in the response. Many HTTP clients (such as Mozilla and Internet Explorer) do not\n   * correctly handle responses with this status code, primarily for security reasons.\n   */\n  UseProxy = 305,\n\n  /** No longer used. Originally meant \"Subsequent requests should use the specified proxy.\" */\n  SwitchProxy = 306,\n\n  /**\n   * SINCE HTTP/1.1 In this case, the request should be repeated with another URI; however, future\n   * requests should still use the original URI. In contrast to how 302 was historically\n   * implemented, the request method is not allowed to be changed when reissuing the original\n   * request. For example, a POST request should be repeated using another POST request.\n   */\n  TemporaryRedirect = 307,\n\n  /**\n   * The request and all future requests should be repeated using another URI. 307 and 308 parallel\n   * the behaviors of 302 and 301, but do not allow the HTTP method to change. So, for example,\n   * submitting a form to a permanently redirected resource may continue smoothly.\n   */\n  PermanentRedirect = 308,\n\n  /**\n   * The server cannot or will not process the request due to an apparent client error (e.g.,\n   * malformed request syntax, too large size, invalid request message framing, or deceptive request\n   * routing).\n   */\n  BadRequest = 400,\n\n  /**\n   * Similar to 403 Forbidden, but specifically for use when authentication is required and has\n   * failed or has not yet been provided. The response must include a WWW-Authenticate header field\n   * containing a challenge applicable to the requested resource. See Basic access authentication\n   * and Digest access authentication. 401 semantically means \"unauthenticated\",i.e. the user does\n   * not have the necessary credentials.\n   */\n  Unauthorized = 401,\n\n  /**\n   * Reserved for future use. The original intention was that this code might be used as part of\n   * some form of digital cash or micro payment scheme, but that has not happened, and this code is\n   * not usually used. Google Developers API uses this status if a particular developer has exceeded\n   * the daily limit on requests.\n   */\n  PaymentRequired = 402,\n\n  /**\n   * The request was valid, but the server is refusing action. The user might not have the necessary\n   * permissions for a resource.\n   */\n  Forbidden = 403,\n\n  /**\n   * The requested resource could not be found but may be available in the future. Subsequent\n   * requests by the client are permissible.\n   */\n  NotFound = 404,\n\n  /**\n   * A request method is not supported for the requested resource; for example, a GET request on a\n   * form that requires data to be presented via POST, or a PUT request on a read-only resource.\n   */\n  MethodNotAllowed = 405,\n\n  /**\n   * The requested resource is capable of generating only content not acceptable according to the\n   * Accept headers sent in the request.\n   */\n  NotAcceptable = 406,\n\n  /** The client must first authenticate itself with the proxy. */\n  ProxyAuthenticationRequired = 407,\n\n  /**\n   * The server timed out waiting for the request. According to HTTP specifications: \"The client did\n   * not produce a request within the time that the server was prepared to wait. The client MAY\n   * repeat the request without modifications at any later time.\"\n   */\n  RequestTimeout = 408,\n\n  /**\n   * Indicates that the request could not be processed because of conflict in the request, such as\n   * an edit conflict between multiple simultaneous updates.\n   */\n  Conflict = 409,\n\n  /**\n   * Indicates that the resource requested is no longer available and will not be available again.\n   * This should be used when a resource has been intentionally removed and the resource should be\n   * purged. Upon receiving a 410 status code, the client should not request the resource in the\n   * future. Clients such as search engines should remove the resource from their indices. Most use\n   * cases do not require clients and search engines to purge the resource, and a \"404 Not Found\"\n   * may be used instead.\n   */\n  Gone = 410,\n\n  /**\n   * The request did not specify the length of its content, which is required by the requested\n   * resource.\n   */\n  LengthRequired = 411,\n\n  /** The server does not meet one of the preconditions that the requester put on the request. */\n  PreconditionFailed = 412,\n\n  /**\n   * The request is larger than the server is willing or able to process. Previously called \"Request\n   * Entity Too Large\".\n   */\n  PayloadTooLarge = 413,\n\n  /**\n   * The URI provided was too long for the server to process. Often the result of too much data\n   * being encoded as a query-string of a GET request, in which case it should be converted to a\n   * POST request. Called \"Request-URI Too Long\" previously.\n   */\n  UriTooLong = 414,\n\n  /**\n   * The request entity has a media type which the server or resource does not support. For example,\n   * the client uploads an image as image/svg+xml, but the server requires that images use a\n   * different format.\n   */\n  UnsupportedMediaType = 415,\n\n  /**\n   * The client has asked for a portion of the file (byte serving), but the server cannot supply\n   * that portion. For example, if the client asked for a part of the file that lies beyond the end\n   * of the file. Called \"Requested Range Not Satisfiable\" previously.\n   */\n  RangeNotSatisfiable = 416,\n\n  /** The server cannot meet the requirements of the Expect request-header field. */\n  ExpectationFailed = 417,\n\n  /**\n   * This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324,\n   * Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP\n   * servers. The RFC specifies this code should be returned by teapots requested to brew coffee.\n   * This HTTP status is used as an Easter egg in some websites, including Google.com.\n   */\n  IAmATeapot = 418,\n\n  /**\n   * The request was directed at a server that is not able to produce a response (for example\n   * because a connection reuse).\n   */\n  MisdirectedRequest = 421,\n\n  /** The request was well-formed but was unable to be followed due to semantic errors. */\n  UnprocessableEntity = 422,\n\n  /** The resource that is being accessed is locked. */\n  Locked = 423,\n\n  /** The request failed due to failure of a previous request (e.g., a PROPPATCH). */\n  FailedDependency = 424,\n\n  /**\n   * The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header\n   * field.\n   */\n  UpgradeRequired = 426,\n\n  /**\n   * The origin server requires the request to be conditional. Intended to prevent \"the 'lost\n   * update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the\n   * server, when meanwhile a third party has modified the state on the server, leading to a\n   * conflict.\"\n   */\n  PreconditionRequired = 428,\n\n  /**\n   * The user has sent too many requests in a given amount of time. Intended for use with\n   * rate-limiting schemes.\n   */\n  TooManyRequests = 429,\n\n  /**\n   * The server is unwilling to process the request because either an individual header field, or\n   * all the header fields collectively, are too large.\n   */\n  RequestHeaderFieldsTooLarge = 431,\n\n  /**\n   * A server operator has received a legal demand to deny access to a resource or to a set of\n   * resources that includes the requested resource. The code 451 was chosen as a reference to the\n   * novel Fahrenheit 451.\n   */\n  UnavailableForLegalReasons = 451,\n\n  /**\n   * A generic error message, given when an unexpected condition was encountered and no more\n   * specific message is suitable.\n   */\n  InternalServerError = 500,\n\n  /**\n   * The server either does not recognize the request method, or it lacks the ability to fulfill the\n   * request. Usually this implies future availability (e.g., a new feature of a web-service API).\n   */\n  NotImplemented = 501,\n\n  /**\n   * The server was acting as a gateway or proxy and received an invalid response from the upstream\n   * server.\n   */\n  BadGateway = 502,\n\n  /**\n   * The server is currently unavailable (because it is overloaded or down for maintenance).\n   * Generally, this is a temporary state.\n   */\n  ServiceUnavailable = 503,\n\n  /**\n   * The server was acting as a gateway or proxy and did not receive a timely response from the\n   * upstream server.\n   */\n  GatewayTimeout = 504,\n\n  /** The server does not support the HTTP protocol version used in the request */\n  HttpVersionNotSupported = 505,\n\n  /** Transparent content negotiation for the request results in a circular reference. */\n  VariantAlsoNegotiates = 506,\n\n  /** The server is unable to store the representation needed to complete the request. */\n  InsufficientStorage = 507,\n\n  /** The server detected an infinite loop while processing the request. */\n  LoopDetected = 508,\n\n  /** Further extensions to the request are required for the server to fulfill it. */\n  NotExtended = 510,\n\n  /**\n   * The client needs to authenticate to gain network access. Intended for use by intercepting\n   * proxies used to control access to the network (e.g., \"captive portals\" used to require\n   * agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).\n   */\n  NetworkAuthenticationRequired = 511,\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/index.ts",
    "content": "export { getErrorHtml } from './error-handler';\nexport { mergeHeadersCookies } from './cookie';\nexport { ServerError } from './server-error';\nexport { AbortMessage, RedirectMessage } from './redirect-handler';\nexport { RewriteMessage } from './rewrite-handler';\nexport { requestHandler } from './request-handler';\nexport { _TextEncoderStream_polyfill } from './polyfill';\nexport type {\n  CacheControl,\n  Cookie,\n  CookieOptions,\n  CookieValue,\n  ResolveValue,\n  ResolveSyncValue,\n  RequestEvent,\n  RequestEventLoader,\n  RequestEventAction,\n  RequestHandler,\n  RequestEventCommon,\n  ServerRequestMode,\n  ServerRenderOptions,\n  ServerRequestEvent,\n  ServerResponseHandler,\n  DeferReturn,\n  RequestEventBase,\n  ClientConn,\n  EnvGetter,\n} from './types';\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/middleware.request-handler.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { Action } from '@builder.io/qwik-city';\nimport type { _deserializeData } from '@builder.io/qwik';\nimport type { EnvGetter as EnvGetter_2 } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { FailReturn } from '@builder.io/qwik-city';\nimport type { Loader as Loader_2 } from '@builder.io/qwik-city';\nimport type { QwikCityPlan } from '@builder.io/qwik-city';\nimport type { QwikIntrinsicElements } from '@builder.io/qwik';\nimport type { Render } from '@builder.io/qwik/server';\nimport type { RenderOptions } from '@builder.io/qwik/server';\nimport type { RequestEvent as RequestEvent_2 } from '@builder.io/qwik-city';\nimport type { RequestHandler as RequestHandler_2 } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ResolveSyncValue as ResolveSyncValue_2 } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { _serializeData } from '@builder.io/qwik';\nimport type { ValueOrPromise } from '@builder.io/qwik';\nimport type { _verifySerializable } from '@builder.io/qwik';\n\n// @public (undocumented)\nexport class AbortMessage {\n}\n\n// Warning: (ae-forgotten-export) The symbol \"CacheControlOptions\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type CacheControl = CacheControlOptions | number | 'day' | 'week' | 'month' | 'year' | 'no-cache' | 'immutable' | 'private';\n\n// @public (undocumented)\nexport interface ClientConn {\n    // (undocumented)\n    country?: string;\n    // (undocumented)\n    ip?: string;\n}\n\n// @public (undocumented)\nexport interface Cookie {\n    append(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\n    delete(name: string, options?: Pick<CookieOptions, 'path' | 'domain' | 'sameSite'>): void;\n    get(name: string): CookieValue | null;\n    getAll(): Record<string, CookieValue>;\n    has(name: string): boolean;\n    headers(): string[];\n    set(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\n}\n\n// @public\nexport interface CookieOptions {\n    domain?: string;\n    expires?: Date | string;\n    httpOnly?: boolean;\n    maxAge?: number | [number, 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks'];\n    path?: string;\n    sameSite?: 'strict' | 'lax' | 'none' | 'Strict' | 'Lax' | 'None' | boolean;\n    secure?: boolean;\n}\n\n// @public (undocumented)\nexport interface CookieValue {\n    // (undocumented)\n    json: <T = unknown>() => T;\n    // (undocumented)\n    number: () => number;\n    // (undocumented)\n    value: string;\n}\n\n// @public (undocumented)\nexport type DeferReturn<T> = () => Promise<T>;\n\n// @public (undocumented)\nexport interface EnvGetter {\n    // (undocumented)\n    get(key: string): string | undefined;\n}\n\n// @public (undocumented)\nexport function getErrorHtml(status: number, e: any): string;\n\n// @public (undocumented)\nexport const mergeHeadersCookies: (headers: Headers, cookies: Cookie) => Headers;\n\n// @public (undocumented)\nexport class RedirectMessage extends AbortMessage {\n}\n\n// @public (undocumented)\nexport interface RequestEvent<PLATFORM = QwikCityPlatform> extends RequestEventCommon<PLATFORM> {\n    readonly exited: boolean;\n    readonly getWritableStream: () => WritableStream<Uint8Array>;\n    readonly headersSent: boolean;\n    readonly next: () => Promise<void>;\n}\n\n// @public (undocumented)\nexport interface RequestEventAction<PLATFORM = QwikCityPlatform> extends RequestEventCommon<PLATFORM> {\n    // (undocumented)\n    fail: <T extends Record<string, any>>(status: number, returnData: T) => FailReturn<T>;\n}\n\n// @public (undocumented)\nexport interface RequestEventBase<PLATFORM = QwikCityPlatform> {\n    readonly basePathname: string;\n    // Warning: (ae-forgotten-export) The symbol \"CacheControlTarget\" needs to be exported by the entry point index.d.ts\n    readonly cacheControl: (cacheControl: CacheControl, target?: CacheControlTarget) => void;\n    readonly clientConn: ClientConn;\n    readonly cookie: Cookie;\n    readonly env: EnvGetter;\n    readonly headers: Headers;\n    readonly method: string;\n    readonly originalUrl: URL;\n    readonly params: Readonly<Record<string, string>>;\n    readonly parseBody: () => Promise<unknown>;\n    readonly pathname: string;\n    readonly platform: PLATFORM;\n    readonly query: URLSearchParams;\n    readonly request: Request;\n    readonly sharedMap: Map<string, any>;\n    readonly signal: AbortSignal;\n    readonly url: URL;\n}\n\n// @public (undocumented)\nexport interface RequestEventCommon<PLATFORM = QwikCityPlatform> extends RequestEventBase<PLATFORM> {\n    // Warning: (ae-forgotten-export) The symbol \"ErrorCodes\" needs to be exported by the entry point index.d.ts\n    readonly error: <T = any>(statusCode: ErrorCodes, message: T) => ServerError<T>;\n    // (undocumented)\n    readonly exit: () => AbortMessage;\n    readonly html: (statusCode: StatusCodes, html: string) => AbortMessage;\n    readonly json: (statusCode: StatusCodes, data: any) => AbortMessage;\n    readonly locale: (local?: string) => string;\n    // Warning: (ae-forgotten-export) The symbol \"RedirectCode\" needs to be exported by the entry point index.d.ts\n    readonly redirect: (statusCode: RedirectCode, url: string) => RedirectMessage;\n    readonly rewrite: (pathname: string) => RewriteMessage;\n    // Warning: (ae-forgotten-export) The symbol \"SendMethod\" needs to be exported by the entry point index.d.ts\n    readonly send: SendMethod;\n    // Warning: (ae-forgotten-export) The symbol \"StatusCodes\" needs to be exported by the entry point index.d.ts\n    readonly status: (statusCode?: StatusCodes) => number;\n    readonly text: (statusCode: StatusCodes, text: string) => AbortMessage;\n}\n\n// @public (undocumented)\nexport interface RequestEventLoader<PLATFORM = QwikCityPlatform> extends RequestEventAction<PLATFORM> {\n    // (undocumented)\n    defer: <T>(returnData: Promise<T> | (() => Promise<T>)) => DeferReturn<T>;\n    // (undocumented)\n    resolveValue: ResolveValue;\n}\n\n// @public (undocumented)\nexport type RequestHandler<PLATFORM = QwikCityPlatform> = (ev: RequestEvent<PLATFORM>) => Promise<void> | void;\n\n// Warning: (ae-forgotten-export) The symbol \"QwikSerializer\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"QwikCityRun\" needs to be exported by the entry point index.d.ts\n//\n// @public\nexport function requestHandler<T = unknown>(serverRequestEv: ServerRequestEvent<T>, opts: ServerRenderOptions, qwikSerializer: QwikSerializer): Promise<QwikCityRun<T> | null>;\n\n// @public (undocumented)\nexport interface ResolveSyncValue {\n    // (undocumented)\n    <T>(loader: Loader_2<T>): Awaited<T> extends () => any ? never : Awaited<T>;\n    // (undocumented)\n    <T>(action: Action<T>): Awaited<T> | undefined;\n}\n\n// @public (undocumented)\nexport interface ResolveValue {\n    // (undocumented)\n    <T>(loader: Loader_2<T>): Awaited<T> extends () => any ? never : Promise<T>;\n    // (undocumented)\n    <T>(action: Action<T>): Promise<T | undefined>;\n}\n\n// @public (undocumented)\nexport class RewriteMessage extends AbortMessage {\n    constructor(pathname: string);\n    // (undocumented)\n    readonly pathname: string;\n}\n\n// @public (undocumented)\nexport class ServerError<T = any> extends Error {\n    constructor(status: number, data: T);\n    // (undocumented)\n    data: T;\n    // (undocumented)\n    status: number;\n}\n\n// @public (undocumented)\nexport interface ServerRenderOptions extends RenderOptions {\n    checkOrigin?: boolean | 'lax-proto';\n    // (undocumented)\n    qwikCityPlan: QwikCityPlan;\n    // (undocumented)\n    render: Render;\n}\n\n// @public\nexport interface ServerRequestEvent<T = unknown> {\n    // (undocumented)\n    env: EnvGetter;\n    // (undocumented)\n    getClientConn: () => ClientConn;\n    // (undocumented)\n    getWritableStream: ServerResponseHandler<T>;\n    // (undocumented)\n    locale: string | undefined;\n    // (undocumented)\n    mode: ServerRequestMode;\n    // (undocumented)\n    platform: QwikCityPlatform;\n    // (undocumented)\n    request: Request;\n    // (undocumented)\n    url: URL;\n}\n\n// @public (undocumented)\nexport type ServerRequestMode = 'dev' | 'static' | 'server';\n\n// Warning: (ae-forgotten-export) The symbol \"RequestEventInternal\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type ServerResponseHandler<T = any> = (status: number, headers: Headers, cookies: Cookie, resolve: (response: T) => void, requestEv: RequestEventInternal) => WritableStream<Uint8Array>;\n\n// @internal (undocumented)\nexport class _TextEncoderStream_polyfill {\n    // (undocumented)\n    get [Symbol.toStringTag](): string;\n    // (undocumented)\n    get encoding(): string;\n    // (undocumented)\n    get readable(): ReadableStream<Uint8Array>;\n    // (undocumented)\n    get writable(): WritableStream<string>;\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/mime-types.ts",
    "content": "/** Common mime types mapped to Content-Type headers */\nexport const MIME_TYPES: { [ext: string]: string } = {\n  '3gp': 'video/3gpp',\n  '3gpp': 'video/3gpp',\n  asf: 'video/x-ms-asf',\n  asx: 'video/x-ms-asf',\n  avi: 'video/x-msvideo',\n  avif: 'image/avif',\n  bmp: 'image/x-ms-bmp',\n  css: 'text/css',\n  flv: 'video/x-flv',\n  gif: 'image/gif',\n  htm: 'text/html',\n  html: 'text/html',\n  ico: 'image/x-icon',\n  jng: 'image/x-jng',\n  jpeg: 'image/jpeg',\n  jpg: 'image/jpeg',\n  js: 'application/javascript',\n  json: 'application/json',\n  kar: 'audio/midi',\n  m4a: 'audio/x-m4a',\n  m4v: 'video/x-m4v',\n  mid: 'audio/midi',\n  midi: 'audio/midi',\n  mng: 'video/x-mng',\n  mov: 'video/quicktime',\n  mp3: 'audio/mpeg',\n  mp4: 'video/mp4',\n  mpeg: 'video/mpeg',\n  mpg: 'video/mpeg',\n  ogg: 'audio/ogg',\n  pdf: 'application/pdf',\n  png: 'image/png',\n  rar: 'application/x-rar-compressed',\n  shtml: 'text/html',\n  svg: 'image/svg+xml',\n  svgz: 'image/svg+xml',\n  tif: 'image/tiff',\n  tiff: 'image/tiff',\n  ts: 'video/mp2t',\n  txt: 'text/plain',\n  wbmp: 'image/vnd.wap.wbmp',\n  webm: 'video/webm',\n  webp: 'image/webp',\n  wmv: 'video/x-ms-wmv',\n  woff: 'font/woff',\n  woff2: 'font/woff2',\n  xml: 'text/xml',\n  zip: 'application/zip',\n};\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/polyfill.ts",
    "content": "// Polyfill for TextEncoderStream\n\n/**\n * TextEncoderStream polyfill based on Node.js' implementation\n * https://github.com/nodejs/node/blob/3f3226c8e363a5f06c1e6a37abd59b6b8c1923f1/lib/internal/webstreams/encoding.js#L38-L119\n * (MIT License)\n */\n/** @internal */\nexport class _TextEncoderStream_polyfill {\n  #pendingHighSurrogate: string | null = null;\n\n  #handle = new TextEncoder();\n\n  #transform = new TransformStream<string, Uint8Array>({\n    transform: (chunk, controller) => {\n      // https://encoding.spec.whatwg.org/#encode-and-enqueue-a-chunk\n      chunk = String(chunk);\n\n      let finalChunk = '';\n      for (let i = 0; i < chunk.length; i++) {\n        const item = chunk[i];\n        const codeUnit = item.charCodeAt(0);\n\n        if (this.#pendingHighSurrogate !== null) {\n          const highSurrogate = this.#pendingHighSurrogate;\n\n          this.#pendingHighSurrogate = null;\n\n          if (0xdc00 <= codeUnit && codeUnit <= 0xdfff) {\n            finalChunk += highSurrogate + item;\n            continue;\n          }\n\n          finalChunk += '\\uFFFD';\n        }\n\n        if (0xd800 <= codeUnit && codeUnit <= 0xdbff) {\n          this.#pendingHighSurrogate = item;\n          continue;\n        }\n\n        if (0xdc00 <= codeUnit && codeUnit <= 0xdfff) {\n          finalChunk += '\\uFFFD';\n          continue;\n        }\n\n        finalChunk += item;\n      }\n\n      if (finalChunk) {\n        controller.enqueue(this.#handle.encode(finalChunk));\n      }\n    },\n\n    flush: (controller) => {\n      // https://encoding.spec.whatwg.org/#encode-and-flush\n      if (this.#pendingHighSurrogate !== null) {\n        controller.enqueue(new Uint8Array([0xef, 0xbf, 0xbd]));\n      }\n    },\n  });\n\n  get encoding() {\n    return this.#handle.encoding;\n  }\n\n  get readable() {\n    return this.#transform.readable;\n  }\n\n  get writable() {\n    return this.#transform.writable;\n  }\n\n  get [Symbol.toStringTag]() {\n    return 'TextEncoderStream';\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/polyfill.unit.ts",
    "content": "import { describe, it, expect } from 'vitest';\nimport { _TextEncoderStream_polyfill } from './polyfill';\n\ndescribe('_TextEncoderStream_polyfill tests', () => {\n  it('should encode string to Uint8Array', async () => {\n    const encoderStream = new _TextEncoderStream_polyfill();\n    const reader = encoderStream.readable.getReader();\n\n    encoderStream.writable.getWriter().write('hello');\n    const { value, done } = await reader.read();\n    expect(value).toBeInstanceOf(Uint8Array);\n    expect(new TextDecoder().decode(value)).toBe('hello');\n    expect(done).toBeFalsy();\n  });\n\n  it('should handle multiple chunks', async () => {\n    const encoderStream = new _TextEncoderStream_polyfill();\n    const encoderStream2 = new TextEncoderStream();\n    const writer = encoderStream.writable.getWriter();\n    const reader = encoderStream.readable.getReader();\n    const writer2 = encoderStream2.writable.getWriter();\n    const reader2 = encoderStream2.readable.getReader();\n\n    writer.write('hello');\n    writer.write(' world');\n    writer2.write('hello');\n    writer2.write(' world');\n\n    const results1 = [await reader.read(), await reader.read()];\n    const results2 = [await reader2.read(), await reader2.read()];\n    await writer.close();\n    await writer2.close();\n\n    expect(results1.length).toBe(results2.length);\n    expect(new TextDecoder().decode(results1[0].value)).toBe(\n      new TextDecoder().decode(results2[0].value)\n    );\n    expect(new TextDecoder().decode(results1[1].value)).toBe(\n      new TextDecoder().decode(results2[1].value)\n    );\n  });\n\n  it('encoding consistency with native TextEncoderStream', async () => {\n    const polyfillStream = new _TextEncoderStream_polyfill();\n    const nativeStream = new TextEncoderStream();\n    const testString = 'This is a test string.';\n\n    const polyReader = polyfillStream.readable.getReader();\n    const nativeReader = nativeStream.readable.getReader();\n\n    polyfillStream.writable.getWriter().write(testString);\n    nativeStream.writable.getWriter().write(testString);\n\n    const polyResult = await polyReader.read();\n    const nativeResult = await nativeReader.read();\n\n    expect(polyResult.value).toEqual(nativeResult.value);\n    expect(new TextDecoder().decode(polyResult.value)).toBe(testString);\n  });\n\n  it('handles non-string inputs', async () => {\n    const polyfillStream = new _TextEncoderStream_polyfill();\n    const nativeStream = new TextEncoderStream();\n\n    const nativeWriter = nativeStream.writable.getWriter();\n    const polyWriter = polyfillStream.writable.getWriter();\n\n    expect(polyWriter.write(123 as any)).toEqual(nativeWriter.write(123 as any));\n    expect(polyWriter.write({} as any)).toEqual(nativeWriter.write({} as any));\n  });\n\n  it(\"can encode emoji characters just the same as Node.js' implementation\", async () => {\n    const polyfillStream = new _TextEncoderStream_polyfill();\n    const nativeStream = new TextEncoderStream();\n\n    const input = '🦊test emoji encoding📦';\n\n    const polyReader = polyfillStream.readable.getReader();\n    const nativeReader = nativeStream.readable.getReader();\n\n    polyfillStream.writable.getWriter().write(input);\n    nativeStream.writable.getWriter().write(input);\n\n    const polyResult = await polyReader.read();\n    const nativeResult = await nativeReader.read();\n\n    expect(polyResult.value).toEqual(nativeResult.value);\n    expect(new TextDecoder().decode(polyResult.value)).toBe(input);\n  });\n\n  it('handles large input', async () => {\n    const encoderStream = new _TextEncoderStream_polyfill();\n    const writer = encoderStream.writable.getWriter();\n    const reader = encoderStream.readable.getReader();\n    const largeString = 'a'.repeat(10 ** 6); // 1 million characters\n\n    writer.write(largeString);\n    const { value } = await reader.read();\n    expect(value?.byteLength).toBe(largeString.length);\n  });\n\n  it('sequential writes and reads', async () => {\n    const encoderStream = new _TextEncoderStream_polyfill();\n    const writer = encoderStream.writable.getWriter();\n    const reader = encoderStream.readable.getReader();\n\n    writer.write('first');\n    writer.write('second');\n\n    const firstResult = await reader.read();\n    const secondResult = await reader.read();\n\n    await writer.close();\n\n    expect(new TextDecoder().decode(firstResult.value)).toBe('first');\n    expect(new TextDecoder().decode(secondResult.value)).toBe('second');\n  });\n\n  it('stream chaining', async () => {\n    const encoderStream = new _TextEncoderStream_polyfill();\n    const transformStream = new TransformStream({\n      transform(chunk, controller) {\n        controller.enqueue(chunk);\n      },\n    });\n\n    const writer = encoderStream.writable.getWriter();\n    const chainedStream = encoderStream.readable.pipeThrough(transformStream);\n    const reader = chainedStream.getReader();\n\n    writer.write('test chaining');\n    const result = await reader.read();\n    expect(new TextDecoder().decode(result.value)).toBe('test chaining');\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/redirect-handler.ts",
    "content": "/** @public */\nexport class AbortMessage {}\n\n/** @public */\nexport class RedirectMessage extends AbortMessage {}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/request-event.ts",
    "content": "import type { ValueOrPromise } from '@builder.io/qwik';\nimport { QDATA_KEY } from '../../runtime/src/constants';\nimport type {\n  ActionInternal,\n  FailReturn,\n  JSONValue,\n  LoadedRoute,\n  LoaderInternal,\n} from '../../runtime/src/types';\nimport { isPromise } from './../../runtime/src/utils';\nimport { createCacheControl } from './cache-control';\nimport { Cookie } from './cookie';\n// Import separately to avoid duplicate imports in the vite dev server\nimport {\n  AbortMessage,\n  RedirectMessage,\n  ServerError,\n  RewriteMessage,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { encoder, getContentType } from './resolve-request-handlers';\nimport type {\n  CacheControl,\n  CacheControlTarget,\n  QwikSerializer,\n  RequestEvent,\n  RequestEventCommon,\n  RequestEventLoader,\n  RequestHandler,\n  ResolveValue,\n  ServerRequestEvent,\n  ServerRequestMode,\n} from './types';\nimport { IsQData, getRouteMatchPathname } from './user-response';\n\nconst RequestEvLoaders = Symbol('RequestEvLoaders');\nconst RequestEvMode = Symbol('RequestEvMode');\nconst RequestEvRoute = Symbol('RequestEvRoute');\nexport const RequestEvQwikSerializer = Symbol('RequestEvQwikSerializer');\nexport const RequestEvTrailingSlash = Symbol('RequestEvTrailingSlash');\nexport const RequestRouteName = '@routeName';\nexport const RequestEvSharedActionId = '@actionId';\nexport const RequestEvSharedActionFormData = '@actionFormData';\nexport const RequestEvSharedNonce = '@nonce';\nexport const RequestEvIsRewrite = '@rewrite';\n\nexport function createRequestEvent(\n  serverRequestEv: ServerRequestEvent,\n  loadedRoute: LoadedRoute | null,\n  requestHandlers: RequestHandler<any>[],\n  trailingSlash: boolean,\n  basePathname: string,\n  qwikSerializer: QwikSerializer,\n  resolved: (response: any) => void\n) {\n  const { request, platform, env } = serverRequestEv;\n\n  const sharedMap = new Map();\n  const cookie = new Cookie(request.headers.get('cookie'));\n  const headers = new Headers();\n  const url = new URL(request.url);\n  const { pathname, isInternal } = getRouteMatchPathname(url.pathname, trailingSlash);\n  if (isInternal) {\n    // For the middleware callbacks we pretend it's a regular request\n    url.pathname = pathname;\n    // But we set this flag so that they can act differently\n    sharedMap.set(IsQData, true);\n  }\n\n  let routeModuleIndex = -1;\n  let writableStream: WritableStream<Uint8Array> | null = null;\n  let requestData: Promise<JSONValue | undefined> | undefined = undefined;\n  let locale = serverRequestEv.locale;\n  let status = 200;\n\n  const next = async () => {\n    routeModuleIndex++;\n\n    while (routeModuleIndex < requestHandlers.length) {\n      const moduleRequestHandler = requestHandlers[routeModuleIndex];\n      const asyncStore = globalThis.qcAsyncRequestStore;\n      const result = asyncStore?.run\n        ? asyncStore.run(requestEv, moduleRequestHandler, requestEv)\n        : moduleRequestHandler(requestEv);\n      if (isPromise(result)) {\n        await result;\n      }\n      routeModuleIndex++;\n    }\n  };\n\n  const resetRoute = (\n    _loadedRoute: LoadedRoute | null,\n    _requestHandlers: RequestHandler<any>[],\n    _url = url\n  ) => {\n    loadedRoute = _loadedRoute;\n    requestHandlers = _requestHandlers;\n    url.pathname = _url.pathname;\n    url.search = _url.search;\n    routeModuleIndex = -1;\n  };\n\n  const check = () => {\n    if (writableStream !== null) {\n      throw new Error('Response already sent');\n    }\n  };\n\n  const send = (statusOrResponse: number | Response, body: string | Uint8Array) => {\n    check();\n    if (typeof statusOrResponse === 'number') {\n      status = statusOrResponse;\n      const writableStream = requestEv.getWritableStream();\n      const writer = writableStream.getWriter();\n      writer.write(typeof body === 'string' ? encoder.encode(body) : body);\n      writer.close();\n    } else {\n      status = statusOrResponse.status;\n      statusOrResponse.headers.forEach((value, key) => {\n        if (key.toLowerCase() === 'set-cookie') {\n          return;\n        }\n        headers.append(key, value);\n      });\n      statusOrResponse.headers.getSetCookie().forEach((ck) => {\n        const index = ck.indexOf('=');\n        if (index === -1) {\n          return;\n        }\n        const key = ck.slice(0, index).trim();\n        const value = ck.slice(index + 1).trim();\n        cookie.set(key, value);\n      });\n      if (statusOrResponse.body) {\n        const writableStream = requestEv.getWritableStream();\n        statusOrResponse.body.pipeTo(writableStream);\n      } else {\n        requestEv.getWritableStream().getWriter().close();\n      }\n    }\n    return exit();\n  };\n\n  const exit = () => {\n    routeModuleIndex = ABORT_INDEX;\n    return new AbortMessage();\n  };\n\n  const loaders: Record<string, Promise<any>> = {};\n  const requestEv: RequestEventInternal = {\n    [RequestEvLoaders]: loaders,\n    [RequestEvMode]: serverRequestEv.mode,\n    [RequestEvTrailingSlash]: trailingSlash,\n    get [RequestEvRoute]() {\n      return loadedRoute;\n    },\n    [RequestEvQwikSerializer]: qwikSerializer,\n    cookie,\n    headers,\n    env,\n    method: request.method,\n    signal: request.signal,\n    originalUrl: new URL(url),\n    get params() {\n      return loadedRoute?.[1] ?? {};\n    },\n    get pathname() {\n      return url.pathname;\n    },\n    platform,\n    get query() {\n      return url.searchParams;\n    },\n    request,\n    url,\n    basePathname,\n    sharedMap,\n    get headersSent() {\n      return writableStream !== null;\n    },\n    get exited() {\n      return routeModuleIndex >= ABORT_INDEX;\n    },\n    get clientConn() {\n      return serverRequestEv.getClientConn();\n    },\n\n    next,\n\n    resetRoute,\n\n    exit,\n\n    cacheControl: (cacheControl: CacheControl, target: CacheControlTarget = 'Cache-Control') => {\n      check();\n      headers.set(target, createCacheControl(cacheControl));\n    },\n\n    resolveValue: (async (loaderOrAction: LoaderInternal | ActionInternal) => {\n      // create user request event, which is a narrowed down request context\n      const id = loaderOrAction.__id;\n      if (loaderOrAction.__brand === 'server_loader') {\n        if (!(id in loaders)) {\n          throw new Error(\n            'You can not get the returned data of a loader that has not been executed for this request.'\n          );\n        }\n      }\n\n      return loaders[id];\n    }) as ResolveValue,\n\n    status: (statusCode?: number) => {\n      if (typeof statusCode === 'number') {\n        check();\n        status = statusCode;\n        return statusCode;\n      }\n      return status;\n    },\n\n    locale: (_locale?: string) => {\n      if (typeof _locale === 'string') {\n        locale = _locale;\n      }\n      return locale || '';\n    },\n\n    error: <T = any>(statusCode: number, message: T) => {\n      status = statusCode;\n      headers.delete('Cache-Control');\n      return new ServerError(statusCode, message);\n    },\n\n    redirect: (statusCode: number, url: string) => {\n      check();\n      status = statusCode;\n      if (url) {\n        if (\n          // //test.com\n          /^\\/\\//.test(url) ||\n          // /test//path\n          /([^:])\\/\\/+/.test(url)\n        ) {\n          const fixedURL = url.replace(/^\\/\\/+/, '/').replace(/([^:])\\/\\/+/g, '$1/');\n          console.warn(`Redirect URL ${url} is invalid, fixing to ${fixedURL}`);\n          url = fixedURL;\n        }\n        headers.set('Location', url);\n      }\n      headers.delete('Cache-Control');\n      if (statusCode > 301) {\n        headers.set('Cache-Control', 'no-store');\n      }\n\n      routeModuleIndex = ABORT_INDEX;\n      return new RedirectMessage();\n    },\n\n    rewrite: (pathname: string) => {\n      check();\n      if (pathname.startsWith('http')) {\n        throw new Error('Rewrite does not support absolute urls');\n      }\n      sharedMap.set(RequestEvIsRewrite, true);\n      return new RewriteMessage(pathname.replace(/\\/+/g, '/'));\n    },\n\n    defer: (returnData) => {\n      return typeof returnData === 'function' ? returnData : () => returnData;\n    },\n\n    fail: <T extends Record<string, any>>(statusCode: number, data: T): FailReturn<T> => {\n      check();\n      status = statusCode;\n      headers.delete('Cache-Control');\n      return {\n        failed: true,\n        ...data,\n      };\n    },\n\n    text: (statusCode: number, text: string) => {\n      headers.set('Content-Type', 'text/plain; charset=utf-8');\n      return send(statusCode, text);\n    },\n\n    html: (statusCode: number, html: string) => {\n      headers.set('Content-Type', 'text/html; charset=utf-8');\n      return send(statusCode, html);\n    },\n\n    parseBody: async () => {\n      if (requestData !== undefined) {\n        return requestData;\n      }\n      return (requestData = parseRequest(requestEv, sharedMap, qwikSerializer));\n    },\n\n    json: (statusCode: number, data: any) => {\n      headers.set('Content-Type', 'application/json; charset=utf-8');\n      return send(statusCode, JSON.stringify(data));\n    },\n\n    send: send as any,\n\n    isDirty: () => {\n      return writableStream !== null;\n    },\n\n    getWritableStream: () => {\n      if (writableStream === null) {\n        if (serverRequestEv.mode === 'dev') {\n          const serverTiming = sharedMap.get('@serverTiming') as [string, number][] | undefined;\n          if (serverTiming) {\n            headers.set('Server-Timing', serverTiming.map((a) => `${a[0]};dur=${a[1]}`).join(','));\n          }\n        }\n        writableStream = serverRequestEv.getWritableStream(\n          status,\n          headers,\n          cookie,\n          resolved,\n          requestEv\n        );\n      }\n      return writableStream;\n    },\n  };\n  return requestEv;\n}\n\nexport interface RequestEventInternal extends Readonly<RequestEvent>, Readonly<RequestEventLoader> {\n  readonly [RequestEvLoaders]: Record<string, ValueOrPromise<unknown> | undefined>;\n  readonly [RequestEvMode]: ServerRequestMode;\n  readonly [RequestEvTrailingSlash]: boolean;\n  readonly [RequestEvRoute]: LoadedRoute | null;\n  readonly [RequestEvQwikSerializer]: QwikSerializer;\n\n  /**\n   * Check if this request is already written to.\n   *\n   * @returns `true`, if `getWritableStream()` has already been called.\n   */\n  isDirty(): boolean;\n\n  /**\n   * Reset the request event to the given route data.\n   *\n   * @param loadedRoute - The new loaded route.\n   * @param requestHandlers - The new request handlers.\n   * @param url - The new URL of the route.\n   */\n  resetRoute(\n    loadedRoute: LoadedRoute | null,\n    requestHandlers: RequestHandler<any>[],\n    url: URL\n  ): void;\n}\n\nexport function getRequestLoaders(requestEv: RequestEventCommon) {\n  return (requestEv as RequestEventInternal)[RequestEvLoaders];\n}\n\nexport function getRequestTrailingSlash(requestEv: RequestEventCommon) {\n  return (requestEv as RequestEventInternal)[RequestEvTrailingSlash];\n}\n\nexport function getRequestRoute(requestEv: RequestEventCommon) {\n  return (requestEv as RequestEventInternal)[RequestEvRoute];\n}\n\nexport function getRequestMode(requestEv: RequestEventCommon) {\n  return (requestEv as RequestEventInternal)[RequestEvMode];\n}\n\nconst ABORT_INDEX = Number.MAX_SAFE_INTEGER;\n\nconst parseRequest = async (\n  { request, method, query }: RequestEventInternal,\n  sharedMap: Map<string, any>,\n  qwikSerializer: QwikSerializer\n): Promise<JSONValue | undefined> => {\n  const type = getContentType(request.headers);\n  if (type === 'application/x-www-form-urlencoded' || type === 'multipart/form-data') {\n    const formData = await request.formData();\n    sharedMap.set(RequestEvSharedActionFormData, formData);\n    return formToObj(formData);\n  } else if (type === 'application/json') {\n    const data = await request.json();\n    return data;\n  } else if (type === 'application/qwik-json') {\n    if (method === 'GET' && query.has(QDATA_KEY)) {\n      const data = query.get(QDATA_KEY);\n      if (data) {\n        try {\n          return qwikSerializer._deserializeData(decodeURIComponent(data));\n        } catch (err) {\n          //\n        }\n      }\n    }\n    return qwikSerializer._deserializeData(await request.text());\n  }\n  return undefined;\n};\n\nconst isDangerousKey = (k: string) => k === '__proto__' || k === 'constructor' || k === 'prototype';\nconst isArrayIndexKey = (k: string) => /^(0|[1-9]\\d*)$/.test(k);\n\nconst getArrayPaths = (formData: FormData) => {\n  const arrayCandidates = new Map<string, boolean>();\n\n  for (const [name] of formData) {\n    const keys = name.split('.');\n    let hasDangerousKey = false;\n\n    for (const key of keys) {\n      if (isDangerousKey(key)) {\n        hasDangerousKey = true;\n        break;\n      }\n    }\n\n    if (hasDangerousKey) {\n      continue;\n    }\n\n    let path = '';\n    for (let i = 0; i < keys.length - 1; i++) {\n      const key = keys[i];\n      if (key.endsWith('[]')) {\n        break;\n      }\n\n      path = path ? `${path}.${key}` : key;\n      if (!arrayCandidates.has(path)) {\n        arrayCandidates.set(path, true);\n      }\n      if (!isArrayIndexKey(keys[i + 1])) {\n        arrayCandidates.set(path, false);\n      }\n    }\n  }\n\n  return new Set(\n    Array.from(arrayCandidates.entries())\n      .filter(([, isArrayPath]) => isArrayPath)\n      .map(([path]) => path)\n  );\n};\n\nexport const formToObj = (formData: FormData): Record<string, any> => {\n  /**\n   * Convert FormData to object Handle nested form input using dot notation Handle array input using\n   * indexed dot notation (name.0, name.0) or bracket notation (name[]), the later is needed for\n   * multiselects Create values object by form data entries\n   */\n  const values = Object.create(null);\n  const arrayPaths = getArrayPaths(formData);\n\n  for (const [name, value] of formData) {\n    const keys = name.split('.');\n    let hasDangerousKey = false;\n\n    for (let i = 0; i < keys.length; i++) {\n      if (isDangerousKey(keys[i])) {\n        hasDangerousKey = true;\n        break;\n      }\n    }\n\n    if (hasDangerousKey) {\n      continue;\n    }\n\n    let object = values;\n    let path = '';\n    for (let i = 0; i < keys.length; i++) {\n      const key = keys[i];\n\n      // Bracket notation for arrays, notably for multi selects\n      if (key.endsWith('[]')) {\n        const arrayKey = key.slice(0, -2);\n        if (isDangerousKey(arrayKey)) {\n          break;\n        }\n        const existingValue = object[arrayKey];\n        if (existingValue !== undefined && !Array.isArray(existingValue)) {\n          break;\n        }\n        object[arrayKey] = existingValue || [];\n        object[arrayKey].push(value);\n        break;\n      }\n\n      if (Array.isArray(object) && !isArrayIndexKey(key)) {\n        break;\n      }\n\n      // If it is not last index, return nested object or array\n      if (i < keys.length - 1) {\n        path = path ? `${path}.${key}` : key;\n        const nextValue = object[key];\n        if (nextValue !== undefined) {\n          object = nextValue;\n          continue;\n        }\n\n        object = object[key] = arrayPaths.has(path) ? [] : Object.create(null);\n      } else {\n        object[key] = value;\n      }\n    }\n  }\n\n  // Return values object\n  return values;\n};\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/request-event.unit.ts",
    "content": "import { describe, it, expect, vi } from 'vitest';\nimport { createRequestEvent } from './request-event';\nimport { RedirectMessage } from './redirect-handler';\nimport type { ServerRequestEvent, QwikSerializer } from './types';\n\nconst mockQwikSerializer: QwikSerializer = {\n  _deserializeData: vi.fn(),\n  _serializeData: vi.fn(),\n  _verifySerializable: vi.fn(),\n};\n\nfunction createMockServerRequestEvent(url = 'http://localhost:3000/test'): ServerRequestEvent {\n  const mockRequest = new Request(url);\n\n  return {\n    mode: 'server',\n    url: new URL(url),\n    locale: undefined,\n    platform: {},\n    request: mockRequest,\n    env: {\n      get: vi.fn(),\n    },\n    getClientConn: vi.fn(() => ({ ip: '127.0.0.1' })),\n    getWritableStream: vi.fn(() => {\n      const writer = {\n        write: vi.fn(),\n        close: vi.fn(),\n      };\n      return {\n        getWriter: () => writer,\n        locked: false,\n        pipeTo: vi.fn(),\n      } as any;\n    }),\n  };\n}\n\nfunction createMockRequestEvent(url = 'http://localhost:3000/test') {\n  const serverRequestEv = createMockServerRequestEvent(url);\n  return createRequestEvent(serverRequestEv, null, [], true, '/', mockQwikSerializer, vi.fn());\n}\n\ndescribe('request-event redirect', () => {\n  it('should not cache redirects by default', () => {\n    const requestEv = createMockRequestEvent();\n\n    requestEv.headers.set('Cache-Control', 'max-age=3600, public');\n\n    const result = requestEv.redirect(301, '/new-location');\n\n    expect(result).toBeInstanceOf(RedirectMessage);\n    expect(requestEv.headers.get('Location')).toBe('/new-location');\n    expect(requestEv.headers.get('Cache-Control')).toBeNull();\n    expect(requestEv.status()).toBe(301);\n  });\n\n  it('should set Cache-Control to no-store for redirects with status > 301', () => {\n    const requestEv = createMockRequestEvent();\n\n    const result = requestEv.redirect(307, '/new-location');\n\n    expect(result).toBeInstanceOf(RedirectMessage);\n    expect(requestEv.headers.get('Location')).toBe('/new-location');\n    expect(requestEv.headers.get('Cache-Control')).toBe('no-store');\n    expect(requestEv.status()).toBe(307);\n  });\n\n  it('should fix invalid redirect URLs with multiple slashes', () => {\n    const requestEv = createMockRequestEvent();\n\n    const consoleSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});\n\n    const result = requestEv.redirect(302, '/path//with///multiple////slashes');\n\n    expect(result).toBeInstanceOf(RedirectMessage);\n    expect(requestEv.headers.get('Location')).toBe('/path/with/multiple/slashes');\n    expect(consoleSpy).toHaveBeenCalledWith(\n      'Redirect URL /path//with///multiple////slashes is invalid, fixing to /path/with/multiple/slashes'\n    );\n  });\n\n  it('should fix protocol-relative URL redirects starting with //', () => {\n    const requestEv = createMockRequestEvent();\n\n    const consoleSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});\n\n    const result = requestEv.redirect(302, '//evil.com');\n\n    expect(result).toBeInstanceOf(RedirectMessage);\n    expect(requestEv.headers.get('Location')).toBe('/evil.com');\n    expect(consoleSpy).toHaveBeenCalledWith(\n      'Redirect URL //evil.com is invalid, fixing to /evil.com'\n    );\n  });\n\n  it('should fix protocol-relative URL redirects with trailing path', () => {\n    const requestEv = createMockRequestEvent();\n\n    const consoleSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});\n\n    const result = requestEv.redirect(302, '//evil.com/path');\n\n    expect(result).toBeInstanceOf(RedirectMessage);\n    expect(requestEv.headers.get('Location')).toBe('/evil.com/path');\n    expect(consoleSpy).toHaveBeenCalledWith(\n      'Redirect URL //evil.com/path is invalid, fixing to /evil.com/path'\n    );\n  });\n\n  it('should fix URLs with multiple leading slashes', () => {\n    const requestEv = createMockRequestEvent();\n\n    const consoleSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});\n\n    const result = requestEv.redirect(302, '////evil.com');\n\n    expect(result).toBeInstanceOf(RedirectMessage);\n    expect(requestEv.headers.get('Location')).toBe('/evil.com');\n    expect(consoleSpy).toHaveBeenCalledWith(\n      'Redirect URL ////evil.com is invalid, fixing to /evil.com'\n    );\n  });\n\n  it('should preserve valid URLs with protocols', () => {\n    const requestEv = createMockRequestEvent();\n\n    const consoleSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});\n\n    const result = requestEv.redirect(302, 'https://qwik.dev');\n\n    expect(result).toBeInstanceOf(RedirectMessage);\n    expect(requestEv.headers.get('Location')).toBe('https://qwik.dev');\n    expect(consoleSpy).not.toHaveBeenCalled();\n  });\n\n  it('should throw error when trying to redirect after headers are sent', () => {\n    const requestEv = createMockRequestEvent();\n\n    // Trigger getWritableStream to simulate headers being sent\n    requestEv.getWritableStream();\n\n    expect(() => {\n      requestEv.redirect(302, '/should-fail');\n    }).toThrow('Response already sent');\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/request-handler.ts",
    "content": "import type { Render } from '@builder.io/qwik/server';\nimport { loadRoute } from '../../runtime/src/routing';\nimport type { RebuildRouteInfoInternal, QwikCityPlan } from '../../runtime/src/types';\nimport { renderQwikMiddleware, resolveRequestHandlers } from './resolve-request-handlers';\nimport type { QwikSerializer, ServerRenderOptions, ServerRequestEvent } from './types';\nimport { getRouteMatchPathname, runQwikCity, type QwikCityRun } from './user-response';\n\n/**\n * The request handler for QwikCity. Called by every integration.\n *\n * @public\n */\nexport async function requestHandler<T = unknown>(\n  serverRequestEv: ServerRequestEvent<T>,\n  opts: ServerRenderOptions,\n  qwikSerializer: QwikSerializer\n): Promise<QwikCityRun<T> | null> {\n  const { render, qwikCityPlan, checkOrigin } = opts;\n  const { pathname, isInternal } = getRouteMatchPathname(\n    serverRequestEv.url.pathname,\n    qwikCityPlan.trailingSlash\n  );\n  const routeAndHandlers = await loadRequestHandlers(\n    qwikCityPlan,\n    pathname,\n    serverRequestEv.request.method,\n    checkOrigin ?? true,\n    render,\n    isInternal\n  );\n\n  if (routeAndHandlers) {\n    const [route, requestHandlers] = routeAndHandlers;\n\n    const rebuildRouteInfo: RebuildRouteInfoInternal = async (url: URL) => {\n      // once internal, always internal, don't override\n      const { pathname } = getRouteMatchPathname(url.pathname, qwikCityPlan.trailingSlash);\n      const routeAndHandlers = await loadRequestHandlers(\n        qwikCityPlan,\n        pathname,\n        serverRequestEv.request.method,\n        checkOrigin ?? true,\n        render,\n        isInternal\n      );\n\n      if (routeAndHandlers) {\n        const [loadedRoute, requestHandlers] = routeAndHandlers;\n        return { loadedRoute, requestHandlers };\n      } else {\n        return { loadedRoute: null, requestHandlers: [] };\n      }\n    };\n\n    return runQwikCity(\n      serverRequestEv,\n      route,\n      requestHandlers,\n      rebuildRouteInfo,\n      qwikCityPlan.trailingSlash,\n      qwikCityPlan.basePathname,\n      qwikSerializer\n    );\n  }\n  return null;\n}\n\nasync function loadRequestHandlers(\n  qwikCityPlan: QwikCityPlan,\n  pathname: string,\n  method: string,\n  checkOrigin: boolean | 'lax-proto',\n  renderFn: Render,\n  isInternal: boolean\n) {\n  const { routes, serverPlugins, menus, cacheModules } = qwikCityPlan;\n  const route = await loadRoute(routes, menus, cacheModules, pathname, isInternal);\n  const requestHandlers = resolveRequestHandlers(\n    serverPlugins,\n    route,\n    method,\n    checkOrigin,\n    renderQwikMiddleware(renderFn),\n    isInternal\n  );\n  if (requestHandlers.length > 0) {\n    return [route, requestHandlers] as const;\n  }\n  return null;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/resolve-request-handlers.ts",
    "content": "import type { QRL } from '@builder.io/qwik';\nimport type { Render, RenderToStringResult } from '@builder.io/qwik/server';\nimport { QACTION_KEY, QFN_KEY } from '../../runtime/src/constants';\nimport type {\n  ActionInternal,\n  ClientPageData,\n  DataValidator,\n  JSONObject,\n  LoadedRoute,\n  LoaderInternal,\n  PageModule,\n  RouteModule,\n  ValidatorReturn,\n} from '../../runtime/src/types';\nimport { HttpStatus } from './http-status-codes';\nimport {\n  RequestEvQwikSerializer,\n  RequestEvIsRewrite,\n  RequestEvSharedActionId,\n  RequestRouteName,\n  getRequestLoaders,\n  getRequestMode,\n  getRequestTrailingSlash,\n  type RequestEventInternal,\n} from './request-event';\nimport { getQwikCityServerData } from './response-page';\nimport type {\n  ErrorCodes,\n  QwikSerializer,\n  RequestEvent,\n  RequestEventBase,\n  RequestHandler,\n} from './types';\nimport { IsQData, QDATA_JSON } from './user-response';\n// Import separately to avoid duplicate imports in the vite dev server\nimport { RedirectMessage, ServerError } from '@builder.io/qwik-city/middleware/request-handler';\n\n/**\n * This generates the handlers that will be run. They run in the order they are defined. If one\n * calls `.exit()`, the rest of the handlers will be skipped.\n *\n * By awaiting `.next()`, handlers can wait for all subsequent handlers to complete before\n * continuing.\n */\nexport const resolveRequestHandlers = (\n  serverPlugins: RouteModule[] | undefined,\n  route: LoadedRoute | null,\n  method: string,\n  checkOrigin: boolean | 'lax-proto',\n  renderHandler: RequestHandler,\n  isInternal: boolean\n) => {\n  const routeLoaders: LoaderInternal[] = [];\n  const routeActions: ActionInternal[] = [];\n\n  const requestHandlers: RequestHandler[] = [];\n\n  const isPageRoute = !!(route && isLastModulePageRoute(route[2]));\n\n  // Always handle QData redirects (server plugins might redirect)\n  if (isInternal) {\n    requestHandlers.push(handleQDataRedirect);\n  }\n\n  if (serverPlugins) {\n    // Serverplugins run even if no route is matched\n    _resolveRequestHandlers(\n      routeLoaders,\n      routeActions,\n      requestHandlers,\n      serverPlugins,\n      isPageRoute,\n      method\n    );\n  }\n\n  if (route) {\n    const routeName = route[0];\n    if (\n      checkOrigin &&\n      (method === 'POST' || method === 'PUT' || method === 'PATCH' || method === 'DELETE')\n    ) {\n      if (checkOrigin === 'lax-proto') {\n        requestHandlers.unshift(csrfLaxProtoCheckMiddleware);\n      } else {\n        requestHandlers.unshift(csrfCheckMiddleware);\n      }\n    }\n    if (isPageRoute) {\n      // `server$()` can only be called from existing page routes\n      if (method === 'POST' || method === 'GET') {\n        requestHandlers.push(runServerFunction);\n      }\n\n      // Note that we don't care about trailing slash on `server$()` calls\n      requestHandlers.push(fixTrailingSlash);\n\n      // If this is a QData request, we short-circuit after running all the loaders/middleware\n      if (isInternal) {\n        requestHandlers.push(renderQData);\n      }\n    }\n    const routeModules = route[2];\n    _resolveRequestHandlers(\n      routeLoaders,\n      routeActions,\n      requestHandlers,\n      routeModules,\n      isPageRoute,\n      method\n    );\n    if (isPageRoute) {\n      requestHandlers.push((ev) => {\n        // Set the current route name\n        ev.sharedMap.set(RequestRouteName, routeName);\n      });\n      requestHandlers.push(actionsMiddleware(routeActions, routeLoaders) as any);\n      requestHandlers.push(renderHandler);\n    }\n  }\n\n  return requestHandlers;\n};\n\nconst _resolveRequestHandlers = (\n  routeLoaders: LoaderInternal[],\n  routeActions: ActionInternal[],\n  requestHandlers: RequestHandler[],\n  routeModules: RouteModule[],\n  collectActions: boolean,\n  method: string\n) => {\n  for (const routeModule of routeModules) {\n    if (typeof routeModule.onRequest === 'function') {\n      requestHandlers.push(routeModule.onRequest);\n    } else if (Array.isArray(routeModule.onRequest)) {\n      requestHandlers.push(...routeModule.onRequest);\n    }\n\n    let methodReqHandler: RequestHandler | RequestHandler[] | undefined;\n    switch (method) {\n      case 'GET': {\n        methodReqHandler = routeModule.onGet;\n        break;\n      }\n      case 'POST': {\n        methodReqHandler = routeModule.onPost;\n        break;\n      }\n      case 'PUT': {\n        methodReqHandler = routeModule.onPut;\n        break;\n      }\n      case 'PATCH': {\n        methodReqHandler = routeModule.onPatch;\n        break;\n      }\n      case 'DELETE': {\n        methodReqHandler = routeModule.onDelete;\n        break;\n      }\n      case 'OPTIONS': {\n        methodReqHandler = routeModule.onOptions;\n        break;\n      }\n      case 'HEAD': {\n        methodReqHandler = routeModule.onHead;\n        break;\n      }\n    }\n\n    if (typeof methodReqHandler === 'function') {\n      requestHandlers.push(methodReqHandler);\n    } else if (Array.isArray(methodReqHandler)) {\n      requestHandlers.push(...methodReqHandler);\n    }\n\n    if (collectActions) {\n      for (const module of Object.values(routeModule)) {\n        if (typeof module === 'function') {\n          if (module.__brand === 'server_loader') {\n            routeLoaders.push(module as LoaderInternal);\n          } else if (module.__brand === 'server_action') {\n            routeActions.push(module as ActionInternal);\n          }\n        }\n      }\n    }\n  }\n};\n\nexport const checkBrand = (obj: any, brand: string) => {\n  return obj && typeof obj === 'function' && obj.__brand === brand;\n};\n\nexport function actionsMiddleware(routeActions: ActionInternal[], routeLoaders: LoaderInternal[]) {\n  return async (requestEv: RequestEventInternal) => {\n    if (requestEv.headersSent) {\n      requestEv.exit();\n      return;\n    }\n    const { method } = requestEv;\n    const loaders = getRequestLoaders(requestEv);\n    const isDev = getRequestMode(requestEv) === 'dev';\n    const qwikSerializer = requestEv[RequestEvQwikSerializer];\n    if (isDev && method === 'GET') {\n      if (requestEv.query.has(QACTION_KEY)) {\n        console.warn(\n          'Seems like you are submitting a Qwik Action via GET request. Qwik Actions should be submitted via POST request.\\nMake sure your <form> has method=\"POST\" attribute, like this: <form method=\"POST\">'\n        );\n      }\n    }\n    if (method === 'POST') {\n      const selectedActionId = requestEv.query.get(QACTION_KEY);\n      if (selectedActionId) {\n        const serverActionsMap = globalThis._qwikActionsMap as\n          | Map<string, ActionInternal>\n          | undefined;\n        const action =\n          routeActions.find((action) => action.__id === selectedActionId) ??\n          serverActionsMap?.get(selectedActionId);\n        if (action) {\n          requestEv.sharedMap.set(RequestEvSharedActionId, selectedActionId);\n          const data = await requestEv.parseBody();\n          if (!data || typeof data !== 'object') {\n            throw new Error(\n              `Expected request data for the action id ${selectedActionId} to be an object`\n            );\n          }\n          const result = await runValidators(requestEv, action.__validators, data, isDev);\n          if (!result.success) {\n            loaders[selectedActionId] = requestEv.fail(result.status ?? 500, result.error);\n          } else {\n            const actionResolved = isDev\n              ? await measure(requestEv, action.__qrl.getSymbol().split('_', 1)[0], () =>\n                  action.__qrl.call(requestEv, result.data as JSONObject, requestEv)\n                )\n              : await action.__qrl.call(requestEv, result.data as JSONObject, requestEv);\n            if (isDev) {\n              verifySerializable(qwikSerializer, actionResolved, action.__qrl);\n            }\n            loaders[selectedActionId] = actionResolved;\n          }\n        }\n      }\n    }\n\n    if (routeLoaders.length > 0) {\n      const resolvedLoadersPromises = routeLoaders.map((loader) => {\n        const loaderId = loader.__id;\n        loaders[loaderId] = runValidators(\n          requestEv,\n          loader.__validators,\n          undefined, // data\n          isDev\n        )\n          .then((res) => {\n            if (res.success) {\n              if (isDev) {\n                return measure<Promise<unknown>>(\n                  requestEv,\n                  loader.__qrl.getSymbol().split('_', 1)[0],\n                  () => loader.__qrl.call(requestEv, requestEv)\n                );\n              } else {\n                return loader.__qrl.call(requestEv, requestEv);\n              }\n            } else {\n              return requestEv.fail(res.status ?? 500, res.error);\n            }\n          })\n          .then((resolvedLoader) => {\n            if (typeof resolvedLoader === 'function') {\n              loaders[loaderId] = resolvedLoader();\n            } else {\n              if (isDev) {\n                verifySerializable(qwikSerializer, resolvedLoader, loader.__qrl);\n              }\n              loaders[loaderId] = resolvedLoader;\n            }\n            return resolvedLoader;\n          });\n\n        return loaders[loaderId];\n      });\n\n      await Promise.all(resolvedLoadersPromises);\n    }\n  };\n}\n\nasync function runValidators(\n  requestEv: RequestEvent,\n  validators: DataValidator[] | undefined,\n  data: unknown,\n  isDev: boolean\n) {\n  let lastResult: ValidatorReturn = {\n    success: true,\n    data,\n  };\n  if (validators) {\n    for (const validator of validators) {\n      if (isDev) {\n        lastResult = await measure(requestEv, `validator$`, () =>\n          validator.validate(requestEv, data)\n        );\n      } else {\n        lastResult = await validator.validate(requestEv, data);\n      }\n      if (!lastResult.success) {\n        return lastResult;\n      } else {\n        data = lastResult.data;\n      }\n    }\n  }\n  return lastResult;\n}\n\nfunction isAsyncIterator(obj: unknown): obj is AsyncIterable<unknown> {\n  return obj ? typeof obj === 'object' && Symbol.asyncIterator in obj : false;\n}\n\nasync function runServerFunction(ev: RequestEvent) {\n  const fn = ev.query.get(QFN_KEY);\n  if (\n    fn &&\n    ev.request.headers.get('X-QRL') === fn &&\n    ev.request.headers.get('Content-Type') === 'application/qwik-json'\n  ) {\n    ev.exit();\n    const isDev = getRequestMode(ev) === 'dev';\n    const qwikSerializer = (ev as RequestEventInternal)[RequestEvQwikSerializer];\n    const data = await ev.parseBody();\n    if (Array.isArray(data)) {\n      const [qrl, ...args] = data;\n      if (isQrl(qrl) && qrl.getHash() === fn) {\n        let result: unknown;\n        try {\n          if (isDev) {\n            result = await measure(ev, `server_${qrl.getSymbol()}`, () =>\n              (qrl as Function).apply(ev, args)\n            );\n          } else {\n            result = await (qrl as Function).apply(ev, args);\n          }\n        } catch (err) {\n          if (err instanceof ServerError) {\n            throw ev.error(err.status as ErrorCodes, err.data);\n          }\n          throw ev.error(500, 'Invalid request');\n        }\n        if (isAsyncIterator(result)) {\n          ev.headers.set('Content-Type', 'text/qwik-json-stream');\n          const writable = ev.getWritableStream();\n          const stream = writable.getWriter();\n          for await (const item of result) {\n            if (isDev) {\n              verifySerializable(qwikSerializer, item, qrl);\n            }\n            const message = await qwikSerializer._serializeData(item, true);\n            if (ev.signal.aborted) {\n              break;\n            }\n            await stream.write(encoder.encode(`${message}\\n`));\n          }\n          stream.close();\n        } else {\n          verifySerializable(qwikSerializer, result, qrl);\n          ev.headers.set('Content-Type', 'application/qwik-json');\n          const message = await qwikSerializer._serializeData(result, true);\n          ev.send(200, message);\n        }\n        return;\n      }\n    }\n    throw ev.error(500, 'Invalid request');\n  }\n}\n\nexport function fixTrailingSlash(ev: RequestEvent) {\n  const trailingSlash = getRequestTrailingSlash(ev);\n  const { basePathname, originalUrl, sharedMap } = ev;\n  const { pathname, search } = originalUrl;\n  const isQData = sharedMap.has(IsQData);\n\n  if (\n    // all valid pathnames must start with a single slash\n    !pathname.startsWith('/') ||\n    // protocol-relative URLs are not allowed like: //test.com, ///bad.com\n    pathname.startsWith('//')\n  ) {\n    return;\n  }\n\n  if (!isQData && pathname !== basePathname && !pathname.endsWith('.html')) {\n    // only check for slash redirect on pages\n    if (trailingSlash) {\n      // must have a trailing slash\n      if (!pathname.endsWith('/')) {\n        // add slash to existing pathname\n        throw ev.redirect(HttpStatus.MovedPermanently, pathname + '/' + search);\n      }\n    } else {\n      // should not have a trailing slash\n      if (pathname.endsWith('/')) {\n        // remove slash from existing pathname\n        throw ev.redirect(\n          HttpStatus.MovedPermanently,\n          pathname.slice(0, pathname.length - 1) + search\n        );\n      }\n    }\n  }\n}\n\nexport function verifySerializable(qwikSerializer: QwikSerializer, data: any, qrl: QRL) {\n  try {\n    qwikSerializer._verifySerializable(data, undefined);\n  } catch (e: any) {\n    if (e instanceof Error && qrl.dev) {\n      (e as any).loc = qrl.dev;\n    }\n    throw e;\n  }\n}\n\nexport const isQrl = (value: any): value is QRL => {\n  return typeof value === 'function' && typeof value.getSymbol === 'function';\n};\n\nexport function isLastModulePageRoute(routeModules: RouteModule[]) {\n  const lastRouteModule = routeModules[routeModules.length - 1];\n  return lastRouteModule && typeof (lastRouteModule as PageModule).default === 'function';\n}\n\nexport function getPathname(url: URL, trailingSlash: boolean | undefined) {\n  url = new URL(url);\n  if (url.pathname.endsWith(QDATA_JSON)) {\n    url.pathname = url.pathname.slice(0, -QDATA_JSON.length);\n  }\n  if (trailingSlash) {\n    if (!url.pathname.endsWith('/')) {\n      url.pathname += '/';\n    }\n  } else {\n    if (url.pathname.endsWith('/')) {\n      url.pathname = url.pathname.slice(0, -1);\n    }\n  }\n  // strip internal search params\n  const search = url.search.slice(1).replaceAll(/&?q(action|data|func)=[^&]+/g, '');\n  return `${url.pathname}${search ? `?${search}` : ''}${url.hash}`;\n}\n\nexport const encoder = /*#__PURE__*/ new TextEncoder();\n\nfunction csrfLaxProtoCheckMiddleware(requestEv: RequestEvent) {\n  checkCSRF(requestEv, 'lax-proto');\n}\nfunction csrfCheckMiddleware(requestEv: RequestEvent) {\n  checkCSRF(requestEv);\n}\nexport function checkCSRF(requestEv: RequestEvent, laxProto?: 'lax-proto') {\n  const contentType = requestEv.request.headers.get('content-type');\n\n  const isSimpleRequest =\n    !contentType ||\n    isContentType(\n      requestEv.request.headers,\n      'application/x-www-form-urlencoded',\n      'multipart/form-data',\n      'text/plain'\n    );\n\n  if (isSimpleRequest) {\n    const inputOrigin = requestEv.request.headers.get('origin');\n    const origin = requestEv.url.origin;\n    let forbidden = inputOrigin !== origin;\n\n    // fix https://github.com/QwikDev/qwik/issues/7688\n    if (\n      forbidden &&\n      laxProto &&\n      inputOrigin?.replace(/^http(s)?/g, '') === origin.replace(/^http(s)?/g, '')\n    ) {\n      forbidden = false;\n    }\n\n    if (forbidden) {\n      throw requestEv.error(\n        403,\n        `CSRF check failed. Cross-site ${requestEv.method} form submissions are forbidden.\nThe request origin \"${inputOrigin}\" does not match the server origin \"${origin}\".`\n      );\n    }\n  }\n}\nexport function renderQwikMiddleware(render: Render) {\n  return async (requestEv: RequestEvent) => {\n    if (requestEv.headersSent) {\n      return;\n    }\n    const isPageDataReq = requestEv.sharedMap.has(IsQData);\n    if (isPageDataReq) {\n      return;\n    }\n    const requestHeaders: Record<string, string> = {};\n    requestEv.request.headers.forEach((value, key) => (requestHeaders[key] = value));\n\n    const responseHeaders = requestEv.headers;\n    if (!responseHeaders.has('Content-Type')) {\n      responseHeaders.set('Content-Type', 'text/html; charset=utf-8');\n    }\n\n    const trailingSlash = getRequestTrailingSlash(requestEv);\n    const { readable, writable } = new TextEncoderStream();\n    const writableStream = requestEv.getWritableStream();\n    const pipe = readable.pipeTo(writableStream, { preventClose: true });\n    const stream = writable.getWriter();\n    const status = requestEv.status();\n    try {\n      const isStatic = getRequestMode(requestEv) === 'static';\n      const serverData = getQwikCityServerData(requestEv);\n      const result = await render({\n        base: requestEv.basePathname + 'build/',\n        stream,\n        serverData,\n        containerAttributes: {\n          ['q:render']: isStatic ? 'static' : '',\n          ...serverData.containerAttributes,\n        },\n      });\n      const qData: ClientPageData = {\n        loaders: getRequestLoaders(requestEv),\n        action: requestEv.sharedMap.get(RequestEvSharedActionId),\n        status: status !== 200 ? status : 200,\n        href: getPathname(requestEv.url, trailingSlash),\n      };\n      if (typeof (result as any as RenderToStringResult).html === 'string') {\n        // render result used renderToString(), so none of it was streamed\n        // write the already completed html to the stream\n        await stream.write((result as any as RenderToStringResult).html);\n      }\n      requestEv.sharedMap.set('qData', qData);\n    } finally {\n      await stream.ready;\n      await stream.close();\n      await pipe;\n    }\n    // On success, close the stream\n    await writableStream.close();\n  };\n}\n\n/** Restore q-data.json on redirect */\nasync function handleQDataRedirect(requestEv: RequestEvent) {\n  try {\n    await requestEv.next();\n  } catch (err) {\n    if (!(err instanceof RedirectMessage)) {\n      throw err;\n    }\n  }\n  if (requestEv.headersSent) {\n    return;\n  }\n\n  const status = requestEv.status();\n  const location = requestEv.headers.get('Location');\n  const isRedirect = status >= 301 && status <= 308 && location;\n\n  if (isRedirect) {\n    const adaptedLocation = makeQDataPath(location);\n    if (adaptedLocation) {\n      requestEv.headers.set('Location', adaptedLocation);\n      requestEv.getWritableStream().close();\n      return;\n    } else {\n      requestEv.status(200);\n      requestEv.headers.delete('Location');\n    }\n  }\n}\n\nasync function renderQData(requestEv: RequestEvent) {\n  await requestEv.next();\n\n  if (requestEv.headersSent || requestEv.exited) {\n    return;\n  }\n\n  const status = requestEv.status();\n  const redirectLocation = requestEv.headers.get('Location');\n  const trailingSlash = getRequestTrailingSlash(requestEv);\n\n  const requestHeaders: Record<string, string> = {};\n  requestEv.request.headers.forEach((value, key) => (requestHeaders[key] = value));\n  requestEv.headers.set('Content-Type', 'application/json; charset=utf-8');\n\n  const qData: ClientPageData = {\n    loaders: getRequestLoaders(requestEv),\n    action: requestEv.sharedMap.get(RequestEvSharedActionId),\n    status: status !== 200 ? status : 200,\n    href: getPathname(requestEv.url, trailingSlash),\n    redirect: redirectLocation ?? undefined,\n    isRewrite: requestEv.sharedMap.get(RequestEvIsRewrite),\n  };\n  const writer = requestEv.getWritableStream().getWriter();\n  const qwikSerializer = (requestEv as RequestEventInternal)[RequestEvQwikSerializer];\n  // write just the page json data to the response body\n  const data = await qwikSerializer._serializeData(qData, true);\n  writer.write(encoder.encode(data));\n  requestEv.sharedMap.set('qData', qData);\n\n  writer.close();\n}\n\nfunction makeQDataPath(href: string) {\n  if (href.startsWith('/')) {\n    if (!href.includes(QDATA_JSON)) {\n      const url = new URL(href, 'http://localhost');\n\n      const pathname = url.pathname.endsWith('/') ? url.pathname.slice(0, -1) : url.pathname;\n      return pathname + QDATA_JSON + url.search;\n    }\n    return href;\n  } else {\n    return undefined;\n  }\n}\n\nfunction now() {\n  return typeof performance !== 'undefined' ? performance.now() : 0;\n}\n\nexport async function measure<T>(\n  requestEv: RequestEventBase,\n  name: string,\n  fn: () => T\n): Promise<Awaited<T>> {\n  const start = now();\n  try {\n    return await fn();\n  } finally {\n    const duration = now() - start;\n    let measurements = requestEv.sharedMap.get('@serverTiming');\n    if (!measurements) {\n      requestEv.sharedMap.set('@serverTiming', (measurements = []));\n    }\n    measurements.push([name, duration]);\n  }\n}\n\nexport function getContentType(headers: Headers): string {\n  return (headers.get('content-type')?.split(/[;,]/, 1)[0].trim() ?? '').toLowerCase();\n}\n\nexport function isContentType(headers: Headers, ...types: string[]) {\n  const type = getContentType(headers);\n  for (let i = 0; i < types.length; i++) {\n    if (types[i].toLowerCase() === type) {\n      return true;\n    }\n  }\n  return false;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/resolve-request-handlers.unit.ts",
    "content": "import { describe, it, expect, vi } from 'vitest';\nimport { getPathname, isContentType, fixTrailingSlash } from './resolve-request-handlers';\nimport { createRequestEvent } from './request-event';\nimport { RedirectMessage } from './redirect-handler';\nimport type { ServerRequestEvent, QwikSerializer } from './types';\nimport { checkCSRF } from './resolve-request-handlers';\n\nconst mockQwikSerializer: QwikSerializer = {\n  _deserializeData: vi.fn(),\n  _serializeData: vi.fn(),\n  _verifySerializable: vi.fn(),\n};\n\nfunction createMockServerRequestEvent(url = 'http://localhost:3000/test'): ServerRequestEvent {\n  const mockRequest = new Request(url);\n\n  return {\n    mode: 'server',\n    url: new URL(url),\n    locale: undefined,\n    platform: {},\n    request: mockRequest,\n    env: {\n      get: vi.fn(),\n    },\n    getClientConn: vi.fn(() => ({ ip: '127.0.0.1' })),\n    getWritableStream: vi.fn(() => {\n      const writer = {\n        write: vi.fn(),\n        close: vi.fn(),\n      };\n      return {\n        getWriter: () => writer,\n        locked: false,\n        pipeTo: vi.fn(),\n      } as any;\n    }),\n  };\n}\n\nfunction createMockRequestEvent(url = 'http://localhost:3000/test', trailingSlash = true) {\n  const serverRequestEv = createMockServerRequestEvent(url);\n  return createRequestEvent(\n    serverRequestEv,\n    null,\n    [],\n    trailingSlash,\n    '/',\n    mockQwikSerializer,\n    vi.fn()\n  );\n}\n\ndescribe('resolve-request-handler', () => {\n  describe('getPathname', () => {\n    it('should remove q-data.json', () => {\n      expect(getPathname(new URL('http://server/path/q-data.json?foo=bar#hash'), true)).toBe(\n        '/path/?foo=bar#hash'\n      );\n      expect(getPathname(new URL('http://server/path/q-data.json?foo=bar#hash'), false)).toBe(\n        '/path?foo=bar#hash'\n      );\n    });\n\n    it('should pass non q-data.json through', () => {\n      expect(getPathname(new URL('http://server/path?foo=bar#hash'), true)).toBe(\n        '/path/?foo=bar#hash'\n      );\n      expect(getPathname(new URL('http://server/path/?foo=bar#hash'), false)).toBe(\n        '/path?foo=bar#hash'\n      );\n    });\n\n    it('should remove internal search params', () => {\n      expect(getPathname(new URL('http://server/path?qaction=123&qdata=data'), true)).toBe(\n        '/path/'\n      );\n      expect(getPathname(new URL('http://server/path?foo=1&qfunc=f&bar=2'), false)).toBe(\n        '/path?foo=1&bar=2'\n      );\n    });\n  });\n\n  describe('isContentType', () => {\n    it('should correctly identify form/data', () => {\n      const headers = new Headers({\n        'content-type':\n          'multipart/form-data; boundary=---------------------------5509475224001460121912752931',\n      });\n      expect(isContentType(headers, 'multipart/form-data')).toBe(true);\n    });\n\n    it('should correctly identify type with mixed casing', () => {\n      const headers = new Headers({\n        'content-type': 'tEXt/PlaiN; charset=utf-8',\n      });\n      expect(isContentType(headers, 'text/plain')).toBe(true);\n    });\n\n    it('should split on comma to prevent Content-Type smuggling', () => {\n      const headers = new Headers({\n        'content-type': 'application/x-www-form-urlencoded, bypass',\n      });\n      expect(isContentType(headers, 'application/x-www-form-urlencoded')).toBe(true);\n    });\n  });\n\n  describe('checkCSRF', () => {\n    it('should throw for cross-origin form submissions', () => {\n      const ev: any = {\n        request: {\n          headers: new Headers({\n            'content-type': 'text/plain; charset=utf-8',\n            origin: 'http://evil.com',\n          }),\n        },\n        url: new URL('http://server/path'),\n        method: 'POST',\n        error: (status: number, msg: string) => new Error(msg),\n      };\n\n      expect(() => checkCSRF(ev)).toThrow(/CSRF check failed/);\n    });\n\n    it('should throw for mixed type casing form submissions', () => {\n      const ev: any = {\n        request: {\n          headers: new Headers({\n            'content-type': 'TexT/pLaIn; charset=utf-8',\n            origin: 'http://server/path',\n          }),\n        },\n        url: new URL('http://server/path'),\n        method: 'POST',\n        error: (status: number, msg: string) => new Error(msg),\n      };\n\n      expect(() => checkCSRF(ev)).toThrow(/CSRF check failed/);\n    });\n\n    it('should throw for missing content-type header form submissions', () => {\n      const ev: any = {\n        request: {\n          headers: new Headers({\n            origin: 'http://server/path',\n          }),\n        },\n        url: new URL('http://server/path'),\n        method: 'POST',\n        error: (status: number, msg: string) => new Error(msg),\n      };\n\n      expect(() => checkCSRF(ev)).toThrow(/CSRF check failed/);\n    });\n\n    it('should allow same-origin form submissions', () => {\n      const ev: any = {\n        request: {\n          headers: new Headers({\n            'content-type': 'text/plain; charset=utf-8',\n            origin: 'http://server',\n          }),\n        },\n        url: new URL('http://server/path'),\n        method: 'POST',\n        error: (status: number, msg: string) => new Error(msg),\n      };\n\n      // Should not throw\n      checkCSRF(ev);\n    });\n\n    it('should allow when lax-proto and only scheme differs', () => {\n      const ev: any = {\n        request: {\n          headers: new Headers({\n            'content-type': 'text/plain; charset=utf-8',\n            origin: 'https://server',\n          }),\n        },\n        url: new URL('http://server/path'),\n        method: 'POST',\n        error: (status: number, msg: string) => new Error(msg),\n      };\n\n      // Should not throw\n      checkCSRF(ev, 'lax-proto');\n    });\n\n    it('should not check origin for non-form content-types', () => {\n      const ev: any = {\n        request: {\n          headers: new Headers({\n            'content-type': 'application/json',\n            origin: 'http://evil.com',\n          }),\n        },\n        url: new URL('http://server/path'),\n        method: 'POST',\n        error: (status: number, msg: string) => new Error(msg),\n      };\n\n      // Should not throw\n      checkCSRF(ev);\n    });\n\n    it('should throw for Content-Type smuggling via comma', () => {\n      const ev: any = {\n        request: {\n          headers: new Headers({\n            'content-type': 'application/x-www-form-urlencoded, bypass',\n            origin: 'http://server/path',\n          }),\n        },\n        url: new URL('http://server/path'),\n        method: 'POST',\n        error: (status: number, msg: string) => new Error(msg),\n      };\n\n      expect(() => checkCSRF(ev)).toThrow(/CSRF check failed/);\n    });\n  });\n\n  describe('fixTrailingSlash', () => {\n    describe('protocol-relative URL prevention', () => {\n      it('should prevent redirect with protocol-relative URL //evil.com', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000//evil.com', true);\n\n        fixTrailingSlash(requestEv);\n      });\n\n      it('should prevent redirect with multiple leading slashes ///evil.com', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000///evil.com', true);\n\n        fixTrailingSlash(requestEv);\n      });\n\n      it('should prevent redirect with protocol-relative URL //evil.com/path', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000//evil.com/path', true);\n\n        fixTrailingSlash(requestEv);\n      });\n    });\n\n    describe('trailing slash enforcement', () => {\n      it('should add trailing slash when trailingSlash is true and path has no slash', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000/about', true);\n\n        expect(() => fixTrailingSlash(requestEv)).toThrow(RedirectMessage);\n        expect(requestEv.headers.get('Location')).toBe('/about/');\n      });\n\n      it('should not redirect when trailingSlash is true and path has slash', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000/about/', true);\n\n        fixTrailingSlash(requestEv);\n      });\n\n      it('should remove trailing slash when trailingSlash is false and path has slash', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000/about/', false);\n\n        expect(() => fixTrailingSlash(requestEv)).toThrow(RedirectMessage);\n        expect(requestEv.headers.get('Location')).toBe('/about');\n      });\n\n      it('should not redirect when trailingSlash is false and path has no slash', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000/about', false);\n\n        fixTrailingSlash(requestEv);\n      });\n\n      it('should preserve query string in redirect', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000/about?foo=bar', true);\n\n        expect(() => fixTrailingSlash(requestEv)).toThrow(RedirectMessage);\n        expect(requestEv.headers.get('Location')).toBe('/about/?foo=bar');\n      });\n\n      it('should not redirect .html files', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000/page.html', true);\n\n        fixTrailingSlash(requestEv);\n      });\n\n      it('should not redirect basePathname', () => {\n        const requestEv = createMockRequestEvent('http://localhost:3000/', true);\n\n        fixTrailingSlash(requestEv);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/response-page.ts",
    "content": "import type { QwikCityEnvData } from '../../runtime/src/types';\nimport type { RequestEvent } from './types';\nimport {\n  getRequestLoaders,\n  getRequestRoute,\n  RequestEvSharedActionFormData,\n  RequestEvSharedActionId,\n  RequestEvSharedNonce,\n  RequestRouteName,\n} from './request-event';\n\nexport function getQwikCityServerData(requestEv: RequestEvent) {\n  const { params, request, status, locale, originalUrl } = requestEv;\n  const requestHeaders: Record<string, string> = {};\n  request.headers.forEach((value, key) => (requestHeaders[key] = value));\n\n  const action = requestEv.sharedMap.get(RequestEvSharedActionId) as string;\n  const formData = requestEv.sharedMap.get(RequestEvSharedActionFormData);\n  const routeName = requestEv.sharedMap.get(RequestRouteName) as string;\n  const nonce = requestEv.sharedMap.get(RequestEvSharedNonce);\n  const headers = requestEv.request.headers;\n  const reconstructedUrl = new URL(originalUrl.pathname + originalUrl.search, originalUrl);\n  const host = headers.get('X-Forwarded-Host')!;\n  const protocol = headers.get('X-Forwarded-Proto')!;\n  if (host) {\n    reconstructedUrl.port = '';\n    reconstructedUrl.host = host;\n  }\n  if (protocol) {\n    reconstructedUrl.protocol = protocol;\n  }\n\n  return {\n    url: reconstructedUrl.href,\n    requestHeaders,\n    locale: locale(),\n    nonce,\n    containerAttributes: {\n      'q:route': routeName,\n    },\n    qwikcity: {\n      routeName,\n      ev: requestEv,\n      params: { ...params },\n      loadedRoute: getRequestRoute(requestEv),\n      response: {\n        status: status(),\n        loaders: getRequestLoaders(requestEv),\n        action,\n        formData,\n      },\n    } satisfies QwikCityEnvData,\n  };\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/rewrite-handler.ts",
    "content": "import { AbortMessage } from './redirect-handler';\n\n/** @public */\nexport class RewriteMessage extends AbortMessage {\n  constructor(readonly pathname: string) {\n    super();\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/server-error.ts",
    "content": "/** @public */\nexport class ServerError<T = any> extends Error {\n  constructor(\n    public status: number,\n    public data: T\n  ) {\n    super(typeof data === 'string' ? data : undefined);\n  }\n}\n/** @deprecated */\n\nexport class ErrorResponse extends ServerError {\n  constructor(\n    public status: number,\n    message?: string\n  ) {\n    super(status, message);\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/types.ts",
    "content": "import type { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport type { Action, FailReturn, Loader, QwikCityPlan } from '@builder.io/qwik-city';\nimport type { Render, RenderOptions } from '@builder.io/qwik/server';\nimport type { ServerError } from './server-error';\nimport type { AbortMessage, RedirectMessage } from './redirect-handler';\nimport type { RequestEventInternal } from './request-event';\nimport type { RewriteMessage } from './rewrite-handler';\n\n/** @public */\nexport interface EnvGetter {\n  get(key: string): string | undefined;\n}\n\n/** @public */\nexport interface ClientConn {\n  ip?: string;\n  country?: string;\n}\n\n/**\n * @public\n * Request event created by the server.\n */\nexport interface ServerRequestEvent<T = unknown> {\n  mode: ServerRequestMode;\n  url: URL;\n  locale: string | undefined;\n  platform: QwikCityPlatform;\n  request: Request;\n  env: EnvGetter;\n  getClientConn: () => ClientConn;\n  getWritableStream: ServerResponseHandler<T>;\n}\n\n/** @public */\nexport type ServerRequestMode = 'dev' | 'static' | 'server';\n\n/** @public */\nexport type ServerResponseHandler<T = any> = (\n  status: number,\n  headers: Headers,\n  cookies: Cookie,\n  resolve: (response: T) => void,\n  requestEv: RequestEventInternal\n) => WritableStream<Uint8Array>;\n\n/** @public */\nexport interface ServerRenderOptions extends RenderOptions {\n  render: Render;\n  qwikCityPlan: QwikCityPlan;\n  /**\n   * Protection against cross-site request forgery (CSRF) attacks.\n   *\n   * When `true`, for every incoming POST, PUT, PATCH, or DELETE form submissions, the request\n   * origin is checked to match the server's origin. `lax-proto` is for SSL-terminating proxies\n   *\n   * Be careful when disabling this option as it may lead to CSRF attacks.\n   *\n   * Defaults to `true`.\n   */\n  checkOrigin?: boolean | 'lax-proto';\n}\n\n/** @public */\nexport type RequestHandler<PLATFORM = QwikCityPlatform> = (\n  ev: RequestEvent<PLATFORM>\n) => Promise<void> | void;\n\n/** @public */\nexport interface SendMethod {\n  (statusCode: StatusCodes, data: any): AbortMessage;\n  (response: Response): AbortMessage;\n}\n\nexport type StatusCodes =\n  | InformationalCode\n  | SuccessCode\n  | ClientErrorCode\n  | ServerErrorCode\n  | RedirectCode\n  | number;\n\nexport type ErrorCodes = ClientErrorCode | ServerErrorCode;\n\n/**\n * HTTP Informational Status Codes Status codes in the 1xx range indicate that the server has\n * received and is processing the request, but no response is available yet.\n */\nexport type InformationalCode =\n  | 100 // Continue\n  | 101 // Switching Protocols\n  | 102 // Processing\n  | 103; // Early Hints\n\n/**\n * HTTP Success Status Codes Status codes in the 2xx range indicate that the client's request was\n * successfully received, understood, and accepted by the server.\n */\ntype SuccessCode =\n  | 200 // OK\n  | 201 // Created\n  | 202 // Accepted\n  | 203 // Non-Authoritative Information\n  | 204 // No Content\n  | 205 // Reset Content\n  | 206 // Partial Content\n  | 207 // Multi-Status\n  | 208 // Already Reported\n  | 226; // IM Used;\n\n/**\n * HTTP Redirect Status Codes Status codes in the 3xx range indicate that further action must be\n * taken by the client to complete the request.\n */\nexport type RedirectCode =\n  | 300 // Multiple Choices\n  | 301 // Moved Permanently\n  | 302 // Found\n  | 303 // See Other\n  | 304 // Not Modified\n  | 305 // Use Proxy\n  | 307 // Temporary Redirect\n  | 308; // Permanent Redirect\n\n/**\n * HTTP Client Error Status Codes Status codes in the 4xx range indicate that the client's request\n * was malformed or invalid and could not be understood or processed by the server.\n */\nexport type ClientErrorCode =\n  | 400 // Bad Request\n  | 401 // Unauthorized\n  | 402 // Payment Required\n  | 403 // Forbidden\n  | 404 // Not Found\n  | 405 // Method Not Allowed\n  | 406 // Not Acceptable\n  | 407 // Proxy Authentication Required\n  | 408 // Request Timeout\n  | 409 // Conflict\n  | 410 // Gone\n  | 411 // Length Required\n  | 412 // Precondition Failed\n  | 413 // Payload Too Large\n  | 414 // URI Too Long\n  | 415 // Unsupported Media Type\n  | 416 // Range Not Satisfiable\n  | 417 // Expectation Failed\n  | 418 // I'm a teapot\n  | 421 // Misdirected Request\n  | 422 // Unprocessable Entity\n  | 423 // Locked\n  | 424 // Failed Dependency\n  | 425 // Too Early\n  | 426 // Upgrade Required\n  | 428 // Precondition Required\n  | 429 // Too Many Requests\n  | 431 // Request Header Fields Too Large\n  | 451 // Unavailable For Legal Reasons\n  | 499; // Client closed request\n\n/**\n * HTTP Server Error Status Codes Status codes in the 5xx range indicate that the server encountered\n * an error or was unable to fulfill the request due to unexpected conditions.\n */\nexport type ServerErrorCode =\n  | 500 // Internal Server Error\n  | 501 // Not Implemented\n  | 502 // Bad Gateway\n  | 503 // Service Unavailable\n  | 504 // Gateway Timeout\n  | 505 // HTTP Version Not Supported\n  | 506 // Variant Also Negotiates\n  | 507 // Insufficient Storage\n  | 508 // Loop Detected\n  | 510 // Not Extended\n  | 511; // Network Authentication Required\n\n/** @public */\nexport interface RequestEventCommon<PLATFORM = QwikCityPlatform>\n  extends RequestEventBase<PLATFORM> {\n  /**\n   * HTTP response status code. Sets the status code when called with an argument. Always returns\n   * the status code, so calling `status()` without an argument will can be used to return the\n   * current status code.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n   */\n  readonly status: (statusCode?: StatusCodes) => number;\n\n  /**\n   * Which locale the content is in.\n   *\n   * The locale value can be retrieved from selected methods using `getLocale()`:\n   */\n  readonly locale: (local?: string) => string;\n\n  /**\n   * URL to redirect to. When called, the response will immediately end with the correct redirect\n   * status and headers.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections\n   */\n  readonly redirect: (statusCode: RedirectCode, url: string) => RedirectMessage;\n\n  /**\n   * When called, qwik-city will execute the path's matching route flow.\n   *\n   * The url in the browser will remain unchanged.\n   *\n   * @param pathname - The pathname to rewrite to.\n   */\n  readonly rewrite: (pathname: string) => RewriteMessage;\n\n  /**\n   * When called, the response will immediately end with the given status code. This could be useful\n   * to end a response with `404`, and use the 404 handler in the routes directory. See\n   * https://developer.mozilla.org/en-US/docs/Web/HTTP/Status for which status code should be used.\n   */\n  readonly error: <T = any>(statusCode: ErrorCodes, message: T) => ServerError<T>;\n\n  /**\n   * Convenience method to send an text body response. The response will be automatically set the\n   * `Content-Type` header to`text/plain; charset=utf-8`. An `text()` response can only be called\n   * once.\n   */\n  readonly text: (statusCode: StatusCodes, text: string) => AbortMessage;\n\n  /**\n   * Convenience method to send an HTML body response. The response will be automatically set the\n   * `Content-Type` header to`text/html; charset=utf-8`. An `html()` response can only be called\n   * once.\n   */\n  readonly html: (statusCode: StatusCodes, html: string) => AbortMessage;\n\n  /**\n   * Convenience method to JSON stringify the data and send it in the response. The response will be\n   * automatically set the `Content-Type` header to `application/json; charset=utf-8`. A `json()`\n   * response can only be called once.\n   */\n  readonly json: (statusCode: StatusCodes, data: any) => AbortMessage;\n\n  /**\n   * Send a body response. The `Content-Type` response header is not automatically set when using\n   * `send()` and must be set manually. A `send()` response can only be called once.\n   */\n  readonly send: SendMethod;\n\n  readonly exit: () => AbortMessage;\n}\n\n/** @public */\nexport interface RequestEventBase<PLATFORM = QwikCityPlatform> {\n  /**\n   * HTTP response headers. Notice it will be empty until you first add a header. If you want to\n   * read the request headers, use `request.headers` instead.\n   *\n   * https://developer.mozilla.org/en-US/docs/Glossary/Response_header\n   */\n  readonly headers: Headers;\n\n  /**\n   * HTTP request and response cookie. Use the `get()` method to retrieve a request cookie value.\n   * Use the `set()` method to set a response cookie value.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies\n   */\n  readonly cookie: Cookie;\n\n  /**\n   * HTTP request method.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods\n   */\n  readonly method: string;\n\n  /**\n   * URL pathname. Does not include the protocol, domain, query string (search params) or hash.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname\n   */\n  readonly pathname: string;\n\n  /**\n   * URL path params which have been parsed from the current url pathname segments. Use `query` to\n   * instead retrieve the query string search params.\n   */\n  readonly params: Readonly<Record<string, string>>;\n\n  /**\n   * URL Query Strings (URL Search Params). Use `params` to instead retrieve the route params found\n   * in the url pathname.\n   *\n   * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n   */\n  readonly query: URLSearchParams;\n\n  /** HTTP request URL. */\n  readonly url: URL;\n\n  /**\n   * The original HTTP request URL.\n   *\n   * This property was introduced to support the rewrite feature.\n   *\n   * If rewrite is called, the url property will be changed to the rewritten url. while originalUrl\n   * will stay the same(e.g the url inserted to the address bar).\n   *\n   * If rewrite is never called as part of the request, the url property and the originalUrl are\n   * equal.\n   */\n  readonly originalUrl: URL;\n\n  /** The base pathname of the request, which can be configured at build time. Defaults to `/`. */\n  readonly basePathname: string;\n\n  /** HTTP request information. */\n  readonly request: Request;\n\n  /** Platform specific data and functions */\n  readonly platform: PLATFORM;\n\n  /** Platform provided environment variables. */\n  readonly env: EnvGetter;\n\n  /**\n   * Shared Map across all the request handlers. Every HTTP request will get a new instance of the\n   * shared map. The shared map is useful for sharing data between request handlers.\n   */\n  readonly sharedMap: Map<string, any>;\n\n  /**\n   * This method will check the request headers for a `Content-Type` header and parse the body\n   * accordingly. It supports `application/json`, `application/x-www-form-urlencoded`, and\n   * `multipart/form-data` content types.\n   *\n   * If the `Content-Type` header is not set, it will return `null`.\n   */\n  readonly parseBody: () => Promise<unknown>;\n\n  /**\n   * Convenience method to set the Cache-Control header. Depending on your CDN, you may want to add\n   * another cacheControl with the second argument set to `CDN-Cache-Control` or any other value (we\n   * provide the most common values for auto-complete, but you can use any string you want).\n   *\n   * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control and\n   * https://qwik.dev/docs/caching/#CDN-Cache-Controls for more information.\n   */\n  readonly cacheControl: (cacheControl: CacheControl, target?: CacheControlTarget) => void;\n\n  /**\n   * Provides information about the client connection, such as the IP address and the country the\n   * request originated from.\n   */\n  readonly clientConn: ClientConn;\n\n  /**\n   * Request's AbortSignal (same as `request.signal`). This signal indicates that the request has\n   * been aborted.\n   */\n  readonly signal: AbortSignal;\n}\n\n/** @public */\nexport type CacheControl =\n  | CacheControlOptions\n  | number\n  | 'day'\n  | 'week'\n  | 'month'\n  | 'year'\n  | 'no-cache'\n  | 'immutable'\n  | 'private';\n\n/** @public */\nexport interface CacheControlOptions {\n  /**\n   * The max-age=N response directive indicates that the response remains fresh until N seconds\n   * after the response is generated. Note that max-age is not the elapsed time since the response\n   * was received; it is the elapsed time since the response was generated on the origin server. So\n   * if the other cache(s) — on the network route taken by the response — store the response for 100\n   * seconds (indicated using the Age response header field), the browser cache would deduct 100\n   * seconds from its freshness lifetime.\n   */\n  maxAge?: number;\n\n  /**\n   * The s-maxage response directive also indicates how long the response is fresh for (similar to\n   * max-age) — but it is specific to shared caches, and they will ignore max-age when it is\n   * present.\n   */\n  sMaxAge?: number;\n\n  /**\n   * The stale-while-revalidate response directive indicates that the cache could reuse a stale\n   * response while it revalidates it to a cache.\n   */\n  staleWhileRevalidate?: number;\n\n  /**\n   * The stale-if-error response directive that indicates if a stale response can be used when\n   * there's an error from the origin.\n   */\n  staleIfError?: number;\n\n  /**\n   * The no-store response directive indicates that any caches of any kind (private or shared)\n   * should not store this response.\n   */\n  noStore?: boolean;\n\n  /**\n   * The no-cache response directive indicates that the response can be stored in caches, but the\n   * response must be validated with the origin server before each reuse, even when the cache is\n   * disconnected from the origin server.\n   */\n  noCache?: boolean;\n\n  /**\n   * The public response directive indicates that the response can be stored in a shared cache.\n   * Responses for requests with Authorization header fields must not be stored in a shared cache;\n   * however, the public directive will cause such responses to be stored in a shared cache.\n   */\n  public?: boolean;\n\n  /**\n   * The private response directive indicates that the response can be stored only in a private\n   * cache (e.g. local caches in browsers). You should add the private directive for\n   * user-personalized content, especially for responses received after login and for sessions\n   * managed via cookies. If you forget to add private to a response with personalized content, then\n   * that response can be stored in a shared cache and end up being reused for multiple users, which\n   * can cause personal information to leak.\n   */\n  private?: boolean;\n\n  /**\n   * The immutable response directive indicates that the response will not be updated while it's\n   * fresh.\n   *\n   * A modern best practice for static resources is to include version/hashes in their URLs, while\n   * never modifying the resources — but instead, when necessary, updating the resources with newer\n   * versions that have new version-numbers/hashes, so that their URLs are different. That's called\n   * the cache-busting pattern.\n   */\n  immutable?: boolean;\n}\n\n/** @public */\nexport type CacheControlTarget =\n  | 'Cache-Control'\n  | 'CDN-Cache-Control'\n  | 'Cloudflare-CDN-Cache-Control'\n  | 'Vercel-CDN-Cache-Control'\n  | '~ANY-OTHER-STRING'\n  | (string & {});\n\n/** @public */\nexport interface RequestEvent<PLATFORM = QwikCityPlatform> extends RequestEventCommon<PLATFORM> {\n  /** True if headers have been sent, preventing any more headers from being set. */\n  readonly headersSent: boolean;\n\n  /** True if the middleware chain has finished executing. */\n  readonly exited: boolean;\n  /**\n   * Low-level access to write to the HTTP response stream. Once `getWritableStream()` is called,\n   * the status and headers can no longer be modified and will be sent over the network.\n   */\n  readonly getWritableStream: () => WritableStream<Uint8Array>;\n\n  /**\n   * Invoke the next middleware function in the chain.\n   *\n   * NOTE: Ensure that the call to `next()` is `await`ed.\n   */\n  readonly next: () => Promise<void>;\n}\n\ndeclare global {\n  interface QwikCityPlatform {}\n}\n\n/** @public */\nexport interface RequestEventAction<PLATFORM = QwikCityPlatform>\n  extends RequestEventCommon<PLATFORM> {\n  fail: <T extends Record<string, any>>(status: number, returnData: T) => FailReturn<T>;\n}\n\n/** @public */\nexport type DeferReturn<T> = () => Promise<T>;\n\n/** @public */\nexport interface RequestEventLoader<PLATFORM = QwikCityPlatform>\n  extends RequestEventAction<PLATFORM> {\n  resolveValue: ResolveValue;\n  defer: <T>(returnData: Promise<T> | (() => Promise<T>)) => DeferReturn<T>;\n}\n\n/** @public */\nexport interface ResolveValue {\n  <T>(loader: Loader<T>): Awaited<T> extends () => any ? never : Promise<T>;\n  <T>(action: Action<T>): Promise<T | undefined>;\n}\n\n/** @public */\nexport interface ResolveSyncValue {\n  <T>(loader: Loader<T>): Awaited<T> extends () => any ? never : Awaited<T>;\n  <T>(action: Action<T>): Awaited<T> | undefined;\n}\n\n/** @public */\nexport interface Cookie {\n  /** Gets a `Request` cookie header value by name. */\n  get(name: string): CookieValue | null;\n  /** Gets all `Request` cookie headers. */\n  getAll(): Record<string, CookieValue>;\n  /** Checks if the `Request` cookie header name exists. */\n  has(name: string): boolean;\n  /** Sets a `Response` cookie header using the `Set-Cookie` header. */\n  set(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\n  /**\n   * Appends a `Response` cookie header using the `Set-Cookie` header.\n   *\n   * The difference between `set()` and `append()` is that if the specified header already exists,\n   * `set()` will overwrite the existing value with the new one, whereas `append()` will append the\n   * new value onto the end of the set of values.\n   */\n  append(name: string, value: string | number | Record<string, any>, options?: CookieOptions): void;\n  /** Deletes cookie value by name using the `Response` cookie header. */\n  delete(name: string, options?: Pick<CookieOptions, 'path' | 'domain' | 'sameSite'>): void;\n  /** Returns an array of all the set `Response` `Set-Cookie` header values. */\n  headers(): string[];\n}\n\n/** @public */\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie\n *\n * @public\n */\nexport interface CookieOptions {\n  /**\n   * Defines the host to which the cookie will be sent. If omitted, this attribute defaults to the\n   * host of the current document URL, not including subdomains.\n   */\n  domain?: string;\n  /**\n   * Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. If both `expires` and\n   * `maxAge` are set, `maxAge` has precedence.\n   */\n  expires?: Date | string;\n  /**\n   * Forbids JavaScript from accessing the cookie, for example, through the `document.cookie`\n   * property.\n   */\n  httpOnly?: boolean;\n  /**\n   * Indicates the number of seconds until the cookie expires. A zero or negative number will expire\n   * the cookie immediately. If both `expires` and `maxAge` are set, `maxAge` has precedence. You\n   * can also use the array syntax to set the max-age using minutes, hours, days or weeks. For\n   * example, `{ maxAge: [3, \"days\"] }` would set the cookie to expire in 3 days.\n   */\n  maxAge?: number | [number, 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks'];\n  /**\n   * Indicates the path that must exist in the requested URL for the browser to send the Cookie\n   * header.\n   */\n  path?: string;\n  /**\n   * Controls whether or not a cookie is sent with cross-site requests, providing some protection\n   * against cross-site request forgery attacks (CSRF).\n   */\n  sameSite?: 'strict' | 'lax' | 'none' | 'Strict' | 'Lax' | 'None' | boolean;\n  /**\n   * Indicates that the cookie is sent to the server only when a request is made with the `https:`\n   * scheme (except on localhost)\n   */\n  secure?: boolean;\n}\n\n/** @public */\nexport interface CookieValue {\n  value: string;\n  json: <T = unknown>() => T;\n  number: () => number;\n}\n\n/** @public */\nexport interface QwikSerializer {\n  _deserializeData: typeof _deserializeData;\n  _serializeData: typeof _serializeData;\n  _verifySerializable: typeof _verifySerializable;\n}\n\n/** @public */\nexport type HttpMethod =\n  | 'GET'\n  | 'POST'\n  | 'PUT'\n  | 'DELETE'\n  | 'PATCH'\n  | 'HEAD'\n  | 'OPTIONS'\n  | 'CONNECT'\n  | 'TRACE';\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/request-handler/user-response.ts",
    "content": "import type { RequestEvent, RequestHandler } from '@builder.io/qwik-city';\nimport type { LoadedRoute, RebuildRouteInfoInternal } from '../../runtime/src/types';\nimport { getErrorHtml } from './error-handler';\nimport {\n  RequestEvQwikSerializer,\n  createRequestEvent,\n  getRequestMode,\n  type RequestEventInternal,\n} from './request-event';\nimport { encoder } from './resolve-request-handlers';\nimport type { QwikSerializer, ServerRequestEvent, StatusCodes } from './types';\n// Import separately to avoid duplicate imports in the vite dev server\nimport {\n  AbortMessage,\n  RedirectMessage,\n  ServerError,\n  RewriteMessage,\n} from '@builder.io/qwik-city/middleware/request-handler';\n\nexport interface QwikCityRun<T> {\n  response: Promise<T | null>;\n  requestEv: RequestEvent;\n  completion: Promise<unknown>;\n}\n\nlet asyncStore: AsyncStore | undefined;\nimport('node:async_hooks')\n  .then((module) => {\n    const AsyncLocalStorage = module.AsyncLocalStorage;\n    asyncStore = new AsyncLocalStorage<RequestEventInternal>();\n    globalThis.qcAsyncRequestStore = asyncStore;\n  })\n  .catch((err) => {\n    console.warn(\n      'AsyncLocalStorage not available, continuing without it. This might impact concurrent server calls.',\n      err\n    );\n  });\n\nexport function runQwikCity<T>(\n  serverRequestEv: ServerRequestEvent<T>,\n  loadedRoute: LoadedRoute | null,\n  requestHandlers: RequestHandler<any>[],\n  rebuildRouteInfo: RebuildRouteInfoInternal,\n  trailingSlash = true,\n  basePathname = '/',\n  qwikSerializer: QwikSerializer\n): QwikCityRun<T> {\n  let resolve: (value: T) => void;\n  const responsePromise = new Promise<T>((r) => (resolve = r));\n  const requestEv = createRequestEvent(\n    serverRequestEv,\n    loadedRoute,\n    requestHandlers,\n    trailingSlash,\n    basePathname,\n    qwikSerializer,\n    resolve!\n  );\n\n  return {\n    response: responsePromise,\n    requestEv,\n    completion: asyncStore\n      ? asyncStore.run(requestEv, runNext, requestEv, rebuildRouteInfo, resolve!)\n      : runNext(requestEv, rebuildRouteInfo, resolve!),\n  };\n}\n\nasync function runNext(\n  requestEv: RequestEventInternal,\n  rebuildRouteInfo: RebuildRouteInfoInternal,\n  resolve: (value: any) => void\n) {\n  try {\n    const isValidURL = (url: URL) => new URL(url.pathname + url.search, url);\n    isValidURL(requestEv.originalUrl);\n  } catch {\n    const status = 404;\n    const message = 'Resource Not Found';\n    requestEv.status(status);\n    const html = getErrorHtml(status, message);\n    requestEv.html(status, html);\n    return new ServerError(status, message);\n  }\n\n  let rewriteAttempt = 1;\n\n  async function _runNext() {\n    try {\n      // Run all middlewares\n      await requestEv.next();\n    } catch (e) {\n      if (e instanceof RedirectMessage) {\n        const stream = requestEv.getWritableStream();\n        await stream.close();\n      } else if (e instanceof RewriteMessage) {\n        if (rewriteAttempt > 50) {\n          throw new Error(`Infinite rewrite loop`);\n        }\n\n        rewriteAttempt += 1;\n        const url = new URL(requestEv.url);\n        url.pathname = e.pathname;\n        const { loadedRoute, requestHandlers } = await rebuildRouteInfo(url);\n        requestEv.resetRoute(loadedRoute, requestHandlers, url);\n        return await _runNext();\n      } else if (e instanceof ServerError) {\n        if (!requestEv.headersSent) {\n          const status = e.status as StatusCodes;\n          const accept = requestEv.request.headers.get('Accept');\n          if (accept && !accept.includes('text/html')) {\n            const qwikSerializer = requestEv[RequestEvQwikSerializer];\n            requestEv.headers.set('Content-Type', 'application/qwik-json');\n            requestEv.send(status, await qwikSerializer._serializeData(e.data, true));\n          } else {\n            const html = getErrorHtml(e.status, e.data);\n            requestEv.html(status, html);\n          }\n        }\n      } else if (!(e instanceof AbortMessage)) {\n        if (getRequestMode(requestEv) !== 'dev') {\n          try {\n            if (!requestEv.headersSent) {\n              requestEv.headers.set('content-type', 'text/html; charset=utf-8');\n              requestEv.cacheControl({ noCache: true });\n              requestEv.status(500);\n            }\n            const stream = requestEv.getWritableStream();\n            if (!stream.locked) {\n              const writer = stream.getWriter();\n              await writer.write(encoder.encode(getErrorHtml(500, 'Internal Server Error')));\n              await writer.close();\n            }\n          } catch {\n            console.error('Unable to render error page');\n          }\n        }\n\n        return e;\n      }\n    }\n\n    return undefined;\n  }\n\n  try {\n    return await _runNext();\n  } finally {\n    if (!requestEv.isDirty()) {\n      resolve(null);\n    }\n  }\n}\n\n/**\n * The pathname used to match in the route regex array. A pathname ending with /q-data.json should\n * be treated as a pathname without it.\n */\nexport function getRouteMatchPathname(pathname: string, trailingSlash: boolean | undefined) {\n  const isInternal = pathname.endsWith(QDATA_JSON);\n  if (isInternal) {\n    const trimEnd = pathname.length - QDATA_JSON.length + (trailingSlash ? 1 : 0);\n    pathname = pathname.slice(0, trimEnd);\n    if (pathname === '') {\n      pathname = '/';\n    }\n  }\n  return { pathname, isInternal };\n}\n\nexport const IsQData = '@isQData';\nexport const QDATA_JSON = '/q-data.json';\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/vercel-edge/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/middleware/vercel-edge/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"middleware.vercel-edge\",\n    \"reportFolder\": \"<projectFolder>/src/middleware/vercel-edge/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/middleware/vercel-edge\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/middleware/vercel-edge/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/middleware/vercel-edge/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/vercel-edge/index.ts",
    "content": "import type {\n  ServerRenderOptions,\n  ServerRequestEvent,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport {\n  mergeHeadersCookies,\n  requestHandler,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport { getNotFound } from '@qwik-city-not-found-paths';\nimport { isStaticPath } from '@qwik-city-static-paths';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\nimport { setServerPlatform } from '@builder.io/qwik/server';\n\n// @builder.io/qwik-city/middleware/vercel-edge\nconst COUNTRY_HEADER_NAME = 'x-vercel-ip-country';\nconst IP_HEADER_NAME = 'x-real-ip';\nconst VERCEL_COOKIE = '__vdpl';\nconst VERCEL_SKEW_PROTECTION_ENABLED = 'VERCEL_SKEW_PROTECTION_ENABLED';\nconst VERCEL_DEPLOYMENT_ID = 'VERCEL_DEPLOYMENT_ID';\nconst BASE_URL = 'BASE_URL';\n\n/** @public */\nexport function createQwikCity(opts: QwikCityVercelEdgeOptions) {\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  if (opts.manifest) {\n    setServerPlatform(opts.manifest);\n  }\n  async function onVercelEdgeRequest(request: Request) {\n    try {\n      const url = new URL(request.url);\n\n      if (isStaticPath(request.method, url)) {\n        // known static path, let vercel handle it\n        return new Response(null, {\n          headers: {\n            'x-middleware-next': '1',\n          },\n        });\n      }\n\n      const p = (() => globalThis.process)();\n\n      const serverRequestEv: ServerRequestEvent<Response> = {\n        mode: 'server',\n        locale: undefined,\n        url,\n        request,\n        env: {\n          get(key) {\n            return p.env[key];\n          },\n        },\n        getWritableStream: (status, headers, cookies, resolve) => {\n          const { readable, writable } = new TransformStream();\n          if (serverRequestEv.env.get(VERCEL_SKEW_PROTECTION_ENABLED)) {\n            const deploymentId = serverRequestEv.env.get(VERCEL_DEPLOYMENT_ID) || '';\n            const baseUrl = serverRequestEv.env.get(BASE_URL) || '/';\n            // only on document request\n            if (request.headers.has('Sec-Fetch-Dest')) {\n              // set cookie before creating response\n              cookies.set(VERCEL_COOKIE, deploymentId, {\n                path: baseUrl,\n                secure: true,\n                sameSite: true,\n                httpOnly: true,\n              });\n            }\n          }\n          const response = new Response(readable, {\n            status,\n            headers: mergeHeadersCookies(headers, cookies),\n          });\n          resolve(response);\n          return writable;\n        },\n        platform: {},\n        getClientConn: () => {\n          return {\n            ip: request.headers.get(IP_HEADER_NAME) ?? undefined,\n            country: request.headers.get(COUNTRY_HEADER_NAME) ?? undefined,\n          };\n        },\n      };\n\n      // send request to qwik city request handler\n      const handledResponse = await requestHandler(serverRequestEv, opts, qwikSerializer);\n      if (handledResponse) {\n        handledResponse.completion.then((v) => {\n          if (v) {\n            console.error(v);\n          }\n        });\n        const response = await handledResponse.response;\n        if (response) {\n          return response;\n        }\n      }\n\n      // qwik city did not have a route for this request\n      // response with 404 for this pathname\n\n      // In the development server, we replace the getNotFound function\n      // For static paths, we assign a static \"Not Found\" message.\n      // This ensures consistency between development and production environments for specific URLs.\n      const notFoundHtml = isStaticPath(request.method || 'GET', url)\n        ? 'Not Found'\n        : getNotFound(url.pathname);\n      return new Response(notFoundHtml, {\n        status: 404,\n        headers: { 'Content-Type': 'text/html; charset=utf-8', 'X-Not-Found': url.pathname },\n      });\n    } catch (e: any) {\n      console.error(e);\n      return new Response(String(e || 'Error'), {\n        status: 500,\n        headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'vercel-edge' },\n      });\n    }\n  }\n\n  return onVercelEdgeRequest;\n}\n\n/** @public */\nexport interface QwikCityVercelEdgeOptions extends ServerRenderOptions {}\n\n/** @public */\nexport interface PlatformVercel {}\n"
  },
  {
    "path": "packages/qwik-city/src/middleware/vercel-edge/middleware.vercel-edge.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\n// @public (undocumented)\nexport function createQwikCity(opts: QwikCityVercelEdgeOptions): (request: Request) => Promise<Response>;\n\n// @public (undocumented)\nexport interface PlatformVercel {\n}\n\n// @public (undocumented)\nexport interface QwikCityVercelEdgeOptions extends ServerRenderOptions {\n}\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/runtime/src/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik-city.runtime\",\n    \"reportFolder\": \"<projectFolder>/src/runtime/src/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/src/runtime\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/core/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/client-navigate.ts",
    "content": "import { isBrowser } from '@builder.io/qwik';\n// @ts-expect-error we don't have types for the preloader yet\nimport { p as preload } from '@builder.io/qwik/preloader';\nimport type { NavigationType, ScrollState } from './types';\nimport { isSamePath, toPath } from './utils';\n\nexport const clientNavigate = (\n  win: Window,\n  navType: NavigationType,\n  fromURL: URL,\n  toURL: URL,\n  replaceState = false\n) => {\n  if (navType !== 'popstate') {\n    const samePath = isSamePath(fromURL, toURL);\n    const sameHash = fromURL.hash === toURL.hash;\n\n    // TODO Refactor, some of this is redundant now.\n\n    if (!samePath || !sameHash) {\n      const newState = {\n        _qCityScroll: newScrollState(),\n      };\n\n      if (replaceState) {\n        win.history.replaceState(newState, '', toPath(toURL));\n      } else {\n        // push to history for path or hash changes\n        win.history.pushState(newState, '', toPath(toURL));\n      }\n    }\n  }\n};\n\nexport const newScrollState = (): ScrollState => {\n  return {\n    x: 0,\n    y: 0,\n    w: 0,\n    h: 0,\n  };\n};\n\nexport const preloadRouteBundles = (path: string, probability: number = 0.8) => {\n  if (isBrowser) {\n    path = path.endsWith('/') ? path : path + '/';\n    path = path.length > 1 && path.startsWith('/') ? path.slice(1) : path;\n    preload(path, probability);\n  }\n};\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/client-navigate.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { clientNavigate, newScrollState } from './client-navigate';\n\ntest('initialize and push empty scroll history state on navigate', () => {\n  const [win, urlOf] = createTestWindow('http://qwik.dev/');\n  assert.equal(win.history.state, null);\n\n  const scrollState = newScrollState();\n\n  clientNavigate(win, 'link', urlOf('/'), urlOf('/page-a'));\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n\n  clientNavigate(win, 'link', urlOf('/page-a'), urlOf('/page-b'));\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n\n  win.history.popState(-1);\n  clientNavigate(win, 'popstate', urlOf('/page-b'), urlOf('/page-a'));\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n\n  win.history.popState(-1);\n  clientNavigate(win, 'popstate', urlOf('/page-a'), urlOf('/'));\n  // This will be null, upgrading state only happens in QwikCityProvider.\n  // ClientNavigate only pushes new empty states for the scroll handler to use.\n  assert.equal(win.history.state, null);\n\n  assert.deepEqual(win.events(), []);\n});\n\ntest('pushState for different routes', () => {\n  const [win, urlOf] = createTestWindow('http://qwik.dev/page-a?search=123');\n  assert.equal(win.history.state, null);\n\n  const scrollState = newScrollState();\n\n  clientNavigate(win, 'link', urlOf('/page-a?search=123'), urlOf('/page-b?search=123'));\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n\n  clientNavigate(win, 'link', urlOf('/page-b?search=123'), urlOf('/page-b?param=456'));\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n\n  assert.deepEqual(win.events(), []);\n});\n\ntest('when passing replaceState', () => {\n  const [win, urlOf] = createTestWindow('http://qwik.dev/page-a?search=123');\n  assert.equal(win.history.state, null);\n\n  const scrollState = newScrollState();\n\n  const length = win.history.length;\n  clientNavigate(win, 'link', urlOf('/page-a?search=123'), urlOf('/page-a?search=456'), true);\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n  assert.equal(win.history.length, length);\n});\n\ntest('pushState for different hash', () => {\n  const [win, urlOf] = createTestWindow('http://qwik.dev/page-a?search=123#hash-1');\n  assert.equal(win.history.state, null);\n\n  const scrollState = newScrollState();\n\n  clientNavigate(\n    win,\n    'link',\n    urlOf('/page-a?search=123#hash-1'),\n    urlOf('/page-b?search=123#hash-2')\n  );\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n  assert.deepEqual(win.events(), []);\n\n  clientNavigate(\n    win,\n    'link',\n    urlOf('/page-b?search=123#hash-2'),\n    urlOf('/page-b?search=123#hash-3')\n  );\n  assert.deepEqual(win.history.state, { _qCityScroll: scrollState });\n});\n\nfunction createTestWindow<T>(href: string): [testWindow: TestWindow, urlOf: (path: string) => URL] {\n  const events: Event[] = [];\n  const historyEntries: { url: URL; state: T | null }[] = [{ url: new URL(href), state: null }];\n  let index = 0;\n\n  return [\n    {\n      HashChangeEvent: class {\n        type: 'hashchange';\n        newURL: string;\n        oldURL: string;\n        constructor(type: 'hashchange', { newURL, oldURL }: { newURL: string; oldURL: string }) {\n          this.type = type;\n          this.newURL = newURL;\n          this.oldURL = oldURL;\n        }\n      },\n      events() {\n        return events;\n      },\n      get location() {\n        return historyEntries[index].url;\n      },\n      dispatchEvent: (event: Event) => events.push(event),\n      history: {\n        popState: (delta: number) => {\n          const newIndex = index + delta;\n          if (newIndex < 0 || newIndex > historyEntries.length - 1) {\n            throw new Error(\n              `Invalid change to history position. current: ${index}, delta: ${delta}, length: ${historyEntries.length}`\n            );\n          }\n          index = newIndex;\n        },\n        pushState: (state: any, _: string, path: string) => {\n          ++index;\n          historyEntries.push({ url: new URL(path, href), state });\n        },\n        replaceState: (state: any, _: string, path: string) => {\n          historyEntries.splice(historyEntries.length - 1, 1, { url: new URL(path, href), state });\n          return historyEntries;\n        },\n        get length() {\n          return historyEntries.length;\n        },\n        get state() {\n          return historyEntries[index].state;\n        },\n      },\n    } as any,\n    (path: string) => new URL(path, href),\n  ];\n}\n\ninterface TestWindow extends Window {\n  events: () => Event[];\n  history: History & { popState: (delta: number) => void };\n}\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/constants.ts",
    "content": "import type { ClientPageData } from './types';\n\nexport const MODULE_CACHE = /*#__PURE__*/ new WeakMap<any, any>();\n\nexport const CLIENT_DATA_CACHE = new Map<string, Promise<ClientPageData | undefined>>();\n\nexport const QACTION_KEY = 'qaction';\n\nexport const QFN_KEY = 'qfunc';\n\nexport const QDATA_KEY = 'qdata';\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/contexts.ts",
    "content": "import { createContextId, type Signal } from '@builder.io/qwik';\nimport type {\n  ContentState,\n  ContentStateInternal,\n  ResolvedDocumentHead,\n  RouteAction,\n  RouteLocation,\n  RouteNavigate,\n  RoutePreventNavigate,\n} from './types';\n\nexport const RouteStateContext = /*#__PURE__*/ createContextId<Record<string, any>>('qc-s');\n\nexport const ContentContext = /*#__PURE__*/ createContextId<ContentState>('qc-c');\nexport const ContentInternalContext =\n  /*#__PURE__*/ createContextId<Signal<ContentStateInternal>>('qc-ic');\n\nexport const DocumentHeadContext =\n  /*#__PURE__*/ createContextId<Required<ResolvedDocumentHead>>('qc-h');\nexport const RouteLocationContext = /*#__PURE__*/ createContextId<RouteLocation>('qc-l');\n\nexport const RouteNavigateContext = /*#__PURE__*/ createContextId<RouteNavigate>('qc-n');\n\nexport const RouteActionContext = /*#__PURE__*/ createContextId<RouteAction>('qc-a');\n\nexport const RoutePreventNavigateContext =\n  /*#__PURE__*/ createContextId<RoutePreventNavigate>('qc-p');\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/error-boundary.tsx",
    "content": "import { component$, useErrorBoundary, Slot, type QRL, useOnWindow, $ } from '@builder.io/qwik';\n\n/** @public */\nexport interface ErrorBoundaryProps {\n  fallback$?: QRL<(error: any) => any>;\n}\n\n/** @public */\nexport const ErrorBoundary = component$((props: ErrorBoundaryProps) => {\n  const store = useErrorBoundary();\n\n  useOnWindow(\n    'qerror',\n    $((e: CustomEvent) => {\n      store.error = e.detail.error;\n    })\n  );\n\n  if (store.error && props.fallback$) {\n    return <>{props.fallback$(store.error)}</>;\n  }\n\n  return <Slot />;\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/form-component.tsx",
    "content": "import {\n  jsx,\n  _wrapSignal,\n  component$,\n  Slot,\n  $,\n  type QwikJSX,\n  type QRLEventHandlerMulti,\n} from '@builder.io/qwik';\nimport type { ActionStore } from './types';\nimport { useNavigate } from './use-functions';\n\n/** @public */\nexport interface FormSubmitCompletedDetail<T> {\n  status: number;\n  value: T;\n}\n\n/** @public */\nexport interface FormProps<O, I>\n  extends Omit<QwikJSX.IntrinsicElements['form'], 'action' | 'method'> {\n  /** Reference to the action returned by `action()`. */\n  action?: ActionStore<O, I, true | false>;\n\n  /**\n   * When `true` the form submission will cause a full page reload, even if SPA mode is enabled and\n   * JS is available.\n   */\n  reloadDocument?: boolean;\n\n  /**\n   * When `true` all the form inputs will be reset in SPA mode, just like happens in a full page\n   * form submission.\n   *\n   * Defaults to `false`\n   */\n  spaReset?: boolean;\n\n  /** Event handler executed right when the form is submitted. */\n  onSubmit$?: QRLEventHandlerMulti<SubmitEvent, HTMLFormElement> | undefined;\n\n  /** Event handler executed right after the action is executed successfully and returns some data. */\n  onSubmitCompleted$?:\n    | QRLEventHandlerMulti<CustomEvent<FormSubmitCompletedDetail<O>>, HTMLFormElement>\n    | undefined;\n\n  key?: string | number | null;\n}\n\n/** @public */\nexport const Form = <O, I>(\n  { action, spaReset, reloadDocument, onSubmit$, ...rest }: FormProps<O, I>,\n  key: string | null\n) => {\n  if (action) {\n    const isArrayApi = Array.isArray(onSubmit$);\n    // if you pass an array you can choose where you want action.submit in it\n    if (isArrayApi) {\n      return jsx(\n        'form',\n        {\n          ...rest,\n          action: action.actionPath,\n          'preventdefault:submit': !reloadDocument,\n          onSubmit$: [\n            ...onSubmit$,\n            // action.submit \"submitcompleted\" event for onSubmitCompleted$ events\n            !reloadDocument\n              ? $((evt: SubmitEvent) => {\n                  if (!action.submitted) {\n                    return action.submit(evt);\n                  }\n                })\n              : undefined,\n          ],\n          method: 'post',\n          ['data-spa-reset']: spaReset ? 'true' : undefined,\n        },\n        key\n      );\n    }\n    return jsx(\n      'form',\n      {\n        ...rest,\n        action: action.actionPath,\n        'preventdefault:submit': !reloadDocument,\n        onSubmit$: [\n          // action.submit \"submitcompleted\" event for onSubmitCompleted$ events\n          !reloadDocument ? action.submit : undefined,\n          // TODO: v2 breaking change this should fire before the action.submit\n          onSubmit$,\n        ],\n        method: 'post',\n        ['data-spa-reset']: spaReset ? 'true' : undefined,\n      },\n      key\n    );\n  } else {\n    return (\n      <GetForm\n        key={key}\n        spaReset={spaReset}\n        reloadDocument={reloadDocument}\n        onSubmit$={onSubmit$}\n        {...(rest as any)}\n      />\n    );\n  }\n};\n\nexport const GetForm = component$<FormProps<undefined, undefined>>(\n  ({ action, spaReset, reloadDocument, onSubmit$, ...rest }) => {\n    const nav = useNavigate();\n    return (\n      <form\n        action=\"get\"\n        preventdefault:submit={!reloadDocument}\n        data-spa-reset={spaReset ? 'true' : undefined}\n        {...rest}\n        onSubmit$={[\n          ...(Array.isArray(onSubmit$) ? onSubmit$ : [onSubmit$]),\n          $(async (_evt, form) => {\n            const formData = new FormData(form);\n            const params = new URLSearchParams();\n            formData.forEach((value, key) => {\n              if (typeof value === 'string') {\n                params.append(key, value);\n              }\n            });\n            await nav('?' + params.toString(), { type: 'form', forceReload: true });\n          }),\n          $((_evt, form) => {\n            if (form.getAttribute('data-spa-reset') === 'true') {\n              form.reset();\n            }\n            form.dispatchEvent(\n              new CustomEvent('submitcompleted', {\n                bubbles: false,\n                cancelable: false,\n                composed: false,\n                detail: {\n                  status: 200,\n                },\n              })\n            );\n            //\n          }),\n          // end of array\n        ]}\n      >\n        <Slot />\n      </form>\n    );\n  }\n);\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/head.ts",
    "content": "import { withLocale } from '@builder.io/qwik';\nimport type {\n  ContentModule,\n  RouteLocation,\n  EndpointResponse,\n  ResolvedDocumentHead,\n  DocumentHeadProps,\n  DocumentHeadValue,\n  ClientPageData,\n  LoaderInternal,\n  Editable,\n  ResolveSyncValue,\n  ActionInternal,\n} from './types';\nimport { isPromise } from './utils';\n\nexport const resolveHead = (\n  endpoint: EndpointResponse | ClientPageData,\n  routeLocation: RouteLocation,\n  contentModules: ContentModule[],\n  locale: string\n) => {\n  const head = createDocumentHead();\n  const getData = ((loaderOrAction: LoaderInternal | ActionInternal) => {\n    const id = loaderOrAction.__id;\n    if (loaderOrAction.__brand === 'server_loader') {\n      if (!(id in endpoint.loaders)) {\n        throw new Error(\n          'You can not get the returned data of a loader that has not been executed for this request.'\n        );\n      }\n    }\n    const data = endpoint.loaders[id];\n    if (isPromise(data)) {\n      throw new Error('Loaders returning a promise can not be resolved for the head function.');\n    }\n    return data;\n  }) as any as ResolveSyncValue;\n  const headProps: DocumentHeadProps = {\n    head,\n    withLocale: (fn) => withLocale(locale, fn),\n    resolveValue: getData,\n    ...routeLocation,\n  };\n\n  for (let i = contentModules.length - 1; i >= 0; i--) {\n    const contentModuleHead = contentModules[i] && contentModules[i].head;\n    if (contentModuleHead) {\n      if (typeof contentModuleHead === 'function') {\n        resolveDocumentHead(\n          head,\n          withLocale(locale, () => contentModuleHead(headProps))\n        );\n      } else if (typeof contentModuleHead === 'object') {\n        resolveDocumentHead(head, contentModuleHead);\n      }\n    }\n  }\n\n  return headProps.head;\n};\n\nconst resolveDocumentHead = (\n  resolvedHead: Editable<ResolvedDocumentHead>,\n  updatedHead: DocumentHeadValue\n) => {\n  if (typeof updatedHead.title === 'string') {\n    resolvedHead.title = updatedHead.title;\n  }\n  mergeArray(resolvedHead.meta as any, updatedHead.meta);\n  mergeArray(resolvedHead.links as any, updatedHead.links);\n  mergeArray(resolvedHead.styles as any, updatedHead.styles);\n  mergeArray(resolvedHead.scripts as any, updatedHead.scripts);\n  Object.assign(resolvedHead.frontmatter, updatedHead.frontmatter);\n};\n\nconst mergeArray = (\n  existingArr: { key?: string }[],\n  newArr: readonly { key?: string }[] | undefined\n) => {\n  if (Array.isArray(newArr)) {\n    for (const newItem of newArr) {\n      if (typeof newItem.key === 'string') {\n        const existingIndex = existingArr.findIndex((i) => i.key === newItem.key);\n        if (existingIndex > -1) {\n          existingArr[existingIndex] = newItem;\n          continue;\n        }\n      }\n      existingArr.push(newItem);\n    }\n  }\n};\n\nexport const createDocumentHead = (): ResolvedDocumentHead => ({\n  title: '',\n  meta: [],\n  links: [],\n  styles: [],\n  scripts: [],\n  frontmatter: {},\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/index.ts",
    "content": "export type { FormSubmitCompletedDetail as FormSubmitSuccessDetail } from './form-component';\n\nexport type {\n  Action,\n  ActionConstructor,\n  ActionStore,\n  ContentHeading,\n  ContentMenu,\n  Cookie,\n  CookieOptions,\n  CookieValue,\n  DeferReturn,\n  DocumentHead,\n  DocumentHeadProps,\n  DocumentHeadValue,\n  DocumentLink,\n  DocumentMeta,\n  DocumentScript,\n  DocumentStyle,\n  FailReturn,\n  JSONObject,\n  JSONValue,\n  Loader,\n  LoaderSignal,\n  MenuData,\n  NavigationType,\n  PageModule,\n  PathParams,\n  PreventNavigateCallback,\n  QwikCityPlan,\n  RequestEvent,\n  RequestEventAction,\n  RequestEventBase,\n  RequestEventCommon,\n  RequestEventLoader,\n  RequestHandler,\n  ResolvedDocumentHead,\n  RouteData,\n  RouteLocation,\n  RouteNavigate,\n  StaticGenerate,\n  StaticGenerateHandler,\n  ValidatorErrorKeyDotNotation,\n  ValidatorErrorType,\n  ZodConstructor,\n} from './types';\n\nexport { RouterOutlet } from './router-outlet-component';\nexport {\n  type QwikCityProps,\n  QwikCityProvider,\n  type QwikCityMockProps,\n  type QwikCityMockLoaderProp,\n  type QwikCityMockActionProp,\n  QwikCityMockProvider,\n  QWIK_CITY_SCROLLER,\n} from './qwik-city-component';\nexport { type LinkProps, Link } from './link-component';\nexport { ServiceWorkerRegister } from './sw-component';\nexport { useDocumentHead, useLocation, useContent, useNavigate } from './use-functions';\nexport { usePreventNavigate$, usePreventNavigateQrl } from './use-functions';\nexport { routeAction$, routeActionQrl } from './server-functions';\nexport { globalAction$, globalActionQrl } from './server-functions';\nexport { routeLoader$, routeLoaderQrl } from './server-functions';\nexport { server$, serverQrl } from './server-functions';\nexport { valibot$, valibotQrl } from './server-functions';\nexport { zod$, zodQrl } from './server-functions';\nexport { validator$, validatorQrl } from './server-functions';\nexport { ErrorBoundary } from './error-boundary';\n\nexport { z } from 'zod';\n\nexport { Form } from './form-component';\nexport type { FormProps } from './form-component';\n\nexport type {\n  TypedDataValidator,\n  DataValidator,\n  GetValidatorType,\n  GetValidatorInputType,\n  GetValidatorOutputType,\n  FailOfRest,\n  ActionReturn,\n  StrictUnion,\n  ValidatorReturn,\n  ServerQRL,\n  ServerFunction,\n} from './types';\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/link-component.tsx",
    "content": "import {\n  component$,\n  Slot,\n  type QwikIntrinsicElements,\n  $,\n  sync$,\n  useSignal,\n  useVisibleTask$,\n  untrack,\n  type EventHandler,\n  type QwikVisibleEvent,\n} from '@builder.io/qwik';\nimport { getClientNavPath, shouldPreload } from './utils';\nimport { loadClientData } from './use-endpoint';\nimport { useLocation, useNavigate } from './use-functions';\nimport { preloadRouteBundles } from './client-navigate';\nimport { isDev } from '@builder.io/qwik';\n// @ts-expect-error we don't have types for the preloader yet\nimport { p as preload } from '@builder.io/qwik/preloader';\n\n/** @public */\nexport const Link = component$<LinkProps>((props) => {\n  const nav = useNavigate();\n  const loc = useLocation();\n  const originalHref = props.href;\n  const anchorRef = useSignal<HTMLAnchorElement>();\n  const {\n    onClick$,\n    prefetch: prefetchProp,\n    reload,\n    replaceState,\n    scroll,\n    ...linkProps\n  } = (() => props)();\n  const clientNavPath = untrack(getClientNavPath, { ...linkProps, reload }, loc);\n  linkProps.href = clientNavPath || originalHref;\n\n  const prefetchData =\n    (!!clientNavPath && prefetchProp !== false && prefetchProp !== 'js') || undefined;\n\n  const prefetch =\n    prefetchData ||\n    (!!clientNavPath && prefetchProp !== false && untrack(shouldPreload, clientNavPath, loc));\n\n  const handlePrefetch = prefetch\n    ? $((_: any, elm: HTMLAnchorElement) => {\n        if ((navigator as any).connection?.saveData) {\n          return;\n        }\n\n        if (elm && elm.href) {\n          const url = new URL(elm.href);\n          preloadRouteBundles(url.pathname);\n\n          if (elm.hasAttribute('data-prefetch')) {\n            loadClientData(url, elm, {\n              preloadRouteBundles: false,\n              isPrefetch: true,\n            });\n          }\n        }\n      })\n    : undefined;\n\n  const preventDefault = clientNavPath\n    ? sync$((event: MouseEvent, target: HTMLAnchorElement) => {\n        if (!(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) {\n          event.preventDefault();\n        }\n      })\n    : undefined;\n\n  const handleClientSideNavigation = clientNavPath\n    ? $(async (event: Event, elm: HTMLAnchorElement) => {\n        if (event.defaultPrevented) {\n          // If default was prevented, then it is up to us to make client side navigation.\n          if (elm.hasAttribute('q:nbs')) {\n            // Allow bootstrapping into useNavigate.\n            await nav(location.href, { type: 'popstate' });\n          } else if (elm.href) {\n            elm.setAttribute('aria-pressed', 'true');\n            await nav(elm.href, { forceReload: reload, replaceState, scroll });\n            elm.removeAttribute('aria-pressed');\n          }\n        }\n      })\n    : undefined;\n\n  const handlePreload = $((_: any, elm: HTMLAnchorElement) => {\n    const url = new URL(elm.href);\n    preloadRouteBundles(url.pathname, 1);\n  });\n\n  useVisibleTask$(({ track }) => {\n    track(() => loc.url.pathname);\n    // We need to trigger the onQVisible$ in the visible task for it to fire on subsequent route navigations\n    const handler = linkProps.onQVisible$;\n    if (handler) {\n      const event = new CustomEvent('qvisible') as QwikVisibleEvent;\n\n      if (Array.isArray(handler)) {\n        (handler as any)\n          .flat(10)\n          .forEach((handler: EventHandler<QwikVisibleEvent, HTMLAnchorElement>) =>\n            handler?.(event, anchorRef.value!)\n          );\n      } else {\n        handler?.(event, anchorRef.value!);\n      }\n    }\n\n    // Don't prefetch on visible in dev mode\n    if (!isDev && anchorRef.value) {\n      handlePrefetch?.(undefined, anchorRef.value!);\n    }\n  });\n\n  return (\n    <a\n      ref={anchorRef}\n      // Attr 'q:link' is used as a selector for bootstrapping into spa after context loss\n      {...{ 'q:link': !!clientNavPath }}\n      {...linkProps}\n      onClick$={[\n        preventDefault,\n        handlePreload, // needs to be in between preventDefault and onClick$ to ensure it starts asap.\n        onClick$,\n        handleClientSideNavigation,\n      ]}\n      data-prefetch={prefetchData}\n      onMouseOver$={[linkProps.onMouseOver$, handlePrefetch]}\n      onFocus$={[linkProps.onFocus$, handlePrefetch]}\n      // We need to prevent the onQVisible$ from being called twice since it is handled in the visible task\n      onQVisible$={[]}\n    >\n      <Slot />\n    </a>\n  );\n});\n\ntype AnchorAttributes = QwikIntrinsicElements['a'];\n\n/** @public */\nexport interface LinkProps extends AnchorAttributes {\n  /**\n   * **Defaults to _true_.**\n   *\n   * Whether Qwik should prefetch and cache the target page of this **`Link`**, this includes\n   * invoking any **`routeLoader$`**, **`onGet`**, etc.\n   *\n   * This **improves UX performance** for client-side (**SPA**) navigations.\n   *\n   * Prefetching occurs when a the Link enters the viewport in production (**`on:qvisible`**), or\n   * with **`mouseover`/`focus`** during dev.\n   *\n   * Prefetching will not occur if the user has the **data saver** setting enabled.\n   *\n   * Setting this value to **`\"js\"`** will prefetch only javascript bundles required to render this\n   * page on the client, **`false`** will disable prefetching altogether.\n   */\n  prefetch?: boolean | 'js';\n\n  reload?: boolean;\n  replaceState?: boolean;\n  scroll?: boolean;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/qwik-city-component.tsx",
    "content": "import {\n  $,\n  component$,\n  getLocale,\n  noSerialize,\n  Slot,\n  useContextProvider,\n  useServerData,\n  useSignal,\n  useStore,\n  useTask$,\n  _getContextElement,\n  _weakSerialize,\n  useStyles$,\n  _waitUntilRendered,\n  type QRL,\n  type ValueOrPromise,\n} from '@builder.io/qwik';\nimport { isBrowser, isDev, isServer } from '@builder.io/qwik';\nimport * as qwikCity from '@qwik-city-plan';\nimport { CLIENT_DATA_CACHE } from './constants';\nimport {\n  ContentContext,\n  ContentInternalContext,\n  DocumentHeadContext,\n  RouteActionContext,\n  RouteLocationContext,\n  RouteNavigateContext,\n  RoutePreventNavigateContext,\n  RouteStateContext,\n} from './contexts';\nimport { createDocumentHead, resolveHead } from './head';\nimport { loadRoute } from './routing';\nimport type {\n  Action,\n  ActionInternal,\n  ClientPageData,\n  ContentModule,\n  ContentState,\n  ContentStateInternal,\n  Editable,\n  EndpointResponse,\n  LoadedRoute,\n  Loader,\n  LoaderInternal,\n  MutableRouteLocation,\n  PageModule,\n  PreventNavigateCallback,\n  ResolvedDocumentHead,\n  RouteActionResolver,\n  RouteActionValue,\n  RouteNavigate,\n  RouteStateInternal,\n  ScrollState,\n} from './types';\nimport { loadClientData } from './use-endpoint';\nimport { useQwikCityEnv } from './use-functions';\nimport { isSameOrigin, isSamePath, toUrl } from './utils';\nimport { clientNavigate } from './client-navigate';\nimport {\n  currentScrollState,\n  getScrollHistory,\n  saveScrollHistory,\n  restoreScroll,\n} from './scroll-restoration';\nimport spaInit from './spa-init';\n\n/** @public */\nexport const QWIK_CITY_SCROLLER = '_qCityScroller';\n\n/** @public */\nexport interface QwikCityProps {\n  // /**\n  //  * The QwikCity component must have only two direct children: `<head>` and `<body>`, like the following example:\n  //  *\n  //  * ```tsx\n  //  * <QwikCityProvider>\n  //  *   <head>\n  //  *     <meta charset=\"utf-8\" />\n  //  *   </head>\n  //  *   <body lang=\"en\"></body>\n  //  * </QwikCityProvider>\n  //  * ```\n  //  */\n  // children?: [JSXNode, JSXNode];\n\n  /**\n   * Enable the ViewTransition API\n   *\n   * Default: `true`\n   *\n   * @see https://github.com/WICG/view-transitions/blob/main/explainer.md\n   * @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API\n   * @see https://caniuse.com/mdn-api_viewtransition\n   */\n  viewTransition?: boolean;\n}\n\n// Gets populated by registerPreventNav on the client\nconst preventNav: {\n  $cbs$?: Set<QRL<PreventNavigateCallback>> | undefined;\n  $handler$?: (event: BeforeUnloadEvent) => void;\n} = {};\n\n// Track navigations during prevent so we don't overwrite\n// We need to use an object so we can write into it from qrls\nconst internalState = { navCount: 0 };\n\n/** @public */\nexport const QwikCityProvider = component$<QwikCityProps>((props) => {\n  useStyles$(`:root{view-transition-name:none}`);\n  const env = useQwikCityEnv();\n  if (!env?.params) {\n    throw new Error(\n      `Missing Qwik City Env Data for help visit https://github.com/QwikDev/qwik/issues/6237`\n    );\n  }\n\n  const urlEnv = useServerData<string>('url');\n  if (!urlEnv) {\n    throw new Error(`Missing Qwik URL Env Data`);\n  }\n\n  if (isServer) {\n    if (\n      env!.ev.originalUrl.pathname !== env!.ev.url.pathname &&\n      !__EXPERIMENTAL__.enableRequestRewrite\n    ) {\n      throw new Error(\n        `enableRequestRewrite is an experimental feature and is not enabled. Please enable the feature flag by adding \\`experimental: [\"enableRequestRewrite\"]\\` to your qwikVite plugin options.`\n      );\n    }\n  }\n\n  const url = new URL(urlEnv);\n  const routeLocation = useStore<MutableRouteLocation>(\n    {\n      url,\n      params: env.params,\n      isNavigating: false,\n      prevUrl: undefined,\n    },\n    { deep: false }\n  );\n  const navResolver: { r?: () => void } = {};\n  const loaderState = _weakSerialize(useStore(env.response.loaders, { deep: false }));\n\n  // The initial state of routeInternal uses the URL provided by the server environment.\n  // It may not be accurate to the actual URL the browser is accessing the site from.\n  // It is useful for the purposes of SSR and SSG, but may be overridden browser-side\n  // if needed for SPA routing.\n  const routeInternal = useSignal<RouteStateInternal>({\n    type: 'initial',\n    dest: url,\n    forceReload: false,\n    replaceState: false,\n    scroll: true,\n  });\n\n  const documentHead = useStore<Editable<ResolvedDocumentHead>>(createDocumentHead);\n  const content = useStore<Editable<ContentState>>({\n    headings: undefined,\n    menu: undefined,\n  });\n\n  const contentInternal = useSignal<ContentStateInternal>();\n\n  const currentActionId = env.response.action;\n  const currentAction = currentActionId ? env.response.loaders[currentActionId] : undefined;\n  const actionState = useSignal<RouteActionValue>(\n    currentAction\n      ? {\n          id: currentActionId!,\n          data: env.response.formData,\n          output: {\n            result: currentAction,\n            status: env.response.status,\n          },\n        }\n      : undefined\n  );\n\n  const registerPreventNav = $((fn$: QRL<PreventNavigateCallback>) => {\n    if (!isBrowser) {\n      return;\n    }\n    preventNav.$handler$ ||= (event: BeforeUnloadEvent) => {\n      // track navigations during prevent so we don't overwrite\n      internalState.navCount++;\n      if (!preventNav.$cbs$) {\n        return;\n      }\n      const prevents = [...preventNav.$cbs$.values()].map((cb) =>\n        cb.resolved ? cb.resolved() : cb()\n      );\n      // this catches both true and Promise<any>\n      // we assume a Promise means to prevent the navigation\n      if (prevents.some(Boolean)) {\n        event.preventDefault();\n        // legacy support\n        event.returnValue = true;\n      }\n    };\n\n    (preventNav.$cbs$ ||= new Set()).add(fn$);\n    // we need the QRLs to be synchronous if possible, for the beforeunload event\n    fn$.resolve();\n    // TS thinks we're a webworker and doesn't know about beforeunload\n    (window as any).addEventListener('beforeunload', preventNav.$handler$);\n\n    return () => {\n      if (preventNav.$cbs$) {\n        preventNav.$cbs$.delete(fn$);\n        if (!preventNav.$cbs$.size) {\n          preventNav.$cbs$ = undefined;\n          // unregister the event listener if no more callbacks, to make older Firefox happy\n          (window as any).removeEventListener('beforeunload', preventNav.$handler$);\n        }\n      }\n    };\n  });\n\n  const goto: RouteNavigate = $(async (path, opt) => {\n    const {\n      type = 'link',\n      forceReload = path === undefined, // Hack for nav() because this API is already set.\n      replaceState = false,\n      scroll = true,\n    } = typeof opt === 'object' ? opt : { forceReload: opt };\n    internalState.navCount++;\n\n    // If this is the first SPA navigation, we rewrite routeInternal's URL\n    // as the browser location URL to prevent an erroneous origin mismatch.\n    // The initial value of routeInternal is derived from the server env,\n    // which in the case of SSG may not match the actual origin the site\n    // is deployed on.\n    if (isBrowser && type === 'link' && routeInternal.value.type === 'initial') {\n      const url = new URL(window.location.href);\n      routeInternal.value.dest = url;\n      routeLocation.url = url;\n    }\n\n    const lastDest = routeInternal.value.dest;\n    const dest =\n      path === undefined\n        ? lastDest\n        : typeof path === 'number'\n          ? path\n          : toUrl(path, routeLocation.url);\n\n    if (\n      preventNav.$cbs$ &&\n      (forceReload ||\n        typeof dest === 'number' ||\n        !isSamePath(dest, lastDest) ||\n        !isSameOrigin(dest, lastDest))\n    ) {\n      const ourNavId = internalState.navCount;\n      const prevents = await Promise.all([...preventNav.$cbs$.values()].map((cb) => cb(dest)));\n      if (ourNavId !== internalState.navCount || prevents.some(Boolean)) {\n        if (ourNavId === internalState.navCount && type === 'popstate') {\n          // Popstate events are not cancellable, so we push to undo\n          // TODO keep state?\n          history.pushState(null, '', lastDest);\n        }\n        return;\n      }\n    }\n\n    if (typeof dest === 'number') {\n      if (isBrowser) {\n        history.go(dest);\n      }\n      return;\n    }\n\n    if (!isSameOrigin(dest, lastDest)) {\n      // Cross-origin nav() should always abort early.\n      if (isBrowser) {\n        location.href = dest.href;\n      }\n      return;\n    }\n\n    if (!forceReload && isSamePath(dest, lastDest)) {\n      if (isBrowser) {\n        // Use `location.href` because the lastDest signal is only updated on page navigates.\n        if (type === 'link' && dest.href !== location.href) {\n          history.pushState(null, '', dest);\n        }\n\n        // Always scroll on same-page popstates, #hash clicks, or links.\n        const scroller = document.getElementById(QWIK_CITY_SCROLLER) ?? document.documentElement;\n        restoreScroll(type, dest, new URL(location.href), scroller, getScrollHistory());\n\n        if (type === 'popstate') {\n          (window as ClientSPAWindow)._qCityScrollEnabled = true;\n        }\n      }\n\n      // Update routeLocation.url on hash/search-only changes so components react to the new URL\n      if (dest.href !== routeLocation.url.href) {\n        const newUrl = new URL(dest.href);\n        routeInternal.value.dest = newUrl;\n        routeLocation.url = newUrl;\n      }\n\n      return;\n    }\n\n    routeInternal.value = { type, dest, forceReload, replaceState, scroll };\n\n    if (isBrowser) {\n      loadClientData(dest, _getContextElement());\n      loadRoute(qwikCity.routes, qwikCity.menus, qwikCity.cacheModules, dest.pathname);\n    }\n\n    actionState.value = undefined;\n    routeLocation.isNavigating = true;\n\n    return new Promise<void>((resolve) => {\n      navResolver.r = resolve;\n    });\n  });\n\n  useContextProvider(ContentContext, content);\n  useContextProvider(ContentInternalContext, contentInternal);\n  useContextProvider(DocumentHeadContext, documentHead);\n  useContextProvider(RouteLocationContext, routeLocation);\n  useContextProvider(RouteNavigateContext, goto);\n  useContextProvider(RouteStateContext, loaderState);\n  useContextProvider(RouteActionContext, actionState);\n  useContextProvider<any>(RoutePreventNavigateContext, registerPreventNav);\n\n  useTask$(({ track }) => {\n    async function run() {\n      const navigation = track(routeInternal);\n      const action = track(actionState);\n\n      const locale = getLocale('');\n      const prevUrl = routeLocation.url;\n      const navType = action ? 'form' : navigation.type;\n      const replaceState = navigation.replaceState;\n      let trackUrl: URL;\n      let clientPageData: EndpointResponse | ClientPageData | undefined;\n      let loadedRoute: LoadedRoute | null = null;\n      let elm: unknown;\n      if (isServer) {\n        // server\n        trackUrl = new URL(navigation.dest, routeLocation.url);\n        loadedRoute = env!.loadedRoute;\n        clientPageData = env!.response;\n      } else {\n        // client\n        trackUrl = new URL(navigation.dest, location as any as URL);\n\n        // ensure correct trailing slash\n        if (trackUrl.pathname.endsWith('/')) {\n          if (!qwikCity.trailingSlash) {\n            trackUrl.pathname = trackUrl.pathname.slice(0, -1);\n          }\n        } else if (qwikCity.trailingSlash) {\n          trackUrl.pathname += '/';\n        }\n        let loadRoutePromise = loadRoute(\n          qwikCity.routes,\n          qwikCity.menus,\n          qwikCity.cacheModules,\n          trackUrl.pathname\n        );\n        elm = _getContextElement();\n        const pageData = (clientPageData = await loadClientData(trackUrl, elm, {\n          action,\n          clearCache: true,\n        }));\n        if (!pageData) {\n          // Reset the path to the current path\n          (routeInternal as any).untrackedValue = { type: navType, dest: trackUrl };\n          return;\n        }\n        const newHref = pageData.href;\n        const newURL = new URL(newHref, trackUrl);\n        if (!isSamePath(newURL, trackUrl)) {\n          // Change our path to the canonical path in the response unless rewrite.\n          if (!pageData.isRewrite) {\n            trackUrl = newURL;\n          }\n\n          loadRoutePromise = loadRoute(\n            qwikCity.routes,\n            qwikCity.menus,\n            qwikCity.cacheModules,\n            newURL.pathname // Load the actual required path.\n          );\n        }\n\n        try {\n          loadedRoute = await loadRoutePromise;\n        } catch (e) {\n          console.error(e);\n          window.location.href = newHref;\n          return;\n        }\n      }\n\n      if (loadedRoute) {\n        const [routeName, params, mods, menu] = loadedRoute;\n        const contentModules = mods as ContentModule[];\n        const pageModule = contentModules[contentModules.length - 1] as PageModule;\n\n        // Restore search params unless it's a redirect\n        if (navigation.dest.search && !!isSamePath(trackUrl, prevUrl)) {\n          trackUrl.search = navigation.dest.search;\n        }\n\n        // Update route location\n        if (!isSamePath(trackUrl, prevUrl)) {\n          routeLocation.prevUrl = prevUrl;\n        }\n\n        routeLocation.url = trackUrl;\n        routeLocation.params = { ...params };\n\n        (routeInternal as any).untrackedValue = { type: navType, dest: trackUrl };\n\n        // Needs to be done after routeLocation is updated\n        const resolvedHead = resolveHead(clientPageData!, routeLocation, contentModules, locale);\n\n        // Update content\n        content.headings = pageModule.headings;\n        content.menu = menu;\n        contentInternal.value = noSerialize(contentModules);\n\n        // Update document head\n        documentHead.links = resolvedHead.links;\n        documentHead.meta = resolvedHead.meta;\n        documentHead.styles = resolvedHead.styles;\n        documentHead.scripts = resolvedHead.scripts;\n        documentHead.title = resolvedHead.title;\n        documentHead.frontmatter = resolvedHead.frontmatter;\n\n        if (isBrowser) {\n          if (props.viewTransition !== false) {\n            // mark next DOM render to use startViewTransition API\n            (document as any).__q_view_transition__ = true;\n          }\n\n          let scrollState: ScrollState | undefined;\n          if (navType === 'popstate') {\n            scrollState = getScrollHistory();\n          }\n          const scroller = document.getElementById(QWIK_CITY_SCROLLER) ?? document.documentElement;\n\n          if (\n            (navigation.scroll &&\n              (!navigation.forceReload || !isSamePath(trackUrl, prevUrl)) &&\n              (navType === 'link' || navType === 'popstate')) ||\n            // Action might have responded with a redirect.\n            (navType === 'form' && !isSamePath(trackUrl, prevUrl))\n          ) {\n            // Mark next DOM render to scroll.\n            (document as any).__q_scroll_restore__ = () =>\n              restoreScroll(navType, trackUrl, prevUrl, scroller, scrollState);\n          }\n\n          const loaders = clientPageData?.loaders;\n          const win = window as ClientSPAWindow;\n          if (loaders) {\n            Object.assign(loaderState, loaders);\n          }\n          CLIENT_DATA_CACHE.clear();\n\n          if (!win._qCitySPA) {\n            // only add event listener once\n            win._qCitySPA = true;\n            history.scrollRestoration = 'manual';\n\n            win.addEventListener('popstate', () => {\n              // Disable scroll handler eagerly to prevent overwriting history.state.\n              win._qCityScrollEnabled = false;\n              clearTimeout(win._qCityScrollDebounce);\n\n              goto(location.href, {\n                type: 'popstate',\n              });\n            });\n\n            win.removeEventListener('popstate', win._qCityInitPopstate!);\n            win._qCityInitPopstate = undefined;\n\n            // Browsers natively will remember scroll on ALL history entries, incl. custom pushState.\n            // Devs could push their own states that we can't control.\n            // If a user doesn't initiate scroll after, it will not have any scrollState.\n            // We patch these to always include scrollState.\n            // TODO Block this after Navigation API PR, browsers that support it have a Navigation API solution.\n            if (!win._qCityHistoryPatch) {\n              win._qCityHistoryPatch = true;\n              const pushState = history.pushState;\n              const replaceState = history.replaceState;\n\n              const prepareState = (state: any) => {\n                if (state === null || typeof state === 'undefined') {\n                  state = {};\n                } else if (state?.constructor !== Object) {\n                  state = { _data: state };\n\n                  if (isDev) {\n                    console.warn(\n                      'In a Qwik SPA context, `history.state` is used to store scroll state. ' +\n                        'Direct calls to `pushState()` and `replaceState()` must supply an actual Object type. ' +\n                        'We need to be able to automatically attach the scroll state to your state object. ' +\n                        'A new state object has been created, your data has been moved to: `history.state._data`'\n                    );\n                  }\n                }\n\n                state._qCityScroll = state._qCityScroll || currentScrollState(scroller);\n                return state;\n              };\n\n              history.pushState = (state, title, url) => {\n                state = prepareState(state);\n                return pushState.call(history, state, title, url);\n              };\n\n              history.replaceState = (state, title, url) => {\n                state = prepareState(state);\n                return replaceState.call(history, state, title, url);\n              };\n            }\n\n            // Chromium and WebKit fire popstate+hashchange for all #anchor clicks,\n            // ... even if the URL is already on the #hash.\n            // Firefox only does it once and no more, but will still scroll. It also sets state to null.\n            // Any <a> tags w/ #hash href will break SPA state in Firefox.\n            // We patch these events and direct them to Link pipeline during SPA.\n            document.addEventListener('click', (event) => {\n              if (event.defaultPrevented) {\n                return;\n              }\n\n              const target = (event.target as HTMLElement).closest('a[href]');\n\n              if (target && !target.hasAttribute('preventdefault:click')) {\n                const href = target.getAttribute('href')!;\n                const prev = new URL(location.href);\n                const dest = new URL(href, prev);\n                // Patch only same-page anchors.\n                if (isSameOrigin(dest, prev) && isSamePath(dest, prev)) {\n                  event.preventDefault();\n\n                  // Simulate same-page (no hash) anchor reload.\n                  // history.scrollRestoration = 'manual' makes these not scroll.\n                  if (!dest.hash && !dest.href.endsWith('#')) {\n                    if (dest.href !== prev.href) {\n                      history.pushState(null, '', dest);\n                    }\n\n                    win._qCityScrollEnabled = false;\n                    clearTimeout(win._qCityScrollDebounce);\n                    saveScrollHistory({\n                      ...currentScrollState(scroller),\n                      x: 0,\n                      y: 0,\n                    });\n                    location.reload();\n                    return;\n                  }\n\n                  goto(target.getAttribute('href')!);\n                }\n              }\n            });\n\n            document.removeEventListener('click', win._qCityInitAnchors!);\n            win._qCityInitAnchors = undefined;\n\n            // TODO Remove block after Navigation API PR.\n            // Calling `history.replaceState` during `visibilitychange` in Chromium will nuke BFCache.\n            // Only Chromium 96 - 101 have BFCache without Navigation API. (<1% of users)\n            if (!(window as any).navigation) {\n              // Commit scrollState on refresh, cross-origin navigation, mobile view changes, etc.\n              document.addEventListener(\n                'visibilitychange',\n                () => {\n                  if (win._qCityScrollEnabled && document.visibilityState === 'hidden') {\n                    // Last & most reliable point to commit state.\n                    // Do not clear timeout here in case debounce gets to run later.\n                    const scrollState = currentScrollState(scroller);\n                    saveScrollHistory(scrollState);\n                  }\n                },\n                { passive: true }\n              );\n\n              document.removeEventListener('visibilitychange', win._qCityInitVisibility!);\n              win._qCityInitVisibility = undefined;\n            }\n\n            win.addEventListener(\n              'scroll',\n              () => {\n                if (!win._qCityScrollEnabled) {\n                  return;\n                }\n\n                clearTimeout(win._qCityScrollDebounce);\n                win._qCityScrollDebounce = setTimeout(() => {\n                  const scrollState = currentScrollState(scroller);\n                  saveScrollHistory(scrollState);\n                  // Needed for e2e debounceDetector.\n                  win._qCityScrollDebounce = undefined;\n                }, 200);\n              },\n              { passive: true }\n            );\n\n            removeEventListener('scroll', win._qCityInitScroll!);\n            win._qCityInitScroll = undefined;\n\n            win._qCityBootstrap?.remove();\n            win._qCityBootstrap = undefined;\n\n            // Cache SPA recovery script.\n            spaInit.resolve();\n          }\n\n          if (navType !== 'popstate') {\n            win._qCityScrollEnabled = false;\n            clearTimeout(win._qCityScrollDebounce);\n\n            // Save the final scroll state before pushing new state.\n            // Upgrades/replaces state with scroll pos on nav as needed.\n            const scrollState = currentScrollState(scroller);\n            saveScrollHistory(scrollState);\n          }\n\n          clientNavigate(window, navType, prevUrl, trackUrl, replaceState);\n          _waitUntilRendered(elm as Element).then(() => {\n            const container = getContainer(elm as Element);\n            container.setAttribute('q:route', routeName);\n            const scrollState = currentScrollState(scroller);\n            saveScrollHistory(scrollState);\n            win._qCityScrollEnabled = true;\n\n            routeLocation.isNavigating = false;\n            navResolver.r?.();\n          });\n        }\n      }\n    }\n    const promise = run();\n    if (isServer) {\n      return promise;\n    } else {\n      return;\n    }\n  });\n\n  return <Slot />;\n});\n\nfunction getContainer(elm: Node): HTMLElement {\n  while (elm && elm.nodeType !== Node.ELEMENT_NODE) {\n    elm = elm.parentElement as Element;\n  }\n  return (elm as Element).closest('[q\\\\:container]') as HTMLElement;\n}\n\n/** @public */\nexport interface QwikCityMockLoaderProp<T = any> {\n  /** The loader function to mock. */\n  loader: Loader<T>;\n\n  /** The data to return when the loader is called. */\n  data: T;\n}\n\n/** @public */\nexport interface QwikCityMockActionProp<T = any> {\n  /** The action function to mock. */\n  action: Action<T>;\n\n  /** The QRL function that will be called when the action is submitted. */\n  handler: QRL<(data: T) => ValueOrPromise<RouteActionResolver>>;\n}\n\n/** @public */\nexport interface QwikCityMockProps {\n  /**\n   * Allow mocking the url returned by `useLocation` hook.\n   *\n   * Default: `http://localhost/`\n   */\n  url?: string;\n\n  /** Allow mocking the route params returned by `useLocation` hook. */\n  params?: Record<string, string>;\n\n  /** Allow mocking the `goto` function returned by `useNavigate` hook. */\n  goto?: RouteNavigate;\n\n  /**\n   * Allow mocking data for loaders defined with `routeLoader$` function.\n   *\n   * ```\n   * [\n   *   {\n   *     loader: useProductData,\n   *     data: { product: { name: 'Test Product' } },\n   *   },\n   * ];\n   * ```\n   */\n  loaders?: Array<QwikCityMockLoaderProp<any>>;\n\n  /**\n   * Allow mocking actions defined with `routeAction$` function.\n   *\n   * ```\n   * [\n   *   {\n   *     action: useAddUser,\n   *     handler: $(async (data) => {\n   *       console.log('useAddUser action called with data:', data);\n   *     }),\n   *   },\n   * ];\n   * ```\n   */\n  actions?: Array<QwikCityMockActionProp<any>>;\n}\n\n/** @public */\nexport const QwikCityMockProvider = component$<QwikCityMockProps>((props) => {\n  const urlEnv = props.url ?? 'http://localhost/';\n  const url = new URL(urlEnv);\n  const routeLocation = useStore<MutableRouteLocation>(\n    {\n      url,\n      params: props.params ?? {},\n      isNavigating: false,\n      prevUrl: undefined,\n    },\n    { deep: false }\n  );\n\n  const loadersData = props.loaders?.reduce(\n    (acc, { loader, data }) => {\n      acc[(loader as LoaderInternal).__id] = data;\n      return acc;\n    },\n    {} as Record<string, QwikCityMockLoaderProp['data']>\n  );\n  const loaderState = useStore(loadersData ?? {}, { deep: false });\n\n  const goto: RouteNavigate =\n    props.goto ??\n    $(async () => {\n      console.warn('QwikCityMockProvider: goto not provided');\n    });\n\n  const documentHead = useStore(createDocumentHead, { deep: false });\n\n  const content = useStore<ContentState>(\n    {\n      headings: undefined,\n      menu: undefined,\n    },\n    { deep: false }\n  );\n\n  const contentInternal = useSignal<ContentStateInternal>();\n\n  const actionState = useSignal<RouteActionValue>();\n\n  useContextProvider(ContentContext, content);\n  useContextProvider(ContentInternalContext, contentInternal);\n  useContextProvider(DocumentHeadContext, documentHead);\n  useContextProvider(RouteLocationContext, routeLocation);\n  useContextProvider(RouteNavigateContext, goto);\n  useContextProvider(RouteStateContext, loaderState);\n  useContextProvider(RouteActionContext, actionState);\n\n  const actionsMocks = props.actions?.reduce(\n    (acc, { action, handler }) => {\n      acc[(action as ActionInternal).__id] = handler;\n      return acc;\n    },\n    {} as Record<string, QwikCityMockActionProp['handler']>\n  );\n\n  useTask$(async ({ track }) => {\n    const action = track(actionState);\n    if (!action?.resolve) {\n      return;\n    }\n\n    const mock = actionsMocks?.[action.id];\n    if (mock) {\n      const actionResult = await mock(action.data);\n      action.resolve(actionResult);\n    }\n  });\n\n  return <Slot />;\n});\n\nexport interface ClientSPAWindow extends Window {\n  _qCitySPA?: boolean;\n  _qCityHistoryPatch?: boolean;\n  _qCityScrollEnabled?: boolean;\n  _qCityScrollDebounce?: ReturnType<typeof setTimeout>;\n  _qCityInitPopstate?: () => void;\n  _qCityInitAnchors?: (event: MouseEvent) => void;\n  _qCityInitVisibility?: () => void;\n  _qCityInitScroll?: () => void;\n  _qCityBootstrap?: HTMLAnchorElement;\n  _qcs?: boolean;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/qwik-city-plan.ts",
    "content": "import type { MenuData, RouteData, RouteModule } from './types';\n\n// Generated at build time\nexport const routes: RouteData[] = [];\nexport const menus: MenuData[] = [];\nexport const serverPlugins: RouteModule[] = [];\nexport const trailingSlash = false;\nexport const basePathname = '/';\nexport const cacheModules = false;\n\nexport default {\n  routes,\n  menus,\n  trailingSlash,\n  basePathname,\n  cacheModules,\n};\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/qwik-city.runtime.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n\nimport { Component } from '@builder.io/qwik';\nimport { Cookie } from '@builder.io/qwik-city/middleware/request-handler';\nimport { CookieOptions } from '@builder.io/qwik-city/middleware/request-handler';\nimport { CookieValue } from '@builder.io/qwik-city/middleware/request-handler';\nimport { DeferReturn } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { EnvGetter } from '@builder.io/qwik-city/middleware/request-handler';\nimport { JSXOutput } from '@builder.io/qwik';\nimport { QRL } from '@builder.io/qwik';\nimport { QRLEventHandlerMulti } from '@builder.io/qwik';\nimport { QwikIntrinsicElements } from '@builder.io/qwik';\nimport { QwikJSX } from '@builder.io/qwik';\nimport type { ReadonlySignal } from '@builder.io/qwik';\nimport { RequestEvent } from '@builder.io/qwik-city/middleware/request-handler';\nimport { RequestEventAction } from '@builder.io/qwik-city/middleware/request-handler';\nimport { RequestEventBase } from '@builder.io/qwik-city/middleware/request-handler';\nimport { RequestEventCommon } from '@builder.io/qwik-city/middleware/request-handler';\nimport { RequestEventLoader } from '@builder.io/qwik-city/middleware/request-handler';\nimport { RequestHandler } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { ResolveSyncValue } from '@builder.io/qwik-city/middleware/request-handler';\nimport type * as v from 'valibot';\nimport { ValueOrPromise } from '@builder.io/qwik';\nimport { z } from 'zod';\nimport type * as z_2 from 'zod';\n\n// @public (undocumented)\nexport type Action<RETURN, INPUT = Record<string, unknown>, OPTIONAL extends boolean = true> = {\n    (): ActionStore<RETURN, INPUT, OPTIONAL>;\n};\n\n// @public (undocumented)\nexport type ActionConstructor = {\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {\n        readonly id?: string;\n        readonly validation: [VALIDATOR, ...REST];\n    }): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {\n        readonly id?: string;\n        readonly validation: [VALIDATOR];\n    }): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;\n    <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, options: {\n        readonly id?: string;\n        readonly validation: REST;\n    }): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: VALIDATOR, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>> | FailReturn<FailOfRest<REST>>>, GetValidatorInputType<VALIDATOR>, false>;\n    <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(actionQrl: (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>, options: VALIDATOR): Action<StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>, GetValidatorInputType<VALIDATOR>, false>;\n    <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, ...rest: REST): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n    <OBJ>(actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>, options?: {\n        readonly id?: string;\n    }): Action<StrictUnion<OBJ>>;\n};\n\n// @public (undocumented)\nexport type ActionReturn<RETURN> = {\n    readonly status?: number;\n    readonly value: RETURN;\n};\n\n// @public (undocumented)\nexport type ActionStore<RETURN, INPUT, OPTIONAL extends boolean = true> = {\n    readonly actionPath: string;\n    readonly isRunning: boolean;\n    readonly status?: number;\n    readonly formData: FormData | undefined;\n    readonly value: RETURN | undefined;\n    readonly submit: QRL<OPTIONAL extends true ? (form?: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>> : (form: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>>>;\n    readonly submitted: boolean;\n};\n\n// @public (undocumented)\nexport interface ContentHeading {\n    // (undocumented)\n    readonly id: string;\n    // (undocumented)\n    readonly level: number;\n    // (undocumented)\n    readonly text: string;\n}\n\n// @public (undocumented)\nexport interface ContentMenu {\n    // (undocumented)\n    readonly href?: string;\n    // (undocumented)\n    readonly items?: ContentMenu[];\n    // (undocumented)\n    readonly text: string;\n}\n\nexport { Cookie }\n\nexport { CookieOptions }\n\nexport { CookieValue }\n\n// @public (undocumented)\nexport type DataValidator<T extends Record<string, any> = {}> = {\n    validate(ev: RequestEvent, data: unknown): Promise<ValidatorReturn<T>>;\n};\n\nexport { DeferReturn }\n\n// @public (undocumented)\nexport type DocumentHead = DocumentHeadValue | ((props: DocumentHeadProps) => DocumentHeadValue);\n\n// @public (undocumented)\nexport interface DocumentHeadProps extends RouteLocation {\n    // (undocumented)\n    readonly head: ResolvedDocumentHead;\n    // (undocumented)\n    readonly resolveValue: ResolveSyncValue;\n    // (undocumented)\n    readonly withLocale: <T>(fn: () => T) => T;\n}\n\n// @public (undocumented)\nexport interface DocumentHeadValue<FrontMatter extends Record<string, any> = Record<string, unknown>> {\n    readonly frontmatter?: Readonly<FrontMatter>;\n    readonly links?: readonly DocumentLink[];\n    readonly meta?: readonly DocumentMeta[];\n    // Warning: (ae-incompatible-release-tags) The symbol \"scripts\" is marked as @public, but its signature references \"DocumentScript\" which is marked as @alpha\n    readonly scripts?: readonly DocumentScript[];\n    readonly styles?: readonly DocumentStyle[];\n    readonly title?: string;\n}\n\n// @public (undocumented)\nexport interface DocumentLink {\n    // (undocumented)\n    as?: string;\n    // (undocumented)\n    crossorigin?: string;\n    // (undocumented)\n    disabled?: boolean;\n    // (undocumented)\n    href?: string;\n    // (undocumented)\n    hreflang?: string;\n    // (undocumented)\n    id?: string;\n    // (undocumented)\n    imagesizes?: string;\n    // (undocumented)\n    imagesrcset?: string;\n    // (undocumented)\n    integrity?: string;\n    // (undocumented)\n    key?: string;\n    // (undocumented)\n    media?: string;\n    // (undocumented)\n    prefetch?: string;\n    // (undocumented)\n    referrerpolicy?: string;\n    // (undocumented)\n    rel?: string;\n    // (undocumented)\n    sizes?: string;\n    // (undocumented)\n    title?: string;\n    // (undocumented)\n    type?: string;\n}\n\n// @public (undocumented)\nexport interface DocumentMeta {\n    // (undocumented)\n    readonly content?: string;\n    // (undocumented)\n    readonly httpEquiv?: string;\n    // (undocumented)\n    readonly itemprop?: string;\n    // (undocumented)\n    readonly key?: string;\n    // (undocumented)\n    readonly media?: string;\n    // (undocumented)\n    readonly name?: string;\n    // (undocumented)\n    readonly property?: string;\n}\n\n// @alpha (undocumented)\nexport interface DocumentScript {\n    // (undocumented)\n    readonly key?: string;\n    // (undocumented)\n    readonly props?: Readonly<QwikIntrinsicElements['script']>;\n    // (undocumented)\n    readonly script?: string;\n}\n\n// @public (undocumented)\nexport interface DocumentStyle {\n    // (undocumented)\n    readonly key?: string;\n    // (undocumented)\n    readonly props?: Readonly<QwikIntrinsicElements['style']>;\n    // (undocumented)\n    readonly style: string;\n}\n\n// Warning: (ae-forgotten-export) The symbol \"ErrorBoundaryProps\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const ErrorBoundary: Component<ErrorBoundaryProps>;\n\n// @public (undocumented)\nexport type FailOfRest<REST extends readonly DataValidator[]> = REST extends readonly DataValidator<infer ERROR>[] ? ERROR : never;\n\n// Warning: (ae-forgotten-export) The symbol \"Failed\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type FailReturn<T> = T & Failed;\n\n// @public (undocumented)\nexport const Form: <O, I>({ action, spaReset, reloadDocument, onSubmit$, ...rest }: FormProps<O, I>, key: string | null) => JSXOutput;\n\n// @public (undocumented)\nexport interface FormProps<O, I> extends Omit<QwikJSX.IntrinsicElements['form'], 'action' | 'method'> {\n    action?: ActionStore<O, I, true | false>;\n    // (undocumented)\n    key?: string | number | null;\n    onSubmit$?: QRLEventHandlerMulti<SubmitEvent, HTMLFormElement> | undefined;\n    onSubmitCompleted$?: QRLEventHandlerMulti<CustomEvent<FormSubmitSuccessDetail<O>>, HTMLFormElement> | undefined;\n    reloadDocument?: boolean;\n    spaReset?: boolean;\n}\n\n// @public (undocumented)\nexport interface FormSubmitSuccessDetail<T> {\n    // (undocumented)\n    status: number;\n    // (undocumented)\n    value: T;\n}\n\n// Warning: (ae-forgotten-export) The symbol \"ValibotDataValidator\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"ZodDataValidator\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type GetValidatorInputType<VALIDATOR extends TypedDataValidator> = VALIDATOR extends ValibotDataValidator<infer TYPE> ? v.InferInput<TYPE> : VALIDATOR extends ZodDataValidator<infer TYPE> ? z_2.input<TYPE> : never;\n\n// @public (undocumented)\nexport type GetValidatorOutputType<VALIDATOR extends TypedDataValidator> = VALIDATOR extends ValibotDataValidator<infer TYPE> ? v.InferOutput<TYPE> : VALIDATOR extends ZodDataValidator<infer TYPE> ? z_2.output<TYPE> : never;\n\n// @public (undocumented)\nexport type GetValidatorType<VALIDATOR extends TypedDataValidator> = GetValidatorOutputType<VALIDATOR>;\n\n// @public (undocumented)\nexport const globalAction$: ActionConstructor;\n\n// Warning: (ae-forgotten-export) The symbol \"ActionConstructorQRL\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const globalActionQrl: ActionConstructorQRL;\n\n// @public (undocumented)\nexport type JSONObject = {\n    [x: string]: JSONValue;\n};\n\n// @public (undocumented)\nexport type JSONValue = string | number | boolean | {\n    [x: string]: JSONValue;\n} | Array<JSONValue>;\n\n// @public (undocumented)\nexport const Link: Component<LinkProps>;\n\n// Warning: (ae-forgotten-export) The symbol \"AnchorAttributes\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport interface LinkProps extends AnchorAttributes {\n    prefetch?: boolean | 'js';\n    // (undocumented)\n    reload?: boolean;\n    // (undocumented)\n    replaceState?: boolean;\n    // (undocumented)\n    scroll?: boolean;\n}\n\n// @public (undocumented)\ntype Loader_2<RETURN> = {\n    (): LoaderSignal<RETURN>;\n};\nexport { Loader_2 as Loader }\n\n// @public (undocumented)\nexport type LoaderSignal<TYPE> = TYPE extends () => ValueOrPromise<infer VALIDATOR> ? ReadonlySignal<ValueOrPromise<VALIDATOR>> : ReadonlySignal<TYPE>;\n\n// Warning: (ae-forgotten-export) The symbol \"MenuModuleLoader\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type MenuData = [pathname: string, menuLoader: MenuModuleLoader];\n\n// @public (undocumented)\nexport type NavigationType = 'initial' | 'form' | 'link' | 'popstate';\n\n// Warning: (ae-forgotten-export) The symbol \"RouteModule\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport interface PageModule extends RouteModule {\n    // (undocumented)\n    readonly default: unknown;\n    // Warning: (ae-forgotten-export) The symbol \"ContentModuleHead\" needs to be exported by the entry point index.d.ts\n    //\n    // (undocumented)\n    readonly head?: ContentModuleHead;\n    // (undocumented)\n    readonly headings?: ContentHeading[];\n    // (undocumented)\n    readonly onStaticGenerate?: StaticGenerateHandler;\n}\n\n// @public (undocumented)\nexport type PathParams = Record<string, string>;\n\n// @public (undocumented)\nexport type PreventNavigateCallback = (url?: number | URL) => ValueOrPromise<boolean>;\n\n// @public (undocumented)\nexport const QWIK_CITY_SCROLLER = \"_qCityScroller\";\n\n// @public (undocumented)\nexport interface QwikCityMockActionProp<T = any> {\n    action: Action<T>;\n    // Warning: (ae-forgotten-export) The symbol \"RouteActionResolver\" needs to be exported by the entry point index.d.ts\n    handler: QRL<(data: T) => ValueOrPromise<RouteActionResolver>>;\n}\n\n// @public (undocumented)\nexport interface QwikCityMockLoaderProp<T = any> {\n    data: T;\n    loader: Loader_2<T>;\n}\n\n// @public (undocumented)\nexport interface QwikCityMockProps {\n    actions?: Array<QwikCityMockActionProp<any>>;\n    goto?: RouteNavigate;\n    loaders?: Array<QwikCityMockLoaderProp<any>>;\n    params?: Record<string, string>;\n    url?: string;\n}\n\n// @public (undocumented)\nexport const QwikCityMockProvider: Component<QwikCityMockProps>;\n\n// @public (undocumented)\nexport interface QwikCityPlan {\n    // (undocumented)\n    readonly basePathname?: string;\n    // (undocumented)\n    readonly cacheModules?: boolean;\n    // (undocumented)\n    readonly menus?: MenuData[];\n    // (undocumented)\n    readonly routes: RouteData[];\n    // (undocumented)\n    readonly serverPlugins?: RouteModule[];\n    // (undocumented)\n    readonly trailingSlash?: boolean;\n}\n\n// @public (undocumented)\nexport interface QwikCityProps {\n    viewTransition?: boolean;\n}\n\n// @public (undocumented)\nexport const QwikCityProvider: Component<QwikCityProps>;\n\nexport { RequestEvent }\n\nexport { RequestEventAction }\n\nexport { RequestEventBase }\n\nexport { RequestEventCommon }\n\nexport { RequestEventLoader }\n\nexport { RequestHandler }\n\n// @public (undocumented)\nexport type ResolvedDocumentHead<FrontMatter extends Record<string, any> = Record<string, unknown>> = Required<DocumentHeadValue<FrontMatter>>;\n\n// @public (undocumented)\nexport const routeAction$: ActionConstructor;\n\n// @public (undocumented)\nexport const routeActionQrl: ActionConstructorQRL;\n\n// Warning: (ae-forgotten-export) The symbol \"ModuleLoader\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type RouteData = [routeName: string, loaders: ModuleLoader[]] | [\nrouteName: string,\nloaders: ModuleLoader[],\noriginalPathname: string,\nrouteBundleNames: string[]\n];\n\n// Warning: (ae-forgotten-export) The symbol \"LoaderConstructor\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const routeLoader$: LoaderConstructor;\n\n// Warning: (ae-forgotten-export) The symbol \"LoaderConstructorQRL\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const routeLoaderQrl: LoaderConstructorQRL;\n\n// @public (undocumented)\nexport interface RouteLocation {\n    // (undocumented)\n    readonly isNavigating: boolean;\n    // (undocumented)\n    readonly params: Readonly<Record<string, string>>;\n    // (undocumented)\n    readonly prevUrl: URL | undefined;\n    // (undocumented)\n    readonly url: URL;\n}\n\n// @public (undocumented)\nexport type RouteNavigate = QRL<(path?: string | number | URL, options?: {\n    type?: Exclude<NavigationType, 'initial'>;\n    forceReload?: boolean;\n    replaceState?: boolean;\n    scroll?: boolean;\n} | boolean) => Promise<void>>;\n\n// @public (undocumented)\nexport const RouterOutlet: Component<unknown>;\n\n// Warning: (ae-forgotten-export) The symbol \"ServerConfig\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const server$: <T extends ServerFunction>(qrl: T, options?: ServerConfig | undefined) => ServerQRL<T>;\n\n// @public (undocumented)\nexport type ServerFunction = {\n    (this: RequestEventBase, ...args: any[]): any;\n    options?: ServerConfig;\n};\n\n// @public\nexport type ServerQRL<T extends ServerFunction> = QRL<((abort: AbortSignal, ...args: Parameters<T>) => ReturnType<T>) | ((...args: Parameters<T>) => ReturnType<T>)>;\n\n// @public (undocumented)\nexport const serverQrl: <T extends ServerFunction>(qrl: QRL<T>, options?: ServerConfig) => ServerQRL<T>;\n\n// @public\nexport const ServiceWorkerRegister: (props: {\n    nonce?: string;\n}) => JSXOutput;\n\n// @public (undocumented)\nexport interface StaticGenerate {\n    // (undocumented)\n    params?: PathParams[];\n}\n\n// @public (undocumented)\nexport type StaticGenerateHandler = ({ env, }: {\n    env: EnvGetter;\n}) => Promise<StaticGenerate> | StaticGenerate;\n\n// Warning: (ae-forgotten-export) The symbol \"Prettify\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"StrictUnionHelper\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type StrictUnion<T> = Prettify<StrictUnionHelper<T, T>>;\n\n// @public (undocumented)\nexport type TypedDataValidator = ValibotDataValidator | ZodDataValidator;\n\n// Warning: (ae-forgotten-export) The symbol \"ContentState\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const useContent: () => ContentState;\n\n// @public\nexport const useDocumentHead: <FrontMatter extends Record<string, unknown> = Record<string, any>>() => Required<ResolvedDocumentHead<FrontMatter>>;\n\n// @public (undocumented)\nexport const useLocation: () => RouteLocation;\n\n// @public (undocumented)\nexport const useNavigate: () => RouteNavigate;\n\n// @public\nexport const usePreventNavigate$: (qrl: PreventNavigateCallback) => void;\n\n// Warning: (ae-internal-missing-underscore) The name \"usePreventNavigateQrl\" should be prefixed with an underscore because the declaration is marked as @internal\n//\n// @internal\nexport const usePreventNavigateQrl: (fn: QRL<PreventNavigateCallback>) => void;\n\n// Warning: (ae-forgotten-export) The symbol \"ValibotConstructor\" needs to be exported by the entry point index.d.ts\n//\n// @alpha (undocumented)\nexport const valibot$: ValibotConstructor;\n\n// Warning: (ae-forgotten-export) The symbol \"ValibotConstructorQRL\" needs to be exported by the entry point index.d.ts\n//\n// @alpha (undocumented)\nexport const valibotQrl: ValibotConstructorQRL;\n\n// Warning: (ae-forgotten-export) The symbol \"ValidatorConstructor\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const validator$: ValidatorConstructor;\n\n// Warning: (ae-forgotten-export) The symbol \"IsAny\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type ValidatorErrorKeyDotNotation<T, Prefix extends string = ''> = IsAny<T> extends true ? never : T extends object ? {\n    [K in keyof T & string]: IsAny<T[K]> extends true ? never : T[K] extends (infer U)[] ? IsAny<U> extends true ? never : U extends object ? `${Prefix}${K}[]` | ValidatorErrorKeyDotNotation<U, `${Prefix}${K}[].`> : `${Prefix}${K}[]` : T[K] extends object ? ValidatorErrorKeyDotNotation<T[K], `${Prefix}${K}.`> : `${Prefix}${K}`;\n}[keyof T & string] : never;\n\n// @public (undocumented)\nexport type ValidatorErrorType<T, U = string> = {\n    formErrors: U[];\n    fieldErrors: Partial<{\n        [K in ValidatorErrorKeyDotNotation<T>]: K extends `${infer _Prefix}[]${infer _Suffix}` ? U[] : U;\n    }>;\n};\n\n// Warning: (ae-forgotten-export) The symbol \"ValidatorConstructorQRL\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const validatorQrl: ValidatorConstructorQRL;\n\n// Warning: (ae-forgotten-export) The symbol \"ValidatorReturnSuccess\" needs to be exported by the entry point index.d.ts\n// Warning: (ae-forgotten-export) The symbol \"ValidatorReturnFail\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport type ValidatorReturn<T extends Record<string, any> = {}> = ValidatorReturnSuccess | ValidatorReturnFail<T>;\n\nexport { z }\n\n// @public (undocumented)\nexport const zod$: ZodConstructor;\n\n// @public (undocumented)\nexport type ZodConstructor = {\n    <T extends z_2.ZodRawShape>(schema: T): ZodDataValidator<z_2.ZodObject<T>>;\n    <T extends z_2.ZodRawShape>(schema: (zod: typeof z_2.z, ev: RequestEvent) => T): ZodDataValidator<z_2.ZodObject<T>>;\n    <T extends z_2.Schema>(schema: T): ZodDataValidator<T>;\n    <T extends z_2.Schema>(schema: (zod: typeof z_2.z, ev: RequestEvent) => T): ZodDataValidator<T>;\n};\n\n// Warning: (ae-forgotten-export) The symbol \"ZodConstructorQRL\" needs to be exported by the entry point index.d.ts\n//\n// @public (undocumented)\nexport const zodQrl: ZodConstructorQRL;\n\n// (No @packageDocumentation comment for this package)\n\n```\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/route-matcher.ts",
    "content": "import type { PathParams } from './types';\n\n/**\n * Match a given route against a path.\n *\n * @param route Route definition: example: `/path/[param]/[...rest]/`\n * @param path Actual path to match\n * @returns Returns PathParams or null if did not match.\n */\nexport function matchRoute(route: string, path: string): PathParams | null {\n  const routeIdx: number = startIdxSkipSlash(route);\n  const routeLength = lengthNoTrailingSlash(route);\n  const pathIdx: number = startIdxSkipSlash(path);\n  const pathLength = lengthNoTrailingSlash(path);\n  return matchRoutePart(route, routeIdx, routeLength, path, pathIdx, pathLength);\n}\n\nfunction matchRoutePart(\n  route: string,\n  routeIdx: number,\n  routeLength: number,\n  path: string,\n  pathIdx: number,\n  pathLength: number\n): PathParams | null {\n  if (path.startsWith('/build/')) {\n    return null;\n  }\n\n  let params: PathParams | null = null;\n  while (routeIdx < routeLength) {\n    const routeCh = route.charCodeAt(routeIdx++);\n    const pathCh = path.charCodeAt(pathIdx++);\n    if (routeCh === Char.OPEN_BRACKET) {\n      const isMany = isThreeDots(route, routeIdx);\n      // EXAMPLE: /path/pre[param]post/\n      //                   ^     ^    ^\n      //                   |     |    + paramSuffixEnd\n      //                   |     + paramNameEnd\n      //                   + paramNameStart\n      //\n      const paramNameStart = routeIdx + (isMany ? 3 : 0);\n      const paramNameEnd = scan(route, paramNameStart, routeLength, Char.CLOSE_BRACKET);\n      const paramName = route.substring(paramNameStart, paramNameEnd);\n      const paramSuffixEnd = scan(route, paramNameEnd + 1, routeLength, Char.SLASH);\n      const suffix = route.substring(paramNameEnd + 1, paramSuffixEnd);\n      routeIdx = paramNameEnd + 1;\n      // VALUE\n      const paramValueStart = pathIdx - 1; // -1 because we already consumed the character\n      if (isMany) {\n        const match = recursiveScan(\n          paramName,\n          suffix,\n          path,\n          paramValueStart,\n          pathLength,\n          route,\n          routeIdx + suffix.length + 1,\n          routeLength\n        );\n        if (match) {\n          return Object.assign(params || (params = {}), match);\n        }\n      }\n      const paramValueEnd = scan(path, paramValueStart, pathLength, Char.SLASH, suffix);\n      if (paramValueEnd == -1) {\n        return null;\n      }\n      const paramValue = path.substring(paramValueStart, paramValueEnd);\n      if (!isMany && !suffix && !paramValue) {\n        // empty value is only allowed with rest or suffix (e.g. '/path/[...rest]' or '/path/[param]suffix')\n        return null;\n      }\n      pathIdx = paramValueEnd;\n      (params || (params = {}))[paramName] = decodeURIComponent(paramValue);\n    } else if (routeCh !== pathCh) {\n      if (!(isNaN(pathCh) && isRestParameter(route, routeIdx))) {\n        return null;\n      }\n    }\n  }\n  if (allConsumed(route, routeIdx) && allConsumed(path, pathIdx)) {\n    // match if there are no extra parts\n    return params || {};\n  } else {\n    return null;\n  }\n}\n\nfunction isRestParameter(text: string, idx: number): boolean {\n  return text.charCodeAt(idx) === Char.OPEN_BRACKET && isThreeDots(text, idx + 1);\n}\n\nfunction lengthNoTrailingSlash(text: string): number {\n  const length = text.length;\n  return length > 1 && text.charCodeAt(length - 1) === Char.SLASH ? length - 1 : length;\n}\n\nfunction allConsumed(text: string, idx: number): boolean {\n  const length = text.length;\n  return idx >= length || (idx == length - 1 && text.charCodeAt(idx) === Char.SLASH);\n}\n\nfunction startIdxSkipSlash(text: string): 0 | 1 {\n  return text.charCodeAt(0) === Char.SLASH ? 1 : 0;\n}\n\nfunction isThreeDots(text: string, idx: number): boolean {\n  return (\n    text.charCodeAt(idx) === Char.DOT &&\n    text.charCodeAt(idx + 1) === Char.DOT &&\n    text.charCodeAt(idx + 2) === Char.DOT\n  );\n}\n\nfunction scan(text: string, idx: number, end: number, ch: Char, suffix: string = ''): number {\n  while (idx < end && text.charCodeAt(idx) !== ch) {\n    idx++;\n  }\n  const suffixLength = suffix.length;\n  for (let i = 0; i < suffixLength; i++) {\n    if (text.charCodeAt(idx - suffixLength + i) !== suffix.charCodeAt(i)) {\n      return -1;\n    }\n  }\n  return idx - suffixLength;\n}\n\nconst enum Char {\n  EOL = 0,\n  OPEN_BRACKET = 91, // '['\n  CLOSE_BRACKET = 93, // ']'\n  DOT = 46, // '.'\n  SLASH = 47, // '/'\n}\nfunction recursiveScan(\n  paramName: string,\n  suffix: string,\n  path: string,\n  pathStart: number,\n  pathLength: number,\n  route: string,\n  routeStart: number,\n  routeLength: number\n) {\n  if (path.charCodeAt(pathStart) === Char.SLASH) {\n    pathStart++;\n  }\n  let pathIdx = pathLength;\n  const sep = suffix + '/';\n  while (pathIdx >= pathStart) {\n    const match = matchRoutePart(route, routeStart, routeLength, path, pathIdx, pathLength);\n    if (match) {\n      let value = path.substring(pathStart, Math.min(pathIdx, pathLength));\n      if (value.endsWith(sep)) {\n        value = value.substring(0, value.length - sep.length);\n      }\n      match[paramName] = decodeURIComponent(value);\n      return match;\n    }\n    const newPathIdx = lastIndexOf(path, pathStart, sep, pathIdx, pathStart - 1) + sep.length;\n    if (pathIdx === newPathIdx) {\n      break;\n    }\n    pathIdx = newPathIdx;\n  }\n  return null;\n}\n\nfunction lastIndexOf(\n  text: string,\n  start: number,\n  match: string,\n  searchIdx: number,\n  notFoundIdx: number\n): number {\n  let idx = text.lastIndexOf(match, searchIdx);\n  if (idx == searchIdx - match.length) {\n    // If previous match was right upto the separator, then try to find the match before that.\n    idx = text.lastIndexOf(match, searchIdx - match.length - 1);\n  }\n  return idx > start ? idx : notFoundIdx;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/route-matcher.unit.ts",
    "content": "import { assert, describe, test } from 'vitest';\nimport { matchRoute } from './route-matcher';\n\ndescribe('route-matcher', () => {\n  test('should match /', () => {\n    assert.deepEqual(matchRoute('/', '/'), {});\n    assert.deepEqual(matchRoute('/', '/extra'), null, 'should not match extra');\n  });\n\n  test('should match /foo/', () => {\n    assert.deepEqual(matchRoute('/foo', '/foo/'), {});\n    assert.deepEqual(matchRoute('foo', '/foo/'), {});\n    assert.deepEqual(matchRoute('/foo', '/foo/extra'), null, 'should not match extra');\n  });\n\n  test('should match /foo/ with trailing slash', () => {\n    assert.deepEqual(matchRoute('/foo/', '/foo/'), {});\n    assert.deepEqual(matchRoute('/foo/', '/foo'), {});\n    assert.deepEqual(matchRoute('foo/', '/foo/'), {});\n    assert.deepEqual(matchRoute('/foo/', '/foo/extra'), null, 'should not match extra');\n  });\n\n  test('should match /seg/[slug]/', () => {\n    assert.deepEqual(matchRoute('/seg/[slug]', '/seg/extract-text/'), { slug: 'extract-text' });\n    assert.deepEqual(\n      matchRoute('/seg/[slug]', '/seg/[slug]/extra'),\n      null,\n      'should not match extra'\n    );\n  });\n\n  test('should match /seg/[slug]/ with trailing slash', () => {\n    assert.deepEqual(matchRoute('/seg/[slug]/', '/seg/extract-text/'), { slug: 'extract-text' });\n    assert.deepEqual(\n      matchRoute('/seg/[slug]/', '/seg/[slug]/extra'),\n      null,\n      'should not match extra'\n    );\n  });\n\n  test('should match /seg/[slug]/[param]/', () => {\n    assert.deepEqual(matchRoute('/seg/[slug]/[param]', '/seg/extract-text/param-text/'), {\n      slug: 'extract-text',\n      param: 'param-text',\n    });\n    assert.deepEqual(\n      matchRoute('/seg/[slug]/[param]', '/seg/slug/param/extra'),\n      null,\n      'should not match extra'\n    );\n  });\n\n  test('should match /seg/[slug]/[param]/ with trailing slash', () => {\n    assert.deepEqual(matchRoute('/seg/[slug]/[param]/', '/seg/extract-text/param-text/'), {\n      slug: 'extract-text',\n      param: 'param-text',\n    });\n    assert.deepEqual(\n      matchRoute('/seg/[slug]/[param]/', '/seg/slug/param/extra'),\n      null,\n      'should not match extra'\n    );\n  });\n\n  test('should match /seg/[...rest]', () => {\n    assert.deepEqual(matchRoute('/seg/[...rest]', '/seg/a/b/c'), { rest: 'a/b/c' });\n  });\n\n  test('should match /seg/[...rest]/a/b/c/d/e', () => {\n    assert.deepEqual(matchRoute('/seg/[...rest]/a/b/c/d/e', '/seg/a/b/c/d/e'), {\n      rest: '',\n    });\n  });\n\n  test('should match /seg/[...rest] with trailing slash', () => {\n    assert.deepEqual(matchRoute('/seg/[...rest]/', '/seg/a/b/c'), { rest: 'a/b/c' });\n  });\n\n  test('should match /stuff/[...param]', () => {\n    assert.deepEqual(matchRoute('/stuff/[...param]', '/stuff/'), { param: '' }, '1');\n    assert.deepEqual(matchRoute('/stuff/[...param]', '/stuff'), { param: '' }, '2');\n  });\n\n  test('should match /stuff/[...param] with trailing slash', () => {\n    assert.deepEqual(matchRoute('/stuff/[...param]/', '/stuff/'), { param: '' }, '1');\n    assert.deepEqual(matchRoute('/stuff/[...param]/', '/stuff'), { param: '' }, '2');\n  });\n\n  test('should match /seg/[paramA]/[...rest]', () => {\n    assert.deepEqual(matchRoute('/seg/[paramA]/[...rest]', '/seg/a/b/c'), {\n      paramA: 'a',\n      rest: 'b/c',\n    });\n  });\n\n  test('should match /seg/[paramA]/[...rest] with trailing slash', () => {\n    assert.deepEqual(matchRoute('/seg/[paramA]/[...rest]/', '/seg/a/b/c'), {\n      paramA: 'a',\n      rest: 'b/c',\n    });\n  });\n\n  test('regressions', () => {\n    assert.deepEqual(matchRoute('qwikcity-test/api/data.json', '/qwikcity-test/blog/'), null);\n    assert.deepEqual(matchRoute('/api/[org]/[user].json', '/api/builder.io/oss.json'), {\n      org: 'builder.io',\n      user: 'oss',\n    });\n    assert.deepEqual(matchRoute('/api/[org]/[user].json', '/api/builder.io/oss.json/'), {\n      org: 'builder.io',\n      user: 'oss',\n    });\n  });\n\n  test('regressions matching missing segment', () => {\n    assert.deepEqual(matchRoute('/[country]/[city]', '/other'), null, '00');\n    assert.deepEqual(matchRoute('/[country]/[city]', '/other/'), null, '01');\n  });\n\n  test('/a/pre[infix]post', () => {\n    assert.deepEqual(matchRoute('/a/pre[infix]post', '/a/preINpost'), {\n      infix: 'IN',\n    });\n    assert.deepEqual(matchRoute('/a/pre[infix]post', '/a/prepost'), {\n      infix: '',\n    });\n  });\n\n  test('should match /a/pre[infix]post with trailing slash', () => {\n    assert.deepEqual(matchRoute('/a/pre[infix]post/', '/a/preINpost'), {\n      infix: 'IN',\n    });\n    assert.deepEqual(matchRoute('/a/pre[infix]post/', '/a/prepost'), {\n      infix: '',\n    });\n  });\n\n  test('/[...rest] ignore trailing slash', () => {\n    assert.deepEqual(matchRoute('/[...rest]', '/a/b/c/'), {\n      rest: 'a/b/c',\n    });\n    assert.deepEqual(matchRoute('/[...rest]/', '/a/b/c/'), {\n      rest: 'a/b/c',\n    });\n  });\n});\n\ndescribe('routeMatcher/#2951', () => {\n  test('/[...rest]', () => {\n    assert.deepEqual(matchRoute('/[...rest]', '/'), { rest: '' });\n  });\n\n  test('/[...rest]/path', () => {\n    assert.deepEqual(matchRoute('/[...rest]/path', '/path'), { rest: '' });\n  });\n\n  test('[...rest]/path', () => {\n    assert.deepEqual(matchRoute('[...rest]/path', '/path'), { rest: '' });\n  });\n\n  test('/[...rest]/path', () => {\n    assert.deepEqual(matchRoute('/[...rest]/path', '/a/b/c/path'), { rest: 'a/b/c' });\n  });\n\n  test('[...rest]/path', () => {\n    assert.deepEqual(matchRoute('[...rest]/path', 'a/b/c/path'), { rest: 'a/b/c' });\n  });\n\n  test('/[...any]_suffix/path', () => {\n    assert.deepEqual(matchRoute('/[...rest]_suffix/path', '/a/b/c_suffix/path'), { rest: 'a/b/c' });\n  });\n\n  test('/[...a]/[...b]/path', () => {\n    assert.deepEqual(matchRoute('/[...a]/[...b]/path', '/a/b/c/path'), { a: 'a/b/c', b: '' });\n  });\n});\n\ndescribe('routeMatcher/#5080', () => {\n  test('/[...rest]/suffix', () => {\n    assert.deepEqual(matchRoute('/[...rest]/', '/a/b/c/suffix/'), { rest: 'a/b/c/suffix' });\n    assert.deepEqual(matchRoute('/[...rest]/suffix', '/a/b/c/suffix'), { rest: 'a/b/c' });\n    assert.deepEqual(matchRoute('/[...rest]/suffix', '/a/b/c/suffix/'), { rest: 'a/b/c' });\n  });\n});\n\ndescribe('routeMatcher/#5126', () => {\n  test('/[...dynamicOne]/static-segment/[...dynamicTwo]/', () => {\n    assert.deepEqual(\n      matchRoute(\n        '/[...dynamicOne]/static-segment/[...dynamicTwo]/',\n        '/abc/xyz/static-segment/more-dynamic-123/'\n      ),\n      {\n        dynamicOne: 'abc/xyz',\n        dynamicTwo: 'more-dynamic-123',\n      }\n    );\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/router-outlet-component.tsx",
    "content": "import {\n  component$,\n  jsx,\n  type JSXNode,\n  SkipRender,\n  useContext,\n  _jsxBranch,\n  useServerData,\n  sync$,\n} from '@builder.io/qwik';\n\nimport { ContentInternalContext } from './contexts';\nimport spaInit from './spa-init';\nimport type { ClientSPAWindow } from './qwik-city-component';\nimport type { ScrollHistoryState } from './scroll-restoration';\n\n/** @public */\nexport const RouterOutlet = component$(() => {\n  const serverData = useServerData<Record<string, string>>('containerAttributes');\n  if (!serverData) {\n    throw new Error('PrefetchServiceWorker component must be rendered on the server.');\n  }\n  _jsxBranch();\n\n  const { value } = useContext(ContentInternalContext);\n  if (value && value.length > 0) {\n    const contentsLen = value.length;\n    let cmp: JSXNode | null = null;\n    for (let i = contentsLen - 1; i >= 0; i--) {\n      if (value[i].default) {\n        cmp = jsx(value[i].default as any, {\n          children: cmp,\n        });\n      }\n    }\n    return (\n      <>\n        {cmp}\n        {!__EXPERIMENTAL__.noSPA && (\n          <script\n            document:onQCInit$={spaInit}\n            document:onQInit$={sync$(() => {\n              // Minify window and history\n              // Write this as minified as possible, the optimizer does not really minify this code.\n              ((w: ClientSPAWindow, h: History & { state?: ScrollHistoryState }) => {\n                if (!w._qcs && h.scrollRestoration === 'manual') {\n                  // true\n                  w._qcs = !0;\n\n                  // scrollState\n                  const s = h.state?._qCityScroll;\n                  if (s) {\n                    w.scrollTo(s.x, s.y);\n                  }\n                  document.dispatchEvent(new Event('qcinit'));\n                }\n              })(window, history);\n            })}\n          ></script>\n        )}\n      </>\n    );\n  }\n  return SkipRender;\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/routing.ts",
    "content": "import { MODULE_CACHE } from './constants';\nimport { matchRoute } from './route-matcher';\nimport type {\n  ContentMenu,\n  LoadedRoute,\n  MenuData,\n  MenuModule,\n  ModuleLoader,\n  RouteData,\n  RouteModule,\n} from './types';\n\nexport const CACHE = new Map<RouteData, Promise<any>>();\n/** LoadRoute() runs in both client and server. */\nexport const loadRoute = async (\n  routes: RouteData[] | undefined,\n  menus: MenuData[] | undefined,\n  cacheModules: boolean | undefined,\n  pathname: string,\n  isInternal?: boolean\n): Promise<LoadedRoute | null> => {\n  if (!Array.isArray(routes)) {\n    return null;\n  }\n  for (const routeData of routes) {\n    const routeName = routeData[0];\n    const params = matchRoute(routeName, pathname);\n    if (!params) {\n      continue;\n    }\n    const loaders = routeData[1];\n    const routeBundleNames = routeData[3];\n    const modules: RouteModule[] = new Array(loaders.length);\n    const pendingLoads: Promise<any>[] = [];\n\n    loaders.forEach((moduleLoader, i) => {\n      loadModule<RouteModule>(\n        moduleLoader,\n        pendingLoads,\n        (routeModule) => (modules[i] = routeModule),\n        cacheModules\n      );\n    });\n\n    let menu: ContentMenu | undefined = undefined;\n    // No need to load menu for internal QData requests\n    if (!isInternal) {\n      const menuLoader = getMenuLoader(menus, pathname);\n\n      loadModule<MenuModule>(\n        menuLoader,\n        pendingLoads,\n        (menuModule) => (menu = menuModule?.default),\n        cacheModules\n      );\n    }\n    if (pendingLoads.length > 0) {\n      await Promise.all(pendingLoads);\n    }\n\n    return [routeName, params, modules, menu, routeBundleNames];\n  }\n  return null;\n};\n\nconst loadModule = <T>(\n  moduleLoader: ModuleLoader | undefined,\n  pendingLoads: Promise<any>[],\n  moduleSetter: (loadedModule: T) => void,\n  cacheModules: boolean | undefined\n) => {\n  if (typeof moduleLoader === 'function') {\n    const loadedModule = MODULE_CACHE.get(moduleLoader);\n    if (loadedModule) {\n      moduleSetter(loadedModule);\n    } else {\n      const moduleOrPromise: any = moduleLoader();\n      if (typeof moduleOrPromise.then === 'function') {\n        pendingLoads.push(\n          moduleOrPromise.then((loadedModule: any) => {\n            if (cacheModules !== false) {\n              MODULE_CACHE.set(moduleLoader, loadedModule);\n            }\n            moduleSetter(loadedModule);\n          })\n        );\n      } else if (moduleOrPromise) {\n        moduleSetter(moduleOrPromise);\n      }\n    }\n  }\n};\n\nexport const getMenuLoader = (menus: MenuData[] | undefined, pathname: string) => {\n  if (menus) {\n    pathname = pathname.endsWith('/') ? pathname : pathname + '/';\n    // The menus are sorted longest to shortest so first match wins\n    const menu = menus.find((m) => m[0] === pathname || pathname.startsWith(m[0]));\n    if (menu) {\n      return menu[1];\n    }\n  }\n};\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/routing.unit.ts",
    "content": "import { assert, describe, test } from 'vitest';\nimport { parseRoutePathname } from '../../buildtime/routing/parse-pathname';\nimport { getMenuLoader } from './routing';\nimport type { MenuData } from './types';\nimport { matchRoute } from './route-matcher';\n\nconst routeTests = [\n  {\n    basenamePath: '/',\n    pattern: '/stuff/[param]',\n    pathname: '/stuff/thing',\n    result: {\n      param: 'thing',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/stuff/[param]',\n    pathname: '/stuff/thing/',\n    result: {\n      param: 'thing',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/stuff/[...param]',\n    pathname: '/stuff/a/b/c/',\n    result: {\n      param: 'a/b/c',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/stuff/[...param]',\n    pathname: '/stuff/a/b/c',\n    result: {\n      param: 'a/b/c',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/stuff/[...param]',\n    pathname: '/stuff/',\n    result: {\n      param: '',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/stuff/[...param]',\n    pathname: '/stuff',\n    result: {\n      param: '',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/[...param]',\n    pathname: '/thing/',\n    result: {\n      param: 'thing',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/[...param]',\n    pathname: '/thing',\n    result: {\n      param: 'thing',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/xyz/[...param]',\n    pathname: '/xyz/abc.dot',\n    result: {\n      param: 'abc.dot',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/[...param]',\n    pathname: '/abc.dot',\n    result: {\n      param: 'abc.dot',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/[param]',\n    pathname: '/abc.dot',\n    result: {\n      param: 'abc.dot',\n    },\n  },\n  {\n    basenamePath: '/',\n    pattern: '/xyz/[param]',\n    pathname: '/xyz/abc.dot',\n    result: {\n      param: 'abc.dot',\n    },\n  },\n];\n\ndescribe('routing', () => {\n  for (const t of routeTests) {\n    test(`matches ${t.pathname} with ${t.pattern}`, () => {\n      const actual = parseRoutePathname(t.basenamePath, t.pattern);\n      const params = matchRoute(actual.routeName, t.pathname);\n      assert.deepEqual(params, t.result);\n    });\n  }\n});\n\ntest(`getMenuLoader, crawl up root, trailing slash`, async () => {\n  const menus: MenuData[] = [\n    ['/foo/bar/', async () => ({ default: { text: 'Bar' } })],\n    ['/foo/', async () => ({ default: { text: 'Foo' } })],\n    ['/', async () => ({ default: { text: 'Root' } })],\n  ];\n  const loader = getMenuLoader(menus, '/a/b/c/');\n  assert.deepEqual(await loader!(), { default: { text: 'Root' } });\n});\n\ntest(`getMenuLoader, crawl up root, no trailing slash`, async () => {\n  const menus: MenuData[] = [\n    ['/foo/bar/', async () => ({ default: { text: 'Bar' } })],\n    ['/foo/', async () => ({ default: { text: 'Foo' } })],\n    ['/', async () => ({ default: { text: 'Root' } })],\n  ];\n  const loader = getMenuLoader(menus, '/a/b/c');\n  assert.deepEqual(await loader!(), { default: { text: 'Root' } });\n});\n\ntest(`getMenuLoader, crawl up one, trailing slash`, async () => {\n  const menus: MenuData[] = [\n    ['/foo/bar/', async () => ({ default: { text: 'Bar' } })],\n    ['/foo/', async () => ({ default: { text: 'Foo' } })],\n    ['/', async () => ({ default: { text: 'Root' } })],\n  ];\n  const loader = getMenuLoader(menus, '/foo/no-menu/');\n  assert.deepEqual(await loader!(), { default: { text: 'Foo' } });\n});\n\ntest(`getMenuLoader, crawl up one, no trailing slash`, async () => {\n  const menus: MenuData[] = [\n    ['/foo/bar/', async () => ({ default: { text: 'Bar' } })],\n    ['/foo/', async () => ({ default: { text: 'Foo' } })],\n    ['/', async () => ({ default: { text: 'Root' } })],\n  ];\n  const loader = getMenuLoader(menus, '/foo/no-menu');\n  assert.deepEqual(await loader!(), { default: { text: 'Foo' } });\n});\n\ntest(`getMenuLoader, exact path, trailing slash`, async () => {\n  const menus: MenuData[] = [\n    ['/foo/bar/', async () => ({ default: { text: 'Bar' } })],\n    ['/foo/', async () => ({ default: { text: 'Foo' } })],\n    ['/', async () => ({ default: { text: 'Root' } })],\n  ];\n  const loader = getMenuLoader(menus, '/foo/bar/');\n  assert.deepEqual(await loader!(), { default: { text: 'Bar' } });\n});\n\ntest(`getMenuLoader, exact path, no trailing slash`, async () => {\n  const menus: MenuData[] = [\n    ['/foo/bar/', async () => ({ default: { text: 'Bar' } })],\n    ['/foo/', async () => ({ default: { text: 'Foo' } })],\n    ['/', async () => ({ default: { text: 'Root' } })],\n  ];\n  const loader = getMenuLoader(menus, '/foo/bar');\n  assert.deepEqual(await loader!(), { default: { text: 'Bar' } });\n});\n\ntest(`getMenuLoader, root`, async () => {\n  const menus: MenuData[] = [\n    ['/foo/bar/', async () => ({ default: { text: 'Bar' } })],\n    ['/foo/', async () => ({ default: { text: 'Foo' } })],\n    ['/', async () => ({ default: { text: 'Root' } })],\n  ];\n  const loader = getMenuLoader(menus, '/');\n  assert.deepEqual(await loader!(), { default: { text: 'Root' } });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/scroll-restoration.ts",
    "content": "import type { NavigationType, ScrollState } from './types';\nimport { isSamePath } from './utils';\n\nexport const restoreScroll = (\n  type: NavigationType,\n  toUrl: URL,\n  fromUrl: URL,\n  scroller: Element,\n  scrollState?: ScrollState\n) => {\n  if (type === 'popstate' && scrollState) {\n    scroller.scrollTo(scrollState.x, scrollState.y);\n  } else if (type === 'link' || type === 'form') {\n    if (!hashScroll(toUrl, fromUrl)) {\n      scroller.scrollTo(0, 0);\n    }\n  }\n};\n\nconst hashScroll = (toUrl: URL, fromUrl: URL) => {\n  const elmId = toUrl.hash.slice(1);\n  // Firefox complains about empty ids.\n  const elm = elmId && document.getElementById(elmId);\n\n  if (elm) {\n    elm.scrollIntoView();\n    return true;\n  } else if (!elm && toUrl.hash && isSamePath(toUrl, fromUrl)) {\n    // Non-existent (but non-empty) hashes will not scroll in browsers.\n    // However, cross-page non-existent hashes will scroll to top.\n    return true;\n  }\n\n  return false;\n};\n\nexport const currentScrollState = (elm: Element): ScrollState => {\n  return {\n    x: elm.scrollLeft,\n    y: elm.scrollTop,\n    w: Math.max(elm.scrollWidth, elm.clientWidth),\n    h: Math.max(elm.scrollHeight, elm.clientHeight),\n  };\n};\n\nexport const getScrollHistory = () => {\n  const state = history.state as ScrollHistoryState;\n  return state?._qCityScroll;\n};\n\nexport const saveScrollHistory = (scrollState: ScrollState) => {\n  const state: ScrollHistoryState = history.state || {};\n  state._qCityScroll = scrollState;\n  history.replaceState(state, '');\n};\n\nexport interface ScrollHistoryState {\n  _qCityScroll?: ScrollState;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/server-functions.ts",
    "content": "import {\n  $,\n  _deserializeData,\n  _getContextElement,\n  _getContextEvent,\n  _serializeData,\n  _wrapProp,\n  implicit$FirstArg,\n  noSerialize,\n  useContext,\n  useStore,\n  type QRL,\n  type ValueOrPromise,\n} from '@builder.io/qwik';\n\nimport * as v from 'valibot';\nimport * as z from 'zod';\nimport type { RequestEventLoader } from '../../middleware/request-handler/types';\nimport { QACTION_KEY, QDATA_KEY, QFN_KEY } from './constants';\nimport { RouteStateContext } from './contexts';\nimport type {\n  ActionConstructor,\n  ActionConstructorQRL,\n  ActionInternal,\n  ActionStore,\n  CommonLoaderActionOptions,\n  DataValidator,\n  Editable,\n  JSONObject,\n  LoaderConstructor,\n  LoaderConstructorQRL,\n  LoaderInternal,\n  RequestEvent,\n  RequestEventAction,\n  RequestEventBase,\n  RouteActionResolver,\n  RouteLocation,\n  ServerConfig,\n  ServerFunction,\n  ServerQRL,\n  ValidatorConstructor,\n  ValidatorConstructorQRL,\n  ValidatorReturn,\n  ValibotConstructor,\n  ValibotConstructorQRL,\n  ValibotDataValidator,\n  ZodConstructor,\n  ZodConstructorQRL,\n  ZodDataValidator,\n} from './types';\nimport { useAction, useLocation, useQwikCityEnv } from './use-functions';\n\nimport { isDev, isServer } from '@builder.io/qwik';\n\nimport type { FormSubmitCompletedDetail } from './form-component';\n\n/** @public */\nexport const routeActionQrl = ((\n  actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => unknown>,\n  ...rest: (CommonLoaderActionOptions | DataValidator)[]\n) => {\n  const { id, validators } = getValidators(rest, actionQrl);\n  function action() {\n    const loc = useLocation() as Editable<RouteLocation>;\n    const currentAction = useAction();\n    const initialState: Editable<Partial<ActionStore<unknown, unknown>>> = {\n      actionPath: `?${QACTION_KEY}=${id}`,\n      submitted: false,\n      isRunning: false,\n      status: undefined,\n      value: undefined,\n      formData: undefined,\n    };\n    const state = useStore<Editable<ActionStore<unknown, unknown>>>(() => {\n      const value = currentAction.value;\n      if (value && value?.id === id) {\n        const data = value.data;\n        if (data instanceof FormData) {\n          initialState.formData = data;\n        }\n        if (value.output) {\n          const { status, result } = value.output;\n          initialState.status = status;\n          initialState.value = result;\n        }\n      }\n      return initialState as ActionStore<unknown, unknown>;\n    });\n\n    const submit = $((input: unknown | FormData | SubmitEvent = {}) => {\n      if (isServer) {\n        throw new Error(`Actions can not be invoked within the server during SSR.\nAction.run() can only be called on the browser, for example when a user clicks a button, or submits a form.`);\n      }\n      let data: unknown | FormData | SubmitEvent;\n      let form: HTMLFormElement | undefined;\n      if (input instanceof SubmitEvent) {\n        form = input.target as HTMLFormElement;\n        data = new FormData(form);\n        if (\n          (input.submitter instanceof HTMLInputElement ||\n            input.submitter instanceof HTMLButtonElement) &&\n          input.submitter.name\n        ) {\n          if (input.submitter.name) {\n            (data as FormData).append(input.submitter.name, input.submitter.value);\n          }\n        }\n      } else {\n        data = input;\n      }\n      return new Promise<RouteActionResolver>((resolve) => {\n        if (data instanceof FormData) {\n          state.formData = data;\n        }\n        state.submitted = true;\n        state.isRunning = true;\n        loc.isNavigating = true;\n        currentAction.value = {\n          data: data as Record<string, unknown>,\n          id,\n          resolve: noSerialize(resolve),\n        };\n      }).then(({ result, status }) => {\n        state.isRunning = false;\n        state.status = status;\n        state.value = result;\n        if (form) {\n          if (form.getAttribute('data-spa-reset') === 'true') {\n            form.reset();\n          }\n          const detail = { status, value: result } satisfies FormSubmitCompletedDetail<unknown>;\n          form.dispatchEvent(\n            new CustomEvent('submitcompleted', {\n              bubbles: false,\n              cancelable: false,\n              composed: false,\n              detail: detail,\n            })\n          );\n        }\n        return {\n          status: status,\n          value: result,\n        };\n      });\n    });\n    initialState.submit = submit;\n\n    return state;\n  }\n  action.__brand = 'server_action' as const;\n  action.__validators = validators;\n  action.__qrl = actionQrl;\n  action.__id = id;\n  Object.freeze(action);\n\n  return action satisfies ActionInternal;\n}) as unknown as ActionConstructorQRL;\n\n/** @public */\nexport const globalActionQrl = ((\n  actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => unknown>,\n  ...rest: (CommonLoaderActionOptions | DataValidator)[]\n) => {\n  const action = routeActionQrl(actionQrl, ...(rest as any));\n  if (isServer) {\n    if (typeof globalThis._qwikActionsMap === 'undefined') {\n      globalThis._qwikActionsMap = new Map();\n    }\n    globalThis._qwikActionsMap!.set((action as ActionInternal).__id, action as ActionInternal);\n  }\n  return action;\n}) as ActionConstructorQRL;\n\n/** @public */\nexport const routeAction$: ActionConstructor = /*#__PURE__*/ implicit$FirstArg(\n  routeActionQrl\n) as any;\n\n/** @public */\nexport const globalAction$: ActionConstructor = /*#__PURE__*/ implicit$FirstArg(\n  globalActionQrl\n) as any;\n\n/** @public */\nexport const routeLoaderQrl = ((\n  loaderQrl: QRL<(event: RequestEventLoader) => unknown>,\n  ...rest: (CommonLoaderActionOptions | DataValidator)[]\n): LoaderInternal => {\n  const { id, validators } = getValidators(rest, loaderQrl);\n  function loader() {\n    return useContext(RouteStateContext, (state) => {\n      if (!(id in state)) {\n        throw new Error(`routeLoader$ \"${loaderQrl.getSymbol()}\" was invoked in a route where it was not declared.\n    This is because the routeLoader$ was not exported in a 'layout.tsx' or 'index.tsx' file of the existing route.\n    For more information check: https://qwik.dev/qwikcity/route-loader/\n\n    If your are managing reusable logic or a library it is essential that this function is re-exported from within 'layout.tsx' or 'index.tsx file of the existing route otherwise it will not run or throw exception.\n    For more information check: https://qwik.dev/docs/re-exporting-loaders/`);\n      }\n      return _wrapProp(state, id);\n    });\n  }\n  loader.__brand = 'server_loader' as const;\n  loader.__qrl = loaderQrl;\n  loader.__validators = validators;\n  loader.__id = id;\n  Object.freeze(loader);\n\n  return loader;\n}) as LoaderConstructorQRL;\n\n/** @public */\nexport const routeLoader$: LoaderConstructor = /*#__PURE__*/ implicit$FirstArg(routeLoaderQrl);\n\n/** @public */\nexport const validatorQrl = ((\n  validator: QRL<(ev: RequestEvent, data: unknown) => ValueOrPromise<ValidatorReturn>>\n): DataValidator => {\n  if (isServer) {\n    return {\n      validate: validator,\n    };\n  }\n  return undefined as any;\n}) as ValidatorConstructorQRL;\n\n/** @public */\nexport const validator$: ValidatorConstructor = /*#__PURE__*/ implicit$FirstArg(validatorQrl);\n\nconst flattenValibotIssues = (issues: v.GenericIssue[]) => {\n  return issues.reduce<Record<string, string | string[]>>((acc, issue) => {\n    if (issue.path) {\n      const hasArrayType = issue.path.some((path) => path.type === 'array');\n      if (hasArrayType) {\n        const keySuffix = issue.expected === 'Array' ? '[]' : '';\n        const key =\n          issue.path\n            .map((item) => (item.type === 'array' ? '*' : item.key))\n            .join('.')\n            .replace(/\\.\\*/g, '[]') + keySuffix;\n        acc[key] = acc[key] || [];\n        if (Array.isArray(acc[key])) {\n          (acc[key] as string[]).push(issue.message);\n        }\n        return acc;\n      } else {\n        acc[issue.path.map((item) => item.key).join('.')] = issue.message;\n      }\n    }\n    return acc;\n  }, {});\n};\n\n/** @alpha */\nexport const valibotQrl: ValibotConstructorQRL = (\n  qrl: QRL<\n    | v.GenericSchema\n    | v.GenericSchemaAsync\n    | ((ev: RequestEvent) => v.GenericSchema | v.GenericSchemaAsync)\n  >\n): ValibotDataValidator => {\n  if (!__EXPERIMENTAL__.valibot) {\n    throw new Error(\n      'Valibot is an experimental feature and is not enabled. Please enable the feature flag by adding `experimental: [\"valibot\"]` to your qwikVite plugin options.'\n    );\n  }\n  if (isServer) {\n    return {\n      __brand: 'valibot',\n      async validate(ev, inputData) {\n        const schema: v.GenericSchema | v.GenericSchemaAsync = await qrl\n          .resolve()\n          .then((obj) => (typeof obj === 'function' ? obj(ev) : obj));\n        const data = inputData ?? (await ev.parseBody());\n        const result = await v.safeParseAsync(schema, data);\n        if (result.success) {\n          return {\n            success: true,\n            data: result.output,\n          };\n        } else {\n          if (isDev) {\n            console.error('ERROR: Valibot validation failed', result.issues);\n          }\n          return {\n            success: false,\n            status: 400,\n            error: {\n              formErrors: v.flatten(result.issues).root ?? [],\n              fieldErrors: flattenValibotIssues(result.issues),\n            },\n          };\n        }\n      },\n    };\n  }\n  return undefined as never;\n};\n\n/** @alpha */\nexport const valibot$: ValibotConstructor = /*#__PURE__*/ implicit$FirstArg(valibotQrl);\n\nconst flattenZodIssues = (issues: z.ZodIssue | z.ZodIssue[]) => {\n  issues = Array.isArray(issues) ? issues : [issues];\n  return issues.reduce<Record<string, string | string[]>>((acc, issue) => {\n    const isExpectingArray = 'expected' in issue && issue.expected === 'array';\n    const hasArrayType = issue.path.some((path) => typeof path === 'number') || isExpectingArray;\n    if (hasArrayType) {\n      const keySuffix = 'expected' in issue && issue.expected === 'array' ? '[]' : '';\n      const key =\n        issue.path\n          .map((path) => (typeof path === 'number' ? '*' : path))\n          .join('.')\n          .replace(/\\.\\*/g, '[]') + keySuffix;\n      acc[key] = acc[key] || [];\n      if (Array.isArray(acc[key])) {\n        (acc[key] as string[]).push(issue.message);\n      }\n      return acc;\n    } else {\n      acc[issue.path.join('.')] = issue.message;\n    }\n    return acc;\n  }, {});\n};\n\n/** @public */\nexport const zodQrl: ZodConstructorQRL = (\n  qrl: QRL<\n    z.ZodRawShape | z.Schema | ((z: typeof import('zod').z, ev: RequestEvent) => z.ZodRawShape)\n  >\n): ZodDataValidator => {\n  if (isServer) {\n    return {\n      __brand: 'zod',\n      async validate(ev, inputData) {\n        const schema: z.Schema = await qrl.resolve().then((obj) => {\n          if (typeof obj === 'function') {\n            obj = obj(z, ev);\n          }\n          if (obj instanceof z.Schema) {\n            return obj;\n          } else {\n            return z.object(obj);\n          }\n        });\n        const data = inputData ?? (await ev.parseBody());\n        const result = await schema.safeParseAsync(data);\n        if (result.success) {\n          return result;\n        } else {\n          if (isDev) {\n            console.error('ERROR: Zod validation failed', result.error.issues);\n          }\n          return {\n            success: false,\n            status: 400,\n            error: {\n              formErrors: result.error.flatten().formErrors,\n              fieldErrors: flattenZodIssues(result.error.issues),\n            },\n          };\n        }\n      },\n    };\n  }\n  return undefined as never;\n};\n\n/** @public */\nexport const zod$: ZodConstructor = /*#__PURE__*/ implicit$FirstArg(zodQrl);\n\nconst deepFreeze = (obj: any) => {\n  Object.getOwnPropertyNames(obj).forEach((prop) => {\n    const value = obj[prop];\n    // we assume that a frozen object is a circular reference and fully deep frozen\n    if (value && typeof value === 'object' && !Object.isFrozen(value)) {\n      deepFreeze(value);\n    }\n  });\n  return Object.freeze(obj);\n};\n\n/** @public */\nexport const serverQrl = <T extends ServerFunction>(\n  qrl: QRL<T>,\n  options?: ServerConfig\n): ServerQRL<T> => {\n  if (isServer) {\n    const captured = qrl.getCaptured();\n    if (captured && captured.length > 0 && !_getContextElement()) {\n      throw new Error('For security reasons, we cannot serialize QRLs that capture lexical scope.');\n    }\n  }\n\n  const method = options?.method?.toUpperCase?.() || 'POST';\n  const headers = options?.headers || {};\n  const origin = options?.origin || '';\n  const fetchOptions = options?.fetchOptions || {};\n\n  function rpc() {\n    return $(async function (this: RequestEventBase, ...args: Parameters<T>) {\n      // move to ServerConfig\n      const abortSignal =\n        args.length > 0 && args[0] instanceof AbortSignal\n          ? (args.shift() as AbortSignal)\n          : undefined;\n\n      if (isServer) {\n        // Running during SSR, we can call the function directly\n        let requestEvent = globalThis.qcAsyncRequestStore?.getStore() as RequestEvent | undefined;\n\n        if (!requestEvent) {\n          const contexts = [useQwikCityEnv()?.ev, this, _getContextEvent()] as RequestEvent[];\n          requestEvent = contexts.find(\n            (v) =>\n              v &&\n              Object.prototype.hasOwnProperty.call(v, 'sharedMap') &&\n              Object.prototype.hasOwnProperty.call(v, 'cookie')\n          );\n        }\n\n        return qrl.apply(requestEvent, isDev ? deepFreeze(args) : args);\n      } else {\n        // Running on the client, we need to call the function via HTTP\n        const ctxElm = _getContextElement();\n        const filteredArgs = args.map((arg: unknown) => {\n          if (arg instanceof SubmitEvent && arg.target instanceof HTMLFormElement) {\n            return new FormData(arg.target);\n          } else if (arg instanceof Event) {\n            return null;\n          } else if (arg instanceof Node) {\n            return null;\n          }\n          return arg;\n        });\n        const qrlHash = qrl.getHash();\n        // Handled by `pureServerFunction` middleware\n        let query = '';\n        const config = {\n          ...fetchOptions,\n          method,\n          headers: {\n            ...headers,\n            'Content-Type': 'application/qwik-json',\n            Accept: 'application/json, application/qwik-json, text/qwik-json-stream, text/plain',\n            // Required so we don't call accidentally\n            'X-QRL': qrlHash,\n          },\n          signal: abortSignal,\n        };\n        const body = await _serializeData([qrl, ...filteredArgs], false);\n        if (method === 'GET') {\n          query += `&${QDATA_KEY}=${encodeURIComponent(body)}`;\n        } else {\n          // PatrickJS: sorry Ryan Florence I prefer const still\n          config.body = body;\n        }\n        const res = await fetch(`${origin}?${QFN_KEY}=${qrlHash}${query}`, config);\n\n        const contentType = res.headers.get('Content-Type');\n        if (res.ok && contentType === 'text/qwik-json-stream' && res.body) {\n          return (async function* () {\n            try {\n              for await (const result of deserializeStream(\n                res.body!,\n                ctxElm ?? document.documentElement,\n                abortSignal\n              )) {\n                yield result;\n              }\n            } finally {\n              if (!abortSignal?.aborted) {\n                await res.body!.cancel();\n              }\n            }\n          })();\n        } else if (contentType === 'application/qwik-json') {\n          const str = await res.text();\n          const obj = await _deserializeData(str, ctxElm ?? document.documentElement);\n          if (res.status >= 400) {\n            throw obj;\n          }\n          return obj;\n        } else if (contentType === 'application/json') {\n          const obj = await res.json();\n          if (res.status >= 400) {\n            throw obj;\n          }\n          return obj;\n        } else if (contentType === 'text/plain' || contentType === 'text/html') {\n          const str = await res.text();\n          if (res.status >= 400) {\n            throw str;\n          }\n          return str;\n        }\n      }\n    }) as ServerQRL<T>;\n  }\n  return rpc();\n};\n\n/** @public */\nexport const server$ = /*#__PURE__*/ implicit$FirstArg(serverQrl);\n\nconst getValidators = (rest: (CommonLoaderActionOptions | DataValidator)[], qrl: QRL) => {\n  let id: string | undefined;\n  const validators: DataValidator[] = [];\n  if (rest.length === 1) {\n    const options = rest[0];\n    if (options && typeof options === 'object') {\n      if ('validate' in options) {\n        validators.push(options);\n      } else {\n        id = options.id;\n        if (options.validation) {\n          validators.push(...options.validation);\n        }\n      }\n    }\n  } else if (rest.length > 1) {\n    validators.push(...(rest.filter((v) => !!v) as DataValidator[]));\n  }\n\n  if (typeof id === 'string') {\n    if (isDev) {\n      if (!/^[\\w/.-]+$/.test(id)) {\n        throw new Error(`Invalid id: ${id}, id can only contain [a-zA-Z0-9_.-]`);\n      }\n    }\n    id = `id_${id}`;\n  } else {\n    id = qrl.getHash();\n  }\n  return {\n    validators: validators.reverse(),\n    id,\n  };\n};\n\nconst deserializeStream = async function* (\n  stream: ReadableStream<Uint8Array>,\n  ctxElm: unknown,\n  abortSignal?: AbortSignal\n) {\n  const reader = stream.getReader();\n  try {\n    let buffer = '';\n    const decoder = new TextDecoder();\n    while (!abortSignal?.aborted) {\n      const result = await reader.read();\n      if (result.done) {\n        break;\n      }\n      buffer += decoder.decode(result.value, { stream: true });\n      const lines = buffer.split(/\\n/);\n      buffer = lines.pop()!;\n      for (const line of lines) {\n        yield await _deserializeData(line, ctxElm);\n      }\n    }\n  } finally {\n    reader.releaseLock();\n  }\n};\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/server-functions.unit.ts",
    "content": "import { describe, expectTypeOf, test } from 'vitest';\nimport * as z from 'zod';\nimport { server$ } from './server-functions';\nimport type { RequestEventBase, ValidatorErrorType } from './types';\n\ndescribe('types', () => {\n  test('matching', () => () => {\n    const foo = () => server$(() => 'hello');\n\n    expectTypeOf(foo).not.toBeAny();\n    expectTypeOf(foo).returns.toMatchTypeOf<() => Promise<string>>();\n    expectTypeOf(foo).returns.toMatchTypeOf<(sig: AbortSignal) => Promise<string>>();\n    expectTypeOf(foo).returns.not.toMatchTypeOf<(meep: boolean) => Promise<string>>();\n  });\n\n  test('matching with args', () => () => {\n    const foo = () => server$((name: string) => 'hello ' + name);\n\n    expectTypeOf(foo).not.toBeAny();\n    expectTypeOf(foo).returns.toMatchTypeOf<(name: string) => Promise<string>>();\n    expectTypeOf(foo).returns.toMatchTypeOf<(sig: AbortSignal, name: string) => Promise<string>>();\n    expectTypeOf(foo).returns.not.toMatchTypeOf<(meep: boolean) => Promise<string>>();\n  });\n\n  test('inferring', () => () => {\n    const callIt = () =>\n      server$(function () {\n        expectTypeOf(this).not.toBeAny();\n        expectTypeOf(this).toMatchTypeOf<RequestEventBase>();\n        return this;\n      })();\n\n    expectTypeOf(callIt).not.toBeAny();\n    expectTypeOf(callIt).returns.toMatchTypeOf<Promise<RequestEventBase>>();\n\n    const serverGetSourceSnippet = server$(async function (\n      publicApiKey: string,\n      symbolHash: string\n    ) {\n      return {\n        fullName: 'fullName',\n        count: 5,\n        origin: 'origin',\n        originUrl: 'url',\n        source: 'source',\n      };\n    });\n    expectTypeOf(serverGetSourceSnippet).not.toBeAny();\n    expectTypeOf(serverGetSourceSnippet('hi', 'there')).toEqualTypeOf<\n      Promise<{\n        fullName: string;\n        count: number;\n        origin: string;\n        originUrl: string;\n        source: string;\n      }>\n    >();\n    expectTypeOf(serverGetSourceSnippet(new AbortController().signal, 'hi', 'there')).toEqualTypeOf<\n      Promise<{\n        fullName: string;\n        count: number;\n        origin: string;\n        originUrl: string;\n        source: string;\n      }>\n    >();\n  });\n\n  test('easy zod type', () => () => {\n    const zodSchema = z.object({\n      username: z.string(),\n      password: z.string(),\n    });\n    type ErrorType = ValidatorErrorType<z.infer<typeof zodSchema>>['fieldErrors'];\n\n    expectTypeOf<ErrorType>().toEqualTypeOf<{\n      username?: string;\n      password?: string;\n    }>();\n  });\n\n  test('array zod type with string', () => () => {\n    const zodSchema = z.object({\n      arrayWithStrings: z.array(z.string()),\n    });\n    type ErrorType = ValidatorErrorType<z.infer<typeof zodSchema>>['fieldErrors'];\n\n    expectTypeOf<ErrorType>().toEqualTypeOf<{\n      ['arrayWithStrings[]']?: string[];\n    }>();\n  });\n\n  test('array zod type with object', () => () => {\n    const zodSchema = z.object({\n      persons: z.array(\n        z.object({\n          name: z.string(),\n          age: z.number(),\n        })\n      ),\n    });\n    type ErrorType = ValidatorErrorType<z.infer<typeof zodSchema>>['fieldErrors'];\n\n    expectTypeOf<ErrorType>().toEqualTypeOf<{\n      'persons[]'?: string[];\n      'persons[].name'?: string[];\n      'persons[].age'?: string[];\n    }>();\n  });\n\n  test('Complex zod type', () => () => {\n    const BaseUserSchema = z.object({\n      id: z.string().uuid(),\n      username: z.string().min(3).max(20),\n      email: z.string().email(),\n      createdAt: z.date().default(new Date()),\n      isActive: z.boolean().default(true),\n      someAnyType: z.any(),\n      roles: z.array(z.enum(['user', 'admin', 'moderator'])).default(['user']),\n      preferences: z\n        .object({\n          theme: z.enum(['light', 'dark']).default('light'),\n          notifications: z.boolean().default(true),\n        })\n        .optional(),\n    });\n\n    // Schema for an Admin user with additional fields\n    const AdminUserSchema = BaseUserSchema.extend({\n      adminSince: z.date(),\n      permissions: z.array(z.string()),\n    }).refine((data) => data.roles.includes('admin'), {\n      message: 'Admin role must be included in roles',\n    });\n\n    // Schema for a Moderator user with additional fields\n    const ModeratorUserSchema = BaseUserSchema.extend({\n      moderatedSections: z.array(z.string()),\n    }).refine((data) => data.roles.includes('moderator'), {\n      message: 'Moderator role must be included in roles',\n    });\n\n    // Union of all user types\n    const UserSchema = z.union([AdminUserSchema, ModeratorUserSchema, BaseUserSchema]);\n\n    type ErrorType = ValidatorErrorType<z.infer<typeof UserSchema>>['fieldErrors'];\n    type EqualType = {\n      username?: string;\n      id?: string;\n      email?: string;\n      isActive?: string;\n      preferences?: string;\n      'roles[]'?: string[];\n      'permissions[]'?: string[];\n      'moderatedSections[]'?: string[];\n    };\n\n    expectTypeOf<ErrorType>().toEqualTypeOf<EqualType>();\n\n    expectTypeOf<ErrorType>().not.toEqualTypeOf<{\n      someAnyType?: string;\n    }>();\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/service-worker/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../../../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/runtime/src/service-worker/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik-city.service-worker\",\n    \"reportFolder\": \"<projectFolder>/src/runtime/src/service-worker/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/src/runtime/service-worker\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/service-worker.d.ts\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/service-worker/index.ts",
    "content": "/**\n * @deprecated This is no longer needed, Qwik now automatically embeds preloading logic into the\n *   application.\n *\n *   If your service-worker.ts file contains no custom code, you should deploy to production until\n *   you're sure that all users picked up the new version, then you can remove it and also remove\n *   the `<ServiceWorkerRegister />` component from your `Root.tsx`.\n *\n *   If you do have custom service worker logic, you should keep the `service-worker.ts` file and\n *   `<ServiceWorkerRegister />` component, but remove the `setupServiceWorker()` call.\n * @public\n */\nexport const setupServiceWorker = () => {};\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/service-worker/qwik-city.service-worker.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n// @public @deprecated (undocumented)\nexport const setupServiceWorker: () => void;\n\n// (No @packageDocumentation comment for this package)\n```\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/spa-init.ts",
    "content": "import type { ClientSPAWindow } from './qwik-city-component';\nimport type { ScrollHistoryState } from './scroll-restoration';\nimport type { ScrollState } from './types';\n\nimport { isDev } from '@builder.io/qwik';\nimport { event$ } from '@builder.io/qwik';\n\n// TODO Dedupe handler code from here and QwikCityProvider?\n// TODO Navigation API; check for support & simplify.\n\n// SPA init script:\n// - Pre-cached when upgrading to SPA.\n// - Reasonable expectation this file is already cached for history revisits.\n// - Robust, fully relies only on history. (scrollRestoration = 'manual')\n\n// ! DO NOT IMPORT OR USE ANY EXTERNAL REFERENCES IN THIS SCRIPT.\nexport default event$((_: Event, el: Element) => {\n  const win: ClientSPAWindow = window;\n  const spa = '_qCitySPA';\n  const initPopstate = '_qCityInitPopstate';\n  const initAnchors = '_qCityInitAnchors';\n  const initVisibility = '_qCityInitVisibility';\n  const initScroll = '_qCityInitScroll';\n  if (\n    !win[spa] &&\n    !win[initPopstate] &&\n    !win[initAnchors] &&\n    !win[initVisibility] &&\n    !win[initScroll]\n  ) {\n    const currentPath = location.pathname + location.search;\n\n    const historyPatch = '_qCityHistoryPatch';\n    const bootstrap = '_qCityBootstrap';\n    const scrollEnabled = '_qCityScrollEnabled';\n    const debounceTimeout = '_qCityScrollDebounce';\n    const scrollHistory = '_qCityScroll';\n\n    const checkAndScroll = (scrollState: ScrollState | undefined) => {\n      if (scrollState) {\n        win.scrollTo(scrollState.x, scrollState.y);\n      }\n    };\n\n    const currentScrollState = (): ScrollState => {\n      const elm = document.documentElement;\n      return {\n        x: elm.scrollLeft,\n        y: elm.scrollTop,\n        w: Math.max(elm.scrollWidth, elm.clientWidth),\n        h: Math.max(elm.scrollHeight, elm.clientHeight),\n      };\n    };\n\n    const saveScrollState = (scrollState?: ScrollState) => {\n      const state: ScrollHistoryState = history.state || {};\n      state[scrollHistory] = scrollState || currentScrollState();\n      history.replaceState(state, '');\n    };\n\n    saveScrollState();\n\n    win[initPopstate] = () => {\n      if (win[spa]) {\n        return;\n      }\n\n      // Disable scroll handler eagerly to prevent overwriting history.state.\n      win[scrollEnabled] = false;\n      clearTimeout(win[debounceTimeout]);\n\n      if (currentPath !== location.pathname + location.search) {\n        const getContainer = (el: Element) => el.closest('[q\\\\:container]');\n        // Hook into useNavigate context, if available.\n        // We hijack a <Link> here, goes through the loader, resumes, app, etc. Simple.\n        // TODO Will only work with <Link>, is there a better way?\n        const link = getContainer(el)?.querySelector('a[q\\\\:link]');\n\n        if (link) {\n          // Re-acquire container, link may be in a nested container.\n          const container = getContainer(link)!;\n          const bootstrapLink = link.cloneNode() as HTMLAnchorElement;\n          bootstrapLink.setAttribute('q:nbs', '');\n          bootstrapLink.style.display = 'none';\n\n          container.appendChild(bootstrapLink);\n          win[bootstrap] = bootstrapLink;\n          bootstrapLink.click();\n        } else {\n          // No useNavigate ctx available, fallback to reload.\n          location.reload();\n        }\n      } else {\n        if (history.scrollRestoration === 'manual') {\n          const scrollState = (history.state as ScrollHistoryState)?.[scrollHistory];\n          checkAndScroll(scrollState);\n          win[scrollEnabled] = true;\n        }\n      }\n    };\n\n    if (!win[historyPatch]) {\n      win[historyPatch] = true;\n      const pushState = history.pushState;\n      const replaceState = history.replaceState;\n\n      const prepareState = (state: any) => {\n        if (state === null || typeof state === 'undefined') {\n          state = {};\n        } else if (state?.constructor !== Object) {\n          state = { _data: state };\n\n          if (isDev) {\n            console.warn(\n              'In a Qwik SPA context, `history.state` is used to store scroll state. ' +\n                'Direct calls to `pushState()` and `replaceState()` must supply an actual Object type. ' +\n                'We need to be able to automatically attach the scroll state to your state object. ' +\n                'A new state object has been created, your data has been moved to: `history.state._data`'\n            );\n          }\n        }\n\n        state._qCityScroll = state._qCityScroll || currentScrollState();\n        return state;\n      };\n\n      history.pushState = (state, title, url) => {\n        state = prepareState(state);\n        return pushState.call(history, state, title, url);\n      };\n\n      history.replaceState = (state, title, url) => {\n        state = prepareState(state);\n        return replaceState.call(history, state, title, url);\n      };\n    }\n\n    // We need this handler in init because Firefox destroys states w/ anchor tags.\n    win[initAnchors] = (event: MouseEvent) => {\n      if (win[spa] || event.defaultPrevented) {\n        return;\n      }\n\n      const target = (event.target as HTMLElement).closest('a[href]');\n\n      if (target && !target.hasAttribute('preventdefault:click')) {\n        const href = target.getAttribute('href')!;\n        const prev = new URL(location.href);\n        const dest = new URL(href, prev);\n        const sameOrigin = dest.origin === prev.origin;\n        const samePath = dest.pathname + dest.search === prev.pathname + prev.search;\n        // Patch only same-page anchors.\n        if (sameOrigin && samePath) {\n          event.preventDefault();\n\n          // Check href because empty hashes don't register.\n          if (dest.href !== prev.href) {\n            history.pushState(null, '', dest);\n          }\n\n          if (!dest.hash) {\n            if (dest.href.endsWith('#')) {\n              window.scrollTo(0, 0);\n            } else {\n              // Simulate same-page (no hash) anchor reload.\n              // history.scrollRestoration = 'manual' makes these not scroll.\n              win[scrollEnabled] = false;\n              clearTimeout(win[debounceTimeout]);\n              saveScrollState({ ...currentScrollState(), x: 0, y: 0 });\n              location.reload();\n            }\n          } else {\n            const elmId = dest.hash.slice(1);\n            const elm = document.getElementById(elmId);\n            if (elm) {\n              elm.scrollIntoView();\n            }\n          }\n        }\n      }\n    };\n\n    win[initVisibility] = () => {\n      if (!win[spa] && win[scrollEnabled] && document.visibilityState === 'hidden') {\n        saveScrollState();\n      }\n    };\n\n    win[initScroll] = () => {\n      if (win[spa] || !win[scrollEnabled]) {\n        return;\n      }\n\n      clearTimeout(win[debounceTimeout]);\n      win[debounceTimeout] = setTimeout(() => {\n        saveScrollState();\n        // Needed for e2e debounceDetector.\n        win[debounceTimeout] = undefined;\n      }, 200);\n    };\n\n    win[scrollEnabled] = true;\n\n    setTimeout(() => {\n      win.addEventListener('popstate', win[initPopstate]!);\n      win.addEventListener('scroll', win[initScroll]!, { passive: true });\n      document.addEventListener('click', win[initAnchors]!);\n\n      if (!(win as any).navigation) {\n        document.addEventListener('visibilitychange', win[initVisibility]!, {\n          passive: true,\n        });\n      }\n    }, 0);\n  }\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/sw-component.tsx",
    "content": "import swRegister from '@qwik-city-sw-register';\nimport type { JSXOutput } from '@builder.io/qwik';\n/**\n * Loads the service workers that are defined in the routes. Any file named `service-worker.*` (all\n * JS extensions are allowed) will be picked up, bundled into a separate file, and registered as a\n * service worker.\n *\n * Qwik 1.14.0 and above now use `<link rel=\"modulepreload\">` by default. If you didn't add custom\n * service-worker logic, you should remove your service-worker.ts file(s) for the\n * `ServiceWorkerRegister` Component to actually unregister the service-worker.js and delete its\n * related cache. Make sure to keep the `ServiceWorkerRegister` Component in your app (without any\n * service-worker.ts file) as long as you want to unregister the service-worker.js for your users.\n *\n * @public\n */\nexport const ServiceWorkerRegister = (props: { nonce?: string }): JSXOutput => (\n  <script type=\"module\" dangerouslySetInnerHTML={swRegister} nonce={props.nonce} />\n);\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/sw-register-runtime.ts",
    "content": "// generated at build time from sw-register.ts\n// with the user configured /service-worker.js url\n\nexport default '';\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/sw-register.ts",
    "content": "// Source for what becomes innerHTML to the <ServiceWorkerRegister/> script\n\n(() => {\n  if ('serviceWorker' in navigator) {\n    navigator.serviceWorker.register('__url').catch((e) => console.error(e));\n    // We need to delete the cache since we are using modulepreload by default in qwik 1.14 and above\n    if ('caches' in window) {\n      caches\n        .keys()\n        .then((names) => {\n          const cacheName = names.find((name) => name.startsWith('QwikBuild'));\n          if (cacheName) {\n            caches.delete(cacheName).catch(console.error);\n          }\n        })\n        .catch(console.error);\n    }\n  } else {\n    // eslint-disable-next-line no-console\n    console.log('Service worker not supported in this browser.');\n  }\n})();\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/types.ts",
    "content": "import type {\n  NoSerialize,\n  QRL,\n  QwikIntrinsicElements,\n  Signal,\n  ValueOrPromise,\n  ReadonlySignal,\n} from '@builder.io/qwik';\nimport type {\n  RequestEvent,\n  RequestEventAction,\n  RequestEventBase,\n  RequestEventLoader,\n  RequestHandler,\n  ResolveSyncValue,\n  EnvGetter,\n} from '@builder.io/qwik-city/middleware/request-handler';\nimport type * as v from 'valibot';\nimport type * as z from 'zod';\n\nexport type {\n  Cookie,\n  CookieOptions,\n  CookieValue,\n  DeferReturn,\n  RequestEvent,\n  RequestEventAction,\n  RequestEventCommon,\n  RequestEventLoader,\n  RequestEventBase,\n  RequestHandler,\n  ResolveSyncValue,\n  ResolveValue,\n} from '@builder.io/qwik-city/middleware/request-handler';\n\nexport interface RouteModule<BODY = unknown> {\n  onDelete?: RequestHandler<BODY> | RequestHandler<BODY>[];\n  onGet?: RequestHandler<BODY> | RequestHandler<BODY>[];\n  onHead?: RequestHandler<BODY> | RequestHandler<BODY>[];\n  onOptions?: RequestHandler<BODY> | RequestHandler<BODY>[];\n  onPatch?: RequestHandler<BODY> | RequestHandler<BODY>[];\n  onPost?: RequestHandler<BODY> | RequestHandler<BODY>[];\n  onPut?: RequestHandler<BODY> | RequestHandler<BODY>[];\n  onRequest?: RequestHandler<BODY> | RequestHandler<BODY>[];\n}\n\n/** @public */\nexport interface PageModule extends RouteModule {\n  readonly default: unknown;\n  readonly head?: ContentModuleHead;\n  readonly headings?: ContentHeading[];\n  readonly onStaticGenerate?: StaticGenerateHandler;\n}\n\nexport interface LayoutModule extends RouteModule {\n  readonly default: unknown;\n  readonly head?: ContentModuleHead;\n}\n\nexport interface MenuModule {\n  readonly default: ContentMenu;\n}\n\n/** @public */\nexport interface RouteLocation {\n  readonly params: Readonly<Record<string, string>>;\n  readonly url: URL;\n  readonly isNavigating: boolean;\n  readonly prevUrl: URL | undefined;\n}\n\n/** @public */\nexport type NavigationType = 'initial' | 'form' | 'link' | 'popstate';\n\n/** @internal */\nexport type RouteStateInternal = {\n  type: NavigationType;\n  dest: URL;\n  forceReload?: boolean;\n  replaceState?: boolean;\n  scroll?: boolean;\n};\n\nexport type RebuildRouteInfoInternal = (\n  url: URL\n) => Promise<{ loadedRoute: LoadedRoute | null; requestHandlers: RequestHandler<any>[] }>;\n\n/**\n * @param url - The URL that the user is trying to navigate to, or a number to indicate the user is\n *   trying to navigate back/forward in the application history. If it is missing, the event is sent\n *   by the browser and the user is trying to reload or navigate away from the page. In this case,\n *   the function should decide the answer synchronously.\n * @returns `true` to prevent navigation, `false` to allow navigation, or a Promise that resolves to\n *   `true` or `false`. For browser events, returning `true` or a Promise may show a confirmation\n *   dialog, at the browser's discretion. If the user confirms, the navigation will still be\n *   allowed.\n * @public\n */\nexport type PreventNavigateCallback = (url?: number | URL) => ValueOrPromise<boolean>;\n\n/** @internal registers prevent navigate handler and returns cleanup function */\nexport type RoutePreventNavigate = QRL<(cb$: QRL<PreventNavigateCallback>) => () => void>;\n\nexport type ScrollState = {\n  x: number;\n  y: number;\n  w: number;\n  h: number;\n};\n\n/** @public */\nexport type RouteNavigate = QRL<\n  (\n    path?: string | number | URL,\n    options?:\n      | {\n          type?: Exclude<NavigationType, 'initial'>;\n          forceReload?: boolean;\n          replaceState?: boolean;\n          scroll?: boolean;\n        }\n      | boolean\n  ) => Promise<void>\n>;\n\nexport type RouteAction = Signal<RouteActionValue>;\n\nexport type RouteActionResolver = { status: number; result: unknown };\nexport type RouteActionValue =\n  | {\n      id: string;\n      data: FormData | Record<string, unknown> | undefined;\n      output?: RouteActionResolver;\n      resolve?: NoSerialize<(data: RouteActionResolver) => void>;\n    }\n  | undefined;\n\nexport type MutableRouteLocation = Mutable<RouteLocation>;\n\nexport type Mutable<T> = { -readonly [K in keyof T]: T[K] };\n\n/** @public */\nexport interface DocumentHeadValue<\n  FrontMatter extends Record<string, any> = Record<string, unknown>,\n> {\n  /** Sets `document.title`. */\n  readonly title?: string;\n  /**\n   * Used to manually set meta tags in the head. Additionally, the `data` property could be used to\n   * set arbitrary data which the `<head>` component could later use to generate `<meta>` tags.\n   */\n  readonly meta?: readonly DocumentMeta[];\n  /** Used to manually append `<link>` elements to the `<head>`. */\n  readonly links?: readonly DocumentLink[];\n  /** Used to manually append `<style>` elements to the `<head>`. */\n  readonly styles?: readonly DocumentStyle[];\n  /** Used to manually append `<script>` elements to the `<head>`. */\n  readonly scripts?: readonly DocumentScript[];\n  /**\n   * Arbitrary object containing custom data. When the document head is created from markdown files,\n   * the frontmatter attributes that are not recognized as a well-known meta names (such as title,\n   * description, author, etc...), are stored in this property.\n   */\n  readonly frontmatter?: Readonly<FrontMatter>;\n}\n\n/** @public */\nexport type ResolvedDocumentHead<\n  FrontMatter extends Record<string, any> = Record<string, unknown>,\n> = Required<DocumentHeadValue<FrontMatter>>;\n\n/** @public */\nexport interface DocumentMeta {\n  readonly content?: string;\n  readonly httpEquiv?: string;\n  readonly name?: string;\n  readonly property?: string;\n  readonly key?: string;\n  readonly itemprop?: string;\n  readonly media?: string;\n}\n\n/** @public */\nexport interface DocumentLink {\n  as?: string;\n  crossorigin?: string;\n  disabled?: boolean;\n  href?: string;\n  hreflang?: string;\n  id?: string;\n  imagesizes?: string;\n  imagesrcset?: string;\n  integrity?: string;\n  media?: string;\n  prefetch?: string;\n  referrerpolicy?: string;\n  rel?: string;\n  sizes?: string;\n  title?: string;\n  type?: string;\n  key?: string;\n}\n\n/** @public */\nexport interface DocumentStyle {\n  readonly style: string;\n  readonly props?: Readonly<QwikIntrinsicElements['style']>;\n  readonly key?: string;\n}\n\n/** @alpha */\nexport interface DocumentScript {\n  readonly script?: string;\n  readonly props?: Readonly<QwikIntrinsicElements['script']>;\n  readonly key?: string;\n}\n\n/** @public */\nexport interface DocumentHeadProps extends RouteLocation {\n  readonly head: ResolvedDocumentHead;\n  readonly withLocale: <T>(fn: () => T) => T;\n  readonly resolveValue: ResolveSyncValue;\n}\n\n/** @public */\nexport type DocumentHead = DocumentHeadValue | ((props: DocumentHeadProps) => DocumentHeadValue);\n\nexport type ContentStateInternal = NoSerialize<ContentModule[]>;\n\n/** @public */\nexport interface ContentState {\n  readonly headings: ContentHeading[] | undefined;\n  readonly menu: ContentMenu | undefined;\n}\n\n/** @public */\nexport interface ContentMenu {\n  readonly text: string;\n  readonly href?: string;\n  readonly items?: ContentMenu[];\n}\n\n/** @public */\nexport interface ContentHeading {\n  readonly text: string;\n  readonly id: string;\n  readonly level: number;\n}\n\nexport type ContentModuleLoader = () => Promise<ContentModule>;\nexport type EndpointModuleLoader = () => Promise<RouteModule>;\nexport type ModuleLoader = ContentModuleLoader | EndpointModuleLoader;\nexport type MenuModuleLoader = () => Promise<MenuModule>;\n\n/** @public */\nexport type RouteData =\n  | [routeName: string, loaders: ModuleLoader[]]\n  | [\n      routeName: string,\n      loaders: ModuleLoader[],\n      originalPathname: string,\n      routeBundleNames: string[],\n    ];\n\n/** @public */\nexport type MenuData = [pathname: string, menuLoader: MenuModuleLoader];\n\n/** @public */\nexport interface QwikCityPlan {\n  readonly routes: RouteData[];\n  readonly serverPlugins?: RouteModule[];\n  readonly basePathname?: string;\n  readonly menus?: MenuData[];\n  readonly trailingSlash?: boolean;\n  readonly cacheModules?: boolean;\n}\n\n/** @public */\nexport declare type PathParams = Record<string, string>;\n\nexport type ContentModule = PageModule | LayoutModule;\n\nexport type ContentModuleHead = DocumentHead | ResolvedDocumentHead;\n\nexport type LoadedRoute = [\n  routeName: string,\n  params: PathParams,\n  mods: (RouteModule | ContentModule)[],\n  menu: ContentMenu | undefined,\n  routeBundleNames: string[] | undefined,\n];\n\nexport interface LoadedContent extends LoadedRoute {\n  pageModule: PageModule;\n}\n\nexport type RequestHandlerBody<BODY> = BODY | string | number | boolean | undefined | null | void;\n\nexport type RequestHandlerBodyFunction<BODY> = () =>\n  | RequestHandlerBody<BODY>\n  | Promise<RequestHandlerBody<BODY>>;\n\nexport interface EndpointResponse {\n  status: number;\n  loaders: Record<string, unknown>;\n  formData?: FormData;\n  action?: string;\n}\n\nexport interface ClientPageData extends Omit<EndpointResponse, 'status'> {\n  status: number;\n  href: string;\n  redirect?: string;\n  isRewrite?: boolean;\n}\n\n/** @public */\nexport type StaticGenerateHandler = ({\n  env,\n}: {\n  env: EnvGetter;\n}) => Promise<StaticGenerate> | StaticGenerate;\n\n/** @public */\nexport interface StaticGenerate {\n  params?: PathParams[];\n}\n\nexport interface QwikCityRenderDocument extends Document {}\n\nexport interface QwikCityEnvData {\n  routeName: string;\n  ev: RequestEvent;\n  params: PathParams;\n  response: EndpointResponse;\n  loadedRoute: LoadedRoute | null;\n}\n\nexport interface SimpleURL {\n  origin: string;\n  href: string;\n  pathname: string;\n  search: string;\n  hash: string;\n}\n\nexport type Editable<T> = {\n  -readonly [P in keyof T]: T[P];\n};\n\ntype UnionKeys<T> = T extends T ? keyof T : never;\ntype StrictUnionHelper<T, TAll> = T extends any\n  ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>>\n  : never;\n\n/** @public */\nexport type StrictUnion<T> = Prettify<StrictUnionHelper<T, T>>;\n\ntype Prettify<T> = {} & {\n  [K in keyof T]: T[K];\n};\n\n/** @public */\nexport type JSONValue = string | number | boolean | { [x: string]: JSONValue } | Array<JSONValue>;\n\n/** @public */\nexport type JSONObject = { [x: string]: JSONValue };\n\n/** @public */\nexport type GetValidatorInputType<VALIDATOR extends TypedDataValidator> =\n  VALIDATOR extends ValibotDataValidator<infer TYPE>\n    ? v.InferInput<TYPE>\n    : VALIDATOR extends ZodDataValidator<infer TYPE>\n      ? z.input<TYPE>\n      : never;\n\n/** @public */\nexport type GetValidatorOutputType<VALIDATOR extends TypedDataValidator> =\n  VALIDATOR extends ValibotDataValidator<infer TYPE>\n    ? v.InferOutput<TYPE>\n    : VALIDATOR extends ZodDataValidator<infer TYPE>\n      ? z.output<TYPE>\n      : never;\n\n/** @public */\nexport type GetValidatorType<VALIDATOR extends TypedDataValidator> =\n  GetValidatorOutputType<VALIDATOR>;\n\n/** @public */\nexport interface CommonLoaderActionOptions {\n  readonly id?: string;\n  readonly validation?: DataValidator[];\n}\n\n/** @public */\nexport type FailOfRest<REST extends readonly DataValidator[]> = REST extends readonly DataValidator<\n  infer ERROR\n>[]\n  ? ERROR\n  : never;\n\ntype IsAny<Type> = 0 extends 1 & Type ? true : false;\n\n/** @public */\nexport type ValidatorErrorKeyDotNotation<T, Prefix extends string = ''> =\n  IsAny<T> extends true\n    ? never\n    : T extends object\n      ? {\n          [K in keyof T & string]: IsAny<T[K]> extends true\n            ? never\n            : T[K] extends (infer U)[]\n              ? IsAny<U> extends true\n                ? never\n                : U extends object\n                  ? `${Prefix}${K}[]` | ValidatorErrorKeyDotNotation<U, `${Prefix}${K}[].`>\n                  : `${Prefix}${K}[]`\n              : T[K] extends object\n                ? ValidatorErrorKeyDotNotation<T[K], `${Prefix}${K}.`>\n                : `${Prefix}${K}`;\n        }[keyof T & string]\n      : never;\n\n/** @public */\nexport type ValidatorErrorType<T, U = string> = {\n  formErrors: U[];\n  fieldErrors: Partial<{\n    [K in ValidatorErrorKeyDotNotation<T>]: K extends `${infer _Prefix}[]${infer _Suffix}`\n      ? U[]\n      : U;\n  }>;\n};\n\n/** @public */\nexport type ActionConstructor = {\n  // Use options object, use typed data validator, use data validator\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction\n    ) => ValueOrPromise<OBJ>,\n    options: {\n      readonly id?: string;\n      readonly validation: [VALIDATOR, ...REST];\n    }\n  ): Action<\n    StrictUnion<\n      | OBJ\n      | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n      | FailReturn<FailOfRest<REST>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use options object, use typed data validator\n  <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction\n    ) => ValueOrPromise<OBJ>,\n    options: {\n      readonly id?: string;\n      readonly validation: [VALIDATOR];\n    }\n  ): Action<\n    StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use options object, use data validator\n  <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(\n    actionQrl: (data: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>,\n    options: {\n      readonly id?: string;\n      readonly validation: REST;\n    }\n  ): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n\n  // Use typed data validator, use data validator\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction\n    ) => ValueOrPromise<OBJ>,\n    options: VALIDATOR,\n    ...rest: REST\n  ): Action<\n    StrictUnion<\n      | OBJ\n      | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n      | FailReturn<FailOfRest<REST>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use typed data validator\n  <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(\n    actionQrl: (\n      data: GetValidatorOutputType<VALIDATOR>,\n      event: RequestEventAction\n    ) => ValueOrPromise<OBJ>,\n    options: VALIDATOR\n  ): Action<\n    StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use data validator\n  <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(\n    actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>,\n    ...rest: REST\n  ): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n\n  // No validators\n  <OBJ>(\n    actionQrl: (form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>,\n    options?: {\n      readonly id?: string;\n    }\n  ): Action<StrictUnion<OBJ>>;\n};\n\n/** @public */\nexport type ActionConstructorQRL = {\n  // Use options object, use typed data validator, use data validator\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: QRL<\n      (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>\n    >,\n    options: {\n      readonly id?: string;\n      readonly validation: [VALIDATOR, ...REST];\n    }\n  ): Action<\n    StrictUnion<\n      | OBJ\n      | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n      | FailReturn<FailOfRest<REST>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use options object, use typed data validator\n  <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(\n    actionQrl: QRL<\n      (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>\n    >,\n    options: {\n      readonly id?: string;\n      readonly validation: [VALIDATOR];\n    }\n  ): Action<\n    StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use options object, use data validator\n  <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(\n    actionQrl: QRL<(data: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>>,\n    options: {\n      readonly id?: string;\n      readonly validation: REST;\n    }\n  ): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n\n  // Use typed data validator, use data validator\n  <\n    OBJ extends Record<string, any> | void | null,\n    VALIDATOR extends TypedDataValidator,\n    REST extends [DataValidator, ...DataValidator[]],\n  >(\n    actionQrl: QRL<\n      (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>\n    >,\n    options: VALIDATOR,\n    ...rest: REST\n  ): Action<\n    StrictUnion<\n      | OBJ\n      | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>\n      | FailReturn<FailOfRest<REST>>\n    >,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use typed data validator\n  <OBJ extends Record<string, any> | void | null, VALIDATOR extends TypedDataValidator>(\n    actionQrl: QRL<\n      (data: GetValidatorOutputType<VALIDATOR>, event: RequestEventAction) => ValueOrPromise<OBJ>\n    >,\n    options: VALIDATOR\n  ): Action<\n    StrictUnion<OBJ | FailReturn<ValidatorErrorType<GetValidatorInputType<VALIDATOR>>>>,\n    GetValidatorInputType<VALIDATOR>,\n    false\n  >;\n\n  // Use data validator\n  <OBJ extends Record<string, any> | void | null, REST extends [DataValidator, ...DataValidator[]]>(\n    actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>>,\n    ...rest: REST\n  ): Action<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n\n  // No validators\n  <OBJ>(\n    actionQrl: QRL<(form: JSONObject, event: RequestEventAction) => ValueOrPromise<OBJ>>,\n    options?: {\n      readonly id?: string;\n    }\n  ): Action<StrictUnion<OBJ>>;\n};\n\n/** @public */\nexport type LoaderOptions = {\n  id?: string;\n};\n\n/** @public */\nexport type LoaderConstructor = {\n  // Without validation\n  <OBJ>(\n    loaderFn: (event: RequestEventLoader) => ValueOrPromise<OBJ>,\n    options?: LoaderOptions\n  ): Loader<[Extract<OBJ, Failed>] extends [never] ? OBJ : StrictUnion<OBJ>>;\n\n  // With validation\n  <OBJ extends Record<string, any> | void | null, REST extends readonly DataValidator[]>(\n    loaderFn: (event: RequestEventLoader) => ValueOrPromise<OBJ>,\n    ...rest: REST\n  ): Loader<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n};\n\n/** @public */\nexport type LoaderConstructorQRL = {\n  // Without validation\n  <OBJ>(\n    loaderQrl: QRL<(event: RequestEventLoader) => ValueOrPromise<OBJ>>,\n    options?: LoaderOptions\n  ): Loader<[Extract<OBJ, Failed>] extends [never] ? OBJ : StrictUnion<OBJ>>;\n\n  // With validation\n  <OBJ extends Record<string, any> | void | null, REST extends readonly DataValidator[]>(\n    loaderQrl: QRL<(event: RequestEventLoader) => ValueOrPromise<OBJ>>,\n    ...rest: REST\n  ): Loader<StrictUnion<OBJ | FailReturn<FailOfRest<REST>>>>;\n};\n\nexport type LoaderStateHolder = Record<string, Signal<unknown>>;\n\n/** @public */\nexport type ActionReturn<RETURN> = {\n  readonly status?: number;\n  readonly value: RETURN;\n};\n\n/** @public */\nexport type ActionStore<RETURN, INPUT, OPTIONAL extends boolean = true> = {\n  /**\n   * It's the \"action\" path that a native `<form>` should have in order to call the action.\n   *\n   * ```tsx\n   *  <form action={action.actionPath} />\n   * ```\n   *\n   * Most of the time this property should not be used directly, instead use the `Form` component:\n   *\n   * ```tsx\n   * import {action$, Form} from '@builder.io/qwik-city';\n   *\n   * export const useAddUser = action$(() => { ... });\n   *\n   * export default component$(() => {\n   *   const action = useAddUser();\n   *   return (\n   *     <Form action={action}/>\n   *   );\n   * });\n   * ```\n   */\n  readonly actionPath: string;\n\n  /**\n   * Reactive property that becomes `true` only in the browser, when a form is submitted and\n   * switched back to false when the action finish, ie, it describes if the action is actively\n   * running.\n   *\n   * This property is specially useful to disable the submit button while the action is processing,\n   * to prevent multiple submissions, and to inform visually to the user that the action is actively\n   * running.\n   *\n   * It will be always `false` in the server, and only becomes `true` briefly while the action is\n   * running.\n   */\n  readonly isRunning: boolean;\n\n  /**\n   * Returned HTTP status code of the action after its last execution.\n   *\n   * It's `undefined` before the action is first called.\n   */\n  readonly status?: number;\n\n  /**\n   * When calling an action through a `<form>`, this property contains the previously submitted\n   * `FormData`.\n   *\n   * This is useful to keep the filled form data even after a full page reload.\n   *\n   * It's `undefined` before the action is first called.\n   */\n  readonly formData: FormData | undefined;\n\n  /**\n   * Returned successful data of the action. This reactive property will contain the data returned\n   * inside the `action$` function.\n   *\n   * It's `undefined` before the action is first called.\n   */\n  readonly value: RETURN | undefined;\n\n  /**\n   * Method to execute the action programmatically from the browser. Ie, instead of using a\n   * `<form>`, a 'click' handle can call the `run()` method of the action in order to execute the\n   * action in the server.\n   */\n  readonly submit: QRL<\n    OPTIONAL extends true\n      ? (form?: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>>\n      : (form: INPUT | FormData | SubmitEvent) => Promise<ActionReturn<RETURN>>\n  >;\n  /** Is action.submit was submitted */\n  readonly submitted: boolean;\n};\n\ntype Failed = {\n  failed: true;\n};\n\n/** @public */\nexport type FailReturn<T> = T & Failed;\n\n/** @public */\nexport type LoaderSignal<TYPE> = TYPE extends () => ValueOrPromise<infer VALIDATOR>\n  ? ReadonlySignal<ValueOrPromise<VALIDATOR>>\n  : ReadonlySignal<TYPE>;\n\n/** @public */\nexport type Loader<RETURN> = {\n  /**\n   * Returns the `Signal` containing the data returned by the `loader$` function. Like all `use-`\n   * functions and methods, it can only be invoked within a `component$()`.\n   */\n  (): LoaderSignal<RETURN>;\n};\n\nexport interface LoaderInternal extends Loader<any> {\n  readonly __brand?: 'server_loader';\n  __qrl: QRL<(event: RequestEventLoader) => ValueOrPromise<unknown>>;\n  __id: string;\n  __validators: DataValidator[] | undefined;\n  (): LoaderSignal<unknown>;\n}\n\n/** @public */\nexport type Action<RETURN, INPUT = Record<string, unknown>, OPTIONAL extends boolean = true> = {\n  /**\n   * Returns the `ActionStore` containing the current action state and methods to invoke it from a\n   * component$(). Like all `use-` functions and methods, it can only be invoked within a\n   * `component$()`.\n   */\n  (): ActionStore<RETURN, INPUT, OPTIONAL>;\n};\n\nexport interface ActionInternal extends Action<any, any> {\n  readonly __brand: 'server_action';\n  __id: string;\n  __qrl: QRL<(form: JSONObject, event: RequestEventAction) => ValueOrPromise<unknown>>;\n  __validators: DataValidator[] | undefined;\n\n  (): ActionStore<unknown, unknown>;\n}\n/** @public */\nexport type ValidatorReturn<T extends Record<string, any> = {}> =\n  | ValidatorReturnSuccess\n  | ValidatorReturnFail<T>;\n\nexport type ValidatorReturnSuccess = {\n  readonly success: true;\n  readonly data?: unknown;\n};\n\nexport type ValidatorReturnFail<T extends Record<string, any> = {}> = {\n  readonly success: false;\n  readonly error: T;\n  readonly status?: number;\n};\n\n/** @public */\nexport type DataValidator<T extends Record<string, any> = {}> = {\n  validate(ev: RequestEvent, data: unknown): Promise<ValidatorReturn<T>>;\n};\n\nexport type ValidatorConstructor = {\n  <T extends ValidatorReturn>(\n    validator: (ev: RequestEvent, data: unknown) => ValueOrPromise<T>\n  ): T extends ValidatorReturnFail<infer ERROR> ? DataValidator<ERROR> : DataValidator<never>;\n};\n\nexport type ValidatorConstructorQRL = {\n  <T extends ValidatorReturn>(\n    validator: QRL<(ev: RequestEvent, data: unknown) => ValueOrPromise<T>>\n  ): T extends ValidatorReturnFail<infer ERROR> ? DataValidator<ERROR> : DataValidator<never>;\n};\n\n/** @alpha */\nexport type ValibotDataValidator<\n  T extends v.GenericSchema | v.GenericSchemaAsync = v.GenericSchema | v.GenericSchemaAsync,\n> = {\n  readonly __brand: 'valibot';\n  validate(\n    ev: RequestEvent,\n    data: unknown\n  ): Promise<ValidatorReturn<ValidatorErrorType<v.InferInput<T>>>>;\n};\n\n/** @alpha */\nexport type ValibotConstructor = {\n  <T extends v.GenericSchema | v.GenericSchemaAsync>(schema: T): ValibotDataValidator<T>;\n  <T extends v.GenericSchema | v.GenericSchemaAsync>(\n    schema: (ev: RequestEvent) => T\n  ): ValibotDataValidator<T>;\n};\n\n/** @alpha */\nexport type ValibotConstructorQRL = {\n  <T extends v.GenericSchema | v.GenericSchemaAsync>(schema: QRL<T>): ValibotDataValidator<T>;\n  <T extends v.GenericSchema | v.GenericSchemaAsync>(\n    schema: QRL<(ev: RequestEvent) => T>\n  ): ValibotDataValidator<T>;\n};\n\n/** @public */\nexport type ZodDataValidator<T extends z.ZodType = z.ZodType> = {\n  readonly __brand: 'zod';\n  validate(\n    ev: RequestEvent,\n    data: unknown\n  ): Promise<ValidatorReturn<ValidatorErrorType<z.input<T>>>>;\n};\n\n/** @public */\nexport type ZodConstructor = {\n  <T extends z.ZodRawShape>(schema: T): ZodDataValidator<z.ZodObject<T>>;\n  <T extends z.ZodRawShape>(\n    schema: (zod: typeof z.z, ev: RequestEvent) => T\n  ): ZodDataValidator<z.ZodObject<T>>;\n  <T extends z.Schema>(schema: T): ZodDataValidator<T>;\n  <T extends z.Schema>(schema: (zod: typeof z.z, ev: RequestEvent) => T): ZodDataValidator<T>;\n};\n\n/** @public */\nexport type ZodConstructorQRL = {\n  <T extends z.ZodRawShape>(schema: QRL<T>): ZodDataValidator<z.ZodObject<T>>;\n  <T extends z.ZodRawShape>(\n    schema: QRL<(zod: typeof z.z, ev: RequestEvent) => T>\n  ): ZodDataValidator<z.ZodObject<T>>;\n  <T extends z.Schema>(schema: QRL<T>): ZodDataValidator<T>;\n  <T extends z.Schema>(schema: QRL<(zod: typeof z.z, ev: RequestEvent) => T>): ZodDataValidator<T>;\n};\n\n/** @public */\nexport type TypedDataValidator = ValibotDataValidator | ZodDataValidator;\n\n/** @public */\nexport interface ServerConfig {\n  // TODO: create id registry\n  // id?: string;\n  origin?: string;\n  // TODO: recreate sending arguments as queryParams\n  // only support \"get\" and \"post\" for now\n  method?: 'get' | 'post'; // | 'patch' | 'delete';\n  headers?: Record<string, string>;\n  // TODO: add cache interface\n  // cache?: any,\n  // TODO: cancel with signal\n  // signal?: Signal<boolean>;\n  fetchOptions?: any;\n}\n\n/** @public */\nexport type ServerFunction = {\n  (this: RequestEventBase, ...args: any[]): any;\n  options?: ServerConfig;\n};\n\n/**\n * You can pass an AbortSignal as the first argument of a `server$` function and it will use it to\n * abort the fetch when fired.\n *\n * @public\n */\nexport type ServerQRL<T extends ServerFunction> = QRL<\n  | ((abort: AbortSignal, ...args: Parameters<T>) => ReturnType<T>)\n  | ((...args: Parameters<T>) => ReturnType<T>)\n>;\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/use-endpoint.ts",
    "content": "import { getClientDataPath } from './utils';\nimport { CLIENT_DATA_CACHE } from './constants';\nimport type { ClientPageData, RouteActionValue } from './types';\nimport { _deserializeData } from '@builder.io/qwik';\nimport { preloadRouteBundles } from './client-navigate';\n\nexport const loadClientData = async (\n  url: URL,\n  element: unknown,\n  opts?: {\n    action?: RouteActionValue;\n    clearCache?: boolean;\n    preloadRouteBundles?: boolean;\n    isPrefetch?: boolean;\n  }\n) => {\n  const pagePathname = url.pathname;\n  const pageSearch = url.search;\n  const clientDataPath = getClientDataPath(pagePathname, pageSearch, opts?.action);\n  let qData: Promise<ClientPageData | undefined> | undefined;\n  if (!opts?.action) {\n    qData = CLIENT_DATA_CACHE.get(clientDataPath);\n  }\n\n  if (opts?.preloadRouteBundles !== false) {\n    preloadRouteBundles(pagePathname, 0.8);\n  }\n  let resolveFn: () => void | undefined;\n\n  if (!qData) {\n    const fetchOptions = getFetchOptions(opts?.action, opts?.clearCache);\n    if (opts?.action) {\n      opts.action.data = undefined;\n    }\n    qData = fetch(clientDataPath, fetchOptions).then((rsp) => {\n      if (rsp.redirected) {\n        const redirectedURL = new URL(rsp.url);\n        const isQData = redirectedURL.pathname.endsWith('/q-data.json');\n        if (!isQData || redirectedURL.origin !== location.origin) {\n          // Captive portal etc. We can't talk to the server, so redirect as asked, except when prefetching\n          if (!opts?.isPrefetch) {\n            location.href = redirectedURL.href;\n          }\n          return;\n        }\n      }\n      if ((rsp.headers.get('content-type') || '').includes('json')) {\n        // we are safe we are reading a q-data.json\n        return rsp.text().then((text) => {\n          const clientData = _deserializeData(text, element) as ClientPageData | null;\n          if (!clientData) {\n            // Something went wrong, show to the user\n            location.href = url.href;\n            return;\n          }\n          if (opts?.clearCache) {\n            CLIENT_DATA_CACHE.delete(clientDataPath);\n          }\n          if (clientData.redirect) {\n            // server function asked for redirect\n            location.href = clientData.redirect;\n          } else if (opts?.action) {\n            const { action } = opts;\n            const actionData = clientData.loaders[action.id];\n            resolveFn = () => {\n              action!.resolve!({ status: rsp.status, result: actionData });\n            };\n          }\n          return clientData;\n        });\n      } else {\n        if (opts?.isPrefetch !== true) {\n          location.href = url.href;\n        }\n        return undefined;\n      }\n    });\n\n    if (!opts?.action) {\n      CLIENT_DATA_CACHE.set(clientDataPath, qData);\n    }\n  }\n\n  return qData.then((v) => {\n    if (!v) {\n      CLIENT_DATA_CACHE.delete(clientDataPath);\n    }\n    resolveFn && resolveFn();\n    return v;\n  });\n};\n\nconst getFetchOptions = (\n  action: RouteActionValue | undefined,\n  noCache: boolean | undefined\n): RequestInit | undefined => {\n  const actionData = action?.data;\n  if (!actionData) {\n    if (noCache) {\n      return {\n        cache: 'no-cache',\n        headers: {\n          'Cache-Control': 'no-cache',\n          Pragma: 'no-cache',\n        },\n      };\n    }\n    return undefined;\n  }\n  if (actionData instanceof FormData) {\n    return {\n      method: 'POST',\n      body: actionData,\n    };\n  } else {\n    return {\n      method: 'POST',\n      body: JSON.stringify(actionData),\n      headers: {\n        'Content-Type': 'application/json; charset=UTF-8',\n      },\n    };\n  }\n};\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/use-functions.ts",
    "content": "import {\n  implicit$FirstArg,\n  noSerialize,\n  useContext,\n  useServerData,\n  useVisibleTask$,\n  type QRL,\n} from '@builder.io/qwik';\nimport {\n  ContentContext,\n  DocumentHeadContext,\n  RouteActionContext,\n  RouteLocationContext,\n  RouteNavigateContext,\n  RoutePreventNavigateContext,\n} from './contexts';\nimport type {\n  RouteLocation,\n  ResolvedDocumentHead,\n  RouteNavigate,\n  QwikCityEnvData,\n  RouteAction,\n  PreventNavigateCallback,\n} from './types';\n\n/** @public */\nexport const useContent = () => useContext(ContentContext);\n\n/**\n * Returns the document head for the current page. The generic type describes the front matter.\n *\n * @public\n */\nexport const useDocumentHead = <\n  FrontMatter extends Record<string, unknown> = Record<string, any>,\n>(): Required<ResolvedDocumentHead<FrontMatter>> => useContext<any>(DocumentHeadContext);\n\n/** @public */\nexport const useLocation = (): RouteLocation => useContext(RouteLocationContext);\n\n/** @public */\nexport const useNavigate = (): RouteNavigate => useContext(RouteNavigateContext);\n\n/** @internal Implementation of usePreventNavigate$ */\nexport const usePreventNavigateQrl = (fn: QRL<PreventNavigateCallback>): void => {\n  if (!__EXPERIMENTAL__.preventNavigate) {\n    throw new Error(\n      'usePreventNavigate$ is experimental and must be enabled with `experimental: [\"preventNavigate\"]` in the `qwikVite` plugin.'\n    );\n  }\n  const registerPreventNav = useContext(RoutePreventNavigateContext);\n  // Note: we have to use a visible task because:\n  // - the onbeforeunload event is synchronous, so we need to preload the callbacks\n  // - to unregister the callback, we need to run code on unmount, which means a visible task\n  // - it allows removing the onbeforeunload event listener when no callbacks are registered, which is better for older Firefox versions\n  // - preventing navigation implies user interaction, so we'll need to load the framework anyway\n  useVisibleTask$(() => registerPreventNav(fn));\n};\n/**\n * Prevent navigation attempts. This hook registers a callback that will be called before SPA or\n * browser navigation.\n *\n * Return `true` to prevent navigation.\n *\n * #### SPA Navigation\n *\n * For Single-Page-App (SPA) navigation (via `<Link />`, `const nav = useNavigate()`, and browser\n * backwards/forwards inside SPA history), the callback will be provided with the target, either a\n * URL or a number. It will only be a number if `nav(number)` was called to navigate forwards or\n * backwards in SPA history.\n *\n * If you return a Promise, the navigation will be blocked until the promise resolves.\n *\n * This can be used to show a nice dialog to the user, and wait for the user to confirm, or to\n * record the url, prevent the navigation, and navigate there later via `nav(url)`.\n *\n * #### Browser Navigation\n *\n * However, when the user navigates away by clicking on a regular `<a />`, reloading, or moving\n * backwards/forwards outside SPA history, this callback will not be awaited. This is because the\n * browser does not provide a way to asynchronously prevent these navigations.\n *\n * In this case, returning returning `true` will tell the browser to show a confirmation dialog,\n * which cannot be customized. You are also not able to show your own `window.confirm()` dialog\n * during the callback, the browser won't allow it. If you return a Promise, it will be considered\n * as `true`.\n *\n * When the callback is called from the browser, no url will be provided. Use this to know whether\n * you can show a dialog or just return `true` to prevent the navigation.\n *\n * @public\n */\nexport const usePreventNavigate$ = implicit$FirstArg(usePreventNavigateQrl);\n\nexport const useAction = (): RouteAction => useContext(RouteActionContext);\n\nexport const useQwikCityEnv = () => noSerialize(useServerData<QwikCityEnvData>('qwikcity'));\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/utils.ts",
    "content": "import type { RouteActionValue, SimpleURL } from './types';\n\nimport { QACTION_KEY } from './constants';\n\n/** Gets an absolute url path string (url.pathname + url.search + url.hash) */\nexport const toPath = (url: URL) => url.pathname + url.search + url.hash;\n\n/** Create a URL from a string and baseUrl */\nexport const toUrl = (url: string | URL, baseUrl: SimpleURL) => new URL(url, baseUrl.href);\n\n/** Checks only if the origins are the same. */\nexport const isSameOrigin = (a: SimpleURL, b: SimpleURL) => a.origin === b.origin;\n\nconst withSlash = (path: string) => (path.endsWith('/') ? path : path + '/');\n/** Checks only if the pathnames are the same for the URLs (doesn't include search and hash) */\nexport const isSamePathname = ({ pathname: a }: SimpleURL, { pathname: b }: SimpleURL) => {\n  const lDiff = Math.abs(a.length - b.length);\n  return lDiff === 0 ? a === b : lDiff === 1 && withSlash(a) === withSlash(b);\n};\n/** Checks only if the search query strings are the same for the URLs */\nexport const isSameSearchQuery = (a: SimpleURL, b: SimpleURL) => a.search === b.search;\n\n/** Checks only if the pathname + search are the same for the URLs. */\nexport const isSamePath = (a: SimpleURL, b: SimpleURL) =>\n  isSameSearchQuery(a, b) && isSamePathname(a, b);\n\n/** Same origin, but different pathname (doesn't include search and hash) */\nexport const isSameOriginDifferentPathname = (a: SimpleURL, b: SimpleURL) =>\n  isSameOrigin(a, b) && !isSamePath(a, b);\n\nexport const getClientDataPath = (\n  pathname: string,\n  pageSearch?: string,\n  action?: RouteActionValue\n) => {\n  let search = pageSearch ?? '';\n  if (action) {\n    search += (search ? '&' : '?') + QACTION_KEY + '=' + encodeURIComponent(action.id);\n  }\n  return pathname + (pathname.endsWith('/') ? '' : '/') + 'q-data.json' + search;\n};\n\nexport const getClientNavPath = (props: Record<string, any>, baseUrl: { url: URL }) => {\n  const href = props.href;\n  if (typeof href === 'string' && typeof props.target !== 'string' && !props.reload) {\n    try {\n      const linkUrl = toUrl(href.trim(), baseUrl.url);\n      const currentUrl = toUrl('', baseUrl.url)!;\n      if (isSameOrigin(linkUrl, currentUrl)) {\n        return toPath(linkUrl);\n      }\n    } catch (e) {\n      console.error(e);\n    }\n  } else if (props.reload) {\n    return toPath(toUrl('', baseUrl.url));\n  }\n  return null;\n};\n\nexport const shouldPreload = (clientNavPath: string | null, currentLoc: { url: URL }) => {\n  if (clientNavPath) {\n    const prefetchUrl = toUrl(clientNavPath, currentLoc.url);\n    const currentUrl = toUrl('', currentLoc.url);\n\n    return !isSamePathname(prefetchUrl, currentUrl);\n  }\n  return false;\n};\n\nexport const isPromise = (value: any): value is Promise<any> => {\n  // not using \"value instanceof Promise\" to have zone.js support\n  return value && typeof value.then === 'function';\n};\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/src/utils.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport {\n  getClientDataPath,\n  getClientNavPath,\n  shouldPreload,\n  isSameOrigin,\n  isSameOriginDifferentPathname,\n  isSamePath,\n  toPath,\n} from './utils';\n\n[\n  {\n    a: 'http://qwik.dev/',\n    b: 'http://qwik.dev/',\n    expect: false,\n  },\n  {\n    a: 'http://qwik.dev/',\n    b: 'http://b.io/',\n    expect: false,\n  },\n  {\n    a: 'http://qwik.dev/',\n    b: 'http://b.io/path-b',\n    expect: false,\n  },\n  {\n    a: 'http://qwik.dev/path-a',\n    b: 'http://qwik.dev/path-b',\n    expect: true,\n  },\n  {\n    a: 'http://qwik.dev/qs=a',\n    b: 'http://qwik.dev/qs=b',\n    expect: true,\n  },\n  {\n    a: 'http://qwik.dev/qs=a',\n    b: 'http://qwik.dev/qs=a',\n    expect: false,\n  },\n  {\n    a: 'http://qwik.dev/qs=a#hash1',\n    b: 'http://qwik.dev/qs=b#hash1',\n    expect: true,\n  },\n  {\n    a: 'http://qwik.dev/qs=a#hash1',\n    b: 'http://qwik.dev/qs=a#hash1',\n    expect: false,\n  },\n  {\n    a: 'http://qwik.dev/qs=a#hash1',\n    b: 'http://qwik.dev/qs=a#hash2',\n    expect: false,\n  },\n].forEach((t) => {\n  const a = new URL(t.a);\n  const b = new URL(t.b);\n  test(`isSameOriginDifferentPathname(${a},${b})`, () => {\n    assert.equal(isSameOriginDifferentPathname(a, b), t.expect);\n  });\n});\n\n[\n  { pathname: '/', expect: '/q-data.json' },\n  { pathname: '/about', expect: '/about/q-data.json' },\n  { pathname: '/about/', expect: '/about/q-data.json' },\n].forEach((t) => {\n  test(`getClientEndpointUrl(\"${t.pathname}\")`, () => {\n    const endpointPath = getClientDataPath(t.pathname);\n    assert.equal(endpointPath, t.expect);\n  });\n});\n\n[\n  { pathname: '/', search: '?foo=bar', expect: '/q-data.json?foo=bar' },\n  { pathname: '/about', search: '?foo=bar', expect: '/about/q-data.json?foo=bar' },\n  { pathname: '/about/', search: '?foo=bar', expect: '/about/q-data.json?foo=bar' },\n  { pathname: '/about/', search: '?foo=bar&baz=qux', expect: '/about/q-data.json?foo=bar&baz=qux' },\n].forEach((t) => {\n  test(`getClientEndpointUrl(\"${t.pathname}\", \"${t.search}\")`, () => {\n    const endpointPath = getClientDataPath(t.pathname, t.search);\n    assert.equal(endpointPath, t.expect);\n  });\n});\n\n[\n  {\n    url: 'http://qwik.dev/',\n    expect: '/',\n  },\n  {\n    url: 'http://qwik.dev/about',\n    expect: '/about',\n  },\n  {\n    url: 'http://qwik.dev/about?qs=1',\n    expect: '/about?qs=1',\n  },\n  {\n    url: 'http://qwik.dev/about#hash',\n    expect: '/about#hash',\n  },\n].forEach((t) => {\n  test(`toPath(\"${t.url}\")`, () => {\n    const url = new URL(t.url);\n    assert.equal(toPath(url), t.expect);\n  });\n});\n\n[\n  {\n    a: 'http://qwik.dev/',\n    b: 'http://qwik.dev/',\n    expect: true,\n  },\n  {\n    a: 'http://qwik.dev/',\n    b: 'http://qwik.dev/#hash',\n    expect: true,\n  },\n  {\n    a: 'http://qwik.dev/',\n    b: 'http://qwik.dev/about',\n    expect: false,\n  },\n  {\n    a: 'http://qwik.dev/',\n    b: 'http://qwik.dev/?qs',\n    expect: false,\n  },\n  {\n    a: 'http://qwik.dev/?qs',\n    b: 'http://qwik.dev/?qs',\n    expect: true,\n  },\n  {\n    a: 'http://qwik.dev/?qs#hash',\n    b: 'http://qwik.dev/?qs',\n    expect: true,\n  },\n].forEach((t) => {\n  test(`isSamePath(${t.a}, ${t.b})`, () => {\n    assert.equal(isSamePath(new URL(t.a), new URL(t.b)), t.expect);\n  });\n});\n\ntest(`isSameOrigin`, () => {\n  assert.equal(\n    isSameOrigin(new URL('http://qwik.dev/'), new URL('http://qwik.dev/about-us')),\n    true\n  );\n  assert.equal(\n    isSameOrigin(new URL('https://qwik.dev/'), new URL('http://qwik.dev/about-us')),\n    false\n  );\n  assert.equal(\n    isSameOrigin(new URL('https://builder.io/'), new URL('http://qwik.dev/about-us')),\n    false\n  );\n});\n\n[\n  { props: { href: '#hash' }, expect: '/#hash' },\n  { props: { href: '?qs=true' }, expect: '/?qs=true' },\n  { props: { href: '/abs-path' }, expect: '/abs-path' },\n  { props: { href: './rel-path' }, expect: '/rel-path' },\n  { props: { href: 'rel-path' }, expect: '/rel-path' },\n  { props: { href: '/path/../rel-path' }, expect: '/rel-path' },\n  { props: { href: '/abs-path', target: '_blank' }, expect: null },\n  { props: { href: 'http://qwik.dev/' }, expect: null },\n  { props: { href: 'http://builder.io/' }, expect: null },\n  { props: { href: '       ' }, expect: '/' },\n  { props: { href: '' }, expect: '/' },\n  { props: { href: null }, expect: null },\n  { props: {}, expect: null },\n  { props: { reload: true }, expect: '/' },\n].forEach((t) => {\n  test(`getClientNavPath ${t.props.href}`, () => {\n    const baseUrl = new URL('https://qwik.dev/');\n    assert.equal(\n      getClientNavPath(t.props, { url: baseUrl }),\n      t.expect,\n      `${t.props.href} ${t.expect}`\n    );\n  });\n});\n\n// ======================\ntest('missing clientNavPath', () => {\n  const clientNavPath = null;\n  const currentLoc = new URL('https://qwik.dev/contact');\n  assert.equal(shouldPreload(clientNavPath, { url: currentLoc }), false);\n});\n\ntest('path and current path the same, has different querystring and hash', () => {\n  const clientNavPath = '/about?qs#hash';\n  const currentLoc = new URL('https://qwik.dev/about');\n  assert.equal(shouldPreload(clientNavPath, { url: currentLoc }), false);\n});\n\ntest('path and current path the same, different trailing slash', () => {\n  const clientNavPath = '/about/';\n  const currentLoc = new URL('https://qwik.dev/about');\n  assert.equal(shouldPreload(clientNavPath, { url: currentLoc }), false);\n});\n\ntest('path and current path the same', () => {\n  const clientNavPath = '/about';\n  const currentLoc = new URL('https://qwik.dev/about');\n  assert.equal(shouldPreload(clientNavPath, { url: currentLoc }), false);\n});\n\ntest('valid prefetchUrl, has querystring and hash', () => {\n  const clientNavPath = '/about?qs#hash';\n  const currentLoc = new URL('https://qwik.dev/contact');\n  assert.equal(shouldPreload(clientNavPath, { url: currentLoc }), true);\n});\n\ntest('valid prefetchUrl, trailing slash', () => {\n  const clientNavPath = '/about/';\n  const currentLoc = new URL('https://qwik.dev/contact');\n  assert.equal(shouldPreload(clientNavPath, { url: currentLoc }), true);\n});\n\ntest('valid prefetchUrl', () => {\n  const clientNavPath = '/about';\n  const currentLoc = new URL('https://qwik.dev/contact');\n  assert.equal(shouldPreload(clientNavPath, { url: currentLoc }), true);\n});\n"
  },
  {
    "path": "packages/qwik-city/src/runtime/vite.config.mts",
    "content": "import { defineConfig } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\n\nexport default defineConfig(() => {\n  return {\n    build: {\n      target: 'es2020',\n      outDir: '../../lib',\n      lib: {\n        entry: './src/index.ts',\n        formats: ['es', 'cjs'] as const,\n        fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n      minify: false,\n      rollupOptions: {\n        external: [\n          'zod',\n          '@qwik-city-sw-register',\n          '@qwik-city-plan',\n          '@builder.io/qwik/preloader',\n        ],\n      },\n    },\n    plugins: [qwikVite()],\n    clearScreen: false,\n    optimizeDeps: {\n      force: true,\n    },\n  };\n});\n"
  },
  {
    "path": "packages/qwik-city/src/static/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/../../dist-dev/dts-out/packages/qwik-city/src/static/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik-city.static\",\n    \"reportFolder\": \"<projectFolder>/src/static/\",\n    \"reportTempFolder\": \"<projectFolder>/../../dist-dev/api-extractor/qwik-city/static\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/lib/static/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/../../dist-dev/api/qwik-city/static/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/extract-params.ts",
    "content": "/**\n * Extracts parameter names from the route name.\n *\n * Example: /base/[paramA]/[paramB].json -> ['paramA', 'paramB']\n */\nexport function extractParamNames(routeName: string): string[] {\n  const params: string[] = [];\n  let idx = 0;\n  while (idx < routeName.length) {\n    const start = routeName.indexOf('[', idx);\n    if (start !== -1) {\n      const end = routeName.indexOf(']', start);\n      const param = routeName.slice(start + 1, end);\n      params.push(param.startsWith('...') ? param.substring(3) : param);\n      idx = end + 1;\n    } else {\n      idx = routeName.length;\n    }\n  }\n  return params;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/extract-params.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { extractParamNames } from './extract-params';\n\ntest('should parse no params', () => {\n  assert.deepEqual(extractParamNames('/a/b/c'), []);\n});\n\ntest('should parse one param', () => {\n  assert.deepEqual(extractParamNames('/a/[b]/[c]'), ['b', 'c']);\n});\n\ntest('should parse param in mid urls', () => {\n  assert.deepEqual(extractParamNames('/a/pre[b]post/pre[c]/[d]post'), ['b', 'c', 'd']);\n});\n\ntest('should parse rest param', () => {\n  assert.deepEqual(extractParamNames('/a/[...b]'), ['b']);\n});\n"
  },
  {
    "path": "packages/qwik-city/src/static/index.ts",
    "content": "import type {\n  StaticGenerateRenderOptions,\n  StaticGenerateOptions,\n  StaticGenerateResult,\n} from './types';\n\n// @builder.io/qwik-city/static\n\n/**\n * Use this function when SSG should be generated from another module, such as a Vite plugin. This\n * function's should be passed the paths of the entry module and Qwik City Plan.\n *\n * @public\n */\nexport async function generate(opts: StaticGenerateOptions) {\n  const ssgPlatform = await getEntryModule();\n  const result: StaticGenerateResult = await ssgPlatform.generate(opts);\n  return result;\n}\n\nexport type { StaticGenerateOptions, StaticGenerateRenderOptions, StaticGenerateResult };\n\nfunction getEntryModulePath() {\n  if (isNode() || isBun() || isDeno()) {\n    if (isCjs()) {\n      return './node.cjs';\n    }\n    return './node.mjs';\n  }\n  throw new Error(`Unsupported platform`);\n}\n\nfunction getEntryModule() {\n  const entryModule = getEntryModulePath();\n  if (isCjs()) {\n    return require(entryModule);\n  }\n  return import(entryModule);\n}\n\nfunction isDeno() {\n  return typeof Deno !== 'undefined';\n}\n\nfunction isBun() {\n  return typeof Bun !== 'undefined';\n}\n\nfunction isNode() {\n  return !isBun() && !isDeno() && typeof process !== 'undefined' && !!process.versions?.node;\n}\n\nfunction isCjs() {\n  const req = 'require';\n  return isNode() && typeof globalThis[req] === 'function';\n}\n\ndeclare const Deno: any;\ndeclare const Bun: any;\n"
  },
  {
    "path": "packages/qwik-city/src/static/main-thread.ts",
    "content": "import type { PageModule, QwikCityPlan, RouteData, PathParams } from '@builder.io/qwik-city';\nimport type { StaticGenerateOptions, StaticGenerateResult, StaticRoute, System } from './types';\nimport { createRouteTester } from './routes';\nimport { generateNotFoundPages } from './not-found';\nimport { getPathnameForDynamicRoute } from '../utils/pathname';\nimport { msToString } from '../utils/format';\nimport { pathToFileURL } from 'node:url';\nimport { relative } from 'node:path';\nimport { bold, green, dim, red, magenta } from 'kleur/colors';\nimport { formatError } from '../buildtime/vite/format-error';\nimport { buildErrorMessage } from 'vite';\nimport { extractParamNames } from './extract-params';\n\nexport async function mainThread(sys: System) {\n  const opts = sys.getOptions();\n  validateOptions(opts);\n\n  const main = await sys.createMainProcess!();\n  const log = await sys.createLogger();\n  log.info('\\n' + bold(green('Starting Qwik City SSG...')));\n\n  const qwikCityPlan: QwikCityPlan = (await import(pathToFileURL(opts.qwikCityPlanModulePath).href))\n    .default;\n\n  const queue: StaticRoute[] = [];\n  const active = new Set<string>();\n  const routes = qwikCityPlan.routes || [];\n  const trailingSlash = !!qwikCityPlan.trailingSlash;\n  const includeRoute = createRouteTester(opts.basePathname || '/', opts.include, opts.exclude);\n\n  return new Promise<StaticGenerateResult>((resolve, reject) => {\n    try {\n      const timer = sys.createTimer();\n      const generatorResult: StaticGenerateResult = {\n        duration: 0,\n        rendered: 0,\n        errors: 0,\n        staticPaths: [],\n      };\n\n      let isCompleted = false;\n      let isRoutesLoaded = false;\n\n      const completed = async () => {\n        const closePromise = main.close();\n\n        await generateNotFoundPages(sys, opts, routes);\n\n        generatorResult.duration = timer();\n\n        if (generatorResult.errors === 0) {\n          log.info(`\\n${green('SSG results')}`);\n          if (generatorResult.rendered > 0) {\n            log.info(\n              `- Generated: ${dim(\n                `${generatorResult.rendered} page${generatorResult.rendered === 1 ? '' : 's'}`\n              )}`\n            );\n          }\n\n          log.info(`- Duration: ${dim(msToString(generatorResult.duration))}`);\n\n          const total = generatorResult.rendered + generatorResult.errors;\n          if (total > 0) {\n            log.info(\n              `- Average: ${dim(msToString(generatorResult.duration / total) + ' per page')}`\n            );\n          }\n          log.info(``);\n        }\n\n        closePromise\n          .then(() => {\n            setTimeout(() => resolve(generatorResult));\n          })\n          .catch(reject);\n      };\n\n      const next = () => {\n        while (!isCompleted && main.hasAvailableWorker() && queue.length > 0) {\n          const staticRoute = queue.shift();\n          if (staticRoute) {\n            render(staticRoute);\n          }\n        }\n\n        if (!isCompleted && isRoutesLoaded && queue.length === 0 && active.size === 0) {\n          isCompleted = true;\n          completed();\n        }\n      };\n\n      let isPendingDrain = false;\n      const flushQueue = () => {\n        if (!isPendingDrain) {\n          isPendingDrain = true;\n          setTimeout(() => {\n            isPendingDrain = false;\n            next();\n          });\n        }\n      };\n\n      const render = async (staticRoute: StaticRoute) => {\n        try {\n          active.add(staticRoute.pathname);\n\n          const result = await main.render({ type: 'render', ...staticRoute });\n\n          active.delete(staticRoute.pathname);\n\n          if (result.error) {\n            const err = new Error(result.error.message);\n            err.stack = result.error.stack;\n            log.error(`\\n${bold(red(`!!! ${result.pathname}: Error during SSG`))}`);\n            log.error(red(err.message));\n            log.error(`  Pathname: ${magenta(staticRoute.pathname)}`);\n            Object.assign(formatError(err), {\n              plugin: 'qwik-ssg',\n            });\n            log.error(buildErrorMessage(err));\n\n            generatorResult.errors++;\n          }\n\n          if (result.filePath != null) {\n            generatorResult.rendered++;\n            generatorResult.staticPaths.push(result.pathname);\n            const base = opts.rootDir ?? opts.outDir;\n            const path = relative(base, result.filePath);\n            const lastSlash = path.lastIndexOf('/');\n            log.info(`${dim(path.slice(0, lastSlash + 1))}${path.slice(lastSlash + 1)}`);\n          }\n\n          flushQueue();\n        } catch (e) {\n          isCompleted = true;\n          reject(e);\n        }\n      };\n\n      const addToQueue = (pathname: string | undefined | null, params: PathParams | undefined) => {\n        if (pathname) {\n          pathname = new URL(pathname, `https://qwik.dev`).pathname;\n\n          if (pathname !== opts.basePathname) {\n            if (trailingSlash) {\n              if (!pathname.endsWith('/')) {\n                const segments = pathname.split('/');\n                const lastSegment = segments[segments.length - 1];\n\n                if (!lastSegment.includes('.')) {\n                  pathname += '/';\n                }\n              }\n            } else {\n              if (pathname.endsWith('/')) {\n                pathname = pathname.slice(0, pathname.length - 1);\n              }\n            }\n          }\n\n          if (includeRoute(pathname) && !queue.some((s) => s.pathname === pathname)) {\n            queue.push({\n              pathname,\n              params,\n            });\n            flushQueue();\n          }\n        }\n      };\n\n      const loadStaticRoute = async (route: RouteData) => {\n        const [routeName, loaders, originalPathname] = route;\n        const modules = await Promise.all(loaders.map((loader) => loader()));\n        const pageModule: PageModule = modules[modules.length - 1] as any;\n        const paramNames = extractParamNames(routeName);\n\n        // if a module has a \"default\" export, it's a page module\n        // if a module has a \"onGet\" or \"onRequest\" export, it's an endpoint module for static generation\n        const isValidStaticModule =\n          pageModule && (pageModule.default || pageModule.onRequest || pageModule.onGet);\n\n        if (isValidStaticModule) {\n          if (Array.isArray(paramNames) && paramNames.length > 0) {\n            if (typeof pageModule.onStaticGenerate === 'function' && paramNames.length > 0) {\n              // dynamic route page module\n              const staticGenerate = await pageModule.onStaticGenerate({\n                env: {\n                  get(key: string) {\n                    return sys.getEnv(key);\n                  },\n                },\n              });\n              if (Array.isArray(staticGenerate.params)) {\n                for (const params of staticGenerate.params) {\n                  const pathname = getPathnameForDynamicRoute(\n                    originalPathname!,\n                    paramNames,\n                    params\n                  );\n                  addToQueue(pathname, params);\n                }\n              }\n            }\n          } else {\n            // static route page module\n            addToQueue(originalPathname, undefined);\n          }\n        }\n      };\n\n      const loadStaticRoutes = async () => {\n        await Promise.all(routes.map(loadStaticRoute));\n        isRoutesLoaded = true;\n        flushQueue();\n      };\n\n      loadStaticRoutes().catch((e) => {\n        console.error('SSG route loading failed', e);\n        reject(e);\n      });\n    } catch (e) {\n      reject(e);\n    }\n  });\n}\n\nfunction validateOptions(opts: StaticGenerateOptions) {\n  if (!opts.qwikCityPlanModulePath) {\n    throw new Error(`Missing \"qwikCityPlanModulePath\" option`);\n  }\n  if (!opts.renderModulePath) {\n    throw new Error(`Missing \"renderModulePath\" option`);\n  }\n\n  let siteOrigin = opts.origin;\n  if (typeof siteOrigin !== 'string' || siteOrigin.trim().length === 0) {\n    throw new Error(`Missing \"origin\" option`);\n  }\n  siteOrigin = siteOrigin.trim();\n  if (!/:\\/\\//.test(siteOrigin) || siteOrigin.startsWith('://')) {\n    throw new Error(\n      `\"origin\" must start with a valid protocol, such as \"https://\" or \"http://\", received \"${siteOrigin}\"`\n    );\n  }\n  try {\n    new URL(siteOrigin);\n  } catch (e) {\n    throw new Error(`Invalid \"origin\": ${e}`);\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/node/index.ts",
    "content": "import type { StaticGenerateOptions } from '../types';\nimport { createSystem } from './node-system';\nimport { isMainThread, workerData } from 'node:worker_threads';\nimport { mainThread } from '../main-thread';\nimport { workerThread } from '../worker-thread';\n\nexport async function generate(opts: StaticGenerateOptions) {\n  if (isMainThread) {\n    const sys = await createSystem(opts);\n    const result = await mainThread(sys);\n    return result;\n  }\n\n  throw new Error(`generate() cannot be called from a worker thread`);\n}\n\nif (!isMainThread && workerData) {\n  (async () => {\n    // self initializing worker thread with workerData\n    const sys = await createSystem(workerData);\n    await workerThread(sys);\n  })();\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/node/node-main.ts",
    "content": "import type {\n  MainContext,\n  StaticGenerateOptions,\n  StaticRoute,\n  StaticWorkerRenderResult,\n  WorkerOutputMessage,\n  WorkerInputMessage,\n  System,\n} from '../types';\nimport fs from 'node:fs';\nimport { cpus as nodeCpus } from 'node:os';\nimport { Worker } from 'node:worker_threads';\nimport { isAbsolute, resolve } from 'node:path';\nimport { ensureDir } from './node-system';\nimport { normalizePath } from '../../utils/fs';\n\nexport async function createNodeMainProcess(sys: System, opts: StaticGenerateOptions) {\n  const ssgWorkers: StaticGeneratorWorker[] = [];\n  const sitemapBuffer: string[] = [];\n  let sitemapStream: fs.WriteStream | null = null;\n\n  opts = { ...opts };\n\n  let outDir = opts.outDir;\n  if (typeof outDir !== 'string') {\n    throw new Error(`Missing \"outDir\" option`);\n  }\n  if (!isAbsolute(outDir)) {\n    throw new Error(`\"outDir\" must be an absolute file path, received: ${outDir}`);\n  }\n  outDir = normalizePath(outDir);\n\n  let maxWorkers = nodeCpus().length;\n  if (typeof opts.maxWorkers === 'number') {\n    maxWorkers = Math.max(1, Math.min(opts.maxWorkers, maxWorkers));\n  }\n\n  let maxTasksPerWorker = 20;\n  if (typeof opts.maxTasksPerWorker === 'number') {\n    maxTasksPerWorker = Math.max(1, Math.min(opts.maxTasksPerWorker, 50));\n  }\n\n  let sitemapOutFile = opts.sitemapOutFile;\n  if (sitemapOutFile !== null) {\n    if (typeof sitemapOutFile !== 'string') {\n      sitemapOutFile = 'sitemap.xml';\n    }\n    if (!isAbsolute(sitemapOutFile)) {\n      sitemapOutFile = resolve(outDir, sitemapOutFile);\n    }\n  }\n  const createWorker = () => {\n    let terminateResolve: (() => void) | null = null;\n    const mainTasks = new Map<string, WorkerMainTask>();\n\n    let workerFilePath: string | URL;\n    let terminateTimeout: number | null = null;\n\n    // Launch the worker using the package's index module, which bootstraps the worker thread.\n    if (typeof __filename === 'string') {\n      workerFilePath = __filename;\n    } else {\n      workerFilePath = import.meta.url;\n    }\n\n    if (typeof workerFilePath === 'string' && workerFilePath.startsWith('file://')) {\n      workerFilePath = new URL(workerFilePath);\n    }\n\n    const nodeWorker = new Worker(workerFilePath, { workerData: opts });\n    nodeWorker.unref();\n\n    const ssgWorker: StaticGeneratorWorker = {\n      activeTasks: 0,\n      totalTasks: 0,\n\n      render: (staticRoute) => {\n        return new Promise((resolve, reject) => {\n          try {\n            ssgWorker.activeTasks++;\n            ssgWorker.totalTasks++;\n            mainTasks.set(staticRoute.pathname, resolve);\n            nodeWorker.postMessage(staticRoute);\n          } catch (e) {\n            ssgWorker.activeTasks--;\n            mainTasks.delete(staticRoute.pathname);\n            reject(e);\n          }\n        });\n      },\n\n      terminate: async () => {\n        mainTasks.clear();\n        const msg: WorkerInputMessage = { type: 'close' };\n        await new Promise<void>((resolve) => {\n          terminateResolve = resolve;\n          nodeWorker.postMessage(msg);\n        });\n        terminateTimeout = setTimeout(async () => {\n          await nodeWorker.terminate();\n        }, 1000) as unknown as number;\n      },\n    };\n\n    nodeWorker.on('message', (msg: WorkerOutputMessage) => {\n      switch (msg.type) {\n        case 'render': {\n          const mainTask = mainTasks.get(msg.pathname);\n          if (mainTask) {\n            mainTasks.delete(msg.pathname);\n            ssgWorker.activeTasks--;\n            mainTask(msg);\n          }\n          break;\n        }\n        case 'close': {\n          if (terminateResolve) {\n            terminateResolve();\n            terminateResolve = null;\n          }\n          break;\n        }\n      }\n    });\n\n    nodeWorker.on('error', (e) => {\n      console.error(`worker error`, e);\n    });\n\n    nodeWorker.on('exit', (code) => {\n      if (terminateTimeout) {\n        clearTimeout(terminateTimeout);\n        terminateTimeout = null;\n      }\n      if (code !== 0) {\n        console.error(`worker exit ${code}`);\n      }\n    });\n\n    return ssgWorker;\n  };\n\n  const getNextWorker = () => ssgWorkers.sort(ssgWorkerCompare)[0];\n\n  const hasAvailableWorker = () => {\n    const ssgWorker = getNextWorker();\n    return ssgWorker.activeTasks < maxTasksPerWorker;\n  };\n\n  const render = async (staticRoute: StaticRoute) => {\n    const ssgWorker = getNextWorker();\n\n    const result = await ssgWorker.render(staticRoute);\n\n    if (sitemapOutFile && result.ok && result.resourceType === 'page') {\n      sitemapBuffer.push(`<url><loc>${result.url}</loc></url>`);\n      if (sitemapBuffer.length > 50) {\n        const siteMapUrls = sitemapBuffer.join('\\n') + '\\n';\n        sitemapBuffer.length = 0;\n        if (sitemapStream) {\n          sitemapStream.write(siteMapUrls);\n        }\n      }\n    }\n\n    return result;\n  };\n\n  const close = async () => {\n    const promises: Promise<unknown>[] = [];\n\n    if (sitemapStream) {\n      sitemapBuffer.push(`</urlset>`);\n      sitemapStream.write(sitemapBuffer.join('\\n'));\n      sitemapBuffer.length = 0;\n\n      await new Promise<void>((resolve, reject) => {\n        if (sitemapStream) {\n          sitemapStream.end((err?: Error | null) => {\n            if (err) {\n              reject(err);\n            } else {\n              resolve();\n            }\n          });\n        } else {\n          resolve();\n        }\n      });\n\n      sitemapStream = null;\n    }\n\n    for (const ssgWorker of ssgWorkers) {\n      try {\n        promises.push(ssgWorker.terminate());\n      } catch (e) {\n        console.error(e);\n      }\n    }\n\n    await Promise.all(promises);\n    ssgWorkers.length = 0;\n\n    // On Windows, give extra time for all workers to fully exit\n    // This prevents resource conflicts in back-to-back builds\n    if (process.platform === 'win32') {\n      await new Promise((resolve) => setTimeout(resolve, 300));\n    }\n  };\n\n  if (sitemapOutFile) {\n    await ensureDir(sitemapOutFile);\n    sitemapStream = fs.createWriteStream(sitemapOutFile, {\n      flags: 'w',\n    });\n\n    sitemapStream.write(\n      `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\\n`\n    );\n  }\n\n  for (let i = 0; i < maxWorkers; i++) {\n    ssgWorkers.push(createWorker());\n    // On Windows, add delay between worker creation to avoid resource contention\n    if (process.platform === 'win32' && i < maxWorkers - 1) {\n      await new Promise((resolve) => setTimeout(resolve, 100));\n    }\n  }\n\n  const mainCtx: MainContext = {\n    hasAvailableWorker,\n    render,\n    close,\n  };\n\n  return mainCtx;\n}\n\nfunction ssgWorkerCompare(a: StaticGeneratorWorker, b: StaticGeneratorWorker) {\n  if (a.activeTasks < b.activeTasks) {\n    return -1;\n  }\n  if (a.activeTasks > b.activeTasks) {\n    return 1;\n  }\n  return a.totalTasks < b.totalTasks ? -1 : 1;\n}\n\ntype WorkerMainTask = (result: StaticWorkerRenderResult) => void;\n\ninterface StaticGeneratorWorker {\n  activeTasks: number;\n  totalTasks: number;\n  render: (staticRoute: StaticRoute) => Promise<StaticWorkerRenderResult>;\n  terminate: () => Promise<void>;\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/node/node-system.ts",
    "content": "/* eslint-disable no-console */\nimport type { StaticGenerateOptions, System } from '../types';\nimport fs from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { patchGlobalThis } from '../../middleware/node/node-fetch';\nimport { createNodeMainProcess } from './node-main';\nimport { createNodeWorkerProcess } from './node-worker';\nimport { normalizePath } from '../../utils/fs';\n\n/** @public */\nexport async function createSystem(opts: StaticGenerateOptions) {\n  patchGlobalThis();\n\n  const createWriteStream = (filePath: string) => {\n    return fs.createWriteStream(filePath, {\n      flags: 'w',\n    });\n  };\n\n  const NS_PER_SEC = 1e9;\n  const MS_PER_NS = 1e-6;\n\n  const createTimer = () => {\n    const start = process.hrtime();\n    return () => {\n      const diff = process.hrtime(start);\n      return (diff[0] * NS_PER_SEC + diff[1]) * MS_PER_NS;\n    };\n  };\n\n  const createLogger = async () => {\n    return {\n      debug: opts.log === 'debug' ? console.debug.bind(console) : () => {},\n      error: console.error.bind(console),\n      info: console.info.bind(console),\n    };\n  };\n\n  const outDir = normalizePath(opts.outDir);\n\n  const basePathname = opts.basePathname || '/';\n  const basenameLen = basePathname.length;\n\n  const getRouteFilePath = (pathname: string, isHtml: boolean) => {\n    pathname = decodeURIComponent(pathname.slice(basenameLen));\n    if (isHtml) {\n      if (!pathname.endsWith('.html')) {\n        if (pathname.endsWith('/')) {\n          pathname += 'index.html';\n        } else {\n          pathname += '/index.html';\n        }\n      }\n    } else {\n      if (pathname.endsWith('/')) {\n        pathname = pathname.slice(0, -1);\n      }\n    }\n    return join(outDir, pathname);\n  };\n\n  const getDataFilePath = (pathname: string) => {\n    pathname = decodeURIComponent(pathname.slice(basenameLen));\n    if (pathname.endsWith('/')) {\n      pathname += 'q-data.json';\n    } else {\n      pathname += '/q-data.json';\n    }\n    return join(outDir, pathname);\n  };\n\n  const sys: System = {\n    createMainProcess: null,\n    createWorkerProcess: createNodeWorkerProcess,\n    createLogger,\n    getOptions: () => opts,\n    ensureDir,\n    createWriteStream,\n    createTimer,\n    access,\n    getRouteFilePath,\n    getDataFilePath,\n    getEnv: (key) => process.env[key],\n    platform: {\n      static: true,\n      node: process.versions.node,\n    },\n  };\n  sys.createMainProcess = () => createNodeMainProcess(sys, opts);\n\n  return sys;\n}\n\nexport const ensureDir = async (filePath: string) => {\n  await fs.promises.mkdir(dirname(filePath), { recursive: true });\n};\n\nexport const access = async (path: string) => {\n  try {\n    await fs.promises.access(path);\n    return true;\n  } catch {\n    return false;\n  }\n};\n"
  },
  {
    "path": "packages/qwik-city/src/static/node/node-worker.ts",
    "content": "import { parentPort } from 'node:worker_threads';\nimport type { WorkerInputMessage, WorkerOutputMessage } from '../types';\n\nexport async function createNodeWorkerProcess(\n  onMessage: (msg: WorkerInputMessage) => Promise<WorkerOutputMessage>\n) {\n  parentPort?.on('message', async (msg: WorkerInputMessage) => {\n    parentPort?.postMessage(await onMessage(msg));\n    if (msg.type === 'close') {\n      parentPort?.close();\n    }\n  });\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/not-found.ts",
    "content": "import { getErrorHtml } from '@builder.io/qwik-city/middleware/request-handler';\nimport type { RouteData } from '@builder.io/qwik-city';\nimport type { StaticGenerateOptions, System } from './types';\n\nexport async function generateNotFoundPages(\n  sys: System,\n  opts: StaticGenerateOptions,\n  routes: RouteData[]\n) {\n  if (opts.emit404Pages !== false) {\n    const basePathname = opts.basePathname || '/';\n    const rootNotFoundPathname = basePathname + '404.html';\n\n    const hasRootNotFound = routes.some((r) => r[2] === rootNotFoundPathname);\n    if (!hasRootNotFound) {\n      const filePath = sys.getRouteFilePath(rootNotFoundPathname, true);\n\n      const html = getErrorHtml(404, 'Resource Not Found');\n\n      await sys.ensureDir(filePath);\n\n      return new Promise<void>((resolve) => {\n        const writer = sys.createWriteStream(filePath);\n        writer.write(html);\n        writer.end(resolve);\n      });\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/qwik-city.static.api.md",
    "content": "## API Report File for \"@builder.io/qwik-city\"\n\n> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).\n\n```ts\n/// <reference types=\"node\" />\n\nimport type { RenderOptions } from '@builder.io/qwik/server';\n\n// @public\nexport function generate(opts: StaticGenerateOptions): Promise<StaticGenerateResult>;\n\n// @public (undocumented)\nexport interface StaticGenerateOptions extends StaticGenerateRenderOptions {\n  basePathname?: string;\n  qwikCityPlanModulePath: string;\n  renderModulePath: string;\n  // (undocumented)\n  rootDir?: string;\n}\n\n// @public (undocumented)\nexport interface StaticGenerateRenderOptions extends RenderOptions {\n  emit404Pages?: boolean;\n  emitData?: boolean;\n  emitHtml?: boolean;\n  exclude?: string[];\n  include?: string[];\n  log?: 'debug';\n  maxTasksPerWorker?: number;\n  maxWorkers?: number;\n  origin: string;\n  outDir: string;\n  sitemapOutFile?: string | null;\n}\n\n// @public (undocumented)\nexport interface StaticGenerateResult {\n  // (undocumented)\n  duration: number;\n  // (undocumented)\n  errors: number;\n  // (undocumented)\n  rendered: number;\n  // (undocumented)\n  staticPaths: string[];\n}\n\n// (No @packageDocumentation comment for this package)\n```\n"
  },
  {
    "path": "packages/qwik-city/src/static/routes.ts",
    "content": "export function createRouteTester(\n  basePathname: string,\n  includeRoutes: string[] | undefined,\n  excludeRoutes: string[] | undefined\n) {\n  const includes = routesToRegExps(includeRoutes);\n  const excludes = routesToRegExps(excludeRoutes);\n\n  return (pathname: string) => {\n    if (pathname.endsWith('404.html')) {\n      // always static render 404.html routes\n      return true;\n    }\n\n    if (basePathname !== '/') {\n      // the \"include\" and \"exclude\" routes are relative to the file system\n      // routes directory, and should not involve the URL base pathname\n      pathname = pathname.slice(basePathname.length - 1);\n    }\n\n    for (const exclude of excludes) {\n      if (exclude.test(pathname)) {\n        return false;\n      }\n    }\n    for (const include of includes) {\n      if (include.test(pathname)) {\n        return true;\n      }\n    }\n    return false;\n  };\n}\n\nfunction routesToRegExps(routes: string[] | undefined) {\n  if (!Array.isArray(routes)) {\n    return [];\n  }\n  return routes.filter((r) => typeof r === 'string').map(routeToRegExp);\n}\n\nfunction routeToRegExp(rule: string) {\n  let transformedRule: string;\n\n  if (rule === '/' || rule === '/*') {\n    transformedRule = rule;\n  } else if (rule.endsWith('/*')) {\n    // make `/*` an optional group so we can match both /foo/* and /foo\n    // /foo/* => /foo(/*)?\n    transformedRule = `${rule.substring(0, rule.length - 2)}(/*)?`;\n  } else if (rule.endsWith('/')) {\n    // make `/` an optional group so we can match both /foo/ and /foo\n    // /foo/ => /foo(/)?\n    transformedRule = `${rule.substring(0, rule.length - 1)}(/)?`;\n  } else if (rule.endsWith('*')) {\n    transformedRule = rule;\n  } else {\n    transformedRule = `${rule}(/)?`;\n  }\n\n  // /foo* => /foo.* => ^/foo.*$\n  transformedRule = `^${transformedRule.replace(/\\*/g, '.*')}$`;\n\n  // ^/foo.*$ => /^\\/foo.*$/\n  return new RegExp(transformedRule);\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/types.ts",
    "content": "import type { StreamWriter } from '@builder.io/qwik';\nimport type { RenderOptions } from '@builder.io/qwik/server';\nimport type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler';\n\nexport interface System {\n  createMainProcess: (() => Promise<MainContext>) | null;\n  createWorkerProcess: (\n    onMessage: (msg: WorkerInputMessage) => Promise<WorkerOutputMessage>\n  ) => void;\n  createLogger: () => Promise<Logger>;\n  getOptions: () => StaticGenerateOptions;\n  ensureDir: (filePath: string) => Promise<void>;\n  access: (path: string) => Promise<boolean>;\n  createWriteStream: (filePath: string) => StaticStreamWriter;\n  createTimer: () => () => number;\n  getRouteFilePath: (pathname: string, isHtml: boolean) => string;\n  getDataFilePath: (pathname: string) => string;\n  getEnv: (key: string) => string | undefined;\n  platform: { [key: string]: any };\n}\n\nexport interface StaticStreamWriter extends StreamWriter {\n  write: (chunk: string | Buffer) => void;\n  end(callback?: () => void): void;\n  on(event: 'error', callback: (err: Error) => void): void;\n}\n\nexport interface MainContext {\n  hasAvailableWorker: () => boolean;\n  render: (staticRoute: StaticRenderInput) => Promise<StaticWorkerRenderResult>;\n  close: () => Promise<void>;\n}\n\nexport interface Logger {\n  info: (...msgs: any[]) => void;\n  error: (...msgs: any[]) => void;\n  debug: (...msgs: any[]) => void;\n}\n\n/** @public */\nexport interface StaticGenerateRenderOptions extends RenderOptions {\n  /** File system directory where the static files should be written. */\n  outDir: string;\n  /**\n   * The URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For\n   * example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the\n   * `origin` does not include a `pathname`.\n   *\n   * The `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate\n   * a complete URL rather than just the `pathname`. For example, in order to render a correct\n   * canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.\n   *\n   * If the site also starts with a pathname other than `/`, please use the `basePathname` option in\n   * the Qwik City config options.\n   */\n  origin: string;\n  /**\n   * Maximum number of workers to use while generating the static pages. Defaults to the number of\n   * CPUs available.\n   */\n  maxWorkers?: number;\n  /** Maximum number of tasks to be running at one time per worker. Defaults to `20`. */\n  maxTasksPerWorker?: number;\n  /**\n   * File system path to write the `sitemap.xml` to. Defaults to `sitemap.xml` and written to the\n   * root of the `outDir`. Setting to `null` will prevent the sitemap from being created.\n   */\n  sitemapOutFile?: string | null;\n  /** Log level. */\n  log?: 'debug';\n  /**\n   * Set to `false` if the generated static HTML files should not be written to disk. Setting to\n   * `false` is useful if the SSG should only write the `q-data.json` files to disk. Defaults to\n   * `true`.\n   */\n  emitHtml?: boolean;\n  /**\n   * Set to `false` if the generated `q-data.json` data files should not be written to disk.\n   * Defaults to `true`.\n   */\n  emitData?: boolean;\n  /**\n   * Set to `false` if the static build should not write custom or default `404.html` pages.\n   * Defaults to `true`.\n   */\n  emit404Pages?: boolean;\n  /**\n   * Defines file system routes relative to the source `routes` directory that should be static\n   * generated. Accepts wildcard behavior. This should not include the \"base\" pathname. If not\n   * provided, all routes will be static generated. `exclude` always takes priority over `include`.\n   */\n  include?: string[];\n  /**\n   * Defines file system routes relative to the source `routes` directory that should not be static\n   * generated. Accepts wildcard behavior. This should not include the \"base\" pathname. `exclude`\n   * always takes priority over `include`.\n   */\n  exclude?: string[];\n}\n\n/** @public */\nexport interface StaticGenerateOptions extends StaticGenerateRenderOptions {\n  /**\n   * Path to the SSR module exporting the default render function. In most cases it'll be\n   * `./src/entry.ssr.tsx`.\n   */\n  renderModulePath: string;\n  /** Path to the Qwik City Plan module exporting the default `@qwik-city-plan`. */\n  qwikCityPlanModulePath: string;\n  /** Defaults to `/` */\n  basePathname?: string;\n\n  rootDir?: string;\n}\n\nexport interface StaticGenerateHandlerOptions\n  extends StaticGenerateRenderOptions,\n    ServerRenderOptions {}\n\nexport type WorkerInputMessage = StaticRenderInput | WorkerCloseMessage;\n\nexport type WorkerOutputMessage = StaticWorkerRenderResult | WorkerCloseMessage;\n\nexport interface StaticRenderInput extends StaticRoute {\n  type: 'render';\n}\n\nexport interface StaticRoute {\n  pathname: string;\n  params: Record<string, string> | undefined;\n}\n\nexport interface WorkerCloseMessage {\n  type: 'close';\n}\n\nexport interface StaticWorkerRenderResult {\n  type: 'render';\n  pathname: string;\n  url: string;\n  ok: boolean;\n  error: { message: string; stack: string | undefined } | null;\n  filePath: string | null;\n  contentType: string | null;\n  resourceType: 'page' | '404' | null;\n}\n\n/** @public */\nexport interface StaticGenerateResult {\n  duration: number;\n  rendered: number;\n  errors: number;\n  staticPaths: string[];\n}\n"
  },
  {
    "path": "packages/qwik-city/src/static/worker-thread.ts",
    "content": "import type {\n  StaticGenerateHandlerOptions,\n  StaticRoute,\n  StaticStreamWriter,\n  StaticWorkerRenderResult,\n  System,\n} from './types';\nimport type { ClientPageData } from '../runtime/src/types';\nimport type { ServerRequestEvent } from '@builder.io/qwik-city/middleware/request-handler';\nimport { requestHandler } from '@builder.io/qwik-city/middleware/request-handler';\nimport { pathToFileURL } from 'node:url';\nimport { WritableStream } from 'node:stream/web';\nimport { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik';\n\nexport async function workerThread(sys: System) {\n  const ssgOpts = sys.getOptions();\n  const pendingPromises = new Set<Promise<any>>();\n\n  const opts: StaticGenerateHandlerOptions = {\n    ...ssgOpts,\n    render: (await import(pathToFileURL(ssgOpts.renderModulePath).href)).default,\n    qwikCityPlan: (await import(pathToFileURL(ssgOpts.qwikCityPlanModulePath).href)).default,\n  };\n\n  sys.createWorkerProcess(async (msg) => {\n    switch (msg.type) {\n      case 'render': {\n        return new Promise<StaticWorkerRenderResult>((resolve) => {\n          workerRender(sys, opts, msg, pendingPromises, resolve);\n        });\n      }\n      case 'close': {\n        const promises = Array.from(pendingPromises);\n        pendingPromises.clear();\n        await Promise.all(promises);\n        return { type: 'close' };\n      }\n    }\n  });\n}\n\nasync function workerRender(\n  sys: System,\n  opts: StaticGenerateHandlerOptions,\n  staticRoute: StaticRoute,\n  pendingPromises: Set<Promise<any>>,\n  callback: (result: StaticWorkerRenderResult) => void\n) {\n  const qwikSerializer = {\n    _deserializeData,\n    _serializeData,\n    _verifySerializable,\n  };\n  // pathname and origin already normalized at this point\n  const url = new URL(staticRoute.pathname, opts.origin);\n\n  const result: StaticWorkerRenderResult = {\n    type: 'render',\n    pathname: staticRoute.pathname,\n    url: url.href,\n    ok: false,\n    error: null,\n    filePath: null,\n    contentType: null,\n    resourceType: null,\n  };\n\n  try {\n    let routeWriter: StaticStreamWriter | null = null;\n    let closeResolved: (v?: any) => void;\n    const closePromise = new Promise((closePromiseResolve) => {\n      closeResolved = closePromiseResolve;\n    });\n\n    const request = new Request(url);\n\n    const requestCtx: ServerRequestEvent<void> = {\n      mode: 'static',\n      locale: undefined,\n      url,\n      request,\n      env: {\n        get(key) {\n          return sys.getEnv(key);\n        },\n      },\n      platform: sys.platform,\n      getClientConn: () => {\n        return {};\n      },\n      getWritableStream: (status, headers, _, _r, requestEv) => {\n        result.ok = status >= 200 && status < 300;\n\n        if (!result.ok) {\n          // not ok, don't write anything\n          return noopWritableStream as any;\n        }\n\n        result.contentType = (headers.get('Content-Type') || '').toLowerCase();\n        const isHtml = result.contentType.includes('text/html');\n        const is404ErrorPage = url.pathname.endsWith('/404.html');\n        const routeFilePath = sys.getRouteFilePath(url.pathname, isHtml);\n\n        if (is404ErrorPage) {\n          result.resourceType = '404';\n        } else if (isHtml) {\n          result.resourceType = 'page';\n        }\n\n        const hasRouteWriter = isHtml ? opts.emitHtml !== false : true;\n        const writeQDataEnabled = isHtml && opts.emitData !== false;\n\n        const stream = new WritableStream<Uint8Array>({\n          async start() {\n            try {\n              if (hasRouteWriter || writeQDataEnabled) {\n                // for html pages, endpoints or q-data.json\n                // ensure the containing directory is created\n                await sys.ensureDir(routeFilePath);\n              }\n\n              if (hasRouteWriter) {\n                // create a write stream for the static file if enabled\n                routeWriter = sys.createWriteStream(routeFilePath);\n                routeWriter.on('error', (e) => {\n                  console.error(e);\n                  routeWriter = null;\n                  result.error = {\n                    message: e.message,\n                    stack: e.stack,\n                  };\n                });\n              }\n            } catch (e: any) {\n              routeWriter = null;\n              result.error = {\n                message: String(e),\n                stack: e.stack || '',\n              };\n            }\n          },\n          write(chunk) {\n            try {\n              if (routeWriter) {\n                // write to the static file if enabled\n                routeWriter.write(Buffer.from(chunk.buffer));\n              }\n            } catch (e: any) {\n              routeWriter = null;\n              result.error = {\n                message: String(e),\n                stack: e.stack || '',\n              };\n            }\n          },\n          async close() {\n            const writePromises: Promise<any>[] = [];\n\n            try {\n              if (writeQDataEnabled) {\n                const qData: ClientPageData = requestEv.sharedMap.get('qData');\n                if (qData && !is404ErrorPage) {\n                  // write q-data.json file when enabled and qData is set\n                  const qDataFilePath = sys.getDataFilePath(url.pathname);\n                  const dataWriter = sys.createWriteStream(qDataFilePath);\n                  dataWriter.on('error', (e) => {\n                    console.error(e);\n                    result.error = {\n                      message: e.message,\n                      stack: e.stack,\n                    };\n                  });\n\n                  const serialized = await _serializeData(qData, true);\n                  dataWriter.write(serialized);\n\n                  writePromises.push(\n                    new Promise<void>((resolve) => {\n                      // set the static file path for the result\n                      result.filePath = routeFilePath;\n                      dataWriter.end(resolve);\n                    })\n                  );\n                }\n              }\n\n              if (routeWriter) {\n                // close the static file if there is one\n                writePromises.push(\n                  new Promise<void>((resolve) => {\n                    // set the static file path for the result\n                    result.filePath = routeFilePath;\n                    routeWriter!.end(resolve);\n                  }).finally(closeResolved)\n                );\n              }\n\n              if (writePromises.length > 0) {\n                await Promise.all(writePromises);\n              }\n            } catch (e: any) {\n              routeWriter = null;\n              result.error = {\n                message: String(e),\n                stack: e.stack || '',\n              };\n            }\n          },\n        });\n        return stream;\n      },\n    };\n\n    const promise = requestHandler(requestCtx, opts, qwikSerializer)\n      .then((rsp) => {\n        if (rsp != null) {\n          return rsp.completion.then((r) => {\n            if (routeWriter) {\n              return closePromise.then(() => r);\n            }\n            return r;\n          });\n        }\n      })\n      .then((e) => {\n        if (e !== undefined) {\n          if (e instanceof Error) {\n            result.error = {\n              message: e.message,\n              stack: e.stack,\n            };\n          } else {\n            result.error = {\n              message: String(e),\n              stack: undefined,\n            };\n          }\n        }\n      })\n      .finally(() => {\n        pendingPromises.delete(promise);\n        callback(result);\n      });\n\n    pendingPromises.add(promise);\n  } catch (e: any) {\n    if (e instanceof Error) {\n      result.error = {\n        message: e.message,\n        stack: e.stack,\n      };\n    } else {\n      result.error = {\n        message: String(e),\n        stack: undefined,\n      };\n    }\n    callback(result);\n  }\n}\n\nconst noopWriter: WritableStreamDefaultWriter<any> = {\n  closed: Promise.resolve(undefined),\n  ready: Promise.resolve(undefined),\n  desiredSize: 0,\n  async close() {},\n  async abort() {},\n  async write() {},\n  releaseLock() {},\n};\n\nconst noopWritableStream: WritableStream = {\n  get locked() {\n    return false;\n  },\n  set locked(_: boolean) {},\n  async abort() {},\n  async close() {},\n  getWriter() {\n    return noopWriter;\n  },\n};\n"
  },
  {
    "path": "packages/qwik-city/src/utils/format.ts",
    "content": "import type { BuildContext } from '../buildtime/types';\n\nexport function toTitleCase(str: string) {\n  return str.replace(/\\w\\S*/g, (txt) => {\n    return txt.charAt(0).toUpperCase() + txt.slice(1).toLowerCase();\n  });\n}\n\nexport function addError(ctx: BuildContext, e: any) {\n  ctx.diagnostics.push({\n    type: 'error',\n    message: e ? String(e.stack || e) : 'Error',\n  });\n}\n\nexport function addWarning(ctx: BuildContext, message: string) {\n  ctx.diagnostics.push({\n    type: 'warn',\n    message: String(message),\n  });\n}\n\nexport function msToString(ms: number) {\n  if (ms < 1) {\n    return ms.toFixed(2) + ' ms';\n  }\n  if (ms < 1000) {\n    return ms.toFixed(1) + ' ms';\n  }\n  if (ms < 60000) {\n    return (ms / 1000).toFixed(1) + ' s';\n  }\n  return (ms / 60000).toFixed(1) + ' m';\n}\n"
  },
  {
    "path": "packages/qwik-city/src/utils/format.unit.ts",
    "content": "import { assert, test } from 'vitest';\nimport { msToString } from './format';\n\n[\n  {\n    ms: 0.05,\n    expect: '0.05 ms',\n  },\n  {\n    ms: 10.5,\n    expect: '10.5 ms',\n  },\n  {\n    ms: 100,\n    expect: '100.0 ms',\n  },\n  {\n    ms: 2000,\n    expect: '2.0 s',\n  },\n  {\n    ms: 120000,\n    expect: '2.0 m',\n  },\n].forEach((t) => {\n  test(`msToString(${t.ms})`, () => {\n    assert.equal(msToString(t.ms), t.expect);\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/utils/fs.ts",
    "content": "import { basename, dirname, normalize, relative } from 'node:path';\nimport type { NormalizedPluginOptions } from '../buildtime/types';\nimport { toTitleCase } from './format';\nimport { normalizePathname } from './pathname';\n\nexport function parseRouteIndexName(extlessName: string) {\n  let layoutName = '';\n  const layoutStop = extlessName.endsWith('!');\n\n  if (layoutStop) {\n    extlessName = extlessName.slice(0, extlessName.length - 1);\n  }\n\n  const namedLayoutParts = extlessName.split('@');\n  if (namedLayoutParts.length > 1) {\n    namedLayoutParts.shift();\n    layoutName = namedLayoutParts.join('@');\n  }\n\n  return { layoutName, layoutStop };\n}\n\nexport function getPathnameFromDirPath(opts: NormalizedPluginOptions, dirPath: string) {\n  // get relative file system path from the dirname\n  // ignoring the already known \"index\" filename\n  const relFilePath = relative(opts.routesDir, dirPath);\n\n  // ensure file system path uses / (POSIX) instead of \\\\ (windows)\n  let pathname = normalizePath(relFilePath);\n\n  pathname = normalizePathname(pathname, opts.basePathname, opts.trailingSlash)!\n    .split('/')\n    // remove grouped layout segments\n    .filter((segment) => !isGroupedLayoutName(segment))\n    .join('/');\n  if (pathname === '') {\n    return '/';\n  }\n  return pathname;\n}\n\nexport function getMenuPathname(opts: NormalizedPluginOptions, filePath: string) {\n  let pathname = normalizePath(relative(opts.routesDir, filePath));\n  pathname = `/` + normalizePath(dirname(pathname));\n  return normalizePathname(pathname, opts.basePathname, true)!;\n}\n\nexport function getExtension(fileName: string) {\n  if (typeof fileName === 'string') {\n    const parts = fileName.trim().toLowerCase().split('.');\n    if (parts.length > 1) {\n      const ext = parts.pop()!.split('?')[0].split('#')[0];\n      if (ext === 'ts' && parts.pop() === 'd') {\n        return '.d.ts';\n      }\n      return '.' + ext;\n    }\n  }\n  return '';\n}\n\nexport function removeExtension(fileName: string) {\n  if (typeof fileName === 'string') {\n    fileName = fileName.trim();\n    const ext = getExtension(fileName);\n    return fileName.slice(0, fileName.length - ext.length);\n  }\n  return '';\n}\n\nexport function normalizePath(path: string) {\n  return normalizePathSlash(normalize(path));\n}\n\nexport function normalizePathSlash(path: string) {\n  // MIT https://github.com/sindresorhus/slash/blob/main/license\n  // Convert Windows backslash paths to slash paths: foo\\\\bar ➔ foo/bar\n  const isExtendedLengthPath = /^\\\\\\\\\\?\\\\/.test(path);\n  const hasNonAscii = /[^\\u0000-\\u0080]+/.test(path); // eslint-disable-line no-control-regex\n\n  if (isExtendedLengthPath || hasNonAscii) {\n    return path;\n  }\n\n  path = path.replace(/\\\\/g, '/');\n  if (path.endsWith('/')) {\n    path = path.slice(0, path.length - 1);\n  }\n  return path;\n}\n\n/**\n * Creates an id for the module, based on its path.\n *\n * @param routesDir\n * @param fsPath\n * @param explicitFileType Add to avoid collisions between different types of modules. `Menu` and\n *   `Layout` files are named based on their path (eg. /routes/about/menu.md => AboutMenu)\n */\nexport function createFileId(\n  routesDir: string,\n  fsPath: string,\n  explicitFileType?: 'Route' | 'Plugin' | 'ServiceWorker'\n) {\n  const ids: string[] = [];\n\n  for (let i = 0; i < 25; i++) {\n    let baseName = removeExtension(basename(fsPath));\n\n    baseName = baseName.replace(/[\\W_]+/g, '');\n    if (baseName === '') {\n      baseName = 'Q' + i;\n    } else if (!isNaN(baseName.charAt(0) as any)) {\n      baseName = 'Q' + baseName;\n    }\n    ids.push(toTitleCase(baseName));\n\n    fsPath = normalizePath(dirname(fsPath));\n\n    if (fsPath === routesDir) {\n      break;\n    }\n  }\n\n  if (ids.length > 1 && ids[0] === 'Index') {\n    ids.shift();\n  }\n\n  return ids\n    .reverse()\n    .join('')\n    .concat(explicitFileType || '');\n}\n\nconst PAGE_MODULE_EXTS: { [type: string]: boolean } = {\n  '.tsx': true,\n  '.jsx': true,\n};\n\nconst MODULE_EXTS: { [type: string]: boolean } = {\n  '.ts': true,\n  '.js': true,\n};\n\nconst MARKDOWN_EXTS: { [type: string]: boolean } = {\n  '.md': true,\n  '.mdx': true,\n};\n\nexport function isIndexModule(extlessName: string) {\n  return /^index(|!|@.+)$/.test(extlessName);\n}\n\nexport function isPluginModule(extlessName: string) {\n  return /^plugin(|@.+)$/.test(extlessName);\n}\n\nexport function isLayoutModule(extlessName: string) {\n  return /^layout(|!|-.+)$/.test(extlessName);\n}\n\nexport function isPageModuleExt(ext: string) {\n  return ext in PAGE_MODULE_EXTS;\n}\n\nexport function isModuleExt(ext: string) {\n  return ext in MODULE_EXTS;\n}\n\nexport function isMarkdownExt(ext: string) {\n  return ext in MARKDOWN_EXTS;\n}\n\nexport function isPageExt(ext: string) {\n  return ext in PAGE_MODULE_EXTS || ext in MARKDOWN_EXTS;\n}\n\nexport function isMenuFileName(fileName: string) {\n  return fileName === 'menu.md';\n}\n\nexport function isServiceWorkerName(extlessName: string) {\n  return extlessName === 'service-worker';\n}\n\nexport function isEntryName(extlessName: string) {\n  return extlessName === 'entry';\n}\n\nexport function isErrorName(extlessName: string) {\n  try {\n    const statusCode = parseInt(extlessName, 10);\n    return statusCode >= 400 && statusCode <= 599;\n  } catch (e) {\n    //\n  }\n  return false;\n}\n\nexport function isGroupedLayoutName(dirName: string, warn = true) {\n  if (dirName.startsWith('__')) {\n    if (warn) {\n      console.warn(\n        `Grouped (pathless) layout \"${dirName}\" should use the \"(${dirName.slice(\n          2\n        )})\" directory name instead. Prefixing a directory with \"__\" has been deprecated and will be removed in future versions.`\n      );\n    }\n    return true;\n  }\n  return dirName.startsWith('(') && dirName.endsWith(')');\n}\n"
  },
  {
    "path": "packages/qwik-city/src/utils/fs.unit.ts",
    "content": "import { tmpdir } from 'node:os';\nimport { basename, join } from 'node:path';\nimport { assert, test } from 'vitest';\nimport type { NormalizedPluginOptions } from '../buildtime/types';\nimport {\n  createFileId,\n  getExtension,\n  getMenuPathname,\n  getPathnameFromDirPath,\n  isGroupedLayoutName,\n  isMarkdownExt,\n  isMenuFileName,\n  isModuleExt,\n  isPageExt,\n  isPageModuleExt,\n  normalizePath,\n  parseRouteIndexName,\n  removeExtension,\n} from './fs';\n\nconst routesDir = normalizePath(join(tmpdir(), 'src', 'routes'));\nconst serverPluginsDir = normalizePath(join(tmpdir(), 'src', 'routes'));\n\ntest('isGroupedLayoutName', () => {\n  const t = [\n    { ext: '(abc)', expect: true },\n    { ext: '__abc', expect: true }, // deprecated\n    { ext: '(abc)xyz', expect: false },\n    { ext: 'xyz(abc)', expect: false },\n    { ext: '(abc', expect: false },\n    { ext: 'abc)', expect: false },\n    { ext: 'abc', expect: false },\n  ];\n  t.forEach((c) => {\n    assert.equal(isGroupedLayoutName(c.ext, false), c.expect, c.ext);\n  });\n});\n\ntest('isPageExt', () => {\n  const t = [\n    { ext: '.tsx', expect: true },\n    { ext: '.ts', expect: false },\n    { ext: '.jsx', expect: true },\n    { ext: '.js', expect: false },\n    { ext: '.md', expect: true },\n    { ext: '.mdx', expect: true },\n    { ext: '.css', expect: false },\n    { ext: '.scss', expect: false },\n    { ext: '.sass', expect: false },\n  ];\n  t.forEach((c) => {\n    assert.equal(isPageExt(c.ext), c.expect, c.ext);\n  });\n});\n\ntest('isModuleExt', () => {\n  const t = [\n    { ext: '.tsx', expect: false },\n    { ext: '.ts', expect: true },\n    { ext: '.jsx', expect: false },\n    { ext: '.js', expect: true },\n    { ext: '.md', expect: false },\n    { ext: '.mdx', expect: false },\n    { ext: '.css', expect: false },\n    { ext: '.scss', expect: false },\n    { ext: '.sass', expect: false },\n  ];\n  t.forEach((c) => {\n    assert.equal(isModuleExt(c.ext), c.expect, c.ext);\n  });\n});\n\ntest('isPageModuleExt', () => {\n  const t = [\n    { ext: '.tsx', expect: true },\n    { ext: '.ts', expect: false },\n    { ext: '.jsx', expect: true },\n    { ext: '.js', expect: false },\n    { ext: '.md', expect: false },\n    { ext: '.mdx', expect: false },\n    { ext: '.css', expect: false },\n    { ext: '.scss', expect: false },\n    { ext: '.sass', expect: false },\n  ];\n  t.forEach((c) => {\n    assert.equal(isPageModuleExt(c.ext), c.expect, c.ext);\n  });\n});\n\ntest('isMarkdownExt', () => {\n  const t = [\n    { ext: '.tsx', expect: false },\n    { ext: '.ts', expect: false },\n    { ext: '.jsx', expect: false },\n    { ext: '.js', expect: false },\n    { ext: '.md', expect: true },\n    { ext: '.mdx', expect: true },\n    { ext: '.css', expect: false },\n    { ext: '.scss', expect: false },\n    { ext: '.sass', expect: false },\n  ];\n  t.forEach((c) => {\n    assert.equal(isMarkdownExt(c.ext), c.expect, c.ext);\n  });\n});\n\ntest('isMenuFileName', () => {\n  const t = [\n    { name: 'menu.md', expect: true },\n    { name: 'menu.mdx', expect: false },\n    { name: 'menu.tsx', expect: false },\n    { name: 'menu.ts', expect: false },\n  ];\n  t.forEach((c) => {\n    assert.equal(isMenuFileName(c.name), c.expect, c.name);\n  });\n});\n\ntest('getExtension', () => {\n  const t = [\n    { name: 'file.md?qs', expect: '.md' },\n    { name: 'file.md#hash', expect: '.md' },\n    { name: 'file.md', expect: '.md' },\n    { name: 'file.dot.dot.PnG ', expect: '.png' },\n    { name: 'file.JSX', expect: '.jsx' },\n    { name: 'file.d.ts', expect: '.d.ts' },\n    { name: 'file.ts', expect: '.ts' },\n    { name: 'C:\\\\path\\\\to\\\\file.tsx', expect: '.tsx' },\n    { name: 'http://qwik.dev/index.mdx', expect: '.mdx' },\n    { name: '?qs', expect: '' },\n    { name: '#hash', expect: '' },\n    { name: 'file', expect: '' },\n    { name: '', expect: '' },\n    { name: null, expect: '' },\n    { name: undefined, expect: '' },\n  ];\n  t.forEach((c) => {\n    assert.equal(getExtension(c.name!), c.expect, c.name!);\n  });\n});\n\ntest('removeExtension', () => {\n  const t = [\n    { name: 'file.dot.dot.PnG ', expect: 'file.dot.dot' },\n    { name: 'file.JSX', expect: 'file' },\n    { name: 'file.d.ts', expect: 'file' },\n    { name: 'file.ts', expect: 'file' },\n    { name: 'C:\\\\path\\\\to\\\\file.tsx', expect: 'C:\\\\path\\\\to\\\\file' },\n    { name: 'http://qwik.dev/index.mdx', expect: 'http://qwik.dev/index' },\n    { name: 'file', expect: 'file' },\n    { name: '', expect: '' },\n    { name: null, expect: '' },\n    { name: undefined, expect: '' },\n  ];\n  t.forEach((c) => {\n    assert.equal(removeExtension(c.name!), c.expect, c.name!);\n  });\n});\n\ntest('createFileId, Page dir/index.tsx', () => {\n  const path = normalizePath(join(routesDir, 'docs', 'index.tsx'));\n  const p = createFileId(routesDir, path, 'Route');\n  assert.equal(p, 'DocsRoute');\n});\n\ntest('createFileId, Page about-us.tsx', () => {\n  const path = normalizePath(join(routesDir, 'about-us', 'index.tsx'));\n  const p = createFileId(routesDir, path, 'Route');\n  assert.equal(p, 'AboutusRoute');\n});\n\ntest('createFileId, Endpoint, api/[user]/index.ts', () => {\n  const path = normalizePath(join(routesDir, 'api', '[user]', 'index.ts'));\n  const p = createFileId(routesDir, path, 'Route');\n  assert.equal(p, 'ApiUserRoute');\n});\n\ntest('createFileId, Endpoint, data.json.ts', () => {\n  const path = normalizePath(join(routesDir, 'api', 'data.json', 'index.ts'));\n  const p = createFileId(routesDir, path, 'Route');\n  assert.equal(p, 'ApiDataRoute');\n});\n\ntest('createFileId, Layout', () => {\n  const path = normalizePath(join(routesDir, 'dashboard', 'settings', 'layout.tsx'));\n  const p = createFileId(routesDir, path);\n  assert.equal(p, 'DashboardSettingsLayout');\n});\n\ntest('createFileId, Menu', () => {\n  const path = normalizePath(join(routesDir, 'settings', 'menu.mdx'));\n  const p = createFileId(routesDir, path);\n  assert.equal(p, 'SettingsMenu');\n});\n\n[\n  {\n    dirPath: join(routesDir, '(a)', 'about', '(b)', 'info', '(c)'),\n    basePathname: '/',\n    trailingSlash: true,\n    expect: '/about/info/',\n  },\n  {\n    dirPath: join(routesDir, 'about'),\n    basePathname: '/app/',\n    trailingSlash: true,\n    expect: '/app/about/',\n  },\n  {\n    dirPath: join(routesDir, 'about'),\n    basePathname: '/app/',\n    trailingSlash: false,\n    expect: '/app/about',\n  },\n  {\n    dirPath: join(routesDir, 'about'),\n    basePathname: '/',\n    trailingSlash: true,\n    expect: '/about/',\n  },\n  {\n    dirPath: join(routesDir, 'about'),\n    basePathname: '/',\n    trailingSlash: false,\n    expect: '/about',\n  },\n  {\n    dirPath: routesDir,\n    basePathname: '/',\n    trailingSlash: false,\n    expect: '/',\n  },\n  {\n    dirPath: routesDir,\n    basePathname: '/',\n    trailingSlash: true,\n    expect: '/',\n  },\n  {\n    dirPath: routesDir,\n    basePathname: '/app/',\n    trailingSlash: false,\n    expect: '/app/',\n  },\n  {\n    dirPath: routesDir,\n    basePathname: '/app/',\n    trailingSlash: true,\n    expect: '/app/',\n  },\n].forEach((t) => {\n  test(`getPathnameFromDirPath, dirPath: ${basename(t.dirPath)}, basePathname: ${\n    t.basePathname\n  }`, () => {\n    const opts: NormalizedPluginOptions = {\n      routesDir,\n      serverPluginsDir,\n      basePathname: t.basePathname,\n      trailingSlash: t.trailingSlash,\n      mdxPlugins: {\n        remarkGfm: true,\n        rehypeSyntaxHighlight: true,\n        rehypeAutolinkHeadings: true,\n      },\n      mdx: {},\n      platform: {},\n      rewriteRoutes: [],\n    };\n    const pathname = getPathnameFromDirPath(opts, t.dirPath);\n    assert.equal(pathname, t.expect, t.dirPath);\n  });\n});\n\ntest('parseRouteIndexName', () => {\n  const t = [\n    {\n      extlessName: 'index@layout@name',\n      expect: { layoutName: 'layout@name', layoutStop: false },\n    },\n    {\n      extlessName: 'index@layoutname!',\n      expect: { layoutName: 'layoutname', layoutStop: true },\n    },\n    {\n      extlessName: 'index@layoutname',\n      expect: { layoutName: 'layoutname', layoutStop: false },\n    },\n    {\n      extlessName: 'index!',\n      expect: { layoutName: '', layoutStop: true },\n    },\n    {\n      extlessName: 'index',\n      expect: { layoutName: '', layoutStop: false },\n    },\n  ];\n\n  t.forEach((c) => {\n    const r = parseRouteIndexName(c.extlessName);\n    assert.equal(r.layoutName, c.expect.layoutName, `${c.extlessName} layoutName`);\n    assert.equal(r.layoutStop, c.expect.layoutStop, `${c.extlessName} layoutStop`);\n  });\n});\n\n[\n  {\n    filePath: join(routesDir, 'dir', 'menu.md'),\n    basePathname: '/basepath/',\n    trailingSlash: true,\n    expect: '/basepath/dir/',\n  },\n  {\n    filePath: join(routesDir, 'dir', 'menu.md'),\n    basePathname: '/basepath/',\n    trailingSlash: false,\n    expect: '/basepath/dir/',\n  },\n  {\n    filePath: join(routesDir, 'menu.md'),\n    basePathname: '/basepath/',\n    trailingSlash: true,\n    expect: '/basepath/',\n  },\n  {\n    filePath: join(routesDir, 'menu.md'),\n    basePathname: '/basepath/',\n    trailingSlash: false,\n    expect: '/basepath/',\n  },\n  {\n    filePath: join(routesDir, 'dir', 'menu.md'),\n    basePathname: '/',\n    trailingSlash: true,\n    expect: '/dir/',\n  },\n  {\n    filePath: join(routesDir, 'dir', 'menu.md'),\n    basePathname: '/',\n    trailingSlash: false,\n    expect: '/dir/',\n  },\n  {\n    filePath: join(routesDir, 'menu.md'),\n    basePathname: '/',\n    trailingSlash: true,\n    expect: '/',\n  },\n  {\n    filePath: join(routesDir, 'menu.md'),\n    basePathname: '/',\n    trailingSlash: false,\n    expect: '/',\n  },\n].forEach((t) => {\n  test(`menu-${t.basePathname}-${t.trailingSlash}`, () => {\n    const opts: NormalizedPluginOptions = {\n      routesDir,\n      serverPluginsDir,\n      basePathname: t.basePathname,\n      trailingSlash: t.trailingSlash,\n      mdxPlugins: {\n        remarkGfm: true,\n        rehypeSyntaxHighlight: true,\n        rehypeAutolinkHeadings: true,\n      },\n      mdx: {},\n      platform: {},\n      rewriteRoutes: [],\n    };\n    const pathname = getMenuPathname(opts, t.filePath);\n    assert.equal(pathname, t.expect);\n  });\n});\n"
  },
  {
    "path": "packages/qwik-city/src/utils/pathname.ts",
    "content": "import type { PathParams } from '../runtime/src';\n\nexport function normalizePathname(\n  pathname: string | undefined | null,\n  basePathname: string,\n  trailingSlash: boolean\n) {\n  if (typeof pathname === 'string') {\n    pathname = pathname.trim();\n\n    if (pathname !== '') {\n      try {\n        // remove duplicate forward slashes\n        pathname = pathname.replace(/\\/+/g, '/');\n\n        if (pathname.startsWith('/')) {\n          pathname = pathname.slice(1);\n        }\n\n        // normalize the basePath and pathname together\n        // origin doesn't matter here\n        pathname = new URL(basePathname + pathname, `https://qwik.dev`).pathname;\n\n        if (pathname !== basePathname) {\n          if (trailingSlash) {\n            if (!pathname.endsWith('/')) {\n              const segments = pathname.split('/');\n              const lastSegment = segments[segments.length - 1];\n\n              if (!lastSegment.includes('.')) {\n                pathname += '/';\n              }\n            }\n          } else {\n            if (pathname.endsWith('/')) {\n              pathname = pathname.slice(0, pathname.length - 1);\n            }\n          }\n        }\n\n        return pathname;\n      } catch (e) {\n        console.error(e);\n      }\n    }\n  }\n  return null;\n}\n\nexport function getPathnameForDynamicRoute(\n  originalPathname: string,\n  paramNames: string[] | undefined,\n  params: PathParams | undefined\n) {\n  let pathname = originalPathname;\n\n  if (paramNames && params) {\n    for (const paramName of paramNames) {\n      const paramKey = `[${paramName}]`;\n      const restParamKey = `[...${paramName}]`;\n      const paramValue = params[paramName];\n      pathname = pathname.replace(restParamKey, paramValue);\n      pathname = pathname.replace(paramKey, paramValue);\n    }\n  }\n\n  return pathname;\n}\n\nexport function isSameOriginUrl(url: string) {\n  if (typeof url === 'string') {\n    url = url.trim();\n    if (url !== '') {\n      const firstChar = url.charAt(0);\n      if (firstChar !== '/' && firstChar !== '.') {\n        if (firstChar === '#') {\n          return false;\n        }\n        const i = url.indexOf(':');\n        if (i > -1) {\n          const protocol = url.slice(0, i).toLowerCase();\n          return !PROTOCOLS[protocol];\n        }\n      }\n      return true;\n    }\n  }\n  return false;\n}\n\nconst PROTOCOLS: { [protocol: string]: boolean } = {\n  https: true,\n  http: true,\n  about: true,\n  javascript: true,\n  file: true,\n};\n"
  },
  {
    "path": "packages/qwik-city/src/utils/pathname.unit.ts",
    "content": "import type { PathParams } from '../runtime/src/types';\nimport { getPathnameForDynamicRoute, isSameOriginUrl, normalizePathname } from './pathname';\nimport { parseRoutePathname } from '../buildtime/routing/parse-pathname';\nimport { assert, test } from 'vitest';\n\ntest('isSameOriginUrl', () => {\n  const t = [\n    { url: '#hash', expect: false },\n    { url: '   #hash', expect: false },\n    { url: '', expect: false },\n    { url: '    ', expect: false },\n    { url: 'javascript://nice', expect: false },\n    { url: 'file://local', expect: false },\n    { url: 'about://blank', expect: false },\n    { url: 'HTTPS://qwik.dev', expect: false },\n    { url: 'http://qwik.dev', expect: false },\n    { url: 'relative:whatever', expect: true },\n    { url: 'relative', expect: true },\n    { url: './relative', expect: true },\n    { url: '/absolute', expect: true },\n    { url: undefined, expect: false },\n    { url: null, expect: false },\n  ];\n  t.forEach((c) => {\n    assert.equal(isSameOriginUrl(c.url!), c.expect, c.url!);\n  });\n});\n\ntest('normalizePathname', () => {\n  const tests = [\n    {\n      pathname: '/name/',\n      basePathname: '/',\n      trailingSlash: true,\n      expect: '/name/',\n    },\n    {\n      pathname: '/name',\n      basePathname: '/',\n      trailingSlash: true,\n      expect: '/name/',\n    },\n    {\n      pathname: '/name/',\n      basePathname: '/',\n      trailingSlash: false,\n      expect: '/name',\n    },\n    {\n      pathname: '/name',\n      basePathname: '/',\n      trailingSlash: false,\n      expect: '/name',\n    },\n    {\n      pathname: 'plz no spaces',\n      basePathname: '/',\n      trailingSlash: false,\n      expect: '/plz%20no%20spaces',\n    },\n    {\n      pathname: './about',\n      basePathname: '/',\n      trailingSlash: false,\n      expect: '/about',\n    },\n    {\n      pathname: '/about.html',\n      basePathname: '/site/',\n      trailingSlash: true,\n      expect: '/site/about.html',\n    },\n    {\n      pathname: '/about.html',\n      basePathname: '/site/',\n      trailingSlash: false,\n      expect: '/site/about.html',\n    },\n    {\n      pathname: '/about',\n      basePathname: '/site/',\n      trailingSlash: true,\n      expect: '/site/about/',\n    },\n    {\n      pathname: '/about/',\n      basePathname: '/site/',\n      trailingSlash: false,\n      expect: '/site/about',\n    },\n    {\n      pathname: '/',\n      basePathname: '/site/',\n      trailingSlash: true,\n      expect: '/site/',\n    },\n    {\n      pathname: '/',\n      basePathname: '/site/',\n      trailingSlash: false,\n      expect: '/site/',\n    },\n    {\n      pathname: '/',\n      basePathname: '/',\n      trailingSlash: true,\n      expect: '/',\n    },\n    {\n      pathname: '/',\n      basePathname: '/',\n      trailingSlash: false,\n      expect: '/',\n    },\n  ];\n\n  tests.forEach((t) => {\n    const pathname = normalizePathname(t.pathname, t.basePathname, t.trailingSlash);\n    assert.equal(pathname, t.expect);\n  });\n});\n\ntest('dynamic, rest pathname in segment', () => {\n  const p = getPathname({\n    originalPathname: '/blog/start-[...slugId]-end',\n    basePathname: '/',\n    params: {\n      slugId: 'what-is-resumability',\n    },\n  });\n  assert.equal(p, '/blog/start-what-is-resumability-end');\n});\n\ntest('dynamic rest pathname', () => {\n  const p = getPathname({\n    originalPathname: '/blog/[...slugId]',\n    basePathname: '/',\n    params: {\n      slugId: 'what-is-resumability',\n    },\n  });\n  assert.equal(p, '/blog/what-is-resumability');\n});\n\ntest('dynamic, empty rest pathname in root', () => {\n  const p = getPathname({\n    originalPathname: '/[...id]',\n    basePathname: '/',\n    params: {\n      id: '',\n    },\n  });\n  assert.equal(p, '/');\n});\n\ntest('dynamic, empty rest pathname in root with nested page', () => {\n  const p = getPathname({\n    originalPathname: '/[...id]/page',\n    basePathname: '/',\n    params: {\n      id: '',\n    },\n  });\n  assert.equal(p, '/page');\n});\n\ntest('dynamic pathname', () => {\n  const p = getPathname({\n    originalPathname: '/docs/[category]/[slugId]',\n    basePathname: '/',\n    params: {\n      category: 'introduction',\n      slugId: 'basics',\n    },\n  });\n  assert.equal(p, '/docs/introduction/basics');\n});\n\ntest('dynamic pathname with special characters', () => {\n  const p = getPathname({\n    originalPathname: '/docs/[category]/[slugId]',\n    basePathname: '/',\n    params: {\n      category: 'my category',\n      slugId: 'héllo wörld',\n    },\n  });\n  assert.equal(p, '/docs/my%20category/h%C3%A9llo%20w%C3%B6rld');\n});\n\nfunction getPathname(t: { originalPathname: string; basePathname: string; params?: PathParams }) {\n  const p = parseRoutePathname(t.basePathname, t.originalPathname);\n  const d = getPathnameForDynamicRoute(t.originalPathname, p.paramNames, t.params);\n  return normalizePathname(d, '/', false);\n}\n"
  },
  {
    "path": "packages/qwik-city/src/utils/test-suite.ts",
    "content": "/* eslint-disable no-empty-pattern */\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { assert, beforeAll, test, type TestAPI } from 'vitest';\nimport { build } from '../buildtime/build';\nimport { createBuildContext } from '../buildtime/context';\nimport type {\n  BuildContext,\n  BuildLayout,\n  BuildRoute,\n  MarkdownAttributes,\n  PluginOptions,\n} from '../buildtime/types';\nimport { normalizePath } from './fs';\n\nexport { assert };\n\nconst __dirname = fileURLToPath(new URL('.', import.meta.url));\n\nexport function suite(title: string = 'qwik-city') {\n  const rootDir = tmpdir();\n  const basePath = '/';\n\n  return test.extend<TestContext>({\n    ctx: async ({}, use) => {\n      const ctx = createBuildContext(rootDir, basePath, {\n        routesDir: join(rootDir, 'src', 'routes'),\n      });\n      await use(ctx);\n      ctx.diagnostics.forEach((d) => console.error(d.message));\n    },\n    filePath: ({ ctx }, use) => use(join(ctx.opts.routesDir, 'welcome.mdx')),\n    attrs: ({}, use) => use({ title: '', description: '' }),\n  });\n}\n\nexport function testAppSuite(\n  title: string,\n  userOpts?: PluginOptions\n): TestAPI<TestAppBuildContext> {\n  let buildCtx: BuildContext;\n\n  beforeAll(async (testCtx) => {\n    const testAppRootDir = join(\n      __dirname,\n      '..',\n      '..',\n      '..',\n      '..',\n      'starters',\n      'apps',\n      'qwikcity-test'\n    );\n    const basePath = '/';\n    const ctx = createBuildContext(testAppRootDir, basePath, userOpts);\n\n    assert.equal(normalizePath(testAppRootDir), ctx.rootDir);\n    assert.equal(normalizePath(join(testAppRootDir, 'src', 'routes')), ctx.opts.routesDir);\n\n    await build(ctx);\n\n    assert.deepEqual(ctx.diagnostics, []);\n\n    buildCtx = ctx;\n    Object.assign(testCtx, ctx);\n  });\n\n  const assertRoute = (p: string) => {\n    const r = buildCtx.routes.find((r) => r.pathname === p);\n    if (!r) {\n      // eslint-disable-next-line no-console\n      console.log(buildCtx.routes);\n      assert.ok(r, `did not find page route \"${p}\"`);\n    }\n    return r as any;\n  };\n  const assertLayout = (id: string) => {\n    const l = buildCtx.layouts.find((r) => r.id === id);\n    if (!l) {\n      // eslint-disable-next-line no-console\n      console.log(buildCtx.layouts);\n      assert.ok(l, `did not find layout \"${id}\"`);\n    }\n    return l as any;\n  };\n\n  const myTest = test.extend<TestAppBuildContext>({\n    ctx: async ({}, use) => use(buildCtx),\n    filePath: ({ ctx }, use) => use(join(ctx.opts.routesDir, 'welcome.mdx')),\n    attrs: ({}, use) => use({ title: '', description: '' }),\n\n    assertRoute: ({}, use) => use(assertRoute),\n    assertLayout: ({}, use) => use(assertLayout),\n  });\n\n  return myTest;\n}\n\nexport interface TestAppBuildContext extends TestContext {\n  assertRoute: (pathname: string) => BuildRoute;\n  assertLayout: (id: string) => BuildLayout;\n}\n\nexport interface TestContext {\n  ctx: BuildContext;\n  filePath: string;\n  attrs: MarkdownAttributes;\n}\n"
  },
  {
    "path": "packages/qwik-city/static.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './lib/static';\n"
  },
  {
    "path": "packages/qwik-city/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"paths\": {\n      \"@builder.io/qwik-city\": [\"packages/qwik-city/src/runtime/src/index.ts\"],\n      \"@builder.io/qwik-city/service-worker\": [\n        \"packages/qwik-city/src/runtime/src/service-worker/index.ts\"\n      ],\n      \"@builder.io/qwik-city/adapters/azure-swa/vite\": [\n        \"packages/qwik-city/src/adapters/azure-swa/vite/index.ts\"\n      ],\n      \"@builder.io/qwik-city/adapters/cloudflare-pages/vite\": [\n        \"packages/qwik-city/src/adapters/cloudflare-pages/vite/index.ts\"\n      ],\n      \"@builder.io/qwik-city/adapters/node-server/vite\": [\n        \"packages/qwik-city/src/adapters/node-server/vite/index.ts\"\n      ],\n      \"@builder.io/qwik-city/adapters/netlify-edge/vite\": [\n        \"packages/qwik-city/src/adapters/netlify-edge/vite/index.ts\"\n      ],\n      \"@builder.io/qwik-city/adapters/shared/vite\": [\n        \"packages/qwik-city/src/adapters/shared/vite/index.ts\"\n      ],\n      \"@builder.io/qwik-city/adapters/static/vite\": [\n        \"packages/qwik-city/src/adapters/static/vite/index.ts\"\n      ],\n      \"@builder.io/qwik-city/middleware/azure-swa\": [\"packages/qwik-city/src/middleware/azure-swa\"],\n      \"@builder.io/qwik-city/middleware/aws-lambda\": [\n        \"packages/qwik-city/src/middleware/aws-lambda\"\n      ],\n      \"@builder.io/qwik-city/middleware/cloudflare-pages\": [\n        \"packages/qwik-city/src/middleware/cloudflare-pages\"\n      ],\n      \"@builder.io/qwik-city/middleware/request-handler\": [\n        \"packages/qwik-city/src/middleware/request-handler\"\n      ],\n      \"@builder.io/qwik-city/middleware/node\": [\"packages/qwik-city/src/middleware/node\"],\n      \"@builder.io/qwik-city/middleware/netlify-edge\": [\n        \"packages/qwik-city/src/middleware/netlify-edge\"\n      ],\n      \"@builder.io/qwik-city/static\": [\"packages/qwik-city/src/static\"],\n      \"@builder.io/qwik-city/vite\": [\"packages/qwik-city/src/buildtime/vite\"],\n\n      \"@qwik-city-plan\": [\"packages/qwik-city/src/runtime/src/qwik-city-plan.ts\"],\n      \"@qwik-city-sw-register-build\": [\n        \"packages/qwik-city/src/buildtime/runtime-generation/sw-register-build.ts\"\n      ],\n      \"@qwik-city-sw-register\": [\"packages/qwik-city/src/runtime/src/sw-register-runtime.ts\"],\n      \"@qwik-city-not-found-paths\": [\n        \"packages/qwik-city/src/middleware/request-handler/generated/not-found-paths.ts\"\n      ],\n      \"@qwik-city-static-paths\": [\n        \"packages/qwik-city/src/middleware/request-handler/generated/static-paths.ts\"\n      ]\n    }\n  },\n  \"include\": [\".\"]\n}\n"
  },
  {
    "path": "packages/qwik-city/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './lib/vite';\n"
  },
  {
    "path": "packages/qwik-dom/CHANGELOG.md",
    "content": "# domino x.x.x (not yet released)\n\n# domino 2.1.6 (16 Jul 2020)\n\n- Bumped version of lodash (#169)\n- Performance improvement to DOMTokenList (#166)\n- `mocha` dependency has been updated to 6.x. As a result, we are\n  no longer testing on node 4.\n\n# domino 2.1.5 (30 Apr 2020)\n\n- Bumped version of jquery dev dependency (#163)\n- Omit tests/ directory from NPM package (#161)\n\n# domino 2.1.4 (16 Dec 2019)\n\n- Bug fix for `Element#closest` when selector doesn't match (#154)\n\n# domino 2.1.3 (6 Mar 2019)\n\n- Bug fix for CSS `$=` selector and for matches on root `<html>` element.\n- Renamed CSS `:matches` to `:is`\n  ( https://github.com/w3c/csswg-drafts/issues/3258 )\n- Bug fix for CSS matches with escape characters in tag name.\n\n# domino 2.1.2 (14 Feb 2019)\n\n- Allow writable Element constructors unless **domino_frozen** is set to true (#138)\n- Bug fix for CSS `$=` selector. (#135)\n- Move `Node#_serializeOne()` to `NodeUtils.serializeOne()` to reduce pressure\n  on the megamorphic stub cache in V8, and thereby improve throughput (#142).\n- Implemented `HTMLOptionElement#text` and `HTMLOptionElement#value` (#136)\n\n# domino 2.1.1 (30 Nov 2018)\n\n- Add `domino.createIncrementalHTMLParser` interface.\n\n# domino 2.1.0 (13 Aug 2018)\n\n- Fix `ContainerNode#removeChildren()` when there is more than one child (#129)\n- Implement `Document#scrollingElement` (#107)\n- Implement setter for `Element#outerHTML` (#102)\n- Handle null/undefined in setter for `Node#textContent`\n- Handle null/undefined/negative values in `CharacterData` interface methods\n- Spec-correctness fixes for `DOMTokenList`, including handling of duplicate\n  keys.\n- Fix `[src=...]` selectors in `Document#querySelector()` and similar\n- Spec-correctness fixes for `Document#createElement()` and\n  `Document#createElementNS()`, including proper exception type and type\n  coercion.\n- Implement `Attr#cloneNode()`, `Element#getAttributeNode()`,\n  `Element#getAttributeNodeNS()`, `Element#setAttributeNode()`,\n  `Element#setAttributeNodeNS()`, and `Element#removeAttributeNode()`\n  (DOM3 compatibility)\n- Implement `Document#createAttribute()` and `Document#createAttributeNS()`\n- Implement `Element#hasAttributes()`, `Element#toggleAttribute()`, and\n  `Element#getAttributeNames()`\n- Implement `Text#wholeText`\n- Implement `Document#cloneNode()` and `DocumentType#cloneNode()`\n- Spec-correctness fixes for `Node#lookupPrefix()`,\n  `Node#lookupNamespaceURI()`, and `Node#isDefaultNamespace`, including\n  proper type coercion and reconciling DOM 3 and DOM 4 specifications.\n- Ensure `Document#title` continues to use correct whitespace stripping\n  for node > 4, and properly set `<title>` when `undefined` is passed to\n  `DOMImplementation#createHTMLDocument()`\n- Ensure `Element#attributes` implements `NamedNodeMap` and that indexed\n  properties of `Element#attributes` work (previously you needed to use\n  the `item()` accessor method)\n- Improve stubs for `HTMLElement#style`, `Document#documentURI`, and\n  `Document#contentType`\n- Implement proper accessors for `HTMLSelectElement#autocomplete`,\n  `HTMLTextAreaElement#type/value/defaultValue/textLength`, and\n  `HTMLInputElement#width/height/minLength`\n- Implement `Element#insertAdjacentElement()`, `Element#insertAdjacentText()`,\n  and `Element#insertAdjacentHTML()` (#102)\n- Spec-correctness fixes for `TreeWalker` and `NodeIterator`: read-only\n  properties, proper exception types, type coercion of `NodeFilter` results.\n- Implement `NodeIterator` pre-removal steps. Note that in the absence\n  of weak references, be cautious about the number of `NodeIterator`s you\n  create on any single document, since domino does not artificially limit\n  these.\n  See https://github.com/tc39/proposal-weakrefs/issues/17 for details.\n- Preserve prefix of SVG elements during parsing. (#102)\n\n# domino 2.0.3 (12 Jul 2018)\n\n- Define `blur()`, `focus()` and `forceSpellCheck()` on `HTMLElement` (#125)\n- Stringify argument tokens for DOMTokenList methods (#126)\n- Fix `HTMLAnchorElement#hash` when `href` attribute contains bare\n  fragment (#127)\n- Implement case-insensitive CSS attribute matching (#128)\n- Implement `DOMTokenList#replace()`, `DOMTokenList#toggle(token, force)`,\n  and `DOMTokenList#value`. Fix handling of non-space whitespace. (#111)\n\n# domino 2.0.2 (28 Mar 2018)\n\n- Add TypeScript definitions (#103)\n- Add `flex` CSS styles (#119, #120)\n- Fix Element#matches with ~= selectors (#121)\n\n# domino 2.0.1 (14 Feb 2018)\n\n- Allow attributes named 'xmlns' (#112)\n- Make DOMTokenList add/remove variadic (#109)\n- Make `Array.from` and for-of loops work on `Node#attributes`.\n\n# domino 2.0.0 ( 8 Nov 2017)\n\n- Fix potential O(N^2) slowdown in FilteredElementList#item.\n- `mocha` dependency has been updated to 4.0.x. As a result, we are\n  no longer testing on node pre-v4.0.0; see:\n  https://boneskull.com/mocha-v4-nears-release/\n- Domino now uses a linked list representation for children of Node,\n  unless/until the Node#childNodes accessor is used (which requires\n  an indexed array to be built). Inserting a removing nodes can be\n  much quicker using the linked list representation if care is\n  taken not to deoptimize the tree by using the #childNodes accessor.\n  This implementation strategy matches the one used by webkit and\n  other browser-based implementations, and thus ought to match\n  performance expectations of folks used to writing browser-based\n  DOM manipulation code.\n\n# domino 1.0.30 (24 Oct 2017)\n\n- Fix regexp capitalization in URLUtils (#101)\n- Fix O(N^2) slowdown in initial tree traversal using nextSibling/prevSibling\n- Update `mocha` dependency to 3.5.x and `should` to 13.1.x.\n\n# domino 1.0.29 ( 7 Aug 2017)\n\n- Fix \"#id\" optimization in querySelectorAll() when 0 or 2 matches for\n  `id`. (#99)\n- Correct return value of CSSStyleDeclaration#getPropertyValue() when\n  style is not set. (#98)\n\n# domino 1.0.28 (27 Jan 2017)\n\n- Fix unescape mechanism in attribute values. (#95)\n- Disable nonstandard \"ignore case\" version of attribute matching.\n- Add `dom/nodes` tests from w3c/web-platform-tests. (#92, @pimterry)\n- Make selected API methods writable to support polyfills. (#89, @pimterry)\n- Fix `Element#hasAttribute`/`Element#hasAttributeNS` after\n  `Element#removeAttribute`/`Element#removeAttributeNS`. (#90, @clint-tseng)\n- Fix deep `Document#importNode`. (#93)\n- Ensure that `Node#parentNode` is `null` (not `undefined`) when removed.\n- Add an optional second argument to `domino.createWindow` to specify\n  the document's address.\n- Tweak JavaScript properties which are DOM reflections of element\n  attributes in order to more closely match the DOM 4 spec.\n- Implement `ChildNode#before()`, `ChildNode#after()`, and\n  `ChildNode#replaceWith()`.\n\n# domino 1.0.27 (17 Oct 2016)\n\n- Fix bug in AFE list replacement over existing bookmark.\n- Update htmlwg test suite to latest w3c/web-platform-tests.\n- Update html5lib test suite to latest.\n- HTML5 spec update: <menuitem> is no longer an empty element.\n- HTML5 spec update: tweaked HTML entity parsing in attributes.\n- HTML5 spec update: dashes are allowed in HTML comments.\n- HTML5 spec update: remove special handling of <isindex>.\n- Improve handling of legacy elements: `<xmp>`, `<listing>`, `acronym`,\n  `basefont`, `big`, `center`, `nobr`, `noembed`, `noframes`, `plaintext`,\n  `rb`, `rtc`, `strike`, and `tt`.\n- HTML5 spec update: Remove extra newline in serialization of `<pre>`,\n  `<listing>`, `<textarea>`. (#88)\n- HTML5 spec update: Remove case normalization for defunct SVG attributes.\n- Implement HTMLMenuItemElement#label.\n- Basic SVG support. (#81, #82)\n\n# domino 1.0.26 (15 Oct 2016)\n\n- Implement Document#dir.\n- Minor spec-compliance fixes to Document#title and classList#contains.\n- Implement Element#closest(). (#84)\n- Actually run the HTMLWG tests (#83)\n- Expose the HTML5 tree builder implementation. (#87)\n- Add workaround to W3C test harness for node >= 0.11.7.\n- Update the form-associated element list to match HTML5.\n\n# domino 1.0.25 (19 May 2016)\n\n- Fix broken stopping of immediate propagation of Events. (#78)\n- Properly set \"scripting enabled\" flag when parsing fragments.\n- Fix handling of escaped or invalid CSS identifiers in\n  `querySelector` and friends. (#79)\n\n# domino 1.0.24 (05 Apr 2016)\n\n- Implement WindowTimers interface on Window. (#72)\n- Factor out the NavigatorID interface and make more spec-compliant.\n- Implement `HTMLTemplateElement` and parse `<template>` tags.\n- Properly parse the `<main>` tag.\n- Remove support for the non-standard `<command>` tag.\n- Create `HTMLCanvasElement` when parsing `<canvas>` tags.\n- Create `HTMLDialogElement` when parsing `<dialog>` tags.\n- Fix parsing of `<ruby>` tags, especially `<rb>` and `<rtc>`.\n- Create `HTMLMenuItemElement` when parsing `<menuitem>` tags.\n- Create `HTMLSourceElement` when parsing `<source>` tags.\n- Create `HTMLTrackElement` when parsing `<track>` tags.\n- Improve parsing of `<svg>` elements.\n- Fix parsing of `<isindex>` element in unusual contexts.\n- Serialize `<!DOCTYPE>` according to latest HTML5 spec.\n- Update adoption agency algorithm to match latest HTML5 spec.\n- Add additional parameter to `domino.createDocument` to\n  allow creating a document from an empty string if desired.\n- Add tree builder test cases from `html5lib-tests`.\n- Implement `Document#location`. (#75)\n- Stub out additional properties of `HTMLIFrameElement`. (#76)\n\n# domino 1.0.23 (30 Jan 2016)\n\n- Fix `CSSStyleDeclaration#setProperty`. (#71)\n- Update bundled CSS parser to 0.2.5+domino1.\n\n# domino 1.0.22 (27 Jan 2016)\n\n- Prevent TypeError due to undefined property when parsing styles. (#68)\n- Support legacy `Attr#nodeValue` and `Attr#textContent` aliases. (#70)\n\n# domino 1.0.21 (23 Dec 2015)\n\n- Improve performance when adding nodes with duplicate IDs. (#60)\n- Be more careful about setting prototype to `null` when using\n  Objects as a Map. (#61)\n- Fix a global leak in NodeIterator.\n- Improve efficiency of `Node#replaceChild` and `Node#insert`. (#62)\n- Bug fix for `Node#normalize` which could cause deletion of empty\n  `Comment` or `ProcessingInstruction` nodes. (#63)\n- Don't lowercase non-ASCII tag and attribute names. (#65)\n- Fix a number of minor bugs in rarely used code, discovered\n  during delinting. (#66)\n- Implement `Node.contains`. (#67)\n\n# domino 1.0.20 (20 Nov 2015)\n\n- CharacterData implements the NonDocumentTypeChildNode\n  interface. (#57, #58)\n- Fix CSS `[style]` selector. (#59)\n\n# domino 1.0.19 (29 Jul 2015)\n\n- Bug fixes for `TreeWalker` / `document.createTreeWalker` (filter\n  argument was ignored; various traversal issues)\n- Implement `NodeIterator` / `document.createNodeIterator` (#54)\n- Update `mocha` dependency to 2.2.x and `should` to 7.0.x.\n\n# domino 1.0.18 (25 Sep 2014)\n\n- HTMLAnchorElement now implements URLUtils. (#47)\n- Be consistent with our handling of null/empty namespaces. (#48)\n- Update `mocha` dependency to 1.21.x and `should` to 4.0.x.\n\n# domino 1.0.17 (14 May 2014)\n\n- Brown paper bag bug fix for an HTML parsing regression introduced in\n  domino 1.0.16. (#45)\n- Update `mocha` dependency to 1.18.x and `should` to 3.3.x.\n\n# domino 1.0.16 (13 May 2014)\n\n**DO NOT USE:** contains parser regression, fixed in 1.0.17.\n\n- Various performance improvements to the HTML5 parser. (#43, #44)\n- Fix `Element#isHTML` for non-HTML elements. (#41)\n\n# domino 1.0.15 (21 Jan 2014)\n\n- Implement `Element#matches()`.\n- Fix CSS `[lang]`, `[dir]`, etc selectors.\n- Update `mocha` dependency to 1.17.x.\n\n# domino 1.0.14 (21 Dec 2013)\n\n- `Element#classList.length` should be 0 if there's no `class`\n  attribute.\n- Add `height`/`width` attributes to `HTMLImageElement`.\n- Fix node 0.11 incompatibility in the w3c test harness.\n- Update `mocha` dependency to 1.16.x; update `should` dependency to 2.1.x.\n\n# domino 1.0.13 (8 Oct 2013)\n\n- Include `<th>` elements in `HTMLTableRowElement#cells`. (#38, #39)\n- Fix old call to `toLowerCase()` function. (#37)\n- Update `mocha` and `should` dependencies.\n\n# domino 1.0.12 (9 Jul 2013)\n\n- Fix bug in formatting element adoption agency algorithm. (#36)\n- Coerce `document.createTextNode` argument to a string. (#34, #35)\n- Work around performance regression in node <= 0.6.\n\n# domino 1.0.11 (1 May 2013)\n\n- Fix rooted element traversal (`Element#nextElement`,\n  `Element#getElementsByTagName`). (#31, #32)\n- Update zest to fix bugs in `+` and `>` combinators.\n- Don't overflow the stack if attribute values are very large (>64k).\n\n# domino 1.0.10 (12 Apr 2013)\n\n- Document issues with `Element#attributes`. (#27)\n- Fix `Document#title` to match DOM spec. (#29)\n- Add missing `require('utils')` for `handleErrors`. (#28)\n- Implement `DocumentFragment#querySelector` and\n  `DocumentFragment#querySelectorAll`. (#20, #26)\n- Fix `querySelectorAll` on unparented `Element`s. (#23)\n- Move `outerHTML`/`innerHTML` properties from `HTMLElement` to\n  `Element` to match dom parsing spec. (#21)\n- Update zest selector library to 0.0.4. (#25)\n- Fix regression in node 0.10. (#22, #24)\n- Update `mocha` and `should` dependencies.\n\n# domino 1.0.9 (11 Mar 2013)\n\n- Support jQuery 1.9.x by allowing `Element#attributes[qname]`.\n- Implement `HTMLElement#outerHTML`. (#18)\n- Only add newlines after `<pre>`/`<textarea>`/`<listing>` if\n  necessary, to match HTML5 serialization spec. (#16, #17)\n- Mirror node type properties (`ELEMENT_NODE`, etc) into\n  `Node.prototype`. (#14, #15)\n\n# domino 1.0.8\n\n**DO NOT USE:** was inadvertently published identical to domino 1.0.7.\n\n# domino 1.0.7 (16 Jan 2013)\n\n- Throw `SyntaxError` upon invocation rather than build-time. (#10)\n- Return nodes in document order. (#11)\n- Added a TreeWalker implementation.\n"
  },
  {
    "path": "packages/qwik-dom/LICENSE",
    "content": "Copyright (c) 2011 The Mozilla Foundation.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n    Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/qwik-dom/package.json",
    "content": "{\n  \"name\": \"@builder.io/qwik-dom\",\n  \"description\": \"Server-side DOM implementation based on Mozilla's dom.js\",\n  \"version\": \"2.1.19\",\n  \"author\": \"Felix Gnass <fgnass@gmail.com>\",\n  \"files\": [\n    \"CHANGELOG.md\",\n    \"LICENSE\",\n    \"README.md\",\n    \"lib\"\n  ],\n  \"homepage\": \"https://github.com/fgnass/domino\",\n  \"license\": \"BSD-2-Clause\",\n  \"main\": \"./lib\",\n  \"repository\": \"fgnass/domino.git\",\n  \"types\": \"lib/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/qwik-labs/.gitignore",
    "content": "# Build\n/dist\n/lib\n/lib-types\n/vite\n/server\n\n# Development\nnode_modules\n\n# Cache\n.cache\n.mf\n.vscode\n.rollup.cache\ntsconfig.tsbuildinfo\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\n# Editor\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\n# Yarn\n.yarn/*\n!.yarn/releases\n"
  },
  {
    "path": "packages/qwik-labs/.prettierignore",
    "content": "# Files Prettier should not format\n**/*.log\n**/.DS_Store\n*.\ndist\nvite\nnode_modules\nlib\nlib-types\n"
  },
  {
    "path": "packages/qwik-labs/README.md",
    "content": "# Qwik Library ⚡️\n\n- [Qwik Docs](https://qwik.dev/)\n- [Discord](https://qwik.dev/chat)\n- [Qwik on GitHub](https://github.com/QwikDev/qwik)\n- [@QwikDev](https://twitter.com/QwikDev)\n- [Vite](https://vitejs.dev/)\n- [Partytown](https://partytown.qwik.dev/)\n- [Mitosis](https://github.com/BuilderIO/mitosis)\n- [Builder.io](https://www.builder.io/)\n\n---\n\n## Project Structure\n\nInside your project, you'll see the following directories and files:\n\n```\n├── public/\n│   └── ...\n└── src/\n    ├── components/\n    │   └── ...\n    └── index.ts\n```\n\n- `src/components`: Recommended directory for components.\n\n- `index.ts`: The entry point of your component library, make sure all the public components are exported from this file.\n\n## Development\n\nDevelopment mode uses [Vite's development server](https://vitejs.dev/). For Qwik during development, the `dev` command will also server-side render (SSR) the output. The client-side development modules are loaded by the browser.\n\n```\npnpm dev\n```\n\n> Note: during dev mode, Vite will request many JS files, which does not represent a Qwik production build.\n\n## Production\n\nThe production build should generate the production build of your component library and type definitions in (./lib).\n\n```\npnpm build\n```\n"
  },
  {
    "path": "packages/qwik-labs/eslint.config.mjs",
    "content": "import js from '@eslint/js';\nimport globals from 'globals';\nimport tseslint from 'typescript-eslint';\nimport { globalIgnores } from 'eslint/config';\nimport { qwikEslint9Plugin } from 'eslint-plugin-qwik';\n\nconst ignores = [\n  '**/*.log',\n  '**/.DS_Store',\n  '**/*.',\n  '.vscode/settings.json',\n  '**/.history',\n  '**/.yarn',\n  '**/bazel-*',\n  '**/bazel-bin',\n  '**/bazel-out',\n  '**/bazel-qwik',\n  '**/bazel-testlogs',\n  '**/dist',\n  '**/dist-dev',\n  '**/lib',\n  '**/lib-types',\n  '**/vite',\n  '**/etc',\n  '**/external',\n  '**/node_modules',\n  '**/temp',\n  '**/tsc-out',\n  '**/tsdoc-metadata.json',\n  '**/target',\n  '**/output',\n  '**/rollup.config.js',\n  '**/build',\n  '**/.cache',\n  '**/.vscode',\n  '**/.rollup.cache',\n  '**/dist',\n  '**/tsconfig.tsbuildinfo',\n  '**/vite.config.ts',\n  'eslint.config.mjs',\n];\n\nexport default tseslint.config(\n  globalIgnores(ignores),\n  js.configs.recommended,\n  tseslint.configs.recommended,\n  qwikEslint9Plugin.configs.recommended,\n  {\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        ...globals.node,\n        ...globals.es2021,\n      },\n      parserOptions: {\n        project: ['./tsconfig.json', './tsconfig-vite.json'],\n        tsconfigRootDir: import.meta.dirname,\n        ecmaFeatures: {\n          jsx: true,\n        },\n      },\n    },\n  },\n  {\n    rules: {\n      '@typescript-eslint/no-explicit-any': 'off',\n      '@typescript-eslint/explicit-module-boundary-types': 'off',\n      '@typescript-eslint/no-inferrable-types': 'off',\n      '@typescript-eslint/no-non-null-assertion': 'off',\n      '@typescript-eslint/no-empty-interface': 'off',\n      '@typescript-eslint/no-namespace': 'off',\n      '@typescript-eslint/no-empty-function': 'off',\n      '@typescript-eslint/no-this-alias': 'off',\n      '@typescript-eslint/ban-types': 'off',\n      '@typescript-eslint/ban-ts-comment': 'off',\n      'prefer-spread': 'off',\n      'no-case-declarations': 'off',\n      'no-console': 'off',\n      '@typescript-eslint/no-unused-vars': 'off',\n      '@typescript-eslint/no-empty-object-type': 'off',\n      '@typescript-eslint/no-unsafe-function-type': 'off',\n      '@typescript-eslint/no-unused-expressions': 'off',\n      curly: 'error',\n    },\n  }\n);\n"
  },
  {
    "path": "packages/qwik-labs/package.json",
    "content": "{\n  \"name\": \"@builder.io/qwik-labs\",\n  \"description\": \"Qwik Labs - Where you can try the latest Qwik ideas.\",\n  \"version\": \"0.0.1\",\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@eslint/js\": \"9.32.0\",\n    \"@types/node\": \"20.19.0\",\n    \"eslint\": \"9.32.0\",\n    \"eslint-plugin-qwik\": \"workspace:^\",\n    \"globals\": \"16.4.0\",\n    \"np\": \"10.2.0\",\n    \"prettier\": \"3.6.2\",\n    \"typescript\": \"5.4.5\",\n    \"typescript-eslint\": \"8.38.0\",\n    \"undici\": \"*\",\n    \"vite\": \"7.3.1\",\n    \"zod\": \"3.25.48\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./lib/index.d.ts\",\n      \"import\": \"./lib/index.qwik.mjs\",\n      \"require\": \"./lib/index.qwik.cjs\"\n    },\n    \"./vite\": {\n      \"types\": \"./vite/index.d.ts\",\n      \"import\": \"./vite/index.js\",\n      \"require\": \"./vite/index.cjs\"\n    }\n  },\n  \"files\": [\n    \"lib\",\n    \"vite\"\n  ],\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"peerDependencies\": {\n    \"vite\": \">=5 <8\",\n    \"zod\": \"3.25.48\"\n  },\n  \"private\": true,\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"scripts\": {\n    \"build\": \"pnpm build.vite && qwik build\",\n    \"build.lib\": \"vite build --mode lib\",\n    \"build.vite\": \"vite -c vite.config-src-vite.mts build\",\n    \"dev\": \"vite --mode ssr\",\n    \"dev.debug\": \"node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"fmt\": \"prettier --write .\",\n    \"fmt.check\": \"prettier --check .\",\n    \"lint\": \"eslint \\\"src/**/*.ts*\\\"\",\n    \"lint.fix\": \"eslint --fix \\\"src/**/*.ts*\\\"\",\n    \"qwik\": \"qwik\",\n    \"release\": \"np\",\n    \"start\": \"vite --open --mode ssr\",\n    \"test.unit\": \"vitest\"\n  },\n  \"sideEffects\": false,\n  \"type\": \"module\",\n  \"types\": \"./lib/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/qwik-labs/src/devtools/index.ts",
    "content": "// @ts-expect-error compiled-string-plugin\nexport { default as devtoolsJsonSRC } from './json?compiled-string';\n"
  },
  {
    "path": "packages/qwik-labs/src/devtools/json.ts",
    "content": "// IMPORTANT: This file should have no external imports!!!\n// It runs in the browser and is compiled to a string\n\n// required for side effects\nexport {};\n\nrunQwikJsonDebug(window, document, qwikJsonDebug);\n\nfunction runQwikJsonDebug(window: Window, document: Document, debug: typeof qwikJsonDebug) {\n  const parseQwikJSON = () => {\n    const rawData = JSON.parse(document.querySelector('script[type=\"qwik/json\"]')!.textContent!);\n    const derivedFns =\n      (\n        document.querySelector('script[q\\\\:func=\"qwik/json\"]') as any as {\n          qFuncs: Function[];\n        } | null\n      )?.qFuncs || [];\n    const debugData = debug(document, rawData, derivedFns);\n    (window as any).qwikJson = debugData;\n    console.log(debugData);\n  };\n  if (document.querySelector('script[type=\"qwik/json\"]')) {\n    parseQwikJSON();\n  } else {\n    document.addEventListener('DOMContentLoaded', parseQwikJSON);\n  }\n}\n\nfunction qwikJsonDebug(document: Document, qwikJson: QwikJson, derivedFns: Function[]): DebugState {\n  class Base {\n    constructor(\n      public __id: number,\n      public __backRefs: any[] = []\n    ) {}\n  }\n\n  class number_ extends Base {\n    constructor(\n      public __id: number,\n      public __value: number\n    ) {\n      super(__id);\n    }\n  }\n\n  class boolean_ extends Base {\n    constructor(\n      public __id: number,\n      public __value: boolean\n    ) {\n      super(__id);\n    }\n  }\n\n  class string_ extends Base {\n    constructor(\n      public __id: number,\n      public __value: string\n    ) {\n      super(__id);\n    }\n  }\n\n  class undefined_ extends Base {\n    constructor(public __id: number) {\n      super(__id);\n    }\n  }\n  class Object_ extends Base {\n    constructor(public __id: number) {\n      super(__id);\n    }\n  }\n\n  class Array_ extends Array implements Base {\n    public __id: number;\n    public __backRefs: any[] = [];\n    constructor(__id: number) {\n      super();\n      this.__id = __id;\n    }\n  }\n\n  class Task extends Base {\n    constructor(\n      public __id: number,\n      public flags: string,\n      public index: number,\n      public obj: any\n    ) {\n      super(__id);\n    }\n  }\n\n  class Listener {\n    constructor(\n      public event: string,\n      public qrl: QRL\n    ) {}\n  }\n\n  interface SubscriberEffect {}\n  // interface StyleAppend {}\n  // interface ProcessedJSXNode {}\n\n  class QContext {\n    element: Node | null = null;\n    // refMap: any[] = [];\n    // flags: string = '';\n    props: Record<string, any> | null = null;\n    componentQrl: QRL | null = null;\n    listeners: Listener[] = [];\n    seq: any[] | null = [];\n    tasks: SubscriberEffect[] | null = null;\n    contexts: Map<string, any> | null = null;\n    // appendStyles: StyleAppend[] | null = null;\n    scopeIds: string[] | null = null;\n    // vdom: ProcessedJSXNode | null = null;\n    // slots: ProcessedJSXNode[] | null = null;\n    // dynamicSlots: QContext[] | null = null;\n    // parent: QContext | null = null;\n    // slotParent: QContext | null = null;\n  }\n\n  class QRefs {\n    constructor(\n      public element: Element,\n      public refMap: any[],\n      public listeners: Listener[]\n    ) {}\n  }\n\n  class Component extends Base {\n    constructor(\n      public __id: number,\n      public qrl: string\n    ) {\n      super(__id);\n    }\n  }\n\n  class SignalWrapper extends Base {\n    constructor(\n      public __id: number,\n      public id: string,\n      public prop: string\n    ) {\n      super(__id);\n    }\n  }\n\n  class DerivedSignal extends Base {\n    constructor(\n      public __id: number,\n      public fn: Function,\n      public args: any[]\n    ) {\n      super(__id);\n    }\n  }\n\n  class QRL extends Base {\n    constructor(\n      public __id: number,\n      public chunk: string,\n      public symbol: string,\n      public capture: any[]\n    ) {\n      super(__id);\n    }\n  }\n\n  const nodeMap = getNodeMap();\n  const refs: Record<string, QRefs> = {};\n  const contexts: Record<string, QContext> = {};\n  const objs: any[] = [];\n  const subs: any[] = [];\n  qwikJson.objs.forEach((_, idx) => getObject(idx, null));\n  Object.keys(qwikJson.ctx).forEach((idx) => getContext(idx));\n  Object.keys(qwikJson.refs).forEach((idx) => getRef(idx));\n  qwikJson.subs;\n  return {\n    refs,\n    ctx: contexts,\n    objs,\n    subs,\n  };\n  //////////////////////////////////////////////////////////////////////////////////\n  function getContext(idx: string): any {\n    const rawCtx = qwikJson.ctx[idx];\n    const ctx = (contexts[idx] = new QContext());\n    const node = (ctx.element = nodeMap.get(idx) || null);\n    if (isElement(node)) {\n      const rawRefs = qwikJson.refs[idx];\n      const refMap = splitParse(rawRefs, ' ', (id) => getObject(id, node));\n      ctx.listeners = getDomListeners(refMap, node);\n    } else if (isComment(node)) {\n      const attrs = new Map<string, string>();\n      node.textContent!.split(' ').forEach((keyValue) => {\n        const [key, value] = keyValue.split('=');\n        attrs.set(key, value);\n      });\n      const sstyle = attrs.get('q:sstyle');\n      if (sstyle) {\n        ctx.scopeIds = sstyle.split('|');\n      }\n    }\n    if (rawCtx.h) {\n      const [qrl, props] = rawCtx.h.split(' ').map((h: string) => (h ? getObject(h, ctx) : null));\n      ctx.componentQrl = qrl;\n      ctx.props = props;\n    }\n    if (rawCtx.c) {\n      const contexts = (ctx.contexts = new Map());\n      for (const part of rawCtx.c.split(' ')) {\n        const [key, value] = part.split('=');\n        contexts.set(key, getObject(value, ctx));\n      }\n    }\n    if (rawCtx.s) {\n      ctx.seq = rawCtx.s.split(' ').map((s) => getObject(parseNumber(s), ctx));\n    }\n    if (rawCtx.w) {\n      ctx.tasks = rawCtx.w.split(' ').map((s) => getObject(parseNumber(s), ctx));\n    }\n  }\n  //////////////////////////////////////////////////////////////////////////////////\n  function getRef(idx: string): any {\n    const rawRefs = qwikJson.refs[idx];\n    const node = nodeMap.get(idx) || null;\n    if (isElement(node)) {\n      const refMap = splitParse(rawRefs, ' ', (id) => getObject(id, node));\n      const listeners = getDomListeners(refMap, node);\n      refs[idx] = new QRefs(node, refMap, listeners);\n    }\n  }\n  //////////////////////////////////////////////////////////////////////////////////\n  function getObject(idx: number | string, parent: any): any {\n    if (typeof idx == 'string') {\n      if (idx.startsWith('#')) {\n        const node = nodeMap.get(idx.substring(1));\n        if (!(node as unknown as Base).__backRefs) {\n          (node as unknown as Base).__backRefs = [];\n        }\n        if ((node as unknown as Base).__backRefs.indexOf(parent) === -1) {\n          (node as unknown as Base).__backRefs.push(parent);\n        }\n        return node;\n      }\n      const num = parseNumber(idx);\n      if (isNaN(num)) {\n        throw new Error('Invalid index: ' + idx);\n      }\n      idx = num;\n    }\n    while (objs.length < idx) {\n      objs.push(null);\n    }\n    let obj: undefined | Base = objs[idx];\n    if (!obj) {\n      const rawValue = qwikJson.objs[idx];\n      let value: any = rawValue;\n      if (typeof value === 'number') {\n        obj = new number_(idx, value);\n      } else if (typeof value === 'boolean') {\n        obj = new boolean_(idx, value);\n      } else if (typeof value === 'undefined') {\n        obj = new undefined_(idx);\n      } else if (typeof value === 'object') {\n        obj = Array.isArray(value) ? new Array_(idx) : new Object_(idx);\n        for (const key in value) {\n          if (Object.prototype.hasOwnProperty.call(value, key)) {\n            (obj as any)[key] = getObject(parseNumber(value[key]), obj);\n          }\n        }\n      } else if (typeof rawValue === 'string') {\n        const data = rawValue.substring(1);\n        switch (rawValue.charCodeAt(0)) {\n          case 0x01: // UndefinedSerializer, ///////// \\u0001\n            value = new undefined_(idx);\n            break;\n          case 0x02: // QRLSerializer, ////////////// \\u0002\n            const [chunk, symbol, ...capture] = data.split(/[#[\\]\\s]/);\n            obj = new QRL(\n              idx,\n              chunk,\n              symbol,\n              capture.map((id) => getObject(parseNumber(id), parent))\n            );\n            break;\n          case 0x03: // TaskSerializer, ///////////// \\u0003\n            const [flags, index, objId] = data.split(' ');\n            const flagString = [\n              parseNumber(flags) & (1 << 0) ? 'Visible' : '',\n              parseNumber(flags) & (1 << 1) ? 'Task' : '',\n              parseNumber(flags) & (1 << 2) ? 'Resource' : '',\n              parseNumber(flags) & (1 << 3) ? 'Computed' : '',\n              parseNumber(flags) & (1 << 4) ? 'Dirty' : '',\n              parseNumber(flags) & (1 << 5) ? 'Cleanup' : '',\n            ]\n              .filter(Boolean)\n              .join('|');\n            obj = new Task(idx, flagString, parseNumber(index), getObject(objId, parent));\n            break;\n          case 0x12: // SignalSerializer, /////////// \\u0012\n            obj = getObject(data, parent);\n            break;\n          case 0x11: // DerivedSignalSerializer, //// \\u0011\n            const fnParts = data.split(' ');\n            const fn = derivedFns[parseNumber(fnParts.pop()!.substring(1))];\n            obj = new DerivedSignal(\n              idx,\n              fn,\n              fnParts.map((id) => getObject(id, parent))\n            );\n            break;\n          case 0x05: // URLSerializer, ////////////// \\u0005\n            obj = new URL(data) as any;\n            (obj as Base).__id = idx;\n            (obj as Base).__backRefs = [];\n            break;\n          case 0x10: // ComponentSerializer, //////// \\u0010\n            obj = new Component(idx, data);\n            break;\n          case 0x13: // SignalWrapperSerializer, //// \\u0013\n            const [id, prop] = data.split(' ');\n            obj = new SignalWrapper(idx, id as any, prop);\n            break;\n          case 0x04: // ResourceSerializer, ///////// \\u0004\n          case 0x06: // DateSerializer, ///////////// \\u0006\n          case 0x16: // FormDataSerializer, ///////// \\u0016\n          case 0x07: // RegexSerializer, //////////// \\u0007\n          case 0x0e: // ErrorSerializer, //////////// \\u000E\n          case 0x15: // URLSearchParamsSerializer, // \\u0015\n          case 0x14: // NoFiniteNumberSerializer, /// \\u0014\n          case 0x17: // JSXNodeSerializer, ////////// \\u0017\n          case 0x18: // BigIntSerializer, /////////// \\u0018\n          case 0x19: // SetSerializer, ////////////// \\u0019\n          case 0x1a: // MapSerializer, ////////////// \\u001a\n          case 0x0f: // DocumentSerializer, ///////// \\u000F\n            throw new Error(\n              'Not Implemented: ' +\n                rawValue.charCodeAt(0).toString(16) +\n                ' ' +\n                JSON.stringify(rawValue)\n            );\n          // console.error((value = 'Not Implemented: ' + rawValue.charCodeAt(0)));\n          // break;\n          default:\n            obj = new string_(idx, rawValue);\n        }\n      } else {\n        throw new Error('Unexpected type: ' + JSON.stringify(rawValue));\n      }\n      objs[idx] = obj;\n    }\n    if (parent && obj && obj.__backRefs.indexOf(parent) === -1) {\n      obj.__backRefs.push(parent);\n    }\n    return obj;\n  }\n\n  function getNodeMap() {\n    const map = new Map<string, Node>();\n    const walker = document.createTreeWalker(\n      document.firstElementChild!,\n      NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT\n    );\n    for (let node = walker.firstChild(); node !== null; node = walker.nextNode()) {\n      const id = getId(node);\n      id && map.set(id, node);\n    }\n    return map;\n  }\n\n  function getId(node: Node): string | null {\n    if (isElement(node)) {\n      return node.getAttribute('q:id');\n    } else if (isComment(node)) {\n      const text = node.nodeValue || '';\n      if (text.startsWith('t=')) {\n        return text.substring(2);\n      } else if (text.startsWith('qv ')) {\n        const parts = text.split(' ');\n        for (let i = 0; i < parts.length; i++) {\n          const part = parts[i];\n          if (part.startsWith('q:id=')) {\n            return part.substring(5);\n          }\n        }\n      }\n      return null;\n    } else {\n      throw new Error('Unexpected node type: ' + node.nodeType);\n    }\n  }\n\n  function isElement(node: any): node is Element {\n    return node && typeof node == 'object' && node.nodeType === Node.ELEMENT_NODE;\n  }\n  function isComment(node: any): node is Comment {\n    return node && typeof node == 'object' && node.nodeType === Node.COMMENT_NODE;\n  }\n\n  function splitParse(text: string | null, sep: string, fn: (part: string) => any): any[] {\n    if (!text) {\n      return [];\n    }\n    return text.split(sep).map(fn);\n  }\n\n  function getDomListeners(refMap: any[], containerEl: Element): Listener[] {\n    const attributes = containerEl.attributes;\n    const listeners: Listener[] = [];\n    for (let i = 0; i < attributes.length; i++) {\n      const { name, value } = attributes.item(i)!;\n      if (\n        name.startsWith('on:') ||\n        name.startsWith('on-window:') ||\n        name.startsWith('on-document:')\n      ) {\n        const urls = value.split('\\n');\n        for (const url of urls) {\n          const [chunk, symbol, capture] = url.split(/[#[\\]]/);\n          const qrl = new QRL(\n            -1,\n            chunk,\n            symbol,\n            (capture || '').split(' ').map((id) => refMap[parseInt(id, 10)])\n          );\n          listeners.push(new Listener(name, qrl));\n        }\n      }\n    }\n    return listeners;\n  }\n\n  function parseNumber(value: string) {\n    return parseInt(value, 36);\n  }\n}\n\ninterface QwikJson {\n  refs: Record<string, string>;\n  ctx: Record<\n    string,\n    {\n      w?: string; // q:watches\n      s?: string; // q:seq\n      h?: string; // q:host\n      c?: string; // q:context\n    }\n  >;\n  objs: Array<QwikJsonObjsPrimitives | QwikJsonObjsObj>;\n  subs: Array<Array<string>>;\n}\ntype QwikJsonObjsPrimitives = string | boolean | number | null;\ntype QwikJsonObjsObj = Record<string, QwikJsonObjsPrimitives>;\n\ninterface Base {\n  __id: number;\n  __backRefs: any[];\n}\n\ninterface QRL extends Base {\n  chunk: string;\n  symbol: string;\n  capture: any[];\n}\n\ninterface QRefs {\n  element: Element;\n  refMap: any[];\n  listeners: Listener[];\n}\n\ninterface Listener {\n  event: string;\n  qrl: QRL;\n}\n\ninterface SubscriberEffect {}\n\ninterface QContext {\n  element: Node | null;\n  props: Record<string, any> | null;\n  componentQrl: QRL | null;\n  listeners: Listener[];\n  seq: any[] | null;\n  tasks: SubscriberEffect[] | null;\n  contexts: Map<string, any> | null;\n  scopeIds: string[] | null;\n}\n\ninterface DebugState {\n  refs: Record<string, QRefs>;\n  ctx: Record<string, QContext>;\n  objs: any[];\n  subs: unknown;\n}\n"
  },
  {
    "path": "packages/qwik-labs/src/entry.dev.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Development entry point using only client-side modules:\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nimport { render, type RenderOptions } from '@builder.io/qwik';\nimport Root from './root';\n\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "packages/qwik-labs/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this entry point\n * will be the common one.\n *\n * - Server (express, cloudflare...)\n * - `npm run start`\n * - `npm run preview`\n * - `npm run build`\n */\nimport { renderToStream, type RenderToStreamOptions } from '@builder.io/qwik/server';\nimport Root from './root';\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/qwik-labs/src/index.ts",
    "content": "export { Insights, InsightsError, InsightSymbol, InsightsPayload } from './insights';\nexport { untypedAppUrl, omitProps } from './qwik-types';\nexport { devtoolsJsonSRC } from './devtools';\n"
  },
  {
    "path": "packages/qwik-labs/src/insights/index.tsx",
    "content": "import { component$, sync$ } from '@builder.io/qwik';\nimport * as z from 'zod';\n\nexport interface InsightsPayload {\n  /** Qwik version */\n  qVersion: string;\n\n  /** Manifest Hash of the container. */\n  manifestHash: string;\n\n  /**\n   * API key of the application which we are trying to profile.\n   *\n   * This key can be used for sharding the data.\n   */\n  publicApiKey: string;\n\n  /**\n   * Previous symbol received on the client.\n   *\n   * Client periodically sends symbol log to the server. Being able to connect the order of symbols\n   * is useful for server clustering. Sending previous symbol name allows the server to stitch the\n   * symbol list together.\n   */\n  previousSymbol?: string | null;\n\n  /** List of symbols which have been received since last update. */\n  symbols: InsightSymbol[];\n}\n\nexport interface InsightSymbol {\n  /** Symbol name */\n  symbol: string;\n\n  /** Current route so we can have a better understanding of which symbols are needed for each route. */\n  route: string;\n\n  /** Time delta since last symbol. Can be used to stich symbol requests together */\n  delay: number;\n\n  /** Number of ms between the time the symbol was requested and it was loaded. */\n  latency: number;\n\n  /** Number of ms between the q:route attribute change and the qsymbol event */\n  timeline: number;\n\n  /**\n   * Was this symbol as a result of user interaction. User interactions represent roots for\n   * clouters.\n   */\n  interaction: boolean;\n}\n\nexport interface InsightsError {\n  /** Manifest Hash of the container. */\n  manifestHash: string;\n  timestamp: number;\n  url: string;\n  source: string;\n  line: number;\n  column: number;\n  error: string;\n  message: string;\n  stack: string;\n}\n\nexport const InsightsError = /* @__PURE__ */ z.object({\n  manifestHash: z.string(),\n  url: z.string(),\n  timestamp: z.number(),\n  source: z.string(),\n  line: z.number(),\n  column: z.number(),\n  message: z.string(),\n  error: z.string(),\n  stack: z.string(),\n});\n\nexport const InsightSymbol = /* @__PURE__ */ z.object({\n  symbol: z.string(),\n  route: z.string(),\n  delay: z.number(),\n  latency: z.number(),\n  timeline: z.number(),\n  interaction: z.boolean(),\n});\n\nexport const InsightsPayload = /* @__PURE__ */ z.object({\n  qVersion: z.string(),\n  manifestHash: z.string(),\n  publicApiKey: z.string(),\n  // we retain nullable for older clients\n  previousSymbol: z.string().optional().nullable(),\n  symbols: z.array(InsightSymbol),\n});\n\nInsightSymbol._type satisfies InsightSymbol;\nInsightsPayload._type satisfies InsightsPayload;\nInsightsError._type satisfies InsightsError;\n\ninterface QwikSymbolTrackerWindow extends Window {\n  qSymbolTracker: {\n    symbols: InsightSymbol[];\n    publicApiKey: string;\n  };\n}\n\ninterface QSymbolDetail {\n  element: HTMLElement | undefined;\n  reqTime: number;\n  symbol: string;\n}\n\n// We use a self-invoking function to minify the code, renaming long globals and attributes\n// the qwik optimizer only minifies somewhat, so put all var declarations in the same line\nconst insightsPing = sync$(() =>\n  ((\n    window: QwikSymbolTrackerWindow,\n    document,\n    location,\n    navigator,\n    performance,\n    round,\n    JSON_stringify\n  ) => {\n    /* eslint-disable no-var -- better minification */\n    var publicApiKey = __QI_KEY__,\n      postUrl = __QI_URL__,\n      getAttribute_s = 'getAttribute' as const,\n      querySelector_s = 'querySelector' as const,\n      manifest_s = 'manifest' as const,\n      manifest_hash_s = `${manifest_s}-hash` as const,\n      manifestHash_s = `${manifest_s}Hash` as const,\n      version_s = 'version' as const,\n      publicApiKey_s = 'publicApiKey' as const,\n      sendBeacon_s = 'sendBeacon' as const,\n      symbol_s = 'symbol' as const,\n      length_s = 'length' as const,\n      addEventListener_s = 'addEventListener' as const,\n      route_s = 'route' as const,\n      error_s = 'error' as const,\n      stack_s = 'stack' as const,\n      message_s = 'message' as const,\n      symbols_s = `${symbol_s}s` as const,\n      qVersion =\n        document[querySelector_s](`[q\\\\:${version_s}]`)?.[getAttribute_s](`q:${version_s}`) ||\n        'unknown',\n      manifestHash =\n        document[querySelector_s](`[q\\\\:${manifest_hash_s}]`)?.[getAttribute_s](\n          `q:${manifest_hash_s}`\n        ) || 'dev',\n      qSymbols: InsightSymbol[] = [],\n      existingSymbols: Set<string> = new Set(),\n      flushSymbolIndex: number = 0,\n      lastReqTime: number = 0,\n      timeoutID: ReturnType<typeof setTimeout> | undefined,\n      qRouteChangeTime = performance.now(),\n      qRouteEl = document[querySelector_s](`[q\\\\:${route_s}]`),\n      flush = () => {\n        timeoutID = undefined;\n        if (qSymbols[length_s] > flushSymbolIndex) {\n          var payload = {\n            qVersion,\n            [publicApiKey_s]: publicApiKey,\n            [manifestHash_s]: manifestHash,\n            previousSymbol:\n              flushSymbolIndex == 0 ? undefined : qSymbols[flushSymbolIndex - 1][symbol_s],\n            [symbols_s]: qSymbols.slice(flushSymbolIndex),\n          } satisfies InsightsPayload;\n          navigator[sendBeacon_s](postUrl, JSON_stringify(payload));\n          flushSymbolIndex = qSymbols[length_s];\n        }\n      },\n      debounceFlush = () => {\n        timeoutID != undefined && clearTimeout(timeoutID);\n        timeoutID = setTimeout(flush, 1000);\n      };\n\n    window.qSymbolTracker = {\n      [symbols_s]: qSymbols,\n      [publicApiKey_s]: publicApiKey,\n    };\n    if (qRouteEl) {\n      new MutationObserver((mutations) => {\n        var mutation = mutations.find((m) => m.attributeName === `q:${route_s}`);\n        if (mutation) {\n          qRouteChangeTime = performance.now();\n        }\n      }).observe(qRouteEl, { attributes: true });\n    }\n    document[addEventListener_s](\n      'visibilitychange',\n      () => document.visibilityState === 'hidden' && flush()\n    );\n    document[addEventListener_s](`q${symbol_s}`, (_event) => {\n      var event = _event as CustomEvent<QSymbolDetail>,\n        detail = event.detail,\n        symbolRequestTime = detail.reqTime,\n        symbolDeliveredTime = event.timeStamp,\n        symbol = detail[symbol_s];\n      if (!existingSymbols.has(symbol)) {\n        existingSymbols.add(symbol);\n        var route = qRouteEl?.[getAttribute_s](`q:${route_s}`) || '/';\n        qSymbols.push({\n          [symbol_s]: symbol,\n          [route_s]: route,\n          delay: round(0 - lastReqTime + symbolRequestTime),\n          latency: round(symbolDeliveredTime - symbolRequestTime),\n          timeline: round(0 - qRouteChangeTime + symbolRequestTime),\n          interaction: !!detail.element,\n        });\n        lastReqTime = symbolDeliveredTime;\n        debounceFlush();\n      }\n    });\n    window[addEventListener_s](error_s, (event: ErrorEvent) => {\n      var error = event[error_s];\n      if (!(error && typeof error === 'object')) {\n        return;\n      }\n      var payload = {\n        url: `${location}`,\n        [manifestHash_s]: manifestHash,\n        timestamp: new Date().getTime(),\n        source: event.filename,\n        line: event.lineno,\n        column: event.colno,\n        [message_s]: event[message_s],\n        [error_s]: message_s in error ? (error as Error)[message_s] : `${error}`,\n        [stack_s]: stack_s in error ? (error as Error)[stack_s] || '' : '',\n      } satisfies InsightsError;\n      navigator[sendBeacon_s](`${postUrl}${error_s}/`, JSON_stringify(payload));\n    });\n  })(window as any, document, location, navigator, performance, Math.round, JSON.stringify)\n);\n\n// We don't add window. to save some bytes\ndeclare var __QI_KEY__: string;\ndeclare var __QI_URL__: string;\n\nexport const Insights = component$<{ publicApiKey: string; postUrl?: string }>(\n  ({ publicApiKey, postUrl }) => {\n    if (!publicApiKey) {\n      return null;\n    }\n\n    return (\n      // the script will set the variables before the qinit event\n      <script\n        document:onQInit$={insightsPing}\n        dangerouslySetInnerHTML={`__QI_KEY__=${JSON.stringify(publicApiKey)};__QI_URL__=${JSON.stringify(postUrl || `https://insights.qwik.dev/api/v1/${publicApiKey}/post/`)}`}\n      />\n    );\n  }\n);\n"
  },
  {
    "path": "packages/qwik-labs/src/qwik-types/index.ts",
    "content": "export { untypedAppUrl, omitProps } from './public-api';\n"
  },
  {
    "path": "packages/qwik-labs/src/qwik-types/public-api.ts",
    "content": "/** @public */\nexport const untypedAppUrl = function appUrl(\n  route: string,\n  params?: Record<string, string>,\n  paramsPrefix: string = ''\n): string {\n  const path = route.split('/');\n  for (let i = 0; i < path.length; i++) {\n    const segment = path[i];\n    if (segment.startsWith('[') && segment.endsWith(']')) {\n      const isSpread = segment.startsWith('[...');\n      const key = segment.substring(segment.startsWith('[...') ? 4 : 1, segment.length - 1);\n      const value = params ? params[paramsPrefix + key] || params[key] : '';\n      path[i] = isSpread ? value : encodeURIComponent(value);\n    }\n    if (segment.startsWith('(') && segment.endsWith(')')) {\n      path.splice(i, 1);\n    }\n  }\n  let url = path.join('/');\n  let baseURL = import.meta.env.BASE_URL;\n  if (baseURL) {\n    if (!baseURL.endsWith('/')) {\n      baseURL += '/';\n    }\n    while (url.startsWith('/')) {\n      url = url.substring(1);\n    }\n    url = baseURL + url;\n  }\n  return url;\n};\n\n/**\n * Creates a new object from `obj` by omitting a set of `keys`.\n *\n * @public\n */\nexport function omitProps<T, KEYS extends keyof T>(obj: T, keys: KEYS[]): Omit<T, KEYS> {\n  const omittedObj: Record<string, any> = {};\n  for (const key in obj) {\n    if (!key.startsWith('param:') && !keys.includes(key as any)) {\n      omittedObj[key] = obj[key];\n    }\n  }\n  return omittedObj as Omit<T, KEYS>;\n}\n"
  },
  {
    "path": "packages/qwik-labs/src/root.tsx",
    "content": "export default () => {\n  return (\n    <>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik Blank App</title>\n        <script type=\"module\" src=\"/src/debug/index.ts\" />\n      </head>\n      <body>Qwik Labs</body>\n    </>\n  );\n};\n"
  },
  {
    "path": "packages/qwik-labs/src-vite/index.ts",
    "content": "export * from './insights';\nexport * from './qwik-types';\n"
  },
  {
    "path": "packages/qwik-labs/src-vite/insights/index.ts",
    "content": "import { type QwikVitePlugin, type SmartEntryStrategy } from '@builder.io/qwik/optimizer';\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport { join, resolve } from 'node:path';\nimport { type PluginOption } from 'vite';\n\nconst logWarn = (message?: any, ...rest: any[]) => {\n  // eslint-disable-next-line no-console\n  console.warn('\\x1b[33m%s\\x1b[0m', `qwikInsight()[WARN]: ${message}`, ...rest);\n};\n\nconst log = (message?: any) => {\n  // eslint-disable-next-line no-console\n  console.log('\\x1b[35m%s\\x1b[0m', `qwikInsight(): ${message}`);\n};\n\n/** @public */\nexport interface InsightManifest {\n  manual: Record<string, string>;\n  prefetch: { route: string; symbols: string[] }[];\n}\n\nexport async function qwikInsights(qwikInsightsOpts: {\n  publicApiKey: string;\n  baseUrl?: string;\n  outDir?: string;\n}): Promise<PluginOption> {\n  const { publicApiKey, baseUrl = 'https://insights.qwik.dev', outDir = '' } = qwikInsightsOpts;\n  let isProd = false;\n  let jsonDir: string;\n  let jsonFile: string;\n  let data: InsightManifest | null = null;\n  let qwikVitePlugin: QwikVitePlugin | null = null;\n\n  async function loadQwikInsights(): Promise<InsightManifest | null> {\n    if (data) {\n      return data;\n    }\n    if (existsSync(jsonFile)) {\n      log('Reading Qwik Insight data from: ' + jsonFile);\n      return (data = JSON.parse(await readFile(jsonFile, 'utf-8')) as InsightManifest);\n    }\n    return null;\n  }\n\n  const vitePlugin: PluginOption = {\n    name: 'vite-plugin-qwik-insights',\n    enforce: 'pre',\n    apply: 'build',\n    async config(viteConfig) {\n      jsonDir = resolve(viteConfig.root || '.', outDir);\n      jsonFile = join(jsonDir, 'q-insights.json');\n      isProd = viteConfig.mode !== 'ssr';\n    },\n    configResolved: {\n      // we want to register the bundle graph adder last so we overwrite existing routes\n      order: 'post',\n      async handler(config) {\n        qwikVitePlugin = config.plugins.find(\n          (p) => p.name === 'vite-plugin-qwik'\n        ) as QwikVitePlugin;\n        if (!qwikVitePlugin) {\n          throw new Error('Missing vite-plugin-qwik');\n        }\n        const opts = qwikVitePlugin.api.getOptions();\n        if (isProd) {\n          try {\n            const qManifest: InsightManifest = { manual: {}, prefetch: [] };\n            const response = await fetch(`${baseUrl}/api/v1/${publicApiKey}/bundles/strategy/`);\n            const strategy = await response.json();\n            Object.assign(qManifest, strategy);\n            data = qManifest;\n            mkdirSync(jsonDir, { recursive: true });\n            log('Fetched latest Qwik Insight data into: ' + jsonFile);\n            await writeFile(jsonFile, JSON.stringify(qManifest));\n          } catch (e) {\n            logWarn('Failed to fetch manifest from Insights DB', e);\n            await loadQwikInsights();\n          }\n        } else {\n          await loadQwikInsights();\n        }\n\n        if (data) {\n          (opts.entryStrategy as SmartEntryStrategy).manual = {\n            ...data.manual,\n            ...(opts.entryStrategy as SmartEntryStrategy).manual,\n          };\n\n          qwikVitePlugin.api.registerBundleGraphAdder((manifest) => {\n            const result: Record<\n              string,\n              { imports?: string[] | undefined; dynamicImports?: string[] | undefined }\n            > = {};\n            for (const item of data?.prefetch || []) {\n              if (item.symbols) {\n                let route = item.route;\n                if (route.startsWith('/')) {\n                  route = route.slice(1);\n                }\n                if (!route.endsWith('/')) {\n                  route += '/';\n                }\n                result[route] = { ...manifest.bundles[route], imports: item.symbols };\n              }\n            }\n            return result;\n          });\n        }\n      },\n    },\n\n    closeBundle: async () => {\n      const path = resolve(outDir, 'q-manifest.json');\n      if (isProd && existsSync(path)) {\n        const qManifest = await readFile(path, 'utf-8');\n\n        try {\n          await fetch(`${baseUrl}/api/v1/${publicApiKey}/post/manifest`, {\n            method: 'post',\n            body: qManifest,\n          });\n        } catch (e) {\n          logWarn('Failed to post manifest to Insights DB', e);\n        }\n      }\n    },\n  };\n  return vitePlugin;\n}\n"
  },
  {
    "path": "packages/qwik-labs/src-vite/qwik-types/generator.ts",
    "content": "import { stat, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { prettify } from './prettify';\n\nexport async function generateRouteTypes(srcDir: string, routesDir: string, routes: string[]) {\n  // console.log(routes);\n  await generateSrcRoutesConfig(srcDir);\n  await generateSrcRoutesGen(srcDir, routes);\n}\n\nasync function generateSrcRoutesConfig(srcDir: string) {\n  const CONFIG_FILE = await prettify`\n/**\n * This file is created as part of the typed routes, but it is intended to be modified by the developer.\n *\n * @fileoverview\n */\nimport { untypedAppUrl, omitProps } from '@builder.io/qwik-labs';\nimport { type AppLinkProps, type AppRouteParamsFunction } from './routes.gen';\nimport { type QwikIntrinsicElements } from '@builder.io/qwik';\n\n/**\n * Configure \\`appUrl\\` with the typed information of routes.\n */\nexport const appUrl = untypedAppUrl as AppRouteParamsFunction;\n\n/**\n * Configure \\`<AppLink/>\\` component with the typed information of routes.\n *\n * NOTE: you may consider changing \\`<a>\\` to \\`<Link>\\` to be globally applied across your application.\n */\nexport function AppLink(props: AppLinkProps & QwikIntrinsicElements['a']) {\n  return (\n    <a\n      href={(appUrl as (route: string, props: any, prefix: string) => string)(\n        props.route,\n        props,\n        'param:'\n      )}\n      {...omitProps(props, ['href'])}\n    >\n      {props.children}\n    </a>\n  );\n}\n`;\n\n  const file = join(srcDir, 'routes.config.tsx');\n  const fileExists = await exists(file);\n  console.log('File exists', file, fileExists);\n  if (!fileExists) {\n    writeFile(file, CONFIG_FILE);\n  }\n}\n\nasync function exists(file: string): Promise<boolean> {\n  try {\n    return (await stat(file)).isFile();\n  } catch (e) {\n    return false;\n  }\n}\n\nasync function generateSrcRoutesGen(srcDir: string, routes: string[]) {\n  await writeFile(\n    join(srcDir, 'routes.gen.d.ts'),\n    await prettify`\n${GENERATED_HEADER}\n\nexport type AppRoutes = ${routes.map((r) => s(r)).join('|')};\n\nexport interface AppRouteMap {\n  ${routes.map((r) => s(r) + ':' + toInterface('', r))}\n};\n\nexport interface AppRouteParamsFunction {\n  ${routes.map((r) => `(route: ${s(r)}, ${toInterface('params', r)}): string`).join(';')}\n}\n\nexport type AppLinkProps = ${routes\n      .map(\n        (route) =>\n          `{ route: ${s(route)}, ${toParams(route)\n            .map((param) => s('param:' + param) + ': string')\n            .join(';')}}`\n      )\n      .join('|')}\n`\n  );\n}\n\nfunction toParams(route: string) {\n  const params: string[] = [];\n  const parts = route.split('/');\n  parts.forEach((part) => {\n    if (part.startsWith('[') && part.endsWith(']')) {\n      params.push(part.substring(part.startsWith('[...') ? 4 : 1, part.length - 1));\n    }\n  });\n  return params;\n}\n\nfunction toInterface(paramName: string, route: string): string {\n  const params: string[] = toParams(route);\n  return (\n    (paramName ? paramName + (params.length ? ':' : '?:') : '') +\n    '{' +\n    params.map((param) => param + ': string').join(';') +\n    '}'\n  );\n}\n\nconst GENERATED_HEADER = `\n///////////////////////////////////////////////////////////////////////////\n/// GENERATED FILE --- DO NOT EDIT --- YOUR CHANGES WILL BE OVERWRITTEN ///\n///////////////////////////////////////////////////////////////////////////\n`;\n\nfunction s(text: string): string {\n  return JSON.stringify(text);\n}\n"
  },
  {
    "path": "packages/qwik-labs/src-vite/qwik-types/index.ts",
    "content": "export { qwikTypes } from './vite';\n"
  },
  {
    "path": "packages/qwik-labs/src-vite/qwik-types/prettify.ts",
    "content": "import { format } from 'prettier/standalone';\nimport estree from 'prettier/plugins/estree';\nimport typeScriptParser from 'prettier/parser-typescript';\nimport postCssParser from 'prettier/parser-postcss';\nimport htmlParser from 'prettier/parser-html';\nimport babelParser from 'prettier/parser-babel';\n\nexport async function prettify(\n  template: TemplateStringsArray,\n  ...substitutions: any[]\n): Promise<string> {\n  let source = '';\n  for (let i = 0; i < template.length; i++) {\n    source += template[i] + (i < substitutions.length ? String(substitutions[i]) : '');\n  }\n  try {\n    source = await format(source, {\n      parser: 'typescript',\n      plugins: [\n        // To support running in browsers\n        // require('prettier/plugins/estree'),\n        estree,\n        // require('prettier/parser-typescript'),\n        typeScriptParser,\n        // require('prettier/parser-postcss'),\n        postCssParser,\n        // require('prettier/parser-html'),\n        htmlParser,\n        // require('prettier/parser-babel'),\n        babelParser,\n      ],\n      htmlWhitespaceSensitivity: 'ignore',\n    });\n  } catch (e) {\n    throw new Error(\n      e +\n        '\\n' +\n        '========================================================================\\n' +\n        source +\n        '\\n\\n========================================================================'\n    );\n  }\n  return source;\n}\n"
  },
  {
    "path": "packages/qwik-labs/src-vite/qwik-types/vite.ts",
    "content": "import { readdir, stat } from 'node:fs/promises';\nimport { join, sep } from 'node:path';\nimport { type Plugin } from 'vite';\nimport { generateRouteTypes } from './generator';\n\nexport function qwikTypes(): Plugin {\n  const srcFolder = join(process.cwd(), 'src');\n  const routesFolder = join(srcFolder, 'routes');\n  return {\n    name: 'Qwik Type Generator',\n    async buildStart() {\n      await regenerateRoutes(srcFolder, routesFolder);\n    },\n  };\n}\n\nasync function regenerateRoutes(srcDir: string, routesDir: string): Promise<Set<string>> {\n  assertDirectoryExists(srcDir);\n  assertDirectoryExists(routesDir);\n  const routes: string[] = [];\n  await collectRoutes(routesDir, routesDir, routes);\n  routes.sort();\n  generateRouteTypes(srcDir, routesDir, routes);\n  const seenRoutes = new Set<string>();\n  routes.forEach((route) => seenRoutes.add(join(routesDir, route, `index.tsx`)));\n  return seenRoutes;\n}\n\nasync function assertDirectoryExists(directoryPath: string) {\n  try {\n    const stats = await stat(directoryPath);\n    if (!stats.isDirectory()) {\n      throw new Error(`${directoryPath} is not a directory.`);\n    }\n  } catch (error) {\n    throw new Error(`Directory ${directoryPath} does not exist.`);\n  }\n}\n\nfunction getRouteDirectory(id: string): string | null {\n  const lastSlash = id.lastIndexOf(sep);\n  const filename = id.substring(lastSlash + 1);\n  if (\n    filename.endsWith('index.md') ||\n    filename.endsWith('index.mdx') ||\n    filename.endsWith('index.js') ||\n    filename.endsWith('index.jsx') ||\n    filename.endsWith('index.ts') ||\n    filename.endsWith('index.tsx')\n  ) {\n    return id.substring(0, lastSlash + 1);\n  }\n  return null;\n}\n\nasync function collectRoutes(base: string, directoryPath: string, routes: string[]) {\n  const files = await readdir(directoryPath);\n  for (let i = 0; i < files.length; i++) {\n    const filePath = join(directoryPath, files[i]);\n    const fileStat = await stat(filePath);\n\n    let route: string | null;\n    if (fileStat.isDirectory()) {\n      await collectRoutes(base, filePath, routes);\n    } else if ((route = getRouteDirectory(filePath)) !== null) {\n      routes.push(route.substring(base.length).replaceAll(sep, '/'));\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik-labs/tsconfig-vite.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"target\": \"ES2021\",\n    \"module\": \"ES2020\",\n    \"lib\": [\"es2021\", \"DOM\"],\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"outDir\": \"vite\",\n    \"declarationDir\": \"vite\",\n    \"types\": [\"node\", \"vite/client\"]\n  },\n  \"files\": [\"src-vite/index.ts\"]\n}\n"
  },
  {
    "path": "packages/qwik-labs/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"noEmit\": true,\n    \"target\": \"ES2021\",\n    \"module\": \"ES2020\",\n    \"lib\": [\"es2021\", \"DOM\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"types\": [\"vite/client\"],\n    \"paths\": {\n      \"@qwik-client-manifest\": [\"../../qwik/src/server/server-modules.d.ts\"]\n    }\n  },\n  \"include\": [\"src\"],\n  \"exclude\": [\"node_modules\", \"lib\"]\n}\n"
  },
  {
    "path": "packages/qwik-labs/vite.config-src-vite.mts",
    "content": "import { defineConfig } from 'vite';\nimport dtsPlugin from 'vite-plugin-dts';\n\nexport default defineConfig(() => {\n  return {\n    ssr: {\n      external: true,\n    },\n    build: {\n      ssr: true,\n      target: 'es2021',\n      outDir: 'vite',\n      lib: {\n        entry: './src-vite',\n        formats: ['es', 'cjs'],\n        fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n    },\n    plugins: [\n      dtsPlugin({\n        // rollupTypes: true,\n        tsconfigPath: 'tsconfig-vite.json',\n        logLevel: 'info',\n        outDir: 'vite',\n      }),\n    ],\n  };\n});\n"
  },
  {
    "path": "packages/qwik-labs/vite.config.mts",
    "content": "import { defineConfig } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\nimport dtsPlugin from 'vite-plugin-dts';\nimport { compiledStringPlugin } from '../../scripts/compiled-string-plugin.js';\n\nexport default defineConfig(() => {\n  return {\n    build: {\n      target: 'es2021',\n      lib: {\n        entry: './src/index.ts',\n        formats: ['es', 'cjs'],\n        fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n      rollupOptions: {\n        external: ['zod'],\n      },\n    },\n    plugins: [qwikVite(), dtsPlugin(), compiledStringPlugin()],\n  };\n});\n"
  },
  {
    "path": "packages/qwik-react/.npmignore",
    "content": "src\nvite\n"
  },
  {
    "path": "packages/qwik-react/CHANGELOG.md",
    "content": "# @builder.io/qwik-react\n\n## 0.5.8\n\n### Patch Changes\n\n- execute cleanup cb for all component tree while calling dispose.cleanup method returned by render fn (by [@sashkashishka](https://github.com/sashkashishka) in [#8164](https://github.com/QwikDev/qwik/pull/8164))\n\n- Updated dependencies [[`494d27c`](https://github.com/QwikDev/qwik/commit/494d27cddee49875d0b2776236d4c49da15e47b3), [`7d62aa2`](https://github.com/QwikDev/qwik/commit/7d62aa21b1b2f82889a331969f6b53cac5b84c6a), [`767c981`](https://github.com/QwikDev/qwik/commit/767c9814e338ba6c443ba88d8ddb2158f2e9a9a9), [`bd6c9b3`](https://github.com/QwikDev/qwik/commit/bd6c9b350815f33abf0c43e3e988c52254a268a3)]:\n  - @builder.io/qwik@1.18.0\n\n## 0.5.7\n\n### Patch Changes\n\n- 🐞🩹 unmount qwikify react root alongside with qwik component (done by @shashkashishka in #7864) (by [@shairez](https://github.com/shairez) in [#8017](https://github.com/QwikDev/qwik/pull/8017))\n\n- Updated dependencies [[`a797237`](https://github.com/QwikDev/qwik/commit/a7972373bb31cebae8eae00843ca246795503372), [`96b3f8e`](https://github.com/QwikDev/qwik/commit/96b3f8e44a8642b4e91705f999d1f01a61cc5a46), [`5f749fa`](https://github.com/QwikDev/qwik/commit/5f749fac92631924601aa2d00f90c991c7ec1b3a), [`f6369a0`](https://github.com/QwikDev/qwik/commit/f6369a097dfa3375cc30f2f950a2f12ff1342494), [`e33abbb`](https://github.com/QwikDev/qwik/commit/e33abbbfaf4130a4b7caf8f3ed93d425b9593a3f), [`04da311`](https://github.com/QwikDev/qwik/commit/04da3112f93c095b4f1114d533c2295edb9441e4), [`e90e5f8`](https://github.com/QwikDev/qwik/commit/e90e5f80e599d5049e652548d52bc4ed84ebf13d)]:\n  - @builder.io/qwik@1.17.0\n"
  },
  {
    "path": "packages/qwik-react/README.md",
    "content": "# Qwik qwik-react ⚡️\n\n- Create a component library\n- Vite.js tooling.\n- Prettier code formatter.\n\n## Development Builds\n\n### Client only\n\nDuring development, the index.html is not a result of server-side rendering, but rather the Qwik app is built using client-side JavaScript only. This is ideal for development with Vite and its ability to reload modules quickly and on-demand. However, this mode is only for development and does not showcase \"how\" Qwik works since JavaScript is required to execute, and Vite imports many development modules for the app to work.\n\n```\nnpm run dev\n```\n\n### Server-side Rendering (SSR) and Client\n\nServer-side rendered index.html, with client-side modules prefetched and loaded by the browser. This can be used to test out server-side rendered content during development, but will be slower than the client-only development builds.\n\n```\nnpm run dev.ssr\n```\n\n## Production Builds\n\nA production build should generate the client and server modules by running both client and server build commands.\n\n```\nnpm run build\n```\n\n### Client Modules\n\nProduction build that creates only the client-side modules that are dynamically imported by the browser.\n\n```\nnpm run build.client\n```\n\n### Server Modules\n\nProduction build that creates the server-side render (SSR) module that is used by the server to render the HTML.\n\n```\nnpm run build.server\n```\n\n---\n\n## Related\n\n- [Qwik Docs](https://qwik.dev/docs/)\n- [Qwik on GitHub](https://github.com/QwikDev/qwik)\n- [@QwikDev](https://twitter.com/QwikDev)\n- [Discord](https://qwik.dev/chat)\n- [Vite](https://vitejs.dev/)\n- [Partytown](https://partytown.qwik.dev/)\n- [Mitosis](https://github.com/BuilderIO/mitosis)\n- [Builder.io](https://www.builder.io/)\n"
  },
  {
    "path": "packages/qwik-react/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"bundledPackages\": [],\n  \"docModel\": {\n    \"enabled\": false\n  },\n  \"dtsRollup\": {\n    \"enabled\": false\n  },\n  \"tsdocMetadata\": {\n    \"enabled\": false\n  },\n  \"messages\": {\n    \"compilerMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    },\n    \"extractorMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    },\n    \"tsdocMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"error\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/qwik-react/package.json",
    "content": "{\n  \"name\": \"@builder.io/qwik-react\",\n  \"description\": \"QwikReact allows adding React components into existing Qwik application\",\n  \"version\": \"0.5.8\",\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@types/react\": \"18.3.3\",\n    \"@types/react-dom\": \"18.3.0\",\n    \"react\": \"18.3.1\",\n    \"react-dom\": \"18.3.1\",\n    \"typescript\": \"5.4.5\",\n    \"vite\": \"7.3.1\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./lib/types/index.qwik.d.ts\",\n      \"import\": \"./lib/index.qwik.mjs\",\n      \"require\": \"./lib/index.qwik.cjs\"\n    },\n    \"./vite\": {\n      \"types\": \"./lib/types/vite.d.ts\",\n      \"import\": \"./lib/vite.mjs\",\n      \"require\": \"./lib/vite.cjs\"\n    }\n  },\n  \"files\": [\n    \"lib\",\n    \"vite\"\n  ],\n  \"homepage\": \"https://qwik.dev/\",\n  \"license\": \"MIT\",\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"peerDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@types/react\": \"^18\",\n    \"@types/react-dom\": \"^18\",\n    \"react\": \"^18\",\n    \"react-dom\": \"^18\",\n    \"vite\": \">=5 <8\"\n  },\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/qwik-react\"\n  },\n  \"scripts\": {\n    \"build\": \"npm run build.lib\",\n    \"build.client\": \"vite build\",\n    \"build.lib\": \"vite build --mode lib\",\n    \"build.ssr\": \"vite build --ssr src/entry.ssr.tsx\",\n    \"dev\": \"vite\",\n    \"dev.debug\": \"node --inspect-brk ../../node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"dev.ssr\": \"vite --mode ssr\",\n    \"fmt\": \"prettier --write .\",\n    \"fmt.check\": \"prettier --check .\",\n    \"lint\": \"eslint \\\"src/**/*.ts*\\\"\",\n    \"lint.fix\": \"eslint --fix \\\"src/**/*.ts*\\\"\",\n    \"release\": \"pnpm run -w build.local && pnpm publish\",\n    \"start\": \"npm run dev\",\n    \"typecheck\": \"tsc --noEmit\"\n  },\n  \"sideEffects\": false,\n  \"type\": \"module\",\n  \"types\": \"./lib/types/index.qwik.d.ts\"\n}\n"
  },
  {
    "path": "packages/qwik-react/src/api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"extends\": \"../api-extractor.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/dist-dev/dts-out/packages/qwik-react/src/index.d.ts\",\n  \"newlineKind\": \"lf\",\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFileName\": \"qwik-react.\",\n    \"reportFolder\": \"<projectFolder>/packages/qwik-react/src/\",\n    \"reportTempFolder\": \"<projectFolder>/dist-dev/api-extractor/qwik-react\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": true,\n    \"untrimmedFilePath\": \"<projectFolder>/packages/qwik-react/lib/types/index.d.ts\"\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"<projectFolder>/dist-dev/api/qwik-react/docs.api.json\"\n  }\n}\n"
  },
  {
    "path": "packages/qwik-react/src/entry.dev.tsx",
    "content": "import { render, type RenderOptions } from '@builder.io/qwik';\nimport { Root } from './root';\n\n/**\n * Development entry point using only client-side modules:\n *\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "packages/qwik-react/src/entry.ssr.tsx",
    "content": "import { renderToStream, type RenderToStreamOptions } from '@builder.io/qwik/server';\nimport { Root } from './root';\n\n/** Server-Side Render method to be called by a server. */\nexport default function (opts: RenderToStreamOptions) {\n  // Render the Root component to a string\n  // Pass in the manifest that was generated from the client build\n  return renderToStream(<Root />, opts);\n}\n"
  },
  {
    "path": "packages/qwik-react/src/examples/app.tsx",
    "content": "/** @jsxImportSource react */\n\nimport { qwikify$ } from '../react/qwikify';\n\nexport const App = qwikify$(() => {\n  return (\n    <>\n      <div>hola</div>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/qwik-react/src/index.qwik.ts",
    "content": "export { qwikify$, qwikifyQrl } from './react/qwikify';\n\nexport type { QwikifyProps } from './react/types';\n"
  },
  {
    "path": "packages/qwik-react/src/react/client.tsx",
    "content": "export { createRoot, hydrateRoot } from 'react-dom/client';\nexport { flushSync } from 'react-dom';\n"
  },
  {
    "path": "packages/qwik-react/src/react/qwikify.tsx",
    "content": "import {\n  component$,\n  implicit$FirstArg,\n  type NoSerialize,\n  noSerialize,\n  type QRL,\n  useTask$,\n  SkipRender,\n  useSignal,\n  Slot,\n  RenderOnce,\n  useStylesScoped$,\n} from '@builder.io/qwik';\n\nimport { isBrowser, isServer } from '@builder.io/qwik';\nimport type { Root } from 'react-dom/client';\nimport type { FunctionComponent as ReactFC } from 'react';\nimport * as client from './client';\nimport { renderFromServer } from './server-render';\nimport { getHostProps, main, mainExactProps, useWakeupSignal } from './slot';\nimport type { Internal, QwikifyOptions, QwikifyProps } from './types';\n\nexport function qwikifyQrl<PROPS extends Record<any, any>>(\n  reactCmp$: QRL<ReactFC<PROPS & { children?: any }>>,\n  opts?: QwikifyOptions\n) {\n  return component$((props: QwikifyProps<PROPS>) => {\n    const { scopeId } = useStylesScoped$(\n      `q-slot{display:none} q-slotc,q-slotc>q-slot{display:contents}`\n    );\n    const hostRef = useSignal<Element>();\n    const slotRef = useSignal<Element>();\n    const internalState = useSignal<NoSerialize<Internal<PROPS>>>();\n    const [signal, isClientOnly] = useWakeupSignal(props, opts);\n    const hydrationKeys = {};\n    const TagName = opts?.tagName ?? ('qwik-react' as any);\n\n    // Task takes cares of updates and partial hydration\n    useTask$(async ({ track }) => {\n      const trackedProps = track(() => ({ ...props }));\n      track(signal);\n\n      if (!isBrowser) {\n        return;\n      }\n\n      // Update\n      if (internalState.value) {\n        if (internalState.value.root) {\n          internalState.value.root.render(\n            main(slotRef.value, scopeId, internalState.value.cmp, trackedProps)\n          );\n        }\n      } else {\n        let root: Root | undefined = undefined;\n        const Cmp = await reactCmp$.resolve();\n        const hostElement = hostRef.value;\n        if (hostElement) {\n          // hydration\n          if (isClientOnly) {\n            root = client.createRoot(hostElement);\n          } else {\n            root = client.flushSync(() => {\n              return client.hydrateRoot(\n                hostElement,\n                mainExactProps(slotRef.value, scopeId, Cmp, hydrationKeys)\n              );\n            });\n          }\n          if (isClientOnly || signal.value === false) {\n            root.render(main(slotRef.value, scopeId, Cmp, trackedProps));\n          }\n        }\n        internalState.value = noSerialize({\n          cmp: Cmp,\n          root,\n        });\n      }\n    });\n\n    useTask$(({ track, cleanup }) => {\n      track(signal);\n\n      if (isBrowser) {\n        cleanup(() => {\n          internalState.value?.root?.unmount();\n        });\n      }\n    });\n\n    if (isServer && !isClientOnly) {\n      const jsx = renderFromServer(\n        TagName,\n        reactCmp$,\n        scopeId,\n        props,\n        hostRef,\n        slotRef,\n        hydrationKeys\n      );\n      return <RenderOnce key={2}>{jsx}</RenderOnce>;\n    }\n\n    return (\n      <RenderOnce>\n        <TagName\n          {...getHostProps(props)}\n          ref={(el: Element) => {\n            if (isBrowser) {\n              queueMicrotask(() => {\n                const internalData = internalState.value;\n                if (internalData && !internalData.root) {\n                  const root = (internalData.root = client.createRoot(el));\n                  root.render(main(slotRef.value, scopeId, internalData.cmp, props));\n                }\n              });\n            } else {\n              hostRef.value = el;\n            }\n          }}\n        >\n          {SkipRender}\n        </TagName>\n        <q-slot ref={slotRef}>\n          <Slot></Slot>\n        </q-slot>\n      </RenderOnce>\n    );\n  });\n}\n\nexport const qwikify$ = /*#__PURE__*/ implicit$FirstArg(qwikifyQrl);\n"
  },
  {
    "path": "packages/qwik-react/src/react/server-render.tsx",
    "content": "import { type QRL, type Signal, Slot, SSRRaw, SSRStream } from '@builder.io/qwik';\nimport { getHostProps, mainExactProps, getReactProps } from './slot';\nimport { renderToString } from 'react-dom/server';\nimport { isServer } from '@builder.io/qwik';\n\nexport async function renderFromServer(\n  Host: any,\n  reactCmp$: QRL<any>,\n  scopeId: string,\n  props: Record<string, any>,\n  ref: Signal<Element | undefined>,\n  slotRef: Signal<Element | undefined>,\n  hydrationProps: Record<string, any>\n) {\n  if (isServer) {\n    const Cmp = await reactCmp$.resolve();\n\n    const newProps = getReactProps(props);\n    Object.assign(hydrationProps, newProps);\n    const html = renderToString(mainExactProps(undefined, scopeId, Cmp, newProps));\n    const index = html.indexOf('<!--SLOT-->');\n    if (index > 0) {\n      const part1 = html.slice(0, index);\n      const part2 = html.slice(index + '<!--SLOT-->'.length);\n      return (\n        <Host ref={ref} {...getHostProps(props)}>\n          <SSRStream>\n            {async function* () {\n              yield <SSRRaw data={part1} />;\n              yield (\n                <q-slot ref={slotRef}>\n                  <Slot />\n                </q-slot>\n              );\n              yield <SSRRaw data={part2} />;\n            }}\n          </SSRStream>\n        </Host>\n      );\n    }\n    return (\n      <>\n        <Host ref={ref}>\n          <SSRRaw data={html}></SSRRaw>\n        </Host>\n        <q-slot ref={slotRef}>\n          <Slot />\n        </q-slot>\n      </>\n    );\n  }\n}\n"
  },
  {
    "path": "packages/qwik-react/src/react/slot.ts",
    "content": "import { $, useOn, useOnDocument, useSignal } from '@builder.io/qwik';\nimport { isServer } from '@builder.io/qwik';\nimport { Component, createContext, createElement, createRef } from 'react';\nimport type { QwikifyOptions, QwikifyProps } from './types';\n\ninterface SlotState {\n  el?: Element;\n  scopeId: string;\n  attachedEl?: Element;\n}\nconst SlotCtx = createContext<SlotState>({ scopeId: '' });\n\nexport function main(slotEl: Element | undefined, scopeId: string, RootCmp: any, props: any) {\n  const newProps = getReactProps(props);\n  return mainExactProps(slotEl, scopeId, RootCmp, newProps);\n}\n\nexport function mainExactProps(\n  slotEl: Element | undefined,\n  scopeId: string,\n  RootCmp: any,\n  props: any\n) {\n  return createElement(SlotCtx.Provider, {\n    value: {\n      el: slotEl,\n      scopeId,\n      attachedEl: undefined,\n    },\n    children: createElement(RootCmp, {\n      ...props,\n      children: createElement(SlotElement, null),\n    }),\n  });\n}\n\nexport class SlotElement extends Component {\n  static contextType = SlotCtx;\n  declare context: React.ContextType<typeof SlotCtx>;\n\n  slotC = createRef<Element>();\n\n  shouldComponentUpdate(): boolean {\n    return false;\n  }\n\n  componentDidMount(): void {\n    const slotC = this.slotC.current;\n    if (slotC) {\n      const { attachedEl, el } = this.context;\n      if (el) {\n        if (!attachedEl) {\n          slotC.appendChild(el);\n        } else if (attachedEl !== slotC) {\n          throw new Error('already attached');\n        }\n      }\n    }\n  }\n\n  render() {\n    return createElement('q-slotc', {\n      class: this.context.scopeId,\n      suppressHydrationWarning: true,\n      dangerouslySetInnerHTML: { __html: '<!--SLOT-->' },\n      ref: this.slotC,\n    });\n  }\n}\n\nexport const getReactProps = (props: Record<string, any>): Record<string, any> => {\n  const obj: Record<string, any> = {};\n  Object.keys(props).forEach((key) => {\n    if (!key.startsWith('client:') && !key.startsWith('qwik:') && !key.startsWith(HOST_PREFIX)) {\n      const normalizedKey = key.endsWith('$') ? key.slice(0, -1) : key;\n      obj[normalizedKey] = props[key];\n    }\n  });\n  return obj;\n};\n\nexport const getHostProps = (props: Record<string, any>): Record<string, any> => {\n  const obj: Record<string, any> = {};\n  Object.keys(props).forEach((key) => {\n    if (key.startsWith(HOST_PREFIX)) {\n      obj[key.slice(HOST_PREFIX.length)] = props[key];\n    }\n  });\n  return obj;\n};\n\nexport const useWakeupSignal = (props: QwikifyProps<{}>, opts: QwikifyOptions = {}) => {\n  const signal = useSignal(false);\n  const activate = $(() => (signal.value = true));\n  const clientOnly = !!(props['client:only'] || props['qwik:only'] || opts?.clientOnly);\n\n  /*\n    qwik:* is an alias so that it can be used in meta-frameworks that also use client:* directives.\n  */\n  const clientVisible =\n    props['client:visible'] || props['qwik:visible'] || opts?.eagerness === 'visible';\n\n  const clientIdle = props['client:idle'] || props['qwik:idle'] || opts?.eagerness === 'idle';\n\n  const clientLoad =\n    props['client:load'] || props['qwik:load'] || clientOnly || opts?.eagerness === 'load';\n\n  const clientHover = props['client:hover'] || props['qwik:hover'] || opts?.eagerness === 'hover';\n\n  const clientEvent = props['client:event'] || props['qwik:event'];\n\n  if (isServer) {\n    if (clientVisible) {\n      useOn('qvisible', activate);\n    }\n    if (clientIdle) {\n      useOnDocument('qidle', activate);\n    }\n    if (clientLoad) {\n      useOnDocument('qinit', activate);\n    }\n    if (clientHover) {\n      useOn('mouseover', activate);\n    }\n    if (clientEvent) {\n      useOn(clientEvent, activate);\n    }\n    if (opts?.event) {\n      useOn(opts?.event, activate);\n    }\n  }\n  return [signal, clientOnly, activate] as const;\n};\n\nconst HOST_PREFIX = 'host:';\n"
  },
  {
    "path": "packages/qwik-react/src/react/types.ts",
    "content": "import type { QRL, Signal } from '@builder.io/qwik';\nimport type { FunctionComponent as ReactFC } from 'react';\nimport type { Root } from 'react-dom/client';\n\nexport interface Internal<PROPS> {\n  root: Root | undefined;\n  cmp: ReactFC<PROPS>;\n}\n\nexport interface QwikifyBase {\n  /**\n   * The component eagerly hydrates when the document loads.\n   *\n   * **Use case:** Immediately-visible UI elements that need to be interactive as soon as possible.\n   */\n  'client:load'?: boolean;\n  'qwik:load'?: boolean;\n\n  /**\n   * The component eagerly hydrates when the browser first become idle, ie, when everything\n   * important as already run before.\n   *\n   * **Use case:** Lower-priority UI elements that don’t need to be immediately interactive.\n   */\n  'client:idle'?: boolean;\n  'qwik:idle'?: boolean;\n\n  /**\n   * The component eagerly hydrates when it becomes visible in the viewport.\n   *\n   * **Use case:** Low-priority UI elements that are either far down the page (“below the fold”) or\n   * so resource-intensive to load that you would prefer not to load them at all if the user never\n   * saw the element.\n   */\n  'client:visible'?: boolean;\n  'qwik:visible'?: boolean;\n\n  /**\n   * The component eagerly hydrates when the mouse is over the component.\n   *\n   * **Use case:** Lowest-priority UI elements which interactivity is not crucial, and only needs to\n   * run in desktop.\n   */\n  'client:hover'?: boolean;\n  'qwik:hover'?: boolean;\n\n  /** When `true`, the component will not run in SSR, only in the browser. */\n  'client:only'?: boolean;\n  'qwik:only'?: boolean;\n\n  /**\n   * This is an advanced API that allows to hydrate the component whenever the passed signal becomes\n   * `true`.\n   *\n   * This effectively allows you to implement custom strategies for hydration.\n   */\n  'client:signal'?: Signal<boolean>;\n  'qwik:signal'?: Signal<boolean>;\n\n  /** The component eagerly hydrates when specified DOM events are dispatched. */\n  'client:event'?: string | string[];\n  'qwik:event'?: string | string[];\n\n  /**\n   * Adds a `click` event listener to the host element, this event will be dispatched even if the\n   * react component is not hydrated.\n   */\n  'host:onClick$'?: QRL<(ev: Event) => void>;\n\n  /**\n   * Adds a `blur` event listener to the host element, this event will be dispatched even if the\n   * react component is not hydrated.\n   */\n  'host:onBlur$'?: QRL<(ev: Event) => void>;\n\n  /**\n   * Adds a `focus` event listener to the host element, this event will be dispatched even if the\n   * react component is not hydrated.\n   */\n  'host:onFocus$'?: QRL<(ev: Event) => void>;\n\n  /**\n   * Adds a `mouseover` event listener to the host element, this event will be dispatched even if\n   * the react component is not hydrated.\n   */\n  'host:onMouseOver$'?: QRL<(ev: Event) => void>;\n\n  children?: any;\n}\n\nexport type TransformProps<PROPS extends Record<any, any>> = {\n  [K in keyof PROPS as K extends `on${string}` ? `${K}$` : K]: PROPS[K];\n};\n\nexport type QwikifyProps<PROPS extends Record<any, any>> = TransformProps<PROPS> & QwikifyBase;\n\nexport interface QwikifyOptions {\n  tagName?: string;\n  eagerness?: 'load' | 'visible' | 'idle' | 'hover';\n  event?: string | string[];\n  clientOnly?: boolean;\n}\n"
  },
  {
    "path": "packages/qwik-react/src/root.tsx",
    "content": "import { component$ } from '@builder.io/qwik';\nimport { App } from './examples/app';\n\nexport const Root = component$(() => {\n  return (\n    <>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik Blank App</title>\n        <style>\n          {`\n            box {\n              display: block;\n              width: 200px;\n              height: 200px;\n              margin: 20px;\n              background: blue;\n            }\n          `}\n        </style>\n      </head>\n      <body>\n        <box />\n        <box />\n        <box />\n        <box />\n        <box />\n        <box />\n        <box />\n        <box />\n        <box />\n        <box />\n        <box />\n        <App client:visible />\n      </body>\n    </>\n  );\n});\n"
  },
  {
    "path": "packages/qwik-react/src/vite.ts",
    "content": "export function qwikReact(): any {\n  const OPTIMIZE_DEPS = [\n    'react',\n    'react-dom',\n    'react-dom/client',\n    'react-dom/server',\n    'react/jsx-runtime',\n    'react/jsx-dev-runtime',\n  ];\n  const DEDUPE = ['react', 'react-dom'];\n\n  return {\n    name: 'vite-plugin-qwik-react',\n    config() {\n      return {\n        resolve: {\n          dedupe: DEDUPE,\n        },\n        optimizeDeps: {\n          include: OPTIMIZE_DEPS,\n        },\n      };\n    },\n  };\n}\n"
  },
  {
    "path": "packages/qwik-react/vite.config.mts",
    "content": "import { defineConfig } from 'vite';\nimport { qwikVite } from '@builder.io/qwik/optimizer';\n\nexport default defineConfig(() => {\n  return {\n    build: {\n      minify: false,\n      target: 'es2020',\n      lib: {\n        entry: ['./src/index.qwik.ts', './src/vite.ts'],\n        formats: ['es', 'cjs'],\n        fileName: (format, entryName) => `${entryName}.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n      rollupOptions: {\n        external: [\n          'react',\n          'react/jsx-runtime',\n          'react/jsx-dev-runtime',\n          'react-dom',\n          'react-dom/client',\n          'react-dom/server',\n        ],\n      },\n    },\n    plugins: [qwikVite()],\n  };\n});\n"
  },
  {
    "path": "packages/qwik-react/vite.d.ts",
    "content": "// re-export for typescript in old resolution mode\nexport * from './lib/types/vite';\n"
  },
  {
    "path": "packages/qwik-worker/.npmignore",
    "content": "src\n"
  },
  {
    "path": "packages/qwik-worker/package.json",
    "content": "{\n  \"name\": \"@builder.io/qwik-worker\",\n  \"description\": \"Qwik Worker allows to use Web Worker with worker$. Experimental.\",\n  \"version\": \"0.0.1\",\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"vite\": \"7.3.1\",\n    \"vite-plugin-static-copy\": \"3.1.2\"\n  },\n  \"engines\": {\n    \"node\": \">=16.8.0 <18.0.0 || >=18.11\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./lib/types/index.d.ts\",\n      \"import\": \"./lib/index.qwik.mjs\"\n    }\n  },\n  \"files\": [\n    \"lib\"\n  ],\n  \"homepage\": \"https://qwik.dev/\",\n  \"license\": \"MIT\",\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"peerDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\"\n  },\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/qwik-worker\"\n  },\n  \"scripts\": {\n    \"build\": \"vite build --mode lib\"\n  },\n  \"sideEffects\": false,\n  \"type\": \"module\",\n  \"types\": \"./lib/types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/qwik-worker/src/index.ts",
    "content": "import {\n  $,\n  implicit$FirstArg,\n  type QRL,\n  _getContextElement,\n  _serializeData,\n} from '@builder.io/qwik';\n\n//@ts-ignore\nimport workerUrl from './worker.js?worker&url';\n\nexport interface ServerFunction {\n  (...args: any[]): any;\n}\nexport interface WorkerConstructorQRL {\n  <T extends ServerFunction>(fnQrl: QRL<T>): QRL<T>;\n}\n\nconst qwikWorkers = new Map<string, Worker>();\nlet workerRequests = 0;\n\nconst getWorkerRequest = () => {\n  workerRequests++;\n  return workerRequests;\n};\n\nconst getWorker = (qrl: QRL) => {\n  let worker = qwikWorkers.get(qrl.getHash());\n  if (!worker) {\n    qwikWorkers.set(\n      qrl.getHash(),\n      (worker = new Worker(workerUrl, {\n        name: `worker$(${qrl.getSymbol()})`,\n        type: 'module',\n      }))\n    );\n  }\n  return worker;\n};\n\nexport const workerQrl: WorkerConstructorQRL = (qrl) => {\n  return $(async (...args: any[]) => {\n    const containerEl =\n      (_getContextElement() as HTMLElement | undefined)?.closest('[q\\\\:container]') ??\n      document.documentElement;\n    const worker = getWorker(qrl);\n    const requestId = getWorkerRequest();\n    const qbase = containerEl.getAttribute('q:base') ?? '/';\n    const baseURI = document.baseURI;\n    const filtered = args.map((arg) => {\n      if (arg instanceof SubmitEvent && arg.target instanceof HTMLFormElement) {\n        return new FormData(arg.target);\n      } else if (arg instanceof Event) {\n        return null;\n      } else if (arg instanceof Node) {\n        return null;\n      }\n      return arg;\n    });\n    const data = await _serializeData([qrl, ...filtered], false);\n    return new Promise((resolve, reject) => {\n      const handler = ({ data }: MessageEvent) => {\n        if (Array.isArray(data) && data.length === 3 && data[0] === requestId) {\n          worker.removeEventListener('message', handler);\n          if (data[1] === true) {\n            resolve(data[2]);\n          } else {\n            reject(data[2]);\n          }\n        }\n      };\n      worker.addEventListener('message', handler);\n      worker.postMessage([requestId, baseURI, qbase, data]);\n    });\n  }) as any;\n};\n\nexport const worker$ = implicit$FirstArg(workerQrl);\n"
  },
  {
    "path": "packages/qwik-worker/src/worker.js",
    "content": "import { _deserializeData } from '@builder.io/qwik';\n\nglobalThis.document = {\n  nodeType: 9,\n  ownerDocument: undefined,\n  dispatchEvent() {\n    return true;\n  },\n  createElement() {\n    return {\n      nodeType: 1,\n    };\n  },\n};\n\nglobalThis.onmessage = async ({ data }) => {\n  const requestId = data[0];\n  const baseURI = data[1];\n  const qBase = data[2];\n  const containerEl = {\n    nodeType: 1,\n    ownerDocument: {\n      baseURI,\n    },\n    closest() {\n      return containerEl;\n    },\n    getAttribute(name) {\n      return name === 'q:base' ? qBase : undefined;\n    },\n  };\n  try {\n    const [qrl, ...args] = _deserializeData(data[3], containerEl);\n    const output = await qrl.apply(undefined, args);\n    self.postMessage([requestId, true, output]);\n  } catch (err) {\n    self.postMessage([requestId, false, err]);\n    return;\n  }\n};\n"
  },
  {
    "path": "packages/qwik-worker/vite.config.ts",
    "content": "import { qwikVite } from '@builder.io/qwik/optimizer';\nimport { defineConfig } from 'vite';\nimport { viteStaticCopy } from 'vite-plugin-static-copy';\n\nexport default defineConfig(() => {\n  return {\n    build: {\n      minify: false,\n      target: 'es2022',\n      outDir: 'lib',\n      lib: {\n        entry: ['./src/index.ts'],\n        formats: ['es'],\n        fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n      rollupOptions: {\n        external: (id) => {\n          if (\n            ['@builder.io/qwik', '@builder.io/qwik-city', '@builder.io/qwik/build'].includes(id)\n          ) {\n            return true;\n          }\n          if (id.endsWith('worker.js?worker&url')) {\n            return true;\n          }\n          return false;\n        },\n      },\n    },\n    plugins: [\n      qwikVite(),\n      viteStaticCopy({\n        targets: [\n          {\n            src: 'src/worker.js',\n            dest: '.',\n          },\n        ],\n      }),\n    ],\n  };\n}) as any;\n"
  },
  {
    "path": "packages/supabase-auth-helpers-qwik/README.md",
    "content": "# @supabase/auth-helpers-qwik (BETA)\n\nThis submodule provides convenience helpers for implementing user authentication in Qwik applications.\n"
  },
  {
    "path": "packages/supabase-auth-helpers-qwik/package.json",
    "content": "{\n  \"name\": \"supabase-auth-helpers-qwik\",\n  \"description\": \"A collection of Qwik framework specific Auth utilities for working with Supabase.\",\n  \"version\": \"0.0.3\",\n  \"author\": \"Qwik Team\",\n  \"bugs\": \"https://github.com/QwikDev/qwik/issues\",\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"workspace:^\",\n    \"@builder.io/qwik-city\": \"workspace:^\",\n    \"@supabase/ssr\": \"0.6.1\",\n    \"@supabase/supabase-js\": \"2.53.0\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./lib/types/index.d.ts\",\n      \"import\": \"./lib/index.qwik.mjs\",\n      \"require\": \"./lib/index.qwik.cjs\"\n    }\n  },\n  \"files\": [\n    \"lib\"\n  ],\n  \"homepage\": \"https://qwik.dev/\",\n  \"keywords\": [\n    \"Auth\",\n    \"Qwik\",\n    \"Supabase\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"peerDependencies\": {\n    \"@supabase/supabase-js\": \"^2.49.4\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/QwikDev/qwik.git\",\n    \"directory\": \"packages/supabase-auth-helpers-qwik\"\n  },\n  \"scripts\": {\n    \"build\": \"vite build --mode lib\"\n  },\n  \"type\": \"module\",\n  \"types\": \"./lib/types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/supabase-auth-helpers-qwik/src/ambient.d.ts",
    "content": "// these variables are defined by tsup\ndeclare const PACKAGE_NAME: string;\ndeclare const PACKAGE_VERSION: string;\n"
  },
  {
    "path": "packages/supabase-auth-helpers-qwik/src/index.ts",
    "content": "// Methods\nexport { createBrowserClient } from './utils/createBrowserClient';\nexport { createServerClient } from './utils/createServerClient';\n\n// Types\nexport type { Session, User, SupabaseClient } from '@supabase/supabase-js';\n"
  },
  {
    "path": "packages/supabase-auth-helpers-qwik/src/utils/createBrowserClient.ts",
    "content": "import type { SupabaseClient } from '@supabase/supabase-js';\nimport {\n  createBrowserClient as browserClient,\n  type CookieMethodsBrowser,\n  type CookieOptionsWithName,\n} from '@supabase/ssr';\nimport type {\n  GenericSchema,\n  SupabaseClientOptions,\n} from '@supabase/supabase-js/dist/module/lib/types';\n\nexport function createBrowserClient<\n  Database = any,\n  SchemaName extends string & keyof Database = 'public' extends keyof Database\n    ? 'public'\n    : string & keyof Database,\n  Schema extends GenericSchema = Database[SchemaName] extends GenericSchema\n    ? Database[SchemaName]\n    : any,\n>(\n  supabaseUrl: string,\n  supabaseKey: string,\n  options?: SupabaseClientOptions<SchemaName> & {\n    cookies?: CookieMethodsBrowser;\n    cookieOptions?: CookieOptionsWithName;\n    cookieEncoding?: 'raw' | 'base64url';\n    isSingleton?: boolean;\n  }\n): SupabaseClient<Database, SchemaName, Schema> {\n  if (!supabaseUrl || !supabaseKey) {\n    throw new Error(\n      'supabaseUrl and supabaseKey are required to create a Supabase client! Find these under `Settings` > `API` in your Supabase dashboard.'\n    );\n  }\n\n  return browserClient<Database, SchemaName, Schema>(supabaseUrl, supabaseKey, {\n    ...options,\n    global: {\n      ...options?.global,\n      headers: {\n        ...options?.global?.headers,\n        'X-Client-Info': 'supabase-auth-helpers-qwik@0.0.3',\n      },\n    },\n    auth: {\n      storageKey: options?.cookieOptions?.name,\n    },\n  });\n}\n"
  },
  {
    "path": "packages/supabase-auth-helpers-qwik/src/utils/createServerClient.ts",
    "content": "import type { SupabaseClient } from '@supabase/supabase-js';\nimport { createServerClient as serverClient } from '@supabase/ssr';\nimport type { CookieMethodsBrowser, CookieOptionsWithName } from '@supabase/ssr';\nimport type {\n  GenericSchema,\n  SupabaseClientOptions,\n} from '@supabase/supabase-js/dist/module/lib/types';\nimport type { RequestEventBase } from 'packages/qwik-city/lib';\n\nexport function createServerClient<\n  Database = any,\n  SchemaName extends string & keyof Database = 'public' extends keyof Database\n    ? 'public'\n    : string & keyof Database,\n  Schema extends GenericSchema = Database[SchemaName] extends GenericSchema\n    ? Database[SchemaName]\n    : any,\n>(\n  supabaseUrl: string,\n  supabaseKey: string,\n  requestEv: RequestEventBase,\n  options?: SupabaseClientOptions<SchemaName> & {\n    cookies?: CookieMethodsBrowser;\n    cookieOptions?: CookieOptionsWithName;\n    cookieEncoding?: 'raw' | 'base64url';\n    isSingleton?: boolean;\n  }\n): SupabaseClient<Database, SchemaName, Schema> {\n  if (!supabaseUrl || !supabaseKey) {\n    throw new Error(\n      'supabaseUrl and supabaseKey are required to create a Supabase client! Find these under `Settings` > `API` in your Supabase dashboard.'\n    );\n  }\n\n  return serverClient<Database, SchemaName, Schema>(supabaseUrl, supabaseKey, {\n    ...options,\n    global: {\n      ...options?.global,\n      headers: {\n        ...options?.global?.headers,\n        'X-Client-Info': 'supabase-auth-helpers-qwik@0.0.3',\n      },\n    },\n    auth: {\n      storageKey: options?.cookieOptions?.name,\n    },\n    cookies: {\n      getAll: () => {\n        const cookies = requestEv.cookie.getAll();\n        return Object.keys(cookies).map((name) => {\n          return { name, value: cookies[name].value };\n        });\n      },\n      setAll: (cookies) => {\n        cookies.map((cookie) => {\n          requestEv.cookie.set(cookie.name, cookie.value, cookie.options);\n        });\n      },\n    },\n  });\n}\n"
  },
  {
    "path": "packages/supabase-auth-helpers-qwik/vite.config.ts",
    "content": "import { qwikVite } from '@builder.io/qwik/optimizer';\nimport { defineConfig } from 'vite';\nimport pkg from './package.json';\n\nexport default defineConfig((config) => {\n  return {\n    build: {\n      minify: false,\n      target: 'es2020',\n      outDir: 'lib',\n      lib: {\n        entry: ['./src/index.ts'],\n        formats: ['es', 'cjs'],\n        fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,\n      },\n      rollupOptions: {\n        external: [\n          '@builder.io/qwik',\n          '@builder.io/qwik-city',\n          '@builder.io/qwik/build',\n          '@supabase/supabase-js',\n          '@supabase/auth-helpers-shared',\n        ],\n      },\n    },\n    define: {\n      PACKAGE_NAME: JSON.stringify(pkg.name),\n      PACKAGE_VERSION: JSON.stringify(pkg.version),\n    },\n    plugins: [qwikVite()],\n  };\n}) as any;\n"
  },
  {
    "path": "patches/density-clustering@1.3.0.patch",
    "content": "diff --git a/.history/lib/DBSCAN_20231205115425.js b/.history/lib/DBSCAN_20231205115425.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..433b454c8d1e27ed951c7ba53052a4036e25f43d\n--- /dev/null\n+++ b/.history/lib/DBSCAN_20231205115425.js\n@@ -0,0 +1,236 @@\n+/**\r\n+ * DBSCAN - Density based clustering\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * DBSCAN class construcotr\r\n+ * @constructor\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {DBSCAN}\r\n+ */\r\n+function DBSCAN(dataset, epsilon, minPts, distanceFunction) {\r\n+  /** @type {Array} */\r\n+  this.dataset = [];\r\n+  /** @type {number} */\r\n+  this.epsilon = 1;\r\n+  /** @type {number} */\r\n+  this.minPts = 2;\r\n+  /** @type {function} */\r\n+  this.distance = this._euclideanDistance;\r\n+  /** @type {Array} */\r\n+  this.clusters = [];\r\n+  /** @type {Array} */\r\n+  this.noise = [];\r\n+\r\n+  // temporary variables used during computation\r\n+\r\n+  /** @type {Array} */\r\n+  this._visited = [];\r\n+  /** @type {Array} */\r\n+  this._assigned = [];\r\n+  /** @type {number} */\r\n+  this._datasetLength = 0;\r\n+\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// public functions\r\n+\r\n+/**\r\n+ * Start clustering\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+DBSCAN.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+\r\n+  for (var pointId = 0; pointId < this._datasetLength; pointId++) {\r\n+    // if point is not visited, check if it forms a cluster\r\n+    if (this._visited[pointId] !== 1) {\r\n+      this._visited[pointId] = 1;\r\n+\r\n+      // if closest neighborhood is too small to form a cluster, mark as noise\r\n+      var neighbors = this._regionQuery(pointId);\r\n+\r\n+      if (neighbors.length < this.minPts) {\r\n+        this.noise.push(pointId);\r\n+      } else {\r\n+        // create new cluster and add point\r\n+        var clusterId = this.clusters.length;\r\n+        this.clusters.push([]);\r\n+        this._addToCluster(pointId, clusterId);\r\n+\r\n+        this._expandCluster(clusterId, neighbors);\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  return this.clusters;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// protected functions\r\n+\r\n+/**\r\n+ * Set object properties\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distance\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n+\r\n+  if (dataset) {\r\n+\r\n+    if (!(dataset instanceof Array)) {\r\n+      throw Error('Dataset must be of type array, ' +\r\n+        typeof dataset + ' given');\r\n+    }\r\n+\r\n+    this.dataset = dataset;\r\n+    this.clusters = [];\r\n+    this.noise = [];\r\n+\r\n+    this._datasetLength = dataset.length;\r\n+    this._visited = new Array(this._datasetLength);\r\n+    this._assigned = new Array(this._datasetLength);\r\n+  }\r\n+\r\n+  if (epsilon) {\r\n+    this.epsilon = epsilon;\r\n+  }\r\n+\r\n+  if (minPts) {\r\n+    this.minPts = minPts;\r\n+  }\r\n+\r\n+  if (distance) {\r\n+    this.distance = distance;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Expand cluster to closest points of given neighborhood\r\n+ *\r\n+ * @param {number} clusterId\r\n+ * @param {Array} neighbors\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._expandCluster = function(clusterId, neighbors) {\r\n+\r\n+  /**\r\n+   * It's very important to calculate length of neighbors array each time,\r\n+   * as the number of elements changes over time\r\n+   */\r\n+  for (var i = 0; i < neighbors.length; i++) {\r\n+    var pointId2 = neighbors[i];\r\n+\r\n+    if (this._visited[pointId2] !== 1) {\r\n+      this._visited[pointId2] = 1;\r\n+      var neighbors2 = this._regionQuery(pointId2);\r\n+\r\n+      if (neighbors2.length >= this.minPts) {\r\n+        neighbors = this._mergeArrays(neighbors, neighbors2);\r\n+      }\r\n+    }\r\n+\r\n+    // add to cluster\r\n+    if (this._assigned[pointId2] !== 1) {\r\n+      this._addToCluster(pointId2, clusterId);\r\n+    }\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Add new point to cluster\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @param {number} clusterId\r\n+ */\r\n+DBSCAN.prototype._addToCluster = function(pointId, clusterId) {\r\n+  this.clusters[clusterId].push(pointId);\r\n+  this._assigned[pointId] = 1;\r\n+};\r\n+\r\n+/**\r\n+ * Find all neighbors around given point\r\n+ *\r\n+ * @param {number} pointId,\r\n+ * @param {number} epsilon\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._regionQuery = function(pointId) {\r\n+  var neighbors = [];\r\n+\r\n+  for (var id = 0; id < this._datasetLength; id++) {\r\n+    var dist = this.distance(this.dataset[pointId], this.dataset[id]);\r\n+    if (dist < this.epsilon) {\r\n+      neighbors.push(id);\r\n+    }\r\n+  }\r\n+\r\n+  return neighbors;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// helpers\r\n+\r\n+/**\r\n+ * @param {Array} a\r\n+ * @param {Array} b\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._mergeArrays = function(a, b) {\r\n+  var len = b.length;\r\n+\r\n+  for (var i = 0; i < len; i++) {\r\n+    var P = b[i];\r\n+    if (a.indexOf(P) < 0) {\r\n+      a.push(P);\r\n+    }\r\n+  }\r\n+\r\n+  return a;\r\n+};\r\n+\r\n+/**\r\n+ * Calculate euclidean distance in multidimensional space\r\n+ *\r\n+ * @param {Array} p\r\n+ * @param {Array} q\r\n+ * @returns {number}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._euclideanDistance = function(p, q) {\r\n+  var sum = 0;\r\n+  var i = Math.min(p.length, q.length);\r\n+\r\n+  while (i--) {\r\n+    sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n+  }\r\n+\r\n+  return Math.sqrt(sum);\r\n+};\r\n+\r\n+if (typeof module !== 'undefined' && module.exports) {\r\n+  module.exports = DBSCAN;\r\n+}\r\ndiff --git a/.history/lib/DBSCAN_20231205115515.js b/.history/lib/DBSCAN_20231205115515.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..54f8c4438faba26ebafd22ec9d7a228f6dfdef94\n--- /dev/null\n+++ b/.history/lib/DBSCAN_20231205115515.js\n@@ -0,0 +1,236 @@\n+/**\r\n+ * DBSCAN - Density based clustering\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * DBSCAN class construcotr\r\n+ * @constructor\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {DBSCAN}\r\n+ */\r\n+function DBSCAN(dataset, epsilon, minPts, distanceFunction) {\r\n+  /** @type {Array} */\r\n+  this.dataset = [];\r\n+  /** @type {number} */\r\n+  this.epsilon = 1;\r\n+  /** @type {number} */\r\n+  this.minPts = 2;\r\n+  /** @type {function} */\r\n+  this.distance = this._euclideanDistance;\r\n+  /** @type {Array} */\r\n+  this.clusters = [];\r\n+  /** @type {Array} */\r\n+  this.noise = [];\r\n+\r\n+  // temporary variables used during computation\r\n+\r\n+  /** @type {Array} */\r\n+  this._visited = [];\r\n+  /** @type {Array} */\r\n+  this._assigned = [];\r\n+  /** @type {number} */\r\n+  this._datasetLength = 0;\r\n+\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// public functions\r\n+\r\n+/**\r\n+ * Start clustering\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+DBSCAN.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+\r\n+  for (var pointId = 0; pointId < this._datasetLength; pointId++) {\r\n+    // if point is not visited, check if it forms a cluster\r\n+    if (this._visited[pointId] !== 1) {\r\n+      this._visited[pointId] = 1;\r\n+\r\n+      // if closest neighborhood is too small to form a cluster, mark as noise\r\n+      var neighbors = this._regionQuery(pointId);\r\n+\r\n+      if (neighbors.length < this.minPts) {\r\n+        this.noise.push(pointId);\r\n+      } else {\r\n+        // create new cluster and add point\r\n+        var clusterId = this.clusters.length;\r\n+        this.clusters.push([]);\r\n+        this._addToCluster(pointId, clusterId);\r\n+\r\n+        this._expandCluster(clusterId, neighbors);\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  return this.clusters;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// protected functions\r\n+\r\n+/**\r\n+ * Set object properties\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distance\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n+\r\n+  if (dataset) {\r\n+\r\n+    if (!(dataset instanceof Array)) {\r\n+      throw Error('Dataset must be of type array, ' +\r\n+        typeof dataset + ' given');\r\n+    }\r\n+\r\n+    this.dataset = dataset;\r\n+    this.clusters = [];\r\n+    this.noise = [];\r\n+\r\n+    this._datasetLength = dataset.length;\r\n+    this._visited = new Array(this._datasetLength);\r\n+    this._assigned = new Array(this._datasetLength);\r\n+  }\r\n+\r\n+  if (epsilon) {\r\n+    this.epsilon = epsilon;\r\n+  }\r\n+\r\n+  if (minPts) {\r\n+    this.minPts = minPts;\r\n+  }\r\n+\r\n+  if (distance) {\r\n+    this.distance = distance;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Expand cluster to closest points of given neighborhood\r\n+ *\r\n+ * @param {number} clusterId\r\n+ * @param {Array} neighbors\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._expandCluster = function(clusterId, neighbors) {\r\n+\r\n+  /**\r\n+   * It's very important to calculate length of neighbors array each time,\r\n+   * as the number of elements changes over time\r\n+   */\r\n+  for (var i = 0; i < neighbors.length; i++) {\r\n+    var pointId2 = neighbors[i];\r\n+\r\n+    if (this._visited[pointId2] !== 1) {\r\n+      this._visited[pointId2] = 1;\r\n+      var neighbors2 = this._regionQuery(pointId2);\r\n+\r\n+      if (neighbors2.length >= this.minPts) {\r\n+        neighbors = this._mergeArrays(neighbors, neighbors2);\r\n+      }\r\n+    }\r\n+\r\n+    // add to cluster\r\n+    if (this._assigned[pointId2] !== 1) {\r\n+      this._addToCluster(pointId2, clusterId);\r\n+    }\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Add new point to cluster\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @param {number} clusterId\r\n+ */\r\n+DBSCAN.prototype._addToCluster = function(pointId, clusterId) {\r\n+  this.clusters[clusterId].push(pointId);\r\n+  this._assigned[pointId] = 1;\r\n+};\r\n+\r\n+/**\r\n+ * Find all neighbors around given point\r\n+ *\r\n+ * @param {number} pointId,\r\n+ * @param {number} epsilon\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._regionQuery = function(pointId) {\r\n+  var neighbors = [];\r\n+\r\n+  for (var id = 0; id < this._datasetLength; id++) {\r\n+    var dist = this.distance(this.dataset[pointId], this.dataset[id]);\r\n+    if (dist < this.epsilon) {\r\n+      neighbors.push(id);\r\n+    }\r\n+  }\r\n+\r\n+  return neighbors;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// helpers\r\n+\r\n+/**\r\n+ * @param {Array} a\r\n+ * @param {Array} b\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._mergeArrays = function(a, b) {\r\n+  var len = b.length;\r\n+\r\n+  for (var i = 0; i < len; i++) {\r\n+    var P = b[i];\r\n+    if (a.indexOf(P) < 0) {\r\n+      a.push(P);\r\n+    }\r\n+  }\r\n+\r\n+  return a;\r\n+};\r\n+\r\n+/**\r\n+ * Calculate euclidean distance in multidimensional space\r\n+ *\r\n+ * @param {Array} p\r\n+ * @param {Array} q\r\n+ * @returns {number}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._euclideanDistance = function(p, q) {\r\n+  var sum = 0;\r\n+  var i = Math.min(p.length, q.length);\r\n+\r\n+  while (i--) {\r\n+    sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n+  }\r\n+\r\n+  return Math.sqrt(sum);\r\n+};\r\n+\r\n+if (module.exports) {\r\n+  module.exports = DBSCAN;\r\n+}\r\ndiff --git a/.history/lib/DBSCAN_20231205115526.js b/.history/lib/DBSCAN_20231205115526.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..54f8c4438faba26ebafd22ec9d7a228f6dfdef94\n--- /dev/null\n+++ b/.history/lib/DBSCAN_20231205115526.js\n@@ -0,0 +1,236 @@\n+/**\r\n+ * DBSCAN - Density based clustering\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * DBSCAN class construcotr\r\n+ * @constructor\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {DBSCAN}\r\n+ */\r\n+function DBSCAN(dataset, epsilon, minPts, distanceFunction) {\r\n+  /** @type {Array} */\r\n+  this.dataset = [];\r\n+  /** @type {number} */\r\n+  this.epsilon = 1;\r\n+  /** @type {number} */\r\n+  this.minPts = 2;\r\n+  /** @type {function} */\r\n+  this.distance = this._euclideanDistance;\r\n+  /** @type {Array} */\r\n+  this.clusters = [];\r\n+  /** @type {Array} */\r\n+  this.noise = [];\r\n+\r\n+  // temporary variables used during computation\r\n+\r\n+  /** @type {Array} */\r\n+  this._visited = [];\r\n+  /** @type {Array} */\r\n+  this._assigned = [];\r\n+  /** @type {number} */\r\n+  this._datasetLength = 0;\r\n+\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// public functions\r\n+\r\n+/**\r\n+ * Start clustering\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+DBSCAN.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+\r\n+  for (var pointId = 0; pointId < this._datasetLength; pointId++) {\r\n+    // if point is not visited, check if it forms a cluster\r\n+    if (this._visited[pointId] !== 1) {\r\n+      this._visited[pointId] = 1;\r\n+\r\n+      // if closest neighborhood is too small to form a cluster, mark as noise\r\n+      var neighbors = this._regionQuery(pointId);\r\n+\r\n+      if (neighbors.length < this.minPts) {\r\n+        this.noise.push(pointId);\r\n+      } else {\r\n+        // create new cluster and add point\r\n+        var clusterId = this.clusters.length;\r\n+        this.clusters.push([]);\r\n+        this._addToCluster(pointId, clusterId);\r\n+\r\n+        this._expandCluster(clusterId, neighbors);\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  return this.clusters;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// protected functions\r\n+\r\n+/**\r\n+ * Set object properties\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distance\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n+\r\n+  if (dataset) {\r\n+\r\n+    if (!(dataset instanceof Array)) {\r\n+      throw Error('Dataset must be of type array, ' +\r\n+        typeof dataset + ' given');\r\n+    }\r\n+\r\n+    this.dataset = dataset;\r\n+    this.clusters = [];\r\n+    this.noise = [];\r\n+\r\n+    this._datasetLength = dataset.length;\r\n+    this._visited = new Array(this._datasetLength);\r\n+    this._assigned = new Array(this._datasetLength);\r\n+  }\r\n+\r\n+  if (epsilon) {\r\n+    this.epsilon = epsilon;\r\n+  }\r\n+\r\n+  if (minPts) {\r\n+    this.minPts = minPts;\r\n+  }\r\n+\r\n+  if (distance) {\r\n+    this.distance = distance;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Expand cluster to closest points of given neighborhood\r\n+ *\r\n+ * @param {number} clusterId\r\n+ * @param {Array} neighbors\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._expandCluster = function(clusterId, neighbors) {\r\n+\r\n+  /**\r\n+   * It's very important to calculate length of neighbors array each time,\r\n+   * as the number of elements changes over time\r\n+   */\r\n+  for (var i = 0; i < neighbors.length; i++) {\r\n+    var pointId2 = neighbors[i];\r\n+\r\n+    if (this._visited[pointId2] !== 1) {\r\n+      this._visited[pointId2] = 1;\r\n+      var neighbors2 = this._regionQuery(pointId2);\r\n+\r\n+      if (neighbors2.length >= this.minPts) {\r\n+        neighbors = this._mergeArrays(neighbors, neighbors2);\r\n+      }\r\n+    }\r\n+\r\n+    // add to cluster\r\n+    if (this._assigned[pointId2] !== 1) {\r\n+      this._addToCluster(pointId2, clusterId);\r\n+    }\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Add new point to cluster\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @param {number} clusterId\r\n+ */\r\n+DBSCAN.prototype._addToCluster = function(pointId, clusterId) {\r\n+  this.clusters[clusterId].push(pointId);\r\n+  this._assigned[pointId] = 1;\r\n+};\r\n+\r\n+/**\r\n+ * Find all neighbors around given point\r\n+ *\r\n+ * @param {number} pointId,\r\n+ * @param {number} epsilon\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._regionQuery = function(pointId) {\r\n+  var neighbors = [];\r\n+\r\n+  for (var id = 0; id < this._datasetLength; id++) {\r\n+    var dist = this.distance(this.dataset[pointId], this.dataset[id]);\r\n+    if (dist < this.epsilon) {\r\n+      neighbors.push(id);\r\n+    }\r\n+  }\r\n+\r\n+  return neighbors;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// helpers\r\n+\r\n+/**\r\n+ * @param {Array} a\r\n+ * @param {Array} b\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._mergeArrays = function(a, b) {\r\n+  var len = b.length;\r\n+\r\n+  for (var i = 0; i < len; i++) {\r\n+    var P = b[i];\r\n+    if (a.indexOf(P) < 0) {\r\n+      a.push(P);\r\n+    }\r\n+  }\r\n+\r\n+  return a;\r\n+};\r\n+\r\n+/**\r\n+ * Calculate euclidean distance in multidimensional space\r\n+ *\r\n+ * @param {Array} p\r\n+ * @param {Array} q\r\n+ * @returns {number}\r\n+ * @access protected\r\n+ */\r\n+DBSCAN.prototype._euclideanDistance = function(p, q) {\r\n+  var sum = 0;\r\n+  var i = Math.min(p.length, q.length);\r\n+\r\n+  while (i--) {\r\n+    sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n+  }\r\n+\r\n+  return Math.sqrt(sum);\r\n+};\r\n+\r\n+if (module.exports) {\r\n+  module.exports = DBSCAN;\r\n+}\r\ndiff --git a/.history/lib/KMEANS_20231205115425.js b/.history/lib/KMEANS_20231205115425.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..21646f447f20fa710a7d855e597a9b9f9643b2f5\n--- /dev/null\n+++ b/.history/lib/KMEANS_20231205115425.js\n@@ -0,0 +1,213 @@\n+﻿/**\r\n+ * KMEANS clustering\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * KMEANS class constructor\r\n+ * @constructor\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} k - number of clusters\r\n+ * @param {function} distance - distance function\r\n+ * @returns {KMEANS}\r\n+ */\r\n+ function KMEANS(dataset, k, distance) {\r\n+  this.k = 3; // number of clusters\r\n+  this.dataset = []; // set of feature vectors\r\n+  this.assignments = []; // set of associated clusters for each feature vector\r\n+  this.centroids = []; // vectors for our clusters\r\n+\r\n+  this.init(dataset, k, distance);\r\n+}\r\n+\r\n+/**\r\n+ * @returns {undefined}\r\n+ */\r\n+KMEANS.prototype.init = function(dataset, k, distance) {\r\n+  this.assignments = [];\r\n+  this.centroids = [];\r\n+\r\n+  if (typeof dataset !== 'undefined') {\r\n+    this.dataset = dataset;\r\n+  }\r\n+\r\n+  if (typeof k !== 'undefined') {\r\n+    this.k = k;\r\n+  }\r\n+\r\n+  if (typeof distance !== 'undefined') {\r\n+    this.distance = distance;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * @returns {undefined}\r\n+ */\r\n+KMEANS.prototype.run = function(dataset, k) {\r\n+  this.init(dataset, k);\r\n+\r\n+  var len = this.dataset.length;\r\n+\r\n+  // initialize centroids\r\n+  for (var i = 0; i < this.k; i++) {\r\n+    this.centroids[i] = this.randomCentroid();\r\n+\t}\r\n+\r\n+  var change = true;\r\n+  while(change) {\r\n+\r\n+    // assign feature vectors to clusters\r\n+    change = this.assign();\r\n+\r\n+    // adjust location of centroids\r\n+    for (var centroidId = 0; centroidId < this.k; centroidId++) {\r\n+      var mean = new Array(maxDim);\r\n+      var count = 0;\r\n+\r\n+      // init mean vector\r\n+      for (var dim = 0; dim < maxDim; dim++) {\r\n+        mean[dim] = 0;\r\n+      }\r\n+\r\n+      for (var j = 0; j < len; j++) {\r\n+        var maxDim = this.dataset[j].length;\r\n+\r\n+        // if current cluster id is assigned to point\r\n+        if (centroidId === this.assignments[j]) {\r\n+          for (var dim = 0; dim < maxDim; dim++) {\r\n+            mean[dim] += this.dataset[j][dim];\r\n+          }\r\n+          count++;\r\n+        }\r\n+      }\r\n+\r\n+      if (count > 0) {\r\n+        // if cluster contain points, adjust centroid position\r\n+        for (var dim = 0; dim < maxDim; dim++) {\r\n+          mean[dim] /= count;\r\n+        }\r\n+        this.centroids[centroidId] = mean;\r\n+      } else {\r\n+        // if cluster is empty, generate new random centroid\r\n+        this.centroids[centroidId] = this.randomCentroid();\r\n+        change = true;\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  return this.getClusters();\r\n+};\r\n+\r\n+/**\r\n+ * Generate random centroid\r\n+ *\r\n+ * @returns {Array}\r\n+ */\r\n+KMEANS.prototype.randomCentroid = function() {\r\n+  var maxId = this.dataset.length -1;\r\n+  var centroid;\r\n+  var id;\r\n+\r\n+  do {\r\n+    id = Math.round(Math.random() * maxId);\r\n+    centroid = this.dataset[id];\r\n+  } while (this.centroids.indexOf(centroid) >= 0);\r\n+\r\n+  return centroid;\r\n+}\r\n+\r\n+/**\r\n+ * Assign points to clusters\r\n+ *\r\n+ * @returns {boolean}\r\n+ */\r\n+KMEANS.prototype.assign = function() {\r\n+  var change = false;\r\n+  var len = this.dataset.length;\r\n+  var closestCentroid;\r\n+\r\n+  for (var i = 0; i < len; i++) {\r\n+    closestCentroid = this.argmin(this.dataset[i], this.centroids, this.distance);\r\n+\r\n+    if (closestCentroid != this.assignments[i]) {\r\n+      this.assignments[i] = closestCentroid;\r\n+      change = true;\r\n+    }\r\n+  }\r\n+\r\n+  return change;\r\n+}\r\n+\r\n+/**\r\n+ * Extract information about clusters\r\n+ *\r\n+ * @returns {undefined}\r\n+ */\r\n+KMEANS.prototype.getClusters = function() {\r\n+  var clusters = new Array(this.k);\r\n+  var centroidId;\r\n+\r\n+  for (var pointId = 0; pointId < this.assignments.length; pointId++) {\r\n+    centroidId = this.assignments[pointId];\r\n+\r\n+    // init empty cluster\r\n+    if (typeof clusters[centroidId] === 'undefined') {\r\n+      clusters[centroidId] = [];\r\n+    }\r\n+\r\n+    clusters[centroidId].push(pointId);\r\n+  }\r\n+\r\n+  return clusters;\r\n+};\r\n+\r\n+// utils\r\n+\r\n+/**\r\n+ * @params {Array} point\r\n+ * @params {Array.<Array>} set\r\n+ * @params {Function} f\r\n+ * @returns {number}\r\n+ */\r\n+KMEANS.prototype.argmin = function(point, set, f) {\r\n+  var min = Number.MAX_VALUE;\r\n+  var arg = 0;\r\n+  var len = set.length;\r\n+  var d;\r\n+\r\n+  for (var i = 0; i < len; i++) {\r\n+    d = f(point, set[i]);\r\n+    if (d < min) {\r\n+      min = d;\r\n+      arg = i;\r\n+    }\r\n+  }\r\n+\r\n+  return arg;\r\n+};\r\n+\r\n+/**\r\n+ * Euclidean distance\r\n+ *\r\n+ * @params {number} p\r\n+ * @params {number} q\r\n+ * @returns {number}\r\n+ */\r\n+KMEANS.prototype.distance = function(p, q) {\r\n+  var sum = 0;\r\n+  var i = Math.min(p.length, q.length);\r\n+\r\n+  while (i--) {\r\n+    var diff = p[i] - q[i];\r\n+    sum += diff * diff;\r\n+  }\r\n+\r\n+  return Math.sqrt(sum);\r\n+};\r\n+\r\n+if (typeof module !== 'undefined' && module.exports) {\r\n+  module.exports = KMEANS;\r\n+}\r\ndiff --git a/.history/lib/KMEANS_20231205115515.js b/.history/lib/KMEANS_20231205115515.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..a6fab6e802b5ce7c9f7f8ac4183faff29181b22d\n--- /dev/null\n+++ b/.history/lib/KMEANS_20231205115515.js\n@@ -0,0 +1,213 @@\n+﻿/**\r\n+ * KMEANS clustering\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * KMEANS class constructor\r\n+ * @constructor\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} k - number of clusters\r\n+ * @param {function} distance - distance function\r\n+ * @returns {KMEANS}\r\n+ */\r\n+ function KMEANS(dataset, k, distance) {\r\n+  this.k = 3; // number of clusters\r\n+  this.dataset = []; // set of feature vectors\r\n+  this.assignments = []; // set of associated clusters for each feature vector\r\n+  this.centroids = []; // vectors for our clusters\r\n+\r\n+  this.init(dataset, k, distance);\r\n+}\r\n+\r\n+/**\r\n+ * @returns {undefined}\r\n+ */\r\n+KMEANS.prototype.init = function(dataset, k, distance) {\r\n+  this.assignments = [];\r\n+  this.centroids = [];\r\n+\r\n+  if (typeof dataset !== 'undefined') {\r\n+    this.dataset = dataset;\r\n+  }\r\n+\r\n+  if (typeof k !== 'undefined') {\r\n+    this.k = k;\r\n+  }\r\n+\r\n+  if (typeof distance !== 'undefined') {\r\n+    this.distance = distance;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * @returns {undefined}\r\n+ */\r\n+KMEANS.prototype.run = function(dataset, k) {\r\n+  this.init(dataset, k);\r\n+\r\n+  var len = this.dataset.length;\r\n+\r\n+  // initialize centroids\r\n+  for (var i = 0; i < this.k; i++) {\r\n+    this.centroids[i] = this.randomCentroid();\r\n+\t}\r\n+\r\n+  var change = true;\r\n+  while(change) {\r\n+\r\n+    // assign feature vectors to clusters\r\n+    change = this.assign();\r\n+\r\n+    // adjust location of centroids\r\n+    for (var centroidId = 0; centroidId < this.k; centroidId++) {\r\n+      var mean = new Array(maxDim);\r\n+      var count = 0;\r\n+\r\n+      // init mean vector\r\n+      for (var dim = 0; dim < maxDim; dim++) {\r\n+        mean[dim] = 0;\r\n+      }\r\n+\r\n+      for (var j = 0; j < len; j++) {\r\n+        var maxDim = this.dataset[j].length;\r\n+\r\n+        // if current cluster id is assigned to point\r\n+        if (centroidId === this.assignments[j]) {\r\n+          for (var dim = 0; dim < maxDim; dim++) {\r\n+            mean[dim] += this.dataset[j][dim];\r\n+          }\r\n+          count++;\r\n+        }\r\n+      }\r\n+\r\n+      if (count > 0) {\r\n+        // if cluster contain points, adjust centroid position\r\n+        for (var dim = 0; dim < maxDim; dim++) {\r\n+          mean[dim] /= count;\r\n+        }\r\n+        this.centroids[centroidId] = mean;\r\n+      } else {\r\n+        // if cluster is empty, generate new random centroid\r\n+        this.centroids[centroidId] = this.randomCentroid();\r\n+        change = true;\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  return this.getClusters();\r\n+};\r\n+\r\n+/**\r\n+ * Generate random centroid\r\n+ *\r\n+ * @returns {Array}\r\n+ */\r\n+KMEANS.prototype.randomCentroid = function() {\r\n+  var maxId = this.dataset.length -1;\r\n+  var centroid;\r\n+  var id;\r\n+\r\n+  do {\r\n+    id = Math.round(Math.random() * maxId);\r\n+    centroid = this.dataset[id];\r\n+  } while (this.centroids.indexOf(centroid) >= 0);\r\n+\r\n+  return centroid;\r\n+}\r\n+\r\n+/**\r\n+ * Assign points to clusters\r\n+ *\r\n+ * @returns {boolean}\r\n+ */\r\n+KMEANS.prototype.assign = function() {\r\n+  var change = false;\r\n+  var len = this.dataset.length;\r\n+  var closestCentroid;\r\n+\r\n+  for (var i = 0; i < len; i++) {\r\n+    closestCentroid = this.argmin(this.dataset[i], this.centroids, this.distance);\r\n+\r\n+    if (closestCentroid != this.assignments[i]) {\r\n+      this.assignments[i] = closestCentroid;\r\n+      change = true;\r\n+    }\r\n+  }\r\n+\r\n+  return change;\r\n+}\r\n+\r\n+/**\r\n+ * Extract information about clusters\r\n+ *\r\n+ * @returns {undefined}\r\n+ */\r\n+KMEANS.prototype.getClusters = function() {\r\n+  var clusters = new Array(this.k);\r\n+  var centroidId;\r\n+\r\n+  for (var pointId = 0; pointId < this.assignments.length; pointId++) {\r\n+    centroidId = this.assignments[pointId];\r\n+\r\n+    // init empty cluster\r\n+    if (typeof clusters[centroidId] === 'undefined') {\r\n+      clusters[centroidId] = [];\r\n+    }\r\n+\r\n+    clusters[centroidId].push(pointId);\r\n+  }\r\n+\r\n+  return clusters;\r\n+};\r\n+\r\n+// utils\r\n+\r\n+/**\r\n+ * @params {Array} point\r\n+ * @params {Array.<Array>} set\r\n+ * @params {Function} f\r\n+ * @returns {number}\r\n+ */\r\n+KMEANS.prototype.argmin = function(point, set, f) {\r\n+  var min = Number.MAX_VALUE;\r\n+  var arg = 0;\r\n+  var len = set.length;\r\n+  var d;\r\n+\r\n+  for (var i = 0; i < len; i++) {\r\n+    d = f(point, set[i]);\r\n+    if (d < min) {\r\n+      min = d;\r\n+      arg = i;\r\n+    }\r\n+  }\r\n+\r\n+  return arg;\r\n+};\r\n+\r\n+/**\r\n+ * Euclidean distance\r\n+ *\r\n+ * @params {number} p\r\n+ * @params {number} q\r\n+ * @returns {number}\r\n+ */\r\n+KMEANS.prototype.distance = function(p, q) {\r\n+  var sum = 0;\r\n+  var i = Math.min(p.length, q.length);\r\n+\r\n+  while (i--) {\r\n+    var diff = p[i] - q[i];\r\n+    sum += diff * diff;\r\n+  }\r\n+\r\n+  return Math.sqrt(sum);\r\n+};\r\n+\r\n+if (module.exports) {\r\n+  module.exports = KMEANS;\r\n+}\r\ndiff --git a/.history/lib/OPTICS_20231205115425.js b/.history/lib/OPTICS_20231205115425.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..867e081630c3a4ee2d2615d902642e11249f4981\n--- /dev/null\n+++ b/.history/lib/OPTICS_20231205115425.js\n@@ -0,0 +1,269 @@\n+\r\n+/**\r\n+ * @requires ./PriorityQueue.js\r\n+ */\r\n+\r\n+if (typeof module !== 'undefined' && module.exports) {\r\n+      var PriorityQueue = require('./PriorityQueue.js');\r\n+}\r\n+\r\n+/**\r\n+ * OPTICS - Ordering points to identify the clustering structure\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * OPTICS class constructor\r\n+ * @constructor\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {OPTICS}\r\n+ */\r\n+function OPTICS(dataset, epsilon, minPts, distanceFunction) {\r\n+  /** @type {number} */\r\n+  this.epsilon = 1;\r\n+  /** @type {number} */\r\n+  this.minPts = 1;\r\n+  /** @type {function} */\r\n+  this.distance = this._euclideanDistance;\r\n+\r\n+  // temporary variables used during computation\r\n+\r\n+  /** @type {Array} */\r\n+  this._reachability = [];\r\n+  /** @type {Array} */\r\n+  this._processed = [];\r\n+  /** @type {number} */\r\n+  this._coreDistance = 0;\r\n+  /** @type {Array} */\r\n+  this._orderedList = [];\r\n+\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+}\r\n+\r\n+/******************************************************************************/\r\n+// pulic functions\r\n+\r\n+/**\r\n+ * Start clustering\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+OPTICS.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+\r\n+  for (var pointId = 0, l = this.dataset.length; pointId < l; pointId++) {\r\n+    if (this._processed[pointId] !== 1) {\r\n+      this._processed[pointId] = 1;\r\n+      this.clusters.push([pointId]);\r\n+      var clusterId = this.clusters.length - 1;\r\n+\r\n+      this._orderedList.push(pointId);\r\n+      var priorityQueue = new PriorityQueue(null, null, 'asc');\r\n+      var neighbors = this._regionQuery(pointId);\r\n+\r\n+      // using priority queue assign elements to new cluster\r\n+      if (this._distanceToCore(pointId) !== undefined) {\r\n+        this._updateQueue(pointId, neighbors, priorityQueue);\r\n+        this._expandCluster(clusterId, priorityQueue);\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  return this.clusters;\r\n+};\r\n+\r\n+/**\r\n+ * Generate reachability plot for all points\r\n+ *\r\n+ * @returns {array}\r\n+ * @access public\r\n+ */\r\n+OPTICS.prototype.getReachabilityPlot = function() {\r\n+  var reachabilityPlot = [];\r\n+\r\n+  for (var i = 0, l = this._orderedList.length; i < l; i++) {\r\n+    var pointId = this._orderedList[i];\r\n+    var distance = this._reachability[pointId];\r\n+\r\n+    reachabilityPlot.push([pointId, distance]);\r\n+  }\r\n+\r\n+  return reachabilityPlot;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// protected functions\r\n+\r\n+/**\r\n+ * Set object properties\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distance\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n+\r\n+  if (dataset) {\r\n+\r\n+    if (!(dataset instanceof Array)) {\r\n+      throw Error('Dataset must be of type array, ' +\r\n+        typeof dataset + ' given');\r\n+    }\r\n+\r\n+    this.dataset = dataset;\r\n+    this.clusters = [];\r\n+    this._reachability = new Array(this.dataset.length);\r\n+    this._processed = new Array(this.dataset.length);\r\n+    this._coreDistance = 0;\r\n+    this._orderedList = [];\r\n+  }\r\n+\r\n+  if (epsilon) {\r\n+    this.epsilon = epsilon;\r\n+  }\r\n+\r\n+  if (minPts) {\r\n+    this.minPts = minPts;\r\n+  }\r\n+\r\n+  if (distance) {\r\n+    this.distance = distance;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Update information in queue\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @param {Array} neighbors\r\n+ * @param {PriorityQueue} queue\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._updateQueue = function(pointId, neighbors, queue) {\r\n+  var self = this;\r\n+\r\n+  this._coreDistance = this._distanceToCore(pointId);\r\n+  neighbors.forEach(function(pointId2) {\r\n+    if (self._processed[pointId2] === undefined) {\r\n+      var dist = self.distance(self.dataset[pointId], self.dataset[pointId2]);\r\n+      var newReachableDistance = Math.max(self._coreDistance, dist);\r\n+\r\n+      if (self._reachability[pointId2] === undefined) {\r\n+        self._reachability[pointId2] = newReachableDistance;\r\n+        queue.insert(pointId2, newReachableDistance);\r\n+      } else {\r\n+        if (newReachableDistance < self._reachability[pointId2]) {\r\n+          self._reachability[pointId2] = newReachableDistance;\r\n+          queue.remove(pointId2);\r\n+          queue.insert(pointId2, newReachableDistance);\r\n+        }\r\n+      }\r\n+    }\r\n+  });\r\n+};\r\n+\r\n+/**\r\n+ * Expand cluster\r\n+ *\r\n+ * @param {number} clusterId\r\n+ * @param {PriorityQueue} queue\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._expandCluster = function(clusterId, queue) {\r\n+  var queueElements = queue.getElements();\r\n+\r\n+  for (var p = 0, l = queueElements.length; p < l; p++) {\r\n+    var pointId = queueElements[p];\r\n+    if (this._processed[pointId] === undefined) {\r\n+      var neighbors = this._regionQuery(pointId);\r\n+      this._processed[pointId] = 1;\r\n+\r\n+      this.clusters[clusterId].push(pointId);\r\n+      this._orderedList.push(pointId);\r\n+\r\n+      if (this._distanceToCore(pointId) !== undefined) {\r\n+        this._updateQueue(pointId, neighbors, queue);\r\n+        this._expandCluster(clusterId, queue);\r\n+      }\r\n+    }\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Calculating distance to cluster core\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @returns {number}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._distanceToCore = function(pointId) {\r\n+  var l = this.epsilon;\r\n+  for (var coreDistCand = 0; coreDistCand < l; coreDistCand++) {\r\n+    var neighbors = this._regionQuery(pointId, coreDistCand);\r\n+    if (neighbors.length >= this.minPts) {\r\n+      return coreDistCand;\r\n+    }\r\n+  }\r\n+\r\n+  return;\r\n+};\r\n+\r\n+/**\r\n+ * Find all neighbors around given point\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @param {number} epsilon\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._regionQuery = function(pointId, epsilon) {\r\n+  epsilon = epsilon || this.epsilon;\r\n+  var neighbors = [];\r\n+\r\n+  for (var id = 0, l = this.dataset.length; id < l; id++) {\r\n+    if (this.distance(this.dataset[pointId], this.dataset[id]) < epsilon) {\r\n+      neighbors.push(id);\r\n+    }\r\n+  }\r\n+\r\n+  return neighbors;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// helpers\r\n+\r\n+/**\r\n+ * Calculate euclidean distance in multidimensional space\r\n+ *\r\n+ * @param {Array} p\r\n+ * @param {Array} q\r\n+ * @returns {number}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._euclideanDistance = function(p, q) {\r\n+  var sum = 0;\r\n+  var i = Math.min(p.length, q.length);\r\n+\r\n+  while (i--) {\r\n+    sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n+  }\r\n+\r\n+  return Math.sqrt(sum);\r\n+};\r\n+\r\n+if (typeof module !== 'undefined' && module.exports) {\r\n+  module.exports = OPTICS;\r\n+}\r\ndiff --git a/.history/lib/OPTICS_20231205115515.js b/.history/lib/OPTICS_20231205115515.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..1a2f86f294a6ee1589272cb7d20fe4fa697cc62c\n--- /dev/null\n+++ b/.history/lib/OPTICS_20231205115515.js\n@@ -0,0 +1,269 @@\n+\r\n+/**\r\n+ * @requires ./PriorityQueue.js\r\n+ */\r\n+\r\n+if (module.exports) {\r\n+      var PriorityQueue = require('./PriorityQueue.js');\r\n+}\r\n+\r\n+/**\r\n+ * OPTICS - Ordering points to identify the clustering structure\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * OPTICS class constructor\r\n+ * @constructor\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distanceFunction\r\n+ * @returns {OPTICS}\r\n+ */\r\n+function OPTICS(dataset, epsilon, minPts, distanceFunction) {\r\n+  /** @type {number} */\r\n+  this.epsilon = 1;\r\n+  /** @type {number} */\r\n+  this.minPts = 1;\r\n+  /** @type {function} */\r\n+  this.distance = this._euclideanDistance;\r\n+\r\n+  // temporary variables used during computation\r\n+\r\n+  /** @type {Array} */\r\n+  this._reachability = [];\r\n+  /** @type {Array} */\r\n+  this._processed = [];\r\n+  /** @type {number} */\r\n+  this._coreDistance = 0;\r\n+  /** @type {Array} */\r\n+  this._orderedList = [];\r\n+\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+}\r\n+\r\n+/******************************************************************************/\r\n+// pulic functions\r\n+\r\n+/**\r\n+ * Start clustering\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+OPTICS.prototype.run = function(dataset, epsilon, minPts, distanceFunction) {\r\n+  this._init(dataset, epsilon, minPts, distanceFunction);\r\n+\r\n+  for (var pointId = 0, l = this.dataset.length; pointId < l; pointId++) {\r\n+    if (this._processed[pointId] !== 1) {\r\n+      this._processed[pointId] = 1;\r\n+      this.clusters.push([pointId]);\r\n+      var clusterId = this.clusters.length - 1;\r\n+\r\n+      this._orderedList.push(pointId);\r\n+      var priorityQueue = new PriorityQueue(null, null, 'asc');\r\n+      var neighbors = this._regionQuery(pointId);\r\n+\r\n+      // using priority queue assign elements to new cluster\r\n+      if (this._distanceToCore(pointId) !== undefined) {\r\n+        this._updateQueue(pointId, neighbors, priorityQueue);\r\n+        this._expandCluster(clusterId, priorityQueue);\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  return this.clusters;\r\n+};\r\n+\r\n+/**\r\n+ * Generate reachability plot for all points\r\n+ *\r\n+ * @returns {array}\r\n+ * @access public\r\n+ */\r\n+OPTICS.prototype.getReachabilityPlot = function() {\r\n+  var reachabilityPlot = [];\r\n+\r\n+  for (var i = 0, l = this._orderedList.length; i < l; i++) {\r\n+    var pointId = this._orderedList[i];\r\n+    var distance = this._reachability[pointId];\r\n+\r\n+    reachabilityPlot.push([pointId, distance]);\r\n+  }\r\n+\r\n+  return reachabilityPlot;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// protected functions\r\n+\r\n+/**\r\n+ * Set object properties\r\n+ *\r\n+ * @param {Array} dataset\r\n+ * @param {number} epsilon\r\n+ * @param {number} minPts\r\n+ * @param {function} distance\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._init = function(dataset, epsilon, minPts, distance) {\r\n+\r\n+  if (dataset) {\r\n+\r\n+    if (!(dataset instanceof Array)) {\r\n+      throw Error('Dataset must be of type array, ' +\r\n+        typeof dataset + ' given');\r\n+    }\r\n+\r\n+    this.dataset = dataset;\r\n+    this.clusters = [];\r\n+    this._reachability = new Array(this.dataset.length);\r\n+    this._processed = new Array(this.dataset.length);\r\n+    this._coreDistance = 0;\r\n+    this._orderedList = [];\r\n+  }\r\n+\r\n+  if (epsilon) {\r\n+    this.epsilon = epsilon;\r\n+  }\r\n+\r\n+  if (minPts) {\r\n+    this.minPts = minPts;\r\n+  }\r\n+\r\n+  if (distance) {\r\n+    this.distance = distance;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Update information in queue\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @param {Array} neighbors\r\n+ * @param {PriorityQueue} queue\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._updateQueue = function(pointId, neighbors, queue) {\r\n+  var self = this;\r\n+\r\n+  this._coreDistance = this._distanceToCore(pointId);\r\n+  neighbors.forEach(function(pointId2) {\r\n+    if (self._processed[pointId2] === undefined) {\r\n+      var dist = self.distance(self.dataset[pointId], self.dataset[pointId2]);\r\n+      var newReachableDistance = Math.max(self._coreDistance, dist);\r\n+\r\n+      if (self._reachability[pointId2] === undefined) {\r\n+        self._reachability[pointId2] = newReachableDistance;\r\n+        queue.insert(pointId2, newReachableDistance);\r\n+      } else {\r\n+        if (newReachableDistance < self._reachability[pointId2]) {\r\n+          self._reachability[pointId2] = newReachableDistance;\r\n+          queue.remove(pointId2);\r\n+          queue.insert(pointId2, newReachableDistance);\r\n+        }\r\n+      }\r\n+    }\r\n+  });\r\n+};\r\n+\r\n+/**\r\n+ * Expand cluster\r\n+ *\r\n+ * @param {number} clusterId\r\n+ * @param {PriorityQueue} queue\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._expandCluster = function(clusterId, queue) {\r\n+  var queueElements = queue.getElements();\r\n+\r\n+  for (var p = 0, l = queueElements.length; p < l; p++) {\r\n+    var pointId = queueElements[p];\r\n+    if (this._processed[pointId] === undefined) {\r\n+      var neighbors = this._regionQuery(pointId);\r\n+      this._processed[pointId] = 1;\r\n+\r\n+      this.clusters[clusterId].push(pointId);\r\n+      this._orderedList.push(pointId);\r\n+\r\n+      if (this._distanceToCore(pointId) !== undefined) {\r\n+        this._updateQueue(pointId, neighbors, queue);\r\n+        this._expandCluster(clusterId, queue);\r\n+      }\r\n+    }\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Calculating distance to cluster core\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @returns {number}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._distanceToCore = function(pointId) {\r\n+  var l = this.epsilon;\r\n+  for (var coreDistCand = 0; coreDistCand < l; coreDistCand++) {\r\n+    var neighbors = this._regionQuery(pointId, coreDistCand);\r\n+    if (neighbors.length >= this.minPts) {\r\n+      return coreDistCand;\r\n+    }\r\n+  }\r\n+\r\n+  return;\r\n+};\r\n+\r\n+/**\r\n+ * Find all neighbors around given point\r\n+ *\r\n+ * @param {number} pointId\r\n+ * @param {number} epsilon\r\n+ * @returns {Array}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._regionQuery = function(pointId, epsilon) {\r\n+  epsilon = epsilon || this.epsilon;\r\n+  var neighbors = [];\r\n+\r\n+  for (var id = 0, l = this.dataset.length; id < l; id++) {\r\n+    if (this.distance(this.dataset[pointId], this.dataset[id]) < epsilon) {\r\n+      neighbors.push(id);\r\n+    }\r\n+  }\r\n+\r\n+  return neighbors;\r\n+};\r\n+\r\n+/******************************************************************************/\r\n+// helpers\r\n+\r\n+/**\r\n+ * Calculate euclidean distance in multidimensional space\r\n+ *\r\n+ * @param {Array} p\r\n+ * @param {Array} q\r\n+ * @returns {number}\r\n+ * @access protected\r\n+ */\r\n+OPTICS.prototype._euclideanDistance = function(p, q) {\r\n+  var sum = 0;\r\n+  var i = Math.min(p.length, q.length);\r\n+\r\n+  while (i--) {\r\n+    sum += (p[i] - q[i]) * (p[i] - q[i]);\r\n+  }\r\n+\r\n+  return Math.sqrt(sum);\r\n+};\r\n+\r\n+if (module.exports) {\r\n+  module.exports = OPTICS;\r\n+}\r\ndiff --git a/.history/lib/PriorityQueue_20231205115425.js b/.history/lib/PriorityQueue_20231205115425.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..beda2305bf1585d672f92c93a55391c393dac43d\n--- /dev/null\n+++ b/.history/lib/PriorityQueue_20231205115425.js\n@@ -0,0 +1,180 @@\n+/**\r\n+ * PriorityQueue\r\n+ * Elements in this queue are sorted according to their value\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * PriorityQueue class construcotr\r\n+ * @constructor\r\n+ *\r\n+ * @example\r\n+ * queue: [1,2,3,4]\r\n+ * priorities: [4,1,2,3]\r\n+ * > result = [1,4,2,3]\r\n+ *\r\n+ * @param {Array} elements\r\n+ * @param {Array} priorities\r\n+ * @param {string} sorting - asc / desc\r\n+ * @returns {PriorityQueue}\r\n+ */\r\n+function PriorityQueue(elements, priorities, sorting) {\r\n+  /** @type {Array} */\r\n+  this._queue = [];\r\n+  /** @type {Array} */\r\n+  this._priorities = [];\r\n+  /** @type {string} */\r\n+  this._sorting = 'desc';\r\n+\r\n+  this._init(elements, priorities, sorting);\r\n+};\r\n+\r\n+/**\r\n+ * Insert element\r\n+ *\r\n+ * @param {Object} ele\r\n+ * @param {Object} priority\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.insert = function(ele, priority) {\r\n+  var indexToInsert = this._queue.length;\r\n+  var index = indexToInsert;\r\n+\r\n+  while (index--) {\r\n+    var priority2 = this._priorities[index];\r\n+    if (this._sorting === 'desc') {\r\n+      if (priority > priority2) {\r\n+        indexToInsert = index;\r\n+      }\r\n+    } else {\r\n+      if (priority < priority2) {\r\n+        indexToInsert = index;\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  this._insertAt(ele, priority, indexToInsert);\r\n+};\r\n+\r\n+/**\r\n+ * Remove element\r\n+ *\r\n+ * @param {Object} ele\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.remove = function(ele) {\r\n+  var index = this._queue.length;\r\n+\r\n+  while (index--) {\r\n+    var ele2 = this._queue[index];\r\n+    if (ele === ele2) {\r\n+      this._queue.splice(index, 1);\r\n+      this._priorities.splice(index, 1);\r\n+      break;\r\n+    }\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * For each loop wrapper\r\n+ *\r\n+ * @param {function} func\r\n+ * @returs {undefined}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.forEach = function(func) {\r\n+  this._queue.forEach(func);\r\n+};\r\n+\r\n+/**\r\n+ * @returns {Array}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getElements = function() {\r\n+  return this._queue;\r\n+};\r\n+\r\n+/**\r\n+ * @param {number} index\r\n+ * @returns {Object}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getElementPriority = function(index) {\r\n+  return this._priorities[index];\r\n+};\r\n+\r\n+/**\r\n+ * @returns {Array}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getPriorities = function() {\r\n+  return this._priorities;\r\n+};\r\n+\r\n+/**\r\n+ * @returns {Array}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getElementsWithPriorities = function() {\r\n+  var result = [];\r\n+\r\n+  for (var i = 0, l = this._queue.length; i < l; i++) {\r\n+    result.push([this._queue[i], this._priorities[i]]);\r\n+  }\r\n+\r\n+  return result;\r\n+};\r\n+\r\n+/**\r\n+ * Set object properties\r\n+ *\r\n+ * @param {Array} elements\r\n+ * @param {Array} priorities\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+PriorityQueue.prototype._init = function(elements, priorities, sorting) {\r\n+\r\n+  if (elements && priorities) {\r\n+    this._queue = [];\r\n+    this._priorities = [];\r\n+\r\n+    if (elements.length !== priorities.length) {\r\n+      throw new Error('Arrays must have the same length');\r\n+    }\r\n+\r\n+    for (var i = 0; i < elements.length; i++) {\r\n+      this.insert(elements[i], priorities[i]);\r\n+    }\r\n+  }\r\n+\r\n+  if (sorting) {\r\n+    this._sorting = sorting;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Insert element at given position\r\n+ *\r\n+ * @param {Object} ele\r\n+ * @param {number} index\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+PriorityQueue.prototype._insertAt = function(ele, priority, index) {\r\n+  if (this._queue.length === index) {\r\n+    this._queue.push(ele);\r\n+    this._priorities.push(priority);\r\n+  } else {\r\n+    this._queue.splice(index, 0, ele);\r\n+    this._priorities.splice(index, 0, priority);\r\n+  }\r\n+};\r\n+\r\n+if (typeof module !== 'undefined' && module.exports) {\r\n+  module.exports = PriorityQueue;\r\n+}\r\ndiff --git a/.history/lib/PriorityQueue_20231205115515.js b/.history/lib/PriorityQueue_20231205115515.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..23be5a7061c311446a76fca1e17fd68539738648\n--- /dev/null\n+++ b/.history/lib/PriorityQueue_20231205115515.js\n@@ -0,0 +1,180 @@\n+/**\r\n+ * PriorityQueue\r\n+ * Elements in this queue are sorted according to their value\r\n+ *\r\n+ * @author Lukasz Krawczyk <contact@lukaszkrawczyk.eu>\r\n+ * @copyright MIT\r\n+ */\r\n+\r\n+/**\r\n+ * PriorityQueue class construcotr\r\n+ * @constructor\r\n+ *\r\n+ * @example\r\n+ * queue: [1,2,3,4]\r\n+ * priorities: [4,1,2,3]\r\n+ * > result = [1,4,2,3]\r\n+ *\r\n+ * @param {Array} elements\r\n+ * @param {Array} priorities\r\n+ * @param {string} sorting - asc / desc\r\n+ * @returns {PriorityQueue}\r\n+ */\r\n+function PriorityQueue(elements, priorities, sorting) {\r\n+  /** @type {Array} */\r\n+  this._queue = [];\r\n+  /** @type {Array} */\r\n+  this._priorities = [];\r\n+  /** @type {string} */\r\n+  this._sorting = 'desc';\r\n+\r\n+  this._init(elements, priorities, sorting);\r\n+};\r\n+\r\n+/**\r\n+ * Insert element\r\n+ *\r\n+ * @param {Object} ele\r\n+ * @param {Object} priority\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.insert = function(ele, priority) {\r\n+  var indexToInsert = this._queue.length;\r\n+  var index = indexToInsert;\r\n+\r\n+  while (index--) {\r\n+    var priority2 = this._priorities[index];\r\n+    if (this._sorting === 'desc') {\r\n+      if (priority > priority2) {\r\n+        indexToInsert = index;\r\n+      }\r\n+    } else {\r\n+      if (priority < priority2) {\r\n+        indexToInsert = index;\r\n+      }\r\n+    }\r\n+  }\r\n+\r\n+  this._insertAt(ele, priority, indexToInsert);\r\n+};\r\n+\r\n+/**\r\n+ * Remove element\r\n+ *\r\n+ * @param {Object} ele\r\n+ * @returns {undefined}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.remove = function(ele) {\r\n+  var index = this._queue.length;\r\n+\r\n+  while (index--) {\r\n+    var ele2 = this._queue[index];\r\n+    if (ele === ele2) {\r\n+      this._queue.splice(index, 1);\r\n+      this._priorities.splice(index, 1);\r\n+      break;\r\n+    }\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * For each loop wrapper\r\n+ *\r\n+ * @param {function} func\r\n+ * @returs {undefined}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.forEach = function(func) {\r\n+  this._queue.forEach(func);\r\n+};\r\n+\r\n+/**\r\n+ * @returns {Array}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getElements = function() {\r\n+  return this._queue;\r\n+};\r\n+\r\n+/**\r\n+ * @param {number} index\r\n+ * @returns {Object}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getElementPriority = function(index) {\r\n+  return this._priorities[index];\r\n+};\r\n+\r\n+/**\r\n+ * @returns {Array}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getPriorities = function() {\r\n+  return this._priorities;\r\n+};\r\n+\r\n+/**\r\n+ * @returns {Array}\r\n+ * @access public\r\n+ */\r\n+PriorityQueue.prototype.getElementsWithPriorities = function() {\r\n+  var result = [];\r\n+\r\n+  for (var i = 0, l = this._queue.length; i < l; i++) {\r\n+    result.push([this._queue[i], this._priorities[i]]);\r\n+  }\r\n+\r\n+  return result;\r\n+};\r\n+\r\n+/**\r\n+ * Set object properties\r\n+ *\r\n+ * @param {Array} elements\r\n+ * @param {Array} priorities\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+PriorityQueue.prototype._init = function(elements, priorities, sorting) {\r\n+\r\n+  if (elements && priorities) {\r\n+    this._queue = [];\r\n+    this._priorities = [];\r\n+\r\n+    if (elements.length !== priorities.length) {\r\n+      throw new Error('Arrays must have the same length');\r\n+    }\r\n+\r\n+    for (var i = 0; i < elements.length; i++) {\r\n+      this.insert(elements[i], priorities[i]);\r\n+    }\r\n+  }\r\n+\r\n+  if (sorting) {\r\n+    this._sorting = sorting;\r\n+  }\r\n+};\r\n+\r\n+/**\r\n+ * Insert element at given position\r\n+ *\r\n+ * @param {Object} ele\r\n+ * @param {number} index\r\n+ * @returns {undefined}\r\n+ * @access protected\r\n+ */\r\n+PriorityQueue.prototype._insertAt = function(ele, priority, index) {\r\n+  if (this._queue.length === index) {\r\n+    this._queue.push(ele);\r\n+    this._priorities.push(priority);\r\n+  } else {\r\n+    this._queue.splice(index, 0, ele);\r\n+    this._priorities.splice(index, 0, priority);\r\n+  }\r\n+};\r\n+\r\n+if (module.exports) {\r\n+  module.exports = PriorityQueue;\r\n+}\r\ndiff --git a/.history/lib/index_20231205115425.js b/.history/lib/index_20231205115425.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..a9c5d52a2d5dde2a22ba5f03e54abf3b68f796d8\n--- /dev/null\n+++ b/.history/lib/index_20231205115425.js\n@@ -0,0 +1,9 @@\n+\r\n+if (typeof module !== 'undefined' && module.exports) {\r\n+    module.exports = {\r\n+      DBSCAN: require('./DBSCAN.js'),\r\n+      KMEANS: require('./KMEANS.js'),\r\n+      OPTICS: require('./OPTICS.js'),\r\n+      PriorityQueue: require('./PriorityQueue.js')\r\n+    };\r\n+}\r\ndiff --git a/.history/lib/index_20231205115515.js b/.history/lib/index_20231205115515.js\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..b5a7a8cc312a1c0468259231a06641211c8e11cc\n--- /dev/null\n+++ b/.history/lib/index_20231205115515.js\n@@ -0,0 +1,9 @@\n+\r\n+if (module.exports) {\r\n+    module.exports = {\r\n+      DBSCAN: require('./DBSCAN.js'),\r\n+      KMEANS: require('./KMEANS.js'),\r\n+      OPTICS: require('./OPTICS.js'),\r\n+      PriorityQueue: require('./PriorityQueue.js')\r\n+    };\r\n+}\r\ndiff --git a/lib/DBSCAN.js b/lib/DBSCAN.js\nindex 433b454c8d1e27ed951c7ba53052a4036e25f43d..54f8c4438faba26ebafd22ec9d7a228f6dfdef94 100644\n--- a/lib/DBSCAN.js\n+++ b/lib/DBSCAN.js\n@@ -231,6 +231,6 @@ DBSCAN.prototype._euclideanDistance = function(p, q) {\n   return Math.sqrt(sum);\r\n };\r\n \r\n-if (typeof module !== 'undefined' && module.exports) {\r\n+if (module.exports) {\r\n   module.exports = DBSCAN;\r\n }\r\ndiff --git a/lib/KMEANS.js b/lib/KMEANS.js\nindex 21646f447f20fa710a7d855e597a9b9f9643b2f5..a6fab6e802b5ce7c9f7f8ac4183faff29181b22d 100644\n--- a/lib/KMEANS.js\n+++ b/lib/KMEANS.js\n@@ -208,6 +208,6 @@ KMEANS.prototype.distance = function(p, q) {\n   return Math.sqrt(sum);\r\n };\r\n \r\n-if (typeof module !== 'undefined' && module.exports) {\r\n+if (module.exports) {\r\n   module.exports = KMEANS;\r\n }\r\ndiff --git a/lib/OPTICS.js b/lib/OPTICS.js\nindex 867e081630c3a4ee2d2615d902642e11249f4981..1a2f86f294a6ee1589272cb7d20fe4fa697cc62c 100644\n--- a/lib/OPTICS.js\n+++ b/lib/OPTICS.js\n@@ -3,7 +3,7 @@\n  * @requires ./PriorityQueue.js\r\n  */\r\n \r\n-if (typeof module !== 'undefined' && module.exports) {\r\n+if (module.exports) {\r\n       var PriorityQueue = require('./PriorityQueue.js');\r\n }\r\n \r\n@@ -264,6 +264,6 @@ OPTICS.prototype._euclideanDistance = function(p, q) {\n   return Math.sqrt(sum);\r\n };\r\n \r\n-if (typeof module !== 'undefined' && module.exports) {\r\n+if (module.exports) {\r\n   module.exports = OPTICS;\r\n }\r\ndiff --git a/lib/PriorityQueue.js b/lib/PriorityQueue.js\nindex beda2305bf1585d672f92c93a55391c393dac43d..23be5a7061c311446a76fca1e17fd68539738648 100644\n--- a/lib/PriorityQueue.js\n+++ b/lib/PriorityQueue.js\n@@ -175,6 +175,6 @@ PriorityQueue.prototype._insertAt = function(ele, priority, index) {\n   }\r\n };\r\n \r\n-if (typeof module !== 'undefined' && module.exports) {\r\n+if (module.exports) {\r\n   module.exports = PriorityQueue;\r\n }\r\ndiff --git a/lib/index.js b/lib/index.js\nindex a9c5d52a2d5dde2a22ba5f03e54abf3b68f796d8..b5a7a8cc312a1c0468259231a06641211c8e11cc 100644\n--- a/lib/index.js\n+++ b/lib/index.js\n@@ -1,5 +1,5 @@\n \r\n-if (typeof module !== 'undefined' && module.exports) {\r\n+if (module.exports) {\r\n     module.exports = {\r\n       DBSCAN: require('./DBSCAN.js'),\r\n       KMEANS: require('./KMEANS.js'),\r\n"
  },
  {
    "path": "patches/domino@2.1.6.patch",
    "content": "diff --git a/lib/CSSStyleDeclaration.js b/lib/CSSStyleDeclaration.js\nindex cf1dbc6001fa4315fbeaef8028066a61848a5094..d3217735d6799c11815aa742dd1f5195ef32bfd1 100644\n--- a/lib/CSSStyleDeclaration.js\n+++ b/lib/CSSStyleDeclaration.js\n@@ -186,11 +186,14 @@ CSSStyleDeclaration.prototype = Object.create(Object.prototype, {\n   }},\n });\n \n-var cssProperties = {\n+const cssProperties = {\n+  accentColor: \"accent-color\",\n+  additiveSymbols: \"additive-symbols\",\n   alignContent: \"align-content\",\n   alignItems: \"align-items\",\n-  alignmentBaseline: \"alignment-baseline\",\n   alignSelf: \"align-self\",\n+  alignmentBaseline: \"alignment-baseline\",\n+  all: \"all\",\n   animation: \"animation\",\n   animationDelay: \"animation-delay\",\n   animationDirection: \"animation-direction\",\n@@ -200,9 +203,15 @@ var cssProperties = {\n   animationName: \"animation-name\",\n   animationPlayState: \"animation-play-state\",\n   animationTimingFunction: \"animation-timing-function\",\n+  appRegion: \"app-region\",\n+  appearance: \"appearance\",\n+  ascentOverride: \"ascent-override\",\n+  aspectRatio: \"aspect-ratio\",\n+  backdropFilter: \"backdrop-filter\",\n   backfaceVisibility: \"backface-visibility\",\n   background: \"background\",\n   backgroundAttachment: \"background-attachment\",\n+  backgroundBlendMode: \"background-blend-mode\",\n   backgroundClip: \"background-clip\",\n   backgroundColor: \"background-color\",\n   backgroundImage: \"background-image\",\n@@ -211,9 +220,25 @@ var cssProperties = {\n   backgroundPositionX: \"background-position-x\",\n   backgroundPositionY: \"background-position-y\",\n   backgroundRepeat: \"background-repeat\",\n+  backgroundRepeatX: \"background-repeat-x\",\n+  backgroundRepeatY: \"background-repeat-y\",\n   backgroundSize: \"background-size\",\n+  basePalette: \"base-palette\",\n   baselineShift: \"baseline-shift\",\n+  blockSize: \"block-size\",\n   border: \"border\",\n+  borderBlock: \"border-block\",\n+  borderBlockColor: \"border-block-color\",\n+  borderBlockEnd: \"border-block-end\",\n+  borderBlockEndColor: \"border-block-end-color\",\n+  borderBlockEndStyle: \"border-block-end-style\",\n+  borderBlockEndWidth: \"border-block-end-width\",\n+  borderBlockStart: \"border-block-start\",\n+  borderBlockStartColor: \"border-block-start-color\",\n+  borderBlockStartStyle: \"border-block-start-style\",\n+  borderBlockStartWidth: \"border-block-start-width\",\n+  borderBlockStyle: \"border-block-style\",\n+  borderBlockWidth: \"border-block-width\",\n   borderBottom: \"border-bottom\",\n   borderBottomColor: \"border-bottom-color\",\n   borderBottomLeftRadius: \"border-bottom-left-radius\",\n@@ -222,12 +247,26 @@ var cssProperties = {\n   borderBottomWidth: \"border-bottom-width\",\n   borderCollapse: \"border-collapse\",\n   borderColor: \"border-color\",\n+  borderEndEndRadius: \"border-end-end-radius\",\n+  borderEndStartRadius: \"border-end-start-radius\",\n   borderImage: \"border-image\",\n   borderImageOutset: \"border-image-outset\",\n   borderImageRepeat: \"border-image-repeat\",\n   borderImageSlice: \"border-image-slice\",\n   borderImageSource: \"border-image-source\",\n   borderImageWidth: \"border-image-width\",\n+  borderInline: \"border-inline\",\n+  borderInlineColor: \"border-inline-color\",\n+  borderInlineEnd: \"border-inline-end\",\n+  borderInlineEndColor: \"border-inline-end-color\",\n+  borderInlineEndStyle: \"border-inline-end-style\",\n+  borderInlineEndWidth: \"border-inline-end-width\",\n+  borderInlineStart: \"border-inline-start\",\n+  borderInlineStartColor: \"border-inline-start-color\",\n+  borderInlineStartStyle: \"border-inline-start-style\",\n+  borderInlineStartWidth: \"border-inline-start-width\",\n+  borderInlineStyle: \"border-inline-style\",\n+  borderInlineWidth: \"border-inline-width\",\n   borderLeft: \"border-left\",\n   borderLeftColor: \"border-left-color\",\n   borderLeftStyle: \"border-left-style\",\n@@ -238,6 +277,8 @@ var cssProperties = {\n   borderRightStyle: \"border-right-style\",\n   borderRightWidth: \"border-right-width\",\n   borderSpacing: \"border-spacing\",\n+  borderStartEndRadius: \"border-start-end-radius\",\n+  borderStartStartRadius: \"border-start-start-radius\",\n   borderStyle: \"border-style\",\n   borderTop: \"border-top\",\n   borderTopColor: \"border-top-color\",\n@@ -252,13 +293,18 @@ var cssProperties = {\n   breakAfter: \"break-after\",\n   breakBefore: \"break-before\",\n   breakInside: \"break-inside\",\n+  bufferedRendering: \"buffered-rendering\",\n   captionSide: \"caption-side\",\n+  caretColor: \"caret-color\",\n   clear: \"clear\",\n   clip: \"clip\",\n   clipPath: \"clip-path\",\n   clipRule: \"clip-rule\",\n   color: \"color\",\n+  colorInterpolation: \"color-interpolation\",\n   colorInterpolationFilters: \"color-interpolation-filters\",\n+  colorRendering: \"color-rendering\",\n+  colorScheme: \"color-scheme\",\n   columnCount: \"column-count\",\n   columnFill: \"column-fill\",\n   columnGap: \"column-gap\",\n@@ -266,19 +312,33 @@ var cssProperties = {\n   columnRuleColor: \"column-rule-color\",\n   columnRuleStyle: \"column-rule-style\",\n   columnRuleWidth: \"column-rule-width\",\n-  columns: \"columns\",\n   columnSpan: \"column-span\",\n   columnWidth: \"column-width\",\n+  columns: \"columns\",\n+  contain: \"contain\",\n+  containIntrinsicBlockSize: \"contain-intrinsic-block-size\",\n+  containIntrinsicHeight: \"contain-intrinsic-height\",\n+  containIntrinsicInlineSize: \"contain-intrinsic-inline-size\",\n+  containIntrinsicSize: \"contain-intrinsic-size\",\n+  containIntrinsicWidth: \"contain-intrinsic-width\",\n+  container: \"container\",\n+  containerName: \"container-name\",\n+  containerType: \"container-type\",\n   content: \"content\",\n+  contentVisibility: \"content-visibility\",\n   counterIncrement: \"counter-increment\",\n   counterReset: \"counter-reset\",\n-  cssFloat: \"float\",\n+  counterSet: \"counter-set\",\n   cursor: \"cursor\",\n+  cx: \"cx\",\n+  cy: \"cy\",\n+  d: \"d\",\n+  descentOverride: \"descent-override\",\n   direction: \"direction\",\n   display: \"display\",\n   dominantBaseline: \"dominant-baseline\",\n   emptyCells: \"empty-cells\",\n-  enableBackground: \"enable-background\",\n+  fallback: \"fallback\",\n   fill: \"fill\",\n   fillOpacity: \"fill-opacity\",\n   fillRule: \"fill-rule\",\n@@ -290,19 +350,32 @@ var cssProperties = {\n   flexGrow: \"flex-grow\",\n   flexShrink: \"flex-shrink\",\n   flexWrap: \"flex-wrap\",\n+  float: \"float\",\n   floodColor: \"flood-color\",\n   floodOpacity: \"flood-opacity\",\n   font: \"font\",\n+  fontDisplay: \"font-display\",\n   fontFamily: \"font-family\",\n   fontFeatureSettings: \"font-feature-settings\",\n+  fontKerning: \"font-kerning\",\n+  fontOpticalSizing: \"font-optical-sizing\",\n+  fontPalette: \"font-palette\",\n   fontSize: \"font-size\",\n-  fontSizeAdjust: \"font-size-adjust\",\n   fontStretch: \"font-stretch\",\n   fontStyle: \"font-style\",\n+  fontSynthesis: \"font-synthesis\",\n+  fontSynthesisSmallCaps: \"font-synthesis-small-caps\",\n+  fontSynthesisStyle: \"font-synthesis-style\",\n+  fontSynthesisWeight: \"font-synthesis-weight\",\n   fontVariant: \"font-variant\",\n+  fontVariantCaps: \"font-variant-caps\",\n+  fontVariantEastAsian: \"font-variant-east-asian\",\n+  fontVariantLigatures: \"font-variant-ligatures\",\n+  fontVariantNumeric: \"font-variant-numeric\",\n+  fontVariationSettings: \"font-variation-settings\",\n   fontWeight: \"font-weight\",\n-  glyphOrientationHorizontal: \"glyph-orientation-horizontal\",\n-  glyphOrientationVertical: \"glyph-orientation-vertical\",\n+  forcedColorAdjust: \"forced-color-adjust\",\n+  gap: \"gap\",\n   grid: \"grid\",\n   gridArea: \"grid-area\",\n   gridAutoColumns: \"grid-auto-columns\",\n@@ -322,25 +395,44 @@ var cssProperties = {\n   gridTemplateColumns: \"grid-template-columns\",\n   gridTemplateRows: \"grid-template-rows\",\n   height: \"height\",\n-  imeMode: \"ime-mode\",\n+  hyphenateCharacter: \"hyphenate-character\",\n+  hyphenateLimitChars: \"hyphenate-limit-chars\",\n+  hyphens: \"hyphens\",\n+  imageOrientation: \"image-orientation\",\n+  imageRendering: \"image-rendering\",\n+  inherits: \"inherits\",\n+  initialLetter: \"initial-letter\",\n+  initialValue: \"initial-value\",\n+  inlineSize: \"inline-size\",\n+  inset: \"inset\",\n+  insetBlock: \"inset-block\",\n+  insetBlockEnd: \"inset-block-end\",\n+  insetBlockStart: \"inset-block-start\",\n+  insetInline: \"inset-inline\",\n+  insetInlineEnd: \"inset-inline-end\",\n+  insetInlineStart: \"inset-inline-start\",\n+  isolation: \"isolation\",\n   justifyContent: \"justify-content\",\n-  kerning: \"kerning\",\n-  layoutGrid: \"layout-grid\",\n-  layoutGridChar: \"layout-grid-char\",\n-  layoutGridLine: \"layout-grid-line\",\n-  layoutGridMode: \"layout-grid-mode\",\n-  layoutGridType: \"layout-grid-type\",\n+  justifyItems: \"justify-items\",\n+  justifySelf: \"justify-self\",\n   left: \"left\",\n   letterSpacing: \"letter-spacing\",\n   lightingColor: \"lighting-color\",\n   lineBreak: \"line-break\",\n+  lineGapOverride: \"line-gap-override\",\n   lineHeight: \"line-height\",\n   listStyle: \"list-style\",\n   listStyleImage: \"list-style-image\",\n   listStylePosition: \"list-style-position\",\n   listStyleType: \"list-style-type\",\n   margin: \"margin\",\n+  marginBlock: \"margin-block\",\n+  marginBlockEnd: \"margin-block-end\",\n+  marginBlockStart: \"margin-block-start\",\n   marginBottom: \"margin-bottom\",\n+  marginInline: \"margin-inline\",\n+  marginInlineEnd: \"margin-inline-end\",\n+  marginInlineStart: \"margin-inline-start\",\n   marginLeft: \"margin-left\",\n   marginRight: \"margin-right\",\n   marginTop: \"margin-top\",\n@@ -349,57 +441,27 @@ var cssProperties = {\n   markerMid: \"marker-mid\",\n   markerStart: \"marker-start\",\n   mask: \"mask\",\n+  maskType: \"mask-type\",\n+  mathDepth: \"math-depth\",\n+  mathShift: \"math-shift\",\n+  mathStyle: \"math-style\",\n+  maxBlockSize: \"max-block-size\",\n   maxHeight: \"max-height\",\n+  maxInlineSize: \"max-inline-size\",\n   maxWidth: \"max-width\",\n+  minBlockSize: \"min-block-size\",\n   minHeight: \"min-height\",\n+  minInlineSize: \"min-inline-size\",\n   minWidth: \"min-width\",\n-  msContentZoomChaining: \"-ms-content-zoom-chaining\",\n-  msContentZooming: \"-ms-content-zooming\",\n-  msContentZoomLimit: \"-ms-content-zoom-limit\",\n-  msContentZoomLimitMax: \"-ms-content-zoom-limit-max\",\n-  msContentZoomLimitMin: \"-ms-content-zoom-limit-min\",\n-  msContentZoomSnap: \"-ms-content-zoom-snap\",\n-  msContentZoomSnapPoints: \"-ms-content-zoom-snap-points\",\n-  msContentZoomSnapType: \"-ms-content-zoom-snap-type\",\n-  msFlowFrom: \"-ms-flow-from\",\n-  msFlowInto: \"-ms-flow-into\",\n-  msFontFeatureSettings: \"-ms-font-feature-settings\",\n-  msGridColumn: \"-ms-grid-column\",\n-  msGridColumnAlign: \"-ms-grid-column-align\",\n-  msGridColumns: \"-ms-grid-columns\",\n-  msGridColumnSpan: \"-ms-grid-column-span\",\n-  msGridRow: \"-ms-grid-row\",\n-  msGridRowAlign: \"-ms-grid-row-align\",\n-  msGridRows: \"-ms-grid-rows\",\n-  msGridRowSpan: \"-ms-grid-row-span\",\n-  msHighContrastAdjust: \"-ms-high-contrast-adjust\",\n-  msHyphenateLimitChars: \"-ms-hyphenate-limit-chars\",\n-  msHyphenateLimitLines: \"-ms-hyphenate-limit-lines\",\n-  msHyphenateLimitZone: \"-ms-hyphenate-limit-zone\",\n-  msHyphens: \"-ms-hyphens\",\n-  msImeAlign: \"-ms-ime-align\",\n-  msOverflowStyle: \"-ms-overflow-style\",\n-  msScrollChaining: \"-ms-scroll-chaining\",\n-  msScrollLimit: \"-ms-scroll-limit\",\n-  msScrollLimitXMax: \"-ms-scroll-limit-x-max\",\n-  msScrollLimitXMin: \"-ms-scroll-limit-x-min\",\n-  msScrollLimitYMax: \"-ms-scroll-limit-y-max\",\n-  msScrollLimitYMin: \"-ms-scroll-limit-y-min\",\n-  msScrollRails: \"-ms-scroll-rails\",\n-  msScrollSnapPointsX: \"-ms-scroll-snap-points-x\",\n-  msScrollSnapPointsY: \"-ms-scroll-snap-points-y\",\n-  msScrollSnapType: \"-ms-scroll-snap-type\",\n-  msScrollSnapX: \"-ms-scroll-snap-x\",\n-  msScrollSnapY: \"-ms-scroll-snap-y\",\n-  msScrollTranslation: \"-ms-scroll-translation\",\n-  msTextCombineHorizontal: \"-ms-text-combine-horizontal\",\n-  msTextSizeAdjust: \"-ms-text-size-adjust\",\n-  msTouchAction: \"-ms-touch-action\",\n-  msTouchSelect: \"-ms-touch-select\",\n-  msUserSelect: \"-ms-user-select\",\n-  msWrapFlow: \"-ms-wrap-flow\",\n-  msWrapMargin: \"-ms-wrap-margin\",\n-  msWrapThrough: \"-ms-wrap-through\",\n+  mixBlendMode: \"mix-blend-mode\",\n+  negative: \"negative\",\n+  objectFit: \"object-fit\",\n+  objectPosition: \"object-position\",\n+  objectViewBox: \"object-view-box\",\n+  offset: \"offset\",\n+  offsetDistance: \"offset-distance\",\n+  offsetPath: \"offset-path\",\n+  offsetRotate: \"offset-rotate\",\n   opacity: \"opacity\",\n   order: \"order\",\n   orphans: \"orphans\",\n@@ -409,10 +471,26 @@ var cssProperties = {\n   outlineStyle: \"outline-style\",\n   outlineWidth: \"outline-width\",\n   overflow: \"overflow\",\n+  overflowAnchor: \"overflow-anchor\",\n+  overflowClipMargin: \"overflow-clip-margin\",\n+  overflowWrap: \"overflow-wrap\",\n   overflowX: \"overflow-x\",\n   overflowY: \"overflow-y\",\n+  overrideColors: \"override-colors\",\n+  overscrollBehavior: \"overscroll-behavior\",\n+  overscrollBehaviorBlock: \"overscroll-behavior-block\",\n+  overscrollBehaviorInline: \"overscroll-behavior-inline\",\n+  overscrollBehaviorX: \"overscroll-behavior-x\",\n+  overscrollBehaviorY: \"overscroll-behavior-y\",\n+  pad: \"pad\",\n   padding: \"padding\",\n+  paddingBlock: \"padding-block\",\n+  paddingBlockEnd: \"padding-block-end\",\n+  paddingBlockStart: \"padding-block-start\",\n   paddingBottom: \"padding-bottom\",\n+  paddingInline: \"padding-inline\",\n+  paddingInlineEnd: \"padding-inline-end\",\n+  paddingInlineStart: \"padding-inline-start\",\n   paddingLeft: \"padding-left\",\n   paddingRight: \"padding-right\",\n   paddingTop: \"padding-top\",\n@@ -420,18 +498,63 @@ var cssProperties = {\n   pageBreakAfter: \"page-break-after\",\n   pageBreakBefore: \"page-break-before\",\n   pageBreakInside: \"page-break-inside\",\n+  pageOrientation: \"page-orientation\",\n+  paintOrder: \"paint-order\",\n   perspective: \"perspective\",\n   perspectiveOrigin: \"perspective-origin\",\n+  placeContent: \"place-content\",\n+  placeItems: \"place-items\",\n+  placeSelf: \"place-self\",\n   pointerEvents: \"pointer-events\",\n   position: \"position\",\n+  prefix: \"prefix\",\n   quotes: \"quotes\",\n+  r: \"r\",\n+  range: \"range\",\n+  resize: \"resize\",\n   right: \"right\",\n   rotate: \"rotate\",\n-  rubyAlign: \"ruby-align\",\n-  rubyOverhang: \"ruby-overhang\",\n+  rowGap: \"row-gap\",\n   rubyPosition: \"ruby-position\",\n+  rx: \"rx\",\n+  ry: \"ry\",\n   scale: \"scale\",\n+  scrollBehavior: \"scroll-behavior\",\n+  scrollMargin: \"scroll-margin\",\n+  scrollMarginBlock: \"scroll-margin-block\",\n+  scrollMarginBlockEnd: \"scroll-margin-block-end\",\n+  scrollMarginBlockStart: \"scroll-margin-block-start\",\n+  scrollMarginBottom: \"scroll-margin-bottom\",\n+  scrollMarginInline: \"scroll-margin-inline\",\n+  scrollMarginInlineEnd: \"scroll-margin-inline-end\",\n+  scrollMarginInlineStart: \"scroll-margin-inline-start\",\n+  scrollMarginLeft: \"scroll-margin-left\",\n+  scrollMarginRight: \"scroll-margin-right\",\n+  scrollMarginTop: \"scroll-margin-top\",\n+  scrollPadding: \"scroll-padding\",\n+  scrollPaddingBlock: \"scroll-padding-block\",\n+  scrollPaddingBlockEnd: \"scroll-padding-block-end\",\n+  scrollPaddingBlockStart: \"scroll-padding-block-start\",\n+  scrollPaddingBottom: \"scroll-padding-bottom\",\n+  scrollPaddingInline: \"scroll-padding-inline\",\n+  scrollPaddingInlineEnd: \"scroll-padding-inline-end\",\n+  scrollPaddingInlineStart: \"scroll-padding-inline-start\",\n+  scrollPaddingLeft: \"scroll-padding-left\",\n+  scrollPaddingRight: \"scroll-padding-right\",\n+  scrollPaddingTop: \"scroll-padding-top\",\n+  scrollSnapAlign: \"scroll-snap-align\",\n+  scrollSnapStop: \"scroll-snap-stop\",\n+  scrollSnapType: \"scroll-snap-type\",\n+  scrollbarGutter: \"scrollbar-gutter\",\n+  shapeImageThreshold: \"shape-image-threshold\",\n+  shapeMargin: \"shape-margin\",\n+  shapeOutside: \"shape-outside\",\n+  shapeRendering: \"shape-rendering\",\n   size: \"size\",\n+  sizeAdjust: \"size-adjust\",\n+  speak: \"speak\",\n+  speakAs: \"speak-as\",\n+  src: \"src\",\n   stopColor: \"stop-color\",\n   stopOpacity: \"stop-opacity\",\n   stroke: \"stroke\",\n@@ -442,22 +565,39 @@ var cssProperties = {\n   strokeMiterlimit: \"stroke-miterlimit\",\n   strokeOpacity: \"stroke-opacity\",\n   strokeWidth: \"stroke-width\",\n+  suffix: \"suffix\",\n+  symbols: \"symbols\",\n+  syntax: \"syntax\",\n+  system: \"system\",\n+  tabSize: \"tab-size\",\n   tableLayout: \"table-layout\",\n   textAlign: \"text-align\",\n   textAlignLast: \"text-align-last\",\n   textAnchor: \"text-anchor\",\n+  textCombineUpright: \"text-combine-upright\",\n   textDecoration: \"text-decoration\",\n+  textDecorationColor: \"text-decoration-color\",\n+  textDecorationLine: \"text-decoration-line\",\n+  textDecorationSkipInk: \"text-decoration-skip-ink\",\n+  textDecorationStyle: \"text-decoration-style\",\n+  textDecorationThickness: \"text-decoration-thickness\",\n+  textEmphasis: \"text-emphasis\",\n+  textEmphasisColor: \"text-emphasis-color\",\n+  textEmphasisPosition: \"text-emphasis-position\",\n+  textEmphasisStyle: \"text-emphasis-style\",\n   textIndent: \"text-indent\",\n-  textJustify: \"text-justify\",\n-  textKashida: \"text-kashida\",\n-  textKashidaSpace: \"text-kashida-space\",\n+  textOrientation: \"text-orientation\",\n   textOverflow: \"text-overflow\",\n+  textRendering: \"text-rendering\",\n   textShadow: \"text-shadow\",\n+  textSizeAdjust: \"text-size-adjust\",\n   textTransform: \"text-transform\",\n+  textUnderlineOffset: \"text-underline-offset\",\n   textUnderlinePosition: \"text-underline-position\",\n   top: \"top\",\n   touchAction: \"touch-action\",\n   transform: \"transform\",\n+  transformBox: \"transform-box\",\n   transformOrigin: \"transform-origin\",\n   transformStyle: \"transform-style\",\n   transition: \"transition\",\n@@ -467,6 +607,9 @@ var cssProperties = {\n   transitionTimingFunction: \"transition-timing-function\",\n   translate: \"translate\",\n   unicodeBidi: \"unicode-bidi\",\n+  unicodeRange: \"unicode-range\",\n+  userSelect: \"user-select\",\n+  vectorEffect: \"vector-effect\",\n   verticalAlign: \"vertical-align\",\n   visibility: \"visibility\",\n   webkitAlignContent: \"-webkit-align-content\",\n@@ -480,25 +623,48 @@ var cssProperties = {\n   webkitAnimationIterationCount: \"-webkit-animation-iteration-count\",\n   webkitAnimationName: \"-webkit-animation-name\",\n   webkitAnimationPlayState: \"-webkit-animation-play-state\",\n-  webkitAnimationTimingFunction: \"-webkit-animation-timing-funciton\",\n+  webkitAnimationTimingFunction: \"-webkit-animation-timing-function\",\n+  webkitAppRegion: \"-webkit-app-region\",\n   webkitAppearance: \"-webkit-appearance\",\n   webkitBackfaceVisibility: \"-webkit-backface-visibility\",\n   webkitBackgroundClip: \"-webkit-background-clip\",\n   webkitBackgroundOrigin: \"-webkit-background-origin\",\n   webkitBackgroundSize: \"-webkit-background-size\",\n+  webkitBorderAfter: \"-webkit-border-after\",\n+  webkitBorderAfterColor: \"-webkit-border-after-color\",\n+  webkitBorderAfterStyle: \"-webkit-border-after-style\",\n+  webkitBorderAfterWidth: \"-webkit-border-after-width\",\n+  webkitBorderBefore: \"-webkit-border-before\",\n+  webkitBorderBeforeColor: \"-webkit-border-before-color\",\n+  webkitBorderBeforeStyle: \"-webkit-border-before-style\",\n+  webkitBorderBeforeWidth: \"-webkit-border-before-width\",\n   webkitBorderBottomLeftRadius: \"-webkit-border-bottom-left-radius\",\n   webkitBorderBottomRightRadius: \"-webkit-border-bottom-right-radius\",\n+  webkitBorderEnd: \"-webkit-border-end\",\n+  webkitBorderEndColor: \"-webkit-border-end-color\",\n+  webkitBorderEndStyle: \"-webkit-border-end-style\",\n+  webkitBorderEndWidth: \"-webkit-border-end-width\",\n+  webkitBorderHorizontalSpacing: \"-webkit-border-horizontal-spacing\",\n   webkitBorderImage: \"-webkit-border-image\",\n   webkitBorderRadius: \"-webkit-border-radius\",\n+  webkitBorderStart: \"-webkit-border-start\",\n+  webkitBorderStartColor: \"-webkit-border-start-color\",\n+  webkitBorderStartStyle: \"-webkit-border-start-style\",\n+  webkitBorderStartWidth: \"-webkit-border-start-width\",\n   webkitBorderTopLeftRadius: \"-webkit-border-top-left-radius\",\n   webkitBorderTopRightRadius: \"-webkit-border-top-right-radius\",\n+  webkitBorderVerticalSpacing: \"-webkit-border-vertical-spacing\",\n   webkitBoxAlign: \"-webkit-box-align\",\n+  webkitBoxDecorationBreak: \"-webkit-box-decoration-break\",\n   webkitBoxDirection: \"-webkit-box-direction\",\n   webkitBoxFlex: \"-webkit-box-flex\",\n   webkitBoxOrdinalGroup: \"-webkit-box-ordinal-group\",\n   webkitBoxOrient: \"-webkit-box-orient\",\n   webkitBoxPack: \"-webkit-box-pack\",\n+  webkitBoxReflect: \"-webkit-box-reflect\",\n+  webkitBoxShadow: \"-webkit-box-shadow\",\n   webkitBoxSizing: \"-webkit-box-sizing\",\n+  webkitClipPath: \"-webkit-clip-path\",\n   webkitColumnBreakAfter: \"-webkit-column-break-after\",\n   webkitColumnBreakBefore: \"-webkit-column-break-before\",\n   webkitColumnBreakInside: \"-webkit-column-break-inside\",\n@@ -508,9 +674,9 @@ var cssProperties = {\n   webkitColumnRuleColor: \"-webkit-column-rule-color\",\n   webkitColumnRuleStyle: \"-webkit-column-rule-style\",\n   webkitColumnRuleWidth: \"-webkit-column-rule-width\",\n-  webkitColumns: \"-webkit-columns\",\n   webkitColumnSpan: \"-webkit-column-span\",\n   webkitColumnWidth: \"-webkit-column-width\",\n+  webkitColumns: \"-webkit-columns\",\n   webkitFilter: \"-webkit-filter\",\n   webkitFlex: \"-webkit-flex\",\n   webkitFlexBasis: \"-webkit-flex-basis\",\n@@ -519,38 +685,99 @@ var cssProperties = {\n   webkitFlexGrow: \"-webkit-flex-grow\",\n   webkitFlexShrink: \"-webkit-flex-shrink\",\n   webkitFlexWrap: \"-webkit-flex-wrap\",\n+  webkitFontFeatureSettings: \"-webkit-font-feature-settings\",\n+  webkitFontSmoothing: \"-webkit-font-smoothing\",\n+  webkitHighlight: \"-webkit-highlight\",\n+  webkitHyphenateCharacter: \"-webkit-hyphenate-character\",\n   webkitJustifyContent: \"-webkit-justify-content\",\n+  webkitLineBreak: \"-webkit-line-break\",\n+  webkitLineClamp: \"-webkit-line-clamp\",\n+  webkitLocale: \"-webkit-locale\",\n+  webkitLogicalHeight: \"-webkit-logical-height\",\n+  webkitLogicalWidth: \"-webkit-logical-width\",\n+  webkitMarginAfter: \"-webkit-margin-after\",\n+  webkitMarginBefore: \"-webkit-margin-before\",\n+  webkitMarginEnd: \"-webkit-margin-end\",\n+  webkitMarginStart: \"-webkit-margin-start\",\n+  webkitMask: \"-webkit-mask\",\n+  webkitMaskBoxImage: \"-webkit-mask-box-image\",\n+  webkitMaskBoxImageOutset: \"-webkit-mask-box-image-outset\",\n+  webkitMaskBoxImageRepeat: \"-webkit-mask-box-image-repeat\",\n+  webkitMaskBoxImageSlice: \"-webkit-mask-box-image-slice\",\n+  webkitMaskBoxImageSource: \"-webkit-mask-box-image-source\",\n+  webkitMaskBoxImageWidth: \"-webkit-mask-box-image-width\",\n+  webkitMaskClip: \"-webkit-mask-clip\",\n+  webkitMaskComposite: \"-webkit-mask-composite\",\n+  webkitMaskImage: \"-webkit-mask-image\",\n+  webkitMaskOrigin: \"-webkit-mask-origin\",\n+  webkitMaskPosition: \"-webkit-mask-position\",\n+  webkitMaskPositionX: \"-webkit-mask-position-x\",\n+  webkitMaskPositionY: \"-webkit-mask-position-y\",\n+  webkitMaskRepeat: \"-webkit-mask-repeat\",\n+  webkitMaskRepeatX: \"-webkit-mask-repeat-x\",\n+  webkitMaskRepeatY: \"-webkit-mask-repeat-y\",\n+  webkitMaskSize: \"-webkit-mask-size\",\n+  webkitMaxLogicalHeight: \"-webkit-max-logical-height\",\n+  webkitMaxLogicalWidth: \"-webkit-max-logical-width\",\n+  webkitMinLogicalHeight: \"-webkit-min-logical-height\",\n+  webkitMinLogicalWidth: \"-webkit-min-logical-width\",\n+  webkitOpacity: \"-webkit-opacity\",\n   webkitOrder: \"-webkit-order\",\n-  webkitPerspective: \"-webkit-perspective-origin\",\n+  webkitPaddingAfter: \"-webkit-padding-after\",\n+  webkitPaddingBefore: \"-webkit-padding-before\",\n+  webkitPaddingEnd: \"-webkit-padding-end\",\n+  webkitPaddingStart: \"-webkit-padding-start\",\n+  webkitPerspective: \"-webkit-perspective\",\n   webkitPerspectiveOrigin: \"-webkit-perspective-origin\",\n+  webkitPerspectiveOriginX: \"-webkit-perspective-origin-x\",\n+  webkitPerspectiveOriginY: \"-webkit-perspective-origin-y\",\n+  webkitPrintColorAdjust: \"-webkit-print-color-adjust\",\n+  webkitRtlOrdering: \"-webkit-rtl-ordering\",\n+  webkitRubyPosition: \"-webkit-ruby-position\",\n+  webkitShapeImageThreshold: \"-webkit-shape-image-threshold\",\n+  webkitShapeMargin: \"-webkit-shape-margin\",\n+  webkitShapeOutside: \"-webkit-shape-outside\",\n   webkitTapHighlightColor: \"-webkit-tap-highlight-color\",\n+  webkitTextCombine: \"-webkit-text-combine\",\n+  webkitTextDecorationsInEffect: \"-webkit-text-decorations-in-effect\",\n+  webkitTextEmphasis: \"-webkit-text-emphasis\",\n+  webkitTextEmphasisColor: \"-webkit-text-emphasis-color\",\n+  webkitTextEmphasisPosition: \"-webkit-text-emphasis-position\",\n+  webkitTextEmphasisStyle: \"-webkit-text-emphasis-style\",\n   webkitTextFillColor: \"-webkit-text-fill-color\",\n+  webkitTextOrientation: \"-webkit-text-orientation\",\n+  webkitTextSecurity: \"-webkit-text-security\",\n   webkitTextSizeAdjust: \"-webkit-text-size-adjust\",\n   webkitTextStroke: \"-webkit-text-stroke\",\n   webkitTextStrokeColor: \"-webkit-text-stroke-color\",\n   webkitTextStrokeWidth: \"-webkit-text-stroke-width\",\n   webkitTransform: \"-webkit-transform\",\n   webkitTransformOrigin: \"-webkit-transform-origin\",\n+  webkitTransformOriginX: \"-webkit-transform-origin-x\",\n+  webkitTransformOriginY: \"-webkit-transform-origin-y\",\n+  webkitTransformOriginZ: \"-webkit-transform-origin-z\",\n   webkitTransformStyle: \"-webkit-transform-style\",\n   webkitTransition: \"-webkit-transition\",\n   webkitTransitionDelay: \"-webkit-transition-delay\",\n   webkitTransitionDuration: \"-webkit-transition-duration\",\n   webkitTransitionProperty: \"-webkit-transition-property\",\n   webkitTransitionTimingFunction: \"-webkit-transition-timing-function\",\n+  webkitUserDrag: \"-webkit-user-drag\",\n   webkitUserModify: \"-webkit-user-modify\",\n   webkitUserSelect: \"-webkit-user-select\",\n   webkitWritingMode: \"-webkit-writing-mode\",\n   whiteSpace: \"white-space\",\n   widows: \"widows\",\n   width: \"width\",\n+  willChange: \"will-change\",\n   wordBreak: \"word-break\",\n   wordSpacing: \"word-spacing\",\n   wordWrap: \"word-wrap\",\n   writingMode: \"writing-mode\",\n+  x: \"x\",\n+  y: \"y\",\n   zIndex: \"z-index\",\n   zoom: \"zoom\",\n-  resize: \"resize\",\n-  userSelect: \"user-select\",\n };\n \n for(var prop in cssProperties) defineStyleProperty(prop);\ndiff --git a/lib/ContainerNode.js b/lib/ContainerNode.js\nindex a143ad847d853e235e03065cf5e342304f0bfc8c..b15e482fd6b1a52785cd0632af4435ed70d09cfe 100644\n--- a/lib/ContainerNode.js\n+++ b/lib/ContainerNode.js\n@@ -56,6 +56,15 @@ ContainerNode.prototype = Object.create(Node.prototype, {\n     this._firstChild = null; // free memory\n   }},\n \n+  replaceChildren: {\n+    value: function replaceChildren() {\n+      this.removeChildren();\n+      \n+      // Should probably implement here the replace logic as well\n+      // but for now we just need the \"children\" removal ability\n+    }\n+  },\n+\n   // Remove all of this node's children.  This is a minor\n   // optimization that only calls modify() once.\n   removeChildren: { value: function removeChildren() {\ndiff --git a/lib/Element.js b/lib/Element.js\nindex ecc90a871340ca1e332c432d5486a24226f2f6a8..44d2c818ffbb23724e18e029a98091e4120c9a57 100644\n--- a/lib/Element.js\n+++ b/lib/Element.js\n@@ -92,7 +92,21 @@ Element.prototype = Object.create(ContainerNode.prototype, {\n     get: function() {\n       return this.serialize();\n     },\n-    set: utils.nyi\n+    set: function(v) {\n+      var parser = this.ownerDocument.implementation.mozHTMLParser(\n+        this.ownerDocument._address,\n+        this);\n+      parser.parse(v===null ? '' : String(v), true);\n+\n+      // Remove any existing children of this node\n+      var target = this;\n+      while(target.hasChildNodes())\n+        target.removeChild(target.firstChild);\n+\n+      // Now copy newly parsed children to this node\n+      target.appendChild(parser._asDocumentFragment());\n+\n+    },\n   },\n   outerHTML: {\n     get: function() {\ndiff --git a/lib/Node.js b/lib/Node.js\nindex 66bd6dd53bf6285cc3fc46064584bb087cbe9ae6..4ae8f24b0863528459ce3af29b1b6955656bc693 100644\n--- a/lib/Node.js\n+++ b/lib/Node.js\n@@ -57,6 +57,23 @@ Node.prototype = Object.create(EventTarget.prototype, {\n \n   lastChild: { get: utils.shouldOverride },\n \n+  isConnected: {\n+    get: function () {\n+      let node = this;\n+      while (node != null) {\n+        if (node.nodeType === Node.DOCUMENT_NODE) {\n+          return true;\n+        }\n+\n+        node = node.parentNode;\n+        if (node != null && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n+          node = node.host;\n+        }\n+      }\n+      return false;\n+    },\n+  },\n+\n   previousSibling: { get: function() {\n     var parent = this.parentNode;\n     if (!parent) return null;\ndiff --git a/lib/Window.js b/lib/Window.js\nindex de5fcc669e055956da8cb35a076b6f6cad729715..146db3e2e27c1793669d0fe755cd44af7ff5dd18 100644\n--- a/lib/Window.js\n+++ b/lib/Window.js\n@@ -2,7 +2,6 @@\n var DOMImplementation = require('./DOMImplementation');\n var EventTarget = require('./EventTarget');\n var Location = require('./Location');\n-var sloppy = require('./sloppy');\n var utils = require('./utils');\n \n module.exports = Window;\n@@ -15,7 +14,6 @@ function Window(document) {\n }\n \n Window.prototype = Object.create(EventTarget.prototype, {\n-  _run: { value: sloppy.Window_run },\n   console: { value: console },\n   history: { value: {\n     back: utils.nyi,\ndiff --git a/lib/cssparser.js b/lib/cssparser.js\nindex 80a44b9e4085234944536b602f308df35717e7bf..37c32fdd43478ff46496b31eefc1f919ecdd356d 100644\n--- a/lib/cssparser.js\n+++ b/lib/cssparser.js\n@@ -3652,6 +3652,7 @@ var Properties = {\n     \"-o-animation-play-state\"          : { multi: \"running | paused\", comma: true },\n \n     \"appearance\"                    : \"icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | none | inherit\",\n+    \"aspect-ratio\": 1,\n     \"azimuth\"                       : function (expression) {\n         var simple      = \"<angle> | leftwards | rightwards | inherit\",\n             direction   = \"left-side | far-left | left | center-left | center | center-right | right | far-right | right-side\",\ndiff --git a/lib/defineElement.js b/lib/defineElement.js\nindex 0fd0f19a36963f39dab12928106ecbd6624a52b1..48e57aecf12d27c263fc5ca4d523351fa0ba0059 100644\n--- a/lib/defineElement.js\n+++ b/lib/defineElement.js\n@@ -1,7 +1,6 @@\n \"use strict\";\n \n var attributes = require('./attributes');\n-var sloppy = require('./sloppy');\n var isApiWritable = require(\"./config\").isApiWritable;\n \n module.exports = function(spec, defaultConstructor, tagList, tagNameToImpl) {\n@@ -23,7 +22,7 @@ module.exports = function(spec, defaultConstructor, tagList, tagNameToImpl) {\n     if (spec.events) {\n       addEventHandlers(c, spec.events);\n     }\n-    tagList[c.name] = c;\n+    tagList[spec.name] = c;\n   }\n   else {\n     c = defaultConstructor;\n@@ -43,7 +42,7 @@ function EventHandlerBuilder(body, document, form, element) {\n   this.element = element;\n }\n \n-EventHandlerBuilder.prototype.build = sloppy.EventHandlerBuilder_build;\n+EventHandlerBuilder.prototype.build = function () { return () => {}; };\n \n function EventHandlerChangeHandler(elt, name, oldval, newval) {\n   var doc = elt.ownerDocument || Object.create(null);\ndiff --git a/lib/htmlelts.js b/lib/htmlelts.js\nindex 697b5c8370d53101e23d6041609b8e4831cb4dc0..7a1ef47849fcc3492dfbe829d2d000c37f411c32 100644\n--- a/lib/htmlelts.js\n+++ b/lib/htmlelts.js\n@@ -72,10 +72,16 @@ var HTMLFormElement = function(doc, localName, prefix) {\n \n var HTMLElement = exports.HTMLElement = define({\n   superclass: Element,\n+  name: 'HTMLElement',\n   ctor: function HTMLElement(doc, localName, prefix) {\n     Element.call(this, doc, localName, utils.NAMESPACE.HTML, prefix);\n   },\n   props: {\n+    dangerouslySetInnerHTML: {\n+      set: function (v) {\n+        this._innerHTML = v;\n+      },\n+    },\n     innerHTML: {\n       get: function() {\n         return this.serialize();\n@@ -202,6 +208,7 @@ var HTMLElement = exports.HTMLElement = define({\n \n \n var HTMLUnknownElement = define({\n+  name: 'HTMLUnknownElement',\n   ctor: function HTMLUnknownElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   }\n@@ -217,6 +224,7 @@ var formAssociatedProps = {\n \n define({\n   tag: 'a',\n+  name: 'HTMLAnchorElement',\n   ctor: function HTMLAnchorElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -253,6 +261,7 @@ URLUtils._inherit(htmlNameToImpl.a.prototype);\n \n define({\n   tag: 'area',\n+  name: 'HTMLAreaElement',\n   ctor: function HTMLAreaElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -279,6 +288,7 @@ URLUtils._inherit(htmlNameToImpl.area.prototype);\n \n define({\n   tag: 'br',\n+  name: 'HTMLBRElement',\n   ctor: function HTMLBRElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -290,6 +300,7 @@ define({\n \n define({\n   tag: 'base',\n+  name: 'HTMLBaseElement',\n   ctor: function HTMLBaseElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -301,6 +312,7 @@ define({\n \n define({\n   tag: 'body',\n+  name: 'HTMLBodyElement',\n   ctor: function HTMLBodyElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -330,6 +342,7 @@ define({\n \n define({\n   tag: 'button',\n+  name: 'HTMLButtonElement',\n   ctor: function HTMLButtonElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -349,6 +362,7 @@ define({\n \n define({\n   tag: 'dl',\n+  name: 'HTMLDListElement',\n   ctor: function HTMLDListElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -360,6 +374,7 @@ define({\n \n define({\n   tag: 'data',\n+  name: 'HTMLDataElement',\n   ctor: function HTMLDataElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -370,6 +385,7 @@ define({\n \n define({\n   tag: 'datalist',\n+  name: 'HTMLDataListElement',\n   ctor: function HTMLDataListElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   }\n@@ -377,6 +393,7 @@ define({\n \n define({\n   tag: 'details',\n+  name: 'HTMLDetailsElement',\n   ctor: function HTMLDetailsElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -387,6 +404,7 @@ define({\n \n define({\n   tag: 'div',\n+  name: 'HTMLDivElement',\n   ctor: function HTMLDivElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -398,6 +416,7 @@ define({\n \n define({\n   tag: 'embed',\n+  name: 'HTMLEmbedElement',\n   ctor: function HTMLEmbedElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -414,6 +433,7 @@ define({\n \n define({\n   tag: 'fieldset',\n+  name: 'HTMLFieldSetElement',\n   ctor: function HTMLFieldSetElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -426,6 +446,7 @@ define({\n \n define({\n   tag: 'form',\n+  name: 'HTMLFormElement',\n   ctor: function HTMLFormElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -445,6 +466,7 @@ define({\n \n define({\n   tag: 'hr',\n+  name: 'HTMLHRElement',\n   ctor: function HTMLHRElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -460,6 +482,7 @@ define({\n \n define({\n   tag: 'head',\n+  name: 'HTMLHeadElement',\n   ctor: function HTMLHeadElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   }\n@@ -467,6 +490,7 @@ define({\n \n define({\n   tags: ['h1','h2','h3','h4','h5','h6'],\n+  name: 'HTMLHeadingElement',\n   ctor: function HTMLHeadingElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -478,6 +502,7 @@ define({\n \n define({\n   tag: 'html',\n+  name: 'HTMLHtmlElement',\n   ctor: function HTMLHtmlElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -489,18 +514,9 @@ define({\n \n define({\n   tag: 'iframe',\n+  name: 'HTMLIFrameElement',\n   ctor: function HTMLIFrameElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n-    var Window = require('./Window'); // Avoid circular dependencies.\n-    this._contentWindow = new Window();\n-  },\n-  props: {\n-    contentWindow: { get: function() {\n-      return this._contentWindow;\n-    } },\n-    contentDocument: { get: function() {\n-      return this.contentWindow.document;\n-    } },\n   },\n   attributes: {\n     src: URL,\n@@ -526,6 +542,7 @@ define({\n \n define({\n   tag: 'img',\n+  name: 'HTMLImageElement',\n   ctor: function HTMLImageElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -552,6 +569,7 @@ define({\n \n define({\n   tag: 'input',\n+  name: 'HTMLInputElement',\n   ctor: function HTMLInputElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -615,6 +633,7 @@ define({\n \n define({\n   tag: 'keygen',\n+  name: 'HTMLKeygenElement',\n   ctor: function HTMLKeygenElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -630,6 +649,7 @@ define({\n \n define({\n   tag: 'li',\n+  name: 'HTMLLIElement',\n   ctor: function HTMLLIElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -642,6 +662,7 @@ define({\n \n define({\n   tag: 'label',\n+  name: 'HTMLLabelElement',\n   ctor: function HTMLLabelElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -653,6 +674,7 @@ define({\n \n define({\n   tag: 'legend',\n+  name: 'HTMLLegendElement',\n   ctor: function HTMLLegendElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -664,6 +686,7 @@ define({\n \n define({\n   tag: 'link',\n+  name: 'HTMLLinkElement',\n   ctor: function HTMLLinkElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -687,6 +710,7 @@ define({\n \n define({\n   tag: 'map',\n+  name: 'HTMLMapElement',\n   ctor: function HTMLMapElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -697,6 +721,7 @@ define({\n \n define({\n   tag: 'menu',\n+  name: 'HTMLMenuElement',\n   ctor: function HTMLMenuElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -712,6 +737,7 @@ define({\n \n define({\n   tag: 'meta',\n+  name: 'HTMLMetaElement',\n   ctor: function HTMLMetaElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -726,6 +752,7 @@ define({\n \n define({\n   tag: 'meter',\n+  name: 'HTMLMeterElement',\n   ctor: function HTMLMeterElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -734,6 +761,7 @@ define({\n \n define({\n   tags: ['ins', 'del'],\n+  name: 'HTMLModElement',\n   ctor: function HTMLModElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -745,6 +773,7 @@ define({\n \n define({\n   tag: 'ol',\n+  name: 'HTMLOListElement',\n   ctor: function HTMLOListElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -781,6 +810,7 @@ define({\n \n define({\n   tag: 'object',\n+  name: 'HTMLObjectElement',\n   ctor: function HTMLObjectElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -809,6 +839,7 @@ define({\n \n define({\n   tag: 'optgroup',\n+  name: 'HTMLOptGroupElement',\n   ctor: function HTMLOptGroupElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -820,6 +851,7 @@ define({\n \n define({\n   tag: 'option',\n+  name: 'HTMLOptionElement',\n   ctor: function HTMLOptionElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -853,6 +885,7 @@ define({\n \n define({\n   tag: 'output',\n+  name: 'HTMLOutputElement',\n   ctor: function HTMLOutputElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -865,6 +898,7 @@ define({\n \n define({\n   tag: 'p',\n+  name: 'HTMLParagraphElement',\n   ctor: function HTMLParagraphElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -876,6 +910,7 @@ define({\n \n define({\n   tag: 'param',\n+  name: 'HTMLParamElement',\n   ctor: function HTMLParamElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -890,6 +925,7 @@ define({\n \n define({\n   tags: ['pre',/*legacy elements:*/'listing','xmp'],\n+  name: 'HTMLPreElement',\n   ctor: function HTMLPreElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -901,6 +937,7 @@ define({\n \n define({\n   tag: 'progress',\n+  name: 'HTMLProgressElement',\n   ctor: function HTMLProgressElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -912,6 +949,7 @@ define({\n \n define({\n   tags: ['q', 'blockquote'],\n+  name: 'HTMLQuoteElement',\n   ctor: function HTMLQuoteElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -922,6 +960,7 @@ define({\n \n define({\n   tag: 'script',\n+  name: 'HTMLScriptElement',\n   ctor: function HTMLScriptElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -958,6 +997,7 @@ define({\n \n define({\n   tag: 'select',\n+  name: 'HTMLSelectElement',\n   ctor: function HTMLSelectElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -980,6 +1020,7 @@ define({\n \n define({\n   tag: 'source',\n+  name: 'HTMLSourceElement',\n   ctor: function HTMLSourceElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -992,6 +1033,7 @@ define({\n \n define({\n   tag: 'span',\n+  name: 'HTMLSpanElement',\n   ctor: function HTMLSpanElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   }\n@@ -999,6 +1041,7 @@ define({\n \n define({\n   tag: 'style',\n+  name: 'HTMLStyleElement',\n   ctor: function HTMLStyleElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1011,6 +1054,7 @@ define({\n \n define({\n   tag: 'caption',\n+  name: 'HTMLTableCaptionElement',\n   ctor: function HTMLTableCaptionElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1022,6 +1066,7 @@ define({\n \n \n define({\n+  name: 'HTMLTableCellElement',\n   ctor: function HTMLTableCellElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1046,6 +1091,7 @@ define({\n \n define({\n   tags: ['col', 'colgroup'],\n+  name: 'HTMLTableColElement',\n   ctor: function HTMLTableColElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1062,6 +1108,7 @@ define({\n \n define({\n   tag: 'table',\n+  name: 'HTMLTableElement',\n   ctor: function HTMLTableElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1086,6 +1133,7 @@ define({\n \n define({\n   tag: 'template',\n+  name: 'HTMLTemplateElement',\n   ctor: function HTMLTemplateElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n     this._contentFragment = doc._templateDoc.createDocumentFragment();\n@@ -1098,6 +1146,7 @@ define({\n \n define({\n   tag: 'tr',\n+  name: 'HTMLTableRowElement',\n   ctor: function HTMLTableRowElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1118,6 +1167,7 @@ define({\n \n define({\n   tags: ['thead', 'tfoot', 'tbody'],\n+  name: 'HTMLTableSectionElement',\n   ctor: function HTMLTableSectionElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1137,6 +1187,7 @@ define({\n \n define({\n   tag: 'textarea',\n+  name: 'HTMLTextAreaElement',\n   ctor: function HTMLTextAreaElement(doc, localName, prefix) {\n     HTMLFormElement.call(this, doc, localName, prefix);\n   },\n@@ -1179,6 +1230,7 @@ define({\n \n define({\n   tag: 'time',\n+  name: 'HTMLTimeElement',\n   ctor: function HTMLTimeElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1190,6 +1242,7 @@ define({\n \n define({\n   tag: 'title',\n+  name: 'HTMLTitleElement',\n   ctor: function HTMLTitleElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1202,6 +1255,7 @@ define({\n \n define({\n   tag: 'ul',\n+  name: 'HTMLUListElement',\n   ctor: function HTMLUListElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1213,6 +1267,7 @@ define({\n });\n \n define({\n+  name: 'HTMLMediaElement',\n   ctor: function HTMLMediaElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1231,6 +1286,7 @@ define({\n define({\n   tag: 'audio',\n   superclass: htmlElements.HTMLMediaElement,\n+  name: 'HTMLAudioElement',\n   ctor: function HTMLAudioElement(doc, localName, prefix) {\n     htmlElements.HTMLMediaElement.call(this, doc, localName, prefix);\n   }\n@@ -1239,6 +1295,7 @@ define({\n define({\n   tag: 'video',\n   superclass: htmlElements.HTMLMediaElement,\n+  name: 'HTMLVideoElement',\n   ctor: function HTMLVideoElement(doc, localName, prefix) {\n     htmlElements.HTMLMediaElement.call(this, doc, localName, prefix);\n   },\n@@ -1252,6 +1309,7 @@ define({\n define({\n   tag: 'td',\n   superclass: htmlElements.HTMLTableCellElement,\n+  name: 'HTMLTableDataCellElement',\n   ctor: function HTMLTableDataCellElement(doc, localName, prefix) {\n     htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix);\n   }\n@@ -1260,6 +1318,7 @@ define({\n define({\n   tag: 'th',\n   superclass: htmlElements.HTMLTableCellElement,\n+  name: 'HTMLTableHeaderCellElement',\n   ctor: function HTMLTableHeaderCellElement(doc, localName, prefix) {\n     htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix);\n   },\n@@ -1267,6 +1326,7 @@ define({\n \n define({\n   tag: 'frameset',\n+  name: 'HTMLFrameSetElement',\n   ctor: function HTMLFrameSetElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   }\n@@ -1274,6 +1334,7 @@ define({\n \n define({\n   tag: 'frame',\n+  name: 'HTMLFrameElement',\n   ctor: function HTMLFrameElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   }\n@@ -1281,6 +1342,7 @@ define({\n \n define({\n   tag: 'canvas',\n+  name: 'HTMLCanvasElement',\n   ctor: function HTMLCanvasElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1300,6 +1362,7 @@ define({\n \n define({\n   tag: 'dialog',\n+  name: 'HTMLDialogElement',\n   ctor: function HTMLDialogElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1316,6 +1379,7 @@ define({\n \n define({\n   tag: 'menuitem',\n+  name: 'HTMLMenuItemElement',\n   ctor: function HTMLMenuItemElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1354,6 +1418,7 @@ define({\n \n define({\n   tag: 'source',\n+  name: 'HTMLSourceElement',\n   ctor: function HTMLSourceElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1368,6 +1433,7 @@ define({\n \n define({\n   tag: 'track',\n+  name: 'HTMLTrackElement',\n   ctor: function HTMLTrackElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1391,6 +1457,7 @@ define({\n define({\n   // obsolete\n   tag: 'font',\n+  name: 'HTMLFontElement',\n   ctor: function HTMLFontElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\n@@ -1404,6 +1471,7 @@ define({\n define({\n   // obsolete\n   tag: 'dir',\n+  name: 'HTMLDirectoryElement',\n   ctor: function HTMLDirectoryElement(doc, localName, prefix) {\n     HTMLElement.call(this, doc, localName, prefix);\n   },\ndiff --git a/lib/index.d.ts b/lib/index.d.ts\nindex a0cbb92c03729fcbd9c39213e5e112087baf8289..504150101e24a928ea16b52e46de0bd40ca06846 100644\n--- a/lib/index.d.ts\n+++ b/lib/index.d.ts\n@@ -1,5 +1,4 @@\n declare module \"domino\" {\n   function createDOMImplementation(): DOMImplementation;\n   function createDocument(html?: string, force?: boolean): Document;\n-  function createWindow(html?: string, address?: string): Window;\n }\n\\ No newline at end of file\ndiff --git a/lib/index.js b/lib/index.js\nindex 47c758447f251d9bcccc1bd57f40ca540010e55f..3ac6ae207767260334a3c02ef3cf73e041c600f6 100644\n--- a/lib/index.js\n+++ b/lib/index.js\n@@ -70,10 +70,4 @@ exports.createIncrementalHTMLParser = function() {\n     };\n };\n \n-exports.createWindow = function(html, address) {\n-  var document = exports.createDocument(html);\n-  if (address !== undefined) { document._address = address; }\n-  return new Window(document);\n-};\n-\n exports.impl = require('./impl');\ndiff --git a/lib/sloppy.js b/lib/sloppy.js\nindex b5d8950a8ea98d2d58723c1f96eeabb260699e24..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644\n--- a/lib/sloppy.js\n+++ b/lib/sloppy.js\n@@ -1,24 +0,0 @@\n-/* Domino uses sloppy-mode features (in particular, `with`) for a few\n- * minor things.  This file encapsulates all the sloppiness; every\n- * other module should be strict. */\n-/* jshint strict: false */\n-/* jshint evil: true */\n-/* jshint -W085 */\n-module.exports = {\n-  Window_run: function _run(code, file) {\n-    if (file) code += '\\n//@ sourceURL=' + file;\n-    with(this) eval(code);\n-  },\n-  EventHandlerBuilder_build: function build() {\n-    try {\n-      with(this.document.defaultView || Object.create(null))\n-        with(this.document)\n-          with(this.form)\n-            with(this.element)\n-              return eval(\"(function(event){\" + this.body + \"})\");\n-    }\n-    catch (err) {\n-      return function() { throw err; };\n-    }\n-  }\n-};\ndiff --git a/lib/svg.js b/lib/svg.js\nindex 7e5bf0dc5323ed156a4d5220422959227d72cb72..24aca192bea2661701bf43983c1317dc4fcf497c 100644\n--- a/lib/svg.js\n+++ b/lib/svg.js\n@@ -18,6 +18,7 @@ function define(spec) {\n \n var SVGElement = define({\n   superclass: Element,\n+  name: 'SVGElement',\n   ctor: function SVGElement(doc, localName, prefix) {\n     Element.call(this, doc, localName, utils.NAMESPACE.SVG, prefix);\n   },\n@@ -31,6 +32,7 @@ var SVGElement = define({\n });\n \n define({\n+  name: 'SVGSVGElement',\n   ctor: function SVGSVGElement(doc, localName, prefix) {\n     SVGElement.call(this, doc, localName, prefix);\n   },\n"
  },
  {
    "path": "pnpm-workspace.yaml",
    "content": "packages:\n  - packages/*\n  - e2e/*\n\nautoInstallPeers: false\n\nengineStrict: true\n\nonlyBuiltDependencies:\n  - '@parcel/watcher'\n  - '@rolldown/browser'\n  - '@tailwindcss/oxide'\n  - esbuild\n  - netlify-cli\n  - puppeteer\n  - sharp\n  - simple-git-hooks\n  - unix-dgram\n  - workerd\n\noverrides:\n  typescript: 5.4.5\n  vfile: 6.0.3\n  # 1.0.6 uses node:events, breaks REPL\n  '@napi-rs/wasm-runtime': 1.0.5\n\npatchedDependencies:\n  density-clustering@1.3.0: patches/density-clustering@1.3.0.patch\n  domino@2.1.6: patches/domino@2.1.6.patch\n\nshellEmulator: true\n"
  },
  {
    "path": "rust-toolchain",
    "content": "nightly-2025-10-01\n"
  },
  {
    "path": "rustfmt.toml",
    "content": "hard_tabs = true\n"
  },
  {
    "path": "scripts/api-docs.ts",
    "content": "import { execa } from 'execa';\nimport { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { format } from 'prettier';\nimport { type BuildConfig, toSnakeCase } from './util.ts';\n\nexport async function generateQwikApiMarkdownDocs(config: BuildConfig, apiJsonInputDir: string) {\n  await generateApiMarkdownPackageDocs(config, apiJsonInputDir, ['qwik']);\n}\n\nexport async function generateQwikCityApiMarkdownDocs(\n  config: BuildConfig,\n  apiJsonInputDir: string\n) {\n  await generateApiMarkdownPackageDocs(config, apiJsonInputDir, ['qwik-city']);\n  await generateApiMarkdownPackageDocs(config, apiJsonInputDir, ['qwik-city', 'middleware']);\n  await generateApiMarkdownPackageDocs(config, apiJsonInputDir, ['qwik-city', 'static']);\n  await generateApiMarkdownPackageDocs(config, apiJsonInputDir, ['qwik-city', 'vite']);\n\n  // doesn't really belong here, ah well\n  await generateApiMarkdownPackageDocs(config, apiJsonInputDir, ['qwik-react']);\n}\n\nasync function generateApiMarkdownPackageDocs(\n  config: BuildConfig,\n  apiJsonInputDir: string,\n  pkgNames: string[]\n) {\n  const pkgDirNames = join(apiJsonInputDir, ...pkgNames);\n  if (existsSync(pkgDirNames)) {\n    const subPkgDirNames = readdirSync(pkgDirNames);\n    for (const subPkgDirName of subPkgDirNames) {\n      await generateApiMarkdownSubPackageDocs(config, apiJsonInputDir, [\n        ...pkgNames,\n        subPkgDirName,\n      ]);\n    }\n  }\n}\n\nasync function generateApiMarkdownSubPackageDocs(\n  config: BuildConfig,\n  apiJsonInputDir: string,\n  names: string[]\n) {\n  const subPkgInputDir = join(apiJsonInputDir, ...names);\n  const docsApiJsonPath = join(subPkgInputDir, 'docs.api.json');\n  if (!existsSync(docsApiJsonPath)) {\n    return;\n  }\n\n  const subPkgName = ['@builder.io', ...names].filter((n) => n !== 'core').join('/');\n  console.log('📚', `Generate API ${subPkgName} markdown docs`);\n\n  const apiOuputDir = join(\n    config.rootDir,\n    'dist-dev',\n    'api-docs',\n    names.filter((n) => n !== 'core').join('-')\n  );\n  mkdirSync(apiOuputDir, { recursive: true });\n  console.log(apiOuputDir);\n\n  await execa(\n    'api-documenter',\n    ['markdown', '--input-folder', subPkgInputDir, '--output-folder', apiOuputDir],\n    {\n      stdio: 'inherit',\n      cwd: join(config.rootDir, 'node_modules', '.bin'),\n    }\n  );\n\n  await createApiData(config, docsApiJsonPath, apiOuputDir, subPkgName);\n}\n\nasync function createApiData(\n  config: BuildConfig,\n  docsApiJsonPath: string,\n  apiOuputDir: string,\n  subPkgName: string\n) {\n  const apiExtractedJson = JSON.parse(readFileSync(docsApiJsonPath, 'utf-8'));\n\n  const apiData: ApiData = {\n    id: subPkgName.replace('@builder.io/', '').replace(/\\//g, '-'),\n    package: subPkgName,\n    members: [],\n  };\n\n  function addMember(apiExtract: any, hierarchyStr: string) {\n    const apiName = apiExtract.name || '';\n    const apiKind = apiExtract.kind || '';\n    if (apiName.length === 0) {\n      return;\n    }\n\n    if (apiKind === 'PropertySignature') {\n      if (!apiName.includes(':')) {\n        // do not include PropertySignatures unless they are namespaced\n        // like q:slot or preventdefault:click\n        return;\n      }\n    }\n\n    const hierarchySplit = hierarchyStr.split('/').filter((m) => m.length > 0);\n    hierarchySplit.push(apiName);\n\n    const hierarchy = hierarchySplit.map((h) => {\n      return {\n        name: h,\n        id: getCanonical(hierarchySplit),\n      };\n    });\n\n    const id = getCanonical(hierarchySplit);\n\n    const mdFile = getMdFile(subPkgName, hierarchySplit);\n    const mdPath = join(apiOuputDir, mdFile);\n\n    const content: string[] = [];\n\n    if (existsSync(mdPath)) {\n      const mdSrcLines = readFileSync(mdPath, 'utf-8').split(/\\r?\\n/);\n\n      for (const line of mdSrcLines) {\n        if (line.startsWith('## ')) {\n          continue;\n        }\n        if (line.startsWith('[Home]')) {\n          continue;\n        }\n        if (line.startsWith('<!-- ')) {\n          continue;\n        }\n        if (line.startsWith('**Signature:**')) {\n          continue;\n        }\n        content.push(line);\n      }\n    } else {\n      console.log('Unable to find md for', mdFile);\n    }\n\n    apiData.members.push({\n      name: apiName,\n      id,\n      hierarchy,\n      kind: apiKind,\n      content: content.join('\\n').trim(),\n      editUrl: getEditUrl(config, apiExtract.fileUrlPath),\n      mdFile,\n    });\n  }\n\n  function addMembers(apiExtract: any, hierarchyStr: string) {\n    if (Array.isArray(apiExtract?.members)) {\n      for (const member of apiExtract.members) {\n        addMembers(member, hierarchyStr + '/' + member.name);\n        if (member.kind === 'Package' || member.kind === 'EntryPoint') {\n          continue;\n        }\n        if (apiData.members.some((m) => member.name === m.name && member.kind === m.kind)) {\n          continue;\n        }\n        addMember(member, hierarchyStr);\n      }\n    }\n  }\n\n  addMembers(apiExtractedJson, '');\n\n  apiData.members.forEach((m1) => {\n    apiData.members.forEach((m2) => {\n      while (m1.content.includes(`./${m2.mdFile}`)) {\n        m1.content = m1.content.replace(`./${m2.mdFile}`, `#${m2.id}`);\n      }\n    });\n  });\n\n  apiData.members.forEach((m) => {\n    m.content = m.content.replace(/\\.\\/qwik(.*)\\.md/g, '#');\n  });\n\n  apiData.members.sort((a, b) => {\n    return a.name.localeCompare(b.name);\n  });\n\n  const docsDir = join(config.packagesDir, 'docs', 'src', 'routes', 'api', apiData.id);\n  mkdirSync(docsDir, { recursive: true });\n\n  const apiJsonPath = join(docsDir, `api.json`);\n  writeFileSync(apiJsonPath, JSON.stringify(apiData, null, 2));\n\n  const apiMdPath = join(docsDir, `index.mdx`);\n  writeFileSync(apiMdPath, await createApiMarkdown(apiData));\n}\n\nasync function createApiMarkdown(a: ApiData) {\n  let md: string[] = [];\n\n  const memberNameCounts = a.members.reduce((acc: Record<string, number>, m) => {\n    const normalizedName = m.name.toLowerCase();\n    acc[normalizedName] = (acc[normalizedName] || 0) + 1;\n    return acc;\n  }, {});\n\n  md.push(`---`);\n  md.push(`title: \\\\${a.package} API Reference`);\n  md.push(`---`);\n  md.push(``);\n  md.push(`# [API](/api) &rsaquo; ${a.package}`);\n  md.push(``);\n\n  for (const m of a.members) {\n    // const title = `${toSnakeCase(m.kind)} - ${m.name.replace(/\"/g, '')}`;\n    const kind = toSnakeCase(m.kind);\n    const isDuplicateName = memberNameCounts[m.name.toLowerCase()] > 1;\n    const anchorId = isDuplicateName ? `${m.id}-${kind}` : m.id;\n\n    md.push(`<h2 id=\"${anchorId}\">${m.name}</h2>`);\n    md.push(``);\n\n    // sanitize / adjust output\n\n    // Process the content to escape { characters only outside code blocks\n    let processedContent = '';\n    let inCodeBlock = false;\n    let inInlineCode = false;\n\n    const lines = m.content.split('\\n');\n\n    for (let i = 0; i < lines.length; i++) {\n      let line = lines[i]\n        .replace(/<!--(.|\\s)*?-->/g, '')\n        // .replace(/<Slot\\/>/g, ''\n        .replace(/\\\\#\\\\#\\\\# (\\w+)/gm, '### $1')\n        .replace(/\\\\\\[/gm, '[')\n        .replace(/\\\\\\]/gm, ']');\n\n      // Check for triple backtick code blocks\n      if (line.trim().startsWith('```')) {\n        inCodeBlock = !inCodeBlock;\n        processedContent += line + '\\n';\n        continue;\n      }\n\n      if (!inCodeBlock) {\n        // Process line character by character for inline code\n        let newLine = '';\n        for (let j = 0; j < line.length; j++) {\n          const char = line[j];\n\n          // Toggle inline code state when we see a backtick\n          if (char === '`') {\n            inInlineCode = !inInlineCode;\n            newLine += char;\n            continue;\n          }\n\n          // Escape { when not in any code context\n          if (char === '{' && !inInlineCode) {\n            newLine += '\\\\{';\n          } else {\n            newLine += char;\n          }\n        }\n        processedContent += newLine + '\\n';\n      } else {\n        // In code block, don't change anything\n        processedContent += line + '\\n';\n      }\n    }\n\n    md.push(processedContent.trim());\n    md.push(``);\n\n    if (m.editUrl) {\n      md.push(`[Edit this section](${m.editUrl})`);\n      md.push(``);\n    }\n  }\n\n  const mdOutput = await format(md.join('\\n'), {\n    parser: 'markdown',\n  });\n  return mdOutput;\n}\n\ninterface ApiData {\n  id: string;\n  package: string;\n  members: ApiMember[];\n}\n\ninterface ApiMember {\n  id: string;\n  name: string;\n  hierarchy: { name: string; id: string }[];\n  kind: string;\n  content: string;\n  editUrl?: string;\n  mdFile: string;\n}\n\nfunction getCanonical(hierarchy: string[]) {\n  return hierarchy.map((h) => getSafeFilenameForName(h)).join('-');\n}\n\nfunction getMdFile(subPkgName: string, hierarchy: string[]) {\n  let mdFile = '';\n  for (const h of hierarchy) {\n    mdFile += '.' + getSafeFilenameForName(h);\n  }\n  return `qwik${subPkgName.includes('city') ? '-city' : ''}${mdFile}.md`;\n}\n\nfunction getSafeFilenameForName(name: string): string {\n  // https://github.com/microsoft/rushstack/blob/d0f8f10a9ce1ce4158ca2da5b79c54c71d028d89/apps/api-documenter/src/utils/Utilities.ts\n  return name.replace(/[^a-z0-9_\\-\\.]/gi, '_').toLowerCase();\n}\n\nfunction getEditUrl(config: BuildConfig, fileUrlPath: string | undefined) {\n  if (fileUrlPath) {\n    const rootRelPath = fileUrlPath.slice(fileUrlPath.indexOf('dts-out') + 'dts-out'.length + 1);\n\n    const tsxPath = join(config.rootDir, rootRelPath).replace(`.d.ts`, `.tsx`);\n    if (existsSync(tsxPath)) {\n      const url = new URL(rootRelPath, `https://github.com/QwikDev/qwik/tree/main/`);\n      return url.href.replace(`.d.ts`, `.tsx`);\n    }\n\n    const tsPath = join(config.rootDir, rootRelPath).replace(`.d.ts`, `.ts`);\n    if (existsSync(tsPath)) {\n      const url = new URL(rootRelPath, `https://github.com/QwikDev/qwik/tree/main/`);\n      return url.href.replace(`.d.ts`, `.ts`);\n    }\n  }\n  return undefined;\n}\n"
  },
  {
    "path": "scripts/api.ts",
    "content": "import { Extractor, ExtractorConfig } from '@microsoft/api-extractor';\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { generateQwikApiMarkdownDocs, generateQwikCityApiMarkdownDocs } from './api-docs.ts';\nimport { type BuildConfig, panic, copyFile, ensureDir } from './util.ts';\n\n/**\n * Create each submodule's bundled dts file, and ensure the public API has not changed for a\n * production build.\n */\nexport async function apiExtractorQwik(config: BuildConfig) {\n  // core\n  // Run the api extractor for each of the submodules\n  createTypesApi(\n    config,\n    join(config.srcQwikDir, 'core'),\n    join(config.distQwikPkgDir, 'core.d.ts'),\n    '.'\n  );\n  writeFileSync(\n    join(config.distQwikPkgDir, 'index.d.ts'),\n    `// re-export to make TS happy when not using nodenext import resolution\\nexport * from './core';`\n  );\n  // Special case for jsx-runtime:\n  // It only re-exports JSX. Don't duplicate the types\n  const jsxContent = readFileSync(join(config.srcQwikDir, 'jsx-runtime.ts'), 'utf-8');\n  writeFileSync(\n    join(config.distQwikPkgDir, 'jsx-runtime.d.ts'),\n    `// re-export to make TS happy when not using nodenext import resolution\\n${jsxContent}`\n  );\n  ensureDir(join(config.distQwikPkgDir, 'jsx-runtime'));\n  writeFileSync(\n    join(config.distQwikPkgDir, 'jsx-runtime', 'index.d.ts'),\n    `// re-export to make TS happy when not using nodenext import resolution\\nexport * from '../jsx-runtime';`\n  );\n  createTypesApi(\n    config,\n    join(config.srcQwikDir, 'optimizer'),\n    join(config.distQwikPkgDir, 'optimizer.d.ts'),\n    '.'\n  );\n  createTypesApi(\n    config,\n    join(config.srcQwikDir, 'server'),\n    join(config.distQwikPkgDir, 'server.d.ts'),\n    '.'\n  );\n  createTypesApi(\n    config,\n    join(config.srcQwikDir, 'testing'),\n    join(config.distQwikPkgDir, 'testing', 'index.d.ts'),\n    '..'\n  );\n  createTypesApi(\n    config,\n    join(config.srcQwikDir, 'build'),\n    join(config.distQwikPkgDir, 'build', 'index.d.ts'),\n    '..'\n  );\n  generateServerReferenceModules(config);\n\n  const apiJsonInputDir = join(config.rootDir, 'dist-dev', 'api');\n  await generateQwikApiMarkdownDocs(config, apiJsonInputDir);\n\n  console.log('🥶', 'qwik d.ts API files generated');\n}\n\nexport async function apiExtractorQwikCity(config: BuildConfig) {\n  // qwik-city\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'runtime', 'src'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'runtime', 'src', 'service-worker'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'service-worker.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'buildtime', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'azure-swa', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'azure-swa', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'cloudflare-pages', 'vite'),\n    join(\n      config.packagesDir,\n      'qwik-city',\n      'lib',\n      'adapters',\n      'cloudflare-pages',\n      'vite',\n      'index.d.ts'\n    )\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'cloud-run', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'cloud-run', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'deno-server', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'deno-server', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'bun-server', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'bun-server', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'node-server', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'node-server', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'netlify-edge', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'netlify-edge', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'shared', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'shared', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'static', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'static', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'adapters', 'vercel-edge', 'vite'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'vercel-edge', 'vite', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'azure-swa'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'azure-swa', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'aws-lambda'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'aws-lambda', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'cloudflare-pages'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'cloudflare-pages', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'bun'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'bun', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'deno'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'deno', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'netlify-edge'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'netlify-edge', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'node'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'node', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'request-handler'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'request-handler', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'firebase'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'firebase', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'static'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'static', 'index.d.ts')\n  );\n  createTypesApi(\n    config,\n    join(config.packagesDir, 'qwik-city', 'src', 'middleware', 'vercel-edge'),\n    join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'vercel-edge', 'index.d.ts')\n  );\n  generateQwikCityReferenceModules(config);\n\n  const apiJsonInputDir = join(config.rootDir, 'dist-dev', 'api');\n  await generateQwikCityApiMarkdownDocs(config, apiJsonInputDir);\n\n  console.log('🥶', 'qwik-city d.ts API files generated');\n}\n\nfunction createTypesApi(\n  config: BuildConfig,\n  inPath: string,\n  outPath: string,\n  relativePath?: string\n) {\n  const extractorConfigPath = join(inPath, 'api-extractor.json');\n  const extractorConfig = ExtractorConfig.loadFileAndPrepare(extractorConfigPath);\n  const result = Extractor.invoke(extractorConfig, {\n    localBuild: !!config.dev,\n    showVerboseMessages: true,\n    showDiagnostics: true,\n    messageCallback(msg) {\n      msg.handled = true;\n      if (msg.logLevel === 'verbose') {\n        return;\n      }\n      if (msg.text.includes('Analysis will use')) {\n        return;\n      }\n      if (msg.messageId === 'console-api-report-copied') {\n        if (config.dev) {\n          return;\n        }\n        console.error(\n          `❌ API Extractor, submodule: \"${inPath}\"\\n${extractorConfigPath} has API changes.\\n`\n        );\n        return;\n      }\n      if (\n        msg.messageId === 'console-compiler-version-notice' ||\n        msg.messageId === 'ae-undocumented'\n      ) {\n        return;\n      }\n      console.error(`❌ API Extractor, submodule: \"${inPath}\"\\n${extractorConfigPath}\\n`, msg);\n    },\n  });\n  if (!result.succeeded) {\n    console.log(\n      'API build results: API changed',\n      result.apiReportChanged,\n      'errors',\n      result.errorCount,\n      'warnings',\n      result.warningCount\n    );\n    panic(\n      `Use \"pnpm api.update\" to automatically update the .md files if the api changes were expected`\n    );\n  }\n  const srcPath = result.extractorConfig.untrimmedFilePath;\n  const content = fixDtsContent(config, srcPath, relativePath);\n  writeFileSync(outPath, content);\n}\n\nfunction generateQwikCityReferenceModules(config: BuildConfig) {\n  const srcModulesPath = join(config.packagesDir, 'qwik-city', 'lib');\n\n  const destModulesPath = join(srcModulesPath, 'modules.d.ts');\n  copyFile(join(config.packagesDir, 'qwik-city', 'modules.d.ts'), destModulesPath);\n\n  // manually prepend the ts reference since api extractor removes it\n  const prependReferenceDts = `/// <reference path=\"./modules.d.ts\" />\\n\\n`;\n  const distIndexPath = join(srcModulesPath, 'index.d.ts');\n  let serverDts = readFileSync(distIndexPath, 'utf-8');\n  serverDts = prependReferenceDts + serverDts;\n  writeFileSync(distIndexPath, serverDts);\n}\n\nfunction generateServerReferenceModules(config: BuildConfig) {\n  // server-modules.d.ts\n  const referenceDts = `/// <reference types=\"./server\" />\ndeclare module '@qwik-client-manifest' {\n  const manifest: import('./optimizer').QwikManifest;\n  export { manifest };\n}\n// MD\ndeclare module '*.md' {\n  const node: import('./core').FunctionComponent;\n  export const frontmatter: Record<string, any>;\n  export default node;\n}\n// MDX\ndeclare module '*.mdx' {\n  const node: import('./core').FunctionComponent;\n  export const frontmatter: Record<string, any>;\n  export default node;\n}\n// SVG ?jsx\ndeclare module '*.svg?jsx' {\n  const Cmp: import('./core').FunctionComponent<import('./core').QwikIntrinsicElements['svg']>\n  export default Cmp;\n}\n// Image ?jsx\ndeclare module '*?jsx' {\n  const Cmp: import('./core').FunctionComponent<Omit<import('./core').QwikIntrinsicElements['img'], 'src' | 'width' | 'height' | 'srcSet'>>\n  export default Cmp;\n  export const width: number;\n  export const height: number;\n  export const srcSet: string;\n}\n// Image &jsx\ndeclare module '*&jsx' {\n  const Cmp: import('./core').FunctionComponent<Omit<import('./core').QwikIntrinsicElements['img'], 'src' | 'width' | 'height' | 'srcSet'>>\n  export default Cmp;\n  export const width: number;\n  export const height: number;\n  export const srcSet: string;\n}\n`;\n\n  const destServerModulesPath = join(config.distQwikPkgDir, 'server-modules.d.ts');\n  writeFileSync(destServerModulesPath, referenceDts);\n\n  // manually prepend the ts reference since api extractor removes it\n  const prependReferenceDts = `/// <reference path=\"./server-modules.d.ts\" />\\n\\n`;\n  const distServerPath = join(config.distQwikPkgDir, 'server.d.ts');\n  let serverDts = readFileSync(distServerPath, 'utf-8');\n  serverDts = prependReferenceDts + serverDts;\n  writeFileSync(distServerPath, serverDts);\n}\n\n/**\n * Fix up the generated dts content, and ensure it's using a relative path to find the core.d.ts\n * file, rather than node resolving it.\n */\nfunction fixDtsContent(config: BuildConfig, srcPath: string, relativePath?: string) {\n  let dts = readFileSync(srcPath, 'utf-8');\n\n  // ensure we're just using a relative path\n  if (relativePath) {\n    dts = dts.replace(/'@builder\\.io\\/qwik(.*)'/g, `'${relativePath}$1'`);\n  }\n\n  // replace QWIK_VERSION with the actual version number, useful for debugging\n  return dts.replace(/QWIK_VERSION/g, config.distVersion);\n}\n"
  },
  {
    "path": "scripts/binding-platform.ts",
    "content": "import spawn from 'cross-spawn';\nimport { copyFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { ensureDir, type BuildConfig } from './util.ts';\n\nexport async function buildPlatformBinding(config: BuildConfig) {\n  await new Promise((resolve, reject) => {\n    try {\n      ensureDir(config.distQwikPkgDir);\n      ensureDir(config.distBindingsDir);\n\n      const cmd = `napi`;\n      const args = [\n        `build`,\n        `--cargo-name`,\n        'qwik_napi',\n        `--platform`,\n        `--config=packages/qwik/src/napi/napi.config.json`,\n        config.distBindingsDir,\n      ];\n\n      if (config.platformTarget) {\n        args.push(`--target`, config.platformTarget);\n      }\n      if (!config.dev) {\n        args.push(`--release`);\n        args.push(`--strip`);\n      }\n\n      const napiCwd = join(config.rootDir);\n\n      const child = spawn(cmd, args, { stdio: 'inherit', cwd: napiCwd });\n      child.on('error', reject);\n\n      child.on('close', (code) => {\n        if (code === 0) {\n          resolve(child.stdout);\n        } else {\n          reject(`napi exited with code ${code}`);\n        }\n      });\n    } catch (e) {\n      reject(e);\n    }\n  });\n\n  console.log('🐯 native binding');\n}\n\n// TODO only download current target and wasm\nexport async function copyPlatformBindingWasm(config: BuildConfig) {\n  ensureDir(config.distQwikPkgDir);\n  ensureDir(config.distBindingsDir);\n  const cacheDir = join(config.tmpDir, `cached-bindings`);\n\n  let version = config.distVersion;\n  const isDev = version.includes('-dev');\n  let cdnUrl = 'https://cdn.jsdelivr.net/npm/';\n  let packageName: string;\n  if (isDev) {\n    cdnUrl = `https://pkg.pr.new/QwikDev/qwik/`;\n    version = version.split('-dev')[0];\n  }\n  if (version.startsWith('2')) {\n    // 6903 is the PR that builds v2\n    packageName = `@qwik.dev/core@${isDev ? '6903' : version}`;\n  } else {\n    packageName = `@builder.io/qwik@${isDev ? 'main' : version}`;\n  }\n\n  let cacheVersionDir: string;\n  if (isDev) {\n    // We fetch from pkg.pr.new which is a CDN for the CI builds\n    // It redirects to the latest version\n    cdnUrl = `${cdnUrl}${packageName}`;\n    // First request the URL, this will redirect to the latest version\n    const rsp = await fetch(cdnUrl);\n    if (!rsp.ok) {\n      throw new Error(`Unable to find Qwik package from ${cdnUrl}`);\n    }\n    const url = rsp.url;\n    // get the package name from the url\n    const realPackageName = url.split('/').pop()!;\n    // now check if we already have this package in the cache\n    const cachedPath = join(cacheDir, realPackageName);\n    if (!existsSync(cachedPath)) {\n      ensureDir(cacheDir);\n      // download the package\n      console.log(`🦉 downloading CI build from ${url}`);\n      const pkgRsp = await fetch(url);\n      if (!pkgRsp.ok) {\n        console.error(pkgRsp);\n        throw new Error(`Unable to fetch Qwik package from ${pkgRsp.url}`);\n      }\n      await writeFile(cachedPath, pkgRsp.body as any);\n    }\n    // now unpack the package using tar, into the cache directory\n    const unpackedPath = join(cacheDir, `${realPackageName}-unpacked`);\n    ensureDir(unpackedPath);\n    await new Promise((resolve, reject) => {\n      const child = spawn('tar', ['-xvf', cachedPath, '-C', unpackedPath]);\n      child.on('error', (e) => {\n        console.error(e);\n        reject(e);\n      });\n      child.on('close', (code) => {\n        if (code === 0) {\n          resolve(child.stdout);\n        } else {\n          console.error(child.stdout);\n          reject(`tar exited with code ${code}`);\n        }\n      });\n    });\n\n    // now we need to find the bindings in the package\n    cacheVersionDir = join(unpackedPath, 'package', 'bindings');\n  } else {\n    cdnUrl = `${cdnUrl}${packageName}/bindings/`;\n    cacheVersionDir = join(cacheDir, version);\n    ensureDir(cacheVersionDir);\n  }\n\n  try {\n    const bindingFilenames = [\n      'qwik.darwin-arm64.node',\n      'qwik.darwin-x64.node',\n      'qwik.linux-x64-gnu.node',\n      'qwik.wasm.cjs',\n      'qwik.wasm.mjs',\n      'qwik.win32-x64-msvc.node',\n      'qwik_wasm_bg.wasm',\n    ];\n\n    await Promise.all(\n      bindingFilenames.map(async (bindingFilename) => {\n        const cachedPath = join(cacheVersionDir, bindingFilename);\n        const distPath = join(config.distBindingsDir, bindingFilename);\n\n        if (!existsSync(cachedPath)) {\n          if (isDev) {\n            throw new Error(`Unable to find Qwik binding from ${cachedPath}`);\n          }\n          const url = `${cdnUrl}${bindingFilename}`;\n          console.log(`🦉 native binding / wasm (downloading from ${url})`);\n          const rsp = (await fetch(url)) as any;\n          if (!rsp.ok) {\n            throw new Error(`Unable to fetch Qwik binding from ${rsp.url}`);\n          }\n          await writeFile(cachedPath, rsp.body);\n        }\n\n        await copyFile(cachedPath, distPath);\n      })\n    );\n\n    console.log(`🦉 native binding / wasm (copied from npm v${version})`);\n  } catch (e) {\n    console.warn(`😱 ${e}`);\n  }\n}\n"
  },
  {
    "path": "scripts/binding-wasm.ts",
    "content": "import { type BuildConfig, copyFile, emptyDir, ensureDir } from './util.ts';\nimport spawn from 'cross-spawn';\nimport { join } from 'node:path';\nimport { rollup } from 'rollup';\n\nexport async function buildWasmBinding(config: BuildConfig) {\n  const srcWasmDir = join(config.srcQwikDir, `wasm`);\n  const tmpBuildDir = join(config.tmpDir, `wasm-out`);\n\n  ensureDir(config.distQwikPkgDir);\n  ensureDir(config.distBindingsDir);\n  emptyDir(tmpBuildDir);\n\n  async function buildForTarget(env = {}) {\n    const cmd = `wasm-pack`;\n    const args = [`build`, '--target', 'web', `--out-dir`, tmpBuildDir, srcWasmDir];\n    if (!config.dev) {\n      args.push(`--release`);\n    }\n\n    await new Promise((resolve, reject) => {\n      const child = spawn(cmd, args, {\n        stdio: 'inherit',\n        shell: true,\n        env: {\n          ...process.env,\n          ...env,\n        },\n      });\n      child.on('error', reject);\n\n      child.on('close', (code) => {\n        if (code === 0) {\n          resolve(child.stdout);\n        } else {\n          reject(`wasm-pack exited with code ${code}`);\n        }\n      });\n    });\n    return join(tmpBuildDir, 'qwik_wasm.js');\n  }\n\n  const wasmJsBuildPath = await buildForTarget({\n    CARGO_PROFILE_RELEASE_LTO: true,\n    CARGO_PROFILE_RELEASE_PANIC: 'abort',\n    CARGO_PROFILE_RELEASE_OPT_LEVEL: 'z',\n  });\n\n  const build = await rollup({\n    input: wasmJsBuildPath,\n  });\n\n  await build.write({\n    format: 'es',\n    file: join(config.distBindingsDir, 'qwik.wasm.mjs'),\n    exports: 'named',\n  });\n\n  await build.write({\n    format: 'cjs',\n    file: join(config.distBindingsDir, 'qwik.wasm.cjs'),\n    exports: 'named',\n  });\n\n  await copyFile(\n    join(tmpBuildDir, 'qwik_wasm_bg.wasm'),\n    join(config.distBindingsDir, 'qwik_wasm_bg.wasm')\n  );\n\n  console.log('🐻 wasm binding');\n}\n"
  },
  {
    "path": "scripts/build-clean.ts",
    "content": "import { existsSync, rmSync } from 'node:fs';\n\nconst locations = [\n  'packages/qwik/dist/',\n  'packages/qwik-city/lib/',\n  'packages/docs/dist/',\n  'packages/insights/dist/',\n  'packages/qwik-labs/lib/',\n  'packages/qwik-labs/vite/',\n];\n\nfor (const location of locations) {\n  if (existsSync(location)) {\n    rmSync(location, { recursive: true, force: true });\n  }\n}\n"
  },
  {
    "path": "scripts/build.ts",
    "content": "import { rmSync } from 'fs';\nimport { copyFile, watch } from 'fs/promises';\nimport { join } from 'path';\nimport { apiExtractorQwik, apiExtractorQwikCity } from './api.ts';\nimport { buildPlatformBinding, copyPlatformBindingWasm } from './binding-platform.ts';\nimport { buildWasmBinding } from './binding-wasm.ts';\nimport { buildCreateQwikCli } from './create-qwik-cli.ts';\nimport { buildEslint } from './eslint.ts';\nimport { buildQwikAuth } from './qwik-auth.ts';\nimport { buildQwikCity } from './qwik-city.ts';\nimport { buildQwikLabs } from './qwik-labs.ts';\nimport { buildQwikReact } from './qwik-react.ts';\nimport { buildQwikWorker } from './qwik-worker.ts';\nimport {\n  commitPrepareReleaseVersion,\n  prepareReleaseVersion,\n  publish,\n  setDistVersion,\n  setReleaseVersion,\n} from './release.ts';\nimport { submoduleBuild } from './submodule-build.ts';\nimport { submoduleCli } from './submodule-cli.ts';\nimport { submoduleCore } from './submodule-core.ts';\nimport { submoduleOptimizer } from './submodule-optimizer.ts';\nimport { submoduleQwikLoader } from './submodule-qwikloader.ts';\nimport { submoduleServer } from './submodule-server.ts';\nimport { submoduleTesting } from './submodule-testing.ts';\nimport { buildSupabaseAuthHelpers } from './supabase-auth-helpers.ts';\nimport { tsc, tscQwik, tscQwikCity } from './tsc.ts';\nimport { tscDocs } from './tsc-docs.ts';\nimport { emptyDir, ensureDir, panic, type BuildConfig } from './util.ts';\nimport { validateBuild } from './validate-build.ts';\nimport { submodulePreloader } from './submodule-preloader.ts';\n\n/**\n * Complete a full build for all of the package's submodules. Passed in config has all the correct\n * absolute paths to read from and write to. Additionally, a dev build does not empty the directory,\n * and uses esbuild for each of the submodules for speed. A production build will use TSC + Rollup +\n * Terser for the core submodule.\n */\nexport async function build(config: BuildConfig) {\n  config.devRelease = config.devRelease || (!!config.release && config.setDistTag === 'dev');\n  try {\n    if (config.prepareRelease) {\n      // locally set the version for the upcoming release\n      await prepareReleaseVersion(config);\n    } else if (config.release && !config.dryRun && !config.devRelease) {\n      // ci release, npm publish\n      await setReleaseVersion(config);\n    } else {\n      // local build or dev build\n      await setDistVersion(config);\n    }\n\n    console.log(\n      `🌎 Qwik v${config.distVersion}`,\n      `[node ${process.version}, ${process.platform}/${process.arch}]`\n    );\n\n    if (config.tsc || (!config.dev && config.qwik)) {\n      rmSync(config.tscDir, { recursive: true, force: true });\n      rmSync(config.dtsDir, { recursive: true, force: true });\n      await tscQwik(config);\n    }\n\n    if (config.qwik) {\n      if (config.dev) {\n        ensureDir(config.distQwikPkgDir);\n      } else {\n        emptyDir(config.distQwikPkgDir);\n      }\n\n      await submodulePreloader(config);\n      await Promise.all([\n        submoduleCore(config),\n        submoduleQwikLoader(config),\n        submoduleBuild(config),\n        submoduleTesting(config),\n        submoduleCli(config),\n      ]);\n\n      // server bundling must happen after the results from the others\n      // because it inlines the qwik loader\n      await Promise.all([submoduleServer(config), submoduleOptimizer(config)]);\n    }\n\n    if (config.api || (!config.dev && config.qwik)) {\n      rmSync(join(config.rootDir, 'dist-dev', 'api'), { recursive: true, force: true });\n      rmSync(join(config.rootDir, 'dist-dev', 'api-docs'), { recursive: true, force: true });\n      rmSync(join(config.rootDir, 'dist-dev', 'api-extractor'), { recursive: true, force: true });\n    }\n    if (config.api || ((!config.dev || config.tsc) && config.qwik)) {\n      await apiExtractorQwik(config);\n    }\n\n    if (config.platformBinding) {\n      await buildPlatformBinding(config);\n    } else if (config.platformBindingWasmCopy) {\n      await copyPlatformBindingWasm(config);\n    }\n\n    if (config.wasm) {\n      await buildWasmBinding(config);\n    }\n\n    if (config.tsc || (!config.dev && config.qwikcity)) {\n      await tscQwikCity(config);\n    }\n\n    if (config.qwikcity) {\n      await buildQwikCity(config);\n    }\n\n    if (config.api || ((!config.dev || config.tsc) && config.qwikcity)) {\n      await apiExtractorQwikCity(config);\n    }\n\n    if (config.tsc) {\n      await tsc(config);\n    }\n\n    if (config.eslint) {\n      await buildEslint(config);\n    }\n\n    if (config.qwikreact) {\n      await buildQwikReact(config);\n    }\n\n    if (config.qwikauth) {\n      await buildQwikAuth(config);\n    }\n\n    if (config.qwikworker) {\n      await buildQwikWorker(config);\n    }\n\n    if (config.qwiklabs) {\n      await buildQwikLabs(config);\n    }\n\n    if (config.supabaseauthhelpers) {\n      await buildSupabaseAuthHelpers(config);\n    }\n\n    if (config.tscDocs) {\n      await tscDocs(config);\n    }\n\n    if (config.validate) {\n      await validateBuild(config);\n    }\n\n    if (config.cli) {\n      await buildCreateQwikCli(config);\n      await submoduleCli(config);\n    }\n\n    if (config.prepareRelease) {\n      // locally commit the package.json change\n      await commitPrepareReleaseVersion(config);\n    } else if (config.release) {\n      // release from ci\n      await publish(config);\n    }\n\n    if (config.watch) {\n      await watchDirectories({\n        [join(config.srcQwikDir, 'core')]: async () => {\n          await submoduleCore({ ...config, dev: true });\n          await copyFile(\n            join(config.srcQwikDir, '..', 'dist', 'core.cjs'),\n            join(config.srcQwikDir, '..', 'dist', 'core.prod.cjs')\n          );\n          await copyFile(\n            join(config.srcQwikDir, '..', 'dist', 'core.mjs'),\n            join(config.srcQwikDir, '..', 'dist', 'core.prod.mjs')\n          );\n          console.log(\n            join(config.srcQwikDir, '..', 'dist', 'core.cjs'),\n            join(config.srcQwikDir, '..', 'dist', 'core.prod.cjs')\n          );\n        },\n        [join(config.srcQwikDir, 'cli')]: () => submoduleCli(config),\n        [join(config.srcQwikDir, 'optimizer')]: () => submoduleOptimizer(config),\n        [join(config.srcQwikDir, 'server')]: () => submoduleServer(config),\n        [join(config.srcQwikCityDir, 'runtime/src')]: () => buildQwikCity(config),\n      });\n    }\n  } catch (e: any) {\n    panic(e);\n  }\n}\n\nasync function watchDirectories(dirs: Record<string, () => Promise<any>>) {\n  const promises: Promise<void>[] = [];\n  for (const dir of Object.keys(dirs)) {\n    promises.push(watchDirectory(dir, dirs[dir]));\n  }\n  return Promise.all(promises);\n}\nasync function watchDirectory(dir: string, reactionFn: () => Promise<void>) {\n  console.log('👀 watching', dir);\n  for await (const change of watch(dir, { recursive: true })) {\n    console.log('👀 change in', dir, '=>', change.filename);\n    try {\n      await reactionFn();\n    } catch (e) {\n      console.error('👀 error', dir, '=>', e);\n    }\n  }\n}\n"
  },
  {
    "path": "scripts/compiled-string-plugin.ts",
    "content": "import type { Plugin } from 'vite';\nimport { minify } from 'terser';\n\nconst isCompiledStringId = (id: string) => /[?&]compiled-string/.test(id);\n\n/** This returns the source code of a module after transforming */\nexport function compiledStringPlugin(): Plugin {\n  let devServer: any;\n  return {\n    name: 'compiled-string-plugin',\n    enforce: 'pre',\n\n    configureServer(server) {\n      devServer = server;\n    },\n\n    resolveId: {\n      order: 'pre',\n      async handler(id, importer, options) {\n        if (isCompiledStringId(id)) {\n          const cleanId = id.replace(/([?&])compiled-string/, '$1').replace(/[?&]$/, '');\n          const resolved = await this.resolve(cleanId, importer, { skipSelf: true });\n          if (resolved) {\n            return `virtual:compiled-string:${resolved.id}`;\n          }\n        } else if (id.startsWith('virtual:compiled-string:')) {\n          return id;\n        }\n        return null;\n      },\n    },\n\n    load: {\n      order: 'pre',\n      async handler(id) {\n        if (id.startsWith('virtual:compiled-string:')) {\n          const originalId = id.slice('virtual:compiled-string:'.length);\n\n          const result = await this.load({\n            id: originalId,\n            moduleSideEffects: true,\n          });\n\n          let code: string;\n          if (result && 'code' in result && result.code) {\n            // If this.load provides code, use it\n            code = result.code;\n          } else if (devServer) {\n            // in dev mode, you need to use the dev server to transform the request\n            const transformResult = await devServer.transformRequest(originalId);\n            if (transformResult && transformResult.code) {\n              code = transformResult.code;\n            }\n            this.addWatchFile(originalId);\n          }\n          if (!code!) {\n            throw new Error(`Unable to load code for ${originalId}`);\n          }\n          const minified = await minify(code);\n          if (!minified.code) {\n            throw new Error(`Unable to minify code for ${originalId}`);\n          }\n          const withoutExports = minified.code.replace('export{}', '').replace(/;+$/g, '');\n          return {\n            code: `export default ${JSON.stringify(withoutExports)};`,\n            map: null,\n          };\n        }\n        return null;\n      },\n    },\n  };\n}\n"
  },
  {
    "path": "scripts/create-qwik-cli.ts",
    "content": "import { build } from 'esbuild';\nimport { existsSync } from 'node:fs';\nimport { rm } from 'node:fs/promises';\nimport { basename, join } from 'node:path';\nimport { readPackageJson, writePackageJson } from './package-json.ts';\nimport {\n  type BuildConfig,\n  copyFile,\n  emptyDir,\n  getBanner,\n  getQwikVersion,\n  mkdir,\n  nodeTarget,\n  readdir,\n  run,\n  stat,\n} from './util.ts';\n\nconst PACKAGE = 'create-qwik';\n\nexport async function buildCreateQwikCli(config: BuildConfig) {\n  const srcCliDir = join(config.packagesDir, PACKAGE);\n  const distCliDir = join(srcCliDir, 'dist');\n\n  await bundleCreateQwikCli(config, srcCliDir, distCliDir);\n  await copyStartersDir(config, distCliDir, ['apps']);\n  await syncBaseStarterVersionsFromQwik(config);\n\n  console.log('🐠 create-qwik cli');\n}\n\nasync function bundleCreateQwikCli(config: BuildConfig, srcCliDir: string, distCliDir: string) {\n  emptyDir(distCliDir);\n\n  await build({\n    entryPoints: [join(srcCliDir, 'index.ts')],\n    outfile: join(distCliDir, 'index.cjs'),\n    target: nodeTarget,\n    platform: 'node',\n    format: 'cjs',\n    bundle: true,\n    sourcemap: false,\n    minify: !config.dev,\n    plugins: [\n      {\n        name: 'colorAlias',\n        setup(build) {\n          build.onResolve({ filter: /^chalk$/ }, async (args) => {\n            const result = await build.resolve('kleur', {\n              resolveDir: args.resolveDir,\n              kind: 'import-statement',\n            });\n            if (result.errors.length > 0) {\n              return { errors: result.errors };\n            }\n            return { path: result.path };\n          });\n        },\n      },\n    ],\n    external: ['prettier', 'typescript', 'ts-morph', 'semver', 'ignore'],\n    define: {\n      'globalThis.CODE_MOD': 'false',\n      'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n    },\n    banner: {\n      js: getBanner(PACKAGE, config.distVersion),\n    },\n  });\n}\n\nexport async function publishCreateQwikCli(\n  config: BuildConfig,\n  distTag: string,\n  version: string,\n  isDryRun: boolean\n) {\n  const srcCliDir = join(config.packagesDir, PACKAGE);\n\n  await updateBaseVersions(config, version);\n\n  console.log(`⛴ publishing ${PACKAGE} ${version}`, isDryRun ? '(dry-run)' : '');\n\n  const npmPublishArgs = ['publish', '--tag', distTag];\n\n  await run('npm', npmPublishArgs, isDryRun, isDryRun, { cwd: srcCliDir });\n\n  console.log(\n    `🐳 published version \"${version}\" of ${PACKAGE} with dist-tag \"${distTag}\" to npm`,\n    isDryRun ? '(dry-run)' : ''\n  );\n}\n\nasync function syncBaseStarterVersionsFromQwik(config: BuildConfig) {\n  const qwikVersion = await getQwikVersion(config);\n\n  await updateBaseVersions(config, qwikVersion);\n}\n\nasync function updateBaseVersions(config: BuildConfig, version: string) {\n  const srcCliDir = join(config.packagesDir, PACKAGE);\n\n  // update the base app's package.json\n  const distCliBaseAppDir = join(srcCliDir, 'dist', 'starters', 'apps', 'base');\n  const baseAppPkg = await readPackageJson(distCliBaseAppDir);\n  baseAppPkg.devDependencies = baseAppPkg.devDependencies || {};\n\n  const semverQwik = config.devRelease ? `${version}` : `^${version}`;\n  console.log(`   update devDependencies[\"@builder.io/qwik\"] = \"${semverQwik}\"`);\n  baseAppPkg.devDependencies['@builder.io/qwik'] = semverQwik;\n\n  console.log(`   update devDependencies[\"@builder.io/qwik-city\"] = \"${semverQwik}\"`);\n  baseAppPkg.devDependencies['@builder.io/qwik-city'] = semverQwik;\n\n  console.log(`   update devDependencies[\"eslint-plugin-qwik\"] = \"${semverQwik}\"`);\n  baseAppPkg.devDependencies['eslint-plugin-qwik'] = semverQwik;\n\n  const rootPkg = await readPackageJson(config.rootDir);\n  const typescriptDepVersion = rootPkg.devDependencies!.typescript;\n  const viteDepVersion = rootPkg.devDependencies!.vite;\n\n  console.log(`   update devDependencies[\"typescript\"] = \"${typescriptDepVersion}\"`);\n  baseAppPkg.devDependencies['typescript'] = typescriptDepVersion;\n\n  console.log(`   update devDependencies[\"vite\"] = \"${viteDepVersion}\"`);\n  baseAppPkg.devDependencies['vite'] = viteDepVersion;\n\n  console.log(distCliBaseAppDir, JSON.stringify(baseAppPkg, null, 2));\n  await writePackageJson(distCliBaseAppDir, baseAppPkg);\n}\n\nexport async function copyStartersDir(\n  config: BuildConfig,\n  distCliDir: string,\n  typeDirs: ('apps' | 'features' | 'adapters')[]\n) {\n  const distStartersDir = join(distCliDir, 'starters');\n  try {\n    await mkdir(distStartersDir);\n  } catch (e) {\n    //\n  }\n\n  await Promise.all(\n    typeDirs.map(async (typeDir) => {\n      const srcDir = join(config.startersDir, typeDir);\n      const distDir = join(distStartersDir, typeDir);\n\n      await rm(distDir, { force: true, recursive: true });\n\n      await copyDir(config, srcDir, distDir);\n\n      const distStartersDirs = await readdir(distDir);\n      await Promise.all(\n        distStartersDirs\n          .filter((a) => a !== '.DS_Store')\n          .map(async (distStartersDir) => {\n            const pkgJsonPath = join(distDir, distStartersDir, 'package.json');\n            if (!existsSync(pkgJsonPath)) {\n              throw new Error(`CLI starter missing package.json: ${pkgJsonPath}`);\n            }\n          })\n      );\n    })\n  );\n}\n\nasync function copyDir(config: BuildConfig, srcDir: string, destDir: string) {\n  await mkdir(destDir);\n  const items = await readdir(srcDir);\n  await Promise.all(\n    items.map(async (itemName) => {\n      if (isValidFsItem(itemName)) {\n        const srcPath = join(srcDir, itemName);\n        const destPath = join(destDir, itemName);\n        const itemStat = await stat(srcPath);\n        if (itemStat.isDirectory()) {\n          await copyDir(config, srcPath, destPath);\n        } else if (itemStat.isFile()) {\n          await copyFile(srcPath, destPath);\n          if (basename(destPath) === 'package.json') {\n            await updatePackageJson(config, destDir);\n          }\n        }\n      }\n    })\n  );\n}\n\nasync function updatePackageJson(config: BuildConfig, destDir: string) {\n  const rootPkg = await readPackageJson(config.rootDir);\n  const pkgJson = await readPackageJson(destDir);\n  const qwikVersion = await getQwikVersion(config);\n\n  const setVersionFromRoot = (pkgName: string) => {\n    if (pkgJson.devDependencies && pkgJson.devDependencies[pkgName]) {\n      if (rootPkg.devDependencies && rootPkg.devDependencies[pkgName]) {\n        if (\n          rootPkg.devDependencies[pkgName] !== 'next' &&\n          rootPkg.devDependencies[pkgName] !== 'dev'\n        ) {\n          pkgJson.devDependencies[pkgName] = rootPkg.devDependencies[pkgName];\n        }\n      }\n    }\n  };\n\n  if (pkgJson.devDependencies && pkgJson.devDependencies['@builder.io/qwik']) {\n    pkgJson.devDependencies['@builder.io/qwik'] = qwikVersion;\n  }\n\n  if (pkgJson.devDependencies && pkgJson.devDependencies['eslint-plugin-qwik']) {\n    pkgJson.devDependencies['eslint-plugin-qwik'] = qwikVersion;\n  }\n\n  setVersionFromRoot('@types/node');\n  setVersionFromRoot('typescript-eslint');\n  setVersionFromRoot('globals');\n  setVersionFromRoot('eslint');\n  setVersionFromRoot('eslint/js');\n  setVersionFromRoot('prettier');\n  setVersionFromRoot('typescript');\n  setVersionFromRoot('node-fetch');\n  setVersionFromRoot('undici');\n  setVersionFromRoot('vite');\n\n  await writePackageJson(destDir, pkgJson);\n}\n\nfunction isValidFsItem(fsItemName: string) {\n  return !IGNORE[fsItemName] && !fsItemName.includes('.prod') && !fsItemName.endsWith('-test');\n}\n\nconst IGNORE: { [path: string]: boolean } = {\n  '.rollup.cache': true,\n  build: true,\n  server: true,\n  e2e: true,\n  node_modules: true,\n  'package-lock.json': true,\n  'starter.tsconfig.json': true,\n  'tsconfig.tsbuildinfo': true,\n  'yarn.lock': true,\n  'pnpm-lock.yaml': true,\n};\n"
  },
  {
    "path": "scripts/docs_sync/fetch_hackmd.ts",
    "content": "import { join } from 'node:path';\nimport { readLines, scanFiles, writeFileLines } from './util.ts';\n\nexport function main(dir: string) {\n  console.log('Fetching HackMD content...');\n\n  scanFiles(dir, async (file: string) => {\n    if (file.endsWith('.mdx')) {\n      const fetchLocation = await readFetch(file);\n      if (fetchLocation) {\n        console.log(file, '<==', fetchLocation);\n        const lines = await readLines(fetchLocation);\n        await writeFileLines(file, lines);\n      }\n    }\n  });\n}\n\nconst KEY_VALUE = /^(.\\w+):\\s+(.*)$/;\n\nasync function readFetch(file: string) {\n  const lines = await readLines(file);\n  if (lines[0] === '---') {\n    let row = 1;\n    while (row < lines.length && lines[row] !== '---') {\n      const line = lines[row++];\n      const match = KEY_VALUE.exec(line);\n      if (match) {\n        const [_, key, value] = match;\n        if (key === 'fetch') return value;\n      }\n    }\n  }\n  return null;\n}\n\nif (require.main === module) {\n  main(join(__dirname, '..', '..'));\n}\n"
  },
  {
    "path": "scripts/docs_sync/index.ts",
    "content": "import { main } from './main.ts';\nimport { join } from 'node:path';\n\nmain(join(process.cwd(), 'packages'));\n"
  },
  {
    "path": "scripts/docs_sync/main.ts",
    "content": "import { join, dirname } from 'node:path';\nimport { readLines, scanFiles, writeFileLines } from './util.ts';\n\nexport function main(dir: string) {\n  console.log('DOC SYNC', dir);\n  scanFiles(dir, async (file) => {\n    if (file.endsWith('.ts')) {\n      await readLines(file).then((lines) => scanForDocDirective(file, lines));\n    }\n  });\n}\n\nasync function scanForDocDirective(file: string, lines: string[]) {\n  const output: string[] = [];\n  let row = 0;\n  let write = false;\n  while (row < lines.length) {\n    const line = lines[row++];\n    output.push(line);\n    const match = /^(\\s*)\\/\\/ <docs markdown=\"(.*)#(.*)\">/.exec(line);\n    if (match) {\n      const prefix = match[1];\n      console.log('line', line, JSON.stringify(prefix));\n      const ref = match[2];\n      const section = match[3];\n      let bookRef = ref.replace(/\\/\\/hackmd.io\\//, '//hackmd.io/@qwik-docs/BkxpSz80Y/%2F');\n      if (bookRef.indexOf('hackmd.io') !== -1) {\n        bookRef += '%3Fboth';\n      }\n      output.push(prefix + `// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!`);\n      output.push(prefix + `// (edit ${bookRef}#${section} instead)`);\n      output.push(prefix + '/**');\n      (await resolveComment(dirname(file), ref, section)).forEach((longLine) =>\n        breakLongLine(longLine).forEach((line) =>\n          output.push(prefix + ' *' + (line ? ' ' + line : ''))\n        )\n      );\n      output.push(prefix + ' */');\n      while (row < lines.length) {\n        const line2 = lines[row++];\n        if (!isComment(line2)) {\n          throw new Error(\n            'Missing end `</doc>` tag. Got: ' + line2 + '\\n' + file + '[' + row + ']'\n          );\n        }\n        if (line2.indexOf('// </docs>') != -1) {\n          output.push(line2);\n          break;\n        }\n      }\n      write = true;\n    }\n  }\n  if (write) {\n    await writeFileLines(file, output);\n  }\n}\n\nfunction isComment(line: string): boolean {\n  line = line.trim();\n  return line.startsWith('//') || line.startsWith('/**') || line.startsWith('*');\n}\n\nasync function resolveComment(dir: string, ref: string, section: string): Promise<string[]> {\n  const fileReadme = join(dir, ref);\n  const lines = await readFileSection(fileReadme, section);\n  let row = 0;\n  let output: string[] = [];\n  const dirReadme = dirname(fileReadme);\n  while (row < lines.length) {\n    let line = lines[row++];\n    const match = /<docs code=\"\\.\\/(.*)#(.*)\"\\/>/.exec(line);\n    if (match) {\n      output.push('```tsx');\n      (await resolveCodeExample(join(dirReadme, match[1]), match[2])).forEach((l) =>\n        output.push(l)\n      );\n      output.push('```');\n    } else {\n      output.push(line);\n    }\n  }\n  return output;\n}\n\nasync function readFileSection(file: string, section: string) {\n  const lines = await readLines(file);\n  let sectionStart = '# `' + section + '`';\n  let row = 0;\n  let output: string[] = [];\n  let inSection = false;\n  while (row < lines.length) {\n    const line = lines[row++];\n    if (line === sectionStart) {\n      inSection = true;\n    } else if (line.startsWith('# ')) {\n      inSection = false;\n    } else if (inSection) {\n      output.push(line);\n    }\n  }\n  while (output.length && output[0] == '') {\n    output.shift();\n  }\n  while (output.length && output[output.length - 1] == '') {\n    output.pop();\n  }\n  return output;\n}\n\nasync function resolveCodeExample(file: string, anchor: string): Promise<string[]> {\n  const output: string[] = [];\n  const lines = await readLines(file);\n  let row = 0;\n  while (row < lines.length) {\n    const line = lines[row++];\n    const match = /^(\\s*)\\/\\/ <docs anchor=\"(.*)\">/.exec(line);\n    if (match && match[2] == anchor) {\n      while (row < lines.length) {\n        const offset = match[1].length;\n        const line2 = lines[row++].slice(offset);\n        const match2 = /\\/\\/ <\\/docs>/.exec(line2);\n        if (match2) {\n          break;\n        }\n        output.push(line2);\n      }\n    }\n  }\n  return output;\n}\n\nconst LINE_WIDTH = 95;\n\nfunction breakLongLine(longLine: string): string[] {\n  if (longLine.length < LINE_WIDTH) return [longLine];\n  const output: string[] = [];\n  while (longLine) {\n    if (longLine.length < LINE_WIDTH) {\n      output.push(longLine);\n      break;\n    }\n    let index = 0;\n    let lastWhitespace = index;\n    while (index < longLine.length && index < LINE_WIDTH) {\n      if (longLine[index++].match(/\\s/)) {\n        lastWhitespace = index;\n      }\n    }\n    if (lastWhitespace == 0) {\n      output.push(longLine);\n      break;\n    }\n    output.push(longLine.slice(0, lastWhitespace - 1));\n    longLine = longLine.slice(lastWhitespace).trim();\n  }\n  return output;\n}\n"
  },
  {
    "path": "scripts/docs_sync/util.ts",
    "content": "import { readdir, readFile, stat, writeFile } from 'node:fs';\nimport { get } from 'node:https';\nimport { join } from 'node:path';\n\nexport async function scanFiles(\n  dir: string,\n  callback: (file: string) => Promise<void>\n): Promise<void> {\n  const promises: Promise<void>[] = [];\n  readdir(dir, (err, files) => {\n    if (err) return;\n    files.forEach((file) => {\n      const path = join(dir, file);\n      if (file === 'node_modules') return;\n      if (file.startsWith('.')) return;\n      stat(path, (err, status) => {\n        if (err) return;\n        if (status.isDirectory()) {\n          promises.push(scanFiles(path, callback));\n        } else if (status.isFile()) {\n          promises.push(callback(path));\n        }\n      });\n    });\n  });\n  await Promise.all(promises);\n}\n\nconst hackMdCache = new Map<string, Promise<string[]>>();\n\nexport async function readLines(file: string): Promise<string[]> {\n  file = file.replace('https:/', 'https://').replace('https:///', 'https://');\n  let promise = hackMdCache.get(file);\n  if (promise) return promise;\n\n  const index = file.indexOf('https://hackmd.io/');\n  if (index === -1) {\n    promise = new Promise((res, rej) =>\n      readFile(file, (err, data) => (err ? rej(err) : res(String(data).split('\\n'))))\n    );\n  } else {\n    const url = file.substring(index) + '/download';\n    console.log('FETCHING:', url);\n    promise = new Promise<string[]>((resolve, rej) => {\n      get(url, (res) => {\n        res.setEncoding('utf8');\n        let body = '';\n        res.on('data', (data) => {\n          body += String(data);\n        });\n        res.on('end', () => {\n          resolve(body.split('\\n'));\n        });\n      });\n    });\n  }\n  hackMdCache.set(file, promise);\n  return promise;\n}\n\nexport async function writeFileLines(file: string, lines: string[]) {\n  return new Promise((res, rej) =>\n    writeFile(file, lines.join('\\n'), (err) => (err ? rej(err) : res(null)))\n  );\n}\n"
  },
  {
    "path": "scripts/e2e-cli.ts",
    "content": "import { execSync } from 'child_process';\n// run-command.js\nconst arg = process.argv[2]; // get the argument\nconst command = `playwright test ${arg} --browser=chromium --config starters/playwright.config.ts`; // insert the argument into the command\nexecSync(command, { stdio: 'inherit' }); // run the command\n"
  },
  {
    "path": "scripts/eslint-docs.ts",
    "content": "import * as fs from 'fs';\nimport { resolve } from 'path';\nimport { rules, configs } from '../packages/eslint-plugin-qwik/index';\nimport { examples, type QwikEslintExample } from '../packages/eslint-plugin-qwik/examples';\n\nconst mdx = [];\n\nconst outputPathMdx = resolve(\n  process.cwd(),\n  'packages/docs/src/routes/docs/(qwik)/advanced/eslint/index.mdx'\n);\n\nfunction escapeHtml(htmlStr: string) {\n  return htmlStr\n    .replace(/&/g, '&amp;')\n    .replace(/</g, '&lt;')\n    .replace(/>/g, '&gt;')\n    .replace(/\"/g, '&quot;')\n    .replace(/'/g, '&#39;');\n}\n\nfunction kebabToCamel(str: string) {\n  return str\n    .toLowerCase()\n    .replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace('-', '').replace('_', ''));\n}\n\nfunction renderExample(example: QwikEslintExample, state: 'good' | 'bad' = 'good') {\n  mdx.push('<div class=\"code-wrapper\">');\n  if (state === 'good') {\n    mdx.push('<span class=\"badge good\">✓</span>');\n  } else {\n    mdx.push('<span class=\"badge bad\">✕</span>');\n  }\n  mdx.push(\n    '```tsx' +\n      ((example.codeHighlight && ` ${example.codeHighlight}`) || '') +\n      ((example.codeTitle && ` title=\"${example.codeTitle}\"`) || '')\n  );\n  mdx.push(example.code);\n  mdx.push('```');\n  if (example.description) {\n    mdx.push(`<p class=\"code-description\">${example.description}</p>`);\n  }\n  mdx.push('</div>');\n}\n\nconst rulesMap = Object.keys(rules).map((ruleName) => {\n  const rule = ruleName as keyof typeof rules;\n  return {\n    name: rule,\n    description: escapeHtml(rules[rule]?.meta?.docs?.description || ''),\n    recommended: configs?.recommended?.rules[`qwik/${rule}`] || false,\n    strict: configs.strict.rules[`qwik/${rule}`] || false,\n    messages: rules[rule]?.meta?.messages || '',\n    examples: examples[rule],\n  };\n});\n\nmdx.push(`\n[//]: <> (--------------------------------------)\n[//]: <> (......THIS FILE IS AUTOGENERATED......)\n[//]: <> (--------------------------------------)\n[//]: <> ( to update run: pnpm eslint.update    )\n[//]: <> ( after changing the rule metadata on  )\n[//]: <> ( packages/eslint-plugin-qwik/index.ts )\n[//]: <> (--------------------------------------)\n`);\n\nmdx.push(`import './styles.css';\\n\\n`);\n\nmdx.push('<div>');\n\nmdx.push('<h1 id=\"smth\">ESLint-Rules</h1>');\nmdx.push(\n  '<p>Qwik comes with its own set of ESLint rules to help developers write better code.</p>'\n);\n\nmdx.push(`\n<div class=\"ruleset-legend panel\">\n  <div class=\"panel-border\">\n    <span class=\"icon icon-inactive\">✅</span>\n    <b>Warn</b> in 'recommended' ruleset\n  </div>\n  <div class=\"panel-border\">\n    <span class=\"icon\">✅</span>\n    <b>Error</b> in 'recommended' ruleset\n  </div>\n  <div class=\"panel-border\">\n    <span class=\"icon icon-inactive\">🔔</span>\n    <b>Warn</b> in 'strict' ruleset\n  </div>\n  <div class=\"list-none my-6 px-6\">\n    <span class=\"icon\">🔔</span>\n    <b>Error</b> in 'strict' ruleset\n  </div>\n</div>\n`);\n\nmdx.push(`<h2>Possible Problems</h2>`);\nmdx.push(`<p>These rules are available.</p>`);\n\nmdx.push(`<div class=\"my-6\">`);\nrulesMap.forEach((rule) => {\n  mdx.push(`\n    <a href=\"#${rule.name}\" class=\"p-4 flex panel\">\n      <div class=\"flex-1\">\n        <code>${rule.name}</code>\n        <span class=\"rule-description\">${rule.description}</span>\n      </div>\n      <div class=\"flex gap-2 items-center\">\n        <span\n          class={{\n            'icon': ${rule.recommended === false},\n            'icon icon-inactive': ${rule.recommended === 'warn'},\n          }}\n        >\n          ✅\n        </span>\n        <span\n          class={{\n            'icon': ${rule.strict === false},\n            'icon icon-inactive': ${rule.strict === 'warn'},\n          }}\n        >\n          🔔\n        </span>\n      </div>\n    </a>\n  `);\n});\nmdx.push(`</div>`);\n\nmdx.push(`<h2>Details</h2>`);\nmdx.push(`<div class=\"my-6\">`);\nrulesMap.forEach((rule) => {\n  mdx.push(`\n    <div class=\"rule-wrapper\">\n      <h3 id=\"${rule.name}\">${rule.name}</h3>\n      <span>${rule.description}</span>\n  `);\n  Object.keys(rule.messages).map((messageKey) => {\n    mdx.push(`<h4>${messageKey}</h4>`);\n\n    const goodExamples: QwikEslintExample[] = rule?.examples?.[messageKey]?.good || [];\n    const badExamples: QwikEslintExample[] = rule?.examples?.[messageKey]?.bad || [];\n\n    if (goodExamples.length > 0) {\n      mdx.push('<p>Examples of <b>correct</b> code for this rule:</p>');\n      goodExamples.map((example) => {\n        renderExample(example);\n      });\n    }\n\n    if (badExamples.length > 0) {\n      mdx.push('<p>Examples of <b>incorrect</b> code for this rule:</p>');\n      badExamples.map((example) => {\n        renderExample(example, 'bad');\n      });\n    }\n\n    mdx.push(\n      `<div class=\"edit-examples-wrapper\"><a href=\"https://github.com/QwikDev/qwik/edit/main/packages/eslint-plugin-qwik/src/${kebabToCamel(\n        rule.name\n      )}.ts\" target=\"_blank\" class=\"edit-btn\">Edit examples</a></div>`\n    );\n  });\n  mdx.push(`\n    </div>\n  `);\n});\nmdx.push(`</div>`);\n\nmdx.push(`</div>`);\n\n// TODO: format mdx breaks every odd code block\n// fs.writeFileSync(outputPathMdx, format(mdx.join('\\n'), { parser: 'mdx' }));\nfs.writeFileSync(outputPathMdx, mdx.join('\\n'));\n"
  },
  {
    "path": "scripts/eslint.ts",
    "content": "import { type BuildConfig, run, nodeTarget } from './util.ts';\nimport { join } from 'node:path';\nimport { build } from 'esbuild';\nimport { readPackageJson, writePackageJson } from './package-json.ts';\n\nconst PACKAGE = 'eslint-plugin-qwik';\n\nexport async function buildEslint(config: BuildConfig) {\n  const eslintDir = join(config.packagesDir, PACKAGE);\n  const eslintOutput = join(eslintDir, 'dist');\n\n  await build({\n    entryPoints: [join(eslintDir, 'index.ts')],\n    outfile: join(eslintOutput, 'index.js'),\n    bundle: true,\n    sourcemap: false,\n    target: nodeTarget,\n    platform: 'node',\n    minify: !config.dev,\n    external: ['eslint', 'espree', '@typescript-eslint/utils', 'typescript'],\n  });\n\n  console.log(`📐 ${PACKAGE}`);\n}\n\nexport async function publishEslint(\n  config: BuildConfig,\n  distTag: string,\n  version: string,\n  isDryRun: boolean\n) {\n  const distDir = join(config.packagesDir, PACKAGE);\n  const cliPkg = await readPackageJson(distDir);\n\n  // update the cli version\n  console.log(`   update version = \"${version}\"`);\n  cliPkg.version = version;\n  cliPkg.main = 'index.js';\n  await writePackageJson(distDir, cliPkg);\n\n  console.log(`⛴ publishing ${cliPkg.name} ${version}`, isDryRun ? '(dry-run)' : '');\n\n  const npmPublishArgs = ['publish', '--tag', distTag];\n  await run('npm', npmPublishArgs, isDryRun, isDryRun, { cwd: distDir });\n\n  console.log(\n    `🐳 published version \"${version}\" of ${cliPkg.name} with dist-tag \"${distTag}\" to npm`,\n    isDryRun ? '(dry-run)' : ''\n  );\n}\n\nexport async function validateEslint(config: BuildConfig, errors: string[]) {\n  try {\n  } catch (e: any) {\n    errors.push(String(e.message || e));\n  }\n}\n"
  },
  {
    "path": "scripts/index.ts",
    "content": "/**\n * This is the root build scripts module (keep in commonjs). It's only a .js file but will handle\n * registering typescript files with esbuild-register to allow Node.js to build .ts files\n * on-demand.\n */\nimport { build } from './build.ts';\nimport { loadConfig } from './util.ts';\n\nconst args = process.argv.slice(2);\n\n// load our build config, which figures out all the paths\n// the rest of the build process uses.\nconst config = loadConfig(args);\nconfig.esmNode = true;\n\n// let's do this!\nbuild(config);\n"
  },
  {
    "path": "scripts/link-local-package.ts",
    "content": "import { link, mkdir, readdir, stat, rm } from 'fs/promises';\nimport { join, dirname, resolve } from 'path';\n\nconsole.log('');\nconsole.log('CREATING LOCALE PACKAGES');\nconst __dirname = dirname(new URL(import.meta.url).pathname);\nconst workspace = resolve(join(__dirname, '..'));\nconsole.log('WORKSPACE', workspace);\nconst node_modules = join(workspace, 'node_modules');\nconst dstQwik = join(node_modules, '@builder.io', 'qwik');\nconst dstQwikCity = join(node_modules, '@builder.io', 'qwik-city');\nconst srcQwik = join(workspace, 'packages', 'qwik', 'dist');\nconst srcQwikCity = join(workspace, 'packages', 'qwik-city', 'lib');\nmain();\n\nasync function main() {\n  await mkdir(join(node_modules, '@builder.io'), { recursive: true });\n  linkDirFiles(srcQwik, dstQwik);\n  linkDirFiles(srcQwikCity, dstQwikCity);\n}\n\nasync function linkDirFiles(src: string, dst: string) {\n  try {\n    await rm(dst, { recursive: true });\n  } catch (e) {}\n  await mkdir(dst, { recursive: true });\n  const files = await readdir(src);\n  for (const file of files) {\n    const fileStat = await stat(join(src, file));\n    if (fileStat.isDirectory()) {\n      linkDirFiles(join(src, file), join(dst, file));\n    } else {\n      console.log('LINKING', join(src, file), '=>', join(dst, file));\n      await link(join(src, file), join(dst, file));\n    }\n  }\n}\n"
  },
  {
    "path": "scripts/package-json.ts",
    "content": "import { ensureDir, type PackageJSON } from './util.ts';\nimport { readFile, writeFile } from './util.ts';\nimport { join } from 'node:path';\n\nexport async function readPackageJson(pkgJsonDir: string) {\n  const pkgJsonPath = join(pkgJsonDir, 'package.json');\n  const pkgJson: PackageJSON = JSON.parse(await readFile(pkgJsonPath, 'utf-8'));\n  return pkgJson;\n}\n\nexport async function writePackageJson(pkgJsonDir: string, pkgJson: PackageJSON) {\n  ensureDir(pkgJsonDir);\n  const pkgJsonPath = join(pkgJsonDir, 'package.json');\n  const pkgJsonStr = JSON.stringify(pkgJson, null, 2) + '\\n';\n  await writeFile(pkgJsonPath, pkgJsonStr);\n}\n"
  },
  {
    "path": "scripts/qwik-auth.ts",
    "content": "import { type BuildConfig, copyDir, panic } from './util.ts';\nimport { join } from 'node:path';\nimport { execa } from 'execa';\n\nconst PACKAGE = 'qwik-auth';\n\nexport async function buildQwikAuth(config: BuildConfig) {\n  const input = join(config.packagesDir, PACKAGE);\n\n  const result = await execa('pnpm', ['build'], {\n    stdout: 'inherit',\n    cwd: input,\n  });\n\n  if (result.failed) {\n    panic(`tsc failed`);\n  }\n  await copyDir(\n    config,\n    join(config.dtsDir, 'packages', 'qwik-auth', 'src'),\n    join(input, 'lib', 'types')\n  );\n  console.log(`⚛️  ${PACKAGE}`);\n}\n"
  },
  {
    "path": "scripts/qwik-city.ts",
    "content": "import { build, type Plugin, transform } from 'esbuild';\nimport { execa } from 'execa';\nimport { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { rollup } from 'rollup';\nimport { type BuildConfig, emptyDir, importPath, nodeTarget, panic } from './util.ts';\n\nexport async function buildQwikCity(config: BuildConfig) {\n  if (!config.dev) {\n    emptyDir(config.distQwikCityPkgDir);\n  }\n\n  await Promise.all([\n    buildServiceWorker(config),\n    buildVite(config),\n    buildAdapterAzureSwaVite(config),\n    buildAdapterCloudflarePagesVite(config),\n    buildAdapterCloudRunVite(config),\n    buildAdapterDenoVite(config),\n    buildAdapterBunVite(config),\n    buildAdapterNodeServerVite(config),\n    buildAdapterNetlifyEdgeVite(config),\n    buildAdapterSharedVite(config),\n    buildAdapterStaticVite(config),\n    buildAdapterVercelEdgeVite(config),\n    buildMiddlewareCloudflarePages(config),\n    buildMiddlewareNetlifyEdge(config),\n    buildMiddlewareAzureSwa(config),\n    buildMiddlewareAwsLambda(config),\n    buildMiddlewareDeno(config),\n    buildMiddlewareBun(config),\n    buildMiddlewareNode(config),\n    buildMiddlewareRequestHandler(config),\n    buildMiddlewareVercelEdge(config),\n    buildMiddlewareFirebase(config),\n    buildStatic(config),\n    buildStaticNode(config),\n  ]);\n\n  await buildRuntime(config);\n\n  console.log(`🏙  qwik-city`);\n}\n\nasync function buildRuntime(config: BuildConfig) {\n  const execOptions = {\n    win: {\n      manager: 'npm',\n      command: ['run', 'build'],\n    },\n    other: {\n      manager: 'pnpm',\n      command: ['build'],\n    },\n  };\n  const isWindows = process.platform.includes('win32');\n  const runOptions = isWindows ? execOptions.win : execOptions.other;\n\n  const result = await execa(runOptions.manager, runOptions.command, {\n    stdout: 'inherit',\n    cwd: config.srcQwikCityDir,\n  });\n  if (result.failed) {\n    panic(`tsc failed`);\n  }\n}\n\nasync function buildVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'buildtime', 'vite', 'index.ts')];\n\n  const external = [\n    'fs',\n    'path',\n    'url',\n    'vite',\n    'source-map',\n    'vfile',\n    '@mdx-js/mdx',\n    'node-fetch',\n    'undici',\n    'typescript',\n    'vite-imagetools',\n    'svgo',\n    '@builder.io/qwik-city/middleware/request-handler',\n  ];\n\n  const swRegisterPath = join(config.srcQwikCityDir, 'runtime', 'src', 'sw-register.ts');\n  let swRegisterCode = await readFile(swRegisterPath, 'utf-8');\n\n  const swResult = await transform(swRegisterCode, { loader: 'ts', minify: true });\n  swRegisterCode = swResult.code.trim();\n  if (swRegisterCode.endsWith(';')) {\n    swRegisterCode = swRegisterCode.slice(0, swRegisterCode.length - 1);\n  }\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external,\n    alias: {\n      '@builder.io/qwik': 'noop',\n      '@builder.io/qwik/optimizer': 'noop',\n    },\n    plugins: [serviceWorkerRegisterBuild(swRegisterCode)],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external,\n    plugins: [serviceWorkerRegisterBuild(swRegisterCode)],\n  });\n}\n\nfunction serviceWorkerRegisterBuild(swRegisterCode: string) {\n  const filter = /\\@qwik-city-sw-register-build/;\n\n  const plugin: Plugin = {\n    name: 'serviceWorkerRegisterBuild',\n    setup(build) {\n      build.onResolve({ filter }, (args) => ({\n        path: args.path,\n        namespace: 'sw-reg',\n      }));\n      build.onLoad({ filter: /.*/, namespace: 'sw-reg' }, () => ({\n        contents: swRegisterCode,\n        loader: 'text',\n      }));\n    },\n  };\n  return plugin;\n}\n\nasync function buildServiceWorker(config: BuildConfig) {\n  const build = await rollup({\n    input: join(\n      config.tscDir,\n      'packages',\n      'qwik-city',\n      'src',\n      'runtime',\n      'src',\n      'service-worker',\n      'index.js'\n    ),\n  });\n\n  await build.write({\n    file: join(config.distQwikCityPkgDir, 'service-worker.mjs'),\n    format: 'es',\n  });\n\n  await build.write({\n    file: join(config.distQwikCityPkgDir, 'service-worker.cjs'),\n    format: 'cjs',\n  });\n}\n\nasync function buildAdapterAzureSwaVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'azure-swa', 'vite', 'index.ts')];\n\n  const external = ['vite', 'fs', 'path', '@builder.io/qwik-city/static'];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'azure-swa', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'azure-swa', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external,\n    plugins: [resolveAdapterShared('../../shared/vite/index.cjs')],\n  });\n}\n\nasync function buildAdapterCloudflarePagesVite(config: BuildConfig) {\n  const entryPoints = [\n    join(config.srcQwikCityDir, 'adapters', 'cloudflare-pages', 'vite', 'index.ts'),\n  ];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'cloudflare-pages', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'cloudflare-pages', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.cjs')],\n  });\n}\n\nasync function buildAdapterCloudRunVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'cloud-run', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'cloud-run', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'cloud-run', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.cjs')],\n  });\n}\n\nasync function buildAdapterBunVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'bun-server', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'bun-server', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'bun-server', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [\n      resolveAdapterShared('../../shared/vite/index.cjs'),\n      resolveRequestHandler('../../../middleware/request-handler/index.cjs'),\n    ],\n  });\n}\n\nasync function buildAdapterDenoVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'deno-server', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'deno-server', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'deno-server', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [\n      resolveAdapterShared('../../shared/vite/index.cjs'),\n      resolveRequestHandler('../../../middleware/request-handler/index.cjs'),\n    ],\n  });\n}\n\nasync function buildAdapterNodeServerVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'node-server', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'node-server', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'node-server', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.cjs')],\n  });\n}\n\nasync function buildAdapterNetlifyEdgeVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'netlify-edge', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'netlify-edge', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'netlify-edge', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [\n      resolveAdapterShared('../../shared/vite/index.cjs'),\n      resolveRequestHandler('../../../middleware/request-handler/index.cjs'),\n    ],\n  });\n}\n\nasync function buildAdapterSharedVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'shared', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'shared', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [\n      resolveStatic('../../../static/index.mjs'),\n      resolveRequestHandler('../../../middleware/request-handler/index.mjs'),\n    ],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'shared', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [\n      resolveStatic('../../../static/index.cjs'),\n      resolveRequestHandler('../../../middleware/request-handler/index.cjs'),\n    ],\n  });\n}\n\nasync function buildAdapterStaticVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'static', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'static', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveStatic('../../../static/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'static', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveStatic('../../../static/index.cjs')],\n  });\n}\n\nasync function buildAdapterVercelEdgeVite(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'vercel-edge', 'vite', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'vercel-edge', 'vite', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'adapters', 'vercel-edge', 'vite', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: ADAPTER_EXTERNALS,\n    plugins: [resolveAdapterShared('../../shared/vite/index.cjs')],\n  });\n}\n\nasync function buildMiddlewareAzureSwa(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'azure-swa', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'azure-swa', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildMiddlewareAwsLambda(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'aws-lambda', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'aws-lambda', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildMiddlewareCloudflarePages(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'cloudflare-pages', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'cloudflare-pages', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildMiddlewareBun(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'bun', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'bun', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildMiddlewareDeno(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'deno', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'deno', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildMiddlewareNetlifyEdge(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'netlify-edge', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'netlify-edge', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildMiddlewareNode(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'node', 'index.ts')];\n\n  const external = ['node-fetch', 'undici', 'path', 'os', 'fs', 'url', ...MIDDLEWARE_EXTERNALS];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'node', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'node', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external,\n    plugins: [resolveRequestHandler('../request-handler/index.cjs')],\n  });\n}\n\nasync function buildMiddlewareRequestHandler(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'request-handler', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'request-handler', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'request-handler', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external: MIDDLEWARE_EXTERNALS,\n  });\n}\n\nasync function buildMiddlewareVercelEdge(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'vercel-edge', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'vercel-edge', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildMiddlewareFirebase(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'firebase', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'middleware', 'firebase', 'index.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external: MIDDLEWARE_EXTERNALS,\n    plugins: [resolveRequestHandler('../request-handler/index.mjs')],\n  });\n}\n\nasync function buildStatic(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'static', 'index.ts')];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'static', 'index.mjs'),\n    bundle: true,\n    platform: 'neutral',\n    format: 'esm',\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'static', 'index.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n  });\n}\n\nasync function buildStaticNode(config: BuildConfig) {\n  const entryPoints = [join(config.srcQwikCityDir, 'static', 'node', 'index.ts')];\n\n  const external = [\n    '@builder.io/qwik',\n    '@builder.io/qwik/optimizer',\n    '@builder.io/qwik-city',\n    'fs',\n    'http',\n    'https',\n    'node-fetch',\n    'undici',\n    'os',\n    'path',\n    'stream/web',\n    'url',\n    'worker_threads',\n    'vite',\n  ];\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'static', 'node.mjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'esm',\n    external,\n    plugins: [resolveRequestHandler('../middleware/request-handler/index.mjs')],\n  });\n\n  await build({\n    entryPoints,\n    outfile: join(config.distQwikCityPkgDir, 'static', 'node.cjs'),\n    bundle: true,\n    platform: 'node',\n    target: nodeTarget,\n    format: 'cjs',\n    external,\n    plugins: [resolveRequestHandler('../middleware/request-handler/index.cjs')],\n  });\n}\n\nfunction resolveRequestHandler(path: string) {\n  return importPath(/middleware\\/request-handler/, path);\n}\n\nfunction resolveStatic(path: string) {\n  return importPath(/static$/, path);\n}\n\nfunction resolveAdapterShared(path: string) {\n  return importPath(/shared\\/vite$/, path);\n}\n\nconst ADAPTER_EXTERNALS = [\n  'vite',\n  'fs',\n  'path',\n  '@builder.io/qwik',\n  '@builder.io/qwik/server',\n  '@builder.io/qwik/optimizer',\n  '@builder.io/qwik-city',\n  '@builder.io/qwik-city/static',\n  '@builder.io/qwik-city/middleware/request-handler',\n];\n\nconst MIDDLEWARE_EXTERNALS = [\n  '@builder.io/qwik',\n  '@builder.io/qwik/optimizer',\n  '@builder.io/qwik/server',\n  '@builder.io/qwik-city',\n  '@builder.io/qwik-city/static',\n  '@qwik-city-plan',\n  '@qwik-city-not-found-paths',\n  '@qwik-city-static-paths',\n];\n"
  },
  {
    "path": "scripts/qwik-labs.ts",
    "content": "import { type BuildConfig, panic } from './util.ts';\nimport { join } from 'node:path';\nimport { execa } from 'execa';\n\nconst PACKAGE = 'qwik-labs';\n\nexport async function buildQwikLabs(config: BuildConfig) {\n  const input = join(config.packagesDir, PACKAGE);\n\n  const result = await execa('pnpm', ['build'], {\n    stdout: 'inherit',\n    cwd: input,\n  });\n\n  if (result.failed) {\n    panic(`tsc failed`);\n  }\n  console.log(`⚛️  ${PACKAGE}`);\n}\n"
  },
  {
    "path": "scripts/qwik-push-build-repos.ts",
    "content": "import { execa } from 'execa';\nimport { existsSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = fileURLToPath(new URL('.', import.meta.url));\nconst token = process.env.QWIK_API_TOKEN_GITHUB;\nconst root = join(__dirname, '..');\nconst srcRepoRef = 'https://github.com/QwikDev/qwik/commit/';\n\n(async () => {\n  const finishQwik = await prepare({\n    buildRepo: 'qwik-build',\n    artifactsDir: join(root, 'packages', 'qwik'),\n  });\n  const finishQwikCity = await prepare({\n    buildRepo: 'qwik-city-build',\n    artifactsDir: join(root, 'packages', 'qwik-city'),\n  });\n  const finishCreateQwikCli = await prepare({\n    buildRepo: 'qwik-create-cli-build',\n    artifactsDir: join(root, 'packages', 'create-qwik'),\n  });\n  const finishQwikLabs = await prepare({\n    buildRepo: 'qwik-labs-build',\n    artifactsDir: join(root, 'packages', 'qwik-labs'),\n  });\n  await finishQwik();\n  await finishQwikCity();\n  await finishCreateQwikCli();\n  await finishQwikLabs();\n})();\n\nasync function prepare({ buildRepo, artifactsDir }: { buildRepo: string; artifactsDir: string }) {\n  if (!existsSync(artifactsDir)) {\n    // if no artifacts, then nothing to do.\n    console.log('No artifacts to save. (no artifacts found at ' + artifactsDir);\n    return () => null;\n  }\n  console.log(\n    'preparing to save artifacts from ' + artifactsDir + ' into QwikDev/' + buildRepo + ' repo.'\n  );\n  const buildRepoDir = join(root, 'dist-dev', buildRepo);\n  const repo = token\n    ? `https://${token}:x-oauth-basic@github.com/QwikDev/${buildRepo}.git`\n    : `git@github.com:QwikDev/${buildRepo}.git`;\n\n  await $('rm', '-rf', buildRepoDir);\n  const SHA = await $('git', 'rev-parse', 'HEAD');\n  await mkdir(join(root, 'dist-dev'), {\n    recursive: true,\n  });\n  $chdir(join(root, 'dist-dev'));\n  const branch = await $('git', 'branch', '--show-current');\n  const msg = await $('git', 'log', '--oneline', '-1', '--no-decorate');\n  const userName = await $('git', 'log', '-1', \"--pretty=format:'%an'\");\n  const userEmail = await $('git', 'log', '-1', \"--pretty=format:'%ae'\");\n  try {\n    // first try to get the specific branch only\n    await $('git', 'clone', '--depth=1', '--branch=' + branch, repo);\n    $chdir(buildRepoDir);\n    await $('rm', '-rf', ...(await expand(buildRepoDir)));\n  } catch (e) {\n    // Specific branch not found, so create empty repository.\n    await $('mkdir', buildRepoDir);\n    $chdir(buildRepoDir);\n    await $('git', 'init');\n    await $('git', 'remote', 'add', 'origin', repo);\n    await $('git', 'checkout', '-b', branch);\n  }\n\n  await $(\n    'cp',\n    '-r',\n    ...(await expand(artifactsDir, ['.gitignore', 'node_modules', 'src'])),\n    buildRepoDir\n  );\n  await $('cp', join(root, 'CONTINUOUS_BUILD.md'), 'README.md');\n  await $('git', 'add', '--all');\n  await $(\n    'git',\n    '-c',\n    `user.name=${userName}`,\n    '-c',\n    `user.email=${userEmail}`,\n    'commit',\n    '--allow-empty',\n    '-m',\n    msg + '\\n\\n' + srcRepoRef + SHA\n  );\n  let hasChanges = false;\n  try {\n    await execa('git', ['diff', 'HEAD', 'HEAD~', '--quiet', '--exit-code']);\n  } catch {\n    hasChanges = true;\n  }\n  if (hasChanges) {\n    const dstSHA = await $('git', 'rev-parse', 'HEAD');\n    console.log('##############################################################');\n    console.log('##############################################################');\n    console.log(`### ${artifactsDir} => QwikDev/${buildRepo}`);\n    console.log(`### ${srcRepoRef}/${dstSHA}`);\n    console.log('##############################################################');\n    console.log('##############################################################');\n  }\n  const cwd = process.cwd();\n  return async () => {\n    if (hasChanges) {\n      process.chdir(cwd);\n      console.log('PUSHING:', repo, `HEAD:${branch}`, 'in', cwd);\n      await $('git', 'push', repo, `HEAD:${branch}`);\n    } else {\n      console.log('No changes to push.');\n    }\n    await $('rm', '-rf', buildRepoDir);\n  };\n}\n\nfunction $chdir(path: string) {\n  console.log('CHDIR:', path);\n  process.chdir(path);\n}\n\nasync function $(cmd: string, ...args: string[]): Promise<string> {\n  console.log('EXEC:', cmd, ...args);\n  const { stdout } = await execa(cmd, args);\n  const output = String(stdout).trim();\n  console.log('     ', output);\n  return output;\n}\n\nasync function expand(path: string, ignore: string[] = []): Promise<string[]> {\n  const { stdout } = await execa('ls', ['-a', path]);\n  const paths = String(stdout)\n    .split('\\n')\n    .filter((v) => v !== '.' && v !== '..' && v !== '.git' && !ignore.includes(v))\n    .map((file) => path + '/' + file.trim());\n  return paths;\n}\n"
  },
  {
    "path": "scripts/qwik-react.ts",
    "content": "import { type BuildConfig, copyDir, panic } from './util.ts';\nimport { join } from 'node:path';\nimport { execa } from 'execa';\n\nconst PACKAGE = 'qwik-react';\n\nexport async function buildQwikReact(config: BuildConfig) {\n  const input = join(config.packagesDir, PACKAGE);\n\n  const result = await execa('pnpm', ['build'], {\n    stdout: 'inherit',\n    cwd: input,\n  });\n\n  if (result.failed) {\n    panic(`tsc failed`);\n  }\n  await copyDir(\n    config,\n    join(config.dtsDir, 'packages', 'qwik-react', 'src'),\n    join(input, 'lib', 'types')\n  );\n  console.log(`⚛️  ${PACKAGE}`);\n}\n"
  },
  {
    "path": "scripts/qwik-worker.ts",
    "content": "import { type BuildConfig, copyDir, panic } from './util.ts';\nimport { join } from 'node:path';\nimport { execa } from 'execa';\n\nconst PACKAGE = 'qwik-worker';\n\nexport async function buildQwikWorker(config: BuildConfig) {\n  const input = join(config.packagesDir, PACKAGE);\n\n  const result = await execa('pnpm', ['build'], {\n    stdout: 'inherit',\n    cwd: input,\n  });\n\n  if (result.failed) {\n    panic(`tsc failed`);\n  }\n  await copyDir(\n    config,\n    join(config.dtsDir, 'packages', PACKAGE, 'src'),\n    join(input, 'lib', 'types')\n  );\n  console.log(`⚛️  ${PACKAGE}`);\n}\n"
  },
  {
    "path": "scripts/release.ts",
    "content": "import { Octokit } from '@octokit/action';\nimport { execa } from 'execa';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport prompts from 'prompts';\nimport semver from 'semver';\nimport { publishCreateQwikCli } from './create-qwik-cli.ts';\nimport { publishEslint } from './eslint.ts';\nimport { readPackageJson, writePackageJson } from './package-json.ts';\nimport { type BuildConfig, panic, run } from './util.ts';\nimport { validateBuild } from './validate-build.ts';\n\nlet version: string;\n\nexport async function getVersion(distTag?: string) {\n  if (!version) {\n    const __dirname = fileURLToPath(new URL('.', import.meta.url));\n    // Qwik is the source of truth for the version\n    const qwikDir = join(__dirname, '..', 'packages', 'qwik');\n    const qwikPkg = await readPackageJson(qwikDir);\n    let v = qwikPkg.version;\n    if (!distTag || distTag === 'dev') {\n      v += '-dev';\n      // add the current short commit hash\n      // when in github actions, get from environment\n      try {\n        const gitSha = process.env.GITHUB_SHA;\n        const gitCommit = gitSha || (await execa('git', ['rev-parse', 'HEAD'])).stdout;\n        v += `+${gitCommit.slice(0, 7)}`;\n      } catch (e) {\n        // git not found\n      }\n      const gitStatus = await execa('git', ['status', '--porcelain']);\n      if (gitStatus.stdout !== '') {\n        const d = new Date();\n        v += '-';\n        v += String(d.getUTCFullYear());\n        v += String(d.getUTCMonth() + 1).padStart(2, '0');\n        v += String(d.getUTCDate()).padStart(2, '0');\n        v += String(d.getUTCHours()).padStart(2, '0');\n        v += String(d.getUTCMinutes()).padStart(2, '0');\n        v += String(d.getUTCSeconds()).padStart(2, '0');\n      }\n    }\n    version = v;\n  }\n  return version;\n}\nexport async function setDistVersion(config: BuildConfig) {\n  config.distVersion = await getVersion(config.setDistTag);\n}\n\nexport async function setReleaseVersion(config: BuildConfig) {\n  const distTag = String(config.setDistTag);\n  if (!config.setDistTag || distTag === '') {\n    // ensure npm dist tag for an actual release\n    panic(`Invalid npm dist tag \"${distTag}\"`);\n  }\n\n  console.log(`💫 Set release npm dist tag: ${distTag}`);\n\n  config.distVersion = await getVersion('release');\n\n  const validVersion = semver.valid(config.distVersion)!;\n  if (!validVersion) {\n    panic(`Invalid semver version \"${config.distVersion}\"`);\n  }\n\n  console.log(`🔥 Set release npm version: ${config.distVersion}`);\n\n  // check this @builder.io/qwik version isn't already published\n  await checkExistingNpmVersion('@builder.io/qwik', config.distVersion);\n\n  // check this @builder.io/qwik-city version isn't already published\n  await checkExistingNpmVersion('@builder.io/qwik-city', config.distVersion);\n}\n\nexport async function prepareReleaseVersion(config: BuildConfig) {\n  const rootPkg = await readPackageJson(config.rootDir);\n\n  const answers = await releaseVersionPrompt('@builder.io/qwik', rootPkg.version);\n  if (!semver.valid(answers.version)) {\n    panic(`Invalid version`);\n  }\n\n  config.distVersion = answers.version;\n}\n\nexport async function commitPrepareReleaseVersion(config: BuildConfig) {\n  const commitPaths: string[] = [];\n\n  // update root\n  const rootPkg = await readPackageJson(config.rootDir);\n  commitPaths.push(join(config.rootDir, 'package.json'));\n  const updatedPkg = { ...rootPkg };\n  updatedPkg.version = config.distVersion;\n  await writePackageJson(config.rootDir, updatedPkg);\n\n  // update packages/qwik\n  const qwikDir = join(config.packagesDir, 'qwik');\n  const qwikPkg = await readPackageJson(qwikDir);\n  commitPaths.push(join(qwikDir, 'package.json'));\n  qwikPkg.version = config.distVersion;\n  await writePackageJson(qwikDir, qwikPkg);\n\n  // update packages/qwik-city\n  const qwikCityDir = join(config.packagesDir, 'qwik-city');\n  const qwikCityPkg = await readPackageJson(qwikCityDir);\n  commitPaths.push(join(qwikCityDir, 'package.json'));\n  qwikCityPkg.version = config.distVersion;\n  await writePackageJson(qwikCityDir, qwikCityPkg);\n\n  // update the cli version\n  const distCliDir = join(config.packagesDir, 'create-qwik');\n  commitPaths.push(join(distCliDir, 'package.json'));\n  const cliPkg = await readPackageJson(distCliDir);\n  cliPkg.version = config.distVersion;\n  await writePackageJson(distCliDir, cliPkg);\n\n  // update the eslint version\n  const distEslintDir = join(config.packagesDir, 'eslint-plugin-qwik');\n  commitPaths.push(join(distEslintDir, 'package.json'));\n  const eslintPkg = await readPackageJson(distEslintDir);\n  eslintPkg.version = config.distVersion;\n  await writePackageJson(distEslintDir, eslintPkg);\n\n  // git add the changed package.json\n  const gitAddArgs = ['add', ...commitPaths];\n  await run('git', gitAddArgs);\n\n  // git commit the changed package.json\n  const gitCommitArgs = ['commit', '--message', `chore: ${config.distVersion}`];\n  await run('git', gitCommitArgs);\n\n  console.log(``);\n  console.log(`Next:`);\n  console.log(` - Submit a PR to main with the prepared release updates`);\n  console.log(` - Once merged, run the \"Qwik CI\" release workflow`);\n  console.log(` - https://github.com/QwikDev/qwik/actions/workflows/ci.yml`);\n  console.log(``);\n}\n\nexport async function publish(config: BuildConfig) {\n  const isDryRun = !!config.dryRun;\n\n  const qwikDir = join(config.packagesDir, 'qwik');\n  const distPkg = await readPackageJson(qwikDir);\n  const gitTag = `v${distPkg.version}`;\n  const distTag = config.setDistTag || 'dev';\n\n  console.log(`🚢 publishing ${distPkg.version}`, isDryRun ? '(dry-run)' : '');\n\n  // create a pack.tgz which is useful for debugging and uploaded as an artifact\n  const pkgTarName = `builder.io-qwik-${distPkg.version}.tgz`;\n  await execa('npm', ['pack'], { cwd: qwikDir });\n  await execa('mv', [pkgTarName, '../'], { cwd: qwikDir });\n\n  // make sure our build is good to go and has the files we expect\n  // and each of the files can be parsed correctly\n  await validateBuild(config);\n\n  // check all is good with an npm publish --dry-run before we continue\n  // dry-run does everything the same except actually publish to npm\n  const npmPublishArgs = ['publish', '--tag', distTag, '--access', 'public'];\n\n  const qwikCityDir = join(config.packagesDir, 'qwik-city');\n  // publish @builder.io/qwik-city (dry-run)\n  await run('npm', npmPublishArgs, true, true, { cwd: qwikCityDir });\n\n  // publish @builder.io/qwik (dry-run)\n  await run('npm', npmPublishArgs, true, true, { cwd: qwikDir });\n\n  // looks like the npm publish --dry-run was successful and\n  // we have more confidence that it should work on a real publish\n\n  // set the user git config email\n  const actor = process.env.GITHUB_ACTOR || 'builderbot';\n  const actorEmail = `${actor}@users.noreply.github.com`;\n  const gitConfigEmailArgs = ['config', 'user.email', actorEmail];\n  await run('git', gitConfigEmailArgs, isDryRun);\n\n  // set the user git config name\n  const gitConfigNameArgs = ['config', 'user.name', actor];\n  await run('git', gitConfigNameArgs, isDryRun);\n\n  // git tag this commit\n  const gitTagArgs = ['tag', '-f', '-m', distPkg.version, gitTag];\n  await run('git', gitTagArgs, isDryRun);\n\n  if (isDryRun) {\n    // git push only logs and does not execute in this dry run\n    const gitPushArgs = ['push', '--follow-tags'];\n    await run('git', gitPushArgs, true, false);\n  } else {\n    // production release\n    // git push to the repo w/ --dry-run flag to make sure we're good before publishing\n    const gitPushArgs = ['push', '--follow-tags'];\n    if (!config.devRelease) {\n      await run('git', gitPushArgs, false, true);\n    }\n\n    // if we've made it this far then the npm publish dry-run passed\n    // and all of the git commands worked, time to publish!!\n    // ⛴ LET'S GO!!\n\n    // publish @builder/qwik-city\n    await run('npm', npmPublishArgs, false, false, { cwd: qwikCityDir });\n\n    // publish @builder/qwik\n    await run('npm', npmPublishArgs, false, false, { cwd: qwikDir });\n\n    if (!config.devRelease) {\n      // git push to the production repo w/out the dry-run flag\n      // now that it's officially published to npm\n      await run('git', gitPushArgs, false, false);\n    }\n  }\n\n  if (!config.devRelease) {\n    // create a github release using the git tag we just pushed\n    await createGithubRelease(distPkg.version, gitTag, isDryRun);\n  }\n\n  console.log(\n    `🐋 published version \"${distPkg.version}\" with dist-tag \"${distTag}\" to npm`,\n    isDryRun ? '(dry-run)' : ''\n  );\n\n  await publishCreateQwikCli(config, distTag, distPkg.version, isDryRun);\n  await publishEslint(config, distTag, distPkg.version, isDryRun);\n}\n\nasync function createGithubRelease(version: string, gitTag: string, isDryRun: boolean) {\n  const [owner, repo] = process.env.GITHUB_REPOSITORY!.split('/');\n  const isPrerelease = !!semver.prerelease(version);\n\n  const ghUrl = 'POST /repos/{owner}/{repo}/releases';\n  const ghData = {\n    owner,\n    repo,\n    tag_name: gitTag,\n    prerelease: isPrerelease,\n    generate_release_notes: true,\n  };\n  console.log(`   ${ghUrl} ${JSON.stringify(ghData)}`, isDryRun ? '(dry-run)' : '');\n\n  if (!isDryRun) {\n    // https://docs.github.com/en/rest/reference/repos#create-a-release\n    const octokit = new Octokit();\n    await octokit.request(ghUrl, ghData);\n    console.log(\n      `🐋 created github release \"${gitTag}\": https://github.com/${owner}/${repo}/releases`\n    );\n  }\n}\n\nexport async function checkExistingNpmVersion(pkgName: string, newVersion: string) {\n  if (newVersion !== '0.0.1') {\n    const npmVersionsCall = await execa('npm', ['view', pkgName, 'versions', '--json']);\n    const publishedVersions: string[] = JSON.parse(npmVersionsCall.stdout);\n    if (publishedVersions.includes(newVersion)) {\n      panic(`Version \"${newVersion}\" of ${pkgName} is already published to npm`);\n    } else {\n      console.log(`✅ Version \"${newVersion}\" of ${pkgName} is not already published to npm`);\n    }\n  }\n}\n\nexport async function releaseVersionPrompt(pkgName: string, currentVersion: string) {\n  const answers = await prompts({\n    type: 'select',\n    name: 'version',\n    message: `Select ${pkgName} version`,\n    validate: async (version: string) => {\n      const validVersion = semver.valid(version)!;\n      if (!validVersion) {\n        panic(`Invalid semver version \"${version}\" for ${pkgName}`);\n      }\n      await checkExistingNpmVersion(pkgName, version);\n      return true;\n    },\n    choices: SEMVER_RELEASE_TYPES.map((v) => {\n      return {\n        title: `${v}  ${semver.inc(currentVersion, v)}`,\n        value: semver.inc(currentVersion, v)!,\n      };\n    }),\n  });\n  return answers;\n}\n\nconst SEMVER_RELEASE_TYPES: semver.ReleaseType[] = [\n  'prerelease',\n  'prepatch',\n  'patch',\n  'preminor',\n  'minor',\n  'premajor',\n  'major',\n];\n"
  },
  {
    "path": "scripts/runBefore.ts",
    "content": "function polyfill() {\n  // @ts-ignore\n  globalThis.qTest = true;\n  // @ts-ignore\n  globalThis.qRuntimeQrl = true;\n  // @ts-ignore\n  globalThis.qDev = true;\n  // @ts-ignore\n  globalThis.qInspector = false;\n  if (\n    typeof global !== 'undefined' &&\n    typeof globalThis.fetch !== 'function' &&\n    typeof process !== 'undefined' &&\n    process.versions.node\n  ) {\n    if (!globalThis.fetch) {\n      const { fetch, Headers, Request, Response, FormData } = require('undici');\n      globalThis.fetch = fetch;\n      globalThis.Headers = Headers;\n      globalThis.Request = Request;\n      globalThis.Response = Response;\n      globalThis.FormData = FormData;\n    }\n  }\n}\n\npolyfill();\n"
  },
  {
    "path": "scripts/submodule-build.ts",
    "content": "import { type BuildConfig, ensureDir, target, copyFile, type PackageJSON } from './util.ts';\nimport { join } from 'node:path';\nimport { type BuildOptions, build } from 'esbuild';\nimport { writePackageJson } from './package-json.ts';\n\nexport async function submoduleBuild(config: BuildConfig) {\n  const submodule = 'build';\n  const buildSrcDtsDir = join(config.dtsDir, 'packages', 'qwik', 'src', submodule);\n  const buildDestDir = join(config.distQwikPkgDir, submodule);\n\n  ensureDir(buildDestDir);\n\n  bundleIndex(config, 'index');\n  bundleIndex(config, 'index.dev');\n  bundleIndex(config, 'index.prod');\n\n  console.log('🐨', submodule);\n\n  await copyFile(join(buildSrcDtsDir, 'index.d.ts'), join(buildDestDir, 'index.d.ts'));\n\n  const loaderPkg: PackageJSON = {\n    name: `@builder.io/qwik/build`,\n    version: config.distVersion,\n    main: `index.mjs`,\n    types: `index.d.ts`,\n    private: true,\n    type: 'module',\n  };\n  await writePackageJson(buildDestDir, loaderPkg);\n}\n\nexport async function bundleIndex(config: BuildConfig, entryName: string) {\n  const submodule = 'build';\n  const buildDestDir = join(config.distQwikPkgDir, submodule);\n\n  ensureDir(buildDestDir);\n\n  const opts: BuildOptions = {\n    entryPoints: [join(config.srcQwikDir, 'build', `${entryName}.ts`)],\n    entryNames: entryName,\n    outdir: buildDestDir,\n    bundle: true,\n    sourcemap: true,\n    target,\n  };\n\n  const esm = build({\n    ...opts,\n    format: 'esm',\n    outExtension: { '.js': '.mjs' },\n  });\n\n  const cjs = build({\n    ...opts,\n    format: 'cjs',\n\n    banner: {\n      js: `globalThis.qwikBuild = (function (module) {`,\n    },\n    footer: {\n      js: `return module.exports; })(typeof module === 'object' && module.exports ? module : { exports: {} });`,\n    },\n    outExtension: { '.js': '.cjs' },\n  });\n\n  await Promise.all([esm, cjs]);\n}\n"
  },
  {
    "path": "scripts/submodule-cli.ts",
    "content": "import { build } from 'esbuild';\nimport { existsSync, rmSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { copyStartersDir } from './create-qwik-cli.ts';\nimport { type BuildConfig, copyDir, getBanner, nodeTarget } from './util.ts';\n\n/** Builds @builder.io/qwik/cli */\nexport async function submoduleCli(config: BuildConfig) {\n  const submodule = 'cli';\n\n  await build({\n    entryPoints: [join(config.srcQwikDir, submodule, 'index.ts')],\n    outfile: join(config.distQwikPkgDir, 'cli.cjs'),\n    format: 'cjs',\n    platform: 'node',\n    target: nodeTarget,\n    sourcemap: false,\n    bundle: true,\n    banner: { js: getBanner('@builder.io/qwik/cli', config.distVersion) },\n    outExtension: { '.js': '.cjs' },\n    plugins: [\n      {\n        name: 'colorAlias',\n        setup(build) {\n          build.onResolve({ filter: /^chalk$/ }, async (args) => {\n            const result = await build.resolve('kleur', {\n              resolveDir: args.resolveDir,\n              kind: 'import-statement',\n            });\n            if (result.errors.length > 0) {\n              return { errors: result.errors };\n            }\n            return { path: result.path };\n          });\n        },\n      },\n    ],\n    external: ['prettier', 'typescript', 'ts-morph', 'semver', 'ignore'],\n    define: {\n      'globalThis.CODE_MOD': 'true',\n      'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n    },\n  });\n\n  await copyStartersDir(config, config.distQwikPkgDir, ['features', 'adapters']);\n\n  const tmplSrc = join(config.startersDir, 'templates');\n  const tmplDist = join(config.distQwikPkgDir, 'templates');\n\n  if (existsSync(tmplDist)) {\n    rmSync(tmplDist, { recursive: true });\n  }\n\n  await copyDir(config, tmplSrc, tmplDist);\n\n  console.log('📠', submodule);\n}\n"
  },
  {
    "path": "scripts/submodule-core.ts",
    "content": "import { type BuildConfig, rollupOnWarn } from './util.ts';\nimport { build, type BuildOptions } from 'esbuild';\nimport { getBanner, fileSize, readFile, target, writeFile } from './util.ts';\nimport { type InputOptions, type OutputOptions, rollup } from 'rollup';\nimport { join } from 'node:path';\nimport { minify } from 'terser';\n\n/**\n * Build the core package which is also the root package: @builder.io/qwik\n *\n * Uses esbuild during development (cuz it's super fast) and TSC + Rollup + Terser for production,\n * because it generates smaller code that minifies better.\n */\nexport function submoduleCore(config: BuildConfig) {\n  if (config.dev) {\n    return submoduleCoreDev(config);\n  }\n  return submoduleCoreProd(config);\n}\n\nasync function submoduleCoreProd(config: BuildConfig) {\n  const input: InputOptions = {\n    input: join(config.tscDir, 'packages', 'qwik', 'src', 'core', 'index.js'),\n    onwarn: rollupOnWarn,\n    external: ['@builder.io/qwik/build', '@builder.io/qwik/preloader'],\n    plugins: [\n      {\n        name: 'setVersion',\n        generateBundle(_, bundles) {\n          for (const f in bundles) {\n            const b = bundles[f];\n            if (b.type === 'chunk') {\n              b.code = b.code.replace(\n                'globalThis.QWIK_VERSION',\n                JSON.stringify(config.distVersion)\n              );\n            }\n          }\n        },\n      },\n    ],\n  };\n\n  const esmOutput: OutputOptions = {\n    dir: join(config.distQwikPkgDir),\n    format: 'es',\n    entryFileNames: 'core.mjs',\n    sourcemap: true,\n    banner: getBanner('@builder.io/qwik', config.distVersion),\n  };\n\n  const cjsOutput: OutputOptions = {\n    dir: join(config.distQwikPkgDir),\n    format: 'umd',\n    name: 'qwikCore',\n    entryFileNames: 'core.cjs',\n    sourcemap: true,\n    globals: {\n      '@builder.io/qwik/build': 'qwikBuild',\n      // not actually used\n      '@builder.io/qwik/preloader': 'qwikPreloader',\n    },\n    banner: getBanner('@builder.io/qwik', config.distVersion),\n  };\n\n  const build = await rollup(input);\n\n  await Promise.all([build.write(esmOutput), build.write(cjsOutput)]);\n\n  console.log('🦊 core.mjs:', await fileSize(join(config.distQwikPkgDir, 'core.mjs')));\n\n  const inputCore = join(config.distQwikPkgDir, 'core.mjs');\n  const inputMin: InputOptions = {\n    external: ['@builder.io/qwik/preloader'],\n    input: inputCore,\n    onwarn: rollupOnWarn,\n    plugins: [\n      {\n        name: 'build',\n        resolveId(id) {\n          if (id === '@index.min') {\n            return id;\n          }\n          if (id === '@builder.io/qwik/build') {\n            return id;\n          }\n        },\n        load(id) {\n          if (id === '@builder.io/qwik/build') {\n            return `\n              export const isServer = false;\n              export const isBrowser = true;\n              export const isDev = false;\n            `;\n          }\n        },\n      },\n    ],\n  };\n  const buildMin = await rollup(inputMin);\n  await buildMin.write({\n    dir: join(config.distQwikPkgDir),\n    format: 'es',\n    entryFileNames: 'core.min.mjs',\n    plugins: [\n      {\n        name: 'minify',\n        async renderChunk(code) {\n          const esmMinifyResult = await minify(code, {\n            module: true,\n            toplevel: true,\n            compress: {\n              module: true,\n              toplevel: true,\n              global_defs: {\n                // special global that when set to false will remove all dev code entirely\n                // developer production builds could use core.min.js directly, or setup\n                // their own build tools to define the global `qwikDev` to false\n                'globalThis.qDev': false,\n                'globalThis.qInspector': false,\n                'globalThis.qSerialize': false,\n                'globalThis.qDynamicPlatform': false,\n                'globalThis.qTest': false,\n                'globalThis.qRuntimeQrl': false,\n                'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n              },\n              ecma: 2020,\n              passes: 3,\n              pure_getters: true,\n              unsafe_symbols: true,\n              keep_fargs: false,\n            },\n            mangle: {\n              toplevel: true,\n              module: true,\n              properties: {\n                regex: '^\\\\$.+\\\\$$',\n              },\n            },\n            format: {\n              comments: /__PURE__/,\n              preserve_annotations: true,\n              ecma: 2020,\n            },\n          });\n          const esmMinCode = esmMinifyResult.code!;\n          const esmCleanCode = esmMinCode.replace(/__self__/g, '__SELF__');\n\n          const selfIdx = esmCleanCode.indexOf('self');\n          const indx = Math.max(selfIdx);\n          if (indx !== -1) {\n            throw new Error(\n              `\"core.min.mjs\" should not have any global references, and should have been removed for a production minified build\\n` +\n                esmCleanCode.substring(indx, indx + 10) +\n                '\\n' +\n                esmCleanCode.substring(indx - 100, indx + 300)\n            );\n          }\n          return {\n            code: esmCleanCode,\n          };\n        },\n      },\n    ],\n  });\n\n  console.log('🐭 core.min.mjs:', await fileSize(join(config.distQwikPkgDir, 'core.min.mjs')));\n\n  let esmCode = await readFile(join(config.distQwikPkgDir, 'core.mjs'), 'utf-8');\n  let cjsCode = await readFile(join(config.distQwikPkgDir, 'core.cjs'), 'utf-8');\n  // fixup the Vite base url\n  cjsCode = cjsCode.replaceAll('undefined.BASE_URL', 'globalThis.BASE_URL||\"/\"');\n  await writeFile(join(config.distQwikPkgDir, 'core.cjs'), cjsCode);\n\n  await submoduleCoreProduction(config, esmCode, join(config.distQwikPkgDir, 'core.prod.mjs'));\n  await submoduleCoreProduction(config, cjsCode, join(config.distQwikPkgDir, 'core.prod.cjs'));\n}\n\nasync function submoduleCoreProduction(config: BuildConfig, code: string, outPath: string) {\n  const result = await minify(code, {\n    compress: {\n      pure_getters: true,\n      unsafe_symbols: true,\n      keep_fargs: false,\n      join_vars: false,\n\n      global_defs: {\n        'globalThis.qDev': false,\n        'globalThis.qInspector': false,\n        'globalThis.qSerialize': true,\n        'globalThis.qDynamicPlatform': true,\n        'globalThis.qTest': false,\n        'globalThis.qRuntimeQrl': false,\n        'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n      },\n    },\n    format: {\n      beautify: true,\n      braces: true,\n      comments: /__PURE__/,\n      preserve_annotations: true,\n      ecma: 2020,\n      preamble: getBanner('@builder.io/qwik', config.distVersion),\n    },\n    mangle: false,\n  });\n  code = result.code!;\n\n  await writeFile(outPath, code + '\\n');\n}\n\nasync function submoduleCoreDev(config: BuildConfig) {\n  const submodule = 'core';\n\n  const opts: BuildOptions = {\n    entryPoints: [join(config.srcQwikDir, submodule, 'index.ts')],\n    entryNames: submodule,\n    outdir: config.distQwikPkgDir,\n    bundle: true,\n    sourcemap: 'external',\n    target,\n    define: {\n      'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n    },\n  };\n\n  const esm = await build({\n    ...opts,\n    external: ['@builder.io/qwik/build', '@builder.io/qwik/preloader'],\n    format: 'esm',\n    outExtension: { '.js': '.mjs' },\n  });\n\n  // We do a CJS build, only for the repl service worker\n  const cjs = build({\n    ...opts,\n    // we don't externalize qwik build because then the repl service worker sees require()\n    define: {\n      ...opts.define,\n      // We need to get rid of the import.meta.env values\n      // Vite's base url\n      'import.meta.env.BASE_URL': '\"globalThis.BASE_URL||\\'/\\'\"',\n      // Vite's devserver mode\n      'import.meta.env.DEV': 'false',\n    },\n    format: 'cjs',\n    outExtension: { '.js': '.cjs' },\n    banner: {\n      js: `globalThis.qwikCore = (function (module) {`,\n    },\n    footer: {\n      js: `return module.exports; })(typeof module === 'object' && module.exports ? module : { exports: {} });`,\n    },\n  });\n\n  await Promise.all([esm, cjs]);\n\n  // Point the minified and prod versions to the dev versions\n  await writeFile(join(config.distQwikPkgDir, 'core.prod.mjs'), `export * from './core.mjs';\\n`);\n  await writeFile(\n    join(config.distQwikPkgDir, 'core.prod.cjs'),\n    `module.exports = require('./core.cjs');\\n`\n  );\n  await writeFile(join(config.distQwikPkgDir, 'core.min.mjs'), `export * from './core.mjs';\\n`);\n  await writeFile(\n    join(config.distQwikPkgDir, 'core.min.cjs'),\n    `module.exports = require('./core.cjs');\\n`\n  );\n\n  console.log('🐬', submodule, '(dev)');\n}\n"
  },
  {
    "path": "scripts/submodule-optimizer.ts",
    "content": "import { build, type BuildOptions } from 'esbuild';\nimport {\n  access,\n  type BuildConfig,\n  getBanner,\n  nodeTarget,\n  readFile,\n  target,\n  writeFile,\n} from './util.ts';\nimport { join } from 'node:path';\nimport { minify } from 'terser';\nimport { platformArchTriples } from '@napi-rs/triples';\nimport { constants, existsSync } from 'node:fs';\nimport { inlineQwikScriptsEsBuild } from './submodule-qwikloader.ts';\nimport RawPlugin from 'esbuild-plugin-raw';\n\n/** Builds @builder.io/optimizer */\nexport async function submoduleOptimizer(config: BuildConfig) {\n  const submodule = 'optimizer';\n\n  // Uncomment this to regenerate the platform binding map for the optimizer. This is only necessary when adding new platform bindings to qwik, and should be committed to source control.\n  // await generatePlatformBindingsData(config);\n\n  async function buildOptimizer() {\n    const opts: BuildOptions = {\n      entryPoints: [join(config.srcQwikDir, submodule, 'src', 'index.ts')],\n      entryNames: 'optimizer',\n      outdir: config.distQwikPkgDir,\n      bundle: true,\n      sourcemap: false,\n      platform: 'node',\n      target,\n      external: [\n        /* no Node.js built-in externals allowed! */\n        'espree',\n        'launch-editor',\n      ],\n    };\n\n    const qwikloaderScripts = await inlineQwikScriptsEsBuild(config);\n\n    const esmBuild = build({\n      ...opts,\n      format: 'esm',\n      banner: { js: getBanner('@builder.io/qwik/optimizer', config.distVersion) },\n      outExtension: { '.js': '.mjs' },\n      define: {\n        'globalThis.IS_CJS': 'false',\n        'globalThis.IS_ESM': 'true',\n        'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n        ...qwikloaderScripts,\n      },\n      plugins: [RawPlugin()],\n    });\n\n    const cjsBanner = [`globalThis.qwikOptimizer = (function (module) {`].join('\\n');\n\n    const cjsBuild = build({\n      ...opts,\n      format: 'cjs',\n      banner: { js: cjsBanner },\n      footer: {\n        js: `return module.exports; })(typeof module === 'object' && module.exports ? module : { exports: {} });`,\n      },\n      outExtension: { '.js': '.cjs' },\n      define: {\n        'globalThis.IS_CJS': 'true',\n        'globalThis.IS_ESM': 'false',\n        'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n        ...qwikloaderScripts,\n      },\n      target: nodeTarget,\n      plugins: [RawPlugin()],\n    });\n\n    await Promise.all([esmBuild, cjsBuild]);\n\n    if (!config.dev) {\n      const esmDist = join(config.distQwikPkgDir, 'optimizer.mjs');\n      const cjsDist = join(config.distQwikPkgDir, 'optimizer.cjs');\n\n      await Promise.all(\n        [esmDist, cjsDist].map(async (p) => {\n          const src = await readFile(p, 'utf-8');\n          const result = await minify(src, {\n            compress: {\n              booleans: false,\n              collapse_vars: false,\n              comparisons: false,\n              drop_debugger: false,\n              expression: false,\n              keep_classnames: true,\n              inline: false,\n              if_return: false,\n              join_vars: false,\n              loops: false,\n              passes: 1,\n              reduce_funcs: false,\n              reduce_vars: false,\n              sequences: false,\n              switches: false,\n            },\n            format: {\n              comments: false,\n              braces: true,\n              beautify: true,\n              indent_level: 2,\n              preamble: getBanner('@builder.io/qwik/optimizer', config.distVersion),\n            },\n            mangle: false,\n          });\n          await writeFile(p, result.code!);\n        })\n      );\n    }\n\n    console.log('🐹', submodule);\n  }\n\n  await Promise.all([buildOptimizer()]);\n}\n\nasync function generatePlatformBindingsData(config: BuildConfig) {\n  // generate the platform binding information for only what qwik provides\n  // allows us to avoid using a file system in the optimizer, take a look at:\n  // - node_modules/@node-rs/helper/lib/loader.js\n  // - node_modules/@napi-rs/triples/index.js\n\n  const qwikArchTriples: typeof platformArchTriples = {};\n\n  for (const platformName in platformArchTriples) {\n    const platform = platformArchTriples[platformName];\n    for (const archName in platform) {\n      const triples = platform[archName];\n      for (const triple of triples) {\n        const qwikArchABI = `qwik.${triple.platformArchABI}.node`;\n        if (existsSync(join(config.distBindingsDir, qwikArchABI))) {\n          const qwikTriple = {\n            platform: triple.platform,\n            arch: triple.arch,\n            abi: triple.abi,\n            platformArchABI: qwikArchABI,\n          };\n\n          qwikArchTriples[platformName] = qwikArchTriples[platformName] || {};\n          qwikArchTriples[platformName][archName] = qwikArchTriples[platformName][archName] || [];\n          qwikArchTriples[platformName][archName].push(qwikTriple as any);\n        }\n      }\n    }\n  }\n\n  const c: string[] = [];\n  c.push(`// AUTO-GENERATED IN OPTIMIZER BUILD SCRIPT`);\n  c.push(`// created from data provided by @napi-rs/triples`);\n  c.push(``);\n  c.push(`// prettier-ignore`);\n  c.push(`export const QWIK_BINDING_MAP = ${JSON.stringify(qwikArchTriples, null, 2)};`);\n\n  const code = c.join('\\n') + '\\n';\n\n  const platformBindingPath = join(config.srcQwikDir, 'optimizer', 'src', 'qwik-binding-map.ts');\n  let isWritable;\n  try {\n    await access(platformBindingPath, constants.W_OK);\n    isWritable = true;\n  } catch (e) {\n    isWritable = false;\n  }\n  if (isWritable) {\n    await writeFile(platformBindingPath, code);\n  }\n}\n"
  },
  {
    "path": "scripts/submodule-preloader.ts",
    "content": "import { join } from 'node:path';\nimport { build } from 'vite';\nimport { fileSize, type BuildConfig } from './util.ts';\nimport { minify } from 'terser';\nimport type { Plugin } from 'vite';\n\n/**\n * Custom plugin to apply terser during the bundle generation. Vite doesn't minify library ES\n * modules.\n */\nfunction customTerserPlugin(): Plugin {\n  return {\n    name: 'custom-terser',\n    async renderChunk(code, chunk) {\n      // Only process JavaScript chunks\n      if (!chunk.fileName.endsWith('.mjs') && !chunk.fileName.endsWith('.js')) {\n        return null;\n      }\n\n      // Keep the result readable for debugging\n      const result = await minify(code, {\n        compress: {\n          defaults: false,\n          module: true,\n          hoist_props: true,\n          unused: true,\n          booleans_as_integers: true,\n        },\n        mangle: {\n          toplevel: false,\n          properties: {\n            // use short attribute names for internal properties\n            regex: '^\\\\$.+\\\\$$|^[A-Z][a-zA-Z]+$',\n          },\n        },\n        format: {\n          comments: true,\n        },\n      });\n\n      return result.code || null;\n    },\n  };\n}\n\n/**\n * Builds the qwikloader javascript files using Vite. These files can be used by other tooling, and\n * are provided in the package so CDNs could point to them. The @builder.io/optimizer submodule also\n * provides a utility function.\n */\nexport async function submodulePreloader(config: BuildConfig) {\n  await build({\n    build: {\n      emptyOutDir: false,\n      copyPublicDir: false,\n      lib: {\n        entry: join(config.srcQwikDir, 'core/preloader'),\n        formats: ['es', 'cjs'],\n        fileName: (format) => (format === 'es' ? 'preloader.mjs' : 'preloader.cjs'),\n      },\n      rollupOptions: {\n        external: ['@builder.io/qwik/build'],\n      },\n      minify: false, // This is the default, just to be explicit\n      outDir: config.distQwikPkgDir,\n    },\n    plugins: [customTerserPlugin()],\n  });\n\n  const preloaderSize = await fileSize(join(config.distQwikPkgDir, 'preloader.mjs'));\n  console.log(`🐮 preloader:`, preloaderSize);\n}\n"
  },
  {
    "path": "scripts/submodule-qwikloader.ts",
    "content": "import { join } from 'node:path';\nimport { build } from 'vite';\nimport {\n  type BuildConfig,\n  ensureDir,\n  fileSize,\n  type PackageJSON,\n  readFile,\n  writeFile,\n} from './util.ts';\nimport { minify } from 'terser';\nimport { writePackageJson } from './package-json.ts';\n\n/**\n * Builds the qwikloader javascript files. These files can be used by other tooling, and are\n * provided in the package so CDNs could point to them. The @builder.io/optimizer submodule also\n * provides a utility function.\n */\nexport async function submoduleQwikLoader(config: BuildConfig) {\n  // Build the debug version first\n  await build({\n    build: {\n      emptyOutDir: false,\n      copyPublicDir: false,\n      target: 'es2020',\n      lib: {\n        entry: join(config.srcQwikDir, 'qwikloader.ts'),\n        formats: ['es'],\n        fileName: () => 'qwikloader.debug.js',\n      },\n      minify: false,\n      outDir: config.distQwikPkgDir,\n    },\n  });\n\n  // Read the debug version\n  const debugFilePath = join(config.distQwikPkgDir, 'qwikloader.debug.js');\n  const debugContent = await readFile(debugFilePath, 'utf-8');\n\n  // Create the minified version using terser\n  const minifyResult = await minify(debugContent, {\n    compress: {\n      global_defs: {\n        'window.BuildEvents': false,\n      },\n      keep_fargs: false,\n      unsafe: true,\n      passes: 2,\n    },\n    mangle: {\n      keep_fnames: false,\n      properties: false,\n      toplevel: true,\n    },\n    // uncomment this to understand the minified version better\n    // format: { semicolons: false },\n  });\n\n  // Write the minified version\n  const minifiedFilePath = join(config.distQwikPkgDir, 'qwikloader.js');\n  await writeFile(minifiedFilePath, minifyResult.code || '');\n\n  await generateLoaderSubmodule(config);\n\n  const loaderSize = await fileSize(join(config.distQwikPkgDir, 'qwikloader.js'));\n  console.log(`🐸 qwikloader:`, loaderSize);\n}\n\nconst getLoaderJsonString = async (config: BuildConfig, name: string) => {\n  const filePath = join(config.distQwikPkgDir, name);\n  const content = await readFile(filePath, 'utf-8');\n  // Remove vite comments and leading/trailing whitespace\n  let cleaned = content.trim().replace(/\\n?\\/\\*\\s*@vite[^*]+\\*\\/\\n?/g, '');\n  if (cleaned.endsWith(';')) {\n    cleaned = cleaned.slice(0, -1);\n  }\n  return JSON.stringify(cleaned);\n};\n\n/** Load each of the qwik scripts to be inlined with esbuild \"define\" as const variables. */\nexport async function inlineQwikScriptsEsBuild(config: BuildConfig) {\n  const variableToFileMap = [\n    ['QWIK_LOADER_DEFAULT_MINIFIED', 'qwikloader.js'],\n    ['QWIK_LOADER_DEFAULT_DEBUG', 'qwikloader.debug.js'],\n  ];\n\n  const define: { [varName: string]: string } = {};\n\n  await Promise.all(\n    variableToFileMap.map(async (varToFile) => {\n      const varName = `globalThis.${varToFile[0]}`;\n      define[varName] = await getLoaderJsonString(config, varToFile[1]);\n    })\n  );\n\n  return define;\n}\n\nasync function generateLoaderSubmodule(config: BuildConfig) {\n  const loaderDistDir = join(config.distQwikPkgDir, 'loader');\n\n  const code = [\n    `const QWIK_LOADER = ${await getLoaderJsonString(config, 'qwikloader.js')};`,\n    `const QWIK_LOADER_DEBUG = ${await getLoaderJsonString(config, 'qwikloader.debug.js')};`,\n  ];\n\n  const esmCode = [...code, `export { QWIK_LOADER, QWIK_LOADER_DEBUG };`];\n  const cjsCode = [\n    ...code,\n    `exports.QWIK_LOADER = QWIK_LOADER;`,\n    `exports.QWIK_LOADER_DEBUG = QWIK_LOADER_DEBUG;`,\n  ];\n  const dtsCode = [\n    `export declare const QWIK_LOADER: string;`,\n    `export declare const QWIK_LOADER_DEBUG: string;`,\n  ];\n\n  ensureDir(loaderDistDir);\n  await writeFile(join(loaderDistDir, 'index.mjs'), esmCode.join('\\n') + '\\n');\n  await writeFile(join(loaderDistDir, 'index.cjs'), cjsCode.join('\\n') + '\\n');\n  await writeFile(join(loaderDistDir, 'index.d.ts'), dtsCode.join('\\n') + '\\n');\n\n  const loaderPkg: PackageJSON = {\n    name: `@builder.io/qwik/loader`,\n    version: config.distVersion,\n    main: `index.mjs`,\n    types: `index.d.ts`,\n    private: true,\n    type: 'module',\n  };\n  await writePackageJson(loaderDistDir, loaderPkg);\n}\n"
  },
  {
    "path": "scripts/submodule-server.ts",
    "content": "import { build, type BuildOptions, type Plugin } from 'esbuild';\nimport { join } from 'node:path';\nimport { type BuildConfig, getBanner, importPath, nodeTarget, target } from './util.ts';\nimport { inlineQwikScriptsEsBuild } from './submodule-qwikloader.ts';\nimport { readPackageJson } from './package-json.ts';\n\n/**\n * Builds @builder.io/server\n *\n * This is submodule for helping to generate server-side rendered pages, along with providing\n * utilities for prerendering and unit testing.\n */\nexport async function submoduleServer(config: BuildConfig) {\n  const submodule = 'server';\n\n  const qwikDomPlugin = await bundleQwikDom(config);\n  const qwikDomVersion = await getQwikDomVersion(config);\n\n  const opts: BuildOptions = {\n    entryPoints: [join(config.srcQwikDir, submodule, 'index.ts')],\n    entryNames: 'server',\n    outdir: config.distQwikPkgDir,\n    sourcemap: config.dev,\n    bundle: true,\n    platform: 'node',\n    target,\n    external: [\n      /* no Node.js built-in externals allowed! */\n      '@builder.io/qwik/build',\n      '@builder.io/qwik/preloader',\n      '@qwik-client-manifest',\n    ],\n  };\n\n  const esm = build({\n    ...opts,\n    format: 'esm',\n    banner: { js: getBanner('@builder.io/qwik/server', config.distVersion) },\n    outExtension: { '.js': '.mjs' },\n    plugins: [importPath(/^@builder\\.io\\/qwik$/, '@builder.io/qwik'), qwikDomPlugin],\n    define: {\n      ...(await inlineQwikScriptsEsBuild(config)),\n      'globalThis.IS_CJS': 'false',\n      'globalThis.IS_ESM': 'true',\n      'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n      'globalThis.QWIK_DOM_VERSION': JSON.stringify(qwikDomVersion),\n    },\n  });\n\n  const cjsBanner = [\n    getBanner('@builder.io/qwik/server', config.distVersion),\n    `globalThis.qwikServer = (function (module) {`,\n    browserCjsRequireShim,\n  ].join('\\n');\n\n  const cjs = build({\n    ...opts,\n    format: 'cjs',\n    banner: {\n      js: cjsBanner,\n    },\n    footer: {\n      js: `return module.exports; })(typeof module === 'object' && module.exports ? module : { exports: {} });`,\n    },\n    outExtension: { '.js': '.cjs' },\n    plugins: [importPath(/^@builder\\.io\\/qwik$/, '@builder.io/qwik'), qwikDomPlugin],\n    target: nodeTarget,\n    define: {\n      ...(await inlineQwikScriptsEsBuild(config)),\n      'globalThis.IS_CJS': 'true',\n      'globalThis.IS_ESM': 'false',\n      'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),\n      'globalThis.QWIK_DOM_VERSION': JSON.stringify(qwikDomVersion),\n      // We need to get rid of the import.meta.env values\n      // Vite's base url\n      'import.meta.env.BASE_URL': '\"globalThis.BASE_URL||\\'/\\'\"',\n      // Vite's devserver mode\n      'import.meta.env.DEV': 'false',\n    },\n  });\n\n  await Promise.all([esm, cjs]);\n\n  console.log('🐰', submodule);\n}\n\nasync function bundleQwikDom(config: BuildConfig) {\n  const input = join(config.packagesDir, 'qwik-dom', 'lib', 'index.js');\n  const outfile = join(config.tmpDir, 'qwikdom.mjs');\n\n  const opts: BuildOptions = {\n    entryPoints: [input],\n    sourcemap: false,\n    minify: !config.dev,\n    bundle: true,\n    target,\n    outfile,\n    format: 'esm',\n  };\n\n  await build(opts);\n\n  const qwikDomPlugin: Plugin = {\n    name: 'qwikDomPlugin',\n    setup(build) {\n      build.onResolve({ filter: /@builder.io\\/qwik-dom/ }, () => {\n        return {\n          path: outfile,\n        };\n      });\n    },\n  };\n\n  return qwikDomPlugin;\n}\n\nasync function getQwikDomVersion(config: BuildConfig) {\n  const pkgJsonPath = join(config.packagesDir, 'qwik-dom');\n  const pkgJson = await readPackageJson(pkgJsonPath);\n  return pkgJson.version;\n}\n\nconst browserCjsRequireShim = `\nif (typeof require !== 'function' && typeof location !== 'undefined' && typeof navigator !== 'undefined') {\n  // shim cjs require() for core.cjs within a browser\n  globalThis.require = function(path) {\n    if (path === './core.cjs' || path === '@builder.io/qwik') {\n      if (!self.qwikCore) {\n        throw new Error('Qwik Core global, \"globalThis.qwikCore\", must already be loaded for the Qwik Server to be used within a browser.');\n      }\n      return self.qwikCore;\n    }\n    if (path === '@builder.io/qwik/build') {\n      if (!self.qwikBuild) {\n        throw new Error('Qwik Build global, \"globalThis.qwikBuild\", must already be loaded for the Qwik Server to be used within a browser.');\n      }\n      return self.qwikBuild;\n    }\n    if (path === '@qwik-client-manifest') {\n      return {};\n    }\n    throw new Error('Unable to require() path \"' + path + '\" from a browser environment.');\n  };\n}`;\n"
  },
  {
    "path": "scripts/submodule-testing.ts",
    "content": "import { getBanner, importPath, nodeTarget, target } from './util.ts';\nimport { build, type BuildOptions } from 'esbuild';\nimport { type BuildConfig, type PackageJSON } from './util.ts';\nimport { join } from 'node:path';\nimport { writePackageJson } from './package-json.ts';\n\n/** Builds @builder.io/testing */\nexport async function submoduleTesting(config: BuildConfig) {\n  const submodule = 'testing';\n\n  const opts: BuildOptions = {\n    entryPoints: [join(config.srcQwikDir, submodule, 'index.ts')],\n    outdir: join(config.distQwikPkgDir, submodule),\n    sourcemap: config.dev,\n    bundle: true,\n    target,\n    external: ['@builder.io/qwik/build'],\n    platform: 'node',\n    // external: [...nodeBuiltIns],\n  };\n\n  const esm = build({\n    ...opts,\n    format: 'esm',\n    banner: { js: getBanner('@builder.io/qwik/testing', config.distVersion) },\n    outExtension: { '.js': '.mjs' },\n    plugins: [\n      importPath(/^@builder\\.io\\/qwik$/, '../core.mjs'),\n      importPath(/^@builder\\.io\\/qwik\\/optimizer$/, '../optimizer.mjs'),\n      importPath(/^@builder\\.io\\/qwik\\/server$/, '../server.mjs'),\n    ],\n    define: {\n      'globalThis.MODULE_EXT': `\"mjs\"`,\n      'globalThis.RUNNER': `false`,\n    },\n    target: 'es2020' /* needed for import.meta */,\n  });\n\n  const cjs = build({\n    ...opts,\n    format: 'cjs',\n    outExtension: { '.js': '.cjs' },\n    banner: {\n      js: getBanner('@builder.io/qwik/testing', config.distVersion),\n    },\n    plugins: [\n      importPath(/^@builder\\.io\\/qwik$/, '../core.cjs'),\n      importPath(/^@builder\\.io\\/qwik\\/optimizer$/, '../optimizer.cjs'),\n      importPath(/^@builder\\.io\\/qwik\\/server$/, '../server.cjs'),\n    ],\n    define: {\n      'globalThis.MODULE_EXT': `\"cjs\"`,\n      'globalThis.RUNNER': `false`,\n    },\n    platform: 'node',\n    target: nodeTarget,\n  });\n\n  await Promise.all([esm, cjs]);\n\n  await generateTestingPackageJson(config);\n\n  console.log('🦁', submodule);\n}\n\nasync function generateTestingPackageJson(config: BuildConfig) {\n  const pkg: PackageJSON = {\n    name: '@builder.io/qwik/testing',\n    version: config.distVersion,\n    main: 'index.mjs',\n    types: 'index.d.ts',\n    private: true,\n    type: 'module',\n    sideEffects: true,\n  };\n  const testingDistDir = join(config.distQwikPkgDir, 'testing');\n  await writePackageJson(testingDistDir, pkg);\n}\n"
  },
  {
    "path": "scripts/supabase-auth-helpers.ts",
    "content": "import { type BuildConfig, copyDir, panic } from './util.ts';\nimport { join } from 'node:path';\nimport { execa } from 'execa';\n\nconst PACKAGE = 'supabase-auth-helpers-qwik';\n\nexport async function buildSupabaseAuthHelpers(config: BuildConfig) {\n  const input = join(config.packagesDir, PACKAGE);\n\n  const result = await execa('pnpm', ['build'], {\n    stdout: 'inherit',\n    cwd: input,\n  });\n\n  if (result.failed) {\n    panic(`tsc failed`);\n  }\n  await copyDir(\n    config,\n    join(config.dtsDir, 'packages', PACKAGE, 'src'),\n    join(input, 'lib', 'types')\n  );\n  console.log(`⚛️  ${PACKAGE}`);\n}\n"
  },
  {
    "path": "scripts/tools/preinstall-script.js",
    "content": "/** Do NOT allow using `npm` as package manager. */\nif (process.env.npm_execpath.indexOf('pnpm') === -1) {\n  console.error('You must use pnpm to install dependencies:');\n  console.error('  $ pnpm install');\n  process.exit(1);\n}\n"
  },
  {
    "path": "scripts/tsc-docs.ts",
    "content": "import { execa } from 'execa';\nimport { type BuildConfig, panic } from './util.ts';\nimport { join } from 'path';\n\n// Run tsc for docs separately because it requires e.g. qwik-react types to be built first\n// plus it takes some time to run and we don't need to run it during core dev.\nexport async function tscDocs(config: BuildConfig) {\n  const result = await execa('tsc', ['-p', join('packages', 'docs', 'tsconfig.json')], {\n    stdout: 'inherit',\n  });\n  if (result.failed) {\n    panic(`tsc for docs failed`);\n  }\n}\n"
  },
  {
    "path": "scripts/tsc.ts",
    "content": "import { execa } from 'execa';\nimport { type BuildConfig, panic } from './util.ts';\nimport { join } from 'path';\n\n// TODO DRY\nexport async function tscQwik(config: BuildConfig) {\n  console.log('tsc qwik');\n  const result = await execa('tsc', ['-p', join(config.srcQwikDir, '..', 'tsconfig.json')], {\n    stdout: 'inherit',\n  });\n  if (result.failed) {\n    panic(`tsc for qwik failed`);\n  }\n}\n\nexport async function tscQwikCity(config: BuildConfig) {\n  console.log('tsc qwik-city');\n  const result = await execa('tsc', ['-p', join(config.srcQwikCityDir, '..', 'tsconfig.json')], {\n    stdout: 'inherit',\n  });\n  if (result.failed) {\n    panic(`tsc for qwik failed`);\n  }\n}\n\nexport async function tsc(config: BuildConfig) {\n  console.log('tsc');\n  const result = await execa('tsc', {\n    stdout: 'inherit',\n  });\n  if (result.failed) {\n    panic(`tsc failed`);\n  }\n}\n"
  },
  {
    "path": "scripts/types.d.ts",
    "content": "/**\n * Type definitions for scripts utilities This file allows package code to import types without\n * importing the implementation\n */\n\nexport interface PackageJSON {\n  name?: string;\n  version?: string;\n  description?: string;\n  license?: string;\n  main?: string;\n  module?: string;\n  types?: string;\n  type?: 'module' | 'commonjs';\n  exports?: Record<string, any>;\n  scripts?: Record<string, string>;\n  dependencies?: Record<string, string>;\n  devDependencies?: Record<string, string>;\n  peerDependencies?: Record<string, string>;\n  optionalDependencies?: Record<string, string>;\n  [key: string]: any;\n}\n\nexport interface BuildConfig {\n  rootDir: string;\n  srcDir: string;\n  srcQwikDir: string;\n  srcQwikCityDir: string;\n  packagesDir: string;\n  distQwikPkgDir: string;\n  distQwikCityPkgDir: string;\n  dtsDir: string;\n  [key: string]: any;\n}\n"
  },
  {
    "path": "scripts/update-qwik-builds.ts",
    "content": "import { readPackageJson, writePackageJson } from './package-json.ts';\n\ntype Repos = 'qwik' | 'qwik-city' | 'qwik-labs';\n\nasync function main(packageDir: string) {\n  if (!packageDir) {\n    throw new Error('packageDir is required');\n  }\n  console.log('Updating:', packageDir);\n  const packageJson = await readPackageJson(packageDir);\n  await updateDependency(packageJson.devDependencies!, 'qwik');\n  await updateDependency(packageJson.devDependencies!, 'qwik-city');\n  await updateDependency(packageJson.devDependencies!, 'qwik-labs');\n  writePackageJson(packageDir, packageJson);\n}\n\nasync function updateDependency(deps: Record<string, string>, repo: Repos) {\n  const key = '@builder.io/' + repo;\n  const value = deps[key];\n  const prefix = `github:QwikDev/${repo}-build#`;\n  if (value && value.startsWith(prefix)) {\n    const latestSHA = await getLatestSHA(repo);\n    console.log('  ', value, '->', latestSHA);\n    deps[key] = prefix + latestSHA;\n  }\n}\n\nasync function getLatestSHA(repo: Repos): Promise<string> {\n  const response = await fetch(\n    `https://api.github.com/repos/QwikDev/${repo}-build/commits/main?per_page=1`\n  );\n  const json = await response.json();\n  if (typeof json.sha !== 'string' && json.sha.length == 0) {\n    throw new Error(\n      'Failed to fetch latest SHA for ' + repo + '\\n' + JSON.stringify(json, null, 2)\n    );\n  }\n  return json.sha as string;\n}\n\nconst path = process.argv[2];\nmain(path);\n"
  },
  {
    "path": "scripts/util.ts",
    "content": "import type { Plugin } from 'esbuild';\nimport { execa, type Options } from 'execa';\nimport mri from 'mri';\nimport {\n  access as fsAccess,\n  copyFile as fsCopyFile,\n  mkdir as fsMkdir,\n  readdir as fsReaddir,\n  readFile as fsReadFile,\n  stat as fsStat,\n  unlink as fsUnlink,\n  writeFile as fsWriteFile,\n  mkdirSync,\n  rmSync,\n} from 'node:fs';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { Plugin as RollupPlugin } from 'rollup';\nimport { minify, type MinifyOptions } from 'terser';\nimport { promisify } from 'util';\nimport { readPackageJson } from './package-json.ts';\n\nconst stringOptions = [\n  'distBindingsDir',\n  'distQwikCityPkgDir',\n  'distQwikPkgDir',\n  'distVersion',\n  'dtsDir',\n  'packagesDir',\n  'platformTarget',\n  'rootDir',\n  'scriptsDir',\n  'setDistTag',\n  'srcNapiDir',\n  'srcQwikCityDir',\n  'srcQwikDir',\n  'srcQwikLabsDir',\n  'startersDir',\n  'tmpDir',\n  'tscDir',\n] as const;\nconst booleanOptions = [\n  'api',\n  'cli',\n  'commit',\n  'dev',\n  'devRelease',\n  'dryRun',\n  'eslint',\n  'esmNode',\n  'platformBinding',\n  'platformBindingWasmCopy',\n  'prepareRelease',\n  'qwik',\n  'qwikauth',\n  'qwikcity',\n  'qwiklabs',\n  'qwikreact',\n  'qwikworker',\n  'release',\n  'supabaseauthhelpers',\n  'tsc',\n  'tscDocs',\n  'validate',\n  'wasm',\n  'watch',\n] as const;\n\n/**\n * Contains information about the build we're generating by parsing CLI args, and figuring out all\n * the absolute file paths the build will be reading from and writing to.\n */\nexport type BuildConfig = { [key in (typeof stringOptions)[number]]: string } & {\n  [key in (typeof booleanOptions)[number]]?: boolean;\n};\n\nconst kebab = (str: string) => str.replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`);\n\n/**\n * Create the `BuildConfig` from the process args, and set the absolute paths the build will be\n * reading from and writing to.\n */\nexport function loadConfig(args: string[] = []) {\n  const __dirname = fileURLToPath(new URL('.', import.meta.url));\n  const rootDir = join(__dirname, '..');\n  const packagesDir = join(rootDir, 'packages');\n  const srcQwikDir = join(packagesDir, 'qwik', 'src');\n  const distQwikPkgDir = join(packagesDir, 'qwik', 'dist');\n  const tmpDir = join(rootDir, 'dist-dev');\n  const knownOptions = [...stringOptions, ...booleanOptions] as const;\n  const kebabOptions = knownOptions.map(kebab);\n  // Add _ to known options\n  kebabOptions.push('_');\n  const alias = Object.fromEntries(knownOptions.map((k, i) => [kebabOptions[i], k]));\n  // rename qwik to build\n  (alias as any).build = 'qwik';\n  kebabOptions.push('build');\n  const config = mri<BuildConfig>(args, {\n    boolean: [...booleanOptions],\n    string: [...stringOptions],\n    alias,\n    default: {\n      rootDir,\n      packagesDir,\n      srcQwikDir,\n      tmpDir,\n      srcQwikCityDir: join(packagesDir, 'qwik-city', 'src'),\n      srcQwikLabsDir: join(packagesDir, 'qwik-labs'),\n      srcNapiDir: join(srcQwikDir, 'napi'),\n      scriptsDir: join(rootDir, 'scripts'),\n      startersDir: join(rootDir, 'starters'),\n      distQwikPkgDir,\n      distQwikCityPkgDir: join(packagesDir, 'qwik-city', 'lib'),\n      distBindingsDir: join(packagesDir, 'qwik', 'bindings'),\n      tscDir: join(tmpDir, 'tsc-out'),\n      dtsDir: join(tmpDir, 'dts-out'),\n      esmNode: parseInt(process.version.slice(1).split('.')[0], 10) >= 14,\n    } as BuildConfig,\n  });\n  const parseError =\n    config._.length > 0\n      ? `!!! Extra non-args: ${config._.join(' ')}\\n\\n`\n      : process.argv.length === 2\n        ? `No args provided. `\n        : Object.keys(config).some((k) => !kebabOptions.includes(kebab(k)))\n          ? `!!! Unknown args: ${Object.keys(config)\n              .filter((k) => !kebabOptions.includes(kebab(k)))\n              .join(' ')}\\n\\n`\n          : undefined;\n  if (parseError) {\n    console.error(\n      `\\n${parseError}Known args:\\n${booleanOptions\n        .map((k) => `  --${kebab(k)}\\n`)\n        .join('')}${stringOptions\n        .map((k) => `  --${kebab(k)} <string>\\n`)\n        .join('')}\\n=== Use pnpm build.local for initial build. ===\\n\\n`\n    );\n    process.exit(1);\n  }\n\n  return config;\n}\n\nexport function terser(opts: MinifyOptions): RollupPlugin {\n  return {\n    name: 'terser',\n    async generateBundle(_, bundle) {\n      for (const fileName in bundle) {\n        const chunk = bundle[fileName];\n        if (chunk.type === 'chunk') {\n          const result = await minify(chunk.code, opts);\n          chunk.code = result.code!;\n        }\n      }\n    },\n  };\n}\n\n/** Esbuild plugin to change an import path, but keep it an external path. */\nexport function importPath(filter: RegExp, newModulePath: string) {\n  const plugin: Plugin = {\n    name: 'importPathPlugin',\n    setup(build) {\n      build.onResolve({ filter }, () => ({\n        path: newModulePath,\n        external: true,\n      }));\n    },\n  };\n  return plugin;\n}\n\n/** Standard license banner to place at the top of the generated files. */\nexport const getBanner = (moduleName: string, version: string) => {\n  return `\n/**\n * @license\n * ${moduleName} ${version}\n * Copyright Builder.io, Inc. All Rights Reserved.\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE\n */\n`.trim();\n};\n\n/**\n * The JavaScript target we're going for. Reusing a constant just to make sure all the builds are\n * using the same target.\n */\nexport const target = 'es2020';\n\nexport const nodeTarget = 'node16';\n\n/** Helper just to know which Node.js modules that should stay external. */\nexport const nodeBuiltIns = [\n  'assert',\n  'async_hooks',\n  'child_process',\n  'crypto',\n  'fs',\n  'module',\n  'net',\n  'os',\n  'path',\n  'tty',\n  'url',\n  'util',\n];\n\n/** Utility just to ignore certain rollup warns we already know aren't issues. */\nexport function rollupOnWarn(warning: any, warn: any) {\n  // skip certain warnings\n  if (warning.code === `CIRCULAR_DEPENDENCY`) return;\n  if (warning.code === `PREFER_NAMED_EXPORTS`) return;\n  if (warning.message.includes(`Rollup 'sourcemap'`)) return;\n  console.log(warning);\n  warn(warning);\n}\n\n/** Helper just to get and format a file's size for logging. */\nexport async function fileSize(filePath: string) {\n  const text = await readFile(filePath);\n  const { default: compress } = await import('brotli/compress.js');\n\n  const data = compress(text, {\n    mode: 1,\n    quality: 11,\n  });\n  return {\n    original: formatFileSize(text.length),\n    brotli: formatFileSize(data.byteLength),\n  };\n}\n\nfunction formatFileSize(bytes: number) {\n  if (bytes === 0) return '0b';\n  const k = 1024;\n  const dm = bytes < k ? 0 : 1;\n  const sizes = ['b', 'kb'];\n  const i = Math.floor(Math.log(bytes) / Math.log(k));\n  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + '' + sizes[i];\n}\n\nexport const access = /*#__PURE__*/ promisify(fsAccess);\nexport const copyFile = /*#__PURE__*/ promisify(fsCopyFile);\nexport const readFile = /*#__PURE__*/ promisify(fsReadFile);\nexport const readdir = /*#__PURE__*/ promisify(fsReaddir);\nexport const unlink = /*#__PURE__*/ promisify(fsUnlink);\nexport const stat = /*#__PURE__*/ promisify(fsStat);\nexport const writeFile = /*#__PURE__*/ promisify(fsWriteFile);\nexport const mkdir = /*#__PURE__*/ promisify(fsMkdir);\n\nexport function emptyDir(dir: string) {\n  try {\n    rmSync(dir, { recursive: true });\n  } catch (e) {}\n  ensureDir(dir);\n}\n\nexport function ensureDir(dir: string) {\n  try {\n    mkdirSync(dir, { recursive: true });\n  } catch (e) {}\n}\n\nexport async function run(\n  cmd: string,\n  args: string[],\n  skipExecution?: boolean,\n  dryRunCliFlag?: boolean,\n  opts?: Options\n) {\n  if (dryRunCliFlag) {\n    args = [...args, '--dry-run'];\n  }\n  const bash = `   ${cmd} ${args.join(' ')}`;\n  console.log(bash, opts ? JSON.stringify(opts) : '');\n  if (!skipExecution) {\n    const result = await execa(cmd, args, opts);\n    if (result.failed) {\n      panic(`Finished with error: ${bash}`);\n    }\n  }\n}\n\nexport function panic(msg: string | Error) {\n  const err = typeof msg === 'string' ? new Error(msg) : msg;\n  console.error(`\\n❌ `, err);\n  process.exit(1);\n}\n\n/** Interface for package.json */\nexport interface PackageJSON {\n  name: string;\n  version: string;\n  dependencies?: { [pkgName: string]: string };\n  devDependencies?: { [pkgName: string]: string };\n  description?: string;\n  scripts?: { [scriptName: string]: string };\n  license?: string;\n  main: string;\n  module?: string;\n  types: string;\n  type?: string;\n  files?: string[];\n  exports?: { [key: string]: any };\n  contributors?: { [key: string]: string }[];\n  homepage?: string;\n  repository?: { [key: string]: string };\n  bugs?: { [key: string]: string };\n  keywords?: string[];\n  engines?: { [key: string]: string };\n  private?: boolean;\n  [key: string]: any;\n}\n\nexport async function copyDir(config: BuildConfig, srcDir: string, destDir: string) {\n  await mkdir(destDir);\n  const items = await readdir(srcDir);\n  await Promise.all(\n    items.map(async (itemName) => {\n      if (!IGNORE[itemName] && !itemName.includes('.test')) {\n        const srcPath = join(srcDir, itemName);\n        const destPath = join(destDir, itemName);\n        const itemStat = await stat(srcPath);\n        if (itemStat.isDirectory()) {\n          await copyDir(config, srcPath, destPath);\n        } else if (itemStat.isFile()) {\n          await copyFile(srcPath, destPath);\n        }\n      }\n    })\n  );\n}\n\nconst IGNORE: { [path: string]: boolean } = {\n  '.rollup.cache': true,\n  build: true,\n  server: true,\n  e2e: true,\n  node_modules: true,\n  'package-lock.json': true,\n  'starter.tsconfig.json': true,\n  'tsconfig.tsbuildinfo': true,\n  'yarn.lock': true,\n  'pnpm-lock.yaml': true,\n};\n\nexport const recursiveChangePrefix = <T>(obj: T, prefix: string, replace: string): T => {\n  if (typeof obj === 'string') {\n    return (obj.startsWith(prefix) ? replace + obj.slice(prefix.length) : obj) as T;\n  }\n  if (Array.isArray(obj)) {\n    return obj.map((v) => recursiveChangePrefix(v, prefix, replace)) as T;\n  }\n  if (obj && typeof obj === 'object') {\n    return Object.fromEntries(\n      Object.entries(obj).map(([k, v]) => [k, recursiveChangePrefix(v, prefix, replace)])\n    ) as T;\n  }\n  return obj;\n};\n\nexport async function getQwikVersion(config: BuildConfig) {\n  const qwikDir = join(config.packagesDir, 'qwik');\n  const qwikPkgJson = await readPackageJson(qwikDir);\n  return qwikPkgJson.version;\n}\n\n// pascal to snake case\nexport const toSnakeCase = (str: string) =>\n  str\n    .split(/\\.?(?=[A-Z])/)\n    .join('-')\n    .toLowerCase();\n"
  },
  {
    "path": "scripts/validate-build.ts",
    "content": "import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { type BuildConfig, type PackageJSON, panic } from './util.ts';\nimport { access, readFile } from './util.ts';\nimport { basename, extname, join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { rollup } from 'rollup';\nimport ts from 'typescript';\n\n/**\n * This will validate a completed production build by triple checking all the files have been\n * created and can execute correctly in their context. This is the last task before publishing the\n * build files to npm.\n */\nexport async function validateBuild(config: BuildConfig) {\n  console.log('🕵️ validating build...');\n  const pkgPath = join(config.distQwikPkgDir, 'package.json');\n  const pkg: PackageJSON = JSON.parse(await readFile(pkgPath, 'utf-8'));\n  const errors: string[] = [];\n  const require = createRequire(import.meta.url);\n\n  // triple checks these package files all exist and parse\n  const pkgFiles = [...pkg.files!, 'LICENSE', 'README.md', 'package.json'];\n  const expectedFiles = pkgFiles.map((f) => join(config.distQwikPkgDir, f));\n\n  const dependencies = ['csstype', 'vite'];\n  const pkgDependencies = Object.keys(pkg.dependencies!);\n  if (pkgDependencies.length !== dependencies.length) {\n    errors.push(\n      `Expected ${dependencies.length} dependencies, but found ${pkgDependencies.length}.`\n    );\n  } else {\n    for (const dep of dependencies) {\n      if (!pkgDependencies.includes(dep)) {\n        errors.push(`Expected ${dep} to be a dependency.`);\n      }\n    }\n  }\n\n  for (const filePath of expectedFiles) {\n    try {\n      // loop through each file and ensure it's built correct\n      const ext = extname(filePath);\n\n      switch (ext) {\n        case '.cjs':\n          const f = basename(filePath);\n          if (f !== 'qwik.cjs') {\n            require(filePath);\n            console.log(`✅ ${filePath}`);\n          }\n          break;\n        case '.mjs':\n          if (config.esmNode) {\n            await import(pathToFileURL(filePath).href);\n            console.log(`✅ ${filePath}`);\n            break;\n          }\n        case '.ts':\n          validateTypeScriptFile(config, filePath);\n          console.log(`✅ ${filePath}`);\n          break;\n        case '.json':\n          JSON.parse(readFileSync(filePath, 'utf-8'));\n          console.log(`✅ ${filePath}`);\n          break;\n        case '.map':\n          JSON.parse(readFileSync(filePath, 'utf-8'));\n          console.log(`✅ ${filePath}`);\n          break;\n        default:\n          if (existsSync(filePath)) {\n            const s = statSync(filePath);\n            if (s.isFile()) {\n              const content = readFileSync(filePath, 'utf-8');\n              if (content.trim() === '') {\n                errors.push(`Expected package.json file is empty: ${filePath}`);\n              } else {\n                console.log(`✅ ${filePath}`);\n              }\n            } else {\n              console.log(`✅ ${filePath}`);\n            }\n          } else {\n            if (process.env.CI || (!process.env.CI && ext !== '.node')) {\n              errors.push(`Expected package.json file not found: ${filePath}`);\n            } else {\n              console.log(`✅ ${filePath}`);\n            }\n          }\n      }\n    } catch (e: any) {\n      errors.push(`${filePath}: ${String(e.stack || e)}`);\n    }\n  }\n\n  await validatePackageJson(config, pkg, errors);\n  await Promise.all([\n    validateModuleTreeshake(config, join(config.distQwikPkgDir, 'core.min.mjs')),\n    validateModuleTreeshake(config, join(config.distQwikPkgDir, 'core.prod.mjs')),\n    validateModuleTreeshake(config, join(config.distQwikPkgDir, 'core.mjs')),\n    validateModuleTreeshake(config, join(config.distQwikPkgDir, 'server.mjs')),\n  ]);\n  if (config.qwikcity) {\n    await validateModuleTreeshake(\n      config,\n      join(config.packagesDir, 'qwik-city', 'lib', 'index.qwik.mjs'),\n      ['@qwik-city-plan', '@qwik-city-sw-register', 'zod', '@builder.io/qwik/jsx-runtime']\n    );\n  }\n\n  const allFiles: string[] = [];\n  function getFiles(dir: string) {\n    readdirSync(dir)\n      .map((f) => join(dir, f))\n      .forEach((filePath) => {\n        const s = statSync(filePath);\n        if (s.isDirectory()) {\n          const dirName = basename(filePath);\n          if (dirName !== 'starters' && dirName !== 'templates') {\n            getFiles(filePath);\n          }\n        } else if (s.isFile()) {\n          allFiles.push(filePath);\n        } else {\n          errors.push(`Unexpected: ${filePath}`);\n        }\n      });\n  }\n  getFiles(config.distQwikPkgDir);\n  const unexpectedFiles = allFiles.filter((f) => !expectedFiles.includes(f));\n\n  if (unexpectedFiles.length > 0) {\n    errors.push(\n      `Unexpected files found in the package build:\\n${unexpectedFiles.join(\n        '\\n'\n      )}\\n\\nIf this file is expected, add the file(s) to the package.json \"files\" array`\n    );\n  }\n\n  if (errors.length > 0) {\n    errors.unshift(`Build did not pass validation.`);\n    panic(errors.join('\\n\\n❌ '));\n  } else {\n    console.log('🏅 validated build');\n  }\n}\n\n/**\n * Do a full typescript build for each separate .d.ts file found in the package just to ensure it's\n * well formed and relative import paths are correct.\n */\nexport function validateTypeScriptFile(config: BuildConfig, tsFilePath: string) {\n  const tsconfigPath = join(config.rootDir, 'tsconfig.json');\n  const tsconfigResults = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n  const tsconfig = ts.parseJsonConfigFileContent(\n    tsconfigResults.config,\n    ts.sys,\n    config.rootDir,\n    undefined,\n    tsconfigPath\n  );\n  const program = ts.createProgram([tsFilePath], tsconfig.options);\n\n  const tsDiagnostics = [\n    ...program.getSemanticDiagnostics(),\n    ...program.getSyntacticDiagnostics(),\n    ...program.getDeclarationDiagnostics(),\n    ...program.getGlobalDiagnostics(),\n    ...program.getConfigFileParsingDiagnostics(),\n    ...program.getOptionsDiagnostics(),\n  ];\n\n  if (tsDiagnostics.length > 0) {\n    const host = {\n      getCurrentDirectory: () => ts.sys.getCurrentDirectory(),\n      getNewLine: () => ts.sys.newLine,\n      getCanonicalFileName: (f: string) => f,\n    };\n    throw new Error(ts.formatDiagnostics(tsDiagnostics, host));\n  }\n}\n\nasync function validatePackageJson(config: BuildConfig, pkg: PackageJSON, errors: string[]) {\n  async function validatePath(path: string) {\n    try {\n      await access(join(config.distQwikPkgDir, path));\n    } catch (e: any) {\n      errors.push(\n        `Error loading file \"${path}\" referenced in package.json: ${String(\n          e ? e.stack || e : 'Error'\n        )}`\n      );\n    }\n  }\n\n  await Promise.all([validatePath(pkg.main), validatePath(pkg.types)]);\n\n  async function validateExports(exports: Record<string, any>) {\n    const exportKeys = Object.keys(exports);\n\n    await Promise.all(\n      exportKeys.map(async (exportKey) => {\n        const val = exports[exportKey];\n        if (typeof val === 'string') {\n          await validatePath(val);\n        } else {\n          await validateExports(val);\n        }\n      })\n    );\n  }\n\n  validateExports(pkg.exports!);\n}\n\nasync function validateModuleTreeshake(\n  config: BuildConfig,\n  entryModulePath: string,\n  external: string[] = []\n): Promise<void> {\n  const virtualInputId = `@index`;\n  const bundle = await rollup({\n    input: virtualInputId,\n    treeshake: {\n      moduleSideEffects: 'no-external',\n    },\n    external: ['@builder.io/qwik/build', '@builder.io/qwik', ...external],\n    plugins: [\n      {\n        name: 'resolver',\n        resolveId(id) {\n          if (id === virtualInputId) {\n            return id;\n          }\n        },\n        load(id) {\n          if (id === virtualInputId) {\n            return `import \"${entryModulePath}\";`;\n          }\n        },\n      },\n    ],\n    onwarn(warning) {\n      if (warning.code !== 'EMPTY_BUNDLE') {\n        throw warning;\n      }\n    },\n  });\n\n  const o = await bundle.generate({\n    format: 'es',\n  });\n\n  const output = o.output[0];\n  const outputCode = output.code.trim();\n\n  if (outputCode !== '') {\n    console.log(outputCode);\n    throw new Error(`🧨  Unable to treeshake for ${entryModulePath}`);\n  }\n\n  console.log(`🌳  validated treeshake for ${entryModulePath}`);\n}\n"
  },
  {
    "path": "scripts/validate-cli.ts",
    "content": "import {\n  accessSync,\n  copyFileSync,\n  existsSync,\n  mkdirSync,\n  readFileSync,\n  readdirSync,\n  rmSync,\n  statSync,\n  writeFileSync,\n} from 'node:fs';\nimport { join, relative } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport { readPackageJson, writePackageJson } from './package-json.ts';\n\nimport assert from 'assert';\nimport { panic } from './util.ts';\n\nconst __dirname = fileURLToPath(new URL('.', import.meta.url));\n\nasync function validateCreateQwikCli() {\n  console.log(`👾 validating create-qwik...`);\n\n  const cliDir = join(__dirname, '..', 'packages', 'create-qwik');\n  accessSync(cliDir);\n\n  const cliBin = join(cliDir, 'create-qwik.cjs');\n  accessSync(cliBin);\n\n  const cliPkgJsonPath = join(cliDir, 'package.json');\n  const cliPkgJson = JSON.parse(readFileSync(cliPkgJsonPath, 'utf-8'));\n  assert.strictEqual(cliPkgJson.name, 'create-qwik');\n  const qwikVersion = cliPkgJson.version;\n\n  const startersDir = join(cliDir, 'dist', 'starters');\n  accessSync(startersDir);\n\n  const appsDir = join(startersDir, 'apps');\n  accessSync(appsDir);\n\n  const cliApi = join(cliDir, 'dist', 'index.cjs');\n  console.log(`💫 import cli api: ${cliApi}`);\n  const api: typeof import('create-qwik') = await import(pathToFileURL(cliApi).href);\n\n  const tmpDir = join(__dirname, '..', 'dist-dev');\n\n  await Promise.all([\n    validateStarter(api, tmpDir, 'playground', true, `👻`, qwikVersion),\n    validateStarter(api, tmpDir, 'empty', true, `🫙`, qwikVersion),\n    validateStarter(api, tmpDir, 'library', false, `📚`, qwikVersion),\n  ]).catch((e) => {\n    console.error(e);\n    panic(String(e));\n  });\n\n  console.log(`👽 create-qwik validated\\n`);\n}\n\nasync function validateStarter(\n  api: typeof import('create-qwik'),\n  distDir: string,\n  starterId: string,\n  app: boolean,\n  emoji: string,\n  qwikVersion: string\n) {\n  const appDir = join(distDir, 'e2e-' + starterId);\n\n  console.log(`${emoji} ${appDir}`);\n  rmSync(appDir, { force: true, recursive: true });\n\n  const result = await api.createApp({\n    starterId,\n    outDir: appDir,\n  });\n\n  assert.strictEqual(result.starterId, starterId);\n  assert.strictEqual(result.outDir, appDir);\n\n  accessSync(result.outDir);\n\n  const appPkgJsonPath = join(result.outDir, 'package.json');\n  const appPkgJson = JSON.parse(readFileSync(appPkgJsonPath, 'utf-8'));\n\n  assertRightQwikDepsVersions(appPkgJson, qwikVersion, starterId);\n\n  // Ensure that npm will use an existing version\n  appPkgJson.devDependencies['@builder.io/qwik'] = 'latest';\n  appPkgJson.devDependencies['@builder.io/qwik-city'] = 'latest';\n  appPkgJson.devDependencies['eslint-plugin-qwik'] = 'latest';\n  appPkgJson.devDependencies['eslint'] = 'latest';\n  writeFileSync(appPkgJsonPath, JSON.stringify(appPkgJson, null, 2));\n\n  const tsconfigPath = join(result.outDir, 'tsconfig.json');\n  accessSync(tsconfigPath);\n\n  const { execa } = await import('execa');\n  console.log(`${emoji} ${starterId}: npm install`);\n  await execa('npm', ['install'], { cwd: appDir, stdout: 'inherit' });\n\n  // console.log(`${emoji} ${projectName}: copy @builder.io/qwik distribution`);\n  // const qwikNodeModule = join(appDir, 'node_modules', '@builder.io', 'qwik');\n  // rmSync(qwikNodeModule, { force: true, recursive: true });\n  // const distQwik = join(__dirname, '..', 'packages', 'qwik', 'dist');\n  // cpSync(distQwik, qwikNodeModule);\n\n  // console.log(`${emoji} ${projectName}: copy eslint-plugin-qwik distribution`);\n  // const eslintNodeModule = join(appDir, 'node_modules', 'eslint-plugin-qwik');\n  // rmSync(eslintNodeModule, { force: true, recursive: true });\n  // const distEslintQwik = join(__dirname, '..', 'packages', 'eslint-plugin-qwik', 'dist');\n  // cpSync(distEslintQwik, eslintNodeModule);\n\n  // console.log(`${emoji} ${projectName}: copy @types`);\n  // const typesNodeModule = join(appDir, 'node_modules', '@types');\n  // const distTypesQwik = join(__dirname, '..', 'node_modules', '@types');\n  // cpSync(distTypesQwik, typesNodeModule);\n\n  // console.log(`${emoji} ${projectName}: npm run build`);\n  // if (app) {\n  //   await execa('node', ['./node_modules/@builder.io/qwik/qwik.cjs', 'build'], {\n  //     cwd: appDir,\n  //     stdout: 'inherit',\n  //   });\n  // } else {\n  //   await execa('npm', ['run', 'build'], {\n  //     cwd: appDir,\n  //     stdout: 'inherit',\n  //   });\n  // }\n\n  // accessSync(join(appDir, '.vscode'));\n\n  // if (app) {\n  //   // app\n  //   accessSync(join(appDir, 'dist', 'favicon.ico'));\n  //   accessSync(join(appDir, 'dist', 'q-manifest.json'));\n  //   accessSync(join(appDir, 'dist', 'build'));\n  // } else {\n  //   // library\n  //   accessSync(join(appDir, 'lib', 'types'));\n  //   accessSync(join(appDir, 'lib', 'index.qwik.mjs'));\n  //   accessSync(join(appDir, 'lib', 'index.qwik.cjs'));\n  // }\n  // accessSync(join(appDir, 'README.md'));\n  // accessSync(join(appDir, 'tsconfig.json'));\n  // accessSync(join(appDir, 'tsconfig.tsbuildinfo'));\n\n  console.log(`${emoji} ${starterId} validated\\n`);\n}\n\nfunction assertRightQwikDepsVersions(appPkgJson: any, qwikVersion: string, starterType: string) {\n  assert.strictEqual(\n    appPkgJson.devDependencies['@builder.io/qwik'].includes(qwikVersion),\n    true,\n    `Qwik version mismatch for \"${starterType}\" starter`\n  );\n  if (appPkgJson.devDependencies.hasOwnProperty('@builder.io/qwik-city')) {\n    assert.strictEqual(\n      appPkgJson.devDependencies['@builder.io/qwik-city'].includes(qwikVersion),\n      true,\n      `Qwik City version mismatch for \"${starterType}\" starter`\n    );\n  }\n  if (appPkgJson.devDependencies.hasOwnProperty('eslint-plugin-qwik')) {\n    assert.strictEqual(\n      appPkgJson.devDependencies['eslint-plugin-qwik'].includes(qwikVersion),\n      true,\n      `ESlint plugin version mismatch for \"${starterType}\" starter`\n    );\n  }\n}\n\nfunction cpSync(src: string, dest: string) {\n  // cpSync() not available until Node v16.7.0\n  try {\n    const stats = statSync(src);\n    if (stats.isDirectory()) {\n      mkdirSync(dest, { recursive: true });\n      readdirSync(src).forEach((childItem) => {\n        const childSrc = join(src, childItem);\n        const childDest = join(dest, childItem);\n        cpSync(childSrc, childDest);\n      });\n    } else {\n      copyFileSync(src, dest);\n    }\n  } catch (e) {}\n}\n\nasync function copyLocalQwikDistToTestApp(appDir: string) {\n  const srcQwikDir = join(__dirname, '..', 'packages', 'qwik');\n  const destQwikDir = join(appDir, 'node_modules', '@builder.io', 'qwik');\n  const srcQwikCityDir = join(__dirname, '..', 'packages', 'qwik-city');\n  const destQwikCityDir = join(appDir, 'node_modules', '@builder.io', 'qwik-city');\n  const destQwikBin = relative(appDir, join(destQwikDir, 'qwik.cjs'));\n\n  if (existsSync(appDir) && existsSync(srcQwikDir) && existsSync(srcQwikCityDir)) {\n    console.log('\\nqwik-app local development updates:');\n\n    rmSync(destQwikDir, { recursive: true, force: true });\n    cpSync(srcQwikDir, destQwikDir);\n    console.log(\n      ` - Copied \"${relative(process.cwd(), srcQwikDir)}\" to \"${relative(\n        process.cwd(),\n        destQwikDir\n      )}\"`\n    );\n\n    rmSync(destQwikCityDir, { recursive: true, force: true });\n    cpSync(srcQwikCityDir, destQwikCityDir);\n    console.log(\n      ` - Copied \"${relative(process.cwd(), srcQwikCityDir)}\" to \"${relative(\n        process.cwd(),\n        destQwikCityDir\n      )}\"`\n    );\n\n    const appPackageJson = await readPackageJson(appDir);\n    appPackageJson.scripts!.qwik = `node ./${destQwikBin}`;\n    await writePackageJson(appDir, appPackageJson);\n    console.log(\n      ` - Updated ${relative(process.cwd(), appDir)} package.json qwik script to \"${\n        appPackageJson.scripts!.qwik\n      }\"`\n    );\n\n    console.log('');\n  }\n}\n\n(async () => {\n  try {\n    if (process.argv.includes('--copy-local-qwik-dist')) {\n      const appDir = join(__dirname, '..', 'qwik-app');\n      await copyLocalQwikDistToTestApp(appDir);\n    } else {\n      await validateCreateQwikCli();\n    }\n  } catch (e) {\n    console.error('❌', e);\n    process.exit(1);\n  }\n})();\n"
  },
  {
    "path": "starters/.gitignore",
    "content": "package-lock.json\nyarn.lock\npnpm-lock.yaml\nvideos/\nbuild\ndist\n.history\n.lh"
  },
  {
    "path": "starters/.prettierrc.json",
    "content": "{}\n"
  },
  {
    "path": "starters/README.md",
    "content": "# Starters\n\nThis folder stores \"starter\" projects for the cli. The idea is that during the cli execution, the developer can choose a particular starter app and combine it with a specific server and features.\n\nAll starters are based on `starters/apps/base`, including the `package.json` and `tsconfig.json`. Depending on the options the user selects, their starter merges into the `base` app.\n\n## Developer\n\nHere are steps to try out the cli in a local environment.\n\n1. Build the cli:\n\n```zsh\npnpm build.cli\n```\n\n2. Run the cli:\n\n```zsh\npnpm cli.qwik\n```\n\n> If you want to test the cli on consumer repository, you can `pnpm link.dist` on the qwik monorepo, then `pnpm link --global @builder.io/qwik` on the consumer project, and finally run the cli from there.\n\n## Publishing `create-qwik` cli Package\n\nThe starter cli is published at the same time as `@builder.io/qwik`. When published, the cli will update the `base` app's package.json to point to the published version of Qwik.\n\nThe base app's package.json's devDependencies are updated with:\n\n```json\n{\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"<QWIK_VERSION_BEING_PUBLISHED>\",\n    \"typescript\": \"<SAME_AS_ROOT_PACKAGE>\",\n    \"vite\": \"<SAME_AS_ROOT_PACKAGE>\"\n  }\n}\n```\n"
  },
  {
    "path": "starters/adapters/aws-lambda/.eslintignore",
    "content": "# AWS-lambda\n.serverless\n"
  },
  {
    "path": "starters/adapters/aws-lambda/.prettierignore",
    "content": "# AWS-lambda\n.serverless\n"
  },
  {
    "path": "starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.ts",
    "content": "import { nodeServerAdapter } from \"@builder.io/qwik-city/adapters/node-server/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\nimport { builtinModules } from \"module\";\nexport default extendConfig(baseConfig, () => {\n  return {\n    ssr: {\n      // This configuration will bundle all dependencies, except the node builtins (path, fs, etc.)\n      external: builtinModules,\n      noExternal: /./,\n    },\n    build: {\n      minify: false,\n      ssr: true,\n      rollupOptions: {\n        input: [\"./src/entry_aws-lambda.tsx\", \"@qwik-city-plan\"],\n      },\n    },\n    plugins: [nodeServerAdapter({ name: \"aws-lambda\" })],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/aws-lambda/gitignore",
    "content": "# AWS-lambda\n.serverless\n"
  },
  {
    "path": "starters/adapters/aws-lambda/package.json",
    "content": "{\n  \"description\": \"AWS Lambda\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/aws-lambda/vite.config.ts\",\n    \"serve\": \"qwik build && serverless offline\",\n    \"deploy\": \"serverless deploy\"\n  },\n  \"devDependencies\": {\n    \"source-map-support\": \"^0.5.21\",\n    \"serverless\": \"^3.38.0\",\n    \"serverless-http\": \"^3.2.0\",\n    \"serverless-offline\": \"^13.3.2\"\n  },\n  \"__qwik__\": {\n    \"priority\": 30,\n    \"displayName\": \"Adapter: AWS Lambda\",\n    \"docs\": [\n      \"https://qwik.dev/qwikcity/adaptors/aws-lambda/\",\n      \"https://aws.amazon.com/es/lambda/\",\n      \"https://www.serverless.com/cloud/docs/get-started\"\n    ]\n  }\n}\n"
  },
  {
    "path": "starters/adapters/aws-lambda/serverless.yml",
    "content": "service: qwik-lambda-app\nframeworkVersion: \"3\"\n\nprovider:\n  name: aws\n  runtime: nodejs18.x\n  region: us-west-1\n  memorySize: 128\n  timeout: 10\n  stage: dev\n\nfunctions:\n  qwik:\n    handler: server/entry_aws-lambda.qwikApp\n    events:\n      - httpApi: \"*\"\n\ncustom:\n  serverless-offline:\n    httpPort: 4000\n  serverless-http:\n    # Make sure serverless-http serves files correctly\n    binary:\n      contentTypes:\n        - \"application/javascript\"\n        - \"text/javascript\"\n        - \"application/json\"\n        - \"text/html\"\n        - \"text/css\"\n        - \"image/*\"\n        - \"font/*\"\n    # the js files under build have hash names and are immutable\n    cacheControl:\n      - pattern: \"build/**/*.js\"\n        value: \"public, max-age=31536000, immutable\"\n\npackage:\n  excludeDevDependencies: true\n  patterns:\n    - \"!*\"\n    - \"!*/**\"\n    - \"server/**\"\n    - \"dist/**\"\n\nplugins:\n  - serverless-offline\n"
  },
  {
    "path": "starters/adapters/aws-lambda/src/entry_aws-lambda.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for Aws Lambda when building for production.\n *\n * Learn more about the Aws Lambda integration here:\n * - https://qwik.dev/docs/deployments/aws/\n *\n */\nimport \"source-map-support/register\";\nimport serverless from \"serverless-http\";\nimport {\n  createQwikCity,\n  type PlatformAwsLambda,\n} from \"@builder.io/qwik-city/middleware/aws-lambda\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformAwsLambda;\n}\n\nexport const { handle } = createQwikCity({ render, qwikCityPlan });\n\nexport const qwikApp = serverless({ handle }, { binary: true });\n// handler is the default export for the lambda functions\nexport const handler = qwikApp;\n"
  },
  {
    "path": "starters/adapters/azure-swa/README.md",
    "content": "## Create your Static Web App on Azure\n\n1. Follow [this](https://learn.microsoft.com/en-us/azure/static-web-apps/overview) guide to create a Static Web App. This guide will also detail how to generate a github action or Azure Pipeline (see \"Quickstarts\" section)\n\n2. If you're using github actions, make sure to add skip_api_build with true value.\n\n```yml\napp_location: \"/\"\napi_location: \"azure-functions\"\noutput_location: \"dist\"\nskip_api_build: true # <--- add this line\n###### End of Repository/Build Configurations ######\n```\n"
  },
  {
    "path": "starters/adapters/azure-swa/adapters/azure-swa/vite.config.ts",
    "content": "import { azureSwaAdapter } from \"@builder.io/qwik-city/adapters/azure-swa/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      outDir: \"azure-functions/render\",\n      rollupOptions: {\n        input: [\"src/entry.azure-swa.tsx\", \"@qwik-city-plan\"],\n        output: {\n          entryFileNames: `[name].[hash].mjs`,\n          chunkFileNames: `[name].[hash].mjs`,\n        },\n      },\n    },\n    ssr: {\n      noExternal: /.*/,\n    },\n    plugins: [azureSwaAdapter()],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/azure-swa/azure-functions/host.json",
    "content": "{\n  \"version\": \"2.0\",\n  \"logging\": {\n    \"applicationInsights\": {\n      \"samplingSettings\": {\n        \"isEnabled\": true,\n        \"excludedTypes\": \"Request\"\n      }\n    }\n  },\n  \"extensions\": {\n    \"http\": {\n      \"routePrefix\": \"api\"\n    }\n  },\n  \"extensionBundle\": {\n    \"id\": \"Microsoft.Azure.Functions.ExtensionBundle\",\n    \"version\": \"[2.*, 3.0.0)\"\n  }\n}\n"
  },
  {
    "path": "starters/adapters/azure-swa/gitignore",
    "content": "# Azure\n/azure-functions/**\n!/azure-functions/host.json\n"
  },
  {
    "path": "starters/adapters/azure-swa/package.json",
    "content": "{\n  \"description\": \"Azure Static Web Apps\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/azure-swa/vite.config.ts\",\n    \"serve\": \"swa start\"\n  },\n  \"devDependencies\": {\n    \"@azure/functions\": \"^3.5.0\",\n    \"@azure/static-web-apps-cli\": \"^1.1.1\"\n  },\n  \"__qwik__\": {\n    \"priority\": 30,\n    \"displayName\": \"Adapter: Azure Static Web Apps\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/azure-swa/\",\n      \"https://learn.microsoft.com/en-us/azure/static-web-apps/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build and deploy to Azure with:\",\n        \"\",\n        \"- pnpm run build: production build for Azure SWA\",\n        \"- pnpm run deploy: it will use the SWA CLI to deploy your site\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/azure-swa/public/staticwebapp.config.json",
    "content": "{\n  \"routes\": [\n    {\n      \"route\": \"*\",\n      \"methods\": [\"POST\", \"PUT\", \"DELETE\"],\n      \"rewrite\": \"/api/render\"\n    },\n    {\n      \"route\": \"/\",\n      \"rewrite\": \"/api/render\"\n    },\n    {\n      \"route\": \"/index.html\",\n      \"rewrite\": \"/api/render\"\n    }\n  ],\n  \"navigationFallback\": {\n    \"rewrite\": \"/api/render\"\n  },\n  \"platform\": {\n    \"apiRuntime\": \"node:18\"\n  },\n  \"responseOverrides\": {\n    \"build/**/*.js\": {\n      \"headers\": {\n        \"Cache-Control\": \"public, max-age=31536000, immutable\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/azure-swa/src/entry.azure-swa.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Azure Static Web Apps middleware when building for production.\n *\n * Learn more about the Azure Static Web Apps integration here:\n * - https://qwik.dev/docs/deployments/azure-swa/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformAzure,\n} from \"@builder.io/qwik-city/middleware/azure-swa\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformAzure;\n}\n\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "starters/adapters/azure-swa/swa-cli.config.json",
    "content": "{\n  \"$schema\": \"https://aka.ms/azure/static-web-apps-cli/schema\",\n  \"configurations\": {\n    \"qwik-app\": {\n      \"appLocation\": \".\",\n      \"apiLocation\": \"./azure-functions\",\n      \"outputLocation\": \"./dist\",\n      \"appBuildCommand\": \"npm run build\"\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/bun/README.md",
    "content": "## Bun Server\n\nThis app has a minimal [Bun server](https://bun.sh/docs/api/http) implementation. After running a full build, you can preview the build using the command:\n\n```\nbun run serve\n```\n\nThen visit [http://localhost:3000/](http://localhost:3000/)\n"
  },
  {
    "path": "starters/adapters/bun/adapters/bun/vite.config.ts",
    "content": "import { bunServerAdapter } from \"@builder.io/qwik-city/adapters/bun-server/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport { _TextEncoderStream_polyfill } from \"@builder.io/qwik-city/middleware/request-handler\";\nimport baseConfig from \"../../vite.config\";\n\n// This polyfill is required when you use SSG and build your app with Bun, because Bun does not have TextEncoderStream. See: https://github.com/oven-sh/bun/issues/5648\nglobalThis.TextEncoderStream ||= _TextEncoderStream_polyfill;\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.bun.ts\", \"@qwik-city-plan\"],\n      },\n      minify: false,\n    },\n    plugins: [\n      bunServerAdapter({\n        ssg: {\n          include: [\"/*\"],\n          origin: \"https://yoursite.dev\",\n          maxWorkers: 1, // Limit Workers to 1, otherwise SSG will hang when compiling Qwik City app with `bun run --bun build`.\n        },\n      }),\n    ],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/bun/package.json",
    "content": "{\n  \"description\": \"Bun server\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/bun/vite.config.ts\",\n    \"serve\": \"bun server/entry.bun.js\"\n  },\n  \"__qwik__\": {\n    \"priority\": 20,\n    \"displayName\": \"Adapter: Bun Server\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/bun/\",\n      \"https://bun.sh/docs/api/http\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build a production-ready Bun app:\",\n        \"\",\n        \"- bun run build: production build\",\n        \"- bun run serve: runs the production server locally\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"@types/bun\": \"*\"\n  }\n}\n"
  },
  {
    "path": "starters/adapters/bun/src/entry.bun.ts",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Bun HTTP server when building for production.\n *\n * Learn more about the Bun integration here:\n * - https://qwik.dev/docs/deployments/bun/\n * - https://bun.sh/docs/api/http\n *\n */\nimport { createQwikCity } from \"@builder.io/qwik-city/middleware/bun\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\n// Create the Qwik City Bun middleware\nconst { router, notFound, staticFile } = createQwikCity({\n  render,\n  qwikCityPlan,\n  static: {\n    cacheControl: \"public, max-age=31536000, immutable\",\n  },\n});\n\n// Allow for dynamic port\nconst port = Number(Bun.env.PORT ?? 3000);\n\n// eslint-disable-next-line no-console\nconsole.log(`Server started: http://localhost:${port}/`);\n\nBun.serve({\n  async fetch(request: Request) {\n    const staticResponse = await staticFile(request);\n    if (staticResponse) {\n      return staticResponse;\n    }\n\n    // Server-side render this request with Qwik City\n    const qwikCityResponse = await router(request);\n    if (qwikCityResponse) {\n      return qwikCityResponse;\n    }\n\n    // Path not found\n    return notFound(request);\n  },\n  port,\n});\n"
  },
  {
    "path": "starters/adapters/cloud-run/Dockerfile",
    "content": "FROM node:18-bullseye-slim AS build-env\n\nCOPY . /app\nWORKDIR /app\n\n# It is recommended that you only install production dependencies with\n# `npm i --omit=dev`. You may need to check which dependencies are missing\nRUN npm i\nRUN npm run build\n\n\n# A light-weight image for running the app\nFROM gcr.io/distroless/nodejs18-debian11\n\nWORKDIR /app\nCOPY --from=build-env /app/node_modules ./node_modules\n\n# After running `npm run build` you will have 2 build folders.\n# - The `dist` folder will be created including all the static files.\n# - The `server` folder will be created including all node server files.\nCOPY --from=build-env /app/server ./server\nCOPY --from=build-env /app/dist ./dist\n\nCMD [\"server/entry.cloud-run.js\"]\n"
  },
  {
    "path": "starters/adapters/cloud-run/README.md",
    "content": "## Google Cloud Run Server\n\nThis app has a minimal [Cloud Run server](https://cloud.google.com/run) implementation. After running a full build, deploy your app with:\n\n```\nnpm run deploy\n```\n"
  },
  {
    "path": "starters/adapters/cloud-run/adapters/cloud-run/vite.config.ts",
    "content": "import { cloudRunAdapter } from \"@builder.io/qwik-city/adapters/cloud-run/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.cloud-run.tsx\", \"@qwik-city-plan\"],\n      },\n    },\n    plugins: [cloudRunAdapter()],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/cloud-run/package.json",
    "content": "{\n  \"description\": \"Google Cloud Run server\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/cloud-run/vite.config.ts\",\n    \"deploy\": \"gcloud run deploy my-cloud-run-app --source .\"\n  },\n  \"__qwik__\": {\n    \"priority\": 20,\n    \"displayName\": \"Adapter: Google Cloud Run server\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/gcp-cloud-run/\",\n      \"https://cloud.google.com/run\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build and deploy to Google Cloud Run with:\",\n        \"\",\n        \"- pnpm run build: production build for Cloud Run\",\n        \"- pnpm run deploy: it will use the gcloud CLI to deploy your site\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/cloud-run/src/entry.cloud-run.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Google Cloud Run middleware when building for production.\n *\n * Learn more about the Cloud Run integration here:\n * - https://qwik.dev/docs/deployments/gcp-cloud-run/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformNode,\n} from \"@builder.io/qwik-city/middleware/node\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport { createServer } from \"node:http\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformNode;\n}\n\n/** The default headers used by helmet */\nconst DEFAULT_HEADERS = {\n  \"Content-Security-Policy\": [\n    `default-src 'self'`,\n    `base-uri 'self'`,\n    `font-src 'self' https: data:`,\n    `form-action 'self'`,\n    `frame-ancestors 'self'`,\n    `img-src 'self' data:`,\n    `object-src 'none'`,\n    `script-src 'self'`,\n    `script-src-attr 'none'`,\n    `style-src 'self' https: 'unsafe-inline'`,\n    `upgrade-insecure-requests`,\n  ].join(\";\"),\n  \"Cross-Origin-Embedder-Policy\": \"require-corp\",\n  \"Cross-Origin-Opener-Policy\": \"same-origin\",\n  \"Cross-Origin-Resource-Policy\": \"same-origin\",\n  \"Origin-Agent-Cluster\": \"?1\",\n  \"Referrer-Policy\": \"no-referrer\",\n  \"Strict-Transport-Security\": \"max-age=15552000; includeSubDomains\",\n  \"X-Content-Type-Options\": \"nosniff\",\n  \"X-DNS-Prefetch-Control\": \"off\",\n  \"X-Download-Options\": \"noopen\",\n  \"X-Frame-Options\": \"SAMEORIGIN\",\n  \"X-Permitted-Cross-Domain-Policies\": \"none\",\n  \"X-XSS-Protection\": \"0\",\n};\n\n// Create the Qwik City router\nconst { router, notFound, staticFile } = createQwikCity({\n  render,\n  qwikCityPlan,\n  static: {\n    cacheControl: \"public, max-age=31536000, immutable\",\n  },\n  getOrigin(req) {\n    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto\n    const protocol = req.headers[\"x-forwarded-proto\"] ?? \"http\";\n    const host = req.headers[\"host\"];\n    return `${protocol}://${host}`;\n  },\n  getClientConn: (conn) => {\n    const xForwardedFor = conn.headers[\"x-forwarded-for\"];\n    if (typeof xForwardedFor === \"string\") {\n      return {\n        ip: xForwardedFor.split(\",\").shift()?.trim(),\n      };\n    } else if (Array.isArray(xForwardedFor)) {\n      return {\n        ip: xForwardedFor.shift()?.trim(),\n      };\n    }\n    return {\n      ip: undefined,\n    };\n  },\n});\n\nconst server = createServer();\n\nserver.on(\"request\", (req, res) => {\n  for (const header of Object.entries(DEFAULT_HEADERS)) {\n    res.setHeader(...header);\n  }\n\n  staticFile(req, res, () => {\n    router(req, res, () => {\n      notFound(req, res, () => {});\n    });\n  });\n});\n\nserver.listen(process.env.PORT ?? 8080);\n"
  },
  {
    "path": "starters/adapters/cloudflare-pages/README.md",
    "content": "## Cloudflare Pages\n\nCloudflare's [wrangler](https://github.com/cloudflare/wrangler) CLI can be used to preview a production build locally. To start a local server, run:\n\n```\nnpm run serve\n```\n\nThen visit [http://localhost:8787/](http://localhost:8787/)\n\n### Deployments\n\n[Cloudflare Pages](https://pages.cloudflare.com/) are deployable through their [Git provider integrations](https://developers.cloudflare.com/pages/platform/git-integration/).\n\nIf you don't already have an account, then [create a Cloudflare account here](https://dash.cloudflare.com/sign-up/pages). Next go to your dashboard and follow the [Cloudflare Pages deployment guide](https://developers.cloudflare.com/pages/framework-guides/deploy-anything/).\n\nWithin the projects \"Settings\" for \"Build and deployments\", the \"Build command\" should be `npm run build`, and the \"Build output directory\" should be set to `dist`.\n\n### Function Invocation Routes\n\nCloudflare Page's [function-invocation-routes config](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes) can be used to include, or exclude, certain paths to be used by the worker functions. Having a `_routes.json` file gives developers more granular control over when your Function is invoked.\nThis is useful to determine if a page response should be Server-Side Rendered (SSR) or if the response should use a static-site generated (SSG) `index.html` file.\n\nBy default, the Cloudflare pages adaptor _does not_ include a `public/_routes.json` config, but rather it is auto-generated from the build by the Cloudflare adaptor. An example of an auto-generate `dist/_routes.json` would be:\n\n```\n{\n  \"include\": [\n    \"/*\"\n  ],\n  \"exclude\": [\n    \"/_headers\",\n    \"/_redirects\",\n    \"/build/*\",\n    \"/favicon.ico\",\n    \"/manifest.json\",\n    \"/service-worker.js\",\n    \"/about\"\n  ],\n  \"version\": 1\n}\n```\n\nIn the above example, it's saying _all_ pages should be SSR'd. However, the root static files such as `/favicon.ico` and any static assets in `/build/*` should be excluded from the Functions, and instead treated as a static file.\n\nIn most cases the generated `dist/_routes.json` file is ideal. However, if you need more granular control over each path, you can instead provide you're own `public/_routes.json` file. When the project provides its own `public/_routes.json` file, then the Cloudflare adaptor will not auto-generate the routes config and instead use the committed one within the `public` directory.\n"
  },
  {
    "path": "starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.ts",
    "content": "import { cloudflarePagesAdapter } from \"@builder.io/qwik-city/adapters/cloudflare-pages/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.cloudflare-pages.tsx\", \"@qwik-city-plan\"],\n      },\n    },\n    plugins: [cloudflarePagesAdapter()],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/cloudflare-pages/gitignore",
    "content": "# Cloudflare\nfunctions/**/*.js\n"
  },
  {
    "path": "starters/adapters/cloudflare-pages/package.json",
    "content": "{\n  \"description\": \"Cloudflare Pages\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/cloudflare-pages/vite.config.ts\",\n    \"deploy\": \"wrangler pages deploy ./dist\",\n    \"serve\": \"wrangler pages dev ./dist --compatibility-flags=nodejs_als\"\n  },\n  \"devDependencies\": {\n    \"wrangler\": \"^3.0.0\"\n  },\n  \"__qwik__\": {\n    \"priority\": 40,\n    \"displayName\": \"Adapter: Cloudflare Pages\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/cloudflare-pages/\",\n      \"https://developers.cloudflare.com/pages\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build and deploy to Cloudflare Pages with:\",\n        \"\",\n        \"- pnpm run build: production build for Cloudflare\",\n        \"- pnpm run deploy: it will use the Cloudflare CLI to deploy your site\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/cloudflare-pages/public/_headers",
    "content": "# https://developers.cloudflare.com/pages/platform/headers/\n\n/*service-worker.js\n  Cache-Control: no-store\n  Content-Type: application/javascript\n  X-Content-Type-Options: nosniff\n\n/build/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n/assets/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n"
  },
  {
    "path": "starters/adapters/cloudflare-pages/public/_redirects",
    "content": "# https://developers.cloudflare.com/pages/platform/redirects/\n"
  },
  {
    "path": "starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for Cloudflare Pages when building for production.\n *\n * Learn more about the Cloudflare Pages integration here:\n * - https://qwik.dev/docs/deployments/cloudflare-pages/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformCloudflarePages,\n} from \"@builder.io/qwik-city/middleware/cloudflare-pages\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformCloudflarePages;\n}\n\nconst fetch = createQwikCity({ render, qwikCityPlan });\n\nexport { fetch };\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/README.md",
    "content": "## Cloudflare Workers\n\nCloudflare's [wrangler](https://github.com/cloudflare/wrangler) CLI can be used to preview a production build locally. To start a local server, run:\n\n```\nnpm run serve\n```\n\nThen visit [http://localhost:8787/](http://localhost:8787/)\n\n### Deployments\n\n[Cloudflare Workers](https://workers.cloudflare.com/) can be deployed using the [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/).\n\nIf you don't already have an account, then [create a Cloudflare account here](https://dash.cloudflare.com/sign-up/workers-and-pages).\n\nOnce authenticated, you can deploy your Worker:\n\n```\nnpm run deploy\n```\n\n### Configuration\n\nThe `wrangler.jsonc` file contains your Worker configuration. Key settings include:\n\n- **name**: Your Worker's name\n- **main**: Path to your Worker script (default: `./dist/_worker.js`)\n- **compatibility_date**: The date used for compatibility with the Workers runtime\n- **assets**: Configuration for serving static assets\n- **bindings**: Resources your Worker can interact with (KV, R2, D1, etc.)\n\nAfter adding any binding, use this command to regenerate the worker-configuration.d.ts file\n\n```\nnpm run cf-typegen\n```\n\nFor more details, see the [Wrangler configuration documentation](https://developers.cloudflare.com/workers/wrangler/configuration/).\n\n### Bindings\n\nCloudflare Workers can interact with various Cloudflare resources through bindings:\n\n- **KV**: Key-value storage\n- **R2**: Object storage\n- **D1**: SQL database\n- **Durable Objects**: Strongly consistent storage\n- **Queues**: Message queues\n- **AI**: AI inference\n\nConfigure bindings in your `wrangler.jsonc` file. See the [bindings documentation](https://developers.cloudflare.com/workers/runtime-apis/bindings/) for more information.\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts",
    "content": "import { cloudflarePagesAdapter as cloudflareWorkersAdapter } from \"@builder.io/qwik-city/adapters/cloudflare-pages/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.cloudflare-pages.tsx\", \"@qwik-city-plan\"],\n      },\n    },\n    plugins: [cloudflareWorkersAdapter()],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/gitignore",
    "content": "# Cloudflare\nfunctions/**/*.js\n.wrangler/"
  },
  {
    "path": "starters/adapters/cloudflare-workers/package.json",
    "content": "{\n  \"description\": \"Cloudflare Workers\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/cloudflare-workers/vite.config.ts\",\n    \"deploy\": \"wrangler deploy\",\n    \"serve\": \"wrangler dev\",\n    \"cf-typegen\": \"wrangler types\"\n  },\n  \"devDependencies\": {\n    \"@cloudflare/workers-types\": \"^4.20251228.0\",\n    \"wrangler\": \"^3.0.0\"\n  },\n  \"__qwik__\": {\n    \"priority\": 40,\n    \"displayName\": \"Adapter: Cloudflare Workers\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/cloudflare-workers/\",\n      \"https://developers.cloudflare.com/workers\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Make sure to follow the instructions in the [Cloudflare Workers documentation](https://qwik.dev/deployments/cloudflare-workers/) to setup your Qwik app.\",\n        \"Now you can build and deploy to Cloudflare Workers with:\",\n        \"\",\n        \"- pnpm run build: production build for Cloudflare\",\n        \"- pnpm run deploy: it will use the Cloudflare CLI to deploy your site\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/public/.assetsignore",
    "content": "_worker.js\n_routes.json\n_headers\n_redirects\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/public/_headers",
    "content": "# https://developers.cloudflare.com/pages/platform/headers/\n\n/*service-worker.js\n  Cache-Control: no-store\n  Content-Type: application/javascript\n  X-Content-Type-Options: nosniff\n\n/build/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n/assets/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/public/_redirects",
    "content": "# https://developers.cloudflare.com/pages/platform/redirects/\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/src/entry.cloudflare-pages.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for Cloudflare Workers when building for production.\n *\n * Learn more about the Cloudflare Workers integration here:\n * - https://qwik.dev/docs/deployments/cloudflare-workers/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformCloudflarePages as PlatformCloudflareWorkers,\n} from \"@builder.io/qwik-city/middleware/cloudflare-pages\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformCloudflareWorkers;\n}\n\nconst fetch = createQwikCity({ render, qwikCityPlan });\n\nexport { fetch };\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/worker-configuration.d.ts",
    "content": "// Generated by Wrangler\n// After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`\ninterface Env {\n  ASSET: Fetcher;\n}\n"
  },
  {
    "path": "starters/adapters/cloudflare-workers/wrangler.jsonc",
    "content": "/**\n * For more details on how to configure Wrangler, refer to:\n * https://developers.cloudflare.com/workers/wrangler/configuration/\n */\n{\n  \"$schema\": \"node_modules/wrangler/config-schema.json\",\n  \"name\": \"my-qwik-app\",\n  \"main\": \"./dist/_worker.js\",\n  \"compatibility_date\": \"2025-12-28\",\n  \"compatibility_flags\": [\"nodejs_compat\", \"global_fetch_strictly_public\"],\n  \"assets\": {\n    \"binding\": \"ASSET\",\n    \"directory\": \"./dist\",\n  },\n  \"observability\": {\n    \"enabled\": true,\n  },\n  /**\n   * Smart Placement\n   * https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement\n   */\n  // \"placement\": {  \"mode\": \"smart\" }\n  /**\n   * Bindings\n   * Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including\n   * databases, object storage, AI inference, real-time communication and more.\n   * https://developers.cloudflare.com/workers/runtime-apis/bindings/\n   */\n  /**\n   * Environment Variables\n   * https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables\n   * Note: Use secrets to store sensitive data.\n   * https://developers.cloudflare.com/workers/configuration/secrets/\n   */\n  // \"vars\": {  \"MY_VARIABLE\": \"production_value\" }\n  /**\n   * Service Bindings (communicate between multiple Workers)\n   * https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings\n   */\n  // \"services\": [  {   \"binding\": \"MY_SERVICE\",   \"service\": \"my-service\"  } ]\n}\n"
  },
  {
    "path": "starters/adapters/deno/README.md",
    "content": "## Deno Server\n\nThis app has a minimal [Deno server](https://docs.deno.com/runtime/tutorials/http_server) implementation. After running a full build, you can preview the build using the command:\n\n```\nnpm run serve\n```\n\nThen visit [http://localhost:8080/](http://localhost:8080/)\n"
  },
  {
    "path": "starters/adapters/deno/adapters/deno/vite.config.ts",
    "content": "import { denoServerAdapter } from \"@builder.io/qwik-city/adapters/deno-server/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.deno.ts\", \"@qwik-city-plan\"],\n      },\n      minify: false,\n    },\n    plugins: [\n      denoServerAdapter({\n        ssg: {\n          include: [\"/*\"],\n          origin: \"https://yoursite.dev\",\n        },\n      }),\n    ],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/deno/package.json",
    "content": "{\n  \"description\": \"Deno server\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/deno/vite.config.ts\",\n    \"serve\": \"deno run --allow-net --allow-read --allow-env server/entry.deno.js\"\n  },\n  \"__qwik__\": {\n    \"priority\": 20,\n    \"displayName\": \"Adapter: Deno Server\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/deno/\",\n      \"https://docs.deno.com/runtime/tutorials/http_server\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build a production-ready Deno app:\",\n        \"\",\n        \"- pnpm run build: production build\",\n        \"- pnpm run serve: runs the production server locally\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/deno/src/entry.deno.ts",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Deno HTTP server when building for production.\n *\n * Learn more about the Deno integration here:\n * - https://qwik.dev/docs/deployments/deno/\n * - https://docs.deno.com/runtime/tutorials/http_server\n *\n */\nimport { createQwikCity } from \"@builder.io/qwik-city/middleware/deno\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\n// Create the Qwik City Deno middleware\nconst { router, notFound, staticFile } = createQwikCity({\n  render,\n  qwikCityPlan,\n  static: {\n    cacheControl: \"public, max-age=31536000, immutable\",\n  },\n});\n\n// Allow for dynamic port\nconst port = Number(Deno.env.get(\"PORT\") ?? 3009);\n\n/* eslint-disable */\nconsole.log(`Server starter: http://localhost:${port}/app/`);\n\nDeno.serve({ port }, async (request: Request, info: any) => {\n  const staticResponse = await staticFile(request);\n  if (staticResponse) {\n    return staticResponse;\n  }\n\n  // Server-side render this request with Qwik City\n  const qwikCityResponse = await router(request, info);\n  if (qwikCityResponse) {\n    return qwikCityResponse;\n  }\n\n  // Path not found\n  return notFound(request);\n});\n\ndeclare const Deno: any;\n"
  },
  {
    "path": "starters/adapters/express/README.md",
    "content": "## Express Server\n\nThis app has a minimal [Express server](https://expressjs.com/) implementation. After running a full build, you can preview the build using the command:\n\n```\nnpm run serve\n```\n\nThen visit [http://localhost:8080/](http://localhost:8080/)\n"
  },
  {
    "path": "starters/adapters/express/adapters/express/vite.config.ts",
    "content": "import { nodeServerAdapter } from \"@builder.io/qwik-city/adapters/node-server/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.express.tsx\", \"@qwik-city-plan\"],\n      },\n    },\n    plugins: [nodeServerAdapter({ name: \"express\" })],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/express/package.json",
    "content": "{\n  \"description\": \"Express.js server\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/express/vite.config.ts\",\n    \"serve\": \"node server/entry.express\"\n  },\n  \"dependencies\": {\n    \"express\": \"4.22.0\"\n  },\n  \"devDependencies\": {\n    \"@types/compression\": \"^1.7.2\",\n    \"@types/express\": \"^4.17.19\",\n    \"compression\": \"^1.7.4\",\n    \"dotenv\": \"^16.3.2\"\n  },\n  \"__qwik__\": {\n    \"priority\": 20,\n    \"displayName\": \"Adapter: Node.js Express Server\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/node/\",\n      \"https://expressjs.com/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build a production-ready Express app:\",\n        \"\",\n        \"- pnpm run build: production build\",\n        \"- pnpm run serve: runs the production server locally\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/express/src/entry.express.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Express HTTP server when building for production.\n *\n * Learn more about Node.js server integrations here:\n * - https://qwik.dev/docs/deployments/node/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformNode,\n} from \"@builder.io/qwik-city/middleware/node\";\nimport \"dotenv/config\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\nimport express from \"express\";\nimport { fileURLToPath } from \"node:url\";\nimport { join } from \"node:path\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformNode;\n}\n\n// Directories where the static assets are located\nconst distDir = join(fileURLToPath(import.meta.url), \"..\", \"..\", \"dist\");\nconst buildDir = join(distDir, \"build\");\nconst assetsDir = join(distDir, \"assets\");\n\n// Allow for dynamic port\nconst PORT = process.env.PORT ?? 3000;\n\n// Create the Qwik City Node middleware\nconst { router, notFound } = createQwikCity({\n  render,\n  qwikCityPlan,\n  // getOrigin(req) {\n  //   // If deploying under a proxy, you may need to build the origin from the request headers\n  //   // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto\n  //   const protocol = req.headers[\"x-forwarded-proto\"] ?? \"http\";\n  //   // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host\n  //   const host = req.headers[\"x-forwarded-host\"] ?? req.headers.host;\n  //   return `${protocol}://${host}`;\n  // }\n});\n\n// Create the express server\n// https://expressjs.com/\nconst app = express();\n\n// Enable gzip compression\n// app.use(compression());\n\n// Static asset handlers\n// https://expressjs.com/en/starter/static-files.html\napp.use(`/build`, express.static(buildDir, { immutable: true, maxAge: \"1y\" }));\napp.use(\n  `/assets`,\n  express.static(assetsDir, { immutable: true, maxAge: \"1y\" }),\n);\napp.use(express.static(distDir, { redirect: false }));\n\n// Use Qwik City's page and endpoint request handler\napp.use(router);\n\n// Use Qwik City's 404 handler\napp.use(notFound);\n\n// Start the express server\napp.listen(PORT, () => {\n  /* eslint-disable */\n  console.log(`Server started: http://localhost:${PORT}/`);\n});\n"
  },
  {
    "path": "starters/adapters/fastify/README.md",
    "content": "## Fastify Server\n\nThis app has a minimal [Fastify server](https://fastify.dev/) implementation. After running a full build, you can preview the build using the command:\n\n```\nnpm run serve\n```\n\nThen visit [http://localhost:3000/](http://localhost:3000/)\n"
  },
  {
    "path": "starters/adapters/fastify/adapters/fastify/vite.config.ts",
    "content": "import { nodeServerAdapter } from \"@builder.io/qwik-city/adapters/node-server/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.fastify.tsx\", \"@qwik-city-plan\"],\n      },\n    },\n    plugins: [nodeServerAdapter({ name: \"fastify\" })],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/fastify/package.json",
    "content": "{\n  \"description\": \"Fastify server\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/fastify/vite.config.ts\",\n    \"serve\": \"node server/entry.fastify\"\n  },\n  \"dependencies\": {\n    \"@fastify/compress\": \"^6.2.1\",\n    \"@fastify/static\": \"^6.10.1\",\n    \"fastify\": \"^5.7.3\",\n    \"fastify-plugin\": \"^4.5.0\"\n  },\n  \"devDependencies\": {\n    \"dotenv\": \"^16.3.2\"\n  },\n  \"__qwik__\": {\n    \"priority\": 20,\n    \"displayName\": \"Adapter: Node.js Fastify Server\",\n    \"docs\": [\n      \"https://qwik.dev/integrations/deployments/node/\",\n      \"https://fastify.dev/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build a production-ready Fastify app:\",\n        \"\",\n        \"- pnpm run build: production build for Fastify\",\n        \"- pnpm run serve: runs the production server locally\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/fastify/src/entry.fastify.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Fastify server when building for production.\n *\n * Learn more about Node.js server integrations here:\n * - https://qwik.dev/docs/deployments/node/\n *\n */\nimport { type PlatformNode } from \"@builder.io/qwik-city/middleware/node\";\nimport \"dotenv/config\";\nimport Fastify from \"fastify\";\nimport { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport FastifyQwik from \"./plugins/fastify-qwik\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformNode;\n}\n\n// Directories where the static assets are located\nconst distDir = join(fileURLToPath(import.meta.url), \"..\", \"..\", \"dist\");\nconst buildDir = join(distDir, \"build\");\nconst assetsDir = join(distDir, \"assets\");\n\n// Allow for dynamic port and host\nconst PORT = parseInt(process.env.PORT ?? \"3000\");\nconst HOST = process.env.HOST ?? \"0.0.0.0\";\n\nconst start = async () => {\n  // Create the fastify server\n  // https://fastify.dev/docs/latest/Guides/Getting-Started/\n  const fastify = Fastify({\n    logger: true,\n  });\n\n  // Enable compression\n  // https://github.com/fastify/fastify-compress\n  // IMPORTANT NOTE: THIS MUST BE REGISTERED BEFORE THE fastify-qwik PLUGIN\n  // await fastify.register(import('@fastify/compress'))\n\n  // Handle Qwik City using a plugin\n  await fastify.register(FastifyQwik, { distDir, buildDir, assetsDir });\n\n  // Start the fastify server\n  await fastify.listen({ port: PORT, host: HOST });\n};\n\nstart();\n"
  },
  {
    "path": "starters/adapters/fastify/src/plugins/fastify-qwik.ts",
    "content": "import { createQwikCity } from \"@builder.io/qwik-city/middleware/node\";\nimport fastifyStatic from \"@fastify/static\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport type { FastifyPluginAsync } from \"fastify\";\nimport fastifyPlugin from \"fastify-plugin\";\n\nimport render from \"../entry.ssr\";\n\nexport interface FastifyQwikOptions {\n  distDir: string;\n  buildDir: string;\n  assetsDir: string;\n}\n\nconst { router, notFound } = createQwikCity({ render, qwikCityPlan });\n\nconst qwikPlugin: FastifyPluginAsync<FastifyQwikOptions> = async (\n  fastify,\n  options,\n) => {\n  const { buildDir, distDir, assetsDir } = options;\n\n  fastify.register(fastifyStatic, {\n    root: buildDir,\n    prefix: \"/build\",\n    immutable: true,\n    maxAge: \"1y\",\n    decorateReply: false,\n  });\n\n  fastify.register(fastifyStatic, {\n    root: assetsDir,\n    prefix: \"/assets\",\n    immutable: true,\n    maxAge: \"1y\",\n  });\n\n  fastify.register(fastifyStatic, {\n    root: distDir,\n    redirect: false,\n    decorateReply: false,\n  });\n\n  fastify.removeAllContentTypeParsers();\n\n  fastify.setNotFoundHandler(async (request, response) => {\n    await router(request.raw, response.raw, (err) => fastify.log.error(err));\n    await notFound(request.raw, response.raw, (err) => fastify.log.error(err));\n  });\n};\n\nexport default fastifyPlugin(qwikPlugin, { fastify: \">=4.0.0 <6.0.0\" });\n"
  },
  {
    "path": "starters/adapters/firebase/.eslintignore",
    "content": "# Firebase\n"
  },
  {
    "path": "starters/adapters/firebase/.prettierignore",
    "content": "# Firebase\n"
  },
  {
    "path": "starters/adapters/firebase/adapters/firebase/vite.config.ts",
    "content": "import { nodeServerAdapter } from \"@builder.io/qwik-city/adapters/node-server/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\nimport { builtinModules } from \"module\";\nexport default extendConfig(baseConfig, () => {\n  return {\n    ssr: {\n      external: builtinModules,\n      noExternal: /./,\n    },\n    build: {\n      minify: false,\n      ssr: true,\n      rollupOptions: {\n        input: [\"./src/entry-firebase.tsx\", \"@qwik-city-plan\"],\n      },\n      outDir: \"./functions/server\",\n    },\n    plugins: [nodeServerAdapter({ name: \"firebase\" })],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/firebase/firebase.json",
    "content": "{\n  \"functions\": [\n    {\n      \"source\": \"functions\",\n      \"codebase\": \"default\",\n      \"ignore\": [\n        \"node_modules\",\n        \".git\",\n        \"firebase-debug.log\",\n        \"firebase-debug.*.log\"\n      ]\n    }\n  ],\n  \"hosting\": {\n    \"public\": \"dist\",\n    \"rewrites\": [\n      {\n        \"source\": \"**\",\n        \"function\": \"app\"\n      }\n    ],\n    \"ignore\": [\"firebase.json\", \"**/.*\", \"**/node_modules/**\"],\n    \"headers\": [\n      {\n        \"source\": \"build/**/*.js\",\n        \"headers\": [\n          {\n            \"key\": \"Cache-Control\",\n            \"value\": \"public, max-age=31536000, s-maxage=31536000, immutable\"\n          }\n        ]\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "starters/adapters/firebase/functions/.gitkeep",
    "content": ""
  },
  {
    "path": "starters/adapters/firebase/functions/index.js",
    "content": "import { https } from \"firebase-functions\";\nimport qwikApp from \"./server/entry-firebase.mjs\";\n\nexport const app = https.onRequest(qwikApp);\n"
  },
  {
    "path": "starters/adapters/firebase/functions/package.json",
    "content": "{\n  \"name\": \"functions\",\n  \"description\": \"Cloud Functions for Firebase\",\n  \"scripts\": {\n    \"serve\": \"firebase emulators:start --only functions\",\n    \"shell\": \"firebase functions:shell\",\n    \"start\": \"npm run shell\",\n    \"deploy\": \"firebase deploy --only functions\",\n    \"logs\": \"firebase functions:log\"\n  },\n  \"engines\": {\n    \"node\": \"18\"\n  },\n  \"type\": \"module\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"@google-cloud/functions-framework\": \"^3.3.0\",\n    \"firebase-admin\": \"^11.8.0\",\n    \"firebase-functions\": \"^4.3.1\",\n    \"undici\": \"*\"\n  },\n  \"devDependencies\": {\n    \"firebase-functions-test\": \"^3.1.0\"\n  },\n  \"private\": true\n}\n"
  },
  {
    "path": "starters/adapters/firebase/gitignore",
    "content": "# Firebase\nfunctions/server\nfunctions/node_modules\n"
  },
  {
    "path": "starters/adapters/firebase/package.json",
    "content": "{\n  \"description\": \"Firebase\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/firebase/vite.config.ts\",\n    \"serve\": \"qwik build && firebase emulators:start\",\n    \"deploy\": \"firebase deploy\"\n  },\n  \"devDependencies\": {\n    \"firebase-tools\": \"^13.10.2\"\n  },\n  \"__qwik__\": {\n    \"priority\": 30,\n    \"displayName\": \"Adapter: Firebase\",\n    \"docs\": [\n      \"https://qwik.dev/qwikcity/adaptors/aws-lambda/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"- cd functions && pnpm i\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/firebase/src/entry-firebase.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for Firbease when building for production.\n *\n * Learn more about the Firebase integration here:\n * - https://qwik.dev/docs/deployments/firebase/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformFirebase,\n} from \"@builder.io/qwik-city/middleware/firebase\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformFirebase;\n}\n\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "starters/adapters/netlify-edge/README.md",
    "content": "## Netlify\n\nThis starter site is configured to deploy to [Netlify Edge Functions](https://docs.netlify.com/edge-functions/overview/), which means it will be rendered at an edge location near to your users.\n\n### Local development\n\nThe [Netlify CLI](https://docs.netlify.com/cli/get-started/) can be used to preview a production build locally. To do so: First build your site, then to start a local server, run:\n\n1. Install Netlify CLI globally `npm i -g netlify-cli`.\n2. Build your site with both ssr and static `npm run build`.\n3. Start a local server with `npm run serve`.\n   In this project, `npm run serve` uses the `netlify dev` command to spin up a server that can handle Netlify's Edge Functions locally.\n4. Visit [http://localhost:8888/](http://localhost:8888/) to check out your site.\n\n### Edge Functions Declarations\n\n[Netlify Edge Functions declarations](https://docs.netlify.com/edge-functions/declarations/)\ncan be configured to run on specific URL patterns. Each edge function declaration associates\none site path pattern with one function to execute on requests that match the path. A single request can execute a chain of edge functions from a series of declarations. A single edge function can be associated with multiple paths across various declarations.\n\nThis is useful to determine if a page response should be Server-Side Rendered (SSR) or\nif the response should use a static-site generated (SSG) `index.html` file instead.\n\nBy default, the Netlify Edge adaptor will generate a `.netlify/edge-middleware/manifest.json` file, which is used by the Netlify deployment to determine which paths should, and should not, use edge functions.\n\nTo override the generated manifest, you can [add a declaration](https://docs.netlify.com/edge-functions/declarations/#add-a-declaration) to the `netlify.toml` using the `[[edge_functions]]` config. For example:\n\n```toml\n[[edge_functions]]\n  path = \"/admin\"\n  function = \"auth\"\n```\n\n### Addition Adapter Options\n\nNetlify-specific option fields that can be passed to the adapter options:\n\n- `excludedPath` this option accepts a `string` glob pattern that represents which path pattern should not go through the generated Edge Functions.\n\n### Deployments\n\nYou can [deploy your site to Netlify](https://docs.netlify.com/site-deploys/create-deploys/) either via a Git provider integration or through the Netlify CLI. This starter site includes a `netlify.toml` file to configure your build for deployment.\n\n#### Deploying via Git\n\nOnce your site has been pushed to your Git provider, you can either link it [in the Netlify UI](https://app.netlify.com/start) or use the CLI. To link your site to a Git provider from the Netlify CLI, run the command:\n\n```shell\nnetlify link\n```\n\nThis sets up [continuous deployment](https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git) for your site's repo. Whenever you push new commits to your repo, Netlify starts the build process..\n\n#### Deploying manually via the CLI\n\nIf you wish to deploy from the CLI rather than using Git, you can use the command:\n\n```shell\nnetlify deploy --build\n```\n\nYou must use the `--build` flag whenever you deploy. This ensures that the Edge Functions that this starter site relies on are generated and available when you deploy your site.\n\nAdd `--prod` flag to deploy to production.\n"
  },
  {
    "path": "starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.ts",
    "content": "import { netlifyEdgeAdapter } from \"@builder.io/qwik-city/adapters/netlify-edge/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.netlify-edge.tsx\", \"@qwik-city-plan\"],\n      },\n      outDir: \".netlify/edge-functions/entry.netlify-edge\",\n    },\n    plugins: [netlifyEdgeAdapter()],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/netlify-edge/gitignore",
    "content": "# Netlify\n.netlify\n"
  },
  {
    "path": "starters/adapters/netlify-edge/netlify.toml",
    "content": "[build]\npublish = \"dist\"\ncommand = \"npm run build\"\n"
  },
  {
    "path": "starters/adapters/netlify-edge/package.json",
    "content": "{\n  \"description\": \"Netlify Edge Functions\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/netlify-edge/vite.config.ts\",\n    \"deploy\": \"netlify deploy --build\"\n  },\n  \"devDependencies\": {\n    \"@netlify/edge-functions\": \"^2.0.0\",\n    \"netlify-cli\": \"^15.0.0\"\n  },\n  \"__qwik__\": {\n    \"priority\": 30,\n    \"displayName\": \"Adapter: Netlify Edge\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/netlify-edge/\",\n      \"https://docs.netlify.com/edge-functions/overview/\",\n      \"https://docs.netlify.com/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build and deploy to Netlify with:\",\n        \"\",\n        \"- pnpm run build: production build for Netlify\",\n        \"- pnpm run deploy: it will use the netlify CLI to deploy your site\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/netlify-edge/public/_headers",
    "content": "/assets/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n/build/*\n  Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable\n"
  },
  {
    "path": "starters/adapters/netlify-edge/src/entry.netlify-edge.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for Netlify Edge when building for production.\n *\n * Learn more about the Netlify integration here:\n * - https://qwik.dev/docs/deployments/netlify-edge/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformNetlify,\n} from \"@builder.io/qwik-city/middleware/netlify-edge\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformNetlify;\n}\n\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "starters/adapters/node-server/README.md",
    "content": "## Node Server\n\nThis app has a minimal zero-dependencies server. Using the built-in `http.createServer` API.\nThis should be faster and less overhead than Express or other frameworks.\n\nAfter running a full build, you can preview the build using the command:\n\n```\nnpm run serve\n```\n\nThen visit [http://localhost:3004/](http://localhost:3004/)\n"
  },
  {
    "path": "starters/adapters/node-server/adapters/node-server/vite.config.ts",
    "content": "import { nodeServerAdapter } from \"@builder.io/qwik-city/adapters/node-server/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.node-server.tsx\", \"@qwik-city-plan\"],\n      },\n    },\n    plugins: [nodeServerAdapter({ name: \"node-server\" })],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/node-server/package.json",
    "content": "{\n  \"description\": \"Vanilla Node server\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/node-server/vite.config.ts\",\n    \"serve\": \"node server/entry.node-server\"\n  },\n  \"__qwik__\": {\n    \"priority\": 19,\n    \"displayName\": \"Adapter: Node.js Server\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/node/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build a production-ready node app:\",\n        \"\",\n        \"- pnpm run build: production build\",\n        \"- pnpm run serve: runs the production server locally\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/node-server/src/entry.node-server.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for the Express HTTP server when building for production.\n *\n * Learn more about Node.js server integrations here:\n * - https://qwik.dev/docs/deployments/node/\n *\n */\nimport { createQwikCity } from \"@builder.io/qwik-city/middleware/node\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\nimport { createServer } from \"node:http\";\n\n// Allow for dynamic port\nconst PORT = process.env.PORT ?? 3004;\n\n// Create the Qwik City express middleware\nconst { router, notFound, staticFile } = createQwikCity({\n  render,\n  qwikCityPlan,\n  static: {\n    cacheControl: \"public, max-age=31536000, immutable\",\n  },\n});\n\nconst server = createServer();\n\nserver.on(\"request\", (req, res) => {\n  staticFile(req, res, () => {\n    router(req, res, () => {\n      notFound(req, res, () => {});\n    });\n  });\n});\n\nserver.listen(PORT, () => {\n  // eslint-disable-next-line no-console\n  console.log(`Node server listening on http://localhost:${PORT}`);\n});\n"
  },
  {
    "path": "starters/adapters/static/README.md",
    "content": "## Static Site Generator (Node.js)\n\nBe sure to configure your server to serve very long cache headers for the `build/**/*.js` files.\n\nTypically you'd set the `Cache-Control` header for those files to `public, max-age=31536000, immutable`.\n\n```shell\nnpm run build.server\n```\n"
  },
  {
    "path": "starters/adapters/static/adapters/static/vite.config.ts",
    "content": "import { staticAdapter } from \"@builder.io/qwik-city/adapters/static/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"@qwik-city-plan\"],\n      },\n    },\n    plugins: [\n      staticAdapter({\n        origin: \"https://yoursite.qwik.dev\",\n      }),\n    ],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/static/package.json",
    "content": "{\n  \"description\": \"Static Site Generator\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/static/vite.config.ts\"\n  },\n  \"__qwik__\": {\n    \"priority\": 10,\n    \"displayName\": \"Adapter: Static site (.html files)\",\n    \"docs\": [\n      \"https://qwik.dev/qwikcity/static-site-generation/overview/\"\n    ],\n    \"nextSteps\": {\n      \"lines\": [\n        \"You have to change the 'origin' url under staticAdapter\",\n        \"inside './adapters/static/vite.config.ts'\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/vercel-edge/README.md",
    "content": "## Vercel Edge\n\nThis starter site is configured to deploy to [Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions), which means it will be rendered at an edge location near to your users.\n\n## Installation\n\nThe adaptor will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:\n\n```\n└── adapters/\n    └── vercel-edge/\n        └── vite.config.ts\n└── src/\n    └── entry.vercel-edge.tsx\n```\n\nAdditionally, within the `package.json`, the `build.server` script will be updated with the Vercel Edge build.\n\n## Production build\n\nTo build the application for production, use the `build` command, this command will automatically run `npm run build.server` and `npm run build.client`:\n\n```shell\nnpm run build\n```\n\n[Read the full guide here](https://github.com/QwikDev/qwik/blob/main/starters/adapters/vercel-edge/README.md)\n\n## Dev deploy\n\nTo deploy the application for development:\n\n```shell\nnpm run deploy\n```\n\nNotice that you might need a [Vercel account](https://docs.Vercel.com/get-started/) in order to complete this step!\n\n## Production deploy\n\nThe project is ready to be deployed to Vercel. However, you will need to create a git repository and push the code to it.\n\nYou can [deploy your site to Vercel](https://vercel.com/docs/concepts/deployments/overview) either via a Git provider integration or through the Vercel CLI.\n"
  },
  {
    "path": "starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.ts",
    "content": "import { vercelEdgeAdapter } from \"@builder.io/qwik-city/adapters/vercel-edge/vite\";\nimport { extendConfig } from \"@builder.io/qwik-city/vite\";\nimport baseConfig from \"../../vite.config\";\n\nexport default extendConfig(baseConfig, () => {\n  return {\n    build: {\n      ssr: true,\n      rollupOptions: {\n        input: [\"src/entry.vercel-edge.tsx\", \"@qwik-city-plan\"],\n      },\n      outDir: \".vercel/output/functions/_qwik-city.func\",\n    },\n    plugins: [vercelEdgeAdapter()],\n  };\n});\n"
  },
  {
    "path": "starters/adapters/vercel-edge/gitignore",
    "content": "# Vercel\n.vercel\n"
  },
  {
    "path": "starters/adapters/vercel-edge/package.json",
    "content": "{\n  \"description\": \"Vercel Edge Functions\",\n  \"scripts\": {\n    \"build.server\": \"qwik check-client src dist && vite build -c adapters/vercel-edge/vite.config.ts\",\n    \"deploy\": \"vercel deploy\"\n  },\n  \"devDependencies\": {\n    \"vercel\": \"^29.1.1\"\n  },\n  \"__qwik__\": {\n    \"priority\": 30,\n    \"displayName\": \"Adapter: Vercel Edge\",\n    \"docs\": [\n      \"https://qwik.dev/deployments/vercel-edge/\",\n      \"https://vercel.com/docs/concepts/functions/edge-functions\",\n      \"https://vercel.com/docs\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \"Now you can build and deploy to Vercel with:\",\n        \"\",\n        \"- pnpm run build: production build for Vercel\",\n        \"- pnpm run deploy: it will use the Vercel CLI to deploy your site\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/adapters/vercel-edge/src/entry.vercel-edge.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the entry point for Vercel Edge when building for production.\n *\n * Learn more about the Vercel Edge integration here:\n * - https://qwik.dev/docs/deployments/vercel-edge/\n *\n */\nimport {\n  createQwikCity,\n  type PlatformVercel,\n} from \"@builder.io/qwik-city/middleware/vercel-edge\";\nimport qwikCityPlan from \"@qwik-city-plan\";\nimport render from \"./entry.ssr\";\n\ndeclare global {\n  type QwikCityPlatform = PlatformVercel;\n}\n\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "starters/adapters/vercel-edge/vercel.json",
    "content": "{\n  \"headers\": [\n    {\n      \"source\": \"/(.*)?service-worker.js\",\n      \"headers\": [\n        {\n          \"key\": \"Cache-Control\",\n          \"value\": \"public, max-age=0, must-revalidate\"\n        }\n      ]\n    },\n    {\n      \"source\": \"/(assets|build)/(.*)\",\n      \"headers\": [\n        {\n          \"key\": \"Cache-Control\",\n          \"value\": \"public, max-age=31536000, s-maxage=31536000, immutable\"\n        }\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "starters/apps/base/.npmrc",
    "content": "engine-strict=true\n"
  },
  {
    "path": "starters/apps/base/.prettierignore",
    "content": "**/*.log\n**/.DS_Store\n*.\n.vscode/settings.json\n.history\n.yarn\nbazel-*\nbazel-bin\nbazel-out\nbazel-qwik\nbazel-testlogs\ndist\ndist-dev\nlib\nlib-types\netc\nexternal\nnode_modules\ntemp\ntsc-out\ntsdoc-metadata.json\ntarget\noutput\nrollup.config.js\nbuild\n.cache\n.vscode\n.rollup.cache\ntsconfig.tsbuildinfo\nvite.config.ts\n*.spec.tsx\n*.spec.ts\n.netlify\npnpm-lock.yaml\npackage-lock.json\nyarn.lock\nserver\n"
  },
  {
    "path": "starters/apps/base/.vscode/extensions.json",
    "content": "{\n  \"recommendations\": [\"dbaeumer.vscode-eslint\", \"unifiedjs.vscode-mdx\"],\n  \"unwantedRecommendations\": []\n}\n"
  },
  {
    "path": "starters/apps/base/.vscode/launch.json",
    "content": "{\n  // Use IntelliSense to learn about possible attributes.\n  // Hover to view descriptions of existing attributes.\n  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"name\": \"Launch Chrome\",\n      \"request\": \"launch\",\n      \"type\": \"chrome\",\n      \"url\": \"http://localhost:5173\",\n      \"webRoot\": \"${workspaceFolder}\"\n    },\n    {\n      \"type\": \"node\",\n      \"name\": \"dev.debug\",\n      \"request\": \"launch\",\n      \"skipFiles\": [\"<node_internals>/**\"],\n      \"cwd\": \"${workspaceFolder}\",\n      \"program\": \"${workspaceFolder}/node_modules/vite/bin/vite.js\",\n      \"args\": [\"--mode\", \"ssr\", \"--force\"]\n    }\n  ]\n}\n"
  },
  {
    "path": "starters/apps/base/.vscode/qwik-city.code-snippets",
    "content": "{\n  \"onRequest\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qonRequest\",\n    \"description\": \"onRequest function for a route index\",\n    \"body\": [\n      \"export const onRequest: RequestHandler = (request) => {\",\n      \"  $0\",\n      \"};\",\n    ],\n  },\n  \"loader$\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qloader$\",\n    \"description\": \"loader$()\",\n    \"body\": [\"export const $1 = routeLoader$(() => {\", \"  $0\", \"});\"],\n  },\n  \"action$\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qaction$\",\n    \"description\": \"action$()\",\n    \"body\": [\"export const $1 = routeAction$((data) => {\", \"  $0\", \"});\"],\n  },\n  \"Full Page\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qpage\",\n    \"description\": \"Simple page component\",\n    \"body\": [\n      \"import { component$ } from '@builder.io/qwik';\",\n      \"\",\n      \"export default component$(() => {\",\n      \"  $0\",\n      \"});\",\n    ],\n  },\n}\n"
  },
  {
    "path": "starters/apps/base/.vscode/qwik.code-snippets",
    "content": "{\n  \"Qwik component (simple)\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"qcomponent$\",\n    \"description\": \"Simple Qwik component\",\n    \"body\": [\n      \"export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {\",\n      \"  return <${2:div}>$4</$2>\",\n      \"});\",\n    ],\n  },\n  \"Qwik component (props)\": {\n    \"scope\": \"typescriptreact\",\n    \"prefix\": \"qcomponent$ + props\",\n    \"description\": \"Qwik component w/ props\",\n    \"body\": [\n      \"export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {\",\n      \"  $2\",\n      \"}\",\n      \"\",\n      \"export const $1 = component$<$1Props>((props) => {\",\n      \"  const ${2:count} = useSignal(0);\",\n      \"  return (\",\n      \"    <${3:div} on${4:Click}$={(ev) => {$5}}>\",\n      \"      $6\",\n      \"    </${3}>\",\n      \"  );\",\n      \"});\",\n    ],\n  },\n  \"Qwik signal\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseSignal\",\n    \"description\": \"useSignal() declaration\",\n    \"body\": [\"const ${1:foo} = useSignal($2);\", \"$0\"],\n  },\n  \"Qwik store\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseStore\",\n    \"description\": \"useStore() declaration\",\n    \"body\": [\"const ${1:state} = useStore({\", \"  $2\", \"});\", \"$0\"],\n  },\n  \"$ hook\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"q$\",\n    \"description\": \"$() function hook\",\n    \"body\": [\"$(() => {\", \"  $0\", \"});\", \"\"],\n  },\n  \"useVisibleTask\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseVisibleTask\",\n    \"description\": \"useVisibleTask$() function hook\",\n    \"body\": [\"useVisibleTask$(({ track }) => {\", \"  $0\", \"});\", \"\"],\n  },\n  \"useTask\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseTask$\",\n    \"description\": \"useTask$() function hook\",\n    \"body\": [\n      \"useTask$(({ track }) => {\",\n      \"  track(() => $1);\",\n      \"  $0\",\n      \"});\",\n      \"\",\n    ],\n  },\n  \"useResource\": {\n    \"scope\": \"javascriptreact,typescriptreact\",\n    \"prefix\": \"quseResource$\",\n    \"description\": \"useResource$() declaration\",\n    \"body\": [\n      \"const $1 = useResource$(({ track, cleanup }) => {\",\n      \"  $0\",\n      \"});\",\n      \"\",\n    ],\n  },\n}\n"
  },
  {
    "path": "starters/apps/base/.vscode/settings.json",
    "content": "{\n  \"material-icon-theme.activeIconPack\": \"qwik\",\n  \"emmet.includeLanguages\": {\n    \"typescriptreact\": \"html\"\n  },\n  \"emmet.preferences\": {\n    // to ensure closing tags are used (e.g. <img/> not just <img> like in HTML)\n    // https://github.com/microsoft/vscode/commit/083bf9020407ea5a91199eb1f0b373859df8d600#diff-88456bc9b7caa2f8126aea0107b4671db0f094961aaf39a7c689f890e23aaaba\n    \"output.selfClosingStyle\": \"xhtml\"\n  }\n}\n"
  },
  {
    "path": "starters/apps/base/README.md",
    "content": "# Qwik City App ⚡️\n\n- [Qwik Docs](https://qwik.dev/)\n- [Discord](https://qwik.dev/chat)\n- [Qwik GitHub](https://github.com/QwikDev/qwik)\n- [@QwikDev](https://twitter.com/QwikDev)\n- [Vite](https://vitejs.dev/)\n\n---\n\n## Project Structure\n\nThis project is using Qwik with [QwikCity](https://qwik.dev/qwikcity/overview/). QwikCity is just an extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more.\n\nInside your project, you'll see the following directory structure:\n\n```\n├── public/\n│   └── ...\n└── src/\n    ├── components/\n    │   └── ...\n    └── routes/\n        └── ...\n```\n\n- `src/routes`: Provides the directory-based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.dev/qwikcity/routing/overview/) for more info.\n\n- `src/components`: Recommended directory for components.\n\n- `public`: Any static assets, like images, can be placed in the public directory. Please see the [Vite public directory](https://vitejs.dev/guide/assets.html#the-public-directory) for more info.\n\n## Add Integrations and deployment\n\nUse the `npm run qwik add` command to add additional integrations. Some examples of integrations includes: Cloudflare, Netlify or Express Server, and the [Static Site Generator (SSG)](https://qwik.dev/qwikcity/guides/static-site-generation/).\n\n```shell\nnpm run qwik add # or `yarn qwik add`\n```\n\n## Development\n\nDevelopment mode uses [Vite's development server](https://vitejs.dev/). The `dev` command will server-side render (SSR) the output during development.\n\n```shell\nnpm start # or `yarn start`\n```\n\n> Note: during dev mode, Vite may request a significant number of `.js` files. This does not represent a Qwik production build.\n\n## Preview\n\nThe preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to preview a production build locally and should not be used as a production server.\n\n```shell\nnpm run preview # or `yarn preview`\n```\n\n## Production\n\nThe production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.\n\n```shell\nnpm run build # or `yarn build`\n```\n"
  },
  {
    "path": "starters/apps/base/eslint.config.js",
    "content": "import js from \"@eslint/js\";\nimport globals from \"globals\";\nimport tseslint from \"typescript-eslint\";\nimport { globalIgnores } from \"eslint/config\";\nimport { qwikEslint9Plugin } from \"eslint-plugin-qwik\";\n\nconst ignores = [\n  \"**/*.log\",\n  \"**/.DS_Store\",\n  \"**/*.\",\n  \".vscode/settings.json\",\n  \"**/.history\",\n  \"**/.yarn\",\n  \"**/bazel-*\",\n  \"**/bazel-bin\",\n  \"**/bazel-out\",\n  \"**/bazel-qwik\",\n  \"**/bazel-testlogs\",\n  \"**/dist\",\n  \"**/dist-dev\",\n  \"**/lib\",\n  \"**/lib-types\",\n  \"**/etc\",\n  \"**/external\",\n  \"**/node_modules\",\n  \"**/temp\",\n  \"**/tsc-out\",\n  \"**/tsdoc-metadata.json\",\n  \"**/target\",\n  \"**/output\",\n  \"**/rollup.config.js\",\n  \"**/build\",\n  \"**/.cache\",\n  \"**/.vscode\",\n  \"**/.rollup.cache\",\n  \"**/dist\",\n  \"**/tsconfig.tsbuildinfo\",\n  \"**/vite.config.ts\",\n  \"**/*.spec.tsx\",\n  \"**/*.spec.ts\",\n  \"**/.netlify\",\n  \"**/pnpm-lock.yaml\",\n  \"**/package-lock.json\",\n  \"**/yarn.lock\",\n  \"**/server\",\n  \"eslint.config.js\",\n];\n\nexport default tseslint.config(\n  globalIgnores(ignores),\n  js.configs.recommended,\n  tseslint.configs.recommended,\n  qwikEslint9Plugin.configs.recommended,\n  {\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        ...globals.node,\n        ...globals.es2021,\n        ...globals.serviceworker,\n      },\n      parserOptions: {\n        projectService: true,\n        tsconfigRootDir: import.meta.dirname,\n      },\n    },\n  },\n  {\n    rules: {\n      \"@typescript-eslint/no-explicit-any\": \"off\",\n    },\n  },\n);\n"
  },
  {
    "path": "starters/apps/base/gitignore",
    "content": "# Build\n/dist\n/lib\n/lib-types\n/server\n\n# Development\nnode_modules\n.env\n*.local\n\n# Cache\n.cache\n.mf\n.rollup.cache\ntsconfig.tsbuildinfo\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\n# Editor\n.vscode/*\n!.vscode/launch.json\n!.vscode/*.code-snippets\n\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\n# Yarn\n.yarn/*\n!.yarn/releases\n"
  },
  {
    "path": "starters/apps/base/package.json",
    "content": "{\n  \"name\": \"qwik-project-name\",\n  \"scripts\": {\n    \"build\": \"qwik build\",\n    \"build.client\": \"vite build\",\n    \"build.preview\": \"vite build --ssr src/entry.preview.tsx\",\n    \"build.types\": \"tsc --incremental --noEmit\",\n    \"dev\": \"vite --mode ssr\",\n    \"dev.debug\": \"node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"fmt\": \"prettier --write .\",\n    \"fmt.check\": \"prettier --check .\",\n    \"lint\": \"eslint \\\"src/**/*.ts*\\\"\",\n    \"preview\": \"qwik build preview && vite preview --open\",\n    \"start\": \"vite --open --mode ssr\",\n    \"deploy\": \"echo 'Run \\\"npm run qwik add\\\" to install a server adapter'\",\n    \"qwik\": \"qwik\"\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"latest\",\n    \"@builder.io/qwik-city\": \"latest\",\n    \"@eslint/js\": \"^9\",\n    \"@types/node\": \"latest\",\n    \"typescript-eslint\": \"latest\",\n    \"eslint\": \"^9\",\n    \"eslint-plugin-qwik\": \"latest\",\n    \"globals\": \"latest\",\n    \"prettier\": \"latest\",\n    \"typescript\": \"latest\",\n    \"typescript-plugin-css-modules\": \"latest\",\n    \"undici\": \"latest\",\n    \"vite\": \"latest\",\n    \"vite-tsconfig-paths\": \"^4.2.1\"\n  },\n  \"engines\": {\n    \"node\": \"^18.17.0 || ^20.3.0 || >=21.0.0\",\n    \"npm\": \">=10.0.0\",\n    \"pnpm\": \">=8.0.0\",\n    \"yarn\": \">=3.0.0\"\n  },\n  \"engines-annotation\": \"Mostly required by sharp which needs a Node-API v9 compatible runtime\",\n  \"private\": true,\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "starters/apps/base/public/manifest.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/web-manifest-combined.json\",\n  \"name\": \"qwik-project-name\",\n  \"short_name\": \"Welcome to Qwik\",\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"background_color\": \"#fff\",\n  \"description\": \"A Qwik project app.\"\n}\n"
  },
  {
    "path": "starters/apps/base/public/robots.txt",
    "content": ""
  },
  {
    "path": "starters/apps/base/qwik.env.d.ts",
    "content": "// This file can be used to add references for global types like `vite/client`.\n\n// Add global `vite/client` types. For more info, see: https://vitejs.dev/guide/features#client-types\n/// <reference types=\"vite/client\" />\n"
  },
  {
    "path": "starters/apps/base/src/entry.dev.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Development entry point using only client-side modules:\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nimport { render, type RenderOptions } from \"@builder.io/qwik\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/base/src/entry.preview.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the bundle entry point for `npm run preview`.\n * That is, serving your app built in production mode.\n *\n * Feel free to modify this file, but don't remove it!\n *\n * Learn more about Vite's preview command:\n * - https://vitejs.dev/config/preview-options.html#preview-options\n *\n */\nimport { createQwikCity } from \"@builder.io/qwik-city/middleware/node\";\nimport qwikCityPlan from \"@qwik-city-plan\";\n// make sure qwikCityPlan is imported before entry\nimport render from \"./entry.ssr\";\n\n/**\n * The default export is the QwikCity adapter used by Vite preview.\n */\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "starters/apps/base/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this\n * entry point will be the common one.\n *\n * - Server (express, cloudflare...)\n * - npm run start\n * - npm run preview\n * - npm run build\n *\n */\nimport {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    ...opts,\n    // Use container attributes to set attributes on the html tag.\n    containerAttributes: {\n      lang: \"en-us\",\n      ...opts.containerAttributes,\n    },\n    serverData: {\n      ...opts.serverData,\n    },\n  });\n}\n"
  },
  {
    "path": "starters/apps/base/src/global.css",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * Globally applied styles. No matter which components are in the page or matching route,\n * the styles in here will be applied to the Document, without any sort of CSS scoping.\n *\n */\nhtml {\n  -webkit-text-size-adjust: 100%;\n  -moz-tab-size: 4;\n  -o-tab-size: 4;\n  tab-size: 4;\n  font-family:\n    ui-sans-serif,\n    system-ui,\n    -apple-system,\n    BlinkMacSystemFont,\n    \"Segoe UI\",\n    Roboto,\n    \"Helvetica Neue\",\n    Arial,\n    \"Noto Sans\",\n    sans-serif,\n    \"Apple Color Emoji\",\n    \"Segoe UI Emoji\",\n    \"Segoe UI Symbol\",\n    \"Noto Color Emoji\";\n}\n\nbody {\n  padding: 0;\n  line-height: inherit;\n}\n"
  },
  {
    "path": "starters/apps/base/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2022\",\n    \"lib\": [\"es2022\", \"DOM\", \"WebWorker\", \"DOM.Iterable\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"outDir\": \"tmp\",\n    \"noEmit\": true,\n    \"paths\": {\n      \"~/*\": [\"./src/*\"]\n    },\n    /* if you do not use CSS modules, remove this line and delete the typescript-plugin-css-modules module from package.json */\n    \"plugins\": [{ \"name\": \"typescript-plugin-css-modules\" }]\n  },\n  \"include\": [\"src\", \"./*.d.ts\", \"./*.config.ts\"]\n}\n"
  },
  {
    "path": "starters/apps/base/vite.config.ts",
    "content": "/**\n * This is the base config for vite.\n * When building, the adapter config is used which loads this file and extends it.\n */\nimport { defineConfig, type UserConfig } from \"vite\";\nimport { qwikVite } from \"@builder.io/qwik/optimizer\";\nimport { qwikCity } from \"@builder.io/qwik-city/vite\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\nimport pkg from \"./package.json\";\n\ntype PkgDep = Record<string, string>;\nconst { dependencies = {}, devDependencies = {} } = pkg as any as {\n  dependencies: PkgDep;\n  devDependencies: PkgDep;\n  [key: string]: unknown;\n};\nerrorOnDuplicatesPkgDeps(devDependencies, dependencies);\n\n/**\n * Note that Vite normally starts from `index.html` but the qwikCity plugin makes start at `src/entry.ssr.tsx` instead.\n */\nexport default defineConfig(({ command, mode }): UserConfig => {\n  return {\n    plugins: [qwikCity(), qwikVite(), tsconfigPaths({ root: \".\" })],\n    // This tells Vite which dependencies to pre-build in dev mode.\n    optimizeDeps: {\n      // Put problematic deps that break bundling here, mostly those with binaries.\n      // For example ['better-sqlite3'] if you use that in server functions.\n      exclude: [],\n    },\n\n    /**\n     * This is an advanced setting. It improves the bundling of your server code. To use it, make sure you understand when your consumed packages are dependencies or dev dependencies. (otherwise things will break in production)\n     */\n    // ssr:\n    //   command === \"build\" && mode === \"production\"\n    //     ? {\n    //         // All dev dependencies should be bundled in the server build\n    //         noExternal: Object.keys(devDependencies),\n    //         // Anything marked as a dependency will not be bundled\n    //         // These should only be production binary deps (including deps of deps), CLI deps, and their module graph\n    //         // If a dep-of-dep needs to be external, add it here\n    //         // For example, if something uses `bcrypt` but you don't have it as a dep, you can write\n    //         // external: [...Object.keys(dependencies), 'bcrypt']\n    //         external: Object.keys(dependencies),\n    //       }\n    //     : undefined,\n\n    server: {\n      headers: {\n        // Don't cache the server response in dev mode\n        \"Cache-Control\": \"public, max-age=0\",\n      },\n    },\n    preview: {\n      headers: {\n        // Do cache the server response in preview (non-adapter production build)\n        \"Cache-Control\": \"public, max-age=600\",\n      },\n    },\n  };\n});\n\n// *** utils ***\n\n/**\n * Function to identify duplicate dependencies and throw an error\n * @param {Object} devDependencies - List of development dependencies\n * @param {Object} dependencies - List of production dependencies\n */\nfunction errorOnDuplicatesPkgDeps(\n  devDependencies: PkgDep,\n  dependencies: PkgDep,\n) {\n  let msg = \"\";\n  // Create an array 'duplicateDeps' by filtering devDependencies.\n  // If a dependency also exists in dependencies, it is considered a duplicate.\n  const duplicateDeps = Object.keys(devDependencies).filter(\n    (dep) => dependencies[dep],\n  );\n\n  // include any known qwik packages\n  const qwikPkg = Object.keys(dependencies).filter((value) =>\n    /qwik/i.test(value),\n  );\n\n  // any errors for missing \"qwik-city-plan\"\n  // [PLUGIN_ERROR]: Invalid module \"@qwik-city-plan\" is not a valid package\n  msg = `Move qwik packages ${qwikPkg.join(\", \")} to devDependencies`;\n\n  if (qwikPkg.length > 0) {\n    throw new Error(msg);\n  }\n\n  // Format the error message with the duplicates list.\n  // The `join` function is used to represent the elements of the 'duplicateDeps' array as a comma-separated string.\n  msg = `\n    Warning: The dependency \"${duplicateDeps.join(\", \")}\" is listed in both \"devDependencies\" and \"dependencies\".\n    Please move the duplicated dependencies to \"devDependencies\" only and remove it from \"dependencies\"\n  `;\n\n  // Throw an error with the constructed message.\n  if (duplicateDeps.length > 0) {\n    throw new Error(msg);\n  }\n}\n"
  },
  {
    "path": "starters/apps/e2e/package.json",
    "content": "{\n  \"description\": \"Qwik E2E\",\n  \"__qwik__\": {\n    \"priority\": 0,\n    \"featureOptions\": []\n  },\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/components/async/async.tsx",
    "content": "import { useStore, component$ } from \"@builder.io/qwik\";\n\nexport function delay(time: number) {\n  return new Promise<void>((resolve) => {\n    setTimeout(() => resolve(), time);\n  });\n}\n\nexport const Async = component$(() => {\n  const state = useStore({ name: \"World\", count: 0 });\n  async function stuff() {\n    await delay(10);\n    return (\n      <>\n        <button\n          class=\"border-2 border-solid border-blue-500\"\n          onClick$={() => {\n            state.count++;\n          }}\n        >\n          More\n        </button>\n      </>\n    );\n  }\n\n  return (\n    <div class=\"my-app p-20\">\n      {stuff()}\n      <Inner value={state.count} />\n    </div>\n  );\n});\n\n// This code will not work because its async before reading subs\nexport const Inner = component$((props: { value: number }) => {\n  async function resolve() {\n    await delay(1000);\n    return (\n      <>\n        <Inner2 value={props.value} />\n      </>\n    );\n  }\n  return (\n    <div class=\"my-app p-20\">\n      Inner: {props.value}\n      {resolve()}\n    </div>\n  );\n});\n\nexport const Inner2 = component$((props: { value: number }) => {\n  const value = props.value;\n  return <div class=\"my-app p-20\">Inner2: {delay(1000).then(() => value)}</div>;\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/attributes/attributes.tsx",
    "content": "import { component$, useSignal, useStore } from \"@builder.io/qwik\";\n\nexport const Attributes = component$(() => {\n  const render = useSignal(0);\n  return (\n    <>\n      <h1>Most of the changes happen in the input attributes</h1>\n      <button\n        id=\"force-rerender\"\n        data-v={render.value}\n        onClick$={() => render.value++}\n      >\n        Rerender\n      </button>\n      <AttributesChild v={render.value} key={render.value} />\n    </>\n  );\n});\n\nexport const AttributesChild = component$<{ v: number }>(({ v }) => {\n  const renders = useStore(\n    {\n      count: 0,\n    },\n    {\n      reactive: false,\n    },\n  );\n\n  const title = useSignal<string>();\n  const input = useSignal(\"\");\n  const hide = useSignal(false);\n  const required = useSignal(false);\n  const state = useStore({\n    dataAria: \"true\",\n    count: 0,\n    label: \"even\",\n    stuff: \"\",\n  });\n  renders.count++;\n  const rerenders = renders.count + 0;\n\n  state.stuff;\n  return (\n    <>\n      <div>\n        <button\n          id=\"hide\"\n          onClick$={() => {\n            hide.value = !hide.value;\n          }}\n        >\n          Toggle hide\n        </button>\n        <button\n          id=\"title\"\n          onClick$={() => {\n            title.value = title.value === undefined ? \"some title\" : undefined;\n          }}\n        >\n          Toggle title\n        </button>\n        <button\n          id=\"aria-hidden\"\n          onClick$={() => {\n            state.dataAria = state.dataAria === \"true\" ? \"false\" : \"true\";\n          }}\n        >\n          Toggle aria-hidden\n        </button>\n        <button\n          id=\"count\"\n          onClick$={() => {\n            state.count++;\n            if (state.count % 2 === 0) {\n              state.label = \"even\";\n            } else {\n              state.label = \"odd\";\n            }\n          }}\n        >\n          Count\n        </button>\n        <button\n          id=\"required\"\n          onClick$={() => {\n            required.value = !required.value;\n          }}\n        >\n          Toggle required\n        </button>\n        <button\n          id=\"stuff\"\n          onClick$={() => {\n            state.stuff += \"0\";\n          }}\n        >\n          Add stuff (caused render)\n        </button>\n      </div>\n      <div>\n        Renders: <span id=\"renders\">{rerenders}</span>\n      </div>\n      <div>\n        {hide.value ? (\n          <>\n            <label id=\"label\" />\n            <input id=\"input\" />\n            <svg id=\"svg\">\n              <feGaussianBlur></feGaussianBlur>\n              <foreignObject>\n                <foreignObject></foreignObject>\n                <div>Still outside svg</div>\n              </foreignObject>\n              <textPath></textPath>\n            </svg>\n          </>\n        ) : (\n          <>\n            <label\n              id=\"label\"\n              for={state.label}\n              form=\"my-form\"\n              title={title.value}\n            ></label>\n            <input\n              id=\"input\"\n              required={required.value}\n              aria-hidden={state.dataAria as any}\n              aria-label={state.label}\n              aria-required={required.value}\n              draggable={required.value}\n              spellcheck={required.value}\n              data-stuff={\"stuff: \" + state.stuff}\n              tabIndex={-1}\n              title={title.value}\n              onInput$={(ev, el) => {\n                input.value = el.value;\n              }}\n            />\n            <svg\n              id=\"svg\"\n              width=\"15\"\n              height=\"15\"\n              class=\"is-svg\"\n              preserveAspectRatio=\"xMidYMin slice\"\n              aria-hidden={state.dataAria as any}\n            >\n              <feGaussianBlur class=\"is-svg\"></feGaussianBlur>\n              <foreignObject class=\"is-svg\">\n                <foreignObject class=\"is-html\"></foreignObject>\n                <div class=\"is-html\">Still outside svg</div>\n              </foreignObject>\n              <textPath scale={0.1}></textPath>\n            </svg>\n          </>\n        )}\n      </div>\n      <div id=\"input-value\">{input.value}</div>\n      <input id=\"input-copy\" value={input.value} />\n      <Issue3622 />\n      <Issue4718Null />\n      <Issue4718Undefined />\n      <div id=\"renderCount\">Render {v}</div>\n    </>\n  );\n});\n\nexport const Issue3622 = component$(() => {\n  return (\n    <div>\n      <select id=\"issue-3622-result\" value=\"option1\">\n        <option value=\"option1\">Option 1</option>\n        <option value=\"option2\">Option 2</option>\n      </select>\n    </div>\n  );\n});\n\nexport const Issue4718Undefined = component$(() => {\n  const signal = useSignal<string | undefined>(\"some value\");\n\n  return (\n    <button\n      id=\"issue-4718-undefined-result\"\n      data-works={signal.value}\n      aria-label={signal.value}\n      title={signal.value}\n      class={!signal.value && \"moop\"}\n      onClick$={() => {\n        signal.value = undefined;\n      }}\n    >\n      Click Me\n    </button>\n  );\n});\n\nexport const Issue4718Null = component$(() => {\n  const signal = useSignal<string | null>(\"some value\");\n\n  return (\n    <button\n      id=\"issue-4718-null-result\"\n      data-works={signal.value as any}\n      aria-label={signal.value as any}\n      title={signal.value as any}\n      class={!signal.value && \"moop\"}\n      onClick$={() => {\n        signal.value = null;\n      }}\n    >\n      Click Me\n    </button>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/broadcast-events/broadcast-event.tsx",
    "content": "import {\n  component$,\n  useOnDocument,\n  useStore,\n  $,\n  useOnWindow,\n  useOn,\n} from \"@builder.io/qwik\";\n\nexport function useDocumentMouse() {\n  const mousePosition = useStore({ x: 0, y: 0, inside: \"false\" });\n  useOnDocument(\n    \"mousemove\",\n    $((event: Event) => {\n      mousePosition.x = (event as MouseEvent).clientX;\n      mousePosition.y = (event as MouseEvent).clientY;\n    }),\n  );\n  useOnDocument(\n    \"mouseenter\",\n    $(() => {\n      mousePosition.inside = \"true\";\n    }),\n  );\n  useOnDocument(\n    \"mouseleave\",\n    $(() => {\n      mousePosition.inside = \"false\";\n    }),\n  );\n  return mousePosition;\n}\n\nexport function useWindowMouse() {\n  const mousePosition = useStore({ x: 0, y: 0, inside: \"false\" });\n  useOnWindow(\n    \"mousemove\",\n    $((event: Event) => {\n      mousePosition.x = (event as MouseEvent).clientX;\n      mousePosition.y = (event as MouseEvent).clientY;\n    }),\n  );\n  useOnWindow(\n    \"mouseenter\",\n    $(() => {\n      mousePosition.inside = \"true\";\n    }),\n  );\n  useOnWindow(\n    \"mouseleave\",\n    $(() => {\n      mousePosition.inside = \"false\";\n    }),\n  );\n  return mousePosition;\n}\n\nexport function useSelfMouse() {\n  const mousePosition = useStore({ x: 0, y: 0, inside: \"false\" });\n  useOn(\n    \"mousemove\",\n    $((event: Event) => {\n      mousePosition.x = (event as MouseEvent).clientX;\n      mousePosition.y = (event as MouseEvent).clientY;\n    }),\n  );\n  useOn(\n    \"mouseenter\",\n    $(() => {\n      mousePosition.inside = \"true\";\n    }),\n  );\n  useOn(\n    \"mouseleave\",\n    $(() => {\n      mousePosition.inside = \"false\";\n    }),\n  );\n  return mousePosition;\n}\n\nexport const BroadcastEvents = component$(() => {\n  const state = useStore({\n    count: 0,\n  });\n  return (\n    <div>\n      <ul>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n        <li>1</li>\n      </ul>\n      <button\n        id=\"btn-toggle-render\"\n        type=\"button\"\n        onClick$={() => state.count++}\n      >\n        Rerender\n      </button>\n      <MouseEvents key={state.count} />\n    </div>\n  );\n});\n\nexport const MouseEvents = component$(() => {\n  const mouseDoc = useDocumentMouse();\n  const mouseWin = useWindowMouse();\n  const mouseSelf = useSelfMouse();\n\n  const mouseDoc2 = useStore({ x: 0, y: 0 });\n  const mouseWin2 = useStore({ x: 0, y: 0 });\n  const mouseSelf2 = useStore({ x: 0, y: 0 });\n\n  return (\n    <div\n      onMouseMove$={(event) => {\n        mouseSelf2.x = event.clientX;\n        mouseSelf2.y = event.clientY;\n      }}\n      window:onMouseMove$={(event) => {\n        mouseWin2.x = event.clientX;\n        mouseWin2.y = event.clientY;\n      }}\n      document:onMouseMove$={(event) => {\n        mouseDoc2.x = event.clientX;\n        mouseDoc2.y = event.clientY;\n      }}\n    >\n      <p class=\"document\">\n        (Document: x: {mouseDoc.x}, y: {mouseDoc.y})\n      </p>\n      <p class=\"document2\">\n        (Document2: x: {mouseDoc2.x}, y: {mouseDoc2.y})\n      </p>\n      <p class=\"window\">\n        (Window: x: {mouseWin.x}, y: {mouseWin.y})\n      </p>\n      <p class=\"window2\">\n        (Window2: x: {mouseWin2.x}, y: {mouseWin2.y})\n      </p>\n      <p class=\"self\">\n        (Host: x: {mouseSelf.x}, y: {mouseSelf.y}, inside: {mouseSelf.inside})\n      </p>\n      <p class=\"self2\">\n        (Host2: x: {mouseSelf2.x}, y: {mouseSelf2.y})\n      </p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/build-variables/build.tsx",
    "content": "import { component$, useSignal, useTask$ } from \"@builder.io/qwik\";\nimport { isBrowser, isServer } from \"@builder.io/qwik\";\nimport * as build from \"@builder.io/qwik\";\n\nexport const BuildVariables = component$(() => {\n  const json = useSignal(\"\");\n  const count = useSignal(0);\n\n  useTask$(({ track }) => {\n    track(() => count.value);\n    json.value = JSON.stringify({\n      isServer: isServer,\n      isBrowser: isBrowser,\n      isDev: build.isDev,\n      buildIsServer: build.isServer,\n      buildIsBrowser: build.isBrowser,\n      buildIsDev: build.isDev,\n      count: count.value,\n    });\n  });\n\n  return (\n    <>\n      <button id=\"build-variables-button\" onClick$={() => count.value++}>\n        Redo\n      </button>\n      <div id=\"build-variables-result\">{json.value}</div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/computed/computed.tsx",
    "content": "/* eslint-disable */\nimport {\n  component$,\n  useComputed$,\n  useSignal,\n  useTask$,\n} from \"@builder.io/qwik\";\n\nexport const ComputedRoot = component$(() => {\n  const rerender = useSignal(0);\n\n  return (\n    <div key={rerender.value}>\n      <button id=\"rerender\" onClick$={() => rerender.value++}>\n        Rerender\n      </button>\n      <ComputedBasic />\n      <Issue3482 />\n      <Issue3488 />\n      <Issue5738 />\n    </div>\n  );\n});\n\nexport const ComputedBasic = component$(() => {\n  const count = useSignal(0);\n  const double = useComputed$(() => count.value * 2);\n  const plus3 = useComputed$(() => double.value + 3);\n  const triple = useComputed$(() => plus3.value * 3);\n  const sum = useComputed$(() => double.value + plus3.value + triple.value);\n\n  console.log(\"here\");\n  return (\n    <div>\n      <div class=\"result\">count: {count.value}</div>\n      <div class=\"result\">double: {double.value}</div>\n      <div class=\"result\">plus3: {plus3.value}</div>\n      <div class=\"result\">triple: {triple.value}</div>\n      <div class=\"result\">sum: {sum.value + \"\"}</div>\n      <button id=\"increment\" onClick$={() => count.value++}>\n        Increment\n      </button>\n    </div>\n  );\n});\n\nexport const Issue3482 = component$((props) => {\n  const count = useSignal(0);\n\n  const attributes = useComputed$(() => {\n    return {\n      \"data-nu\": String(count.value),\n      class: `class-${count.value}`,\n    };\n  });\n\n  return (\n    <>\n      <button id=\"issue-3482-button\" onClick$={() => count.value++}>\n        Increment\n      </button>\n      <div id=\"issue-3482-div\" {...attributes.value}>\n        Div\n      </div>\n      <TextContent {...attributes.value}></TextContent>\n    </>\n  );\n});\n\nexport const TextContent = component$(\n  (props: { \"data-nu\"?: string; class?: string }) => {\n    return (\n      <div>\n        <div id=\"issue-3482-datanu\">data-nu: {props[\"data-nu\"]}</div>\n        <div id=\"issue-3482-class\">class: {props.class}</div>\n      </div>\n    );\n  },\n);\n\nexport const Issue3488 = component$(() => {\n  const count = useSignal(0);\n\n  const data = useComputed$(() => {\n    return {\n      class: `class-${count.value}`,\n    };\n  });\n\n  return (\n    <>\n      <button id=\"issue-3488-button\" onClick$={() => count.value++}>\n        Increment\n      </button>\n      <div id=\"issue-3488-result\">{data.value.class}</div>\n    </>\n  );\n});\n\nexport const Issue5738 = component$(() => {\n  const foo = useSignal(0);\n  const comp = useComputed$(() => {\n    return foo.value * 2;\n  });\n  useTask$(() => {\n    foo.value = 1;\n  });\n  return <div id=\"issue-5738-result\">Calc: {comp.value}</div>;\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/containers/container.tsx",
    "content": "import {\n  component$,\n  useStyles$,\n  useResource$,\n  Resource,\n  useSignal,\n} from \"@builder.io/qwik\";\n\ninterface ContainerProps {\n  url: string;\n}\n\nexport const Containers = component$(() => {\n  const signal = useSignal(0);\n  return (\n    <div>\n      <button onClick$={() => signal.value++}>{signal.value}</button>\n      <Container url=\"/e2e/two-listeners\"></Container>\n    </div>\n  );\n});\n\nexport const Container = component$((props: ContainerProps) => {\n  useStyles$(`\n    .container {\n      margin: 20px;\n      padding: 5px;\n      border: 1px solid black;\n      border-radius: 10px;\n    }\n    .frame {\n      padding: 5px;\n      border: 1px solid grey;\n      border-radius: 5px;\n    }\n    .url {\n      background: #d1d1d1;\n      border-radius: 10px;\n      padding: 5px 10px;\n      margin-bottom: 10px;\n    }\n    `);\n\n  const resource = useResource$<{ url: string; html: string }>(\n    async ({ track }) => {\n      track(() => props.url);\n      const url = `http://localhost:${(globalThis as any).PORT}${\n        props.url\n      }?fragment&loader=false`;\n      const res = await fetch(url);\n      return {\n        url,\n        html: await res.text(),\n      };\n    },\n  );\n\n  return (\n    <div>\n      <div class=\"inline-container\">\n        <Resource\n          value={resource}\n          onResolved={({ url, html }) => {\n            return (\n              <>\n                <div class=\"url\">{url}</div>\n                <div class=\"frame\" dangerouslySetInnerHTML={html} />\n              </>\n            );\n          }}\n        />\n      </div>\n      <div style={{ border: \"1px solid red\" }}>\n        Shadow DOM\n        <div q:shadowRoot>\n          <template shadowRootMode=\"open\">\n            <Resource\n              value={resource}\n              onResolved={({ url, html }) => {\n                return (\n                  <>\n                    <div class=\"url\">{url}</div>\n                    <div class=\"frame\" dangerouslySetInnerHTML={html} />\n                  </>\n                );\n              }}\n            />\n          </template>\n        </div>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/context/context.tsx",
    "content": "import {\n  useStore,\n  component$,\n  createContextId,\n  useContextProvider,\n  useContext,\n  Slot,\n  useSignal,\n  useVisibleTask$,\n} from \"@builder.io/qwik\";\n\nexport interface ContextI {\n  displayName: string;\n  count: number;\n}\n\nexport const Context1 = createContextId<ContextI>(\"ctx\");\nexport const Context2 = createContextId<ContextI>(\"ctx1\");\nexport const Context3 = createContextId<ContextI>(\"ctx2\");\nexport const ContextSlot = createContextId<ContextI>(\"slot\");\nexport const Unset = createContextId<ContextI>(\"unset\");\nexport const ContextString = createContextId<string>(\"ctx-string\");\n\nexport const ContextRoot = component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      <button id=\"btn-rerender\" onClick$={() => count.value++}>\n        Client Rerender\n      </button>\n      <ContextApp key={count.value} />\n    </div>\n  );\n});\n\nexport const ContextApp = component$(() => {\n  const state1 = useStore({ displayName: \"ROOT / state1\", count: 0 });\n  const state2 = useStore({ displayName: \"ROOT / state2\", count: 0 });\n\n  useContextProvider(Context1, state1);\n  useContextProvider(Context2, state2);\n\n  return (\n    <div>\n      <button class=\"root-increment1\" onClick$={() => state1.count++}>\n        Increment State 1\n      </button>\n      <button class=\"root-increment2\" onClick$={() => state2.count++}>\n        Increment State 2\n      </button>\n\n      <ContextFromSlot>\n        <Level2 />\n        <Level2 />\n      </ContextFromSlot>\n\n      <Issue1971 />\n      <Issue2087 />\n      <Issue2894 />\n      <Issue5356 />\n      <Issue5793 />\n    </div>\n  );\n});\n\nexport const ContextFromSlot = component$(() => {\n  const store = useStore({\n    displayName: \"bar\",\n    count: 0,\n  });\n  useContextProvider(ContextSlot, store);\n  return <Slot />;\n});\n\n// This code will not work because its async before reading subs\nexport const Level2 = component$(() => {\n  const level2State1 = useStore({ displayName: \"Level2 / state1\", count: 0 });\n  // read context1 before changing it\n  const state1 = useContext(Context1);\n  // change context1\n  useContextProvider(Context1, level2State1);\n\n  const state3 = useStore({ displayName: \"Level2 / state3\", count: 0 });\n  useContextProvider(Context3, state3);\n\n  const state2 = useContext(Context2);\n  const stateSlot = useContext(ContextSlot);\n\n  return (\n    <div>\n      <h1>Level2</h1>\n      <div class=\"level2-state1\">\n        {state1.displayName} = {state1.count}\n      </div>\n      <div class=\"level2-state2\">\n        {state2.displayName} = {state2.count}\n      </div>\n      <div class=\"level2-slot\">\n        {stateSlot.displayName} = {stateSlot.count}\n      </div>\n\n      <button class=\"level2-increment3\" onClick$={() => state3.count++}>\n        Increment\n      </button>\n\n      {Array.from({ length: state3.count }, () => {\n        return <Level3></Level3>;\n      })}\n    </div>\n  );\n});\n\nexport const Level3 = component$(() => {\n  const state1 = useContext(Context1);\n  const state2 = useContext(Context2);\n  const state3 = useContext(Context3);\n  const stateSlot = useContext(ContextSlot);\n\n  if (useContext(Unset, null) !== null) {\n    throw new Error(\"ERROR\");\n  }\n\n  return (\n    <div>\n      <h2>Level3</h2>\n      <div class=\"level3-state1\">\n        {state1.displayName} = {state1.count}\n      </div>\n      <div class=\"level3-state2\">\n        {state2.displayName} = {state2.count}\n      </div>\n      <div class=\"level3-state3\">\n        {state3.displayName} = {state3.count}\n      </div>\n      <div class=\"level3-slot\">\n        {stateSlot.displayName} = {stateSlot.count}\n      </div>\n    </div>\n  );\n});\n\nexport const Issue1971 = component$(() => {\n  return (\n    <Issue1971Provider>\n      <Issue1971Child />\n    </Issue1971Provider>\n  );\n});\n\nexport const Issue1971Context = createContextId<any>(\"issue-1971\");\n\nexport const Issue1971Provider = component$(() => {\n  useContextProvider(Issue1971Context, {\n    value: \"hello!\",\n  });\n\n  return <Slot></Slot>;\n});\n\nexport const Issue1971Child = component$(() => {\n  const show = useSignal(false);\n  useVisibleTask$(() => {\n    show.value = true;\n  });\n  return (\n    <>\n      <div>Test 1: {show.value && <Issue1971Consumer />}</div>\n    </>\n  );\n});\n\nexport const Issue1971Consumer = component$(() => {\n  const ctx = useContext(Issue1971Context);\n  return <div id=\"issue1971-value\">Value: {ctx.value}</div>;\n});\n\nexport const Ctx = createContextId<{ t: string }>(\"issue-2087\");\n\nexport const Issue2087 = component$(() => {\n  return (\n    <>\n      <Issue2087_Root />\n      <Issue2087_Nested />\n    </>\n  );\n});\n\nexport const Issue2087_Root = component$(() => {\n  const t = useSignal(0);\n  return (\n    <Provider>\n      <Symbol id=\"RootA\" />\n      <button id=\"issue2087_btn1\" onClick$={() => t.value++}>\n        Click me\n      </button>\n      {!!t.value && <Symbol id=\"RootB\" />}\n    </Provider>\n  );\n});\n\nexport const Issue2087_Nested = component$(() => {\n  const t = useSignal(0);\n  return (\n    <Provider>\n      <Symbol id=\"NestedA\" />\n      <button id=\"issue2087_btn2\" onClick$={() => t.value++}>\n        Click me\n      </button>\n      <div>{!!t.value && <Symbol id=\"NestedB\" />}</div>\n    </Provider>\n  );\n});\n\nexport const Symbol = component$(({ id }: any) => {\n  const s = useContext(Ctx);\n  return (\n    <p id={`issue2087_symbol_${id}`}>\n      Symbol {id}, context value: {s.t}\n    </p>\n  );\n});\n\nexport const Provider = component$(() => {\n  const s = useStore({ t: \"yes\" });\n  useContextProvider(Ctx, s);\n  return <Slot />;\n});\n\nexport const CTX_2894 = createContextId<{ foo: string }>(\"issue-2894\");\nexport const Issue2894 = component$(() => {\n  useContextProvider(CTX_2894, { foo: \"bar\" });\n  return (\n    <>\n      <Issue2894_Projector>\n        <Issue2894_Consumer />\n      </Issue2894_Projector>\n    </>\n  );\n});\n\nexport const Issue2894_Projector = component$(() => {\n  const signal = useSignal(false);\n  if (!signal.value) {\n    return (\n      <>\n        <button id=\"issue2894-button\" onClick$={() => (signal.value = true)}>\n          Toggle visibility\n        </button>\n      </>\n    );\n  }\n  return (\n    <>\n      <Slot />\n    </>\n  );\n});\n\nexport const Issue2894_Consumer = component$(() => {\n  const ctx = useContext(CTX_2894);\n  return <div id=\"issue2894-value\">Value: {ctx.foo}</div>;\n});\n\nexport const Issue5356Context = createContextId<object>(\"issue-5356\");\nexport const Issue5356 = component$(() => {\n  useContextProvider(Issue5356Context, {});\n\n  return <Issue5356_Parent />;\n});\n\nexport const Issue5356_Parent = component$(() => {\n  const signal = useSignal(1);\n\n  const children = [1, 2];\n\n  return (\n    <div id=\"issue-5356\">\n      <button id=\"issue5356-button-1\" onClick$={() => (signal.value = 1)}>\n        1\n      </button>\n      <button id=\"issue5356-button-2\" onClick$={() => (signal.value = 2)}>\n        2\n      </button>\n\n      <>\n        {children.map((value) => (\n          <Issue5356_Child\n            key={value}\n            value={value}\n            active={signal.value === value}\n          />\n        ))}\n      </>\n      <>\n        {[\n          <Issue5356_Child value={3} active={signal.value === 1} />,\n          <Issue5356_Child value={4} active={signal.value === 2} />,\n        ]}\n      </>\n    </div>\n  );\n});\n\nexport const Issue5356_Child = component$<{ value: number; active: boolean }>(\n  (props) => {\n    useContext(Issue5356Context);\n\n    return (\n      <div id={`issue5356-child-${props.value}`}>\n        Child {props.value}, active: {props.active ? \"true\" : \"false\"}\n      </div>\n    );\n  },\n);\n\nexport const Issue5793 = component$(() => {\n  useContextProvider(ContextString, \"yes\");\n  return <Issue5793_Child />;\n});\n\nexport const Issue5793_Child = component$(() => {\n  const s = useContext(ContextString);\n  return <div id=\"issue5793-value\">{s}</div>;\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/effect-client/effect-client.tsx",
    "content": "/* eslint-disable */\nimport {\n  component$,\n  createContextId,\n  Slot,\n  useComputed$,\n  useContext,\n  useContextProvider,\n  useSignal,\n  useStore,\n  useStyles$,\n  useTask$,\n  useVisibleTask$,\n  type Signal,\n} from \"@builder.io/qwik\";\nimport { delay } from \"../streaming/streaming\";\n\nexport const EffectClient = component$(() => {\n  useStyles$(`.box {\n    background: blue;\n    width: 100px;\n    height: 100px;\n    margin: 10px;\n  }`);\n  console.log(\"<EffectClient> renders\");\n  return (\n    <div>\n      <Issue1413 />\n      <Issue1717 />\n      <Issue2015 />\n      <Issue1955 />\n      <CleanupEffects />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n      <div class=\"box\" />\n\n      <Timer />\n      <Eager></Eager>\n      <Issue4432 />\n    </div>\n  );\n});\n\nexport const Timer = component$(() => {\n  console.log(\"<Timer> renders\");\n\n  const container = useSignal<Element>();\n  const state = useStore({\n    count: 0,\n    msg: \"empty\",\n  });\n\n  // Double count watch\n  useVisibleTask$(() => {\n    state.msg = \"run\";\n    container.value!.setAttribute(\"data-effect\", \"true\");\n  });\n\n  // Double count watch\n  useVisibleTask$(() => {\n    state.count = 10;\n    const timer = setTimeout(() => {\n      state.count++;\n    }, 500);\n    return () => {\n      clearTimeout(timer);\n    };\n  });\n\n  return (\n    <div id=\"container\" ref={container}>\n      <div id=\"counter\">{state.count}</div>\n      <div id=\"msg\">{state.msg}</div>\n    </div>\n  );\n});\n\nexport const Eager = component$(() => {\n  console.log(\"<Timer> renders\");\n\n  const state = useStore({\n    msg: \"empty 0\",\n  });\n\n  // Double count watch\n  useVisibleTask$(\n    () => {\n      state.msg = \"run\";\n    },\n    {\n      strategy: \"document-ready\",\n    },\n  );\n\n  return (\n    <div>\n      <div id=\"eager-msg\">{state.msg}</div>\n      <ClientSide key={state.msg} />\n    </div>\n  );\n});\n\nexport const ClientSide = component$(() => {\n  console.log(\"<Timer> renders\");\n\n  const state = useStore({\n    text1: \"empty 1\",\n    text2: \"empty 2\",\n    text3: \"empty 3\",\n  });\n\n  useVisibleTask$(\n    () => {\n      state.text1 = \"run\";\n    },\n    {\n      strategy: \"document-ready\",\n    },\n  );\n\n  useVisibleTask$(() => {\n    state.text2 = \"run\";\n  });\n\n  useVisibleTask$(\n    () => {\n      state.text3 = \"run\";\n    },\n    {\n      strategy: \"document-idle\",\n    },\n  );\n\n  return (\n    <>\n      <div id=\"client-side-msg-1\">{state.text1}</div>\n      <div id=\"client-side-msg-2\">{state.text2}</div>\n      <div id=\"client-side-msg-3\">{state.text3}</div>\n    </>\n  );\n});\n\nexport const FancyName = component$(() => {\n  console.log(\"Fancy Name\");\n  useVisibleTask$(() => {\n    console.log(\"Client effect fancy name\");\n  });\n  return <Slot />;\n});\n\nexport const fancyName = \"Some\";\n\nexport const Issue1413 = component$(() => {\n  useVisibleTask$(() => {\n    console.log(fancyName);\n  });\n  console.log(\"Root route\");\n  return (\n    <FancyName>\n      <section>\n        <div>Hello</div>\n      </section>\n    </FancyName>\n  );\n});\n\nexport function useDelay(value: string) {\n  const ready = useSignal(\"---\");\n  useVisibleTask$(() => {\n    ready.value = value;\n  });\n  return ready;\n}\n\nexport const Issue1717 = component$(() => {\n  const val1 = useDelay(\"value 1\");\n  const val2 = useDelay(\"value 2\");\n  const renders = useStore(\n    {\n      count: 0,\n    },\n    { reactive: false },\n  );\n  const signal = useSignal(0);\n  useTask$(async () => {\n    await delay(500);\n    signal.value = 10;\n  });\n  renders.count++;\n  return (\n    <>\n      <div id=\"issue-1717-meta\">\n        Sub: {signal.value + \"\"} Renders: {renders.count}\n      </div>\n      <div id=\"issue-1717-value1\">{val1.value}</div>\n      <div id=\"issue-1717-value2\">{val2.value}</div>\n    </>\n  );\n});\n\nexport const Issue2015 = component$(() => {\n  const state = useStore({\n    logs: [] as string[],\n  });\n\n  useVisibleTask$(async () => {\n    state.logs.push(\"start 1\");\n    await delay(100);\n    state.logs.push(\"finish 1\");\n  });\n\n  useVisibleTask$(async () => {\n    state.logs.push(\"start 2\");\n    await delay(100);\n    state.logs.push(\"finish 2\");\n  });\n\n  useVisibleTask$(async () => {\n    state.logs.push(\"start 3\");\n    await delay(100);\n    state.logs.push(\"finish 3\");\n    state.logs = state.logs.slice();\n  });\n\n  return <div id=\"issue-2015-order\">Order: {state.logs.join(\" \")}</div>;\n});\n\nexport const Issue1955Helper = component$(() => {\n  return (\n    <div id=\"issue-1955-results\">\n      <Slot />\n    </div>\n  );\n});\n\nexport const Issue1955 = component$(() => {\n  const signal = useSignal(\"empty\");\n  useVisibleTask$(() => {\n    signal.value = \"run\";\n  });\n  return <Issue1955Helper>{signal.value + \"\"}</Issue1955Helper>;\n});\n\nexport const CleanupEffects = component$(() => {\n  const nuCleanups = useSignal(0);\n  const counter = useSignal(0);\n\n  return (\n    <>\n      <CleanupEffectsChild nuCleanups={nuCleanups} key={counter.value} />\n      <button id=\"cleanup-effects-button\" onClick$={() => counter.value++}>\n        Add\n      </button>\n      <div id=\"cleanup-effects-count\">{nuCleanups.value + \"\"}</div>\n    </>\n  );\n});\n\nexport const CleanupEffectsChild = component$(\n  (props: { nuCleanups: Signal<number> }) => {\n    useVisibleTask$(({ cleanup }) => {\n      cleanup(() => {\n        props.nuCleanups.value++;\n      });\n    });\n    return <div>Hello</div>;\n  },\n);\n\nconst ContextIssue4432 = createContextId<{ url: URL; logs: string }>(\n  \"issue-4432\",\n);\n\nexport const Issue4432 = component$(() => {\n  const loc = useStore({\n    url: new URL(\"http://localhost:3000/\"),\n    logs: \"\",\n  });\n  useContextProvider(ContextIssue4432, loc);\n\n  return (\n    <>\n      <button\n        id=\"issue-4432-button\"\n        onClick$={() => (loc.url = new URL(\"http://localhost:3000/other\"))}\n      >\n        Change\n      </button>\n      <pre id=\"issue-4432-logs\">{loc.logs}</pre>\n      {loc.url.pathname === \"/\" && <Issue4432Child />}\n    </>\n  );\n});\n\nexport const Issue4432Child = component$(() => {\n  const state = useContext(ContextIssue4432);\n\n  const pathname = useComputed$(() => state.url.pathname);\n\n  useVisibleTask$(\n    ({ track, cleanup }) => {\n      track(() => pathname.value);\n\n      // This should only run on page load for path '/'\n      state.logs += `VisibleTask ChildA ${pathname.value}\\n`;\n\n      // This should only run when leaving the page\n      cleanup(() => {\n        state.logs += `Cleanup ChildA ${pathname.value}\\n`;\n      });\n    },\n    {\n      strategy: \"document-ready\",\n    },\n  );\n\n  return (\n    <>\n      <p>Child A</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/events/events-client.tsx",
    "content": "import { component$, useSignal, $ } from \"@builder.io/qwik\";\n\nexport const EventsClient = component$(() => {\n  const enabled = useSignal(false);\n  const input = useSignal(\"\");\n\n  return (\n    <div>\n      <p>\n        <a id=\"link\" href=\"/\" preventdefault:click>\n          Should not navigate\n        </a>\n        <input\n          id=\"input\"\n          onInput$={\n            enabled.value\n              ? $((ev, el) => {\n                  input.value = el.value;\n                })\n              : undefined\n          }\n          onFocus$={() => {\n            enabled.value = true;\n          }}\n        />\n\n        {enabled.value && <EventChildren input={input.value}></EventChildren>}\n      </p>\n    </div>\n  );\n});\n\nexport const EventChildren = component$((props: { input: string }) => {\n  const isOver = useSignal(false);\n  return (\n    <div\n      id=\"div\"\n      class={{ isOver: isOver.value }}\n      onClick$={undefined}\n      onMouseOver$={() => {\n        isOver.value = true;\n      }}\n    >\n      Text: {props.input}\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/events/events.tsx",
    "content": "import {\n  component$,\n  useStore,\n  type QRL,\n  useSignal,\n  useOnWindow,\n  $,\n} from \"@builder.io/qwik\";\n\nexport const Events = component$(() => {\n  const store = useStore({\n    countTransparent: 0,\n    countWrapped: 0,\n    countAnchor: 0,\n    propagationStoppedCount: 0,\n  });\n\n  return (\n    <div>\n      <Buttons\n        onTransparentClick$={async () => {\n          store.countTransparent++;\n        }}\n        onWrappedClick$={async () => {\n          store.countWrapped++;\n        }}\n      ></Buttons>\n      <p>\n        <a href=\"/\" preventdefault:click id=\"prevent-default-1\">\n          Should prevent default\n        </a>\n      </p>\n      <div>\n        <div\n          onClick$={() => {\n            throw new Error(\"event was not stopped\");\n          }}\n        >\n          <a\n            href=\"/\"\n            preventdefault:click\n            id=\"prevent-default-2\"\n            onClick$={(ev) => {\n              ev.stopPropagation();\n              store.countAnchor++;\n            }}\n          >\n            Should count\n          </a>\n        </div>\n        <div\n          onClick$={() => {\n            store.propagationStoppedCount++;\n            throw new Error(\"event was not stopped\");\n          }}\n        >\n          <button\n            stoppropagation:click\n            id=\"stop-propagation\"\n            onClick$={(ev) => {\n              store.propagationStoppedCount++;\n            }}\n          >\n            Should stop propagation{\" \"}\n          </button>\n        </div>\n      </div>\n      <p id=\"count-transparent\">countTransparent: {store.countTransparent}</p>\n      <p id=\"count-wrapped\">countWrapped: {store.countWrapped}</p>\n      <p id=\"count-anchor\">countAnchor: {store.countAnchor}</p>\n      <p id=\"count-propagation\">\n        countPropagationStopped: {store.propagationStoppedCount}\n      </p>\n      <Issue3948 />\n    </div>\n  );\n});\n\ninterface ButtonProps {\n  onTransparentClick$?: QRL<(ev: Event) => any>;\n  onWrappedClick$?: QRL<(nu: number) => void>;\n}\n\nexport const Buttons = component$((props: ButtonProps) => {\n  const store = useStore({ count: 0 });\n  return (\n    <div>\n      <span>some</span>\n      <button id=\"btn-transparent\" onClick$={props.onTransparentClick$ as any}>\n        Transparent\n      </button>\n      <button\n        id=\"btn-wrapped\"\n        onClick$={async () => {\n          store.count++;\n          await props.onWrappedClick$?.(store.count);\n        }}\n      >\n        Wrapped {store.count}\n      </button>\n    </div>\n  );\n});\n\nexport const Listener = component$((props: { name: string }) => {\n  const count = useSignal(0);\n\n  useOnWindow(\n    \"click\",\n    $(() => {\n      count.value++;\n    }),\n  );\n\n  return (\n    <p id={`issue-3948-${props.name}`}>\n      {props.name} count: {count.value}\n    </p>\n  );\n});\n\nexport const Issue3948 = component$(() => {\n  const showingToggle = useSignal(false);\n\n  return (\n    <>\n      <Listener name=\"always\" />\n      <label for=\"toggle\">\n        <input\n          id=\"issue-3948-toggle\"\n          type=\"checkbox\"\n          bind:checked={showingToggle}\n        />{\" \"}\n        Show conditional\n      </label>\n      {showingToggle.value && <Listener name=\"conditional\" />}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/factory/factory.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { factory$ } from \"./utils\";\n\nexport const A = factory$(() => {\n  return <div>A</div>;\n});\n\nexport const B = factory$(() => {\n  return <div>B</div>;\n});\n\nexport function Light(props: { prop: string }) {\n  return <div>Light: {props.prop}</div>;\n}\n\nexport const C = factory$(Light);\n\nexport const Factory = component$(() => {\n  return (\n    <div>\n      <A />\n      <B />\n      <C prop=\"wow!\" />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/factory/utils.tsx",
    "content": "import { component$, implicit$FirstArg, type QRL } from \"@builder.io/qwik\";\n\nexport function factoryQrl<P extends Record<string, any>>(\n  componentQRL: QRL<(props: P) => any>,\n) {\n  return component$((props: P) => {\n    const component = componentQRL.resolve();\n    return (\n      <div>\n        {component.then((Cmp) => (\n          <Cmp {...props} />\n        ))}\n      </div>\n    );\n  });\n}\nexport const factory$ = implicit$FirstArg(factoryQrl);\n"
  },
  {
    "path": "starters/apps/e2e/src/components/lexical-scope/lexicalScope.tsx",
    "content": "import {\n  component$,\n  $,\n  useStore,\n  noSerialize,\n  useSignal,\n  type Signal,\n} from \"@builder.io/qwik\";\n\nexport const LexicalScope = component$(() => {\n  const signal = useSignal(0);\n  const store = useStore({\n    count: 0,\n    signal,\n  });\n  return (\n    <LexicalScopeChild\n      message={\"mutable message\"}\n      message2={null}\n      signal={signal}\n      signalValue={signal.value}\n      store={store}\n      storeCount={store.count}\n      storeSignal={store.signal}\n    />\n  );\n});\n\ninterface LexicalScopeProps {\n  message: string;\n  message2: string | null;\n  signal: Signal;\n  signalValue: number;\n  store: Record<string, any>;\n  storeCount: number;\n  storeSignal: Signal;\n}\n\nexport const LexicalScopeChild = component$((props: LexicalScopeProps) => {\n  const immutable = useStore(\n    {\n      stuff: \"foo\",\n    },\n    {\n      deep: true,\n    },\n  );\n  Object.freeze(immutable);\n  const state = useStore({\n    count: 0,\n    result: \"\",\n  });\n  const a = 1;\n  const b = \"</script>\";\n  const promise = Promise.resolve(\"from a promise\");\n  const rejected = Promise.reject(new Error(\"failed message\"));\n  rejected.catch(() => null);\n\n  const formData = new FormData();\n  formData.append(\"name\", \"qwik\");\n  formData.append(\"age\", \"1\");\n  formData.append(\"age\", \"2\");\n\n  const specialStrings = [\n    \"\\b: backspace\",\n    \"\\f: form feed\",\n    \"\\n: line feed\",\n    \"\\r: carriage return\",\n    \"\\t: horizontal tab\",\n    \"\\v: vertical tab\",\n    \"\\0: null character\",\n    \"': single quote\",\n    \"\\\\: backslash\",\n  ];\n  const c = {\n    a: { thing: 12 },\n    b: \"hola\",\n    c: 123,\n    d: false,\n    e: true,\n    f: null,\n    g: undefined,\n    h: [1, \"string\", false, { hola: 1 }, [\"hello\"]],\n    i: noSerialize(() => console.warn()),\n    promise,\n  };\n  const propsCopy = {\n    signal: props.signal,\n    signalValue: props.signalValue,\n    store: props.store,\n    storeCount: props.storeCount,\n    storeSignal: props.storeSignal,\n  };\n  const d = undefined;\n  const e = null;\n  const g = true;\n  const h = false;\n  const i = noSerialize(() => console.error());\n  const f = [1, 2, \"hola\", i, {}];\n  const url = new URL(\"http://qwik.builder.com/docs?query=true\");\n  const date = new Date(\"2022-07-26T17:40:30.255Z\");\n  const regex = /hola()\\//gi;\n  const nullPrototype = Object.create(null);\n  nullPrototype.value = 12;\n  const infinite = Infinity;\n  const negativeInfinite = -Infinity;\n  const nan = NaN;\n  const urlSearchParams = new URLSearchParams(\"mph=88\");\n  const bigint = BigInt(\"200000000000000000\");\n\n  const set = new Set([\"hola\", 12, { a: date }]);\n  const map = new Map<any, any>([\n    [formData, set],\n    [\"mapkey\", url],\n  ]);\n\n  const onclick = $(async () => {\n    // eslint-disable-next-line\n    console.assert(infinite === Infinity);\n    // eslint-disable-next-line\n    console.assert(negativeInfinite === -Infinity);\n    // eslint-disable-next-line\n    console.assert(isNaN(nan));\n\n    rejected.catch((reason) => {\n      promise.then((promiseValue) => {\n        state.result = JSON.stringify([\n          a,\n          b,\n          c,\n          String(d),\n          String(e),\n          f,\n          g,\n          h,\n          i,\n          props.message,\n          props.message2,\n          props.signal,\n          props.signalValue,\n          props.store,\n          props.storeCount,\n          props.storeSignal,\n          promiseValue,\n          url.href,\n          date.toISOString(),\n          `${regex.source} ${regex.flags}`,\n          nullPrototype.value,\n          reason.message,\n          specialStrings,\n          String(infinite),\n          String(negativeInfinite),\n          String(nan),\n          urlSearchParams.get(\"mph\"),\n          formData.get(\"name\"),\n          formData.getAll(\"age\"),\n          String(bigint),\n          JSON.stringify([...set.keys()]),\n          JSON.stringify([...map.entries()]),\n        ]);\n        state.count++;\n      });\n    });\n  });\n\n  return (\n    <section>\n      <div id=\"static\">\n        <p>{JSON.stringify(a)}</p>\n        <p>{JSON.stringify(b)}</p>\n        <p>{JSON.stringify(c)}</p>\n        <p>{String(d)}</p>\n        <p>{String(e)}</p>\n        <p>{JSON.stringify(f)}</p>\n        <p>{JSON.stringify(g)}</p>\n        <p>{JSON.stringify(h)}</p>\n        <p>{String(i)}</p>\n        <p>{props.message}</p>\n        <p>{JSON.stringify(propsCopy)}</p>\n        <p>{promise}</p>\n        <p>{Object.keys(props).join(\", \")}</p>\n      </div>\n      <button onClick$={onclick} id=\"rerender\">\n        Rerender {state.count}\n      </button>\n      <div id=\"result\">{\"\" + state.result}</div>\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/mount/mount.tsx",
    "content": "import { component$, useStore, useTask$ } from \"@builder.io/qwik\";\nimport { delay } from \"../async/async\";\nimport { isServer } from \"@builder.io/qwik\";\n\nexport const MountRoot = component$(() => {\n  const internal = useStore(\n    {\n      renders: 0,\n    },\n    {\n      reactive: false,\n    },\n  );\n  const store = useStore({\n    logs: \"\",\n  });\n  useTask$(async () => {\n    if (isServer) {\n      store.logs += \"BEFORE useServerMount1()\\n\";\n      await delay(100);\n      store.logs += \"AFTER useServerMount1()\\n\";\n    }\n  });\n\n  useTask$(async () => {\n    store.logs += \"BEFORE useMount2()\\n\";\n    await delay(50);\n    store.logs += \"AFTER useMount2()\\n\";\n  });\n\n  useTask$(async () => {\n    store.logs += \"BEFORE useWatch3()\\n\";\n    await delay(20);\n    store.logs += \"AFTER useWatch3()\\n\";\n  });\n\n  useTask$(async () => {\n    if (isServer) {\n      store.logs += \"BEFORE useServerMount4()\\n\";\n      await delay(10);\n      store.logs += \"AFTER useServerMount4()\\n\";\n    }\n  });\n\n  internal.renders++;\n\n  return (\n    <>\n      <button\n        onClick$={() => {\n          store.logs += \"Click\\n\";\n        }}\n      >\n        Rerender\n      </button>\n      <pre id=\"renders\">Renders: {internal.renders}</pre>\n      <pre id=\"logs\">{store.logs + \"\"}</pre>\n    </>\n  );\n});\n\nexport const Child = component$((props: { counter: { count: number } }) => {\n  return <>Rerender {props.counter.count}</>;\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/no-resume/no-resume.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport const NoResume = component$(() => {\n  return (\n    <button\n      onClick$={() => {\n        document.body.style.background = \"black\";\n      }}\n    >\n      Click me\n    </button>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/ref/ref.tsx",
    "content": "import {\n  component$,\n  useStore,\n  useVisibleTask$,\n  useSignal,\n  type PropsOf,\n} from \"@builder.io/qwik\";\n\nexport const RefRoot = component$(() => {\n  const state = useStore({\n    visible: false,\n  });\n  useVisibleTask$(() => {\n    state.visible = true;\n  });\n\n  return (\n    <>\n      <div>\n        <Ref id=\"static\" key={\"1\"}></Ref>\n        {state.visible && <Ref id=\"dynamic\" key={\"2\"}></Ref>}\n\n        <Ref2 id=\"static-2\" key={11}></Ref2>\n        {state.visible && <Ref2 id=\"dynamic-2\" key={\"22\"}></Ref2>}\n\n        <Ref3 id=\"static-3\" key={111}></Ref3>\n        {state.visible && <Ref3 id=\"dynamic-3\" key={\"33\"}></Ref3>}\n      </div>\n    </>\n  );\n});\n\nexport const Ref = component$((props: { id: string }) => {\n  const ref = useSignal<Element>();\n  useVisibleTask$(({ track }) => {\n    const el = track(() => ref.value);\n    el!.textContent = `Rendered ${props.id}`;\n  });\n  return (\n    <>\n      <div id={props.id} ref={ref} />\n    </>\n  );\n});\n\nexport const Ref2 = component$((props: { id: string }) => {\n  const ref = useSignal<Element>();\n  useVisibleTask$(({ track }) => {\n    const el = track(() => ref.value);\n    el!.textContent = `Rendered ${props.id}`;\n  });\n  return (\n    <>\n      <div id={props.id} ref={ref} />\n    </>\n  );\n});\n\nexport const Ref3 = component$(\n  <C extends \"div\" | \"span\">(\n    props: { as?: C } & PropsOf<unknown extends C ? \"div\" : C>,\n  ) => {\n    const { as = \"div\", ...rest } = props;\n    const ref = useSignal<HTMLElement>();\n\n    const Cmp = as as any;\n\n    useVisibleTask$(() => {\n      ref.value!.textContent = `Rendered ${props.id}`;\n    });\n\n    return (\n      <>\n        <Cmp {...rest} ref={ref}>\n          Test\n        </Cmp>\n      </>\n    );\n  },\n);\n"
  },
  {
    "path": "starters/apps/e2e/src/components/render/render.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useStore,\n  useStylesScoped$,\n  useTask$,\n  event$,\n  h,\n  jsx,\n  SkipRender,\n  SSRRaw,\n  HTMLFragment,\n  type PropsOf,\n  Slot,\n  type QRL,\n  type JSXOutput,\n} from \"@builder.io/qwik\";\nimport { delay } from \"../streaming/demo\";\nimport { isServer } from \"@builder.io/qwik\";\n\nexport const Render = component$(() => {\n  const rerender = useSignal(0);\n  return (\n    <>\n      <button\n        id=\"rerender\"\n        data-v={rerender.value}\n        onClick$={() => rerender.value++}\n      >\n        Rerender\n      </button>\n      <RenderChildren v={rerender.value} key={rerender.value} />\n    </>\n  );\n});\nexport const RenderChildren = component$<{ v: number }>(({ v }) => {\n  const parent = {\n    counter: {\n      count: 0,\n    },\n    count: 0,\n    children: [] as any[],\n  };\n  parent.children.push(parent);\n\n  const state = useStore(parent, { deep: true });\n  return (\n    <>\n      <div id=\"rerenderCount\">Render {v}</div>\n      <button\n        id=\"increment\"\n        onClick$={() => {\n          state.counter.count++;\n          state.count++;\n        }}\n      >\n        Increment\n      </button>\n      <Child counter={state.counter}></Child>\n      <Issue1475 />\n      <Issue2563 />\n      <Issue2608 />\n      <Issue2800 />\n      <Issue2889 />\n      <Issue3116 />\n      <CounterToggle />\n      <PropsDestructuring\n        message=\"Hello\"\n        count={state.count}\n        id=\"props-destructuring\"\n        aria-hidden=\"true\"\n      />\n      <PropsDestructuringNo\n        count={state.count}\n        id=\"props-destructuring-no\"\n        aria-hidden=\"true\"\n      />\n      <PropsDestructuring\n        message=\"Count\"\n        count={state.count}\n        id=\"props-destructuring-count\"\n        aria-count={state.count}\n      />\n      <IssueReorder />\n      <Issue2414 />\n      <Issue3178 />\n      <Issue3398 />\n      <Issue3479 />\n      <Issue3481 />\n      <Issue3468 />\n      <Pr3475 />\n      <Issue3561 />\n      <Issue3542 atom={{ code: 1 }} />\n      <Issue3643 />\n      <IssueChildrenSpread />\n      <Issue3731 />\n      <Issue3702 />\n      <Issue3795 />\n      <Issue4029 />\n      <Issue4346 />\n      <SkipRenderTest />\n      <SSRRawTest />\n      <HTMLFragmentTest />\n      <Issue4292 />\n      <Issue4386 />\n      <Issue4455 />\n      <Issue5266 />\n      <DynamicButton id=\"dynamic-button\" />;\n    </>\n  );\n});\n\nexport const Child = component$((props: { counter: { count: number } }) => {\n  const state = useStore({\n    hideAttributes: false,\n  });\n  useStylesScoped$(`\n  .even::before{\n    content: \"even\"\n  }\n  .odd::after{\n    content: \"odd\"\n  }\n  `);\n\n  if (state.hideAttributes) {\n    const count = props.counter.count;\n    return (\n      <>\n        <span id=\"rerenders\">Rerender {count}</span>\n        <div id=\"attributes\">\n          <button\n            id=\"toggle\"\n            onClick$={() => (state.hideAttributes = !state.hideAttributes)}\n          >\n            Toggle attributes\n          </button>\n        </div>\n      </>\n    );\n  }\n  const count = props.counter.count;\n  return (\n    <>\n      <span id=\"rerenders\">Rerender {count}</span>\n      <div\n        id=\"attributes\"\n        preventdefault:click\n        autoCorrect=\"all\"\n        aria-hidden=\"true\"\n        class={{\n          even: count % 2 === 0,\n          odd: count % 2 === 1,\n          stable0: true,\n          hidden: false,\n        }}\n      >\n        <button\n          id=\"toggle\"\n          onClick$={() => (state.hideAttributes = !state.hideAttributes)}\n        >\n          Toggle attributes\n        </button>\n      </div>\n    </>\n  );\n});\n\nexport const Issue1475 = component$(() => {\n  const render = useSignal(false);\n  return (\n    <>\n      <button id=\"issue-1475-button\" onClick$={() => (render.value = true)}>\n        Render\n      </button>\n      <div id=\"issue-1475-result\">\n        {render.value ? (\n          <>\n            <h1>1. Before</h1>\n            2. Some text\n            <LazyIssue1475 />\n            {\"\\n\"}\n            <h2>3 After</h2>\n            <p>Stuff</p>\n          </>\n        ) : (\n          <>\n            <h1>Welcome</h1>\n            <ul></ul>\n            <h2>Here</h2>\n          </>\n        )}\n      </div>\n    </>\n  );\n});\n\nexport const LazyIssue1475 = component$(() => {\n  useTask$(async () => {\n    await delay(50);\n  });\n\n  return <div>Middle</div>;\n});\n\nexport const CounterToggle = component$(() => {\n  const cond = useSignal({ cond: true });\n  return (\n    <>\n      <button\n        id=\"counter-toggle-btn\"\n        onClick$={() => (cond.value = { cond: !cond.value.cond })}\n      >\n        Toggle\n      </button>\n      {cond.value.cond ? (\n        <CounterToggleShow text=\"even\" />\n      ) : (\n        <CounterToggleShow text=\"odd\" />\n      )}\n      <CounterToggleShow2 cond={cond.value.cond} />\n    </>\n  );\n});\n\nexport const CounterToggleShow = component$((props: { text: string }) => {\n  return (\n    <>\n      <div id=\"counter-toggle-show\">{props.text}</div>\n    </>\n  );\n});\n\nexport const CounterToggleShow2 = component$((props: { cond: boolean }) => {\n  return (\n    <>\n      <div id=\"counter-toggle-show-2\">{String(props.cond)}</div>\n    </>\n  );\n});\n\nexport const PropsDestructuring = component$(\n  ({ message, id, count: c, ...rest }: Record<string, any>) => {\n    const renders = useStore(\n      { renders: 0 },\n      {\n        reactive: false,\n      },\n    );\n    renders.renders++;\n    const rerenders = renders.renders + 0;\n\n    return (\n      <div id={id}>\n        <span {...rest}>\n          {message} {c}\n        </span>\n        <div class=\"renders\">{rerenders}</div>\n      </div>\n    );\n  },\n);\n\nexport const PropsDestructuringNo = component$(\n  ({ message = \"Default\", count, id, ...rest }: Record<string, any>) => {\n    const renders = useStore(\n      { renders: 0 },\n      {\n        reactive: false,\n      },\n    );\n    renders.renders++;\n    const rerenders = renders.renders + 0;\n    return (\n      <div id={id}>\n        <span {...rest}>\n          {message} {count}\n        </span>\n        <div class=\"renders\">{rerenders}</div>\n      </div>\n    );\n  },\n);\n\nexport const Issue2563 = component$(() => {\n  const html = `hola`;\n  const obj = { length: 4 };\n  return (\n    <ul>\n      <li id=\"issue-2563-string\">4={html.length}</li>\n      <li id=\"issue-2563-obj\">4={obj.length}</li>\n      <li id=\"issue-2563-operation\">4+1={html.length + 1}</li>\n    </ul>\n  );\n});\n\nexport const Issue2608 = component$(() => {\n  const show = useSignal(false);\n  return (\n    <>\n      <button id=\"issue-2608-btn\" onClick$={() => (show.value = !show.value)}>\n        Toggle\n      </button>\n      {show.value && <div>Content</div>}\n      <div>\n        <input id=\"issue-2608-input\" type=\"text\" />\n      </div>\n    </>\n  );\n});\n\nexport const Issue2800 = component$(() => {\n  const store = useStore<Record<string, number>>({\n    alpha: 1,\n    bravo: 2,\n    charlie: 3,\n  });\n\n  return (\n    <div>\n      <button\n        id=\"issue-2800-btn\"\n        onClick$={() => {\n          const keys = Object.keys(store);\n          store[`extra${keys.length}`] = 1;\n        }}\n      >\n        Add key\n      </button>\n      <ul id=\"issue-2800-result\">\n        {Object.entries(store).map(([key, value]) => (\n          <li key={key}>\n            {key} - {value}\n          </li>\n        ))}\n      </ul>\n    </div>\n  );\n});\n\nexport const Issue2889 = component$(() => {\n  const appState = useStore(\n    {\n      events: [\n        { created: new Date(2022, 1, 15), count: 2 },\n        { created: new Date(2022, 1, 18), count: 8 },\n        { created: new Date(2022, 1, 21), count: 3 },\n        { created: new Date(2022, 1, 26), count: 6 },\n      ],\n    },\n    { deep: true },\n  );\n\n  const filteredEvents = useSignal<{ created: Date; count: number }[]>();\n\n  useTask$(({ track }) => {\n    const list = track(() => appState.events);\n    filteredEvents.value = list.filter(\n      (x) => x.created >= new Date(2022, 1, 20),\n    );\n  });\n\n  return (\n    <>\n      <h2 id=\"issue-2889-result1\">Deeds: {appState.events.length}</h2>\n      <h2 id=\"issue-2889-result2\">\n        Filtered Deeds: {(filteredEvents.value || []).length}\n      </h2>\n    </>\n  );\n});\n\ntype Product = string;\n\nexport type ProductRelationProps = {\n  render$: QRL<(products: Product[]) => JSXOutput>;\n};\n\nexport const ProductRelations = component$((props: ProductRelationProps) => {\n  return <div>{props.render$([\"this comes from render$\"])}</div>;\n});\n\nexport const Issue3116 = component$(() => {\n  return (\n    <>\n      <ProductRelations\n        render$={(products) => (\n          <div id=\"issue-3116-result\">{products.join(\"hi\")}</div>\n        )}\n      />\n    </>\n  );\n});\n\nexport const IssueReorder = component$(() => {\n  const cond = useSignal(false);\n\n  return (\n    <div>\n      {!cond.value && (\n        <p id=\"running\" class=\"issue-order\">\n          TOP\n        </p>\n      )}\n\n      <div class=\"issue-order\" data-value=\"first\">\n        1. First\n      </div>\n      <div class=\"issue-order\" data-value=\"second\">\n        2. Second\n      </div>\n\n      {cond.value && (\n        <p id=\"form-error\" class=\"issue-order\">\n          BOTTOM\n        </p>\n      )}\n      <button\n        id=\"issue-order-btn\"\n        type=\"button\"\n        onClick$={() => {\n          cond.value = true;\n        }}\n      >\n        Submit\n      </button>\n    </div>\n  );\n});\n\nconst Issue2414 = component$(() => {\n  const sort = useSignal<\"id\" | \"size\" | \"age\">(\"size\");\n  const showTable = useSignal(true);\n  const table = useStore({\n    value: [\n      { id: 1, size: 4, age: 1 },\n      { id: 2, size: 3, age: 3 },\n      { id: 3, size: 2, age: 27 },\n      { id: 4, size: 1, age: 9 },\n      { id: 5, size: 7, age: 21 },\n      { id: 6, size: 8, age: 12 },\n      { id: 7, size: 9, age: 7 },\n    ],\n  });\n\n  useTask$(({ track }) => {\n    track(() => sort.value);\n    table.value = table.value\n      .sort((a, b) => a[sort.value] - b[sort.value])\n      .slice();\n  });\n\n  return (\n    <>\n      <p>Should be currently sorted by: {sort.value}</p>\n      <table>\n        <caption>Hello</caption>\n        <colgroup></colgroup>\n        <thead>\n          {([\"size\", \"age\", \"id\"] as const).map((c) => {\n            return (\n              <th\n                key={c}\n                id={`issue-2414-${c}`}\n                onClick$={() => {\n                  sort.value = c;\n                }}\n              >\n                {c}\n              </th>\n            );\n          })}\n        </thead>\n        {showTable.value ? (\n          <tbody>\n            {table.value.map((row) => {\n              return (\n                <tr key={row.id}>\n                  <td class=\"issue-2414-size\">{row.size}</td>\n                  <td class=\"issue-2414-age\">{row.age}</td>\n                  <td class=\"issue-2414-id\">{row.id}</td>\n                </tr>\n              );\n            })}\n          </tbody>\n        ) : (\n          <></>\n        )}\n        <tfoot>\n          <tr>\n            <td colSpan={3}>\n              {table.value === undefined ? \"\" : table.value.length}\n            </td>\n          </tr>\n        </tfoot>\n      </table>\n    </>\n  );\n});\n\nconst Issue3178 = component$(() => {\n  const store = useStore(\n    {\n      elements: [] as Element[],\n    },\n    { deep: true },\n  );\n\n  return (\n    <>\n      <div\n        id=\"issue-3178\"\n        ref={(el) => {\n          store.elements.push(el);\n          // console.warn(store.elements[0].nodeType);\n        }}\n      >\n        Hello\n      </div>\n    </>\n  );\n});\n\nexport type TitleProps = {\n  tag?: \"h1\" | \"h2\";\n};\n\nexport const Title = component$((props: TitleProps) => {\n  const Tag = props.tag ?? \"h1\";\n\n  return <Tag id=\"issue-3398-tag\">Hello {Tag}</Tag>;\n});\n\nexport const Issue3398 = component$(() => {\n  const tag = useSignal<\"h1\" | \"h2\">(\"h1\");\n  return (\n    <div>\n      <button\n        id=\"issue-3398-button\"\n        onClick$={() => (tag.value = tag.value === \"h1\" ? \"h2\" : \"h1\")}\n      >\n        Toggle tag\n      </button>\n      <Title tag={tag.value}></Title>\n    </div>\n  );\n});\n\nexport const Issue3479 = component$(() => {\n  const count = useSignal(0);\n  const attributes = {\n    onClick$: event$(() => count.value++),\n  };\n  const countStr = String(count.value) + \"\";\n  return (\n    <div>\n      <button id=\"issue-3479-button\" {...attributes}>\n        Increment\n      </button>\n      <div id=\"issue-3479-result\">{countStr}</div>\n    </div>\n  );\n});\n\nexport const Issue3481 = component$(() => {\n  useStylesScoped$(`\n    .from-static {\n      color: red;\n    }\n    .from-attr {\n      color: blue;\n    }\n  `);\n  const attr: Record<string, string> = {\n    class: \"from-attr\",\n  };\n  const count = useSignal(0);\n  const countStr = String(count.value) + \"\";\n  return (\n    <>\n      <button id=\"issue-3481-button\" onClick$={() => count.value++}>\n        Rerender\n      </button>\n      <div id=\"issue-3481-result1\" class=\"from-static\" {...attr}>\n        Hello {countStr}\n      </div>\n      <div id=\"issue-3481-result2\" {...attr} class=\"from-static\">\n        Hello {countStr}\n      </div>\n    </>\n  );\n});\n\nconst DATA = [{ name: \"a\" }, { name: \"b\" }, { name: \"c\" }, { name: \"d\" }];\n\nexport const Card = component$((props: any) => {\n  return (\n    <div class=\"issue-3468-card\">\n      {props.name}:{props.key}\n    </div>\n  );\n});\n\nexport const Issue3468 = component$(() => {\n  return (\n    <>\n      {DATA.map((post) => (\n        <Card {...post} key={post.name} />\n      ))}\n    </>\n  );\n});\n\nexport const Pr3475 = component$(() =>\n  ((store) => (\n    <button id=\"pr-3475-button\" onClick$={() => delete store.key}>\n      {store.key}\n    </button>\n  ))(useStore<{ key?: string }>({ key: \"data\" })),\n);\n\nexport const Issue3561 = component$(() => {\n  const props = useStore({\n    product: {\n      currentVariant: {\n        variantImage: \"image\",\n        variantNumber: \"number\",\n        setContents: \"contents\",\n      },\n    },\n  });\n  const { currentVariant: { variantImage, variantNumber, setContents } = {} } =\n    props.product;\n\n  return (\n    <div>\n      <div>\n        <div>{variantImage}</div>\n      </div>\n      <div>\n        <div>{variantNumber}</div>\n      </div>\n      <div>\n        <div>{setContents}</div>\n      </div>\n    </div>\n  );\n});\n\nexport const Issue3542 = component$(({ atom }: any) => {\n  let status = atom.status;\n  if (atom.code === 1) {\n    status = \"CODE IS 1\";\n  }\n  return <span id=\"issue-3542-result\">{status}</span>;\n});\n\nexport const Issue3643 = component$(() => {\n  const toggle = useSignal(false);\n  return (\n    <div>\n      <button\n        id=\"issue-3643-button\"\n        onClick$={() => (toggle.value = !toggle.value)}\n      >\n        Toggle\n      </button>\n      <div id=\"issue-3643-result\">\n        {toggle.value\n          ? h(\"div\", {}, \"World\")\n          : h(\"div\", { dangerouslySetInnerHTML: \"Hello\" })}\n      </div>\n      <div id=\"issue-3643-result-2\">\n        {toggle.value\n          ? jsx(\"div\", { children: \"World\" })\n          : jsx(\"div\", { dangerouslySetInnerHTML: \"Hello\" })}\n      </div>\n    </div>\n  );\n});\n\nfunction Hola(props: any) {\n  return <div {...props}></div>;\n}\n\nexport const IssueChildrenSpread = component$(() => {\n  const signal = useSignal({\n    type: \"div\",\n    children: [\"Hello\"],\n  });\n  const Type = signal.value.type;\n  return (\n    <div>\n      <button\n        id=\"issue-children-spread-button\"\n        onClick$={() => {\n          signal.value = {\n            type: \"div\",\n            children: [\"Changed\"],\n          };\n        }}\n      >\n        Change\n      </button>\n      <Hola id=\"issue-children-spread-static\">\n        <div>1</div>\n        <div>2</div>\n      </Hola>\n      <div id=\"issue-children-spread-result\">\n        <Type {...(signal.value as any)}></Type>\n      </div>\n    </div>\n  );\n});\n\nconst states = [\n  [\"think\", \"containers\", \"hydrating\", \"usestylesscoped\", \"slots\"],\n  [\"think\", \"containers\", \"cleanup\", \"usevisibletask\", \"hydrating\"],\n  [\"cleanup\", \"usevisibletask\", \"think\", \"containers\", \"slots\"],\n];\n\nexport const Issue3731 = component$(() => {\n  const state = useSignal(0);\n  const signal = useSignal(states[0]);\n  return (\n    <div>\n      <button\n        id=\"issue-3731-button\"\n        onClick$={() => {\n          state.value++;\n          if (state.value > states.length - 1) {\n            state.value = 0;\n          }\n          signal.value = states[state.value];\n        }}\n      >\n        Change\n      </button>\n      <ul>\n        {signal.value.map((item) => {\n          return <Issue3731Child key={item} value={item}></Issue3731Child>;\n        })}\n      </ul>\n    </div>\n  );\n});\n\nexport const Issue3731Child = component$((props: any) => {\n  return <div class=\"issue-3731-result\">{props.value}</div>;\n});\n\nexport const Issue3702 = component$(({ description = \"\", other }: any) => {\n  const counter = useSignal(0);\n  return (\n    <div\n      id=\"issue-3702-result\"\n      data-title={\n        description && \"description\" in other\n          ? `Hello ${counter.value}`\n          : `Bye ${counter.value}`\n      }\n    >\n      Issue3702\n      <button id=\"issue-3702-button\" onClick$={() => counter.value++}>\n        Increment\n      </button>\n    </div>\n  );\n});\n\nexport const Issue3795 = component$(() => {\n  let base = \"foo\";\n  const firstAssignment = base;\n  base += \"bar\";\n  const secondAssignment = base;\n  return (\n    <div id=\"issue-3795-result\">\n      {firstAssignment} {secondAssignment}\n    </div>\n  );\n});\n\nexport const Issue4029 = component$(() => {\n  const Comp = useSignal<any>(CompA);\n  return (\n    <>\n      <button id=\"issue-4029-toggle\" onClick$={() => (Comp.value = CompB)}>\n        toggle\n      </button>\n      <Comp.value />\n    </>\n  );\n});\n\nexport const CompA = component$(() => <div id=\"issue-4029-result\">CompA</div>);\nexport const CompB = component$(() => <div id=\"issue-4029-result\">CompB</div>);\n\nexport const SkipRenderTest = component$(() => {\n  const count = useSignal(0);\n  if (count.value % 3 !== 0) {\n    return SkipRender;\n  }\n  const countV = count.value + \"\";\n  return (\n    <>\n      <button id=\"skip-render-button\" onClick$={() => count.value++}>\n        Increment {countV}\n      </button>\n      <div id=\"skip-render-result\">Number: {count.value}</div>\n    </>\n  );\n});\n\nexport const SSRRawTest = component$(() => {\n  return (\n    <div\n      id=\"ssr-raw-test-result\"\n      data-mounted={isServer ? \"server\" : \"browser\"}\n    >\n      <SSRRaw data=\"<b>ssr raw test</b>\" />\n    </div>\n  );\n});\n\nexport const HTMLFragmentTest = component$(() => {\n  return (\n    <div\n      id=\"html-fragment-test-result\"\n      data-mounted={isServer ? \"server\" : \"browser\"}\n    >\n      <HTMLFragment dangerouslySetInnerHTML=\"<b>html fragment test</b>\" />\n    </div>\n  );\n});\n\ntype A = PropsOf<\"button\">;\n\nexport interface TestAProps extends A {}\n\nexport const TestA = component$<TestAProps>((props) => {\n  return (\n    <button id=\"issue-4292-result\" type=\"button\" {...props}>\n      <Slot />\n    </button>\n  );\n});\n\nexport interface TestBProps extends TestAProps {}\n\nexport const TestB = component$<TestBProps>((props) => {\n  return (\n    <TestA {...props}>\n      <Slot />\n    </TestA>\n  );\n});\n\nexport const Issue4292 = component$(() => {\n  const $toggled = useSignal<boolean>(false);\n\n  return (\n    <>\n      <h1>Playground</h1>\n\n      <TestB\n        aria-label={$toggled.value ? \"a\" : \"a1\"}\n        title={$toggled.value ? \"a\" : \"a1\"}\n        onClick$={() => {\n          $toggled.value = !$toggled.value;\n        }}\n      >\n        <div>Hello, World!</div>\n      </TestB>\n    </>\n  );\n});\n\nexport const Issue4346 = component$(() => {\n  const toggle = useSignal(true);\n  const ref = useSignal<HTMLDivElement>();\n\n  return (\n    <>\n      <div id=\"issue-4346-result\" ref={toggle.value ? ref : undefined}>\n        {toggle.value ? \"Hello\" : \"world\"}\n      </div>\n      <button\n        id=\"issue-4346-toggle\"\n        onClick$={() => (toggle.value = false)}\n      ></button>\n    </>\n  );\n});\n\nexport const FOO_MAPPING = {\n  A: 1,\n  B: 2,\n  C: 3,\n};\n\nexport const Issue4386 = component$(() => {\n  const key = \"A\";\n  const value = FOO_MAPPING[key];\n\n  return <div id=\"issue-4386-result\">{value}</div>;\n});\n\nexport const Issue4455 = component$(() => {\n  return (\n    <>\n      <input\n        id=\"issue-4455-input1\"\n        type=\"range\"\n        value=\"0.5\"\n        step=\"0.1\"\n        min=\"0\"\n        max=\"1\"\n      />\n      <input\n        id=\"issue-4455-input2\"\n        type=\"range\"\n        step=\"0.1\"\n        value=\"0.5\"\n        min=\"0\"\n        max=\"1\"\n      />\n    </>\n  );\n});\n\nexport const DynamicComponent = component$<{ b?: boolean; v: string }>(\n  ({ b, v }) => {\n    // Make the tag dynamic\n    const Tag = b ? \"button\" : \"div\";\n    return (\n      <Tag id=\"issue-5266-tag\" data-v={v}>\n        hello\n      </Tag>\n    );\n  },\n);\nexport const Issue5266 = component$(() => {\n  const show = useSignal(false);\n  const state = useSignal(\"foo\");\n  return (\n    <div>\n      <button id=\"issue-5266-render\" onClick$={() => (show.value = true)} />\n      <button id=\"issue-5266-button\" onClick$={() => (state.value = \"bar\")}>\n        toggle\n      </button>\n      {show.value && <DynamicComponent v={state.value} />}\n    </div>\n  );\n});\n\n// needs to be a variable outside component scope to trigger the bug\nconst buttonStyle = \"btn\";\nexport const DynamicButton = component$<any>(\n  ({ isWhite, href, onClick$, id }: any) => {\n    const ComponentName = href ? \"a\" : \"button\";\n    return (\n      <ComponentName\n        id={id}\n        class={[buttonStyle, { white: isWhite }]}\n        href={href}\n        onClick$={onClick$}\n      >\n        <Slot />\n      </ComponentName>\n    );\n  },\n);\n"
  },
  {
    "path": "starters/apps/e2e/src/components/resource/resource-fn.tsx",
    "content": "import {\n  component$,\n  useResource$,\n  useSignal,\n  Resource,\n} from \"@builder.io/qwik\";\n\nexport const ResourceFn = component$(() => {\n  const resource = useResource$(({ track }) => {\n    track(() => {\n      return;\n    });\n    return { name: \"resource\" };\n  });\n  const signal = useSignal({ name: \"signal\" });\n  const asyncSignal = useSignal(Promise.resolve({ name: \"asyncSignal\" }));\n  const promise = Promise.resolve({ name: \"promise\" });\n\n  return (\n    <div>\n      <Resource\n        value={resource}\n        onResolved={(value) => <div id={value.name}>{value.name}</div>}\n      />\n      <Resource\n        value={signal}\n        onResolved={(value) => <div id={value.name}>{value.name}</div>}\n      />\n      <Resource\n        value={asyncSignal}\n        onResolved={(value) => <div id={value.name}>{value.name}</div>}\n      />\n      <Resource\n        value={promise}\n        onResolved={(value) => <div id={value.name}>{value.name}</div>}\n      />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/resource/resource-serialization.tsx",
    "content": "/* eslint-disable */\nimport {\n  component$,\n  useStore,\n  useResource$,\n  Resource,\n  useSignal,\n} from \"@builder.io/qwik\";\nimport { delay } from \"./resource\";\n\nexport const ResourceSerialization = component$(() => {\n  const state = useStore({\n    count0: 0,\n    count1: 0,\n  });\n  const resourceSuccess = useResource$(\n    async () => {\n      await delay(100);\n      return \"Success\";\n    },\n    {\n      timeout: 1000,\n    },\n  );\n  const resourceFailure = useResource$(async () => {\n    await delay(100);\n    throw new Error(\"failed\");\n  });\n  const resourceTimeout = useResource$(\n    async () => {\n      await delay(1000);\n      return \"Success\";\n    },\n    {\n      timeout: 100,\n    },\n  );\n\n  return (\n    <>\n      <Issue2014 />\n      <IssueRaceCondition />\n      <Resource\n        value={resourceSuccess}\n        onResolved={(data) => (\n          <button class=\"success r1\" onClick$={() => state.count0++}>\n            PASS: {data} {state.count0}\n          </button>\n        )}\n        onRejected={(reason) => (\n          <button class=\"failure r1\" onClick$={() => state.count1++}>\n            ERROR: {String(reason)} {state.count1}\n          </button>\n        )}\n      />\n      <Resource\n        value={resourceFailure}\n        onResolved={(data) => (\n          <button class=\"success r2\" onClick$={() => state.count0++}>\n            PASS: {data} {state.count0}\n          </button>\n        )}\n        onRejected={(reason) => (\n          <button class=\"failure r2\" onClick$={() => state.count1++}>\n            ERROR: {String(reason)} {state.count1}\n          </button>\n        )}\n      />\n      <Resource\n        value={resourceTimeout}\n        onResolved={(data) => (\n          <button class=\"success r3\" onClick$={() => state.count0++}>\n            PASS: {data} {state.count0}\n          </button>\n        )}\n        onRejected={(reason) => (\n          <button class=\"failure r3\" onClick$={() => state.count1++}>\n            ERROR: {String(reason)} {state.count1}\n          </button>\n        )}\n      />\n    </>\n  );\n});\n\nexport const Issue2014 = component$(() => {\n  const count = useSignal(0);\n  console.log(\"render\");\n\n  const resource = useResource$<any>(async ({ track }) => {\n    track(count);\n    return {\n      timestamp: count.value * 2,\n    };\n  });\n\n  return (\n    <div>\n      <button id=\"issue-2014-btn\" onClick$={() => count.value++}>\n        <Resource\n          value={resource}\n          onResolved={(data) => <>{data.timestamp}</>}\n        />\n        (count is here: {count.value})\n      </button>\n    </div>\n  );\n});\n\nexport const IssueRaceCondition = component$(() => {\n  const count = useSignal(0);\n  const resource = useResource$<number>(async ({ track }) => {\n    track(count);\n    const value = count.value;\n    if (count.value === 1) {\n      await delay(500);\n    }\n    return value;\n  });\n\n  return (\n    <>\n      <button id=\"resource-race-btn\" onClick$={() => count.value++}>\n        {count.value}\n      </button>\n      <Resource\n        value={resource}\n        onResolved={(data) => <div id=\"resource-race-result\">{data}</div>}\n      />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/resource/resource.tsx",
    "content": "import {\n  component$,\n  useStore,\n  useResource$,\n  Resource,\n  useTask$,\n  createContextId,\n  useContextProvider,\n  useContext,\n  useStyles$,\n  type ResourceReturn,\n} from \"@builder.io/qwik\";\n\nexport interface WeatherData {\n  name: string;\n  wind: { speed: number; deg: number };\n  visibility: number;\n  temp: number;\n  feels_like: number;\n  temp_min: number;\n  temp_max: number;\n  pressure: number;\n  humidity: number;\n}\n\ninterface LogsContext {\n  content: string;\n}\n\nexport const LOGS = createContextId<LogsContext>(\"qwik.logs.resource\");\n\nexport const ResourceApp = component$(() => {\n  const logs = {\n    content: \"\",\n  };\n  useContextProvider(LOGS, logs);\n\n  logs.content += \"[RENDER] <ResourceApp>\\n\";\n  const state = useStore({\n    count: 10,\n    countDouble: 0,\n    countDoubleDouble: 0,\n  });\n\n  useTask$(async ({ track }) => {\n    logs.content += \"[WATCH] 1 before\\n\";\n    const count = track(() => state.count);\n    await delay(100);\n    state.countDouble = count * 2;\n    logs.content += \"[WATCH] 1 after\\n\";\n  });\n\n  useTask$(async ({ track }) => {\n    logs.content += \"[WATCH] 2 before\\n\";\n    const city = track(() => state.countDouble);\n    await delay(100);\n    state.countDoubleDouble = city * 2;\n    logs.content += \"[WATCH] 2 after\\n\";\n  });\n\n  const resource = useResource$<number>(async ({ track }) => {\n    logs.content += \"[RESOURCE] 1 before\\n\";\n    const count = track(() => state.countDoubleDouble);\n    await delay(2000);\n\n    logs.content += \"[RESOURCE] 1 after\\n\";\n    return count * 2;\n  });\n\n  // const resource2 = useResource$<number>(async ({ track }) => {\n  //   logs.content += '[RESOURCE] 2 before\\n';\n  //   const count = track(state, 'countDoubleDouble');\n  //   await delay(2000);\n\n  //   logs.content += '[RESOURCE] 2 after\\n';\n  //   return count * 4;\n  // });\n  const resourceState = resource.loading ? \"pending\" : \"resolved\";\n\n  return (\n    <div>\n      <button type=\"button\" class=\"increment\" onClick$={() => state.count++}>\n        Increment\n      </button>\n      <div id=\"outside-state\">{resourceState}</div>\n      <Results result={resource} />\n    </div>\n  );\n});\n\nexport const Results = component$(\n  (props: { result: ResourceReturn<number> }) => {\n    useStyles$(`\n    .logs {\n      white-space: pre;\n    }`);\n    const logs = useContext(LOGS);\n    logs.content += \"[RENDER] <Results>\\n\\n\\n\";\n    const logscontent = logs.content + \"\";\n\n    const state = useStore({\n      count: 0,\n    });\n    const resourceState = props.result.loading ? \"pending\" : \"resolved\";\n    return (\n      <div>\n        <div id=\"inside-state\">{resourceState}</div>\n        <Resource\n          value={props.result}\n          onPending={() => <div class=\"resource1\">loading resource 1...</div>}\n          onRejected={(reason) => (\n            <div class=\"resource1\">error {`${reason}`}</div>\n          )}\n          onResolved={(number) => {\n            return (\n              <>\n                <div class=\"resource1\">resource 1 is {number}</div>\n                <button class=\"count\" onClick$={() => state.count++}>\n                  count is {mutable(state.count + 0)}\n                </button>\n              </>\n            );\n          }}\n        />\n\n        <div class=\"logs\">{logscontent}</div>\n      </div>\n    );\n  },\n);\n\nexport function mutable(value: any) {\n  return value;\n}\nexport function delay(nu: number) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, nu);\n  });\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/components/resource/weather.tsx",
    "content": "/* eslint-disable */\nimport {\n  component$,\n  useStore,\n  useResource$,\n  Resource,\n  useTask$,\n  type ResourceReturn,\n} from \"@builder.io/qwik\";\n\nexport interface WeatherData {\n  name: string;\n  wind: { speed: number; deg: number };\n  visibility: number;\n  temp: number;\n  feels_like: number;\n  temp_min: number;\n  temp_max: number;\n  pressure: number;\n  humidity: number;\n}\n\nexport const Weather = component$(() => {\n  const state = useStore({\n    city: \"\",\n    debouncedCity: \"\",\n    weather: undefined,\n  });\n\n  // Debounce city\n  useTask$(({ track }) => {\n    const city = track(() => state.city);\n    const timer = setTimeout(() => {\n      state.debouncedCity = city;\n    }, 500);\n    return () => {\n      clearTimeout(timer);\n    };\n  });\n\n  const weather = useResource$<WeatherData | undefined>(\n    async ({ track, cleanup }) => {\n      const city = track(() => state.debouncedCity);\n      cleanup(() => console.log(\"abort request for \", city));\n      if (city.length < 2) {\n        return undefined;\n      }\n      const controller = new AbortController();\n      cleanup(() => controller.abort());\n      const value = await fetchWeather(city, controller.signal);\n      return value;\n    },\n  );\n\n  return (\n    <div>\n      <input\n        type=\"text\"\n        value={state.city}\n        name=\"city\"\n        autoComplete=\"off\"\n        placeholder=\"City name\"\n        onInput$={(ev, el) => (state.city = el.value)}\n      />\n      <WeatherResults2 weather={weather} />\n    </div>\n  );\n});\n\nexport const WeatherResults = component$(\n  (props: { weather: ResourceReturn<WeatherData> }) => {\n    console.log(\"rerender\");\n    return (\n      <div>\n        <Resource\n          value={props.weather}\n          onPending={() => <div>loading data...</div>}\n          onRejected={() => <div>error</div>}\n          onResolved={(resolved) => (\n            <ul>\n              <li>name: {resolved.name}</li>\n              <li>temp: {resolved.temp}</li>\n              <li>feels_like: {resolved.feels_like}</li>\n              <li>humidity: {resolved.humidity}</li>\n              <li>temp_max: {resolved.temp_max}</li>\n              <li>temp_min: {resolved.temp_min}</li>\n              <li>visibility: {resolved.visibility}</li>\n            </ul>\n          )}\n        />\n      </div>\n    );\n  },\n);\n\nexport const WeatherResults2 = component$(\n  (props: { weather: ResourceReturn<WeatherData | undefined> }) => {\n    console.log(\"rerender\");\n    return (\n      <div>\n        <Resource\n          value={props.weather}\n          onPending={() => <div>loading data...</div>}\n          onRejected={(reason) => <div>error {`${reason}`}</div>}\n          onResolved={(weather) => {\n            if (!weather) {\n              return <div>Please write some city</div>;\n            }\n            return (\n              <ul>\n                <li>name: {weather.name}</li>\n                <li>temp: {weather.temp}</li>\n                <li>feels_like: {weather.feels_like}</li>\n                <li>humidity: {weather.humidity}</li>\n                <li>temp_max: {weather.temp_max}</li>\n                <li>temp_min: {weather.temp_min}</li>\n                <li>visibility: {weather.visibility}</li>\n              </ul>\n            );\n          }}\n        />\n      </div>\n    );\n  },\n);\n\nexport async function fetchWeather(\n  city: string,\n  signal: AbortSignal,\n): Promise<WeatherData> {\n  const url = new URL(\"https://api.openweathermap.org/data/2.5/weather\");\n  url.searchParams.set(\"q\", city);\n  url.searchParams.set(\"appid\", \"796dc66c4335ab39e43f882c0098b076\");\n\n  await delay(500);\n  const res = await fetch(url, { signal });\n  const json = await res.json();\n  if (json.cod !== 200) {\n    throw new Error(\"City not found\");\n  }\n  return {\n    name: json.name,\n    wind: json.wind,\n    visibility: json.visibility,\n    feels_like: json.main.feels_like,\n    humidity: json.main.humidity,\n    pressure: json.main.pressure,\n    temp: json.main.temp,\n    temp_max: json.main.temp_max,\n    temp_min: json.main.temp_min,\n  };\n}\n\nfunction delay(nu: number) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, nu);\n  });\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/components/resuming/resuming.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useContextProvider,\n  createContextId,\n  type Signal,\n  useContext,\n  useTask$,\n} from \"@builder.io/qwik\";\n\nexport const CTXCount = createContextId<Signal<number>>(\"resuming-count\");\nexport const CTXShow = createContextId<Signal<boolean>>(\"resuming-show\");\nexport const CTXCounterCopy = createContextId<Signal<number>>(\"resuming-copy\");\n\nexport const Resuming1 = component$(() => {\n  const signal = useSignal(0);\n  useContextProvider(CTXCount, signal);\n  const signalCopy = useSignal(0);\n  useContextProvider(CTXCounterCopy, signalCopy);\n\n  return (\n    <>\n      <div>\n        <Resuming2 />\n      </div>\n    </>\n  );\n});\n\nexport const Resuming2 = component$(() => {\n  const show = useSignal(true);\n  const count = useContext(CTXCounterCopy);\n\n  return (\n    <>\n      <div>\n        <button id=\"toggle\" onClick$={() => (show.value = !show.value)}>\n          Toggle\n        </button>\n        <ResumingCounterButton />\n        <div id=\"counter-copy\">{count.value}</div>\n        {show.value && <ResumingCounterShow />}\n      </div>\n    </>\n  );\n});\n\nexport const ResumingCounterShow = component$(() => {\n  const count = useContext(CTXCount);\n  const copy = useContext(CTXCounterCopy);\n\n  useTask$(({ track }) => {\n    const value = track(() => count.value);\n    copy.value = value;\n  });\n  return (\n    <>\n      <div id=\"counter\">{count.value + \"\"}</div>\n    </>\n  );\n});\n\nexport const ResumingCounterButton = component$(() => {\n  const count = useContext(CTXCount);\n\n  return (\n    <>\n      <button id=\"increment\" onClick$={() => count.value++}>\n        Increment\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/resuming/sync-qrl.tsx",
    "content": "import { component$, sync$ } from \"@builder.io/qwik\";\n\nexport const SyncQRL = component$(() => {\n  return (\n    <div>\n      <h1>PreventDefault</h1>\n      <input\n        id=\"preventDefaultInput\"\n        type=\"checkbox\"\n        onClick$={[\n          sync$((e: Event, target: Element) => {\n            if (target.getAttribute(\"shouldPreventDefault\")) {\n              e.preventDefault();\n            }\n            target.setAttribute(\"prevented\", String(e.defaultPrevented));\n          }),\n        ]}\n      />\n      <hr />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/signals/Issue_5001.tsx",
    "content": "import { component$, useStore } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const nakedState: [number] = [0];\n  // STEP 1\n  // By passing the `nakedState` into a child component, we force\n  // Qwik to serialize `nakedState` into `qwik/json`\n  return <Parent nakedState={nakedState} />;\n});\n\nexport const Parent = component$<{ nakedState: [number] }>(({ nakedState }) => {\n  // STEP 2\n  // We wrap the `nakedState` into `state`.\n  // This means that Qwik needs to serialize the Proxy for the `nakedState`.\n  const state = useStore(nakedState);\n  return (\n    <>\n      <Button\n        // STEP 3\n        // Uncommenting the next line breaks the code. (UI no longer updates)\n        // This seems te be because Qwik somehow gets confused between the two\n        // objects and assumes that `state` is no longer a proxy hence no\n        // subscription\n        //\n        unusedValue={nakedState}\n        state={state}\n      />\n      Count: <span class=\"count\">{state[0]}</span>\n    </>\n  );\n});\n\nexport const Button = component$<{ unusedValue?: [number]; state: [number] }>(\n  ({ state }) => {\n    return (\n      <div>\n        <button onClick$={() => state[0]++}>+1</button>\n      </div>\n    );\n  },\n);\n"
  },
  {
    "path": "starters/apps/e2e/src/components/signals/signals.tsx",
    "content": "import {\n  component$,\n  type Signal,\n  useSignal,\n  createSignal,\n  useConstant,\n  useStore,\n  useVisibleTask$,\n  useTask$,\n  Slot,\n  useStyles$,\n  useResource$,\n  type QwikIntrinsicElements,\n  Resource,\n  useComputed$,\n  createComputed$,\n} from \"@builder.io/qwik\";\nimport { delay } from \"../resource/resource\";\nimport {\n  TestAC,\n  TestACN,\n  TestACNStr,\n  TestACStr,\n  TestC,\n  TestCN,\n  TestCNStr,\n  TestCStr,\n  TestCWithFlag,\n} from \"./utils/utils\";\nimport { isBrowser } from \"@builder.io/qwik\";\n\nexport const Signals = component$(() => {\n  const rerender = useSignal(0);\n  return (\n    <>\n      <button id=\"rerender\" onClick$={() => rerender.value++}>\n        Rerender\n      </button>\n      <SignalsChildren key={rerender.value} />\n    </>\n  );\n});\nexport const SignalsChildren = component$(() => {\n  const ref = useSignal<Element>();\n  const ref2 = useSignal<Element>();\n  const id = useSignal(0);\n  const signal = useSignal(\"\");\n  const renders = useStore(\n    {\n      count: 0,\n    },\n    { reactive: false },\n  );\n  const store = useStore({\n    foo: 10,\n    attribute: \"even\",\n    signal,\n  });\n\n  const styles = useSignal(\"body { background: white}\");\n\n  useVisibleTask$(() => {\n    ref.value!.setAttribute(\"data-set\", \"ref\");\n    ref2.value!.setAttribute(\"data-set\", \"ref2\");\n  });\n\n  renders.count++;\n  const rerenders = renders.count + 0;\n  return (\n    <div aria-label={store.attribute}>\n      <button\n        id=\"count\"\n        onClick$={() => {\n          store.foo++;\n          store.attribute = store.foo % 2 === 0 ? \"even\" : \"odd\";\n        }}\n      >\n        Increment\n      </button>\n      <button\n        id=\"click\"\n        onClick$={() => {\n          signal.value = \"clicked\";\n        }}\n      >\n        Click\n      </button>\n      <button\n        id=\"increment-id\"\n        onClick$={() => {\n          id.value++;\n        }}\n      >\n        Increment ID\n      </button>\n      <button\n        id=\"background\"\n        onClick$={() => {\n          styles.value = \"body { background: black }\";\n        }}\n      >\n        Black background\n      </button>\n      <div id=\"parent-renders\">Parent renders: {rerenders}</div>\n      <Child\n        text=\"Message\"\n        count={store.foo}\n        ref={ref}\n        ref2={ref2}\n        signal={signal}\n        signal2={store.signal}\n        id={id.value}\n        styles={styles.value}\n      />\n      <Issue1681 />\n      <Issue1733 />\n      <SideEffect />\n      <Issue1884 />\n      <Issue2176 />\n      <Issue2245 />\n      <Issue2245B />\n      <ComplexClassSignals />\n      <Issue2311 />\n      <Issue2344 />\n      <Issue2928 />\n      <Issue2930 />\n      <Issue3212 />\n      <FineGrainedTextSub />\n      <FineGrainedUnsubs />\n      <Issue3415 />\n      <BindSignal />\n      <Issue3482 />\n      <Issue3663 />\n      <Issue3440 />\n      <Issue4174 />\n      <Issue4249 />\n      <Issue4228 />\n      <Issue4368 />\n      <Issue4868 />\n      <ManySignals />\n    </div>\n  );\n});\n\ninterface ChildProps {\n  count: number;\n  text: string;\n  ref: Signal<Element | undefined>;\n  ref2: Signal<Element | undefined>;\n  signal: Signal<string>;\n  signal2: Signal<string>;\n  id: number;\n  styles: string;\n}\nexport const Child = component$((props: ChildProps) => {\n  const renders = useStore(\n    {\n      count: 0,\n    },\n    { reactive: false },\n  );\n  renders.count++;\n  const rerenders = renders.count + 0;\n  return (\n    <>\n      <div id=\"child-renders\">Child renders: {rerenders}</div>\n      <div id=\"text\" ref={props.ref}>\n        Text: {props.text}\n      </div>\n      <Id id={props.id} />\n      <div id=\"computed\">{\"computed: \" + props.signal.value}</div>\n      <div id=\"stuff\" ref={props.ref2}>\n        Stuff: {props.count}\n      </div>\n      <style>{props.styles}</style>\n      <textarea id=\"textarea\" value={props.styles}></textarea>\n    </>\n  );\n});\n\nexport const Id = (props: any) => <div id=\"id\">Id: {props.id}</div>;\n\nexport const C = ({ who, count }: any) => (\n  <>\n    Count {who} is {count}\n  </>\n);\n\nexport const Issue1681 = component$(() => {\n  const signal = useSignal(0);\n\n  return (\n    <div>\n      <button id=\"issue-1681-btn\" onClick$={() => signal.value++}>\n        Click\n      </button>{\" \"}\n      <span id=\"issue-1681-return\">\n        <C who={\"A\"} count={signal.value} /> <C who={\"B\"} count={signal} />\n      </span>\n    </div>\n  );\n});\n\nexport const Issue1733 = component$(() => {\n  const store = useStore({ open: false });\n  return (\n    <>\n      <button id=\"issue1733-btn\" onClick$={() => (store.open = !store.open)}>\n        toggle\n      </button>\n      <p id=\"issue1733-signal\">{store.open}</p>\n      <p id=\"issue1733-false\">{false}</p>\n      <p id=\"issue1733-true\">{true}</p>\n      {store.open && <h1 id=\"issue1733-h1\">Message</h1>}\n    </>\n  );\n});\n\nexport const SideEffect = component$(() => {\n  const signal = useSignal(\"initial\");\n  useTask$(async () => {\n    await delay(100);\n    signal.value = \"set\";\n  });\n  return (\n    <>\n      <div>{signal.value}</div>\n    </>\n  );\n});\n\nexport const Issue1884 = component$(() => {\n  const state = useStore({\n    value: \"\",\n    bool: false,\n    counter: 0,\n  });\n  return (\n    <>\n      <button\n        id=\"issue1884-btn\"\n        onClick$={() => {\n          state.value = \"test\";\n          state.counter++;\n          state.bool = true;\n        }}\n      >\n        Click me {state.counter}\n      </button>\n      <div>\n        <Test active={state.value === \"test\"} />\n        <Test active={state.bool ? true : false} />\n        <Test active={state.bool} />\n        <Test active={state.value} />\n      </div>\n    </>\n  );\n});\n\nexport const Test = component$(({ active }: { active: boolean | string }) => {\n  return (\n    <div class=\"issue1884-text\" style={{ color: active && (\"red\" as any) }}>\n      Should turn red\n    </div>\n  );\n});\n\nexport const Issue2176 = component$(() => {\n  const data = useSignal({ text: \"testing\", flag: false, num: 1 });\n  const store = useStore({ text: \"testing\", flag: false, num: 1 });\n  return (\n    <div>\n      <button\n        id=\"issue-2176-btn\"\n        onClick$={() => {\n          const nu = data.value.num + 1;\n          const text = \"testing\" + nu;\n          data.value = { text, flag: !data.value.flag, num: nu };\n          store.num = nu;\n          store.text = text;\n          store.flag = !store.flag;\n        }}\n      >\n        Click me to change the data\n      </button>\n      {/* <code>{JSON.stringify(data.value)}</code> */}\n\n      <h2>Signal</h2>\n      <ul>\n        <li>\n          <Test1\n            text={data.value.text}\n            flag={data.value.flag}\n            num={data.value.num}\n          >\n            Nested value\n          </Test1>\n        </li>\n        <li>\n          <Test1Sig sig={data}>Raw </Test1Sig>\n        </li>\n        <li>\n          <Test2\n            text={`${data.value.text} flag=${data.value.flag ? \"T\" : \"F\"} num=${\n              data.value.num\n            }`}\n          >\n            Computed prop\n          </Test2>\n        </li>\n        <li>\n          <Test2Sig sig={data}>Raw + Computed</Test2Sig>\n        </li>\n        <li>\n          <Test2Child>\n            Slot{\" \"}\n            <span class=\"issue-2176-result\">\n              {data.value.text} flag={data.value.flag ? \"T\" : \"F\"} num=\n              {data.value.num}\n            </span>\n          </Test2Child>\n        </li>\n        <li>\n          <Test2Child>\n            Computed + Slot{\" \"}\n            <span class=\"issue-2176-result\">\n              {`${data.value.text} flag=${data.value.flag ? \"T\" : \"F\"} num=${\n                data.value.num\n              }`}\n            </span>\n          </Test2Child>\n        </li>\n      </ul>\n\n      <h2>Store</h2>\n      <ul>\n        <li>\n          <Test1 text={store.text} flag={store.flag} num={store.num}>\n            Nested value\n          </Test1>\n        </li>\n        <li>\n          <TestStore store={store}>Raw</TestStore>\n        </li>\n        <li>\n          <Test2\n            text={`${store.text} flag=${store.flag ? \"T\" : \"F\"} num=${\n              store.num\n            }`}\n          >\n            Computed prop\n          </Test2>\n        </li>\n        <li>\n          <Test2Store store={store}>Raw + Computed</Test2Store>\n        </li>\n        <li>\n          <Test2Child>\n            Slot{\" \"}\n            <span class=\"issue-2176-result\">\n              {store.text} flag={store.flag ? \"T\" : \"F\"} num={store.num}\n            </span>\n          </Test2Child>\n        </li>\n        <li>\n          <Test2Child>\n            Computed + Slot{\" \"}\n            <span class=\"issue-2176-result\">\n              {`${store.text} flag=${store.flag ? \"T\" : \"F\"} num=${store.num}`}\n            </span>\n          </Test2Child>\n        </li>\n      </ul>\n    </div>\n  );\n});\n\nexport const Test1 = component$(\n  (props: { text: string; flag: boolean; num: number }) => {\n    return (\n      <p>\n        <Slot />{\" \"}\n        <span class=\"issue-2176-result\">\n          {props.text} flag={props.flag ? \"T\" : \"F\"} num={props.num}\n        </span>\n      </p>\n    );\n  },\n);\nexport const Test1Sig = component$((props: { sig: Signal }) => {\n  return (\n    <p>\n      <Slot />{\" \"}\n      <span class=\"issue-2176-result\">\n        {props.sig.value.text} flag={props.sig.value.flag ? \"T\" : \"F\"} num=\n        {props.sig.value.num}\n      </span>\n    </p>\n  );\n});\nexport const TestStore = component$((props: { store: any }) => {\n  return (\n    <p>\n      <Slot />{\" \"}\n      <span class=\"issue-2176-result\">\n        {props.store.text} flag={props.store.flag ? \"T\" : \"F\"} num=\n        {props.store.num}\n      </span>\n    </p>\n  );\n});\nexport const Test2 = component$((props: { text: string }) => {\n  return (\n    <p>\n      <Slot /> <span class=\"issue-2176-result\">{props.text}</span>\n    </p>\n  );\n});\nexport const Test2Sig = component$((props: { sig: Signal }) => {\n  return (\n    <p>\n      <Slot />{\" \"}\n      <span class=\"issue-2176-result\">\n        {`${props.sig.value.text} flag=${\n          props.sig.value.flag ? \"T\" : \"F\"\n        } num=${props.sig.value.num}`}\n      </span>\n    </p>\n  );\n});\nexport const Test2Store = component$((props: { store: any }) => {\n  return (\n    <p>\n      <Slot />{\" \"}\n      <span class=\"issue-2176-result\">\n        {`${props.store.text} flag=${props.store.flag ? \"T\" : \"F\"} num=${\n          props.store.num\n        }`}\n      </span>\n    </p>\n  );\n});\nexport const Test2Child = component$(() => {\n  return (\n    <p>\n      <Slot />\n    </p>\n  );\n});\n\nexport const Issue2245 = component$(() => {\n  useStyles$(`\nspan.true { font-weight: bold; }\nspan.false { font-style: italic; }\n.row { display:flex; flex-direction: row; }\n.column { display:flex; flex-direction: column; }\np { padding: 0.5em; border:1px solid; margin:0.2em }\n.black { color: black; border-color: black; }\n.red { color: red; border-color: red; }\n.blue { color: blue; border-color: blue; }\n.green { color: green; border-color: green; }\n.purple { color: purple; border-color: purple; }\n`);\n\n  const colors = [\"black\", \"red\", \"blue\", \"green\", \"purple\"];\n  const store = useStore({ color: \"black\", n: 0, flag: false });\n  const colorSignal = useSignal(\"black\");\n  return (\n    <div>\n      <button\n        id=\"issue-2245-btn\"\n        onClick$={() => {\n          store.n++;\n          store.flag = !store.flag;\n          if (store.n >= colors.length) {\n            store.n = 0;\n          }\n          store.color = colors[store.n];\n          colorSignal.value = colors[store.n];\n        }}\n      >\n        Click me to change the color\n      </button>\n\n      <div class=\"row\">\n        <div class=\"column issue-2245-results\">\n          <h3>Store - class</h3>\n          <TestC color={store.color}>Class = OK</TestC>\n          <TestAC color={store.color}>[Class] = OK</TestAC>\n          <TestCStr color={store.color}>{`{Class}`} = OK</TestCStr>\n          <TestACStr color={store.color}>{`[{Class}]`} = OK</TestACStr>\n\n          <h3>Store - className</h3>\n          <TestCN color={store.color}>ClassName = OK</TestCN>\n          <TestACN color={store.color}>\n            [ClassName] = OK (though JSX complains\n          </TestACN>\n          <TestCNStr color={store.color}>{`{ClassName}`} = OK</TestCNStr>\n          <TestACNStr color={store.color}>{`[{ClassName}]`} = OK</TestACNStr>\n        </div>\n\n        <div class=\"column issue-2245-results\">\n          <h3>Signal - class</h3>\n          <TestC color={colorSignal.value}>Class = OK</TestC>\n          <TestAC color={colorSignal.value}>[Class] = OK</TestAC>\n          <TestCStr color={colorSignal.value}>{`{Class}`} = OK</TestCStr>\n          <TestACStr color={colorSignal.value}>{`[{Class}]`} = OK</TestACStr>\n\n          <h3>Signal - className</h3>\n          <TestCN color={colorSignal.value}>ClassName = Fail</TestCN>\n          <TestACN color={colorSignal.value}>\n            [ClassName] = OK (JSX complains)\n          </TestACN>\n          <TestCNStr color={colorSignal.value}>{`{ClassName}`} = OK</TestCNStr>\n          <TestACNStr color={colorSignal.value}>\n            {`[{ClassName}]`} = OK (JSX complains)\n          </TestACNStr>\n        </div>\n      </div>\n    </div>\n  );\n});\n\nexport const Issue2245B = component$(() => {\n  const colors = [\"black\", \"red\", \"blue\", \"green\", \"purple\"];\n  const store = useStore({ color: \"black\", n: 0, flag: false });\n  const colorSignal = useSignal(\"black\");\n  const flagSignal = useSignal(false);\n  return (\n    <div>\n      <button\n        id=\"issue-2245-b-btn\"\n        onClick$={() => {\n          store.n++;\n          store.flag = !store.flag;\n          flagSignal.value = !flagSignal.value;\n          if (store.n >= colors.length) {\n            store.n = 0;\n          }\n          store.color = colors[store.n];\n          colorSignal.value = colors[store.n];\n        }}\n      >\n        Click me to change the color\n      </button>\n      <div>\n        FLAG: <code>{store.flag ? \"bold\" : \"italic\"} </code>\n      </div>\n      <div>\n        <code>STORE: {JSON.stringify(store.color)}</code>\n      </div>\n\n      <div class=\"column issue-2245-b-results\">\n        <TestCWithFlag color={store.color} flag={store.flag}>\n          Class = Fail\n        </TestCWithFlag>\n      </div>\n    </div>\n  );\n});\n\nexport const ComplexClassSignals = component$(() => {\n  const classes = useSignal([\"initial\", { hidden: false, visible: true }]);\n  return (\n    <div>\n      <button\n        id=\"complex-classes-btn\"\n        onClick$={() => {\n          classes.value = [\"change\", { hidden: true, visible: false }];\n        }}\n      >\n        Change classses\n      </button>\n      <div id=\"complex-classes-results\" class={classes.value}>\n        Div with classes\n      </div>\n    </div>\n  );\n});\n\ntype MyStore = {\n  condition: boolean;\n  text: string;\n};\n\nexport const Issue2311 = component$(() => {\n  const store = useStore<MyStore>({\n    condition: false,\n    text: \"Hello\",\n  });\n\n  useTask$(({ track }) => {\n    const v = track(() => store.condition);\n    if (v) {\n      store.text = \"Bye bye 👻\";\n    }\n  });\n\n  return (\n    <div>\n      <h1>Weird DOM update bug?</h1>\n\n      <div>\n        <button\n          id=\"issue-2311-btn\"\n          onClick$={() => {\n            store.condition = true;\n          }}\n        >\n          Make it so\n        </button>\n      </div>\n\n      <div id=\"issue-2311-results\">\n        <p>This text should not change</p>\n        <>{store.condition ? <b>Done!</b> : <p>{store.text}</p>}</>\n\n        <p>This text should not change</p>\n        <>{store.condition ? <b>Done!</b> : <p>{store.text}</p>}</>\n\n        <p>This text should not change</p>\n        <>{store.condition ? <b>Done!</b> : <p>{store.text}</p>}</>\n\n        <p>This text should not change</p>\n        <>{store.condition ? <b>Done!</b> : <p>{store.text}</p>}</>\n\n        <p>This text should not change</p>\n        <>{store.condition ? <b>Done!</b> : <p>{store.text}</p>}</>\n      </div>\n    </div>\n  );\n});\n\nexport const Issue2344 = component$(() => {\n  const classSig = useSignal(\"abc\");\n  return (\n    <>\n      <textarea id=\"issue-2344-results\" value=\"Content\" rows={5}></textarea>\n      {classSig.value + \"\"}\n      <p>\n        <button\n          id=\"issue-2344-btn\"\n          onClick$={() => {\n            classSig.value = \"bar\";\n          }}\n        >\n          Should not error\n        </button>\n      </p>\n    </>\n  );\n});\n\nexport const Issue2928 = component$(() => {\n  const store = useStore(\n    {\n      controls: {\n        age: {\n          value: 1,\n          valid: true,\n        },\n      },\n    },\n    {\n      deep: true,\n    },\n  );\n  const group = {\n    controls: store.controls,\n  };\n\n  return (\n    <div>\n      <button\n        onClick$={async (e) => {\n          group.controls.age.value++;\n          await delayZero();\n          group.controls.age.valid = false;\n        }}\n      >\n        Increment\n      </button>\n      <FormDebug ctrl={group.controls.age} />\n      {group.controls.age.value == 2 && <div>match!</div>}\n    </div>\n  );\n});\n\nexport const FormDebug = component$<{ ctrl: any }>((props) => {\n  return (\n    <div>\n      value:{\" this_breaks!! \"} -<>{props.ctrl.value} </>\n      <>{props.ctrl.value + \"\"} </>\n    </div>\n  );\n});\n\nexport const Issue2930 = component$(() => {\n  const group = useStore(\n    {\n      controls: {\n        ctrl: {\n          value: \"\",\n        },\n      },\n    },\n    {\n      deep: true,\n    },\n  );\n\n  return (\n    <div>\n      <div>Type into input field:</div>\n      <input\n        id=\"issue-2930-input\"\n        style=\"border: 1px solid black\"\n        type=\"text\"\n        value={group.controls.ctrl.value}\n        onInput$={(ev, el) => {\n          group.controls.ctrl.value = el.value;\n        }}\n      />\n      <Stringify data={group} />\n\n      <Stringify data={group.controls} />\n\n      <Stringify data={group.controls.ctrl} />\n\n      <Stringify data={group.controls.ctrl.value} />\n    </div>\n  );\n});\n\nexport const Stringify = component$<{\n  data: any;\n  style?: any;\n}>((props) => {\n  return <pre class=\"issue-2930-result\">{JSON.stringify(props.data)}</pre>;\n});\n\nexport const Issue3212Child = component$(\n  (props: { signal: Signal<number> }) => {\n    return <>{props.signal.value}</>;\n  },\n);\n\nexport function useMySignal() {\n  const signal = useSignal<number>(1);\n  return { signal };\n}\n\nexport const Issue3212 = component$(() => {\n  const stuff = useMySignal();\n  const signal = stuff.signal;\n  return (\n    <div>\n      <h2>Issue3212</h2>\n      <div id=\"issue-3212-result-0\">\n        <Issue3212Child signal={stuff.signal} />\n      </div>\n      <div id=\"issue-3212-result-1\">{stuff.signal.value}</div>\n      <div id=\"issue-3212-result-2\">{stuff.signal}</div>\n      <div id=\"issue-3212-result-3\">{signal}</div>\n    </div>\n  );\n});\n\nexport const delayZero = () => {\n  return new Promise((resolve) => {\n    setTimeout(resolve, 1);\n  });\n};\n\nexport const FineGrainedTextSub = component$(() => {\n  const count = useSignal(0);\n  const computed = count.value + 2;\n\n  return (\n    <div>\n      <h2>Fine Grained</h2>\n      <div id=\"fine-grained-mutable\" data-value={computed}>\n        {computed}\n      </div>\n      <div>\n        <button\n          id=\"fine-grained-signal\"\n          data-value={count.value}\n          onClick$={() => count.value++}\n        >\n          Increment {count.value}\n        </button>\n      </div>\n    </div>\n  );\n});\n\nexport const FineGrainedUnsubs = component$(() => {\n  const count = useSignal<{ nu: number } | undefined>({ nu: 1 });\n  console.warn(count.value);\n\n  return (\n    <div>\n      <h2>Fine Grained Unsubs</h2>\n      <button\n        id=\"fine-grained-unsubs-toggle\"\n        onClick$={() => {\n          if (count.value) {\n            count.value = undefined;\n          } else {\n            count.value = { nu: 123 };\n          }\n        }}\n      >\n        Toggle\n      </button>\n\n      {count.value && (\n        <div id=\"fine-grained-unsubs\" data-value={count.value.nu}>\n          {count.value.nu}\n        </div>\n      )}\n      <div>{count.value?.nu ?? \"EMPTY\"}</div>\n    </div>\n  );\n});\n\nexport const Issue3415 = component$(() => {\n  const signal = useSignal(\"<b>foo</b>\");\n\n  return (\n    <>\n      <button\n        id=\"issue-3415-button\"\n        onClick$={() => {\n          signal.value = \"<i>bar</i>\";\n        }}\n      >\n        Toggle\n      </button>\n      <div id=\"issue-3415-result\" dangerouslySetInnerHTML={signal.value} />\n    </>\n  );\n});\n\nexport const BindSignal = component$(() => {\n  const value = useSignal(\"initial\");\n  const checked = useSignal(false);\n\n  return (\n    <>\n      <input id=\"bind-checkbox\" type=\"checkbox\" bind:checked={checked} />\n      <input id=\"bind-input-1\" bind:value={value} disabled={checked.value} />\n      <div id=\"bind-text-1\">Value: {value}</div>\n      <div id=\"bind-text-2\">Value: {value.value}</div>\n      <textarea id=\"bind-input-2\" bind:value={value} disabled={checked.value} />\n      <input id=\"bind-checkbox-2\" type=\"checkbox\" bind:checked={checked} />\n    </>\n  );\n});\n\nexport const Issue3482 = component$(() => {\n  const count = useStore({\n    \"data-foo\": 0,\n  });\n\n  return (\n    <>\n      <button\n        id=\"issue-3482-button\"\n        data-count={count[\"data-foo\"]}\n        onClick$={() => count[\"data-foo\"]++}\n      >\n        Increment {count[\"data-foo\"]}\n      </button>\n      <div id=\"issue-3482-result\" data-count={count[\"data-foo\"]}>\n        {count[\"data-foo\"]}\n      </div>\n    </>\n  );\n});\n\nexport const Issue3663 = component$(() => {\n  const store = useStore({\n    \"Custom Counter\": 0,\n  });\n  const a = store[\"Custom Counter\"] + 0;\n  return (\n    <div>\n      <button id=\"issue-3663-button\" onClick$={() => store[\"Custom Counter\"]++}>\n        Increment\n      </button>\n      <div class=\"issue-3663-result\" data-value={store[\"Custom Counter\"]}>\n        {store[\"Custom Counter\"]}\n      </div>\n      <Issue3663Cmp prop={store[\"Custom Counter\"]} />\n      <div class=\"issue-3663-result\" data-value={a}>\n        {a}\n      </div>\n    </div>\n  );\n});\n\nfunction Issue3663Cmp(props: { prop: number }) {\n  return (\n    <div class=\"issue-3663-result\" data-value={props.prop}>\n      {props.prop}\n    </div>\n  );\n}\n\nexport const Issue3440 = component$(() => {\n  const name = useSignal(\"Demo\");\n  const blogs = useStore([\n    {\n      id: 1,\n      title: \"my first blog\",\n    },\n    {\n      id: 2,\n      title: \"my second blogs\",\n    },\n    {\n      id: 3,\n      title: \"my third blog\",\n    },\n  ]);\n  return (\n    <>\n      <div>\n        <div>\n          <h1>Name: {name.value}</h1>\n          {blogs.map((blog) => (\n            <div class=\"issue-3440-results\" key={blog.id}>\n              {blog.title}\n            </div>\n          ))}\n          <button id=\"issue-3440-remove\" onClick$={() => blogs.pop()}>\n            Remove Blog\n          </button>\n        </div>\n      </div>\n    </>\n  );\n});\n\nexport const Issue4174 = component$(() => {\n  const storeWithoutInit = useStore<{ value?: string }>({});\n\n  useVisibleTask$(\n    () => {\n      storeWithoutInit.value = \"visible-task\";\n    },\n    { strategy: \"document-ready\" },\n  );\n\n  return (\n    <>\n      <div id=\"issue-4174-result\">Store: {storeWithoutInit.value}</div>\n    </>\n  );\n});\n\nexport const Issue4249 = component$(() => {\n  const first = useSignal(\"\");\n  const second = useSignal(\"\");\n\n  return (\n    <main>\n      <div>\n        <label for=\"first\">\n          {\"First \"}\n          <input\n            id=\"issue-4249-first\"\n            value={first.value}\n            onInput$={(_, e) => (first.value = e.value)}\n            placeholder=\"type here\"\n          />\n        </label>\n      </div>\n      <div>\n        <label for=\"second\">\n          {\"Second \"}\n          <input\n            id=\"issue-4249-second\"\n            value={second.value}\n            onInput$={(_, e) => (second.value = e.value)}\n            placeholder=\"type here\"\n          />\n        </label>\n      </div>\n\n      <div\n        id=\"issue-4249-result\"\n        data-value={\n          first.value && second.value && first.value === second.value\n            ? \"collision\"\n            : \"no-collision\"\n        }\n      >\n        {\"Status: \"}\n        {first.value && second.value && first.value === second.value\n          ? \"Collision detected\"\n          : \"No collision\"}\n      </div>\n    </main>\n  );\n});\n\ntype Counters = {\n  countA: number;\n  countB: number;\n  signal: Signal<number>;\n};\n\ntype Props = {\n  counters: Counters;\n};\n\nexport const DisplayA = component$<Props>(({ counters }) => {\n  return (\n    <>\n      Display A:{\" \"}\n      <span id=\"issue-4228-result-a\">{`${counters.countA}:${\n        typeof (globalThis as any).countA === \"number\"\n          ? (window as any).countA++\n          : 0\n      }`}</span>\n    </>\n  );\n});\nexport const DisplayB = component$<Props>(({ counters }) => {\n  return (\n    <>\n      Display B:{\" \"}\n      <span id=\"issue-4228-result-b\">{`${counters.countB}:${\n        typeof (globalThis as any).countB === \"number\"\n          ? (window as any).countB++\n          : 0\n      }`}</span>\n    </>\n  );\n});\nexport const DisplaySignal = component$<Props>(({ counters }) => {\n  return (\n    <>\n      Display C:{\" \"}\n      <span id=\"issue-4228-result-c\">{`${counters.signal.value}:${\n        typeof (globalThis as any).countC === \"number\"\n          ? (window as any).countC++\n          : 0\n      }`}</span>\n    </>\n  );\n});\nexport const DisplayTotal = component$<Props>(({ counters }) => {\n  return (\n    <>\n      Display Total:{\" \"}\n      <span id=\"issue-4228-result-total\">{`${\n        counters.countA + counters.countB + counters.signal.value\n      }:${\n        typeof (globalThis as any).countD === \"number\"\n          ? (window as any).countD++\n          : 0\n      }`}</span>\n    </>\n  );\n});\nexport const Issue4228 = component$(() => {\n  const signal = useSignal(0);\n  const counter = useStore({\n    countA: 0,\n    countB: 0,\n    signal,\n  });\n  useTask$(() => {\n    if (isBrowser) {\n      (window as any).countA = 0;\n      (window as any).countB = 0;\n      (window as any).countC = 0;\n      (window as any).countD = 0;\n    }\n  });\n  useVisibleTask$(\n    () => {\n      (window as any).countA = 1;\n      (window as any).countB = 1;\n      (window as any).countC = 1;\n      (window as any).countD = 1;\n    },\n    {\n      strategy: \"document-ready\",\n    },\n  );\n  return (\n    <>\n      <p>\n        <button id=\"issue-4228-button-a\" onClick$={() => counter.countA++}>\n          +1 A\n        </button>\n        <DisplayA counters={counter} />\n      </p>\n      <p>\n        <button id=\"issue-4228-button-b\" onClick$={() => counter.countB++}>\n          +1 B\n        </button>\n        <DisplayB counters={counter} />\n      </p>\n      <p>\n        <button id=\"issue-4228-button-c\" onClick$={() => signal.value++}>\n          +1 Signal\n        </button>\n        <DisplaySignal counters={counter} />\n      </p>\n      <p>\n        <DisplayTotal counters={counter} />\n      </p>\n    </>\n  );\n});\n\nconst MyButton = component$<QwikIntrinsicElements[\"button\"]>(\n  ({ type, ...rest }) => {\n    return (\n      <button id=\"issue-4368-button\" type={type || \"button\"} {...rest}>\n        <Slot />\n      </button>\n    );\n  },\n);\n\nconst MyTextButton = component$<{ text: string }>((props) => {\n  return (\n    <MyButton disabled={!props.text}>\n      {props.text ? \"Example button\" : \"Text is empty\"}\n    </MyButton>\n  );\n});\n\nexport const Issue4368 = component$(() => {\n  const text = useSignal(\"\");\n\n  const textResource = useResource$(async (ctx) => {\n    return ctx.track(() => text.value);\n  });\n\n  return (\n    <>\n      <input\n        id=\"issue-4368-input\"\n        bind:value={text}\n        placeholder=\"type something here\"\n      />\n\n      <Resource\n        value={textResource}\n        onRejected={() => <p>Error</p>}\n        onPending={() => <p>Loading</p>}\n        onResolved={(resolved) => (\n          <>\n            <MyTextButton text={resolved} />\n          </>\n        )}\n      />\n    </>\n  );\n});\n\nexport const __CFG__ = { noImg: \"https://placehold.co/600x400?text=No%20IMG\" };\n\nexport type PropsType = {\n  data: { id: number; src?: string };\n};\n\nconst options = [\n  {\n    src: \"https://placehold.co/400x400?text=1\",\n    id: 1,\n  },\n  {\n    src: \"https://placehold.co/500x500?text=2\",\n    id: 2,\n  },\n];\n\nexport const Issue4868 = component$(() => {\n  const selected = useSignal<{ id: number; src?: string }>(options[0]);\n  return (\n    <div>\n      <Issue4868BigCard data={selected.value} />\n      {options.map((d) => (\n        <>\n          <button\n            key={d.id}\n            onClick$={() => (selected.value = d)}\n            style={{ padding: \"2rem\", cursor: \"pointer\" }}\n            id={`issue-4868-btn-${d.id}`}\n          >\n            {d.id}\n          </button>\n        </>\n      ))}\n    </div>\n  );\n});\n\nexport const Issue4868BigCard = component$<PropsType>((props) => {\n  // Using a reference to another const will somehow prevent the useComputed$ in the Card element to use the correct context\n  const noImg = __CFG__.noImg;\n\n  // Assigning static value here will make the Card component and useComputed$ within work as expected\n  // const noImg = 'https://placehold.co/600x400?text=No%20IMG';\n\n  return (\n    <div\n      style={{\n        flexDirection: \"column\",\n        border: \"1px solid red\",\n        padding: \"1rem\",\n        gap: \"1rem\",\n      }}\n    >\n      <Issue4868Card src={props.data.src || noImg} />\n      <div id=\"issue-4868-json\">{JSON.stringify(props.data)}</div>\n    </div>\n  );\n});\n\nexport const Issue4868Card = component$((props: { src: string }) => {\n  const { src } = props;\n\n  const src$ = useComputed$(() => {\n    // do something very important with the src\n    return props.src + \"&useComputed$\";\n  });\n\n  return (\n    <div style={{ border: \"1px solid white\", padding: \"1rem\" }}>\n      <p id=\"issue-4868-props\">Card props.src: {src}</p>\n      <p id=\"issue-4868-usecomputed\">Card useComputed$: {src$.value}</p>\n    </div>\n  );\n});\n\nexport const ManySignals = component$(() => {\n  const signals = useConstant(() => {\n    const arr: (Signal<number> | string)[] = [];\n    for (let i = 0; i < 10; i++) {\n      arr.push(createSignal(0));\n      arr.push(\", \");\n    }\n    return arr;\n  });\n  const doubles = useConstant(() =>\n    signals.map((s: Signal<number> | string) =>\n      typeof s === \"string\" ? s : createComputed$(() => s.value * 2),\n    ),\n  );\n\n  return (\n    <>\n      <button\n        id=\"many-signals-button\"\n        onClick$={() => {\n          for (const s of signals) {\n            if (typeof s !== \"string\") {\n              s.value++;\n            }\n          }\n        }}\n      >\n        Increment\n      </button>\n      <div id=\"many-signals-result\">{signals}</div>\n      <div id=\"many-doubles-result\">{doubles}</div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/signals/utils/utils.tsx",
    "content": "/* eslint-disable no-console */\n\nimport { component$, Slot } from \"@builder.io/qwik\";\n\nexport const TestC = component$((props: { color: string }) => {\n  console.log(\"TestC\");\n  return (\n    <p class={props.color}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\nexport const TestAC = component$((props: { color: string }) => {\n  console.log(\"TestAC\");\n  return (\n    <p class={[props.color]}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\nexport const TestCStr = component$((props: { color: string }) => {\n  console.log(\"TestCStr\");\n  return (\n    <p class={`${props.color}`}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\nexport const TestACStr = component$((props: { color: string }) => {\n  console.log(\"TestACStr\");\n  return (\n    <p class={[`${props.color}`]}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\n\nexport const TestCN = component$((props: { color: string }) => {\n  console.log(\"TestCN\");\n  return (\n    <p class={props.color}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\nexport const TestACN = component$((props: { color: string }) => {\n  console.log(\"TestACN\");\n  return (\n    <p class={[props.color] as any}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\nexport const TestCNStr = component$((props: { color: string }) => {\n  console.log(\"TestCNStr\");\n  return (\n    <p class={`${props.color}`}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\nexport const TestACNStr = component$((props: { color: string }) => {\n  console.log(\"TestACNStr\");\n  return (\n    <p class={[`${props.color}`] as any}>\n      {\" \"}\n      <Slot />\n    </p>\n  );\n});\n\nexport const TestCWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestCWithFlag\");\n    return (\n      <p class={props.color}>\n        <span class={props.flag ? \"true\" : \"false\"}>In {props.color}</span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\nexport const TestACWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestACWithFlag\");\n    return (\n      <p class={[props.color]}>\n        <span class={[props.flag ? \"true\" : \"false\"]}>In {props.color}</span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\nexport const TestCStrWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestCStr\");\n    return (\n      <p class={`${props.color}`}>\n        <span class={`${props.flag ? \"true\" : \"false\"}`}>In {props.color}</span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\nexport const TestACStrWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestACStrWithFlag\");\n    return (\n      <p class={[`${props.color}`]}>\n        <span class={[`${props.flag ? \"true\" : \"false\"}`]}>\n          In {props.color}\n        </span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\n\nexport const TestCNWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestCNWithFlag\");\n    return (\n      <p class={props.color}>\n        <span class={props.flag ? \"true\" : \"false\"}>In {props.color}</span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\nexport const TestACNWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestACNWithFlag\");\n    return (\n      <p class={[props.color] as any}>\n        <span class={[props.flag ? \"true\" : \"false\"] as any}>\n          In {props.color}\n        </span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\nexport const TestCNStrWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestCNStrWithFlag\");\n    return (\n      <p class={`${props.color}`}>\n        <span class={`${props.flag ? \"true\" : \"false\"}`}>In {props.color}</span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\nexport const TestACNStrWithFlag = component$(\n  (props: { color: string; flag: boolean }) => {\n    console.log(\"TestACNStrWithFlag\");\n    return (\n      <p class={[`${props.color}`] as any}>\n        <span class={[`${props.flag ? \"true\" : \"false\"}`] as any}>\n          In {props.color}\n        </span>{\" \"}\n        <Slot />\n      </p>\n    );\n  },\n);\n"
  },
  {
    "path": "starters/apps/e2e/src/components/slot/slot-remove.tsx",
    "content": "import {\n  component$,\n  useSignal,\n  useContextProvider,\n  createContextId,\n  type Signal,\n  useContext,\n  Slot,\n} from \"@builder.io/qwik\";\n\nexport const SlotCleanup = component$(() => {\n  const rerender = useSignal(0);\n\n  return (\n    <section>\n      <SlotCleanupChildren key={rerender.value} />\n    </section>\n  );\n});\n\nconst CleanupCounterContext = createContextId<Signal<number>>(\n  \"CleanupCounterContext\",\n);\n\nexport const SlotCleanupChildren = component$(() => {\n  const signal = useSignal(0);\n  useContextProvider(CleanupCounterContext, signal);\n\n  return (\n    <>\n      <IssueBogusCleanup />\n    </>\n  );\n});\n\nexport const IssueBogusCleanup = component$(() => {\n  const signal = useSignal(0);\n  useContextProvider(CleanupCounterContext, signal);\n\n  return (\n    <>\n      <button\n        id=\"issue-2751-toggle\"\n        onClick$={() => {\n          signal.value++;\n        }}\n      >\n        Toggle\n      </button>\n      <div class=\"issue-2751-result\">\n        {signal.value % 2 === 0 ? <CleanupA></CleanupA> : <div>Nothing</div>}\n      </div>\n    </>\n  );\n});\n\ninterface CleanupProps {\n  slot?: boolean;\n}\nexport const CleanupA = component$<CleanupProps>((props) => {\n  return (\n    <div>\n      <Bogus />\n      {props.slot && <Slot></Slot>}\n    </div>\n  );\n});\n\nexport const Bogus = component$(() => {\n  const signal = useContext(CleanupCounterContext);\n  const count = signal.value;\n  return (\n    <div>\n      Bogus {count} {signal.value} <span>{signal.value}</span>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/slot/slot.tsx",
    "content": "import {\n  component$,\n  $,\n  useStore,\n  Slot,\n  useContext,\n  useSignal,\n  useContextProvider,\n  createContextId,\n  type Signal,\n  jsx,\n  type JSXNode,\n  useVisibleTask$,\n  type FunctionComponent,\n} from \"@builder.io/qwik\";\n\nexport const SlotParent = component$(() => {\n  const state = useStore({\n    disableButtons: false,\n    disableNested: false,\n    removeContent: false,\n    render: true,\n    count: 0,\n  });\n  return (\n    <section class=\"todoapp\">\n      {state.render && (\n        <>\n          <div id=\"isRendered\">Hi</div>\n          <Issue1630>\n            <Child id=\"slot-child\" q:slot=\"slot-content\">\n              Component Slot Content\n            </Child>\n            <p q:slot=\"slot-content\" id=\"slot-p\">\n              P Slot Content\n            </p>\n            <p id=\"noslot-p\">Non-Slotted Content</p>\n          </Issue1630>\n          <Issue1410>\n            <span id=\"modal-content\">Model content</span>\n          </Issue1410>\n          <Issue2688 count={state.count} />\n          <Projector state={state} id=\"btn1\">\n            {!state.removeContent && <>DEFAULT {state.count}</>}\n            <span q:slot=\"ignore\">IGNORE</span>\n          </Projector>\n\n          <Projector state={state} id=\"btn2\">\n            {!state.removeContent && (\n              <div q:slot=\"start\">START {state.count}</div>\n            )}\n          </Projector>\n\n          <Thing state={state} id=\"btn3\">\n            <Projector id=\"projected\" state={state}>\n              {!state.removeContent && <>INSIDE THING {state.count}</>}\n            </Projector>\n          </Thing>\n          <Issue2751 />\n\n          <Issue3565 model={Issue3565Model} />\n\n          <Issue3607 />\n          <Issue3727 />\n          <Issue4215 />\n          <Issue4283>\n            <p>index page</p>\n          </Issue4283>\n          <Issue4658 />\n          <Issue5270 />\n          <Issue5506 />\n        </>\n      )}\n      <div>\n        <button\n          id=\"btn-toggle-content\"\n          class=\"border border-cyan-600\"\n          onClick$={() => (state.removeContent = !state.removeContent)}\n        >\n          Toggle content\n        </button>\n      </div>\n      <div>\n        <button\n          id=\"btn-toggle-buttons\"\n          class=\"border border-cyan-600\"\n          onClick$={() => (state.disableButtons = !state.disableButtons)}\n        >\n          Toggle buttons\n        </button>\n      </div>\n      <div>\n        <button\n          id=\"btn-toggle-thing\"\n          class=\"border border-cyan-600\"\n          onClick$={() => (state.disableNested = !state.disableNested)}\n        >\n          Toogle Thing\n        </button>\n      </div>\n      <div>\n        <button\n          id=\"btn-count\"\n          class=\"border border-cyan-600\"\n          onClick$={() => state.count++}\n        >\n          Count\n        </button>\n      </div>\n      <div>\n        <button\n          id=\"btn-toggle-render\"\n          class=\"border border-cyan-600\"\n          onClick$={() => (state.render = !state.render)}\n        >\n          Toogle render\n        </button>\n      </div>\n    </section>\n  );\n});\n\nexport const Issue1630 = component$(() => {\n  const store = useStore({ open: true });\n\n  return (\n    <>\n      <button\n        id=\"toggle-child-slot\"\n        onClick$={() => (store.open = !store.open)}\n      >\n        Toggle Non-Slotted Content\n      </button>\n      <Slot name=\"slot-content\" />\n      {store.open && <Slot />}\n    </>\n  );\n});\n\nexport const Child = component$((props: { id?: string }) => {\n  return (\n    <p id={props.id}>\n      <Slot />\n    </p>\n  );\n});\n\nexport const Issue1410 = component$(() => {\n  const store = useStore({ open: true });\n\n  return (\n    <>\n      <button id=\"toggle-modal\" onClick$={() => (store.open = !store.open)}>\n        Toggle modal\n      </button>\n      {store.open && (\n        <>\n          <Child>\n            <Slot />\n          </Child>\n        </>\n      )}\n    </>\n  );\n});\n\nexport const Projector = component$((props: { state: any; id: string }) => {\n  return (\n    <div\n      id={props.id}\n      onClick$={() => {\n        props.state.count--;\n      }}\n    >\n      <Button>\n        <Slot name=\"start\"></Slot>\n\n        {!props.state.disableButtons && (\n          <div>\n            <Slot />\n          </div>\n        )}\n        <Slot name=\"end\" />\n      </Button>\n    </div>\n  );\n});\n\nexport const Button = component$((props: { id?: string }) => {\n  return (\n    <button type=\"button\" id={props.id}>\n      <Slot />\n    </button>\n  );\n});\n\nexport const Thing = component$((props: { state: any; id: string }) => {\n  return (\n    <article class=\"todoapp\" id={props.id}>\n      {!props.state.disableNested && <Slot />}\n    </article>\n  );\n});\n\nexport const Switch = component$((props: { name: string }) => {\n  return <Slot name={props.name} />;\n});\n\nexport const Issue2688 = component$(({ count }: { count: number }) => {\n  const store = useStore({ flip: false });\n\n  return (\n    <>\n      <button\n        id=\"issue-2688-button\"\n        onClick$={() => (store.flip = !store.flip)}\n      >\n        Toggle switch\n      </button>\n      <div id=\"issue-2688-result\">\n        <Switch name={store.flip ? \"b\" : \"a\"}>\n          <div q:slot=\"a\">Alpha {count}</div>\n          <div q:slot=\"b\">Bravo {count}</div>\n        </Switch>\n      </div>\n    </>\n  );\n});\n\nconst Issue2751Context = createContextId<Signal<number>>(\n  \"CleanupCounterContext\",\n);\n\nexport const Issue2751 = component$(() => {\n  const signal = useSignal(0);\n  useContextProvider(Issue2751Context, signal);\n\n  return (\n    <>\n      <button\n        id=\"issue-2751-toggle\"\n        onClick$={() => {\n          signal.value++;\n        }}\n      >\n        Toggle\n      </button>\n      <div id=\"issue-2751-result\">\n        {signal.value % 2 === 0 ? <CleanupA></CleanupA> : <div>Nothing</div>}\n      </div>\n    </>\n  );\n});\n\ninterface CleanupProps {\n  slot?: boolean;\n}\nexport const CleanupA = component$<CleanupProps>((props) => {\n  return (\n    <div>\n      <Bogus />\n      {props.slot && <Slot></Slot>}\n    </div>\n  );\n});\n\nexport const Bogus = component$(() => {\n  const signal = useContext(Issue2751Context);\n  const count = signal.value;\n  return (\n    <div>\n      Bogus {count} {signal.value} <span>{signal.value}</span>\n    </div>\n  );\n});\n\nexport const Issue3565Model = component$(() => {\n  return (\n    <div id=\"issue-3565-result\">\n      Own content\n      <Slot></Slot>\n    </div>\n  );\n});\n\nexport const Issue3565 = component$(\n  ({ model: Model }: { model: string | FunctionComponent }) => {\n    return (\n      <>\n        <Model>\n          <div>content projected</div>\n        </Model>\n      </>\n    );\n  },\n);\n\nexport const Issue3607 = component$(() => {\n  const show = useSignal(false);\n  return (\n    <Issue3607Button\n      loading={show.value}\n      onClick$={() => {\n        show.value = !show.value;\n      }}\n    >\n      {show.value ? \"Loading...\" : \"Load more\"}\n    </Issue3607Button>\n  );\n});\n\nexport const Issue3607Button = component$(({ onClick$ }: any) => {\n  return (\n    <>\n      <button id=\"issue-3607-result\" onClick$={onClick$} class=\"btn\">\n        <Slot />\n      </button>\n    </>\n  );\n});\n\nconst CTX = createContextId<Signal<any[]>>(\"content-Issue3727\");\n\nexport const Issue3727 = component$(() => {\n  const content = useSignal<any[]>([Issue3727ParentA, Issue3727ChildA]);\n  useContextProvider(CTX, content);\n\n  const contentsLen = content.value.length;\n  let cmp: JSXNode | null = null;\n  for (let i = contentsLen - 1; i >= 0; i--) {\n    cmp = jsx(content.value[i], {\n      children: cmp,\n    });\n  }\n  return cmp;\n});\n\nexport const Issue3727ParentA = component$(() => {\n  return (\n    <main id=\"Issue3727ParentA\">\n      <Slot />\n    </main>\n  );\n});\n\nexport const Issue3727ParentB = component$(() => {\n  return (\n    <main id=\"Issue3727ParentB\">\n      <Slot />\n    </main>\n  );\n});\n\nexport const Issue3727ChildA = component$(() => {\n  const content = useContext(CTX);\n\n  return (\n    <article>\n      <h1>First</h1>\n      <button\n        id=\"issue-3727-navigate\"\n        onClick$={() => {\n          content.value = [Issue3727ParentB, Issue3727ChildB];\n        }}\n      >\n        Navigate\n      </button>\n    </article>\n  );\n});\n\nexport const Issue3727ChildB = component$(() => {\n  const copyList = useSignal<string[]>([]);\n  const content = useContext(CTX);\n  return (\n    <article>\n      <h1>Second</h1>\n      <button\n        id=\"issue-3727-add\"\n        onClick$={async () => {\n          content.value = [Issue3727ParentB, Issue3727ChildB];\n          copyList.value = [...copyList.value, `item ${copyList.value.length}`];\n        }}\n      >\n        Add item\n      </button>\n      <ul id=\"issue-3727-results\">\n        {copyList.value.map((item) => (\n          <li>{item}</li>\n        ))}\n      </ul>\n    </article>\n  );\n});\n\nexport const QwikSvgWithSlot = component$(() => {\n  return (\n    <svg\n      id=\"issue-4215-svg\"\n      viewBox=\"0 0 24 24\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      style={{ width: \"24px\", height: \"24px\" }}\n    >\n      <Slot />\n    </svg>\n  );\n});\n\nexport const Issue4215 = component$(() => {\n  const $visible = useSignal<boolean>(true);\n\n  return (\n    <>\n      <button\n        class=\"cta\"\n        id=\"issue-4215-toggle\"\n        onClick$={() => {\n          $visible.value = !$visible.value;\n        }}\n      >\n        Toggle icons\n      </button>\n\n      <div class=\"svg-container icon1\">\n        <p>QwikSvgWithSlot</p>\n        <QwikSvgWithSlot>\n          {$visible.value && (\n            <path d=\"M14.71 6.71c-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z\" />\n          )}\n        </QwikSvgWithSlot>\n      </div>\n    </>\n  );\n});\n\nexport const HideUntilVisible = component$(() => {\n  const isNotVisible = useSignal(true);\n\n  useVisibleTask$(\n    () => {\n      if (isNotVisible.value) {\n        isNotVisible.value = false;\n      }\n    },\n    {\n      strategy: \"document-ready\",\n    },\n  );\n\n  // NOTE: if you comment the line below,\n  // there will only be one \"Content\"\n  if (isNotVisible.value) {\n    return <div></div>;\n  }\n\n  return (\n    <div id=\"issue-4283-result\">\n      <p>Hide until visible</p>\n      <Slot />\n    </div>\n  );\n});\n\nexport const Issue4283 = component$(() => {\n  return (\n    <HideUntilVisible>\n      <p>Content</p>\n      <Slot />\n    </HideUntilVisible>\n  );\n});\n\nexport const Issue4658Context =\n  createContextId<Signal<boolean>>(\"issue-4658-context\");\nexport const Issue4658Inner = component$(() => {\n  const toggle = useContext(Issue4658Context);\n  return (\n    <>\n      <main>\n        <Slot />\n      </main>\n      {toggle.value ? (\n        <h3 id=\"issue-4658-inner\">CCC</h3>\n      ) : (\n        <h3 id=\"issue-4658-inner\">DDD</h3>\n      )}\n    </>\n  );\n});\n\nexport const Issue4658 = component$(() => {\n  const toggle = useSignal(false);\n  useContextProvider(Issue4658Context, toggle);\n  return (\n    <>\n      <Issue4658Inner>\n        {toggle.value ? (\n          <h1 id=\"issue-4658-top\">AAA</h1>\n        ) : (\n          <h1 id=\"issue-4658-top\">BBB</h1>\n        )}\n      </Issue4658Inner>\n      <button\n        id=\"issue-4658-toggle\"\n        onClick$={() => {\n          toggle.value = !toggle.value;\n        }}\n      >\n        Toggle\n      </button>\n    </>\n  );\n});\n\nconst Issue5270Context = createContextId<{ hi: string }>(\"5270\");\nexport const ProviderParent = component$(() => {\n  useContextProvider(Issue5270Context, { hi: \"hello\" });\n  const s = useSignal(false);\n  return (\n    <div>\n      <button id=\"issue-5270-button\" onClick$={() => (s.value = !s.value)}>\n        toggle\n      </button>\n      <br />\n      {s.value && <Slot />}\n    </div>\n  );\n});\nconst ContextChild = component$(() => {\n  const t = useContext(Issue5270Context);\n  return <div id=\"issue-5270-div\">Ctx: {t.hi}</div>;\n});\nexport const Issue5270 = component$(() => {\n  useContextProvider(Issue5270Context, { hi: \"wrong\" });\n  return (\n    <ProviderParent>\n      <ContextChild />\n    </ProviderParent>\n  );\n});\n\nexport const Toggle5506 = component$<any>((props) => {\n  return (\n    <>\n      <label>\n        <input\n          {...props}\n          type=\"checkbox\"\n          // ensure it gets checked state only from props\n          preventdefault:click\n        />\n        toggle me\n      </label>\n    </>\n  );\n});\n\nexport const SlotParent5506 = component$(() => <Slot />);\n\n// This breaks signal propagation, if you put this expression directly in the JSX prop it works\nfunction coerceBoolean(value: string) {\n  return value === \"true\";\n}\n\nexport const Issue5506 = component$(() => {\n  const sig = useSignal(\"true\");\n  const render = useSignal(0);\n  const onClick$ = $(() => {\n    const newValue = sig.value === \"true\" ? \"false\" : \"true\";\n    sig.value = newValue;\n  });\n\n  return (\n    <div id=\"issue-5506-div\">\n      <SlotParent5506 key={render.value}>\n        <Toggle5506\n          id=\"input-5506\"\n          checked={coerceBoolean(sig.value)}\n          onClick$={onClick$}\n        />\n        <br />\n        <button onClick$={() => render.value++}>Rerender on client</button>\n      </SlotParent5506>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/streaming/demo.tsx",
    "content": "import {\n  component$,\n  Resource,\n  SSRStream,\n  useResource$,\n  useStyles$,\n} from \"@builder.io/qwik\";\n\nexport function delay(time: number) {\n  return new Promise<void>((resolve) => {\n    setTimeout(() => resolve(), time);\n  });\n}\n\nexport const Streaming = component$(() => {\n  return (\n    <div>\n      <Cmp text=\"this 1\" delay={1000}></Cmp>\n      <Cmp text=\"this 2\" delay={2000}></Cmp>\n      <Cmp text=\"this 3\" delay={3000}></Cmp>\n      <Cmp text=\"this 4\" delay={4000}></Cmp>\n      <Cmp text=\"this 5\" delay={3000}></Cmp>\n      <SSRStream>\n        {async function* () {\n          for (let i = 0; i < 100; i++) {\n            yield <div>{i}</div>;\n            await delay(500);\n          }\n        }}\n      </SSRStream>\n    </div>\n  );\n});\n\nexport const Cmp = component$((props: { text: string; delay: number }) => {\n  useStyles$(`.cmp {\n    background: blue;\n    color: white;\n    width: 100%;\n    height: 300px;\n    display: block;\n    text-align: center;\n    font-size: 40px;\n    margin: 20px 0;\n  }`);\n\n  const resource = useResource$<string>(async ({ track }) => {\n    track(() => props.text);\n    await delay(props.delay);\n    return props.text;\n  });\n\n  return (\n    <div>\n      <Resource\n        value={resource}\n        onResolved={(value) => <span class=\"cmp\">{value}</span>}\n      />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/streaming/streaming.tsx",
    "content": "import {\n  component$,\n  Resource,\n  SSRStream,\n  SSRStreamBlock,\n  useResource$,\n  useStore,\n  useStyles$,\n} from \"@builder.io/qwik\";\n\nexport function delay(time: number) {\n  return new Promise<void>((resolve) => {\n    setTimeout(() => resolve(), time);\n  });\n}\n\nexport const StreamingRoot = component$(() => {\n  const store = useStore({\n    count: 0,\n  });\n  return (\n    <>\n      <button id=\"client-render\" onClick$={() => store.count++}>\n        Client rerender: {store.count}\n      </button>\n      <Streaming key={store.count} />\n    </>\n  );\n});\n\nexport const Streaming = component$(() => {\n  const store = useStore({\n    count: 0,\n  });\n  return (\n    <div>\n      <button id=\"count\" onClick$={() => store.count++}>\n        Rerender: {store.count}\n      </button>\n\n      <ul>\n        <SSRStream>\n          {async function* () {\n            for (let i = 0; i < 5; i++) {\n              yield <li>yield: {i}</li>;\n              await delay(100);\n            }\n          }}\n        </SSRStream>\n      </ul>\n\n      <ol>\n        <SSRStream>\n          {async function (stream: any) {\n            for (let i = 0; i < 10; i++) {\n              stream.write(`<li>raw: ${i}</li>`);\n              await delay(100);\n            }\n          }}\n        </SSRStream>\n      </ol>\n\n      <SSRStreamBlock>\n        <Cmp text=\"this 1\" delay={1000}></Cmp>\n        <Cmp text=\"this 2\" delay={1200}></Cmp>\n      </SSRStreamBlock>\n\n      <Cmp text=\"this 3\" delay={1500}></Cmp>\n\n      <SSRStreamBlock>\n        <Cmp text=\"this 4\" delay={1000}></Cmp>\n        <Cmp text=\"this 4\" delay={2000}></Cmp>\n      </SSRStreamBlock>\n    </div>\n  );\n});\n\nexport const Cmp = component$((props: { text: string; delay: number }) => {\n  useStyles$(`.cmp {\n    background: blue;\n    color: white;\n    width: 100%;\n    height: 100px;\n    display: block;\n    text-align: center;\n    font-size: 40px;\n    margin: 20px 0;\n  }`);\n\n  const resource = useResource$<string>(async ({ track }) => {\n    track(() => props.text);\n    await delay(props.delay);\n    return props.text;\n  });\n\n  return (\n    <div>\n      <Resource\n        value={resource}\n        onResolved={(value) => (\n          <span id={value} class=\"cmp\">\n            {value}\n          </span>\n        )}\n      />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/styles/child.css",
    "content": ".child-container > .child {\n  font-size: 20px;\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/components/styles/child2.css",
    "content": ".child-container > .child2 {\n  font-size: 10px;\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/components/styles/empty.css",
    "content": ""
  },
  {
    "path": "starters/apps/e2e/src/components/styles/parent.css",
    "content": ".parent-container > .parent {\n  font-size: 200px;\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/components/styles/parent2.css",
    "content": ".parent-child {\n  font-size: 40px;\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/components/styles/styles.tsx",
    "content": "import {\n  component$,\n  useStylesScoped$,\n  useStore,\n  Slot,\n  useSignal,\n  Fragment,\n} from \"@builder.io/qwik\";\nimport parent from \"./parent.css?inline\";\nimport parent2 from \"./parent2.css?inline\";\nimport child from \"./child.css?inline\";\nimport child2 from \"./child2.css?inline\";\nimport empty from \"./empty.css?inline\";\n\nexport const Styles = component$(() => {\n  const reload = useSignal(0);\n  return (\n    <>\n      <button id=\"reload\" data-v={reload.value} onClick$={() => reload.value++}>\n        Reload\n      </button>\n      <StylesChildren v={reload.value} key={reload.value} />\n    </>\n  );\n});\n\nexport const StylesChildren = component$<{ v: number }>(({ v }) => {\n  useStylesScoped$(parent);\n  useStylesScoped$(parent2);\n\n  const store = useStore({\n    count: 10,\n  });\n  return (\n    <div class=\"parent-container\">\n      <div id=\"renderCount\">Render {v}</div>\n      <div class={[\"parent\", `count-${store.count}`]}>\n        Parent\n        <button id=\"add-child\" type=\"button\" onClick$={() => store.count++}>\n          Add Child\n        </button>\n        {Array.from({ length: store.count }).map((_, i) => (\n          <Fragment key={i}>\n            <Child index={i} />\n            <div class=\"parent-child\">Inline {i}</div>\n          </Fragment>\n        ))}\n      </div>\n      <Issue1945 />\n      <IssueScopedAndFineGrained />\n    </div>\n  );\n});\n\nexport const Child = component$((props: { index: number }) => {\n  useStylesScoped$(child);\n  useStylesScoped$(child2);\n  useStylesScoped$(empty);\n\n  return (\n    <div class=\"child-container\">\n      <div class=\"child\">Child {props.index}</div>\n    </div>\n  );\n});\n\nexport const Issue1945 = component$(() => {\n  useStylesScoped$(`h1 {\n    background-color: blue;\n  }\n  `);\n  return (\n    <>\n      <h1 id=\"issue1945-1\">Outside A and B</h1>\n      <ComponentA>\n        <h1 q:slot=\"one\" id=\"issue1945-2\">\n          Outside B\n        </h1>\n        <ComponentB q:slot=\"two\">\n          <h1 id=\"issue1945-3\">Inside B</h1>\n        </ComponentB>\n        <div q:slot=\"three\">\n          <h1 id=\"issue1945-4\">Inside slot 3</h1>\n        </div>\n        <div q:slot=\"four\">\n          {/* This h1 should have a blue background when it is rendered */}\n          <h1 id=\"issue1945-5\">Inside slot 4</h1>\n        </div>\n      </ComponentA>\n    </>\n  );\n});\n\nexport const ComponentA = component$(() => {\n  useStylesScoped$(`h1 {\n    background-color: green;\n  }\n  `);\n  const store = useStore({ show: false });\n\n  return (\n    <div>\n      {/*\n        Slots 1-3 behave as expected, assigning the scopeId of the consuming component to the slotted elements\n      */}\n      <Slot name=\"one\" />\n      <Slot name=\"two\" />\n      <Slot name=\"three\" />\n      <button id=\"issue1945-btn\" onClick$={() => (store.show = !store.show)}>\n        toggle slot 4\n      </button>\n      {/*\n        When Slot 4 is conditionally rendered, the scoped style assigns the wrong\n        class to the slotted elements (it assigns ComponentA scopeId instead of\n        the scopeId of the consuming component), thus allowing for bleeding scoped\n        styles from this component to the slotted elements.\n      */}\n      {store.show ? <Slot name=\"four\" /> : null}\n    </div>\n  );\n});\n\nexport const ComponentB = component$(() => {\n  useStylesScoped$(`h1 {\n    background-color: red;\n  }\n  `);\n  return (\n    <div>\n      <Slot />\n    </div>\n  );\n});\n\nexport const IssueScopedAndFineGrained = component$(() => {\n  useStylesScoped$(`\n  .button {\n    background-color: red;\n  }\n  .even {\n    background-color: green;\n  }\n  .odd {\n    background-color: blue;\n  }\n  `);\n  const count = useSignal(0);\n  return (\n    <button\n      id=\"issue-scoped-fine-grained\"\n      onClick$={() => count.value++}\n      class={{\n        button: true,\n        even: count.value % 2 === 0,\n        odd: count.value % 2 === 1,\n      }}\n    >\n      Hello\n    </button>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/toggle/toggle.tsx",
    "content": "/* eslint-disable */\nimport {\n  component$,\n  createContextId,\n  useStore,\n  useContextProvider,\n  useContext,\n  useTask$,\n} from \"@builder.io/qwik\";\nimport { isBrowser, isServer } from \"@builder.io/qwik\";\n\nexport const CTX = createContextId<{ message: string; count: number }>(\n  \"toggle\",\n);\n\nexport const CTX_LOCAL = createContextId<{ logs: string }>(\"logs\");\n\nexport const Toggle = component$(() => {\n  const store = useStore({\n    message: \"hello from root\",\n    count: 0,\n  });\n  useContextProvider(CTX, store);\n  return (\n    <div>\n      <button id=\"increment\" type=\"button\" onClick$={() => store.count++}>\n        Root increment\n      </button>\n      <ToggleShell />\n    </div>\n  );\n});\n\nexport const ToggleShell = component$(() => {\n  const store = useStore({\n    cond: false,\n    a: 2,\n    logs: \"\",\n  });\n\n  useContextProvider(CTX_LOCAL, store);\n\n  console.log(\"PARENT renders\");\n  return (\n    <div>\n      <Logs0 store={store} />\n      {!store.cond ? <ToggleA root={store} /> : <ToggleB root={store} />}\n      <button\n        type=\"button\"\n        id=\"toggle\"\n        onClick$={() => (store.cond = !store.cond)}\n      >\n        Toggle\n      </button>\n    </div>\n  );\n});\n\nexport const Logs0 = component$((props: Record<string, any>) => {\n  const rootState = useContext(CTX);\n  const logs = useContext(CTX_LOCAL);\n\n  useTask$(({ track }) => {\n    const count = track(() => rootState.count);\n    console.log(\"changed\");\n    logs.logs += `Log(${count})`;\n  });\n  console.log(\"created\");\n\n  return (\n    <div>\n      <Logs1 store={props.store} />\n    </div>\n  );\n});\n\nexport const Logs1 = component$((props: Record<string, any>) => {\n  return (\n    <div>\n      <Logs2 message={props.store.logs} />\n    </div>\n  );\n});\n\nexport const Logs2 = component$((props: Record<string, any>) => {\n  return <div id=\"logs\">Logs: {props.message}</div>;\n});\n\nexport const ToggleA = component$((props: { root: { logs: string } }) => {\n  console.log(\"ToggleA renders\");\n  const rootState = useContext(CTX);\n\n  const state = useStore({\n    mount: \"\",\n    copyCount: 0,\n  });\n\n  useTask$(({ cleanup }) => {\n    if (state.mount !== \"\") {\n      throw new Error(\"already mounted\");\n    }\n    if (isServer) {\n      state.mount = \"mounted in server\";\n    }\n    if (isBrowser) {\n      state.mount = \"mounted in client\";\n    }\n    cleanup(() => {\n      props.root.logs += \"ToggleA()\";\n    });\n  });\n\n  useTask$(({ track }) => {\n    track(() => rootState.count);\n    state.copyCount = rootState.count;\n  });\n\n  return (\n    <div>\n      <h1>ToggleA</h1>\n      <div id=\"mount\">{state.mount}</div>\n      <div id=\"root\">\n        {rootState.message} ({rootState.count}/{state.copyCount})\n      </div>\n      <Child />\n    </div>\n  );\n});\n\nexport const ToggleB = component$((props: { root: { logs: string } }) => {\n  console.log(\"ToggleB renders\");\n  const rootState = useContext(CTX);\n\n  const state = useStore({\n    mount: \"\",\n    copyCount: 0,\n  });\n\n  useTask$(({ track }) => {\n    state.copyCount = track(() => rootState.count);\n  });\n\n  useTask$(({ cleanup }) => {\n    if (state.mount !== \"\") {\n      throw new Error(\"already mounted\");\n    }\n    if (isServer) {\n      state.mount = \"mounted in server\";\n    }\n    if (isBrowser) {\n      state.mount = \"mounted in client\";\n    }\n    cleanup(() => {\n      props.root.logs += \"ToggleB()\";\n    });\n  });\n\n  return (\n    <div>\n      <h1>ToggleB</h1>\n      <div id=\"mount\">{state.mount}</div>\n      <div id=\"root\">\n        {rootState.message} ({rootState.count}/{state.copyCount})\n      </div>\n      <Child />\n    </div>\n  );\n});\n\nexport const Child = component$(() => {\n  const rootState = useContext(CTX);\n  const logs = useContext(CTX_LOCAL);\n\n  useTask$(({ track }) => {\n    const count = track(() => rootState.count);\n    console.log(\"Child\", count);\n    logs.logs += `Child(${count})`;\n  });\n\n  return <div>CHILD</div>;\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/treeshaking/treeshaking.tsx",
    "content": "/* eslint-disable */\nimport {\n  component$,\n  useStore,\n  createContextId,\n  useContextProvider,\n} from \"@builder.io/qwik\";\n\nexport const LOGS = createContextId<{ content: string }>(\"qwik.logs.resource\");\n\nexport const TreeshakingApp = component$(() => {\n  const logs = {\n    content: \"\",\n  };\n  useContextProvider(LOGS, logs);\n\n  const state = useStore({\n    text: \"text\",\n  });\n  return (\n    <div>\n      <Child text={state} />\n    </div>\n  );\n});\n\nexport const Child = component$((props: { text: { text: string } }) => {\n  const state = useStore({\n    text: \"child\",\n  });\n\n  return (\n    <div>\n      <span onClick$={() => console.log(\"hola\")}>Text: {props.text.text}</span>\n      <span>Child: {state.text}</span>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/two-listeners/twolisteners.tsx",
    "content": "import { $, component$, useStore } from \"@builder.io/qwik\";\n\nexport const TwoListeners = component$(() => {\n  const store1 = useStore({ count: 1 });\n  const store2 = useStore({ count: 1 });\n\n  const update = $(() => store2.count++);\n  return (\n    <a\n      href=\"/\"\n      preventdefault:click\n      class=\"two-listeners\"\n      onClick$={[$(() => store1.count++), update, undefined, [null, update]]}\n    >\n      {store1.count} / {store2.count}\n    </a>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/useid/useid.tsx",
    "content": "import {\n  component$,\n  useVisibleTask$,\n  useSignal,\n  useId,\n} from \"@builder.io/qwik\";\n\nexport const MIN_CHILDREN = 2;\nexport const MAX_CHIDREN = 5;\nexport const MAX_DEPTH = 5;\n\nexport const Nested = component$((props: { level: number }) => {\n  const id = useId();\n  const r =\n    Math.floor(Math.random() * (MAX_CHIDREN - MIN_CHILDREN + 1)) + MIN_CHILDREN;\n  const children = [...new Array(r).keys()];\n  return (\n    <>\n      {\" \"}\n      {props.level >= MAX_DEPTH && children.length ? (\n        id\n      ) : (\n        <ul\n          id={`${id}`}\n          key={id}\n          style=\"box-sizing: border-box; border: 1px solid #ccc; padding: 1rem; list-style: none\"\n        >\n          {id}\n          {children.map((number, idx) => (\n            <li key={`${number}-${idx}-${id}`}>\n              <Nested level={props.level + 1} />\n            </li>\n          ))}\n        </ul>\n      )}\n    </>\n  );\n});\n\nexport const UseId = component$(() => {\n  const totalIdsSignal = useSignal<number | null>(null);\n  const validIdsSignal = useSignal<number | null>(null);\n  const collsionsSignal = useSignal<number | null>(null);\n  const resultSignal = useSignal<string | null>(null);\n\n  useVisibleTask$(() => {\n    const ids = Array.from(document.querySelectorAll(\"ul[id]\"));\n\n    const uniqueIds: Set<string> = [...ids].reduce((prev, value) => {\n      prev.add(value.id);\n      return prev;\n    }, new Set() as Set<string>);\n\n    const validIdCount = [...ids].reduce((prev, curr) => {\n      const id = curr.id;\n      const isValid = !!id;\n      return prev + (isValid ? 1 : 0);\n    }, 0);\n\n    totalIdsSignal.value = ids.length;\n    validIdsSignal.value = validIdCount;\n    collsionsSignal.value = ids.length - uniqueIds.size;\n\n    resultSignal.value =\n      totalIdsSignal.value == validIdsSignal.value && collsionsSignal.value == 0\n        ? \"Passed\"\n        : \"Failed\";\n  });\n\n  return (\n    <>\n      <h1>\n        useId() Collision Test{\" \"}\n        <span\n          id=\"result\"\n          style={{ visibility: resultSignal.value ? \"visible\" : \"hidden\" }}\n        >\n          {resultSignal.value}\n        </span>\n      </h1>\n      Verify there are no id collisions from useId(). This tests generates a\n      random depth and number of children each time to inject some randomness\n      and create greater coverage over time. This test does not take into\n      consideration microfrontends, but does use q:base to generate the base\n      hash.\n      <p>\n        <b>Total IDs:</b> <span id=\"totalIds\">{totalIdsSignal.value}</span>\n      </p>\n      <p>\n        <b>Valid IDs:</b> <span id=\"validIds\">{totalIdsSignal.value}</span>\n      </p>\n      <p>\n        <b>Collisions:</b> <span id=\"collisions\">{collsionsSignal.value}</span>\n      </p>\n      <Nested key={\"nested-root\"} level={0} />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/components/watch/watch.tsx",
    "content": "/* eslint-disable */\nimport {\n  component$,\n  useTask$,\n  useStore,\n  useSignal,\n  type Signal,\n  createContextId,\n  useContext,\n  useContextProvider,\n  $,\n} from \"@builder.io/qwik\";\nimport { isServer } from \"@builder.io/qwik\";\n\ninterface State {\n  count: number;\n  doubleCount: number;\n  debounced: number;\n  server: string;\n}\n\nexport const Watch = component$(() => {\n  const nav = useStore({\n    path: \"/\",\n  });\n  const store = useStore<State>({\n    count: 2,\n    doubleCount: 0,\n    debounced: 0,\n    server: \"\",\n  });\n\n  useTask$(() => {\n    if (isServer) {\n      store.server = \"comes from server\";\n    }\n  });\n\n  // This watch should be treeshaken\n  useTask$(({ track }) => {\n    const path = track(() => nav.path);\n    console.log(path);\n  });\n\n  // Double count watch\n  useTask$(({ track }) => {\n    const count = track(() => store.count);\n    store.doubleCount = 2 * count;\n  });\n\n  // Debouncer watch\n  useTask$(({ track }) => {\n    const doubleCount = track(() => store.doubleCount);\n    const timer = setTimeout(() => {\n      store.debounced = doubleCount;\n    }, 2000);\n    return () => {\n      clearTimeout(timer);\n    };\n  });\n\n  console.log(\"PARENT renders\");\n  return <WatchShell nav={nav} store={store} />;\n});\n\nexport const WatchShell = component$(\n  ({ store }: { nav: any; store: State }) => {\n    return (\n      <div>\n        <div id=\"server-content\">{store.server}</div>\n        <div id=\"parent\">{store.count + 0}</div>\n        <Child state={store} />\n        <button id=\"add\" onClick$={() => store.count++}>\n          +\n        </button>\n        <Issue1766Root />\n        <Issue2972 />\n      </div>\n    );\n  },\n);\n\nexport const Child = component$<{ state: State }>((props) => {\n  console.log(\"CHILD renders\");\n  return (\n    <div>\n      <div id=\"child\">\n        {props.state.count} / {props.state.doubleCount}\n      </div>\n      <GrandChild state={props.state} />\n    </div>\n  );\n});\n\nexport const GrandChild = component$<{ state: State }>((props) => {\n  console.log(\"GrandChild renders\");\n  return <div id=\"debounced\">Debounced: {props.state.debounced}</div>;\n});\n\nexport const LinkPath = createContextId<{ value: string }>(\"link-path\");\n\nexport const Issue1766Root = component$(() => {\n  const loc = useStore({\n    value: \"/root\",\n  });\n\n  const final = useStore({\n    value: \"/root\",\n  });\n  useContextProvider(LinkPath, loc);\n\n  useTask$(({ track }) => {\n    const path = track(() => loc.value);\n    final.value = path.toUpperCase();\n  });\n\n  return (\n    <>\n      <Issue1766 />\n      <div id=\"issue-1766-loc\">Loc: {final.value}</div>\n    </>\n  );\n});\n\nexport const Issue1766 = component$(() => {\n  const counter = useSignal(0);\n  const second = useSignal(\"---\");\n\n  useTask$(async ({ track }) => {\n    track(counter);\n    if (counter.value !== 0) {\n      second.value = \"watch ran\";\n    }\n  });\n\n  return (\n    <div>\n      <p id=\"issue-1766\">{second.value}</p>\n      <Issue1766Child counter={counter} />\n    </div>\n  );\n});\n\ntype Props = {\n  counter: Signal<number>;\n};\n\nexport const Issue1766Child = component$<Props>(({ counter }) => {\n  const state = useStore({ show: false });\n  return (\n    <>\n      {state.show ? (\n        <>\n          <button\n            id=\"show-btn-2\"\n            onClick$={() => {\n              counter.value++;\n            }}\n          >\n            Bump In Child Component (Doesn't work)\n          </button>\n          <Link href=\"/page\" />\n        </>\n      ) : (\n        <button\n          id=\"show-btn\"\n          onClick$={() => {\n            state.show = true;\n          }}\n        >\n          Show Button\n        </button>\n      )}\n    </>\n  );\n});\n\nexport const Link = component$((props: { href: string }) => {\n  const loc = useContext(LinkPath);\n  return (\n    <button\n      id=\"link-navigate\"\n      onClick$={() => {\n        loc.value = props.href;\n      }}\n    >\n      Navigate\n    </button>\n  );\n});\n\nexport function foo(this: any) {\n  return this.value;\n}\n\nexport const Issue2972 = component$(() => {\n  const message = useSignal(\"\");\n  useTask$(async () => {\n    message.value = await $(foo).apply({ value: \"passed\" });\n  });\n\n  return (\n    <>\n      <div id=\"issue-2972\">{message.value}</div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e/src/entry.ssr.tsx",
    "content": "import {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport { Root } from \"./root\";\n\n/**\n * Entry point for server-side pre-rendering.\n *\n * @returns a promise when all of the rendering is completed.\n */\nexport default function (opts: RenderToStreamOptions) {\n  const url = new URL(opts.serverData!.url);\n\n  // Render segment instead\n  if (url.searchParams.has(\"fragment\")) {\n    return renderToStream(\n      <>\n        <Root pathname={url.pathname} />\n      </>,\n      {\n        debug: true,\n        containerTagName: \"container\",\n        // streaming: {\n        //   inOrder: {\n        //     buffering: 'marks',\n        //   },\n        // },\n        qwikLoader: {\n          include:\n            url.searchParams.get(\"loader\") === \"false\" ? \"never\" : \"auto\",\n        },\n        ...opts,\n      },\n    );\n  }\n\n  return renderToStream(\n    <>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik Blank App</title>\n      </head>\n      <body>\n        <Root pathname={url.pathname} />\n      </body>\n    </>,\n    {\n      debug: true,\n      ...opts,\n    },\n  );\n}\n"
  },
  {
    "path": "starters/apps/e2e/src/global.css",
    "content": "/**\n * Write here your global css styles\n */\n"
  },
  {
    "path": "starters/apps/e2e/src/root.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { FunctionComponent } from \"@builder.io/qwik\";\nimport { Async } from \"./components/async/async\";\nimport { Attributes } from \"./components/attributes/attributes\";\nimport { BroadcastEvents } from \"./components/broadcast-events/broadcast-event\";\nimport { BuildVariables } from \"./components/build-variables/build\";\nimport { ComputedRoot } from \"./components/computed/computed\";\nimport { Containers } from \"./components/containers/container\";\nimport { ContextRoot } from \"./components/context/context\";\nimport { EffectClient } from \"./components/effect-client/effect-client\";\nimport { Events } from \"./components/events/events\";\nimport { EventsClient } from \"./components/events/events-client\";\nimport { Factory } from \"./components/factory/factory\";\nimport { LexicalScope } from \"./components/lexical-scope/lexicalScope\";\nimport { MountRoot } from \"./components/mount/mount\";\nimport { NoResume } from \"./components/no-resume/no-resume\";\nimport { RefRoot } from \"./components/ref/ref\";\nimport { Render } from \"./components/render/render\";\nimport { ResourceApp } from \"./components/resource/resource\";\nimport { ResourceFn } from \"./components/resource/resource-fn\";\nimport { ResourceSerialization } from \"./components/resource/resource-serialization\";\nimport { Weather } from \"./components/resource/weather\";\nimport { Resuming1 } from \"./components/resuming/resuming\";\nimport Issue5001 from \"./components/signals/Issue_5001\";\nimport { Signals } from \"./components/signals/signals\";\nimport { SlotParent } from \"./components/slot/slot\";\nimport { StreamingRoot } from \"./components/streaming/streaming\";\nimport { Styles } from \"./components/styles/styles\";\nimport { Toggle } from \"./components/toggle/toggle\";\nimport { TreeshakingApp } from \"./components/treeshaking/treeshaking\";\nimport { TwoListeners } from \"./components/two-listeners/twolisteners\";\nimport { UseId } from \"./components/useid/useid\";\nimport { Watch } from \"./components/watch/watch\";\nimport { SyncQRL } from \"./components/resuming/sync-qrl\";\n// import { RenderExceptions, UseTaskExceptions } from \"./components/exceptions\";\n\nimport \"./global.css\";\n\nconst tests: Record<string, FunctionComponent> = {\n  \"/e2e/two-listeners\": () => <TwoListeners />,\n  \"/e2e/use-id\": () => <UseId />,\n  \"/e2e/slot\": () => <SlotParent />,\n  \"/e2e/lexical-scope\": () => <LexicalScope />,\n  \"/e2e/render\": () => <Render />,\n  \"/e2e/events\": () => <Events />,\n  \"/e2e/async\": () => <Async />,\n  \"/e2e/container\": () => <Containers />,\n  \"/e2e/factory\": () => <Factory />,\n  \"/e2e/watch\": () => <Watch />,\n  \"/e2e/effect-client\": () => <EffectClient />,\n  \"/e2e/context\": () => <ContextRoot />,\n  \"/e2e/toggle\": () => <Toggle />,\n  \"/e2e/styles\": () => <Styles />,\n  \"/e2e/broadcast-events\": () => <BroadcastEvents />,\n  \"/e2e/weather\": () => <Weather />,\n  \"/e2e/resource\": () => <ResourceApp />,\n  \"/e2e/resource-serialization\": () => <ResourceSerialization />,\n  \"/e2e/resource-fn\": () => <ResourceFn />,\n  \"/e2e/treeshaking\": () => <TreeshakingApp />,\n  \"/e2e/streaming\": () => <StreamingRoot />,\n  \"/e2e/mount\": () => <MountRoot />,\n  \"/e2e/ref\": () => <RefRoot />,\n  \"/e2e/signals\": () => <Signals />,\n  \"/e2e/signals/issue-5001\": () => <Issue5001 />,\n  \"/e2e/attributes\": () => <Attributes />,\n  \"/e2e/events-client\": () => <EventsClient />,\n  \"/e2e/no-resume\": () => <NoResume />,\n  \"/e2e/resuming\": () => <Resuming1 />,\n  \"/e2e/sync-qrl\": () => <SyncQRL />,\n  \"/e2e/computed\": () => <ComputedRoot />,\n  \"/e2e/build-variables\": () => <BuildVariables />,\n  // \"/e2e/exception/render\": () => <RenderExceptions />,\n  // \"/e2e/exception/use-task\": () => <UseTaskExceptions />,\n};\n\nexport const Root = component$<{ pathname: string }>(({ pathname }) => {\n  const Test = tests[pathname];\n  if (Test) {\n    return <Test />;\n  }\n  return (\n    <section>\n      {Object.keys(tests)\n        .sort()\n        .map((testPath) => (\n          <p key={testPath}>\n            <a href={testPath}>{testPath.replace(/^\\/e2e\\//, \"\")}</a>\n          </p>\n        ))}\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/apps/e2e-library/package.json",
    "content": "{\n  \"name\": \"e2e-library\",\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "starters/apps/empty/package.json",
    "content": "{\n  \"name\": \"qwik-empty-starter\",\n  \"description\": \"Blank project with routing included\",\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"priority\": 1,\n    \"displayName\": \"Empty App (Qwik City + Qwik)\",\n    \"qwikCity\": true,\n    \"docs\": [\n      \"https://qwik.dev/docs/getting-started/\"\n    ]\n  }\n}\n"
  },
  {
    "path": "starters/apps/empty/public/manifest.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/web-manifest-combined.json\",\n  \"name\": \"qwik-project-name\",\n  \"short_name\": \"Welcome to Qwik\",\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"background_color\": \"#fff\",\n  \"description\": \"A Qwik project app.\"\n}\n"
  },
  {
    "path": "starters/apps/empty/public/robots.txt",
    "content": ""
  },
  {
    "path": "starters/apps/empty/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useDocumentHead, useLocation } from \"@builder.io/qwik-city\";\n\n/**\n * The RouterHead component is placed inside of the document `<head>` element.\n */\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.url.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n\n      {head.meta.map((m) => (\n        <meta key={m.key} {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link key={l.key} {...l} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.style })}\n        />\n      ))}\n\n      {head.scripts.map((s) => (\n        <script\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.script })}\n        />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/empty/src/global.css",
    "content": ""
  },
  {
    "path": "starters/apps/empty/src/root.tsx",
    "content": "import { component$, isDev } from \"@builder.io/qwik\";\nimport { QwikCityProvider, RouterOutlet } from \"@builder.io/qwik-city\";\nimport { RouterHead } from \"./components/router-head/router-head\";\n\nimport \"./global.css\";\n\nexport default component$(() => {\n  /**\n   * The root of a QwikCity site always start with the <QwikCityProvider> component,\n   * immediately followed by the document's <head> and <body>.\n   *\n   * Don't remove the `<head>` and `<body>` elements.\n   */\n\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charset=\"utf-8\" />\n        {!isDev && (\n          <link\n            rel=\"manifest\"\n            href={`${import.meta.env.BASE_URL}manifest.json`}\n          />\n        )}\n        <RouterHead />\n      </head>\n      <body lang=\"en\">\n        <RouterOutlet />\n      </body>\n    </QwikCityProvider>\n  );\n});\n"
  },
  {
    "path": "starters/apps/empty/src/routes/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <>\n      <h1>Hi 👋</h1>\n      <div>\n        Can't wait to see what you build with qwik!\n        <br />\n        Happy coding.\n      </div>\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Welcome to Qwik\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Qwik site description\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/apps/library/.prettierignore",
    "content": "# Files Prettier should not format\n**/*.log\n**/.DS_Store\n*.\ndist\nnode_modules\n"
  },
  {
    "path": "starters/apps/library/README.md",
    "content": "# Qwik Library ⚡️\n\n- [Qwik Docs](https://qwik.dev/)\n- [Discord](https://qwik.dev/chat)\n- [Qwik on GitHub](https://github.com/QwikDev/qwik)\n- [@QwikDev](https://twitter.com/QwikDev)\n- [Vite](https://vitejs.dev/)\n- [Partytown](https://partytown.qwik.dev/)\n- [Mitosis](https://github.com/BuilderIO/mitosis)\n- [Builder.io](https://www.builder.io/)\n\n---\n\n## Project Structure\n\nInside your project, you'll see the following directories and files:\n\n```\n├── public/\n│   └── ...\n└── src/\n    ├── components/\n    │   └── ...\n    └── index.ts\n```\n\n- `src/components`: Recommended directory for components.\n\n- `index.ts`: The entry point of your component library, make sure all the public components are exported from this file.\n\n## Development\n\nDevelopment mode uses [Vite's development server](https://vitejs.dev/). For Qwik during development, the `dev` command will also server-side render (SSR) the output. The client-side development modules are loaded by the browser.\n\n```\nnpm run dev\n```\n\n> Note: during dev mode, Vite will request many JS files, which does not represent a Qwik production build.\n\n## Production\n\nThe production build should generate the production build of your component library in (./lib) and the typescript type definitions in (./lib-types).\n\n```\nnpm run build\n```\n\n## sideEffects: false\n\nThis package is configured with \"sideEffects\": false in its package.json.<br/>\nThis tells bundlers that the module [has no side effects](https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free) when imported.<br/>\nConsequently, to maintain the integrity of tree-shaking optimizations, please ensure your code truly contains no side effects (such as modifying global variables or the DOM upon import).<br/>\nIf your module does introduce side effects, remove \"sideEffects\": false or specify the specific files with side effects.<br/>\nBe sure to only remove it from the specific file where the global is being set. Finally, verify that your build continues to function as expected after making any adjustments to the sideEffects setting.\n"
  },
  {
    "path": "starters/apps/library/eslint.config.js",
    "content": "import js from \"@eslint/js\";\nimport globals from \"globals\";\nimport tseslint from \"typescript-eslint\";\nimport { globalIgnores } from \"eslint/config\";\nimport { qwikEslint9Plugin } from \"eslint-plugin-qwik\";\n\nconst ignores = [\n  \"**/*.log\",\n  \"**/.DS_Store\",\n  \"**/*.\",\n  \".vscode/settings.json\",\n  \"**/.history\",\n  \"**/.yarn\",\n  \"**/bazel-*\",\n  \"**/bazel-bin\",\n  \"**/bazel-out\",\n  \"**/bazel-qwik\",\n  \"**/bazel-testlogs\",\n  \"**/dist\",\n  \"**/dist-dev\",\n  \"**/lib\",\n  \"**/lib-types\",\n  \"**/etc\",\n  \"**/external\",\n  \"**/node_modules\",\n  \"**/temp\",\n  \"**/tsc-out\",\n  \"**/tsdoc-metadata.json\",\n  \"**/target\",\n  \"**/output\",\n  \"**/rollup.config.js\",\n  \"**/build\",\n  \"**/.cache\",\n  \"**/.vscode\",\n  \"**/.rollup.cache\",\n  \"**/dist\",\n  \"**/tsconfig.tsbuildinfo\",\n  \"**/vite.config.ts\",\n  \"**/*.spec.tsx\",\n  \"**/*.spec.ts\",\n  \"**/.netlify\",\n  \"**/pnpm-lock.yaml\",\n  \"**/package-lock.json\",\n  \"**/yarn.lock\",\n  \"**/server\",\n  \"eslint.config.js\",\n];\n\nexport default tseslint.config(\n  globalIgnores(ignores),\n  js.configs.recommended,\n  tseslint.configs.recommended,\n  qwikEslint9Plugin.configs.recommended,\n  {\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        ...globals.node,\n        ...globals.es2021,\n        ...globals.serviceworker,\n      },\n      parserOptions: {\n        projectService: true,\n        tsconfigRootDir: import.meta.dirname,\n      },\n    },\n  },\n);\n"
  },
  {
    "path": "starters/apps/library/gitignore",
    "content": "# Build\n/dist\n/lib\n/lib-types\n/server\n\n# Development\nnode_modules\n\n# Cache\n.cache\n.mf\n.vscode\n.rollup.cache\ntsconfig.tsbuildinfo\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\n# Editor\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n\n# Yarn\n.yarn/*\n!.yarn/releases\n"
  },
  {
    "path": "starters/apps/library/package.json",
    "content": "{\n  \"name\": \"qwik-library-name\",\n  \"description\": \"Create a Qwik library\",\n  \"version\": \"0.0.1\",\n  \"private\": false,\n  \"main\": \"./lib/index.qwik.mjs\",\n  \"qwik\": \"./lib/index.qwik.mjs\",\n  \"types\": \"./lib-types/index.d.ts\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./lib/index.qwik.mjs\",\n      \"require\": \"./lib/index.qwik.cjs\",\n      \"types\": \"./lib-types/index.d.ts\"\n    }\n  },\n  \"files\": [\n    \"lib\",\n    \"lib-types\"\n  ],\n  \"scripts\": {\n    \"build\": \"qwik build\",\n    \"build.lib\": \"vite build --mode lib\",\n    \"build.types\": \"tsc --emitDeclarationOnly\",\n    \"dev\": \"vite --mode ssr\",\n    \"dev.debug\": \"node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"fmt\": \"prettier --write .\",\n    \"fmt.check\": \"prettier --check .\",\n    \"lint\": \"eslint \\\"src/**/*.ts*\\\"\",\n    \"test\": \"echo \\\"No test specified\\\" && exit 0\",\n    \"start\": \"vite --open --mode ssr\",\n    \"qwik\": \"qwik\",\n    \"release\": \"np\"\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik\": \"latest\",\n    \"@eslint/js\": \"^9\",\n    \"@types/node\": \"latest\",\n    \"typescript-eslint\": \"latest\",\n    \"eslint\": \"^9\",\n    \"eslint-plugin-qwik\": \"latest\",\n    \"globals\": \"latest\",\n    \"np\": \"^8.0.4\",\n    \"prettier\": \"latest\",\n    \"typescript\": \"latest\",\n    \"undici\": \"latest\",\n    \"vite\": \"latest\",\n    \"vite-tsconfig-paths\": \"^4.2.1\"\n  },\n  \"__qwik__\": {\n    \"displayName\": \"Library (Qwik)\",\n    \"priority\": -1,\n    \"docs\": [\n      \"https://qwik.dev/docs/getting-started/\"\n    ]\n  },\n  \"sideEffects\": false\n}\n"
  },
  {
    "path": "starters/apps/library/src/components/counter/counter.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport const Counter = component$(() => {\n  const count = useSignal(0);\n\n  return (\n    <div>\n      <p>Count: {count.value}</p>\n      <p>\n        <button onClick$={() => count.value++}>Increment</button>\n      </p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/library/src/components/logo/logo.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport const Logo = component$(() => {\n  return (\n    <div>\n      <a href=\"https://qwik.dev/\">\n        <img\n          alt=\"Qwik Logo\"\n          width={400}\n          height={147}\n          src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F667ab6c2283d4c4d878fb9083aacc10f\"\n        />\n      </a>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/library/src/entry.dev.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Development entry point using only client-side modules:\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nimport { render, type RenderOptions } from \"@builder.io/qwik\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/library/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this\n * entry point will be the common one.\n *\n * - Server (express, cloudflare...)\n * - npm run start\n * - npm run preview\n * - npm run build\n *\n */\nimport {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/library/src/index.ts",
    "content": "export { Logo } from \"./components/logo/logo\";\nexport { Counter } from \"./components/counter/counter\";\n"
  },
  {
    "path": "starters/apps/library/src/root.tsx",
    "content": "import { Counter } from \"./components/counter/counter\";\nimport { Logo } from \"./components/logo/logo\";\n\nexport default () => {\n  return (\n    <>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik Blank App</title>\n      </head>\n      <body>\n        <Logo />\n        <Counter />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "starters/apps/library/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2020\",\n    \"lib\": [\"es2020\", \"DOM\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"declaration\": true,\n    \"declarationDir\": \"lib-types\",\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"types\": [\"vite/client\"]\n  },\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "starters/apps/library/vite.config.ts",
    "content": "import { defineConfig } from \"vite\";\nimport pkg from \"./package.json\";\nimport { qwikVite } from \"@builder.io/qwik/optimizer\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\n\nconst { dependencies = {}, peerDependencies = {} } = pkg as any;\nconst makeRegex = (dep) => new RegExp(`^${dep}(/.*)?$`);\nconst excludeAll = (obj) => Object.keys(obj).map(makeRegex);\n\nexport default defineConfig(() => {\n  return {\n    build: {\n      target: \"es2020\",\n      lib: {\n        entry: \"./src/index.ts\",\n        formats: [\"es\", \"cjs\"],\n        fileName: (format, entryName) =>\n          `${entryName}.qwik.${format === \"es\" ? \"mjs\" : \"cjs\"}`,\n      },\n      rollupOptions: {\n        output: {\n          preserveModules: true,\n          preserveModulesRoot: \"src\",\n        },\n        // externalize deps that shouldn't be bundled into the library\n        external: [\n          /^node:.*/,\n          ...excludeAll(dependencies),\n          ...excludeAll(peerDependencies),\n        ],\n      },\n    },\n    plugins: [qwikVite(), tsconfigPaths({ root: \".\" })],\n  };\n});\n"
  },
  {
    "path": "starters/apps/perf.prod/package.json",
    "content": "{\n  \"description\": \"Qwik Performance starter app.\",\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"priority\": 0\n  }\n}\n"
  },
  {
    "path": "starters/apps/perf.prod/src/components/app/app.tsx",
    "content": "import { component$, useStore } from \"@builder.io/qwik\";\n\nlet idCounter = 1;\nconst adjectives = [\n    \"pretty\",\n    \"large\",\n    \"big\",\n    \"small\",\n    \"tall\",\n    \"short\",\n    \"long\",\n    \"handsome\",\n    \"plain\",\n    \"quaint\",\n    \"clean\",\n    \"elegant\",\n    \"easy\",\n    \"angry\",\n    \"crazy\",\n    \"helpful\",\n    \"mushy\",\n    \"odd\",\n    \"unsightly\",\n    \"adorable\",\n    \"important\",\n    \"inexpensive\",\n    \"cheap\",\n    \"expensive\",\n    \"fancy\",\n  ],\n  colours = [\n    \"red\",\n    \"yellow\",\n    \"blue\",\n    \"green\",\n    \"pink\",\n    \"brown\",\n    \"purple\",\n    \"brown\",\n    \"white\",\n    \"black\",\n    \"orange\",\n  ],\n  nouns = [\n    \"table\",\n    \"chair\",\n    \"house\",\n    \"bbq\",\n    \"desk\",\n    \"car\",\n    \"pony\",\n    \"cookie\",\n    \"sandwich\",\n    \"burger\",\n    \"pizza\",\n    \"mouse\",\n    \"keyboard\",\n  ];\n\nfunction _random(max: number) {\n  return Math.round(Math.random() * 1000) % max;\n}\n\nexport function buildData(count: number) {\n  const data = new Array(count);\n  for (let i = 0; i < count; i++) {\n    data[i] = {\n      id: idCounter++,\n      label: `${adjectives[_random(adjectives.length)]} ${\n        colours[_random(colours.length)]\n      } ${nouns[_random(nouns.length)]}`,\n    };\n  }\n  return data;\n}\n\ntype BenchState = {\n  data: Array<{ id: number; label: string }>;\n  selected: number | null;\n};\nexport const App = component$(() => {\n  const state = useStore<BenchState>({ data: [], selected: null });\n  return (\n    <div class=\"container\">\n      <div class=\"jumbotron\">\n        <div class=\"row\">\n          <div class=\"col-md-6\">\n            <h1>Qwik Keyed</h1>\n          </div>\n          <div class=\"col-md-6\">\n            <div class=\"row\">\n              <div class=\"col-sm-6 smallpad\">\n                <button\n                  id=\"run\"\n                  class=\"btn btn-primary btn-block\"\n                  type=\"button\"\n                  onClick$={() => (state.data = buildData(1000))}\n                >\n                  Create 1,000 rows\n                </button>\n                <button\n                  id=\"runlots\"\n                  class=\"btn btn-primary btn-block\"\n                  type=\"button\"\n                  onClick$={() => (state.data = buildData(10000))}\n                >\n                  Create 10,000 rows\n                </button>\n                <button\n                  id=\"add\"\n                  class=\"btn btn-primary btn-block\"\n                  type=\"button\"\n                  onClick$={() =>\n                    (state.data = state.data.concat(buildData(1000)))\n                  }\n                >\n                  Append 1,000 rows\n                </button>\n                <button\n                  id=\"update\"\n                  class=\"btn btn-primary btn-block\"\n                  type=\"button\"\n                  onClick$={() => {\n                    for (\n                      let i = 0, d = state.data, len = d.length;\n                      i < len;\n                      i += 10\n                    ) {\n                      d[i].label += \" !!!\";\n                    }\n                  }}\n                >\n                  Update every 10th row\n                </button>\n                <button\n                  id=\"clear\"\n                  class=\"btn btn-primary btn-block\"\n                  type=\"button\"\n                  onClick$={() => (state.data = [])}\n                >\n                  Clear\n                </button>\n                <button\n                  id=\"swaprows\"\n                  class=\"btn btn-primary btn-block\"\n                  type=\"button\"\n                  onClick$={() => {\n                    const d = state.data.slice();\n                    if (d.length > 998) {\n                      const tmp = d[1];\n                      d[1] = d[998];\n                      d[998] = tmp;\n                      state.data = d;\n                    }\n                  }}\n                >\n                  Swap Rows\n                </button>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n      <table class=\"table table-hover table-striped test-data\">\n        <tbody>\n          {state.data.map(({ id, label }) => {\n            return (\n              <tr key={id} class={id === state.selected ? \"danger\" : \"\"}>\n                <td class=\"col-md-1\">{id}</td>\n                <td class=\"col-md-4\">\n                  <a onClick$={() => alert(label)}>{label}</a>\n                </td>\n                <td class=\"col-md-1\">\n                  <a\n                  // onClick$={() => {\n                  //   const d = state.data;\n                  //   d.splice(\n                  //     d.findIndex((d) => d.id === id),\n                  //     1\n                  //   );\n                  // }}\n                  >\n                    <span\n                      class=\"glyphicon glyphicon-remove\"\n                      ariaHidden=\"true\"\n                    />\n                  </a>\n                </td>\n                <td class=\"col-md-6\" />\n              </tr>\n            );\n          })}\n        </tbody>\n      </table>\n      <span class=\"preloadicon glyphicon glyphicon-remove\" ariaHidden=\"true\" />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/perf.prod/src/entry.express.tsx",
    "content": "import express from \"express\";\nimport { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport render from \"./entry.ssr\";\n\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\n\n/**\n * Create an express server\n * https://expressjs.com/\n */\nconst app = express();\n\n/**\n * Serve static client build files,\n * hashed filenames, immutable cache-control\n */\napp.use(\n  \"/build\",\n  express.static(join(__dirname, \"..\", \"dist\", \"build\"), {\n    immutable: true,\n    maxAge: \"1y\",\n  }),\n);\n\n/**\n * Serve static public files at the root\n */\napp.use(express.static(join(__dirname, \"..\", \"dist\"), { index: false }));\n\n/**\n * Server-Side Render Qwik application\n */\napp.get(\"/*\", async (req, res, next) => {\n  try {\n    // Render the Root component to a string\n    const result = await render({\n      stream: res,\n    });\n\n    // respond with SSR'd HTML\n    if (\"html\" in result) {\n      res.send((result as any).html);\n    } else {\n      res.end();\n    }\n  } catch (e) {\n    // Error while server-side rendering\n    next(e);\n  }\n});\n\n/**\n * Start the express server\n */\napp.listen(8080, () => {\n  /* eslint-disable */\n  console.log(`http://localhost:8080/`);\n});\n"
  },
  {
    "path": "starters/apps/perf.prod/src/entry.ssr.tsx",
    "content": "import { renderToStream, RenderToStreamOptions } from \"@builder.io/qwik/server\";\nimport Root from \"./root\";\n\n/**\n * Server-Side Render method to be called by a server.\n */\nexport default function (opts: RenderToStreamOptions) {\n  // Render the Root component to a string\n  // Pass in the manifest that was generated from the client build\n  return renderToStream(<Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/perf.prod/src/global.css",
    "content": "/**\n * Write here your global css styles\n */\n"
  },
  {
    "path": "starters/apps/perf.prod/src/root.tsx",
    "content": "import { App } from \"./components/app/app\";\n\nimport \"./global.css\";\n\nexport default () => {\n  return (\n    <html>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik Blank App</title>\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n      </head>\n      <body>\n        <App />\n      </body>\n    </html>\n  );\n};\n"
  },
  {
    "path": "starters/apps/perf.prod/vite.config.mts",
    "content": "import { defineConfig } from \"vite\";\nimport { qwikVite } from \"@builder.io/qwik/optimizer\";\nexport default defineConfig({\n  plugins: [\n    qwikVite({\n      debug: true,\n    }),\n  ],\n  build: {\n    minify: true,\n  },\n});\n"
  },
  {
    "path": "starters/apps/playground/package.json",
    "content": "{\n  \"name\": \"qwik-basic-starter\",\n  \"description\": \"Demo app with sample routes\",\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"priority\": 2,\n    \"displayName\": \"Playground App (Qwik City + Qwik)\",\n    \"qwikCity\": true,\n    \"docs\": [\n      \"https://qwik.dev/docs/getting-started/\"\n    ]\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/public/manifest.json",
    "content": "{\n  \"$schema\": \"https://json.schemastore.org/web-manifest-combined.json\",\n  \"name\": \"qwik-project-name\",\n  \"short_name\": \"Welcome to Qwik\",\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"background_color\": \"#fff\",\n  \"description\": \"A Qwik project app.\"\n}\n"
  },
  {
    "path": "starters/apps/playground/public/robots.txt",
    "content": ""
  },
  {
    "path": "starters/apps/playground/src/components/router-head/router-head.tsx",
    "content": "import { useDocumentHead, useLocation } from \"@builder.io/qwik-city\";\n\nimport { component$ } from \"@builder.io/qwik\";\n\n/**\n * The RouterHead component is placed inside of the document `<head>` element.\n */\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.url.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n\n      {head.meta.map((m) => (\n        <meta key={m.key} {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link key={l.key} {...l} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.style })}\n        />\n      ))}\n\n      {head.scripts.map((s) => (\n        <script\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.script })}\n        />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/counter/counter.module.css",
    "content": ".counter-wrapper {\n  margin-top: 50px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n}\n\n@media screen and (min-width: 768px) {\n  .counter-wrapper {\n    gap: 30px;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/counter/counter.tsx",
    "content": "import { component$, useSignal, $ } from \"@builder.io/qwik\";\nimport styles from \"./counter.module.css\";\nimport Gauge from \"../gauge\";\n\nexport default component$(() => {\n  const count = useSignal(70);\n\n  const setCount = $((newValue: number) => {\n    if (newValue < 0 || newValue > 100) {\n      return;\n    }\n    count.value = newValue;\n  });\n\n  return (\n    <div class={styles[\"counter-wrapper\"]}>\n      <button\n        class=\"button-dark button-small\"\n        onClick$={() => setCount(count.value - 1)}\n      >\n        -\n      </button>\n      <Gauge value={count.value} />\n      <button\n        class=\"button-dark button-small\"\n        onClick$={() => setCount(count.value + 1)}\n      >\n        +\n      </button>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/footer/footer.module.css",
    "content": ".anchor {\n  color: white !important;\n  display: block;\n  font-size: 0.8rem;\n  text-align: center;\n  text-decoration: none;\n  line-height: 1.5;\n}\n\n.anchor span:not(.spacer) {\n  display: block;\n}\n\n.spacer {\n  display: none;\n  padding: 0 15px;\n}\n\n@media screen and (min-width: 768px) {\n  .anchor span {\n    display: inline !important;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/footer/footer.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useServerTimeLoader } from \"../../../routes/layout\";\nimport styles from \"./footer.module.css\";\n\nexport default component$(() => {\n  const serverTime = useServerTimeLoader();\n\n  return (\n    <footer>\n      <div class=\"container\">\n        <a href=\"https://www.builder.io/\" target=\"_blank\" class={styles.anchor}>\n          <span>Made with ♡ by Builder.io</span>\n          <span class={styles.spacer}>|</span>\n          <span>{serverTime.value.date}</span>\n        </a>\n      </div>\n    </footer>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/gauge/gauge.module.css",
    "content": ".wrapper {\n  position: relative;\n}\n\n.gauge {\n  width: 160px;\n}\n\n.value {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  color: white;\n  font-size: 3rem;\n  transform: translate(-50%, -50%);\n  width: 200px;\n  text-align: center;\n}\n\n@media screen and (min-width: 768px) {\n  .gauge {\n    width: 400px;\n  }\n  .value {\n    font-size: 7rem;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/gauge/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport styles from \"./gauge.module.css\";\n\nexport default component$(({ value = 50 }: { value?: number }) => {\n  const safeValue = value < 0 || value > 100 ? 50 : value;\n\n  return (\n    <div class={styles.wrapper}>\n      <svg viewBox=\"0 0 120 120\" class={styles.gauge}>\n        <defs>\n          <linearGradient id=\"gradient\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n            <stop offset=\"0%\" stop-color=\"#18B6F6\" />\n            <stop offset=\"1000%\" stop-color=\"#AC7FF4\" />\n          </linearGradient>\n        </defs>\n\n        <circle\n          r=\"56\"\n          cx=\"60\"\n          cy=\"60\"\n          stroke-width=\"8\"\n          style=\"fill: #000; stroke: #0000\"\n        ></circle>\n\n        <circle\n          r=\"56\"\n          cx=\"60\"\n          cy=\"60\"\n          stroke-width=\"8\"\n          style={`transform: rotate(-87.9537deg); stroke-dasharray: ${\n            safeValue * 3.51\n          }, 351.858; fill:none; transform-origin:50% 50%; stroke-linecap:round; stroke:url(#gradient)`}\n        ></circle>\n      </svg>\n      <span class={styles.value}>{safeValue}</span>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/header/header.module.css",
    "content": ".wrapper {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n}\n\n.logo {\n  display: inline-block;\n}\n.logo a {\n  display: block;\n}\n\n.header ul {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  display: flex;\n  gap: 30px;\n}\n\n.header li {\n  display: none;\n  margin: 0;\n  padding: 0;\n  font-size: 0.7rem;\n}\n\n.header li a {\n  color: white;\n  display: inline-block;\n  padding: 0;\n  text-decoration: none;\n}\n\n.header li a:hover {\n  color: var(--qwik-light-blue);\n}\n\n@media (min-width: 450px) {\n  .header li {\n    display: inline-block;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/header/header.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { QwikLogo } from \"../icons/qwik\";\nimport styles from \"./header.module.css\";\n\nexport default component$(() => {\n  return (\n    <header class={styles.header}>\n      <div class={[\"container\", styles.wrapper]}>\n        <div class={styles.logo}>\n          <a href=\"/\" title=\"qwik\">\n            <QwikLogo height={50} width={143} />\n          </a>\n        </div>\n        <ul>\n          <li>\n            <a href=\"https://qwik.dev/docs/core/overview/\" target=\"_blank\">\n              Docs\n            </a>\n          </li>\n          <li>\n            <a\n              href=\"https://qwik.dev/examples/introduction/hello-world/\"\n              target=\"_blank\"\n            >\n              Examples\n            </a>\n          </li>\n          <li>\n            <a\n              href=\"https://qwik.dev/tutorial/welcome/overview/\"\n              target=\"_blank\"\n            >\n              Tutorials\n            </a>\n          </li>\n        </ul>\n      </div>\n    </header>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/hero/hero.module.css",
    "content": ".hero {\n  display: flex;\n  vertical-align: middle;\n  flex-direction: column;\n  flex-wrap: nowrap;\n  align-items: center;\n  height: 450px;\n  justify-content: center;\n  gap: 40px;\n}\n\n.hero-image {\n  width: 100%;\n  position: absolute;\n  height: auto;\n  object-fit: cover;\n  z-index: -1;\n  opacity: 0.2;\n  pointer-events: none;\n}\n\n.hero p {\n  color: white;\n  margin: 0;\n  font-size: 1rem;\n}\n\n.button-group {\n  display: flex;\n  flex-direction: row;\n  gap: 24px;\n}\n\n@media screen and (min-width: 768px) {\n  .hero {\n    gap: 60px;\n    height: 500px;\n  }\n\n  .hero p {\n    font-size: 1.3rem;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/hero/hero.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport styles from \"./hero.module.css\";\nimport ImgThunder from \"../../../media/thunder.png?jsx\";\n\nexport default component$(() => {\n  return (\n    <div class={[\"container\", styles.hero]}>\n      <ImgThunder class={styles[\"hero-image\"]} alt=\"Image thunder\" />\n      <h1>\n        So <span class=\"highlight\">fantastic</span>\n        <br />\n        to have <span class=\"highlight\">you</span> here\n      </h1>\n      <p>Have fun building your App with Qwik.</p>\n      <div class={styles[\"button-group\"]}>\n        <button\n          onClick$={async () => {\n            const defaults = {\n              spread: 360,\n              ticks: 70,\n              gravity: 0,\n              decay: 0.95,\n              startVelocity: 30,\n              colors: [\"006ce9\", \"ac7ff4\", \"18b6f6\", \"713fc2\", \"ffffff\"],\n              origin: {\n                x: 0.5,\n                y: 0.35,\n              },\n            };\n\n            function loadConfetti() {\n              return new Promise<(opts: any) => void>((resolve, reject) => {\n                if ((globalThis as any).confetti) {\n                  return resolve((globalThis as any).confetti as any);\n                }\n                const script = document.createElement(\"script\");\n                script.src =\n                  \"https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js\";\n                script.onload = () =>\n                  resolve((globalThis as any).confetti as any);\n                script.onerror = reject;\n                document.head.appendChild(script);\n                script.remove();\n              });\n            }\n\n            const confetti = await loadConfetti();\n\n            function shoot() {\n              confetti({\n                ...defaults,\n                particleCount: 80,\n                scalar: 1.2,\n              });\n\n              confetti({\n                ...defaults,\n                particleCount: 60,\n                scalar: 0.75,\n              });\n            }\n\n            setTimeout(shoot, 0);\n            setTimeout(shoot, 100);\n            setTimeout(shoot, 200);\n            setTimeout(shoot, 300);\n            setTimeout(shoot, 400);\n          }}\n        >\n          Time to celebrate\n        </button>\n        <a\n          href=\"https://qwik.dev/docs\"\n          target=\"_blank\"\n          class=\"button button-dark\"\n        >\n          Explore the docs\n        </a>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/icons/qwik.tsx",
    "content": "export const QwikLogo = ({\n  width = 100,\n  height = 35,\n}: {\n  width?: number;\n  height?: number;\n}) => (\n  <svg\n    width={width}\n    height={height}\n    viewBox=\"0 0 167 53\"\n    fill=\"none\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <path\n      d=\"M81.9545 46.5859H75.5513V35.4045C73.4363 36.8579 71.0496 37.5749 68.4884 37.5749C65.0151 37.5749 62.4344 36.6253 60.8239 34.6487C59.2134 32.6915 58.3984 29.2034 58.3984 24.2231C58.3984 19.1266 59.3492 15.5997 61.2702 13.5456C63.23 11.4721 66.3734 10.4644 70.7004 10.4644C74.7946 10.4644 78.5201 11.0264 81.9545 12.131V46.5859ZM75.5513 16.278C74.096 15.8323 72.4661 15.6191 70.7004 15.6191C68.5272 15.6191 66.9749 16.1811 66.1017 17.3244C65.2479 18.4871 64.7823 20.6962 64.7823 23.9712C64.7823 27.0524 65.1897 29.1065 66.0435 30.2304C66.8973 31.335 68.3719 31.897 70.5452 31.897C73.3781 31.897 75.5513 30.7343 75.5513 29.2809V16.278Z\"\n      fill=\"white\"\n    />\n    <path\n      d=\"M91.133 11.1426C93.4033 17.4406 95.3242 23.7386 96.993 30.0948C99.205 23.5836 101.087 17.2856 102.542 11.1426H108.15C110.265 17.4406 112.031 23.7386 113.447 30.0948C115.97 23.196 117.949 16.8787 119.404 11.1426H125.71C123.033 20.173 120.064 28.777 116.785 36.8966H109.256C108.402 32.3039 107.044 26.7617 105.22 20.1536C104.056 25.2889 102.445 30.8893 100.33 36.8966H92.8018C90.2793 27.5174 87.5434 18.9522 84.6328 11.1426H91.133Z\"\n      fill=\"white\"\n    />\n    <path\n      d=\"M132.832 7.55758C129.999 7.55758 129.203 6.85996 129.203 3.97257C129.203 1.39523 130.018 0.794495 132.832 0.794495C135.665 0.794495 136.46 1.39523 136.46 3.97257C136.46 6.85996 135.665 7.55758 132.832 7.55758ZM129.649 11.1426H136.053V36.8966H129.649V11.1426Z\"\n      fill=\"white\"\n    />\n    <path\n      d=\"M166.303 11.1426C161.763 17.5956 158.581 21.5295 156.815 22.9441C158.27 23.8937 162.17 28.8933 167.002 36.916H159.628C153.613 27.7887 150.742 23.8549 149.325 23.2542V36.916H142.922V0H149.325V23.2348C150.78 22.169 153.963 18.1382 158.872 11.1426H166.303Z\"\n      fill=\"white\"\n    />\n    <path\n      d=\"M40.973 52.5351L32.0861 43.6985L31.9503 43.7179V43.621L13.0511 24.9595L17.708 20.4637L14.9721 4.76715L1.99103 20.8513C-0.220992 23.0798 -0.628467 26.7036 0.962635 29.3778L9.07337 42.8265C10.3152 44.9 12.566 46.1402 14.9915 46.1208L19.0081 46.082L40.973 52.5351Z\"\n      fill=\"#18B6F6\"\n    />\n    <path\n      d=\"M45.8232 20.5411L44.038 17.2468L43.1066 15.5609L42.738 14.902L42.6992 14.9408L37.8094 6.47238C36.587 4.34075 34.2974 3.02301 31.8137 3.04239L27.5255 3.15865L14.7384 3.19741C12.313 3.21679 10.101 4.49577 8.87853 6.56927L1.09766 21.9945L15.0101 4.72831L33.2496 24.7656L30.0091 28.0406L31.9495 43.7178L31.9689 43.679V43.7178H31.9301L31.9689 43.7565L33.4824 45.2293L40.8364 52.4187C41.1469 52.7094 41.6514 52.3606 41.4379 51.9924L36.8975 43.0589L44.8142 28.4282L45.0664 28.1375C45.1634 28.0212 45.2604 27.905 45.3381 27.7887C46.8904 25.6764 47.1038 22.8472 45.8232 20.5411Z\"\n      fill=\"#AC7EF4\"\n    />\n    <path\n      d=\"M33.3076 24.6882L15.0099 4.74774L17.61 20.3668L12.9531 24.882L31.9105 43.6985L30.203 28.0794L33.3076 24.6882Z\"\n      fill=\"white\"\n    />\n  </svg>\n);\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/infobox/infobox.module.css",
    "content": ".infobox {\n  color: white;\n  font-size: 0.8rem;\n  line-height: 2;\n  margin: 0 0 40px;\n}\n\n.infobox h3 {\n  font-size: 1rem;\n  font-weight: 400;\n  margin: 0 0 15px;\n  padding: 0;\n}\n\n.infobox li {\n  line-height: 2.5;\n}\n\n@media screen and (min-width: 600px) {\n  .infobox {\n    margin: 0;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/infobox/infobox.tsx",
    "content": "import { Slot, component$ } from \"@builder.io/qwik\";\nimport styles from \"./infobox.module.css\";\n\nexport default component$(() => {\n  return (\n    <div class={styles.infobox}>\n      <h3>\n        <Slot name=\"title\" />\n      </h3>\n      <Slot />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/next-steps/next-steps.module.css",
    "content": ".gettingstarted {\n  display: flex;\n  color: white;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n  height: 280px;\n  line-height: 1.5;\n  gap: 10px;\n  max-width: 600px;\n  margin: 0 auto;\n}\n\n.gettingstarted .intro {\n  font-size: 1rem;\n  width: 100%;\n  word-break: break-word;\n}\n.gettingstarted .hint {\n  font-size: 0.8rem;\n}\n.gettingstarted .hint a {\n  color: var(--qwik-dark-purple);\n}\n\n@media screen and (min-width: 768px) {\n  .gettingstarted {\n    height: 180px;\n  }\n  .gettingstarted .intro {\n    font-size: 1.2rem;\n  }\n  .gettingstarted .hint {\n    font-size: 1rem;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/components/starter/next-steps/next-steps.tsx",
    "content": "import { component$, $, useOnWindow, useSignal } from \"@builder.io/qwik\";\nimport styles from \"./next-steps.module.css\";\n\nexport const GETTING_STARTED_STEPS = [\n  {\n    message:\n      \"Press and hold the <b>ALT/Option</b> key to activate 'Click-to-Source' mode\",\n  },\n  {\n    message:\n      \"Select the title of this page while keeping the <b>ALT/Option</b> key pressed\",\n    hint: 'Edit the title and save the changes. If your editor does not open, have a look at <a href=\"https://github.com/yyx990803/launch-editor#supported-editors\" target=\"_blank\">this page</a> to set the correct <code>LAUNCH_EDITOR</code> value.',\n  },\n  {\n    message:\n      \"<b>Update</b> now the <code>routeLoader$</code> defined in the <code>src/routes/layout.tsx</code> file\",\n    hint: \"Instead of returning the current date, you could return any possible string.<br />The output is displayed in the footer.\",\n  },\n  {\n    message: \"Create a <b>new Route</b> called <code>/me</code>\",\n    hint: 'Create a new directory called <code>me</code> in <code>src/routes</code>. Within this directory create a <code>index.tsx</code> file or copy the <code>src/routes/index.tsx</code> file. Your new route is now accessible <a href=\"/me\" target=\"_blank\">here</a> ✨',\n  },\n  {\n    message: \"Time to have a look at <b>Forms</b>\",\n    hint: 'Open <a href=\"/demo/todolist\" target=\"_blank\">the TODO list App</a> and add some items to the list. Try the same with disabled JavaScript 🐰',\n  },\n  {\n    message: \"<b>Congratulations!</b> You are now familiar with the basics! 🎉\",\n    hint: \"If you need further info on how to use qwik, have a look at <a href='https://qwik.dev' target='_blank'>qwik.dev</a> or join the <a href='https://qwik.dev/chat' target='_blank'>Discord channel</a>.\",\n  },\n];\n\nexport default component$(() => {\n  const gettingStartedStep = useSignal(0);\n\n  useOnWindow(\n    \"keydown\",\n    $((e) => {\n      if ((e as KeyboardEvent).key === \"Alt\") {\n        gettingStartedStep.value = 1;\n      }\n    }),\n  );\n\n  return (\n    <div class=\"container container-purple container-center\">\n      <h2>\n        Time for a\n        <br />\n        <span class=\"highlight\">qwik intro</span>?\n      </h2>\n      <div class={styles.gettingstarted}>\n        <div\n          class={styles.intro}\n          dangerouslySetInnerHTML={\n            GETTING_STARTED_STEPS[gettingStartedStep.value].message\n          }\n        />\n        <span\n          class={styles.hint}\n          dangerouslySetInnerHTML={\n            GETTING_STARTED_STEPS[gettingStartedStep.value].hint\n          }\n        />\n      </div>\n      {gettingStartedStep.value + 1 < GETTING_STARTED_STEPS.length ? (\n        <button class=\"button-dark\" onClick$={() => gettingStartedStep.value++}>\n          Continue with Step {gettingStartedStep.value + 2} of{\" \"}\n          {GETTING_STARTED_STEPS.length}\n        </button>\n      ) : (\n        <button\n          class=\"button-dark\"\n          onClick$={() => (gettingStartedStep.value = 0)}\n        >\n          Re-Start\n        </button>\n      )}\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/global.css",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * Globally applied styles. No matter which components are in the page or matching route,\n * the styles in here will be applied to the Document, without any sort of CSS scoping.\n *\n */\n\n:root {\n  --qwik-dark-blue: #006ce9;\n  --qwik-light-blue: #18b6f6;\n  --qwik-light-purple: #ac7ff4;\n  --qwik-dark-purple: #713fc2;\n  --qwik-dirty-black: #1d2033;\n  --qwik-dark-background: #151934;\n  --qwik-dark-text: #ffffff;\n}\n\nhtml {\n  line-height: 1;\n  -webkit-text-size-adjust: 100%;\n  -moz-tab-size: 4;\n  -o-tab-size: 4;\n  tab-size: 4;\n  font-family:\n    ui-sans-serif,\n    system-ui,\n    -apple-system,\n    BlinkMacSystemFont,\n    \"Segoe UI\",\n    Roboto,\n    \"Helvetica Neue\",\n    Arial,\n    \"Noto Sans\",\n    sans-serif,\n    \"Apple Color Emoji\",\n    \"Segoe UI Emoji\",\n    \"Segoe UI Symbol\",\n    \"Noto Color Emoji\";\n}\n\nbody {\n  padding: 0;\n  margin: 0;\n  line-height: inherit;\n}\n"
  },
  {
    "path": "starters/apps/playground/src/root.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { isDev } from \"@builder.io/qwik\";\nimport { QwikCityProvider, RouterOutlet } from \"@builder.io/qwik-city\";\nimport { RouterHead } from \"./components/router-head/router-head\";\n\nimport \"./global.css\";\n\nexport default component$(() => {\n  /**\n   * The root of a QwikCity site always start with the <QwikCityProvider> component,\n   * immediately followed by the document's <head> and <body>.\n   *\n   * Don't remove the `<head>` and `<body>` elements.\n   */\n\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charset=\"utf-8\" />\n        {!isDev && (\n          <link\n            rel=\"manifest\"\n            href={`${import.meta.env.BASE_URL}manifest.json`}\n          />\n        )}\n        <RouterHead />\n      </head>\n      <body lang=\"en\">\n        <RouterOutlet />\n      </body>\n    </QwikCityProvider>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/routes/demo/flower/flower.css",
    "content": ".host {\n  display: grid;\n\n  align-items: center;\n  justify-content: center;\n  justify-items: center;\n  --rotation: 135deg;\n  --rotation: 225deg;\n  --size-step: 10px;\n  --odd-color-step: 5;\n  --even-color-step: 5;\n  --center: 12;\n\n  width: 100%;\n  height: 500px;\n\n  contain: strict;\n}\n\nh1 {\n  margin-bottom: 60px;\n}\n\n.input {\n  width: 60%;\n}\n\n.square {\n  --size: calc(40px + var(--index) * var(--size-step));\n\n  display: block;\n  width: var(--size);\n  height: var(--size);\n  transform: rotateZ(\n    calc(var(--rotation) * var(--state) * (var(--center) - var(--index)))\n  );\n  transition-property: transform, border-color;\n  transition-duration: 5s;\n  transition-timing-function: ease-in-out;\n  grid-area: 1 / 1;\n  background: white;\n  border-width: 2px;\n  border-style: solid;\n  border-color: black;\n  box-sizing: border-box;\n  will-change: transform, border-color;\n\n  contain: strict;\n}\n\n.square.odd {\n  --luminance: calc(1 - calc(calc(var(--index) * var(--odd-color-step)) / 256));\n  background: rgb(\n    calc(172 * var(--luminance)),\n    calc(127 * var(--luminance)),\n    calc(244 * var(--luminance))\n  );\n}\n\n.pride .square:nth-child(12n + 1) {\n  background: #e70000;\n}\n.pride .square:nth-child(12n + 3) {\n  background: #ff8c00;\n}\n.pride .square:nth-child(12n + 5) {\n  background: #ffef00;\n}\n.pride .square:nth-child(12n + 7) {\n  background: #00811f;\n}\n.pride .square:nth-child(12n + 9) {\n  background: #0044ff;\n}\n.pride .square:nth-child(12n + 11) {\n  background: #760089;\n}\n"
  },
  {
    "path": "starters/apps/playground/src/routes/demo/flower/index.tsx",
    "content": "import {\n  component$,\n  useVisibleTask$,\n  useStore,\n  useStylesScoped$,\n} from \"@builder.io/qwik\";\nimport { type DocumentHead, useLocation } from \"@builder.io/qwik-city\";\nimport styles from \"./flower.css?inline\";\n\nexport default component$(() => {\n  useStylesScoped$(styles);\n  const loc = useLocation();\n\n  const state = useStore({\n    count: 0,\n    number: 20,\n  });\n\n  useVisibleTask$(({ cleanup }) => {\n    const timeout = setTimeout(() => (state.count = 1), 500);\n    cleanup(() => clearTimeout(timeout));\n\n    const internal = setInterval(() => state.count++, 7000);\n    cleanup(() => clearInterval(internal));\n  });\n\n  return (\n    <div class=\"container container-center\">\n      <div role=\"presentation\" class=\"ellipsis\"></div>\n      <h1>\n        <span class=\"highlight\">Generate</span> Flowers\n      </h1>\n\n      <input\n        class=\"input\"\n        type=\"range\"\n        value={state.number}\n        max={50}\n        onInput$={(ev, el) => {\n          state.number = el.valueAsNumber;\n        }}\n      />\n      <div\n        style={{\n          \"--state\": `${state.count * 0.1}`,\n        }}\n        class={{\n          host: true,\n          pride: loc.url.searchParams.get(\"pride\") === \"true\",\n        }}\n      >\n        {Array.from({ length: state.number }, (_, i) => (\n          <div\n            key={i}\n            class={{\n              square: true,\n              odd: i % 2 === 0,\n            }}\n            style={{ \"--index\": `${i + 1}` }}\n          />\n        )).reverse()}\n      </div>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Qwik Flower\",\n};\n"
  },
  {
    "path": "starters/apps/playground/src/routes/demo/todolist/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  type DocumentHead,\n  routeLoader$,\n  routeAction$,\n  zod$,\n  z,\n  Form,\n} from \"@builder.io/qwik-city\";\nimport styles from \"./todolist.module.css\";\n\ninterface ListItem {\n  text: string;\n}\n\nexport const list: ListItem[] = [];\n\nexport const useListLoader = routeLoader$(() => {\n  return list;\n});\n\nexport const useAddToListAction = routeAction$(\n  (item) => {\n    list.push(item);\n    return {\n      success: true,\n    };\n  },\n  zod$({\n    text: z.string().trim().min(1),\n  }),\n);\n\nexport default component$(() => {\n  const list = useListLoader();\n  const action = useAddToListAction();\n\n  return (\n    <>\n      <div class=\"container container-center\">\n        <h1>\n          <span class=\"highlight\">TODO</span> List\n        </h1>\n      </div>\n\n      <div role=\"presentation\" class=\"ellipsis\"></div>\n\n      <div class=\"container container-center\">\n        {list.value.length === 0 ? (\n          <span class={styles.empty}>No items found</span>\n        ) : (\n          <ul class={styles.list}>\n            {list.value.map((item, index) => (\n              <li key={`items-${index}`}>{item.text}</li>\n            ))}\n          </ul>\n        )}\n      </div>\n\n      <div class=\"container container-center\">\n        <Form action={action} spaReset>\n          <input type=\"text\" name=\"text\" required class={styles.input} />{\" \"}\n          <button type=\"submit\" class=\"button-dark\">\n            Add item\n          </button>\n        </Form>\n\n        <p class={styles.hint}>\n          PS: This little app works even when JavaScript is disabled.\n        </p>\n      </div>\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Qwik Todo List\",\n};\n"
  },
  {
    "path": "starters/apps/playground/src/routes/demo/todolist/todolist.module.css",
    "content": ".list {\n  display: flex;\n  flex-direction: column;\n  gap: 20px;\n  color: white;\n}\n\n.list,\n.empty {\n  min-height: 250px;\n}\n\n.list li {\n  list-style: none;\n}\n\n.empty {\n  color: white;\n  display: block;\n}\n\n.input {\n  background: white;\n  color: var(--qwik-light-blue);\n  border: none;\n  border-radius: 8px;\n  padding: 15px 20px;\n  margin-right: 10px;\n  font-size: 0.8rem;\n}\n\n.hint {\n  font-size: 0.8rem;\n  color: white;\n  margin-top: 30px;\n}\n\n@media screen and (min-width: 768px) {\n  .input {\n    padding: 23px 35px;\n    margin-right: 20px;\n    font-size: 1rem;\n  }\n}\n"
  },
  {
    "path": "starters/apps/playground/src/routes/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nimport Counter from \"../components/starter/counter/counter\";\nimport Hero from \"../components/starter/hero/hero\";\nimport Infobox from \"../components/starter/infobox/infobox\";\nimport Starter from \"../components/starter/next-steps/next-steps\";\n\nexport default component$(() => {\n  return (\n    <>\n      <Hero />\n      <Starter />\n\n      <div role=\"presentation\" class=\"ellipsis\"></div>\n      <div role=\"presentation\" class=\"ellipsis ellipsis-purple\"></div>\n\n      <div class=\"container container-center container-spacing-xl\">\n        <h3>\n          You can <span class=\"highlight\">count</span>\n          <br /> on me\n        </h3>\n        <Counter />\n      </div>\n\n      <div class=\"container container-flex\">\n        <Infobox>\n          <div q:slot=\"title\" class=\"icon icon-cli\">\n            CLI Commands\n          </div>\n          <>\n            <p>\n              <code>npm run dev</code>\n              <br />\n              Starts the development server and watches for changes\n            </p>\n            <p>\n              <code>npm run preview</code>\n              <br />\n              Creates production build and starts a server to preview it\n            </p>\n            <p>\n              <code>npm run build</code>\n              <br />\n              Creates production build\n            </p>\n            <p>\n              <code>npm run qwik add</code>\n              <br />\n              Runs the qwik CLI to add integrations\n            </p>\n          </>\n        </Infobox>\n\n        <div>\n          <Infobox>\n            <div q:slot=\"title\" class=\"icon icon-apps\">\n              Example Apps\n            </div>\n            <p>\n              Have a look at the <a href=\"/demo/flower\">Flower App</a> or the{\" \"}\n              <a href=\"/demo/todolist\">Todo App</a>.\n            </p>\n          </Infobox>\n\n          <Infobox>\n            <div q:slot=\"title\" class=\"icon icon-community\">\n              Community\n            </div>\n            <ul>\n              <li>\n                <span>Questions or just want to say hi? </span>\n                <a href=\"https://qwik.dev/chat\" target=\"_blank\">\n                  Chat on discord!\n                </a>\n              </li>\n              <li>\n                <span>Follow </span>\n                <a href=\"https://twitter.com/QwikDev\" target=\"_blank\">\n                  @QwikDev\n                </a>\n                <span> on Twitter</span>\n              </li>\n              <li>\n                <span>Open issues and contribute on </span>\n                <a href=\"https://github.com/QwikDev/qwik\" target=\"_blank\">\n                  GitHub\n                </a>\n              </li>\n              <li>\n                <span>Watch </span>\n                <a href=\"https://qwik.dev/media/\" target=\"_blank\">\n                  Presentations, Podcasts, Videos, etc.\n                </a>\n              </li>\n            </ul>\n          </Infobox>\n        </div>\n      </div>\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Welcome to Qwik\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Qwik site description\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/apps/playground/src/routes/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\n\nimport Header from \"../components/starter/header/header\";\nimport Footer from \"../components/starter/footer/footer\";\n\nimport styles from \"./styles.css?inline\";\n\nexport const useServerTimeLoader = routeLoader$(() => {\n  return {\n    date: new Date().toISOString(),\n  };\n});\n\nexport default component$(() => {\n  useStyles$(styles);\n  return (\n    <>\n      <Header />\n      <main>\n        <Slot />\n      </main>\n      <Footer />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/playground/src/routes/styles.css",
    "content": "/* THIS FILE IS JUST FOR EXAMPLES, DELETE IT IF YOU DON'T NEED IT */\n\n/* SHELL ---------------------------------------- */\nhtml {\n  font-family:\n    ui-sans-serif,\n    system-ui,\n    -apple-system,\n    BlinkMacSystemFont,\n    \"Segoe UI\",\n    Roboto,\n    \"Helvetica Neue\",\n    Arial,\n    \"Noto Sans\",\n    sans-serif,\n    \"Apple Color Emoji\",\n    \"Segoe UI Emoji\",\n    \"Segoe UI Symbol\",\n    \"Noto Color Emoji\";\n}\n\nbody {\n  background: var(--qwik-dark-background);\n  color: var(--qwik-dark-text);\n  overflow-x: hidden;\n}\n\n/* HEADINGS ------------------------------------- */\nh1,\nh2,\nh3 {\n  color: white;\n  margin: 0;\n}\n\nh1 {\n  font-size: 3.2rem;\n  text-align: center;\n}\nh1 .highlight,\nh3 .highlight {\n  color: var(--qwik-light-blue);\n}\n\nh2 {\n  font-weight: 400;\n  font-size: 2.4rem;\n}\nh2 .highlight {\n  font-weight: 700;\n}\n\nh3 {\n  font-size: 2rem;\n}\n\n@media screen and (min-width: 768px) {\n  h1 {\n    font-size: 5rem;\n  }\n  h2 {\n    font-size: 3.4rem;\n  }\n  h3 {\n    font-size: 3rem;\n  }\n}\n\n/* TAGS ----------------------------------------- */\na {\n  text-decoration: none;\n  color: var(--qwik-light-blue);\n}\n\ncode {\n  background: rgba(230, 230, 230, 0.3);\n  border-radius: 4px;\n  padding: 2px 6px;\n}\n\nul {\n  margin: 0;\n  padding-left: 20px;\n}\n\n/* CONTAINER ------------------------------------ */\n.container {\n  margin: 0 auto;\n  padding: 30px 40px;\n}\n.container.container-purple {\n  background: var(--qwik-light-purple);\n}\n.container.container-dark {\n  background: var(--qwik-dark-background);\n  color: var(--qwik-dark-text);\n}\n.container.container-center {\n  text-align: center;\n}\n.container.container-flex {\n  /* does nothing on mobile */\n}\n.container.container-spacing-xl {\n  padding: 50px 40px;\n}\n\n@media screen and (min-width: 768px) {\n  .container {\n    padding: 60px 80px;\n  }\n  .container.container-spacing-xl {\n    padding: 100px 60px;\n  }\n  .container.container-flex {\n    display: flex;\n    justify-content: center;\n    gap: 60px;\n  }\n}\n\n/* BUTTONS -------------------------------------- */\na.button,\nbutton {\n  background: var(--qwik-light-blue);\n  border: none;\n  border-radius: 8px;\n  color: white;\n  cursor: pointer;\n  font-size: 0.8rem;\n  padding: 15px 20px;\n  text-align: center;\n}\n\na.button.button-dark,\nbutton.button-dark {\n  background: var(--qwik-dirty-black);\n}\n\na.button.button-small,\nbutton.button-small {\n  padding: 15px 25px;\n}\n\n@media screen and (min-width: 768px) {\n  a.button,\n  button {\n    font-size: 1rem;\n    padding: 23px 35px;\n  }\n}\n\n/* DESIGN --------------------------------------- */\n.ellipsis {\n  position: absolute;\n  top: 100px;\n  left: -100px;\n  width: 400px;\n  height: 400px;\n  background: radial-gradient(\n    57.58% 57.58% at 48.79% 42.42%,\n    rgba(24, 180, 244, 0.5) 0%,\n    rgba(46, 55, 114, 0) 63.22%\n  );\n  transform: rotate(5deg);\n  opacity: 0.5;\n  z-index: -1;\n}\n.ellipsis.ellipsis-purple {\n  top: 1350px;\n  left: -100px;\n  background: radial-gradient(\n    50% 50% at 50% 50%,\n    rgba(172, 127, 244, 0.5) 0%,\n    rgba(21, 25, 52, 0) 100%\n  );\n  transform: rotate(-5deg);\n}\n\n@media screen and (min-width: 768px) {\n  .ellipsis {\n    top: -100px;\n    left: 350px;\n    width: 1400px;\n    height: 800px;\n  }\n  .ellipsis.ellipsis-purple {\n    top: 1300px;\n    left: -200px;\n  }\n}\n\n/* used icon pack: https://www.svgrepo.com/collection/phosphor-thin-icons */\n.icon:before {\n  width: 18px;\n  height: 18px;\n  content: \"\";\n  display: inline-block;\n  margin-right: 20px;\n  position: relative;\n  top: 2px;\n}\n\n.icon-cli:before {\n  background-image: url(\"data:image/svg+xml,%3Csvg fill='%23ffffff' width='20px' height='20px' viewBox='0 0 256 256' id='Flat' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M122.499 124.87646a4.00053 4.00053 0 0 1 0 6.24708l-40 32a4.0002 4.0002 0 0 1-4.998-6.24708L113.59668 128 77.501 99.12354a4.0002 4.0002 0 0 1 4.998-6.24708ZM175.99414 156h-40a4 4 0 0 0 0 8h40a4 4 0 1 0 0-8ZM228 56.48535v143.0293A12.49909 12.49909 0 0 1 215.51465 212H40.48535A12.49909 12.49909 0 0 1 28 199.51465V56.48535A12.49909 12.49909 0 0 1 40.48535 44h175.0293A12.49909 12.49909 0 0 1 228 56.48535Zm-8 0A4.49023 4.49023 0 0 0 215.51465 52H40.48535A4.49023 4.49023 0 0 0 36 56.48535v143.0293A4.49023 4.49023 0 0 0 40.48535 204h175.0293A4.49023 4.49023 0 0 0 220 199.51465Z'/%3E%3C/svg%3E\");\n}\n\n.icon-apps:before {\n  background-image: url(\"data:image/svg+xml,%3Csvg fill='%23ffffff' width='20px' height='20px' viewBox='0 0 256 256' id='Flat' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M216 44.00586H40a12.01375 12.01375 0 0 0-12 12v144a12.01375 12.01375 0 0 0 12 12H216a12.01375 12.01375 0 0 0 12-12v-144A12.01375 12.01375 0 0 0 216 44.00586Zm4 156a4.00458 4.00458 0 0 1-4 4H40a4.00458 4.00458 0 0 1-4-4v-144a4.00458 4.00458 0 0 1 4-4H216a4.00458 4.00458 0 0 1 4 4Zm-144-116a8 8 0 1 1-8-8A7.99977 7.99977 0 0 1 76 84.00586Zm40 0a8 8 0 1 1-8-8A7.99977 7.99977 0 0 1 116 84.00586Z'/%3E%3C/svg%3E\");\n}\n\n.icon-community:before {\n  background-image: url(\"data:image/svg+xml,%3Csvg fill='%23ffffff' width='20px' height='20px' viewBox='0 0 256 256' id='Flat' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M246.40381 143.19434a4.00061 4.00061 0 0 1-5.60108-.7959A55.57857 55.57857 0 0 0 196 120a4 4 0 0 1 0-8 28 28 0 1 0-27.50732-33.26074 4.00013 4.00013 0 0 1-7.85987-1.49219 36.00191 36.00191 0 1 1 54.06494 37.50513 63.58068 63.58068 0 0 1 32.50147 22.84155A3.99993 3.99993 0 0 1 246.40381 143.19434Zm-57.24268 71.05273a3.9998 3.9998 0 1 1-7.1914 3.50391 60.02582 60.02582 0 0 0-107.93946 0 3.9998 3.9998 0 1 1-7.1914-3.50391 67.56008 67.56008 0 0 1 40.90625-35.20581 44 44 0 1 1 40.50976 0A67.56139 67.56139 0 0 1 189.16113 214.24707ZM128 176a36 36 0 1 0-36-36A36.04061 36.04061 0 0 0 128 176ZM60 112A28 28 0 1 1 87.50732 78.73828a3.99989 3.99989 0 1 0 7.85938-1.49219A36.00177 36.00177 0 1 0 41.30225 114.7522 63.5829 63.5829 0 0 0 8.79883 137.5957a4 4 0 1 0 6.39648 4.80469A55.58072 55.58072 0 0 1 60 120a4 4 0 0 0 0-8Z'/%3E%3C/svg%3E\");\n}\n"
  },
  {
    "path": "starters/apps/preloader-test/README.md",
    "content": "This is the test app for the preloader.\n\nUse `pnpm preview` to run the app and observe the network requests and the console output.\n\nThe modules have been configured to have a random size between 0.5kb and 50kb, and when they load they will log a message to the console and add their id to the `_loaded` array.\n"
  },
  {
    "path": "starters/apps/preloader-test/package.json",
    "content": "{\n  \"name\": \"preloader-test\",\n  \"scripts\": {\n    \"build\": \"qwik build\",\n    \"build.client\": \"vite build\",\n    \"build.preview\": \"vite build --ssr src/entry.preview.tsx\",\n    \"dev\": \"vite --mode ssr\",\n    \"dev.debug\": \"node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force\",\n    \"preview\": \"qwik build preview && vite preview --open\",\n    \"start\": \"vite --open --mode ssr\"\n  },\n  \"private\": true,\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter1.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter10.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter100.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter11.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter12.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter13.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter14.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter15.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter16.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter17.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter18.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter19.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter2.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter20.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter21.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter22.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter23.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter24.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter25.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter26.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter27.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter28.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter29.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter3.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter30.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter31.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter32.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter33.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter34.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter35.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter36.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter37.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter38.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter39.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter4.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter40.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter41.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter42.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter43.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter44.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter45.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter46.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter47.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter48.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter49.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter5.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter50.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter51.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter52.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter53.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter54.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter55.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter56.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter57.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter58.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter59.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter6.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter60.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter61.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter62.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter63.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter64.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter65.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter66.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter67.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter68.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter69.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter7.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter70.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter71.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter72.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter73.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter74.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter75.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter76.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter77.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter78.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter79.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter8.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter80.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter81.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter82.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter83.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter84.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter85.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter86.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter87.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter88.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter89.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter9.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter90.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter91.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter92.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter93.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter94.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter95.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter96.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter97.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter98.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/counter99.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <>\n      <button onClick$={() => count.value++}>Increment</button>\n      <p>Current Count: {count.value}</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic1.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic2 from \"./dynamic2\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 1</p>\n      <Dynamic2 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic2.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic3 from \"./dynamic3\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 2</p>\n      <Dynamic3 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic3.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic4 from \"./dynamic4\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 3</p>\n      <Dynamic4 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic4.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic5 from \"./dynamic5\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 4</p>\n      <Dynamic5 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic5.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic6 from \"./dynamic6\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 5</p>\n      <Dynamic6 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic6.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic7 from \"./dynamic7\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 6</p>\n      <Dynamic7 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic7.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic8 from \"./dynamic8\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 7</p>\n      <Dynamic8 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic8.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport Dynamic9 from \"./dynamic9\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 8</p>\n      <Dynamic9 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/dynamic9.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return (\n    <>\n      <p>Dynamic 9</p>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/generated/show-dynamic.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\nimport Dynamic1 from \"./dynamic1\";\n\nexport default component$(() => {\n  const showDynamic = useSignal(false);\n  return (\n    <>\n      <button\n        onClick$={() => {\n          showDynamic.value = true;\n          // eslint-disable-next-line no-console\n          console.log(\n            `\n************************************************\n************************************************\n************************************************\n************************************************\n************************************************\nSHOW DYNAMIC CLICKED\n************************************************\n************************************************\n************************************************\n************************************************\n************************************************\n`,\n          );\n        }}\n      >\n        Show dynamic\n      </button>\n      {showDynamic.value ? <Dynamic1 /> : <p>Not yet</p>}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useDocumentHead, useLocation } from \"@builder.io/qwik-city\";\n\n/**\n * The RouterHead component is placed inside of the document `<head>` element.\n */\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  return (\n    <>\n      <title>{head.title}</title>\n\n      <link rel=\"canonical\" href={loc.url.href} />\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n\n      {head.meta.map((m) => (\n        <meta key={m.key} {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link key={l.key} {...l} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.style })}\n        />\n      ))}\n\n      {head.scripts.map((s) => (\n        <script\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.script })}\n        />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/entry.dev.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Development entry point using only client-side modules:\n * - Do not use this mode in production!\n * - No SSR\n * - No portion of the application is pre-rendered on the server.\n * - All of the application is running eagerly in the browser.\n * - More code is transferred to the browser than in SSR mode.\n * - Optimizer/Serialization/Deserialization code is not exercised!\n */\nimport { render, type RenderOptions } from \"@builder.io/qwik\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderOptions) {\n  return render(document, <Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/preloader-test/src/entry.preview.tsx",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * It's the bundle entry point for `npm run preview`.\n * That is, serving your app built in production mode.\n *\n * Feel free to modify this file, but don't remove it!\n *\n * Learn more about Vite's preview command:\n * - https://vitejs.dev/config/preview-options.html#preview-options\n *\n */\nimport { createQwikCity } from \"@builder.io/qwik-city/middleware/node\";\nimport qwikCityPlan from \"@qwik-city-plan\";\n// make sure qwikCityPlan is imported before entry\nimport render from \"./entry.ssr\";\n\n/**\n * The default export is the QwikCity adapter used by Vite preview.\n */\nexport default createQwikCity({ render, qwikCityPlan });\n"
  },
  {
    "path": "starters/apps/preloader-test/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this\n * entry point will be the common one.\n *\n * - Server (express, cloudflare...)\n * - npm run start\n * - npm run preview\n * - npm run build\n *\n */\nimport {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    preloader: {\n      debug: true,\n      ssrPreloads: 10,\n    },\n    ...opts,\n    // Use container attributes to set attributes on the html tag.\n    containerAttributes: {\n      lang: \"en-us\",\n      ...opts.containerAttributes,\n    },\n    serverData: {\n      ...opts.serverData,\n    },\n  });\n}\n"
  },
  {
    "path": "starters/apps/preloader-test/src/global.css",
    "content": ""
  },
  {
    "path": "starters/apps/preloader-test/src/root.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { QwikCityProvider, RouterOutlet } from \"@builder.io/qwik-city\";\nimport { RouterHead } from \"./components/router-head/router-head\";\n\nimport \"./global.css\";\n\nexport default component$(() => {\n  /**\n   * The root of a QwikCity site always start with the <QwikCityProvider> component,\n   * immediately followed by the document's <head> and <body>.\n   *\n   * Don't remove the `<head>` and `<body>` elements.\n   */\n\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charset=\"utf-8\" />\n        <RouterHead />\n      </head>\n      <body lang=\"en\">\n        <RouterOutlet />\n      </body>\n    </QwikCityProvider>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/routes/about/index.tsx",
    "content": "import { component$, useStyles$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  useStyles$(`\n    .about-container {\n      max-width: 42rem;\n      margin: 0 auto;\n    }\n\n    .title {\n      font-size: 1.875rem;\n      font-weight: bold;\n      margin-bottom: 1rem;\n    }\n\n    .content {\n      font-size: 1rem;\n      line-height: 1.5;\n    }\n\n    .paragraph {\n      margin-bottom: 1rem;\n    }\n\n    .subtitle {\n      font-size: 1.5rem;\n      font-weight: bold;\n      margin-top: 1.5rem;\n      margin-bottom: 0.75rem;\n    }\n\n    .feature-list {\n      list-style-type: disc;\n      padding-left: 1.25rem;\n      margin-bottom: 1rem;\n    }\n\n    .feature-list li {\n      margin-bottom: 0.5rem;\n    }\n  `);\n\n  return (\n    <div class=\"about-container\">\n      <h1 class=\"title\">About Preloader Test</h1>\n      <div class=\"content\">\n        <p class=\"paragraph\">\n          This application demonstrates the preloading capabilities of Qwik. It\n          shows how Qwik can efficiently load only the necessary JavaScript code\n          when needed, resulting in faster page loads and better performance.\n        </p>\n        <h2 class=\"subtitle\">Features</h2>\n        <ul class=\"feature-list\">\n          <li>Route-based code splitting</li>\n          <li>Form handling with validation</li>\n          <li>Toggle between native links and Qwik Link components</li>\n          <li>Responsive design with CSS</li>\n        </ul>\n        <p class=\"paragraph\">\n          Feel free to explore the different pages and observe how Qwik handles\n          navigation and form interactions efficiently.\n        </p>\n      </div>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"About - Preloader Test\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Learn about the Preloader Test application and its features\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/apps/preloader-test/src/routes/counters/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\nimport Counter1 from \"~/components/generated/counter1\";\nimport Counter2 from \"~/components/generated/counter2\";\nimport Counter3 from \"~/components/generated/counter3\";\nimport Counter4 from \"~/components/generated/counter4\";\nimport Counter5 from \"~/components/generated/counter5\";\nimport Counter6 from \"~/components/generated/counter6\";\nimport Counter7 from \"~/components/generated/counter7\";\nimport Counter8 from \"~/components/generated/counter8\";\nimport Counter9 from \"~/components/generated/counter9\";\nimport Counter10 from \"~/components/generated/counter10\";\nimport Counter11 from \"~/components/generated/counter11\";\nimport Counter12 from \"~/components/generated/counter12\";\nimport Counter13 from \"~/components/generated/counter13\";\nimport Counter14 from \"~/components/generated/counter14\";\nimport Counter15 from \"~/components/generated/counter15\";\nimport Counter16 from \"~/components/generated/counter16\";\nimport Counter17 from \"~/components/generated/counter17\";\nimport Counter18 from \"~/components/generated/counter18\";\nimport Counter19 from \"~/components/generated/counter19\";\nimport Counter20 from \"~/components/generated/counter20\";\nimport Counter21 from \"~/components/generated/counter21\";\nimport Counter22 from \"~/components/generated/counter22\";\nimport Counter23 from \"~/components/generated/counter23\";\nimport Counter24 from \"~/components/generated/counter24\";\nimport Counter25 from \"~/components/generated/counter25\";\nimport Counter26 from \"~/components/generated/counter26\";\nimport Counter27 from \"~/components/generated/counter27\";\nimport Counter28 from \"~/components/generated/counter28\";\nimport Counter29 from \"~/components/generated/counter29\";\nimport Counter30 from \"~/components/generated/counter30\";\nimport Counter31 from \"~/components/generated/counter31\";\nimport Counter32 from \"~/components/generated/counter32\";\nimport Counter33 from \"~/components/generated/counter33\";\nimport Counter34 from \"~/components/generated/counter34\";\nimport Counter35 from \"~/components/generated/counter35\";\nimport Counter36 from \"~/components/generated/counter36\";\nimport Counter37 from \"~/components/generated/counter37\";\nimport Counter38 from \"~/components/generated/counter38\";\nimport Counter39 from \"~/components/generated/counter39\";\nimport Counter40 from \"~/components/generated/counter40\";\nimport Counter41 from \"~/components/generated/counter41\";\nimport Counter42 from \"~/components/generated/counter42\";\nimport Counter43 from \"~/components/generated/counter43\";\nimport Counter44 from \"~/components/generated/counter44\";\nimport Counter45 from \"~/components/generated/counter45\";\nimport Counter46 from \"~/components/generated/counter46\";\nimport Counter47 from \"~/components/generated/counter47\";\nimport Counter48 from \"~/components/generated/counter48\";\nimport Counter49 from \"~/components/generated/counter49\";\nimport Counter50 from \"~/components/generated/counter50\";\nimport Counter51 from \"~/components/generated/counter51\";\nimport Counter52 from \"~/components/generated/counter52\";\nimport Counter53 from \"~/components/generated/counter53\";\nimport Counter54 from \"~/components/generated/counter54\";\nimport Counter55 from \"~/components/generated/counter55\";\nimport Counter56 from \"~/components/generated/counter56\";\nimport Counter57 from \"~/components/generated/counter57\";\nimport Counter58 from \"~/components/generated/counter58\";\nimport Counter59 from \"~/components/generated/counter59\";\nimport Counter60 from \"~/components/generated/counter60\";\nimport Counter61 from \"~/components/generated/counter61\";\nimport Counter62 from \"~/components/generated/counter62\";\nimport Counter63 from \"~/components/generated/counter63\";\nimport Counter64 from \"~/components/generated/counter64\";\nimport Counter65 from \"~/components/generated/counter65\";\nimport Counter66 from \"~/components/generated/counter66\";\nimport Counter67 from \"~/components/generated/counter67\";\nimport Counter68 from \"~/components/generated/counter68\";\nimport Counter69 from \"~/components/generated/counter69\";\nimport Counter70 from \"~/components/generated/counter70\";\nimport Counter71 from \"~/components/generated/counter71\";\nimport Counter72 from \"~/components/generated/counter72\";\nimport Counter73 from \"~/components/generated/counter73\";\nimport Counter74 from \"~/components/generated/counter74\";\nimport Counter75 from \"~/components/generated/counter75\";\nimport Counter76 from \"~/components/generated/counter76\";\nimport Counter77 from \"~/components/generated/counter77\";\nimport Counter78 from \"~/components/generated/counter78\";\nimport Counter79 from \"~/components/generated/counter79\";\nimport Counter80 from \"~/components/generated/counter80\";\nimport Counter81 from \"~/components/generated/counter81\";\nimport Counter82 from \"~/components/generated/counter82\";\nimport Counter83 from \"~/components/generated/counter83\";\nimport Counter84 from \"~/components/generated/counter84\";\nimport Counter85 from \"~/components/generated/counter85\";\nimport Counter86 from \"~/components/generated/counter86\";\nimport Counter87 from \"~/components/generated/counter87\";\nimport Counter88 from \"~/components/generated/counter88\";\nimport Counter89 from \"~/components/generated/counter89\";\nimport Counter90 from \"~/components/generated/counter90\";\nimport Counter91 from \"~/components/generated/counter91\";\nimport Counter92 from \"~/components/generated/counter92\";\nimport Counter93 from \"~/components/generated/counter93\";\nimport Counter94 from \"~/components/generated/counter94\";\nimport Counter95 from \"~/components/generated/counter95\";\nimport Counter96 from \"~/components/generated/counter96\";\nimport Counter97 from \"~/components/generated/counter97\";\nimport Counter98 from \"~/components/generated/counter98\";\nimport Counter99 from \"~/components/generated/counter99\";\nimport Counter100 from \"~/components/generated/counter100\";\nimport ShowDynamic from \"~/components/generated/show-dynamic\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Counters</h1>\n      <p>\n        This page has 100 counters. Each counter is a separate component that is\n        preloaded. You can click on the \"Say what?\" button to see a reprio of\n        the say-what bundle and its transitive dependencies.\n      </p>\n      <br />\n      <Counter1 />\n      <Counter2 />\n      <Counter3 />\n      <ShowDynamic />\n      <Counter4 />\n      <Counter5 />\n      <Counter6 />\n      <Counter7 />\n      <Counter8 />\n      <Counter9 />\n      <Counter10 />\n      <Counter11 />\n      <Counter12 />\n      <Counter13 />\n      <Counter14 />\n      <Counter15 />\n      <Counter16 />\n      <Counter17 />\n      <Counter18 />\n      <Counter19 />\n      <Counter20 />\n      <Counter21 />\n      <Counter22 />\n      <Counter23 />\n      <Counter24 />\n      <Counter25 />\n      <Counter26 />\n      <Counter27 />\n      <Counter28 />\n      <Counter29 />\n      <Counter30 />\n      <Counter31 />\n      <Counter32 />\n      <Counter33 />\n      <Counter34 />\n      <Counter35 />\n      <Counter36 />\n      <Counter37 />\n      <Counter38 />\n      <Counter39 />\n      <Counter40 />\n      <Counter41 />\n      <Counter42 />\n      <Counter43 />\n      <Counter44 />\n      <Counter45 />\n      <Counter46 />\n      <Counter47 />\n      <Counter48 />\n      <Counter49 />\n      <Counter50 />\n      <Counter51 />\n      <Counter52 />\n      <Counter53 />\n      <Counter54 />\n      <Counter55 />\n      <Counter56 />\n      <Counter57 />\n      <Counter58 />\n      <Counter59 />\n      <Counter60 />\n      <Counter61 />\n      <Counter62 />\n      <Counter63 />\n      <Counter64 />\n      <Counter65 />\n      <Counter66 />\n      <Counter67 />\n      <Counter68 />\n      <Counter69 />\n      <Counter70 />\n      <Counter71 />\n      <Counter72 />\n      <Counter73 />\n      <Counter74 />\n      <Counter75 />\n      <Counter76 />\n      <Counter77 />\n      <Counter78 />\n      <Counter79 />\n      <Counter80 />\n      <Counter81 />\n      <Counter82 />\n      <Counter83 />\n      <Counter84 />\n      <Counter85 />\n      <Counter86 />\n      <Counter87 />\n      <Counter88 />\n      <Counter89 />\n      <Counter90 />\n      <Counter91 />\n      <Counter92 />\n      <Counter93 />\n      <Counter94 />\n      <Counter95 />\n      <Counter96 />\n      <Counter97 />\n      <Counter98 />\n      <Counter99 />\n      <Counter100 />\n      <Link\n        href=\"/hidden\"\n        // eslint-disable-next-line no-console\n        onQVisible$={() => console.log(\"visible below fold\")}\n      >\n        Home\n      </Link>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/routes/form/index.tsx",
    "content": "import { component$, useStyles$ } from \"@builder.io/qwik\";\nimport { type DocumentHead, routeAction$, Form } from \"@builder.io/qwik-city\";\n\nexport const useFormAction = routeAction$((data) => {\n  // This runs on the server\n  // eslint-disable-next-line no-console\n  console.log(\"Form submitted with data:\", data);\n  return {\n    success: true,\n    message: \"Form submitted successfully\",\n  };\n});\n\nexport default component$(() => {\n  useStyles$(`\n    .form-container {\n      max-width: 42rem;\n      margin: 0 auto;\n    }\n\n    .title {\n      font-size: 1.875rem;\n      font-weight: bold;\n      margin-bottom: 1rem;\n    }\n\n    .success-message {\n      background-color: #dcfce7;\n      border: 1px solid #86efac;\n      color: #15803d;\n      padding: 0.75rem 1rem;\n      border-radius: 0.375rem;\n      margin-bottom: 1rem;\n    }\n\n    .form {\n      display: flex;\n      flex-direction: column;\n      gap: 1rem;\n    }\n\n    .form-group {\n      display: flex;\n      flex-direction: column;\n    }\n\n    .label {\n      display: block;\n      font-size: 0.875rem;\n      font-weight: 500;\n      color: #374151;\n      margin-bottom: 0.25rem;\n    }\n\n    .input,\n    .textarea {\n      width: 100%;\n      padding: 0.5rem;\n      border: 1px solid #d1d5db;\n      border-radius: 0.375rem;\n      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n    }\n\n    .input:focus,\n    .textarea:focus {\n      outline: none;\n      border-color: #3b82f6;\n      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);\n    }\n\n    .textarea {\n      min-height: 6rem;\n    }\n\n    .submit-button {\n      display: inline-flex;\n      justify-content: center;\n      padding: 0.5rem 1rem;\n      font-size: 0.875rem;\n      font-weight: 500;\n      color: white;\n      background-color: #2563eb;\n      border: none;\n      border-radius: 0.375rem;\n      cursor: pointer;\n      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n      align-self: flex-start;\n    }\n\n    .submit-button:hover {\n      background-color: #1d4ed8;\n    }\n\n    .submit-button:focus {\n      outline: none;\n      box-shadow: 0 0 0 2px white, 0 0 0 4px #2563eb;\n    }\n  `);\n\n  const action = useFormAction();\n\n  return (\n    <div class=\"form-container\">\n      <h1 class=\"title\">Contact Form</h1>\n\n      {action.value?.success ? (\n        <div class=\"success-message\">Thank you for your submission!</div>\n      ) : (\n        <Form action={action} class=\"form\">\n          <div class=\"form-group\">\n            <label for=\"name\" class=\"label\">\n              Name\n            </label>\n            <input id=\"name\" name=\"name\" type=\"text\" class=\"input\" required />\n          </div>\n\n          <div class=\"form-group\">\n            <label for=\"email\" class=\"label\">\n              Email\n            </label>\n            <input\n              id=\"email\"\n              name=\"email\"\n              type=\"email\"\n              class=\"input\"\n              required\n            />\n          </div>\n\n          <div class=\"form-group\">\n            <label for=\"message\" class=\"label\">\n              Message\n            </label>\n            <textarea id=\"message\" name=\"message\" class=\"textarea\" required />\n          </div>\n\n          <button type=\"submit\" class=\"submit-button\">\n            Submit\n          </button>\n        </Form>\n      )}\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Contact Form - Preloader Test\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Contact form for the Preloader Test application\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/apps/preloader-test/src/routes/hidden/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return <div>Hidden</div>;\n});\n"
  },
  {
    "path": "starters/apps/preloader-test/src/routes/index.tsx",
    "content": "import {\n  component$,\n  useTask$,\n  useVisibleTask$,\n  useSignal,\n  $,\n  useStyles$,\n} from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\n// This will be in a separate chunk due to dynamic import\nconst getLibA = () => import(\"../vendor-lib/libA\");\nconst getLibB = () => import(\"../vendor-lib/libB\");\n\nexport default component$(() => {\n  useStyles$(`\n    .home-container {\n      max-width: 42rem;\n      margin: 0 auto;\n    }\n\n    .title {\n      font-size: 1.875rem;\n      font-weight: bold;\n      margin-bottom: 1rem;\n    }\n\n    .paragraph {\n      margin-bottom: 1rem;\n    }\n  `);\n\n  const count = useSignal(0);\n  const message = useSignal(\"\");\n\n  useVisibleTask$(async ({ track }) => {\n    const lib = track(count) & 1 ? getLibA() : getLibB();\n    message.value = (await lib).getMessage();\n  });\n\n  useTask$(async () => {\n    message.value = \"loading...\";\n  });\n\n  const handleClick$ = $(async () => {\n    count.value++;\n    const lib = await (count.value & 1 ? getLibA() : getLibB());\n    message.value = lib.getMessage();\n  });\n\n  return (\n    <div class=\"home-container\">\n      <h1 class=\"title\">Welcome to Preloader Test</h1>\n      <p class=\"paragraph\">\n        This is a test application to demonstrate preloading capabilities in\n        Qwik.\n      </p>\n      <p class=\"paragraph\">\n        Navigate to the Form page to try out the form functionality, or visit\n        the About page to learn more.\n      </p>\n      <p>Count: {count.value}</p>\n      <p>Message: {message.value}</p>\n      {/* event handler with $ */}\n      <button onClick$={handleClick$}>Increment</button>\n      {/* inline event handler */}\n      <button onClick$={() => count.value--}>Decrement</button>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Home - Preloader Test\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Welcome to the Preloader Test application\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/apps/preloader-test/src/routes/layout.tsx",
    "content": "import { component$, Slot, useSignal, useStyles$ } from \"@builder.io/qwik\";\nimport { Link, type DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  useStyles$(`\n    .layout {\n      min-height: 100vh;\n      display: flex;\n      flex-direction: column;\n    }\n    \n    .header {\n      background-color: #1f2937;\n      color: white;\n      padding: 1rem;\n    }\n\n    .container {\n      max-width: 1200px;\n      margin: 0 auto;\n      padding: 0 1rem;\n    }\n\n    .nav-container {\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n    }\n\n    .nav {\n      display: flex;\n      gap: 1rem;\n    }\n\n    .nav a {\n      color: white;\n      text-decoration: none;\n    }\n\n    .nav a:hover {\n      color: #d1d5db;\n    }\n\n    .toggle-label {\n      display: flex;\n      align-items: center;\n      gap: 0.5rem;\n    }\n\n    .toggle-text {\n      font-size: 0.875rem;\n    }\n\n    .main {\n      flex-grow: 1;\n    }\n  `);\n\n  const isSPA = useSignal(true);\n  const LinkCmp = isSPA.value ? Link : \"a\";\n\n  return (\n    <div class=\"layout\">\n      <header class=\"header\">\n        <div class=\"container nav-container\">\n          <nav class=\"nav\">\n            <LinkCmp href=\"/\">Home</LinkCmp>\n            <LinkCmp href=\"/form\">Form</LinkCmp>\n            <LinkCmp href=\"/about\">About</LinkCmp>\n            <LinkCmp\n              href=\"/counters\"\n              // eslint-disable-next-line no-console\n              onQVisible$={() => console.log(\"visible\")}\n            >\n              Counters\n            </LinkCmp>\n          </nav>\n          <label class=\"toggle-label\">\n            <input type=\"checkbox\" bind:checked={isSPA} />\n            <span class=\"toggle-text\">Use SPA links</span>\n          </label>\n        </div>\n      </header>\n\n      <main class=\"main container\">\n        <Slot />\n      </main>\n      {/* workaround: invisible Link to ensure qwik city context inclusion */}\n      <Link href=\"/\" />\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Preloader Test\",\n};\n"
  },
  {
    "path": "starters/apps/preloader-test/src/vendor-lib/helper.ts",
    "content": "// This will be imported by both LibA and LibB\nexport const helper = () => {\n  return \"Helper function called\";\n};\n"
  },
  {
    "path": "starters/apps/preloader-test/src/vendor-lib/libA.ts",
    "content": "// This will be in its own chunk\nimport { helper } from \"./helper\";\n\nexport const getMessage = () => {\n  return `Message from LibA: ${helper()}`;\n};\n"
  },
  {
    "path": "starters/apps/preloader-test/src/vendor-lib/libB.ts",
    "content": "// This will be in its own chunk\nimport { helper } from \"./helper\";\n\nexport const getMessage = () => {\n  return `Message from LibB: ${helper()}`;\n};\n"
  },
  {
    "path": "starters/apps/preloader-test/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"target\": \"ES2020\",\n    \"module\": \"ES2022\",\n    \"lib\": [\"es2022\", \"DOM\", \"WebWorker\", \"DOM.Iterable\"],\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"incremental\": true,\n    \"isolatedModules\": true,\n    \"outDir\": \"tmp\",\n    \"noEmit\": true,\n    \"paths\": {\n      \"~/*\": [\"./src/*\"],\n      \"~components/*\": [\"./src/components/*\"]\n    }\n  },\n  \"include\": [\"src\", \"./*.d.ts\", \"./*.config.ts\"]\n}\n"
  },
  {
    "path": "starters/apps/preloader-test/vite.config.ts",
    "content": "/**\n * This is the base config for vite.\n * When building, the adapter config is used which loads this file and extends it.\n */\nimport { defineConfig, type UserConfig, type Plugin } from \"vite\";\nimport { qwikVite } from \"@builder.io/qwik/optimizer\";\nimport { qwikCity } from \"@builder.io/qwik-city/vite\";\nimport crypto from \"crypto\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\nimport basicSsl from \"@vitejs/plugin-basic-ssl\";\n/**\n * Note that Vite normally starts from `index.html` but the qwikCity plugin makes start at `src/entry.ssr.tsx` instead.\n */\nfunction createBulkPlugin(): Plugin {\n  return {\n    name: \"add-bulk-and-track\",\n    transform(code, id) {\n      // Only process JavaScript/TypeScript files\n      if (!id.match(/(\\.[cm]?[jt]sx?$|@qwik)/)) {\n        return null;\n      }\n\n      // Generate deterministic bulk based on filename\n      const hash = crypto.createHash(\"sha256\").update(id).digest();\n\n      // Create bulk with an exponential-like distribution between 0kb and 50kb\n      // Most files will be closer to 0kb, with a few reaching 50kb\n      const maxSize = 500;\n      const x = hash[0] / 255; // Normalize first byte to 0-1\n      const exp = Math.pow(x, 6); // Skew distribution\n      const bulkSize = Math.floor(maxSize * exp);\n\n      // Create repeatable random bulk using the hash as seed\n      const prng = crypto.createHash(\"sha512\").update(id).digest();\n      const bulk = Array.from({ length: Math.ceil(bulkSize / 64) }, (_, i) => {\n        // Use the hash as a seed to generate new random blocks\n        const block = crypto\n          .createHash(\"sha512\")\n          .update(prng)\n          .update(Buffer.from([i]))\n          .digest(\"base64\");\n        return block;\n      }).join(\"\");\n\n      // Add tracking code and bulk assignment at the start of each module\n      const trackingCode = `\n        console.log(\">>> running\", ${JSON.stringify(id)});\n        ;(globalThis._loaded||=[]).push(${JSON.stringify(id)});\n      `;\n      const bulkCode = `\n        globalThis._fakeBulk?.(${JSON.stringify(bulk)});\n      `;\n\n      return {\n        /** Note that this code is injected before the import statements which is technically incorrect but Vite handles it */\n        code: `${trackingCode}\\n${code}\\n${bulkCode}`,\n        map: null,\n      };\n    },\n  };\n}\n\nexport default defineConfig((): UserConfig => {\n  return {\n    plugins: [\n      qwikCity(),\n      qwikVite({ debug: true }),\n      createBulkPlugin(),\n      tsconfigPaths({ root: \".\" }),\n      basicSsl(),\n    ],\n    build: {\n      minify: false,\n      rollupOptions: {\n        output: {\n          manualChunks: (id) => {\n            // Put library code in separate chunks\n            if (id.includes(\"vendor-lib\")) {\n              return id;\n            }\n          },\n        },\n      },\n    },\n  };\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/package.json",
    "content": "{\n  \"description\": \"QwikCity e2e app\",\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"qwikCity\": true\n  }\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/auth/auth.ts",
    "content": "/**\n * Simple Auth For Testing Only!!!\n */\nimport type { Cookie } from \"@builder.io/qwik-city\";\n\nexport const isUserAuthenticated = async (cookie: Cookie) => {\n  return cookie.has(AUTHTOKEN_NAME);\n};\n\ninterface Signin {\n  username: string;\n  password: string;\n}\n\nexport const signIn = async (\n  { username, password }: Signin,\n  cookie: Cookie,\n): Promise<AuthResult> => {\n  if (username === \"qwik\" && password === \"dev\") {\n    // super secret username/password (Testing purposes only, DO NOT DO THIS!!)\n    cookie.set(AUTHTOKEN_NAME, Math.round(Math.random() * 9999999), {\n      httpOnly: true,\n      maxAge: [5, \"minutes\"],\n      path: \"/\",\n    });\n    return {\n      status: \"signed-in\",\n    };\n  }\n\n  return {\n    status: \"invalid\",\n  };\n};\n\nexport const signOut = (cookie: Cookie) => {\n  cookie.delete(AUTHTOKEN_NAME, { path: \"/\" });\n  return {\n    status: \"signed-out\",\n  };\n};\n\nexport interface AuthResult {\n  status: \"signed-in\" | \"signed-out\" | \"invalid\";\n}\n\nconst AUTHTOKEN_NAME = \"qwikcity-auth-token\";\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/action/action.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, globalAction$ } from \"@builder.io/qwik-city\";\n\nexport const useAction = globalAction$(() => {\n  return true;\n});\n\nexport const ActionStandalone = component$(() => {\n  const action = useAction();\n  return (\n    <div>\n      <h1>Test</h1>\n      <Form action={action}>\n        <input type=\"text\" name=\"name\" />\n        <button>Send</button>\n      </Form>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/breadcrumbs/breadcrumbs.css",
    "content": "nav.breadcrumbs {\n  padding: 5px;\n  border-bottom: 1px solid #ddd;\n}\n\nnav.breadcrumbs > span {\n  display: inline-block;\n  padding: 5px 0;\n  font-size: 12px;\n}\n\nnav.breadcrumbs > span a {\n  text-decoration: none;\n  color: inherit;\n}\n\nnav.breadcrumbs > span::after {\n  content: \">\";\n  padding: 0 5px;\n  opacity: 0.4;\n}\n\nnav.breadcrumbs > span:last-child::after {\n  display: none;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/breadcrumbs/breadcrumbs.tsx",
    "content": "import { component$, useStyles$ } from \"@builder.io/qwik\";\nimport {\n  Link,\n  useContent,\n  useLocation,\n  type ContentMenu,\n} from \"@builder.io/qwik-city\";\nimport styles from \"./breadcrumbs.css?inline\";\n\nexport const Breadcrumbs = component$(() => {\n  useStyles$(styles);\n\n  const { menu } = useContent();\n  const { url } = useLocation();\n\n  const breadcrumbs = createBreadcrumbs(menu, url.pathname);\n  if (breadcrumbs.length === 0) {\n    return null;\n  }\n\n  return (\n    <nav class=\"breadcrumbs\">\n      {breadcrumbs.map((b, i) => (\n        <span data-test-breadcrumb={i} key={b.text}>\n          {b.href ? <Link href={b.href}>{b.text}</Link> : b.text}\n        </span>\n      ))}\n    </nav>\n  );\n});\n\nexport function createBreadcrumbs(\n  menu: ContentMenu | undefined,\n  pathname: string,\n) {\n  if (menu?.items) {\n    for (const breadcrumbA of menu.items) {\n      if (matchesHref(breadcrumbA.href, pathname)) {\n        return [breadcrumbA];\n      }\n\n      if (breadcrumbA.items) {\n        for (const breadcrumbB of breadcrumbA.items) {\n          if (matchesHref(breadcrumbB.href, pathname)) {\n            return [breadcrumbA, breadcrumbB];\n          }\n\n          if (breadcrumbB.items) {\n            for (const breadcrumbC of breadcrumbB.items) {\n              if (matchesHref(breadcrumbC.href, pathname)) {\n                return [breadcrumbA, breadcrumbB, breadcrumbC];\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  return [];\n}\n\nfunction matchesHref(href: string | undefined, pathname: string) {\n  if (href) {\n    if (href.endsWith(\"/\") && !pathname.endsWith(\"/\")) {\n      pathname += \"/\";\n    } else if (!href.endsWith(\"/\") && pathname.endsWith(\"/\")) {\n      href += \"/\";\n    }\n  }\n  return href === pathname;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/content-nav/content-nav.css",
    "content": ".content-nav {\n  display: flex;\n  padding: 10px 20px 10px 10px;\n}\n\n.content-nav .prev,\n.content-nav .next {\n  flex: 1;\n}\n\n.content-nav a {\n  position: relative;\n  background-color: #0093ee;\n  border: 1px solid #0093ee;\n  border-radius: 5px;\n  padding: 6px 16px;\n  text-decoration: none;\n  color: white;\n  display: inline-block;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  margin: 10px 0;\n  max-width: 150px;\n}\n\n.content-nav a:hover {\n  background-color: white;\n  color: #0093ee;\n}\n\n.content-nav .next {\n  text-align: right;\n}\n\n.content-nav .prev a {\n  padding-left: 24px;\n}\n\n.content-nav .next a {\n  padding-right: 24px;\n}\n\n.content-nav .prev a::before {\n  position: absolute;\n  content: \"\\2039\";\n  top: 5px;\n  left: 11px;\n}\n\n.content-nav .next a::after {\n  position: absolute;\n  content: \"\\203A\";\n  top: 5px;\n  right: 11px;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/content-nav/content-nav.tsx",
    "content": "import {\n  type ContentMenu,\n  Link,\n  useContent,\n  useLocation,\n} from \"@builder.io/qwik-city\";\nimport { component$, useStyles$ } from \"@builder.io/qwik\";\nimport styles from \"./content-nav.css?inline\";\n\nexport const ContentNav = component$(() => {\n  useStyles$(styles);\n\n  const { url } = useLocation();\n\n  const { menu } = useContent();\n  const items = flattenMenu(menu);\n\n  const prev = getNav(items, url.pathname, -1);\n  const next = getNav(items, url.pathname, 1);\n\n  return (\n    <nav class=\"content-nav\">\n      <div class=\"prev\">\n        {prev ? (\n          <Link href={prev.href} prefetch={true}>\n            {prev.text}\n          </Link>\n        ) : null}\n      </div>\n      <div class=\"next\">\n        {next ? (\n          <Link href={next.href} prefetch>\n            {next.text}\n          </Link>\n        ) : null}\n      </div>\n    </nav>\n  );\n});\n\nexport const getNav = (\n  items: ContentMenu[],\n  currentPathname: string,\n  direction: -1 | 1,\n) => {\n  const currentIndex = items.findIndex((p) => p.href === currentPathname);\n  if (currentIndex > -1) {\n    let item = items[currentIndex + direction];\n    if (item && item.href) {\n      return item;\n    }\n    item = items[currentIndex + direction + direction];\n    if (item && item.href) {\n      return item;\n    }\n  }\n};\n\nexport const flattenMenu = (menu: ContentMenu | undefined) => {\n  const items: ContentMenu[] = [];\n  const readMenu = (m: ContentMenu) => {\n    items.push(m);\n    if (m.items) {\n      for (const item of m.items) {\n        readMenu(item);\n      }\n    }\n  };\n  if (menu) {\n    readMenu(menu);\n  }\n  return items;\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/footer/footer.css",
    "content": "footer {\n  border-top: 1px solid #ddd;\n  margin-top: 40px;\n  padding: 20px;\n  font-size: 12px;\n  color: #949494;\n}\n\nfooter a {\n  color: inherit;\n}\n\nfooter ul {\n  list-style: none;\n  margin: 0 0 10px 0;\n  padding: 0;\n  text-align: center;\n}\n\nfooter li {\n  display: inline-block;\n  padding: 4px 12px;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/footer/footer.tsx",
    "content": "import { component$, useStyles$, useTask$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\nimport { useUserLoader } from \"../../routes/layout\";\nimport { useRootLoader } from \"../../routes/plugin@header\";\nimport styles from \"./footer.css?inline\";\nimport { usePlugin } from \"../../routes/plugin@issue4722\";\n\nexport default component$(() => {\n  const serverData = useRootLoader();\n  const userData = useUserLoader();\n  const plugin = usePlugin();\n\n  useStyles$(styles);\n\n  useTask$(({ track }) => {\n    // run everytime it updates\n    track(serverData);\n    track(userData);\n  });\n\n  return (\n    <footer>\n      <ul>\n        <li>\n          <Link href=\"/qwikcity-test/blog/\">Blog</Link>\n        </li>\n        <li>\n          <Link href=\"/qwikcity-test/docs/\">Docs</Link>\n        </li>\n        <li>\n          <Link href=\"/qwikcity-test/actions/\">Actions</Link>\n        </li>\n        <li>\n          <Link href=\"/qwikcity-test/about-us/\">About Us</Link>\n        </li>\n        <li>\n          {userData.value.isAuthenticated ? (\n            <Link href=\"/qwikcity-test/sign-out/\">Sign Out</Link>\n          ) : (\n            <Link href=\"/qwikcity-test/sign-in/\">Sign In</Link>\n          )}\n        </li>\n        <li>\n          <Link href=\"/qwikcity-test/mit/\" target=\"_self\" data-test-link=\"mit\">\n            {/* Should not use include preventdefault:client */}\n            MIT\n          </Link>\n        </li>\n        <li>\n          <Link class=\"footer-home\" href=\"/qwikcity-test/\">\n            Home\n          </Link>\n        </li>\n      </ul>\n      <ul>\n        <li>{serverData.value.serverTime.toISOString()}</li>\n        <li>Node {serverData.value.nodeVersion}</li>\n        <li>{plugin.value.message}</li>\n      </ul>\n    </footer>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/header/header.css",
    "content": "header {\n  background-color: #0093ee;\n}\n\nheader .header-inner {\n  display: grid;\n  grid-template-columns: 1fr auto auto;\n  padding: 10px;\n  max-width: 800px;\n  margin: 0 auto;\n}\n\n.full-screen header .header-inner {\n  max-width: 100%;\n}\n\nheader a {\n  color: white;\n  text-decoration: none;\n  padding: 4px 8px;\n  margin-right: 5px;\n  border-radius: 4px;\n}\n\nheader a:hover {\n  background-color: #ffffff50;\n}\n\nheader .active {\n  background-color: #ffffff30;\n}\n\n.theme-toggle {\n  background: transparent;\n  width: 30px;\n  border: none;\n  cursor: pointer;\n}\n\n.theme-light .theme-toggle::before {\n  content: \"☽\";\n}\n\n.theme-dark .theme-toggle::before {\n  content: \"☀\";\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/header/header.tsx",
    "content": "import { component$, useStyles$ } from \"@builder.io/qwik\";\nimport { Link, useLocation } from \"@builder.io/qwik-city\";\nimport { useUserLoader } from \"../../routes/layout\";\nimport styles from \"./header.css?inline\";\n\nexport default component$(() => {\n  const userData = useUserLoader();\n  const loc = useLocation();\n\n  useStyles$(styles);\n\n  return (\n    <header>\n      <div class=\"header-inner\">\n        <section class=\"logo\">\n          <Link\n            href=\"/qwikcity-test/\"\n            prefetch={true}\n            data-test-link=\"header-home\"\n          >\n            Qwik City 🏙\n          </Link>\n        </section>\n        <nav data-test-header-links>\n          <Link\n            href=\"/qwikcity-test/blog/\"\n            class={{\n              active: loc.url.pathname.startsWith(\"/qwikcity-test/blog/\"),\n            }}\n            data-test-link=\"blog-home\"\n          >\n            Blog\n          </Link>\n          <Link\n            href=\"/qwikcity-test/docs/\"\n            class={{\n              active: loc.url.pathname.startsWith(\"/qwikcity-test/docs/\"),\n            }}\n            data-test-link=\"docs-home\"\n          >\n            Docs\n          </Link>\n          <Link\n            href=\"/qwikcity-test/actions/\"\n            class={{\n              active: loc.url.pathname.startsWith(\"/qwikcity-test/actions/\"),\n            }}\n            data-test-link=\"docs-actions\"\n          >\n            Actions\n          </Link>\n          <Link\n            href=\"/qwikcity-test/api/\"\n            class={{\n              active: loc.url.pathname.startsWith(\"/qwikcity-test/api/\"),\n            }}\n            data-test-link=\"api-home\"\n          >\n            API\n          </Link>\n          <Link\n            href=\"/qwikcity-test/products/hat/\"\n            class={{\n              active: loc.url.pathname.startsWith(\"/qwikcity-test/products/\"),\n            }}\n            data-test-link=\"products-hat\"\n          >\n            Products\n          </Link>\n          <Link\n            href=\"/qwikcity-test/about-us/\"\n            class={{\n              active: loc.url.pathname.startsWith(\"/qwikcity-test/about-us/\"),\n            }}\n            data-test-link=\"about-us\"\n          >\n            About Us\n          </Link>\n\n          {userData.value.isAuthenticated ? (\n            <Link href=\"/qwikcity-test/sign-in/\" data-test-link=\"sign-in\">\n              Dashboard\n            </Link>\n          ) : (\n            <Link\n              href=\"/qwikcity-test/sign-in/\"\n              class={{\n                active: loc.url.pathname.startsWith(\"/qwikcity-test/sign-in/\"),\n              }}\n              data-test-link=\"sign-out\"\n            >\n              Sign In\n            </Link>\n          )}\n        </nav>\n      </div>\n    </header>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/menu/menu.css",
    "content": ".menu {\n  background: #eee;\n  padding: 20px 10px;\n}\n\n.menu h5 {\n  margin: 0;\n}\n\n.menu ul {\n  padding-left: 20px;\n  margin: 5px 0 25px 0;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/menu/menu.tsx",
    "content": "import { component$, Fragment, useStyles$ } from \"@builder.io/qwik\";\nimport { useContent, Link, useLocation } from \"@builder.io/qwik-city\";\nimport styles from \"./menu.css?inline\";\n\nexport const Menu = component$(() => {\n  useStyles$(styles);\n\n  const { menu } = useContent();\n  const { url } = useLocation();\n\n  return (\n    <aside class=\"menu\">\n      {menu\n        ? menu.items?.map((item, i) => (\n            <Fragment key={item.href}>\n              <h5 data-test-menu-header={i}>{item.text}</h5>\n              <ul>\n                {item.items?.map((item) => (\n                  <li key={item.href}>\n                    <Link\n                      data-test-menu-link={item.href}\n                      href={item.href}\n                      class={{\n                        \"is-active\": url.pathname === item.href,\n                      }}\n                    >\n                      {item.text}\n                    </Link>\n                  </li>\n                ))}\n              </ul>\n            </Fragment>\n          ))\n        : null}\n    </aside>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/provider/provider.tsx",
    "content": "import {\n  component$,\n  createContextId,\n  Slot,\n  useContextProvider,\n  useStore,\n} from \"@builder.io/qwik\";\n\nexport type SomeContextType = {\n  value: string;\n};\n\nexport const SomeContext = createContextId<SomeContextType>(\"some-context\");\nexport const SomeProvider = component$(() => {\n  const contextStore = useStore({ value: \"__CONTEXT_VALUE__\" });\n  useContextProvider(SomeContext, contextStore);\n  return <Slot />;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useDocumentHead, useLocation } from \"@builder.io/qwik-city\";\nimport { Social } from \"./social\";\nimport { Vendor } from \"./vendor\";\n\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  const title = head.title ? `${head.title} - Qwik` : `Qwik`;\n  return (\n    <>\n      <title>{title}</title>\n      <link rel=\"canonical\" href={loc.url.href} />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n      <meta name=\"viewport\" content=\"width=device-width\" />\n\n      <Social loc={loc} head={head} />\n      <Vendor loc={loc} />\n\n      {head.meta.map((m) => (\n        <meta {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link {...l} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.style })}\n        />\n      ))}\n\n      {head.scripts.map((s) => (\n        <script\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.script })}\n        />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/router-head/social.tsx",
    "content": "import type {\n  ResolvedDocumentHead,\n  RouteLocation,\n} from \"@builder.io/qwik-city\";\n\nexport const Social = ({ head, loc }: SocialProps) => {\n  return (\n    <>\n      {/*  Open Graph: https://ogp.me/  */}\n      <meta property=\"og:url\" content={loc.url.href} />\n      <meta property=\"og:title\" content={head.title} />\n      <meta property=\"og:type\" content=\"website\" />\n      <meta property=\"og:site_name\" content=\"Qwik\" />\n      <meta property=\"og:locale\" content=\"en_US\" />\n\n      {/*  Twitter: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards  */}\n      <meta name=\"twitter:card\" content=\"summary_large_image\" />\n      <meta name=\"twitter:site\" content=\"@QwikDev\" />\n      <meta name=\"twitter:title\" content={head.title} />\n    </>\n  );\n};\n\ninterface SocialProps {\n  loc: RouteLocation;\n  head: ResolvedDocumentHead;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/components/router-head/vendor.tsx",
    "content": "import type { RouteLocation } from \"@builder.io/qwik-city\";\n\nexport const Vendor = ({ loc }: VendorProps) => {\n  return (\n    <>\n      <script\n        dangerouslySetInnerHTML={`console.log(\"🧨 Analytics! ${loc.url.pathname}\");`}\n      />\n    </>\n  );\n};\n\ninterface VendorProps {\n  loc: RouteLocation;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/entry.ssr.tsx",
    "content": "import {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    base: \"/qwikcity-test/build/\",\n    ...opts,\n  });\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/global.css",
    "content": "body {\n  margin: 0;\n  padding: 0;\n  font-family:\n    system-ui,\n    -apple-system,\n    BlinkMacSystemFont,\n    \"Segoe UI\",\n    Roboto,\n    \"Helvetica Neue\",\n    sans-serif;\n}\n\nmain {\n  padding: 10px 20px;\n  max-width: 800px;\n  margin: 0 auto;\n}\n\n.full-screen main {\n  max-width: 100%;\n}\n\na {\n  color: #006eb3;\n}\n\na:hover {\n  text-decoration: none;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/root.tsx",
    "content": "import { QwikCityProvider, RouterOutlet } from \"@builder.io/qwik-city\";\nimport { SomeProvider } from \"./components/provider/provider\";\nimport { RouterHead } from \"./components/router-head/router-head\";\nimport \"./global.css\";\n\nexport default function Root() {\n  return (\n    <SomeProvider>\n      <QwikCityProvider>\n        <head>\n          <meta charset=\"utf-8\" />\n          <RouterHead />\n        </head>\n        <body>\n          <RouterOutlet />\n        </body>\n      </QwikCityProvider>\n    </SomeProvider>\n  );\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/(auth)/layout.css",
    "content": ".auth {\n  display: grid;\n  grid-template-columns: 1fr 200px;\n  padding: 0;\n}\n\n.auth-content {\n  padding-right: 20px;\n}\n\n.auth form {\n  padding: 20px;\n  border: 1px solid #ddd;\n  border-radius: 5px;\n}\n\n.auth label {\n  display: block;\n  margin: 10px;\n}\n\n.auth label span {\n  display: inline-block;\n  min-width: 100px;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/(auth)/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from \"@builder.io/qwik\";\nimport type { RequestEvent } from \"@builder.io/qwik-city\";\nimport styles from \"./layout.css?inline\";\n\nexport const onGet = ({ headers }: RequestEvent) => {\n  headers.set(\"cache-control\", \"no-cache\");\n};\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  return (\n    <div class=\"auth\" data-test-layout=\"auth\">\n      <section class=\"auth-content\">\n        <Slot />\n      </section>\n      <aside class=\"auth-menu\">\n        <h3>Account Help</h3>\n      </aside>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/(auth)/sign-in/index.tsx",
    "content": "/**\n * Simple Auth For Testing Only!!!\n */\n\nimport { component$ } from \"@builder.io/qwik\";\nimport {\n  type DocumentHead,\n  Form,\n  type RequestHandler,\n  globalAction$,\n  zod$,\n} from \"@builder.io/qwik-city\";\nimport { isUserAuthenticated, signIn } from \"../../../../auth/auth\";\nimport * as z from \"zod\";\n\nexport const onGet: RequestHandler = async ({ redirect, cookie }) => {\n  if (await isUserAuthenticated(cookie)) {\n    throw redirect(302, \"/qwikcity-test/dashboard/\");\n  }\n};\n\nexport const useSigninAction = globalAction$(\n  async (data, { cookie, redirect, status, fail }) => {\n    const result = await signIn(data, cookie);\n\n    if (result.status === \"signed-in\") {\n      throw redirect(302, \"/qwikcity-test/dashboard/\");\n    }\n\n    return fail(403, {\n      message: [\"Invalid username or password\"],\n    });\n  },\n  zod$(\n    z\n      .object({\n        username: z.string(),\n        password: z.string(),\n        confirmPassword: z.string(),\n      })\n      .superRefine(({ confirmPassword, password }, ctx) => {\n        if (confirmPassword !== password) {\n          ctx.addIssue({\n            code: \"custom\",\n            message: \"The passwords did not match\",\n          });\n        }\n      }),\n  ),\n);\n\nexport const useResetPasswordAction = globalAction$(\n  ({ email }) => {\n    console.warn(\"resetPasswordAction\", email);\n  },\n  zod$({\n    email: z.string().email(),\n  }),\n);\n\nexport default component$(() => {\n  const signIn = useSigninAction();\n  const resetPassword = useResetPasswordAction();\n\n  return (\n    <div>\n      <h1>Sign In</h1>\n\n      <Form action={signIn} spaReset>\n        {signIn.value?.message && (\n          <p style=\"color:red\">{signIn.value.message}</p>\n        )}\n        <label>\n          <span>Username</span>\n          <input name=\"username\" type=\"text\" autoComplete=\"username\" required />\n          {signIn.value?.fieldErrors?.username && (\n            <p style=\"color:red\">{signIn.value?.fieldErrors?.username}</p>\n          )}\n        </label>\n        <label>\n          <span>Password</span>\n          <input\n            name=\"password\"\n            type=\"password\"\n            autoComplete=\"current-password\"\n            required\n          />\n          {signIn.value?.fieldErrors?.password && (\n            <p style=\"color:red\">{signIn.value?.fieldErrors?.password}</p>\n          )}\n        </label>\n        <label>\n          <span>Confirm password</span>\n          <input\n            name=\"confirmPassword\"\n            type=\"password\"\n            autoComplete=\"current-password\"\n            required\n          />\n          {signIn.value?.fieldErrors?.confirmPassword && (\n            <p style=\"color:red\">\n              {signIn.value?.fieldErrors?.confirmPassword}\n            </p>\n          )}\n        </label>\n        <button data-test-sign-in>Sign In</button>\n        <p>(Username: qwik, Password: dev)</p>\n      </Form>\n\n      <h2>Reset Password</h2>\n\n      <form method=\"post\" action={resetPassword.actionPath}>\n        <label>\n          <span>Email</span>\n          <input name=\"email\" type=\"text\" required />\n        </label>\n        <button data-test-reset-password>Reset Password</button>\n      </form>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Sign In\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/(auth)/sign-out/index.tsx",
    "content": "/**\n * Simple Auth For Testing Only!!!\n */\n\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\nimport { signOut } from \"../../../../auth/auth\";\n\nexport const onGet: RequestHandler = async ({ redirect, cookie }) => {\n  signOut(cookie);\n  throw redirect(302, \"/qwikcity-test/sign-in/\");\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/[...catchall]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  type DocumentHead,\n  type RequestHandler,\n  useLocation,\n} from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const loc = useLocation();\n\n  return (\n    <div>\n      <h1>Catch All</h1>\n      <p>\n        <span>loc.params.catchall: </span>\n        <code data-test-params=\"catchall\">{loc.params.catchall}</code>\n      </p>\n      <p>\n        <a href=\"/qwikcity-test/\">Home</a>\n      </p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = () => {\n  return {\n    title: \"Catch All\",\n  };\n};\n\nexport const onGet: RequestHandler = ({\n  error,\n  url,\n  exit: exitMiddlewares,\n}) => {\n  if (url.pathname === \"/qwikcity-test/catchall-error/\") {\n    throw error(500, \"ERROR: Demonstration of an error response.\");\n  }\n\n  if (url.pathname === \"/qwikcity-test/catchall/\") {\n    // special case catchall\n    return;\n  }\n\n  exitMiddlewares();\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/[country]/[city]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  type DocumentHead,\n  Link,\n  routeLoader$,\n  useLocation,\n} from \"@builder.io/qwik-city\";\n\nexport const useWeatherLoader = routeLoader$(({ params, query }) => {\n  return {\n    city: params.city,\n    country: params.country,\n    temperature: 30,\n    unit: query.get(\"unit\") || \"C\",\n    forecast: query.get(\"forecast\") || \"10day\",\n  };\n});\n\nexport default component$(() => {\n  const loc = useLocation();\n  const weather = useWeatherLoader().value;\n\n  return (\n    <>\n      <h1>Weather</h1>\n      <p>\n        <span>loc.params.country: </span>\n        <code data-test-params=\"country\">{loc.params.country}</code>\n      </p>\n      <p>\n        <span>resource weather.city: </span>\n        <code data-test-params=\"city\">{weather.city}</code>\n      </p>\n      <p>\n        <span>resource weather.temperature: </span>\n        <code data-test-params=\"temperature\">{weather.temperature}</code>\n        <code>&deg; </code>\n      </p>\n      <p>\n        <span>url.url.searchParams.get('unit'): </span>\n        <code data-test-params=\"unit\">\n          {loc.url.searchParams.get(\"unit\") || \"C\"}\n        </code>\n      </p>\n      <p>\n        <span>resource weather.forecast: </span>\n        <code data-test-params=\"forecast\">{weather.forecast}</code>\n      </p>\n      <ul>\n        <li>\n          <Link href=\"/qwikcity-test/usa/astoria/\">Astoria, OR, USA</Link>\n        </li>\n        <li>\n          <Link href=\"/qwikcity-test/usa/hill-valley/?unit=F&forecast=24hour\">\n            Hill Valley, CA, USA\n          </Link>\n        </li>\n      </ul>\n    </>\n  );\n});\n\nexport const head: DocumentHead = ({ resolveValue, params, url }) => {\n  const weather = resolveValue(useWeatherLoader);\n  const forecast = url.searchParams.get(\"forecast\") || \"10day\";\n\n  return {\n    title: `Weather: ${weather.country} ${params.city}, ${weather.temperature}${weather.unit}, ${forecast}`,\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/about-us/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>About Us</h1>\n      <p>\n        <a href=\"/qwikcity-test/\">Home</a>\n      </p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"About Us\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/actions.module.css",
    "content": ".error {\n  color: red;\n}\n\n.success {\n  color: green;\n}\n\n.processing {\n  color: blue;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  globalAction$,\n  type DocumentHead,\n  routeLoader$,\n} from \"@builder.io/qwik-city\";\nimport { SecretForm } from \"./login\";\n\nexport const useDateLoader = routeLoader$(() => new Date());\n\nexport const useOtherAction = globalAction$(() => {\n  return {\n    success: true,\n  };\n});\n\nexport default component$(() => {\n  const other = useOtherAction();\n  const date = useDateLoader();\n\n  return (\n    <div class=\"actions\">\n      <h1>Actions Test</h1>\n      <section class=\"input\">\n        <SecretForm />\n      </section>\n      <div>{date.value.toISOString()}</div>\n      <section>\n        <div id=\"other-store\">\n          {String(other.isRunning)}:{other.formData?.get(\"username\") as string}:\n          {other.formData?.get(\"code\") as string}:{JSON.stringify(other.value)}\n        </div>\n        <button id=\"other-button\" onClick$={() => other.submit()}>\n          Run other\n        </button>\n        {other.value?.success && <div id=\"other-success\">Success</div>}\n      </section>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = () => {\n  return {\n    title: \"Actions\",\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/issue3183/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, globalAction$ } from \"@builder.io/qwik-city\";\n\nexport const useDotNotationAction = globalAction$(async (payload) => {\n  return {\n    success: true,\n    payload: payload,\n  };\n});\n\nexport default component$(() => {\n  const dotNotation = useDotNotationAction();\n\n  return (\n    <>\n      <h1>Dot Notation Form Inputs</h1>\n      <Form action={dotNotation} id=\"dot-notation-form\">\n        <input type=\"hidden\" name=\"arrayOld[]\" value=\"0\" />\n        <input type=\"hidden\" name=\"arrayOld[]\" value=\"1\" />\n        <input type=\"hidden\" name=\"arrayNew.0\" value=\"0\" />\n        <input type=\"hidden\" name=\"arrayNew.1\" value=\"1\" />\n        <input type=\"hidden\" name=\"people.0.name\" value=\"Fred\" />\n        <input type=\"hidden\" name=\"people.1.name\" value=\"Sam\" />\n\n        <button id=\"issue3183-button\" disabled={dotNotation.isRunning}>\n          Dot Notation\n        </button>\n      </Form>\n      {dotNotation.value?.success && (\n        <div id=\"issue3183-success\">\n          {JSON.stringify(dotNotation.value.payload)}\n        </div>\n      )}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/issue3497/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, globalAction$ } from \"@builder.io/qwik-city\";\n\nexport const useDotNotationAction = globalAction$(async (payload) => {\n  return {\n    success: true,\n    payload: payload,\n  };\n});\n\nexport default component$(() => {\n  const dotNotation = useDotNotationAction();\n\n  return (\n    <>\n      <h1>Dot Notation Form Inputs</h1>\n      <Form action={dotNotation} id=\"dot-notation-form\">\n        <input type=\"hidden\" name=\"credentials.username\" value=\"user\" />\n        <input type=\"hidden\" name=\"credentials.password\" value=\"pass\" />\n        <input type=\"hidden\" name=\"array[]\" value=\"1\" />\n        <input type=\"hidden\" name=\"array[]\" value=\"2\" />\n        <button id=\"issue3497-button\" disabled={dotNotation.isRunning}>\n          Dot Notation\n        </button>\n      </Form>\n      {dotNotation.value?.success && (\n        <div id=\"issue3497-success\">\n          {JSON.stringify(dotNotation.value.payload)}\n        </div>\n      )}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/issue4444/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { ActionStandalone } from \"../../../../components/action/action\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Test</h1>\n      <ActionStandalone />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/issue5065/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeAction$, zod$, z } from \"@builder.io/qwik-city\";\nimport type { ValidatorErrorType } from \"packages/qwik-city/src/runtime/src/types\";\n\n// This is a TypeScript type validation test only.\n\ninterface MyObject {\n  value: number;\n  optional?: string;\n}\n\nexport const useSimpleObjectAction = routeAction$(\n  async () => ({ value: 42 }) as MyObject,\n);\n\nexport const useZodObjectAction = routeAction$(\n  async () => ({ value: 42 }) as MyObject,\n  zod$({ name: z.string() }),\n);\n\nexport default component$(() => {\n  const fooAction = useSimpleObjectAction();\n  const fooValue = fooAction.value!;\n  fooValue satisfies MyObject;\n\n  const zodAction = useZodObjectAction();\n  const zodValue = zodAction.value!;\n  if (zodValue.failed) {\n    zodValue satisfies { failed: true } & ValidatorErrorType<{\n      name: string;\n    }>;\n  } else {\n    zodValue satisfies MyObject;\n  }\n  return <>TEST</>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/issue5463/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, globalAction$, zod$ } from \"@builder.io/qwik-city\";\n\nexport const useDotNotationAction = globalAction$(\n  async (payload) => {\n    return {\n      success: true,\n      payload: payload,\n    };\n  },\n  zod$((z) =>\n    z.object({\n      credentials: z.object({\n        username: z.string(),\n        password: z.string(),\n      }),\n      evenMoreComplex: z.object({\n        deep: z.object({\n          firstName: z.string(),\n        }),\n      }),\n      persons: z.array(z.object({ name: z.string() })),\n    }),\n  ),\n);\n\nexport default component$(() => {\n  const dotNotation = useDotNotationAction();\n\n  type ConfirmType = Partial<\n    Record<\n      | \"credentials.username\"\n      | \"credentials.password\"\n      | \"evenMoreComplex.deep.firstName\",\n      string\n    >\n  >;\n\n  const errors = dotNotation.value?.fieldErrors satisfies\n    | ConfirmType\n    | undefined;\n\n  return (\n    <>\n      <h1>Dot Notation Form Errors</h1>\n      <Form action={dotNotation} id=\"dot-notation-form\">\n        <input\n          type=\"hidden\"\n          name=\"credentials.username\"\n          value=\"user\"\n          class={{\n            error: dotNotation.value?.fieldErrors?.[\"credentials.username\"],\n          }}\n        />\n        <input\n          type=\"hidden\"\n          name=\"credentials.password\"\n          value=\"pass\"\n          class={{\n            error: dotNotation.value?.fieldErrors?.[\"credentials.password\"],\n          }}\n        />\n        <input\n          type=\"hidden\"\n          name=\"credentials.password\"\n          value=\"pass\"\n          class={{\n            error:\n              dotNotation.value?.fieldErrors?.[\n                \"evenMoreComplex.deep.firstName\"\n              ],\n          }}\n        />\n        {errors?.[\"credentials.password\"] ?? \"no error\"}\n\n        <input\n          type=\"hidden\"\n          name=\"evenMoreComplex.deep.firstName\"\n          value=\"John\"\n          class={{\n            error:\n              dotNotation.value?.fieldErrors?.[\n                \"evenMoreComplex.deep.firstName\"\n              ],\n          }}\n        />\n\n        <input\n          type=\"hidden\"\n          name=\"persons.0.name\"\n          value=\"John\"\n          class={{\n            error: dotNotation.value?.fieldErrors?.[\"persons[].name\"]?.[0],\n          }}\n        />\n\n        <button>Dot Notation</button>\n      </Form>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/login.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\nimport { zod$, z, Form, globalAction$ } from \"@builder.io/qwik-city\";\nimport styles from \"./actions.module.css\";\n\nexport function delay(nu: number) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, nu);\n  });\n}\n\nexport const useSecretAction = globalAction$(\n  async (payload, { fail, redirect }) => {\n    if (payload.username === \"admin\" && payload.code === 123) {\n      await delay(2000);\n      return {\n        secret: \"this is the secret\",\n        date: new Date(),\n      };\n    } else if (payload.username === \"redirect\" && payload.code === 123) {\n      throw redirect(302, \"/qwikcity-test/\");\n    }\n    return fail(400, {\n      message: \"Invalid username or code\",\n    });\n  },\n  zod$({\n    username: z.string().min(3).max(10),\n    code: z.coerce.number(),\n    button: z.string().startsWith(\"hello\"),\n  }),\n);\n\nexport const SecretForm = component$(() => {\n  const action = useSecretAction();\n  const message = useSignal(\"\");\n\n  return (\n    <>\n      <Form action={action} id=\"secret-form\">\n        {action.isRunning && (\n          <p id=\"running\" class={styles.processing}>\n            Running...\n          </p>\n        )}\n        <div>\n          <label id=\"label-username\">\n            Username:\n            <input\n              type=\"text\"\n              name=\"username\"\n              placeholder=\"admin\"\n              value={action.formData?.get(\"username\")}\n            />\n            {action.value?.fieldErrors?.username && (\n              <p class={styles.error}>{action.value.fieldErrors.username}</p>\n            )}\n          </label>\n        </div>\n        <div>\n          <label id=\"label-code\">\n            Code:\n            <input\n              type=\"text\"\n              name=\"code\"\n              placeholder=\"123\"\n              value={action.formData?.get(\"code\")}\n            />\n            {action.value?.fieldErrors?.code && (\n              <p class={styles.error}>{action.value.fieldErrors.code}</p>\n            )}\n          </label>\n        </div>\n        {action.value?.message && (\n          <p id=\"form-error\" class={styles.error}>\n            {action.value.message}\n          </p>\n        )}\n        {action.value?.secret && (\n          <p id=\"form-success\" class={styles.success}>\n            {action.value.secret}\n          </p>\n        )}\n        <button\n          value=\"hello\"\n          name=\"button\"\n          id=\"submit\"\n          disabled={action.isRunning}\n        >\n          Submit\n        </button>\n      </Form>\n\n      <button\n        type=\"button\"\n        onClick$={async () => {\n          const { value } = await action.submit({\n            username: \"admin\",\n            code: 123,\n            button: \"hello\",\n          });\n          console.warn(value?.secret);\n          message.value = value!.secret!;\n        }}\n      >\n        I don't wanna to play\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/multiple-handlers/index.tsx",
    "content": "import { $, component$, useSignal } from \"@builder.io/qwik\";\nimport { Form, routeAction$ } from \"@builder.io/qwik-city\";\n\nexport const useDotNotationAction = routeAction$(async (payload) => {\n  return {\n    success: true,\n    payload: payload,\n  };\n});\n\nexport default component$(() => {\n  const finished = useSignal(false);\n  const dotNotation = useDotNotationAction();\n\n  return (\n    <>\n      <h1>Dot Notation Form Inputs</h1>\n      <Form\n        action={dotNotation}\n        onSubmit$={[\n          $(() => {\n            finished.value = false;\n          }),\n          $((evt) => dotNotation.submit(evt)),\n          $(() => {\n            finished.value = dotNotation.submitted;\n          }),\n        ]}\n        id=\"dot-notation-form\"\n      >\n        <input type=\"hidden\" name=\"arrayOld[]\" value=\"0\" />\n        <input type=\"hidden\" name=\"arrayOld[]\" value=\"1\" />\n        <input type=\"hidden\" name=\"arrayNew.0\" value=\"0\" />\n        <input type=\"hidden\" name=\"arrayNew.1\" value=\"1\" />\n        <input type=\"hidden\" name=\"people.0.name\" value=\"Fred\" />\n        <input type=\"hidden\" name=\"people.1.name\" value=\"Sam\" />\n\n        <button id=\"multiple-handlers-button\" disabled={dotNotation.isRunning}>\n          Dot Notation\n        </button>\n      </Form>\n      {dotNotation.value?.success && (\n        <div id=\"multiple-handlers-success\">\n          {JSON.stringify(dotNotation.value.payload)}\n        </div>\n      )}\n      <div id=\"multiple-handlers-finished\">{String(finished.value)}</div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/actions/validated/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  routeAction$,\n  routeLoader$,\n  validator$,\n  z,\n  zod$,\n} from \"@builder.io/qwik-city\";\nimport type {\n  CommonLoaderActionOptions,\n  JSONObject,\n  RequestEventAction,\n  ValidatorErrorType,\n} from \"packages/qwik-city/src/runtime/src/types\";\n\ntype TypedDataValidatorError = ValidatorErrorType<{\n  category: \"bird\" | \"dog\" | \"rat\";\n}>;\n\nconst typedDataValidator = zod$({\n  category: z.enum([\"bird\", \"dog\", \"rat\"]),\n});\n\ninterface DataValidatorError {\n  message: string;\n}\n\nconst dataValidator = validator$((ev) => {\n  if (ev.query.get(\"secret\") === \"123\") {\n    return {\n      success: true,\n    };\n  }\n  return {\n    success: false,\n    error: {\n      message: \"Secret not found\",\n    } as DataValidatorError,\n  };\n});\n\ninterface ActionSuccessObject {\n  actionSuccess: string;\n}\n\ninterface ActionFailedObject {\n  actionFail: string;\n}\n\nconst actionQrl = (data: JSONObject, { fail }: RequestEventAction) => {\n  if (Math.random() > 0.5) {\n    return fail(500, {\n      actionFail: \"secret\",\n    } as ActionFailedObject);\n  }\n\n  return {\n    actionSuccess: \"シマエナガ\",\n  } as ActionSuccessObject;\n};\n\nexport const useLoader = routeLoader$(() => {\n  return {\n    stuff: \"hello\",\n  };\n}, dataValidator);\n\nexport const useAction1 = routeAction$(actionQrl, {\n  validation: [typedDataValidator, dataValidator],\n} as CommonLoaderActionOptions);\nexport const useAction2 = routeAction$(actionQrl, {\n  validation: [typedDataValidator],\n} as CommonLoaderActionOptions);\nexport const useAction3 = routeAction$(actionQrl, {\n  validation: [dataValidator],\n} as CommonLoaderActionOptions);\nexport const useAction4 = routeAction$(\n  actionQrl,\n  typedDataValidator,\n  dataValidator,\n);\nexport const useAction5 = routeAction$(actionQrl, typedDataValidator);\nexport const useAction6 = routeAction$(actionQrl, dataValidator);\nexport const useAction7 = routeAction$(actionQrl);\nexport const useAction8 = routeAction$(actionQrl, { id: \"id-action-8\" });\n\nexport default component$(() => {\n  const loader = useLoader();\n\n  // Use options object, use typed data validator, use data validator\n  const action1 = useAction1();\n  if (action1.value) {\n    if (action1.value.failed) {\n      action1.value satisfies { failed: true } & (\n        | TypedDataValidatorError\n        | DataValidatorError\n        | ActionFailedObject\n      );\n    } else {\n      action1.value satisfies ActionSuccessObject;\n    }\n  }\n\n  // Use options object, use typed data validator\n  const action2 = useAction2();\n  if (action2.value) {\n    if (action2.value.failed) {\n      action2.value satisfies { failed: true } & (\n        | TypedDataValidatorError\n        | ActionFailedObject\n      );\n    } else {\n      action2.value satisfies ActionSuccessObject;\n    }\n  }\n\n  // Use options object, use data validator\n  const action3 = useAction3();\n  if (action3.value) {\n    if (action3.value.failed) {\n      action3.value satisfies { failed: true } & (\n        | DataValidatorError\n        | ActionFailedObject\n      );\n    } else {\n      action3.value satisfies ActionSuccessObject;\n    }\n  }\n\n  // Use typed data validator, use data validator\n  const action4 = useAction4();\n  if (action4.value) {\n    if (action4.value.failed) {\n      action4.value satisfies { failed: true } & (\n        | TypedDataValidatorError\n        | DataValidatorError\n        | ActionFailedObject\n      );\n    } else {\n      action4.value satisfies ActionSuccessObject;\n    }\n  }\n\n  // Use typed data validator\n  const action5 = useAction5();\n  if (action5.value) {\n    if (action5.value.failed) {\n      action5.value satisfies { failed: true } & (\n        | TypedDataValidatorError\n        | ActionFailedObject\n      );\n    } else {\n      action5.value satisfies ActionSuccessObject;\n    }\n  }\n\n  // Use data validator\n  const action6 = useAction6();\n  if (action6.value) {\n    if (action6.value.failed) {\n      action6.value satisfies { failed: true } & (\n        | DataValidatorError\n        | ActionFailedObject\n      );\n    } else {\n      action6.value satisfies ActionSuccessObject;\n    }\n  }\n\n  // No validators\n  const action7 = useAction7();\n  if (action7.value) {\n    if (action7.value.failed) {\n      action7.value satisfies { failed: true } & ActionFailedObject;\n    } else {\n      action7.value satisfies ActionSuccessObject;\n    }\n  }\n\n  // No validators, with action id\n  const action8 = useAction7();\n  if (action8.value) {\n    if (action8.value.failed) {\n      action8.value satisfies { failed: true } & ActionFailedObject;\n    } else {\n      action8.value satisfies ActionSuccessObject;\n    }\n  }\n\n  return (\n    <div>\n      <h1>Validated</h1>\n      {loader.value.failed ? (\n        <div>\n          <p>Failed</p>\n          <p>{loader.value.message}</p>\n        </div>\n      ) : (\n        <div>\n          <p>Success</p>\n          <p>{loader.value.stuff}</p>\n        </div>\n      )}\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/api/[org]/[user].json/index.ts",
    "content": "import type { RequestHandler } from \"@builder.io/qwik-city\";\nimport os from \"node:os\";\n\nexport const onGet: RequestHandler = ({ request, params, json }) => {\n  json(200, {\n    timestamp: Date.now(),\n    method: request.method,\n    url: request.url,\n    params,\n    os: os.platform(),\n    arch: os.arch(),\n    node: process.versions.node,\n  });\n};\n\nexport const onPost: RequestHandler = async ({ request, headers, send }) => {\n  headers.set(\"Content-Type\", \"text/plain\");\n  send(\n    200,\n    `Platform: ${os.platform()}, Node: ${process.versions.node}, HTTP Method: ${\n      request.method\n    }`,\n  );\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/api/data.json/index.ts",
    "content": "import type { RequestHandler } from \"@builder.io/qwik-city\";\nimport os from \"node:os\";\nimport url from \"node:url\";\nimport path from \"node:path\";\nimport fs from \"node:fs\";\n\nexport const onRequest: RequestHandler = ({\n  request,\n  headers,\n  query,\n  sharedMap,\n  json,\n  html,\n  send,\n  getWritableStream,\n  status,\n}) => {\n  const format = query.get(\"format\");\n\n  if (format === \"img\") {\n    const faviconPath = path.join(\n      path.dirname(url.fileURLToPath(import.meta.url)),\n      \"..\",\n      \"public\",\n      \"favicon.ico\",\n    );\n\n    status(200);\n    headers.set(\"Content-Type\", \"image/x-icon\");\n\n    const writer = getWritableStream().getWriter();\n    fs.createReadStream(faviconPath)\n      .on(\"data\", (chunk) => {\n        writer.write(chunk as any);\n      })\n      .on(\"end\", () => {\n        writer.close();\n      });\n\n    return;\n  }\n\n  if (format === \"csv\") {\n    status(203);\n    headers.set(\"Content-Type\", \"text/plain\");\n    const { writable, readable } = new TextEncoderStream();\n    readable.pipeTo(getWritableStream());\n    const stream = writable.getWriter();\n    setTimeout(() => {\n      stream.write(csvLine(0));\n      setTimeout(() => {\n        stream.write(csvLine(1));\n        setTimeout(() => {\n          stream.write(csvLine(2));\n          stream.close();\n        }, 500);\n      }, 500);\n    }, 500);\n    return;\n  }\n\n  if (format === \"text\") {\n    headers.set(\"Content-Type\", \"text/plain\");\n    send(202, format + \" \" + request.method + \" \" + new Date().toISOString());\n    return;\n  }\n\n  if (format === \"html\") {\n    html(201, format + \" \" + request.method + \" \" + new Date().toISOString());\n    return;\n  }\n\n  json(200, {\n    shared: sharedMap.get(\"root\") ?? \"not set\",\n    timestamp: new Date().toISOString(),\n    method: request.method,\n    url: request.url,\n    os: os.platform(),\n    arch: os.arch(),\n    node: process.versions.node,\n  });\n};\n\nfunction csvLine(num: number) {\n  let l = String(num);\n  while (l.length < 18000) {\n    l += \",\" + new Date().toISOString();\n  }\n  return l + \"\\n\";\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/api/index@api.tsx",
    "content": "import { component$, useVisibleTask$, useStore } from \"@builder.io/qwik\";\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const store = useStore({ timestamp: \"\", os: \"\", arch: \"\", node: \"\" });\n\n  useVisibleTask$(async () => {\n    const url = `/qwikcity-test/api/builder.io/oss.json`;\n    const rsp = await fetch(url);\n    const data: any = await rsp.json();\n\n    store.timestamp = data.timestamp;\n    store.os = data.os;\n    store.arch = data.arch;\n    store.node = data.node;\n  });\n\n  return (\n    <div>\n      <h1>Qwik City Test API!</h1>\n\n      <ul>\n        <li>\n          <a href=\"/qwikcity-test/api/builder.io/oss.json\">\n            /api/[org]/[user].json\n          </a>\n        </li>\n        <li>\n          <a href=\"/qwikcity-test/api/data.json\">/api/data.json</a>\n        </li>\n      </ul>\n\n      <p>\n        <button\n          data-test-api-onput\n          type=\"button\"\n          onClick$={async (_, elm) => {\n            const res = await fetch(\"/qwikcity-test/api/\", {\n              method: \"PUT\",\n              body: JSON.stringify({ data: \"test\" }),\n            });\n            const data = await res.json();\n            elm.classList.add(\"onput-success\");\n            elm.textContent = data.test;\n          }}\n        >\n          onPut\n        </button>\n      </p>\n\n      <p>\n        <button\n          data-test-api-onpost\n          type=\"button\"\n          onClick$={async (_, elm) => {\n            const res = await fetch(\"/qwikcity-test/api/\", {\n              method: \"POST\",\n              body: JSON.stringify({ data: \"test\" }),\n              headers: {\n                Accept: \"application/json\",\n              },\n            });\n            const data = await res.json();\n            elm.classList.add(\"onpost-success\");\n            elm.textContent = data.test;\n          }}\n        >\n          onPost (accept: application/json)\n        </button>\n      </p>\n\n      <p>Timestamp: {store.timestamp}</p>\n      <p>\n        Node: <span data-test-api-node>{store.node}</span>\n      </p>\n      <p>\n        OS: <span>{store.os}</span>\n      </p>\n    </div>\n  );\n});\n\nexport const onPut: RequestHandler = async ({ request, method, json }) => {\n  const requestData = await request.json();\n  json(200, {\n    test: \"PUT \" + requestData.data,\n    method: method,\n  });\n};\n\nexport const onPost: RequestHandler = async ({ request, method, json }) => {\n  const requestData = await request.json();\n  json(200, {\n    test: \"POST \" + requestData.data,\n    method: request.method,\n  });\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/api/layout-api.css",
    "content": ".api {\n  display: grid;\n  grid-template-columns: 200px 1fr;\n  padding: 0;\n}\n\n.api-menu {\n  background: #eee;\n  padding-left: 20px;\n}\n\n.api-content {\n  padding-left: 20px;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/api/layout-api.tsx",
    "content": "import { component$, Slot, useStyles$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\nimport styles from \"./layout-api.css?inline\";\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  return (\n    <div data-test-layout=\"api\" class=\"api\">\n      <aside class=\"api-menu\">\n        <h2>API</h2>\n        <ul>\n          <li>\n            <a\n              href=\"/qwikcity-test/api/builder.io/oss.json\"\n              data-test-link=\"api-org-user\"\n            >\n              Org/User\n            </a>\n          </li>\n          <li>\n            <a href=\"/qwikcity-test/api/data.json\" data-test-link=\"api-data\">\n              Data\n            </a>\n          </li>\n        </ul>\n      </aside>\n      <section class=\"api-content\">\n        <Slot />\n      </section>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = ({ url }) => {\n  return {\n    title: `API: ${url.pathname}`,\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/blog/[...slug]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  type DocumentHead,\n  type StaticGenerateHandler,\n  routeLoader$,\n} from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const blog = useLoader();\n\n  return (\n    <div>\n      <h1>{blog.value.title}</h1>\n      <p>{blog.value.content}</p>\n    </div>\n  );\n});\n\nexport interface BlogData {\n  title: string;\n  content: string;\n}\n\nexport const useLoader = routeLoader$(({ params, request }) => {\n  return {\n    title: `Blog: ${params.slug}`,\n    content: `${params.slug}, ${request.url}`,\n  };\n});\n\nexport const head: DocumentHead = ({ resolveValue }) => {\n  const data = resolveValue(useLoader);\n  return { title: data?.title };\n};\n\nexport const onStaticGenerate: StaticGenerateHandler = async () => {\n  return {\n    params: [\n      {\n        slug: `what-is-resumability`,\n      },\n    ],\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/blog/index.md",
    "content": "---\ntitle: Welcome to our Blog!\ndescription: Blog Description\nkeywords: blog,docs\ncontributors:\n  - abc\n  - xyz\n---\n\n# Welcome to our Blog!\n\nEnjoy.\n\n[Docs](../../docs/getting-started/index.md#hash)\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/blog/layout.tsx",
    "content": "import { component$, Slot } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div data-test-layout=\"blog\">\n      <section class=\"blog-content\">\n        <Slot />\n      </section>\n      <aside class=\"blog-menu\">\n        <ul>\n          <li>\n            <Link\n              href=\"/qwikcity-test/blog/what-is-resumability\"\n              data-test-link=\"blog-resumability\"\n            >\n              What Is Resumability?\n            </Link>\n          </li>\n          <li>\n            <Link\n              href=\"/qwikcity-test/blog/serializing-props\"\n              data-test-link=\"blog-serializing-props\"\n            >\n              Serializing Props\n            </Link>\n          </li>\n        </ul>\n      </aside>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n// @ts-ignore\nimport ImageJpeg from \"../../media/MyTest.jpeg?jsx\";\n// @ts-ignore\nimport ImageSvg from \"../../media/qwikLogo.svg?jsx\";\n// @ts-ignore\nimport ImageJpegResized from \"../../media/MyTest.jpeg?jsx&w=100&h=100&format=avif\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1 onClick$={() => console.warn(\"hola\")}>Welcome to Qwik City</h1>\n      <p>The meta-framework for Qwik.</p>\n      <ImageJpeg id=\"image-jpeg\" loading=\"eager\" decoding=\"auto\" />\n      <ImageSvg id=\"image-svg\" />\n      <ImageJpegResized id=\"image-avif\" />\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Welcome to Qwik City\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/issue2644/data.ts",
    "content": "export const data: string[] = [];\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/issue2644/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, routeAction$ } from \"@builder.io/qwik-city\";\nimport { data } from \"./data\";\n\nexport const useRootAction = routeAction$(\n  (form, { redirect }) => {\n    const name = form.name as string;\n    data.length = 0;\n    data.push(name);\n    throw redirect(303, \"/qwikcity-test/issue2644/other/\");\n  },\n  {\n    id: \"root-action\",\n  },\n);\n\nexport default component$(() => {\n  const action = useRootAction();\n  return (\n    <Form action={action} spaReset>\n      <input name=\"name\" id=\"issue2644-input\" />\n      <button id=\"issue2644-submit\">Submit</button>\n    </Form>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/issue2644/other/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, routeLoader$, routeAction$ } from \"@builder.io/qwik-city\";\nimport { data } from \"../data\";\n\nexport const useGetData = routeLoader$(() => {\n  return data;\n});\n\nexport const useOtherAction = routeAction$((form) => {\n  const name = form.name as string;\n  data.push(name);\n  return { success: true };\n});\n\nexport default component$(() => {\n  const items = useGetData();\n  const action = useOtherAction();\n  return (\n    <div>\n      <ul id=\"issue2644-list\">\n        {items.value.map((x) => (\n          <li>{x}</li>\n        ))}\n      </ul>\n      <Form action={action}>\n        <input name=\"name\" id=\"issue2644-input\" />\n        <button id=\"issue2644-submit\">Submit</button>\n      </Form>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/issue2878/[...slug]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  type DocumentHead,\n  type StaticGenerateHandler,\n  routeLoader$,\n} from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const blog = useLoader();\n\n  return (\n    <div>\n      <h1>{blog.value.title}</h1>\n      <p>{blog.value.content}</p>\n    </div>\n  );\n});\n\nexport interface BlogData {\n  title: string;\n  content: string;\n}\n\nexport const useLoader = routeLoader$(({ params, request }) => {\n  return {\n    title: `Blog: ${params.slug}`,\n    content: `${params.slug}, ${request.url}`,\n  };\n});\n\nexport const head: DocumentHead = ({ resolveValue }) => {\n  const data = resolveValue(useLoader);\n  return { title: data?.title };\n};\n\nexport const onStaticGenerate: StaticGenerateHandler = async () => {\n  return {\n    params: [\n      {\n        slug: `what-is-resumability`,\n      },\n    ],\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/layout.tsx",
    "content": "import { component$, Slot } from \"@builder.io/qwik\";\nimport Footer from \"../../components/footer/footer\";\nimport Header from \"../../components/header/header\";\n\nexport const isNull = null;\n\nexport default component$(() => {\n  return (\n    <div data-test-layout=\"root\">\n      <Header />\n      <main>\n        <Slot />\n      </main>\n      <Footer />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/loaders/[id]/index.tsx",
    "content": "import { component$, Resource } from \"@builder.io/qwik\";\nimport {\n  type DocumentHead,\n  Form,\n  Link,\n  routeLoader$,\n  routeAction$,\n  z,\n  zod$,\n} from \"@builder.io/qwik-city\";\nimport { delay } from \"../../actions/login\";\n\nexport const useDateLoader = routeLoader$(\n  () => new Date(\"2021-01-01T00:00:00.000Z\"),\n);\n\nexport const useDependencyLoader = routeLoader$(\n  async ({ params, redirect, json, resolveValue }) => {\n    const formData = await resolveValue(useForm);\n    await delay(100);\n    if (params.id === \"redirect\") {\n      throw redirect(302, \"/qwikcity-test/\");\n    } else if (params.id === \"redirect-welcome\") {\n      throw redirect(302, \"/qwikcity-test/loaders/welcome/\");\n    } else if (params.id === \"json\") {\n      throw json(200, { nu: 42 });\n    }\n    return {\n      nu: 42,\n      name: formData?.name ?? params.id,\n    };\n  },\n);\n\nconst useLoader = routeLoader$(() => {\n  return [\n    {\n      id: 1,\n      product: {\n        name: \"test\",\n        options: [{ name: \"first\" }, { name: \"second\" }],\n      },\n    },\n  ];\n});\n\nexport const useAsyncLoader = routeLoader$(async ({ resolveValue }) => {\n  const p1 = resolveValue(useDateLoader);\n  const p2 = resolveValue(useDependencyLoader);\n  if (!(p1 instanceof Promise)) {\n    throw new Error(\"Expected date to be a promise\");\n  }\n  if (!(p2 instanceof Promise)) {\n    throw new Error(\"Expected dep to be a promise\");\n  }\n\n  const date = await p1;\n  const dep = await p2;\n\n  return async () => {\n    await delay(500);\n\n    return {\n      date: date,\n      dep: dep.nu * 2,\n      name: dep.name,\n    };\n  };\n});\n\nexport const useSlowLoader = routeLoader$(async () => {\n  await delay(500);\n  return {\n    foo: 123,\n  };\n});\n\nexport const useRealDateLoader = routeLoader$(() => {\n  return [new Date().toISOString()];\n});\n\nexport const DateCmp = component$(() => {\n  const date = useRealDateLoader();\n  return <p id=\"real-date\">real-date: {date.value[0]}</p>;\n});\n\nexport default component$(() => {\n  const date = useDateLoader();\n  const slow = useSlowLoader();\n  const signal = useAsyncLoader();\n  const action = useForm();\n  const items = useLoader().value;\n  const items3 = items.map((item) => {\n    return {\n      ...item,\n      reversed: item.product.options.reverse(),\n    };\n  });\n  console.warn(\"items3\", items3);\n\n  return (\n    <div class=\"loaders\">\n      <h1>Loaders</h1>\n      <DateCmp></DateCmp>\n      <div>\n        <p id=\"date\">date: {date.value.toISOString()}</p>\n      </div>\n      <div>\n        <p id=\"slow\">slow: {slow.value.foo}</p>\n      </div>\n      <Resource\n        value={signal}\n        onResolved={(value) => {\n          return (\n            <div>\n              <p id=\"nested-date\">date: {value.date.toISOString()}</p>\n              <p id=\"nested-dep\">dep: {value.dep}</p>\n              <p id=\"nested-name\">name: {value.name}</p>\n            </div>\n          );\n        }}\n      />\n      <Form action={action}>\n        <input type=\"text\" name=\"name\" id=\"form-name\" />\n        <button type=\"submit\" id=\"form-submit\">\n          Submit\n        </button>\n      </Form>\n      <ul>\n        <li>\n          <Link href=\"/qwikcity-test/loaders/stuff/\" id=\"link-stuff\">\n            To Stuff\n          </Link>\n        </li>\n        <li>\n          <Link href=\"/qwikcity-test/loaders/redirect/\" id=\"link-redirect\">\n            To Redirect home\n          </Link>\n        </li>\n        <li>\n          <Link\n            href=\"/qwikcity-test/loaders/redirect-welcome/\"\n            id=\"link-welcome\"\n          >\n            To Redirect /loaders/welcome/\n          </Link>\n        </li>\n      </ul>\n    </div>\n  );\n});\n\nexport const useForm = routeAction$(\n  async (stuff) => {\n    return stuff;\n  },\n  zod$({\n    name: z.string(),\n  }),\n);\n\nexport const useFormWithError = routeAction$(async (stuff, { fail }) => {\n  if (Math.random() > 2) {\n    return fail(500, {\n      message: \"Random error\",\n    });\n  }\n  return {\n    name: stuff.name as string,\n  };\n});\n\nexport const head: DocumentHead = ({ resolveValue }) => {\n  const date = resolveValue(useDateLoader);\n  const dep = resolveValue(useDependencyLoader);\n  const action = resolveValue(useForm);\n  const actionWithError = resolveValue(useFormWithError);\n  let title = \"Loaders\";\n  if (action) {\n    title += ` - ACTION: ${action.name}`;\n  }\n  if (actionWithError) {\n    title += ` - Error: ${actionWithError.name} ${actionWithError.message}`;\n  }\n  return {\n    title,\n    meta: [\n      { content: date.toISOString(), name: \"date\" },\n      { content: `${dep.nu}`, name: \"dep\" },\n    ],\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/loaders/issue3979/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport {\n  routeLoader$,\n  validator$,\n  type RequestEventAction,\n} from \"@builder.io/qwik-city\";\n\nconst dataValidator = validator$((ev) => {\n  if (ev.query.get(\"secret\") === \"123\") {\n    return {\n      success: true,\n    };\n  }\n  return {\n    success: false,\n    error: {\n      validationFailReason: \"Secret not found\",\n    },\n  };\n});\n\nconst petLoaderQrl = () => {\n  return {\n    pet: \"guinea pig\",\n  };\n};\n\nconst dynamicPetLoaderQrl = () => {\n  if (Math.random() > 0.5) {\n    return {\n      dog: \"malamute\",\n    };\n  }\n\n  return {\n    rat: \"guinea pig\",\n  };\n};\n\nconst randomFailedLoaderQrl = ({ fail }: RequestEventAction) => {\n  if (Math.random() > 0.5) {\n    return fail(500, {\n      loaderFailedReason: \"Reach Limit\",\n    });\n  }\n\n  return {\n    pet: \"guinea pig\",\n  };\n};\n\nexport const usePetLoader = routeLoader$(petLoaderQrl);\nexport const usePetWithValidationLoader = routeLoader$(\n  petLoaderQrl,\n  dataValidator,\n);\n\nexport const useDynamicPetLoader = routeLoader$(dynamicPetLoaderQrl);\nexport const useDynamicPetWithValidationLoader = routeLoader$(\n  dynamicPetLoaderQrl,\n  dataValidator,\n);\n\nexport const useRandomFailedLoader = routeLoader$(randomFailedLoaderQrl);\nexport const useRandomFailedWithValidatorLoader = routeLoader$(\n  randomFailedLoaderQrl,\n  dataValidator,\n);\n\nexport default component$(() => {\n  const pet = usePetLoader();\n  const petWithValidation = usePetWithValidationLoader();\n  const dynamicPet = useDynamicPetLoader();\n  const dynamicPetWithValidation = useDynamicPetWithValidationLoader();\n  const randomFailed = useRandomFailedLoader();\n  const randomFailedWithValidator = useRandomFailedWithValidatorLoader();\n\n  return (\n    <div>\n      <div>{pet.value.pet}</div>\n      <div>\n        {petWithValidation.value.pet}\n        {petWithValidation.value.failed}\n        {petWithValidation.value.validationFailReason}\n      </div>\n      <div>\n        {dynamicPet.value.dog}\n        {dynamicPet.value.rat}\n      </div>\n      <div>\n        {dynamicPetWithValidation.value.dog}\n        {dynamicPetWithValidation.value.rat}\n        {dynamicPetWithValidation.value.failed}\n        {dynamicPetWithValidation.value.validationFailReason}\n      </div>\n      <div>\n        {randomFailed.value.pet}\n        {randomFailed.value.failed}\n        {randomFailed.value.loaderFailedReason}\n      </div>\n      <div>\n        {randomFailedWithValidator.value.pet}\n        {randomFailedWithValidator.value.failed}\n        {randomFailedWithValidator.value.loaderFailedReason}\n        {randomFailedWithValidator.value.validationFailReason}\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/loaders/loader-error/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\n\nconst useError = routeLoader$(async function ({ error }): Promise<string> {\n  throw error(401, \"loader-error-uncaught\");\n});\n\nexport default component$(() => {\n  useError();\n  return <></>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/loaders/loader-error/uncaught-server/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$, server$ } from \"@builder.io/qwik-city\";\nimport { ServerError } from \"@builder.io/qwik-city/middleware/request-handler\";\n\nexport const serverError = server$(() => {\n  throw new ServerError(401, \"server-error-data\");\n});\n\nconst useCatchServerErrorInLoader = routeLoader$(async () => {\n  await serverError();\n});\n\nexport default component$(() => {\n  useCatchServerErrorInLoader();\n  return <></>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/location/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useLocation } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const location = useLocation();\n  return (\n    <div>\n      <h1>useLocation()</h1>\n      <ul>\n        <li>\n          URL: <span class=\"url\">{location.url.href}</span>\n        </li>\n      </ul>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/mit/index!.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const d = new Date();\n  return (\n    <div style={{ padding: \"20px\" }}>\n      <h1>MIT License</h1>\n\n      <p>Copyright {d.getUTCFullYear()} Builder.io</p>\n\n      <p>\n        Permission is hereby granted, free of charge, to any person obtaining a\n        copy of this software and associated documentation files (the\n        \"Software\"), to deal in the Software without restriction, including\n        without limitation the rights to use, copy, modify, merge, publish,\n        distribute, sublicense, and/or sell copies of the Software, and to\n        permit persons to whom the Software is furnished to do so, subject to\n        the following conditions:\n      </p>\n\n      <p>\n        The above copyright notice and this permission notice shall be included\n        in all copies or substantial portions of the Software.\n      </p>\n\n      <p>\n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n        OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n        IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n        CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n        TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n        SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n      </p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"MIT License\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/products/404.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useLocation, type DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const { params } = useLocation();\n\n  return (\n    <div>\n      <h1>Product {params.id} not found</h1>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = ({ params }) => {\n  return {\n    title: `Product ${params.id} Not Found`,\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/products/[id]/index.tsx",
    "content": "import { component$, useStore } from \"@builder.io/qwik\";\nimport {\n  Link,\n  useLocation,\n  type DocumentHead,\n  routeLoader$,\n} from \"@builder.io/qwik-city\";\nimport os from \"node:os\";\n\nexport default component$(() => {\n  const { params, url } = useLocation();\n  const store = useStore({ productFetchData: \"\" });\n\n  const product = useProductLoader();\n\n  return (\n    <div>\n      <h1>Product: {params.id}</h1>\n\n      {product.value == null && <p>Not Found</p>}\n      {product.value != null && (\n        <>\n          <p>Price: {product.value.price}</p>\n          <p>{product.value.description}</p>\n        </>\n      )}\n\n      <p>(Artificial response delay of 200ms)</p>\n\n      <p>\n        <button\n          onClick$={async () => {\n            const rsp = await fetch(url.pathname, {\n              headers: {\n                accept: \"application/json\",\n              },\n            });\n            store.productFetchData = JSON.stringify(await rsp.json(), null, 2);\n          }}\n        >\n          fetch(\"{url.pathname}\") data\n        </button>\n      </p>\n\n      <pre>\n        <code>{store.productFetchData}</code>\n      </pre>\n\n      <hr />\n\n      <ul>\n        <li>\n          <Link\n            href=\"/qwikcity-test/products/jacket/\"\n            data-test-link=\"products-jacket\"\n          >\n            Jacket\n          </Link>\n        </li>\n        <li>\n          <Link href=\"/qwikcity-test/products/hat/\">Hat</Link>\n        </li>\n        <li>\n          <Link\n            href=\"/qwikcity-test/products/shirt/\"\n            data-test-link=\"products-shirt\"\n          >\n            T-Shirt (Redirect to /products/tshirt)\n          </Link>\n        </li>\n        <li>\n          <Link\n            href=\"/qwikcity-test/products/shirt-rewrite/\"\n            data-test-link=\"products-shirt-rewrite\"\n          >\n            T-Shirt (Rewrite to /products/tshirt)\n          </Link>\n        </li>\n        <li>\n          <Link\n            href=\"/qwikcity-test/products/shirt-rewrite/?search=true\"\n            data-test-link=\"products-shirt-rewrite-with-search\"\n          >\n            T-Shirt (Rewrite to /products/tshirt)\n          </Link>\n        </li>\n        <li>\n          <Link\n            href=\"/qwikcity-test/products/shirt-rewrite\"\n            data-test-link=\"products-shirt-rewrite-no-trailing-slash\"\n          >\n            T-Shirt (Rewrite to /products/tshirt) Also trailing slash should be\n            added.\n          </Link>\n        </li>\n        <li>\n          <Link\n            href=\"/qwikcity-test/products/shirt-rewrite-absolute-url/\"\n            data-test-link=\"products-shirt-rewrite-absolute-url\"\n          >\n            T-Shirt (Rewrite to /products/tshirt) Also trailing slash should be\n            added.\n          </Link>\n        </li>\n        <li>\n          <Link\n            href=\"/qwikcity-test/products/hoodie/\"\n            data-test-link=\"products-hoodie\"\n          >\n            Hoodie (404 Not Found)\n          </Link>\n        </li>\n        <li>\n          <a\n            href=\"/qwikcity-test/products/hat/?json=true\"\n            data-test-link=\"products-hat-json\"\n          >\n            Hat (200 json)\n          </a>\n        </li>\n\n        <li>\n          <a\n            href=\"/qwikcity-test/products/error\"\n            data-test-link=\"products-error\"\n          >\n            Error\n          </a>\n        </li>\n      </ul>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = ({ params }) => {\n  return {\n    title: `Product ${params.id}`,\n  };\n};\n\n// Our pretty awesome database of prices\nexport const PRODUCT_DB: Record<string, string> = {\n  hat: \"$21.96\",\n  jacket: \"$48.96\",\n  tshirt: \"$18.96\",\n};\n\nexport const useProductLoader = routeLoader$(\n  async ({\n    headers,\n    json,\n    error,\n    params,\n    query,\n    redirect,\n    rewrite,\n    status,\n    url,\n  }) => {\n    // Serverside Endpoint\n    // During SSR, this method is called directly on the server and returns the data object\n    // On the client, this same data can be requested with fetch() at the same URL, but also\n    // requires the \"accept: application/json\" request header.\n\n    const id = params.id;\n    if (query.has(\"querystring-test\")) {\n      throw redirect(301, \"/qwikcity-test/\");\n    }\n\n    if (id === \"shirt\") {\n      // Redirect, which will skip any rendering and the server will immediately redirect\n      throw redirect(301, \"/qwikcity-test/products/tshirt/\");\n    }\n\n    if (id === \"shirt-rewrite\") {\n      throw rewrite(\"/qwikcity-test/products/tshirt/\");\n    }\n\n    // Should throw an error\n    if (id === \"shirt-rewrite-absolute-url\") {\n      throw rewrite(`${url.origin}/qwikcity-test/products/tshirt/`);\n    }\n\n    if (id === \"error\") {\n      throw error(500, \"Error from server\");\n    }\n\n    const productPrice = PRODUCT_DB[id];\n    if (!productPrice) {\n      // Product data not found, but purposely not throwing a response.error(404)\n      // instead the renderer will still run with the returned `null` data\n      // and the component will decide how to render it\n      status(404);\n      // never cache\n      headers.set(\"Cache-Control\", \"no-cache, no-store, no-fun\");\n      return null;\n    }\n\n    // cache for a super long time of 15 seconds\n    headers.set(\"Cache-Control\", \"max-age=15\");\n\n    await new Promise<void>((resolve) => setTimeout(resolve, 200));\n\n    const data = {\n      // Found the product data\n      // This same data is passed to the head() function\n      // and in the component$() it can be access with useEndpoint()\n      productId: id,\n      price: productPrice,\n      description: `Node ${\n        process.versions.node\n      } ${os.platform()} ${os.arch()} ${os.cpus()[0].model}`,\n    };\n    if (query.get(\"json\") === \"true\") {\n      json(200, data);\n    }\n    return data;\n  },\n);\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/context/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from \"@builder.io/qwik\";\nimport { server$ } from \"@builder.io/qwik-city\";\nimport { delay } from \"../../actions/login\";\n\nconst serverFunctionA = server$(async function a() {\n  return this.method;\n});\nconst serverFunctionB = server$(async function b() {\n  return this.method;\n});\n\nexport const MultipleServerFunctionsInvokedInTask = component$(() => {\n  const methodA = useSignal(\"\");\n  const methodB = useSignal(\"\");\n  useTask$(async () => {\n    methodA.value = await serverFunctionA();\n    await delay(1);\n    methodB.value = await serverFunctionB();\n  });\n\n  return (\n    <div id=\"methods\">\n      {methodA.value}\n      {methodB.value}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      <MultipleServerFunctionsInvokedInTask />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/cookie/index.tsx",
    "content": "import { component$, useSignal, useTask$ } from \"@builder.io/qwik\";\nimport { server$ } from \"@builder.io/qwik-city\";\nimport { delay } from \"../../actions/login\";\n\nconst serverHost = server$(function () {\n  return this.request.headers.get(\"host\")!;\n});\nconst serverFunctionA = server$(async function a() {\n  const user = (await this.cookie.get(\"user\")?.value) || \"\";\n  return user;\n});\nconst serverFunctionB = server$(async function b() {\n  const user = (await this.cookie.get(\"user\")?.value) || \"\";\n  return user;\n});\n\nexport const MultipleServerFunctionsInvokedInTask = component$(() => {\n  const host = useSignal(\"\");\n  const user1 = useSignal(\"\");\n  const user2 = useSignal(\"\");\n  useTask$(async () => {\n    host.value = await serverHost();\n    await delay(1);\n    user1.value = await serverFunctionA();\n    await delay(1);\n    user2.value = await serverFunctionB();\n  });\n\n  return (\n    <>\n      <div id=\"host\">{host.value}</div>\n      <div id=\"users\">\n        {user1.value}\n        {user2.value}\n      </div>\n    </>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      <MultipleServerFunctionsInvokedInTask />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/index.tsx",
    "content": "import {\n  Resource,\n  component$,\n  useComputed$,\n  useResource$,\n  useSignal,\n  useTask$,\n} from \"@builder.io/qwik\";\nimport { routeLoader$, server$ } from \"@builder.io/qwik-city\";\nimport { delay } from \"../actions/login\";\n\nexport const useGetUserAgent = routeLoader$(() => {\n  return getUserAgent();\n});\n\nexport const getUserAgentForReal = server$(function () {\n  if (!this) {\n    return \"failed\";\n  }\n  const header = this.request.headers.get(\"host\")!;\n  return header;\n});\n\nexport const getUserAgent = server$(function () {\n  return getUserAgentForReal();\n});\n\nexport const streamingFunc = server$(async function* () {\n  for (let i = 0; i < 5; i++) {\n    await delay(1000);\n    yield i;\n  }\n});\n\nconst serverFunctionA = server$(async function a() {\n  return this.method;\n});\nconst serverFunctionB = server$(async function b() {\n  return this.method;\n});\n\nexport const MultipleServerFunctionsInvokedInTask = component$(() => {\n  const methodA = useSignal(\"\");\n  const methodB = useSignal(\"\");\n  useTask$(async () => {\n    methodA.value = await serverFunctionA();\n    await delay(1);\n    methodB.value = await serverFunctionB();\n  });\n\n  return (\n    <div id=\"methods\">\n      {methodA.value}\n      {methodB.value}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  const resource = useResource$(() => getUserAgent());\n  const userAgent = useSignal(\"\");\n  const userAgentEvent = useSignal(\"\");\n  const userAgentComputed = useComputed$(() => getUserAgent());\n  const loader = useGetUserAgent();\n  const streamingLogs = useSignal(\"\");\n\n  useTask$(async () => {\n    userAgent.value = await getUserAgent();\n  });\n  return (\n    <>\n      <Resource\n        value={resource}\n        onResolved={(value) => <div class=\"server-host\">{value}</div>}\n      />\n      <div class=\"server-host\">{userAgent.value}</div>\n      <div class=\"server-host\">{userAgent.value}</div>\n      <div class=\"server-host\">{loader.value}</div>\n      <div class=\"server-host\">{userAgentEvent.value}</div>\n      <div class=\"server-host\">{userAgentComputed.value}</div>\n      <button\n        id=\"server-host-button\"\n        onClick$={async () => {\n          userAgentEvent.value = await getUserAgent();\n        }}\n      >\n        Load\n      </button>\n      <section>\n        <h2>Streaming</h2>\n\n        <div class=\"server-streaming\">{streamingLogs.value}</div>\n\n        <button\n          id=\"server-streaming-button\"\n          onClick$={async () => {\n            for await (const nu of await streamingFunc()) {\n              streamingLogs.value += nu;\n            }\n          }}\n        >\n          5 seconds streaming\n        </button>\n      </section>\n      <MultipleServerFunctionsInvokedInTask />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/resource/index.tsx",
    "content": "import { component$, useResource$, Resource } from \"@builder.io/qwik\";\nimport { server$ } from \"@builder.io/qwik-city\";\nimport { delay } from \"../../actions/login\";\n\nconst serverFunctionA = server$(async function a() {\n  return this.pathname + \"a\";\n});\n\nconst serverFunctionB = server$(async function b() {\n  return this.pathname + \"b\";\n});\n\nconst serverFunctionC = server$(async function c() {\n  return this.pathname + \"c\";\n});\n\nconst ResourceServerFns = component$(() => {\n  const resource = useResource$(async () => {\n    const resultA = await serverFunctionA();\n    await delay(1);\n    const resultB = await serverFunctionB();\n    await delay(1);\n    const resultC = await serverFunctionC();\n\n    return { resultA, resultB, resultC };\n  });\n\n  return (\n    <div>\n      <Resource\n        value={resource}\n        onResolved={({ resultA, resultB, resultC }) => (\n          <>\n            <p id=\"a\">{resultA}</p>\n            <p id=\"b\">{resultB} </p>\n            <p id=\"c\">{resultC}</p>\n          </>\n        )}\n      />\n    </div>\n  );\n});\n\nexport default ResourceServerFns;\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/server-configs/index.tsx",
    "content": "import { component$, useSignal, useVisibleTask$ } from \"@builder.io/qwik\";\nimport { server$ } from \"@builder.io/qwik-city\";\nimport { delay } from \"../../actions/login\";\n\nconst customHeader = \"x-custom-header\";\n\nexport const serverFunctionA = server$(\n  async function a() {\n    return (\n      this.method +\n      \"--\" +\n      (this.request.headers.get(\"X-Custom-Header\") || \"N/A\")\n    );\n  },\n  {\n    headers: {\n      [customHeader]: \"MyCustomValue\",\n    },\n  },\n);\nexport const serverFunctionB = server$(\n  async function b(this) {\n    return (\n      this.method + \"--\" + this.request.headers.get(\"x-custom-header\") || \"N/A\"\n    );\n  },\n  {\n    method: \"get\",\n    headers: {\n      [customHeader]: \"MyCustomValue\",\n    },\n  },\n);\n\nexport const MultipleServerFunctionsWithConfig = component$(() => {\n  const serverValA = useSignal(\"\");\n  const serverValB = useSignal(\"\");\n\n  // ensure request made on client\n  useVisibleTask$(async () => {\n    serverValA.value = await serverFunctionA();\n    await delay(1);\n    serverValB.value = await serverFunctionB();\n  });\n\n  return (\n    <div id=\"server-configs\">\n      {serverValA.value}-{serverValB.value}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      server$\n      <MultipleServerFunctionsWithConfig />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/server-error/index.tsx",
    "content": "import { component$, useSignal, useVisibleTask$ } from \"@builder.io/qwik\";\nimport { server$ } from \"@builder.io/qwik-city\";\nimport { ServerError } from \"@builder.io/qwik-city/middleware/request-handler\";\nimport { delay } from \"../../actions/login\";\n\ntype ErrorReason = {\n  reason: string;\n  middleware: string;\n};\n\nconst serverFunctionA = server$(async function a(): Promise<string> {\n  throw new ServerError<ErrorReason>(401, {\n    reason: \"my error\",\n    middleware: \"server-error-uncaught\",\n  });\n});\n\nconst serverFunctionB = server$(async function b(): Promise<string> {\n  return this.method;\n});\n\nexport const MultipleServerFunctionsInvokedInTask = component$(() => {\n  const errorReason = useSignal(\"\");\n  const errorMiddleware = useSignal(\"\");\n  const methodB = useSignal(\"\");\n\n  useVisibleTask$(async () => {\n    try {\n      await serverFunctionA();\n    } catch (err: any) {\n      if (isErrorReason(err)) {\n        errorReason.value = err.reason;\n        errorMiddleware.value = err.middleware;\n      }\n    }\n\n    await delay(1);\n\n    const method = await serverFunctionB();\n    methodB.value = method;\n  });\n\n  return (\n    <div id=\"server-error\">\n      {errorReason.value}\n      {errorMiddleware.value}\n      {methodB.value}\n    </div>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      <MultipleServerFunctionsInvokedInTask />\n    </>\n  );\n});\n\nexport function isErrorReason(err: any): err is ErrorReason {\n  if (typeof err.reason === \"string\" && typeof err.middleware === \"string\") {\n    return true;\n  }\n\n  return false;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/server-error/loader/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$, server$ } from \"@builder.io/qwik-city\";\nimport { ServerError } from \"@builder.io/qwik-city/middleware/request-handler\";\n\nexport const serverError = server$(() => {\n  throw new ServerError(401, \"loader-error-data\");\n});\n\nconst useCatchServerErrorInLoader = routeLoader$(async () => {\n  try {\n    await serverError();\n  } catch (err: any) {\n    if (err instanceof ServerError && typeof err.data === \"string\") {\n      return err.data;\n    }\n  }\n\n  return \"unknown error\";\n});\n\nexport default component$(() => {\n  const error = useCatchServerErrorInLoader();\n  return <div id=\"server-error\">{error.value}</div>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/server-func/server-error/primitive/index.tsx",
    "content": "import { component$, useSignal, useVisibleTask$ } from \"@builder.io/qwik\";\nimport { server$ } from \"@builder.io/qwik-city\";\nimport { ServerError } from \"@builder.io/qwik-city/middleware/request-handler\";\n\nconst serverFunctionA = server$(async () => {\n  throw new ServerError(401, 1);\n});\n\nconst serverFunctionB = server$(async () => {\n  throw new ServerError(500, \"error\");\n});\n\nexport default component$(() => {\n  const errorA = useSignal<number>();\n  const errorB = useSignal<string>();\n\n  useVisibleTask$(async () => {\n    try {\n      await serverFunctionA();\n    } catch (err: any) {\n      errorA.value = err;\n    }\n\n    try {\n      await serverFunctionB();\n    } catch (err: any) {\n      errorB.value = err;\n    }\n  });\n\n  return (\n    <div id=\"server-error\">\n      {errorA.value}\n      {errorB.value}\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/streaming/index.tsx",
    "content": "import { component$, Resource } from \"@builder.io/qwik\";\nimport { type DocumentHead, routeLoader$ } from \"@builder.io/qwik-city\";\nimport { delay } from \"../actions/login\";\n\nexport const useThing = routeLoader$(({ defer }) => {\n  return defer(async () => {\n    await delay(1000);\n    return { name: \"thing\" };\n  });\n});\n\nexport const useOther = routeLoader$(({ defer }) => {\n  return defer(\n    delay(2000).then(() => {\n      return { name: \"other\" };\n    }),\n  );\n});\n\nexport const useAnother = routeLoader$(() => {\n  return { name: \"another\" };\n});\n\nexport default component$(() => {\n  const resourceThing = useThing();\n  const resourceOther = useOther();\n  return (\n    <div>\n      <h1>Streaming</h1>\n      <Resource\n        value={resourceThing}\n        onResolved={(thing) => {\n          return <div>FIRST: {thing.name}</div>;\n        }}\n      />\n      <Resource\n        value={resourceOther}\n        onResolved={(thing) => {\n          return <div>SECOND: {thing.name}</div>;\n        }}\n      />\n    </div>\n  );\n});\n\n// export const onGet: RequestHandler = async ({cacheControl}) => {\n//   cacheControl('static');\n// };\n\nexport const head: DocumentHead = {\n  title: \"About Us\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/(common)/treeshaking/index.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\n\nexport const neverUsed = routeLoader$(() => {\n  // console.log('neverUsed');\n  return [\"SHOULD NOT BE SERIALIZED\"];\n});\n\nexport const useUsed = routeLoader$(() => {\n  // console.log('used');\n\n  return [\"USED, but not serialized\"];\n});\n\nexport default component$(() => {\n  const data = useUsed();\n  const signal = useSignal(0);\n  return (\n    <div class=\"actions\">\n      <button onClick$={() => signal.value++}>{signal.value}</button>\n      {data.value.map((item) => (\n        <div>{item}</div>\n      ))}\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/action-redirect-without-search-params/index.tsx",
    "content": "import { routeAction$, Form } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport const useAction = routeAction$((_, context) => {\n  throw context.redirect(\n    302,\n    \"/qwikcity-test/action-redirect-without-search-params-target/\",\n  );\n});\n\nexport default component$(() => {\n  const action = useAction();\n\n  return (\n    <Form action={action}>\n      <h1>Should have searchParams</h1>\n      <button type=\"submit\">Submit</button>\n    </Form>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/action-redirect-without-search-params-target/index.tsx",
    "content": "import { useLocation } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const location = useLocation();\n\n  return (\n    <div>\n      <h1>\n        Should <strong>not</strong> have searchParams\n      </h1>\n      <pre>{JSON.stringify(location.url.searchParams.get(\"id\"))}</pre>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/dashboard/dashboard.css",
    "content": ".dashboard {\n  display: grid;\n  grid-template-columns: 200px 1fr;\n  padding: 0;\n}\n\n.dashboard-menu {\n  background: #eee;\n  padding-left: 20px;\n}\n\n.dashboard-content {\n  padding-left: 20px;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/dashboard/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Dashboard</h1>\n      <p>\n        <a href=\"/qwikcity-test/sign-out/\">Sign Out</a>\n      </p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Home\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/dashboard/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from \"@builder.io/qwik\";\nimport type { RequestHandler, DocumentHead } from \"@builder.io/qwik-city\";\nimport { isUserAuthenticated } from \"../../auth/auth\";\nimport Footer from \"../../components/footer/footer\";\nimport Header from \"../../components/header/header\";\nimport styles from \"./dashboard.css?inline\";\n\nexport const onGet: RequestHandler = async ({\n  cacheControl,\n  redirect,\n  cookie,\n}) => {\n  const isAuthenticated = await isUserAuthenticated(cookie);\n  if (!isAuthenticated) {\n    throw redirect(302, \"/qwikcity-test/sign-in\");\n  }\n  cacheControl({\n    noCache: true,\n    private: true,\n  });\n};\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  return (\n    <div data-test-layout=\"dashboard\">\n      <Header />\n      <main class=\"dashboard\">\n        <aside class=\"dashboard-menu\">\n          <h5>Dashboard Menu</h5>\n          <ul>\n            <li>\n              <a\n                href=\"/qwikcity-test/dashboard/profile\"\n                data-test-link=\"dashboard-profile\"\n              >\n                Profile\n              </a>\n            </li>\n            <li>\n              <a\n                href=\"/qwikcity-test/dashboard/settings\"\n                data-test-link=\"dashboard-settings\"\n              >\n                Settings\n              </a>\n            </li>\n            <li>\n              <a\n                href=\"/qwikcity-test/sign-out\"\n                data-test-link=\"dashboard-sign-out\"\n              >\n                Sign Out\n              </a>\n            </li>\n          </ul>\n        </aside>\n        <section class=\"dashboard-content\">\n          <Slot />\n        </section>\n      </main>\n      <Footer />\n    </div>\n  );\n});\n\nexport const head: DocumentHead = ({ head }) => {\n  return {\n    title: `Dashboard ${head.title}`,\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/dashboard/profile/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Profile</h1>\n      <p>My Profile</p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Profile\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/dashboard/settings/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Settings</h1>\n      <p>My Settings</p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Settings\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/docs/[category]/[id]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useLocation, type DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const { url, params } = useLocation();\n\n  return (\n    <div>\n      <h1>\n        Docs: {params.category} {params.id}\n      </h1>\n      <p>pathname: {url.pathname}</p>\n      <p>category: {params.category}</p>\n      <p>id: {params.id}</p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = ({ params }) => {\n  return {\n    title: `${params.category} ${params.id}`,\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/docs/getting-started/index.md",
    "content": "---\ntitle: \\@builder.io/qwik Getting Started\n---\n\n# Getting Started\n\n## Creating an app using the CLI\n\nThe first step is to create an application. Qwik comes with a CLI that allows you to create a basic working skeleton of an application. We will use the CLI to create a Todo sample app, and we will use that application to do a walk-through of Qwik so that you can familiarize yourself with it.\n\n## Running in development\n\nOnce the application is download.\n\n1. Change into the directory created by the `npm create qwik@latest`.\n\n```shell\ncd qwik-todo\n```\n\n2. Install NPM modules:\n\n```shell\nnpm install\n```\n\n3. Invoke the dev server\n\n```shell\nnpm start\n```\n\n4. You should see a server running with your To-do application\n\n```shell\n  vite v2.8.6 dev server running at:\n\n  > Local: http://localhost:3000/\n  > Network: use `--host` to expose\n\n  ready in 157ms.\n```\n\n5. Visit http://localhost:3000/ to explore the To-do app.\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/docs/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Welcome to the Docs!</h1>\n\n      <p>\n        <a href=\"/qwikcity-test/docs\">\n          Docs link with trailing slash (should redirect without slash)\n        </a>\n      </p>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Welcome!\",\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/docs/layout.css",
    "content": ".docs main {\n  display: grid;\n  grid-template-columns: 200px 1fr;\n  padding: 0;\n  margin: 0;\n}\n\n.docs-content {\n  padding-left: 20px;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/docs/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\nimport { Breadcrumbs } from \"../../components/breadcrumbs/breadcrumbs\";\nimport { ContentNav } from \"../../components/content-nav/content-nav\";\nimport Footer from \"../../components/footer/footer\";\nimport Header from \"../../components/header/header\";\nimport { Menu } from \"../../components/menu/menu\";\nimport styles from \"./layout.css?inline\";\n\nexport default component$(() => {\n  useStyles$(styles);\n\n  return (\n    <div class=\"docs full-screen\" data-test-layout=\"docs\">\n      <Header />\n      <main>\n        <Menu />\n        <section class=\"docs-content\">\n          <Breadcrumbs />\n          <Slot />\n          <ContentNav />\n          <Footer />\n        </section>\n      </main>\n    </div>\n  );\n});\n\nexport const head: DocumentHead = ({ head }) => {\n  return {\n    title: `Docs: ${head.title}`,\n  };\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/docs/menu.md",
    "content": "# Docs\n\n## Introduction\n\n- [Overview](overview/index.md)\n- [Getting Started](getting-started/index.md)\n\n## Core\n\n- [Basics](/qwikcity-test/docs/core/basics/)\n- [Listeners](/qwikcity-test/docs/core/listeners)\n\n## Anchors\n\n- [Lorem](overview/index.md#lorem)\n- [Pellentesque](overview/index.md#pellentesque)\n- [In erat mauris](overview/index.md#in-erat-mauris)\n- [Sollicitudin](overview/index.md#sollicitudin)\n- [Nulla](overview/index.md#nulla)\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/docs/overview/index.md",
    "content": "---\ntitle: Overview\n---\n\n# Overview\n\nQwik is a new kind of web framework that can deliver instant loading web applications at any size or complexity. Your sites and apps can boot with less than 1kb of JS (_including_ your code, regardless of complexity), and achieve unheard of performance at scale.\n\n## Lorem\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eleifend molestie erat, at sagittis libero euismod id. Etiam ut orci eget neque venenatis mollis ut ut massa. Interdum et malesuada fames ac ante ipsum primis in faucibus. Morbi elementum purus tortor, varius ultricies enim lacinia sit amet. In porttitor mi lorem. Nulla ut augue malesuada lacus luctus interdum a non nisl. Ut convallis commodo magna sit amet pharetra. Integer sed tincidunt nunc, a scelerisque nisl. Sed ac tristique nisl.\n\n## Pellentesque\n\nPellentesque eget ex vitae est ornare tempor et sed tortor. Sed mi urna, rhoncus eget fringilla at, volutpat in odio. Suspendisse ac ligula quis nulla sagittis bibendum ac sit amet arcu. Praesent ullamcorper diam at tortor posuere tempor. Nam ultrices risus at mauris blandit imperdiet. Quisque sit amet purus accumsan, lobortis ex at, pretium justo. Nullam facilisis, ante a iaculis mollis, purus quam volutpat mauris, tempus aliquam odio augue et metus. Pellentesque efficitur neque a sem sollicitudin ornare. Curabitur at aliquam tellus. Aenean pharetra est et erat accumsan, et ultrices felis scelerisque. Proin convallis lectus ultrices mi malesuada fermentum. Integer lacinia, enim sit amet vehicula cursus, tellus erat pulvinar lacus, at volutpat nisi libero non sem.\n\n## In erat mauris\n\nIn erat mauris, porta scelerisque semper congue, pellentesque non ipsum. Vestibulum justo lectus, pulvinar quis rutrum non, dictum eget ante. Nulla posuere imperdiet tellus vel convallis. Quisque pellentesque tempor libero, id imperdiet lorem dictum vitae. Integer nec nulla quis sem malesuada ultrices. Vestibulum at sem urna. Fusce imperdiet arcu ante, at aliquam lectus egestas ac. Curabitur fringilla ultricies placerat. Donec vel velit maximus nibh commodo pulvinar sit amet ut nulla. Nullam a accumsan lacus. Praesent gravida leo orci, non volutpat massa pellentesque non. Proin eu nibh purus. Aliquam cursus felis eros, vel ullamcorper nulla vestibulum vitae. Suspendisse eleifend ipsum in nibh hendrerit consectetur. Pellentesque malesuada magna vel ullamcorper hendrerit. Donec tincidunt placerat ante, in dapibus enim auctor eget.\n\n## Sollicitudin\n\nPellentesque sed sollicitudin lectus. Integer sit amet libero mi. Nulla eu est purus. Morbi tempus odio purus, sed finibus nisi ornare ac. Mauris justo odio, pellentesque vitae semper eget, placerat eu sapien. Vivamus nec dictum felis. Etiam rhoncus arcu ut nulla lobortis, nec vulputate enim facilisis. Aliquam luctus dui lobortis consequat consequat. Proin pulvinar metus aliquet, consequat lacus vel, elementum dui. Aliquam vehicula nibh ut mattis tristique. Fusce pulvinar sapien sit amet lorem consequat lobortis. Aenean tincidunt lectus non dui luctus tempus. Donec vitae porta odio. In bibendum velit ac lorem consectetur, ac elementum metus mattis. Aenean fermentum mauris vitae sem facilisis, vel varius augue luctus. In hac habitasse platea dictumst.\n\n## Nulla\n\nNulla bibendum dui bibendum ligula iaculis, non semper lorem tincidunt. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed tincidunt lacus elit, ac vulputate nibh pulvinar ac. Aliquam elit eros, gravida at dapibus ac, mattis sit amet purus. Vestibulum hendrerit tortor at velit facilisis, lacinia bibendum ante ullamcorper. Aenean porta risus sit amet varius volutpat. Fusce tristique tellus eu nisl congue vulputate.\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/error/index.tsx",
    "content": "import { component$, $ } from \"@builder.io/qwik\";\nimport { ErrorBoundary } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return <Issue7227 />;\n});\n\nconst Issue7227 = component$(() => {\n  return (\n    <ErrorBoundary\n      fallback$={$((error) => {\n        return <div>Caught error: {error.message}</div>;\n      })}\n    >\n      <div>\n        All good\n        <button\n          onClick$={$(() => {\n            throw new Error(\"Boom!\");\n          })}\n        >\n          Throw error\n        </button>\n      </div>\n    </ErrorBoundary>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue-loader/action.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, globalAction$ } from \"@builder.io/qwik-city\";\n\nexport const useOtherAction = globalAction$(() => {\n  return {\n    secret: \"this is the secret\",\n    date: new Date(),\n  };\n});\n\nexport default component$(() => {\n  const other = useOtherAction();\n  return (\n    <div>\n      <Form action={other}>\n        <button id=\"submit\">Submit</button>\n      </Form>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue-loader/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport ActionForm from \"./action\";\n\nexport const useRealDateLoader = routeLoader$(() => {\n  return [new Date().toISOString()];\n});\n\nexport default component$(() => {\n  const date = useRealDateLoader();\n  return (\n    <div>\n      <p id=\"real-date\">real-date: {date.value[0]}</p>\n      <ActionForm />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue-loader-serialization/action.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Form, globalAction$ } from \"@builder.io/qwik-city\";\n\nexport const useOtherAction = globalAction$(() => {\n  return {\n    secret: \"this is the secret\",\n    date: new Date(),\n  };\n});\n\nexport default component$(() => {\n  const other = useOtherAction();\n  return (\n    <div>\n      <Form action={other}>\n        <button id=\"submit\">Submit</button>\n      </Form>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue-loader-serialization/index.tsx",
    "content": "import {\n  component$,\n  useVisibleTask$,\n  useSignal,\n  useTask$,\n} from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { isBrowser } from \"@builder.io/qwik\";\n\nexport const useCmp1 = routeLoader$(\n  () => {\n    return {\n      message: \"loader-cmp1\",\n    };\n  },\n  {\n    id: \"cmp-1\",\n  },\n);\n\nexport const useCmp2 = routeLoader$(() => {\n  return {\n    message: \"loader-cmp2\",\n  };\n});\n\nexport const useCmp3 = routeLoader$(() => {\n  return {\n    message: \"loader-cmp3\",\n  };\n});\n\nexport const useCmp4 = routeLoader$(() => {\n  return {\n    message: \"loader-cmp4\",\n  };\n});\n\nexport const useCmp5 = routeLoader$(() => {\n  return {\n    message: \"loader-cmp5\",\n  };\n});\n\nexport const useCmp6 = routeLoader$(() => {\n  return {\n    message: \"loader-cmp5\",\n  };\n});\n\nexport const Cmp = component$(() => {\n  const date = useCmp1();\n  const ref = useSignal<HTMLElement>();\n  useVisibleTask$(() => {\n    ref.value!.textContent = date.value.message;\n  });\n  return (\n    <div>\n      <p class=\"loader-data\" ref={ref}>\n        empty\n      </p>\n    </div>\n  );\n});\n\nexport const Cmp2 = component$(() => {\n  const date = useCmp2();\n  const signal = useSignal(0);\n  const ref = useSignal<HTMLElement>();\n  useTask$(({ track }) => {\n    track(() => signal.value);\n    if (isBrowser) {\n      ref.value!.textContent = date.value.message;\n    }\n  });\n  return (\n    <div>\n      <button id=\"update-cmp2\" onClick$={() => signal.value++}>\n        Update\n      </button>\n      <p class=\"loader-data\" ref={ref}>\n        empty\n      </p>\n    </div>\n  );\n});\n\nexport const Cmp3 = component$(() => {\n  const date = useCmp3();\n  const signal = useSignal(0);\n\n  return (\n    <div>\n      <button id=\"update-cmp3\" onClick$={() => signal.value++}>\n        Update\n      </button>\n      {signal.value > 0 && <p class=\"loader-data\">{date.value.message}</p>}\n    </div>\n  );\n});\n\nexport const Cmp4 = component$(() => {\n  const date = useCmp4();\n\n  return (\n    <div>\n      <p class=\"loader-data\">{date.value.message}</p>\n    </div>\n  );\n});\n\nexport const Cmp5 = component$(() => {\n  const loaderData = useCmp5();\n  const localStore = useSignal(false);\n  return (\n    <div>\n      <p>{JSON.stringify(localStore)}</p>\n      <p class=\"loader-data\">{JSON.stringify(loaderData.value)}</p>\n      <button\n        id=\"update-cmp5\"\n        onClick$={() => {\n          localStore.value = true;\n        }}\n      >\n        Update\n      </button>\n    </div>\n  );\n});\n\nexport default component$(() => {\n  return (\n    <>\n      <Cmp />\n      <Cmp2 />\n      <Cmp3 />\n      <Cmp4 />\n      <Cmp5 />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue-route-with-search-params-and-action-redirect-without-search-params/action-redirect-without-search-params/index.tsx",
    "content": "import { routeAction$, Form } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport const useAction = routeAction$((_, event) => {\n  throw event.redirect(\n    302,\n    \"/qwikcity-test/action-redirect-without-search-params-target/\",\n  );\n});\n\nexport default component$(() => {\n  const action = useAction();\n\n  return (\n    <Form action={action}>\n      <h1>Should have searchParams on the url</h1>\n      <button type=\"submit\">Submit</button>\n    </Form>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue-route-with-search-params-and-action-redirect-without-search-params/action-redirect-without-search-params-target/index.tsx",
    "content": "import { useLocation } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const location = useLocation();\n\n  return (\n    <div>\n      <h1>\n        Should <strong>not</strong> have searchParams\n      </h1>\n      <pre>{JSON.stringify(location.url.searchParams.get(\"id\"))}</pre>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue2441/abc.endpoint/index.ts",
    "content": "import type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onRequest: RequestHandler = ({ json }) => {\n  json(200, {\n    issue: 2441,\n  });\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue2441/abc.page/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return <h1 id=\"issue2441\">Issue 2441</h1>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue2829/a/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <Link id=\"issue2829-link\" href=\"/qwikcity-test/issue2829/b/\">\n        Issue 2829\n      </Link>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue2829/b/index.tsx",
    "content": "import { component$, useContext } from \"@builder.io/qwik\";\nimport { SomeContext } from \"../../../components/provider/provider\";\n\nexport default component$(() => {\n  const someContext = useContext(SomeContext);\n  return (\n    <div>\n      <h1>Profile</h1>\n      <p id=\"issue2829-context\">context: {someContext.value}</p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue2890/a/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <div>\n        <Link id=\"issue2890-link-0\" href=\"/qwikcity-test/issue2890/b/\">\n          /b/\n        </Link>\n      </div>\n      <div>\n        <Link\n          id=\"issue2890-link-1\"\n          href=\"/qwikcity-test/issue2890/b/?query=123\"\n        >\n          /b/?query=123\n        </Link>\n      </div>\n      <div>\n        <Link id=\"issue2890-link-2\" href=\"/qwikcity-test/issue2890/b?query=321\">\n          /b?query=321\n        </Link>\n      </div>\n      <div>\n        <Link\n          id=\"issue2890-link-3\"\n          href=\"/qwikcity-test/issue2890/b/?query=321&hash=true#h2\"\n        >\n          /b/?query=321&hash=true#h2\n        </Link>\n      </div>\n      <div>\n        <Link\n          id=\"issue2890-link-4\"\n          href=\"/qwikcity-test/issue2890/b?query=321&hash=true#h2\"\n        >\n          /b?query=321&hash=true#h2\n        </Link>\n      </div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue2890/b/index.tsx",
    "content": "import { component$, useVisibleTask$, useSignal } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\n\nexport const useUndefined = routeLoader$(() => {\n  return undefined;\n});\n\nexport const useGetQuery = routeLoader$(({ query }) => {\n  return {\n    query: query.get(\"query\") ?? \"NONE\",\n    hash: query.get(\"hash\") ?? \"NONE\",\n  };\n});\n\nexport default component$(() => {\n  const signal = useSignal({});\n  const data = useGetQuery();\n  const undefinedLoader = useUndefined();\n\n  useVisibleTask$(() => {\n    const url = new URL(window.location.href);\n    signal.value = {\n      query: url.searchParams.get(\"query\") ?? \"NONE\",\n      hash: url.hash,\n    };\n  });\n\n  return (\n    <div>\n      <h1>Query</h1>\n      <div>{undefinedLoader.value}</div>\n      <p id=\"loader\">LOADER: {JSON.stringify(data.value)}</p>\n      <p id=\"browser\">BROWSER: {JSON.stringify(signal.value)}</p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue3438/عربي/index.mdx",
    "content": "Test arabic route\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4100/index.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      <button onClick$={() => count.value++}>Click me {count.value}</button>\n      <a href=\"#navigate\">Navigate</a>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4502/broken/index.tsx",
    "content": "import type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onRequest: RequestHandler<void> = async (onRequestArgs) => {\n  const { redirect, url } = onRequestArgs;\n  throw redirect(302, `${url.pathname}/route/`);\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4502/broken/route/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => (\n  <div id=\"route\">\n    welcome to <code>/broken/route</code>\n  </div>\n));\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4502/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => (\n  <div>\n    <p>\n      <Link id=\"link\" href=\"/qwikcity-test/issue4502/broken\">\n        Link\n      </Link>\n    </p>\n    <p>\n      <a id=\"anchor\" href=\"/qwikcity-test/issue4502/broken\">\n        Anchor\n      </a>\n    </p>\n  </div>\n));\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4502/layout.tsx",
    "content": "import { Slot, component$, useSignal } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const count = useSignal(0);\n  return (\n    <div>\n      <button id=\"count\" onClick$={() => count.value++}>\n        Count: {count.value}\n      </button>\n      <Slot />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4531/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => <div id=\"route\">should render</div>);\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4531/layout.tsx",
    "content": "import type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onRequest: RequestHandler<void> = async (onRequestArgs) => {\n  const { headers } = onRequestArgs;\n  headers.set(\"x-qwikcity-test\", \"issue4531\");\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4679/index.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\nimport { Form, routeAction$ } from \"@builder.io/qwik-city\";\n\nexport const useAction = routeAction$(() => true);\nexport default component$((props) => {\n  const signal = useSignal(false);\n  return (\n    <section>\n      <Form spaReset={signal.value}>\n        <button\n          type=\"button\"\n          id=\"issue-4679-button\"\n          onClick$={() => {\n            signal.value = !signal.value;\n          }}\n        >\n          Toggle {}\n          {signal.value ? <span>True</span> : <span>False</span>}\n        </button>\n      </Form>\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4792/index.tsx",
    "content": "import { Link } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport default component$((props) => {\n  return (\n    <div>\n      <h1>Issue 4792</h1>\n      <p>link with attr `reload` was not refreshing the page</p>\n      <Link id=\"reload\" reload={true} href=\"docs\">\n        reload the page\n      </Link>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue4956/index.tsx",
    "content": "import { component$, useStore, useTask$ } from \"@builder.io/qwik\";\nimport { useLocation } from \"@builder.io/qwik-city\";\n\nexport default component$((props) => {\n  const loc = useLocation();\n  const state = useStore({ id: \"\" });\n  useTask$(({ track }) => {\n    track(() => loc.url.searchParams);\n    state.id = loc.url.searchParams.get(\"id\") || \"\";\n  });\n  return (\n    <div>\n      <h1>Issue 4956</h1>\n      <div id=\"routeId\">{state.id}</div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue5665/projects/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Link, useLocation } from \"@builder.io/qwik-city\";\n\nexport default component$((props) => {\n  const {\n    url: { pathname },\n  } = useLocation();\n\n  const isProjects = pathname.includes(\"projects\");\n  const hrefPath = isProjects ? \"projekte\" : \"projects\";\n\n  return (\n    <div>\n      <h1>Issue 5665</h1>\n      <p>\n        Translated routes from rewriteRoutes get ignored for [...catchall] route\n        in same folder\n      </p>\n      <Link href={`/qwikcity-test/issue5665/${hrefPath}`}>\n        Go to {isProjects ? \"projekte\" : \"projects\"}\n      </Link>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue6660/index.tsx",
    "content": "import { routeAction$, Form } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport const useAction = routeAction$(() => ({ ok: true }));\n\nexport default component$(() => {\n  const action = useAction();\n\n  return (\n    <Form action={action}>\n      <button name=\"test\" value=\"test\">\n        Submit\n      </button>\n\n      {action.value?.ok && <span id=\"status\">Submitted</span>}\n    </Form>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue7182/index.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\nexport default component$(() => {\n  const a = useSignal(1);\n  const b = useSignal(2);\n\n  return (\n    <div>\n      {a.value} + {b.value} = <span id=\"result\">{a.value + b.value}</span>\n      <input type=\"number\" id=\"input1\" bind:value={a} />\n      <input type=\"number\" id=\"input2\" bind:value={b} />\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue7254/index.tsx",
    "content": "import { component$, Resource, useResource$, useStore } from \"@builder.io/qwik\";\n\nimport { server$ } from \"@builder.io/qwik-city\";\n\nexport interface Hello {\n  print: string;\n}\n\nconst hello = server$((hello: Hello) => {\n  // Error: 'getOwnPropertyDescriptor' on proxy: trap returned descriptor for property 'print' that is incompatible with the existing property in the proxy target\n  return helloBar(hello);\n});\n\nconst helloBar = server$(\n  (hello: Hello): Promise<string> =>\n    new Promise((res) => {\n      setTimeout(() => {\n        res(hello.print + \" Bar\");\n      }, 200);\n    }),\n);\nexport default component$(() => {\n  const helloStore = useStore<Hello>({ print: \"hello\" });\n  const resource = useResource$(({ track }) => {\n    track(() => helloStore.print);\n\n    return hello(helloStore);\n  });\n\n  return (\n    <>\n      <Resource\n        value={resource}\n        onPending={() => <div>Loading...</div>}\n        onRejected={(error) => <div>Error: {error.message}</div>}\n        onResolved={(data) => <div>Data: {data}</div>}\n      />\n\n      <button\n        onClick$={() => {\n          helloStore.print = \"Foo\";\n        }}\n      >\n        Reset\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue7732/a/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return <div>empty default route A</div>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue7732/b/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onGet: RequestHandler<void> = ({ redirect }) => {\n  throw redirect(302, `/qwikcity-test/issue7732/c/?redirected=true`);\n};\n\nexport default component$(() => {\n  return <div>B route with redirect</div>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue7732/c/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return <div>route C should have redirected=true params</div>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/issue7732/layout.tsx",
    "content": "import { component$, Slot } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <>\n      <div style={{ display: \"flex\", gap: \"10px\" }}>\n        <Link href=\"/issue7732/a/\" id=\"issue7732-link-a\">\n          A\n        </Link>\n\n        <Link\n          href=\"/qwikcity-test/issue7732/b/?shouldOverrideRedirect=no\"\n          id=\"issue7732-link-b\"\n        >\n          B\n        </Link>\n        <Link href=\"/issue7732/c/\" id=\"issue7732-link-c\">\n          C\n        </Link>\n      </div>\n      <Slot />\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/layout.tsx",
    "content": "import { component$, Slot } from \"@builder.io/qwik\";\nimport { routeLoader$, type RequestHandler } from \"@builder.io/qwik-city\";\nimport { isUserAuthenticated } from \"../auth/auth\";\n\nexport const useUserLoader = routeLoader$(async ({ cookie }) => {\n  return {\n    isAuthenticated: await isUserAuthenticated(cookie),\n  };\n});\n\nexport const onGet: RequestHandler = ({ locale, headers, sharedMap }) => {\n  // cache for a super long time of 10 seconds for pages using this layout\n  locale(\"en-US\");\n  headers.set(\"Cache-Control\", \"max-age=10\");\n  sharedMap.set(\"root\", \"from root\");\n};\n\nexport default component$(() => {\n  return <Slot />;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/locale/index.tsx",
    "content": "import { component$, getLocale } from \"@builder.io/qwik\";\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const onRequest: RequestHandler = ({ locale }) => {\n  locale(\"test-locale\");\n};\n\nexport default component$(() => {\n  return (\n    <div>\n      Current locale: <span class=\"locale\">{getLocale()}</span>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/mdx/index.mdx",
    "content": "| Name   | Type   | Description          |\n| ------ | ------ | -------------------- |\n| `name` | string | Name of the resource |\n| `path` | string | Path to the resource |\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/plugin@errors.tsx",
    "content": "import { type RequestHandler } from \"@builder.io/qwik-city\";\nimport { ServerError } from \"@builder.io/qwik-city/middleware/request-handler\";\nimport { isErrorReason } from \"./(common)/server-func/server-error\";\n\nexport const onRequest: RequestHandler = async ({ next }) => {\n  try {\n    return await next();\n  } catch (err) {\n    // Intercept and update ServerErrors to test middleware\n    if (err instanceof ServerError) {\n      // Update for (common)/server-func/server-error\n      if (isErrorReason(err.data)) {\n        err.data.middleware = \"server-error-caught\";\n      }\n\n      // Update for (common)/loaders/loader-error\n      if (err.data === \"loader-error-uncaught\") {\n        err.data = \"loader-error-caught\";\n      }\n    }\n\n    throw err;\n  }\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/plugin@header.ts",
    "content": "import { routeLoader$, type RequestHandler } from \"@builder.io/qwik-city\";\n\nexport const useRootLoader = routeLoader$(() => {\n  return {\n    serverTime: new Date(),\n    reg: new RegExp(\"\"),\n    nu: Infinity,\n    nodeVersion: process.version,\n  };\n});\n\nexport const onRequest: RequestHandler = ({ headers, url, json }) => {\n  headers.set(\"X-Qwik\", \"handled\");\n  if (url.pathname === \"/qwikcity-test/virtual/auth\") {\n    json(200, {\n      message: \"handled\",\n    });\n  }\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/plugin@issue4722.tsx",
    "content": "import { routeLoader$ } from \"@builder.io/qwik-city\";\n\nexport const usePlugin = routeLoader$(() => {\n  return {\n    message: \"works\",\n  };\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/plugin@redirect.ts",
    "content": "import type { RequestEvent } from \"@builder.io/qwik-city\";\n\nexport const onGet = (ev: RequestEvent) => {\n  if (ev.url.pathname === \"/qwikcity-test/redirectme/\") {\n    throw ev.redirect(301, \"/qwikcity-test/\");\n  }\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/prevent-navigate/[id]/index.tsx",
    "content": "import { Link, useLocation } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  const loc = useLocation();\n  return (\n    <div>\n      <h1>id {loc.params.id}</h1>\n      <Link id=\"pn-main\" href=\"../\">\n        Go up\n      </Link>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/prevent-navigate/index.tsx",
    "content": "import { Link } from \"@builder.io/qwik-city\";\n\nexport default () => {\n  return (\n    <div>\n      <h1>Main page</h1>\n      <Link id=\"pn-link-5\" href=\"5/\">\n        Go to item 5\n      </Link>\n    </div>\n  );\n};\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/prevent-navigate/layout.tsx",
    "content": "import { Slot, component$, useSignal } from \"@builder.io/qwik\";\nimport { Link, useNavigate, usePreventNavigate$ } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  const okToNavigate = useSignal(true);\n  const runCount = useSignal(0);\n  const navSig = useSignal<URL | number>();\n  const showConfirm = useSignal(false);\n  const nav = useNavigate();\n  usePreventNavigate$((url) => {\n    runCount.value++;\n    if (okToNavigate.value) {\n      return false;\n    }\n    if (!url) {\n      // beforeunload doesn't allow confirm dialog\n      // return !window.confirm(\"really?\");\n      return true;\n    }\n    navSig.value = url;\n    showConfirm.value = true;\n    return true;\n  });\n\n  return (\n    <div>\n      <div id=\"pn-runcount\">{runCount.value}</div>\n      <button\n        id=\"pn-button\"\n        onClick$={() => (okToNavigate.value = !okToNavigate.value)}\n      >\n        is {!okToNavigate.value ? \"dirty\" : \"clean\"}\n      </button>\n      <br />\n      <Link id=\"pn-link\" href=\"/qwikcity-test/\">\n        Go home Link\n      </Link>\n      <br />\n      <a id=\"pn-a\" href=\"/qwikcity-test/\">\n        Go home &lt;a&gt;\n      </a>\n      <hr />\n      <Slot />\n      <hr />\n      <br />\n      {showConfirm.value && (\n        <div>\n          <div id=\"pn-confirm-text\">\n            Do you want to lose changes and go to {String(navSig.value)}?\n          </div>\n          <button\n            id=\"pn-confirm-yes\"\n            onClick$={() => {\n              showConfirm.value = false;\n              okToNavigate.value = true;\n              nav(navSig.value!);\n            }}\n          >\n            Yes\n          </button>\n          <button\n            id=\"pn-confirm-no\"\n            onClick$={() => {\n              showConfirm.value = false;\n            }}\n          >\n            No\n          </button>\n        </div>\n      )}\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/produkt/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return <div>Produkt</div>;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/scroll-restoration/hash/index.tsx",
    "content": "import { component$, useStylesScoped$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  useStylesScoped$(`\n    .spacer {\n      height: 1000px;\n    }\n  `);\n  return (\n    <div>\n      <h1>Hash</h1>\n      <Link id=\"hash-1\" class=\"hash-link\" href=\"#hash-2\">\n        To Hash 2\n      </Link>\n      <div class=\"spacer\" />\n      <Link id=\"hash-2\" class=\"hash-link\" href=\"#hash-1\">\n        To Hash 1\n      </Link>\n      <div class=\"spacer\" />\n      <Link\n        id=\"no-hash\"\n        class=\"hash-link\"\n        href=\"/qwikcity-test/scroll-restoration/hash/\"\n      >\n        To No Hash\n      </Link>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/scroll-restoration/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  useStyles$(`\n    .nav-link {\n      position: fixed;\n      top: 0;\n      right: 0;\n      z-index: 1;\n    }\n  `);\n  return <Slot />;\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/scroll-restoration/page-long/index.tsx",
    "content": "import { component$, useStylesScoped$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  useStylesScoped$(`\n    .container {\n      position: absolute;\n      top: 0;\n      height: 3200px;\n    }\n  `);\n  return (\n    <>\n      <Link\n        id=\"to-page-short\"\n        class=\"nav-link\"\n        href=\"/qwikcity-test/scroll-restoration/page-short/\"\n      >\n        To Page Short\n      </Link>\n      <div class=\"container\">\n        <h1>Page Long</h1>\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/scroll-restoration/page-short/index.tsx",
    "content": "import { component$, useStylesScoped$ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  useStylesScoped$(`\n    .container {\n      position: absolute;\n      top: 0;\n      height: 2000px;\n    }\n  `);\n  return (\n    <>\n      <Link\n        id=\"to-page-long\"\n        class=\"nav-link\"\n        href=\"/qwikcity-test/scroll-restoration/page-long/\"\n      >\n        To Page Long\n      </Link>\n      <div class=\"container\">\n        <h1>Page Short</h1>\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/search-params-redirect/index.tsx",
    "content": "import { routeAction$, routeLoader$, Form } from \"@builder.io/qwik-city\";\nimport { component$ } from \"@builder.io/qwik\";\n\nexport const useLoader = routeLoader$(\n  ({ query }) => `${query.has(\"redirected\")}`,\n);\n\nexport const useAction = routeAction$((_, { redirect, url }) => {\n  const dest = new URL(url.pathname, url);\n\n  dest.search = new URLSearchParams([[\"redirected\", \"true\"]]).toString();\n\n  throw redirect(302, dest.href.replace(dest.origin, \"\"));\n});\n\nexport default component$(() => {\n  const data = useLoader();\n  const action = useAction();\n\n  return (\n    <div>\n      <Form action={action}>\n        <button type=\"submit\">Submit</button>\n      </Form>\n\n      <div id=\"redirected-result\">{data.value}</div>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test/src/routes/some-code.js/entry.ts",
    "content": "/* eslint-disable */\nconsole.log(\"some code\");\n\nexport {};\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/package.json",
    "content": "{\n  \"description\": \"QwikCity e2e prod app\",\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"qwikCity\": true\n  }\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/components/router-head/router-head.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { useDocumentHead, useLocation } from \"@builder.io/qwik-city\";\nimport { Social } from \"./social\";\nimport { Vendor } from \"./vendor\";\n\nexport const RouterHead = component$(() => {\n  const head = useDocumentHead();\n  const loc = useLocation();\n\n  const title = head.title ? `${head.title} - Qwik` : `Qwik`;\n  return (\n    <>\n      <title>{title}</title>\n      <link rel=\"canonical\" href={loc.url.href} />\n      <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n      <meta name=\"viewport\" content=\"width=device-width\" />\n\n      <Social loc={loc} head={head} />\n      <Vendor loc={loc} />\n\n      {head.meta.map((m) => (\n        <meta {...m} />\n      ))}\n\n      {head.links.map((l) => (\n        <link {...l} />\n      ))}\n\n      {head.styles.map((s) => (\n        <style\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.style })}\n        />\n      ))}\n\n      {head.scripts.map((s) => (\n        <script\n          key={s.key}\n          {...s.props}\n          {...(s.props?.dangerouslySetInnerHTML\n            ? {}\n            : { dangerouslySetInnerHTML: s.script })}\n        />\n      ))}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/components/router-head/social.tsx",
    "content": "import type {\n  ResolvedDocumentHead,\n  RouteLocation,\n} from \"@builder.io/qwik-city\";\n\nexport const Social = ({ head, loc }: SocialProps) => {\n  return (\n    <>\n      {/*  Open Graph: https://ogp.me/  */}\n      <meta property=\"og:url\" content={loc.url.href} />\n      <meta property=\"og:title\" content={head.title} />\n      <meta property=\"og:type\" content=\"website\" />\n      <meta property=\"og:site_name\" content=\"Qwik\" />\n      <meta property=\"og:locale\" content=\"en_US\" />\n\n      {/*  Twitter: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards  */}\n      <meta name=\"twitter:card\" content=\"summary_large_image\" />\n      <meta name=\"twitter:site\" content=\"@QwikDev\" />\n      <meta name=\"twitter:title\" content={head.title} />\n    </>\n  );\n};\n\ninterface SocialProps {\n  loc: RouteLocation;\n  head: ResolvedDocumentHead;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/components/router-head/vendor.tsx",
    "content": "import type { RouteLocation } from \"@builder.io/qwik-city\";\n\nexport const Vendor = ({ loc }: VendorProps) => {\n  return (\n    <>\n      <script\n        dangerouslySetInnerHTML={`console.log(\"🧨 Analytics! ${loc.url.pathname}\");`}\n      />\n    </>\n  );\n};\n\ninterface VendorProps {\n  loc: RouteLocation;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/entry.ssr.tsx",
    "content": "import {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport Root from \"./root\";\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    base: \"/qwikcity-test.prod/build/\",\n    ...opts,\n  });\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/global.css",
    "content": "body {\n  margin: 0;\n  padding: 0;\n  font-family:\n    system-ui,\n    -apple-system,\n    BlinkMacSystemFont,\n    \"Segoe UI\",\n    Roboto,\n    \"Helvetica Neue\",\n    sans-serif;\n}\n\nmain {\n  padding: 10px 20px;\n  max-width: 800px;\n  margin: 0 auto;\n}\n\n.full-screen main {\n  max-width: 100%;\n}\n\na {\n  color: #006eb3;\n}\n\na:hover {\n  text-decoration: none;\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/root.tsx",
    "content": "import { QwikCityProvider, RouterOutlet } from \"@builder.io/qwik-city\";\nimport { RouterHead } from \"./components/router-head/router-head\";\nimport \"./global.css\";\n\nexport default function Root() {\n  return (\n    <QwikCityProvider>\n      <head>\n        <meta charset=\"utf-8\" />\n        <RouterHead />\n      </head>\n      <body>\n        <RouterOutlet />\n      </body>\n    </QwikCityProvider>\n  );\n}\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/routes/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Welcome to Qwik City!</h1>\n      <p>\n        <a href=\"/qwikcity-test.prod/server-function\">Server Function</a>\n      </p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/qwikcity-test.prod/src/routes/server-function/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\n\nexport default component$(() => {\n  return (\n    <div>\n      <h1>Server function page!</h1>\n      <p>Page without server function</p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/starter-partytown-test/package.json",
    "content": "{\n  \"description\": \"Blank Qwik starter app with Partytown.\",\n  \"dependencies\": {\n    \"@qwik.dev/partytown\": \"latest\"\n  },\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"priority\": 0\n  }\n}\n"
  },
  {
    "path": "starters/apps/starter-partytown-test/src/components/app/app.tsx",
    "content": "import { component$, useStore } from \"@builder.io/qwik\";\n\nexport const App = component$(() => {\n  const state = useStore({ name: \"World\", running: true });\n\n  return (\n    <div\n      id=\"my-app\"\n      document:on-expensiveComputationDone$={() => (state.running = false)}\n    >\n      <p style={{ \"text-align\": \"center\" }}>\n        <a href=\"https://github.com/QwikDev/qwik\">\n          <img\n            alt=\"Qwik Logo\"\n            width={400}\n            src=\"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F667ab6c2283d4c4d878fb9083aacc10f\"\n          />\n        </a>\n      </p>\n      <p class=\"congrats\">\n        Congratulations <a href=\"https://github.com/QwikDev/qwik\">Qwik</a> with{\" \"}\n        <a href=\"https://partytown.qwik.dev/\">Partytown</a> is working!\n      </p>\n\n      <p>\n        Expensive script running in{\" \"}\n        <a href=\"https://partytown.qwik.dev/\">Partytown</a> is{\" \"}\n        {state.running ? (\n          <span\n            id=\"state\"\n            style={{\n              \"background-color\": \"red\",\n              color: \"white\",\n              padding: \".1em\",\n            }}\n          >\n            running\n          </span>\n        ) : (\n          <span\n            id=\"state\"\n            style={{\n              \"background-color\": \"green\",\n              color: \"white\",\n              padding: \".1em\",\n            }}\n          >\n            finished\n          </span>\n        )}\n        .\n      </p>\n\n      <p>Next steps:</p>\n      <ol>\n        <li>\n          Open dev-tools network tab and notice that no JavaScript was\n          downloaded by the main thread to render this page. (\n          <code>partytown.js</code> is used to execute things of main thread and\n          not for rendering the application.)\n        </li>\n        <li>\n          Partytown executes <code>&lt;script&gt;</code> tag that contains a\n          simulation of expensive script. The expensive script simplation keeps\n          the web-worker thread busy for 2.5 seconds, leaving main-thread free\n          for user interactions. (Without Partytown the script would block the\n          main thread resulting in poor user experience.)\n        </li>\n        <li>\n          Once the expensive operation is finished it dispatches custom event (\n          <code>expensiveComputationDone</code>) that this component listens on.\n          It is only at that time that Qwik lazy-loads the component render\n          function and updates the UI. (See network tab.)\n        </li>\n        <li>\n          Try interacting with this component by changing{\" \"}\n          <input\n            value={state.name}\n            onInput$={(event, input) => {\n              state.name = input.value;\n            }}\n          ></input>\n          .\n        </li>\n        <li>\n          Observe that the binding changes: <code>Hello {state.name}!</code>\n        </li>\n        <li>\n          Notice that Qwik automatically lazily-loaded and resumed the component\n          upon interaction without the developer having to code that behavior.\n          (Lazy hydration is what gives even large apps instant on behavior.)\n        </li>\n        <li>\n          Read the docs <a href=\"https://qwik.dev/\">here</a>.\n        </li>\n        <li>Replace the content of this component with your code.</li>\n        <li>Build amazing web-sites with unbeatable startup performance.</li>\n      </ol>\n      <hr />\n      <p style={{ \"text-align\": \"center\" }}>\n        Made with ❤️ by{\" \"}\n        <a target=\"_blank\" href=\"https://www.builder.io/\">\n          Builder.io\n        </a>\n      </p>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/starter-partytown-test/src/entry.ssr.tsx",
    "content": "import { renderToStream, RenderOptions } from \"@builder.io/qwik/server\";\nimport Root from \"./root\";\n\n/**\n * Qwik server-side render function.\n */\nexport default function (opts: RenderOptions) {\n  return renderToStream(<Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/starter-partytown-test/src/global.css",
    "content": "/**\n * Write here your global css styles\n */\n"
  },
  {
    "path": "starters/apps/starter-partytown-test/src/root.tsx",
    "content": "import { App } from \"./components/app/app\";\nimport { partytownSnippet } from \"@qwik.dev/partytown/integration\";\n\nimport \"./global.css\";\n\nexport default () => {\n  return (\n    <>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik + Partytown Blank App</title>\n        <script\n          dangerouslySetInnerHTML={partytownSnippet({\n            fallbackTimeout: 1000,\n            debug: true,\n          })}\n        />\n      </head>\n      <body>\n        <App />\n        <script\n          type=\"text/partytown\"\n          dangerouslySetInnerHTML={`(${partyTownExampleWhichBlocksMainThreadForOneSecond.toString()})()`}\n        ></script>\n      </body>\n    </>\n  );\n};\n\nfunction partyTownExampleWhichBlocksMainThreadForOneSecond() {\n  // Block execution for 1 second.\n  const start = new Date().getTime();\n  // eslint-disable-next-line no-console\n  console.log(\"Expensive computation started at:\", start);\n  let end = 0;\n  while (end < start + 500) {\n    end = new Date().getTime();\n  }\n  // eslint-disable-next-line no-console\n  console.log(\"Expensive computation ended at:\", end);\n  document.dispatchEvent(\n    new Event(\"expensiveComputationDone\", { bubbles: true }),\n  );\n}\n"
  },
  {
    "path": "starters/apps/todo-old-test/package.json",
    "content": "{\n  \"description\": \"Qwik implementation of TodoMVC: https://todomvc.com/.\",\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"priority\": 0\n  }\n}\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/components/app/app.tsx",
    "content": "import { component$, useStyles$, useStore } from \"@builder.io/qwik\";\nimport { Footer } from \"../footer/footer\";\nimport { Header } from \"../header/header\";\nimport { Body } from \"../body/body\";\nimport type { Todos } from \"../../state/state\";\nimport styles from \"./index.css?inline\";\n\n/**\n * Overall application component.\n *\n * This component is static (meaning it will never change). Because of this\n * Qwik knows that it should never need to be rerendered, and its code will never\n * download to the client.\n */\nexport const App = component$(() => {\n  useStyles$(styles);\n\n  const todos = useStore<Todos>(\n    {\n      filter: \"all\",\n      items: [\n        { completed: false, title: \"Read Qwik docs\", id: \"0\" },\n        { completed: false, title: \"Build HelloWorld\", id: \"1\" },\n        { completed: false, title: \"Profit\", id: \"2\" },\n      ],\n      nextItemId: 3,\n    },\n    { deep: true },\n  );\n  return (\n    <section class=\"todoapp\">\n      <Header todos={todos} />\n      <Body todos={todos} />\n      <Footer todos={todos} />\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/components/app/base.css",
    "content": "hr {\n  margin: 20px 0;\n  border: 0;\n  border-top: 1px dashed #c5c5c5;\n  border-bottom: 1px dashed #f7f7f7;\n}\n\n.learn a {\n  font-weight: normal;\n  text-decoration: none;\n  color: #b83f45;\n}\n\n.learn a:hover {\n  text-decoration: underline;\n  color: #787e7e;\n}\n\n.learn h3,\n.learn h4,\n.learn h5 {\n  margin: 10px 0;\n  font-weight: 500;\n  line-height: 1.2;\n  color: #000;\n}\n\n.learn h3 {\n  font-size: 24px;\n}\n\n.learn h4 {\n  font-size: 18px;\n}\n\n.learn h5 {\n  margin-bottom: 0;\n  font-size: 14px;\n}\n\n.learn ul {\n  padding: 0;\n  margin: 0 0 30px 25px;\n}\n\n.learn li {\n  line-height: 20px;\n}\n\n.learn p {\n  font-size: 15px;\n  font-weight: 300;\n  line-height: 1.3;\n  margin-top: 0;\n  margin-bottom: 0;\n}\n\n#issue-count {\n  display: none;\n}\n\n.quote {\n  border: none;\n  margin: 20px 0 60px 0;\n}\n\n.quote p {\n  font-style: italic;\n}\n\n.quote p:before {\n  content: \"“\";\n  font-size: 50px;\n  opacity: 0.15;\n  position: absolute;\n  top: -20px;\n  left: 3px;\n}\n\n.quote p:after {\n  content: \"”\";\n  font-size: 50px;\n  opacity: 0.15;\n  position: absolute;\n  bottom: -42px;\n  right: 3px;\n}\n\n.quote footer {\n  position: absolute;\n  bottom: -40px;\n  right: 0;\n}\n\n.quote footer img {\n  border-radius: 3px;\n}\n\n.quote footer a {\n  margin-left: 5px;\n  vertical-align: middle;\n}\n\n.speech-bubble {\n  position: relative;\n  padding: 10px;\n  background: rgba(0, 0, 0, 0.04);\n  border-radius: 5px;\n}\n\n.speech-bubble:after {\n  content: \"\";\n  position: absolute;\n  top: 100%;\n  right: 30px;\n  border: 13px solid transparent;\n  border-top-color: rgba(0, 0, 0, 0.04);\n}\n\n.learn-bar > .learn {\n  position: absolute;\n  width: 272px;\n  top: 8px;\n  left: -300px;\n  padding: 10px;\n  border-radius: 5px;\n  background-color: rgba(255, 255, 255, 0.6);\n  transition-property: left;\n  transition-duration: 500ms;\n}\n\n@media (min-width: 899px) {\n  .learn-bar {\n    width: auto;\n    padding-left: 300px;\n  }\n\n  .learn-bar > .learn {\n    left: 8px;\n  }\n}\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/components/app/index.css",
    "content": "@import \"base.css\";\n\nhtml,\nbody {\n  margin: 0;\n  padding: 0;\n}\n\nbutton {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  background: none;\n  font-size: 100%;\n  vertical-align: baseline;\n  font-family: inherit;\n  font-weight: inherit;\n  color: inherit;\n  -webkit-appearance: none;\n  appearance: none;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\nbody {\n  font:\n    14px \"Helvetica Neue\",\n    Helvetica,\n    Arial,\n    sans-serif;\n  line-height: 1.4em;\n  background: #f5f5f5;\n  color: #111111;\n  min-width: 230px;\n  max-width: 550px;\n  margin: 0 auto;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  font-weight: 300;\n}\n\n:focus {\n  outline: 0;\n}\n\n.hidden {\n  display: none;\n}\n\n.todoapp {\n  background: #fff;\n  margin: 130px 0 40px 0;\n  position: relative;\n  box-shadow:\n    0 2px 4px 0 rgba(0, 0, 0, 0.2),\n    0 25px 50px 0 rgba(0, 0, 0, 0.1);\n}\n\n.todoapp input::-webkit-input-placeholder {\n  font-style: italic;\n  font-weight: 300;\n  color: rgba(0, 0, 0, 0.4);\n}\n\n.todoapp input::-moz-placeholder {\n  font-style: italic;\n  font-weight: 300;\n  color: rgba(0, 0, 0, 0.4);\n}\n\n.todoapp input::input-placeholder {\n  font-style: italic;\n  font-weight: 300;\n  color: rgba(0, 0, 0, 0.4);\n}\n\n.todoapp h1 {\n  position: absolute;\n  top: -140px;\n  width: 100%;\n  font-size: 80px;\n  font-weight: 200;\n  text-align: center;\n  color: #b83f45;\n  -webkit-text-rendering: optimizeLegibility;\n  -moz-text-rendering: optimizeLegibility;\n  text-rendering: optimizeLegibility;\n}\n\n.new-todo,\n.edit {\n  position: relative;\n  margin: 0;\n  width: 100%;\n  font-size: 24px;\n  font-family: inherit;\n  font-weight: inherit;\n  line-height: 1.4em;\n  color: inherit;\n  padding: 6px;\n  border: 1px solid #999;\n  box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);\n  box-sizing: border-box;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n.new-todo {\n  padding: 16px 16px 16px 60px;\n  border: none;\n  background: rgba(0, 0, 0, 0.003);\n  box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.03);\n}\n\n.main {\n  position: relative;\n  z-index: 2;\n  border-top: 1px solid #e6e6e6;\n}\n\n.toggle-all {\n  width: 1px;\n  height: 1px;\n  border: none; /* Mobile Safari */\n  opacity: 0;\n  position: absolute;\n  right: 100%;\n  bottom: 100%;\n}\n\n.toggle-all + label {\n  width: 60px;\n  height: 34px;\n  font-size: 0;\n  position: absolute;\n  top: -52px;\n  left: -13px;\n  -webkit-transform: rotate(90deg);\n  transform: rotate(90deg);\n}\n\n.toggle-all + label:before {\n  content: \"❯\";\n  font-size: 22px;\n  color: #e6e6e6;\n  padding: 10px 27px 10px 27px;\n}\n\n.toggle-all:checked + label:before {\n  color: #737373;\n}\n\n.todo-list {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.todo-list li {\n  position: relative;\n  font-size: 24px;\n  border-bottom: 1px solid #ededed;\n}\n\n.todo-list li:last-child {\n  border-bottom: none;\n}\n\n.todo-list li.editing {\n  border-bottom: none;\n  padding: 0;\n}\n\n.todo-list li.editing .edit {\n  display: block;\n  width: calc(100% - 43px);\n  padding: 12px 16px;\n  margin: 0 0 0 43px;\n}\n\n.todo-list li.editing .view {\n  display: none;\n}\n\n.todo-list li .toggle {\n  text-align: center;\n  width: 40px;\n  /* auto, since non-WebKit browsers doesn't support input styling */\n  height: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  margin: auto 0;\n  border: none; /* Mobile Safari */\n  -webkit-appearance: none;\n  appearance: none;\n}\n\n.todo-list li .toggle {\n  opacity: 0;\n}\n\n.todo-list li .toggle + label {\n  /*\n\t\tFirefox requires `#` to be escaped - https://bugzilla.mozilla.org/show_bug.cgi?id=922433\n\t\tIE and Edge requires *everything* to be escaped to render, so we do that instead of just the `#` - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7157459/\n\t*/\n  background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E\");\n  background-repeat: no-repeat;\n  background-position: center left;\n}\n\n.todo-list li .toggle:checked + label {\n  background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23bddad5%22%20stroke-width%3D%223%22/%3E%3Cpath%20fill%3D%22%235dc2af%22%20d%3D%22M72%2025L42%2071%2027%2056l-4%204%2020%2020%2034-52z%22/%3E%3C/svg%3E\");\n}\n\n.todo-list li label {\n  word-break: break-all;\n  padding: 15px 15px 15px 60px;\n  display: block;\n  line-height: 1.2;\n  transition: color 0.4s;\n  font-weight: 400;\n  color: #4d4d4d;\n}\n\n.todo-list li.completed label {\n  color: #cdcdcd;\n  text-decoration: line-through;\n}\n\n.todo-list li .destroy {\n  display: none;\n  position: absolute;\n  top: 0;\n  right: 10px;\n  bottom: 0;\n  width: 40px;\n  height: 40px;\n  margin: auto 0;\n  font-size: 30px;\n  color: #cc9a9a;\n  margin-bottom: 11px;\n  transition: color 0.2s ease-out;\n}\n\n.todo-list li .destroy:hover {\n  color: #af5b5e;\n}\n\n.todo-list li .destroy:after {\n  content: \"×\";\n}\n\n.todo-list li:hover .destroy {\n  display: block;\n}\n\n.todo-list li .edit {\n  display: none;\n}\n\n.todo-list li.editing:last-child {\n  margin-bottom: -1px;\n}\n\n.footer {\n  padding: 10px 15px;\n  height: 20px;\n  text-align: center;\n  font-size: 15px;\n  border-top: 1px solid #e6e6e6;\n}\n\n.footer:before {\n  content: \"\";\n  position: absolute;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  height: 50px;\n  overflow: hidden;\n  box-shadow:\n    0 1px 1px rgba(0, 0, 0, 0.2),\n    0 8px 0 -3px #f6f6f6,\n    0 9px 1px -3px rgba(0, 0, 0, 0.2),\n    0 16px 0 -6px #f6f6f6,\n    0 17px 2px -6px rgba(0, 0, 0, 0.2);\n}\n\n.todo-count {\n  float: left;\n  text-align: left;\n}\n\n.todo-count strong {\n  font-weight: 300;\n}\n\n.filters {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  position: absolute;\n  right: 0;\n  left: 0;\n}\n\n.filters li {\n  display: inline;\n}\n\n.filters li a {\n  color: inherit;\n  margin: 3px;\n  padding: 3px 7px;\n  text-decoration: none;\n  border: 1px solid transparent;\n  border-radius: 3px;\n}\n\n.filters li a:hover {\n  border-color: rgba(175, 47, 47, 0.1);\n}\n\n.filters li a.selected {\n  border-color: rgba(175, 47, 47, 0.2);\n}\n\n.clear-completed,\nhtml .clear-completed:active {\n  float: right;\n  position: relative;\n  line-height: 20px;\n  text-decoration: none;\n  cursor: pointer;\n}\n\n.clear-completed:hover {\n  text-decoration: underline;\n}\n\n.info {\n  margin: 65px auto 0;\n  color: #4d4d4d;\n  font-size: 11px;\n  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);\n  text-align: center;\n}\n\n.info p {\n  line-height: 1;\n}\n\n.info a {\n  color: inherit;\n  text-decoration: none;\n  font-weight: 400;\n}\n\n.info a:hover {\n  text-decoration: underline;\n}\n\n/*\n\tHack to remove background from Mobile Safari.\n\tCan't use it globally since it destroys checkboxes in Firefox\n*/\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n  .toggle-all,\n  .todo-list li .toggle {\n    background: none;\n  }\n\n  .todo-list li .toggle {\n    height: 40px;\n  }\n}\n\n@media (max-width: 430px) {\n  .footer {\n    height: 50px;\n  }\n\n  .filters {\n    bottom: 10px;\n  }\n}\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/components/body/body.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { FILTERS, Todos } from \"../../state/state\";\nimport { Item } from \"../item/item\";\n\ninterface BodyProps {\n  todos: Todos;\n}\nexport const Body = component$(({ todos }: BodyProps) => {\n  return (\n    <div class=\"main\">\n      <ul class=\"todo-list\">\n        {todos.items.filter(FILTERS[todos.filter]).map((key) => (\n          <Item item={key} todos={todos} key={key.id} />\n        ))}\n      </ul>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/components/footer/footer.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { FILTERS, FilterStates, Todos } from \"../../state/state\";\n\n/**\n * Footer showing items remaining and filtering options\n *\n * It only rerenders if the todos count changes or filters are reset.\n */\nexport const Footer = component$((props: { todos: Todos }) => {\n  /**\n   * Example of lite-component (it will always be included with the parent component)\n   */\n  function Filter({ filter }: { filter: FilterStates }) {\n    const lMode = filter.toLowerCase();\n    return (\n      <li>\n        <a\n          class={{ selected: props.todos.filter == lMode }}\n          onClick$={() => {\n            props.todos.filter = filter;\n          }}\n        >\n          {filter[0].toUpperCase() + filter.slice(1)}\n        </a>\n      </li>\n    );\n  }\n  const remaining = props.todos.items.filter(FILTERS.active).length;\n  return (\n    <footer class=\"footer\">\n      {props.todos.items.length > 0 ? (\n        <>\n          <span class=\"todo-count\">\n            <strong>{remaining}</strong>\n            {remaining == 1 ? \" item\" : \" items\"} left\n          </span>\n          <ul class=\"filters\">\n            {FilterStates.map((f) => (\n              <Filter filter={f} key={f} />\n            ))}\n          </ul>\n          {remaining > 0 ? (\n            <button\n              class=\"clear-completed\"\n              onClick$={() => {\n                props.todos.items = props.todos.items.filter(FILTERS.active);\n              }}\n            >\n              Clear completed\n            </button>\n          ) : null}\n        </>\n      ) : null}\n    </footer>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/components/header/header.tsx",
    "content": "import { component$, useStore } from \"@builder.io/qwik\";\nimport type { Todos } from \"../../state/state\";\n\n/**\n * Header component which is responsible for providing UI to ender new todo item.\n *\n * This component only rerenders if the user interacts with it through the input.\n */\nexport const Header = component$((props: { todos: Todos }) => {\n  const state = useStore({ text: \"\" });\n  return (\n    <header>\n      <h1>todos</h1>\n      <input\n        class=\"new-todo\"\n        placeholder=\"What needs to be done?\"\n        autoFocus\n        value={state.text}\n        onKeyUp$={(event: any) => {\n          const inputValue = (event.target as HTMLInputElement).value;\n          state.text = inputValue;\n          if (event.key === \"Enter\" && inputValue) {\n            props.todos.items.push({\n              completed: false,\n              title: state.text,\n              id: `${props.todos.nextItemId++}`,\n            });\n            state.text = \"\";\n          }\n        }}\n      />\n    </header>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/components/item/item.tsx",
    "content": "import { component$, useStore, useSignal, useTask$ } from \"@builder.io/qwik\";\n\nimport type { TodoItem, Todos } from \"../../state/state\";\n\n/**\n * Individual items of the component.\n *\n * It only rerenders if the user infarcts with it or if the item itself changes.\n */\n\nexport interface ItemProps {\n  item: TodoItem;\n  todos: Todos;\n}\n\nexport const Item = component$((props: ItemProps) => {\n  const state = useStore({ editing: false });\n  const editInput = useSignal<HTMLInputElement>();\n\n  useTask$(({ track }) => {\n    const current = track(() => editInput.value);\n    if (current) {\n      current.focus();\n      current.selectionStart = current.selectionEnd = current.value.length;\n    }\n  });\n\n  return (\n    <li class={{ completed: props.item.completed, editing: state.editing }}>\n      <div class=\"view\">\n        <input\n          class=\"toggle\"\n          type=\"checkbox\"\n          checked={props.item.completed}\n          onClick$={() => {\n            props.item.completed = !props.item.completed;\n          }}\n        />\n        <label\n          onDblclick$={async () => {\n            state.editing = true;\n          }}\n        >\n          {props.item.title}\n        </label>\n        <button\n          class=\"destroy\"\n          onClick$={() => {\n            const todoItem = props.item;\n            props.todos.items = props.todos.items.filter((i) => i != todoItem);\n          }}\n        />\n      </div>\n      {state.editing ? (\n        <input\n          class=\"edit\"\n          ref={editInput}\n          value={props.item.title}\n          onBlur$={() => (state.editing = false)}\n          onKeyUp$={(event: any) => {\n            const inputValue = (event.target as HTMLInputElement).value;\n            props.item.title = inputValue;\n            if (event.key === \"Enter\") {\n              state.editing = false;\n            }\n          }}\n        />\n      ) : null}\n    </li>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/entry.dev.tsx",
    "content": "import { render } from \"@builder.io/qwik\";\nimport { Root } from \"./root\";\n\n/**\n * Development only entry point using only client-side modules.\n */\nrender(document, <Root />);\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/entry.ssr.tsx",
    "content": "import { renderToStream, RenderToStreamOptions } from \"@builder.io/qwik/server\";\nimport { Root } from \"./root\";\n\n/**\n * Qwik server-side render function.\n */\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/root.tsx",
    "content": "import { App } from \"./components/app/app\";\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik Demo: Todo</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "starters/apps/todo-old-test/src/state/state.ts",
    "content": "////////////////////////////////////////////////////////////////////////\n// Todo Application State Interfaces\n////////////////////////////////////////////////////////////////////////\n\nexport interface TodoItem {\n  id: string;\n  completed: boolean;\n  title: string;\n}\n\nexport interface Todos {\n  filter: FilterStates;\n  items: TodoItem[];\n  nextItemId: number;\n}\n\nexport type FilterStates = \"all\" | \"active\" | \"completed\";\n\nexport const FilterStates: FilterStates[] = [\"all\", \"active\", \"completed\"];\n\nexport const FILTERS = {\n  all: () => true,\n  active: (i: TodoItem) => i.completed == false,\n  completed: (i: TodoItem) => i.completed == true,\n};\n"
  },
  {
    "path": "starters/apps/todo-test/package.json",
    "content": "{\n  \"description\": \"Qwik implementation of TodoMVC: https://todomvc.com/.\",\n  \"type\": \"module\",\n  \"__qwik__\": {\n    \"priority\": -2\n  }\n}\n"
  },
  {
    "path": "starters/apps/todo-test/src/components/app/app.tsx",
    "content": "import {\n  component$,\n  useStyles$,\n  useStore,\n  useContextProvider,\n} from \"@builder.io/qwik\";\nimport { Footer } from \"../footer/footer\";\nimport { Header } from \"../header/header\";\nimport { Body } from \"../body/body\";\nimport { TODOS, type Todos } from \"../../state/state\";\nimport styles from \"./index.css?inline\";\n\n/**\n * Overall application component.\n *\n * This component is static (meaning it will never change). Because of this\n * Qwik knows that it should never need to be rerendered, and its code will never\n * download to the client.\n */\nexport const App = component$(() => {\n  useStyles$(styles);\n\n  const todos = useStore<Todos>(\n    {\n      filter: \"all\",\n      items: [\n        { completed: false, title: \"Read Qwik docs\", id: \"0\" },\n        { completed: false, title: \"Build HelloWorld\", id: \"1\" },\n        { completed: false, title: \"Profit\", id: \"2\" },\n      ],\n      nextItemId: 3,\n    },\n    { deep: true },\n  );\n  useContextProvider(TODOS, todos);\n\n  return (\n    <section class=\"todoapp\">\n      <Header />\n      <Body />\n      <Footer />\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-test/src/components/app/base.css",
    "content": "hr {\n  margin: 20px 0;\n  border: 0;\n  border-top: 1px dashed #c5c5c5;\n  border-bottom: 1px dashed #f7f7f7;\n}\n\n.learn a {\n  font-weight: normal;\n  text-decoration: none;\n  color: #b83f45;\n}\n\n.learn a:hover {\n  text-decoration: underline;\n  color: #787e7e;\n}\n\n.learn h3,\n.learn h4,\n.learn h5 {\n  margin: 10px 0;\n  font-weight: 500;\n  line-height: 1.2;\n  color: #000;\n}\n\n.learn h3 {\n  font-size: 24px;\n}\n\n.learn h4 {\n  font-size: 18px;\n}\n\n.learn h5 {\n  margin-bottom: 0;\n  font-size: 14px;\n}\n\n.learn ul {\n  padding: 0;\n  margin: 0 0 30px 25px;\n}\n\n.learn li {\n  line-height: 20px;\n}\n\n.learn p {\n  font-size: 15px;\n  font-weight: 300;\n  line-height: 1.3;\n  margin-top: 0;\n  margin-bottom: 0;\n}\n\n#issue-count {\n  display: none;\n}\n\n.quote {\n  border: none;\n  margin: 20px 0 60px 0;\n}\n\n.quote p {\n  font-style: italic;\n}\n\n.quote p:before {\n  content: \"“\";\n  font-size: 50px;\n  opacity: 0.15;\n  position: absolute;\n  top: -20px;\n  left: 3px;\n}\n\n.quote p:after {\n  content: \"”\";\n  font-size: 50px;\n  opacity: 0.15;\n  position: absolute;\n  bottom: -42px;\n  right: 3px;\n}\n\n.quote footer {\n  position: absolute;\n  bottom: -40px;\n  right: 0;\n}\n\n.quote footer img {\n  border-radius: 3px;\n}\n\n.quote footer a {\n  margin-left: 5px;\n  vertical-align: middle;\n}\n\n.speech-bubble {\n  position: relative;\n  padding: 10px;\n  background: rgba(0, 0, 0, 0.04);\n  border-radius: 5px;\n}\n\n.speech-bubble:after {\n  content: \"\";\n  position: absolute;\n  top: 100%;\n  right: 30px;\n  border: 13px solid transparent;\n  border-top-color: rgba(0, 0, 0, 0.04);\n}\n\n.learn-bar > .learn {\n  position: absolute;\n  width: 272px;\n  top: 8px;\n  left: -300px;\n  padding: 10px;\n  border-radius: 5px;\n  background-color: rgba(255, 255, 255, 0.6);\n  transition-property: left;\n  transition-duration: 500ms;\n}\n\n@media (min-width: 899px) {\n  .learn-bar {\n    width: auto;\n    padding-left: 300px;\n  }\n\n  .learn-bar > .learn {\n    left: 8px;\n  }\n}\n"
  },
  {
    "path": "starters/apps/todo-test/src/components/app/index.css",
    "content": "@import \"base.css\";\n\nhtml,\nbody {\n  margin: 0;\n  padding: 0;\n}\n\nbutton {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  background: none;\n  font-size: 100%;\n  vertical-align: baseline;\n  font-family: inherit;\n  font-weight: inherit;\n  color: inherit;\n  -webkit-appearance: none;\n  appearance: none;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\nbody {\n  font:\n    14px \"Helvetica Neue\",\n    Helvetica,\n    Arial,\n    sans-serif;\n  line-height: 1.4em;\n  background: #f5f5f5;\n  color: #111111;\n  min-width: 230px;\n  max-width: 550px;\n  margin: 0 auto;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  font-weight: 300;\n}\n\n:focus {\n  outline: 0;\n}\n\n.hidden {\n  display: none;\n}\n\n.todoapp {\n  background: #fff;\n  margin: 130px 0 40px 0;\n  position: relative;\n  box-shadow:\n    0 2px 4px 0 rgba(0, 0, 0, 0.2),\n    0 25px 50px 0 rgba(0, 0, 0, 0.1);\n}\n\n.todoapp input::-webkit-input-placeholder {\n  font-style: italic;\n  font-weight: 300;\n  color: rgba(0, 0, 0, 0.4);\n}\n\n.todoapp input::-moz-placeholder {\n  font-style: italic;\n  font-weight: 300;\n  color: rgba(0, 0, 0, 0.4);\n}\n\n.todoapp input::input-placeholder {\n  font-style: italic;\n  font-weight: 300;\n  color: rgba(0, 0, 0, 0.4);\n}\n\n.todoapp h1 {\n  position: absolute;\n  top: -140px;\n  width: 100%;\n  font-size: 80px;\n  font-weight: 200;\n  text-align: center;\n  color: #b83f45;\n  -webkit-text-rendering: optimizeLegibility;\n  -moz-text-rendering: optimizeLegibility;\n  text-rendering: optimizeLegibility;\n}\n\n.new-todo,\n.edit {\n  position: relative;\n  margin: 0;\n  width: 100%;\n  font-size: 24px;\n  font-family: inherit;\n  font-weight: inherit;\n  line-height: 1.4em;\n  color: inherit;\n  padding: 6px;\n  border: 1px solid #999;\n  box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);\n  box-sizing: border-box;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n.new-todo {\n  padding: 16px 16px 16px 60px;\n  border: none;\n  background: rgba(0, 0, 0, 0.003);\n  box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.03);\n}\n\n.main {\n  position: relative;\n  z-index: 2;\n  border-top: 1px solid #e6e6e6;\n}\n\n.toggle-all {\n  width: 1px;\n  height: 1px;\n  border: none; /* Mobile Safari */\n  opacity: 0;\n  position: absolute;\n  right: 100%;\n  bottom: 100%;\n}\n\n.toggle-all + label {\n  width: 60px;\n  height: 34px;\n  font-size: 0;\n  position: absolute;\n  top: -52px;\n  left: -13px;\n  -webkit-transform: rotate(90deg);\n  transform: rotate(90deg);\n}\n\n.toggle-all + label:before {\n  content: \"❯\";\n  font-size: 22px;\n  color: #e6e6e6;\n  padding: 10px 27px 10px 27px;\n}\n\n.toggle-all:checked + label:before {\n  color: #737373;\n}\n\n.todo-list {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.todo-list li {\n  position: relative;\n  font-size: 24px;\n  border-bottom: 1px solid #ededed;\n}\n\n.todo-list li:last-child {\n  border-bottom: none;\n}\n\n.todo-list li.editing {\n  border-bottom: none;\n  padding: 0;\n}\n\n.todo-list li.editing .edit {\n  display: block;\n  width: calc(100% - 43px);\n  padding: 12px 16px;\n  margin: 0 0 0 43px;\n}\n\n.todo-list li.editing .view {\n  display: none;\n}\n\n.todo-list li .toggle {\n  text-align: center;\n  width: 40px;\n  /* auto, since non-WebKit browsers doesn't support input styling */\n  height: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  margin: auto 0;\n  border: none; /* Mobile Safari */\n  -webkit-appearance: none;\n  appearance: none;\n}\n\n.todo-list li .toggle {\n  opacity: 0;\n}\n\n.todo-list li .toggle + label {\n  /*\n\t\tFirefox requires `#` to be escaped - https://bugzilla.mozilla.org/show_bug.cgi?id=922433\n\t\tIE and Edge requires *everything* to be escaped to render, so we do that instead of just the `#` - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7157459/\n\t*/\n  background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E\");\n  background-repeat: no-repeat;\n  background-position: center left;\n}\n\n.todo-list li .toggle:checked + label {\n  background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23bddad5%22%20stroke-width%3D%223%22/%3E%3Cpath%20fill%3D%22%235dc2af%22%20d%3D%22M72%2025L42%2071%2027%2056l-4%204%2020%2020%2034-52z%22/%3E%3C/svg%3E\");\n}\n\n.todo-list li label {\n  word-break: break-all;\n  padding: 15px 15px 15px 60px;\n  display: block;\n  line-height: 1.2;\n  transition: color 0.4s;\n  font-weight: 400;\n  color: #4d4d4d;\n}\n\n.todo-list li.completed label {\n  color: #cdcdcd;\n  text-decoration: line-through;\n}\n\n.todo-list li .destroy {\n  display: none;\n  position: absolute;\n  top: 0;\n  right: 10px;\n  bottom: 0;\n  width: 40px;\n  height: 40px;\n  margin: auto 0;\n  font-size: 30px;\n  color: #cc9a9a;\n  margin-bottom: 11px;\n  transition: color 0.2s ease-out;\n}\n\n.todo-list li .destroy:hover {\n  color: #af5b5e;\n}\n\n.todo-list li .destroy:after {\n  content: \"×\";\n}\n\n.todo-list li:hover .destroy {\n  display: block;\n}\n\n.todo-list li .edit {\n  display: none;\n}\n\n.todo-list li.editing:last-child {\n  margin-bottom: -1px;\n}\n\n.footer {\n  padding: 10px 15px;\n  height: 20px;\n  text-align: center;\n  font-size: 15px;\n  border-top: 1px solid #e6e6e6;\n}\n\n.footer:before {\n  content: \"\";\n  position: absolute;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  height: 50px;\n  overflow: hidden;\n  box-shadow:\n    0 1px 1px rgba(0, 0, 0, 0.2),\n    0 8px 0 -3px #f6f6f6,\n    0 9px 1px -3px rgba(0, 0, 0, 0.2),\n    0 16px 0 -6px #f6f6f6,\n    0 17px 2px -6px rgba(0, 0, 0, 0.2);\n}\n\n.todo-count {\n  float: left;\n  text-align: left;\n}\n\n.todo-count strong {\n  font-weight: 300;\n}\n\n.filters {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  position: absolute;\n  right: 0;\n  left: 0;\n}\n\n.filters li {\n  display: inline;\n}\n\n.filters li a {\n  color: inherit;\n  margin: 3px;\n  padding: 3px 7px;\n  text-decoration: none;\n  border: 1px solid transparent;\n  border-radius: 3px;\n}\n\n.filters li a:hover {\n  border-color: rgba(175, 47, 47, 0.1);\n}\n\n.filters li a.selected {\n  border-color: rgba(175, 47, 47, 0.2);\n}\n\n.clear-completed,\nhtml .clear-completed:active {\n  float: right;\n  position: relative;\n  line-height: 20px;\n  text-decoration: none;\n  cursor: pointer;\n}\n\n.clear-completed:hover {\n  text-decoration: underline;\n}\n\n.info {\n  margin: 65px auto 0;\n  color: #4d4d4d;\n  font-size: 11px;\n  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);\n  text-align: center;\n}\n\n.info p {\n  line-height: 1;\n}\n\n.info a {\n  color: inherit;\n  text-decoration: none;\n  font-weight: 400;\n}\n\n.info a:hover {\n  text-decoration: underline;\n}\n\n/*\n\tHack to remove background from Mobile Safari.\n\tCan't use it globally since it destroys checkboxes in Firefox\n*/\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n  .toggle-all,\n  .todo-list li .toggle {\n    background: none;\n  }\n\n  .todo-list li .toggle {\n    height: 40px;\n  }\n}\n\n@media (max-width: 430px) {\n  .footer {\n    height: 50px;\n  }\n\n  .filters {\n    bottom: 10px;\n  }\n}\n"
  },
  {
    "path": "starters/apps/todo-test/src/components/body/body.tsx",
    "content": "import { component$, useContext } from \"@builder.io/qwik\";\nimport { FILTERS, TODOS } from \"../../state/state\";\nimport { Item } from \"../item/item\";\n\nexport const Body = component$(() => {\n  const todos = useContext(TODOS);\n  return (\n    <div class=\"main\">\n      <ul class=\"todo-list\">\n        {todos.items.filter(FILTERS[todos.filter]).map((key) => (\n          <Item item={key} key={key.id} />\n        ))}\n      </ul>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-test/src/components/footer/footer.tsx",
    "content": "import { component$, useContext } from \"@builder.io/qwik\";\nimport { FILTERS, FilterStates, TODOS } from \"../../state/state\";\n\n/**\n * Footer showing items remaining and filtering options\n *\n * It only rerenders if the todos count changes or filters are reset.\n */\nexport const Footer = component$(() => {\n  /**\n   * Example of lite-component (it will always be included with the parent component)\n   */\n  const todos = useContext(TODOS);\n\n  function Filter({ filter }: { filter: FilterStates }) {\n    const lMode = filter.toLowerCase();\n    return (\n      <li>\n        <a\n          class={{ selected: todos.filter == lMode }}\n          onClick$={() => {\n            todos.filter = filter;\n          }}\n        >\n          {filter[0].toUpperCase() + filter.slice(1)}\n        </a>\n      </li>\n    );\n  }\n  const remaining = todos.items.filter(FILTERS.active).length;\n  return (\n    <footer class=\"footer\">\n      {todos.items.length > 0 ? (\n        <>\n          <span class=\"todo-count\">\n            <strong>{remaining}</strong>\n            {remaining == 1 ? \" item\" : \" items\"} left\n          </span>\n          <ul class=\"filters\">\n            {FilterStates.map((f) => (\n              <Filter filter={f} key={f} />\n            ))}\n          </ul>\n          {remaining > 0 ? (\n            <button\n              class=\"clear-completed\"\n              onClick$={() => {\n                todos.items = todos.items.filter(FILTERS.active);\n              }}\n            >\n              Clear completed\n            </button>\n          ) : null}\n        </>\n      ) : null}\n    </footer>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-test/src/components/header/header.tsx",
    "content": "import { component$, useContext, useStore } from \"@builder.io/qwik\";\nimport { TODOS } from \"../../state/state\";\n\n/**\n * Header component which is responsible for providing UI to ender new todo item.\n *\n * This component only rerenders if the user interacts with it through the input.\n */\nexport const Header = component$(() => {\n  const state = useStore({ text: \"\" });\n  const todos = useContext(TODOS);\n  return (\n    <header>\n      <h1>todos</h1>\n      <input\n        class=\"new-todo\"\n        placeholder=\"What needs to be done?\"\n        autoFocus\n        value={state.text}\n        onKeyUp$={(event: any) => {\n          const inputValue = (event.target as HTMLInputElement).value;\n          state.text = inputValue;\n          if (event.key === \"Enter\" && inputValue) {\n            todos.items.push({\n              completed: false,\n              title: state.text,\n              id: `${todos.nextItemId++}`,\n            });\n            state.text = \"\";\n          }\n        }}\n      />\n    </header>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-test/src/components/item/item.tsx",
    "content": "import {\n  component$,\n  useStore,\n  useTask$,\n  useContext,\n  useSignal,\n} from \"@builder.io/qwik\";\n\nimport { type TodoItem, TODOS } from \"../../state/state\";\n\n/**\n * Individual items of the component.\n *\n * It only rerenders if the user infarcts with it or if the item itself changes.\n */\n\nexport interface ItemProps {\n  item: TodoItem;\n}\n\nexport const Item = component$((props: ItemProps) => {\n  const state = useStore({\n    editing: false,\n  });\n  const editInput = useSignal<HTMLInputElement>();\n  const todos = useContext(TODOS);\n\n  useTask$(({ track }) => {\n    const current = track(() => editInput.value);\n    if (current) {\n      current.focus();\n      current.selectionStart = current.selectionEnd = current.value.length;\n    }\n  });\n\n  return (\n    <li class={{ completed: props.item.completed, editing: state.editing }}>\n      <div class=\"view\">\n        <input\n          class=\"toggle\"\n          type=\"checkbox\"\n          checked={props.item.completed}\n          onClick$={() => {\n            props.item.completed = !props.item.completed;\n          }}\n        />\n        <label\n          onDblclick$={async () => {\n            state.editing = true;\n          }}\n        >\n          {props.item.title}\n        </label>\n        <button\n          class=\"destroy\"\n          onClick$={() => {\n            const todoItem = props.item;\n            todos.items = todos.items.filter((i) => i != todoItem);\n          }}\n        />\n      </div>\n      {state.editing ? (\n        <input\n          class=\"edit\"\n          ref={editInput}\n          value={props.item.title}\n          onBlur$={() => (state.editing = false)}\n          onKeyUp$={(event: any) => {\n            const inputValue = (event.target as HTMLInputElement).value;\n            props.item.title = inputValue;\n            if (event.key === \"Enter\") {\n              state.editing = false;\n            }\n          }}\n        />\n      ) : null}\n    </li>\n  );\n});\n"
  },
  {
    "path": "starters/apps/todo-test/src/entry.ssr.tsx",
    "content": "import {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport { Root } from \"./root\";\n\n/**\n * Server-Side Render method to be called by a server.\n */\nexport default function (opts: RenderToStreamOptions) {\n  // Render the Root component to a string\n  // Pass in the manifest that was generated from the client build\n  return renderToStream(<Root />, opts);\n}\n"
  },
  {
    "path": "starters/apps/todo-test/src/root.tsx",
    "content": "import { App } from \"./components/app/app\";\n\nexport const Root = () => {\n  return (\n    <>\n      <head>\n        <meta charset=\"utf-8\" />\n        <title>Qwik Demo: Todo</title>\n      </head>\n      <body>\n        <App />\n      </body>\n    </>\n  );\n};\n"
  },
  {
    "path": "starters/apps/todo-test/src/state/state.ts",
    "content": "////////////////////////////////////////////////////////////////////////\n// Todo Application State Interfaces\n////////////////////////////////////////////////////////////////////////\n\nimport { createContextId } from \"@builder.io/qwik\";\n\nexport const TODOS = createContextId<Todos>(\"TodoApp\");\n\nexport interface TodoItem {\n  id: string;\n  completed: boolean;\n  title: string;\n}\n\nexport interface Todos {\n  filter: FilterStates;\n  items: TodoItem[];\n  nextItemId: number;\n}\n\nexport type FilterStates = \"all\" | \"active\" | \"completed\";\n\nexport const FilterStates: FilterStates[] = [\"all\", \"active\", \"completed\"];\n\nexport const FILTERS = {\n  all: () => true,\n  active: (i: TodoItem) => i.completed == false,\n  completed: (i: TodoItem) => i.completed == true,\n};\n"
  },
  {
    "path": "starters/dev-server.ts",
    "content": "// DO NOT USE FOR PRODUCTION!!!\n// Internal Testing/Dev Server\n// DO NOT USE FOR PRODUCTION!!!\n\n/* eslint-disable no-console */\n\nimport type { NextFunction, Request, Response } from \"express\";\nimport express from \"express\";\nimport { build, type InlineConfig, type PluginOption } from \"vite\";\nimport { join, relative, resolve } from \"node:path\";\nimport {\n  readdirSync,\n  statSync,\n  unlinkSync,\n  rmSync,\n  existsSync,\n  readFileSync,\n} from \"node:fs\";\nimport type { QwikManifest } from \"@builder.io/qwik/optimizer\";\nimport type { Render, RenderToStreamOptions } from \"@builder.io/qwik/server\";\nimport type { PackageJSON } from \"../scripts/types.ts\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { getErrorHtml } from \"../packages/qwik-city/src/middleware/request-handler/error-handler.ts\";\n\nconst isWindows = process.platform === \"win32\";\n\n// map the file path to a url for windows only\nconst file = (filePath: string) => {\n  return isWindows ? pathToFileURL(filePath).toString() : filePath;\n};\n\n// Escape path for imports in windows\nconst escapeChars = (filePath: string) => {\n  return isWindows ? filePath.replace(/\\\\/g, \"\\\\\\\\\") : filePath;\n};\n\nconst app = express();\nconst port = parseInt(process.argv[process.argv.length - 1], 10) || 3300;\nconst address = `http://localhost:${port}/`;\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\nconst startersDir = __dirname;\nconst startersAppsDir = join(startersDir, \"apps\");\nconst appNames = readdirSync(startersAppsDir).filter(\n  (p) => statSync(join(startersAppsDir, p)).isDirectory() && p !== \"base\",\n);\n\nconst rootDir = resolve(__dirname, \"..\");\nconst packagesDir = resolve(rootDir, \"packages\");\nconst qwikCityMjs = join(packagesDir, \"qwik-city\", \"lib\", \"index.qwik.mjs\");\n\n/** Used when qwik-city server is enabled */\nconst qwikCityVirtualEntry = \"@city-ssr-entry\";\nconst entrySsrFileName = \"entry.ssr.tsx\";\nconst qwikCityNotFoundPaths = \"@qwik-city-not-found-paths\";\nconst qwikCityStaticPaths = \"@qwik-city-static-paths\";\n\nError.stackTraceLimit = 1000;\n\n// dev server builds ssr's the starter app on-demand (don't do this in production)\nconst cache = new Map<string, Promise<QwikManifest>>();\nasync function handleApp(req: Request, res: Response, next: NextFunction) {\n  try {\n    let url;\n    try {\n      url = new URL(req.url, address);\n    } catch {\n      res.status(404).send();\n      return;\n    }\n    if (existsSync(url.pathname)) {\n      const relPath = relative(startersAppsDir, url.pathname);\n      if (!relPath.startsWith(\".\")) {\n        url.pathname = relPath;\n      }\n    }\n    const paths = url.pathname.split(\"/\");\n    const appName = paths[1];\n    const appDir = join(startersAppsDir, appName);\n    if (!existsSync(appDir)) {\n      res.status(404).send(`❌ Invalid dev-server path: ${appDir}`);\n      return;\n    }\n\n    console.log(req.method, req.url, `[${appName} build/ssr]`);\n\n    const pkgPath = join(appDir, \"package.json\");\n    const pkgJson: PackageJSON = JSON.parse(readFileSync(pkgPath, \"utf-8\"));\n    const enableCityServer = !!pkgJson.__qwik__?.qwikCity;\n\n    let clientManifest = cache.get(appDir);\n    if (!clientManifest) {\n      clientManifest = buildApp(appDir, appName, enableCityServer);\n      cache.set(appDir, clientManifest);\n    }\n\n    const resolved = await clientManifest;\n    if (url.pathname.endsWith(\".js\")) {\n      res.set(\"Content-Type\", \"text/javascript\");\n    } else {\n      res.set(\"Content-Type\", \"text/html\");\n    }\n    if (enableCityServer) {\n      await cityApp(req, res, next, appDir);\n    } else {\n      await ssrApp(req, res, appName, appDir, resolved);\n      res.end();\n    }\n  } catch (e: any) {\n    console.error(e);\n    if (!res.headersSent) {\n      res.set(\"Content-Type\", \"text/plain; charset=utf-8\");\n      res.send(`❌ ${e.stack || e}`);\n    }\n  }\n}\n\nasync function buildApp(\n  appDir: string,\n  appName: string,\n  enableCityServer: boolean,\n) {\n  const optimizer = await import(\"@builder.io/qwik/optimizer\");\n  const appSrcDir = join(appDir, \"src\");\n  const appDistDir = join(appDir, \"dist\");\n  const appServerDir = join(appDir, \"server\");\n  const basePath = `/${appName}/`;\n  const isProd = appName.includes(\".prod\");\n\n  // always clean the build directory\n  removeDir(appDistDir);\n  removeDir(appServerDir);\n\n  let clientManifest: QwikManifest | undefined = undefined;\n  const plugins: PluginOption[] = [];\n  if (enableCityServer) {\n    // ssr entry existed in service folder, use dev plugin to\n    // 1. export router\n    // 2. set basePath\n    plugins.push({\n      name: \"devPlugin\",\n      resolveId(id) {\n        if (id.endsWith(qwikCityVirtualEntry)) {\n          return qwikCityVirtualEntry;\n        }\n        if (id === qwikCityStaticPaths || id === qwikCityNotFoundPaths) {\n          return \"./\" + id;\n        }\n      },\n      load(id) {\n        if (id.endsWith(qwikCityVirtualEntry)) {\n          return `import { createQwikCity } from '@builder.io/qwik-city/middleware/node';\nimport qwikCityPlan from '@qwik-city-plan';\nimport render from '${escapeChars(resolve(appSrcDir, \"entry.ssr\"))}';\nconst { router, notFound } = createQwikCity({\n  render,\n  qwikCityPlan,\n  base: '${basePath}build/',\n});\nexport {\n  router,\n  notFound\n}\n`;\n        }\n        if (id.endsWith(qwikCityStaticPaths)) {\n          return `export function isStaticPath(method, url){ return false; };`;\n        }\n        if (id.endsWith(qwikCityNotFoundPaths)) {\n          const notFoundHtml = getErrorHtml(404, \"Resource Not Found\");\n          return `export function getNotFound(){ return ${JSON.stringify(\n            notFoundHtml,\n          )}; };`;\n        }\n      },\n    });\n    const qwikCityVite = await import(\"@builder.io/qwik-city/vite\");\n\n    plugins.push(\n      qwikCityVite.qwikCity({\n        rewriteRoutes: [\n          {\n            paths: {\n              projects: \"projekte\",\n            },\n          },\n        ],\n      }) as PluginOption,\n    );\n  }\n\n  const getInlineConf = (extra?: InlineConfig): InlineConfig => ({\n    root: appDir,\n    mode: \"development\",\n    configFile: false,\n    base: basePath,\n    ...extra,\n    resolve: {\n      conditions: [\"development\"],\n      mainFields: [],\n    },\n  });\n\n  await build(\n    getInlineConf({\n      build: {\n        minify: false,\n      },\n      define: {\n        \"globalThis.qSerialize\": true,\n        \"globalThis.qDev\": !isProd,\n        \"globalThis.qInspector\": false,\n        \"globalThis.PORT\": port,\n      },\n      plugins: [\n        ...plugins,\n        optimizer.qwikVite({\n          /**\n           * normally qwik finds qwik-city via package.json but we don't want that\n           * because it causes it to try to lookup the special qwik city imports\n           * even when we're not actually importing qwik-city\n           */\n          disableVendorScan: true,\n          vendorRoots: enableCityServer ? [qwikCityMjs] : [],\n          entryStrategy: {\n            type: \"segment\",\n          },\n          client: {\n            manifestOutput(manifest) {\n              clientManifest = manifest;\n            },\n          },\n          experimental: [\"preventNavigate\", \"enableRequestRewrite\"],\n        }),\n      ],\n    }),\n  );\n\n  await build(\n    getInlineConf({\n      build: {\n        minify: false,\n        ssr: enableCityServer\n          ? qwikCityVirtualEntry\n          : resolve(appSrcDir, entrySsrFileName),\n      },\n      plugins: [\n        ...plugins,\n        optimizer.qwikVite({\n          experimental: [\"preventNavigate\", \"enableRequestRewrite\"],\n        }),\n      ],\n      define: {\n        \"globalThis.qDev\": !isProd,\n        \"globalThis.qInspector\": false,\n        \"globalThis.PORT\": port,\n      },\n    }),\n  );\n\n  return clientManifest!;\n}\n\nfunction removeDir(dir: string) {\n  try {\n    const items = readdirSync(dir);\n    const itemPaths = items.map((i) => join(dir, i));\n    itemPaths.forEach((itemPath) => {\n      if (statSync(itemPath).isDirectory()) {\n        removeDir(itemPath);\n      } else {\n        unlinkSync(itemPath);\n      }\n    });\n    rmSync(dir);\n  } catch (e) {\n    /**/\n  }\n}\n\nasync function cityApp(\n  req: Request,\n  res: Response,\n  next: NextFunction,\n  appDir: string,\n) {\n  const ssrPath = join(appDir, \"server\", `${qwikCityVirtualEntry}.js`);\n\n  const mod = await import(file(ssrPath));\n  const router: any = mod.router;\n  router(req, res, () => {\n    mod.notFound(req, res, () => {\n      next();\n    });\n  });\n}\n\nasync function ssrApp(\n  req: Request,\n  res: Response,\n  appName: string,\n  appDir: string,\n  manifest: QwikManifest,\n) {\n  const ssrPath = join(appDir, \"server\", \"entry.ssr.js\");\n  const mod = await import(file(ssrPath));\n  const render: Render = mod.default ?? mod.render;\n\n  // ssr the document\n  const base = `/${appName}/build/`;\n  const url = new URL(`${req.protocol}://${req.hostname}${req.url}`).href;\n\n  const opts: RenderToStreamOptions = {\n    stream: res,\n    manifest,\n    debug: true,\n    base,\n    serverData: {\n      url,\n    },\n  };\n  await render(opts);\n}\n\nfunction startersHomepage(_: Request, res: Response) {\n  res.set(\"Content-Type\", \"text/html; charset=utf-8\");\n  res.send(`<!-- Some comment --><!DOCTYPE html>\n  <html>\n    <head>\n      <title>Starters Dev Server</title>\n      <style>\n        body {\n          font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;\n          line-height: 1.5;\n        }\n        a { color: #4340C4; }\n        a:hover { text-decoration: none; }\n        h1 { margin: 5px 0; }\n      </style>\n    </head>\n    <body>\n      <h1>⚡️ Starters Dev Server ⚡️</h1>\n      <ul>\n        ${appNames.map((a) => `<li><a href=\"/${a}/\">${a}</a></li>`).join(\"\")}\n      </ul>\n    </body>\n  </html>\n  `);\n}\n\nfunction favicon(_: Request, res: Response) {\n  const path = join(startersAppsDir, \"base\", \"public\", \"favicon.svg\");\n  res.sendFile(path);\n}\n\nasync function main() {\n  await patchGlobalFetch();\n\n  const partytownPath = resolve(\n    startersDir,\n    \"..\",\n    \"node_modules\",\n    \"@builder.io\",\n    \"partytown\",\n    \"lib\",\n  );\n  app.use(`/~partytown`, express.static(partytownPath));\n\n  appNames.forEach((appName) => {\n    const buildPath = join(startersAppsDir, appName, \"dist\", appName);\n    app.use(`/${appName}`, express.static(buildPath));\n\n    const publicPath = join(startersAppsDir, appName, \"public\");\n    app.use(`/${appName}`, express.static(publicPath));\n  });\n\n  app.get(\"/\", startersHomepage);\n  app.get(\"/favicon*\", favicon);\n  app.all(\"/*\", handleApp);\n\n  const server = app.listen(port, () => {\n    console.log(`Starter Dir: ${startersDir}`);\n    console.log(`Dev Server: ${address}\\n`);\n\n    console.log(`Starters:`);\n    appNames.forEach((appName) => {\n      console.log(`  ${address}${appName}/`);\n    });\n    console.log(``);\n  });\n\n  process.on(\"SIGTERM\", () => server.close());\n}\n\nmain();\n\nasync function patchGlobalFetch() {\n  if (\n    typeof global !== \"undefined\" &&\n    typeof globalThis.fetch !== \"function\" &&\n    typeof process !== \"undefined\" &&\n    process.versions.node\n  ) {\n    if (!globalThis.fetch) {\n      const { fetch, Headers, Request, Response, FormData } = await import(\n        \"undici\"\n      );\n      globalThis.fetch = fetch as any;\n      globalThis.Headers = Headers as any;\n      globalThis.Request = Request as any;\n      globalThis.Response = Response as any;\n      globalThis.FormData = FormData as any;\n    }\n  }\n}\n"
  },
  {
    "path": "starters/e2e/e2e.attributes.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"attributes\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/attributes\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  function tests() {\n    test(\"initial render is correctly\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const label = page.locator(\"#label\");\n      const svg = page.locator(\"#svg\");\n\n      const renders = page.locator(\"#renders\");\n\n      await expect(input).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(input).toHaveAttribute(\"aria-label\", \"even\");\n      await expect(input).toHaveAttribute(\"tabindex\", \"-1\");\n      await expect(input).toHaveAttribute(\"aria-required\", \"false\");\n      await expect(input).toHaveAttribute(\"draggable\", \"false\");\n      await expect(input).toHaveAttribute(\"spellcheck\", \"false\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(input).not.hasAttribute(\"title\");\n\n      await expect(label).toHaveAttribute(\"for\", \"even\");\n      await expect(label).toHaveAttribute(\"form\", \"my-form\");\n      await expect(label).not.hasAttribute(\"title\");\n\n      await expect(svg).toHaveAttribute(\"width\", \"15\");\n      await expect(svg).toHaveAttribute(\"height\", \"15\");\n      await expect(svg).toHaveAttribute(\n        \"preserveAspectRatio\",\n        \"xMidYMin slice\",\n      );\n      await expect(svg).toHaveClass(\"is-svg\");\n      await expect(svg).toHaveAttribute(\"aria-hidden\", \"true\");\n\n      await expect(renders).toHaveText(\"1\");\n    });\n\n    test(\"should type and reflect changes\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const svg = page.locator(\"#svg\");\n      const inputCopy = page.locator(\"#input-copy\");\n      const inputValue = page.locator(\"#input-value\");\n      const stuffBtn = page.locator(\"#stuff\");\n      const renders = page.locator(\"#renders\");\n\n      await expect(inputCopy).toHaveJSProperty(\"value\", \"\");\n      await input.type(\"Hello\");\n      await expect(input).toHaveJSProperty(\"value\", \"Hello\");\n      await expect(inputCopy).toHaveJSProperty(\"value\", \"Hello\");\n      await expect(inputValue).toHaveText(\"Hello\");\n      await expect(renders).toHaveText(\"1\");\n\n      await stuffBtn.click();\n      await expect(inputCopy).toHaveJSProperty(\"value\", \"Hello\");\n      await expect(inputValue).toHaveText(\"Hello\");\n      await expect(renders).toHaveText(\"2\");\n\n      await input.type(\"Bye\");\n      await expect(inputCopy).toHaveJSProperty(\"value\", \"ByeHello\");\n      await expect(inputValue).toHaveText(\"ByeHello\");\n      await expect(renders).toHaveText(\"2\");\n\n      await expect(svg).toHaveAttribute(\"width\", \"15\");\n      await expect(svg).toHaveAttribute(\"height\", \"15\");\n      await expect(svg).toHaveAttribute(\n        \"preserveAspectRatio\",\n        \"xMidYMin slice\",\n      );\n      await expect(svg).toHaveClass(\"is-svg\");\n      await expect(svg).toHaveAttribute(\"aria-hidden\", \"true\");\n    });\n\n    test(\"should update aria-label\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const renders = page.locator(\"#renders\");\n      const countBtn = page.locator(\"#count\");\n      await countBtn.click();\n\n      await expect(input).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(input).toHaveAttribute(\"aria-label\", \"odd\");\n      await expect(input).toHaveAttribute(\"tabindex\", \"-1\");\n      await expect(input).toHaveAttribute(\"aria-required\", \"false\");\n      await expect(input).toHaveAttribute(\"draggable\", \"false\");\n      await expect(input).toHaveAttribute(\"spellcheck\", \"false\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(renders).toHaveText(\"1\");\n    });\n\n    test(\"should update title\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const label = page.locator(\"#label\");\n\n      const renders = page.locator(\"#renders\");\n      const countBtn = page.locator(\"#title\");\n      await countBtn.click();\n\n      await expect(input).toHaveAttribute(\"title\", \"some title\");\n      await expect(label).toHaveAttribute(\"title\", \"some title\");\n      await expect(renders).toHaveText(\"1\");\n\n      await countBtn.click();\n      await expect(input).not.toHaveAttribute(\"title\", \"some title\");\n      await expect(input).not.hasAttribute(\"title\");\n      await expect(label).not.hasAttribute(\"title\");\n      await expect(renders).toHaveText(\"1\");\n    });\n\n    test(\"should update aria-hidden\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const svg = page.locator(\"#svg\");\n      const renders = page.locator(\"#renders\");\n      const countBtn = page.locator(\"#aria-hidden\");\n      await countBtn.click();\n\n      await expect(input).toHaveAttribute(\"aria-hidden\", \"false\");\n      await expect(input).toHaveAttribute(\"aria-label\", \"even\");\n      await expect(input).toHaveAttribute(\"tabindex\", \"-1\");\n      await expect(input).toHaveAttribute(\"aria-required\", \"false\");\n      await expect(input).toHaveAttribute(\"draggable\", \"false\");\n      await expect(input).toHaveAttribute(\"spellcheck\", \"false\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(svg).toHaveAttribute(\"aria-hidden\", \"false\");\n      await expect(renders).toHaveText(\"1\");\n    });\n\n    test(\"should update required\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const renders = page.locator(\"#renders\");\n      const countBtn = page.locator(\"#required\");\n      await countBtn.click();\n\n      await expect(input).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(input).toHaveAttribute(\"aria-label\", \"even\");\n      await expect(input).toHaveAttribute(\"tabindex\", \"-1\");\n      await expect(input).toHaveAttribute(\"aria-required\", \"true\");\n      await expect(input).toHaveAttribute(\"draggable\", \"true\");\n      await expect(input).toHaveAttribute(\"spellcheck\", \"true\");\n      await expect(input).hasAttribute(\"required\");\n      await expect(renders).toHaveText(\"1\");\n    });\n\n    test(\"should hide all attributes\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const renders = page.locator(\"#renders\");\n\n      const requiredBtn = page.locator(\"#required\");\n      await requiredBtn.click();\n\n      const countBtn = page.locator(\"#hide\");\n      await countBtn.click();\n      await expect(input).not.toHaveAttribute(\"aria-hidden\", \"true\");\n\n      await expect(input).not.hasAttribute(\"aria-hidden\");\n      await expect(input).not.hasAttribute(\"aria-label\");\n      await expect(input).not.hasAttribute(\"tabindex\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(input).not.hasAttribute(\"aria-required\");\n      await expect(input).not.hasAttribute(\"draggable\");\n      await expect(input).not.hasAttribute(\"spellcheck\");\n      await expect(renders).toHaveText(\"2\");\n    });\n\n    test(\"should toggle attributes several times\", async ({ page }) => {\n      const input = page.locator(\"#input\");\n      const label = page.locator(\"#label\");\n      const svg = page.locator(\"#svg\");\n\n      const renders = page.locator(\"#renders\");\n      const countBtn = page.locator(\"#hide\");\n\n      await countBtn.click();\n      await expect(input).not.toHaveAttribute(\"aria-hidden\", \"true\");\n\n      await expect(input).not.hasAttribute(\"aria-hidden\");\n      await expect(input).not.hasAttribute(\"aria-label\");\n      await expect(input).not.hasAttribute(\"tabindex\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(input).not.hasAttribute(\"aria-required\");\n      await expect(input).not.hasAttribute(\"draggable\");\n      await expect(input).not.hasAttribute(\"spellcheck\");\n      await expect(label).not.hasAttribute(\"for\");\n      await expect(label).not.hasAttribute(\"form\");\n      await expect(svg).not.hasAttribute(\"width\");\n      await expect(svg).not.hasAttribute(\"height\");\n      await expect(svg).not.hasAttribute(\"preserveAspectRatio\");\n      await expect(svg).toHaveClass(\"\");\n      await expect(svg).not.hasAttribute(\"aria-hidden\");\n\n      await expect(renders).toHaveText(\"2\");\n\n      await countBtn.click();\n\n      await expect(input).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(input).toHaveAttribute(\"aria-label\", \"even\");\n      await expect(input).toHaveAttribute(\"tabindex\", \"-1\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(input).toHaveAttribute(\"aria-required\", \"false\");\n      await expect(input).toHaveAttribute(\"draggable\", \"false\");\n      await expect(input).toHaveAttribute(\"spellcheck\", \"false\");\n\n      await expect(label).toHaveAttribute(\"for\", \"even\");\n      await expect(label).toHaveAttribute(\"form\", \"my-form\");\n      await expect(svg).toHaveAttribute(\"width\", \"15\");\n      await expect(svg).toHaveAttribute(\"height\", \"15\");\n      await expect(svg).toHaveAttribute(\n        \"preserveAspectRatio\",\n        \"xMidYMin slice\",\n      );\n      await expect(svg).toHaveClass(\"is-svg\");\n      await expect(svg).toHaveAttribute(\"aria-hidden\", \"true\");\n\n      await expect(renders).toHaveText(\"3\");\n\n      await countBtn.click();\n      await expect(svg).not.toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(input).not.hasAttribute(\"aria-hidden\");\n      await expect(input).not.hasAttribute(\"aria-label\");\n      await expect(input).not.hasAttribute(\"tabindex\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(input).not.hasAttribute(\"aria-required\");\n      await expect(input).not.hasAttribute(\"draggable\");\n      await expect(input).not.hasAttribute(\"spellcheck\");\n      await expect(label).not.hasAttribute(\"for\");\n      await expect(label).not.hasAttribute(\"form\");\n      await expect(svg).not.hasAttribute(\"width\");\n      await expect(svg).not.hasAttribute(\"height\");\n      await expect(svg).not.hasAttribute(\"preserveAspectRatio\");\n      await expect(svg).not.hasAttribute(\"aria-hidden\");\n      await expect(svg).toHaveClass(\"\");\n      await expect(renders).toHaveText(\"4\");\n\n      await countBtn.click();\n\n      await expect(input).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(input).toHaveAttribute(\"aria-label\", \"even\");\n      await expect(input).toHaveAttribute(\"tabindex\", \"-1\");\n      await expect(input).not.hasAttribute(\"required\");\n      await expect(input).toHaveAttribute(\"aria-required\", \"false\");\n      await expect(input).toHaveAttribute(\"draggable\", \"false\");\n      await expect(input).toHaveAttribute(\"spellcheck\", \"false\");\n      await expect(label).toHaveAttribute(\"for\", \"even\");\n      await expect(label).toHaveAttribute(\"form\", \"my-form\");\n      await expect(svg).toHaveAttribute(\"width\", \"15\");\n      await expect(svg).toHaveAttribute(\"height\", \"15\");\n      await expect(svg).toHaveAttribute(\n        \"preserveAspectRatio\",\n        \"xMidYMin slice\",\n      );\n      await expect(svg).toHaveClass(\"is-svg\");\n      await expect(svg).toHaveAttribute(\"aria-hidden\", \"true\");\n\n      await expect(renders).toHaveText(\"5\");\n    });\n\n    test(\"issue 3622\", async ({ page }) => {\n      const select = page.locator(\"#issue-3622-result\");\n      await expect(select).toHaveValue(\"option1\");\n    });\n\n    test(\"issue 4718 (null)\", async ({ page }) => {\n      const button = page.locator(\"#issue-4718-null-result\");\n\n      await expect(button).toHaveAttribute(\"data-works\", \"some value\");\n      await expect(button).toHaveAttribute(\"aria-label\", \"some value\");\n      await expect(button).toHaveAttribute(\"title\", \"some value\");\n\n      await button.click();\n\n      await expect(button).toHaveClass(\"moop\");\n      await expect(button).not.hasAttribute(\"data-works\");\n      await expect(button).not.hasAttribute(\"aria-label\");\n      await expect(button).not.hasAttribute(\"title\");\n    });\n\n    test(\"issue 4718 (undefined)\", async ({ page }) => {\n      const button = page.locator(\"#issue-4718-undefined-result\");\n\n      await expect(button).toHaveAttribute(\"data-works\", \"some value\");\n      await expect(button).toHaveAttribute(\"aria-label\", \"some value\");\n      await expect(button).toHaveAttribute(\"title\", \"some value\");\n\n      await button.click();\n\n      await expect(button).toHaveClass(\"moop\");\n      await expect(button).not.hasAttribute(\"data-works\");\n      await expect(button).not.hasAttribute(\"aria-label\");\n      await expect(button).not.hasAttribute(\"title\");\n    });\n  }\n\n  tests();\n\n  test.describe(\"client rerender\", () => {\n    test.beforeEach(async ({ page }) => {\n      const toggleRender = page.locator(\"#force-rerender\");\n      const renderCount = page.locator(\"#renderCount\");\n      const v = Number(await toggleRender.getAttribute(\"data-v\"));\n\n      expect(v).toBe(0);\n      await expect(renderCount).toHaveText(`Render ${v}`);\n      await toggleRender.click();\n      await expect(renderCount).toHaveText(`Render ${v + 1}`);\n    });\n    tests();\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.build-variables.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"build-variables\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/build-variables\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should have correct value\", async ({ page }) => {\n    const result = page.locator(\"#build-variables-result\");\n    const button = page.locator(\"#build-variables-button\");\n\n    await expect(result).toHaveText(\n      '{\"isServer\":true,\"isBrowser\":false,\"isDev\":true,\"buildIsServer\":true,\"buildIsBrowser\":false,\"buildIsDev\":true,\"count\":0}',\n    );\n    await button.click();\n    await expect(result).toHaveText(\n      '{\"isServer\":false,\"isBrowser\":true,\"isDev\":true,\"buildIsServer\":false,\"buildIsBrowser\":true,\"buildIsDev\":true,\"count\":1}',\n    );\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.computed.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"slot\", () => {\n  function tests() {\n    test(\"should implement basic computed values\", async ({ page }) => {\n      const result = page.locator(\".result\");\n      const increment = page.locator(\"#increment\");\n\n      await expect(result).toHaveText([\n        \"count: 0\",\n        \"double: 0\",\n        \"plus3: 3\",\n        \"triple: 9\",\n        \"sum: 12\",\n      ]);\n\n      await increment.click();\n      await expect(result).toHaveText([\n        \"count: 1\",\n        \"double: 2\",\n        \"plus3: 5\",\n        \"triple: 15\",\n        \"sum: 22\",\n      ]);\n\n      await increment.click();\n      await expect(result).toHaveText([\n        \"count: 2\",\n        \"double: 4\",\n        \"plus3: 7\",\n        \"triple: 21\",\n        \"sum: 32\",\n      ]);\n    });\n\n    test(\"issue 3482\", async ({ page }) => {\n      const button = page.locator(\"#issue-3482-button\");\n      const div = page.locator(\"#issue-3482-div\");\n      const classEl = page.locator(\"#issue-3482-class\");\n      const datanuEl = page.locator(\"#issue-3482-datanu\");\n      await expect(div).toHaveAttribute(\"class\", \"class-0\");\n      await expect(div).toHaveAttribute(\"data-nu\", \"0\");\n      await expect(classEl).toHaveText(\"class: class-0\");\n      await expect(datanuEl).toHaveText(\"data-nu: 0\");\n\n      await button.click();\n      await expect(div).toHaveAttribute(\"class\", \"class-1\");\n      await expect(div).toHaveAttribute(\"data-nu\", \"1\");\n      await expect(classEl).toHaveText(\"class: class-1\");\n      await expect(datanuEl).toHaveText(\"data-nu: 1\");\n\n      await button.click();\n      await expect(div).toHaveAttribute(\"class\", \"class-2\");\n      await expect(div).toHaveAttribute(\"data-nu\", \"2\");\n      await expect(classEl).toHaveText(\"class: class-2\");\n      await expect(datanuEl).toHaveText(\"data-nu: 2\");\n    });\n\n    test(\"issue 3488\", async ({ page }) => {\n      const result = page.locator(\"#issue-3488-result\");\n      const button = page.locator(\"#issue-3488-button\");\n      await expect(result).toHaveText(\"class-0\");\n      await button.click();\n      await expect(result).toHaveText(\"class-1\");\n      await button.click();\n      await expect(result).toHaveText(\"class-2\");\n    });\n\n    test(\"dirty tasks\", async ({ page }) => {\n      const result = page.locator(\"#issue-5738-result\");\n      await expect(result).toHaveText(\"Calc: 2\");\n    });\n  }\n\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/computed\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  tests();\n\n  test.describe(\"client rerender\", () => {\n    test.beforeEach(async ({ page }) => {\n      const rerender = page.locator(\"#rerender\");\n      await rerender.click();\n      await page.waitForTimeout(100);\n    });\n    tests();\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.containers.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"container\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/container\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should handle counter\", async ({ page }) => {\n    const button = page.locator(\"button\");\n\n    await expect(button).toHaveText(\"0\");\n    await button.click();\n    await expect(button).toHaveText(\"1\");\n  });\n\n  test(\"should handle inner counter\", async ({ page }) => {\n    const container = page.locator(\".inline-container container\");\n    const anchor = container.locator(\"a\");\n\n    await expect(anchor).toHaveText(\"1 / 1\");\n    await anchor.click();\n    await expect(anchor).toHaveText(\"2 / 3\");\n  });\n\n  test(\"should handle shadow-dom counter\", async ({ page }) => {\n    const shadowHost = page.locator(\"[q\\\\:shadowroot]\");\n    const anchor = shadowHost.locator(\"a\");\n\n    await expect(anchor).toHaveText(\"1 / 1\");\n    await anchor.click();\n    await expect(anchor).toHaveText(\"2 / 3\");\n  });\n\n  test(\"dynamic preload\", async ({ page }) => {\n    const preloaderScript = page.locator(`script[q\\\\:type='link-js']`).first();\n    await expect(preloaderScript).toBeDefined();\n    // We don't have a way to check if modules are preloaded, because the links go away\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.context.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"context\", () => {\n  function tests() {\n    test(\"should load\", async ({ page }) => {\n      const level2State1 = page.locator(\".level2-state1\");\n      const level2State2 = page.locator(\".level2-state2\");\n      const level2SSlot = page.locator(\".level2-slot\");\n\n      const btnRootIncrement1 = page.locator(\".root-increment1\");\n      const btnRootIncrement2 = page.locator(\".root-increment2\");\n      const btnLevel2Increment = page.locator(\".level2-increment3\").nth(0);\n      const btnLevel2Increment2 = page.locator(\".level2-increment3\").nth(1);\n\n      expect(await level2State1.allTextContents()).toEqual([\n        \"ROOT / state1 = 0\",\n        \"ROOT / state1 = 0\",\n      ]);\n      expect(await level2State2.allTextContents()).toEqual([\n        \"ROOT / state2 = 0\",\n        \"ROOT / state2 = 0\",\n      ]);\n      expect(await level2SSlot.allTextContents()).toEqual([\n        \"bar = 0\",\n        \"bar = 0\",\n      ]);\n\n      await btnRootIncrement1.click();\n      await expect(level2State1.first()).toHaveText(\"ROOT / state1 = 1\");\n\n      expect(await level2State1.allTextContents()).toEqual([\n        \"ROOT / state1 = 1\",\n        \"ROOT / state1 = 1\",\n      ]);\n      expect(await level2State2.allTextContents()).toEqual([\n        \"ROOT / state2 = 0\",\n        \"ROOT / state2 = 0\",\n      ]);\n      expect(await level2SSlot.allTextContents()).toEqual([\n        \"bar = 0\",\n        \"bar = 0\",\n      ]);\n      await btnRootIncrement2.click();\n      await expect(level2State2.first()).toHaveText(\"ROOT / state2 = 1\");\n\n      expect(await level2State1.allTextContents()).toEqual([\n        \"ROOT / state1 = 1\",\n        \"ROOT / state1 = 1\",\n      ]);\n      expect(await level2State2.allTextContents()).toEqual([\n        \"ROOT / state2 = 1\",\n        \"ROOT / state2 = 1\",\n      ]);\n      expect(await level2SSlot.allTextContents()).toEqual([\n        \"bar = 0\",\n        \"bar = 0\",\n      ]);\n      await btnLevel2Increment.click();\n      await btnLevel2Increment.click();\n      await btnLevel2Increment2.click();\n\n      const level3State1 = page.locator(\".level3-state1\");\n      const level3State2 = page.locator(\".level3-state2\");\n      const level3State3 = page.locator(\".level3-state3\");\n      const level3Slot = page.locator(\".level3-slot\");\n\n      await expect(level3State1.first()).toHaveText(\"Level2 / state1 = 0\");\n      expect(await level2State1.allTextContents()).toEqual([\n        \"ROOT / state1 = 1\",\n        \"ROOT / state1 = 1\",\n      ]);\n      expect(await level2State2.allTextContents()).toEqual([\n        \"ROOT / state2 = 1\",\n        \"ROOT / state2 = 1\",\n      ]);\n      expect(await level2SSlot.allTextContents()).toEqual([\n        \"bar = 0\",\n        \"bar = 0\",\n      ]);\n\n      expect(await level3State1.allTextContents()).toEqual([\n        \"Level2 / state1 = 0\",\n        \"Level2 / state1 = 0\",\n        \"Level2 / state1 = 0\",\n      ]);\n      expect(await level3State2.allTextContents()).toEqual([\n        \"ROOT / state2 = 1\",\n        \"ROOT / state2 = 1\",\n        \"ROOT / state2 = 1\",\n      ]);\n      expect(await level3State3.allTextContents()).toEqual([\n        \"Level2 / state3 = 2\",\n        \"Level2 / state3 = 2\",\n        \"Level2 / state3 = 1\",\n      ]);\n      expect(await level3Slot.allTextContents()).toEqual([\n        \"bar = 0\",\n        \"bar = 0\",\n        \"bar = 0\",\n      ]);\n    });\n\n    test(\"issue 1971\", async ({ page }) => {\n      const value = page.locator(\"#issue1971-value\");\n      await expect(value).toHaveText(\"Value: hello!\");\n    });\n\n    test(\"issue 2087\", async ({ page }) => {\n      const btn1 = page.locator(\"#issue2087_btn1\");\n      const btn2 = page.locator(\"#issue2087_btn2\");\n      const rootA = page.locator(\"#issue2087_symbol_RootA\");\n      const rootB = page.locator(\"#issue2087_symbol_RootB\");\n      const nestedA = page.locator(\"#issue2087_symbol_NestedA\");\n      const nestedB = page.locator(\"#issue2087_symbol_NestedB\");\n\n      // Initial state\n      await expect(rootA).toHaveText(\"Symbol RootA, context value: yes\");\n      await expect(rootB).not.toBeVisible();\n      await expect(nestedA).toHaveText(\"Symbol NestedA, context value: yes\");\n      await expect(nestedB).not.toBeVisible();\n\n      // Click a\n      await btn1.click();\n      await expect(rootB).toBeVisible();\n      await expect(rootA).toHaveText(\"Symbol RootA, context value: yes\");\n      await expect(rootB).toHaveText(\"Symbol RootB, context value: yes\");\n\n      // Click b\n      await btn2.click();\n      await expect(nestedB).toBeVisible();\n      await expect(nestedA).toHaveText(\"Symbol NestedA, context value: yes\");\n      await expect(nestedB).toHaveText(\"Symbol NestedB, context value: yes\");\n    });\n\n    test(\"issue 2894\", async ({ page }) => {\n      const btn = page.locator(\"#issue2894-button\");\n      const value = page.locator(\"#issue2894-value\");\n\n      await expect(value).toHaveText(\"Value: bar\");\n      await expect(value).not.toBeVisible();\n\n      await btn.click();\n\n      await expect(value).toHaveText(\"Value: bar\");\n      await expect(value).toBeVisible();\n    });\n\n    test(\"issue 5356\", async ({ page }) => {\n      const btn1 = page.locator(\"#issue5356-button-1\");\n      const btn2 = page.locator(\"#issue5356-button-2\");\n      const child1 = page.locator(\"#issue5356-child-1\");\n      const child2 = page.locator(\"#issue5356-child-2\");\n\n      await expect(child1).toContainText(\"Child 1, active: true\");\n      await expect(child2).toContainText(\"Child 2, active: false\");\n\n      await btn2.click();\n\n      await expect(child1).toContainText(\"Child 1, active: false\");\n      await expect(child2).toContainText(\"Child 2, active: true\");\n\n      await btn1.click();\n\n      await expect(child1).toContainText(\"Child 1, active: true\");\n      await expect(child2).toContainText(\"Child 2, active: false\");\n    });\n\n    test(\"issue 5793 scalar context values\", async ({ page }) => {\n      const value = page.locator(\"#issue5793-value\");\n\n      await expect(value).toHaveText(\"yes\");\n    });\n  }\n\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/context\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n  tests();\n\n  test.describe(\"client rerender\", () => {\n    test.beforeEach(async ({ page }) => {\n      const rerender = page.locator(\"#btn-rerender\");\n      await rerender.click();\n    });\n    tests();\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.effect-client.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"effect-client\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/effect-client\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should load\", async ({ page }) => {\n    const container = page.locator(\"#container\");\n    const counter = page.locator(\"#counter\");\n    const msg = page.locator(\"#msg\");\n    const msgEager = page.locator(\"#eager-msg\");\n    const msgClientSide1 = page.locator(\"#client-side-msg-1\");\n    const msgClientSide2 = page.locator(\"#client-side-msg-2\");\n    const msgClientSide3 = page.locator(\"#client-side-msg-3\");\n\n    await expect(container).not.hasAttribute(\"data-effect\");\n    await expect(counter).toHaveText(\"0\");\n    await expect(msg).toHaveText(\"empty\");\n    await expect(msgEager).toHaveText(\"run\");\n    await expect(msgClientSide1).toHaveText(\"run\");\n    await expect(msgClientSide2).toHaveText(\"run\");\n    await expect(msgClientSide3).toHaveText(\"run\");\n\n    await counter.scrollIntoViewIfNeeded();\n\n    await expect(container).toHaveAttribute(\"data-effect\", \"true\");\n    await expect(counter).toHaveText(\"10\");\n    await expect(msg).toHaveText(\"run\");\n\n    await expect(container).toHaveAttribute(\"data-effect\", \"true\");\n    await expect(counter).toHaveText(\"11\");\n    await expect(msg).toHaveText(\"run\");\n  });\n\n  test(\"issue 1717\", async ({ page }) => {\n    const value1 = page.locator(\"#issue-1717-value1\");\n    const value2 = page.locator(\"#issue-1717-value2\");\n    const meta = page.locator(\"#issue-1717-meta\");\n    await expect(value1).toHaveText(\"value 1\");\n    await expect(value2).toHaveText(\"value 2\");\n    await expect(meta).toHaveText(\"Sub: 10 Renders: 1\");\n  });\n\n  test(\"issue 2015\", async ({ page }) => {\n    const order = page.locator(\"#issue-2015-order\");\n    await expect(order).toHaveText(\n      \"Order: start 1 start 2 start 3 finish 1 finish 2 finish 3\",\n    );\n  });\n\n  test(\"issue 1955\", async ({ page }) => {\n    const results = page.locator(\"#issue-1955-results\");\n    await expect(results).toHaveText(\"run\");\n  });\n\n  test(\"cleanup\", async ({ page }) => {\n    const counter = page.locator(\"#cleanup-effects-button\");\n    const nuCleanups = page.locator(\"#cleanup-effects-count\");\n    await expect(nuCleanups).toHaveText(\"0\");\n    await counter.click();\n    await expect(nuCleanups).toHaveText(\"1\");\n    await counter.click();\n    await expect(nuCleanups).toHaveText(\"2\");\n  });\n\n  test(\"issue 4432\", async ({ page }) => {\n    const button = page.locator(\"#issue-4432-button\");\n    const logs = page.locator(\"#issue-4432-logs\");\n    await expect(logs).toHaveText(\"VisibleTask ChildA /\\n\");\n    await button.click();\n    await expect(logs).toHaveText(\n      \"VisibleTask ChildA /\\nCleanup ChildA /other\\n\",\n    );\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.events.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"events\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/events\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      // console.log(msg.type(), msg.text());\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should rerender correctly\", async ({ page }) => {\n    const btnWrapped = page.locator(\"#btn-wrapped\");\n    const btnTransparent = page.locator(\"#btn-transparent\");\n    const contentTransparent = page.locator(\"#count-transparent\");\n    const countWrapped = page.locator(\"#count-wrapped\");\n\n    await expect(contentTransparent).toHaveText(\"countTransparent: 0\");\n    await expect(countWrapped).toHaveText(\"countWrapped: 0\");\n    await expect(btnWrapped).toHaveText(\"Wrapped 0\");\n\n    // Click wrapped\n    await btnWrapped.click();\n    await expect(countWrapped).toHaveText(\"countWrapped: 1\");\n    await expect(btnWrapped).toHaveText(\"Wrapped 1\");\n    await expect(contentTransparent).toHaveText(\"countTransparent: 0\");\n\n    // Click wrapped\n    await btnWrapped.click();\n    await expect(countWrapped).toHaveText(\"countWrapped: 2\");\n    await expect(btnWrapped).toHaveText(\"Wrapped 2\");\n    await expect(contentTransparent).toHaveText(\"countTransparent: 0\");\n\n    // Click transparent\n    await btnTransparent.click();\n    await expect(contentTransparent).toHaveText(\"countTransparent: 1\");\n    await expect(countWrapped).toHaveText(\"countWrapped: 2\");\n    await expect(btnWrapped).toHaveText(\"Wrapped 2\");\n\n    // Click transparent\n    await btnTransparent.click();\n    await expect(contentTransparent).toHaveText(\"countTransparent: 2\");\n    await expect(countWrapped).toHaveText(\"countWrapped: 2\");\n    await expect(btnWrapped).toHaveText(\"Wrapped 2\");\n  });\n\n  test(\"should prevent defaults and bubbling\", async ({ page }) => {\n    const prevented1 = page.locator(\"#prevent-default-1\");\n    const prevented2 = page.locator(\"#prevent-default-2\");\n    const countWrapped = page.locator(\"#count-anchor\");\n\n    await prevented1.click();\n    await expect(countWrapped).toHaveText(\"countAnchor: 0\");\n\n    await prevented2.click();\n    await expect(countWrapped).toHaveText(\"countAnchor: 1\");\n  });\n\n  test(`GIVEN \"stoppropagation\" is set as a attribute \n        THEN it should stop propagation`, async ({ page }) => {\n    const stoppedPropagationButton = page.locator(\"#stop-propagation\");\n\n    const countPropagation = page.locator(\"#count-propagation\");\n    await expect(countPropagation).toHaveText(\"countPropagationStopped: 0\");\n\n    await stoppedPropagationButton.click();\n\n    await expect(countPropagation).toHaveText(\"countPropagationStopped: 1\");\n  });\n\n  test(\"issue 3948\", async ({ page }) => {\n    const always = page.locator(\"#issue-3948-always\");\n    const toggle = page.locator(\"#issue-3948-toggle\");\n    const html = page.locator(\"html\");\n    await expect(always).toHaveText(\"always count: 0\");\n\n    await html.click();\n    await expect(always).toHaveText(\"always count: 1\");\n    await toggle.click();\n    const conditional = page.locator(\"#issue-3948-conditional\");\n    await expect(conditional).toHaveText(\"conditional count: 0\");\n\n    await html.click();\n    await expect(always).toHaveText(\"always count: 3\");\n    await expect(conditional).toHaveText(\"conditional count: 1\");\n\n    await html.click();\n    await expect(always).toHaveText(\"always count: 4\");\n    await expect(conditional).toHaveText(\"conditional count: 2\");\n  });\n});\n\ntest.describe(\"broadcast-events\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/broadcast-events\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  function tests() {\n    test(\"should render correctly\", async ({ page }) => {\n      const document = page.locator(\"p.document\");\n      const document2 = page.locator(\"p.document2\");\n\n      const window = page.locator(\"p.window\");\n      const window2 = page.locator(\"p.window2\");\n\n      const self = page.locator(\"p.self\");\n      const self2 = page.locator(\"p.self2\");\n\n      await expect(document).toHaveText(\"(Document: x: 0, y: 0)\");\n      await expect(document2).toHaveText(\"(Document2: x: 0, y: 0)\");\n      await expect(window).toHaveText(\"(Window: x: 0, y: 0)\");\n      await expect(window2).toHaveText(\"(Window2: x: 0, y: 0)\");\n      await expect(self).toHaveText(\"(Host: x: 0, y: 0, inside: false)\");\n      await expect(self2).toHaveText(\"(Host2: x: 0, y: 0)\");\n\n      await page.mouse.move(100, 50);\n\n      await expect(document).toHaveText(\"(Document: x: 100, y: 50)\");\n      await expect(document2).toHaveText(\"(Document2: x: 100, y: 50)\");\n      await expect(window).toHaveText(\"(Window: x: 100, y: 50)\");\n      await expect(window2).toHaveText(\"(Window2: x: 100, y: 50)\");\n      await expect(self).toHaveText(\"(Host: x: 0, y: 0, inside: false)\");\n      await expect(self2).toHaveText(\"(Host2: x: 0, y: 0)\");\n\n      await page.mouse.move(100, 300);\n\n      await expect(document).toHaveText(\"(Document: x: 100, y: 300)\");\n      await expect(document2).toHaveText(\"(Document2: x: 100, y: 300)\");\n      await expect(window).toHaveText(\"(Window: x: 100, y: 300)\");\n      await expect(window2).toHaveText(\"(Window2: x: 100, y: 300)\");\n      await expect(self).toHaveText(\"(Host: x: 100, y: 300, inside: true)\");\n      await expect(self2).toHaveText(\"(Host2: x: 100, y: 300)\");\n    });\n  }\n\n  tests();\n\n  test.describe(\"client rerender\", () => {\n    test.beforeEach(async ({ page }) => {\n      const toggleRender = page.locator(\"#btn-toggle-render\");\n      await toggleRender.click();\n      await page.waitForTimeout(100);\n    });\n    tests();\n  });\n});\n\ntest.describe(\"events client side\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/events-client\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should progressively listen to new events\", async ({ page }) => {\n    const link = page.locator(\"#link\");\n    const input = page.locator(\"#input\");\n\n    // it should do nothing, no navigate\n    await link.click();\n\n    await input.focus();\n\n    const div = page.locator(\"#div\");\n    await expect(div).toHaveText(\"Text: \");\n    await expect(div).toHaveClass(\"\");\n\n    await input.fill(\"Some text\");\n    await expect(div).toHaveText(\"Text: Some text\");\n    await expect(div).toHaveClass(\"\");\n\n    await div.hover();\n    await expect(div).toHaveClass(\"isOver\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.factory.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"factory\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/factory\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should render correctly\", async ({ page }) => {\n    const body = page.locator(\"body\");\n\n    expect((await body.innerText()).trim()).toEqual(\"A\\nB\\nLight: wow!\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.lexical-scope.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"lexical-scope\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/lexical-scope\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should rerender without changes\", async ({ page }) => {\n    const SNAPSHOT =\n      '<p>1</p><p>\"&lt;/script&gt;\"</p><p>{\"a\":{\"thing\":12},\"b\":\"hola\",\"c\":123,\"d\":false,\"e\":true,\"f\":null,\"h\":[1,\"string\",false,{\"hola\":1},[\"hello\"]],\"promise\":{}}</p><p>undefined</p><p>null</p><p>[1,2,\"hola\",null,{}]</p><p>true</p><p>false</p><p>()=&gt;console.error()</p><p><!--t=3-->mutable message<!----></p><p>{\"signal\":{\"value\":0},\"signalValue\":0,\"store\":{\"count\":0,\"signal\":{\"value\":0}},\"storeCount\":0,\"storeSignal\":{\"value\":0}}</p><p>from a promise</p><p>message, message2, signal, signalValue, store, storeCount, storeSignal</p>';\n    const RESULT =\n      '[1,\"</script>\",{\"a\":{\"thing\":12},\"b\":\"hola\",\"c\":123,\"d\":false,\"e\":true,\"f\":null,\"h\":[1,\"string\",false,{\"hola\":1},[\"hello\"]],\"promise\":{}},\"undefined\",\"null\",[1,2,\"hola\",null,{}],true,false,null,\"mutable message\",null,{\"value\":0},0,{\"count\":0,\"signal\":{\"value\":0}},0,{\"value\":0},\"from a promise\",\"http://qwik.builder.com/docs?query=true\",\"2022-07-26T17:40:30.255Z\",\"hola()\\\\\\\\/ gi\",12,\"failed message\",[\"\\\\b: backspace\",\"\\\\f: form feed\",\"\\\\n: line feed\",\"\\\\r: carriage return\",\"\\\\t: horizontal tab\",\"\\\\u000b: vertical tab\",\"\\\\u0000: null character\",\"\\': single quote\",\"\\\\\\\\: backslash\"],\"Infinity\",\"-Infinity\",\"NaN\",\"88\",\"qwik\",[\"1\",\"2\"],\"200000000000000000\",\"[\\\\\"hola\\\\\",12,{\\\\\"a\\\\\":\\\\\"2022-07-26T17:40:30.255Z\\\\\"}]\",\"[[{},{}],[\\\\\"mapkey\\\\\",\\\\\"http://qwik.builder.com/docs?query=true\\\\\"]]\"]';\n\n    function normalizeSnapshot(str: string) {\n      return str.replace(\" =&gt; \", \"=&gt;\");\n    }\n    const result = page.locator(\"#result\");\n    const content = page.locator(\"#static\");\n    expect(normalizeSnapshot(await content.innerHTML())).toEqual(SNAPSHOT);\n    const btn = page.locator(\"#rerender\");\n    await expect(btn).toHaveText(\"Rerender 0\");\n    await expect(result).toHaveText(\"\");\n\n    // Click button\n    await btn.click();\n\n    await expect(btn).toHaveText(\"Rerender 1\");\n    expect(normalizeSnapshot(await content.innerHTML())).toEqual(SNAPSHOT);\n    await expect(result).toHaveText(RESULT);\n\n    // Click button\n    await btn.click();\n\n    await expect(btn).toHaveText(\"Rerender 2\");\n    expect(normalizeSnapshot(await content.innerHTML())).toEqual(SNAPSHOT);\n    await expect(result).toHaveText(RESULT);\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.mount.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"mount\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/mount\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should render logs correctly\", async ({ page }) => {\n    const btn = page.locator(\"button\");\n    const logs = page.locator(\"#logs\");\n    const renders = page.locator(\"#renders\");\n    await expect(renders).toHaveText(\"Renders: 1\");\n    await expect(logs).toHaveText(`BEFORE useServerMount1()\nAFTER useServerMount1()\nBEFORE useMount2()\nAFTER useMount2()\nBEFORE useWatch3()\nAFTER useWatch3()\nBEFORE useServerMount4()\nAFTER useServerMount4()`);\n\n    await btn.click();\n    await expect(renders).toHaveText(\"Renders: 1\");\n    await expect(logs).toHaveText(`BEFORE useServerMount1()\nAFTER useServerMount1()\nBEFORE useMount2()\nAFTER useMount2()\nBEFORE useWatch3()\nAFTER useWatch3()\nBEFORE useServerMount4()\nAFTER useServerMount4()\nClick`);\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.noresume.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"no resume\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/no-resume\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should handle to click\", async ({ page }) => {\n    const button = page.locator(\"button\");\n    await button.click();\n\n    const body = page.locator(\"body\");\n    await expect(body).toHaveCSS(\"background-color\", \"rgb(0, 0, 0)\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.ref.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"ref\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/ref\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should render correctly\", async ({ page }) => {\n    const staticEl = page.locator(\"#static\");\n    const dynamicEl = page.locator(\"#dynamic\");\n    const static2El = page.locator(\"#static-2\");\n    const dynamic2El = page.locator(\"#dynamic-2\");\n    const static3El = page.locator(\"#static-3\");\n    const dynamic3El = page.locator(\"#dynamic-3\");\n\n    await expect(staticEl).toHaveText(\"Rendered static\");\n    await expect(dynamicEl).toHaveText(\"Rendered dynamic\");\n    await expect(static2El).toHaveText(\"Rendered static-2\");\n    await expect(dynamic2El).toHaveText(\"Rendered dynamic-2\");\n    await expect(static3El).toHaveText(\"Rendered static-3\");\n    await expect(dynamic3El).toHaveText(\"Rendered dynamic-3\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.render.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"render\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/render\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      // console.warn(msg.type(), msg.text());\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  function tests() {\n    test(\"should load\", async ({ page }) => {\n      const button = page.locator(\"button#increment\");\n      const text = page.locator(\"#rerenders\");\n\n      await expect(text).toHaveText(\"Rerender 0\");\n      await button.click();\n      await expect(text).toHaveText(\"Rerender 1\");\n    });\n\n    test(\"should render classes\", async ({ page }) => {\n      const increment = page.locator(\"button#increment\");\n      const toggle = page.locator(\"button#toggle\");\n\n      const attributes = page.locator(\"#attributes\");\n\n      await expect(attributes).toHaveClass(\"⭐️unvb18-1 even stable0\");\n      await expect(attributes).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(attributes).toHaveAttribute(\"preventdefault:click\", \"\");\n\n      await increment.click();\n\n      await expect(attributes).toHaveClass(\"⭐️unvb18-1 odd stable0\");\n      await expect(attributes).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(attributes).toHaveAttribute(\"preventdefault:click\", \"\");\n\n      await toggle.click();\n\n      await expect(attributes).toHaveClass(\"⭐️unvb18-1\");\n      await expect(attributes).not.hasAttribute(\"aria-hidden\");\n      await expect(attributes).not.hasAttribute(\"preventdefault:click\");\n\n      await increment.click();\n\n      await expect(attributes).toHaveClass(\"⭐️unvb18-1\");\n      await expect(attributes).not.hasAttribute(\"aria-hidden\");\n      await expect(attributes).not.hasAttribute(\"preventdefault:click\");\n\n      await toggle.click();\n\n      await expect(attributes).toHaveClass(\"⭐️unvb18-1 even stable0\");\n      await expect(attributes).toHaveAttribute(\"aria-hidden\", \"true\");\n      await expect(attributes).toHaveAttribute(\"preventdefault:click\", \"\");\n    });\n\n    test(\"issue1475\", async ({ page }) => {\n      const button = page.locator(\"#issue-1475-button\");\n      const result = page.locator(\"#issue-1475-result\");\n\n      await button.click();\n      await expect(result).toHaveText(\n        \"1. Before\\n2. Some text\\nMiddle\\n3 After\\n\\nStuff\",\n        {\n          useInnerText: true,\n        },\n      );\n    });\n\n    test(\"counter toggle\", async ({ page }) => {\n      const button = page.locator(\"#counter-toggle-btn\");\n      const show1 = page.locator(\"#counter-toggle-show\");\n      const show2 = page.locator(\"#counter-toggle-show-2\");\n      await expect(show1).toHaveText(\"even\");\n      await expect(show2).toHaveText(\"true\");\n      await button.click();\n      await expect(show1).toHaveText(\"odd\");\n      await expect(show2).toHaveText(\"false\");\n      await button.click();\n      await expect(show1).toHaveText(\"even\");\n      await expect(show2).toHaveText(\"true\");\n      await button.click();\n      await expect(show1).toHaveText(\"odd\");\n      await expect(show2).toHaveText(\"false\");\n    });\n\n    test(\"handle props destructuring\", async ({ page }) => {\n      const button = page.locator(\"button#increment\");\n\n      const message1 = page.locator(\"#props-destructuring > span\");\n      const renders1 = page.locator(\"#props-destructuring > .renders\");\n\n      const message2 = page.locator(\"#props-destructuring-no > span\");\n      const renders2 = page.locator(\"#props-destructuring-no > .renders\");\n\n      const message3 = page.locator(\"#props-destructuring-count > span\");\n      const renders3 = page.locator(\"#props-destructuring-count > .renders\");\n\n      await expect(message1).toHaveText(\"Hello 0\");\n      await expect(renders1).toHaveText(\"1\");\n      await expect(message2).toHaveText(\"Default 0\");\n      await expect(renders2).toHaveText(\"1\");\n      await expect(message3).toHaveText(\"Count 0\");\n      await expect(message3).toHaveAttribute(\"aria-count\", \"0\");\n      await expect(renders3).toHaveText(\"1\");\n\n      await button.click();\n\n      await expect(message1).toHaveText(\"Hello 1\");\n      await expect(renders1).toHaveText(\"1\");\n      await expect(message2).toHaveText(\"Default 1\");\n      await expect(renders2).toHaveText(\"1\");\n      await expect(message3).toHaveText(\"Count 1\");\n      await expect(message3).toHaveAttribute(\"aria-count\", \"1\");\n      await expect(renders3).toHaveText(\"2\");\n\n      await button.click();\n\n      await expect(message1).toHaveText(\"Hello 2\");\n      await expect(renders1).toHaveText(\"1\");\n      await expect(message2).toHaveText(\"Default 2\");\n      await expect(renders2).toHaveText(\"1\");\n      await expect(message3).toHaveText(\"Count 2\");\n      await expect(message3).toHaveAttribute(\"aria-count\", \"2\");\n      await expect(renders3).toHaveText(\"3\");\n    });\n\n    test(\"issue2563\", async ({ page }) => {\n      const string = page.locator(\"#issue-2563-string\");\n      const obj = page.locator(\"#issue-2563-obj\");\n      const operation = page.locator(\"#issue-2563-operation\");\n\n      await expect(string).toHaveText(\"4=4\");\n      await expect(obj).toHaveText(\"4=4\");\n      await expect(operation).toHaveText(\"4+1=5\");\n    });\n\n    test(\"issue2608\", async ({ page }) => {\n      const toggle = page.locator(\"#issue-2608-btn\");\n      const input = page.locator(\"#issue-2608-input\");\n\n      await expect(input).toHaveValue(\"\");\n      await input.fill(\"some text\");\n      await expect(input).toHaveValue(\"some text\");\n      await toggle.click();\n      await expect(input).toHaveValue(\"some text\");\n      await toggle.click();\n      await expect(input).toHaveValue(\"some text\");\n    });\n\n    test(\"issue2800\", async ({ page }) => {\n      const button = page.locator(\"#issue-2800-btn\");\n      const results = page.locator(\"#issue-2800-result > li\");\n\n      await expect(results).toHaveText([\n        \"alpha - 1\",\n        \"bravo - 2\",\n        \"charlie - 3\",\n      ]);\n\n      await button.click();\n      await expect(results).toHaveText([\n        \"alpha - 1\",\n        \"bravo - 2\",\n        \"charlie - 3\",\n        \"extra3 - 1\",\n      ]);\n      await button.click();\n      await expect(results).toHaveText([\n        \"alpha - 1\",\n        \"bravo - 2\",\n        \"charlie - 3\",\n        \"extra3 - 1\",\n        \"extra4 - 1\",\n      ]);\n    });\n\n    test(\"issue2889\", async ({ page }) => {\n      const result1 = page.locator(\"#issue-2889-result1\");\n      const result2 = page.locator(\"#issue-2889-result2\");\n\n      await expect(result1).toHaveText(\"Deeds: 4\");\n      await expect(result2).toHaveText(\"Filtered Deeds: 2\");\n    });\n\n    test(\"issue3116\", async ({ page }) => {\n      const result = page.locator(\"#issue-3116-result\");\n\n      await expect(result).toHaveText(\"this comes from render$\");\n    });\n\n    test(\"issue reorder\", async ({ page }) => {\n      const result = page.locator(\".issue-order\");\n      const button = page.locator(\"#issue-order-btn\");\n      await expect(result).toHaveText([\"TOP\", \"1. First\", \"2. Second\"]);\n\n      await button.click();\n      await expect(result).toHaveText([\"1. First\", \"2. Second\", \"BOTTOM\"]);\n    });\n\n    test(\"issue2414\", async ({ page }) => {\n      const sortByAge = page.locator(\"#issue-2414-age\");\n      const sortBySize = page.locator(\"#issue-2414-size\");\n      const sortById = page.locator(\"#issue-2414-id\");\n\n      const age = page.locator(\".issue-2414-age\");\n      const size = page.locator(\".issue-2414-size\");\n      const id = page.locator(\".issue-2414-id\");\n\n      const list = [\n        [1, 9, 4],\n        [2, 27, 3],\n        [3, 3, 2],\n        [4, 1, 1],\n        [7, 21, 5],\n        [8, 12, 6],\n        [9, 7, 7],\n      ];\n      await expect(size).toHaveText(list.map((a) => String(a[0])));\n      await expect(age).toHaveText(list.map((a) => String(a[1])));\n      await expect(id).toHaveText(list.map((a) => String(a[2])));\n\n      // Sort by age\n      list.sort((a, b) => a[1] - b[1]);\n      await sortByAge.click();\n\n      await expect(size).toHaveText(list.map((a) => String(a[0])));\n      await expect(age).toHaveText(list.map((a) => String(a[1])));\n      await expect(id).toHaveText(list.map((a) => String(a[2])));\n\n      list.sort((a, b) => a[2] - b[2]);\n      await sortById.click();\n\n      await expect(size).toHaveText(list.map((a) => String(a[0])));\n      await expect(age).toHaveText(list.map((a) => String(a[1])));\n      await expect(id).toHaveText(list.map((a) => String(a[2])));\n\n      list.sort((a, b) => a[0] - b[0]);\n      await sortBySize.click();\n\n      await expect(size).toHaveText(list.map((a) => String(a[0])));\n      await expect(age).toHaveText(list.map((a) => String(a[1])));\n      await expect(id).toHaveText(list.map((a) => String(a[2])));\n    });\n\n    test(\"issue3178\", async ({ page }) => {\n      const result = page.locator(\"#issue-3178\");\n      await expect(result).toHaveText(\"Hello\");\n    });\n\n    test(\"issue3398\", async ({ page }) => {\n      const toggle = page.locator(\"#issue-3398-button\");\n      await expect(page.locator(\"h1#issue-3398-tag\")).toHaveText(\"Hello h1\");\n      await expect(page.locator(\"h1#issue-3398-tag\")).not.hasAttribute(\n        \"children\",\n      );\n\n      await toggle.click();\n      await expect(page.locator(\"h1#issue-3398-tag\")).not.toBeVisible();\n      await expect(page.locator(\"h2#issue-3398-tag\")).toHaveText(\"Hello h2\");\n      await expect(page.locator(\"h2#issue-3398-tag\")).not.hasAttribute(\n        \"children\",\n      );\n\n      await toggle.click();\n      await expect(page.locator(\"h2#issue-3398-tag\")).not.toBeVisible();\n      await expect(page.locator(\"h1#issue-3398-tag\")).toBeVisible();\n      await expect(page.locator(\"h1#issue-3398-tag\")).toHaveText(\"Hello h1\");\n      await expect(page.locator(\"h1#issue-3398-tag\")).not.hasAttribute(\n        \"children\",\n      );\n    });\n\n    test(\"issue3479\", async ({ page }) => {\n      const increment = page.locator(\"#issue-3479-button\");\n      const result = page.locator(\"#issue-3479-result\");\n\n      await expect(result).toHaveText(\"0\");\n      await increment.click();\n      await expect(result).toHaveText(\"1\");\n      await increment.click();\n      await expect(result).toHaveText(\"2\");\n      await increment.click();\n      await expect(result).toHaveText(\"3\");\n    });\n\n    test(\"issue3481\", async ({ page }) => {\n      const increment = page.locator(\"#issue-3481-button\");\n      const result1 = page.locator(\"#issue-3481-result1\");\n      const result2 = page.locator(\"#issue-3481-result2\");\n\n      await expect(result1).toHaveText(\"Hello 0\");\n      await expect(result2).toHaveText(\"Hello 0\");\n      await expect(result1).toHaveCSS(\"color\", \"rgb(0, 0, 255)\");\n      await expect(result2).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n      await increment.click();\n      await expect(result1).toHaveText(\"Hello 1\");\n      await expect(result2).toHaveText(\"Hello 1\");\n      await expect(result1).toHaveCSS(\"color\", \"rgb(0, 0, 255)\");\n      await expect(result2).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n\n      await increment.click();\n      await expect(result1).toHaveText(\"Hello 2\");\n      await expect(result2).toHaveText(\"Hello 2\");\n      await expect(result1).toHaveCSS(\"color\", \"rgb(0, 0, 255)\");\n      await expect(result2).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n    });\n\n    test(\"issue3468\", async ({ page }) => {\n      const cards = page.locator(\".issue-3468-card\");\n      await expect(cards).toHaveText([\"a:\", \"b:\", \"c:\", \"d:\"]);\n    });\n\n    test(\"issue3542\", async ({ page }) => {\n      const result = page.locator(\"#issue-3542-result\");\n      await expect(result).toHaveText(\"CODE IS 1\");\n    });\n\n    test(\"issue3643\", async ({ page }) => {\n      const result = page.locator(\"#issue-3643-result\");\n      const result2 = page.locator(\"#issue-3643-result-2\");\n      const button = page.locator(\"#issue-3643-button\");\n\n      await expect(result).toHaveText(\"Hello\");\n      await expect(result2).toHaveText(\"Hello\");\n      await button.click();\n      await expect(result).toHaveText(\"World\");\n      await expect(result2).toHaveText(\"World\");\n      await button.click();\n      await expect(result).toHaveText(\"Hello\");\n      await expect(result2).toHaveText(\"Hello\");\n      await button.click();\n      await expect(result).toHaveText(\"World\");\n      await expect(result2).toHaveText(\"World\");\n      await button.click();\n      await expect(result).toHaveText(\"Hello\");\n      await expect(result2).toHaveText(\"Hello\");\n      await button.click();\n      await expect(result).toHaveText(\"World\");\n      await expect(result2).toHaveText(\"World\");\n    });\n    test(\"issue-children-spread-result\", async ({ page }) => {\n      const result = page.locator(\"#issue-children-spread-result\");\n      const staticContent = page.locator(\"#issue-children-spread-static\");\n      const button = page.locator(\"#issue-children-spread-button\");\n\n      await expect(staticContent).toHaveText(\"12\");\n      await expect(result).toHaveText(\"Hello\");\n      await button.click();\n      await expect(result).toHaveText(\"Changed\");\n    });\n\n    test(\"issue3731\", async ({ page }) => {\n      const button = page.locator(\"#issue-3731-button\");\n      const results = page.locator(\".issue-3731-result\");\n      await expect(results).toHaveText([\n        \"think\",\n        \"containers\",\n        \"hydrating\",\n        \"usestylesscoped\",\n        \"slots\",\n      ]);\n      await button.click();\n      await expect(results).toHaveText([\n        \"think\",\n        \"containers\",\n        \"cleanup\",\n        \"usevisibletask\",\n        \"hydrating\",\n      ]);\n      await button.click();\n      await expect(results).toHaveText([\n        \"cleanup\",\n        \"usevisibletask\",\n        \"think\",\n        \"containers\",\n        \"slots\",\n      ]);\n    });\n\n    test(\"issue3702\", async ({ page }) => {\n      const button = page.locator(\"#issue-3702-button\");\n      const result = page.locator(\"#issue-3702-result\");\n      await expect(result).toHaveAttribute(\"data-title\", \"Bye 0\");\n      await button.click();\n      await expect(result).toHaveAttribute(\"data-title\", \"Bye 1\");\n      await button.click();\n      await expect(result).toHaveAttribute(\"data-title\", \"Bye 2\");\n    });\n\n    test(\"issue3795\", async ({ page }) => {\n      const result = page.locator(\"#issue-3795-result\");\n      await expect(result).toHaveText(\"foo foobar\");\n    });\n\n    test(\"issue4029\", async ({ page }) => {\n      const toggle = page.locator(\"#issue-4029-toggle\");\n      const result = page.locator(\"#issue-4029-result\");\n      await expect(result).toHaveText(\"CompA\");\n      await toggle.click();\n      await expect(result).toHaveText(\"CompB\");\n    });\n\n    test(\"skip render\", async ({ page }) => {\n      const increment = page.locator(\"#skip-render-button\");\n      const result = page.locator(\"#skip-render-result\");\n\n      await expect(increment).toHaveText(\"Increment 0\");\n      await expect(result).toHaveText(\"Number: 0\");\n\n      await increment.click();\n      await expect(increment).toHaveText(\"Increment 0\");\n      await expect(result).toHaveText(\"Number: 1\");\n\n      await increment.click();\n      await expect(increment).toHaveText(\"Increment 0\");\n      await expect(result).toHaveText(\"Number: 2\");\n\n      await increment.click();\n      await expect(increment).toHaveText(\"Increment 3\");\n      await expect(result).toHaveText(\"Number: 3\");\n\n      await increment.click();\n      await expect(increment).toHaveText(\"Increment 3\");\n      await expect(result).toHaveText(\"Number: 4\");\n\n      await increment.click();\n      await expect(increment).toHaveText(\"Increment 3\");\n      await expect(result).toHaveText(\"Number: 5\");\n\n      await increment.click();\n      await expect(increment).toHaveText(\"Increment 6\");\n      await expect(result).toHaveText(\"Number: 6\");\n    });\n\n    test(\"ssr raw\", async ({ page }) => {\n      const result = page.locator(\"#ssr-raw-test-result\");\n      const mounted = await result.getAttribute(\"data-mounted\");\n      if (mounted === \"server\") {\n        expect(await result.innerHTML()).toEqual(\"<b>ssr raw test</b>\");\n      } else if (mounted === \"browser\") {\n        expect(await result.innerHTML()).toEqual(\"<!--qv --><!--/qv-->\");\n      } else {\n        throw new Error(\"Unexpected mounted value\");\n      }\n    });\n\n    test(\"html fragment\", async ({ page }) => {\n      const result = page.locator(\"#html-fragment-test-result\");\n      const mounted = await result.getAttribute(\"data-mounted\");\n      if (mounted === \"server\") {\n        await expect(await result.innerHTML()).toEqual(\n          \"<!--qv--><b>html fragment test</b><!--/qv-->\",\n        );\n      } else if (mounted === \"browser\") {\n        await expect(await result.innerHTML()).toEqual(\n          \"<!--qv --><b>html fragment test</b><!--/qv-->\",\n        );\n      } else {\n        throw new Error(\"Unexpected mounted value\");\n      }\n    });\n\n    test(\"issue4292\", async ({ page }) => {\n      const button = page.locator(\"#issue-4292-result\");\n      await expect(button).toHaveText(\"Hello, World!\");\n      await expect(button).toHaveAttribute(\"aria-label\", \"a1\");\n      await expect(button).toHaveAttribute(\"title\", \"a1\");\n\n      await button.click();\n      await expect(button).toHaveAttribute(\"aria-label\", \"a\");\n      await expect(button).toHaveAttribute(\"title\", \"a\");\n\n      await button.click();\n      await expect(button).toHaveAttribute(\"aria-label\", \"a1\");\n      await expect(button).toHaveAttribute(\"title\", \"a1\");\n    });\n\n    test(\"issue 4386\", async ({ page }) => {\n      const result = page.locator(\"#issue-4386-result\");\n      await expect(result).toHaveText(\"1\");\n    });\n\n    test(\"issue 4455\", async ({ page }) => {\n      const input1 = page.locator(\"#issue-4455-input1\");\n      const input2 = page.locator(\"#issue-4455-input2\");\n      await expect(input1).toHaveValue(\"0.5\");\n      await expect(input2).toHaveValue(\"0.5\");\n    });\n\n    test(\"issue 5266\", async ({ page }) => {\n      const tag = page.locator(\"#issue-5266-tag\");\n      const button = page.locator(\"#issue-5266-button\");\n      await page.locator(\"#issue-5266-render\").click();\n\n      await expect(tag).toHaveAttribute(\"data-v\", \"foo\");\n      await button.click();\n      await expect(tag).toHaveAttribute(\"data-v\", \"bar\");\n    });\n  }\n\n  tests();\n\n  test.describe(\"client rerender\", () => {\n    test.beforeEach(async ({ page }) => {\n      const toggleRender = page.locator(\"#rerender\");\n      const v = await toggleRender.getAttribute(\"data-v\");\n      await toggleRender.click();\n      await expect(page.locator(\"#rerenderCount\")).toHaveText(\n        `Render ${Number(v) + 1}`,\n      );\n    });\n    tests();\n  });\n\n  test(\"pr3475\", async ({ page }) => {\n    const ref = page.locator(\"#pr-3475-button\");\n    await expect(ref).toHaveText(\"data\");\n    await ref.click();\n    await expect(ref).not.toHaveText(\"data\");\n  });\n\n  test(\"issue4346\", async ({ page }) => {\n    const result = page.locator(\"#issue-4346-result\");\n    const toggle = page.locator(\"#issue-4346-toggle\");\n    await expect(result).toHaveText(\"Hello\");\n    await toggle.click();\n    await expect(result).toHaveText(\"world\");\n  });\n\n  test(\"dynamic DOM tags\", async ({ page }) => {\n    const button = page.locator(\"#dynamic-button\");\n    await expect(button).toHaveClass(\"btn\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.resource.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"resource\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/resource\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should load\", async ({ page }) => {\n    const resource1 = page.locator(\".resource1\");\n    const logs = page.locator(\".logs\");\n    const increment = page.locator(\"button.increment\");\n    let logsContent =\n      \"[RENDER] <ResourceApp>\\n[WATCH] 1 before\\n[WATCH] 1 after\\n[WATCH] 2 before\\n[WATCH] 2 after\\n[RESOURCE] 1 before\\n[RENDER] <Results>\\n\\n\\n\";\n    await expect(resource1).toHaveText(\"resource 1 is 80\");\n    // await expect(resource2).toHaveText('resource 2 is 160');\n    await expect(logs).toHaveText(logsContent);\n\n    // Increment\n    await increment.click();\n\n    await expect(resource1).toHaveText(\"loading resource 1...\");\n    logsContent +=\n      \"[RESOURCE] 1 after\\n\\n[WATCH] 1 before\\n[WATCH] 1 after\\n[WATCH] 2 before\\n[WATCH] 2 after\\n[RESOURCE] 1 before\\n[RENDER] <Results>\\n\\n\\n\";\n    // await expect(resource2).toHaveText('loading resource 2...');\n    await expect(logs).toHaveText(logsContent);\n\n    await expect(resource1).toHaveText(\"resource 1 is 88\");\n    logsContent += \"[RESOURCE] 1 after\\n[RENDER] <Results>\\n\\n\\n\";\n    // await expect(resource2).toHaveText('resource 2 is 176');\n    await expect(logs).toHaveText(logsContent);\n  });\n\n  test(\"should track subscriptions\", async ({ page }) => {\n    const resource1 = page.locator(\".resource1\");\n    const logs = page.locator(\".logs\");\n    let logsContent =\n      \"[RENDER] <ResourceApp>\\n[WATCH] 1 before\\n[WATCH] 1 after\\n[WATCH] 2 before\\n[WATCH] 2 after\\n[RESOURCE] 1 before\\n[RENDER] <Results>\\n\\n\\n\";\n    await expect(resource1).toHaveText(\"resource 1 is 80\");\n    await expect(logs).toHaveText(logsContent);\n\n    // Count\n    const countBtn = page.locator(\"button.count\");\n    await expect(countBtn).toHaveText(\"count is 0\");\n    await countBtn.click();\n    await expect(countBtn).toHaveText(\"count is 1\");\n\n    logsContent += \"[RESOURCE] 1 after\\n[RENDER] <Results>\\n\\n\\n\";\n    await expect(logs).toHaveText(logsContent);\n\n    await countBtn.click();\n    await expect(countBtn).toHaveText(\"count is 2\");\n\n    logsContent += \"[RENDER] <Results>\\n\\n\\n\";\n    await expect(logs).toHaveText(logsContent);\n  });\n});\n\ntest.describe(\"resource serialization\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/resource-serialization\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should load\", async ({ page }) => {\n    const button1 = page.locator(\"button.r1\");\n    const button2 = page.locator(\"button.r2\");\n    const button3 = page.locator(\"button.r3\");\n\n    await expect(button1).toHaveText(\"PASS: Success 0\");\n    await expect(button2).toHaveText(\"ERROR: Error: failed 0\");\n    await expect(button3).toHaveText(\"ERROR: Error: timeout 0\");\n\n    // Click button 1\n    await button1.click();\n\n    await expect(button1).toHaveText(\"PASS: Success 1\");\n    await expect(button2).toHaveText(\"ERROR: Error: failed 0\");\n    await expect(button3).toHaveText(\"ERROR: Error: timeout 0\");\n\n    // Click button 2\n    await button2.click();\n\n    await expect(button1).toHaveText(\"PASS: Success 1\");\n    await expect(button2).toHaveText(\"ERROR: Error: failed 1\");\n    await expect(button3).toHaveText(\"ERROR: Error: timeout 1\");\n\n    // Click button 2\n    await button2.click();\n\n    await expect(button1).toHaveText(\"PASS: Success 1\");\n    await expect(button2).toHaveText(\"ERROR: Error: failed 2\");\n    await expect(button3).toHaveText(\"ERROR: Error: timeout 2\");\n  });\n\n  test(\"issue 2014\", async ({ page }) => {\n    const button1 = page.locator(\"#issue-2014-btn\");\n    await expect(button1).toHaveText(\"0(count is here: 0)\");\n    await button1.click();\n    await expect(button1).toHaveText(\"2(count is here: 1)\");\n    await button1.click();\n    await expect(button1).toHaveText(\"4(count is here: 2)\");\n  });\n\n  test(\"race condition\", async ({ page }) => {\n    const btn = page.locator(\"#resource-race-btn\");\n    const result = page.locator(\"#resource-race-result\");\n\n    await expect(btn).toHaveText(\"0\");\n    await expect(result).toHaveText(\"0\");\n    await btn.click();\n    await expect(btn).toHaveText(\"1\");\n    await expect(result).toHaveText(\"0\");\n    await btn.click();\n    await expect(btn).toHaveText(\"2\");\n    await expect(result).toHaveText(\"2\");\n    await page.waitForTimeout(1000);\n\n    await expect(btn).toHaveText(\"2\");\n    await expect(result).toHaveText(\"2\");\n    await btn.click();\n\n    await expect(btn).toHaveText(\"3\");\n    await expect(result).toHaveText(\"3\");\n  });\n});\n\ntest.describe(\"resource fn\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/resource-fn\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should load\", async ({ page }) => {\n    const asyncSignal = page.locator(\"#asyncSignal\");\n    const promise = page.locator(\"#promise\");\n    const signal = page.locator(\"#signal\");\n    const resource = page.locator(\"#resource\");\n\n    await expect(resource).toHaveText(\"resource\");\n    await expect(asyncSignal).toHaveText(\"asyncSignal\");\n    await expect(promise).toHaveText(\"promise\");\n    await expect(signal).toHaveText(\"signal\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.resuming.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"resuming\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/resuming\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should toggle without crash\", async ({ page }) => {\n    const toggle = page.locator(\"#toggle\");\n    const increment = page.locator(\"#increment\");\n    const counter = page.locator(\"#counter\");\n    const counterCopy = page.locator(\"#counter-copy\");\n\n    await expect(counter).toBeVisible();\n    await expect(counter).toHaveText(\"0\");\n    await expect(counterCopy).toHaveText(\"0\");\n\n    // Hide\n    await toggle.click();\n    await expect(counter).not.toBeVisible();\n    await increment.click();\n    await increment.click();\n    await expect(counter).not.toBeVisible();\n    await expect(counterCopy).toHaveText(\"0\");\n\n    // Show\n    await toggle.click();\n    await expect(counter).toBeVisible();\n    await expect(counter).toHaveText(\"2\");\n    await expect(counterCopy).toHaveText(\"2\");\n    await increment.click();\n    await expect(counter).toHaveText(\"3\");\n    await expect(counterCopy).toHaveText(\"3\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.signals.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"signals\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/signals\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  function tests() {\n    test(\"should do its thing\", async ({ page }) => {\n      const incrementBtn = page.locator(\"#count\");\n      const clickBtn = page.locator(\"#click\");\n      const incrementIdBtn = page.locator(\"#increment-id\");\n      const backgroundBtn = page.locator(\"#background\");\n\n      const parentRender = page.locator(\"#parent-renders\");\n      const childRender = page.locator(\"#child-renders\");\n\n      const text = page.locator(\"#text\");\n      const id = page.locator(\"#id\");\n      const computed = page.locator(\"#computed\");\n      const stuff = page.locator(\"#stuff\");\n      const body = page.locator(\"body\");\n\n      await expect(parentRender).toHaveText(\"Parent renders: 1\");\n      await expect(childRender).toHaveText(\"Child renders: 1\");\n      await expect(text).toHaveText(\"Text: Message\");\n      await expect(text).toHaveAttribute(\"data-set\", \"ref\");\n      await expect(id).toHaveText(\"Id: 0\");\n      await expect(computed).toHaveText(\"computed: \");\n      await expect(stuff).toHaveText(\"Stuff: 10\");\n      await expect(stuff).toHaveAttribute(\"data-set\", \"ref2\");\n\n      await incrementBtn.click();\n      await expect(parentRender).toHaveText(\"Parent renders: 1\");\n      await expect(childRender).toHaveText(\"Child renders: 1\");\n      await expect(text).toHaveText(\"Text: Message\");\n      await expect(text).toHaveAttribute(\"data-set\", \"ref\");\n      await expect(id).toHaveText(\"Id: 0\");\n      await expect(computed).toHaveText(\"computed: \");\n      await expect(stuff).toHaveText(\"Stuff: 11\");\n      await expect(stuff).toHaveAttribute(\"data-set\", \"ref2\");\n\n      await clickBtn.click();\n      await expect(parentRender).toHaveText(\"Parent renders: 1\");\n      await expect(childRender).toHaveText(\"Child renders: 1\");\n      await expect(text).toHaveText(\"Text: Message\");\n      await expect(text).toHaveAttribute(\"data-set\", \"ref\");\n      await expect(id).toHaveText(\"Id: 0\");\n      await expect(computed).toHaveText(\"computed: clicked\");\n      await expect(stuff).toHaveText(\"Stuff: 11\");\n      await expect(stuff).toHaveAttribute(\"data-set\", \"ref2\");\n\n      await incrementIdBtn.click();\n      await expect(parentRender).toHaveText(\"Parent renders: 1\");\n      await expect(childRender).toHaveText(\"Child renders: 1\");\n      await expect(text).toHaveText(\"Text: Message\");\n      await expect(text).toHaveAttribute(\"data-set\", \"ref\");\n      await expect(id).toHaveText(\"Id: 1\");\n      await expect(computed).toHaveText(\"computed: clicked\");\n      await expect(stuff).toHaveText(\"Stuff: 11\");\n      await expect(stuff).toHaveAttribute(\"data-set\", \"ref2\");\n      await expect(body).toHaveCSS(\"background-color\", \"rgb(255, 255, 255)\");\n\n      await backgroundBtn.click();\n      await expect(parentRender).toHaveText(\"Parent renders: 1\");\n      await expect(childRender).toHaveText(\"Child renders: 2\");\n      await expect(text).toHaveText(\"Text: Message\");\n      await expect(text).toHaveAttribute(\"data-set\", \"ref\");\n      await expect(id).toHaveText(\"Id: 1\");\n      await expect(computed).toHaveText(\"computed: clicked\");\n      await expect(stuff).toHaveText(\"Stuff: 11\");\n      await expect(stuff).toHaveAttribute(\"data-set\", \"ref2\");\n      await expect(body).toHaveCSS(\"background-color\", \"rgb(0, 0, 0)\");\n    });\n\n    test(\"issue 1681\", async ({ page }) => {\n      const result = page.locator(\"#issue-1681-return\");\n      const button = page.locator(\"#issue-1681-btn\");\n\n      await expect(result).toHaveText(\"Count A is 0 Count B is 0\");\n      await button.click();\n      await expect(result).toHaveText(\"Count A is 1 Count B is 1\");\n    });\n\n    test(\"issue 1733\", async ({ page }) => {\n      const button = page.locator(\"#issue1733-btn\");\n      const spanSignal = page.locator(\"#issue1733-signal\");\n      const spanTrue = page.locator(\"#issue1733-true\");\n      const spanFalse = page.locator(\"#issue1733-false\");\n      const h1 = page.locator(\"#issue1733-h1\");\n\n      await expect(spanSignal).toHaveText(\"\");\n      await expect(spanTrue).toHaveText(\"\");\n      await expect(spanFalse).toHaveText(\"\");\n      await expect(h1).not.toBeVisible();\n\n      await button.click();\n\n      await expect(spanSignal).toHaveText(\"\");\n      await expect(spanTrue).toHaveText(\"\");\n      await expect(spanFalse).toHaveText(\"\");\n      await expect(h1).toBeVisible();\n      await expect(h1).toHaveText(\"Message\");\n    });\n\n    test(\"issue 1884\", async ({ page }) => {\n      const button = page.locator(\"#issue1884-btn\");\n      const text0 = page.locator(\".issue1884-text:nth-child(1)\");\n      const text1 = page.locator(\".issue1884-text:nth-child(2)\");\n      const text2 = page.locator(\".issue1884-text:nth-child(3)\");\n      const text3 = page.locator(\".issue1884-text:nth-child(4)\");\n\n      await expect(text0).toHaveCSS(\"color\", \"rgb(0, 0, 0)\");\n      await expect(text1).toHaveCSS(\"color\", \"rgb(0, 0, 0)\");\n      await expect(text2).toHaveCSS(\"color\", \"rgb(0, 0, 0)\");\n      await expect(text3).toHaveCSS(\"color\", \"rgb(0, 0, 0)\");\n\n      await button.click();\n\n      await expect(text0).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n      await expect(text1).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n      await expect(text2).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n      await expect(text3).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n    });\n\n    test(\"issue 2000\", async ({ page }) => {\n      const textArea = page.locator(\"#textarea\");\n      await expect(textArea).toHaveValue(\"body { background: white}\");\n    });\n\n    test(\"issue 2176\", async ({ page }) => {\n      const btn = page.locator(\"#issue-2176-btn\");\n      const results = page.locator(\".issue-2176-result\");\n      await expect(results).toHaveText([\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n        \"testing flag=F num=1\",\n      ]);\n\n      await btn.click();\n      await expect(results).toHaveText([\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n        \"testing2 flag=T num=2\",\n      ]);\n\n      await btn.click();\n      await expect(results).toHaveText([\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n        \"testing3 flag=F num=3\",\n      ]);\n    });\n\n    test(\"issue 2245\", async ({ page }) => {\n      const btn = page.locator(\"#issue-2245-btn\");\n      const results = page.locator(\".issue-2245-results p\");\n      expect(await results.count()).toBe(16);\n      for (let i = 0; i < 16; i++) {\n        await expect(results.nth(i)).toHaveCSS(\"color\", \"rgb(0, 0, 0)\");\n      }\n\n      await btn.click();\n      for (let i = 0; i < 16; i++) {\n        await expect(results.nth(i)).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n      }\n\n      await btn.click();\n      for (let i = 0; i < 16; i++) {\n        await expect(results.nth(i)).toHaveCSS(\"color\", \"rgb(0, 0, 255)\");\n      }\n    });\n\n    test(\"issue 2245-b\", async ({ page }) => {\n      const btn = page.locator(\"#issue-2245-b-btn\");\n      const results = page.locator(\".issue-2245-b-results p\");\n      await expect(results).toHaveCSS(\"color\", \"rgb(0, 0, 0)\");\n\n      await btn.click();\n      await expect(results).toHaveCSS(\"color\", \"rgb(255, 0, 0)\");\n\n      await btn.click();\n      await expect(results).toHaveCSS(\"color\", \"rgb(0, 0, 255)\");\n\n      await btn.click();\n      await expect(results).toHaveCSS(\"color\", \"rgb(0, 128, 0)\");\n    });\n\n    test(\"complex classes with signals\", async ({ page }) => {\n      const btn = page.locator(\"#complex-classes-btn\");\n      const results = page.locator(\"#complex-classes-results\");\n\n      await expect(results).toHaveClass(\"initial visible\");\n      await btn.click();\n      await expect(results).toHaveClass(\"change hidden\");\n    });\n\n    test(\"issue 2311\", async ({ page }) => {\n      const btn = page.locator(\"#issue-2311-btn\");\n      const results = page.locator(\"#issue-2311-results > *\");\n      await expect(results).toHaveText([\n        \"This text should not change\",\n        \"Hello\",\n        \"This text should not change\",\n        \"Hello\",\n        \"This text should not change\",\n        \"Hello\",\n        \"This text should not change\",\n        \"Hello\",\n        \"This text should not change\",\n        \"Hello\",\n      ]);\n\n      await btn.click();\n\n      await expect(results).toHaveText([\n        \"This text should not change\",\n        \"Done!\",\n        \"This text should not change\",\n        \"Done!\",\n        \"This text should not change\",\n        \"Done!\",\n        \"This text should not change\",\n        \"Done!\",\n        \"This text should not change\",\n        \"Done!\",\n      ]);\n    });\n\n    test(\"issue 2344\", async ({ page }) => {\n      const btn = page.locator(\"#issue-2344-btn\");\n      const results = page.locator(\"#issue-2344-results\");\n      await expect(results).toHaveValue(\"Content\");\n      await btn.click();\n      await expect(results).toHaveValue(\"Content\");\n    });\n\n    test(\"issue 2930\", async ({ page }) => {\n      const input = page.locator(\"#issue-2930-input\");\n      const results = page.locator(\".issue-2930-result\");\n      await expect(results).toHaveText([\n        '{\"controls\":{\"ctrl\":{\"value\":\"\"}}}',\n        '{\"ctrl\":{\"value\":\"\"}}',\n        '{\"value\":\"\"}',\n        '\"\"',\n      ]);\n      await page.waitForTimeout(100);\n      await input.fill(\"test\");\n      await expect(results).toHaveText([\n        '{\"controls\":{\"ctrl\":{\"value\":\"test\"}}}',\n        '{\"ctrl\":{\"value\":\"test\"}}',\n        '{\"value\":\"test\"}',\n        '\"test\"',\n      ]);\n    });\n\n    test(\"issue 3212\", async ({ page }) => {\n      const result0 = page.locator(\"#issue-3212-result-0\");\n      const result1 = page.locator(\"#issue-3212-result-1\");\n      const result2 = page.locator(\"#issue-3212-result-2\");\n      const result3 = page.locator(\"#issue-3212-result-3\");\n\n      await expect(result0).toHaveText(\"1\");\n      await expect(result1).toHaveText(\"1\");\n      await expect(result2).toHaveText(\"1\");\n      await expect(result3).toHaveText(\"1\");\n    });\n\n    test(\"fine-grained-mutable\", async ({ page }) => {\n      const mutable = page.locator(\"#fine-grained-mutable\");\n      const signal = page.locator(\"#fine-grained-signal\");\n\n      await expect(mutable).toHaveText(\"2\");\n      await expect(signal).toHaveText(\"Increment 0\");\n\n      await signal.click();\n      await expect(mutable).toHaveText(\"3\");\n      await expect(signal).toHaveText(\"Increment 1\");\n\n      await signal.click();\n      await expect(mutable).toHaveText(\"4\");\n      await expect(signal).toHaveText(\"Increment 2\");\n    });\n\n    test(\"issue 3415\", async ({ page }) => {\n      const result = page.locator(\"#issue-3415-result\");\n      const button = page.locator(\"#issue-3415-button\");\n      await expect(result).toHaveText(\"foo\");\n      await expect(await result.innerHTML()).toEqual(\"<b>foo</b>\");\n\n      await button.click();\n      await expect(result).toHaveText(\"bar\");\n      await expect(await result.innerHTML()).toEqual(\"<i>bar</i>\");\n    });\n\n    test(\"bind value\", async ({ page }) => {\n      const input = page.locator(\"#bind-input-1\");\n      const textarea = page.locator(\"#bind-input-2\");\n      const text1 = page.locator(\"#bind-text-1\");\n      const text2 = page.locator(\"#bind-text-2\");\n      const checkbox = page.locator(\"#bind-checkbox\");\n      const checkbox2 = page.locator(\"#bind-checkbox-2\");\n\n      await expect(input).toHaveValue(\"initial\");\n      await expect(textarea).toHaveValue(\"initial\");\n      await expect(text1).toHaveText(\"Value: initial\");\n      await expect(text2).toHaveText(\"Value: initial\");\n\n      await input.clear();\n      await input.fill(\"from1\");\n      await expect(input).toHaveValue(\"from1\");\n      await expect(textarea).toHaveValue(\"from1\");\n      await expect(text1).toHaveText(\"Value: from1\");\n      await expect(text2).toHaveText(\"Value: from1\");\n\n      await input.clear();\n      await textarea.fill(\"from2\");\n      await expect(input).toHaveValue(\"from2\");\n      await expect(textarea).toHaveValue(\"from2\");\n      await expect(text1).toHaveText(\"Value: from2\");\n      await expect(text2).toHaveText(\"Value: from2\");\n\n      await input.clear();\n      await expect(input).toHaveValue(\"\");\n      await expect(textarea).toHaveValue(\"\");\n      await expect(text1).toHaveText(\"Value: \");\n      await expect(text2).toHaveText(\"Value: \");\n\n      await expect(checkbox).not.toBeChecked();\n      await expect(checkbox2).not.toBeChecked();\n      await expect(input).not.toBeDisabled();\n      await expect(textarea).not.toBeDisabled();\n\n      await checkbox.click();\n      await expect(checkbox).toBeChecked();\n      await expect(checkbox2).toBeChecked();\n      await expect(input).toBeDisabled();\n      await expect(textarea).toBeDisabled();\n\n      await checkbox2.click();\n      await expect(checkbox).not.toBeChecked();\n      await expect(checkbox2).not.toBeChecked();\n      await expect(input).not.toBeDisabled();\n      await expect(textarea).not.toBeDisabled();\n\n      await checkbox2.click();\n      await expect(checkbox).toBeChecked();\n      await expect(checkbox2).toBeChecked();\n      await expect(input).toBeDisabled();\n      await expect(textarea).toBeDisabled();\n    });\n\n    test(\"issue 3482\", async ({ page }) => {\n      const button = page.locator(\"#issue-3482-button\");\n      const result = page.locator(\"#issue-3482-result\");\n\n      await expect(button).toHaveText(\"Increment 0\");\n      await expect(button).toHaveAttribute(\"data-count\", \"0\");\n      await expect(result).toHaveText(\"0\");\n      await expect(result).toHaveAttribute(\"data-count\", \"0\");\n\n      await button.click();\n      await expect(button).toHaveText(\"Increment 1\");\n      await expect(button).toHaveAttribute(\"data-count\", \"1\");\n      await expect(result).toHaveText(\"1\");\n      await expect(result).toHaveAttribute(\"data-count\", \"1\");\n    });\n\n    test(\"issue 3663\", async ({ page }) => {\n      const button = page.locator(\"#issue-3663-button\");\n      const result = page.locator(\".issue-3663-result\");\n      await expect(result).toHaveText([\"0\", \"0\", \"0\"]);\n      await button.click();\n      await expect(result).toHaveText([\"1\", \"1\", \"1\"]);\n      await button.click();\n      await expect(result).toHaveText([\"2\", \"2\", \"2\"]);\n      await button.click();\n      await expect(result).toHaveText([\"3\", \"3\", \"3\"]);\n    });\n\n    test(\"issue 3440\", async ({ page }) => {\n      const results = page.locator(\".issue-3440-results\");\n      const remove = page.locator(\"#issue-3440-remove\");\n      await expect(results).toHaveText([\n        \"my first blog\",\n        \"my second blogs\",\n        \"my third blog\",\n      ]);\n      await remove.click();\n      await expect(results).toHaveText([\"my first blog\", \"my second blogs\"]);\n      await remove.click();\n      await expect(results).toHaveText([\"my first blog\"]);\n      await remove.click();\n      await expect(results).toHaveText([]);\n    });\n\n    test(\"issue 4174\", async ({ page }) => {\n      const result = page.locator(\"#issue-4174-result\");\n      await expect(result).toHaveText(\"Store: visible-task\");\n    });\n\n    test(\"issue 4249\", async ({ page }) => {\n      const first = page.locator(\"#issue-4249-first\");\n      const second = page.locator(\"#issue-4249-second\");\n      const result = page.locator(\"#issue-4249-result\");\n\n      await expect(result).toHaveText(\"Status: No collision\");\n      await expect(result).toHaveAttribute(\"data-value\", \"no-collision\");\n      await second.fill(\"bar\");\n      await first.fill(\"bar\");\n      await expect(result).toHaveText(\"Status: Collision detected\");\n      await expect(result).toHaveAttribute(\"data-value\", \"collision\");\n\n      await first.fill(\"foo\");\n      await second.fill(\"foo\");\n      await expect(result).toHaveText(\"Status: Collision detected\");\n      await expect(result).toHaveAttribute(\"data-value\", \"collision\");\n    });\n\n    // This test is flaky, we have it working well in v2\n    test.skip(\"issue 4228\", async ({ page }) => {\n      const buttonA = page.locator(\"#issue-4228-button-a\");\n      const buttonB = page.locator(\"#issue-4228-button-b\");\n      const buttonC = page.locator(\"#issue-4228-button-c\");\n      const resultA = page.locator(\"#issue-4228-result-a\");\n      const resultB = page.locator(\"#issue-4228-result-b\");\n      const resultC = page.locator(\"#issue-4228-result-c\");\n      const resultTotal = page.locator(\"#issue-4228-result-total\");\n\n      await expect(resultA).toHaveText(\"0:0\");\n      await expect(resultB).toHaveText(\"0:0\");\n      await expect(resultC).toHaveText(\"0:0\");\n      await expect(resultTotal).toHaveText(\"0:0\");\n\n      await buttonA.click();\n      await expect(resultA).toHaveText(\"1:1\");\n      await expect(resultB).toHaveText(\"0:0\");\n      await expect(resultC).toHaveText(\"0:0\");\n      await expect(resultTotal).toHaveText(\"1:1\");\n\n      await buttonB.click();\n      await expect(resultA).toHaveText(\"1:1\");\n      await expect(resultB).toHaveText(\"1:1\");\n      await expect(resultC).toHaveText(\"0:0\");\n      await expect(resultTotal).toHaveText(\"2:2\");\n\n      await buttonC.click();\n      await expect(resultA).toHaveText(\"1:1\");\n      await expect(resultB).toHaveText(\"1:1\");\n      await expect(resultC).toHaveText(\"1:1\");\n      await expect(resultTotal).toHaveText(\"3:3\");\n\n      await buttonA.click();\n      await expect(resultA).toHaveText(\"2:2\");\n      await expect(resultB).toHaveText(\"1:1\");\n      await expect(resultC).toHaveText(\"1:1\");\n      await expect(resultTotal).toHaveText(\"4:4\");\n\n      await buttonB.click();\n      await expect(resultA).toHaveText(\"2:2\");\n      await expect(resultB).toHaveText(\"2:2\");\n      await expect(resultC).toHaveText(\"1:1\");\n      await expect(resultTotal).toHaveText(\"5:5\");\n\n      await buttonC.click();\n      await expect(resultA).toHaveText(\"2:2\");\n      await expect(resultB).toHaveText(\"2:2\");\n      await expect(resultC).toHaveText(\"2:2\");\n      await expect(resultTotal).toHaveText(\"6:6\");\n    });\n\n    test(\"issue 4368\", async ({ page }) => {\n      const input = page.locator(\"#issue-4368-input\");\n      const button = page.locator(\"#issue-4368-button\");\n\n      await expect(button).toHaveText(\"Text is empty\");\n      await expect(button).toBeDisabled();\n\n      await input.fill(\"foo\");\n\n      await expect(button).toHaveText(\"Example button\");\n      await expect(button).not.toBeDisabled();\n    });\n\n    test(\"issue 4868\", async ({ page }) => {\n      const btn1 = page.locator(\"#issue-4868-btn-1\");\n      const btn2 = page.locator(\"#issue-4868-btn-2\");\n      const json = page.locator(\"#issue-4868-json\");\n      const props = page.locator(\"#issue-4868-props\");\n      const usecomputed = page.locator(\"#issue-4868-usecomputed\");\n\n      await expect(json).toHaveText(\n        `{\"src\":\"https://placehold.co/400x400?text=1\",\"id\":1}`,\n      );\n      await expect(props).toHaveText(\n        `Card props.src: https://placehold.co/400x400?text=1`,\n      );\n      await expect(usecomputed).toHaveText(\n        `Card useComputed$: https://placehold.co/400x400?text=1&useComputed$`,\n      );\n\n      await btn2.click();\n\n      await expect(json).toHaveText(\n        `{\"src\":\"https://placehold.co/500x500?text=2\",\"id\":2}`,\n      );\n      await expect(props).toHaveText(\n        `Card props.src: https://placehold.co/500x500?text=2`,\n      );\n      await expect(usecomputed).toHaveText(\n        `Card useComputed$: https://placehold.co/500x500?text=2&useComputed$`,\n      );\n\n      await btn1.click();\n\n      await expect(json).toHaveText(\n        `{\"src\":\"https://placehold.co/400x400?text=1\",\"id\":1}`,\n      );\n      await expect(props).toHaveText(\n        `Card props.src: https://placehold.co/400x400?text=1`,\n      );\n      await expect(usecomputed).toHaveText(\n        `Card useComputed$: https://placehold.co/400x400?text=1&useComputed$`,\n      );\n    });\n\n    test(\"createSignal/createComputed$\", async ({ page }) => {\n      const button = page.locator(\"#many-signals-button\");\n      const result = page.locator(\"#many-signals-result\");\n      const doubles = page.locator(\"#many-doubles-result\");\n      await expect(result).toHaveText(\"0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \");\n      await expect(doubles).toHaveText(\"0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \");\n      await button.click();\n      await expect(result).toHaveText(\"1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \");\n      await expect(doubles).toHaveText(\"2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \");\n    });\n  }\n\n  tests();\n\n  test.describe(\"client rerender\", () => {\n    test.beforeEach(async ({ page }) => {\n      const toggleRender = page.locator(\"#rerender\");\n      await toggleRender.click();\n      await page.waitForTimeout(200);\n    });\n    tests();\n  });\n});\n\ntest.describe(\"regressions\", () => {\n  test(\"issue 5001\", async ({ page }) => {\n    await page.goto(\"/e2e/signals/issue-5001\");\n    await expect(page.locator(\".count\")).toHaveText(\"0\");\n    await page.locator(\"button\").click();\n    await expect(page.locator(\".count\")).toHaveText(\"1\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.slot.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"slot\", () => {\n  function tests() {\n    test(\"should update count\", async ({ page }) => {\n      const content1 = page.locator(\"#btn1\");\n      const content2 = page.locator(\"#btn2\");\n      const content3 = page.locator(\"#btn3\");\n      const btnCount = page.locator(\"#btn-count\");\n\n      await expect(content1).toHaveText(\"DEFAULT 0\");\n      await expect(content2).toHaveText(\"START 0\");\n      await expect(content3).toHaveText(\"INSIDE THING 0\");\n\n      // Count\n      await btnCount.click();\n      await expect(content1).toHaveText(\"DEFAULT 1\");\n      await expect(content2).toHaveText(\"START 1\");\n      await expect(content3).toHaveText(\"INSIDE THING 1\");\n\n      // Count\n      await btnCount.click();\n      await expect(content1).toHaveText(\"DEFAULT 2\");\n      await expect(content2).toHaveText(\"START 2\");\n      await expect(content3).toHaveText(\"INSIDE THING 2\");\n    });\n\n    test(\"should toggle buttons\", async ({ page }) => {\n      const content1 = page.locator(\"#btn1\");\n      const content2 = page.locator(\"#btn2\");\n      const content3 = page.locator(\"#btn3\");\n\n      const btnToggleButtons = page.locator(\"#btn-toggle-buttons\");\n\n      // btnToggleButtons\n      await btnToggleButtons.click();\n      await expect(content1).toHaveText(\"\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 0\", { useInnerText: true });\n      await expect(content3).toHaveText(\"\", { useInnerText: true });\n\n      // btnToggleButtons\n      await btnToggleButtons.click();\n      await expect(content1).toHaveText(\"DEFAULT 0\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 0\", { useInnerText: true });\n      await expect(content3).toHaveText(\"INSIDE THING 0\", {\n        useInnerText: true,\n      });\n    });\n\n    test(\"should toggle buttons with count\", async ({ page }) => {\n      const content1 = page.locator(\"#btn1\");\n      const content2 = page.locator(\"#btn2\");\n      const content3 = page.locator(\"#btn3\");\n\n      const btnToggleButtons = page.locator(\"#btn-toggle-buttons\");\n      const btnCount = page.locator(\"#btn-count\");\n\n      // btnToggleButtons\n      await btnToggleButtons.click();\n      await expect(content1).toHaveText(\"\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 0\", { useInnerText: true });\n      await expect(content3).toHaveText(\"\", { useInnerText: true });\n\n      // btnToggleButtons\n      await btnCount.click();\n      await expect(content1).toHaveText(\"\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 1\", { useInnerText: true });\n      await expect(content3).toHaveText(\"\", { useInnerText: true });\n\n      // btnToggleButtons\n      await btnToggleButtons.click();\n      await expect(content1).toHaveText(\"DEFAULT 1\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 1\", { useInnerText: true });\n      await expect(content3).toHaveText(\"INSIDE THING 1\", {\n        useInnerText: true,\n      });\n\n      // btnToggleButtons\n      await btnToggleButtons.click();\n      await expect(content1).toHaveText(\"\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 1\", { useInnerText: true });\n      await expect(content3).toHaveText(\"\", { useInnerText: true });\n\n      // btnToggleButtons\n      await btnToggleButtons.click();\n      await expect(content1).toHaveText(\"DEFAULT 1\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 1\", { useInnerText: true });\n      await expect(content3).toHaveText(\"INSIDE THING 1\", {\n        useInnerText: true,\n      });\n    });\n\n    test(\"should toggle content\", async ({ page }) => {\n      const content1 = page.locator(\"#btn1\");\n      const content2 = page.locator(\"#btn2\");\n      const content3 = page.locator(\"#btn3\");\n\n      const btnToggleContent = page.locator(\"#btn-toggle-content\");\n      const btnCount = page.locator(\"#btn-count\");\n\n      // btnToggleButtons\n      await btnToggleContent.click();\n      await expect(content1).toHaveText(\"\", { useInnerText: true });\n      await expect(content2).toHaveText(\"\", { useInnerText: true });\n      await expect(content3).toHaveText(\"\", { useInnerText: true });\n\n      // btnToggleButtons\n      await btnCount.click();\n      await btnToggleContent.click();\n      await expect(content1).toHaveText(\"DEFAULT 1\", { useInnerText: true });\n      await expect(content2).toHaveText(\"START 1\", { useInnerText: true });\n      await expect(content3).toHaveText(\"INSIDE THING 1\", {\n        useInnerText: true,\n      });\n    });\n\n    test(\"should toggle content and buttons\", async ({ page }) => {\n      const content1 = page.locator(\"#btn1\");\n      const content2 = page.locator(\"#btn2\");\n      const content3 = page.locator(\"#btn3\");\n\n      const btnToggleButtons = page.locator(\"#btn-toggle-buttons\");\n      const btnToggleContent = page.locator(\"#btn-toggle-content\");\n\n      // btnToggleButtons\n      await btnToggleButtons.click();\n      await page.waitForTimeout(100);\n      await btnToggleContent.click();\n      await page.waitForTimeout(100);\n      await btnToggleButtons.click();\n\n      await expect(content1).toHaveText(\"\", { useInnerText: true });\n      await expect(content2).toHaveText(\"\", { useInnerText: true });\n      await expect(content3).toHaveText(\"\", { useInnerText: true });\n    });\n\n    test(\"should toggle thing + count\", async ({ page }) => {\n      const content1 = page.locator(\"#btn1\");\n      const content2 = page.locator(\"#btn2\");\n      const content3 = page.locator(\"#btn3\");\n\n      const btnToggleThing = page.locator(\"#btn-toggle-thing\");\n      const btnCount = page.locator(\"#btn-count\");\n\n      // btnToggleButtons\n      await btnToggleThing.click();\n      await btnCount.click();\n      await expect(content1).toHaveText(\"DEFAULT 1\");\n      await expect(content2).toHaveText(\"START 1\");\n      await expect(content3).toHaveText(\"\");\n\n      await btnToggleThing.click();\n      await expect(content1).toHaveText(\"DEFAULT 1\");\n      await expect(content2).toHaveText(\"START 1\");\n      await expect(content3).toHaveText(\"INSIDE THING 1\");\n    });\n\n    test(\"should not lose q context\", async ({ page }) => {\n      const content3 = page.locator(\"#btn3\");\n      const projected = page.locator(\"#projected\");\n      const btnToggleThing = page.locator(\"#btn-toggle-thing\");\n      const btnCount = page.locator(\"#btn-count\");\n\n      await btnCount.click();\n      await expect(content3).toHaveText(\"INSIDE THING 1\", {\n        useInnerText: true,\n      });\n\n      // btnToggleButtons\n      await btnToggleThing.click();\n      await page.waitForTimeout(100);\n      await btnToggleThing.click();\n      await page.waitForTimeout(100);\n\n      // Click projected\n      await projected.click();\n\n      await expect(content3).toHaveText(\"INSIDE THING 0\", {\n        useInnerText: true,\n      });\n    });\n\n    test(\"should project cmp correctly into their selected slot\", async ({\n      page,\n    }) => {\n      const toggleBtn = page.locator(\"#toggle-child-slot\");\n      const slotChild = page.locator(\"#slot-child\");\n      const slotP = page.locator(\"#slot-p\");\n      const noslotP = page.locator(\"#noslot-p\");\n\n      await expect(slotChild).not.toBeHidden();\n      await expect(slotP).not.toBeHidden();\n      await expect(noslotP).not.toBeHidden();\n\n      await toggleBtn.click();\n\n      await expect(slotChild).not.toBeHidden();\n      await expect(slotP).not.toBeHidden();\n      await expect(noslotP).toBeHidden();\n    });\n\n    test(\"should toggle nested slot\", async ({ page }) => {\n      const toggleBtn = page.locator(\"#toggle-modal\");\n      const modalContent = page.locator(\"#modal-content\");\n\n      await expect(modalContent).not.toBeHidden();\n\n      await toggleBtn.click();\n      await expect(modalContent).toBeHidden();\n\n      await toggleBtn.click();\n      await expect(modalContent).not.toBeHidden();\n    });\n\n    test(\"issue 2688\", async ({ page }) => {\n      const result = page.locator(\"#issue-2688-result\");\n      const button = page.locator(\"#issue-2688-button\");\n      const count = page.locator(\"#btn-count\");\n      await expect(result).toHaveText(\"Alpha 0\", { useInnerText: true });\n      await button.click();\n      await expect(result).toHaveText(\"Bravo 0\", { useInnerText: true });\n      await button.click();\n      await expect(result).toHaveText(\"Alpha 0\", { useInnerText: true });\n      await count.click();\n      await expect(result).toHaveText(\"Alpha 1\", { useInnerText: true });\n      await count.click();\n      await expect(result).toHaveText(\"Alpha 2\", { useInnerText: true });\n      await button.click();\n      await expect(result).toHaveText(\"Bravo 2\", { useInnerText: true });\n      await count.click();\n      await expect(result).toHaveText(\"Bravo 3\", { useInnerText: true });\n      await count.click();\n      await expect(result).toHaveText(\"Bravo 4\", { useInnerText: true });\n      await button.click();\n      await expect(result).toHaveText(\"Alpha 4\", { useInnerText: true });\n      await count.click();\n      await expect(result).toHaveText(\"Alpha 5\", { useInnerText: true });\n    });\n\n    test(\"issue 2751\", async ({ page }) => {\n      const result = page.locator(\"#issue-2751-result\");\n      const button = page.locator(\"#issue-2751-toggle\");\n      await expect(result).toHaveText(\"Bogus 0 0 0\");\n      await button.click();\n      await expect(result).toHaveText(\"Nothing\");\n      await button.click();\n      await expect(result).toHaveText(\"Bogus 2 2 2\");\n      await button.click();\n      await expect(result).toHaveText(\"Nothing\");\n      await button.click();\n      await expect(result).toHaveText(\"Bogus 4 4 4\");\n      await button.click();\n      await expect(result).toHaveText(\"Nothing\");\n      await button.click();\n      await expect(result).toHaveText(\"Bogus 6 6 6\");\n    });\n\n    test(\"issue 3565\", async ({ page }) => {\n      const result = page.locator(\"#issue-3565-result\");\n      await expect(result).toHaveText(\"Own contentcontent projected\");\n    });\n\n    test(\"issue 3607\", async ({ page }) => {\n      const button = page.locator(\"#issue-3607-result\");\n      await expect(button).toHaveText(\"Load more\");\n      await button.click();\n      await expect(button).toHaveText(\"Loading...\");\n      await button.click();\n      await expect(button).toHaveText(\"Load more\");\n      await button.click();\n      await expect(button).toHaveText(\"Loading...\");\n    });\n\n    test(\"issue 3727\", async ({ page }) => {\n      const navigate = page.locator(\"#issue-3727-navigate\");\n      await navigate.click();\n      const results = page.locator(\"#issue-3727-results > li\");\n      const add = page.locator(\"#issue-3727-add\");\n      await expect(results).toHaveText([]);\n      await add.click();\n      await expect(results).toHaveText([\"item 0\"]);\n      await add.click();\n      await expect(results).toHaveText([\"item 0\", \"item 1\"]);\n    });\n\n    test(\"issue 4215\", async ({ page }) => {\n      const svg = page.locator(\"#issue-4215-svg\");\n      const toggle = page.locator(\"#issue-4215-toggle\");\n      async function getNamespaceURI() {\n        return (\n          await (\n            await svg.locator(\"path\").elementHandle()\n          )?.getProperty(\"namespaceURI\")\n        )?.jsonValue();\n      }\n\n      await expect(getNamespaceURI()).resolves.toBe(\n        \"http://www.w3.org/2000/svg\",\n      );\n      await toggle.click();\n      await toggle.click();\n      await expect(getNamespaceURI()).resolves.toBe(\n        \"http://www.w3.org/2000/svg\",\n      );\n    });\n\n    test(\"issue 4283\", async ({ page }) => {\n      const result = page.locator(\"#issue-4283-result\");\n      await expect(result).toHaveText(\n        `Hide until visible\\n\\nContent\\n\\nindex page`,\n        {\n          useInnerText: true,\n        },\n      );\n    });\n\n    test(\"issue 4658\", async ({ page }) => {\n      const button = page.locator(\"#issue-4658-toggle\");\n      const inner = page.locator(\"#issue-4658-inner\");\n      const top = page.locator(\"#issue-4658-top\");\n\n      await expect(inner).toHaveText(\"DDD\");\n      await expect(top).toHaveText(\"BBB\");\n\n      await button.click();\n\n      await expect(inner).toHaveText(\"CCC\");\n      await expect(top).toHaveText(\"AAA\");\n    });\n  }\n\n  test(\"issue 5270\", async ({ page }) => {\n    const button = page.locator(\"#issue-5270-button\");\n    const div = page.locator(\"#issue-5270-div\");\n    await expect(div).toBeHidden();\n    await button.click();\n    await expect(div).toBeVisible();\n    await expect(div).toHaveText(\"Ctx: hello\");\n  });\n\n  test(\"issue 5506\", async ({ page }) => {\n    const input = page.locator(\"#input-5506\");\n    await expect(input).toBeChecked();\n    await input.click();\n    await expect(input).not.toBeChecked();\n  });\n\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/slot\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  tests();\n\n  test.describe(\"client rerender\", () => {\n    test.beforeEach(async ({ page }) => {\n      const toggleRender = page.locator(\"#btn-toggle-render\");\n      const rendered = page.locator(\"#isRendered\");\n      await toggleRender.click();\n      await expect(rendered).toBeHidden();\n      await toggleRender.click();\n      await expect(rendered).toBeVisible();\n    });\n    tests();\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.streaming.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"streaming\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/streaming\", {\n      waitUntil: \"domcontentloaded\",\n    });\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should render correctly\", async ({ page }) => {\n    const ul = page.locator(\"ul > li\");\n    const ol = page.locator(\"ol > li\");\n    const cmps = page.locator(\".cmp\");\n\n    await expect(ul).toHaveCount(5);\n    await expect(ol).toHaveCount(10);\n    await expect(cmps).toHaveCount(5);\n  });\n\n  test(\"should rerender correctly\", async ({ page }) => {\n    const ul = page.locator(\"ul > li\");\n    const ol = page.locator(\"ol > li\");\n    const cmps = page.locator(\".cmp\");\n    const count = page.locator(\"button#count\");\n    await count.click();\n\n    await expect(count).toHaveText(\"Rerender: 1\");\n    await expect(ul).toHaveCount(5);\n    await expect(ol).toHaveCount(10);\n    await expect(cmps).toHaveCount(5);\n  });\n\n  test(\"should render in client correctly\", async ({ page }) => {\n    const ul = page.locator(\"ul > li\");\n    const ol = page.locator(\"ol > li\");\n    const cmps = page.locator(\".cmp\");\n    const count = page.locator(\"button#count\");\n    const rerender = page.locator(\"button#client-render\");\n    await count.click();\n    await expect(count).toHaveText(\"Rerender: 1\");\n\n    await rerender.click();\n    expect(rerender).toHaveText(\"Client rerender: 1\");\n    await expect(count).toHaveText(\"Rerender: 0\");\n    await count.click();\n\n    await expect(count).toHaveText(\"Rerender: 1\");\n    await expect(ul).toHaveCount(0);\n    await expect(ol).toHaveCount(0);\n    await expect(cmps).toHaveCount(5);\n\n    await count.click();\n    await expect(count).toHaveText(\"Rerender: 2\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.style.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"styles\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/styles\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      // console.log(msg.type(), msg.text());\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  runTests();\n\n  test.describe(\"client side\", () => {\n    test.beforeEach(async ({ page }) => {\n      const reload = page.locator(\"#reload\");\n      const renderCount = page.locator(\"#renderCount\");\n      const v = Number(await reload.getAttribute(\"v\"));\n\n      expect(v).toBe(0);\n      await expect(renderCount).toHaveText(`Render ${v}`);\n      await reload.click();\n      await expect(renderCount).toHaveText(`Render ${v + 1}`);\n    });\n    runTests();\n  });\n\n  function runTests() {\n    test(\"should load\", async ({ page }) => {\n      const parent = page.locator(\".parent\");\n      const child2 = page.locator(\"text=Child 2\");\n      const inline2 = page.locator(\"text=Inline 2\");\n\n      const addChild = page.locator(\"button#add-child\");\n\n      await expect(parent).toHaveClass(/count-10/);\n      await expect(parent).toHaveCSS(\"font-size\", \"200px\");\n      await expect(child2).toHaveCSS(\"font-size\", \"20px\");\n      await expect(inline2).toHaveCSS(\"font-size\", \"40px\");\n\n      const el = await page.$$(\"[q\\\\:style]\");\n      expect(el.length).toBe(9);\n      await addChild.click();\n      await expect(parent).toHaveClass(/count-11/);\n\n      const child10 = page.locator(\"text=Child 10\");\n      const inline10 = page.locator(\"text=Inline 10\");\n\n      await expect(parent).toHaveCSS(\"font-size\", \"200px\");\n      await expect(child2).toHaveCSS(\"font-size\", \"20px\");\n      await expect(inline2).toHaveCSS(\"font-size\", \"40px\");\n      await expect(child10).toHaveCSS(\"font-size\", \"20px\");\n      await expect(inline10).toHaveClass(/parent-child/);\n      await expect(inline10).toHaveCSS(\"font-size\", \"40px\");\n\n      const el2 = await page.$$(\"[q\\\\:style]\");\n      expect(el2.length).toBe(9);\n    });\n\n    test(\"issue 1945\", async ({ page }) => {\n      const btn = page.locator(\"#issue1945-btn\");\n      const h1 = page.locator(\"#issue1945-1\");\n      const h2 = page.locator(\"#issue1945-2\");\n      const h3 = page.locator(\"#issue1945-3\");\n      const h4 = page.locator(\"#issue1945-4\");\n      const h5 = page.locator(\"#issue1945-5\");\n\n      await expect(h1).toBeVisible();\n      await expect(h2).toBeVisible();\n      await expect(h3).toBeVisible();\n      await expect(h4).toBeVisible();\n      await expect(h5).not.toBeVisible();\n\n      await btn.click();\n\n      await expect(h1).toBeVisible();\n      await expect(h2).toBeVisible();\n      await expect(h3).toBeVisible();\n      await expect(h4).toBeVisible();\n      await expect(h5).toBeVisible();\n      await expect(h1).toHaveCSS(\"background-color\", \"rgb(0, 0, 255)\");\n      await expect(h2).toHaveCSS(\"background-color\", \"rgb(0, 0, 255)\");\n      await expect(h3).toHaveCSS(\"background-color\", \"rgb(0, 0, 255)\");\n      await expect(h4).toHaveCSS(\"background-color\", \"rgb(0, 0, 255)\");\n      await expect(h5).toHaveCSS(\"background-color\", \"rgb(0, 0, 255)\");\n    });\n\n    test(\"issue scoped fine grained\", async ({ page }) => {\n      const button = page.locator(\"#issue-scoped-fine-grained\");\n      await expect(button).toHaveCSS(\"background-color\", \"rgb(0, 128, 0)\");\n      await button.click();\n      await expect(button).toHaveClass(/odd/);\n      await expect(button).toHaveCSS(\"background-color\", \"rgb(0, 0, 255)\");\n      await button.click();\n      await expect(button).toHaveClass(/even/);\n      await expect(button).toHaveCSS(\"background-color\", \"rgb(0, 128, 0)\");\n    });\n  }\n});\n"
  },
  {
    "path": "starters/e2e/e2e.sync-qrl.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"resuming\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/sync-qrl\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should synchronously prevent default\", async ({ page }) => {\n    const input = page.locator(\"#preventDefaultInput\");\n\n    await expect(input).not.toBeChecked();\n    // clicking checkbox toggles the checked state.\n    await input.click();\n    await expect(input).toBeChecked();\n\n    await input.evaluate((el) =>\n      el.setAttribute(\"shouldPreventDefault\", \"true\"),\n    );\n\n    // clicking checkbox does not toggles the checked state, because default is prevented.\n    await input.click();\n    await expect(input).toBeChecked();\n    await expect(await input.getAttribute(\"prevented\")).toBeDefined();\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.toggle.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"toggle\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/toggle\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should load\", async ({ page }) => {\n    const title = page.locator(\"h1\");\n    const mount = page.locator(\"#mount\");\n    const root = page.locator(\"#root\");\n    const logs = page.locator(\"#logs\");\n    const btnToggle = page.locator(\"button#toggle\");\n    const btnIncrement = page.locator(\"button#increment\");\n\n    let logsStr = \"Logs: Log(0)\";\n    await expect(title).toHaveText(\"ToggleA\");\n    await expect(mount).toHaveText(\"mounted in server\");\n    await expect(root).toHaveText(\"hello from root (0/0)\");\n    await expect(logs).toHaveText(logsStr);\n\n    // ToggleA\n    await btnToggle.click();\n    logsStr += \"Child(0)ToggleA()Child(0)\";\n\n    await expect(title).toHaveText(\"ToggleB\");\n    await expect(mount).toHaveText(\"mounted in client\");\n    await expect(root).toHaveText(\"hello from root (0/0)\");\n    await expect(logs).toHaveText(logsStr);\n\n    // Increment\n    await btnIncrement.click();\n    logsStr += \"Log(1)Child(1)\";\n\n    await expect(title).toHaveText(\"ToggleB\");\n    await expect(mount).toHaveText(\"mounted in client\");\n    await expect(root).toHaveText(\"hello from root (1/1)\");\n    await expect(logs).toHaveText(logsStr);\n\n    // ToggleB\n    await btnToggle.click();\n    logsStr += \"Child(1)ToggleB()\";\n\n    await expect(title).toHaveText(\"ToggleA\");\n    await expect(mount).toHaveText(\"mounted in client\");\n    await expect(root).toHaveText(\"hello from root (1/1)\");\n    await expect(logs).toHaveText(logsStr);\n\n    // Increment\n    await btnIncrement.click();\n    logsStr += \"Log(2)Child(2)\";\n\n    await expect(title).toHaveText(\"ToggleA\");\n    await expect(mount).toHaveText(\"mounted in client\");\n    await expect(root).toHaveText(\"hello from root (2/2)\");\n    await expect(logs).toHaveText(logsStr);\n\n    // ToggleA + increment\n    await btnToggle.click();\n    await btnIncrement.click();\n    logsStr += \"Child(2)ToggleA()Log(3)Child(3)\";\n\n    await expect(title).toHaveText(\"ToggleB\");\n    await expect(mount).toHaveText(\"mounted in client\");\n    await expect(root).toHaveText(\"hello from root (3/3)\");\n    await expect(logs).toHaveText(logsStr);\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.two-listeners.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"two-listeners\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/two-listeners\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should support two QRLs on event\", async ({ page }) => {\n    const button = page.locator(\".two-listeners\");\n    await button.click();\n    await expect(button).toContainText(\"2 / 3\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.use-id.spec.ts",
    "content": "import { test, expect, Locator } from \"@playwright/test\";\n\ntest.describe(\"use-id\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/use-id\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n    // await page.waitForLoadState('networkidle');\n    await page.waitForTimeout(500); // Wait for useVisibleTask$\n  });\n\n  test(\"Creates unique ids and ensure no collisions\", async ({ page }) => {\n    const totalIdsLocator = page.locator(\"#totalIds\");\n    await totalIdsLocator.isVisible();\n    const totalIdsText = await totalIdsLocator.textContent();\n    const totalIds = parseInt(totalIdsText || \"-1\");\n    await expect(totalIds).toBeGreaterThan(0); // MAKE SURE WE HAVE SOME IDS\n\n    const validIdsLocator = page.locator(\"#validIds\");\n    const validIdsText = await validIdsLocator.textContent();\n    const validIds = parseInt(validIdsText || \"-1\");\n\n    const collisionsLocator = page.locator(\"#collisions\");\n    const collisionsText = await collisionsLocator.textContent();\n    const collisions = parseInt(collisionsText || \"-1\");\n\n    //\n    // COMPARE VALUES AS AN OBJECT TO SHOW THE ACTUAL RESULTS IN THE TEST REPORT\n    //\n    const actual = {\n      collisions,\n      totalIds,\n      validIds,\n    };\n\n    const expected = {\n      collisions: 0,\n      totalIds,\n      validIds,\n    };\n\n    await expect(actual).toMatchObject(expected);\n  });\n});\n"
  },
  {
    "path": "starters/e2e/e2e.watch.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest.describe(\"watch\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/e2e/watch\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"should watch correctly\", async ({ page }) => {\n    const server = page.locator(\"#server-content\");\n\n    const parent = page.locator(\"#parent\");\n    const child = page.locator(\"#child\");\n    const debounced = page.locator(\"#debounced\");\n    const addButton = page.locator(\"#add\");\n\n    await expect(server).toHaveText(\"comes from server\");\n    await expect(parent).toHaveText(\"2\");\n    await expect(child).toHaveText(\"2 / 4\");\n    await expect(debounced).toHaveText(\"Debounced: 0\");\n\n    await addButton.click();\n\n    await expect(parent).toHaveText(\"3\");\n    await expect(server).toHaveText(\"comes from server\");\n    await expect(child).toHaveText(\"3 / 6\");\n    await expect(debounced).toHaveText(\"Debounced: 0\");\n\n    await addButton.click();\n\n    await expect(parent).toHaveText(\"4\");\n    await expect(server).toHaveText(\"comes from server\");\n    await expect(child).toHaveText(\"4 / 8\");\n    await expect(debounced).toHaveText(\"Debounced: 0\");\n\n    // Wait for debouncer\n    await expect(debounced).toHaveText(\"Debounced: 8\");\n    await expect(server).toHaveText(\"comes from server\");\n    await expect(parent).toHaveText(\"4\");\n    await expect(child).toHaveText(\"4 / 8\");\n  });\n\n  test(\"issue-1766\", async ({ page }) => {\n    const result = page.locator(\"#issue-1766\");\n    const loc = page.locator(\"#issue-1766-loc\");\n\n    await expect(loc).toHaveText(\"Loc: /ROOT\");\n    await expect(result).toHaveText(\"---\");\n\n    const showBtn1 = page.locator(\"#show-btn\");\n    await showBtn1.click();\n\n    const showBtn2 = page.locator(\"#show-btn-2\");\n    await showBtn2.click();\n\n    await expect(loc).toHaveText(\"Loc: /ROOT\");\n    await expect(result).toHaveText(\"watch ran\");\n\n    const linkBtn = page.locator(\"#link-navigate\");\n    await linkBtn.click();\n    await expect(loc).toHaveText(\"Loc: /PAGE\");\n    await expect(result).toHaveText(\"watch ran\");\n  });\n\n  test(\"issue-2972\", async ({ page }) => {\n    const result = page.locator(\"#issue-2972\");\n    await expect(result).toHaveText(\"passed\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/global.d.ts",
    "content": "declare global {\n  namespace PlaywrightTest {\n    interface Matchers<R> {\n      hasAttribute(a: string): Promise<R>;\n    }\n  }\n}\n\nexport {};\n"
  },
  {
    "path": "starters/e2e/qwikcity/actions.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"actions\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    MPA_and_SPA_tests();\n  });\n\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: true });\n    MPA_and_SPA_tests();\n\n    test.describe(\"issue4679\", () => {\n      test(\"should serialize Form without action\", async ({ page }) => {\n        await page.goto(\"/qwikcity-test/issue4679/\");\n        const button = page.locator(\"#issue-4679-button\");\n        await expect(button).toHaveText(\"Toggle False\");\n        await button.click();\n        await expect(button).toHaveText(\"Toggle True\");\n      });\n    });\n    test.describe(\"multiple-handlers\", () => {\n      test(\"should allow multiple handlers\", async ({ page }) => {\n        await page.goto(\"/qwikcity-test/actions/multiple-handlers/\");\n        const success = page.locator(\"#multiple-handlers-success\");\n\n        await expect(success).toBeHidden();\n        await page.locator(\"#multiple-handlers-button\").click();\n        await expect(success).toHaveText(\n          '{\"arrayOld\":[\"0\",\"1\"],\"arrayNew\":[\"0\",\"1\"],\"people\":[{\"name\":\"Fred\"},{\"name\":\"Sam\"}]}',\n        );\n        const finished = page.locator(\"#multiple-handlers-finished\");\n        await expect(finished).toContainText(\"true\");\n      });\n    });\n  });\n\n  function MPA_and_SPA_tests() {\n    test.describe(\"login form\", () => {\n      test.beforeEach(async ({ page }) => {\n        await page.goto(\"/qwikcity-test/actions/\");\n      });\n\n      test(\"should run actions programmatically\", async ({\n        page,\n        javaScriptEnabled,\n      }) => {\n        if (javaScriptEnabled) {\n          const success = page.locator(\"#other-success\");\n          const btn = page.locator(\"#other-button\");\n\n          await expect(success).toBeHidden();\n          await btn.click();\n          await expect(success).toHaveText(\"Success\");\n          await expect(page.locator(\"#other-store\")).toHaveText(\n            'false:::{\"success\":true}',\n          );\n        }\n      });\n\n      test(\"should run actions\", async ({ page, javaScriptEnabled }) => {\n        const other = page.locator(\"#other-store\");\n        const running = page.locator(\"#running\");\n        const errorMessage = page.locator(\"#form-error\");\n        const successMessage = page.locator(\"#form-success\");\n        const username = page.locator(\"#label-username > input\");\n        const usernameError = page.locator(\"#label-username > p\");\n        const code = page.locator(\"#label-code > input\");\n        const codeError = page.locator(\"#label-code > p\");\n        const submit = page.locator(\"#submit\");\n\n        await expect(other).toHaveText(\"false:::\");\n        await submit.click();\n        await expect(usernameError).toHaveText(\n          \"String must contain at least 3 character(s)\",\n        );\n        await expect(codeError).toBeHidden();\n        await expect(other).toHaveText(\"false:::\");\n\n        await username.fill(\"Manuel\");\n        await code.fill(\"text\");\n        await submit.click();\n        await expect(usernameError).toBeHidden();\n        await expect(codeError).toHaveText(\"Expected number, received nan\");\n        await expect(username).toHaveValue(\"Manuel\");\n        await expect(code).toHaveValue(\"text\");\n        await expect(other).toHaveText(\"false:::\");\n\n        await username.clear();\n        await username.fill(\"Ma\");\n        await submit.click();\n        await expect(usernameError).toHaveText(\n          \"String must contain at least 3 character(s)\",\n        );\n        await expect(codeError).toHaveText(\"Expected number, received nan\");\n        await expect(username).toHaveValue(\"Ma\");\n        await expect(code).toHaveValue(\"text\");\n        await expect(other).toHaveText(\"false:::\");\n\n        await username.clear();\n        await username.fill(\"Test\");\n        await code.clear();\n        await code.fill(\"123\");\n        await submit.click();\n        await expect(usernameError).toBeHidden();\n        await expect(codeError).toBeHidden();\n        await expect(username).toHaveValue(\"Test\");\n        await expect(code).toHaveValue(\"123\");\n        await expect(errorMessage).toHaveText(\"Invalid username or code\");\n        await expect(other).toHaveText(\"false:::\");\n\n        await username.clear();\n        await username.fill(\"admin\");\n        await submit.click();\n        if (javaScriptEnabled) {\n          await expect(running).toHaveText(\"Running...\");\n        }\n        await expect(running).toBeHidden();\n        await expect(errorMessage).toBeHidden();\n        await expect(successMessage).toHaveText(\"this is the secret\");\n        await expect(other).toHaveText(\"false:::\");\n\n        await username.clear();\n        await username.fill(\"redirect\");\n        await submit.click();\n\n        await expect(page).toHaveURL(\"/qwikcity-test/\");\n      });\n\n      test(\"issue with action\", async ({ page }) => {\n        const errorMessage = page.locator(\"#form-error\");\n        const username = page.locator(\"#label-username > input\");\n        const code = page.locator(\"#label-code > input\");\n        const submit = page.locator(\"#submit\");\n\n        await username.fill(\"123\");\n        await submit.click();\n        await expect(errorMessage).toHaveText(\"Invalid username or code\");\n        await expect(username).toHaveValue(\"123\");\n        await expect(code).toHaveValue(\"\");\n      });\n    });\n\n    test.describe(\"issue2644\", () => {\n      test(\"should submit items\", async ({ page }) => {\n        await page.goto(\"/qwikcity-test/issue2644/\");\n        await page.locator(\"#issue2644-input\").fill(\"AAA\");\n        await page.locator(\"#issue2644-submit\").click();\n\n        await expect(page.locator(\"#issue2644-list > li\")).toHaveText([\"AAA\"]);\n        expect(page).toHaveURL(\"/qwikcity-test/issue2644/other/\");\n\n        await page.locator(\"#issue2644-input\").fill(\"BBB\");\n        await page.locator(\"#issue2644-submit\").click();\n        expect(page).toHaveURL(new RegExp(\"/qwikcity-test/issue2644/other/\"));\n\n        await expect(page.locator(\"#issue2644-list > li\")).toHaveText([\n          \"AAA\",\n          \"BBB\",\n        ]);\n      });\n    });\n\n    test.describe(\"issue3497\", () => {\n      test(\"should parse formdata\", async ({ page }) => {\n        await page.goto(\"/qwikcity-test/actions/issue3497/\");\n        const success = page.locator(\"#issue3497-success\");\n\n        await expect(success).toBeHidden();\n        await page.locator(\"#issue3497-button\").click();\n        await expect(success).toHaveText(\n          '{\"credentials\":{\"username\":\"user\",\"password\":\"pass\"},\"array\":[\"1\",\"2\"]}',\n        );\n        await expect(true).toBeTruthy();\n      });\n    });\n\n    test.describe(\"issue3183\", () => {\n      test(\"should parse dot notation index array formdata\", async ({\n        page,\n      }) => {\n        await page.goto(\"/qwikcity-test/actions/issue3183/\");\n        const success = page.locator(\"#issue3183-success\");\n\n        await expect(success).toBeHidden();\n        await page.locator(\"#issue3183-button\").click();\n        await expect(success).toHaveText(\n          '{\"arrayOld\":[\"0\",\"1\"],\"arrayNew\":[\"0\",\"1\"],\"people\":[{\"name\":\"Fred\"},{\"name\":\"Sam\"}]}',\n        );\n      });\n    });\n  }\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/adapter.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"Qwik City Adapter\", () => {\n  test(\"should have simple Not Found response for middleware/node static files\", async ({\n    page: api,\n  }) => {\n    const nestedUrl = \"by/pass/other-routes-for-testing\";\n    const rsp = (await api.goto(\n      `/qwikcity-test/build/${nestedUrl}/a-random-file-after-that.js`,\n    ))!;\n    expect(rsp.status()).toBe(404);\n    expect(rsp.headers()[\"content-type\"]).toBe(\"text/html; charset=utf-8\");\n\n    const data = await rsp.text();\n    expect(data).toBe(\"Not Found\");\n    // \"Resource Not Found\" is replaced in the development server\n    expect(data).not.toBe(\"Resource Not Found\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/api.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"Qwik City API\", () => {\n  test(\"Qwik City API\", async ({ page: api }) => {\n    const rsp = (await api.goto(\"/qwikcity-test/api/data.json\"))!;\n    expect(rsp.status()).toBe(200);\n    expect(rsp.headers()[\"content-type\"]).toBe(\n      \"application/json; charset=utf-8\",\n    );\n\n    const data = await rsp.json();\n    expect(data.method).toBe(\"GET\");\n    expect(data.node).toBe(process.versions.node);\n    expect(data.shared).toBe(\"from root\");\n  });\n\n  test(\"Qwik City API, params\", async ({ page: api }) => {\n    const rsp = (await api.goto(\"/qwikcity-test/api/builder.io/oss.json\"))!;\n    expect(rsp.status()).toBe(200);\n    expect(rsp.headers()[\"content-type\"]).toBe(\n      \"application/json; charset=utf-8\",\n    );\n\n    const data = await rsp.json();\n    expect(data.method).toBe(\"GET\");\n    expect(data.node).toBe(process.versions.node);\n    expect(data.params.org).toBe(\"builder.io\");\n    expect(data.params.user).toBe(\"oss\");\n  });\n\n  test(\"Page route GET, custom json response\", async ({ page: api }) => {\n    const rsp = (await api.goto(\"/qwikcity-test/products/hat/?json=true\"))!;\n    expect(rsp.status()).toBe(200);\n    expect(rsp.headers()[\"content-type\"]).toBe(\n      \"application/json; charset=utf-8\",\n    );\n\n    const clientData = await rsp.json();\n    expect(clientData.productId).toBe(\"hat\");\n    expect(clientData.price).toBe(\"$21.96\");\n  });\n\n  test(\"PUT endpoint on page\", async ({ page }) => {\n    const rsp = (await page.goto(\"/qwikcity-test/api/\"))!;\n    expect(rsp.status()).toBe(200);\n    expect(rsp.headers()[\"content-type\"]).toBe(\"text/html; charset=utf-8\");\n\n    const btnPut = page.locator(\"[data-test-api-onput]\");\n    expect(await btnPut.textContent()).toBe(\"onPut\");\n    await btnPut.click();\n    await page.waitForSelector(\".onput-success\");\n    expect(await btnPut.textContent()).toBe(\"PUT test\");\n  });\n\n  test(\"POST endpoint on page\", async ({ page }) => {\n    const rsp = (await page.goto(\"/qwikcity-test/api/\"))!;\n    expect(rsp.status()).toBe(200);\n    expect(rsp.headers()[\"content-type\"]).toBe(\"text/html; charset=utf-8\");\n\n    const btnPut = page.locator(\"[data-test-api-onpost]\");\n    expect(await btnPut.textContent()).toBe(\n      \"onPost (accept: application/json)\",\n    );\n    await btnPut.click();\n    await page.waitForSelector(\".onpost-success\");\n    expect(await btnPut.textContent()).toBe(\"POST test\");\n  });\n\n  test('redirect from product page because of \"querystring-test\" exists', async ({\n    page,\n  }) => {\n    const rsp = (await page.goto(\n      \"/qwikcity-test/products/hat/?querystring-test=true\",\n    ))!;\n    expect(new URL(rsp.url()).pathname).toBe(\"/qwikcity-test/\");\n  });\n\n  test(\"endpoint with a dot in the pathname, with a trailing slash\", async ({\n    page,\n  }) => {\n    const rsp = (await page.goto(\"/qwikcity-test/issue2441/abc.endpoint/\"))!;\n    expect(rsp.status()).toBe(200);\n    const clientData = await rsp.json();\n    expect(clientData.issue).toBe(2441);\n  });\n\n  test(\"endpoint with a dot in the pathname, without a trailing slash\", async ({\n    page,\n  }) => {\n    const rsp = (await page.goto(\"/qwikcity-test/issue2441/abc.endpoint\"))!;\n    expect(rsp.status()).toBe(200);\n    const clientData = await rsp.json();\n    expect(clientData.issue).toBe(2441);\n  });\n\n  test(\"page with a dot in the pathname, with a trailing slash\", async ({\n    page,\n  }) => {\n    const rsp = (await page.goto(\"/qwikcity-test/issue2441/abc.page/\"))!;\n    expect(rsp.status()).toBe(200);\n    const h1 = page.locator(\"#issue2441\");\n    expect(await h1.textContent()).toBe(\"Issue 2441\");\n  });\n\n  test(\"page with a dot in the pathname, without a trailing slash\", async ({\n    page,\n  }) => {\n    const rsp = (await page.goto(\"/qwikcity-test/issue2441/abc.page\"))!;\n    expect(rsp.status()).toBe(200);\n    const h1 = page.locator(\"#issue2441\");\n    expect(await h1.textContent()).toBe(\"Issue 2441\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/auth.spec.ts",
    "content": "import { test } from \"@playwright/test\";\nimport { assertPage, getPage, linkNavigate, load } from \"./util.js\";\n\ntest.describe(\"Qwik City Auth\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: true });\n    tests();\n  });\n});\n\nfunction tests() {\n  test(\"Qwik City Auth\", async ({ context, javaScriptEnabled }) => {\n    const ctx = await load(\n      context,\n      javaScriptEnabled,\n      \"/qwikcity-test/sign-in/\",\n    );\n\n    /***********  Sign In  ***********/\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/sign-in/\",\n      title: \"Sign In - Qwik\",\n      layoutHierarchy: [\"root\", \"auth\"],\n      h1: \"Sign In\",\n      activeHeaderLink: \"Sign In\",\n    });\n\n    let page = getPage(ctx);\n    await page.focus('input[name=\"username\"]');\n    await page.keyboard.type(\"quick\");\n\n    await page.focus('input[name=\"password\"]');\n    await page.keyboard.type(\"dev\");\n\n    await page.focus('input[name=\"confirmPassword\"]');\n    await page.keyboard.type(\"dev\");\n\n    /***********  Unsuccessful Sign In  ***********/\n    await linkNavigate(ctx, \"[data-test-sign-in]\", 403);\n\n    page = getPage(ctx);\n    await page.focus('input[name=\"username\"]');\n    await page.keyboard.type(\"qwik\");\n\n    await page.focus('input[name=\"password\"]');\n    await page.keyboard.type(\"dev\");\n\n    await page.focus('input[name=\"confirmPassword\"]');\n    await page.keyboard.type(\"deva\");\n\n    /***********  Unsuccessful Sign In  ***********/\n    await linkNavigate(ctx, \"[data-test-sign-in]\", 400);\n\n    page = getPage(ctx);\n    await page.focus('input[name=\"username\"]');\n    await page.keyboard.type(\"qwik\");\n\n    await page.focus('input[name=\"password\"]');\n    await page.keyboard.type(\"dev\");\n\n    await page.focus('input[name=\"confirmPassword\"]');\n    await page.keyboard.type(\"dev\");\n\n    /***********  Successful Sign In, Dashboard  ***********/\n    await linkNavigate(ctx, \"[data-test-sign-in]\", 200);\n\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/dashboard/\",\n      title: \"Dashboard Home - Qwik\",\n      layoutHierarchy: [\"dashboard\"],\n      h1: \"Dashboard\",\n    });\n\n    /***********  Go to Dashboard again, shouldn't redirect if signed in  ***********/\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/dashboard/\",\n      title: \"Dashboard Home - Qwik\",\n      layoutHierarchy: [\"dashboard\"],\n      h1: \"Dashboard\",\n    });\n\n    /***********  Go to Dashboard settings, shouldn't redirect if signed in  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"dashboard-settings\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/dashboard/settings/\",\n      title: \"Dashboard Settings - Qwik\",\n      layoutHierarchy: [\"dashboard\"],\n      h1: \"Settings\",\n    });\n\n    /***********  Sign out  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"dashboard-sign-out\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/sign-in/\",\n    });\n\n    /***********  Dashboard not signed in, redirected to signed in  ***********/\n    page = getPage(ctx);\n    await page.goto(\"/qwikcity-test/dashboard/\");\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/sign-in/\",\n      title: \"Sign In - Qwik\",\n      layoutHierarchy: [\"root\", \"auth\"],\n      h1: \"Sign In\",\n      activeHeaderLink: \"Sign In\",\n    });\n  });\n}\n"
  },
  {
    "path": "starters/e2e/qwikcity/catchall.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"Qwik City Catchall\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: true });\n    tests();\n  });\n});\n\nfunction tests() {\n  test(\"Handled Catchall\", async ({ context }) => {\n    const page = await context.newPage();\n    const response = (await page.goto(\"/qwikcity-test/catchall/\"))!;\n    const status = response.status();\n    expect(status).toBe(200);\n    await expect(page.locator('[data-test-params=\"catchall\"]')).toHaveText(\n      \"catchall\",\n    );\n  });\n\n  test(\"Aborted Catchall\", async ({ context }) => {\n    const page = await context.newPage();\n    const response = (await page.goto(\"/qwikcity-test/catchall-abort/\"))!;\n    const status = response.status();\n    expect(status).toBe(404);\n  });\n\n  test(\"Error Catchall\", async ({ context }) => {\n    const page = await context.newPage();\n    const response = (await page.goto(\"/qwikcity-test/catchall-error/\"))!;\n    const status = response.status();\n    expect(status).toBe(500);\n  });\n}\n"
  },
  {
    "path": "starters/e2e/qwikcity/error.spec.ts",
    "content": "import { test } from \"@playwright/test\";\n\ntest.describe(\"Qwik City Error boundary\", () => {\n  test(\"should catch error\", async ({ page }) => {\n    await page.goto(\"/qwikcity-test/error\");\n\n    page.getByRole(\"button\", { name: \"Throw error\" }).click();\n\n    await page.waitForSelector('div:has-text(\"Caught error: Boom!\")');\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/fallback.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest(\"Qwik City Fallback\", async ({ context, javaScriptEnabled }) => {\n  const page = await context.newPage();\n  const response = (await page.goto(\"/qwikcity-test/idk/\"))!;\n\n  expect(response.status()).toBe(404);\n\n  const title = page.locator(\"title\");\n  expect(await title.innerText()).toBe(`404 Resource Not Found`);\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/loaders.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"loaders\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: true });\n    tests();\n  });\n\n  function tests() {\n    test(\"should run loaders\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/loaders/hola\");\n\n      const date = page.locator(\"#date\");\n      const slow = page.locator(\"#slow\");\n\n      const title = page.locator(\"title\");\n      const nestedDate = page.locator(\"#nested-date\");\n      const nestedDep = page.locator(\"#nested-dep\");\n      const nestedName = page.locator(\"#nested-name\");\n      const formName = page.locator(\"#form-name\");\n      const metaDate = page.locator('meta[name=\"date\"]');\n      const metaDep = page.locator('meta[name=\"dep\"]');\n\n      const submit = page.locator(\"#form-submit\");\n\n      await expect(title).toHaveText(\"Loaders - Qwik\", { useInnerText: true });\n      await expect(date).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(slow).toHaveText(\"slow: 123\");\n      await expect(nestedDate).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(nestedDep).toHaveText(\"dep: 84\");\n      await expect(metaDate).toHaveAttribute(\n        \"content\",\n        \"2021-01-01T00:00:00.000Z\",\n      );\n      await expect(metaDep).toHaveAttribute(\"content\", \"42\");\n\n      await expect(nestedName).toHaveText(\"name: hola\");\n      await formName.fill(\"Manuel\");\n      await submit.click();\n      await expect(title).toHaveText(\"Loaders - ACTION: Manuel - Qwik\", {\n        useInnerText: true,\n      });\n      await expect(date).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(slow).toHaveText(\"slow: 123\");\n      await expect(nestedDate).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(nestedDep).toHaveText(\"dep: 84\");\n      await expect(nestedName).toHaveText(\"name: Manuel\");\n\n      await page.locator(\"#link-stuff\").click();\n      await expect(title).toHaveText(\"Loaders - Qwik\", { useInnerText: true });\n      await expect(date).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(slow).toHaveText(\"slow: 123\");\n      await expect(nestedDate).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(nestedDep).toHaveText(\"dep: 84\");\n      await expect(nestedName).toHaveText(\"name: stuff\");\n\n      await page.locator(\"#link-welcome\").click();\n      await expect(title).toHaveText(\"Loaders - Qwik\", { useInnerText: true });\n      await expect(date).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(slow).toHaveText(\"slow: 123\");\n      await expect(nestedDate).toHaveText(\"date: 2021-01-01T00:00:00.000Z\");\n      await expect(nestedDep).toHaveText(\"dep: 84\");\n      await expect(nestedName).toHaveText(\"name: welcome\");\n    });\n\n    test(\"should pass reactivity issue\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/issue-loader\");\n\n      const realDate = page.locator(\"#real-date\");\n      const value = await realDate.textContent();\n      const submit = page.locator(\"#submit\");\n\n      await submit.click();\n\n      await expect(realDate).not.toHaveText(value!);\n    });\n\n    test(\"serialization of loaders\", async ({ page, javaScriptEnabled }) => {\n      await page.goto(\"/qwikcity-test/issue-loader-serialization/\");\n      const loaderData = page.locator(\".loader-data\");\n\n      await expect(loaderData).toHaveText([\n        javaScriptEnabled ? \"loader-cmp1\" : \"empty\",\n        \"empty\",\n        \"loader-cmp4\",\n        '{\"message\":\"loader-cmp5\"}',\n      ]);\n\n      if (javaScriptEnabled) {\n        await page.locator(\"#update-cmp2\").click();\n        await expect(loaderData).toHaveText([\n          \"loader-cmp1\",\n          \"loader-cmp2\",\n          \"loader-cmp4\",\n          '{\"message\":\"loader-cmp5\"}',\n        ]);\n\n        await page.locator(\"#update-cmp3\").click();\n        await expect(loaderData).toHaveText([\n          \"loader-cmp1\",\n          \"loader-cmp2\",\n          \"loader-cmp3\",\n          \"loader-cmp4\",\n          '{\"message\":\"loader-cmp5\"}',\n        ]);\n\n        await page.locator(\"#update-cmp5\").click();\n        await expect(loaderData).toHaveText([\n          \"loader-cmp1\",\n          \"loader-cmp2\",\n          \"loader-cmp3\",\n          \"loader-cmp4\",\n          '{\"message\":\"loader-cmp5\"}',\n        ]);\n      }\n    });\n    test(\"should modify ServerError in middleware\", async ({ page }) => {\n      const response = await page.goto(\"/qwikcity-test/loaders/loader-error\");\n      const contentType = await response?.headerValue(\"Content-Type\");\n      const status = response?.status();\n\n      expect(status).toEqual(401);\n      expect(contentType).toEqual(\"text/html; charset=utf-8\");\n      const body = page.locator(\"body\");\n      await expect(body).toContainText(\"loader-error-caught\");\n    });\n    test(\"should return html with uncaught ServerErrors thrown in loaders\", async ({\n      page,\n    }) => {\n      const response = await page.goto(\n        \"/qwikcity-test/loaders/loader-error/uncaught-server\",\n      );\n      const contentType = await response?.headerValue(\"Content-Type\");\n      const status = response?.status();\n\n      expect(status).toEqual(401);\n      expect(contentType).toEqual(\"text/html; charset=utf-8\");\n      const body = page.locator(\"body\");\n      await expect(body).toContainText(\"server-error-data\");\n    });\n  }\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/locale.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"Qwik City locale API\", () => {\n  test(\"pass locale to Qwik\", async ({ page }) => {\n    await page.goto(\"/qwikcity-test/locale\");\n    const locale = page.locator(\".locale\");\n    const qContainer = page.locator(\"[q\\\\:container]\");\n    await expect(locale).toHaveText(\"test-locale\");\n    await expect(qContainer).toHaveAttribute(\"q:locale\", \"test-locale\");\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/location.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"Qwik City API: useLocation\", () => {\n  test(\"should take x-forwarded headers into account\", async ({ page }) => {\n    page.setExtraHTTPHeaders({\n      \"X-Forwarded-Host\": \"override-server\",\n      \"X-Forwarded-Proto\": \"http\",\n    });\n    const rsp = (await page.goto(\"/qwikcity-test/location/\"))!;\n    expect(rsp.status()).toBe(200);\n    const span = page.locator(\".url\");\n    expect(await span.textContent()).toBe(\n      \"http://override-server/qwikcity-test/location/\",\n    );\n  });\n\n  test(\"should take x-forwarded headers into account with port\", async ({\n    page,\n  }) => {\n    page.setExtraHTTPHeaders({\n      \"X-Forwarded-Host\": \"override-server:9999\",\n      \"X-Forwarded-Proto\": \"https\",\n    });\n    const rsp = (await page.goto(\"/qwikcity-test/location/\"))!;\n    expect(rsp.status()).toBe(200);\n    const span = page.locator(\".url\");\n    expect(await span.textContent()).toBe(\n      \"https://override-server:9999/qwikcity-test/location/\",\n    );\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/mdx.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"mdx tables \", () => {\n  const wrapperClassName = \".table-wrapper\";\n  test(`should be wrapped with a div that has the class name ${wrapperClassName}`, async ({\n    page,\n  }) => {\n    await page.goto(\"/qwikcity-test/mdx/\");\n    const tableWrapperElm = page.locator(wrapperClassName);\n    await expect(tableWrapperElm).toBeVisible();\n\n    const tableElm = page.locator(\".table-wrapper > table\");\n    await expect(tableElm).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/menu.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\nimport { assertPage, linkNavigate, load, locator } from \"./util.js\";\n\ntest.describe(\"Qwik City Menu\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: true });\n    tests();\n  });\n});\n\nfunction tests() {\n  test(\"Qwik City Menu\", async ({ context, javaScriptEnabled }) => {\n    const ctx = await load(context, javaScriptEnabled, \"/qwikcity-test/\");\n\n    /***********  Docs: home  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"docs-home\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/docs/\",\n      title: \"Docs: Welcome! - Qwik\",\n      layoutHierarchy: [\"docs\"],\n      h1: \"Welcome to the Docs!\",\n      activeHeaderLink: \"Docs\",\n    });\n\n    let menuHeader = locator(ctx, `[data-test-menu-header=\"0\"]`);\n    expect(await menuHeader.innerText()).toBe(\"Introduction\");\n\n    let breadcrumb0 = locator(ctx, `[data-test-breadcrumb=\"0\"]`);\n    if (await breadcrumb0.isVisible()) {\n      expect(true, `Breadcrumb selector ${breadcrumb0} found`).toBe(false);\n    }\n\n    /***********  Docs: overview  ***********/\n    await linkNavigate(\n      ctx,\n      '[data-test-menu-link=\"/qwikcity-test/docs/overview/\"]',\n    );\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/docs/overview/\",\n      title: \"Docs: Overview - Qwik\",\n      layoutHierarchy: [\"docs\"],\n      h1: \"Overview\",\n      activeHeaderLink: \"Docs\",\n    });\n\n    menuHeader = locator(ctx, `[data-test-menu-header=\"0\"]`);\n    expect(await menuHeader.innerText()).toBe(\"Introduction\");\n\n    breadcrumb0 = locator(ctx, `[data-test-breadcrumb=\"0\"]`);\n    expect(await breadcrumb0.innerText()).toBe(\"Introduction\");\n\n    let breadcrumb1 = locator(ctx, `[data-test-breadcrumb=\"1\"]`);\n    expect(await breadcrumb1.innerText()).toBe(\"Overview\");\n\n    /***********  Docs: getting-started  ***********/\n    await linkNavigate(\n      ctx,\n      '[data-test-menu-link=\"/qwikcity-test/docs/getting-started/\"]',\n    );\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/docs/getting-started/\",\n      title: \"Docs: @builder.io/qwik Getting Started - Qwik\",\n      layoutHierarchy: [\"docs\"],\n      h1: \"Getting Started\",\n      activeHeaderLink: \"Docs\",\n    });\n\n    menuHeader = locator(ctx, `[data-test-menu-header=\"0\"]`);\n    expect(await menuHeader.innerText()).toBe(\"Introduction\");\n\n    breadcrumb0 = locator(ctx, `[data-test-breadcrumb=\"0\"]`);\n    expect(await breadcrumb0.innerText()).toBe(\"Introduction\");\n\n    breadcrumb1 = locator(ctx, `[data-test-breadcrumb=\"1\"]`);\n    expect(await breadcrumb1.innerText()).toBe(\"Getting Started\");\n\n    /***********  Docs: core/basics  ***********/\n    await linkNavigate(\n      ctx,\n      '[data-test-menu-link=\"/qwikcity-test/docs/core/basics/\"]',\n    );\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/docs/core/basics/\",\n      title: \"Docs: core basics - Qwik\",\n      layoutHierarchy: [\"docs\"],\n      h1: \"Docs: core basics\",\n      activeHeaderLink: \"Docs\",\n    });\n\n    menuHeader = locator(ctx, `[data-test-menu-header=\"0\"]`);\n    expect(await menuHeader.innerText()).toBe(\"Introduction\");\n\n    breadcrumb0 = locator(ctx, `[data-test-breadcrumb=\"0\"]`);\n    expect(await breadcrumb0.innerText()).toBe(\"Core\");\n\n    breadcrumb1 = locator(ctx, `[data-test-breadcrumb=\"1\"]`);\n    expect(await breadcrumb1.innerText()).toBe(\"Basics\");\n\n    /***********  Docs: core/listeners  ***********/\n    await linkNavigate(\n      ctx,\n      '[data-test-menu-link=\"/qwikcity-test/docs/core/listeners/\"]',\n    );\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/docs/core/listeners/\",\n      title: \"Docs: core listeners - Qwik\",\n      layoutHierarchy: [\"docs\"],\n      h1: \"Docs: core listeners\",\n      activeHeaderLink: \"Docs\",\n    });\n\n    menuHeader = locator(ctx, `[data-test-menu-header=\"0\"]`);\n    expect(await menuHeader.innerText()).toBe(\"Introduction\");\n\n    breadcrumb0 = locator(ctx, `[data-test-breadcrumb=\"0\"]`);\n    expect(await breadcrumb0.innerText()).toBe(\"Core\");\n\n    breadcrumb1 = locator(ctx, `[data-test-breadcrumb=\"1\"]`);\n    expect(await breadcrumb1.innerText()).toBe(\"Listeners\");\n  });\n}\n"
  },
  {
    "path": "starters/e2e/qwikcity/nav.spec.ts",
    "content": "import {\n  assertPage,\n  getScrollHeight,\n  getWindowScrollXY,\n  linkNavigate,\n  load,\n  scrollDebounceDetector,\n  scrollDetector,\n  scrollTo,\n} from \"./util.js\";\nimport { expect, test } from \"@playwright/test\";\n\ntest.describe(\"actions\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: true });\n    tests();\n    spaOnlyTests();\n  });\n\n  function spaOnlyTests() {\n    test(\"issue4100\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/issue4100/\");\n      const increment = page.locator(\"button\");\n      const link = page.locator(\"a\");\n\n      await expect(increment).toHaveText(\"Click me 0\");\n      await increment.click();\n      await expect(increment).toHaveText(\"Click me 1\");\n      await link.click();\n      await expect(new URL(page.url()).hash).toBe(\"#navigate\");\n      await expect(increment).toHaveText(\"Click me 1\");\n    });\n\n    test.describe(\"scroll-restoration\", () => {\n      test(\"should not refresh again on popstate after manual refresh\", async ({\n        page,\n      }) => {\n        await page.goto(\"/qwikcity-test/scroll-restoration/page-long/\");\n        const link = page.locator(\"#to-page-short\");\n        await link.click();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Page Short\");\n\n        await page.reload();\n        await expect(page.locator(\"h1\")).toHaveText(\"Page Short\");\n\n        await page.goBack();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Page Long\");\n      });\n      test(\"should scroll on hash change\", async ({ page }) => {\n        await page.goto(\"/qwikcity-test/scroll-restoration/hash/\");\n        expect(page).toHaveURL(\"/qwikcity-test/scroll-restoration/hash/\");\n\n        const link = page.locator(\"#hash-1\");\n        await link.click();\n\n        await expect(page).toHaveURL(\n          \"/qwikcity-test/scroll-restoration/hash/#hash-2\",\n        );\n        let scrollY1;\n        do {\n          await page.waitForTimeout(10);\n          scrollY1 = (await getWindowScrollXY(page))[1];\n        } while (scrollY1 < 1000);\n        expect(scrollY1).toBeGreaterThan(1090);\n        expect(scrollY1).toBeLessThan(1110);\n\n        const link2 = page.locator(\"#hash-2\");\n        await scrollTo(page, 0, 1000);\n        await link2.click();\n\n        await expect(page).toHaveURL(\n          \"/qwikcity-test/scroll-restoration/hash/#hash-1\",\n        );\n        await page.waitForTimeout(50);\n        let scrollY2;\n        do {\n          await page.waitForTimeout(10);\n          scrollY2 = (await getWindowScrollXY(page))[1];\n        } while (scrollY2 > 500);\n        expect(scrollY2).toBeGreaterThan(70);\n        expect(scrollY2).toBeLessThan(90);\n\n        const link3 = page.locator(\"#no-hash\");\n        await scrollTo(page, 0, 2000);\n        await link3.click();\n\n        await expect(page).toHaveURL(\"/qwikcity-test/scroll-restoration/hash/\");\n        await page.waitForTimeout(50);\n        let scrollY3;\n        do {\n          await page.waitForTimeout(10);\n          scrollY3 = (await getWindowScrollXY(page))[1];\n        } while (scrollY3 > 1000);\n        expect(await getWindowScrollXY(page)).toStrictEqual([0, 0]);\n      });\n      test(\"should restore scroll on back and forward navigations\", async ({\n        page,\n      }) => {\n        await page.goto(\"/qwikcity-test/scroll-restoration/page-long/\");\n        const link = page.locator(\"#to-page-short\");\n        const scrollHeightLong = await getScrollHeight(page);\n        await scrollTo(page, 0, scrollHeightLong);\n        const scrollDetector1 = scrollDetector(page);\n        await link.click();\n\n        await scrollDetector1;\n        await expect(page.locator(\"h1\")).toHaveText(\"Page Short\");\n        expect(page).toHaveURL(\"/qwikcity-test/scroll-restoration/page-short/\");\n        expect(await getWindowScrollXY(page)).toStrictEqual([0, 0]);\n\n        const scrollHeightShort = await getScrollHeight(page);\n        await scrollTo(page, 0, scrollHeightShort);\n\n        // QwikCity relies on a debounced scroll handler to save scroll position.\n        // Once a popstate occurs we cannot update scroll position.\n        // We must wait for the debounce to trigger before popping.\n        await page.waitForTimeout(50);\n        await scrollDebounceDetector(page);\n\n        const scrollDetector2 = scrollDetector(page);\n        await page.goBack();\n\n        await scrollDetector2;\n        await expect(page.locator(\"h1\")).toHaveText(\"Page Long\");\n        expect(page).toHaveURL(\"/qwikcity-test/scroll-restoration/page-long/\");\n        expect(await getWindowScrollXY(page)).toStrictEqual([\n          0,\n          scrollHeightLong,\n        ]);\n\n        const scrollDetector3 = scrollDetector(page);\n        await page.goForward();\n\n        await scrollDetector3;\n        await expect(page.locator(\"h1\")).toHaveText(\"Page Short\");\n        expect(page).toHaveURL(\"/qwikcity-test/scroll-restoration/page-short/\");\n        expect(await getWindowScrollXY(page)).toStrictEqual([\n          0,\n          scrollHeightShort,\n        ]);\n      });\n\n      test(\"issue4502 (link)\", async ({ page }) => {\n        await page.goto(\"/qwikcity-test/issue4502/\");\n        const count = page.locator(\"#count\");\n        await expect(count).toHaveText(\"Count: 0\");\n        await count.click();\n        await expect(count).toHaveText(\"Count: 1\");\n        await page.locator(\"#link\").click();\n        await page.waitForURL(\"/qwikcity-test/issue4502/broken/route/\");\n        await expect(page.locator(\"#route\")).toHaveText(\n          \"welcome to /broken/route\",\n        );\n        await expect(count).toHaveText(\"Count: 1\");\n      });\n    });\n\n    test(\"issue 6660 internal params should not trigger navigation\", async ({\n      page,\n    }) => {\n      await page.goto(\"/qwikcity-test/issue6660/\");\n      await expect(page.locator(\"#status\")).toBeHidden();\n\n      {\n        const startUrl = page.url();\n\n        await page.getByText(\"Submit\").click();\n        await page.waitForSelector(\"#status\");\n\n        expect(page.url()).toBe(startUrl);\n      }\n\n      await page.goto(\"/qwikcity-test/issue6660/?var=1&hello\");\n      await expect(page.locator(\"#status\")).toBeHidden();\n\n      {\n        const startUrl = page.url();\n        expect(startUrl).toContain(\"var=1&hello\");\n\n        await page.getByText(\"Submit\").click();\n        await page.waitForSelector(\"#status\");\n\n        expect(page.url()).toBe(startUrl);\n      }\n    });\n\n    test(\"preventNavigate\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/prevent-navigate/\");\n      const toggleDirty = page.locator(\"#pn-button\");\n      const link = page.locator(\"#pn-link\");\n      const count = page.locator(\"#pn-runcount\");\n      const mpaLink = page.locator(\"#pn-a\");\n      const itemLink = page.locator(\"#pn-link-5\");\n      const confirmText = page.locator(\"#pn-confirm-text\");\n      const confirmYes = page.locator(\"#pn-confirm-yes\");\n      // clean SPA nav\n      await expect(count).toHaveText(\"0\");\n      await link.click();\n      await expect(link).not.toBeVisible();\n      expect(new URL(page.url()).pathname).toBe(\"/qwikcity-test/\");\n      await page.goBack();\n      await expect(count).toHaveText(\"0\");\n      await expect(toggleDirty).toHaveText(\"is clean\");\n      await toggleDirty.click();\n      await expect(toggleDirty).toHaveText(\"is dirty\");\n      // dirty browser nav\n      let didTrigger = false;\n      page.once(\"dialog\", async (dialog) => {\n        didTrigger = true;\n        expect(dialog.type()).toBe(\"beforeunload\");\n        await dialog.accept();\n      });\n      await page.reload();\n      expect(didTrigger).toBe(true);\n      await expect(count).toHaveText(\"0\");\n      await toggleDirty.click();\n\n      // dirty SPA nav\n      await link.click();\n      await expect(count).toHaveText(\"1\");\n      await link.click();\n      await expect(count).toHaveText(\"2\");\n      expect(new URL(page.url()).pathname).toBe(\n        \"/qwikcity-test/prevent-navigate/\",\n      );\n      await expect(confirmText).toContainText(\"/qwikcity-test/?\");\n      await itemLink.click();\n      await expect(confirmText).toContainText(\n        \"/qwikcity-test/prevent-navigate/5/?\",\n      );\n      await confirmYes.click();\n      await expect(page.locator(\"#pn-main\")).toBeVisible();\n      expect(new URL(page.url()).pathname).toBe(\n        \"/qwikcity-test/prevent-navigate/5/\",\n      );\n\n      // dirty browser nav w/ prevent\n      await toggleDirty.click();\n      didTrigger = false;\n      page.once(\"dialog\", async (dialog) => {\n        didTrigger = true;\n        expect(dialog.type()).toBe(\"beforeunload\");\n        // dismissing doesn't work, ah well\n        await dialog.accept();\n      });\n      await mpaLink.click();\n      expect(didTrigger).toBe(true);\n    });\n  }\n\n  function tests() {\n    test.describe(\"issue2829\", () => {\n      test(\"should navigate with context\", async ({ page }) => {\n        await page.goto(\"/qwikcity-test/issue2829/a/\");\n        const link = page.locator(\"#issue2829-link\");\n        await link.click();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Profile\");\n        await expect(page.locator(\"#issue2829-context\")).toHaveText(\n          \"context: __CONTEXT_VALUE__\",\n        );\n        await expect(new URL(page.url()).pathname).toBe(\n          \"/qwikcity-test/issue2829/b/\",\n        );\n      });\n    });\n    test.describe(\"issue2890\", () => {\n      test(\"should navigate (link 0)\", async ({ page, javaScriptEnabled }) => {\n        await page.goto(\"/qwikcity-test/issue2890/a/\");\n        const link = page.locator(\"#issue2890-link-0\");\n        await link.click();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Query\");\n        await expect(toPath(page.url())).toEqual(\"/qwikcity-test/issue2890/b/\");\n        await expect(page.locator(\"#loader\")).toHaveText(\n          'LOADER: {\"query\":\"NONE\",\"hash\":\"NONE\"}',\n        );\n        if (javaScriptEnabled) {\n          await expect(page.locator(\"#browser\")).toHaveText(\n            'BROWSER: {\"query\":\"NONE\",\"hash\":\"\"}',\n          );\n        } else {\n          await expect(page.locator(\"#browser\")).toHaveText(\"BROWSER: {}\");\n        }\n      });\n\n      test(\"should navigate (link 1)\", async ({ page, javaScriptEnabled }) => {\n        await page.goto(\"/qwikcity-test/issue2890/a/\");\n        const link = page.locator(\"#issue2890-link-1\");\n        await link.click();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Query\");\n        await expect(toPath(page.url())).toEqual(\n          \"/qwikcity-test/issue2890/b/?query=123\",\n        );\n        await expect(page.locator(\"#loader\")).toHaveText(\n          'LOADER: {\"query\":\"123\",\"hash\":\"NONE\"}',\n        );\n        if (javaScriptEnabled) {\n          await expect(page.locator(\"#browser\")).toHaveText(\n            'BROWSER: {\"query\":\"123\",\"hash\":\"\"}',\n          );\n        } else {\n          await expect(page.locator(\"#browser\")).toHaveText(\"BROWSER: {}\");\n        }\n      });\n      test(\"should navigate (link 2)\", async ({ page, javaScriptEnabled }) => {\n        await page.goto(\"/qwikcity-test/issue2890/a/\");\n        const link = page.locator(\"#issue2890-link-2\");\n        await link.click();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Query\");\n        await expect(toPath(page.url())).toEqual(\n          \"/qwikcity-test/issue2890/b/?query=321\",\n        );\n        await expect(page.locator(\"#loader\")).toHaveText(\n          'LOADER: {\"query\":\"321\",\"hash\":\"NONE\"}',\n        );\n        if (javaScriptEnabled) {\n          await expect(page.locator(\"#browser\")).toHaveText(\n            'BROWSER: {\"query\":\"321\",\"hash\":\"\"}',\n          );\n        } else {\n          await expect(page.locator(\"#browser\")).toHaveText(\"BROWSER: {}\");\n        }\n      });\n      test(\"should navigate (link 3)\", async ({ page, javaScriptEnabled }) => {\n        await page.goto(\"/qwikcity-test/issue2890/a/\");\n        const link = page.locator(\"#issue2890-link-3\");\n        await link.click();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Query\");\n        await expect(toPath(page.url())).toEqual(\n          \"/qwikcity-test/issue2890/b/?query=321&hash=true#h2\",\n        );\n        await expect(page.locator(\"#loader\")).toHaveText(\n          'LOADER: {\"query\":\"321\",\"hash\":\"true\"}',\n        );\n        if (javaScriptEnabled) {\n          await expect(page.locator(\"#browser\")).toHaveText(\n            'BROWSER: {\"query\":\"321\",\"hash\":\"#h2\"}',\n          );\n        } else {\n          await expect(page.locator(\"#browser\")).toHaveText(\"BROWSER: {}\");\n        }\n      });\n      test(\"should navigate (link 4)\", async ({ page, javaScriptEnabled }) => {\n        await page.goto(\"/qwikcity-test/issue2890/a/\");\n        const link = page.locator(\"#issue2890-link-4\");\n        await link.click();\n\n        await expect(page.locator(\"h1\")).toHaveText(\"Query\");\n        await expect(toPath(page.url())).toEqual(\n          \"/qwikcity-test/issue2890/b/?query=321&hash=true#h2\",\n        );\n        await expect(page.locator(\"#loader\")).toHaveText(\n          'LOADER: {\"query\":\"321\",\"hash\":\"true\"}',\n        );\n        if (javaScriptEnabled) {\n          await expect(page.locator(\"#browser\")).toHaveText(\n            'BROWSER: {\"query\":\"321\",\"hash\":\"#h2\"}',\n          );\n        } else {\n          await expect(page.locator(\"#browser\")).toHaveText(\"BROWSER: {}\");\n        }\n      });\n    });\n\n    test.describe(\"issue 2751\", () => {\n      test(\"should navigate without crash\", async ({\n        context,\n        javaScriptEnabled,\n      }) => {\n        const ctx = await load(\n          context,\n          javaScriptEnabled,\n          \"/qwikcity-test/actions/\",\n        );\n\n        await linkNavigate(ctx, '[data-test-link=\"docs-home\"]');\n        await assertPage(ctx, {\n          pathname: \"/qwikcity-test/docs/\",\n          title: \"Docs: Welcome! - Qwik\",\n          layoutHierarchy: [\"docs\"],\n          h1: \"Welcome to the Docs!\",\n        });\n\n        await linkNavigate(ctx, '[data-test-link=\"docs-actions\"]');\n        await assertPage(ctx, {\n          pathname: \"/qwikcity-test/actions/\",\n          title: \"Actions - Qwik\",\n          layoutHierarchy: [\"root\"],\n          h1: \"Actions Test\",\n        });\n\n        await linkNavigate(ctx, '[data-test-link=\"api-home\"]');\n        await assertPage(ctx, {\n          pathname: \"/qwikcity-test/api/\",\n          title: \"API: /qwikcity-test/api/ - Qwik\",\n          layoutHierarchy: [\"root\", \"api\"],\n          h1: \"Qwik City Test API!\",\n        });\n      });\n    });\n\n    test(\"issue4502 (anchor)\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/issue4502/\");\n      await page.locator(\"#anchor\").click();\n      await page.waitForURL(\"/qwikcity-test/issue4502/broken/route/\");\n      await expect(page.locator(\"#route\")).toHaveText(\n        \"welcome to /broken/route\",\n      );\n    });\n\n    test(\"issue4956\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/issue4956?id=1\");\n      const textContent = await page.locator(\"#routeId\");\n\n      await expect(textContent).toHaveText(\"1\");\n    });\n\n    test(\"issue4531\", async ({ page }) => {\n      const res = await page.goto(\"/qwikcity-test/issue4531/\");\n      await expect(page.locator(\"#route\")).toHaveText(\"should render\");\n      expect(await res?.headerValue(\"X-Qwikcity-Test\")).toEqual(\"issue4531\");\n    });\n\n    test(\"issue4792\", async ({ page }) => {\n      const site = \"/qwikcity-test/issue4792/\";\n      await page.goto(site);\n      const href = page.locator(\"#reload\");\n      await expect(href).toHaveAttribute(\"href\", site);\n    });\n\n    test(\"issue7182\", async ({ page, javaScriptEnabled }) => {\n      await page.goto(\"/qwikcity-test/issue7182\");\n      const input1 = await page.locator(\"#input1\");\n      await input1.fill(\"4\");\n      await input1.dispatchEvent(\"change\");\n      const input2 = await page.locator(\"#input2\");\n      await input2.fill(\"4\");\n      await input2.dispatchEvent(\"change\");\n      const result = await page.locator(\"#result\");\n      if (javaScriptEnabled) {\n        await expect(result).toHaveText(\"8\");\n      } else {\n        await expect(result).toHaveText(\"3\");\n      }\n    });\n    test(\"issue7732 link/useNavigate with query params should not override loader/middleware redirect with query params\", async ({\n      page,\n    }) => {\n      await page.goto(\"/qwikcity-test/issue7732/a/\");\n      const link = page.locator(\"#issue7732-link-b\");\n      await link.click();\n      await expect(page).toHaveURL(\n        \"/qwikcity-test/issue7732/c/?redirected=true\",\n      );\n    });\n    test(\"action with redirect without query params in a route with query param should redirect to route without query params\", async ({\n      page,\n    }) => {\n      await page.goto(\n        \"/qwikcity-test/action-redirect-without-search-params/?test=test\",\n      );\n      const button = page.locator(\"button\");\n      await button.click();\n      await page.waitForURL(\n        \"/qwikcity-test/action-redirect-without-search-params-target/\",\n      );\n      const searchParams = new URL(page.url()).searchParams;\n      expect(searchParams.size).toBe(0);\n    });\n    test(\"media in home page\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/\");\n\n      await expect(page.locator(\"#image-jpeg\")).toHaveJSProperty(\n        \"naturalWidth\",\n        520,\n      );\n      await expect(page.locator(\"#image-jpeg\")).toHaveJSProperty(\n        \"naturalHeight\",\n        520,\n      );\n\n      await expect(page.locator(\"#image-jpeg\")).toHaveJSProperty(\n        \"loading\",\n        \"eager\",\n      );\n      await expect(page.locator(\"#image-jpeg\")).toHaveJSProperty(\n        \"decoding\",\n        \"auto\",\n      );\n\n      await expect(page.locator(\"#image-avif\")).toHaveJSProperty(\"width\", 100);\n      await expect(page.locator(\"#image-avif\")).toHaveJSProperty(\"height\", 100);\n      await expect(page.locator(\"#image-avif\")).toHaveJSProperty(\n        \"naturalWidth\",\n        520,\n      );\n      await expect(page.locator(\"#image-avif\")).toHaveJSProperty(\n        \"naturalHeight\",\n        520,\n      );\n    });\n\n    test(\"redirects, re-runs loaders and changes the url within the same page when search params changed\", async ({\n      page,\n    }) => {\n      await page.goto(\"/qwikcity-test/search-params-redirect/\");\n      await page.getByText(\"Submit\").click();\n      await page.waitForURL(\n        \"**/qwikcity-test/search-params-redirect/?redirected=true\",\n      );\n\n      const url = new URL(page.url());\n\n      expect(url.href.replace(url.origin, \"\")).toEqual(\n        \"/qwikcity-test/search-params-redirect/?redirected=true\",\n      );\n\n      await expect(page.locator(\"#redirected-result\")).toHaveText(\"true\");\n    });\n\n    test(\"server plugin q-data redirect from /redirectme to /\", async ({\n      baseURL,\n    }) => {\n      const res = await fetch(\n        new URL(\"/qwikcity-test/redirectme/q-data.json\", baseURL),\n        {\n          redirect: \"manual\",\n          headers: {\n            Accept: \"application/json\",\n          },\n        },\n      );\n      expect(res.status).toBe(301);\n      expect(res.headers.get(\"Location\")).toBe(\"/qwikcity-test/q-data.json\");\n    });\n  }\n});\n\nfunction toPath(href: string) {\n  const url = new URL(href);\n  return url.pathname + url.search + url.hash;\n}\n"
  },
  {
    "path": "starters/e2e/qwikcity/page.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\nimport {\n  assertPage,\n  getPage,\n  linkNavigate,\n  load,\n  locator,\n  setPage,\n} from \"./util.js\";\n\ntest.describe(\"Qwik City Page\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: true });\n    tests();\n  });\n});\n\nfunction tests() {\n  test(\"Qwik City Page\", async ({ context, javaScriptEnabled }) => {\n    const ctx = await load(context, javaScriptEnabled, \"/qwikcity-test/\");\n\n    /***********  Home Page  ***********/\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/\",\n      title: \"Welcome to Qwik City - Qwik\",\n      layoutHierarchy: [\"root\"],\n      h1: \"Welcome to Qwik City\",\n      activeHeaderLink: false,\n    });\n\n    /***********  Blog: home  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"blog-home\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/blog/\",\n      title: \"Welcome to our Blog! - Qwik\",\n      layoutHierarchy: [\"root\", \"blog\"],\n      h1: \"Welcome to our Blog!\",\n      activeHeaderLink: \"Blog\",\n    });\n\n    /***********  Blog: resumability  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"blog-resumability\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/blog/what-is-resumability/\",\n      title: \"Blog: what-is-resumability - Qwik\",\n      layoutHierarchy: [\"root\", \"blog\"],\n      h1: \"Blog: what-is-resumability\",\n      activeHeaderLink: \"Blog\",\n    });\n\n    /***********  Blog: serializing-props  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"blog-serializing-props\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/blog/serializing-props/\",\n      title: \"Blog: serializing-props - Qwik\",\n      layoutHierarchy: [\"root\", \"blog\"],\n      h1: \"Blog: serializing-props\",\n      activeHeaderLink: \"Blog\",\n    });\n\n    /***********  Docs: home  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"docs-home\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/docs/\",\n      title: \"Docs: Welcome! - Qwik\",\n      layoutHierarchy: [\"docs\"],\n      h1: \"Welcome to the Docs!\",\n      activeHeaderLink: \"Docs\",\n    });\n\n    /***********  Docs: overview  ***********/\n    await linkNavigate(\n      ctx,\n      '[data-test-menu-link=\"/qwikcity-test/docs/overview/\"]',\n    );\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/docs/overview/\",\n      title: \"Docs: Overview - Qwik\",\n      layoutHierarchy: [\"docs\"],\n      h1: \"Overview\",\n      activeHeaderLink: \"Docs\",\n    });\n\n    /***********  Products: hat  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"products-hat\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/products/hat/\",\n      title: \"Product hat - Qwik\",\n      layoutHierarchy: [\"root\"],\n      h1: \"Product: hat\",\n      activeHeaderLink: \"Products\",\n    });\n\n    /***********  Products: jacket  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"products-jacket\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/products/jacket/\",\n      title: \"Product jacket - Qwik\",\n      layoutHierarchy: [\"root\"],\n      h1: \"Product: jacket\",\n      activeHeaderLink: \"Products\",\n    });\n\n    if (!javaScriptEnabled) {\n      /***********  Products: shirt (301 redirect to /products/tshirt)  ***********/\n      await linkNavigate(ctx, '[data-test-link=\"products-shirt\"]');\n      await assertPage(ctx, {\n        pathname: \"/qwikcity-test/products/tshirt/\",\n        title: \"Product tshirt - Qwik\",\n        layoutHierarchy: [\"root\"],\n        h1: \"Product: tshirt\",\n        activeHeaderLink: \"Products\",\n      });\n\n      /***********  Products: shirt (rewrite to /products/tshirt)  ***********/\n      await linkNavigate(ctx, '[data-test-link=\"products-shirt-rewrite\"]');\n      await assertPage(ctx, {\n        pathname: \"/qwikcity-test/products/shirt-rewrite/\",\n        title: \"Product tshirt - Qwik\",\n        layoutHierarchy: [\"root\"],\n        h1: \"Product: tshirt\",\n        activeHeaderLink: \"Products\",\n      });\n\n      /***********  Products: shirt (rewrite to /products/tshirt)  ***********/\n      await linkNavigate(\n        ctx,\n        '[data-test-link=\"products-shirt-rewrite-with-search\"]',\n      );\n      await assertPage(ctx, {\n        pathname: \"/qwikcity-test/products/shirt-rewrite/\",\n        title: \"Product tshirt - Qwik\",\n        layoutHierarchy: [\"root\"],\n        h1: \"Product: tshirt\",\n        activeHeaderLink: \"Products\",\n        searchParams: { search: \"true\" },\n      });\n\n      /***********  Products: shirt (rewrite to /products/tshirt)  ***********/\n      await linkNavigate(\n        ctx,\n        '[data-test-link=\"products-shirt-rewrite-absolute-url\"]',\n        500,\n      );\n      await assertPage(ctx, {\n        title: \"500 Internal Server Error\",\n      });\n      // Recover from error\n      await setPage(ctx, \"/qwikcity-test/products/hat/\");\n\n      /***********  Products: shirt (rewrite to /products/tshirt)  ***********/\n      await linkNavigate(\n        ctx,\n        '[data-test-link=\"products-shirt-rewrite-no-trailing-slash\"]',\n      );\n      await assertPage(ctx, {\n        pathname: \"/qwikcity-test/products/shirt-rewrite/\",\n        title: \"Product tshirt - Qwik\",\n        layoutHierarchy: [\"root\"],\n        h1: \"Product: tshirt\",\n        activeHeaderLink: \"Products\",\n      });\n    }\n\n    /***********  Products: hoodie (404)  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"products-hoodie\"]', 404);\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/products/hoodie/\",\n      title: \"Product hoodie - Qwik\",\n      layoutHierarchy: [\"root\"],\n      h1: \"Product: hoodie\",\n      activeHeaderLink: \"Products\",\n    });\n\n    /***********  About Us  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"about-us\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/about-us/\",\n      title: \"About Us - Qwik\",\n      layoutHierarchy: [\"root\"],\n      h1: \"About Us\",\n      activeHeaderLink: \"About Us\",\n    });\n\n    /***********  API: home  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"api-home\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/api/\",\n      title: \"API: /qwikcity-test/api/ - Qwik\",\n      layoutHierarchy: [\"api\"],\n      h1: \"Qwik City Test API!\",\n      activeHeaderLink: \"API\",\n    });\n\n    const nodeVersion = locator(ctx, \"[data-test-api-node]\");\n    if (javaScriptEnabled) {\n      // TODO!!\n    } else {\n      // no useBrowserVisibleTask()\n      expect(await nodeVersion.innerText()).toBe(\"\");\n    }\n\n    /***********  MIT  ***********/\n    await linkNavigate(ctx, '[data-test-link=\"mit\"]');\n    await assertPage(ctx, {\n      pathname: \"/qwikcity-test/mit/\",\n      title: \"MIT License - Qwik\",\n      layoutHierarchy: [],\n      h1: \"MIT License\",\n    });\n  });\n}\n"
  },
  {
    "path": "starters/e2e/qwikcity/resource.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"Resource\", () => {\n  test(\"should handle the resource correctly\", async ({ page }) => {\n    await page.goto(\"/qwikcity-test/issue7254/\");\n\n    await page.getByText(\"Data: hello Bar\");\n\n    await page.getByRole(\"button\", { name: \"Reset\" }).click();\n\n    await expect(page.getByText(\"Data: Foo Bar\")).toBeVisible();\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/server.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"server$\", () => {\n  test(\"this is available\", async ({ page }) => {\n    await page.goto(\"/qwikcity-test/server-func/\");\n    const host = page.locator(\".server-host\");\n\n    await expect(host).toHaveText([\n      \"localhost:3301\",\n      \"localhost:3301\",\n      \"localhost:3301\",\n      \"localhost:3301\",\n      \"\",\n      \"localhost:3301\",\n    ]);\n\n    const button = page.locator(\"#server-host-button\");\n    await button.click();\n    await expect(host).toHaveText([\n      \"localhost:3301\",\n      \"localhost:3301\",\n      \"localhost:3301\",\n      \"localhost:3301\",\n      \"localhost:3301\",\n      \"localhost:3301\",\n    ]);\n  });\n\n  test(\"streaming\", async ({ page }) => {\n    await page.goto(\"/qwikcity-test/server-func/\");\n    const logs = page.locator(\".server-streaming\");\n    const button = page.locator(\"#server-streaming-button\");\n\n    await expect(logs).toHaveText(\"\");\n    await button.click();\n    await expect(logs).toHaveText(\"0\");\n    await expect(logs).toHaveText(\"01\");\n    await expect(logs).toHaveText(\"012\");\n    await expect(logs).toHaveText(\"0123\");\n    await expect(logs).toHaveText(\"01234\");\n  });\n\n  test.describe(\"server$ inside resource\", () => {\n    test(\"All functions have reference to request event\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/server-func/resource\");\n\n      await Promise.all(\n        [\"a\", \"b\", \"c\"].map(async (letter) => {\n          const result = await page.locator(`#${letter}`);\n\n          await expect(result).toHaveText([\n            \"/qwikcity-test/server-func/resource/\" + letter,\n          ]);\n        }),\n      );\n    });\n  });\n\n  test.describe(\"Multiple server$\", () => {\n    test(\"should use the same context when invoked from useTask$ with resource\", async ({\n      page,\n    }) => {\n      await page.goto(\"/qwikcity-test/server-func/\");\n      const methodsContainer = page.locator(\"#methods\");\n      await expect(methodsContainer).toContainText(\"GETGET\");\n    });\n\n    test(\"should use the same context when invoked from useTask$ on the server\", async ({\n      page,\n    }) => {\n      await page.goto(\"/qwikcity-test/server-func/context\");\n      const methodsContainer = page.locator(\"#methods\");\n      await expect(methodsContainer).toContainText(\"GETGET\");\n    });\n    test(\"should have multiple user cookie values\", async ({ browser }) => {\n      const user1Context = await browser.newContext();\n      const user2Context = await browser.newContext();\n\n      const user1Cookies = [\n        { name: \"user\", value: \"user1\", url: \"http://localhost:3301\" },\n      ];\n      const user2Cookies = [\n        { name: \"user\", value: \"user2\", url: \"http://localhost:3301\" },\n      ];\n      await user1Context.addCookies(user1Cookies);\n      await user2Context.addCookies(user2Cookies);\n\n      const [user1Page, user2Page] = await Promise.all([\n        user1Context.newPage(),\n        user2Context.newPage(),\n      ]);\n      await Promise.all([\n        user1Page.goto(\"/qwikcity-test/server-func/cookie\"),\n        user2Page.goto(\"/qwikcity-test/server-func/cookie\"),\n      ]);\n      const usersContainer1 = user1Page.locator(\"#users\");\n      const usersContainer2 = user2Page.locator(\"#users\");\n      await Promise.all([\n        usersContainer1.waitFor({ state: \"attached\" }),\n        usersContainer2.waitFor({ state: \"attached\" }),\n      ]);\n      await expect(usersContainer1).toContainText(\"user1user1\");\n      await expect(usersContainer2).toContainText(\"user2user2\");\n    });\n    test(\"should work with config custom header and GET on client\", async ({\n      page,\n    }) => {\n      await page.goto(\"/qwikcity-test/server-func/server-configs\");\n      const serverConfigContainer = page.locator(\"#server-configs\");\n\n      await expect(serverConfigContainer).toContainText(\n        \"POST--MyCustomValue-GET--MyCustomValue\",\n      );\n    });\n    test(\"should modify ServerError in middleware\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/server-func/server-error\");\n      const serverConfigContainer = page.locator(\"#server-error\");\n\n      await expect(serverConfigContainer).toContainText(\n        \"my errorserver-error-caughtPOST\",\n      );\n    });\n    test(\"should catch ServerError in routeLoader\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/server-func/server-error/loader\");\n      const serverConfigContainer = page.locator(\"#server-error\");\n      await expect(serverConfigContainer).toContainText(\"loader-error-data\");\n    });\n    test(\"should allow primitive ServerError data\", async ({ page }) => {\n      await page.goto(\"/qwikcity-test/server-func/server-error/primitive\");\n      const serverConfigContainer = page.locator(\"#server-error\");\n      await expect(serverConfigContainer).toContainText(\"1error\");\n    });\n  });\n\n  test(\"should return 500 on invalid request\", async ({ page, request }) => {\n    const notExistingServerFunction = await request.post(\n      \"/qwikcity-test.prod/?qfunc=ThisDoesNotExist\",\n      {\n        headers: {\n          \"X-Qrl\": \"ThisDoesNotExist\",\n          \"Content-Type\": \"application/qwik-json\",\n        },\n        data: {\n          _entry: \"2\",\n          _objs: [\"\\u0002_#s_ThisDoesNotExist\", 1, [\"0\", \"1\"]],\n        },\n      },\n    );\n\n    expect(notExistingServerFunction.status()).toBe(500);\n  });\n});\n"
  },
  {
    "path": "starters/e2e/qwikcity/url.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\";\n\ntest.describe(\"Qwik City URL params\", () => {\n  test.describe(\"mpa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n  test.describe(\"spa\", () => {\n    test.use({ javaScriptEnabled: false });\n    tests();\n  });\n});\n\nfunction tests() {\n  test(\"Route Params\", async ({ context }) => {\n    const page = await context.newPage();\n    const response = (await page.goto(\"/qwikcity-test/usa/astoria/\"))!;\n    const status = response.status();\n    expect(status).toBe(200);\n    const title = page.locator(\"title\");\n    expect(await title.innerText()).toBe(\n      \"Weather: usa astoria, 30C, 10day - Qwik\",\n    );\n    await expect(page.locator('[data-test-params=\"country\"]')).toHaveText(\n      \"usa\",\n    );\n    await expect(page.locator('[data-test-params=\"city\"]')).toHaveText(\n      \"astoria\",\n    );\n    await expect(page.locator('[data-test-params=\"temperature\"]')).toHaveText(\n      \"30\",\n    );\n  });\n\n  test(\"Query Params\", async ({ context }) => {\n    const page = await context.newPage();\n    const response = (await page.goto(\n      \"/qwikcity-test/usa/hill-valley/?unit=F&forecast=24hour\",\n    ))!;\n    const status = response.status();\n    expect(status).toBe(200);\n    const title = page.locator(\"title\");\n    expect(await title.innerText()).toBe(\n      \"Weather: usa hill-valley, 30F, 24hour - Qwik\",\n    );\n    await expect(page.locator('[data-test-params=\"unit\"]')).toHaveText(\"F\");\n    await expect(page.locator('[data-test-params=\"forecast\"]')).toHaveText(\n      \"24hour\",\n    );\n    await expect(page.locator('[data-test-params=\"temperature\"]')).toHaveText(\n      \"30\",\n    );\n  });\n}\n"
  },
  {
    "path": "starters/e2e/qwikcity/util.ts",
    "content": "/* eslint-disable */\nimport type { BrowserContext, Page, Response } from \"@playwright/test\";\nimport { expect } from \"@playwright/test\";\n\nexport async function assertPage(ctx: TestContext, test: AssertPage) {\n  const page = getPage(ctx);\n  const pageUrl = new URL(page.url());\n  const html = page.locator(\"html\");\n\n  expect(await html.getAttribute(\"q:version\")).toBeDefined();\n  expect(await html.getAttribute(\"q:base\")).toBeDefined();\n  expect(await html.getAttribute(\"q:id\")).toBeDefined();\n\n  const head = html.locator(\"head\");\n  expect(await head.getAttribute(\"q:id\")).toBeDefined();\n\n  if (test.pathname) {\n    expect(pageUrl.pathname).toBe(test.pathname);\n\n    const canonical = head.locator('link[rel=\"canonical\"]');\n    const href = await canonical.getAttribute(\"href\");\n    const canonicalUrl = new URL(href!);\n    expect(canonicalUrl.pathname).toBe(test.pathname);\n  }\n\n  if (test.searchParams) {\n    if (test.searchParams === \"empty\") {\n      expect(pageUrl.searchParams.size).toBe(0);\n    } else {\n      for (const [key, value] of Object.entries(test.searchParams)) {\n        expect(pageUrl.searchParams.get(key)).toBe(value);\n      }\n    }\n  }\n\n  if (test.title) {\n    const title = head.locator(\"title\");\n    expect(await title.innerText()).toBe(test.title);\n  }\n\n  let parentLocator = page.locator(\"body\");\n  if (test.layoutHierarchy) {\n    for (const layoutName of test.layoutHierarchy) {\n      const selector = `[data-test-layout=\"${layoutName}\"]`;\n      parentLocator = parentLocator.locator(selector);\n      expect(\n        await parentLocator.isVisible(),\n        `Incorrect layout hierarchy, did not find \"${selector}\", pathname: ${pageUrl.pathname}`,\n      ).toBe(true);\n    }\n\n    const noFindChildLayout = parentLocator.locator(`[data-test-layout]`);\n    if (await noFindChildLayout.isVisible()) {\n      const layoutName =\n        await noFindChildLayout.getAttribute(\"data-test-layout\")!;\n      expect(\n        layoutName,\n        `Should not be another nested layout, but found [data-test-layout=\"${layoutName}\"], pathname: ${pageUrl.pathname}`,\n      ).toBe(null);\n    }\n  }\n\n  if (test.h1) {\n    const h1 = parentLocator.locator(\"h1\");\n    expect(await h1.innerText()).toBe(test.h1);\n  }\n\n  const activeLink = locator(\n    ctx,\n    `header [data-test-header-links] a[class=\"active\"]`,\n  );\n  if (typeof test.activeHeaderLink === \"string\") {\n    if (await activeLink.isVisible()) {\n      expect(await activeLink.innerText()).toBe(test.activeHeaderLink);\n    } else {\n      expect(true, `Header link \"${test.activeHeaderLink}\" not active`).toBe(\n        false,\n      );\n    }\n  } else if (test.activeHeaderLink === false) {\n    if (await activeLink.isVisible()) {\n      expect(true, `There should not be an active header link`).toBe(false);\n    }\n  }\n}\n\ninterface AssertPage {\n  pathname?: string;\n  searchParams?: Record<string, string> | \"empty\";\n  title?: string;\n  h1?: string;\n  layoutHierarchy?: string[];\n  activeHeaderLink?: string | false;\n}\n\nexport async function linkNavigate(\n  ctx: TestContext,\n  linkSelector: string,\n  responseStatus = 200,\n) {\n  const page = getPage(ctx);\n  const link = page.locator(linkSelector);\n\n  if (!(await link.isVisible())) {\n    expect(true, `Link selector ${linkSelector} not found`).toBe(false);\n  }\n\n  const href = await link.getAttribute(\"href\")!;\n  console.log(`       ${href}`);\n\n  if (ctx.javaScriptEnabled) {\n    // SPA\n    await link.click();\n    await page.waitForTimeout(500);\n  } else {\n    // MPA\n    const [rsp] = await Promise.all([page.waitForNavigation(), link.click()]);\n\n    const rspStatus = rsp!.status();\n    if (rspStatus !== responseStatus) {\n      const content = await rsp?.text();\n      expect(rspStatus, `${href} (${rspStatus})\\n${content}`).toBe(\n        responseStatus,\n      );\n    }\n  }\n}\n\nexport async function getScrollHeight(page: Page) {\n  return await page.evaluate(\n    () => document.documentElement.scrollHeight - window.innerHeight,\n  );\n}\n\nexport async function getWindowScrollXY(page: Page) {\n  return await page.evaluate<[number, number]>(() => [\n    window.scrollX,\n    window.scrollY,\n  ]);\n}\n\nexport async function scrollTo(page: Page, x: number, y: number) {\n  return await page.evaluate<void, [number, number]>(\n    ([x, y]) => window.scrollTo(x, y),\n    [x, y],\n  );\n}\n\nexport async function scrollDetector(page: Page) {\n  return page.evaluate(\n    () =>\n      new Promise<void>((resolve) =>\n        document.addEventListener(\"scroll\", () => resolve(), { once: true }),\n      ),\n  );\n}\n\nexport async function scrollDebounceDetector(page: Page) {\n  await page.evaluate(() => {\n    return new Promise<void>((resolve) => {\n      const checkInterval = setInterval(() => {\n        if (!window[\"_qCityScrollDebounce\"]) {\n          clearInterval(checkInterval);\n          resolve();\n        }\n      }, 50);\n    });\n  });\n}\n\nexport function locator(ctx: TestContext, selector: string) {\n  const page = getPage(ctx);\n  return page.locator(selector);\n}\n\nexport function getPage(ctx: TestContext) {\n  return ctx.browserContext.pages()[0]!;\n}\n\nexport async function setPage(ctx: TestContext, pathname: string) {\n  const page = getPage(ctx);\n  const response = (await page.goto(pathname))!;\n  const status = response.status();\n  if (status !== 200) {\n    const text = await response.text();\n    expect(status, `${pathname} (${status})\\n${text}`).toBe(200);\n  }\n}\n\nexport async function load(\n  browserContext: BrowserContext,\n  javaScriptEnabled: boolean | undefined,\n  pathname: string,\n): Promise<TestContext> {\n  console.log(\n    `Load: ${pathname} (js ${javaScriptEnabled ? \"enabled\" : \"disabled\"})`,\n  );\n\n  const page = await browserContext.newPage();\n  const response = (await page.goto(pathname))!;\n  const status = response.status();\n\n  if (status !== 200) {\n    const text = await response.text();\n    expect(status, `${pathname} (${status})\\n${text}`).toBe(200);\n  }\n\n  return {\n    browserContext,\n    javaScriptEnabled: !!javaScriptEnabled,\n    response,\n  };\n}\n\nexport interface TestContext {\n  browserContext: BrowserContext;\n  javaScriptEnabled: boolean;\n  response: Response;\n}\n"
  },
  {
    "path": "starters/e2e/starter-partytown.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest(\"rendered\", async ({ page }) => {\n  await page.goto(\"/starter-partytown-test/\");\n  page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n  page.on(\"console\", (msg) => {\n    if (msg.type() === \"error\") {\n      expect(msg.text()).toEqual(undefined);\n    }\n  });\n\n  const congrats = page.locator(\".congrats\");\n  const state = page.locator(\"#state\");\n  await expect(congrats).toContainText(\n    \"Congratulations Qwik with Partytown is working!\",\n  );\n  await expect(state).toHaveText(\"running\");\n\n  await expect(state).toHaveText(\"finished\");\n});\n\ntest(\"update text\", async ({ page }) => {\n  await page.goto(\"/starter-partytown-test/\");\n  page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n  page.on(\"console\", (msg) => {\n    if (msg.type() === \"error\") {\n      expect(msg.text()).toEqual(undefined);\n    }\n  });\n\n  await page.fill(\"input\", \"QWIK\");\n  await page.dispatchEvent(\"input\", \"keyup\");\n  await expect(page.locator(\"ol\")).toContainText(\"Hello QWIK!\");\n});\n"
  },
  {
    "path": "starters/e2e/todo-old.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\nimport type { Page } from \"@playwright/test\";\n\ntest.describe(\"Todo\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/todo-old-test/\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"todo title\", async ({ page }) => {\n    const title = page.locator(\"title\");\n    await expect(title).toHaveText(\"Qwik Demo: Todo\", { useInnerText: true });\n  });\n\n  test(\"should start with 3 items\", async ({ page }) => {\n    await expect(page.locator(\".todo-count > strong\")).toContainText(\"3\");\n  });\n\n  test(\"should add new item\", async ({ page }) => {\n    await addTodoItem(page, \"New Item\");\n    await assertItemCount(page, 4);\n    await expect(page.locator(\".todo-list>li:last-child label\")).toContainText(\n      \"New Item\",\n    );\n  });\n\n  test(\"should remove item\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page.locator(\".todo-list>li:last-child\").hover();\n    await page.locator(\".todo-list>li:last-child button\").click();\n    await assertItemCount(page, 2);\n  });\n\n  test(\"should complete an item\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page.locator(\".todo-list>li:last-child input\").click();\n    await assertItemCount(page, 2, 3);\n  });\n\n  test(\"should edit an item\", async ({ page }) => {\n    await page.locator(\".todo-list>li:first-child label\").dblclick();\n    await page.locator(\".todo-list>li:first-child input.edit\").fill(\"\");\n    await page.locator(\".todo-list>li:first-child input.edit\").press(\"X\");\n    await page.locator(\".todo-list>li:first-child input.edit\").press(\"Enter\");\n    await page.waitForTimeout(100);\n    await expect(page.locator(\".todo-list>li:first-child\")).toContainText(\"X\");\n  });\n\n  test(\"should blur input.edit element\", async ({ page }) => {\n    await page.locator(\".todo-list>li:first-child label\").dblclick();\n    await page\n      .locator(\".todo-list>li:first-child input.edit\")\n      .dispatchEvent(\"blur\");\n  });\n\n  test(\"should clear completed\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page\n      .locator(\".todo-list>li:first-child input[type=checkbox]\")\n      .click();\n    await page.locator(\"button.clear-completed\").click();\n    await assertItemCount(page, 2);\n  });\n\n  test(\"should remove first item and update last\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page.locator(\".todo-list>li:first-child\").hover();\n    await page.locator(\".todo-list>li:first-child button\").click();\n    await assertItemCount(page, 2);\n    await page.waitForTimeout(100);\n\n    page.locator(\".todo-list>li:last-child input\").click();\n    await assertItemCount(page, 1, 2);\n  });\n\n  // Flaky on E2E Tests (ubuntu-latest, chromium)\n  // test('should add item, remove item, set filter.', async ({ page }) => {\n  //   await addTodoItem(page, 'New Item');\n  //   await assertItemCount(page, 4);\n  //   page.locator('.todo-list>li:nth-child(2)').hover();\n  //   page.locator('.todo-list>li:nth-child(2) button').click();\n  //   await assertItemCount(page, 3);\n  //   page.locator('.todo-list>li:last-child').hover();\n  //   page.locator('.todo-list>li:last-child input').click();\n  //   await assertItemCount(page, 2, 3);\n  //   page.locator('footer li:first-child').click();\n  //   page.locator('.clear-completed').click();\n  //   await assertItemCount(page, 2);\n  // });\n});\nasync function assertItemCount(page: Page, count: number, total?: number) {\n  await expect(page.locator(\".todo-count > strong\")).toContainText(\n    String(count),\n  );\n  await expect(page.locator(\".todo-list>li\")).toHaveCount(\n    total == undefined ? count : total,\n  );\n}\n\nasync function addTodoItem(page: Page, text: string) {\n  await page.fill(\"input.new-todo\", text);\n  await page.press(\"input.new-todo\", \"Enter\");\n  await page.waitForTimeout(50);\n}\n"
  },
  {
    "path": "starters/e2e/todo.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\nimport type { Page } from \"@playwright/test\";\n\ntest.describe(\"Todo\", () => {\n  test.beforeEach(async ({ page }) => {\n    await page.goto(\"/todo-test/\");\n    page.on(\"pageerror\", (err) => expect(err).toEqual(undefined));\n    page.on(\"console\", (msg) => {\n      if (msg.type() === \"error\") {\n        expect(msg.text()).toEqual(undefined);\n      }\n    });\n  });\n\n  test(\"todo title\", async ({ page }) => {\n    const title = page.locator(\"title\");\n    await expect(title).toHaveText(\"Qwik Demo: Todo\", { useInnerText: true });\n  });\n\n  test(\"should start with 3 items\", async ({ page }) => {\n    await expect(page.locator(\".todo-count > strong\")).toContainText(\"3\");\n  });\n\n  test(\"should add new item\", async ({ page }) => {\n    await addTodoItem(page, \"New Item\");\n    await assertItemCount(page, 4);\n    await expect(page.locator(\".todo-list>li:last-child label\")).toContainText(\n      \"New Item\",\n    );\n  });\n\n  test(\"should remove item\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page.locator(\".todo-list>li:last-child\").hover();\n    await page.locator(\".todo-list>li:last-child button\").click();\n    await assertItemCount(page, 2);\n  });\n\n  test(\"should complete an item\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page.locator(\".todo-list>li:last-child input\").click();\n    await assertItemCount(page, 2, 3);\n  });\n\n  test(\"should edit an item\", async ({ page }) => {\n    await page.locator(\".todo-list>li:first-child label\").dblclick();\n    await page.locator(\".todo-list>li:first-child input.edit\").fill(\"\");\n    await page.locator(\".todo-list>li:first-child input.edit\").press(\"X\");\n    await page.locator(\".todo-list>li:first-child input.edit\").press(\"Enter\");\n    await expect(page.locator(\".todo-list>li:first-child\")).toContainText(\"X\");\n  });\n\n  test(\"should blur input.edit element\", async ({ page }) => {\n    await page.locator(\".todo-list>li:first-child label\").dblclick();\n    await page\n      .locator(\".todo-list>li:first-child input.edit\")\n      .dispatchEvent(\"blur\");\n  });\n\n  test(\"should clear completed\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page\n      .locator(\".todo-list>li:first-child input[type=checkbox]\")\n      .click();\n    await page.locator(\"button.clear-completed\").click();\n    await assertItemCount(page, 2);\n  });\n\n  test(\"should remove first item and update last\", async ({ page }) => {\n    await assertItemCount(page, 3);\n    await page.locator(\".todo-list>li:first-child\").hover();\n    await page.locator(\".todo-list>li:first-child button\").click();\n    await assertItemCount(page, 2);\n    await page.waitForTimeout(100);\n\n    page.locator(\".todo-list>li:last-child input\").click();\n    await assertItemCount(page, 1, 2);\n  });\n\n  // Flaky on E2E Tests (ubuntu-latest, chromium)\n  // test('should add item, remove item, set filter.', async ({ page }) => {\n  //   await addTodoItem(page, 'New Item');\n  //   await assertItemCount(page, 4);\n  //   page.locator('.todo-list>li:nth-child(2)').hover();\n  //   page.locator('.todo-list>li:nth-child(2) button').click();\n  //   await assertItemCount(page, 3);\n  //   page.locator('.todo-list>li:last-child').hover();\n  //   page.locator('.todo-list>li:last-child input').click();\n  //   await assertItemCount(page, 2, 3);\n  //   page.locator('footer li:first-child').click();\n  //   page.locator('.clear-completed').click();\n  //   await assertItemCount(page, 2);\n  // });\n});\nasync function assertItemCount(page: Page, count: number, total?: number) {\n  await expect(page.locator(\".todo-count > strong\")).toContainText(\n    String(count),\n  );\n  await expect(page.locator(\".todo-list>li\")).toHaveCount(\n    total == undefined ? count : total,\n  );\n}\n\nasync function addTodoItem(page: Page, text: string) {\n  await page.fill(\"input.new-todo\", text);\n  await page.press(\"input.new-todo\", \"Enter\");\n  await page.waitForTimeout(50);\n}\n"
  },
  {
    "path": "starters/features/auth/package.json",
    "content": "{\n  \"description\": \"Authentication plugin for using battle-tested Auth.js (aka NextAuth)\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Auth.js (authentication)\",\n    \"priority\": -10,\n    \"docs\": [\n      \"https://qwik.dev/docs/integrations/authjs/\",\n      \"https://authjs.dev/\"\n    ],\n    \"nextSteps\": {\n      \"lines\": [\n        \" Please add `optimizeDeps: { include: ['@auth/qwik'] }`\",\n        \" to your vite.config.ts file.\",\n        \" Have a look at the docs for more info: \",\n        \" https://qwik.dev/docs/integrations/authjs/\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"@auth/qwik\": \"0.8.0\"\n  }\n}\n"
  },
  {
    "path": "starters/features/auth/src/routes/plugin@auth.ts",
    "content": "import { QwikAuth$ } from \"@auth/qwik\";\nimport GitHub from \"@auth/qwik/providers/github\";\n\nexport const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(\n  () => ({\n    providers: [GitHub],\n  }),\n);\n"
  },
  {
    "path": "starters/features/bootstrap/package.json",
    "content": "{\n  \"description\": \"Boostrap 5 - Build fast, responsive sites with Bootstrap in Qwik App\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Boostrap\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://getbootstrap.com/docs/5.0/getting-started/introduction/\"\n    ],\n    \"nextSteps\": {\n      \"lines\": [\n        \"We start the project with the `start` npm script\",\n        \"Once started, we access the `/bootstrap/` \",\n        \"path to see all demo examples list.\",\n        \"You can make changes and experiment within \",\n        \"`src/routes/bootstrap/index.tsx` to add more examples\",\n        \"apart from the default ones.\",\n        \"\",\n        \"Any changes to the different components or adding new \",\n        \"ones will be done within `src/components/bootstrap`.\",\n        \"\",\n        \"It is recommended to implement these new functionalities\",\n        \"following the main Bootstrap guide: https://getbootstrap.com/\"\n      ]\n    }\n  },\n  \"dependencies\": {\n    \"bootstrap\": \"5\"\n  },\n  \"devDependencies\": {\n    \"@types/bootstrap\": \"5\"\n  }\n}\n"
  },
  {
    "path": "starters/features/bootstrap/src/components/bootstrap/alert.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { type BsComponentProps } from \"~/models/bootstrap\";\n\nexport const Alert = component$<BsComponentProps>(({ text, colorVariant }) => (\n  <div class={`alert alert-${colorVariant}`} role=\"alert\">\n    {text || `A simple ${colorVariant} alert—check it out!`}\n  </div>\n));\n"
  },
  {
    "path": "starters/features/bootstrap/src/components/bootstrap/button.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { type BsComponentProps } from \"~/models/bootstrap\";\n\nexport const Button = component$<BsComponentProps>(({ text, colorVariant }) => (\n  <button type=\"button\" class={`btn btn-${colorVariant}`}>\n    {text || \"Button text\"}\n  </button>\n));\n"
  },
  {
    "path": "starters/features/bootstrap/src/components/bootstrap/index.ts",
    "content": "export * from \"./alert\";\nexport * from \"./button\";\nexport * from \"./navbar\";\nexport * from \"./spinner\";\n"
  },
  {
    "path": "starters/features/bootstrap/src/components/bootstrap/navbar.tsx",
    "content": "import { component$, useOn, $ } from \"@builder.io/qwik\";\nimport { Link } from \"@builder.io/qwik-city\";\nexport const Navbar = component$(() => {\n  useOn(\n    \"qvisible\",\n    $(() => import(\"bootstrap\")),\n  );\n\n  return (\n    <nav class=\"navbar navbar-expand-lg bg-body-tertiary\">\n      <div class=\"container-fluid\">\n        <button\n          class=\"navbar-toggler\"\n          type=\"button\"\n          data-bs-toggle=\"collapse\"\n          data-bs-target=\"#navbarTogglerDemo01\"\n          aria-controls=\"navbarTogglerDemo01\"\n          aria-expanded=\"false\"\n          aria-label=\"Toggle navigation\"\n        >\n          <span class=\"navbar-toggler-icon\"></span>\n        </button>\n        <div class=\"collapse navbar-collapse\" id=\"navbarTogglerDemo01\">\n          <Link class=\"navbar-brand\" href={\"/bootstrap/\"}>\n            Boostrap in Qwik\n          </Link>\n          <ul class=\"navbar-nav me-auto mb-2 mb-lg-0\">\n            <li class=\"nav-item\">\n              <Link class=\"nav-link\" href={\"/bootstrap/alerts\"}>\n                Alerts\n              </Link>\n            </li>\n            <Link class=\"nav-link\" href={\"/bootstrap/buttons\"}>\n              Buttons\n            </Link>\n            <Link class=\"nav-link\" href={\"/bootstrap/spinners\"}>\n              Spinners\n            </Link>\n          </ul>\n        </div>\n      </div>\n    </nav>\n  );\n});\n"
  },
  {
    "path": "starters/features/bootstrap/src/components/bootstrap/spinner.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { type BsSpinnerComponentProps } from \"~/models/bootstrap\";\n\nexport const Spinner = component$<BsSpinnerComponentProps>(\n  ({ text, colorVariant, growing }) => (\n    <div\n      class={`spinner-${growing ? \"grow\" : \"border\"} text-${colorVariant}`}\n      role=\"status\"\n    >\n      <span class=\"visually-hidden\">{text || \"Loading...\"}</span>\n    </div>\n  ),\n);\n"
  },
  {
    "path": "starters/features/bootstrap/src/constants/data.ts",
    "content": "export const colorVariantsList: Array<string> = [\n  \"primary\",\n  \"secondary\",\n  \"success\",\n  \"danger\",\n  \"warning\",\n  \"info\",\n  \"light\",\n  \"dark\",\n];\n"
  },
  {
    "path": "starters/features/bootstrap/src/models/bootstrap.ts",
    "content": "export interface BsComponentProps {\n  text?: string;\n  colorVariant: string;\n}\n\nexport interface BsSpinnerComponentProps extends BsComponentProps {\n  growing: boolean;\n}\n"
  },
  {
    "path": "starters/features/bootstrap/src/routes/bootstrap/alerts/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\nimport { Alert } from \"~/components/bootstrap\";\nimport { colorVariantsList } from \"~/constants/data\";\nexport default component$(() => {\n  return (\n    <>\n      <h2>Alerts</h2>\n      <hr />\n      {colorVariantsList.map((colorVariant, index) => (\n        <Alert\n          key={`${index + 1}_${colorVariant}`}\n          colorVariant={colorVariant}\n        />\n      ))}\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Qwik - Bootstrap v5 - Alerts\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Alerts with Boostrap in Qwik\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/features/bootstrap/src/routes/bootstrap/buttons/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\nimport { Button } from \"~/components/bootstrap\";\nimport { colorVariantsList } from \"~/constants/data\";\n\nexport default component$(() => {\n  return (\n    <>\n      <h2>Buttons</h2>\n      <hr />\n      {colorVariantsList.map((colorVariant, index) => (\n        <>\n          <Button\n            key={`${index + 1}_${colorVariant}`}\n            colorVariant={colorVariant}\n          />\n          <span class=\"me-3\"></span>\n        </>\n      ))}\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Qwik - Bootstrap v5 - Buttons\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Buttons with Boostrap in Qwik\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/features/bootstrap/src/routes/bootstrap/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { Link, type DocumentHead } from \"@builder.io/qwik-city\";\n\nexport default component$(() => {\n  return (\n    <>\n      <h2>Bootstrap components</h2>\n      <hr />\n      <ul>\n        <li>\n          <Link href=\"/bootstrap/alerts/\">Alerts</Link>\n        </li>\n        <li>\n          <Link href=\"/bootstrap/buttons/\">Buttons</Link>\n        </li>\n        <li>\n          <Link href=\"/bootstrap/spinners/\">Spinners</Link>\n        </li>\n      </ul>\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Welcome to Qwik\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Qwik site description\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/features/bootstrap/src/routes/bootstrap/layout.tsx",
    "content": "import { component$, Slot, useStyles$ } from \"@builder.io/qwik\";\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\nimport { Navbar } from \"~/components/bootstrap\";\n\n// Add bootstrap styles\n\nimport bootstrapStyles from \"../../../node_modules/bootstrap/dist/css/bootstrap.min.css?inline\";\n\nexport default component$(() => {\n  useStyles$(bootstrapStyles);\n  return (\n    <>\n      <Navbar />\n      <div class=\"container\">\n        <div class=\"row mb-2 mt-4\">\n          <p>\n            Bootstrap is a powerful, feature-packed frontend toolkit. Build\n            anything—from prototype to production—in minutes.\n          </p>\n        </div>\n        <Slot />\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/features/bootstrap/src/routes/bootstrap/spinners/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\nimport { Spinner } from \"~/components/bootstrap\";\nimport { colorVariantsList } from \"~/constants/data\";\n\nexport default component$(() => {\n  return (\n    <>\n      <h2>Spinners</h2>\n      <hr />\n      <h3>Border</h3>\n      {colorVariantsList.map((colorVariant, index) => (\n        <>\n          <Spinner\n            key={`${index + 1}_${colorVariant}`}\n            colorVariant={colorVariant}\n            growing={false}\n          />\n          <span class=\"me-3\"></span>\n        </>\n      ))}\n      <h3 class=\"mt-2\">Growing</h3>\n      {colorVariantsList.map((colorVariant, index) => (\n        <>\n          <Spinner\n            key={`${index + 1}_${colorVariant}`}\n            colorVariant={colorVariant}\n            growing={true}\n          />\n          <span class=\"me-3\"></span>\n        </>\n      ))}\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Qwik - Bootstrap v5 - Spinners\",\n  meta: [\n    {\n      name: \"description\",\n      content: \"Spinners with Boostrap in Qwik\",\n    },\n  ],\n};\n"
  },
  {
    "path": "starters/features/builder.io/README.md",
    "content": "## Builder.io + Qwik\n\nAn example of using [Builder.io's](https://www.builder.io/) visual editor with Qwik.\n\nSee the catchall route at [src/routes/[...index]/index.tsx](src/routes/[...index]/index.tsx) for the integration code.\n\nRegistered components can be found in [src/components/builder-registry.ts](src/components/builder-registry.ts)\n\n### Docs\n\nSee our full integration guides [here](https://www.builder.io/c/docs/developers)\n\nAlso, when you push your integration to production, go back and update your preview URL to your production URL so now anyone on your team can visuall create content in your Qwik app!\n\nAlso, to integrate structured data, see [this guide](https://www.builder.io/c/docs/integrate-cms-data)\n"
  },
  {
    "path": "starters/features/builder.io/package.json",
    "content": "{\n  \"description\": \"Visual headless CMS\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Builder.io\",\n    \"priority\": -10,\n    \"viteConfig\": {\n      \"imports\": [\n        {\n          \"namedImports\": [\n            \"builderDevTools\"\n          ],\n          \"importPath\": \"@builder.io/dev-tools/vite\"\n        }\n      ],\n      \"vitePluginsPrepend\": [\n        \"builderDevTools()\"\n      ]\n    },\n    \"docs\": [\n      \"https://www.builder.io/c/docs/quickstart\"\n    ]\n  },\n  \"devDependencies\": {\n    \"@builder.io/dev-tools\": \"^1.0.1\",\n    \"@builder.io/sdk-qwik\": \"^0.14.10\"\n  }\n}\n"
  },
  {
    "path": "starters/features/builder.io/src/components/builder-registry.ts",
    "content": "import type { RegisteredComponent } from \"@builder.io/sdk-qwik\";\nimport Counter from \"./counter/counter\";\n\n/**\n * This array is used to integrate custom components within Builder.\n * https://www.builder.io/c/docs/custom-components-intro\n *\n * These components will be found the \"Custom Components\"\n * section of Builder's visual editor.\n * You can also turn on \"components only mode\" to limit\n * editing to only these components.\n * https://www.builder.io/c/docs/guides/components-only-mode\n */\nexport const CUSTOM_COMPONENTS: RegisteredComponent[] = [\n  {\n    component: Counter,\n    name: \"Counter\",\n    inputs: [\n      {\n        name: \"initialValue\",\n        type: \"number\",\n      },\n    ],\n  },\n];\n"
  },
  {
    "path": "starters/features/builder.io/src/components/counter/counter.module.css",
    "content": ".wrapper {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 20px;\n}\n\n.button {\n  background: #1d2033;\n  border: none;\n  border-radius: 8px;\n  color: white;\n  cursor: pointer;\n  padding: 10px;\n  text-align: center;\n  font-weight: 700;\n  font-size: 2em;\n  min-width: 50px;\n}\n\n.button:hover {\n  background: #006ce9;\n}\n"
  },
  {
    "path": "starters/features/builder.io/src/components/counter/counter.tsx",
    "content": "import { component$, useSignal, $ } from \"@builder.io/qwik\";\nimport styles from \"./counter.module.css\";\nimport Gauge from \"../gauge\";\n\nexport default component$((props: { initialValue: number }) => {\n  const count = useSignal(props.initialValue || 99);\n\n  const setCount = $((newValue: number) => {\n    if (newValue >= 0 && newValue <= 100) {\n      count.value = newValue;\n\n      if (newValue === 100) {\n        celebrate();\n      }\n    }\n  });\n\n  return (\n    <div class={styles.wrapper}>\n      <button class={styles.button} onClick$={() => setCount(count.value - 1)}>\n        -\n      </button>\n      <Gauge value={count.value} />\n      <button class={styles.button} onClick$={() => setCount(count.value + 1)}>\n        +\n      </button>\n    </div>\n  );\n});\n\nexport const celebrate = $(async () => {\n  const defaults = {\n    spread: 360,\n    ticks: 70,\n    gravity: 0,\n    decay: 0.95,\n    startVelocity: 30,\n    colors: [\"006ce9\", \"ac7ff4\", \"18b6f6\", \"713fc2\", \"ffffff\"],\n    origin: {\n      x: 0.5,\n      y: 0.35,\n    },\n  };\n\n  function loadConfetti() {\n    return new Promise<(opts: any) => void>((resolve, reject) => {\n      if ((globalThis as any).confetti) {\n        return resolve((globalThis as any).confetti as any);\n      }\n      const script = document.createElement(\"script\");\n      script.src =\n        \"https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js\";\n      script.onload = () => resolve((globalThis as any).confetti as any);\n      script.onerror = reject;\n      document.head.appendChild(script);\n      script.remove();\n    });\n  }\n\n  const confetti = await loadConfetti();\n\n  function shoot() {\n    confetti({\n      ...defaults,\n      particleCount: 80,\n      scalar: 1.2,\n    });\n\n    confetti({\n      ...defaults,\n      particleCount: 60,\n      scalar: 0.75,\n    });\n  }\n\n  setTimeout(shoot, 0);\n  setTimeout(shoot, 100);\n  setTimeout(shoot, 200);\n  setTimeout(shoot, 300);\n  setTimeout(shoot, 400);\n});\n"
  },
  {
    "path": "starters/features/builder.io/src/components/gauge/gauge.module.css",
    "content": ".wrapper {\n  position: relative;\n}\n\n.gauge {\n  width: 160px;\n}\n\n.value {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  color: white;\n  font-size: 3rem;\n  transform: translate(-50%, -50%);\n  width: 200px;\n  text-align: center;\n}\n\n@media screen and (min-width: 768px) {\n  .gauge {\n    width: 400px;\n  }\n  .value {\n    font-size: 7rem;\n  }\n}\n"
  },
  {
    "path": "starters/features/builder.io/src/components/gauge/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport styles from \"./gauge.module.css\";\n\nexport default component$(({ value = 50 }: { value?: number }) => {\n  const safeValue = value >= 0 && value <= 100 ? value : 50;\n\n  return (\n    <div class={styles.wrapper}>\n      <svg viewBox=\"0 0 120 120\" class={styles.gauge}>\n        <defs>\n          <linearGradient id=\"gradient\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n            <stop offset=\"0%\" stop-color=\"#18B6F6\" />\n            <stop offset=\"1000%\" stop-color=\"#AC7FF4\" />\n          </linearGradient>\n        </defs>\n\n        <circle\n          r=\"56\"\n          cx=\"60\"\n          cy=\"60\"\n          stroke-width=\"8\"\n          style=\"fill: #000; stroke: #0000\"\n        ></circle>\n\n        <circle\n          r=\"56\"\n          cx=\"60\"\n          cy=\"60\"\n          stroke-width=\"8\"\n          style={`transform: rotate(-87.9537deg); stroke-dasharray: ${\n            safeValue * 3.51\n          }, 351.858; fill:none; transform-origin:50% 50%; stroke-linecap:round; stroke:url(#gradient)`}\n        ></circle>\n      </svg>\n      <span class={styles.value}>{safeValue}</span>\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/features/builder.io/src/routes/[...index]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { fetchOneEntry, Content } from \"@builder.io/sdk-qwik\";\nimport { CUSTOM_COMPONENTS } from \"~/components/builder-registry\";\n\nexport const BUILDER_MODEL = \"page\";\n\n// Use Qwik City's `useBuilderContent` to get your content from Builder.\n// `routeLoader$()` takes an async function to fetch content\n// from Builder with `fetchOneEntry()`.\nexport const useBuilderContent = routeLoader$(async (event) => {\n  const isPreviewing = event.url.searchParams.has(\"builder.preview\");\n\n  const builderContent = await fetchOneEntry({\n    model: BUILDER_MODEL,\n    apiKey: import.meta.env.PUBLIC_BUILDER_API_KEY,\n    userAttributes: { urlPath: event.url.pathname },\n    options: event.query,\n  });\n\n  // If there's no content, throw a 404.\n  // You can use your own 404 component here\n  if (!builderContent && !isPreviewing) {\n    throw event.error(404, \"Page not found\");\n  }\n  // return content fetched from Builder, which is JSON\n  return builderContent;\n});\n\nexport default component$(() => {\n  const content = useBuilderContent();\n\n  // Content uses `content` to\n  // render the content of the given model, here a page,\n  // of your space (specified by the API Key)\n  return (\n    <Content\n      model={BUILDER_MODEL}\n      content={content.value}\n      apiKey={import.meta.env.PUBLIC_BUILDER_API_KEY}\n      customComponents={CUSTOM_COMPONENTS}\n    />\n  );\n});\n"
  },
  {
    "path": "starters/features/compiled-i18n/package.json",
    "content": "{\n  \"description\": \"Add compiled-i18n to your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: compiled-i18n (compile time translations)\",\n    \"priority\": -10,\n    \"viteConfig\": {\n      \"imports\": [\n        {\n          \"namedImports\": [\n            \"i18nPlugin\"\n          ],\n          \"importPath\": \"compiled-i18n/vite\"\n        }\n      ],\n      \"vitePlugins\": [\n        \"i18nPlugin({ locales: ['en'] })\"\n      ]\n    },\n    \"docs\": [\n      \"https://qwik.dev/docs/integrations/i18n/#localize\",\n      \"https://github.com/wmertens/compiled-i18n/blob/main/Readme.md\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \" - Change the `locales` array in the vite config to add more languages\",\n        \" - Use the `src/components/locale-selector/locale-selector.tsx` component to switch languages\",\n        \"\",\n        \" Check out the compiled-i18n docs:\",\n        \"   - https://github.com/wmertens/compiled-i18n/blob/main/Readme.md\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"compiled-i18n\": \"latest\"\n  }\n}\n"
  },
  {
    "path": "starters/features/compiled-i18n/src/components/locale-selector/locale-selector.tsx",
    "content": "import { component$, getLocale } from \"@builder.io/qwik\";\nimport { _, locales } from \"compiled-i18n\";\n\nexport const LocaleSelector = component$(() => {\n  const currentLocale = getLocale();\n  return (\n    <>\n      {locales.map((locale) => {\n        const isCurrent = locale === currentLocale;\n        return (\n          // Note, you must use `<a>` and not `<Link>` so the page reloads\n          <a\n            key={locale}\n            // When using route-based locale selection, build the URL here\n            href={`?locale=${locale}`}\n            aria-disabled={isCurrent}\n            class={\n              \"btn btn-ghost btn-sm\" +\n              (isCurrent\n                ? \" bg-neutralContent text-neutral pointer-events-none\"\n                : \" bg-base-100 text-base-content\")\n            }\n          >\n            {locale}\n          </a>\n        );\n      })}\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/features/compiled-i18n/src/entry.ssr.tsx",
    "content": "/**\n * WHAT IS THIS FILE?\n *\n * SSR entry point, in all cases the application is rendered outside the browser, this\n * entry point will be the common one.\n *\n * - Server (express, cloudflare...)\n * - npm run start\n * - npm run preview\n * - npm run build\n *\n */\nimport {\n  renderToStream,\n  type RenderToStreamOptions,\n} from \"@builder.io/qwik/server\";\nimport { extractBase, setSsrLocaleGetter } from \"compiled-i18n/qwik\";\nimport Root from \"./root\";\n\nsetSsrLocaleGetter();\n\nexport default function (opts: RenderToStreamOptions) {\n  return renderToStream(<Root />, {\n    ...opts,\n\n    base: extractBase,\n\n    // Use container attributes to set attributes on the html tag.\n    containerAttributes: {\n      lang: opts.serverData!.locale,\n      ...opts.containerAttributes,\n    },\n    serverData: {\n      ...opts.serverData,\n    },\n  });\n}\n"
  },
  {
    "path": "starters/features/compiled-i18n/src/routes/plugin@compiled-i18n.ts",
    "content": "// ... other imports\nimport { guessLocale } from \"compiled-i18n\";\nimport type { RequestHandler } from \"@builder.io/qwik-city\";\n\n/**\n * Handle incoming requests to determine and set the appropriate locale.\n * This function checks for a 'locale' query parameter, then a `locale` cookie,\n * and finally falls back to the 'Accept-Language' header.\n */\nexport const onRequest: RequestHandler = async ({\n  query,\n  cookie,\n  headers,\n  locale,\n}) => {\n  // Allow overriding locale with query param `locale`\n  if (query.has(\"locale\")) {\n    const newLocale = guessLocale(query.get(\"locale\"));\n    cookie.delete(\"locale\");\n    cookie.set(\"locale\", newLocale, {});\n    locale(newLocale);\n  } else {\n    // Choose locale based on cookie or accept-language header\n    const maybeLocale =\n      cookie.get(\"locale\")?.value || headers.get(\"accept-language\");\n    locale(guessLocale(maybeLocale));\n  }\n};\n"
  },
  {
    "path": "starters/features/cypress/cypress/fixtures/example.json",
    "content": "{\n  \"name\": \"Using fixtures to represent data\",\n  \"email\": \"hello@cypress.io\",\n  \"body\": \"Fixtures are a great way to mock data for responses to routes\"\n}\n"
  },
  {
    "path": "starters/features/cypress/cypress/support/commands.ts",
    "content": "/// <reference types=\"cypress\" />\n// ***********************************************\n// This example commands.ts shows you how to\n// create various custom commands and overwrite\n// existing commands.\n//\n// For more comprehensive examples of custom\n// commands please read more here:\n// https://on.cypress.io/custom-commands\n// ***********************************************\n//\n//\n// -- This is a parent command --\n// Cypress.Commands.add('login', (email, password) => { ... })\n//\n//\n// -- This is a child command --\n// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })\n//\n//\n// -- This is a dual command --\n// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })\n//\n//\n// -- This will overwrite an existing command --\n// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })\n//\n// declare global {\n//   namespace Cypress {\n//     interface Chainable {\n//       login(email: string, password: string): Chainable<void>\n//       drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>\n//       dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>\n//       visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>\n//     }\n//   }\n// }\n"
  },
  {
    "path": "starters/features/cypress/cypress/support/component-index.html",
    "content": "<!doctype html>\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n    <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\" />\n    <title>Components App</title>\n  </head>\n  <body>\n    <div data-cy-root></div>\n  </body>\n</html>\n"
  },
  {
    "path": "starters/features/cypress/cypress/support/component.ts",
    "content": "// ***********************************************************\n// This example support/component.ts is processed and\n// loaded automatically before your test files.\n//\n// This is a great place to put global configuration and\n// behavior that modifies Cypress.\n//\n// You can change the location of this file or turn off\n// automatically serving support files with the\n// 'supportFile' configuration option.\n//\n// You can read more here:\n// https://on.cypress.io/configuration\n// ***********************************************************\n\nimport { addQwikLoader } from \"cypress-ct-qwik\";\naddQwikLoader();\n\n// Import commands.js using ES2015 syntax:\nimport \"./commands\";\n\n// Alternatively you can use CommonJS syntax:\n// require('./commands')\n\nimport { mount } from \"cypress-ct-qwik\";\n\n// Augment the Cypress namespace to include type definitions for\n// your custom command.\n// Alternatively, can be defined in cypress/support/component.d.ts\n// with a <reference path=\"./component\" /> at the top of your spec.\ndeclare global {\n  namespace Cypress {\n    interface Chainable {\n      mount: typeof mount;\n    }\n  }\n}\n\nCypress.Commands.add(\"mount\", mount);\n\n// Example use:\n// cy.mount(MyComponent)\n"
  },
  {
    "path": "starters/features/cypress/cypress/tsconfig.cy.json",
    "content": "{\n  \"extends\": \"../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"../../../dist/out-tsc\",\n    \"module\": \"commonjs\",\n    \"types\": [\"cypress\", \"node\"]\n  },\n  \"include\": [\n    \"support/**/*.ts\",\n    \"../cypress.config.ts\",\n    \"../**/*.cy.ts\",\n    \"../**/*.cy.tsx\",\n    \"../**/*.cy.js\",\n    \"../**/*.cy.jsx\",\n    \"../**/*.d.ts\"\n  ]\n}\n"
  },
  {
    "path": "starters/features/cypress/cypress.config.ts",
    "content": "import { defineConfig } from \"cypress\";\n\nexport default defineConfig({\n  component: {\n    devServer: {\n      framework: \"cypress-ct-qwik\" as any,\n      bundler: \"vite\",\n    },\n  },\n});\n"
  },
  {
    "path": "starters/features/cypress/cypress.d.ts",
    "content": "/// <reference types=\"cypress\" />\n\nimport type { mount } from \"cypress-ct-qwik\";\n\ntype MountParams = Parameters<typeof mount>;\ntype OptionsParam = MountParams[0];\n\ndeclare global {\n  namespace Cypress {\n    interface Chainable {\n      mount: typeof mount;\n    }\n  }\n}\n"
  },
  {
    "path": "starters/features/cypress/package.json",
    "content": "{\n  \"description\": \"Add Cypress component testing\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Cypress\",\n    \"priority\": -10,\n    \"docs\": [\n      \"https://qwik.dev/integrations/cypress/\",\n      \"https://docs.cypress.io/guides/getting-started/installing-cypress\",\n      \"https://docs.cypress.io/guides/component-testing/overview\",\n      \"https://github.com/qwikifiers/cypress-qwik\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"New example component\",\n      \"lines\": [\n        \" We created an example componenet in 'src/components/example'\",\n        \" There you will see a '.cy.tsx' file which is the component test\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"cypress\": \"~12.17.2\",\n    \"cypress-ct-qwik\": \"~0.3.0\"\n  },\n  \"scripts\": {\n    \"cypress.open\": \"cypress open --component\",\n    \"cypress.run\": \"cypress run --component\"\n  }\n}\n"
  },
  {
    "path": "starters/features/cypress/src/actions/example.action.ts",
    "content": "import { routeAction$ } from \"@builder.io/qwik-city\";\n\nexport const useExampleAction = routeAction$(() => {\n  return \"This is example action data.\";\n});\n"
  },
  {
    "path": "starters/features/cypress/src/components/example/example.cy.tsx",
    "content": "import { $, component$ } from \"@builder.io/qwik\";\nimport { QwikCityMockProvider } from \"@builder.io/qwik-city\";\n\nimport { ExampleTest } from \"./example\";\nimport { useExampleLoader } from \"../../loaders/example.loader\";\nimport { useExampleAction } from \"../../actions/example.action\";\n\nconst Template = component$((props: { flag: boolean }) => {\n  const loadersMock = [\n    {\n      loader: useExampleLoader,\n      data: \"Loader Data\",\n    },\n  ];\n\n  const actionStub = $(() => cy.stub().as(\"actionStub\"))();\n  const actionsMock = [\n    {\n      action: useExampleAction,\n      handler: $(async () => {\n        await actionStub.then((_) => _());\n        return { status: 200, result: \"Action Data\" };\n      }),\n    },\n  ];\n\n  return (\n    <QwikCityMockProvider loaders={loadersMock} actions={actionsMock}>\n      <ExampleTest flag={props.flag} />\n    </QwikCityMockProvider>\n  );\n});\n\nit(\"should render ⭐\", () => {\n  cy.mount(<Template flag={true} />);\n  cy.get(\"#icon\").should(\"contain.text\", \"⭐\");\n});\n\nit(\"should render 💣\", () => {\n  cy.mount(<Template flag={false} />);\n  cy.get(\"#icon\").should(\"contain.text\", \"💣\");\n});\n\nit(\"should count clicks\", () => {\n  cy.mount(<Template flag={true} />);\n  cy.get(\"#count\").should(\"contain.text\", \"Count:0\");\n  cy.get(\"#btn-counter\").click();\n  cy.get(\"#count\").should(\"contain.text\", \"Count:1\");\n});\n\nit(\"should render loader data\", () => {\n  cy.mount(<Template flag={true} />);\n  cy.get(\"#loader-data\").should(\"contain.text\", \"Loader Data\");\n});\n\nit(\"should call action on button click\", () => {\n  cy.mount(<Template flag={true} />);\n  cy.get(\"#btn-action\").click();\n  cy.get(\"@actionStub\").should(\"have.been.called\");\n});\n"
  },
  {
    "path": "starters/features/cypress/src/components/example/example.tsx",
    "content": "import { component$, useStore } from \"@builder.io/qwik\";\n\nimport { useExampleLoader } from \"../../loaders/example.loader\";\nimport { useExampleAction } from \"../../actions/example.action\";\n\nexport const ExampleTest = component$((props: { flag: boolean }) => {\n  const state = useStore({\n    counter: 0,\n  });\n\n  const loaderState = useExampleLoader();\n  const action = useExampleAction();\n\n  return (\n    <>\n      <span id=\"count\">Count:{state.counter}</span>\n      <div id=\"icon\">Flag: {props.flag ? \"⭐\" : \"💣\"}</div>\n      <button id=\"btn-counter\" onClick$={() => state.counter++}>\n        Increment counter\n      </button>\n      <span id=\"loader-data\">{loaderState.value}</span>\n      <button id=\"btn-action\" onClick$={() => action.submit()}>\n        Call action\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/features/cypress/src/loaders/example.loader.ts",
    "content": "import { routeLoader$ } from \"@builder.io/qwik-city\";\n\nexport const useExampleLoader = routeLoader$(() => {\n  return \"This is example loader data.\";\n});\n"
  },
  {
    "path": "starters/features/drizzle/drizzle/db/.gitkeep",
    "content": ""
  },
  {
    "path": "starters/features/drizzle/drizzle/migrations/.gitkeep",
    "content": ""
  },
  {
    "path": "starters/features/drizzle/drizzle/schema.ts",
    "content": "import { sqliteTable as table } from \"drizzle-orm/sqlite-core\";\nimport * as t from \"drizzle-orm/sqlite-core\";\n\nexport const users = table(\"users\", {\n  id: t.int({ mode: \"number\" }).primaryKey({ autoIncrement: true }),\n  name: t.text().default(\"not_provided\"),\n  email: t.text().notNull(),\n});\n\nexport const schema = {\n  users,\n};\n"
  },
  {
    "path": "starters/features/drizzle/drizzle.config.ts",
    "content": "import { defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  dialect: \"sqlite\",\n  schema: \"./drizzle/schema.ts\",\n  out: \"./drizzle/migrations/\",\n  dbCredentials: {\n    url: \"./drizzle/db/db.sqlite\",\n  },\n});\n"
  },
  {
    "path": "starters/features/drizzle/package.json",
    "content": "{\n  \"description\": \"Headless TypeScript ORM with a head 🐲\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Drizzle (Database ORM)\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://qwik.dev/integrations/drizzle/\",\n      \"https://orm.drizzle.team/docs/overview\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \" Drizzle was installed with a simple DB schema and some demo routes,\",\n        \" now you need to run `npm run drizzle:migrate` to setup the database.\",\n        \"\",\n        \" better-sqlite3 was configured by default, but in production\",\n        \" you'll want to use Postgres or MySQL.\",\n        \"\",\n        \"\",\n        \" Drizzle studio was also added which you can access by running `npm run drizzle:studio`,\",\n        \"\",\n        \" Check out the Drizzle docs for more info:\",\n        \"   - https://orm.drizzle.team/docs/overview\"\n      ]\n    },\n    \"alwaysInRoot\": []\n  },\n  \"devDependencies\": {\n    \"@types/better-sqlite3\": \"^7.6.12\",\n    \"drizzle-kit\": \"^0.30.3\",\n    \"better-sqlite3\": \"^11.8.1\",\n    \"drizzle-orm\": \"^0.39.0\"\n  },\n  \"scripts\": {\n    \"drizzle:generate\": \"drizzle-kit generate\",\n    \"drizzle:migrate\": \"drizzle-kit migrate\",\n    \"drizzle:push\": \"drizzle-kit push\",\n    \"drizzle:pull\": \"drizzle-kit pull\",\n    \"drizzle:check\": \"drizzle-kit check\",\n    \"drizzle:up\": \"drizzle-kit up\",\n    \"drizzle:studio\": \"drizzle-kit studio\",\n    \"postinstall\": \"drizzle-kit generate\"\n  }\n}\n"
  },
  {
    "path": "starters/features/drizzle/src/routes/create/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeAction$, zod$, z, Form } from \"@builder.io/qwik-city\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport Database from \"better-sqlite3\";\nimport { schema } from \"../../../drizzle/schema\";\nexport const useCreateUser = routeAction$(\n  async (data) => {\n    const sqlite = new Database(\"./drizzle/db/db.sqlite\");\n    const db = drizzle(sqlite, { schema });\n    const user = await db.insert(schema.users).values(data);\n    return user;\n  },\n  zod$({\n    name: z.string(),\n    email: z.string().email(),\n  }),\n);\n\nexport default component$(() => {\n  const createUserAction = useCreateUser();\n  return (\n    <section>\n      <h1>Create User</h1>\n      <Form action={createUserAction}>\n        <label>\n          Name\n          <input name=\"name\" value={createUserAction.formData?.get(\"name\")} />\n        </label>\n        <label>\n          Email\n          <input name=\"email\" value={createUserAction.formData?.get(\"email\")} />\n        </label>\n        <button type=\"submit\">Create</button>\n      </Form>\n      {createUserAction.value && (\n        <div>\n          <h2>User created successfully!</h2>\n        </div>\n      )}\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/features/drizzle/src/routes/users/[userId]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport Database from \"better-sqlite3\";\nimport { schema } from \"../../../../drizzle/schema\";\n\nexport const useGetUser = routeLoader$(async (requestEvent) => {\n  const userId = parseInt(requestEvent.params[\"userId\"], 10);\n  const sqlite = new Database(\"./drizzle/db/db.sqlite\");\n  const db = drizzle(sqlite, { schema });\n  const user = await db.query.users.findFirst({\n    where: (users, { eq }) => eq(users.id, userId),\n  });\n  if (!user) {\n    // Set the status to 404 if the user is not found\n    requestEvent.status(404);\n  }\n  return user;\n});\n\nexport default component$(() => {\n  const user = useGetUser();\n  return (\n    <section>\n      <h1>User detail</h1>\n      {user.value ? (\n        <>\n          <p>Name: {user.value.name}</p>\n          <p>Email: {user.value.email}</p>\n        </>\n      ) : (\n        <p>User not found</p>\n      )}\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/features/drizzle/src/routes/users/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { drizzle } from \"drizzle-orm/better-sqlite3\";\nimport Database from \"better-sqlite3\";\nimport { schema } from \"../../../drizzle/schema\";\n\nexport const useGetUsers = routeLoader$(async () => {\n  const sqlite = new Database(\"./drizzle/db/db.sqlite\");\n  const db = drizzle(sqlite, { schema });\n  const users = await db.query.users.findMany();\n  return users;\n});\n\nexport default component$(() => {\n  const users = useGetUsers();\n  return (\n    <section>\n      <h1>User's directory</h1>\n      <ul>\n        {users.value.map((user) => (\n          <li key={user.id}>\n            <a href={`/users/${user.id}`}>\n              {user.name} ({user.email})\n            </a>\n          </li>\n        ))}\n      </ul>\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/features/leaflet-map/package.json",
    "content": "{\n  \"description\": \"Use Leaflet Maps in your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Leaflet Maps\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://leafletjs.com/reference.html\",\n      \"https://leafletjs.com/examples/quick-start/\",\n      \"https://www.sitepoint.com/leaflet-create-map-beginner-guide/\"\n    ],\n    \"nextSteps\": {\n      \"lines\": [\n        \"We start the project with the `start` npm script\",\n        \"Once started, we access the /basic-map path to see the demo example.\",\n        \"You can make changes and experiment within src/routes/basic-map/index.tsx\",\n        \"to add a new location, zoom,... and any improvements to the maps component\",\n        \"can be done in the src/components/leaflet-map/index.tsx section.\",\n        \"Have a look at the docs for more info:\",\n        \"https://leafletjs.com/\"\n      ]\n    }\n  },\n  \"dependencies\": {\n    \"leaflet\": \"1.9.4\"\n  },\n  \"devDependencies\": {\n    \"@types/leaflet\": \"^1.9.6\"\n  }\n}\n"
  },
  {
    "path": "starters/features/leaflet-map/src/components/leaflet-map/index.tsx",
    "content": "import {\n  component$,\n  noSerialize,\n  useSignal,\n  useStyles$,\n  useVisibleTask$,\n} from \"@builder.io/qwik\";\nimport { Map } from \"leaflet\";\nimport type { MapProps } from \"~/models/map\";\n\nexport const LeafletMap = component$<MapProps>(({ location }: MapProps) => {\n  // Modify with your preferences. By default take all screen\n  useStyles$(`\n    #map {\n      width: 100%;\n      height: 100vh;\n    }\n  `);\n\n  const mapContainer$ = useSignal<Map>();\n\n  useVisibleTask$(async ({ track }) => {\n    track(location);\n\n    const { tileLayer, marker } = await import(\"leaflet\");\n\n    const { getBoundaryBox } = await import(\"../../helpers/boundary-box\");\n\n    if (mapContainer$.value) {\n      mapContainer$.value.remove();\n    }\n\n    const { value: locationData } = location;\n\n    const centerPosition: [number, number] = locationData.point as [\n      number,\n      number,\n    ];\n\n    const map: any = new Map(\"map\").setView(\n      centerPosition,\n      locationData.zoom || 14,\n    );\n\n    tileLayer(\"https://tile.openstreetmap.org/{z}/{x}/{y}.png\", {\n      maxZoom: 19,\n      attribution:\n        '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>',\n    }).addTo(map);\n\n    // Assign select boundary box to use in OSM API if you want\n    locationData.boundaryBox = getBoundaryBox(map);\n\n    locationData.marker &&\n      marker(centerPosition).bindPopup(`Soraluze (Gipuzkoa) :)`).addTo(map);\n\n    mapContainer$.value = noSerialize(map);\n  });\n  return <div id=\"map\"></div>;\n});\n"
  },
  {
    "path": "starters/features/leaflet-map/src/helpers/boundary-box.tsx",
    "content": "import type { Map } from \"leaflet\";\nexport const getBoundaryBox = (map: Map) => {\n  const northEast = map.getBounds().getNorthEast();\n  const southWest = map.getBounds().getSouthWest();\n  return `${southWest.lat},${southWest.lng},${northEast.lat},${northEast.lng}`;\n};\n"
  },
  {
    "path": "starters/features/leaflet-map/src/models/location.ts",
    "content": "export interface LocationsProps {\n  name: string;\n  // latitude , longitude\n  point: [number, number];\n  // Southwest lat, South West Lng, North East lat,  North East lng\n  boundaryBox: string;\n  zoom: number;\n  marker: boolean;\n}\n"
  },
  {
    "path": "starters/features/leaflet-map/src/models/map.ts",
    "content": "import type { LocationsProps } from \"./location\";\nimport { type Signal } from \"@builder.io/qwik\";\nexport interface MapProps {\n  // default options\n  location: Signal<LocationsProps>;\n  // add other options to customization map\n}\n"
  },
  {
    "path": "starters/features/leaflet-map/src/routes/basic-map/index.tsx",
    "content": "import { component$, useStyles$, useSignal } from \"@builder.io/qwik\";\n\n// Leaflet map styles\nimport leafletStyles from \"../../../node_modules/leaflet/dist/leaflet.css?inline\";\n\nimport { LeafletMap } from \"~/components/leaflet-map\";\nimport type { LocationsProps } from \"~/models/location\";\n\nexport default component$(() => {\n  useStyles$(leafletStyles);\n  const currentLocation = useSignal<LocationsProps>({\n    name: \"Soraluze\",\n    point: [43.17478, -2.41172],\n    /**\n     * Define rectangle with: Southwest lat, South West Lng, North East lat,  North East lng points.\n     * Very interesting when use to filter in OpenStreetMap API to take POIs\n     * Example: https://qwik-osm-poc.netlify.app/\n     */\n    boundaryBox:\n      \"43.14658914559456,-2.4765586853027344,43.202923523094725,-2.3467826843261723\",\n    zoom: 9,\n    marker: true,\n  });\n  return <LeafletMap location={currentLocation} />;\n});\n"
  },
  {
    "path": "starters/features/orama/package.json",
    "content": "{\n  \"description\": \"Use Orama in your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Orama (full-text search engine)\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://docs.oramasearch.com/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \" - /src/routes/orama: New public route showcasing Orama integration\",\n        \"\",\n        \" Check out the Orama docs for more info:\",\n        \"   - https://docs.oramasearch.com/\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"@orama/orama\": \"^1.2.11\"\n  }\n}\n"
  },
  {
    "path": "starters/features/orama/src/orama/index.ts",
    "content": "import { type Orama, create, insert } from \"@orama/orama\";\n\nexport type Pokemon = { name: string; description: string; image: string };\n\nconst pokedex: Pokemon[] = [\n  {\n    name: \"Bulbasaur\",\n    description:\n      \"There is a plant seed on its back right from the day this Pokémon is born. The seed slowly grows larger.\",\n    image: \"https://assets.pokemon.com/assets/cms2/img/pokedex/full/001.png\",\n  },\n  {\n    name: \"Charmander\",\n    description:\n      \"It has a preference for hot things. When it rains, steam is said to spout from the tip of its tail.\",\n    image: \"https://assets.pokemon.com/assets/cms2/img/pokedex/full/004.png\",\n  },\n  {\n    name: \"Squirtle\",\n    description:\n      \"When it retracts its long neck into its shell, it squirts out water with vigorous force.\",\n    image: \"https://assets.pokemon.com/assets/cms2/img/pokedex/full/007.png\",\n  },\n];\n\nexport let oramaDb: Orama;\n\nexport const createOramaDb = async () => {\n  if (oramaDb) {\n    return;\n  }\n  const db = await create({\n    schema: {\n      name: \"string\",\n      description: \"string\",\n      image: \"string\",\n    },\n  });\n  oramaDb = db;\n  pokedex.map(async (pokemon) => await insert(oramaDb, pokemon));\n};\n"
  },
  {
    "path": "starters/features/orama/src/routes/orama/index.tsx",
    "content": "import { $, component$, useSignal, useStylesScoped$ } from \"@builder.io/qwik\";\nimport { server$ } from \"@builder.io/qwik-city\";\nimport { search } from \"@orama/orama\";\nimport { type Pokemon, oramaDb, createOramaDb } from \"~/orama\";\n\ncreateOramaDb();\n\nexport default component$(() => {\n  useStylesScoped$(`\n\t\t.search {\n\t\t\tfont-size: 100%;\n\t\t\twidth: calc(100% - 38px);\n\t\t\tborder-radius: 0.5rem;\n\t\t\tborder: 1px black solid;\n\t\t\tpadding: 1rem;\n\t\t\tcolor: black;\n\t\t\toutline: none;\n\t\t}\n\n\t\t.search-button {\n\t\t\tborder: none;\n\t\t\tpadding: 6px 0px;\n\t\t\tcursor: pointer;\n\t\t\tbackground-color: transparent;\n\t\t\tposition: absolute;\n\t\t\tright: 0.6rem;\n\t\t\tpadding: 0.7rem 0.5rem 0.4rem 0.5rem;\n\t\t\toutline: none;\n\t\t}\n\n\t\t.list {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: space-around;\n\t\t}\n\n\t\t.card {\n\t\t\twidth: 300px;\n\t\t\tborder-radius: .5rem;\n\t\t\tborder: 1px black solid;\n\t\t\tbackground-color: white;\n\t\t\tcolor: black;\n\t\t}\n\t`);\n  const termSignal = useSignal(\"\");\n  const pokedexSig = useSignal<Pokemon[]>([]);\n\n  const onSearch = $(async (term: string) => {\n    const response = await execSearch(term);\n    pokedexSig.value = (response.hits || []).map(\n      (hit) => hit.document as unknown as Pokemon,\n    );\n  });\n\n  return (\n    <div>\n      <div style=\"margin: 1rem;\">\n        <div style=\"position: relative;\">\n          <input\n            class=\"search\"\n            placeholder=\"e.g. search for plant, water, hot.\"\n            bind:value={termSignal}\n            onKeyDown$={(e) => {\n              if (e.key === \"Enter\") {\n                onSearch(termSignal.value);\n              }\n            }}\n          />\n          <button\n            type=\"submit\"\n            class=\"search-button\"\n            onClick$={() => onSearch(termSignal.value)}\n          >\n            <svg\n              xmlns=\"http://www.w3.org/2000/svg\"\n              width=\"32\"\n              height=\"32\"\n              viewBox=\"0 0 24 24\"\n            >\n              <path\n                fill=\"currentColor\"\n                d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\"\n              />\n            </svg>\n          </button>\n        </div>\n      </div>\n      <div class=\"list\">\n        {pokedexSig.value.map(({ name, description, image }) => (\n          <div key={name} class=\"card\">\n            <div style=\"padding: 1.25rem; text-align:center;\">\n              <img width={200} height={200} src={image} alt={name} />\n              <div style=\"font-weight: 700; font-size: 1.5rem;\">{name}</div>\n              <p>{description}</p>\n            </div>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n});\n\nexport const execSearch = server$(async (term: string) => {\n  const response = await search(oramaDb, {\n    term,\n    properties: \"*\",\n    boost: { name: 1.5 },\n  });\n  return response;\n});\n"
  },
  {
    "path": "starters/features/pandacss/.eslintignore",
    "content": "# Panda CSS\nsrc/styled-system\npanda.config.ts"
  },
  {
    "path": "starters/features/pandacss/.prettierignore",
    "content": "# Panda CSS\nsrc/styled-system\n"
  },
  {
    "path": "starters/features/pandacss/gitignore",
    "content": "# Panda CSS\nsrc/styled-system\n"
  },
  {
    "path": "starters/features/pandacss/package.json",
    "content": "{\n  \"description\": \"Zero-runtime CSS-in-JS\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: PandaCSS (styling)\",\n    \"priority\": -10,\n    \"postInstall\": \"panda codegen --silent\",\n    \"docs\": [\n      \"https://panda-css.com/docs/getting-started/qwik\"\n    ],\n    \"viteConfig\": {\n      \"imports\": [\n        {\n          \"namedImports\": [\n            \"macroPlugin\"\n          ],\n          \"importPath\": \"@builder.io/vite-plugin-macro\"\n        }\n      ],\n      \"vitePluginsPrepend\": [\n        \"macroPlugin({ preset: 'pandacss' })\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"@builder.io/vite-plugin-macro\": \"~0.0.7\",\n    \"@pandacss/dev\": \"^0.54.0\"\n  },\n  \"scripts\": {\n    \"prebuild.pandacss\": \"panda codegen --silent\"\n  }\n}\n"
  },
  {
    "path": "starters/features/pandacss/panda.config.ts",
    "content": "import { defineConfig } from \"@pandacss/dev\";\n\nexport default defineConfig({\n  jsxFramework: \"qwik\",\n\n  // Whether to use css reset\n  preflight: true,\n\n  // Where to look for your css declarations\n  include: [\"./src/**/*.{js,jsx,ts,tsx}\"],\n\n  // Files to exclude\n  exclude: [],\n\n  // Useful for theme customization\n  theme: {\n    extend: {},\n  },\n\n  // The output directory for your css system\n  outdir: \"src/styled-system\",\n});\n"
  },
  {
    "path": "starters/features/pandacss/postcss.config.js",
    "content": "module.exports = {\n  plugins: {\n    \"@pandacss/dev/postcss\": {},\n  },\n};\n"
  },
  {
    "path": "starters/features/pandacss/src/global.css",
    "content": "/**\n * PandaCSS CSS layers\n * View the full documentation at https://panda-css.com/docs/concepts/cascade-layers#layer-css\n */\n@layer reset, base, tokens, recipes, utilities;\n"
  },
  {
    "path": "starters/features/pandacss/src/routes/pandacss/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { css } from \"~/styled-system/css\";\n\nexport default component$(() => {\n  return (\n    <div\n      class={css({\n        padding: 10,\n        bg: \"red.400\",\n        height: \"dvh\",\n        margin: 100,\n        fontSize: 30,\n      })}\n    >\n      This box is styled with PandaCSS.\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/features/partytown/package.json",
    "content": "{\n  \"description\": \"Use Partytown in your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Partytown (3rd-party scripts)\",\n    \"priority\": -10,\n    \"viteConfig\": {\n      \"imports\": [\n        {\n          \"namedImports\": [\n            \"partytownVite\"\n          ],\n          \"importPath\": \"@qwik.dev/partytown/utils\"\n        },\n        {\n          \"namedImports\": [\n            \"join\"\n          ],\n          \"importPath\": \"path\"\n        }\n      ],\n      \"vitePlugins\": [\n        \"partytownVite({dest: join(__dirname, 'dist', '~partytown')})\"\n      ]\n    },\n    \"docs\": [\n      \"https://partytown.qwik.dev/\",\n      \"https://qwik.dev/integrations/partytown/\"\n    ],\n    \"nextSteps\": {\n      \"lines\": [\n        \" Please add the <QwikPartytown/> component\",\n        \" to your root.tsx file.\",\n        \" Have a look at the docs for more info: \",\n        \" https://partytown.qwik.dev/configuration\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"@qwik.dev/partytown\": \"^0.11.1\"\n  }\n}\n"
  },
  {
    "path": "starters/features/partytown/src/components/partytown/partytown.tsx",
    "content": "import type { PartytownConfig } from \"@qwik.dev/partytown/integration\";\nimport { partytownSnippet } from \"@qwik.dev/partytown/integration\";\n\n/**\n * Props for `<QwikPartytown/>`, which extends the Partytown Config.\n *\n * https://github.com/BuilderIO/partytown#config\n *\n * @public\n */\nexport interface PartytownProps extends PartytownConfig {}\n\n/**\n * @public\n * You can pass setting with props\n */\nexport const QwikPartytown = (props: PartytownProps): any => {\n  return <script dangerouslySetInnerHTML={partytownSnippet(props)} />;\n};\n"
  },
  {
    "path": "starters/features/playwright/package.json",
    "content": "{\n  \"description\": \"Use Playwright to run E2E tests into your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Playwright (E2E Test)\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"postInstall\": \"playwright install\",\n    \"docs\": [\n      \"https://playwright.dev/docs/writing-tests\"\n    ]\n  },\n  \"devDependencies\": {\n    \"@playwright/test\": \"^1.38.1\"\n  },\n  \"scripts\": {\n    \"test.e2e\": \"playwright test\"\n  }\n}\n"
  },
  {
    "path": "starters/features/playwright/playwright.config.ts",
    "content": "import type { PlaywrightTestConfig } from \"@playwright/test\";\nimport { devices } from \"@playwright/test\";\n\n/**\n * See https://playwright.dev/docs/test-configuration.\n */\nconst config: PlaywrightTestConfig = {\n  testDir: \"./tests\",\n  /* Run tests in files in parallel */\n  fullyParallel: true,\n  forbidOnly: !!process.env.CI,\n  retries: 2,\n  workers: process.env.CI ? 1 : undefined,\n  reporter: \"html\",\n  use: {\n    actionTimeout: 0,\n    trace: \"on-first-retry\",\n  },\n  projects: [\n    {\n      name: \"chromium\",\n      use: {\n        ...devices[\"Desktop Chrome\"],\n      },\n    },\n    // {\n    //   name: 'webkit',\n    //   use: {\n    //     ...devices['Desktop Safari'],\n    //   },\n    // },\n  ],\n\n  webServer: {\n    command: \"npm run preview\",\n    port: 4173,\n  },\n};\n\nexport default config;\n"
  },
  {
    "path": "starters/features/playwright/tests/example.spec.ts",
    "content": "import { test, expect } from \"@playwright/test\";\n\ntest(\"homepage has title and links to flower page\", async ({ page }) => {\n  await page.goto(\"/\");\n\n  // Expect a title \"to contain\" a substring.\n  await expect(page).toHaveTitle(/Qwik/);\n\n  // create a locator\n  const anchor = page.locator(\"a.mindblow\");\n\n  // Expect an attribute \"to be strictly equal\" to the value.\n  await expect(anchor).toHaveAttribute(\"href\", \"/flower\");\n});\n"
  },
  {
    "path": "starters/features/postcss/.vscode/settings.json",
    "content": "{\n  \"css.lint.unknownAtRules\": \"ignore\"\n}\n"
  },
  {
    "path": "starters/features/postcss/package.json",
    "content": "{\n  \"description\": \"Use PostCSS in your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: PostCSS (styling)\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://qwik.dev/integrations/postcss/\",\n      \"https://github.com/postcss/postcss-load-config\"\n    ],\n    \"alwaysInRoot\": [\n      \".vscode\"\n    ]\n  },\n  \"devDependencies\": {\n    \"autoprefixer\": \"^10.4.14\",\n    \"postcss\": \"^8.4.31\",\n    \"postcss-preset-env\": \"^9.1.0\"\n  }\n}\n"
  },
  {
    "path": "starters/features/postcss/postcss.config.js",
    "content": "export default {\n  plugins: {\n    autoprefixer: {},\n    \"postcss-preset-env\": {\n      stage: 3,\n      features: {\n        \"nesting-rules\": true,\n      },\n    },\n  },\n};\n"
  },
  {
    "path": "starters/features/prisma/package.json",
    "content": "{\n  \"description\": \"Next-generation Node.js TypeScript ORM\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Prisma (Database ORM)\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://qwik.dev/integrations/prisma/\",\n      \"https://www.prisma.io/docs/concepts/overview/what-is-prisma\"\n    ],\n    \"postInstall\": \"prisma migrate dev --name initial\",\n    \"nextSteps\": {\n      \"title\": \"Next Steps\",\n      \"lines\": [\n        \" Prisma was installed with a default DB schema and some demo routes,\",\n        \"\",\n        \" Sqlite was configured by default, but in production\",\n        \" you'll want to use Postgres or MongoDB.\",\n        \"\",\n        \" Check out the Prisma docs for more info:\",\n        \"   - https://www.prisma.io/docs/getting-started\"\n      ]\n    },\n    \"alwaysInRoot\": []\n  },\n  \"devDependencies\": {\n    \"@prisma/client\": \"5.3.1\",\n    \"prisma\": \"^5.3.1\"\n  },\n  \"scripts\": {\n    \"postinstall\": \"prisma generate\",\n    \"prisma:generate\": \"prisma generate\",\n    \"prisma:migrate\": \"prisma migrate dev\",\n    \"prisma:migrate:prod\": \"prisma migrate deploy\"\n  }\n}\n"
  },
  {
    "path": "starters/features/prisma/prisma/schema.prisma",
    "content": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n  provider = \"prisma-client-js\"\n}\n\ndatasource db {\n  provider = \"sqlite\"\n  url      = \"file:./dev.db\"\n}\n\nmodel User {\n  id    Int     @id @default(autoincrement())\n  email String  @unique\n  name  String?\n}"
  },
  {
    "path": "starters/features/prisma/src/routes/create/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeAction$, zod$, z, Form } from \"@builder.io/qwik-city\";\nimport { PrismaClient } from \"@prisma/client\";\n\nexport const useCreateUser = routeAction$(\n  async (data) => {\n    const prisma = new PrismaClient();\n    const user = await prisma.user.create({\n      data,\n    });\n    return user;\n  },\n  zod$({\n    name: z.string(),\n    email: z.string().email(),\n  }),\n);\n\nexport default component$(() => {\n  const createUserAction = useCreateUser();\n  return (\n    <section>\n      <h1>Create User</h1>\n      <Form action={createUserAction}>\n        <label>\n          Name\n          <input name=\"name\" value={createUserAction.formData?.get(\"name\")} />\n        </label>\n        <label>\n          Email\n          <input name=\"email\" value={createUserAction.formData?.get(\"email\")} />\n        </label>\n        <button type=\"submit\">Create</button>\n      </Form>\n      {createUserAction.value && (\n        <div>\n          <h2>User created successfully!</h2>\n        </div>\n      )}\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/features/prisma/src/routes/users/[userId]/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { PrismaClient } from \"@prisma/client\";\n\nexport const useGetUser = routeLoader$(async ({ params, status }) => {\n  const userId = parseInt(params[\"userId\"], 10);\n  const prisma = new PrismaClient();\n  const user = await prisma.user.findUnique({ where: { id: userId } });\n  if (!user) {\n    // Set the status to 404 if the user is not found\n    status(404);\n  }\n  return user;\n});\n\nexport default component$(() => {\n  const user = useGetUser();\n  return (\n    <section>\n      <h1>User detail</h1>\n      {user.value ? (\n        <>\n          <p>Name: {user.value.name}</p>\n          <p>Email: {user.value.email}</p>\n        </>\n      ) : (\n        <p>User not found</p>\n      )}\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/features/prisma/src/routes/users/index.tsx",
    "content": "import { component$ } from \"@builder.io/qwik\";\nimport { routeLoader$ } from \"@builder.io/qwik-city\";\nimport { PrismaClient } from \"@prisma/client\";\n\nexport const useGetUsers = routeLoader$(async () => {\n  const prisma = new PrismaClient();\n  const users = await prisma.user.findMany();\n  return users;\n});\n\nexport default component$(() => {\n  const users = useGetUsers();\n  return (\n    <section>\n      <h1>User's directory</h1>\n      <ul>\n        {users.value.map((user) => (\n          <li key={user.id}>\n            <a href={`/users/${user.id}`}>\n              {user.name} ({user.email})\n            </a>\n          </li>\n        ))}\n      </ul>\n    </section>\n  );\n});\n"
  },
  {
    "path": "starters/features/react/package.json",
    "content": "{\n  \"description\": \"Use React components into your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Framework: React\",\n    \"priority\": -20,\n    \"docs\": [\n      \"https://qwik.dev/integrations/react/\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"New folders created!\",\n      \"lines\": [\n        \" - /src/routes/react: New public route showcasing react integration\",\n        \" - /src/integrations/react: Here's where the react component lives\"\n      ]\n    },\n    \"viteConfig\": {\n      \"imports\": [\n        {\n          \"namedImports\": [\n            \"qwikReact\"\n          ],\n          \"importPath\": \"@builder.io/qwik-react/vite\"\n        }\n      ],\n      \"vitePlugins\": [\n        \"qwikReact()\"\n      ]\n    }\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik-react\": \"0.5.0\",\n    \"@emotion/react\": \"^11.11.1\",\n    \"@emotion/styled\": \"^11.11.0\",\n    \"@mui/material\": \"^5.13.0\",\n    \"@mui/x-data-grid\": \"^6.4.0\",\n    \"@types/react\": \"^18.2.28\",\n    \"@types/react-dom\": \"^18.2.13\",\n    \"react\": \"18.2.0\",\n    \"react-dom\": \"18.2.0\"\n  }\n}\n"
  },
  {
    "path": "starters/features/react/src/integrations/react/mui.tsx",
    "content": "/** @jsxImportSource react */\n\nimport { qwikify$ } from \"@builder.io/qwik-react\";\nimport { Button, Slider } from \"@mui/material\";\nimport { DataGrid, GridColDef, GridValueGetterParams } from \"@mui/x-data-grid\";\n\nexport const MUIButton = qwikify$(Button);\nexport const MUISlider = qwikify$(Slider, { eagerness: \"hover\" });\n\nexport const TableApp = qwikify$(() => {\n  const columns: GridColDef[] = [\n    { field: \"id\", headerName: \"ID\", width: 70 },\n    { field: \"firstName\", headerName: \"First name\", width: 130 },\n    { field: \"lastName\", headerName: \"Last name\", width: 130 },\n    {\n      field: \"age\",\n      headerName: \"Age\",\n      type: \"number\",\n      width: 90,\n    },\n    {\n      field: \"fullName\",\n      headerName: \"Full name\",\n      description: \"This column has a value getter and is not sortable.\",\n      sortable: false,\n      width: 160,\n      valueGetter: (params: GridValueGetterParams) =>\n        `${params.row.firstName || \"\"} ${params.row.lastName || \"\"}`,\n    },\n  ];\n\n  const rows = [\n    { id: 1, lastName: \"Snow\", firstName: \"Jon\", age: 35 },\n    { id: 2, lastName: \"Lannister\", firstName: \"Cersei\", age: 42 },\n    { id: 3, lastName: \"Lannister\", firstName: \"Jaime\", age: 45 },\n    { id: 4, lastName: \"Stark\", firstName: \"Arya\", age: 16 },\n    { id: 5, lastName: \"Targaryen\", firstName: \"Daenerys\", age: null },\n    { id: 6, lastName: \"Melisandre\", firstName: null, age: 150 },\n    { id: 7, lastName: \"Clifford\", firstName: \"Ferrara\", age: 44 },\n    { id: 8, lastName: \"Frances\", firstName: \"Rossini\", age: 36 },\n    { id: 9, lastName: \"Roxie\", firstName: \"Harvey\", age: 65 },\n  ];\n\n  return (\n    <>\n      <h1>Hello from React</h1>\n\n      <div style={{ height: 400, width: \"100%\" }}>\n        <DataGrid\n          rows={rows}\n          columns={columns}\n          pageSize={5}\n          rowsPerPageOptions={[5]}\n          checkboxSelection\n          disableSelectionOnClick\n        />\n      </div>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/features/react/src/routes/react/index.tsx",
    "content": "import { component$, useSignal } from \"@builder.io/qwik\";\nimport type { DocumentHead } from \"@builder.io/qwik-city\";\nimport { MUIButton, MUISlider, TableApp } from \"~/integrations/react/mui\";\n\nexport default component$(() => {\n  const show = useSignal(false);\n  const count = useSignal(0);\n  const variant = useSignal<\"contained\" | \"outlined\" | \"text\">(\"contained\");\n\n  return (\n    <>\n      <h1>Qwik/React mother of all demos</h1>\n      <select\n        value={variant.value}\n        onChange$={(ev) => {\n          variant.value = (ev.target as any).value;\n        }}\n      >\n        <option>text</option>\n        <option>outlined</option>\n        <option selected>contained</option>\n      </select>\n\n      <MUISlider\n        value={count.value}\n        onChange$={(_, value) => {\n          count.value = value as number;\n        }}\n      />\n\n      <MUIButton variant={variant.value} host:onClick$={() => alert(\"click\")}>\n        Slider is {count.value}\n      </MUIButton>\n\n      <button onClick$={() => (show.value = true)}>Show table</button>\n      {show.value && (\n        <TableApp client:visible>Slider is {count.value}</TableApp>\n      )}\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Qwik React\",\n};\n"
  },
  {
    "path": "starters/features/service-worker/package.json",
    "content": "{\n  \"description\": \"Add a service worker to your app\",\n  \"__qwik__\": {\n    \"displayName\": \"Feature: Service Worker\",\n    \"priority\": 10,\n    \"docs\": [],\n    \"nextSteps\": {\n      \"lines\": [\n        \"Now, make sure that you have `<ServiceWorkerRegister />` in your `src/root.tsx`. You can import it from `@builder.io/qwik-city`.\"\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "starters/features/service-worker/src/routes/service-worker.ts",
    "content": "/*\n * WHAT IS THIS FILE?\n *\n * Any file called \"service-worker\" is automatically bundled and registered with Qwik Router, as long as you add `<RegisterServiceWorker />` in your `root.tsx`.\n *\n * Here you register the events that your service worker will handle.\n *\n * MDN has documentation at https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\n */\nexport declare const self: ServiceWorkerGlobalScope;\n\naddEventListener(\"install\", () => self.skipWaiting());\n\naddEventListener(\"activate\", () => self.clients.claim());\n"
  },
  {
    "path": "starters/features/storybook/.storybook/main.ts",
    "content": "import { StorybookConfig } from \"storybook-framework-qwik\";\n\nconst config: StorybookConfig = {\n  addons: [\"@storybook/addon-links\", \"@storybook/addon-essentials\"],\n  framework: {\n    name: \"storybook-framework-qwik\",\n  },\n  core: {\n    renderer: \"storybook-framework-qwik\",\n  },\n  stories: [\n    // ...rootMain.stories,\n    \"../src/components/**/*.stories.mdx\",\n    \"../src/components/**/*.stories.@(js|jsx|ts|tsx)\",\n  ],\n\n  viteFinal: async (config: any) => {\n    return config;\n  },\n};\n\nexport default config;\n"
  },
  {
    "path": "starters/features/storybook/.storybook/preview-head.html",
    "content": "<script>\n  window.global = window;\n</script>\n"
  },
  {
    "path": "starters/features/storybook/.storybook/preview.tsx",
    "content": "import { Parameters } from \"storybook-framework-qwik\";\n\nimport \"../src/global.css\";\n\nexport const parameters: Parameters = {\n  a11y: {\n    config: {},\n    options: {\n      checks: { \"color-contrast\": { options: { noScroll: true } } },\n      restoreScroll: true,\n    },\n  },\n  options: {\n    showRoots: true,\n  },\n  docs: {\n    iframeHeight: \"200px\",\n  },\n};\n"
  },
  {
    "path": "starters/features/storybook/.storybook/tsconfig.json",
    "content": "{\n  \"extends\": \"../tsconfig.json\",\n  \"compilerOptions\": {\n    \"experimentalDecorators\": true,\n    \"emitDecoratorMetadata\": true\n  },\n\n  \"exclude\": [\n    \"../**/*.spec.ts\",\n    \"../**/*.test.ts\",\n    \"../**/*.spec.tsx\",\n    \"../**/*.test.tsx\"\n  ],\n  \"include\": [\n    \"../src/**/*.stories.ts\",\n    \"../src/**/*.stories.js\",\n    \"../src/**/*.stories.jsx\",\n    \"../src/**/*.stories.tsx\",\n    \"../src/**/*.stories.mdx\",\n    \"*.ts\",\n    \"*.js\",\n    \"preview.tsx\"\n  ]\n}\n"
  },
  {
    "path": "starters/features/storybook/package.json",
    "content": "{\n  \"description\": \"Add Storybook\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Storybook\",\n    \"priority\": -10,\n    \"docs\": [\n      \"https://qwik.dev/integrations/storybook/\",\n      \"https://storybook.js.org/docs/qwik/get-started/why-storybook\"\n    ]\n  },\n  \"devDependencies\": {\n    \"@storybook/addon-essentials\": \"^8.2.8\",\n    \"@storybook/addon-links\": \"^8.2.8\",\n    \"@storybook/blocks\": \"^8.2.8\",\n    \"@storybook/builder-vite\": \"^8.2.8\",\n    \"@storybook/html\": \"^8.2.8\",\n    \"@storybook/html-vite\": \"^8.2.8\",\n    \"storybook\": \"^8.2.8\",\n    \"storybook-framework-qwik\": \"^0.4.0\"\n  },\n  \"scripts\": {\n    \"build-storybook\": \"storybook build\",\n    \"storybook\": \"storybook dev -p 6006\"\n  }\n}\n"
  },
  {
    "path": "starters/features/storybook/src/components/button/button.stories.tsx",
    "content": "import type { Meta, StoryObj } from \"storybook-framework-qwik\";\nimport { Button, type ButtonProps } from \"./button\";\n\nconst meta: Meta<ButtonProps> = {\n  component: Button,\n};\n\ntype Story = StoryObj<ButtonProps>;\n\nexport default meta;\n\nexport const Primary: Story = {\n  args: {\n    size: \"medium\",\n  },\n  render: (props) => <Button {...props}>Some button</Button>,\n};\n"
  },
  {
    "path": "starters/features/storybook/src/components/button/button.tsx",
    "content": "import { component$, useStylesScoped$, Slot } from \"@builder.io/qwik\";\n\nexport interface ButtonProps {\n  size?: \"small\" | \"medium\" | \"large\";\n}\nexport const Button = component$<ButtonProps>(({ size = \"medium\" }) => {\n  useStylesScoped$(`\n    .size-small {\n      font-size: 10px;\n    }\n    .size-medium {\n      font-size: 14px;\n    }\n    .size-large {\n      font-size: 18px;\n    }\n  `);\n  return (\n    <button\n      class={{\n        [`size-${size}`]: true,\n      }}\n    >\n      <Slot></Slot>\n    </button>\n  );\n});\n"
  },
  {
    "path": "starters/features/styled-vanilla-extract/package.json",
    "content": "{\n  \"description\": \"Zero-cost CSS-in-JS for Qwik\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Styled-Vanilla-Extract (styling)\",\n    \"priority\": -10,\n    \"viteConfig\": {\n      \"imports\": [\n        {\n          \"namedImports\": [\n            \"vanillaExtractPlugin\"\n          ],\n          \"importPath\": \"@vanilla-extract/vite-plugin\"\n        }\n      ],\n      \"vitePlugins\": [\n        \"vanillaExtractPlugin()\"\n      ]\n    },\n    \"docs\": [\n      \"https://qwik.dev/docs/integrations/styled-vanilla-extract/\",\n      \"https://github.com/wmertens/styled-vanilla-extract/blob/main/README.md\",\n      \"https://vanilla-extract.style/\"\n    ]\n  },\n  \"devDependencies\": {\n    \"@vanilla-extract/css\": \"^1.12.0\",\n    \"styled-vanilla-extract\": \"^0.5.4\",\n    \"@vanilla-extract/vite-plugin\": \"^5.0.1\"\n  }\n}\n"
  },
  {
    "path": "starters/features/styled-vanilla-extract/src/routes/styled-flower/flower.css.ts",
    "content": "import { style, styled } from \"styled-vanilla-extract/qwik\";\n\nexport const header = style({});\n\nexport const pride = style({});\n\nexport const odd = style({});\n\nexport const Host = styled.div`\n  display: grid;\n\n  align-items: center;\n  justify-content: center;\n  justify-items: center;\n  /* --rotation: 135deg; */\n  --rotation: 225deg;\n  --size-step: 10px;\n  --odd-color-step: 5;\n  --even-color-step: 5;\n  --center: 12;\n\n  width: 100%;\n  height: 500px;\n\n  contain: strict;\n`;\n\nexport const Range = styled.input`\n  width: 100%;\n`;\n\nexport const Square = styled.div`\n  --size: calc(40px + var(--index) * var(--size-step));\n\n  display: block;\n  width: var(--size);\n  height: var(--size);\n  transform: rotateZ(\n    calc(var(--rotation) * var(--state) * (var(--center) - var(--index)))\n  );\n  transition-property: transform, border-color;\n  transition-duration: 5s;\n  transition-timing-function: ease-in-out;\n  grid-area: 1 / 1;\n  background: white;\n  border-width: 2px;\n  border-style: solid;\n  border-color: black;\n  box-sizing: border-box;\n  will-change: transform, border-color;\n\n  contain: strict;\n\n  &${odd} {\n    --luminance: calc(\n      1 - calc(calc(var(--index) * var(--odd-color-step)) / 256)\n    );\n    background: rgb(\n      calc(172 * var(--luminance)),\n      calc(127 * var(--luminance)),\n      calc(244 * var(--luminance))\n    );\n  }\n\n  ${pride} &:nth-child(12n + 1) {\n    background: #e70000;\n  }\n  ${pride} &:nth-child(12n + 3) {\n    background: #ff8c00;\n  }\n  ${pride} &:nth-child(12n + 5) {\n    background: #ffef00;\n  }\n  ${pride} &:nth-child(12n + 7) {\n    background: #00811f;\n  }\n  ${pride} &:nth-child(12n + 9) {\n    background: #0044ff;\n  }\n  ${pride} &:nth-child(12n + 11) {\n    background: #760089;\n  }\n`;\n"
  },
  {
    "path": "starters/features/styled-vanilla-extract/src/routes/styled-flower/index.tsx",
    "content": "import {\n  component$,\n  FunctionComponent,\n  useVisibleTask$,\n  useStore,\n} from \"@builder.io/qwik\";\nimport { DocumentHead, useLocation } from \"@builder.io/qwik-city\";\nimport { Host, odd, pride, Range, Square } from \"./flower.css\";\n\ntype StoredInputProps<\n  T,\n  Cmp extends FunctionComponent,\n  Name extends string = \"value\",\n> = Parameters<Cmp>[0] & {\n  store: { [value in Name]?: T };\n  name?: Name;\n};\n\nexport const RangeInput = <Name extends string = \"value\">({\n  store,\n  name = \"value\" as Name,\n  ...props\n}: StoredInputProps<number, typeof Range, Name>) => (\n  <Range\n    {...props}\n    type=\"range\"\n    value={store[name]}\n    onInput$={(ev, el) => {\n      store[name] = el.valueAsNumber;\n    }}\n  />\n);\n\nexport default component$(() => {\n  const loc = useLocation();\n\n  const state = useStore({\n    count: 0,\n    number: 20,\n  });\n\n  useVisibleTask$(({ cleanup }) => {\n    const timeout = setTimeout(() => (state.count = 1), 500);\n    cleanup(() => clearTimeout(timeout));\n\n    const internal = setInterval(() => state.count++, 7000);\n    cleanup(() => clearInterval(internal));\n  });\n\n  return (\n    <>\n      <p>This is styled with qwik-styled-ve.</p>\n\n      <RangeInput store={state} name=\"number\" max={50} />\n      <Host\n        style={{\n          \"--state\": `${state.count * 0.1}`,\n        }}\n        class={loc.url.searchParams.get(\"pride\") && pride}\n      >\n        {Array.from({ length: state.number }, (_, i) => (\n          <Square\n            key={i}\n            class={{ [odd]: i % 2 === 0 }}\n            style={{ \"--index\": `${i + 1}` }}\n          />\n        )).reverse()}\n      </Host>\n    </>\n  );\n});\n\nexport const head: DocumentHead = {\n  title: \"Qwik Flower\",\n};\n"
  },
  {
    "path": "starters/features/tailwind/package.json",
    "content": "{\n  \"description\": \"Use Tailwind v4 in your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Tailwind v4 (styling)\",\n    \"priority\": -10,\n    \"viteConfig\": {\n      \"imports\": [\n        {\n          \"defaultImport\": \"tailwindcss\",\n          \"importPath\": \"@tailwindcss/vite\"\n        }\n      ],\n      \"vitePlugins\": [\n        \"tailwindcss()\"\n      ]\n    },\n    \"docs\": [\n      \"https://qwik.dev/integrations/tailwind/\",\n      \"https://tailwindcss.com/docs/utility-first\"\n    ]\n  },\n  \"devDependencies\": {\n    \"prettier-plugin-tailwindcss\": \"^0.6.11\",\n    \"tailwindcss\": \"^4.1.4\",\n    \"@tailwindcss/vite\": \"^4.1.4\"\n  },\n  \"type\": \"module\"\n}\n"
  },
  {
    "path": "starters/features/tailwind/prettier.config.js",
    "content": "/**\n * @see https://prettier.io/docs/configuration\n * @type {import(\"prettier\").Config}\n */\n\nconst config = {\n  plugins: [\"prettier-plugin-tailwindcss\"],\n};\n\nexport default config;\n"
  },
  {
    "path": "starters/features/tailwind/src/global.css",
    "content": "@import \"tailwindcss\";\n"
  },
  {
    "path": "starters/features/tailwind-v3/.vscode/settings.json",
    "content": "{\n  \"css.lint.unknownAtRules\": \"ignore\"\n}\n"
  },
  {
    "path": "starters/features/tailwind-v3/package.json",
    "content": "{\n  \"description\": \"Use Tailwind v3 in your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Tailwind v3 (styling)\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://qwik.dev/integrations/integration/tailwind/\",\n      \"https://tailwindcss.com/docs/utility-first\"\n    ],\n    \"alwaysInRoot\": [\n      \".vscode\"\n    ]\n  },\n  \"devDependencies\": {\n    \"autoprefixer\": \"^10.4.19\",\n    \"postcss\": \"^8.4.39\",\n    \"prettier-plugin-tailwindcss\": \"^0.6.11\",\n    \"tailwindcss\": \"^3.4.17\"\n  }\n}\n"
  },
  {
    "path": "starters/features/tailwind-v3/postcss.config.cjs",
    "content": "module.exports = {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n};\n"
  },
  {
    "path": "starters/features/tailwind-v3/prettier.config.js",
    "content": "/**\n * @see https://prettier.io/docs/configuration\n * @type {import(\"prettier\").Config}\n */\n\nconst config = {\n  plugins: [\"prettier-plugin-tailwindcss\"],\n};\n\nexport default config;\n"
  },
  {
    "path": "starters/features/tailwind-v3/src/global.css",
    "content": "/**\n * Tailwind CSS imports\n * View the full documentation at https://tailwindcss.com\n */\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"
  },
  {
    "path": "starters/features/tailwind-v3/tailwind.config.js",
    "content": "/** @type {import('tailwindcss').Config} */\nexport default {\n  content: [\"./src/**/*.{js,ts,jsx,tsx,mdx}\"],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n};\n"
  },
  {
    "path": "starters/features/turso/package.json",
    "content": "{\n  \"description\": \"Use Turso in your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Turso (database)\",\n    \"priority\": -10,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://qwik.dev/integrations/turso/\",\n      \"https://docs.turso.tech\"\n    ],\n    \"nextSteps\": {\n      \"title\": \"Create and set up your turso database\",\n      \"lines\": [\n        \" Install the Turso CLI (https://docs.turso.tech/quickstart)\",\n        \" You can then create a new Turso database by running:\",\n        \"   turso db create <db-name>\",\n        \" To see information about the database, including a connection URL, run:\",\n        \"   turso db show <db-name>\",\n        \" To get an authentication token for the database, run:\",\n        \"   turso db tokens create <db-name>\"\n      ]\n    },\n    \"alwaysInRoot\": [\n      \".env.local\"\n    ]\n  },\n  \"dependencies\": {\n    \"@libsql/client\": \"latest\"\n  },\n  \"devDependencies\": {\n    \"@builder.io/qwik-city\": \"latest\"\n  }\n}\n"
  },
  {
    "path": "starters/features/turso/src/utils/turso.ts",
    "content": "import type { RequestEventBase } from \"@builder.io/qwik-city\";\nimport { createClient, type Client } from \"@libsql/client\";\n\nexport function tursoClient(requestEvent: RequestEventBase): Client {\n  const url = requestEvent.env.get(\"PRIVATE_TURSO_DATABASE_URL\")?.trim();\n  if (url === undefined) {\n    throw new Error(\"PRIVATE_TURSO_DATABASE_URL is not defined\");\n  }\n\n  const authToken = requestEvent.env.get(\"PRIVATE_TURSO_AUTH_TOKEN\")?.trim();\n  if (authToken === undefined) {\n    if (!url.includes(\"file:\")) {\n      throw new Error(\"PRIVATE_TURSO_AUTH_TOKEN is not defined\");\n    }\n  }\n\n  return createClient({\n    url,\n    authToken,\n  });\n}\n"
  },
  {
    "path": "starters/features/vitest/package.json",
    "content": "{\n  \"description\": \"Use Vitest into your Qwik app\",\n  \"__qwik__\": {\n    \"displayName\": \"Integration: Vitest (Unit Test)\",\n    \"priority\": -15,\n    \"viteConfig\": {},\n    \"docs\": [\n      \"https://vitest.dev/guide/\",\n      \"https://qwik.dev/integrations/vitest/\"\n    ]\n  },\n  \"devDependencies\": {\n    \"@vitest/ui\": \"^0.34.6\",\n    \"vitest\": \"^0.34.6\"\n  },\n  \"scripts\": {\n    \"test.unit\": \"vitest components\",\n    \"test.unit.ui\": \"vitest --ui components\"\n  }\n}\n"
  },
  {
    "path": "starters/features/vitest/src/components/example/example.spec.tsx",
    "content": "import { createDOM } from \"@builder.io/qwik/testing\";\nimport { test, expect } from \"vitest\";\nimport { ExampleTest } from \"./example\";\n\ntest(`[ExampleTest Component]: Should render ⭐`, async () => {\n  const { screen, render } = await createDOM();\n  await render(<ExampleTest flag={true} />);\n  expect(screen.outerHTML).toContain(\"⭐\");\n  const div = screen.querySelector(\".icon\") as HTMLElement;\n  expect(div.outerHTML).toContain(\"⭐\");\n});\n\ntest(`[ExampleTest Component]: Should render 💣`, async () => {\n  const { screen, render } = await createDOM();\n  await render(<ExampleTest flag={false} />);\n  expect(screen.outerHTML).toContain(\"💣\");\n});\n\ntest(`[ExampleTest Component]: Click counter +1`, async () => {\n  const { screen, render, userEvent } = await createDOM();\n  await render(<ExampleTest flag={true} />);\n\n  expect(screen.outerHTML).toContain(\"Count:0\");\n\n  const spanBefore = screen.querySelector(\"span\") as HTMLDivElement;\n  await userEvent(\".btn-counter\", \"click\");\n  expect(spanBefore.innerHTML).toEqual(\"Count:1\");\n\n  const spanAfter = screen.querySelector(\"span\") as HTMLDivElement;\n  await userEvent(\"button\", \"click\");\n  expect(spanAfter.innerHTML).toEqual(\"Count:2\");\n});\n"
  },
  {
    "path": "starters/features/vitest/src/components/example/example.tsx",
    "content": "import { component$, useStore } from \"@builder.io/qwik\";\n\nexport const ExampleTest = component$((props: { flag: boolean }) => {\n  const state = useStore({\n    counter: 0,\n  });\n\n  return (\n    <>\n      <span>Count:{state.counter}</span>\n      <div class=\"icon\">Flag: {props.flag ? \"⭐\" : \"💣\"}</div>\n      <button class=\"btn-counter\" onClick$={() => state.counter++}>\n        Increment counter\n      </button>\n    </>\n  );\n});\n"
  },
  {
    "path": "starters/playwright.config.ts",
    "content": "import { expect } from \"@playwright/test\";\nimport type { Locator, PlaywrightTestConfig } from \"@playwright/test\";\n\nconst inGithubCI = !!process.env.GITHUB_ACTIONS;\n\nexpect.extend({\n  async hasAttribute(recieved: Locator, attribute: string) {\n    const pass = await recieved.evaluate((node, attribute) => {\n      return node.getAttribute(attribute);\n    }, attribute);\n\n    return {\n      message: () =>\n        `expected ${recieved} to have attribute \\`${attribute}\\` (${pass})`,\n      pass: pass !== null,\n    };\n  },\n});\n\nconst config: PlaywrightTestConfig = {\n  use: {\n    launchOptions: {\n      slowMo: 100,\n    },\n    viewport: {\n      width: 520,\n      height: 600,\n    },\n  },\n  /* Fail the build on CI if you accidentally left test.only in the source code. */\n  forbidOnly: !!process.env.CI,\n  testIgnore: /.*example.spec.tsx?$/,\n  retries: 0,\n  // retries: inGithubCI ? 0 : 1,\n  expect: { timeout: inGithubCI ? 120000 : 3000 },\n  webServer: {\n    command:\n      \"pnpm node --require ./scripts/runBefore.ts starters/dev-server.ts 3301\",\n    port: 3301,\n    reuseExistingServer: !process.env.CI,\n  },\n};\n\nexport default config;\n"
  },
  {
    "path": "starters/templates/barrel/component/index.tsx.template",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport interface [name]Props {\n\n}\n\nexport const [name] = component$<[name]Props>((props) => {\n  return (\n    <div>\n      [name] component works!\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/templates/barrel/markdown/index.md.template",
    "content": "---\ntitle: New Route\n---\n\nNew route works.\n"
  },
  {
    "path": "starters/templates/barrel/mdx/index.mdx.template",
    "content": "---\ntitle: New Route\n---\n\nNew route works.\n"
  },
  {
    "path": "starters/templates/barrel/route/index.tsx.template",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <div>\n      New route works.\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/templates/qwik/component/[slug].tsx.template",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport interface [name]Props {\n\n}\n\nexport const [name] = component$<[name]Props>((props) => {\n  return (\n    <div>\n      [name] component works!\n    </div>\n  );\n});\n"
  },
  {
    "path": "starters/templates/qwik/markdown/index.md.template",
    "content": "---\ntitle: New Route\n---\n\nNew route works.\n"
  },
  {
    "path": "starters/templates/qwik/mdx/index.mdx.template",
    "content": "---\ntitle: New Route\n---\n\nNew route works.\n"
  },
  {
    "path": "starters/templates/qwik/route/index.tsx.template",
    "content": "import { component$ } from '@builder.io/qwik';\n\nexport default component$(() => {\n  return (\n    <div>\n      New route works.\n    </div>\n  );\n});\n"
  },
  {
    "path": "syncpack-release-conf.json",
    "content": "{\n  \"versionGroups\": [\n    {\n      \"label\": \"Require minimums\",\n      \"dependencyTypes\": [\"prod\", \"peer\"],\n      \"range\": \"^\"\n    }\n  ],\n  \"semverGroups\": [\n    {\n      \"label\": \"Playwright should have the same version as in flake.nix\",\n      \"dependencies\": [\"@playwright/test\"],\n      \"pinVersion\": \"1.47.0\"\n    },\n    {\n      \"label\": \"Undici should always be * until we remove it\",\n      \"dependencies\": [\"undici\"],\n      \"range\": \"*\"\n    },\n    {\n      \"label\": \"use exact version numbers for devDependencies\",\n      \"dependencyTypes\": [\"dev\"],\n      \"range\": \"\"\n    }\n  ]\n}\n"
  },
  {
    "path": "tsconfig-docs.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"include\": [\"packages/docs\"],\n  \"exclude\": [\"packages/docs/dist\"]\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"incremental\": true,\n    \"target\": \"ESNext\",\n    \"module\": \"ESNext\",\n    \"lib\": [\"es2021\", \"DOM\", \"webworker\", \"DOM.Iterable\"],\n    \"resolveJsonModule\": true,\n    \"jsx\": \"react-jsx\",\n    \"allowArbitraryExtensions\": true,\n    \"jsxImportSource\": \"@builder.io/qwik\",\n    \"declaration\": true,\n    \"outDir\": \"./dist-dev/tsc-out\",\n    \"declarationDir\": \"./dist-dev/dts-out\",\n    \"strict\": true,\n    \"verbatimModuleSyntax\": true,\n    \"moduleResolution\": \"Bundler\",\n    \"baseUrl\": \".\",\n    \"assumeChangesOnlyAffectDirectDependencies\": true,\n    \"noUnusedLocals\": true,\n    \"paths\": {\n      \"@qwik-client-manifest\": [\"packages/qwik/dist/server-modules.d.ts\"],\n      \"@qwik-city-plan\": [\"packages/qwik-city/src/runtime/src/qwik-city-plan.ts\"],\n      \"@qwik-city-sw-register-build\": [\n        \"packages/qwik-city/src/buildtime/runtime-generation/sw-register-build.ts\"\n      ],\n      \"@qwik-city-sw-register\": [\"packages/qwik-city/src/runtime/src/sw-register-runtime.ts\"],\n      \"@qwik-city-not-found-paths\": [\n        \"packages/qwik-city/src/middleware/request-handler/generated/not-found-paths.ts\"\n      ],\n      \"@qwik-city-static-paths\": [\n        \"packages/qwik-city/src/middleware/request-handler/generated/static-paths.ts\"\n      ]\n    },\n    \"types\": [\"node\", \"vite/client\"],\n    \"esModuleInterop\": true,\n    \"sourceRoot\": \".\",\n    \"inlineSourceMap\": true,\n    \"inlineSources\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"rootDir\": \".\"\n  },\n  \"include\": [\n    \"packages/create-qwik\",\n    \"packages/qwik-auth\",\n    \"packages/qwik-worker\",\n    \"packages/supabase-auth-helpers-qwik\",\n    \"packages/qwik-react/src\",\n    \"starters/apps/sandbox\",\n    \"starters/apps/todo-test\",\n    \"starters/apps/e2e\",\n    \"starters/apps/qwikcity-test/**/*\",\n    \"starters/apps/qwikcity-test.prod/**/*\",\n    \"packages/qwik-react/vite\",\n    \"@types/deno.d.ts\",\n    \"@types/bun.d.ts\",\n    \"types.d.ts\"\n  ],\n  \"exclude\": [\n    \"packages/create-qwik/dist\",\n    \"packages/qwik/src\",\n    \"packages/*/lib\",\n    \"scripts\",\n    \"starters/dev-server.ts\"\n  ]\n}\n"
  },
  {
    "path": "tsconfig.scripts.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"noEmit\": true,\n    \"allowImportingTsExtensions\": true,\n    \"outDir\": null,\n    \"declarationDir\": null,\n    \"declaration\": false\n  },\n  \"include\": [\"scripts\", \"starters/dev-server.ts\"],\n  \"exclude\": []\n}\n"
  },
  {
    "path": "types.d.ts",
    "content": "declare module '*?jsx' {\n  const Cmp: import('./packages/qwik/').FunctionComponent<\n    Omit<\n      import('./packages/qwik/').QwikIntrinsicElements['img'],\n      'src' | 'width' | 'height' | 'srcSet'\n    >\n  >;\n  export default Cmp;\n  export const width: number;\n  export const height: number;\n  export const srcSet: string;\n}\n"
  },
  {
    "path": "vitest-setup.ts",
    "content": "import { beforeAll } from 'vitest';\n\n// This has to run before qdev.ts loads. `beforeAll` is too late\nglobalThis.qTest = true;\nglobalThis.qRuntimeQrl = true;\nglobalThis.qDev = true;\nglobalThis.qInspector = false;\n\nbeforeAll(async () => {\n  const { getTestPlatform } = await import('./packages/qwik/src/testing/platform');\n  const { setPlatform } = await import('./packages/qwik/src/core/platform/platform');\n  setPlatform(getTestPlatform() as any);\n});\n"
  },
  {
    "path": "vitest.config.ts",
    "content": "import { defineConfig } from 'vitest/config';\nimport tsconfigPaths from 'vite-tsconfig-paths';\n\nexport default defineConfig({\n  plugins: [tsconfigPaths({ ignoreConfigErrors: true })],\n  test: {\n    include: [\n      'packages/**/*.unit.?(c|m)[jt]s?(x)',\n      // Rust build cache\n      '!packages/qwik/**/target',\n      '!packages/qwik/dist',\n      '!packages/*/lib',\n      '!starters',\n      '!**/node_modules',\n      '!dist-dev',\n    ],\n    setupFiles: ['./vitest-setup.ts'],\n  },\n});\n"
  },
  {
    "path": "vitest.workspace.js",
    "content": "import { defineWorkspace } from 'vitest/config';\n\n// needed by the vscode vitest integration but it also speeds up vitest cli\nexport default defineWorkspace(['./vitest.config.ts']);\n"
  }
]